diff --git a/frontend-dist/JuliaMono-Bold.68f7f035.woff2 b/frontend-dist/JuliaMono-Bold.68f7f035.woff2 new file mode 100644 index 0000000000..7cb28c7db1 Binary files /dev/null and b/frontend-dist/JuliaMono-Bold.68f7f035.woff2 differ diff --git a/frontend-dist/JuliaMono-BoldLatin.a78b1eda.woff2 b/frontend-dist/JuliaMono-BoldLatin.a78b1eda.woff2 new file mode 100644 index 0000000000..3ce0143c23 Binary files /dev/null and b/frontend-dist/JuliaMono-BoldLatin.a78b1eda.woff2 differ diff --git a/frontend-dist/JuliaMono-Regular.de4da299.woff2 b/frontend-dist/JuliaMono-Regular.de4da299.woff2 new file mode 100644 index 0000000000..e24039dda8 Binary files /dev/null and b/frontend-dist/JuliaMono-Regular.de4da299.woff2 differ diff --git a/frontend-dist/JuliaMono-RegularItalic.963ec4f3.woff2 b/frontend-dist/JuliaMono-RegularItalic.963ec4f3.woff2 new file mode 100644 index 0000000000..3ef6f2865b Binary files /dev/null and b/frontend-dist/JuliaMono-RegularItalic.963ec4f3.woff2 differ diff --git a/frontend-dist/JuliaMono-RegularLatin.d51844a8.woff2 b/frontend-dist/JuliaMono-RegularLatin.d51844a8.woff2 new file mode 100644 index 0000000000..f334d875b3 Binary files /dev/null and b/frontend-dist/JuliaMono-RegularLatin.d51844a8.woff2 differ diff --git a/frontend-dist/Vollkorn-Black.0ebdfbf5.woff2 b/frontend-dist/Vollkorn-Black.0ebdfbf5.woff2 new file mode 100644 index 0000000000..b51a37a406 Binary files /dev/null and b/frontend-dist/Vollkorn-Black.0ebdfbf5.woff2 differ diff --git a/frontend-dist/Vollkorn-BlackItalic.4095acfe.woff2 b/frontend-dist/Vollkorn-BlackItalic.4095acfe.woff2 new file mode 100644 index 0000000000..bb2e060ce4 Binary files /dev/null and b/frontend-dist/Vollkorn-BlackItalic.4095acfe.woff2 differ diff --git a/frontend-dist/Vollkorn-Bold.6e1feb70.woff2 b/frontend-dist/Vollkorn-Bold.6e1feb70.woff2 new file mode 100644 index 0000000000..cfb12e1520 Binary files /dev/null and b/frontend-dist/Vollkorn-Bold.6e1feb70.woff2 differ diff --git a/frontend-dist/Vollkorn-BoldItalic.a48ab300.woff2 b/frontend-dist/Vollkorn-BoldItalic.a48ab300.woff2 new file mode 100644 index 0000000000..23d7a6c844 Binary files /dev/null and b/frontend-dist/Vollkorn-BoldItalic.a48ab300.woff2 differ diff --git a/frontend-dist/Vollkorn-SemiBold.8072eb6c.woff2 b/frontend-dist/Vollkorn-SemiBold.8072eb6c.woff2 new file mode 100644 index 0000000000..78b781055b Binary files /dev/null and b/frontend-dist/Vollkorn-SemiBold.8072eb6c.woff2 differ diff --git a/frontend-dist/Vollkorn-SemiBoldItalic.5c3cd265.woff2 b/frontend-dist/Vollkorn-SemiBoldItalic.5c3cd265.woff2 new file mode 100644 index 0000000000..2162ab8ef4 Binary files /dev/null and b/frontend-dist/Vollkorn-SemiBoldItalic.5c3cd265.woff2 differ diff --git a/frontend-dist/add-outline.e3c93c35.svg b/frontend-dist/add-outline.e3c93c35.svg new file mode 100644 index 0000000000..7c7fb14877 --- /dev/null +++ b/frontend-dist/add-outline.e3c93c35.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/alegreya-sans-all-400-italic.f87bfe89.woff b/frontend-dist/alegreya-sans-all-400-italic.f87bfe89.woff new file mode 100644 index 0000000000..75ef6a5671 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-400-italic.f87bfe89.woff differ diff --git a/frontend-dist/alegreya-sans-all-400-normal.a91dc265.woff b/frontend-dist/alegreya-sans-all-400-normal.a91dc265.woff new file mode 100644 index 0000000000..0658fd17cc Binary files /dev/null and b/frontend-dist/alegreya-sans-all-400-normal.a91dc265.woff differ diff --git a/frontend-dist/alegreya-sans-all-500-italic.8917c3da.woff b/frontend-dist/alegreya-sans-all-500-italic.8917c3da.woff new file mode 100644 index 0000000000..02b7436cd3 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-500-italic.8917c3da.woff differ diff --git a/frontend-dist/alegreya-sans-all-500-normal.5db27a5b.woff b/frontend-dist/alegreya-sans-all-500-normal.5db27a5b.woff new file mode 100644 index 0000000000..4a6b7ff755 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-500-normal.5db27a5b.woff differ diff --git a/frontend-dist/alegreya-sans-all-700-italic.a6d70e05.woff b/frontend-dist/alegreya-sans-all-700-italic.a6d70e05.woff new file mode 100644 index 0000000000..5118953a73 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-700-italic.a6d70e05.woff differ diff --git a/frontend-dist/alegreya-sans-all-700-normal.29d7dfa9.woff b/frontend-dist/alegreya-sans-all-700-normal.29d7dfa9.woff new file mode 100644 index 0000000000..b8c1d8a284 Binary files /dev/null and b/frontend-dist/alegreya-sans-all-700-normal.29d7dfa9.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-400-italic.8c81649c.woff2 b/frontend-dist/alegreya-sans-cyrillic-400-italic.8c81649c.woff2 new file mode 100644 index 0000000000..3ebce2cffa Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-400-italic.8c81649c.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2 b/frontend-dist/alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2 new file mode 100644 index 0000000000..3434d6ed9e Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-500-italic.a40f95be.woff2 b/frontend-dist/alegreya-sans-cyrillic-500-italic.a40f95be.woff2 new file mode 100644 index 0000000000..7338c02062 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-500-italic.a40f95be.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-500-normal.8a029e9d.woff2 b/frontend-dist/alegreya-sans-cyrillic-500-normal.8a029e9d.woff2 new file mode 100644 index 0000000000..c3c821ba91 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-500-normal.8a029e9d.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2 b/frontend-dist/alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2 new file mode 100644 index 0000000000..ad187b0b86 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2 b/frontend-dist/alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2 new file mode 100644 index 0000000000..dafc6f88c2 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2 new file mode 100644 index 0000000000..4ead31cd71 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2 new file mode 100644 index 0000000000..f81ae10995 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2 new file mode 100644 index 0000000000..387eb05d64 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2 new file mode 100644 index 0000000000..5f05b9e7d0 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2 new file mode 100644 index 0000000000..ae9dc86ec0 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2 new file mode 100644 index 0000000000..43b5ba1286 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-400-italic.1b909c63.woff2 b/frontend-dist/alegreya-sans-greek-400-italic.1b909c63.woff2 new file mode 100644 index 0000000000..c1cebd7a3f Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-400-italic.1b909c63.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-400-normal.4e5a8597.woff2 b/frontend-dist/alegreya-sans-greek-400-normal.4e5a8597.woff2 new file mode 100644 index 0000000000..19ba95016c Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-400-normal.4e5a8597.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-500-italic.19d09eea.woff2 b/frontend-dist/alegreya-sans-greek-500-italic.19d09eea.woff2 new file mode 100644 index 0000000000..5b9906e9c0 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-500-italic.19d09eea.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-500-normal.54a6041f.woff2 b/frontend-dist/alegreya-sans-greek-500-normal.54a6041f.woff2 new file mode 100644 index 0000000000..5cb0e6b5a0 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-500-normal.54a6041f.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-700-italic.5aef27cf.woff2 b/frontend-dist/alegreya-sans-greek-700-italic.5aef27cf.woff2 new file mode 100644 index 0000000000..2a17d2edfa Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-700-italic.5aef27cf.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-700-normal.452fc62e.woff2 b/frontend-dist/alegreya-sans-greek-700-normal.452fc62e.woff2 new file mode 100644 index 0000000000..7415e7b66d Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-700-normal.452fc62e.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-400-italic.550f5118.woff2 b/frontend-dist/alegreya-sans-greek-ext-400-italic.550f5118.woff2 new file mode 100644 index 0000000000..4ddc332622 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-400-italic.550f5118.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-400-normal.b82a0aea.woff2 b/frontend-dist/alegreya-sans-greek-ext-400-normal.b82a0aea.woff2 new file mode 100644 index 0000000000..f85a41731d Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-400-normal.b82a0aea.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-500-italic.8b2e952b.woff2 b/frontend-dist/alegreya-sans-greek-ext-500-italic.8b2e952b.woff2 new file mode 100644 index 0000000000..77cf5e4551 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-500-italic.8b2e952b.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2 b/frontend-dist/alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2 new file mode 100644 index 0000000000..a6681017e2 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2 b/frontend-dist/alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2 new file mode 100644 index 0000000000..ad23a55e70 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2 b/frontend-dist/alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2 new file mode 100644 index 0000000000..49c5654293 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-400-italic.ec56f658.woff2 b/frontend-dist/alegreya-sans-latin-400-italic.ec56f658.woff2 new file mode 100644 index 0000000000..df999c7eb2 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-400-italic.ec56f658.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-400-normal.62b57001.woff2 b/frontend-dist/alegreya-sans-latin-400-normal.62b57001.woff2 new file mode 100644 index 0000000000..5d98f5cde9 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-400-normal.62b57001.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-500-italic.6d8350bf.woff2 b/frontend-dist/alegreya-sans-latin-500-italic.6d8350bf.woff2 new file mode 100644 index 0000000000..7cd291700f Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-500-italic.6d8350bf.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-500-normal.4428c984.woff2 b/frontend-dist/alegreya-sans-latin-500-normal.4428c984.woff2 new file mode 100644 index 0000000000..cf40f1fce9 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-500-normal.4428c984.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-700-italic.abc64c8a.woff2 b/frontend-dist/alegreya-sans-latin-700-italic.abc64c8a.woff2 new file mode 100644 index 0000000000..befb4809c6 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-700-italic.abc64c8a.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-700-normal.96e2fcc9.woff2 b/frontend-dist/alegreya-sans-latin-700-normal.96e2fcc9.woff2 new file mode 100644 index 0000000000..de0826d1b8 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-700-normal.96e2fcc9.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-400-italic.b9ce632b.woff2 b/frontend-dist/alegreya-sans-latin-ext-400-italic.b9ce632b.woff2 new file mode 100644 index 0000000000..c15ce0ec2c Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-400-italic.b9ce632b.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-400-normal.1c1602b0.woff2 b/frontend-dist/alegreya-sans-latin-ext-400-normal.1c1602b0.woff2 new file mode 100644 index 0000000000..cc81c0133c Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-400-normal.1c1602b0.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-500-italic.d15c8f11.woff2 b/frontend-dist/alegreya-sans-latin-ext-500-italic.d15c8f11.woff2 new file mode 100644 index 0000000000..c707422915 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-500-italic.d15c8f11.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-500-normal.637067c1.woff2 b/frontend-dist/alegreya-sans-latin-ext-500-normal.637067c1.woff2 new file mode 100644 index 0000000000..6b61635fa8 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-500-normal.637067c1.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-700-italic.733aea09.woff2 b/frontend-dist/alegreya-sans-latin-ext-700-italic.733aea09.woff2 new file mode 100644 index 0000000000..631822edac Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-700-italic.733aea09.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-700-normal.b5306f41.woff2 b/frontend-dist/alegreya-sans-latin-ext-700-normal.b5306f41.woff2 new file mode 100644 index 0000000000..1896761236 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-700-normal.b5306f41.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-400-italic.d08e8dff.woff2 b/frontend-dist/alegreya-sans-vietnamese-400-italic.d08e8dff.woff2 new file mode 100644 index 0000000000..5552c00e3d Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-400-italic.d08e8dff.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-400-normal.bdc8a622.woff2 b/frontend-dist/alegreya-sans-vietnamese-400-normal.bdc8a622.woff2 new file mode 100644 index 0000000000..3ec2c8eb20 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-400-normal.bdc8a622.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-500-italic.3ff20df8.woff2 b/frontend-dist/alegreya-sans-vietnamese-500-italic.3ff20df8.woff2 new file mode 100644 index 0000000000..528c2f36f7 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-500-italic.3ff20df8.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-500-normal.97e250df.woff2 b/frontend-dist/alegreya-sans-vietnamese-500-normal.97e250df.woff2 new file mode 100644 index 0000000000..7f1f015cb3 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-500-normal.97e250df.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-700-italic.7de0cccc.woff2 b/frontend-dist/alegreya-sans-vietnamese-700-italic.7de0cccc.woff2 new file mode 100644 index 0000000000..8bdb25ba3c Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-700-italic.7de0cccc.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-700-normal.59390763.woff2 b/frontend-dist/alegreya-sans-vietnamese-700-normal.59390763.woff2 new file mode 100644 index 0000000000..bc5e38d57d Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-700-normal.59390763.woff2 differ diff --git a/frontend-dist/arrow-back-outline.9ae1bed8.svg b/frontend-dist/arrow-back-outline.9ae1bed8.svg new file mode 100644 index 0000000000..8fc34ff6ec --- /dev/null +++ b/frontend-dist/arrow-back-outline.9ae1bed8.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/arrow-forward-outline.f5f68f5c.svg b/frontend-dist/arrow-forward-outline.f5f68f5c.svg new file mode 100644 index 0000000000..32a9f4f309 --- /dev/null +++ b/frontend-dist/arrow-forward-outline.f5f68f5c.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/arrow-redo-circle-outline.dfa899f4.svg b/frontend-dist/arrow-redo-circle-outline.dfa899f4.svg new file mode 100644 index 0000000000..d0d9e1124d --- /dev/null +++ b/frontend-dist/arrow-redo-circle-outline.dfa899f4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/arrow-undo-outline.d8c99108.svg b/frontend-dist/arrow-undo-outline.d8c99108.svg new file mode 100644 index 0000000000..a5d529e729 --- /dev/null +++ b/frontend-dist/arrow-undo-outline.d8c99108.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/arrow-up-circle-outline.3f146ffe.svg b/frontend-dist/arrow-up-circle-outline.3f146ffe.svg new file mode 100644 index 0000000000..ba46f260f7 --- /dev/null +++ b/frontend-dist/arrow-up-circle-outline.3f146ffe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/ban-outline.c97da9b4.svg b/frontend-dist/ban-outline.c97da9b4.svg new file mode 100644 index 0000000000..c52ff62277 --- /dev/null +++ b/frontend-dist/ban-outline.c97da9b4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/bandage-outline.37f88b63.svg b/frontend-dist/bandage-outline.37f88b63.svg new file mode 100644 index 0000000000..a9e3764e9f --- /dev/null +++ b/frontend-dist/bandage-outline.37f88b63.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/caret-down-outline.4253a2fe.svg b/frontend-dist/caret-down-outline.4253a2fe.svg new file mode 100644 index 0000000000..c4c15b4722 --- /dev/null +++ b/frontend-dist/caret-down-outline.4253a2fe.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/caret-forward-circle-outline.d0bf2b34.svg b/frontend-dist/caret-forward-circle-outline.d0bf2b34.svg new file mode 100644 index 0000000000..093c8e4ca2 --- /dev/null +++ b/frontend-dist/caret-forward-circle-outline.d0bf2b34.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/caret-forward-outline.348a84b6.svg b/frontend-dist/caret-forward-outline.348a84b6.svg new file mode 100644 index 0000000000..888285c953 --- /dev/null +++ b/frontend-dist/caret-forward-outline.348a84b6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/chatbox-ellipses-outline.4334a3a4.svg b/frontend-dist/chatbox-ellipses-outline.4334a3a4.svg new file mode 100644 index 0000000000..4e04a58545 --- /dev/null +++ b/frontend-dist/chatbox-ellipses-outline.4334a3a4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/checkmark-outline.4fb8c646.svg b/frontend-dist/checkmark-outline.4fb8c646.svg new file mode 100644 index 0000000000..f62dcf9212 --- /dev/null +++ b/frontend-dist/checkmark-outline.4fb8c646.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/chevron-down-outline.1efaf1cc.svg b/frontend-dist/chevron-down-outline.1efaf1cc.svg new file mode 100644 index 0000000000..e7a50cd112 --- /dev/null +++ b/frontend-dist/chevron-down-outline.1efaf1cc.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/chevron-forward-circle-outline.babf2a99.svg b/frontend-dist/chevron-forward-circle-outline.babf2a99.svg new file mode 100644 index 0000000000..9e63a3c049 --- /dev/null +++ b/frontend-dist/chevron-forward-circle-outline.babf2a99.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/close-circle-outline.4baeedb9.svg b/frontend-dist/close-circle-outline.4baeedb9.svg new file mode 100644 index 0000000000..588e2d4c82 --- /dev/null +++ b/frontend-dist/close-circle-outline.4baeedb9.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/close-circle.d0f6eac6.svg b/frontend-dist/close-circle.d0f6eac6.svg new file mode 100644 index 0000000000..cce96081a3 --- /dev/null +++ b/frontend-dist/close-circle.d0f6eac6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/close-outline.9c22a232.svg b/frontend-dist/close-outline.9c22a232.svg new file mode 100644 index 0000000000..17d07818e6 --- /dev/null +++ b/frontend-dist/close-outline.9c22a232.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/cloud-download-outline.8c1ff9bb.svg b/frontend-dist/cloud-download-outline.8c1ff9bb.svg new file mode 100644 index 0000000000..939a8c238e --- /dev/null +++ b/frontend-dist/cloud-download-outline.8c1ff9bb.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/cloud-offline-outline.ac2eade9.svg b/frontend-dist/cloud-offline-outline.ac2eade9.svg new file mode 100644 index 0000000000..426ff3b0d9 --- /dev/null +++ b/frontend-dist/cloud-offline-outline.ac2eade9.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/copy-outline.0f561529.svg b/frontend-dist/copy-outline.0f561529.svg new file mode 100644 index 0000000000..01e29db632 --- /dev/null +++ b/frontend-dist/copy-outline.0f561529.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/document-text-outline.8d1e2333.svg b/frontend-dist/document-text-outline.8d1e2333.svg new file mode 100644 index 0000000000..dacd264f49 --- /dev/null +++ b/frontend-dist/document-text-outline.8d1e2333.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/download-outline.523a74d8.svg b/frontend-dist/download-outline.523a74d8.svg new file mode 100644 index 0000000000..8f0e680543 --- /dev/null +++ b/frontend-dist/download-outline.523a74d8.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/editor.347234ef.css b/frontend-dist/editor.347234ef.css new file mode 100644 index 0000000000..7c7da79db3 --- /dev/null +++ b/frontend-dist/editor.347234ef.css @@ -0,0 +1 @@ +#binder_spinners{display:block;height:100%;opacity:0;overflow:hidden;pointer-events:none;position:absolute;transition:opacity 1s ease-in-out;width:100%}binder-spinner#ring_1{animation-duration:2s;border-top-color:#f5a252;height:300px;margin-left:-150px;margin-top:-150px;width:300px}binder-spinner#ring_2{animation-duration:3s;border-top-color:#579aca;height:380px;margin-left:-190px;margin-top:-190px;width:380px}binder-spinner#ring_3{animation-duration:4s;border-top-color:#e56581;height:460px;margin-left:-230px;margin-top:-230px;width:460px}binder-spinner{animation:spin 4s linear infinite;border:25px solid transparent;border-radius:100%;display:block;left:80vw;position:absolute;top:117px}@keyframes spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.edit_or_run{position:fixed;right:8px;top:9px;z-index:2000}.binder_help_text button{background:#fffdf7;box-shadow:0 0 20px 0 #fff;color:#0000009c;cursor:pointer;display:block;font-family:Roboto Mono;font-size:14px;font-style:italic;letter-spacing:-.2px;padding:7px 20px;white-space:nowrap}body.wiggle_binder .edit_or_run>button{animation:wiggle-binder-button .3s ease-in-out 0s 1}@keyframes wiggle-binder-button{0%{transform:rotate(0deg)}30%{transform:rotate(10deg)}70%{transform:rotate(-10deg)}to{transform:rotate(0deg)}}.binder_help_text button img{color:#000;font-style:normal;font-weight:900;margin:-8px -8px -8px 0}.edit_or_run>button{background:unset;background-color:var(--overlay-button-bg);border:3px solid rgba(92,97,163,.46);border-radius:30px;box-shadow:none;color:var(--black);cursor:pointer;display:block;font-family:Roboto Mono;font-family:var(--lato-ui-font-stack);font-size:16px;letter-spacing:.1px;padding:8px 16px;text-align:center;white-space:nowrap;width:100%;z-index:2000}.edit_or_run>button:hover{text-decoration:underline}.binder_help_text{--width:min(85vw,570px);background-color:#fff;border-radius:8px;box-shadow:0 0 0 100vmax #0000004a;color:#000;color-scheme:light;font-family:var(--lato-ui-font-stack);left:calc(50vw - var(--width)/2);max-height:calc(100vh - 4rem);overflow:auto;padding:16px;position:fixed;top:5rem;width:var(--width)}.binder_help_text a{color:#000}@media (max-width:500px){.binder_help_text{left:0;max-height:100vh;top:0;width:100vw}}.binder_help_text .close{background-image:url(close-outline.9c22a232.svg);background-size:24px 24px;cursor:pointer;height:24px;position:absolute;right:12px;top:12px;width:24px}.copy_div,.download_div{align-items:center;display:flex;height:40px;justify-content:space-between;margin-bottom:.75rem;padding:4px 8px}.binder_help_text button,.copy_div,.download_div{border:3px solid #3f448c5e;border-radius:8px;margin:0 auto;overflow:hidden;width:max(60%,10rem)}.copy_div input,.download_div a{border:none;cursor:text;font-family:Roboto Mono,monospace;font-size:.7rem;line-height:1.4;outline:none;width:calc(100% - 8px - 1rem)}.download_div,.download_div a{cursor:pointer}.copy_icon,.download_icon{background-image:url(copy-outline.0f561529.svg);background-position:50%;background-repeat:no-repeat;background-size:1rem 1rem;box-shadow:0 0 60px 60px #fff;cursor:pointer;height:1.5rem;position:relative;width:1.5rem}.download_icon{background-image:url(download-outline.523a74d8.svg)}.copy_icon.success_copy:after{animation:fadeout 3s;background-color:#dcebf5;content:"Copied!"}.copy_icon.success_copy:after,.copy_icon:not(.success_copy):hover:after{border-radius:.5rem;font-family:JuliaMono,monospace;font-size:.75rem;font-weight:700;line-height:1.5rem;position:absolute;text-align:center;width:4rem}.copy_icon:not(.success_copy):hover:after{background-color:#f4f5dc;content:"Copy"}.copy_icon:after{right:1.5rem}@keyframes fadeout{0%{opacity:1}20%{opacity:1}40%{opacity:0}to{opacity:0}}.command{font-size:1.2rem;font-weight:700;margin-bottom:.75rem}.edit_or_run li{margin-bottom:2rem}.edit_or_run li img,.edit_or_run li video{border:5px solid #d4d4d4;border-radius:5px;width:100%} \ No newline at end of file diff --git a/frontend-dist/editor.3815f7e7.css b/frontend-dist/editor.3815f7e7.css new file mode 100644 index 0000000000..58acdc8acc --- /dev/null +++ b/frontend-dist/editor.3815f7e7.css @@ -0,0 +1 @@ +dialog{background:#fff;border:solid;color:#000;display:block;height:-moz-fit-content;height:-webkit-fit-content;height:fit-content;left:0;margin:auto;padding:1em;position:absolute;right:0;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content}dialog:not([open]){display:none}dialog+.backdrop{background:rgba(0,0,0,.1)}._dialog_overlay,dialog+.backdrop{bottom:0;left:0;position:fixed;right:0;top:0}dialog.fixed{position:fixed;top:50%;transform:translateY(-50%)}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(roboto-mono-cyrillic-ext-500-normal.d362a132.woff2) format("woff2"),url(roboto-mono-all-500-normal.cc559149.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(roboto-mono-cyrillic-500-normal.8ed3add8.woff2) format("woff2"),url(roboto-mono-all-500-normal.cc559149.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(roboto-mono-greek-500-normal.dd57b097.woff2) format("woff2"),url(roboto-mono-all-500-normal.cc559149.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(roboto-mono-vietnamese-500-normal.1320bb60.woff2) format("woff2"),url(roboto-mono-all-500-normal.cc559149.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(roboto-mono-latin-ext-500-normal.415f7d14.woff2) format("woff2"),url(roboto-mono-all-500-normal.cc559149.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:500;src:url(roboto-mono-latin-500-normal.98ad1d4e.woff2) format("woff2"),url(roboto-mono-all-500-normal.cc559149.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:700;src:url(roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2) format("woff2"),url(roboto-mono-all-700-normal.393c796d.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:700;src:url(roboto-mono-cyrillic-700-normal.5e6410cf.woff2) format("woff2"),url(roboto-mono-all-700-normal.393c796d.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:700;src:url(roboto-mono-greek-700-normal.b101f80c.woff2) format("woff2"),url(roboto-mono-all-700-normal.393c796d.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:700;src:url(roboto-mono-vietnamese-700-normal.edb1435b.woff2) format("woff2"),url(roboto-mono-all-700-normal.393c796d.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:700;src:url(roboto-mono-latin-ext-700-normal.c497b002.woff2) format("woff2"),url(roboto-mono-all-700-normal.393c796d.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Roboto Mono;font-style:normal;font-weight:700;src:url(roboto-mono-latin-700-normal.447ac127.woff2) format("woff2"),url(roboto-mono-all-700-normal.393c796d.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:400;src:url(alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2) format("woff2"),url(alegreya-sans-all-400-normal.a91dc265.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:400;src:url(alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2) format("woff2"),url(alegreya-sans-all-400-normal.a91dc265.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:400;src:url(alegreya-sans-greek-ext-400-normal.b82a0aea.woff2) format("woff2"),url(alegreya-sans-all-400-normal.a91dc265.woff) format("woff");unicode-range:U+1f??}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:400;src:url(alegreya-sans-greek-400-normal.4e5a8597.woff2) format("woff2"),url(alegreya-sans-all-400-normal.a91dc265.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:400;src:url(alegreya-sans-vietnamese-400-normal.bdc8a622.woff2) format("woff2"),url(alegreya-sans-all-400-normal.a91dc265.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:400;src:url(alegreya-sans-latin-ext-400-normal.1c1602b0.woff2) format("woff2"),url(alegreya-sans-all-400-normal.a91dc265.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:400;src:url(alegreya-sans-latin-400-normal.62b57001.woff2) format("woff2"),url(alegreya-sans-all-400-normal.a91dc265.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:500;src:url(alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2) format("woff2"),url(alegreya-sans-all-500-normal.5db27a5b.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:500;src:url(alegreya-sans-cyrillic-500-normal.8a029e9d.woff2) format("woff2"),url(alegreya-sans-all-500-normal.5db27a5b.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:500;src:url(alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2) format("woff2"),url(alegreya-sans-all-500-normal.5db27a5b.woff) format("woff");unicode-range:U+1f??}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:500;src:url(alegreya-sans-greek-500-normal.54a6041f.woff2) format("woff2"),url(alegreya-sans-all-500-normal.5db27a5b.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:500;src:url(alegreya-sans-vietnamese-500-normal.97e250df.woff2) format("woff2"),url(alegreya-sans-all-500-normal.5db27a5b.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:500;src:url(alegreya-sans-latin-ext-500-normal.637067c1.woff2) format("woff2"),url(alegreya-sans-all-500-normal.5db27a5b.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:500;src:url(alegreya-sans-latin-500-normal.4428c984.woff2) format("woff2"),url(alegreya-sans-all-500-normal.5db27a5b.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:700;src:url(alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2) format("woff2"),url(alegreya-sans-all-700-normal.29d7dfa9.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:700;src:url(alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2) format("woff2"),url(alegreya-sans-all-700-normal.29d7dfa9.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:700;src:url(alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2) format("woff2"),url(alegreya-sans-all-700-normal.29d7dfa9.woff) format("woff");unicode-range:U+1f??}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:700;src:url(alegreya-sans-greek-700-normal.452fc62e.woff2) format("woff2"),url(alegreya-sans-all-700-normal.29d7dfa9.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:700;src:url(alegreya-sans-vietnamese-700-normal.59390763.woff2) format("woff2"),url(alegreya-sans-all-700-normal.29d7dfa9.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:700;src:url(alegreya-sans-latin-ext-700-normal.b5306f41.woff2) format("woff2"),url(alegreya-sans-all-700-normal.29d7dfa9.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:normal;font-weight:700;src:url(alegreya-sans-latin-700-normal.96e2fcc9.woff2) format("woff2"),url(alegreya-sans-all-700-normal.29d7dfa9.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:400;src:url(alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2) format("woff2"),url(alegreya-sans-all-400-italic.f87bfe89.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:400;src:url(alegreya-sans-cyrillic-400-italic.8c81649c.woff2) format("woff2"),url(alegreya-sans-all-400-italic.f87bfe89.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:400;src:url(alegreya-sans-greek-ext-400-italic.550f5118.woff2) format("woff2"),url(alegreya-sans-all-400-italic.f87bfe89.woff) format("woff");unicode-range:U+1f??}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:400;src:url(alegreya-sans-greek-400-italic.1b909c63.woff2) format("woff2"),url(alegreya-sans-all-400-italic.f87bfe89.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:400;src:url(alegreya-sans-vietnamese-400-italic.d08e8dff.woff2) format("woff2"),url(alegreya-sans-all-400-italic.f87bfe89.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:400;src:url(alegreya-sans-latin-ext-400-italic.b9ce632b.woff2) format("woff2"),url(alegreya-sans-all-400-italic.f87bfe89.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:400;src:url(alegreya-sans-latin-400-italic.ec56f658.woff2) format("woff2"),url(alegreya-sans-all-400-italic.f87bfe89.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:500;src:url(alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2) format("woff2"),url(alegreya-sans-all-500-italic.8917c3da.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:500;src:url(alegreya-sans-cyrillic-500-italic.a40f95be.woff2) format("woff2"),url(alegreya-sans-all-500-italic.8917c3da.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:500;src:url(alegreya-sans-greek-ext-500-italic.8b2e952b.woff2) format("woff2"),url(alegreya-sans-all-500-italic.8917c3da.woff) format("woff");unicode-range:U+1f??}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:500;src:url(alegreya-sans-greek-500-italic.19d09eea.woff2) format("woff2"),url(alegreya-sans-all-500-italic.8917c3da.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:500;src:url(alegreya-sans-vietnamese-500-italic.3ff20df8.woff2) format("woff2"),url(alegreya-sans-all-500-italic.8917c3da.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:500;src:url(alegreya-sans-latin-ext-500-italic.d15c8f11.woff2) format("woff2"),url(alegreya-sans-all-500-italic.8917c3da.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:500;src:url(alegreya-sans-latin-500-italic.6d8350bf.woff2) format("woff2"),url(alegreya-sans-all-500-italic.8917c3da.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:700;src:url(alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2) format("woff2"),url(alegreya-sans-all-700-italic.a6d70e05.woff) format("woff");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:700;src:url(alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2) format("woff2"),url(alegreya-sans-all-700-italic.a6d70e05.woff) format("woff");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:700;src:url(alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2) format("woff2"),url(alegreya-sans-all-700-italic.a6d70e05.woff) format("woff");unicode-range:U+1f??}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:700;src:url(alegreya-sans-greek-700-italic.5aef27cf.woff2) format("woff2"),url(alegreya-sans-all-700-italic.a6d70e05.woff) format("woff");unicode-range:U+0370-03ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:700;src:url(alegreya-sans-vietnamese-700-italic.7de0cccc.woff2) format("woff2"),url(alegreya-sans-all-700-italic.a6d70e05.woff) format("woff");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:700;src:url(alegreya-sans-latin-ext-700-italic.733aea09.woff2) format("woff2"),url(alegreya-sans-all-700-italic.a6d70e05.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Alegreya Sans;font-style:italic;font-weight:700;src:url(alegreya-sans-latin-700-italic.abc64c8a.woff2) format("woff2"),url(alegreya-sans-all-700-italic.a6d70e05.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Lato;font-style:normal;font-weight:400;src:url(lato-latin-ext-400-normal.e1ce8ad3.woff2) format("woff2"),url(lato-all-400-normal.a1a68bdf.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Lato;font-style:normal;font-weight:400;src:url(lato-latin-400-normal.77db3602.woff2) format("woff2"),url(lato-all-400-normal.a1a68bdf.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-display:swap;font-family:Lato;font-style:italic;font-weight:400;src:url(lato-latin-ext-400-italic.336aaf51.woff2) format("woff2"),url(lato-all-400-italic.c29c8c6c.woff) format("woff");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-display:swap;font-family:Lato;font-style:italic;font-weight:400;src:url(lato-latin-400-italic.6edbc86c.woff2) format("woff2"),url(lato-all-400-italic.c29c8c6c.woff) format("woff");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}:root{--pluto-cell-spacing:17px;--pluto-operator-ligatures:none;--julia-mono-font-stack:JuliaMono,Menlo,"Roboto Mono","Lucida Sans Typewriter","Source Code Pro",monospace;--sans-serif-font-stack:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen,Ubuntu,Cantarell,"Open Sans","Helvetica Neue",sans-serif;--lato-ui-font-stack:"Lato",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Cantarell,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",system-ui,sans-serif;--system-ui-font-stack:"Lato",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Cantarell,Helvetica,Arial,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",system-ui,sans-serif;color-scheme:light dark}html{font-size:17px}*{box-sizing:border-box}body{background-color:var(--main-bg-color);margin:0;min-height:100vh;overflow-anchor:none;overflow-x:hidden;position:relative}pluto-editor{align-items:center;display:flex;flex:1 1 auto;flex-direction:column;min-width:0}main{align-content:center;flex:1;max-width:731px;padding:0 6px 4rem 25px;width:100%}body:not(.disable_ui) main{padding-bottom:16rem}body:not(.disable_ui){overscroll-behavior:contain}@media screen and (min-width:calc(700px + 25px + 6px)) and (max-width:calc(700px + 25px + 6px + 500px)){body:not(.disable_ui) pluto-editor.fullscreen main{align-self:flex-start;margin-left:0}}@media screen and (min-width:calc(700px + 25px + 6px + 500px)) and (max-width:calc(700px + 25px + 6px + 500px + 500px)){body:not(.disable_ui) pluto-editor.fullscreen main{align-self:flex-end;margin-right:500px}}pluto-notebook{background:var(--main-bg-color);display:block}pluto-output{color:var(--pluto-output-color);font-family:Alegreya Sans,sans-serif;font-size:1em;font-weight:400}pluto-output h1,pluto-output h2,pluto-output h3,pluto-output h4,pluto-output h5,pluto-output h6{font-feature-settings:"lnum","pnum";color:var(--pluto-output-h-color);font-family:Vollkorn,serif;font-weight:600;margin-block-end:0;margin-block-start:1rem}pluto-output h1,pluto-output h2{font-weight:700;margin-block-start:2rem}pluto-output h1:first-child,pluto-output h2:first-child{margin-block-start:calc(2rem - var(--pluto-cell-spacing))}pluto-output h1{border-bottom:3px solid var(--rule-color);font-size:2.2rem;margin-bottom:.5rem}pluto-output h2{border-bottom:2px dotted var(--rule-color);font-size:1.8rem;margin-bottom:.5rem}pluto-output h1:empty,pluto-output h2:empty{border-bottom:none}pluto-output h3{font-size:1.6rem}pluto-output h4{font-size:1.4rem}pluto-output h5{font-size:1.2rem}pluto-output h6{font-size:1rem}pluto-output h3:first-child,pluto-output h4:first-child,pluto-output h5:first-child,pluto-output h6:first-child{margin-block-start:0}pluto-output br,pluto-output p{line-height:1.45em;margin-block-end:var(--pluto-cell-spacing);margin-block-start:0;word-spacing:.053em}pluto-output p:first-child{margin-block-start:0}b,strong{font-weight:bolder}pluto-output li p+ol,pluto-output li p+ul{margin-block-start:calc(var(--pluto-cell-spacing)*-1)}pluto-output p:last-child{margin-block-end:0}pluto-output img,pluto-output video{max-width:100%}a{color:var(--black);text-decoration-color:var(--a-underline);text-decoration-thickness:2px}a:hover{text-decoration-color:var(--black)}.cm-cursor{border-left:1.2px solid var(--cursor-color)!important}pluto-output code{font-family:var(--julia-mono-font-stack);font-size:.75em;font-variant-ligatures:none}pluto-output code .cm-editor .cm-line{font-family:var(--julia-mono-font-stack)}pluto-output pre>code{font-size:inherit}pluto-output.rich_output code{background-color:var(--pluto-output-bg-color);border-radius:8px;padding:3px}pluto-output.rich_output pre>code{background-color:transparent;padding:0}pluto-log-dot pre,pluto-output pre{display:inline-block;font-family:var(--julia-mono-font-stack);font-size:.75rem;font-variant-ligatures:none;margin:0;tab-size:4;-moz-tab-size:4;white-space:pre-wrap;word-break:break-all}pluto-display pre{white-space:pre;word-break:normal}pluto-output hr{border:none;border-top:3px solid var(--rule-color);margin-left:0;margin-right:0}pluto-output blockquote{margin-left:1rem;margin-right:1rem}pluto-output.rich_output pre:not(.no-block),pluto-output blockquote{background-color:var(--blockquote-bg);border-radius:15px;color:var(--blockquote-color);display:block;margin-block-end:var(--pluto-cell-spacing);margin-block-start:0;padding:15px}pluto-output.rich_output pre:not(.no-block):last-child,pluto-output blockquote:last-child{margin-block-end:0}pluto-output div.admonition{border-radius:8px;margin-block-end:1em;margin-block-start:1em}pluto-output div.admonition .admonition-title{font-feature-settings:"lnum","pnum";color:var(--admonition-title-color);font-family:Vollkorn,sans-serif;font-weight:600;margin-block-end:0;padding-left:.3em}pluto-output div.admonition .admonition-title~*{margin-block-end:.5em;margin-block-start:.5em;transition:filter .1s linear}pluto-output div.admonition{background:var(--jl-message-color);border:5px solid var(--jl-message-accent-color);padding-left:.5rem}pluto-output div.admonition .admonition-title{background:var(--jl-message-accent-color);margin:-1px -1px -1px -.55rem}pluto-output div.admonition.hint,pluto-output div.admonition.info,pluto-output div.admonition.note{background:var(--jl-info-color);border:5px solid var(--jl-info-accent-color)}pluto-output div.admonition.hint .admonition-title,pluto-output div.admonition.info .admonition-title,pluto-output div.admonition.note .admonition-title{background:var(--jl-info-accent-color)}pluto-output div.admonition.warning{background:var(--jl-warn-color);border:5px solid var(--jl-warn-accent-color)}pluto-output div.admonition.warning .admonition-title{background:var(--jl-warn-accent-color)}pluto-output div.admonition.danger{background:var(--jl-danger-color);border:5px solid var(--jl-danger-accent-color)}pluto-output div.admonition.danger .admonition-title{background:var(--jl-danger-accent-color)}pluto-output div.admonition.hint .admonition-title~*{filter:blur(.25em)}pluto-output div.admonition.hint:focus-within .admonition-title~*,pluto-output div.admonition.hint:hover .admonition-title~*{filter:blur(0)}pluto-output div.footnote{margin-block-end:1em;margin-block-start:1em}pluto-output div.footnote p.footnote-title:before{content:"["}pluto-output div.footnote p.footnote-title:after{content:"]: "}pluto-output a.footnote,pluto-output div.footnote p.footnote-title{font-family:Roboto Mono,monospace;font-size:.75rem;font-weight:700;letter-spacing:-.05em;margin-block-end:0}pluto-output div.footnote p.footnote-title~*{border-left:5px solid var(--footnote-border-color);margin-block-end:0;margin-left:.1em;padding-bottom:var(--pluto-cell-spacing);padding-left:.4em}pluto-output div.footnote p:last-child{padding-bottom:0}pluto-output.scroll_y{max-height:80vh;max-height:502px;overflow:auto}pluto-output table{border:2px solid var(--table-border-color);border-collapse:collapse;border-left:none;border-right:none;margin:0 auto;margin-block-end:var(--pluto-cell-spacing);margin-block-start:var(--pluto-cell-spacing)}pluto-output table>thead{border-bottom:1px solid var(--table-border-color)}pluto-output table>tbody td{font-family:var(--julia-mono-font-stack);font-size:.75rem;font-variant-ligatures:none}pluto-output table>tbody td code{font-size:.75rem}pluto-output table td,pluto-output table th{padding:.2rem .5rem}pluto-output table>tbody tr:hover{background-color:var(--table-bg-hover-color)}pluto-output table pre{white-space:pre}kbd,pluto-output kbd{border:1px solid var(--kbd-border-color);border-radius:3px;font-family:Space Mono,monospace;font-size:.7rem;letter-spacing:-.7px;padding:0 5px}pluto-output mjx-assistive-mml{height:1px}header#pluto-nav{background-color:var(--header-bg-color);border-bottom:1px solid var(--header-border-color);font-family:Roboto Mono,monospace;font-size:.75rem;font-weight:400;min-height:60px;transform:translateY(0);transition:background-color .5s ease-in-out,transform .25s cubic-bezier(.18,.89,.49,1.13);width:100%;z-index:50}header#pluto-nav.show_export{position:sticky;top:0;transform:translateY(130px)}aside#export{background:var(--export-bg-color);color:var(--export-color);height:130px;position:absolute;top:0;transform:translateY(-100%);width:100%}aside#export:before{background:inherit;bottom:100%;content:"";height:100px;left:0;position:absolute;right:0}aside#export div#container{display:flex;flex-direction:row;margin:0 auto;max-width:1000px;padding-right:20px}header aside#export div#container{overflow-x:hidden}header.show_export aside#export div#container{overflow-x:auto}a.export_card{background:var(--export-card-bg-color);border:5px solid transparent;box-shadow:0 2px 10px var(--export-card-shadow-color);color:var(--export-card-title-color);margin:20px 5px;text-decoration:none;width:169px}a.export_card,div.export_title{border-radius:8px;flex:0 0 auto;height:90px}div.export_title{font-size:1rem;font-weight:700;margin-top:10px;text-orientation:sideways-right;transform:rotate(180deg);writing-mode:vertical-lr}a.export_card header{font-feature-settings:"lnum","pnum";font-family:Vollkorn,sans;font-size:1rem;margin-block:0}a.export_card section{color:var(--export-card-text-color);font-weight:500;padding:3px}aside#export .export_small_btns{display:flex;flex-direction:row;height:60px;margin-left:auto}body.static_preview button.toggle_export{display:none}nav#at_the_top h1{color:var(--nav-h1-text-color);letter-spacing:2px}nav#at_the_top{display:flex;flex-direction:row;flex-wrap:wrap;margin:0 auto;max-width:1000px;min-height:60px;padding-left:20px;padding-right:20px;z-index:100}nav#at_the_top>*{align-self:center;flex:0 0 auto;margin:10px 0}nav#at_the_top>.flex_grow_1{flex-grow:1}nav#at_the_top>.flex_grow_2{flex-grow:2}nav#at_the_top img{filter:var(--image-filters);height:39px;margin-bottom:-8px}nav#at_the_top h1{border-bottom:none;display:inline;font-size:1.8rem;font-weight:700}nav#at_the_top img#logo-small{display:none}@media (max-width:800px){nav#at_the_top img#logo-small{display:unset}nav#at_the_top img#logo-big{display:none}}nav#at_the_top>pluto-filepicker{display:flex;flex-direction:row;flex-grow:1;width:210px}nav#at_the_top>pluto-filepicker .cm-editor{background:none;border:2px solid var(--footer-input-border-color);border-radius:3px;border-bottom-right-radius:0;border-right:none;border-top-right-radius:0;color:var(--nav-filepicker-color);display:inline-block;font-family:inherit;font-size:.8rem;font-style:normal;font-weight:500;height:calc(1rem + 12px);letter-spacing:1px;min-width:10rem}pluto-filepicker .cm-scroller{scrollbar-width:none}pluto-filepicker .cm-scroller::-webkit-scrollbar{display:none}pluto-filepicker button{cursor:pointer;height:auto}pluto-filepicker button:disabled{cursor:not-allowed}.export_small_btns button,button.start_stop_recording,button.toggle_export{background:none;border:none;cursor:pointer;opacity:.5}.export_small_btns button span,button.start_stop_recording span,button.toggle_export span{background-size:25px 25px;content:" "!important;display:block;height:25px;width:25px}nav#at_the_top button.start_stop_recording span{background-image:url(radio-button-on-outline.778acac1.svg)}nav#at_the_top button.start_stop_recording.stop span{background-image:url(stop-circle-outline.6623356d.svg)}nav#at_the_top button.toggle_export span{background-image:url(shapes-outline.76567c1b.svg);filter:var(--image-filters)}aside#export button.toggle_export span{background-image:url(close-outline.9c22a232.svg);filter:invert(1)}aside#export button.toggle_frontmatter_edit span{background-image:url(newspaper-outline.e481c39c.svg);filter:invert(1)}nav#at_the_top:after{align-self:center;margin-left:auto}.cm-tooltip-autocomplete li.file.new:before{color:#000;content:"👉"}.cm-tooltip-autocomplete li.file:before{color:#000;content:"📄"}.cm-tooltip-autocomplete li.dir:before{color:#000;content:"📁"}@media (any-pointer:fine){nav#at_the_top>pluto-filepicker .cm-editor{border:2px solid transparent;border-right:none;transition:border .15s ease-in-out}nav#at_the_top>pluto-filepicker button{opacity:0;transition:opacity .15s ease-in-out}header:focus-within>nav#at_the_top>pluto-filepicker .cm-editor,header:hover>nav#at_the_top>pluto-filepicker .cm-editor{border:2px solid var(--footer-input-border-color);border-right:none}header:focus-within>nav#at_the_top>pluto-filepicker button,header:hover>nav#at_the_top>pluto-filepicker button{opacity:1}}body.binder header#pluto-nav>nav#at_the_top>pluto-filepicker>*{display:none}body.binder header#pluto-nav>nav#at_the_top>pluto-filepicker>a{display:block;font-family:var(--julia-mono-font-stack);font-size:16px;opacity:.8;text-decoration:none}body.binder.loading header#pluto-nav,body.disconnected header#pluto-nav,body.nbpkg_restart_recommended header#pluto-nav,body.nbpkg_restart_required header#pluto-nav,body.process_dead header#pluto-nav{backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);position:sticky;top:0}body.nbpkg_restart_recommended header#pluto-nav{background-color:var(--restart-recc-header-color)}body.nbpkg_restart_required header#pluto-nav{background-color:var(--restart-req-header-color)}body.process_dead header#pluto-nav{background-color:var(--dead-process-header-color)}body.loading header#pluto-nav{background-color:var(--loading-header-color)}body.disconnected header#pluto-nav{background-color:var(--disconnected-header-color)}body.binder.loading header#pluto-nav{background-color:var(--binder-loading-header-color)}nav#at_the_top>#process_status{background:var(--nav-process-status-bg-color);border-radius:10px;color:var(--nav-process-status-color);font-size:1rem;font-weight:500;margin:5px 5px 5px 1em;padding:5px 10px;z-index:10}nav#at_the_top>#process_status:empty{display:none}loading-bar{animation:move-background 2s ease-in-out infinite;background:linear-gradient(90deg,var(--loading-grad-color-1),var(--loading-grad-color-2),var(--loading-grad-color-1));background-size:100vw 100%;display:block;height:6px;left:0;opacity:0;position:fixed;top:0;transition:width 2s cubic-bezier(.14,.71,0,.99),opacity .2s linear;width:10vw;z-index:12000}loading-bar.slow{transition:width 10s cubic-bezier(.14,.71,0,.99),opacity .5s linear}@media (prefers-reduced-motion){loading-bar{transition:none}}body.binder.loading #binder_spinners{opacity:.25}@keyframes move-background{0%{background-position-x:0}to{background-position-x:100vw}}.outline-frame{box-sizing:border-box;height:100vh;left:0;pointer-events:none;position:fixed;top:0;width:100vw;z-index:9990}body.recording_waiting_to_start .outline-frame.recording{border:12px solid #be6f6fba}body.is_recording .outline-frame.recording{border:12px solid #dc3535ba}.outline-frame.playback{border:12px solid #357ddcba;box-shadow:inset 0 0 20px 20px #919bff2b;opacity:1;position:absolute;transition:top .3s ease-in-out,opacity .3s ease-in-out}body.is_recording header#pluto-nav,body.recording_waiting_to_start header#pluto-nav{display:none}#record-ui-container{display:flex;flex-direction:row;flex-wrap:wrap;position:fixed;top:3px;z-index:9999}#record-ui-container>.overlay-button{border-color:#e86f6c;margin:0 3px}#record-ui-container>.overlay-button.record-no-audio{border-color:#dcc6c6}#record-ui-container>.overlay-button.playback{border-color:#c6c6dc}#record-ui-container span.stop-recording-icon:after{background-image:url(stop-circle-outline.6623356d.svg)}#record-ui-container span.microphone-icon:after{background-image:url(mic-outline.e10eafe2.svg)}#record-ui-container span.mute-icon:after{background-image:url(mic-off-outline.251c22b7.svg)}#record-ui-container span.follow-recording-icon:after{background-image:url(arrow-undo-outline.d8c99108.svg)}div.recording-playback{bottom:16px;position:fixed;width:min(500px,90vw);z-index:9999}.raw-html-wrapper.preamble,div.recording-playback audio{width:100%}main>preamble{display:flex;height:20px;margin-top:5px;padding-right:5px;pointer-events:none;position:sticky;top:5px;z-index:200}.overlay-button{background:var(--overlay-button-bg);border:3px solid var(--overlay-button-border);border-radius:12px;font-family:Segoe UI Emoji,Roboto Mono,monospace;font-size:.75rem;height:35px;padding:5px 8px;pointer-events:all;white-space:nowrap}.overlay-button,.overlay-button button:not(.asdfdsf){color:var(--overlay-button-color)}main>preamble #saveall-container{margin-left:auto}pluto-editor.fullscreen main>preamble #saveall-container{transform:translateX(max(0px,100vw - 700px - 25px))}@media screen and (min-width:calc(700px + 25px + 6px + 500px)){pluto-editor.fullscreen main>preamble #saveall-container{transform:translateX(500px)}}main>preamble #saveall-container.ask_to_save{border-color:var(--overlay-button-border-save)}main>preamble #saveall-container.saved,main>preamble #saveall-container.saving{border-color:transparent}main>preamble #saveall-container.saved>span,main>preamble #saveall-container.saving>span{opacity:.5}.overlay-button span.pluto-icon:after{background-image:url(sync-circle-outline.65b15d76.svg);background-position-x:right;background-position-y:1px;background-repeat:no-repeat;background-size:17px 17px;content:"";display:inline-block;filter:var(--image-filters);height:18px;margin-bottom:-5px;padding-right:20px}.overlay-button span.saved-icon:after,main>preamble span.saved-icon:after{background-image:url(checkmark-outline.4fb8c646.svg);filter:var(--image-filters)}#saveall-container .only-on-hover{display:none}#saveall-container:hover .only-on-hover{display:inline}pluto-cell{break-inside:avoid;display:block;margin-top:var(--pluto-cell-spacing);min-height:25px;position:relative}pluto-output{align-items:baseline;background-color:var(--pluto-output-bg-color);display:block;overflow-x:auto;padding-left:10px;padding-right:10px}.scroll_y{max-height:80vh;overflow-y:auto}pluto-output:focus{outline:none}pluto-output:not(.rich_output){display:flex;flex-wrap:wrap;padding-bottom:3px;padding-top:3px}pluto-output>assignee{font-family:var(--julia-mono-font-stack);font-size:.75rem;font-variant-ligatures:none}pluto-output>assignee:after{content:"\a0=\a0";opacity:.6}.errored pluto-output>assignee,pluto-output>assignee:empty{display:none}pluto-output>div{flex-shrink:0;overflow-y:hidden}pluto-output div.raw-html-wrapper{display:contents}pluto-output:not(.rich_output)>div>pre{display:flex}.bonds_disabled.offer_binder bond{filter:grayscale(1);opacity:.6}pluto-display,pluto-display>div{display:contents}.isolated-cell>pluto-output{padding:0}.hidden-cell{display:none}pluto-cell.depends_on_disabled_cells>pluto-input .cm-editor,pluto-cell.depends_on_disabled_cells>pluto-logs-container,pluto-cell.depends_on_disabled_cells>pluto-output,pluto-cell.depends_on_disabled_cells>pluto-trafficlight,pluto-cell.running_disabled>pluto-input .cm-editor,pluto-cell.running_disabled>pluto-logs-container,pluto-cell.running_disabled>pluto-output,pluto-cell.running_disabled>pluto-trafficlight{opacity:.3}pluto-cell.running_disabled>pluto-input .cm-editor,pluto-cell.running_disabled>pluto-output{background-color:var(--disabled-cell-bg-color)}pluto-cell.selected{background:var(--selected-cell-bg-color);border-radius:0 3px 3px 0}pluto-cell.selected>pluto-input>div.cm-editor,pluto-cell.selected>pluto-output{opacity:.7}main{cursor:vertical-text}pluto-cell{cursor:auto}pluto-output>div{scrollbar-color:transparent transparent;scrollbar-width:thin}pluto-cell:hover>pluto-output>div{scrollbar-color:var(--hover-scrollbar-color-1) var(--hover-scrollbar-color-2)}pluto-output>div::-webkit-scrollbar{background:transparent;height:6px}pluto-output>div::-webkit-scrollbar-thumb{background:transparent}pluto-cell:hover>pluto-output>div::-webkit-scrollbar{background:var(--hover-scrollbar-color-2)}pluto-cell:hover>pluto-output>div::-webkit-scrollbar-thumb{background:var(--hover-scrollbar-color-1)}pluto-input .cm-editor{border:1px solid var(--normal-cell-color);border-bottom-right-radius:4px;border-left:none;min-height:25px;scroll-margin-block:20vh;transition:border-color .15s ease-in-out;z-index:20}pluto-input:focus-within .cm-editor{z-index:21}pluto-input .cm-editor .cm-line{transition:background-color .15s ease-in-out}pluto-input .cm-editor .cm-line.cm-highlighted-line{background-color:#bdbdbd68;border-radius:3px}pluto-cell:not(.show_input)>pluto-input{display:none}pluto-cell.code_differs>pluto-input>.cm-editor{border:1px solid var(--code-differs-cell-color);border-left:none}.overlay-button button,nav#slide_controls>button,pluto-cell>button,pluto-input>button,pluto-runarea>button,pluto-shoulder>button{background:none;border:none;color:var(--ui-button-color);cursor:pointer;font-family:Segoe UI Emoji,Roboto Mono,monospace;font-size:.75rem;margin:0;opacity:50%;padding:1px;position:absolute;z-index:30}.overlay-button button{position:relative}pluto-shoulder{--invisible-border:calc(var(--pluto-cell-spacing)*0.5);--shoulder-width:calc(28px + var(--invisible-border));--border-radius:calc(5px + var(--invisible-border));align-items:flex-start;border:var(--invisible-border) solid transparent;border-radius:var(--border-radius) 0 0 var(--border-radius);border-right:none;bottom:calc(0px - var(--invisible-border));cursor:move;display:flex;flex-direction:row;justify-content:flex-end;left:calc(0px - var(--shoulder-width));position:absolute;top:calc(0px - var(--invisible-border));width:var(--shoulder-width)}pluto-editor.fullscreen pluto-shoulder{--shoulder-width:2000px}pluto-shoulder:hover{background:var(--shoulder-hover-bg-color);background-clip:padding-box}pluto-shoulder>button{flex:0 0 auto;margin-right:5px;margin-top:4px;padding:0 1px;position:sticky;top:0}pluto-cell:focus-within>pluto-shoulder>button{padding-right:4px}pluto-shoulder>button>span:after{background-image:url(eye-outline.6e6e0f7c.svg);filter:var(--image-filters)}pluto-cell.code_folded>pluto-shoulder>button>span:after{background-image:url(eye-off-outline.a37e03db.svg);filter:var(--image-filters)}pluto-trafficlight{--patternHeight:22.62741699797px;background:var(--normal-cell-color);border-bottom-left-radius:4px;border-left-color:var(--normal-cell-color);border-top-left-radius:4px;bottom:0;box-sizing:content-box;left:-4px;margin-right:-1px;overflow:hidden;pointer-events:none;position:absolute;top:0;width:4px}pluto-trafficlight:after{content:"";height:calc(100% + var(--patternHeight)*10);left:0;opacity:0;position:absolute;top:calc(0px - var(--patternHeight)*10);width:100%}pluto-cell.activate_animation pluto-trafficlight:after{animation:scrollbackground 10s linear 0s infinite running}body:not(.___) pluto-cell.code_folded>pluto-trafficlight{background:none}@media screen and (any-pointer:fine){body:not(.disable_ui) pluto-cell:hover>pluto-trafficlight{background:var(--normal-cell-color);transition:background .05s ease-in}}body:not(.___) pluto-cell:focus-within>pluto-trafficlight{background-clip:padding-box;background-color:var(--normal-cell-color);border-left-style:solid;border-left-width:4px;margin-left:-4px}body:not(.___) pluto-cell.selected>pluto-trafficlight{background:var(--selected-cell-color);background-clip:padding-box;border-left-color:var(--selected-cell-color)}body:not(.___) pluto-cell.code_differs>pluto-trafficlight{background:var(--code-differs-cell-color);background-clip:padding-box;border-left-color:var(--code-differs-cell-color)}body:not(.___) pluto-cell.errored>pluto-trafficlight{background:var(--error-cell-color);background-clip:padding-box;border-left-color:var(--error-cell-color)}body:not(.___) pluto-cell.queued>pluto-trafficlight:after{animation-duration:20s;background:repeating-linear-gradient(-45deg,transparent,transparent 8px,var(--normal-cell-color) 8px,var(--normal-cell-color) 16px);background-clip:padding-box;background-size:4px var(--patternHeight);opacity:.99}body:not(.___) pluto-cell.running>pluto-trafficlight:after{background:repeating-linear-gradient(-45deg,var(--normal-cell-color),var(--normal-cell-color) 8px,var(--dark-normal-cell-color) 8px,var(--dark-normal-cell-color) 16px);background-clip:content-box;background-size:4px var(--patternHeight);opacity:.99}body:not(.___) pluto-cell.queued.errored>pluto-trafficlight:after,body:not(.___) pluto-cell.running.errored>pluto-trafficlight:after{background:repeating-linear-gradient(-45deg,var(--light-error-cell-color),var(--light-error-cell-color) 8px,var(--bright-error-cell-color) 8px,var(--bright-error-cell-color) 16px);background-clip:content-box;background-size:4px var(--patternHeight);opacity:.99}@keyframes scrollbackground{0%{transform:translate(0)}to{transform:translateY(calc(var(--patternHeight)*10))}}pluto-cell>button>span,pluto-input>button>span{pointer-events:none}@media screen and (any-pointer:fine){pluto-cell>button,pluto-cell>pluto-runarea,pluto-input>button,pluto-runarea>button,pluto-shoulder>button{opacity:0;transition:opacity .25s ease-in-out}.export_small_btns button,button.start_stop_recording,button.toggle_export,pluto-cell:hover>button,pluto-cell:hover>pluto-input>button,pluto-cell:hover>pluto-shoulder>button,pluto-cell>pluto-runarea>button{opacity:.4;transition:opacity .25s ease-in-out}.export_small_btns button:hover,.overlay-button button:hover,button.start_stop_recording:hover,button.toggle_export:hover,pluto-cell:hover>pluto-runarea,pluto-cell>button:hover,pluto-cell>pluto-input>button:hover,pluto-cell>pluto-runarea>button:hover,pluto-cell>pluto-shoulder>button:hover{opacity:1;transition:opacity .05s ease-in-out}}@media screen and (any-pointer:coarse){pluto-cell>button,pluto-cell>pluto-runarea{opacity:0;transition:opacity .25s ease-in-out}pluto-input>button,pluto-shoulder>button{opacity:.25;transition:opacity .25s ease-in-out}pluto-cell:focus-within>button,pluto-cell:focus-within>pluto-input>button,pluto-cell:focus-within>pluto-runarea,pluto-cell:focus-within>pluto-shoulder>button{opacity:.25;transition:opacity .25s ease-in-out}pluto-cell>button:focus-within,pluto-cell>pluto-input>button:focus-within,pluto-cell>pluto-input>button:focus-within pluto-cell>pluto-runarea>button:focus-within,pluto-cell>pluto-runarea,pluto-cell>pluto-shoulder>button:focus-within{opacity:1;transition:opacity .05s ease-in-out}}pluto-cell>button>span:after,pluto-input>button>span:after,pluto-runarea>button>span:after,pluto-shoulder>button>span:after{background-size:17px 17px;content:" "!important;display:block;height:17px;width:17px}pluto-cell>button.add_cell{left:-12px}pluto-cell>button.add_cell.before{margin-top:calc(-9.5px - var(--pluto-cell-spacing)*.5)!important}pluto-cell>button.add_cell.after{bottom:1px;margin-bottom:calc(-10.5px - var(--pluto-cell-spacing)*.5)}pluto-cell>button.add_cell>span:after{background-image:url(add-outline.e3c93c35.svg);filter:var(--image-filters)}pluto-input>button.input_context_menu ul{--width:156px;background-color:var(--input-context-menu-bg-color);border:1px solid var(--input-context-menu-border-color);border-radius:6px;display:block;left:100%;margin:0;padding:0;position:absolute;top:-8px}@media screen and (min-width:921px){pluto-input>button.input_context_menu ul{left:calc(100% - 3px)}}@media screen and (max-width:920px){pluto-input>button.input_context_menu{z-index:31}pluto-input>button.input_context_menu ul{left:calc(100% - var(--width) - 36px)}}.input_context_menu li{align-items:center;border-radius:2px;color:var(--input-context-menu-li-color);display:flex;font-family:Roboto Mono,system-ui;font-size:.8rem;height:32px;justify-content:flex-start;letter-spacing:-.02em;list-style:none;margin-block-end:0;padding:8px;position:relative;width:var(--width)}.input_context_menu li:last-child{border-bottom-left-radius:6px;border-bottom-right-radius:6px}.input_context_menu li:first-child{border-top-left-radius:6px;border-top-right-radius:6px}.input_context_menu li.coming_soon{color:var(--input-context-menu-soon-color)}.input_context_menu li.coming_soon:hover{background-color:var(--input-context-menu-hover-bg-color);cursor:not-allowed}.input_context_menu li:hover{background-color:var(--input-context-menu-hover-bg-color);transition-duration:.2s;transition-property:background-color}.ctx_icon,.icon{--size:17px;background-position:50%;background-size:var(--size) var(--size);height:var(--size);margin-right:calc(var(--size)/3);margin-top:1px;width:var(--size)}.ctx_icon{filter:var(--image-filters)}.ctx_icon.hide_logs,.ctx_icon.show_logs{background-image:url(document-text-outline.8d1e2333.svg)}.ctx_icon.bandage{background-image:url(bandage-outline.37f88b63.svg);filter:var(--image-filters) opacity(.3)}.ctx_icon.enable_cell{background-image:url(caret-forward-circle-outline.d0bf2b34.svg)}.ctx_icon.disable_cell{background-image:url(ban-outline.c97da9b4.svg);background-repeat:no-repeat;background-size:15px}.ctx_icon.delete{background-image:url(close-circle-outline.4baeedb9.svg)}pluto-input>button.input_context_menu{padding:5px;right:0}pluto-input>button.input_context_menu.open{opacity:1}pluto-input>button.input_context_menu>span.icon:after{background-image:url(ellipsis-horizontal-circle-outline.6279ed30.svg);filter:var(--image-filters)}body.nbpkg_disabled pkg-status-mark:not(.disable_pkg){display:none}pkg-status-mark{display:inline-block;height:1em;margin:0 .6em 0 .2em;width:1em}pkg-status-mark>button{background:none;border:none;cursor:context-menu;margin:0;padding:0;position:relative;top:-.2em}pkg-status-mark>button>span:after{background-image:url(time-outline.7c1877f0.svg);background-size:1.5em;content:" "!important;display:inline-block;filter:var(--image-filters);height:1.5em;opacity:.3;width:1.5em}pkg-status-mark.installed>button>span:after{background-image:url(checkmark-outline.4fb8c646.svg);filter:var(--image-filters)}pkg-status-mark.busy>button>span:after{animation:loadspin 3s ease-in-out infinite;background-image:url(sync-outline.9a1bd27b.svg);filter:var(--image-filters)}pkg-status-mark.not_found>button>span:after{background-image:url(cloud-offline-outline.ac2eade9.svg);filter:var(--image-filters);opacity:.6}pkg-status-mark.will_be_installed>button>span:after{background-image:url(cloud-download-outline.8c1ff9bb.svg);filter:var(--image-filters);opacity:.6}pkg-status-mark.disable_pkg>button>span:after{background-image:url(chatbox-ellipses-outline.4334a3a4.svg);filter:var(--image-filters);opacity:.6}pluto-popup{display:block;font-family:var(--lato-ui-font-stack);margin-left:.4rem;margin-top:-1rem;opacity:0;overflow-wrap:break-word;pointer-events:none;position:absolute;transform:scale(.2);transform-origin:left;transition:transform .5s ease-in-out,opacity .1s ease-in-out;width:min(90vw,251px);z-index:50}pluto-popup.visible{opacity:1;pointer-events:auto;transform:scale(1);transition:transform .2s ease-in-out,opacity .2s ease-in-out}pluto-popup>*{background:var(--overlay-button-bg);border:3px solid var(--overlay-button-border);border-radius:10px;color:var(--black);display:block;padding:8px;position:absolute}pluto-popup>pkg-popup{background:var(--pkg-popup-bg);border:3px solid var(--pkg-popup-border-color)}pkg-popup.busy{border:3px solid #aa80bc}pkg-version{font-family:Space Mono,monospace;font-size:.75rem;opacity:.5}pkg-popup .pkg-buttons{display:inline-flex;flex-direction:row;float:right;height:1em}a.stdout-info img,pkg-popup .pkg-buttons img{filter:var(--image-filters)}a.stdout-info,pkg-popup .pkg-buttons>*{background:var(--pkg-popup-buttons-bg-color);border-radius:10px;box-sizing:content-box;display:block;height:17px;margin-left:-4px;padding:4px;z-index:52}pkg-popup .toggle-terminal{right:20px}pkg-terminal{background:var(--pkg-terminal-bg-color);border:3px solid var(--pkg-terminal-border-color);border-radius:6px;color:#fff;cursor:text;display:block;margin-top:6px;padding:3px}pkg-terminal>.scroller{max-height:10rem;overflow-y:auto;padding:4px;width:100%}pkg-terminal pre{font-family:Space Mono,monospace;font-size:.6rem;margin:0;white-space:pre-wrap;word-break:break-all}pkg-popup pkg-terminal{display:none}pkg-popup.showterminal pkg-terminal{display:block}@keyframes loadspin{0%{transform:rotate(0deg)}25%{transform:rotate(180deg)}50%{transform:rotate(180deg)}75%{transform:rotate(1turn)}to{transform:rotate(1turn)}}pluto-runarea{background-color:var(--pluto-runarea-bg-color);border-bottom-left-radius:5px;border-bottom-right-radius:5px;border-top:none;display:block;height:17px;margin-right:3px;min-width:75px;position:absolute;right:0}pluto-runarea>span{color:var(--pluto-runarea-span-color);display:inline-block;font-family:Roboto Mono,monospace;font-size:.6em;font-style:italic;left:22px;position:absolute;text-align:center;top:1px;width:45px}pluto-runarea>button.runcell{left:1px;top:-1px}pluto-runarea>button.runcell>span:after{background-image:url(caret-forward-circle-outline.d0bf2b34.svg);filter:var(--image-filters)}pluto-runarea.interrupt>button.runcell>span:after{background-image:url(stop-circle-outline.6623356d.svg);filter:var(--image-filters)}pluto-runarea.jump>button.runcell>span:after{background-image:url(arrow-redo-circle-outline.dfa899f4.svg);filter:var(--image-filters)}pluto-runarea.save>button.runcell>span:after{background-image:url(chevron-forward-circle-outline.babf2a99.svg);filter:var(--image-filters)}pluto-cell:not(.show_input)>pluto-runarea{display:none}pluto-cell.code_differs>pluto-runarea,pluto-cell:focus-within>pluto-runarea{opacity:100%}pluto-cell.code_differs>pluto-runarea>button{animation-duration:4s;animation-iteration-count:infinite;animation-name:👀}@keyframes 👀{0%,80%,to{opacity:50%;transform:scale(1)}90%{opacity:100%;transform:scale(1.2)}}dropruler{background:var(--dropruler-bg-color);display:none;height:4px;left:0;margin-top:calc(-2px - var(--pluto-cell-spacing)*.5);position:absolute;right:0}#helpbox-wrapper{bottom:0;display:none;height:0;position:sticky;width:100%;z-index:50}@media (min-width:500px){#helpbox-wrapper{display:block}}pluto-helpbox{background-color:var(--helpbox-bg-color);border-bottom:none;border-right:none;border-top-left-radius:9px;border-top-right-radius:9px;bottom:0;box-shadow:0 0 11px 0 var(--helpbox-box-shadow-color);color:var(--helpbox-text-color);display:flex;flex-direction:column;height:70vh;height:min(70vh,900px);position:absolute;right:20px;width:calc(100vw - 781px);width:clamp(300px,calc(100vw - 781px),450px)}pluto-helpbox>header{background-color:var(--helpbox-header-bg-color);border-top-left-radius:6px;border-top-right-radius:6px;color:var(--helpbox-header-color);display:flex;font-family:Roboto Mono,monospace;font-size:.9rem;font-weight:700;padding:15px}pluto-helpbox>header:before{content:"📖 ";margin-right:10px}pluto-helpbox.hidden>header:before{content:"📚 ";margin-right:10px}pluto-helpbox>header>input{background-color:inherit;border:none;color:inherit;flex-grow:1;font-family:inherit;font-size:inherit;font-weight:inherit}pluto-helpbox.notfound>header>input{color:var(--helpbox-notfound-header-color)}pluto-helpbox>header>input:focus{outline:none}pluto-helpbox>header>button{background:none;border:15px solid transparent;cursor:pointer;margin:-15px}pluto-helpbox>header>button>span{background-image:url(chevron-down-outline.1efaf1cc.svg);background-size:1em 1em;content:" "!important;display:block;filter:var(--image-filters);height:1em;width:1em}pluto-helpbox.hidden{cursor:pointer;height:auto}pluto-helpbox.hidden>section{display:none}pluto-helpbox{font-family:Lato,-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:.9rem;line-height:1.5}pluto-helpbox .cm-line,pluto-helpbox code,pluto-helpbox pre{font-family:Roboto Mono,SFMono-Regular,Menlo,Consolas,Liberation Mono,DejaVu Sans Mono,monospace;font-size:.95em;line-height:normal}pluto-helpbox pre code{font-size:1em}pluto-helpbox code .cm-editor .cm-content,pluto-helpbox pre code.hljs{padding:0}pluto-helpbox img{max-width:100%}pluto-helpbox>section{height:100%;overflow:auto;padding:10px}pluto-helpbox>section h1,pluto-helpbox>section h2,pluto-helpbox>section h3,pluto-helpbox>section h4,pluto-helpbox>section h5,pluto-helpbox>section h6{border-bottom:none;font-family:inherit;font-size:1rem}pluto-helpbox>section h1{font-size:1.3rem}pluto-helpbox>section pre{-webkit-overflow-scrolling:touch;word-wrap:normal;background:var(--code-section-bg-color);border:1px solid var(--code-section-border-color);border-radius:4px;overflow-x:auto;padding:.7rem .5rem;white-space:pre}pluto-helpbox>section hr{border:none;border-top:3px solid var(--rule-color)}.pluto-docs-binding{background:var(--docs-binding-bg);border-radius:1em;color:var(--pluto-output-color);margin:.5em;padding:1em}.pluto-docs-binding>span{background:var(--pluto-output-bg-color);border-radius:7px;color:var(--black);display:inline-block;font-family:var(--julia-mono-font-stack);font-size:.9rem;font-weight:700;margin-top:-1em;padding:4px;transform:translate(-19px,-16px)}footer{background-color:var(--footer-bg-color);color:var(--footer-color);font-family:Roboto Mono,monospace;font-size:.75rem;min-height:3.5rem;width:100%;z-index:70}footer form{display:flex;flex-wrap:wrap;min-height:1.5rem;opacity:1;transition:opacity 5s}footer form>*{flex:0 0 auto}footer form>a,footer form>label{align-self:center}footer form>a,footer form>label{margin-right:1em}footer a{color:var(--footer-atag-color);font-weight:700;opacity:.6}@media (max-width:650px){footer form>label{display:none}}footer input{background:transparent;border:2px solid var(--footer-input-border-color);border-radius:3px 0 0 3px;border-right:none;font-family:inherit;font-size:inherit;margin:0;padding:3px}footer button,header#pluto-nav pluto-filepicker button{background:var(--footer-filepicker-focus-color);border:3px solid var(--footer-filepicker-focus-color);border-radius:0 3px 3px 0;color:var(--footer-filepicker-button-color);font-family:inherit;font-size:.75rem;font-weight:600;height:auto;margin:0}#info{align-items:center;display:flex;flex-direction:row;justify-content:flex-end;margin:0 auto;max-width:9400px;padding:1rem;text-align:right}nav#undo_delete{background-color:var(--white);border-radius:3px;bottom:0;box-shadow:0 0 10px 2px var(--undo-delete-box-shadow-color);color:var(--black);display:block;font-family:Roboto Mono,monospace;font-size:.75rem;left:0;margin:.75rem;opacity:1;padding:.5rem;position:fixed;transition:box-shadow .2s linear,margin-bottom .2s ease-out,opacity .05s linear;z-index:1000}nav#undo_delete.hidden{box-shadow:0 0 10px -5px var(--undo-delete-box-shadow-color);margin-bottom:0;opacity:0;pointer-events:none}@keyframes shadow-fadeout{0%{box-shadow:0 0 10px 2px var(--undo-delete-box-shadow-color);opacity:1}80%{opacity:1}to{opacity:0}}pluto-logs-container{background:hsl(0deg 0% 100%/81%);display:block;max-height:calc(100% + 14px);overflow-x:auto;position:absolute;right:min(-100px,-100vw + (700px + 25px));top:1px;width:max(100px,100vw - (700px + 25px));z-index:25}pluto-logs{display:flex!important}pluto-logs-container{position:static;width:100%}pluto-logs-container:not(:empty){background:var(--pluto-logs-bg-color);padding:10px}pluto-logs-container pluto-progress-bars pluto-progress:not(:first-child){margin-top:10px}pluto-logs-container pluto-progress-bar{--c:var(--pluto-logs-progress-fill);background:linear-gradient(90deg,var(--c),var(--c));background-repeat:no-repeat;padding:1px 3px;transition:background-size 2s cubic-bezier(.14,.71,0,.99),opacity .2s linear;width:100%}pluto-logs-container pluto-progress-bar.collapsed{height:0}pluto-logs{display:grid;flex-direction:row;grid-auto-flow:column;grid-auto-rows:15px;grid-template-columns:repeat(auto-fill,10px);grid-template-rows:repeat(auto-fill,15px)}pluto-logs:not(:first-child):not(:empty){margin-top:10px}pluto-log-dot-positioner{display:block;transition:transform .1s ease-in-out;width:10px}pluto-log-dot-positioner.inspecting,pluto-log-dot-positioner:hover{z-index:5}pluto-log-dot-positioner.inspecting{transform:translateX(5px)}pluto-log-dot-positioner.inspecting pluto-log-dot{box-shadow:0 0 10px rgba(0,0,0,.2)}pluto-log-dot-positioner.inspecting~pluto-log-dot-positioner{transform:translateX(10px)}pluto-log-dot-sizer{display:block;max-width:600px;pointer-events:none;transform:translateZ(10px);width:max-content;z-index:300}pluto-log-dot{background:var(--jl-info-color);border:3px solid var(--jl-info-accent-color);border-radius:7px;box-shadow:-2px 0 1px #00000014;display:inline-flex;flex-direction:column;font-family:Roboto Mono,monospace;font-size:.6rem;min-height:18px;min-width:18px;padding:1px 3px;pointer-events:auto}pluto-log-dot.Warn{background:var(--jl-warn-color);border:3px solid var(--jl-warn-accent-color)}pluto-log-dot.Error{background:var(--jl-danger-color);border:3px solid var(--jl-danger-accent-color)}pluto-log-dot.Debug{background:var(--jl-debug-color);border:3px solid var(--jl-debug-accent-color)}pluto-log-dot.Progress{background:#94949466;border:3px solid var(--pluto-logs-progress-border);overflow:hidden;padding:0;width:100px}pluto-log-dot.Stdout{--inner:#71624b;--outer:#50483f;background:radial-gradient(var(--inner),var(--inner) 20%,var(--outer));border:6px solid #b7b7b7;color:#8ed975;min-width:18em;text-shadow:1px 1px 2px #0000005e}pluto-log-dot.Stdout:after,pluto-log-dot.Stdout:before{bottom:6px;content:" ";display:block;left:6px;pointer-events:none;position:absolute;right:6px;top:6px}pluto-log-dot.Stdout:before{background:linear-gradient(349deg,#000,transparent);opacity:.3}pluto-log-dot.Stdout:after{--crt-spacing:7px;animation:scroll-crt 1s linear infinite;animation-play-state:paused;background:linear-gradient(180deg,#534837,transparent,#1a1a1a);background-repeat:repeat;background-size:100% var(--crt-spacing);opacity:.2}pluto-log-dot.Stdout pre:before{content:" ";float:right;width:24px}a.stdout-info{pointer-events:auto;position:absolute;right:2px;top:2px;z-index:50}@keyframes scroll-crt{0%{background-position:0 0}to{background-position:0 var(--crt-spacing)}}@media (prefers-reduced-motion:no-preference){pluto-log-dot.Stdout:hover:after{animation-play-state:running}}pluto-log-dot jlerror{background:var(--main-bg-color);border-radius:.5rem;display:block;padding:.6rem}pluto-log-dot jlpair,pluto-log-dot jltree{font-size:.6rem}pluto-log-dot>img{max-width:100px}pluto-log-dot-kwarg{display:flex;flex-direction:row;flex-wrap:wrap}pluto-log-dot-kwarg>*{flex:0 1 auto}pluto-log-dot-kwarg>pluto-key{color:var(--pluto-schema-types-color);margin-right:calc(1em - 30px)}pluto-log-dot-kwarg>pluto-key:after{content:": "}pluto-log-dot-kwarg>pluto-value{margin-left:30px}body.presentation pluto-output h1,body.presentation pluto-output h2{margin-top:100vh}body.presentation pluto-notebook{padding-bottom:100vh}body.presentation #helpbox-wrapper{display:none!important}nav#slide_controls{display:none}body.presentation nav#slide_controls{bottom:0;display:flex;position:fixed;right:0;z-index:100}nav#slide_controls>button{padding:5px;position:static}nav#slide_controls>button>span:after{background-size:30px 30px;content:" "!important;display:block;height:30px;width:30px}nav#slide_controls>button.prev>span:after{background-image:url(arrow-back-outline.9ae1bed8.svg);filter:var(--image-filters)}nav#slide_controls>button.next>span:after{background-image:url(arrow-forward-outline.f5f68f5c.svg);filter:var(--image-filters)}.cm-editor .cm-tooltip{border:1px solid var(--cm-editor-tooltip-border-color);border-radius:4px;box-shadow:3px 3px 4px rgb(0 0 0/20%)}.cm-tooltip-autocomplete{box-sizing:content-box;max-height:320px;z-index:100}.cm-tooltip.cm-completionInfo.cm-completionInfo-right:empty{display:none}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li{border-radius:3px;height:16px;line-height:16px;overflow-y:hidden}pluto-input .cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li{height:unset}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li[aria-selected]{background:var(--cm-editor-li-aria-selected-bg-color);color:var(--cm-editor-li-aria-selected-color)}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li[aria-selected] .cm-completionLabel{border-color:transparent}.cm-editor .cm-tooltip.cm-tooltip-autocomplete li.c_notexported{color:var(--cm-editor-li-notexported-color)}.cm-editor .cm-completionIcon{opacity:1;transform:translateY(-1.5px);width:1em}.cm-completionIcon:before{color:transparent;content:"⚫";font-family:var(--julia-mono-font-stack)!important;font-size:.75rem;margin-right:.5em;opacity:1}[data-pluto-variable]{font-weight:inherit}.cm-editor .cm-tooltip.cm-tooltip-autocomplete li.c_from_notebook .cm-completionLabel,[data-pluto-variable]{font-weight:700;text-decoration:underline;text-decoration-color:#ced2ef;text-decoration-skip-ink:none;text-decoration-thickness:3px}@media (prefers-color-scheme:dark){[data-pluto-variable]{text-decoration-color:#5d5f70}}[data-ctrl-down=true][data-cell-variable],[data-ctrl-down=true][data-pluto-variable]{cursor:pointer;text-decoration-color:#d177e6}[data-ctrl-down=true][data-pluto-variable]:hover,[data-ctrl-down=true][data-pluto-variable]:hover *{color:transparent!important;text-shadow:0 0 #af5bc3}[data-cell-variable]{text-decoration:none}[data-ctrl-down=true][data-cell-variable]:hover *{color:transparent!important;text-shadow:0 0 #af5bc3}.cm-tooltip.cm-tooltip-autocomplete{background:var(--autocomplete-menu-bg-color);margin-left:-1.5em;padding:0}.cm-editor .cm-tooltip-autocomplete .cm-completionLabel,pluto-input .cm-editor .cm-content,pluto-input .cm-editor .cm-scroller{font-family:var(--julia-mono-font-stack)!important;font-size:.75rem;font-variant-ligatures:none}pluto-input .cm-editor .cm-content{padding:2px 0}.cm-editor .cm-selectionBackground{background:var(--cm-selection-background-blurred)}.cm-editor.cm-focused .cm-selectionBackground{background:var(--cm-selection-background)}.cm-editor{background:var(--code-background);color:var(--cm-editor-text-color)}.cm-editor.cm-focused:not(.__){outline:unset}.cm-editor .cm-gutter{min-height:23px;min-width:31px}.cm-editor .cm-gutters{background:transparent;border-right:1px solid transparent}pluto-cell.code_differs .cm-editor .cm-gutters{background-color:var(--cm-code-differs-gutters-color)}.cm-editor .cm-lineNumbers .cm-gutterElement{color:transparent}.cm-editor .cm-lineNumbers .cm-gutterElement:after{color:var(--cm-line-numbers-color);content:"⋅";font-size:.75rem;pointer-events:none;position:absolute;right:3px}.cm-editor .cm-lineNumbers .cm-gutterElement:hover{color:var(--cm-line-numbers-color)}.cm-editor .cm-lineNumbers .cm-gutterElement:hover:after{color:transparent}.cm-completionIcon-c_Number:before{color:var(--cm-number-color)}.cm-completionIcon-c_String:before,.cm-completionIcon-completion_dict:before,.cm-completionIcon-completion_path:before{color:var(--cm-string-color)}.cm-completionIcon-c_Any:before,pluto-output>assignee{color:var(--cm-var-color)!important;font-weight:700}.cm-completionIcon-c_Function:before{color:var(--cm-function-color)}.cm-completionIcon-c_Array:before{color:var(--cm-bracket-color)}.cm-completionIcon-c_Module:before,.cm-completionIcon-c_package:before{color:var(--cm-link-color)}.cm-editor .cm-activeLine{background:unset}.cm-selectionMatch{background:none!important;text-shadow:0 0 8px rgba(0,0,0,.5)}@media (prefers-color-scheme:dark){.cm-selectionMatch{background:none!important;text-shadow:0 0 8px hsla(0,0%,100%,.5)}}.cm-editor .cm-matchingBracket,.cm-editor .cm-nonmatchingBracket{background-color:unset;color:unset}pluto-input:focus-within .cm-editor .cm-matchingBracket{background-color:var(--cm-matchingBracket-bg-color);border-radius:2px;color:var(--cm-matchingBracket-color)!important;font-weight:700}.cm-editor .cm-placeholder{color:var(--cm-placeholder-text-color);font-style:italic}.cm-completionMatchedText{text-decoration:unset!important}.awesome-wrapping-plugin-the-line{--correction:0px;margin-left:calc(var(--indented));text-indent:calc(var(--indented)*-1)}.awesome-wrapping-plugin-the-line>*{text-indent:0}.awesome-wrapping-plugin-the-tabs{margin-left:-1px;vertical-align:top;white-space:pre}pluto-cell.hooked_up{--pluto-cell-force-color:#00b9ff7a}pluto-cell.hooked_up pluto-trafficlight{background-color:var(--pluto-cell-force-color)!important}pluto-cell.hooked_up pluto-input .cm-editor{border-color:var(--pluto-cell-force-color);border-width:2px;border-left:none;border-top:none}pluto-cell.hooked_up>pluto-runarea{background-color:var(--pluto-cell-force-color);opacity:1}pluto-cell.hooked_up pluto-runarea>span{color:#0000004f}pluto-cell.hooked_up pluto-output{border-bottom:2px solid;border-right:2px solid;border-color:var(--pluto-cell-force-color);border-top:2px solid;border-top-color:var(--pluto-cell-force-color);border-top-right-radius:4px}.fm-table{display:grid;gap:.3em 1em;grid-template-columns:auto 1fr min-content}.pluto-frontmatter{background:var(--white);color:var(--black);font-family:var(--system-ui-font-stack);width:min(31rem,90vw)}.pluto-frontmatter button{cursor:pointer}.pluto-frontmatter .deletefield{align-self:baseline}.pluto-frontmatter .addentry{background-color:transparent;grid-column:1/3;margin-top:.5em}.pluto-frontmatter .final{display:flex;gap:.5em;justify-content:flex-end;margin-top:2rem} \ No newline at end of file diff --git a/frontend-dist/editor.40c84c82.js b/frontend-dist/editor.40c84c82.js new file mode 100644 index 0000000000..89a31cfe81 --- /dev/null +++ b/frontend-dist/editor.40c84c82.js @@ -0,0 +1,887 @@ +(()=>{function e(e,t,i,n){Object.defineProperty(e,t,{get:i,set:n,enumerable:!0,configurable:!0})}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i={},n={},r=t.parcelRequire94c2;null==r&&((r=function(e){if(e in i)return i[e].exports;if(e in n){var t=n[e];delete n[e];var r={id:e,exports:{}};return i[e]=r,t.call(r.exports,r,r.exports),r.exports}var s=new Error("Cannot find module '"+e+"'");throw s.code="MODULE_NOT_FOUND",s}).register=function(e,t){n[e]=t},t.parcelRequire94c2=r),r.register("jTduX",(function(t,i){var n,r;e(t.exports,"register",(()=>n),(e=>n=e)),e(t.exports,"resolve",(()=>r),(e=>r=e));var s={};n=function(e){for(var t=Object.keys(e),i=0;ixe)),e(s,"render",(()=>U)),e(s,"Component",(()=>k)),e(s,"useEffect",(()=>le)),e(s,"useLayoutEffect",(()=>ce)),e(s,"useState",(()=>oe)),e(s,"useRef",(()=>Oe)),e(s,"useMemo",(()=>he)),e(s,"useCallback",(()=>ue)),e(s,"createContext",(()=>j)),e(s,"createRef",(()=>P)),e(s,"useContext",(()=>de)),e(s,"h",(()=>Q)),e(s,"cloneElement",(()=>D)),e(s,"hydrate",(()=>M));var o,a,l,c,O,h,u,d=Object.defineProperty,f=(e,t)=>d(e,"name",{value:t,configurable:!0}),p={},m=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function $(e,t){for(var i in t)e[i]=t[i];return e}function b(e){var t=e.parentNode;t&&t.removeChild(e)}function Q(e,t,i){var n,r,s,a={};for(s in t)"key"==s?n=t[s]:"ref"==s?r=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?o.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===a[s]&&(a[s]=e.defaultProps[s]);return y(e,a,n,r,null)}function y(e,t,i,n,r){var s={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:r??++l};return null==r&&null!=a.vnode&&a.vnode(s),s}function P(){return{current:null}}function w(e){return e.children}function k(e,t){this.props=e,this.context=t}function _(e,t){if(null==t)return e.__?_(e.__,e.__.__k.indexOf(e)+1):null;for(var i;t0?y(d.type,d.props,d.key,null,d.__v):d)){if(d.__=i,d.__b=i.__b+1,null===(u=b[O])||u&&d.key==u.key&&d.type===u.type)b[O]=void 0;else for(h=0;h2&&(a.children=arguments.length>3?o.call(arguments,2):i),y(e.type,a,n||e.key,r||e.ref,null)}function j(e,t){var i={__c:t="__cC"+u++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var i,n;return this.getChildContext||(i=[],(n={})[t]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&i.some(x)},this.sub=function(e){i.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){i.splice(i.indexOf(e),1),t&&t.call(e)}}),e.children}};return i.Provider.__=i.Consumer.contextType=i}f($,"a"),f(b,"h"),f(Q,"v"),f(y,"y"),f(P,"p"),f(w,"d"),f(k,"_"),f(_,"k"),f(v,"b"),f(x,"m"),f(X,"g"),f(S,"w"),f(R,"x"),f((function e(t,i){return i=i||[],null==t||"boolean"==typeof t||(Array.isArray(t)?t.some((function(t){e(t,i)})):i.push(t)),i}),"A"),f(T,"P"),f(W,"C"),f(A,"$"),f(N,"H"),f(C,"I"),f(E,"T"),f(q,"j"),f(V,"z"),f(z,"L"),f(I,"M"),f(Y,"N"),f(Z,"O"),f(U,"S"),f(M,"q"),f(D,"B"),f(j,"D"),o=m.slice,a={__e:function(e,t){for(var i,n,r;t=t.__;)if((i=t.__c)&&!i.__)try{if((n=i.constructor)&&null!=n.getDerivedStateFromError&&(i.setState(n.getDerivedStateFromError(e)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e),r=i.__d),r)return i.__E=i}catch(t){e=t}throw e}},l=0,f((function(e){return null!=e&&void 0===e.constructor}),"i"),k.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=$({},this.state),"function"==typeof e&&(e=e($({},i),this.props)),e&&$(i,e),null!=e&&this.__v&&(t&&this.__h.push(t),x(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),x(this))},k.prototype.render=w,c=[],O="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,X.__r=0,u=0;var G,L,B,F=Object.defineProperty,K=(e,t)=>F(e,"name",{value:t,configurable:!0}),H=0,J=[],ee=a.__b,te=a.__r,ie=a.diffed,ne=a.__c,re=a.unmount;function se(e,t){a.__h&&a.__h(L,e,H||t),H=0;var i=L.__H||(L.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function oe(e){return H=1,ae(be,e)}function ae(e,t,i){var n=se(G++,2);return n.t=e,n.__c||(n.__=[i?i(t):be(void 0,t),function(e){var t=n.t(n.__[0],e);n.__[0]!==t&&(n.__=[t,n.__[1]],n.__c.setState({}))}],n.__c=L),n.__}function le(e,t){var i=se(G++,3);!a.__s&&$e(i.__H,t)&&(i.__=e,i.__H=t,L.__H.__h.push(i))}function ce(e,t){var i=se(G++,4);!a.__s&&$e(i.__H,t)&&(i.__=e,i.__H=t,L.__h.push(i))}function Oe(e){return H=5,he((function(){return{current:e}}),[])}function he(e,t){var i=se(G++,7);return $e(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function ue(e,t){return H=8,he((function(){return e}),t)}function de(e){var t=L.context[e.__c],i=se(G++,9);return i.c=e,t?(null==i.__&&(i.__=!0,t.sub(L)),t.props.value):e.__}function fe(){for(var e;e=J.shift();)if(e.__P)try{e.__H.__h.forEach(me),e.__H.__h.forEach(ge),e.__H.__h=[]}catch(t){e.__H.__h=[],a.__e(t,e.__v)}}K(se,"m"),K(oe,"l"),K(ae,"p"),K(le,"y"),K(ce,"h"),K(Oe,"s"),K((function(e,t,i){H=6,ce((function(){"function"==typeof e?e(t()):e&&(e.current=t())}),null==i?i:i.concat(e))}),"_"),K(he,"d"),K(ue,"A"),K(de,"F"),K((function(e,t){a.useDebugValue&&a.useDebugValue(t?t(e):e)}),"T"),K((function(e){var t=se(G++,10),i=oe();return t.__=e,L.componentDidCatch||(L.componentDidCatch=function(e){t.__&&t.__(e),i[1](e)}),[i[0],function(){i[1](void 0)}]}),"q"),K(fe,"x"),a.__b=function(e){L=null,ee&&ee(e)},a.__r=function(e){te&&te(e),G=0;var t=(L=e.__c).__H;t&&(t.__h.forEach(me),t.__h.forEach(ge),t.__h=[])},a.diffed=function(e){ie&&ie(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==J.push(t)&&B===a.requestAnimationFrame||((B=a.requestAnimationFrame)||function(e){var t,i=K((function(){clearTimeout(n),pe&&cancelAnimationFrame(t),setTimeout(e)}),"u"),n=setTimeout(i,100);pe&&(t=requestAnimationFrame(i))})(fe)),L=null},a.__c=function(e,t){t.some((function(e){try{e.__h.forEach(me),e.__h=e.__h.filter((function(e){return!e.__||ge(e)}))}catch(i){t.some((function(e){e.__h&&(e.__h=[])})),t=[],a.__e(i,e.__v)}})),ne&&ne(e,t)},a.unmount=function(e){re&&re(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach((function(e){try{me(e)}catch(e){t=e}})),t&&a.__e(t,i.__v))};var pe="function"==typeof requestAnimationFrame;function me(e){var t=L,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),L=t}function ge(e){var t=L;e.__c=e.__(),L=t}function $e(e,t){return!e||e.length!==t.length||t.some((function(t,i){return t!==e[i]}))}function be(e,t){return"function"==typeof t?t(e):t}K(me,"g"),K(ge,"j"),K($e,"k"),K(be,"w");var Qe,ye={};Qe=ye,Object.defineProperty(Qe,"__esModule",{value:!0,configurable:!0}),e(ye,"default",(()=>ve));var Pe=Object.defineProperty,we=(e,t)=>Pe(e,"name",{value:t,configurable:!0}),ke=we((function(e,t,i,n){var r;t[0]=0;for(var s=1;s=5&&((r||!e&&5===n)&&(o.push(n,0,r,i),n=6),e&&(o.push(n,e,0,i),n=6)),r=""},l=0;l"===t?(n=1,r=""):r=t+r[0]:s?t===s?s="":r+=t:'"'===t||"'"===t?s=t:">"===t?(a(),n=1):n&&("="===t?(n=5,i=r,r=""):"/"===t&&(n<5||">"===e[l][c+1])?(a(),3===n&&(o=o[0]),n=o,(o=o[0]).push(2,0,n),n=0):" "===t||"\t"===t||"\n"===t||"\r"===t?(a(),n=2):r+=t),3===n&&"!--"===r&&(n=4,o=o[0])}return a(),o}(e)),t),arguments,[])).length>1?t:t[0]}we(ve,"default");const xe=ve.bind(Q);try{null==window.process&&(window.process={}),null==window.process.env&&(window.process.env={}),window.process.env.NODE_ENV="production"}catch(e){console.warn("Couldn't set window.process.env, this might break some things")}function Xe(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n3?t.i-4:t.i:Array.isArray(e)?1:qe(e)?2:Ve(e)?3:0}function Ae(e,t){return 2===We(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ne(e,t){return 2===We(e)?e.get(t):e[t]}function Ce(e,t,i){var n=We(e);2===n?e.set(t,i):3===n?(e.delete(t),e.add(i)):e[t]=i}function Ee(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function qe(e){return ut&&e instanceof Map}function Ve(e){return dt&&e instanceof Set}function ze(e){return e.o||e.t}function Ie(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=bt(e);delete t[gt];for(var i=$t(t),n=0;n1&&(e.set=e.add=e.clear=e.delete=Ze),Object.freeze(e),t&&Te(e,(function(e,t){return Ye(t,!0)}),!0)),e}function Ze(){Xe(2)}function Ue(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Me(e){var t=Qt[e];return t||Xe(18,e),t}function De(e,t){Qt[e]||(Qt[e]=t)}function je(){return Ot}function Ge(e,t){t&&(Me("Patches"),e.u=[],e.s=[],e.v=t)}function Le(e){Be(e),e.p.forEach(Ke),e.p=null}function Be(e){e===Ot&&(Ot=e.l)}function Fe(e){return Ot={p:[],l:Ot,h:e,m:!0,_:0}}function Ke(e){var t=e[gt];0===t.i||1===t.i?t.j():t.g=!0}function He(e,t){t._=t.p.length;var i=t.p[0],n=void 0!==e&&e!==i;return t.h.O||Me("ES5").S(t,e,n),n?(i[gt].P&&(Le(t),Xe(4)),Re(e)&&(e=Je(t,e),t.l||tt(t,e)),t.u&&Me("Patches").M(i[gt],e,t.u,t.s)):e=Je(t,i,[]),Le(t),t.u&&t.v(t.u,t.s),e!==pt?e:void 0}function Je(e,t,i){if(Ue(t))return t;var n=t[gt];if(!n)return Te(t,(function(r,s){return et(e,n,t,r,s,i)}),!0),t;if(n.A!==e)return t;if(!n.P)return tt(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=4===n.i||5===n.i?n.o=Ie(n.k):n.o;Te(3===n.i?new Set(r):r,(function(t,s){return et(e,n,r,t,s,i)})),tt(e,r,!1),i&&e.u&&Me("Patches").R(n,i,e.u,e.s)}return n.o}function et(e,t,i,n,r,s){if(Se(r)){var o=Je(e,r,s&&t&&3!==t.i&&!Ae(t.D,n)?s.concat(n):void 0);if(Ce(i,n,o),!Se(o))return;e.m=!1}if(Re(r)&&!Ue(r)){if(!e.h.N&&e._<1)return;Je(e,r),t&&t.A.l||tt(e,r)}}function tt(e,t,i){void 0===i&&(i=!1),e.h.N&&e.m&&Ye(t,i)}function it(e,t){var i=e[gt];return(i?ze(i):e)[t]}function nt(e,t){if(t in e)for(var i=Object.getPrototypeOf(e);i;){var n=Object.getOwnPropertyDescriptor(i,t);if(n)return n;i=Object.getPrototypeOf(i)}}function rt(e){e.P||(e.P=!0,e.l&&rt(e.l))}function st(e){e.o||(e.o=Ie(e.t))}function ot(e,t,i){var n=qe(t)?Me("MapSet").T(t,i):Ve(t)?Me("MapSet").F(t,i):e.O?function(e,t){var i=Array.isArray(e),n={i:i?1:0,A:t?t.A:je(),P:!1,I:!1,D:{},l:t,t:e,k:null,o:null,j:null,C:!1},r=n,s=yt;i&&(r=[n],s=Pt);var o=Proxy.revocable(r,s),a=o.revoke,l=o.proxy;return n.k=l,n.j=a,l}(t,i):Me("ES5").J(t,i);return(i?i.A:je()).p.push(n),n}function at(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Ie(e)}function lt(){function e(t){if(!Re(t))return t;if(Array.isArray(t))return t.map(e);if(qe(t))return new Map(Array.from(t.entries()).map((function(t){return[t[0],e(t[1])]})));if(Ve(t))return new Set(Array.from(t).map(e));var i=Object.create(Object.getPrototypeOf(t));for(var n in t)i[n]=e(t[n]);return i}function t(t){return Se(t)?e(t):t}var i="add";De("Patches",{$:function(t,n){return n.forEach((function(n){for(var r=n.path,s=n.op,o=t,a=0;a1?s-1:0),a=1;a1?i-1:0),s=1;s=0;i--){var n=t[i];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}var r=Me("Patches").$;return Se(e)?r(e,t):this.produce(e,(function(e){return r(e,t.slice(i+1))}))},e}(),kt=new wt,_t=kt.produce,vt=kt.produceWithPatches.bind(kt),xt=kt.setAutoFreeze.bind(kt),Xt=(kt.setUseProxies.bind(kt),kt.applyPatches.bind(kt)),St=(kt.createDraft.bind(kt),kt.finishDraft.bind(kt),_t);lt(),xt(!1);var Rt=window._;let Tt=()=>{let e=new window.observablehq.Library;return{DOM:e.DOM,Files:e.Files,Generators:e.Generators,Promises:e.Promises,now:e.now,svg:e.svg(),html:e.html(),require:e.require()}};const Wt=Tt(),At=Tt();Wt.DOM,Wt.Files,Wt.Generators;let Nt=Wt.Promises;Wt.now,Wt.svg,Wt.html,Wt.require;const Ct=function e(t,i,n){function r(o,a){if(!i[o]){if(!t[o]){var l=void 0;if(!a&&l)return l(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var O=i[o]={exports:{}};t[o][0].call(O.exports,(function(e){var i=t[o][1][e];return r(i||e)}),O,O.exports,e,t,i,n)}return i[o].exports}for(var s=void 0,o=0;o>>6,i[n++]=128|63&s):s<55296||s>57343?(i[n++]=224|s>>>12,i[n++]=128|s>>>6&63,i[n++]=128|63&s):(s=65536+(s-55296<<10|e.charCodeAt(o++)-56320),i[n++]=240|s>>>18,i[n++]=128|s>>>12&63,i[n++]=128|s>>>6&63,i[n++]=128|63&s);return n-t}function r(e,t,i){var n=this,r=0|t;i||(i=n.length);for(var s="",o=0;r=65536?(o-=65536,s+=String.fromCharCode(55296+(o>>>10),56320+(1023&o))):s+=String.fromCharCode(o));return s}function s(e,t,i,n){var r;i||(i=0),n||0===n||(n=this.length),t||(t=0);var s=n-i;if(e===this&&i=0;r--)e[r+t]=this[r+i];else for(r=0;rthis.buffer.length)throw new Error(m);return this.offset=i,t}return{bufferish:d,write:e,fetch:l,flush:t,push:O,pull:h,read:c,reserve:i,offset:0}}function o(){function e(){var e=this.start;if(e1?this.bufferish.concat(e):e[0];return e.length=0,t}function n(e){var t=0|e;if(this.buffer){var i=this.buffer.length,n=0|this.offset,r=n+t;if(rthis.minBufferSize)this.flush(),this.push(e);else{var i=this.reserve(t);d.prototype.copy.call(e,this.buffer,i)}}return{bufferish:d,write:a,fetch:e,flush:t,push:O,pull:i,read:c,reserve:n,send:r,maxBufferSize:p,minBufferSize:f,offset:0,start:0}}function a(){throw new Error("method not implemented: write()")}function l(){throw new Error("method not implemented: fetch()")}function c(){return this.buffers&&this.buffers.length?(this.flush(),this.pull()):this.fetch()}function O(e){(this.buffers||(this.buffers=[])).push(e)}function h(){return(this.buffers||(this.buffers=[])).shift()}function u(e){function t(t){for(var i in e)t[i]=e[i];return t}return t}i.FlexDecoder=n,i.FlexEncoder=r;var d=e("./bufferish"),f=2048,p=65536,m="BUFFER_SHORTAGE";n.mixin=u(s()),n.mixin(n.prototype),r.mixin=u(o()),r.mixin(r.prototype)},{"./bufferish":8}],22:[function(e,t,i){function n(e){function t(e){var t=c(e),n=i[t];if(!n)throw new Error("Invalid type: "+(t?"0x"+t.toString(16):t));return n(e)}var i=O.getReadToken(e);return t}function r(){var e=this.options;return this.decode=n(e),e&&e.preset&&l.setExtUnpackers(this),this}function s(e,t){(this.extUnpackers||(this.extUnpackers=[]))[e]=h.filter(t)}function o(e){function t(t){return new a(t,e)}return(this.extUnpackers||(this.extUnpackers=[]))[e]||t}var a=e("./ext-buffer").ExtBuffer,l=e("./ext-unpacker"),c=e("./read-format").readUint8,O=e("./read-token"),h=e("./codec-base");h.install({addExtUnpacker:s,getExtUnpacker:o,init:r}),i.preset=r.call(h.preset)},{"./codec-base":9,"./ext-buffer":17,"./ext-unpacker":19,"./read-format":23,"./read-token":24}],23:[function(e,t,i){function n(e){var t=X.hasArrayBuffer&&e&&e.binarraybuffer,i=e&&e.int64;return{map:R&&e&&e.usemap?s:r,array:o,str:a,bin:t?c:l,ext:O,uint8:h,uint16:d,uint32:p,uint64:g(8,i?Q:$),int8:u,int16:f,int32:m,int64:g(8,i?y:b),float32:g(4,P),float64:g(8,w)}}function r(e,t){var i,n={},r=new Array(t),s=new Array(t),o=e.codec.decode;for(i=0;i>>8,r[n]=i}}function c(e){return function(t,i){var n=t.reserve(5),r=t.buffer;r[n++]=e,r[n++]=i>>>24,r[n++]=i>>>16,r[n++]=i>>>8,r[n]=i}}function O(e,t,i,n){return function(r,s){var o=r.reserve(t+1);r.buffer[o++]=e,i.call(r.buffer,s,o,n)}}function h(e,t){new g(this,t,e)}function u(e,t){new $(this,t,e)}function d(e,t){p.write(this,e,t,!1,23,4)}function f(e,t){p.write(this,e,t,!1,52,8)}var p=e("ieee754"),m=e("int64-buffer"),g=m.Uint64BE,$=m.Int64BE,b=e("./write-uint8").uint8,Q=e("./bufferish"),y=Q.global,P=Q.hasBuffer&&"TYPED_ARRAY_SUPPORT"in y&&!y.TYPED_ARRAY_SUPPORT,w=Q.hasBuffer&&y.prototype||{};i.getWriteToken=n},{"./bufferish":8,"./write-uint8":28,ieee754:32,"int64-buffer":33}],27:[function(e,t,i){function n(e){function t(e,t){S[t?195:194](e,t)}function i(e,t){var i=0|t;return t!==i?void S[203](e,t):void S[-32<=i&&i<=127?255&i:0<=i?i<=255?204:i<=65535?205:206:-128<=i?208:-32768<=i?209:210](e,i)}function n(e,t){S[207](e,t.toArray())}function s(e,t){S[211](e,t.toArray())}function m(e){return e<32?1:e<=255?2:e<=65535?3:5}function g(e){return e<32?1:e<=65535?3:5}function $(e){function t(t,i){var n=i.length,r=5+3*n;t.offset=t.reserve(r);var s=t.buffer,o=e(n),a=t.offset+o;n=c.write.call(s,i,a);var l=e(n);if(o!==l){var O=a+l-o,h=a+n;c.copy.call(s,s,O,a,h)}S[1===l?160+n:l<=3?215+l:219](t,n),t.offset+=n}return t}function b(e,t){if(null===t)return y(e,t);if(W(t))return A(e,t);if(r(t))return P(e,t);if(o.isUint64BE(t))return n(e,t);if(a.isInt64BE(t))return s(e,t);var i=e.codec.getExtPacker(t);return i&&(t=i(t)),t instanceof u?_(e,t):void N(e,t)}function Q(e,t){return W(t)?X(e,t):void b(e,t)}function y(e,t){S[192](e,t)}function P(e,t){var i=t.length;S[i<16?144+i:i<=65535?220:221](e,i);for(var n=e.codec.encode,r=0;r=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function g(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var i=e.length;if(0===i)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return D(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return L(e).length;default:if(n)return D(e).length;t=(""+t).toLowerCase(),n=!0}}function $(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,i);case"utf8":case"utf-8":return S(this,t,i);case"ascii":return T(this,t,i);case"latin1":case"binary":return W(this,t,i);case"base64":return X(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function b(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function Q(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,i,n,r);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):y(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function y(e,t,i,n,r){function s(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var o,a=1,l=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,l/=2,c/=2,i/=2}if(r){var O=-1;for(o=i;ol&&(i=l-c),o=i;o>=0;o--){for(var h=!0,u=0;ur&&(n=r):n=r;var s=t.length;if(s%2!=0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var o=0;o239?4:c>223?3:c>191?2:1;if(r+h<=i)switch(h){case 1:c<128&&(O=c);break;case 2:128==(192&(s=e[r+1]))&&(l=(31&c)<<6|63&s)>127&&(O=l);break;case 3:s=e[r+1],o=e[r+2],128==(192&s)&&128==(192&o)&&(l=(15&c)<<12|(63&s)<<6|63&o)>2047&&(l<55296||l>57343)&&(O=l);break;case 4:s=e[r+1],o=e[r+2],a=e[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&c)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&l<1114112&&(O=l)}null===O?(O=65533,h=1):O>65535&&(O-=65536,n.push(O>>>10&1023|55296),O=56320|1023&O),n.push(O),r+=h}return R(n)}function R(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var i="",n=0;nn)&&(i=n);for(var r="",s=t;si)throw new RangeError("Trying to access beyond buffer length")}function E(e,t,i,n,r,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function q(e,t,i,n){t<0&&(t=65535+t+1);for(var r=0,s=Math.min(e.length-i,2);r>>8*(n?r:1-r)}function V(e,t,i,n){t<0&&(t=4294967295+t+1);for(var r=0,s=Math.min(e.length-i,4);r>>8*(n?r:3-r)&255}function z(e,t,i,n,r,s){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function I(e,t,i,n,r){return r||z(e,t,i,4,34028234663852886e22,-34028234663852886e22),H.write(e,t,i,n,23,4),i+4}function Y(e,t,i,n,r){return r||z(e,t,i,8,17976931348623157e292,-17976931348623157e292),H.write(e,t,i,n,52,8),i+8}function Z(e){if((e=U(e).replace(te,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function D(e,t){t=t||1/0;for(var i,n=e.length,r=null,s=[],o=0;o55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function j(e){for(var t=[],i=0;i>8,r=i%256,s.push(r),s.push(n);return s}function L(e){return K.toByteArray(Z(e))}function B(e,t,i,n){for(var r=0;r=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function F(e){return e!=e}var K=e("base64-js"),H=e("ieee754"),J=e("isarray");n.Buffer=o,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),n.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,i){return a(null,e,t,i)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,i){return c(null,e,t,i)},o.allocUnsafe=function(e){return O(null,e)},o.allocUnsafeSlow=function(e){return O(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var i=e.length,n=t.length,r=0,s=Math.min(i,n);r0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},o.prototype.compare=function(e,t,i,n,r){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var s=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(t>>>=0),l=Math.min(s,a),c=this.slice(n,r),O=e.slice(t,i),h=0;hr)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return P(this,e,t,i);case"utf8":case"utf-8":return w(this,e,t,i);case"ascii":return k(this,e,t,i);case"latin1":case"binary":return _(this,e,t,i);case"base64":return v(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;o.prototype.slice=function(e,t){var i,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(r*=256);)n+=this[e+--t]*r;return n},o.prototype.readUInt8=function(e,t){return t||C(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||C(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||C(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,i){e|=0,t|=0,i||C(e,t,this.length);for(var n=this[e],r=1,s=0;++s=(r*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,i){e|=0,t|=0,i||C(e,t,this.length);for(var n=t,r=1,s=this[e+--n];n>0&&(r*=256);)s+=this[e+--n]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||C(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt16BE=function(e,t){t||C(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},o.prototype.readInt32LE=function(e,t){return t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||C(e,4,this.length),H.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||C(e,4,this.length),H.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||C(e,8,this.length),H.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||C(e,8,this.length),H.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,i,n){e=+e,t|=0,i|=0,n||E(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,s=0;for(this[t]=255&e;++s=0&&(s*=256);)this[t+r]=e/s&255;return t+i},o.prototype.writeUInt8=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):q(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):q(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):V(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):V(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);E(this,e,t,i,r-1,-r)}var s=0,o=1,a=0;for(this[t]=255&e;++s>0)-a&255;return t+i},o.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t|=0,!n){var r=Math.pow(2,8*i-1);E(this,e,t,i,r-1,-r)}var s=i-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+i},o.prototype.writeInt8=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):q(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):q(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):V(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,i){return e=+e,t|=0,i||E(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):V(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,i){return I(this,e,t,!0,i)},o.prototype.writeFloatBE=function(e,t,i){return I(this,e,t,!1,i)},o.prototype.writeDoubleLE=function(e,t,i){return Y(this,e,t,!0,i)},o.prototype.writeDoubleBE=function(e,t,i){return Y(this,e,t,!1,i)},o.prototype.copy=function(e,t,i,n){if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--r)e[r+t]=this[r+i];else if(s<1e3||!o.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=t;s0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function r(e){return 3*e.length/4-n(e)}function s(e){var t,i,r,s,o,a,l=e.length;o=n(e),a=new h(3*l/4-o),r=o>0?l-4:l;var c=0;for(t=0,i=0;t>16&255,a[c++]=s>>8&255,a[c++]=255&s;return 2===o?(s=O[e.charCodeAt(t)]<<2|O[e.charCodeAt(t+1)]>>4,a[c++]=255&s):1===o&&(s=O[e.charCodeAt(t)]<<10|O[e.charCodeAt(t+1)]<<4|O[e.charCodeAt(t+2)]>>2,a[c++]=s>>8&255,a[c++]=255&s),a}function o(e){return c[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}function a(e,t,i){for(var n,r=[],s=t;sO?O:l+o));return 1===n?(t=e[i-1],r+=c[t>>2],r+=c[t<<4&63],r+="=="):2===n&&(t=(e[i-2]<<8)+e[i-1],r+=c[t>>10],r+=c[t>>4&63],r+=c[t<<2&63],r+="="),s.push(r),s.join("")}i.byteLength=r,i.toByteArray=s,i.fromByteArray=l;for(var c=[],O=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,f=u.length;d>1,O=-7,h=i?r-1:0,u=i?-1:1,d=e[t+h];for(h+=u,s=d&(1<<-O)-1,d>>=-O,O+=a;O>0;s=256*s+e[t+h],h+=u,O-=8);for(o=s&(1<<-O)-1,s>>=-O,O+=n;O>0;o=256*o+e[t+h],h+=u,O-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),s-=c}return(d?-1:1)*o*Math.pow(2,s-n)},i.write=function(e,t,i,n,r,s){var o,a,l,c=8*s-r-1,O=(1<>1,u=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,f=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=O):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+h>=1?u/l:u*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=O?(a=0,o=O):o+h>=1?(a=(t*l-1)*Math.pow(2,r),o+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,r),o=0));r>=8;e[i+d]=255&a,d+=f,a/=256,r-=8);for(o=o<0;e[i+d]=255&o,d+=f,o/=256,c-=8);e[i+d-f]|=128*p}},{}],33:[function(e,t,i){(function(e){!function(t){function i(e,i,d){function Q(e,t,i,n){return this instanceof Q?k(this,e,t,i,n):new Q(e,t,i,n)}function w(e){return!(!e||!e[I])}function k(e,t,i,n,r){g&&$&&(t instanceof $&&(t=new g(t)),n instanceof $&&(n=new g(n))),t||i||n||f?(o(t,i)||(r=i,n=t,i=0,t=new(f||Array)(8)),e.buffer=t,e.offset=i|=0,p!==typeof n&&("string"==typeof n?_(t,i,n,r||10):o(n,r)?a(t,i,n,r):"number"==typeof r?(X(t,i+R,n),X(t,i+T,r)):n>0?E(t,i,n):n<0?q(t,i,n):a(t,i,b,0))):e.buffer=l(b,0)}function _(e,t,i,n){var r=0,s=i.length,o=0,a=0;"-"===i[0]&&r++;for(var l=r;r=0))break;a=a*n+c,o=o*n+Math.floor(a/y),a%=y}l&&(o=~o,a?a=y-a:o++),X(e,t+R,o),X(e,t+T,a)}function v(){var e=this.buffer,t=this.offset,i=S(e,t+R),n=S(e,t+T);return d||(i|=0),i?i*y+n:n}function x(e){var t=this.buffer,i=this.offset,n=S(t,i+R),r=S(t,i+T),s="",o=!d&&2147483648&n;for(o&&(n=~n,r=y-r),e=e||10;;){var a=n%e*y+r;if(n=Math.floor(n/e),r=Math.floor(a/e),s=(a%e).toString(e)+s,!n&&!r)break}return o&&(s="-"+s),s}function X(e,t,i){e[t+C]=255&i,i>>=8,e[t+N]=255&i,i>>=8,e[t+A]=255&i,i>>=8,e[t+W]=255&i}function S(e,t){return e[t+W]*P+(e[t+A]<<16)+(e[t+N]<<8)+e[t+C]}var R=i?0:4,T=i?4:0,W=i?0:3,A=i?1:2,N=i?2:1,C=i?3:0,E=i?c:h,q=i?O:u,V=Q.prototype,z="is"+e,I="_"+z;return V.buffer=void 0,V.offset=0,V[I]=!0,V.toNumber=v,V.toString=x,V.toJSON=v,V.toArray=n,m&&(V.toBuffer=r),g&&(V.toArrayBuffer=s),Q[z]=w,t[e]=Q,Q}function n(e){var t=this.buffer,i=this.offset;return f=null,!1!==e&&0===i&&8===t.length&&Q(t)?t:l(t,i)}function r(t){var i=this.buffer,n=this.offset;if(f=m,!1!==t&&0===n&&8===i.length&&e.isBuffer(i))return i;var r=new m(8);return a(r,0,i,n),r}function s(e){var t=this.buffer,i=this.offset,n=t.buffer;if(f=g,!1!==e&&0===i&&n instanceof $&&8===n.byteLength)return n;var r=new g(8);return a(r,0,t,i),r.buffer}function o(e,t){var i=e&&e.length;return t|=0,i&&t+8<=i&&"string"!=typeof e[t]}function a(e,t,i,n){t|=0,n|=0;for(var r=0;r<8;r++)e[t++]=255&i[n++]}function l(e,t){return Array.prototype.slice.call(e,t,t+8)}function c(e,t,i){for(var n=t+8;n>t;)e[--n]=255&i,i/=256}function O(e,t,i){var n=t+8;for(i++;n>t;)e[--n]=255&-i^255,i/=256}function h(e,t,i){for(var n=t+8;tnew Uint8Array(e.buffer);qt.addExtPacker(17,Int8Array,Vt),qt.addExtPacker(18,Uint8Array,Vt),qt.addExtPacker(19,Int16Array,Vt),qt.addExtPacker(20,Uint16Array,Vt),qt.addExtPacker(21,Int32Array,Vt),qt.addExtPacker(22,Uint32Array,Vt),qt.addExtPacker(23,Float32Array,Vt),qt.addExtPacker(24,Float64Array,Vt),qt.addExtPacker(18,Uint8ClampedArray,Vt),qt.addExtPacker(18,ArrayBuffer,(e=>new Uint8Array(e))),qt.addExtPacker(18,DataView,Vt),qt.addExtPacker(13,Date,(e=>new BigInt64Array([BigInt(+e)]))),qt.addExtUnpacker(13,(e=>{if("getBigInt64"in DataView.prototype){let t=new DataView(e.buffer,e.byteOffset,e.byteLength).getBigInt64(0,!0);if(t>Number.MAX_SAFE_INTEGER)throw new Error("Can't read too big number as date (how far in the future is this?!)");return new Date(Number(t))}return new Date(NaN)})),qt.addExtUnpacker(17,(e=>new Int8Array(e.buffer))),qt.addExtUnpacker(18,(e=>new Uint8Array(e.buffer))),qt.addExtUnpacker(19,(e=>new Int16Array(e.buffer))),qt.addExtUnpacker(20,(e=>new Uint16Array(e.buffer))),qt.addExtUnpacker(21,(e=>new Int32Array(e.buffer))),qt.addExtUnpacker(22,(e=>new Uint32Array(e.buffer))),qt.addExtUnpacker(23,(e=>new Float32Array(e.buffer))),qt.addExtUnpacker(24,(e=>new Float64Array(e.buffer)));const zt=e=>Et.encode(e,{codec:qt}),It=e=>Et.decode(e,{codec:qt});var Yt=Object.defineProperty,Zt=(e,t)=>Yt(e,"name",{value:t,configurable:!0}),Ut=Zt((e=>void 0===e||"auto"===e||"instant"===e||"smooth"===e),"checkBehavior");function Mt(e,t){this.scrollLeft=e,this.scrollTop=t}Zt(Mt,"elementScrollXY");var Dt=Zt(((e,t,i="cannot convert to dictionary.")=>`Failed to execute '${e}' on '${t}': ${i}`),"failedExecute"),jt=Zt(((e,t,i)=>Dt(e,t,`The provided value '${i}' is not a valid enum value of type ScrollBehavior.`)),"failedExecuteInvalidEnumValue"),Gt=Zt(((e,t,i)=>{var n;let r=`__SEAMLESS.BACKUP$${t}`;return!e[r]&&e[t]&&!(null!==(n=e[t])&&void 0!==n&&n.__isPolyfill)&&(e[r]=e[t]),e[r]||i}),"backupMethod"),Lt=Zt((e=>{let t=typeof e;return null!==e&&("object"===t||"function"===t)}),"isObject"),Bt=Zt((()=>"scrollBehavior"in window.document.documentElement.style),"isScrollBehaviorSupported"),Ft=Zt((e=>{Object.defineProperty(e,"__isPolyfill",{value:!0})}),"markPolyfill"),Kt=Zt(((e,t)=>{Ft(t),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach((i=>{Gt(i,e),i[e]=t}))}),"modifyPrototypes"),Ht=Zt((e=>e.ownerDocument.scrollingElement||e.ownerDocument.documentElement),"scrollingElement"),Jt=Zt((e=>.5*(1-Math.cos(Math.PI*e))),"ease");function ei(){var e;let t;return t=null!==(e=window.performance)&&void 0!==e&&e.now?Zt((()=>window.performance.now()),"fn"):Zt((()=>window.Date.now()),"fn"),ei=t,t()}Zt(ei,"now");var ti=Zt((e=>{let t=(ei()-e.timeStamp)/(e.duration||500);if(t>1)return e.method(e.targetX,e.targetY),void e.callback();let i=(e.timingFunc||Jt)(t),n=e.startX+(e.targetX-e.startX)*i,r=e.startY+(e.targetY-e.startY)*i;e.method(n,r),e.rafId=window.requestAnimationFrame((()=>{ti(e)}))}),"step"),ii=Zt((e=>isFinite(e)?Number(e):0),"nonFinite"),ni=Zt((e=>{var t;return null!==(t=e.isConnected)&&void 0!==t?t:!(e.ownerDocument&&1&e.ownerDocument.compareDocumentPosition(e))}),"isConnected"),ri=Zt(((e,t,i)=>{var n,r;if(!ni(e))return;let s=e.scrollLeft,o=e.scrollTop,a=ii(null!==(n=t.left)&&void 0!==n?n:s),l=ii(null!==(r=t.top)&&void 0!==r?r:o);if(a===s&&l===o)return;let c=Gt(HTMLElement.prototype,"scroll",Mt),O=Gt(Object.getPrototypeOf(e),"scroll",c).bind(e);if("smooth"!==t.behavior)return void O(a,l);let h=Zt((()=>{window.removeEventListener("wheel",d),window.removeEventListener("touchmove",d)}),"removeEventListener"),u=Object.assign(Object.assign({},i),{timeStamp:ei(),startX:s,startY:o,targetX:a,targetY:l,rafId:0,method:O,callback:h}),d=Zt((()=>{window.cancelAnimationFrame(u.rafId),h()}),"cancelScroll");window.addEventListener("wheel",d,{passive:!0,once:!0}),window.addEventListener("touchmove",d,{passive:!0,once:!0}),ti(u)}),"scrollWithOptions"),si=Zt((e=>e.window===e),"isWindow"),oi=Zt((e=>(t,i,n)=>{let[r,s]=si(t)?[Ht(t.document.documentElement),"Window"]:[t,"Element"],o=i??{};if(!Lt(o))throw new TypeError(Dt(e,s));if(!Ut(o.behavior))throw new TypeError(jt(e,s,o.behavior));"scrollBy"===e&&(o.left=ii(o.left)+r.scrollLeft,o.top=ii(o.top)+r.scrollTop),ri(r,o,n)}),"createScroll"),ai=oi("scroll"),li=oi("scrollTo"),ci=oi("scrollBy"),Oi=ai,hi=Zt(((e,t)=>i=>{if(Bt())return;let n={scroll:ai,scrollTo:li,scrollBy:ci}[e];t(e,(function(){let e=arguments;if(1===arguments.length)return void n(this,e[0],i);let t=e[0],r=e[1];n(this,{left:t,top:r})}))}),"createPolyfill"),ui=hi("scroll",Kt),di=hi("scrollTo",Kt),fi=hi("scrollBy",Kt),pi=Zt(((e,t)=>{Ft(t),Gt(window,e),window[e]=t}),"modifyWindow"),mi=hi("scroll",pi),gi=hi("scrollTo",pi),$i=hi("scrollBy",pi),bi=Zt((e=>{switch(e){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":return 0;case"vertical-rl":case"tb":case"tb-rl":return 1;case"vertical-lr":case"tb-lr":return 2;case"sideways-rl":return 3;case"sideways-lr":return 4}return 0}),"normalizeWritingMode"),Qi=Zt(((e,t,i,n)=>{let r=0;switch(t||(r^=2),e){case 0:r=r>>1|(1&r)<<1,[i,n]=[n,i];break;case 1:case 3:r^=1;break;case 4:r^=2}return[r,i,n]}),"calcPhysicalAxis"),yi=Zt((e=>1==(1&Qi(bi(e.writingMode),"rtl"!==e.direction,void 0,void 0)[0])),"isXReversed"),Pi=Zt(((e,t,i)=>{let[n,r,s]=Qi(t,i,e.block||"start",e.inline||"nearest");return[r,s].map(((e,t)=>{switch(e){case"center":return 1;case"nearest":return 0;default:return"start"===e==!(n>>t&1)?2:3}}))}),"toPhysicalAlignment"),wi=Zt(((e,t,i,n,r,s,o)=>0!==e?e:ri||r>t&&s=i&&o>=n?2:s>i&&on?3:null),"mapNearest"),ki=Zt((e=>"visible"!==e&&"clip"!==e),"canOverflow"),_i=Zt((e=>{var t;try{return(null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.frameElement)||null}catch{return null}}),"getFrameElement"),vi=Zt(((e,t)=>(e.clientHeight{let t=e.parentNode,i=e.parentElement;if(null===i&&null!==t){if(11===t.nodeType)return t.host;if(9===t.nodeType)return _i(e)}return i}),"parentElement"),Xi=Zt(((e,t,i)=>ei?i:e),"clamp"),Si=Zt((e=>["scroll-margin","scroll-snap-margin"].filter((t=>t in e.documentElement.style))[0]),"getSupportedScrollMarginProperty"),Ri=Zt(((e,t,i)=>{let{top:n,right:r,bottom:s,left:o}=t,a=Si(e.ownerDocument);if(!a)return[n,r,s,o];let l=Zt((e=>{let t=i.getPropertyValue(`${a}-${e}`);return parseInt(t,10)||0}),"scrollMarginValue");return[n-l("top"),r+l("right"),s+l("bottom"),o-l("left")]}),"getElementScrollSnapArea"),Ti=Zt(((e,t,i)=>{switch(e){case 1:return(t+i)/2;case 3:return i;case 2:case 0:return t}}),"calcAlignEdge"),Wi=Zt(((e,t)=>{var i,n,r;let s=null===(i=e.ownerDocument.defaultView)||void 0===i?void 0:i.visualViewport,[o,a,l,c]=e===Ht(e)?[0,0,null!==(n=null==s?void 0:s.width)&&void 0!==n?n:e.clientWidth,null!==(r=null==s?void 0:s.height)&&void 0!==r?r:e.clientHeight]:[t.left,t.top,e.clientWidth,e.clientHeight],O=o+e.clientLeft,h=a+e.clientTop;return[h,O+l,h+c,O]}),"getFrameViewport"),Ai=Zt(((e,t)=>{let i=[],n=e.ownerDocument,r=n.defaultView;if(!r)return i;let s=window.getComputedStyle(e),o="rtl"!==s.direction,a=bi(s.writingMode||s.getPropertyValue("-webkit-writing-mode")||s.getPropertyValue("-ms-writing-mode")),[l,c]=Pi(t,a,o),[O,h,u,d]=Ri(e,e.getBoundingClientRect(),s);for(let s=xi(e);null!==s;s=xi(s)){if(n!==s.ownerDocument){if(n=s.ownerDocument,r=n.defaultView,!r)break;let{left:e,top:t}=s.getBoundingClientRect();O+=t,h+=e,u+=t,d+=e}let e=r.getComputedStyle(s);if("fixed"===e.position)break;if(!vi(s,e))continue;let o=s.getBoundingClientRect(),[a,f,p,m]=Wi(s,o),g=wi(l,m,f,s.clientWidth,d,h,h-d),$=wi(c,a,p,s.clientHeight,O,u,u-O),b=null===g?0:Ti(g,d,h)-Ti(g,m,f),Q=null===$?0:Ti($,O,u)-Ti($,a,p),y=yi(e)?Xi(b,-s.scrollWidth+s.clientWidth-s.scrollLeft,-s.scrollLeft):Xi(b,-s.scrollLeft,s.scrollWidth-s.clientWidth-s.scrollLeft),P=Xi(Q,-s.scrollTop,s.scrollHeight-s.clientHeight-s.scrollTop);i.push([s,{left:s.scrollLeft+y,top:s.scrollTop+P,behavior:t.behavior}]),O=Math.max(O-P,a),h=Math.min(h-y,f),u=Math.min(u-P,p),d=Math.max(d-y,m)}return i}),"computeScrollIntoView"),Ni=Zt(((e,t,i)=>{let n=t||{};if(!Ut(n.behavior))throw new TypeError(jt("scrollIntoView","Element",n.behavior));Ai(e,n).forEach((([e,t])=>{Oi(e,t,i)}))}),"scrollIntoView"),Ci=Ni;function Ei(e){Ci(this,{block:e??1?"start":"end",inline:"nearest"})}Zt(Ei,"elementScrollIntoViewBoolean");var qi=Zt((e=>{if(Bt())return;let t=Gt(window.HTMLElement.prototype,"scrollIntoView",Ei);Kt("scrollIntoView",Zt((function(){let i=arguments,n=i[0];1===i.length&&Lt(n)?Ci(this,n,e):t.apply(this,i)}),"scrollIntoView"))}),"elementScrollIntoViewPolyfill"),Vi=Zt((e=>{Bt()||(ui(e),di(e),fi(e),qi(e),mi(e),gi(e),$i(e))}),"polyfill");null==Blob.prototype.text&&(Blob.prototype.text=function(){const e=new FileReader,t=new Promise(((t,i)=>{e.onload=()=>{t(e.result)},e.onerror=t=>{e.abort(),i(t)}}));return e.readAsText(this),t}),null==Blob.prototype.arrayBuffer&&(Blob.prototype.arrayBuffer=function(){return new Response(this).arrayBuffer()}),Vi();const zi=(e,t)=>Promise.race([e,new Promise(((e,i)=>{setTimeout((()=>{i(new Error("Promise timed out."))}),t)}))]),Ii=()=>crypto.getRandomValues(new Uint32Array(1))[0].toString(36),Yi=e=>e.readyState==WebSocket.OPEN||e.readyState==WebSocket.CONNECTING,Zi=e=>{e.onopen=()=>{Zi(e)},e.onmessage=e.onclose=e.onerror=void 0;try{e.close(1e3,"byebye")}catch(e){}},Ui=(e,{on_message:t,on_socket_close:i},n=30)=>new Promise(((r,s)=>{const o=new WebSocket(e);let a=!1;const l=setTimeout((()=>{console.warn("Creating websocket timed out",(new Date).toLocaleTimeString()),Zi(o),s("Socket timeout")}),1e3*n),c=e=>{const t=zt(e);o.send(t)};let O=Promise.resolve();o.onmessage=e=>{O=O.then((async()=>{try{const i=await e.data.arrayBuffer(),n=It(new Uint8Array(i));try{t(n)}catch(t){console.error("Failed to process message from websocket",t,{message:n}),alert(`Something went wrong! You might need to refresh the page.\n\nPlease open an issue on https://github.com/fonsp/Pluto.jl with this info:\n\nFailed to process update\n${t.message}\n\n${JSON.stringify(e)}`)}}catch(t){console.error("Failed to unpack message from websocket",t,{event:e}),alert(`Something went wrong! You might need to refresh the page.\n\nPlease open an issue on https://github.com/fonsp/Pluto.jl with this info:\n\nFailed to unpack message\n${t}\n\n${JSON.stringify(e)}`)}}))},o.onerror=async e=>{console.error(`Socket did an oopsie - ${e.type}`,(new Date).toLocaleTimeString(),"was open:",a,e),await(e=>new Promise((t=>{Yi(e)?t(!0):setTimeout((()=>{t(Yi(e))}),1e3)})))(o)?(console.log("The socket somehow recovered from an error?! Onbegrijpelijk"),console.log(o),console.log(o.readyState)):a?(i(),Zi(o)):s(e)},o.onclose=async e=>{console.error(`Socket did an oopsie - ${e.type}`,(new Date).toLocaleTimeString(),"was open:",a,e),a?(i(),Zi(o)):s(e)},o.onopen=()=>{console.log("Socket opened",(new Date).toLocaleTimeString()),clearInterval(l),a=!0,r({socket:o,send:c})},console.log("Waiting for socket to open...",(new Date).toLocaleTimeString())}));const Mi=e=>{let t=null,i=[],n=null;return async(r,s,o,a)=>{if("update_notebook"===r){if(null!=n&&n!=o.notebook_id)throw new Error("Switched notebook inbetween same-tick updates??? WHAT?!?!");return i=[...i,...s.updates],n=o.notebook_id,null==t&&(t=new Promise((e=>setTimeout(e,0))).then((async()=>{let s=i;return t=null,i=[],n=null,await e(r,{updates:s},o,a)}))),await t}return await e(r,s,o,a)}},Di=e=>{const t=new URL("./",e);return t.protocol=t.protocol.replace("http","ws"),String(t)},ji=()=>Di(window.location.href),Gi=async({on_unrequested_update:e,on_reconnect:t,on_connection_status:i,connect_metadata:n={},ws_address:r=ji()})=>{var s=null;const o={send:null,session_options:null,version_info:{julia:"unknown",pluto:"unknown",dismiss_update_notification:!1},notebook_exists:!0,kill:null},a=Ii(),l=new Map,c=async(t,i={},n={},r=!0)=>{const o=Ii(),c={type:t,client_id:a,request_id:o,body:i,...n};let O=(()=>{let e=()=>{},t=()=>{};return{current:new Promise(((i,n)=>{e=i,t=n})),resolve:e,reject:t}})();return l.set(o,(t=>{O.resolve(t),!1===r&&e(t,!0)})),s.send(c),await O.current};o.send=Mi(c);const O=async()=>{(async()=>{try{const e=new URL(window.location.href),t=await fetch("possible_binder_token_please");if(!t.ok)return;const i=await t.text();""!==i&&e.searchParams.get("token")!==i&&(e.searchParams.set("token",i),history.replaceState({},"",e.toString()))}catch(e){console.warn("Error while setting binder url:",e)}})();try{s=await Ui(String(r),{on_message:t=>{const i=t.initiator_id==a,n=t.request_id;if(i&&n){const e=l.get(n);if(e)return e(t),void l.delete(n)}e(t,i)},on_socket_close:async()=>{i(!1),console.log("Starting new websocket",(new Date).toLocaleTimeString()),await Nt.delay(500),await O(),console.log("Starting state sync",(new Date).toLocaleTimeString());const e=t();console.log(`State sync ${e?"":"not "}successful`,(new Date).toLocaleTimeString()),i(e),e||alert("Connection out of sync 😥\n\nRefresh the page to continue")}}),console.log("Hello?");const h=await c("connect",{},n);if(console.log("Hello!"),o.session_options=h.message.options,o.version_info=h.message.version_info,o.notebook_exists=h.message.notebook_exists,console.log("Client object: ",o),null!=n.notebook_id&&!h.message.notebook_exists)return confirm("A new server was started - this notebook session is no longer running.\n\nWould you like to go back to the main menu?")&&(window.location.href="./"),i(!1),{};i(!0);const u=()=>{c("ping",{},{}).then((()=>{setTimeout(u,28e3)})).catch()};return u(),h.message}catch(e){return console.error("connect() failed",e),await Nt.delay(5e3),await O()}};return await O(),o};let Li=async e=>e(),Bi=null;r.register("dLidm",(function(e,t){e.exports=r("aFTz8")(r("8LcMF").getBundleURL("7rd1W")+r("jTduX").resolve("9OeRT")).then((()=>r("dN8oq")))})),r.register("aFTz8",(function(e,t){"use strict";var i=r("l8cOo");e.exports=i((function(e){return new Promise((function(t,i){var n=document.getElementsByTagName("script");if([].concat(n).some((function(t){return t.src===e})))t();else{var r=document.createElement("script");r.async=!0,r.type="text/javascript",r.charset="utf-8",r.src=e,r.onerror=function(e){r.onerror=r.onload=null,r.remove(),i(e)},r.onload=function(){r.onerror=r.onload=null,t()},document.getElementsByTagName("head")[0].appendChild(r)}}))}))})),r.register("l8cOo",(function(e,t){"use strict";var i={},n={},r={};function s(e){switch(e){case"preload":return n;case"prefetch":return r;default:return i}}e.exports=function(e,t){return function(i){var n=s(t);return n[i]?n[i]:n[i]=e.apply(null,arguments).catch((function(e){throw delete n[i],e}))}}})),r.register("8LcMF",(function(t,i){var n;e(t.exports,"getBundleURL",(()=>n),(e=>n=e));var r={};function s(e){return(""+e).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/,"$1")+"/"}n=function(e){var t=r[e];return t||(t=function(){try{throw new Error}catch(t){var e=(""+t.stack).match(/(https?|file|ftp):\/\/[^)\n]+/g);if(e)return s(e[2])}return"/"}(),r[e]=t),t}})),r.register("cQdD1",(function(e,t){e.exports=Promise.all([r("aFTz8")(r("8LcMF").getBundleURL("7rd1W")+r("jTduX").resolve("9OeRT")),r("aFTz8")(r("8LcMF").getBundleURL("7rd1W")+r("jTduX").resolve("eSSrR"))]).then((()=>r("4Odpp")))}));const Fi=async()=>(null==Bi&&(Bi=Li((async()=>{let[{initializeApp:e},t]=await Promise.all([r("dLidm"),r("cQdD1")]),{getFirestore:i,addDoc:n,doc:s,collection:o}=t,a=o(i(e({apiKey:"AIzaSyC0DqEcaM8AZ6cvApXuNcNU2RgZZOj7F68",authDomain:"localhost",projectId:"pluto-feedback"})),"feedback");return console.log("🔥base loaded"),async e=>{await n(a,e)}}))),await Bi),Ki=async()=>{try{const e=document.querySelector("form#feedback");e.addEventListener("submit",(t=>{const i=prompt("Would you like us to contact you?\n\nEmail: (leave blank to stay anonymous 👀)");t.preventDefault(),Li((async()=>{try{let n=await Fi();await zi(n({feedback:new FormData(t.target).get("opinion"),timestamp:Date.now(),email:i||""}),5e3);let r="Submitted. Thank you for your feedback! 💕";console.log(r),alert(r),e.querySelector("#opinion").value=""}catch(e){let t="Whoops, failed to send feedback 😢\nWe would really like to hear from you! Please got to https://github.com/fonsp/Pluto.jl/issues to report this failure:\n\n";console.error(t),console.error(e),alert(t+e)}}))})),e.addEventListener("focusin",(()=>{Fi()}))}catch(e){console.error("Something went wrong loading the feedback form:",e),document.querySelector("form#feedback").style.opacity=0;for(let e of"Oh noooooooooooooooooo...")document.querySelector("form#feedback input").value+=e,await new Promise((e=>setTimeout(e,200)))}};let Hi=/Mac/.test(navigator.platform),Ji=Hi?"Cmd":"Ctrl",en=e=>e.ctrlKey||Hi&&e.metaKey,tn=()=>{const e=null!=document.activeElement.closest("footer"),t=null!=document.activeElement.closest("header"),i=null!=document.activeElement.closest(".cm-editor"),{tagName:n}=document.activeElement;return"INPUT"===n||"TEXTAREA"===n||e||t||i};function nn(e){return e.replace(/\r\n/g,"\n").split(/# ╔═╡ \S+\n/).map((e=>e.trim())).filter((e=>""!==e))}const rn="julia> ";function sn(e){const t=e.replace(/\r\n/g,"\n").split(rn),i=" ".repeat(prompt.length);return t.map((function(e){return(i+e).split("\n").filter((e=>e.startsWith(i))).map((e=>e.replace(i,""))).join("\n")})).map((e=>e.trim())).filter((e=>""!==e))}const on=(e,t=!0)=>{var i;return e.trim().startsWith(rn)?sn:t&&!tn()&&(null===(i=e.match(/# ╔═╡ ........-....-....-....-............/g))||void 0===i?void 0:i.length)?nn:null},an=new TextEncoder,ln=new TextDecoder,cn=(e,t)=>ln.decode(an.encode(e).slice(0,t)).length,On=(e,t,i)=>{const n=an.encode(e);return ln.decode(n.slice(t,i))};console.assert("e é hannes ❤ is a dog"===((e,t,i,n)=>{const r=an.encode(e),s=an.encode(n),o=new Uint8Array(r.length+s.length-(i-t));return o.set(r.slice(0,t),0),o.set(s,t),o.set(r.slice(i),t+s.length),ln.decode(o)})("e é 🐶 is a dog",5,9,"hannes ❤")),console.assert("🐶"===On("e é 🐶 is a dog",5,9)),r.register("6kwV5",(function(e,t){}));var hn=r("6kwV5");class un{constructor(){}lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),fn.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),fn.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new gn(this),r=new gn(e);for(let e=t,s=t;;){if(n.next(e),r.next(e),e=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(s+=n.value.length,n.done||s>=i)return!0}}iter(e=1){return new gn(this,e)}iterRange(e,t=this.length){return new $n(this,e,t)}iterLines(e,t){let i;if(null==e)i=this.iter();else{null==t&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new bn(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new dn(e):fn.from(dn.split(e,[])):un.empty}}class dn extends un{constructor(e,t=function(e){let t=-1;for(let i of e)t+=i.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let r=0;;r++){let s=this.text[r],o=n+s.length;if((t?i:o)>=e)return new Qn(n,o,i,s);n=o+1,i++}}decompose(e,t,i,n){let r=e<=0&&t>=this.length?this:new dn(mn(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&n){let e=i.pop(),t=pn(r.text,e.text.slice(),0,r.length);if(t.length<=32)i.push(new dn(t,e.length+r.length));else{let e=t.length>>1;i.push(new dn(t.slice(0,e)),new dn(t.slice(e)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof dn))return super.replace(e,t,i);let n=pn(this.text,pn(i.text,mn(this.text,0,e)),t),r=this.length+i.length-(t-e);return n.length<=32?new dn(n,r):fn.from(dn.split(n,[]),r)}sliceString(e,t=this.length,i="\n"){let n="";for(let r=0,s=0;r<=t&&se&&s&&(n+=i),er&&(n+=o.slice(Math.max(0,e-r),t-r)),r=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let r of e)i.push(r),n+=r.length+1,32==i.length&&(t.push(new dn(i,n)),i=[],n=-1);return n>-1&&t.push(new dn(i,n)),t}}class fn extends un{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let t of e)this.lines+=t.lines}lineInner(e,t,i,n){for(let r=0;;r++){let s=this.children[r],o=n+s.length,a=i+s.lines-1;if((t?a:o)>=e)return s.lineInner(e,t,i,n);n=o+1,i=a+1}}decompose(e,t,i,n){for(let r=0,s=0;s<=t&&r=s){let r=n&((s<=e?1:0)|(a>=t?2:0));s>=e&&a<=t&&!r?i.push(o):o.decompose(e-s,t-s,i,r)}s=a+1}}replace(e,t,i){if(i.lines=r&&t<=o){let a=s.replace(e-r,t-r,i),l=this.lines-s.lines+a.lines;if(a.lines>4&&a.lines>l>>6){let r=this.children.slice();return r[n]=a,new fn(r,this.length-(t-e)+i.length)}return super.replace(r,o,a)}r=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i="\n"){let n="";for(let r=0,s=0;re&&r&&(n+=i),es&&(n+=o.sliceString(e-s,t-s,i)),s=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof fn))return 0;let i=0,[n,r,s,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,r+=t){if(n==s||r==o)return i;let a=this.children[n],l=e.children[r];if(a!=l)return i+a.scanIdentical(l,t);i+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let i=0;for(let t of e)i+=t.lines;if(i<32){let i=[];for(let t of e)t.flatten(i);return new dn(i,t)}let n=Math.max(32,i>>5),r=n<<1,s=n>>1,o=[],a=0,l=-1,c=[];function O(e){let t;if(e.lines>r&&e instanceof fn)for(let t of e.children)O(t);else e.lines>s&&(a>s||!a)?(h(),o.push(e)):e instanceof dn&&a&&(t=c[c.length-1])instanceof dn&&e.lines+t.lines<=32?(a+=e.lines,l+=e.length+1,c[c.length-1]=new dn(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>n&&h(),a+=e.lines,l+=e.length+1,c.push(e))}function h(){0!=a&&(o.push(1==c.length?c[0]:fn.from(c,l)),l=-1,a=c.length=0)}for(let t of e)O(t);return h(),1==o.length?o[0]:new fn(o,t)}}function pn(e,t,i=0,n=1e9){for(let r=0,s=0,o=!0;s=i&&(l>n&&(a=a.slice(0,n-r)),r0?1:(e instanceof dn?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],s=r>>1,o=n instanceof dn?n.text.length:n.children.length;if(s==(t>0?o:0)){if(0==i)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[i]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(n instanceof dn){let r=n.text[s+(t<0?-1:0)];if(this.offsets[i]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=n.children[s+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof dn?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class $n{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new gn(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class bn{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(un.prototype[Symbol.iterator]=function(){return this.iter()},gn.prototype[Symbol.iterator]=$n.prototype[Symbol.iterator]=bn.prototype[Symbol.iterator]=function(){return this});class Qn{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}let yn="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((e=>e?parseInt(e,36):1));for(let e=1;ee)return yn[t-1]<=e;return!1}function wn(e){return e>=127462&&e<=127487}function kn(e,t,i=!0,n=!0){return(i?_n:vn)(e,t,n)}function _n(e,t,i){if(t==e.length)return t;t&&xn(e.charCodeAt(t))&&Xn(e.charCodeAt(t-1))&&t--;let n=Sn(e,t);for(t+=Tn(n);t=0&&wn(Sn(e,n));)i++,n-=2;if(i%2==0)break;t+=2}}}return t}function vn(e,t,i){for(;t>0;){let n=_n(e,t-2,i);if(n=56320&&e<57344}function Xn(e){return e>=55296&&e<56320}function Sn(e,t){let i=e.charCodeAt(t);if(!Xn(i)||t+1==e.length)return i;let n=e.charCodeAt(t+1);return xn(n)?n-56320+(i-55296<<10)+65536:i}function Rn(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Tn(e){return e<65536?1:2}const Wn=/\r\n?|\n/;var An,Nn=((An=Nn||(Nn={}))[An.Simple=0]="Simple",An[An.TrackDel=1]="TrackDel",An[An.TrackBefore=2]="TrackBefore",An[An.TrackAfter=3]="TrackAfter",An);class Cn{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-n);r+=o}else{if(i!=Nn.Simple&&l>=e&&(i==Nn.TrackDel&&ne||i==Nn.TrackBefore&&ne))return null;if(l>e||l==e&&t<0&&!o)return e==n||t<0?r:r+a;r+=a}n=l}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return r}touchesRange(e,t=e){for(let i=0,n=0;i=0&&n<=t&&r>=e)return!(nt)||"cover";n=r}return!1}toString(){let e="";for(let t=0;t=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Cn(e)}}class En extends Cn{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return zn(this,((t,i,n,r,s)=>e=e.replace(n,n+(i-t),s)),!1),e}mapDesc(e,t=!1){return In(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,r=0;n=0){t[n]=o,t[n+1]=s;let a=n>>1;for(;i.length0&&Vn(i,t,r.text),r.forward(e),o+=e}let l=e[s++];for(;o>1].toJSON()))}return e}static of(e,t,i){let n=[],r=[],s=0,o=null;function a(e=!1){if(!e&&!n.length)return;so||e<0||o>t)throw new RangeError(`Invalid change range ${e} to ${o} (in doc of length ${t})`);let O=c?"string"==typeof c?un.of(c.split(i||Wn)):c:un.empty,h=O.length;if(e==o&&0==h)return;es&&qn(n,e-s,-1),qn(n,o-e,h),Vn(r,n,O),s=o}}(e),a(!o),o}static empty(e){return new En(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;nt&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;i.length=0&&i<=0&&i==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=i:n?(e[r]+=t,e[r+1]+=i):e.push(t,i)}function Vn(e,t,i){if(0==i.length)return;let n=t.length-2>>1;if(n>1])),!(i||o==e.sections.length||e.sections[o+1]<0);)a=e.sections[o++],l=e.sections[o++];t(r,c,s,O,h),r=c,s=O}}}function In(e,t,i,n=!1){let r=[],s=n?[]:null,o=new Zn(e),a=new Zn(t);for(let e=0,t=0;;)if(-1==o.ins)e+=o.len,o.next();else if(-1==a.ins&&t=0&&(o.done||tt&&!o.done&&e+o.len=0)){if(o.done&&a.done)return s?new En(r,s):new Cn(r);throw new Error("Mismatched change set lengths")}{let i=0,n=e+o.len;for(;;)if(a.ins>=0&&t>e&&t+a.lent||o.ins>=0&&o.len>t)&&(e||n.length>i),s.forward2(t),o.forward(t)}}else qn(n,0,o.ins,e),r&&Vn(r,n,o.text),o.next()}}class Zn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?un.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?un.empty:t[i].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class Un{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){let e=3&this.flags;return 3==e?null:e}get goalColumn(){let e=this.flags>>5;return 33554431==e?void 0:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new Un(i,n,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Mn.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Mn.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return Mn.range(e.anchor,e.head)}}class Mn{constructor(e,t=0){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:Mn.create(this.ranges.map((i=>i.map(e,t))),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.toJSON())),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new Mn(e.ranges.map((e=>Un.fromJSON(e))),e.main)}static single(e,t=e){return new Mn([Mn.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;ne?4:0))}}function Dn(e,t=0){let i=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(i);for(let i=1;in.head?Mn.range(o,s):Mn.range(s,o))}}return new Mn(e,t)}function jn(e,t){for(let i of e.ranges)if(i.to>t)throw new RangeError("Selection points outside of document")}let Gn=0;class Ln{constructor(e,t,i,n,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.extensions=r,this.id=Gn++,this.default=e([])}static define(e={}){return new Ln(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:Bn),!!e.static,e.enables)}of(e){return new Fn([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Fn(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Fn(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(i=>t(i.field(e))))}}function Bn(e,t){return e==t||e.length==t.length&&e.every(((e,i)=>e===t[i]))}class Fn{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=Gn++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,r=this.id,s=e[r]>>1,o=2==this.type,a=!1,l=!1,c=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:0==(1&(null!==(t=e[i.id])&&void 0!==t?t:1))&&c.push(e[i.id]);return{create:e=>(e.values[s]=i(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||Hn(e,c)){let t=i(e);if(o?!Kn(t,e.values[s],n):!n(t,e.values[s]))return e.values[s]=t,1}return 0},reconfigure:(e,t)=>{let a=i(e),l=t.config.address[r];if(null!=l){let i=dr(t,l);if(this.dependencies.every((i=>i instanceof Ln?t.facet(i)===e.facet(i):!(i instanceof tr)||t.field(i,!1)==e.field(i,!1)))||(o?Kn(a,i,n):n(a,i)))return e.values[s]=i,0}return e.values[s]=a,1}}}}function Kn(e,t,i){if(e.length!=t.length)return!1;for(let n=0;ne[t.id])),r=i.map((e=>e.type)),s=n.filter((e=>!(1&e))),o=e[t.id]>>1;function a(e){let i=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(er).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,i)=>{let n=e.values[t],r=this.updateF(n,i);return this.compareF(n,r)?0:(e.values[t]=r,1)},reconfigure:(e,i)=>null!=i.config.address[this.id]?(e.values[t]=i.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,er.of({field:this,create:e})]}get extension(){return this}}const ir=4,nr=3,rr=2,sr=1;function or(e){return t=>new lr(t,e)}const ar={highest:or(0),high:or(sr),default:or(rr),low:or(nr),lowest:or(ir)};class lr{constructor(e,t){this.inner=e,this.prec=t}}class cr{of(e){return new Or(this,e)}reconfigure(e){return cr.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Or{constructor(e,t){this.compartment=e,this.inner=t}}class hr{constructor(e,t,i,n,r,s){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let n=[],r=Object.create(null),s=new Map;for(let i of function(e,t,i){let n=[[],[],[],[],[]],r=new Map;return function e(s,o){let a=r.get(s);if(null!=a){if(a<=o)return;let e=n[a].indexOf(s);e>-1&&n[a].splice(e,1),s instanceof Or&&i.delete(s.compartment)}if(r.set(s,o),Array.isArray(s))for(let t of s)e(t,o);else if(s instanceof Or){if(i.has(s.compartment))throw new RangeError("Duplicate use of compartment in extensions");let n=t.get(s.compartment)||s.inner;i.set(s.compartment,n),e(n,o)}else if(s instanceof lr)e(s.inner,s.prec);else if(s instanceof tr)n[o].push(s),s.provides&&e(s.provides,o);else if(s instanceof Fn)n[o].push(s),s.facet.extensions&&e(s.facet.extensions,o);else{let t=s.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${s}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,o)}}(e,rr),n.reduce(((e,t)=>e.concat(t)))}(e,t,s))i instanceof tr?n.push(i):(r[i.facet.id]||(r[i.facet.id]=[])).push(i);let o=Object.create(null),a=[],l=[];for(let e of n)o[e.id]=l.length<<1,l.push((t=>e.slot(t)));let c=null==i?void 0:i.config.facets;for(let e in r){let t=r[e],n=t[0].facet,s=c&&c[e]||[];if(t.every((e=>0==e.type)))if(o[n.id]=a.length<<1|1,Bn(s,t))a.push(i.facet(n));else{let e=n.combine(t.map((e=>e.value)));a.push(i&&n.compare(e,i.facet(n))?i.facet(n):e)}else{for(let e of t)0==e.type?(o[e.id]=a.length<<1|1,a.push(e.value)):(o[e.id]=l.length<<1,l.push((t=>e.dynamicSlot(t))));o[n.id]=l.length<<1,l.push((e=>Jn(e,n,t)))}}let O=l.map((e=>e(o)));return new hr(e,s,O,o,a,r)}}function ur(e,t){if(1&t)return 2;let i=t>>1,n=e.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;e.status[i]=4;let r=e.computeSlot(e,e.config.dynamicSlots[i]);return e.status[i]=2|r}function dr(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const fr=Ln.define(),pr=Ln.define({combine:e=>e.some((e=>e)),static:!0}),mr=Ln.define({combine:e=>e.length?e[0]:void 0,static:!0}),gr=Ln.define(),$r=Ln.define(),br=Ln.define(),Qr=Ln.define({combine:e=>!!e.length&&e[0]});class yr{constructor(e,t){this.type=e,this.value=t}static define(){return new Pr}}class Pr{of(e){return new yr(this,e)}}class wr{constructor(e){this.map=e}of(e){return new kr(this,e)}}class kr{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new kr(this.type,t)}is(e){return this.type==e}static define(e={}){return new wr(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let e=n.map(t);e&&i.push(e)}return i}}kr.reconfigure=kr.define(),kr.appendConfig=kr.define();class _r{constructor(e,t,i,n,r,s){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,i&&jn(i,t.newLength),r.some((e=>e.type==_r.time))||(this.annotations=r.concat(_r.time.of(Date.now())))}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(_r.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function vr(e,t){let i=[];for(let n=0,r=0;;){let s,o;if(n=e[n]))s=e[n++],o=e[n++];else{if(!(r=0;r--){let s=i[r](e);s&&Object.keys(s).length&&(n=xr(e,Xr(t,s,e.changes.newLength),!0))}return n==e?e:new _r(t,e.changes,e.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(e){let t=e.startState,i=!0;for(let n of t.facet(gr)){let t=n(e);if(!1===t){i=!1;break}Array.isArray(t)&&(i=!0===i?t:vr(i,t))}if(!0!==i){let n,r;if(!1===i)r=e.changes.invertedDesc,n=En.empty(t.doc.length);else{let t=e.changes.filter(i);n=t.changes,r=t.filtered.invertedDesc}e=new _r(t,n,e.selection&&e.selection.map(r),kr.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let n=t.facet($r);for(let i=n.length-1;i>=0;i--){let r=n[i](e);e=r instanceof _r?r:Array.isArray(r)&&1==r.length&&r[0]instanceof _r?r[0]:Sr(t,Tr(r),!1)}return e}(r):r)}_r.time=yr.define(),_r.userEvent=yr.define(),_r.addToHistory=yr.define(),_r.remote=yr.define();const Rr=[];function Tr(e){return null==e?Rr:Array.isArray(e)?e:[e]}var Wr=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(Wr||(Wr={}));const Ar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Nr;try{Nr=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}function Cr(e){return t=>{if(!/\S/.test(t))return Wr.Space;if(function(e){if(Nr)return Nr.test(e);for(let t=0;t"€"&&(i.toUpperCase()!=i.toLowerCase()||Ar.test(i)))return!0}return!1}(t))return Wr.Word;for(let i=0;i-1)return Wr.Word;return Wr.Other}}class Er{constructor(e,t,i,n,r,s){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=r,s&&(s._state=this);for(let e=0;er.set(t,e))),i=null),r.set(t.value.compartment,t.value.extension)):t.is(kr.reconfigure)?(i=null,n=t.value):t.is(kr.appendConfig)&&(i=null,n=Tr(n).concat(t.value));i?t=e.startState.values.slice():(i=hr.resolve(n,r,this),t=new Er(i,this.doc,this.selection,i.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values),new Er(i,e.newDoc,e.newSelection,t,((t,i)=>i.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:Mn.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),r=[i.range],s=Tr(i.effects);for(let i=1;ir.spec.fromJSON(s,e))))}return Er.create({doc:e.doc,selection:Mn.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=hr.resolve(e.extensions||[],new Map),i=e.doc instanceof un?e.doc:un.of((e.doc||"").split(t.staticFacet(Er.lineSeparator)||Wn)),n=e.selection?e.selection instanceof Mn?e.selection:Mn.single(e.selection.anchor,e.selection.head):Mn.single(0);return jn(n,i.length),t.staticFacet(pr)||(n=n.asSingle()),new Er(t,i,n,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(Er.tabSize)}get lineBreak(){return this.facet(Er.lineSeparator)||"\n"}get readOnly(){return this.facet(Qr)}phrase(e){for(let t of this.facet(Er.phrases))if(Object.prototype.hasOwnProperty.call(t,e))return t[e];return e}languageDataAt(e,t,i=-1){let n=[];for(let r of this.facet(fr))for(let s of r(this,t,i))Object.prototype.hasOwnProperty.call(s,e)&&n.push(s[e]);return n}charCategorizer(e){return Cr(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),r=this.charCategorizer(e),s=e-i,o=e-i;for(;s>0;){let e=kn(t,s,!1);if(r(t.slice(e,s))!=Wr.Word)break;s=e}for(;oe.length?e[0]:4}),Er.lineSeparator=mr,Er.readOnly=Qr,Er.phrases=Ln.define({compare(e,t){let i=Object.keys(e),n=Object.keys(t);return i.length==n.length&&i.every((i=>e[i]==t[i]))}}),Er.languageData=fr,Er.changeFilter=gr,Er.transactionFilter=$r,Er.transactionExtender=br,cr.reconfigure=kr.define();class Vr{eq(e){return this==e}range(e,t=e){return new zr(e,t,this)}}Vr.prototype.startSide=Vr.prototype.endSide=0,Vr.prototype.point=!1,Vr.prototype.mapMode=Nn.TrackDel;class zr{constructor(e,t,i){this.from=e,this.to=t,this.value=i}}function Ir(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Yr{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,n=0){let r=i?this.to:this.from;for(let s=n,o=r.length;;){if(s==o)return s;let n=s+o>>1,a=r[n]-e||(i?this.value[n].endSide:this.value[n].startSide)-t;if(n==s)return a>=0?s:o;a>=0?o=n:s=n+1}}between(e,t,i,n){for(let r=this.findIndex(t,-1e9,!0),s=this.findIndex(i,1e9,!1,r);rc||l==c&&O.startSide>0&&O.endSide<=0)continue;(c-l||O.endSide-O.startSide)<0||(s<0&&(s=l),O.point&&(o=Math.max(o,c-l)),i.push(O),n.push(l-s),r.push(c-s))}return{mapped:i.length?new Yr(n,r,i,o):null,pos:s}}}class Zr{constructor(e,t,i=Zr.empty,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=e,s=e.filter;if(0==t.length&&!s)return this;if(i&&(t=t.slice().sort(Ir)),this.isEmpty)return t.length?Zr.of(t):this;let o=new Dr(this,null,-1).goto(0),a=0,l=[],c=new Ur;for(;o.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||l.push(e)}else 1==o.rangeIndex&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||ro.to||r=r&&e<=r+s.length&&!1===s.between(r,e-r,t-r,i))return}this.nextLayer.between(e,t,i)}}iter(e=0){return jr.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return jr.from(e).goto(t)}static compare(e,t,i,n,r=-1){let s=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),o=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=Mr(s,o,i),l=new Lr(s,a,r),c=new Lr(o,a,r);i.iterGaps(((e,t,i)=>Br(l,e,c,t,i,n))),i.empty&&0==i.length&&Br(l,0,c,0,0,n)}static eq(e,t,i=0,n){null==n&&(n=1e9);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),s=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=s.length)return!1;if(!r.length)return!0;let o=Mr(r,s),a=new Lr(r,o,0).goto(i),l=new Lr(s,o,0).goto(i);for(;;){if(a.to!=l.to||!Fr(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>n)return!0;a.next(),l.next()}}static spans(e,t,i,n,r=-1){let s=new Lr(e,null,r).goto(t),o=t,a=s.openStart;for(;;){let e=Math.min(s.to,i);if(s.point?(n.point(o,e,s.point,s.activeForPoint(s.to),a,s.pointRank),a=s.openEnd(e)+(s.to>e?1:0)):e>o&&(n.span(o,e,s.active,a),a=s.openEnd(e)),s.to>i)break;o=s.to,s.next()}return a}static of(e,t=!1){let i=new Ur;for(let n of e instanceof zr?[e]:t?function(e){if(e.length>1)for(let t=e[0],i=1;i0)return e.slice().sort(Ir);t=n}return e}(e):e)i.add(n.from,n.to,n.value);return i.finish()}}Zr.empty=new Zr([],[],null,-1),Zr.empty.nextLayer=Zr.empty;class Ur{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(e){this.chunks.push(new Yr(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Ur)).add(e,t,i)}addInner(e,t,i){let n=e-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),0))}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(Zr.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=new Zr(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Mr(e,t,i){let n=new Map;for(let t of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new Dr(s,t,i,r));return 1==n.length?n[0]:new jr(n)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)Gr(this.heap,e);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)Gr(this.heap,e);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Gr(this.heap,0)}}}function Gr(e,t){for(let i=e[t];;){let n=1+(t<<1);if(n>=e.length)break;let r=e[n];if(n+1=0&&(r=e[n+1],n++),i.compare(r)<0)break;e[n]=i,e[t]=r,t=n}}class Lr{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=jr.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Kr(this.active,e),Kr(this.activeTo,e),Kr(this.activeRank,e),this.minActive=Jr(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:r}=this.cursor;for(;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Kr(i,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let r=this.cursor.value;if(r.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function Br(e,t,i,n,r,s){e.goto(t),i.goto(n);let o=n+r,a=n,l=n-t;for(;;){let t=e.to+l-i.to||e.endSide-i.endSide,n=t<0?e.to+l:i.to,r=Math.min(n,o);if(e.point||i.point?e.point&&i.point&&(e.point==i.point||e.point.eq(i.point))&&Fr(e.activeForPoint(e.to+l),i.activeForPoint(i.to))||s.comparePoint(a,r,e.point,i.point):r>a&&!Fr(e.active,i.active)&&s.compareRange(a,r,e.active,i.active),n>o)break;a=n,t<=0&&e.next(),t>=0&&i.next()}}function Fr(e,t){if(e.length!=t.length)return!1;for(let i=0;i=t;i--)e[i+1]=e[i];e[t]=i}function Jr(e,t){let i=-1,n=1e9;for(let r=0;r=t)return n;if(n==e.length)break;r+=9==e.charCodeAt(n)?i-r%i:1,n=kn(e,n)}return!0===n?-1:e.length}const is=1024;let ns=0;class rs{constructor(e,t){this.from=e,this.to=t}}class ss{constructor(e={}){this.id=ns++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=ls.match(e)),t=>{let i=e(t);return void 0===i?null:[this,i]}}}ss.closedBy=new ss({deserialize:e=>e.split(" ")}),ss.openedBy=new ss({deserialize:e=>e.split(" ")}),ss.group=new ss({deserialize:e=>e.split(" ")}),ss.contextHash=new ss({perNode:!0}),ss.lookAhead=new ss({perNode:!0}),ss.mounted=new ss({perNode:!0});class os{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}}const as=Object.create(null);class ls{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):as,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),n=new ls(e.name||"",t,e.id,i);if(e.props)for(let i of e.props)if(Array.isArray(i)||(i=i(n)),i){if(i[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[i[0].id]=i[1]}return n}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(ss.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let n of i.split(" "))t[n]=e[i];return e=>{for(let i=e.prop(ss.group),n=-1;n<(i?i.length:0);n++){let r=t[n<0?e.name:i[n]];if(r)return r}}}}ls.none=new ls("",Object.create(null),0,8);class cs{constructor(e){this.types=e;for(let t=0;t=n&&(s.type.isAnonymous||!1!==t(s))){if(s.firstChild())continue;e=!0}for(;e&&i&&!s.type.isAnonymous&&i(s),!s.nextSibling();){if(!s.parent())return;e=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Xs(ls.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,i)=>new ds(this.type,e,t,i,this.propValues)),e.makeTree||((e,t,i)=>new ds(ls.none,e,t,i)))}static build(e){return function(e){var t;let{buffer:i,nodeSet:n,maxBufferLength:r=is,reused:s=[],minRepeatType:o=n.types.length}=e,a=Array.isArray(i)?new fs(i,i.length):i,l=n.types,c=0,O=0;function h(e,t,i,p,m){let{id:g,start:$,end:b,size:Q}=a,y=O;for(;Q<0;){if(a.next(),-1==Q){let t=s[g];return i.push(t),void p.push($-e)}if(-3==Q)return void(c=g);if(-4==Q)return void(O=g);throw new RangeError(`Unrecognized record size: ${Q}`)}let P,w,k=l[g],_=$-e;if(b-$<=r&&(w=function(e,t){let i=a.fork(),n=0,s=0,l=0,c=i.end-r,O={size:0,start:0,skip:0};e:for(let r=i.pos-e;i.pos>r;){let e=i.size;if(i.id==t&&e>=0){O.size=n,O.start=s,O.skip=l,l+=4,n+=4,i.next();continue}let a=i.pos-e;if(e<0||a=o?4:0,u=i.start;for(i.next();i.pos>a;){if(i.size<0){if(-3!=i.size)break e;h+=4}else i.id>=o&&(h+=4);i.next()}s=u,n+=e,l+=h}return(t<0||n==e)&&(O.size=n,O.start=s,O.skip=l),O.size>4?O:void 0}(a.pos-t,m))){let t=new Uint16Array(w.size-w.skip),i=a.pos-w.size,r=t.length;for(;a.pos>i;)r=f(w.start,t,r);P=new ps(t,b-w.start,n),_=w.start-e}else{let e=a.pos-Q;a.next();let t=[],i=[],n=g>=o?g:-1,s=0,l=b;for(;a.pos>e;)n>=0&&a.id==n&&a.size>=0?(a.end<=l-r&&(u(t,i,$,s,a.end,l,n,y),s=t.length,l=a.end),a.next()):h($,e,t,i,n);if(n>=0&&s>0&&s-1&&s>0){let e=function(e){return(t,i,n)=>{let r,s,o=0,a=t.length-1;if(a>=0&&(r=t[a])instanceof ds){if(!a&&r.type==e&&r.length==n)return r;(s=r.prop(ss.lookAhead))&&(o=i[a]+r.length+s)}return d(e,t,i,n,o)}}(k);P=Xs(k,t,i,0,t.length,0,b-$,e,e)}else P=d(k,t,i,b-$,y-b)}i.push(P),p.push(_)}function u(e,t,i,r,s,o,a,l){let c=[],O=[];for(;e.length>r;)c.push(e.pop()),O.push(t.pop()+i-s);e.push(d(n.types[a],c,O,o-s,l-o)),t.push(s-i)}function d(e,t,i,n,r=0,s){if(c){let e=[ss.contextHash,c];s=s?[e].concat(s):[e]}if(r>25){let e=[ss.lookAhead,r];s=s?[e].concat(s):[e]}return new ds(e,t,i,n,s)}function f(e,t,i){let{id:n,start:r,end:s,size:l}=a;if(a.next(),l>=0&&n4){let n=a.pos-(l-4);for(;a.pos>n;)i=f(e,t,i)}t[--i]=o,t[--i]=s-e,t[--i]=r-e,t[--i]=n}else-3==l?c=n:-4==l&&(O=n);return i}let p=[],m=[];for(;a.pos>0;)h(e.start||0,e.bufferStart||0,p,m,-1);let g=null!==(t=e.length)&&void 0!==t?t:p.length?m[0]+p[0].length:0;return new ds(l[e.topID],p.reverse(),m.reverse(),g)}(e)}}ds.empty=new ds(ls.none,[],[],0);class fs{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new fs(this.buffer,this.index)}}class ps{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return ls.none}toString(){let e=[];for(let t=0;t0));a=s[a+3]);return o}slice(e,t,i,n){let r=this.buffer,s=new Uint16Array(t-e);for(let n=e,o=0;n=t&&it;case 1:return i<=t&&n>t;case 2:return n>t;case 4:return!0}}function gs(e,t){let i=e.childBefore(t);for(;i;){let t=i.lastChild;if(!t||t.to!=i.to)break;t.type.isError&&t.from==t.to?(e=i,i=t.prevSibling):i=t}return e}function $s(e,t,i,n){for(var r;e.from==e.to||(i<1?e.from>=t:e.from>t)||(i>-1?e.to<=t:e.to0?o.length:-1;e!=l;e+=t){let l=o[e],c=a[e]+s.from;if(ms(n,i,c,c+l.length))if(l instanceof ps){if(r&us.ExcludeBuffers)continue;let o=l.findChild(0,l.buffer.length,t,i-c,n);if(o>-1)return new ws(new Ps(s,l,e,c),null,o)}else if(r&us.IncludeAnonymous||!l.type.isAnonymous||_s(l)){let o;if(!(r&us.IgnoreMounts)&&l.props&&(o=l.prop(ss.mounted))&&!o.overlay)return new bs(o.tree,c,e,s);let a=new bs(l,c,e,s);return r&us.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?l.children.length-1:0,t,i,n)}}if(r&us.IncludeAnonymous||!s.type.isAnonymous)return null;if(e=s.index>=0?s.index+t:t<0?-1:s._parent._tree.children.length,s=s._parent,!s)return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,i=0){let n;if(!(i&us.IgnoreOverlays)&&(n=this._tree.prop(ss.mounted))&&n.overlay){let i=e-this.from;for(let{from:e,to:r}of n.overlay)if((t>0?e<=i:e=i:r>i))return new bs(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new ks(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,t=0){return $s(this,e,t,!1)}resolveInner(e,t=0){return $s(this,e,t,!0)}enterUnfinishedNodesBefore(e){return gs(this,e)}getChild(e,t=null,i=null){let n=Qs(this,e,t,i);return n.length?n[0]:null}getChildren(e,t=null,i=null){return Qs(this,e,t,i)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return ys(this,e)}}function Qs(e,t,i,n){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(null!=i)for(;!r.type.is(i);)if(!r.nextSibling())return s;for(;;){if(null!=n&&r.type.is(n))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return null==n?s:[]}}function ys(e,t,i=t.length-1){for(let n=e.parent;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(t[i]&&t[i]!=n.name)return!1;i--}}return!0}class Ps{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class ws{constructor(e,t,i){this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,t,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new ws(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,i=0){if(i&us.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new ws(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new ws(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new ws(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}cursor(e=0){return new ks(this,e)}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let s=i.buffer[this.index+1],o=i.buffer[this.index+2];e.push(i.slice(n,r,s,o)),t.push(0)}return new ds(this.type,e,t,this.to-this.from)}resolve(e,t=0){return $s(this,e,t,!1)}resolveInner(e,t=0){return $s(this,e,t,!0)}enterUnfinishedNodesBefore(e){return gs(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,t=null,i=null){let n=Qs(this,e,t,i);return n.length?n[0]:null}getChildren(e,t=null,i=null){return Qs(this,e,t,i)}get node(){return this}matchContext(e){return ys(this,e)}}class ks{constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof bs)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:i,buffer:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=i+n.buffer[e+1],this.to=i+n.buffer[e+2],!0}yield(e){return!!e&&(e instanceof bs?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,i);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?!(i&us.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&us.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&us.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let e=i<0?0:this.stack[i]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(e)}return i<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:n}=this;if(n){if(e>0){if(this.index-1)for(let n=t+e,r=e<0?-1:i._tree.children.length;n!=r;n+=e){let e=i._tree.children[n];if(this.mode&us.IncludeAnonymous||e instanceof ps||!e.type.isAnonymous||_s(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let s=e;s;s=s._parent)if(s.index==n){if(n==this.index)return s;t=s,i=r+1;break e}n=this.stack[--r]}for(let e=i;e=0;r--){if(r<0)return ys(this.node,e,n);let s=i[t.buffer[this.stack[r]]];if(!s.isAnonymous){if(e[n]&&e[n]!=s.name)return!1;n--}}return!0}}function _s(e){return e.children.some((e=>e instanceof ps||!e.type.isAnonymous||_s(e)))}const vs=new WeakMap;function xs(e,t){if(!e.isAnonymous||t instanceof ps||t.type!=e)return 1;let i=vs.get(t);if(null==i){i=1;for(let n of t.children){if(n.type!=e||!(n instanceof ds)){i=1;break}i+=xs(e,n)}vs.set(t,i)}return i}function Xs(e,t,i,n,r,s,o,a,l){let c=0;for(let i=n;i=O)break;f+=t}if(c==r+1){if(f>O){let e=i[r];t(e.children,e.positions,0,e.children.length,n[r]+a);continue}h.push(i[r])}else{let t=n[c-1]+i[c-1].length-d;h.push(Xs(e,i,n,r,c,d,t,null,l))}u.push(d+a-s)}}(t,i,n,r,0),(a||l)(h,u,o)}class Ss{constructor(e,t,i,n,r=!1,s=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(r?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],i=!1){let n=[new Ss(0,e.length,e,0,!1,i)];for(let i of t)i.to>e.length&&n.push(i);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],r=1,s=e.length?e[0]:null;for(let o=0,a=0,l=0;;o++){let c=o=i)for(;s&&s.from=t.from||O<=t.to||l){let e=Math.max(t.from,a)-l,i=Math.min(t.to,O)-l;t=e>=i?null:new Ss(e,i,t.tree,t.offset+l,o>0,!!c)}if(t&&n.push(t),s.to>O)break;s=rnew rs(e.from,e.to))):[new rs(0,0)]:[new rs(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let e=n.advance();if(e)return e}}}class Ts{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function Ws(e){return(t,i,n,r)=>new Es(t,e,i,n,r)}class As{constructor(e,t,i,n,r){this.parser=e,this.parse=t,this.overlay=i,this.target=n,this.ranges=r}}class Ns{constructor(e,t,i,n,r,s,o){this.parser=e,this.predicate=t,this.mounts=i,this.index=n,this.start=r,this.target=s,this.prev=o,this.depth=0,this.ranges=[]}}const Cs=new ss({perNode:!0});class Es{constructor(e,t,i,n,r){this.nest=t,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),null!=this.stoppedAt)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return null!=this.stoppedAt&&(e=new ds(e.type,e.children,e.positions,e.length,e.propValues.concat([[Cs,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[ss.mounted.id]=new os(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;te.frag.from<=n.from&&e.frag.to>=n.to&&e.mount.overlay));if(e)for(let i of e.mount.overlay){let r=i.from+e.pos,s=i.to+e.pos;r>=n.from&&s<=n.to&&!t.ranges.some((e=>e.fromr))&&t.ranges.push({from:r,to:s})}}a=!1}else if(i&&(s=qs(i.ranges,n.from,n.to)))a=2!=s;else if(!n.type.isAnonymous&&n.fromnew rs(e.from-n.from,e.to-n.from))):null,n.tree,e)),r.overlay?e.length&&(i={ranges:e,depth:0,prev:i}):a=!1}}else t&&(o=t.predicate(n))&&(!0===o&&(o=new rs(n.from,n.to)),o.fromnew rs(e.from-t.start,e.to-t.start))),t.target,e)),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function qs(e,t,i){for(let n of e){if(n.from>=i)break;if(n.to>t)return n.from<=t&&n.to>=i?2:1}return 0}function Vs(e,t,i,n,r,s){if(t=t.to);n++);let o=r.children[n],a=o.buffer;r.children[n]=function e(i,n,r,l,c){let O=i;for(;a[O+2]+s<=t.from;)O=a[O+3];let h=[],u=[];Vs(o,i,O,h,u,l);let d=a[O+1],f=a[O+2],p=d+s==t.from&&f+s==t.to&&a[O]==t.type.id;return h.push(p?t.toTree():e(O+4,a[O+3],o.set.types[a[O]],d,f-d)),u.push(d-l),Vs(o,a[O+3],n,h,u,l),new ds(r,h,u,c)}(0,a.length,ls.none,0,o.length);for(let n=0;n<=i;n++)e.childAfter(t.from)}class Is{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(us.IncludeAnonymous|us.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,us.IgnoreOverlays|us.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(!(t.children.length&&0==t.positions[0]&&t.children[0]instanceof ds))break;t=t.children[0]}return!1}}class Ys{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=null!==(t=i.tree.prop(Cs))&&void 0!==t?t:i.to,this.inner=new Is(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(Cs))&&void 0!==e?e:t.to,this.inner=new Is(t.tree,-t.offset)}}findMounts(e,t){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let r=null===(i=e.tree)||void 0===i?void 0:i.prop(ss.mounted);if(r&&r.parser==t)for(let t=this.fragI;t=e.to)break;i.tree==this.curFrag.tree&&n.push({frag:i,pos:e.from-i.offset,mount:r})}}}return n}}function Zs(e,t){let i=null,n=t;for(let r=1,s=0;r=a)break;e.to<=o||(i||(n=i=t.slice()),e.froma&&i.splice(s+1,0,new rs(a,e.to))):e.to>a?i[s--]=new rs(a,e.to):i.splice(s--,1))}}return n}function Us(e,t,i,n){let r=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let O=r==e.length?1e9:o?e[r].to:e[r].from,h=s==t.length?1e9:a?t[s].to:t[s].from;if(o!=a){let e=Math.max(l,i),t=Math.min(O,h,n);enew rs(e.from+n,e.to+n))),a,l);for(let t=0,n=a;;t++){let a=t==o.length,c=a?l:o[t].from;if(c>n&&i.push(new Ss(n,c,r.tree,-e,s.from>=n,s.to<=c)),a)break;n=o[t].to}}else i.push(new Ss(a,l,r.tree,-e,s.from>=e,s.to<=o))}return i}class Ds{constructor(e,t,i,n,r,s,o,a,l,c=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new Ds(e,[],t,i,i,0,[],0,n?new js(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,i=65535&e,{parser:n}=this.p,r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==t)return this.pushState(n.getGoto(this.state,i,!0),this.reducePos),is;)this.stack.pop();this.reduceContext(i,o)}storeNode(e,t,i,n=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i){let n=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:s}=this.p;(i>this.pos||t<=s.maxNode)&&(this.pos=i,s.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,n),this.shiftContext(t,n),t<=s.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,i){65536&e?this.reduce(e):this.shift(e,t,i)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new Ds(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Ls(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let e=0;e>19,n=65535&e,r=this.stack.length-3*i;if(r<0||t.getGoto(this.stack[r],n,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class js{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}var Gs;!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(Gs||(Gs={}));class Ls{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class Bs{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Bs(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new Bs(this.stack,this.pos,this.index)}}class Fs{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Ks=new Fs;class Hs{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Ks,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Ks,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class Js{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,i,n){let r=0,s=1<0){let i=e[n];if(a.allows(i)&&(-1==t.token.value||t.token.value==i||o.overrides(i,t.token.value))){t.acceptToken(i);break}}for(let n=t.next,s=0,o=e[r+2];s>1,l=i+a+(a<<1),c=e[l],O=e[l+1];if(n=O)){r=e[l+2],t.advance();continue e}s=a+1}}break}}(this.data,e,t,this.id)}}Js.prototype.contextual=Js.prototype.fallback=Js.prototype.extend=!1;class eo{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function to(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),s+=r,i)break;s*=46}i?i[r++]=s:i=new t(s)}return i}const io=void 0!==hn&&hn.env&&/\bparse\b/.test(void 0);let no=null;var ro,so;function oo(e,t,i){let n=e.cursor(us.IncludeAnonymous);for(n.moveTo(t);;)if(!(i<0?n.childBefore(t):n.childAfter(t)))for(;;){if((i<0?n.tot)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(ro||(ro={}));class ao{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?oo(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?oo(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof ds){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class lo{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new Fs))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,s=n.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let n=0;nc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(i=c,t>n))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),i||e.pos!=this.stream.end||(i=new Fs,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Fs,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){if(t.token(this.stream.reset(i.pos,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=Math.min(i.p.stream.end,i.pos+1)}putAction(e,t,i,n){for(let t=0;t4*e.bufferLength?new ao(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];for(let s=0;sn)r.push(o);else{if(this.advanceStack(o,r,i))continue;{e||(e=[],t=[]),e.push(o);let i=this.tokens.getMainToken(o);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1)e:for(let e=0;e500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}this.minStackPos=r[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(n);o;){let n=this.parser.nodeSet.types[o.type.id]==o.type?r.getGoto(e.state,o.type.id):-1;if(n>-1&&o.length&&(!t||(o.prop(ss.contextHash)||0)==i))return e.useNode(o,n),io&&console.log(s+this.stackID(e)+` (via reuse of ${r.getName(o.type.id)})`),!0;if(!(o instanceof ds)||0==o.children.length||o.positions[0]>0)break;let a=o.children[0];if(!(a instanceof ds&&0==o.positions[0]))break;o=a}}let o=r.stateSlot(e.state,4);if(o>0)return e.reduce(o),io&&console.log(s+this.stackID(e)+` (via always-reduce ${r.getName(65535&o)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let o=0;on?t.push(u):i.push(u)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return Oo(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let s=0;s ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),io&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let O=o.split(),h=c;for(let e=0;O.forceReduce()&&e<10&&(io&&console.log(h+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));e++)io&&(h=this.stackID(O)+" -> ");for(let e of o.recoverByInsert(a))io&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),io&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),Oo(o,i)):(!n||n.scoree.topRules[t][1])),n=[];for(let e=0;e=0)r(n,e,t[i++]);else{let s=t[i+-n];for(let o=-n;o>0;o--)r(t[i++],e,s);i++}}}this.nodeSet=new cs(t.map(((t,r)=>ls.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:n[r],top:i.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=is;let s=to(e.tokenData);if(this.context=e.context,this.specialized=new Uint16Array(e.specialized?e.specialized.length:0),this.specializers=[],e.specialized)for(let t=0;t"number"==typeof e?new Js(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new co(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],s=1&t,o=n[r++];if(s&&i)return o;for(let i=r+(t>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])return!1;i=fo(this.data,i+2)}if(t==fo(this.data,i+1))return!0}}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=fo(this.data,i+2)}if(0==(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}overrides(e,t){let i=po(this.data,this.tokenPrecTable,t);return i<0||po(this.data,this.tokenPrecTable,e){let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let n of e.split(" ")){let e=t.indexOf(n);e>=0&&(i[e]=!0)}let n=null;for(let e=0;e{e.peek(0)===Xo&&t.canShift(254)&&e.acceptToken(254,1)}));function ea(e,t){return qo.test(e)||Vo.test(e)||zo.test(e)||Io.test(e)||Yo.test(e)||jo.test(e)||Bo.test(e)||Ho.test(e)||Ko.test(e)&&!(t>=8592&&t<=8703)&&65532!=t&&65533!=t&&9023!=t&&166!=t||t>=8512&&t<=10780&&(t>=8512&&t<=8516||8767==t||8894==t||8895==t||8868==t||8869==t||t>=8706&&t<=8755&&(8706==t||8709==t||8710==t||8711==t||8718==t||8719==t||8720==t||8721==t||8734==t||8735==t||t>=8747)||t>=8896&&t<=8899||t>=9720&&t<=9727||t>=9839&&(9839==t||10200==t||10201==t||t>=10176&&t<=10177||t>=10672&&t<=10676||t>=10752&&t<=10758||t>=10761&&t<=10774||10779==t||10780==t))||t>=120513&&(120513==t||120539==t||120571==t||120597==t||120629==t||120655==t||120687==t||120713==t||120745==t||120771==t)||t>=8314&&t<=8318||t>=8330&&t<=8334||t>=8736&&t<=8738||t>=10651&&t<=10671||8472==t||8494==t||t>=12443&&t<=12444||t>=120782&&t<=120801}function ta(e,t){let i=e.peek(t);if(i>=So&&i<=Ro||i>=To&&i<=Wo||i==Co)return 1;if(i<161||i>1114111)return 0;{let n=ia(e,t);return ea(n,i)?n.length:0}}function ia(e,t){let i=1,n=e.peek(t),r=String.fromCodePoint(n);for(;;){let s=e.peek(t+i);if(!(55296<=n&&n<=56319&&56320<=s&&s<=57343))break;r+=String.fromCodePoint(s),n=s,i+=1}return r}const na=e=>new eo(((t,i)=>{let n=!0,r=0,s=1;for(;;){let e=t.peek(r);if(-1===e)break;if(n){if(n=!1,s=ta(t,r),0===s)break}else if(e>=So&&e<=Ro||e>=To&&e<=Wo||e>=Ao&&e<=No||e==Co||e==Eo);else{if(e<161||e>1114111)break;{let i=ia(t,r);if(s=i.length,ea(i,e));else if(!(Uo.test(i)||Mo.test(i)||Do.test(i)||Lo.test(i)||Fo.test(i)||Zo.test(i)||Go.test(i)||e>=8242&&e<=8247||8279==e))break}}r+=s,s=1}0!==r&&t.acceptToken(e,r)})),ra=na(1),sa=na(255),oa=(e,t)=>{let i=e.peek(t),n=e.peek(t+1);return i===bo&&(0!==ta(e,t+1)||n==Po)},aa=({till:e,term:t})=>new eo(((i,n)=>{let r=0,s=!1;for(;;){let n=i.peek(r);if(-1===n)break;if(s)s=!1;else if(n===go)s=!0;else if(oa(i,r)||e(i,r))return void(r>0&&i.acceptToken(t,r));r+=1}})),la=({till:e,term:t})=>new eo(((i,n)=>{let r=0,s=!1;for(;;){let n=i.peek(r);if(-1===n)break;if(s)s=!1;else if(n===go)s=!0;else if(e(i,r))return void(r>0&&i.acceptToken(t,r));r+=1}})),ca=(e,t)=>e.peek(t)===vo&&e.peek(t+1)===vo&&e.peek(t+2)===vo,Oa=(e,t)=>e.peek(t)===vo,ha=(e,t)=>e.peek(t)===$o,ua=aa({term:256,till:ca}),da=aa({term:257,till:Oa}),fa=aa({term:258,till:ha}),pa=la({term:259,till:ca}),ma=la({term:260,till:Oa}),ga=la({term:261,till:ha}),$a=(e,t)=>e.peek(t)===Qo&&e.peek(t+1)===yo,ba=(e,t)=>e.peek(t)===yo&&e.peek(t+1)===Qo,Qa=new eo(((e,t)=>{if($a(e,0)){let t=1,i=2;for(;-1!==e.peek(i);)if(ba(e,i)){if(t-=1,0===t)return void e.acceptToken(2,i+2);i+=2}else $a(e,i)?(t+=1,i+=2):i+=1;e.acceptToken(2,i)}})),ya=(e,t)=>{let i=e.peek(t);return i>=9&&i<14||i>=32&&i<33||i>=133&&i<134||i>=160&&i<161||i>=5760&&i<5761||i>=8192&&i<8203||i>=8232&&i<8234||i>=8239&&i<8240||i>=8287&&i<8288||i>=12288&&i<12289},Pa=new eo(((e,t)=>{e.peek(0)!==Po||ya(e,-1)||!t.canShift(245)?e.peek(0)!==_o||ya(e,-1)||!t.canShift(246)?e.peek(0)!==wo||ya(e,-1)||!t.canShift(247)?e.peek(0)!==ko||ya(e,-1)||!t.canShift(248)?e.peek(0)!==xo||ya(e,-1)||!t.canShift(249)?e.peek(0)!==vo||ya(e,-1)||!t.canShift(250)?e.peek(0)!==$o||ya(e,-1)||!t.canShift(251)?e.peek(0)!==mo||ya(e,-1)||!t.canShift(252)?ya(e,-1)||ya(e,0)||-1===e.peek(0)||!t.canShift(253)||e.acceptToken(253,0):e.acceptToken(252,0):e.acceptToken(251,0):e.acceptToken(250,0):e.acceptToken(249,0):e.acceptToken(248,0):e.acceptToken(247,0):e.acceptToken(246,0):e.acceptToken(245,0)}),{extend:!0}),wa={__proto__:null,if:14,elseif:20,else:24,end:26,try:30,catch:34,finally:40,for:44,primitive:74,type:76,abstract:84,mutable:90,struct:92,module:98,baremodule:104,macro:110,in:132,isa:134,function:152,do:164,where:170,true:204,false:204,begin:264,while:320,let:326,const:334,global:342,local:346,quote:350,break:354,continue:358,return:362,using:366,import:368,as:376,export:384},ka=uo.deserialize({version:14,states:"%<^Q$tQNSOOOOQj'#IP'#IPOOQj'#Gt'#GtO${QNSO'#IOO*cQNTO'#DoO*mQNTO'#DoO/eQNTO'#IRO0OQMyO'#IlOOQk'#Il'#IlO0TQNTO'#IlOOQk'#Do'#DoO:sQNTO'#DoO>{QNQO'#DtOOQk'#Ib'#IbO@WQNUO'#EWO@bONzO'#EhO@mONYO'#ElO@xO!!^O'#EmOATQMyO'#EoODRQNTO'#EoODYQMyO'#EnOGsQNQO'#FiOOQk'#I['#I[OLwQNTO'#I[ONrQNTO'#IOO! tQNSO'#IOOOQk'#IS'#ISO!!OQNTO'#GfO!#hQNTO'#GfO!$}QNQO'#GjO!(`QMxO'#GnO!(eQNTO'#IROOQk'#IR'#IRO! YQNSO'#IOO! YQNSO'#IOQOQMxOOO!(oQNQO'#CbOOQk'#Is'#IsO!$}QNQO'#FxO!,QQNQO'#F|O!/cQNQO'#GOOOQk'#GS'#GSOOQk'#GU'#G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w@x@y@z@{@|@}AOAPAQARASATAUAVAWAXAYAZA[A]A^A_A`AaAbAcAdAeAfAgAhAiAjAkAlAmAnAoApAqArAsAtAuBxByBzB{B|B}CWCYCZC[C]C^C_C`CdCeCfCgChCiCjDPDQDRDSDTDUDVDWDX|#oh!`$S$_%]&`&t&v&{'O'R'S(],{,}-[1a5S5T5U5w5|f,`)T+l-k.g/V/Y/]/^0U1z2Rf4_!o5f5p5y5}6Y6o7U7]:S:Wl4`#a#w+U+a5g5q5t5z6Z6p7V7^:T:Xd4a5h5r5u5{6[6q7W7_:U:Y`4b5i5v6]6r7X7`8^:Zd4c$R%R*e5s6^6s7Y7a:V:[h4d)])_)y+[/f5j5x6_6t7Z7b:]t4e'T6`6u7[7c:^=x=y=z={=|=}>OCaCsCtCuCvf9_+x+}0z0|:_:j;P;f;mij9c/a0_0a0p1h2Q2[2]:n;T;j;q<``9d.m:b:o;U;k;rb>c>d>e>f>g>hC{C|C}DO`=b=m=p=s=v=w>R>^>_`?[&k?p?v@S@`@dAvAx^?]?q?w@T@a@eAwAy[?^,q?x@U@b@fAz^?_,z?y@V@c@gA{Cb^AbA|BSB`BlBpCOCQ[AcBTBaBmBqCRCm`Ad0fA}BUBbBnBrCPCS]AeBVBcBoBsCTClU!v[%g`>a@l@m@n@o@v@w@x@y@z@{@|@}AOAPAQARASATAUAVAWAXAYAZA[A]A^A_A`AaAbAcAdAeAfAgAhAiAjAkAlAmAnAoApAqArAsAtAuBxByBzB{B|B}CdCeCfCgChCiCjDUDVDWDXQ.Q+hR0^.RS+t({.OR.`+pQ+o({S._+p.O^0b.X0d0k1u1y2S2dU0g.Z0i1wR1X/bS#P_#QS#T`#UT#Wa#XT+u({/bW,g)T+l-k0UR.l+xR.y,RR-Y*Sg$Yw ArgumentList ListCompherension ForClause IfClause Parameters FunctionDefinition function Definition TypedExpression CallExpression BroadcastDot DoClause do DoClauseArguments CallExpression where TypeParameters MacroExpression MacroIdentifier MacroName Operator MacroFieldExpression FieldExpression SubscriptExpression AssignmentExpression Symbol SymbolName CallExpression BroadcastDot ArgumentList AssignmentExpression Parameters BooleanLiteral Character String $ ( ) TripleString CommandString PrefixedString Prefix FieldEpxression String TripleString CommandString ParenthesizedExpression TupleExpression ArrayExpression ArrayComprehensionExpression ForClause ForBinding AssignOperator = ∈ IfClause MatrixExpression MatrixRow GeneratorExpression TypedExpression ParameterizedIdentifier TypeArgumentList begin MacroFieldName MacroArgumentList AssignmentExpression BareTupleExpression UnaryExpression Operator BinaryExpression TernaryExpression FunctionExpression AssignmentExpression CoefficientExpression TransposeExpression Coefficient CallExpression FieldExpression ParenthesizedExpression SpreadExpression AssignmentExpression ArrayExpression ArrayComprehensionExpression MatrixExpression MatrixRow GeneratorExpression TypedExpression ParameterizedIdentifier AssignOperator WhileStatement while WhileBinding LetStatement let LetBinding VariableDeclaration ConstStatement const AssignmentExpression BareTupleExpression GlobalStatement global LocalStatement local QuoteStatement quote BreakStatement break ContinueStatement continue ReturnStatement return ImportStatement using import Import ScopedIdentifier RenamedIdentifier as SelectedImport RenamedImport ExportStatement export CompoundExpression MacroExpression MacroFieldExpression MacroFieldName MacroArgumentList UnaryExpression Operator BinaryExpression TernaryExpression FunctionExpression AssignmentExpression CoefficientExpression TransposeExpression SpreadExpression FunctionAssignmentExpression",maxTerm:331,nodeProps:[["closedBy",-2,5,8,"end else elseif",-15,11,19,21,36,41,44,48,51,54,75,81,159,162,174,193,"end",14,"end catch finally",16,"end finally",-9,34,58,93,118,119,126,151,152,153,"]",-2,62,131,"}",-7,63,70,99,116,128,148,155,")"],["group",-35,7,10,12,13,15,17,20,22,37,38,42,45,46,49,52,55,66,67,76,82,85,132,160,163,167,171,173,175,177,179,181,183,184,188,192,"keyword",-9,27,28,65,90,105,106,107,123,124,"operator"]],skippedNodes:[0,2,3],repeatNodeCount:36,tokenData:"#$d~R.[XYHwYZHwpqHwqrJursK[stKotuKzuvLPvwL^wxLnxyMhyzMmz{LP{|Mr|}Mz}!ONP!O!PNo!P!Q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QQ'|~!_!`!Kt#p#q!Ko~#$]O'Z~R#$dO'yQ'eP",tokenizers:[Pa,Jo,sa,ra,Qa,ua,da,fa,pa,ma,ga,0,1],topRules:{SourceFile:[0,4]},dynamicPrecedences:{30:2,33:2,95:10,143:5,189:1,204:5,207:2,302:1,304:1,305:10,308:1,318:1,326:1,328:10,329:10,331:1},specialized:[{term:1,get:e=>wa[e]||-1}],tokenPrec:51925}),_a="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),va="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),xa="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class Xa{constructor(e,t){this.rules=[];let{finish:i}=t||{};function n(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,s,o){let a=[],l=/^@(\w+)\b/.exec(e[0]),c=l&&"keyframes"==l[1];if(l&&null==t)return s.push(e[0]+";");for(let i in t){let o=t[i];if(/&/.test(i))r(i.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),o,s);else if(o&&"object"==typeof o){if(!l)throw new RangeError("The value of a property ("+i+") should be a primitive value.");r(n(i),o,a,c)}else null!=o&&a.push(i.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+o+";")}(a.length||c)&&s.push((!i||l||o?e:e.map(i)).join(", ")+" {"+a.join(" ")+"}")}for(let t in e)r(n(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=xa[_a]||1;return xa[_a]=e+1,"ͼ"+e.toString(36)}static mount(e,t){(e[va]||new Ra(e)).mount(Array.isArray(t)?t:[t])}}let Sa=null;class Ra{constructor(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if(Sa)return e.adoptedStyleSheets=[Sa.sheet].concat(e.adoptedStyleSheets),e[va]=Sa;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),Sa=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[va]=this}mount(e){let t=this.sheet,i=0,n=0;for(let r=0;r-1&&(this.modules.splice(o,1),n--,o=-1),-1==o){if(this.modules.splice(n++,0,s),t)for(let e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Aa="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Na="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Ca="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ea="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),qa="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Va=Aa&&(Ea||+Aa[1]<57)||Ca&&Ea,za=0;za<10;za++)Ta[48+za]=Ta[96+za]=String(za);for(za=1;za<=24;za++)Ta[za+111]="F"+za;for(za=65;za<=90;za++)Ta[za]=String.fromCharCode(za+32),Wa[za]=String.fromCharCode(za);for(var Ia in Ta)Wa.hasOwnProperty(Ia)||(Wa[Ia]=Ta[Ia]);function Ya(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Za(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function Ua(e,t){if(!t.anchorNode)return!1;try{return Za(e,t.anchorNode)}catch(e){return!1}}function Ma(e){return 3==e.nodeType?il(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function Da(e,t,i,n){return!!i&&(Ga(e,t,i,n,-1)||Ga(e,t,i,n,1))}function ja(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function Ga(e,t,i,n,r){for(;;){if(e==i&&t==n)return!0;if(t==(r<0?0:La(e))){if("DIV"==e.nodeName)return!1;let i=e.parentNode;if(!i||1!=i.nodeType)return!1;t=ja(e)+(r<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?La(e):0}}}function La(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}const Ba={left:0,right:0,top:0,bottom:0};function Fa(e,t){let i=t?e.left:e.right;return{left:i,right:i,top:e.top,bottom:e.bottom}}function Ka(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}class Ha{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){this.set(e.anchorNode,e.anchorOffset,e.focusNode,e.focusOffset)}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}let Ja,el=null;function tl(e){if(e.setActive)return e.setActive();if(el)return e.focus(el);let t=[];for(let i=e;i&&(t.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(e.focus(null==el?{get preventScroll(){return el={preventScroll:!0},!0}}:void 0),!el){el=!1;for(let e=0;et)return i.domBoundsAround(e,t,l);if(O>=e&&-1==n&&(n=a,r=l),l>t&&i.dom.parentNode==this.dom){s=a,o=c;break}c=O,l=O+i.breakAfter}return{from:r,to:o<0?i+this.length:o,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:s=0?this.children[s].dom:null}}markDirty(e=!1){this.dirty|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.dirty|=2),1&t.dirty)return;t.dirty|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.dirty&&this.markParentsDirty(!0))}setDOM(e){this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=ol){this.markDirty();for(let i=e;ithis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Ol(e,t,i,n,r,s,o,a,l){let{children:c}=e,O=c.length?c[t]:null,h=s.length?s[s.length-1]:null,u=h?h.breakAfter:o;if(!(t==n&&O&&!o&&!u&&s.length<2&&O.merge(i,r,s.length?h:null,0==i,a,l))){if(n0&&(!o&&s.length&&O.merge(i,O.length,s[0],!1,a,0)?O.breakAfter=s.shift().breakAfter:(i2);var wl={mac:Pl||/Mac/.test(ul.platform),windows:/Win/.test(ul.platform),linux:/Linux|X11/.test(ul.platform),ie:gl,ie_version:pl?dl.documentMode||6:ml?+ml[1]:fl?+fl[1]:0,gecko:$l,gecko_version:$l?+(/Firefox\/(\d+)/.exec(ul.userAgent)||[0,0])[1]:0,chrome:!!bl,chrome_version:bl?+bl[1]:0,ios:Pl,android:/Android\b/.test(ul.userAgent),webkit:Ql,safari:yl,webkit_version:Ql?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=dl.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class kl extends al{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){3==e.nodeType&&this.createDOM(e)}merge(e,t,i){return(!i||i instanceof kl&&!(this.length-(t-e)+i.length>256))&&(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new kl(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new sl(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return vl(this.dom,e,t)}}class _l extends al{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let e of t)e.setParent(this)}setAttrs(e){if(rl(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.dirty|=6)}sync(e){this.dom?4&this.dirty&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e)}merge(e,t,i,n,r,s){return!(i&&(!(i instanceof _l&&i.mark.eq(this.mark))||e&&r<=0||te&&t.push(i=e&&(n=r),i=o,r++}let s=this.length-e;return this.length=e,n>-1&&(this.children.length=n,this.markDirty()),new _l(this.mark,t,s)}domAtPos(e){return Wl(this.dom,this.children,e)}coordsAt(e,t){return Nl(this,e,t)}}function vl(e,t,i){let n=e.nodeValue.length;t>n&&(t=n);let r=t,s=t,o=0;0==t&&i<0||t==n&&i>=0?wl.chrome||wl.gecko||(t?(r--,o=1):(s++,o=-1)):i<0?r--:s++;let a=il(e,r,s).getClientRects();if(!a.length)return Ba;let l=a[(o?o<0:i>=0)?0:a.length-1];return wl.safari&&!o&&0==l.width&&(l=Array.prototype.find.call(a,(e=>e.width))||l),o?Fa(l,o<0):l||null}class xl extends al{constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}static create(e,t,i){return new(e.customView||xl)(e,t,i)}split(e){let t=xl.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,n,r,s){return!(i&&(!(i instanceof xl&&this.widget.compare(i.widget))||e>0&&r<=0||t0?i.length-1:0;n=i[t],!(e>0?0==t:t==i.length-1||n.top0?-1:1);return 0==e&&t>0||e==this.length&&t<=0?n:Fa(n,0==e)}get isEditable(){return!1}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class Xl extends xl{domAtPos(e){let{topView:t,text:i}=this.widget;return t?Sl(e,0,t,i,((e,t)=>e.domAtPos(t)),(e=>new sl(i,Math.min(e,i.nodeValue.length)))):new sl(i,Math.min(e,i.nodeValue.length))}sync(){this.setDOM(this.widget.toDOM())}localPosFromDOM(e,t){let{topView:i,text:n}=this.widget;return i?Rl(e,t,i,n):Math.min(t,this.length)}ignoreMutation(){return!1}get overrideDOMText(){return null}coordsAt(e,t){let{topView:i,text:n}=this.widget;return i?Sl(e,t,i,n,((e,t,i)=>e.coordsAt(t,i)),((e,t)=>vl(n,e,t))):vl(n,e,t)}destroy(){var e;super.destroy(),null===(e=this.widget.topView)||void 0===e||e.destroy()}get isEditable(){return!0}}function Sl(e,t,i,n,r,s){if(i instanceof _l){for(let o of i.children){let i=Za(o.dom,n),a=i?n.nodeValue.length:o.length;if(e=0;)if(t<0?n>0:n0?-1:1);return i&&i.topt.top?{left:t.left,right:t.right,top:i.top,bottom:i.bottom}:t}get overrideDOMText(){return un.empty}}function Wl(e,t,i){let n=0;for(let r=0;nr&&i0;n--){let i=t[n-1].dom;if(i.parentNode==e)return sl.after(i)}return new sl(e,0)}function Al(e,t,i){let n,{children:r}=e;i>0&&t instanceof _l&&r.length&&(n=r[r.length-1])instanceof _l&&n.mark.eq(t.mark)?Al(n,t.children[0],i-1):(r.push(t),t.setParent(e)),e.length+=t.length}function Nl(e,t,i){for(let n=0,r=0;r0?a>=t:a>t)&&(t0)){let e=0;if(a==n){if(o.getSide()<=0)continue;e=i=-o.getSide()}let r=o.coordsAt(Math.max(0,t-n),i);return e&&r?Fa(r,i<0):r}n=a}let n=e.dom.lastChild;if(!n)return e.dom.getBoundingClientRect();let r=Ma(n);return r[r.length-1]||null}function Cl(e,t){for(let i in e)"class"==i&&t.class?t.class+=" "+e.class:"style"==i&&t.style?t.style+=";"+e.style:t[i]=e[i];return t}function El(e,t){if(e==t)return!0;if(!e||!t)return!1;let i=Object.keys(e),n=Object.keys(t);if(i.length!=n.length)return!1;for(let r of i)if(-1==n.indexOf(r)||e[r]!==t[r])return!1;return!0}function ql(e,t,i){if(t)for(let n in t)i&&n in i||e.removeAttribute(n);if(i)for(let n in i)t&&t[n]==i[n]||e.setAttribute(n,i[n])}kl.prototype.children=xl.prototype.children=Tl.prototype.children=ol;class Vl{eq(e){return!1}updateDOM(e){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}ignoreEvent(e){return!0}get customView(){return null}destroy(e){}}var zl=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(zl||(zl={}));class Il extends Vr{constructor(e,t,i,n){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(e){return new Yl(e)}static widget(e){let t=e.side||0,i=!!e.block;return t+=i?t>0?3e8:-4e8:t>0?1e8:-1e8,new Ul(e,t,t,i,e.widget||null,!1)}static replace(e){let t,i,n=!!e.block;if(e.isBlockGap)t=-5e8,i=4e8;else{let{start:r,end:s}=Ml(e,n);t=(r?n?-3e8:-1:5e8)-1,i=1+(s?n?2e8:1:-6e8)}return new Ul(e,t,i,n,e.widget||null,!0)}static line(e){return new Zl(e)}static set(e,t=!1){return Zr.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}Il.none=Zr.empty;class Yl extends Il{constructor(e){let{start:t,end:i}=Ml(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){return this==e||e instanceof Yl&&this.tagName==e.tagName&&this.class==e.class&&El(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Yl.prototype.point=!1;class Zl extends Il{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Zl&&El(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Zl.prototype.mapMode=Nn.TrackBefore,Zl.prototype.point=!0;class Ul extends Il{constructor(e,t,i,n,r,s){super(t,i,r,e),this.block=n,this.isReplace=s,this.mapMode=n?t<=0?Nn.TrackBefore:Nn.TrackAfter:Nn.TrackDel}get type(){return this.startSide=5}eq(e){return e instanceof Ul&&function(e,t){return e==t||!!(e&&t&&e.compare(t))}(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}function Ml(e,t=!1){let{inclusiveStart:i,inclusiveEnd:n}=e;return null==i&&(i=e.inclusive),null==n&&(n=e.inclusive),{start:null!=i?i:t,end:null!=n?n:t}}function Dl(e,t,i,n=0){let r=i.length-1;r>=0&&i[r]+n>=e?i[r]=Math.max(i[r],t):i.push(e,t)}Ul.prototype.point=!0;class jl extends al{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,i,n,r,s){if(i){if(!(i instanceof jl))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),hl(this,e,t,i?i.children:[],r,s),!0}split(e){let t=new jl;if(t.breakAfter=this.breakAfter,0==this.length)return t;let{i:i,off:n}=this.childPos(e);n&&(t.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let e=i;e0&&0==this.children[i-1].length;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){El(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Al(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=Cl(t,this.attrs||{})),i&&(this.attrs=Cl({class:i},this.attrs||{}))}domAtPos(e){return Wl(this.dom,this.children,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.dirty|=6)}sync(e){var t;this.dom?4&this.dirty&&(rl(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),void 0!==this.prevAttrs&&(ql(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e);let i=this.dom.lastChild;for(;i&&al.get(i)instanceof _l;)i=i.lastChild;if(!(i&&this.length&&("BR"==i.nodeName||0!=(null===(t=al.get(i))||void 0===t?void 0:t.isEditable)||wl.ios&&this.children.some((e=>e instanceof kl))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e=0;for(let t of this.children){if(!(t instanceof kl))return null;let i=Ma(t.dom);if(1!=i.length)return null;e+=i[0].width}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length}}coordsAt(e,t){return Nl(this,e,t)}become(e){return!1}get type(){return zl.Text}static find(e,t){for(let i=0,n=0;i=t){if(r instanceof jl)return r;if(s>t)break}n=s+r.breakAfter}return null}}class Gl extends al{constructor(e,t,i){super(),this.widget=e,this.length=t,this.type=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,n,r,s){return!(i&&(!(i instanceof Gl&&this.widget.compare(i.widget))||e>0&&r<=0||t0;){if(this.textOff==this.text.length){let{value:t,lineBreak:i,done:n}=this.cursor.next(this.skip);if(this.skip=0,n)throw new Error("Ran out of text content when drawing inline views");if(i){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer([]),this.curLine=null,e--;continue}this.text=t,this.textOff=0}let n=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(0,i)),this.getLine().append(Bl(new kl(this.text.slice(this.textOff,this.textOff+n)),t),i),this.atCursorPos=!0,this.textOff+=n,e-=n,i=0}}span(e,t,i,n){this.buildText(t-e,i,n),this.pos=t,this.openStart<0&&(this.openStart=n)}point(e,t,i,n,r,s){if(this.disallowBlockEffectsFor[s]&&i instanceof Ul){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=t-e;if(i instanceof Ul)if(i.block){let{type:e}=i;e!=zl.WidgetAfter||this.posCovered()||this.getLine(),this.addBlockWidget(new Gl(i.widget||new Fl("div"),o,e))}else{let s=xl.create(i.widget||new Fl("span"),o,i.startSide),a=this.atCursorPos&&!s.isEditable&&r<=n.length&&(e0),l=!s.isEditable&&(ee.some((e=>e))});class rc{constructor(e,t="nearest",i="nearest",n=5,r=5){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=r}map(e){return e.empty?this:new rc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin)}}const sc=kr.define({map:(e,t)=>e.map(t)});function oc(e,t,i){let n=e.facet(ec);n.length?n[0](t):window.onerror?window.onerror(String(t),i,void 0,void 0,t):i?console.error(i+":",t):console.error(t)}const ac=Ln.define({combine:e=>!e.length||e[0]});let lc=0;const cc=Ln.define();class Oc{constructor(e,t,i,n){this.id=e,this.create=t,this.domEventHandlers=i,this.extension=n(this)}static define(e,t){const{eventHandlers:i,provide:n,decorations:r}=t||{};return new Oc(lc++,e,i,(e=>{let t=[cc.of(e)];return r&&t.push(fc.of((t=>{let i=t.plugin(e);return i?r(i):Il.none}))),n&&t.push(n(e)),t}))}static fromClass(e,t){return Oc.define((t=>new e(t)),t)}}class hc{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(t){if(oc(e.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(e){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){oc(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(t){oc(e.state,t,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const uc=Ln.define(),dc=Ln.define(),fc=Ln.define(),pc=Ln.define(),mc=Ln.define(),gc=Ln.define();class $c{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new $c(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let n=e[t-1];if(!(n.fromA>i.toA)){if(n.toAc)break;r+=2}if(!a)return i;new $c(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),s=a.toA,o=a.toB}}}class bc{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=En.empty(this.startState.doc.length);for(let e of i)this.changes=this.changes.compose(e.changes);let n=[];this.changes.iterChangedRanges(((e,t,i,r)=>n.push(new $c(e,t,i,r)))),this.changedRanges=n;let r=e.hasFocus;r!=e.inputState.notifiedFocused&&(e.inputState.notifiedFocused=r,this.flags|=1)}static create(e,t,i){return new bc(e,t,i)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}var Qc=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(Qc||(Qc={}));const yc=Qc.LTR,Pc=Qc.RTL;function wc(e){let t=[];for(let i=0;i=t){if(o.level==i)return s;(r<0||(0!=n?n<0?o.fromt:e[r].level>o.level))&&(r=s)}}if(r<0)throw new RangeError("Index out of range");return r}}const Tc=[];function Wc(e){return[new Rc(0,e,0)]}let Ac="";function Nc(e,t,i,n,r){var s;let o=n.head-e.from,a=-1;if(0==o){if(!r||!e.length)return null;t[0].level!=i&&(o=t[0].side(!1,i),a=0)}else if(o==e.length){if(r)return null;let e=t[t.length-1];e.level!=i&&(o=e.side(!0,i),a=t.length-1)}a<0&&(a=Rc.find(t,o,null!==(s=n.bidiLevel)&&void 0!==s?s:-1,n.assoc));let l=t[a];o==l.side(r,i)&&(l=t[a+=r?1:-1],o=l.side(!r,i));let c=r==(l.dir==i),O=kn(e.text,o,c);if(Ac=e.text.slice(Math.min(o,O),Math.max(o,O)),O!=l.side(r,i))return Mn.cursor(O+e.from,c?-1:1,l.level);let h=a==(r?t.length-1:0)?null:t[a+(r?1:-1)];return h||l.level==i?h&&h.level1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=o-1);i=s+o}}readNode(e){if(e.cmIgnore)return;let t=al.get(e),i=t&&t.overrideDOMText;if(null!=i){this.findPointInside(e,i.length);for(let e=i.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(3==e.nodeType?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+Math.min(t,i.offset))}}function Ec(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}class qc{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Vc extends al{constructor(e){super(),this.view=e,this.compositionDeco=Il.none,this.decorations=[],this.dynamicDecorationMap=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new jl],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new $c(0,0,0,e.state.doc.length)],0)}get root(){return this.view.root}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(e){let t=e.changedRanges;this.minWidth>0&&t.length&&(t.every((({fromA:e,toA:t})=>tthis.minWidthTo))?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.view.inputState.composing<0?this.compositionDeco=Il.none:(e.transactions.length||this.dirty)&&(this.compositionDeco=function(e,t){let i=Ic(e);if(!i)return Il.none;let{from:n,to:r,node:s,text:o}=i,a=t.mapPos(n,1),l=Math.max(a,t.mapPos(r,-1)),{state:c}=e,O=3==s.nodeType?s.nodeValue:new Cc([],c).readRange(s.firstChild,null).text;if(l-a{this.dom.style.height=this.view.viewState.contentHeight+"px",this.dom.style.minWidth=this.minWidth?this.minWidth+"px":"";let e=wl.chrome||wl.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(e),this.dirty=0,e&&(e.written||i.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""}));let n=[];if(this.view.viewport.from||this.view.viewport.to=0?e[t]:null;if(!n)break;let{fromA:r,toA:s,fromB:o,toB:a}=n,{content:l,breakAtStart:c,openStart:O,openEnd:h}=Ll.build(this.view.state.doc,o,a,this.decorations,this.dynamicDecorationMap),{i:u,off:d}=i.findPos(s,1),{i:f,off:p}=i.findPos(r,-1);Ol(this,f,p,u,d,l,c,O,h)}}updateSelection(e=!1,t=!1){if(e&&this.view.observer.readSelectionRange(),!t&&!this.mayControlSelection()||wl.ios&&this.view.inputState.rapidCompositionStart)return;let i=this.forceSelection;this.forceSelection=!1;let n=this.view.state.selection.main,r=this.domAtPos(n.anchor),s=n.empty?r:this.domAtPos(n.head);if(wl.gecko&&n.empty&&function(e){return 1==e.node.nodeType&&e.node.firstChild&&(0==e.offset||"false"==e.node.childNodes[e.offset-1].contentEditable)&&(e.offset==e.node.childNodes.length||"false"==e.node.childNodes[e.offset].contentEditable)}(r)){let e=document.createTextNode("");this.view.observer.ignore((()=>r.node.insertBefore(e,r.node.childNodes[r.offset]||null))),r=s=new sl(e,0),i=!0}let o=this.view.observer.selectionRange;!i&&o.focusNode&&Da(r.node,r.offset,o.anchorNode,o.anchorOffset)&&Da(s.node,s.offset,o.focusNode,o.focusOffset)||(this.view.observer.ignore((()=>{wl.android&&wl.chrome&&this.dom.contains(o.focusNode)&&function(e,t){for(let i=e;i&&i!=t;i=i.assignedSlot||i.parentNode)if(1==i.nodeType&&"false"==i.contentEditable)return!0;return!1}(o.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=Ya(this.root);if(n.empty){if(wl.gecko){let e=function(e,t){return 1!=e.nodeType?0:(t&&"false"==e.childNodes[t-1].contentEditable?1:0)|(tn.head&&([r,s]=[s,r]),t.setEnd(s.node,s.offset),t.setStart(r.node,r.offset),e.removeAllRanges(),e.addRange(t)}})),this.view.observer.setSelectionRange(r,s)),this.impreciseAnchor=r.precise?null:new sl(o.anchorNode,o.anchorOffset),this.impreciseHead=s.precise?null:new sl(o.focusNode,o.focusOffset)}enforceCursorAssoc(){if(this.compositionDeco.size)return;let e=this.view.state.selection.main,t=Ya(this.root);if(!e.empty||!e.assoc||!t.modify)return;let i=jl.find(this,e.head);if(!i)return;let n=i.posAtStart;if(e.head==n||e.head==n+i.length)return;let r=this.coordsAt(e.head,-1),s=this.coordsAt(e.head,1);if(!r||!s||r.bottom>s.top)return;let o=this.domAtPos(e.head+e.assoc);t.collapse(o.node,o.offset),t.modify("move",e.assoc<0?"forward":"backward","lineboundary")}mayControlSelection(){return this.view.state.facet(ac)?this.root.activeElement==this.dom:Ua(this.dom,this.view.observer.selectionRange)}nearest(e){for(let t=e;t;){let e=al.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;ts||e==s&&r.type!=zl.WidgetBefore&&r.type!=zl.WidgetAfter&&(!n||2==t||this.children[n-1].breakAfter||this.children[n-1].type==zl.WidgetBefore&&t>-2))return r.coordsAt(e-s,t);i=s}}measureVisibleLineHeights(e){let t=[],{from:i,to:n}=e,r=this.view.contentDOM.clientWidth,s=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==Qc.LTR;for(let e=0,l=0;ln)break;if(e>=i){let i=c.dom.getBoundingClientRect();if(t.push(i.height),s){let t=c.dom.lastChild,n=t?Ma(t):[];if(n.length){let t=n[n.length-1],s=a?t.right-i.left:i.right-t.left;s>o&&(o=s,this.minWidth=r,this.minWidthFrom=e,this.minWidthTo=O)}}}e=O+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?Qc.RTL:Qc.LTR}measureTextSize(){for(let e of this.children)if(e instanceof jl){let t=e.measureTextSize();if(t)return t}let e,t,i=document.createElement("div");return i.className="cm-line",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(i);let n=Ma(i.firstChild)[0];e=i.getBoundingClientRect().height,t=n?n.width/27:7,i.remove()})),{lineHeight:e,charWidth:t}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new cl(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let r=n==t.viewports.length?null:t.viewports[n],s=r?r.from-1:this.length;if(s>i){let n=t.lineBlockAt(s).bottom-t.lineBlockAt(i).top;e.push(Il.replace({widget:new zc(n),block:!0,inclusive:!0,isBlockGap:!0}).range(i,s))}if(!r)break;i=r.to+1}return Il.set(e)}updateDeco(){let e=this.view.state.facet(fc).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e));for(let t=e.length;ti.anchor?-1:1);if(!n)return;!i.empty&&(t=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,t.left),top:Math.min(n.top,t.top),right:Math.max(n.right,t.right),bottom:Math.max(n.bottom,t.bottom)});let r=0,s=0,o=0,a=0;for(let e of this.view.state.facet(mc).map((e=>e(this.view))))if(e){let{left:t,right:i,top:n,bottom:l}=e;null!=t&&(r=Math.max(r,t)),null!=i&&(s=Math.max(s,i)),null!=n&&(o=Math.max(o,n)),null!=l&&(a=Math.max(a,l))}let l={left:n.left-r,top:n.top-o,right:n.right+s,bottom:n.bottom+a};!function(e,t,i,n,r,s,o,a){let l=e.ownerDocument,c=l.defaultView;for(let O=e;O;)if(1==O.nodeType){let e,h=O==l.body;if(h)e=Ka(c);else{if(O.scrollHeight<=O.clientHeight&&O.scrollWidth<=O.clientWidth){O=O.parentNode;continue}let t=O.getBoundingClientRect();e={left:t.left,right:t.left+O.clientWidth,top:t.top,bottom:t.top+O.clientHeight}}let u=0,d=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+d&&(d=t.bottom-e.bottom+d+o)):t.bottom>e.bottom&&(d=t.bottom-e.bottom+o,i<0&&t.top-d0&&t.right>e.right+u&&(u=t.right-e.right+u+s)):t.right>e.right&&(u=t.right-e.right+s,i<0&&t.left0&&i<=0)t=La(e=e.childNodes[t-1]);else{if(!(1==e.nodeType&&t=0))return null;e=e.childNodes[t],t=0}}}class Uc{constructor(){this.changes=[]}compareRange(e,t){Dl(e,t,this.changes)}comparePoint(e,t){Dl(e,t,this.changes)}}function Mc(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function Dc(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function jc(e,t){return e.topt.top+1}function Gc(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function Bc(e,t,i){let n,r,s,o,a,l,c,O;for(let h=e.firstChild;h;h=h.nextSibling){let e=Ma(h);for(let u=0;up||o==p&&s>f)&&(n=h,r=d,s=f,o=p),0==f?i>d.bottom&&(!c||c.bottomd.top)&&(l=h,O=d):c&&jc(c,d)?c=Lc(c,d.bottom):O&&jc(O,d)&&(O=Gc(O,d.top))}}if(c&&c.bottom>=i?(n=a,r=c):O&&O.top<=i&&(n=l,r=O),!n)return{node:e,offset:0};let h=Math.max(r.left,Math.min(r.right,t));return 3==n.nodeType?Fc(n,h,i):s||"true"!=n.contentEditable?{node:e,offset:Array.prototype.indexOf.call(e.childNodes,n)+(t>=(r.left+r.right)/2?1:0)}:Bc(n,h,i)}function Fc(e,t,i){let n=e.nodeValue.length,r=-1,s=1e9,o=0;for(let a=0;ai?c.top-i:i-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&O=(c.left+c.right)/2,n=i;if((wl.chrome||wl.gecko)&&il(e,a).getBoundingClientRect().left==c.right&&(n=!i),O<=0)return{node:e,offset:a+(n?1:0)};r=a+(n?1:0),s=O}}}return{node:e,offset:r>-1?r:o>0?e.nodeValue.length:0}}function Kc(e,{x:t,y:i},n,r=-1){var s;let o,a=e.contentDOM.getBoundingClientRect(),l=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,O=i-l;if(O<0)return 0;if(O>c)return e.state.doc.length;for(let t=e.defaultLineHeight/2,i=!1;o=e.elementAtHeight(O),o.type!=zl.Text;)for(;O=r>0?o.bottom+t:o.top-t,!(O>=0&&O<=c);){if(i)return n?null:0;i=!0,r=-r}i=l+O;let h=o.from;if(he.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:Hc(e,a,o,t,i);let u=e.dom.ownerDocument,d=e.root.elementFromPoint?e.root:u,f=d.elementFromPoint(t,i);f&&!e.contentDOM.contains(f)&&(f=null),f||(t=Math.max(a.left+1,Math.min(a.right-1,t)),f=d.elementFromPoint(t,i),f&&!e.contentDOM.contains(f)&&(f=null));let p,m=-1;if(f&&0!=(null===(s=e.docView.nearest(f))||void 0===s?void 0:s.isEditable))if(u.caretPositionFromPoint){let e=u.caretPositionFromPoint(t,i);e&&({offsetNode:p,offset:m}=e)}else if(u.caretRangeFromPoint){let e=u.caretRangeFromPoint(t,i);e&&(({startContainer:p,startOffset:m}=e),wl.safari&&function(e,t,i){let n;if(3!=e.nodeType||t!=(n=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=t.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return il(e,n-1,n).getBoundingClientRect().left>i}(p,m,t)&&(p=void 0))}if(!p||!e.docView.dom.contains(p)){let n=jl.find(e.docView,h);if(!n)return O>o.top+o.height/2?o.to:o.from;({node:p,offset:m}=Bc(n.dom,t,i))}return e.docView.posFromDOM(p,m)}function Hc(e,t,i,n,r){let s=Math.round((n-t.left)*e.defaultCharacterWidth);e.lineWrapping&&i.height>1.5*e.defaultLineHeight&&(s+=Math.floor((r-i.top)/e.defaultLineHeight)*e.viewState.heightOracle.lineLength);let o=e.state.sliceDoc(i.from,i.to);return i.from+ts(o,s,e.state.tabSize)}function Jc(e,t,i,n){let r=e.state.doc.lineAt(t.head),s=e.bidiSpans(r),o=e.textDirectionAt(r.from);for(let a=t,l=null;;){let t=Nc(r,s,o,a,i),c=Ac;if(!t){if(r.number==(i?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(i?1:-1)),s=e.bidiSpans(r),t=Mn.cursor(i?r.from:r.to)}if(l){if(!l(c))return a}else{if(!n)return t;l=n(c)}a=t}}function eO(e,t,i){let n=e.state.facet(pc).map((t=>t(e)));for(;;){let e=!1;for(let r of n)r.between(i.from-1,i.from+1,((n,r,s)=>{i.from>n&&i.fromi.from?Mn.cursor(n,1):Mn.cursor(r,-1),e=!0)}));if(!e)return i}}class tO{constructor(e){this.lastKeyCode=0,this.lastKeyTime=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=0,this.lastContextMenu=0,this.scrollHandlers=[],this.registeredEvents=[],this.customHandlers=[],this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.rapidCompositionStart=!1,this.mouseSelection=null;for(let t in oO){let i=oO[t];e.contentDOM.addEventListener(t,(n=>{sO(e,n)&&!this.ignoreDuringComposition(n)&&("keydown"==t&&this.keydown(e,n)||(this.mustFlushObserver(n)&&e.observer.forceFlush(),this.runCustomHandlers(t,e,n)?n.preventDefault():i(e,n)))})),this.registeredEvents.push(t)}this.notifiedFocused=e.hasFocus,wl.safari&&e.contentDOM.addEventListener("input",(()=>null))}setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}ensureHandlers(e,t){var i;let n;this.customHandlers=[];for(let r of t)if(n=null===(i=r.update(e).spec)||void 0===i?void 0:i.domEventHandlers){this.customHandlers.push({plugin:r.value,handlers:n});for(let t in n)this.registeredEvents.indexOf(t)<0&&"scroll"!=t&&(this.registeredEvents.push(t),e.contentDOM.addEventListener(t,(i=>{sO(e,i)&&this.runCustomHandlers(t,e,i)&&i.preventDefault()})))}}runCustomHandlers(e,t,i){for(let n of this.customHandlers){let r=n.handlers[e];if(r)try{if(r.call(n.plugin,i,t)||i.defaultPrevented)return!0}catch(e){oc(t.state,e)}}return!1}runScrollHandlers(e,t){for(let i of this.customHandlers){let n=i.handlers.scroll;if(n)try{n.call(i.plugin,t,e)}catch(t){oc(e.state,t)}}}keydown(e,t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),9==t.keyCode&&Date.now()e.keyCode==t.keyCode)))||t.ctrlKey||t.altKey||t.metaKey||t.synthetic||(this.pendingIOSKey=i,setTimeout((()=>this.flushIOSKey(e)),250),0))}flushIOSKey(e){let t=this.pendingIOSKey;return!!t&&(this.pendingIOSKey=void 0,nl(e.contentDOM,t.key,t.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(wl.safari&&Date.now()-this.compositionEndedAt<100)&&(this.compositionEndedAt=0,!0))}mustFlushObserver(e){return"keydown"==e.type&&229!=e.keyCode||"compositionend"==e.type&&!wl.ios}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.mouseSelection&&this.mouseSelection.update(e),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}const iO=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],nO=[16,17,18,20,91,92,224,225];class rO{constructor(e,t,i,n){this.view=e,this.style=i,this.mustSelect=n,this.lastEvent=t;let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Er.allowMultipleSelections)&&function(e,t){let i=e.state.facet(Kl);return i.length?i[0](t):wl.mac?t.metaKey:t.ctrlKey}(e,t),this.dragMove=function(e,t){let i=e.state.facet(Hl);return i.length?i[0](t):wl.mac?!t.altKey:!t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:i}=e.state.selection;if(i.empty)return!1;let n=Ya(e.root);if(0==n.rangeCount)return!0;let r=n.getRangeAt(0).getClientRects();for(let e=0;e=t.clientX&&i.top<=t.clientY&&i.bottom>=t.clientY)return!0}return!1}(e,t)||1!=bO(t))&&null,!1===this.dragging&&(t.preventDefault(),this.select(t))}move(e){if(0==e.buttons)return this.destroy();!1===this.dragging&&this.select(this.lastEvent=e)}up(e){null==this.dragging&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=null}select(e){let t=this.style.get(e,this.extend,this.multiple);!this.mustSelect&&t.eq(this.view.state.selection)&&t.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:t,userEvent:"select.pointer",scrollIntoView:!0}),this.mustSelect=!1}update(e){e.docChanged&&this.dragging&&(this.dragging=this.dragging.map(e.changes)),this.style.update(e)&&setTimeout((()=>this.select(this.lastEvent)),20)}}function sO(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let i,n=t.target;n!=e.contentDOM;n=n.parentNode)if(!n||11==n.nodeType||(i=al.get(n))&&i.ignoreEvent(t))return!1;return!0}const oO=Object.create(null),aO=wl.ie&&wl.ie_version<15||wl.ios&&wl.webkit_version<604;function lO(e,t){let i,{state:n}=e,r=1,s=n.toText(t),o=s.lines==n.selection.ranges.length;if(null!=yO&&n.selection.ranges.every((e=>e.empty))&&yO==s.toString()){let e=-1;i=n.changeByRange((i=>{let a=n.doc.lineAt(i.from);if(a.from==e)return{range:i};e=a.from;let l=n.toText((o?s.line(r++).text:t)+n.lineBreak);return{changes:{from:a.from,insert:l},range:Mn.cursor(i.from+l.length)}}))}else i=o?n.changeByRange((e=>{let t=s.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Mn.cursor(e.from+t.length)}})):n.replaceSelection(s);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}oO.keydown=(e,t)=>{e.inputState.setSelectionOrigin("select"),27==t.keyCode?e.inputState.lastEscPress=Date.now():nO.indexOf(t.keyCode)<0&&(e.inputState.lastEscPress=0)};let cO=0;function OO(e,t,i,n){if(1==n)return Mn.cursor(t,i);if(2==n)return function(e,t,i=1){let n=e.charCategorizer(t),r=e.doc.lineAt(t),s=t-r.from;if(0==r.length)return Mn.cursor(t);0==s?i=1:s==r.length&&(i=-1);let o=s,a=s;i<0?o=kn(r.text,s,!1):a=kn(r.text,s);let l=n(r.text.slice(o,a));for(;o>0;){let e=kn(r.text,o,!1);if(n(r.text.slice(e,o))!=l)break;o=e}for(;a{cO=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},oO.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},oO.mousedown=(e,t)=>{if(e.observer.flush(),cO>Date.now()-2e3&&1==bO(t))return;let i=null;for(let n of e.state.facet(Jl))if(i=n(e,t),i)break;if(i||0!=t.button||(i=function(e,t){let i=fO(e,t),n=bO(t),r=e.state.selection,s=i,o=t;return{update(e){e.docChanged&&(i&&(i.pos=e.changes.mapPos(i.pos)),r=r.map(e.changes),o=null)},get(t,a,l){let c;if(o&&t.clientX==o.clientX&&t.clientY==o.clientY?c=s:(c=s=fO(e,t),o=t),!c||!i)return r;let O=OO(e,c.pos,c.bias,n);if(i.pos!=c.pos&&!a){let t=OO(e,i.pos,i.bias,n),r=Math.min(t.from,O.from),s=Math.max(t.to,O.to);O=rtl(e.contentDOM))),e.inputState.startMouseSelection(new rO(e,t,i,n))}};let hO=(e,t)=>e>=t.top&&e<=t.bottom,uO=(e,t,i)=>hO(t,i)&&e>=i.left&&e<=i.right;function dO(e,t,i,n){let r=jl.find(e.docView,t);if(!r)return 1;let s=t-r.posAtStart;if(0==s)return 1;if(s==r.length)return-1;let o=r.coordsAt(s,-1);if(o&&uO(i,n,o))return-1;let a=r.coordsAt(s,1);return a&&uO(i,n,a)?1:o&&hO(n,o)?-1:1}function fO(e,t){let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:i,bias:dO(e,i,t.clientX,t.clientY)}}const pO=wl.ie&&wl.ie_version<=11;let mO=null,gO=0,$O=0;function bO(e){if(!pO)return e.detail;let t=mO,i=$O;return mO=e,$O=Date.now(),gO=!t||i>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(gO+1)%3:1}function QO(e,t,i,n){if(!i)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1);t.preventDefault();let{mouseSelection:s}=e.inputState,o=n&&s&&s.dragging&&s.dragMove?{from:s.dragging.from,to:s.dragging.to}:null,a={from:r,insert:i},l=e.state.changes(o?[o,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(r,-1),head:l.mapPos(r,1)},userEvent:o?"move.drop":"input.drop"})}oO.dragstart=(e,t)=>{let{selection:{main:i}}=e.state,{mouseSelection:n}=e.inputState;n&&(n.dragging=i),t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(i.from,i.to)),t.dataTransfer.effectAllowed="copyMove")},oO.drop=(e,t)=>{if(!t.dataTransfer)return;if(e.state.readOnly)return t.preventDefault();let i=t.dataTransfer.files;if(i&&i.length){t.preventDefault();let n=Array(i.length),r=0,s=()=>{++r==i.length&&QO(e,t,n.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(n[e]=t.result),s()},t.readAsText(i[e])}}else QO(e,t,t.dataTransfer.getData("Text"),!0)},oO.paste=(e,t)=>{if(e.state.readOnly)return t.preventDefault();e.observer.flush();let i=aO?null:t.clipboardData;i?(lO(e,i.getData("text/plain")),t.preventDefault()):function(e){let t=e.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout((()=>{e.focus(),i.remove(),lO(e,i.value)}),50)}(e)};let yO=null;function PO(e){setTimeout((()=>{e.hasFocus!=e.inputState.notifiedFocused&&e.update([])}),10)}function wO(e,t){if(e.docView.compositionDeco.size){e.inputState.rapidCompositionStart=t;try{e.update([])}finally{e.inputState.rapidCompositionStart=!1}}}oO.copy=oO.cut=(e,t)=>{let{text:i,ranges:n,linewise:r}=function(e){let t=[],i=[],n=!1;for(let n of e.selection.ranges)n.empty||(t.push(e.sliceDoc(n.from,n.to)),i.push(n));if(!t.length){let r=-1;for(let{from:n}of e.selection.ranges){let s=e.doc.lineAt(n);s.number>r&&(t.push(s.text),i.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),r=s.number}n=!0}return{text:t.join(e.lineBreak),ranges:i,linewise:n}}(e.state);if(!i&&!r)return;yO=r?i:null;let s=aO?null:t.clipboardData;s?(t.preventDefault(),s.clearData(),s.setData("text/plain",i)):function(e,t){let i=e.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=t,n.focus(),n.selectionEnd=t.length,n.selectionStart=0,setTimeout((()=>{n.remove(),e.focus()}),50)}(e,i),"cut"!=t.type||e.state.readOnly||e.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"})},oO.focus=PO,oO.blur=e=>{e.observer.clearSelectionRange(),PO(e)},oO.compositionstart=oO.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0,e.docView.compositionDeco.size&&(e.observer.flush(),wO(e,!0)))},oO.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionFirstChange=null,setTimeout((()=>{e.inputState.composing<0&&wO(e,!1)}),50)},oO.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},oO.beforeinput=(e,t)=>{var i;let n;if(wl.chrome&&wl.android&&(n=iO.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(n.key,n.keyCode),"Backspace"==n.key||"Delete"==n.key)){let t=(null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0;setTimeout((()=>{var i;((null===(i=window.visualViewport)||void 0===i?void 0:i.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}};const kO=["pre-wrap","normal","pre-line","break-spaces"];class _O{constructor(){this.doc=un.empty,this.lineWrapping=!1,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return kO.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,o=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=s;if(this.lineWrapping=s,this.lineHeight=t,this.charWidth=i,this.lineLength=n,o){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>.001&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return SO.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let r=this;for(let s=n.length-1;s>=0;s--){let{fromA:o,toA:a,fromB:l,toB:c}=n[s],O=r.lineAt(o,XO.ByPosNoHeight,t,0,0),h=O.to>=a?O:r.lineAt(a,XO.ByPosNoHeight,t,0,0);for(c+=h.to-a,a=h.to;s>0&&O.from<=n[s-1].toA;)o=n[s-1].fromA,l=n[s-1].fromB,s--,o2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),i+=1+r.break,n-=r.size}else{if(!(r>2*n))break;{let t=e[i];t.break?e.splice(i,1,t.left,null,t.right):e.splice(i,1,t.left,t.right),i+=2+t.break,r-=t.size}}else if(n=r&&s(this.blockAt(0,i,n,r))}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more&&this.setHeight(e,n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class TO extends RO{constructor(e,t){super(e,t,zl.Text),this.collapsed=0,this.widgetHeight=0}replace(e,t,i){let n=i[0];return 1==i.length&&(n instanceof TO||n instanceof WO&&4&n.flags)&&Math.abs(this.length-n.length)<10?(n instanceof WO?n=new TO(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):SO.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setHeight(e,n.heights[n.index++]):(i||this.outdated)&&this.setHeight(e,Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class WO extends SO{constructor(e){super(e,0)}lines(e,t){let i=e.lineAt(t).number,n=e.lineAt(t+this.length).number;return{firstLine:i,lastLine:n,lineHeight:this.height/(n-i+1)}}blockAt(e,t,i,n){let{firstLine:r,lastLine:s,lineHeight:o}=this.lines(t,n),a=Math.max(0,Math.min(s-r,Math.floor((e-i)/o))),{from:l,length:c}=t.line(r+a);return new xO(l,c,i+o*a,o,zl.Text)}lineAt(e,t,i,n,r){if(t==XO.ByHeight)return this.blockAt(e,i,n,r);if(t==XO.ByPosNoHeight){let{from:t,to:n}=i.lineAt(e);return new xO(t,n-t,0,0,zl.Text)}let{firstLine:s,lineHeight:o}=this.lines(i,r),{from:a,length:l,number:c}=i.lineAt(e);return new xO(a,l,n+o*(c-s),o,zl.Text)}forEachLine(e,t,i,n,r,s){let{firstLine:o,lineHeight:a}=this.lines(i,r);for(let l=Math.max(e,r),c=Math.min(r+this.length,t);l<=c;){let t=i.lineAt(l);l==e&&(n+=a*(t.number-o)),s(new xO(t.from,t.length,n,a,zl.Text)),n+=a,l=t.to+1}}replace(e,t,i){let n=this.length-t;if(n>0){let e=i[i.length-1];e instanceof WO?i[i.length-1]=new WO(e.length+n):i.push(null,new WO(n-1))}if(e>0){let t=i[0];t instanceof WO?i[0]=new WO(e+t.length):i.unshift(new WO(e-1),null)}return SO.of(i)}decomposeLeft(e,t){t.push(new WO(e-1),null)}decomposeRight(e,t){t.push(null,new WO(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let r=t+this.length;if(n&&n.from<=t+this.length&&n.more){let i=[],s=Math.max(t,n.from),o=-1,a=e.heightChanged;for(n.from>t&&i.push(new WO(n.from-t-1).updateHeight(e,t));s<=r&&n.more;){let t=e.doc.lineAt(s).length;i.length&&i.push(null);let r=n.heights[n.index++];-1==o?o=r:Math.abs(r-o)>=.001&&(o=-2);let a=new TO(t,r);a.outdated=!1,i.push(a),s+=t+1}s<=r&&i.push(null,new WO(r-s).updateHeight(e,s));let l=SO.of(i);return e.heightChanged=a||o<0||Math.abs(l.height-this.height)>=.001||Math.abs(o-this.lines(e.doc,t).lineHeight)>=.001,l}return(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class AO extends SO{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return 1&this.flags}blockAt(e,t,i,n){let r=i+this.left.height;return eo))return l;let c=t==XO.ByPosNoHeight?XO.ByPosNoHeight:XO.ByPos;return a?l.join(this.right.lineAt(o,c,i,s,o)):this.left.lineAt(o,c,i,n,r).join(l)}forEachLine(e,t,i,n,r,s){let o=n+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,o,a,s);else{let l=this.lineAt(a,XO.ByPos,i,n,r);e=e&&l.from<=t&&s(l),t>l.to&&this.right.forEachLine(l.to+1,t,i,o,a,s)}}replace(e,t,i){let n=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let r=[];e>0&&this.decomposeLeft(e,r);let s=r.length;for(let e of i)r.push(e);if(e>0&&NO(r,s-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e2*t.size||t.size>2*e.size?SO.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=e.height+t.height,this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,n){let{left:r,right:s}=this,o=t+r.length+this.break,a=null;return n&&n.from<=t+r.length&&n.more?a=r=r.updateHeight(e,t,i,n):r.updateHeight(e,t,i),n&&n.from<=o+s.length&&n.more?a=s=s.updateHeight(e,o,i,n):s.updateHeight(e,o,i),a?this.balanced(r,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function NO(e,t){let i,n;null==e[t]&&(i=e[t-1])instanceof WO&&(n=e[t+1])instanceof WO&&e.splice(t-1,3,new WO(i.length+1+n.length))}class CO{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let e=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof TO?i.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new TO(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=5)&&this.addLineDeco(n,r)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new TO(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new WO(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof TO)return e;let t=new TO(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine(),e.type!=zl.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,e.type!=zl.WidgetBefore&&(this.covering=e)}addLineDeco(e,t){let i=this.ensureLine();i.length+=t,i.collapsed+=t,i.widgetHeight=Math.max(i.widgetHeight,e),this.writtenTo=this.pos=this.pos+t}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof TO||this.isCovered?(this.writtenToe.clientHeight||e.scrollWidth>e.clientWidth)&&"visible"!=i.overflow){let t=e.getBoundingClientRect();n=Math.max(n,t.left),r=Math.min(r,t.right),s=Math.max(s,t.top),o=Math.min(o,t.bottom)}t="absolute"==i.position||"fixed"==i.position?e.offsetParent:e.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:n-i.left,right:Math.max(n,r)-i.left,top:s-(i.top+t),bottom:Math.max(s,o)-(i.top+t)}}function VO(e,t){let i=e.getBoundingClientRect();return{left:0,right:i.right-i.left,top:t,bottom:i.bottom-(i.top+t)}}class zO{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i"function"!=typeof e)),this.heightMap=SO.empty().applyChanges(this.stateDeco,un.empty,this.heightOracle.setDoc(e.doc),[new $c(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Il.set(this.lineGaps.map((e=>e.draw(!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let n=i?t.head:t.anchor;if(!e.some((({from:e,to:t})=>n>=e&&n<=t))){let{from:t,to:i}=this.lineBlockAt(n);e.push(new ZO(t,i))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?LO:new BO(this.heightOracle.doc,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,(e=>{this.viewportLines.push(1==this.scaler.scale?e:FO(e,this.scaler))}))}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(fc).filter((e=>"function"!=typeof e));let n=e.changedRanges,r=$c.extendWithRanges(n,function(e,t,i){let n=new EO;return Zr.compare(e,t,i,n,0),n.changes}(i,this.stateDeco,e?e.changes:En.empty(this.state.doc.length))),s=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=s&&(e.flags|=2);let o=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heado.to)||!this.viewportIsAppropriate(o))&&(o=this.getViewport(0,t));let a=!e.changes.empty||2&e.flags||o.from!=this.viewport.from||o.to!=this.viewport.to;this.viewport=o,this.updateForViewport(),a&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection="rtl"==i.direction?Qc.RTL:Qc.LTR;let s=this.heightOracle.mustRefreshForWrapping(r),o=s||this.mustMeasureContent||this.contentDOMHeight!=t.clientHeight,a=0,l=0;if(this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(o=!0),this.editorWidth=e.scrollDOM.clientWidth,a|=8),o){this.mustMeasureContent=!1,this.contentDOMHeight=t.clientHeight;let e=parseInt(i.paddingTop)||0,n=parseInt(i.paddingBottom)||0;this.paddingTop==e&&this.paddingBottom==n||(a|=8,this.paddingTop=e,this.paddingBottom=n)}let c=(this.printing?VO:qO)(t,this.paddingTop),O=c.top-this.pixelViewport.top,h=c.bottom-this.pixelViewport.bottom;this.pixelViewport=c;let u=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(u!=this.inView&&(this.inView=u,u&&(o=!0)),!this.inView)return 0;let d=t.clientWidth;if(this.contentDOMWidth==d&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=d,this.editorHeight=e.scrollDOM.clientHeight,a|=8),o){let t=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(t)&&(s=!0),s||n.lineWrapping&&Math.abs(d-this.contentDOMWidth)>n.charWidth){let{lineHeight:i,charWidth:o}=e.docView.measureTextSize();s=n.refresh(r,i,o,d/o,t),s&&(e.docView.minWidth=0,a|=8)}O>0&&h>0?l=Math.max(O,h):O<0&&h<0&&(l=Math.min(O,h)),n.heightChanged=!1;for(let i of this.viewports){let r=i.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(i);this.heightMap=this.heightMap.updateHeight(n,0,s,new vO(i.from,r))}n.heightChanged&&(a|=2)}let f=!this.viewportIsAppropriate(this.viewport,l)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return f&&(this.viewport=this.getViewport(l,this.scrollTarget)),this.updateForViewport(),(2&a||f)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(s?[]:this.lineGaps)),a|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),a}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),n=this.heightMap,r=this.state.doc,{visibleTop:s,visibleBottom:o}=this,a=new ZO(n.lineAt(s-1e3*i,XO.ByHeight,r,0,0).from,n.lineAt(o+1e3*(1-i),XO.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let i,s=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),o=n.lineAt(e,XO.ByPos,r,0,0);i="center"==t.y?(o.top+o.bottom)/2-s/2:"start"==t.y||"nearest"==t.y&&e=o+Math.max(10,Math.min(i,250)))&&n>s-2e3&&ri.from&&o.push({from:i.from,to:n}),r=i.from&&a.from<=i.to&&jO(o,a.from-10,a.from+10),!a.empty&&a.to>=i.from&&a.to<=i.to&&jO(o,a.to-10,a.to+10);for(let{from:n,to:r}of o)r-n>1e3&&t.push(GO(e,(e=>e.from>=i.from&&e.to<=i.to&&Math.abs(e.from-n)<1e3&&Math.abs(e.to-r)<1e3))||new zO(n,r,this.gapSize(i,n,r,s)))}return t}gapSize(e,t,i,n){let r=DO(n,i)-DO(n,t);return this.heightOracle.lineWrapping?e.height*r:n.total*this.heightOracle.charWidth*r}updateLineGaps(e){zO.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Il.set(e.map((e=>e.draw(this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];Zr.spans(e,this.viewport.from,this.viewport.to,{span(e,i){t.push({from:e,to:i})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,i)=>e.from!=t[i].from||e.to!=t[i].to));return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||FO(this.heightMap.lineAt(e,XO.ByPos,this.state.doc,0,0),this.scaler)}lineBlockAtHeight(e){return FO(this.heightMap.lineAt(this.scaler.fromDOM(e),XO.ByHeight,this.state.doc,0,0),this.scaler)}elementAtHeight(e){return FO(this.heightMap.blockAt(this.scaler.fromDOM(e),this.state.doc,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ZO{constructor(e,t){this.from=e,this.to=t}}function UO(e,t,i){let n=[],r=e,s=0;return Zr.spans(i,e,t,{span(){},point(e,t){e>r&&(n.push({from:r,to:e}),s+=e-r),r=t}},20),r=1)return t[t.length-1].to;let n=Math.floor(e*i);for(let e=0;;e++){let{from:i,to:r}=t[e],s=r-i;if(n<=s)return i+n;n-=s}}function DO(e,t){let i=0;for(let{from:n,to:r}of e.ranges){if(t<=r){i+=t-n;break}i+=r-n}return i/e.total}function jO(e,t,i){for(let n=0;nt){let s=[];r.fromi&&s.push({from:i,to:r.to}),e.splice(n,1,...s),n+=s.length-1}}}function GO(e,t){for(let i of e)if(t(i))return i}const LO={toDOM:e=>e,fromDOM:e=>e,scale:1};class BO{constructor(e,t,i){let n=0,r=0,s=0;this.viewports=i.map((({from:i,to:r})=>{let s=t.lineAt(i,XO.ByPos,e,0,0).top,o=t.lineAt(r,XO.ByPos,e,0,0).bottom;return n+=o-s,{from:i,to:r,top:s,bottom:o,domTop:0,domBottom:0}})),this.scale=(7e6-n)/(t.height-n);for(let e of this.viewports)e.domTop=s+(e.top-r)*this.scale,s=e.domBottom=e.domTop+(e.bottom-e.top),r=e.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let r=tFO(e,t))):e.type)}const KO=Ln.define({combine:e=>e.join(" ")}),HO=Ln.define({combine:e=>e.indexOf(!0)>-1}),JO=Xa.newName(),eh=Xa.newName(),th=Xa.newName(),ih={"&light":"."+eh,"&dark":"."+th};function nh(e,t,i){return new Xa(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]})):e+" "+t})}const rh=nh("."+JO,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},ih),sh={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},oh=wl.ie&&wl.ie_version<=11;class ah{constructor(e,t,i){this.view=e,this.onChange=t,this.onScrollChanged=i,this.active=!1,this.selectionRange=new Ha,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.scrollTargets=[],this.intersection=null,this.resize=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver((t=>{for(let e of t)this.queue.push(e);(wl.ie&&wl.ie_version<=11||wl.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),oh&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),window.addEventListener("resize",this.onResize=this.onResize.bind(this)),"function"==typeof ResizeObserver&&(this.resize=new ResizeObserver((()=>{this.view.docView.lastUpdate{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))}),{}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver((e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))}),{})),this.listenForScroll(),this.readSelectionRange(),this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}onScroll(e){this.intersecting&&this.flush(!1),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1,this.view.requestMeasure()}),50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout((()=>{this.view.viewState.printing=!1,this.view.requestMeasure()}),500)}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some(((t,i)=>t!=e[i])))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:t}=this,i=this.selectionRange;if(t.state.facet(ac)?t.root.activeElement!=this.dom:!Ua(t.dom,i))return;let n=i.anchorNode&&t.docView.nearest(i.anchorNode);n&&n.ignoreEvent(e)||((wl.ie&&wl.ie_version<=11||wl.android&&wl.chrome)&&!t.state.selection.main.empty&&i.focusNode&&Da(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1))}readSelectionRange(){let{root:e}=this.view,t=Ya(e),i=wl.safari&&11==e.nodeType&&function(){let e=document.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}()==this.view.contentDOM&&function(e){let t=null;function i(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",i,!0),document.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",i,!0),!t)return null;let n=t.startContainer,r=t.startOffset,s=t.endContainer,o=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return Da(a.node,a.offset,s,o)&&([n,r,s,o]=[s,o,n,r]),{anchorNode:n,anchorOffset:r,focusNode:s,focusOffset:o}}(this.view)||t;return!this.selectionRange.eq(i)&&(this.selectionRange.setRange(i),this.selectionChanged=!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(1==i.nodeType)!t&&e{let e=this.delayedAndroidKey;this.delayedAndroidKey=null;let t=this.view.state;this.readSelectionRange(),nl(this.view.contentDOM,e.key,e.keyCode)?this.processRecords():this.flush(),this.view.state==t&&this.view.update([])})),this.delayedAndroidKey&&"Enter"!=e||(this.delayedAndroidKey={key:e,keyCode:t})}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=window.setTimeout((()=>{this.delayedFlush=-1,this.flush()}),20))}forceFlush(){this.delayedFlush>=0&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}processRecords(){let e=this.queue;for(let t of this.observer.takeRecords())e.push(t);e.length&&(this.queue=[]);let t=-1,i=-1,n=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(n=!0),-1==t?({from:t,to:i}=e):(t=Math.min(e.from,t),i=Math.max(e.to,i)))}return{from:t,to:i,typeOver:n}}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return;e&&this.readSelectionRange();let{from:t,to:i,typeOver:n}=this.processRecords(),r=this.selectionChanged&&Ua(this.dom,this.selectionRange);if(t<0&&!r)return;this.selectionChanged=!1;let s=this.view.state;this.onChange(t,i,n),this.view.state==s&&this.view.update([])}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.dirty|=4),"childList"==e.type){let i=lh(t,e.previousSibling||e.target.previousSibling,-1),n=lh(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}destroy(){var e,t,i;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(i=this.resize)||void 0===i||i.disconnect();for(let e of this.scrollTargets)e.removeEventListener("scroll",this.onScroll);window.removeEventListener("scroll",this.onScroll),window.removeEventListener("resize",this.onResize),window.removeEventListener("beforeprint",this.onPrint),this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout)}}function lh(e,t,i){for(;t;){let n=al.get(t);if(n&&n.parent==e)return n;let r=t.parentNode;t=r!=e.dom?r:i>0?t.nextSibling:t.previousSibling}return null}function ch(e,t,i,n){let r,s,o=e.state.selection.main;if(t>-1){let n=e.docView.domBoundsAround(t,i,0);if(!n||e.state.readOnly)return;let{from:a,to:l}=n,c=e.docView.impreciseHead||e.docView.impreciseAnchor?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:s}=e.observer.selectionRange;return i&&(t.push(new qc(i,n)),r==i&&s==n||t.push(new qc(r,s))),t}(e),O=new Cc(c,e.state);O.readRange(n.startDOM,n.endDOM);let h=o.from,u=null;(8===e.inputState.lastKeyCode&&e.inputState.lastKeyTime>Date.now()-100||wl.android&&O.text.length0&&a>0&&e.charCodeAt(o-1)==t.charCodeAt(a-1);)o--,a--;"end"==n&&(i-=o+Math.max(0,s-Math.min(o,a))-s);o=o?s-i:0,a=s+(a-o),o=s):a=a?s-i:0,o=s+(o-a),a=s);return{from:s,toA:o,toB:a}}(e.state.doc.sliceString(a,l,"￿"),O.text,h-a,u);d&&(wl.chrome&&13==e.inputState.lastKeyCode&&d.toB==d.from+2&&"￿￿"==O.text.slice(d.from,d.toB)&&d.toB--,r={from:a+d.from,to:a+d.toA,insert:un.of(O.text.slice(d.from,d.toB).split("￿"))}),s=function(e,t){if(0==e.length)return null;let i=e[0].pos,n=2==e.length?e[1].pos:i;return i>-1&&n>-1?Mn.single(i+t,n+t):null}(c,a)}else if(e.hasFocus||!e.state.facet(ac)){let t=e.observer.selectionRange,{impreciseHead:i,impreciseAnchor:n}=e.docView,r=i&&i.node==t.focusNode&&i.offset==t.focusOffset||!Za(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),a=n&&n.node==t.anchorNode&&n.offset==t.anchorOffset||!Za(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset);r==o.head&&a==o.anchor||(s=Mn.single(a,r))}if(r||s)if(!r&&n&&!o.empty&&s&&s.main.empty?r={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:r&&r.from>=o.from&&r.to<=o.to&&(r.from!=o.from||r.to!=o.to)&&o.to-o.from-(r.to-r.from)<=4?r={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,r.from).append(r.insert).append(e.state.doc.slice(r.to,o.to))}:wl.mac&&r&&r.from==r.to&&r.from==o.head-1&&"."==r.insert.toString()&&(r={from:o.from,to:o.to,insert:un.of([" "])}),r){let t=e.state;if(wl.ios&&e.inputState.flushIOSKey(e))return;if(wl.android&&(r.from==o.from&&r.to==o.to&&1==r.insert.length&&2==r.insert.lines&&nl(e.contentDOM,"Enter",13)||r.from==o.from-1&&r.to==o.to&&0==r.insert.length&&nl(e.contentDOM,"Backspace",8)||r.from==o.from&&r.to==o.to+1&&0==r.insert.length&&nl(e.contentDOM,"Delete",46)))return;let i,n=r.insert.toString();if(e.state.facet(ic).some((t=>t(e,r.from,r.to,n))))return;if(e.inputState.composing>=0&&e.inputState.composing++,r.from>=o.from&&r.to<=o.to&&r.to-r.from>=(o.to-o.from)/3&&(!s||s.main.empty&&s.main.from==r.from+r.insert.length)&&e.inputState.composing<0){let n=o.fromr.to?t.sliceDoc(r.to,o.to):"";i=t.replaceSelection(e.state.toText(n+r.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let n=t.changes(r),a=s&&!t.selection.main.eq(s.main)&&s.main.to<=n.newLength?s.main:void 0;if(t.selection.ranges.length>1&&e.inputState.composing>=0&&r.to<=o.to&&r.to>=o.to-10){let s=e.state.sliceDoc(r.from,r.to),l=Ic(e)||e.state.doc.lineAt(o.head),c=o.to-r.to,O=o.to-o.from;i=t.changeByRange((i=>{if(i.from==o.from&&i.to==o.to)return{changes:n,range:a||i.map(n)};let h=i.to-c,u=h-s.length;if(i.to-i.from!=O||e.state.sliceDoc(u,h)!=s||l&&i.to>=l.from&&i.from<=l.to)return{range:i};let d=t.changes({from:u,to:h,insert:r.insert}),f=i.to-o.to;return{changes:d,range:a?Mn.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):i.map(d)}}))}else i={changes:n,selection:a&&t.selection.replaceRange(a)}}let a="input.type";e.composing&&(a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),e.dispatch(i,{scrollIntoView:!0,userEvent:a})}else if(s&&!s.main.eq(o)){let t=!1,i="select";e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),i=e.inputState.lastSelectionOrigin),e.dispatch({selection:s,scrollIntoView:t,userEvent:i})}}class Oh{constructor(e={}){this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=e.dispatch||(e=>this.update([e])),this.dispatch=this.dispatch.bind(this),this.root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new YO(e.state||Er.create()),this.plugins=this.state.facet(cc).map((e=>new hc(e)));for(let e of this.plugins)e.update(this);this.observer=new ah(this,((e,t,i)=>{ch(this,e,t,i)}),(e=>{this.inputState.runScrollHandlers(this,e),this.observer.intersecting&&this.measure()})),this.inputState=new tO(this),this.inputState.ensureHandlers(this,this.plugins),this.docView=new Vc(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return this.inputState.composing>0}get compositionStarted(){return this.inputState.composing>=0}dispatch(...e){this._dispatch(1==e.length&&e[0]instanceof _r?e[0]:this.state.update(...e))}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,i=!1,n=this.state;for(let t of e){if(t.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=t.state}if(this.destroyed)return void(this.viewState.state=n);if(n.facet(Er.phrases)!=this.state.facet(Er.phrases))return this.setState(n);t=bc.create(this,n,e);let r=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(r&&(r=r.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;r=new rc(e.empty?e:Mn.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(sc)&&(r=e.value)}this.viewState.update(t,r),this.bidiCache=dh.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),i=this.docView.update(t),this.state.facet(gc)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(KO)!=t.state.facet(KO)&&(this.viewState.mustMeasureContent=!0),(i||r||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let e of this.state.facet(tc))e(t)}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new YO(e),this.plugins=e.facet(cc).map((e=>new hc(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView=new Vc(this),this.inputState.ensureHandlers(this,this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(cc),i=e.state.facet(cc);if(t!=i){let n=[];for(let r of i){let i=t.indexOf(r);if(i<0)n.push(new hc(r));else{let t=this.plugins[i];t.mustUpdate=e,n.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=n,this.pluginMap.clear(),this.inputState.ensureHandlers(this,this.plugins)}else for(let t of this.plugins)t.mustUpdate=e;for(let e=0;e-1&&cancelAnimationFrame(this.measureScheduled),this.measureScheduled=0,e&&this.observer.flush();let t=null;try{for(let e=0;;e++){this.updateState=1;let i=this.viewport,n=this.viewState.measure(this);if(!n&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let r=[];4&n||([this.measureRequests,r]=[r,this.measureRequests]);let s=r.map((e=>{try{return e.read(this)}catch(e){return oc(this.state,e),uh}})),o=bc.create(this,this.state,[]),a=!1,l=!1;o.flags|=n,t?t.flags|=n:t=o,this.updateState=2,o.empty||(this.updatePlugins(o),this.inputState.update(o),this.updateAttrs(),a=this.docView.update(o));for(let e=0;e{ql(this.contentDOM,this.contentAttrs,t),ql(this.dom,this.editorAttrs,e)})),this.editorAttrs=e,this.contentAttrs=t}showAnnouncements(e){let t=!0;for(let i of e)for(let e of i.effects)e.is(Oh.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(gc),Xa.mount(this.root,this.styleModules.concat(rh).reverse())}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=requestAnimationFrame((()=>this.measure()))),e){if(null!=e.key)for(let t=0;tt.spec==e))||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return eO(this,e,Jc(this,e,t,i))}moveByGroup(e,t){return eO(this,e,Jc(this,e,t,(t=>function(e,t,i){let n=e.state.charCategorizer(t),r=n(i);return e=>{let t=n(e);return r==Wr.Space&&(r=t),r==t}}(this,e.head,t))))}moveToLineBoundary(e,t,i=!0){return function(e,t,i,n){let r=e.state.doc.lineAt(t.head),s=n&&e.lineWrapping?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(s){let t=e.dom.getBoundingClientRect(),n=e.textDirectionAt(r.from),o=e.posAtCoords({x:i==(n==Qc.LTR)?t.right-1:t.left+1,y:(s.top+s.bottom)/2});if(null!=o)return Mn.cursor(o,i?-1:1)}let o=jl.find(e.docView,t.head),a=o?i?o.posAtEnd:o.posAtStart:i?r.to:r.from;return Mn.cursor(a,i?-1:1)}(this,e,t,i)}moveVertically(e,t,i){return eO(this,e,function(e,t,i,n){let r=t.head,s=i?1:-1;if(r==(i?e.state.doc.length:0))return Mn.cursor(r,t.assoc);let o,a=t.goalColumn,l=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r),O=e.documentTop;if(c)null==a&&(a=c.left-l.left),o=s<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(l.right-l.left,e.defaultCharacterWidth*(r-t.from))),o=(s<0?t.top:t.bottom)+O}let h=l.left+a,u=null!=n?n:e.defaultLineHeight>>1;for(let i=0;;i+=10){let n=o+(u+i)*s,c=Kc(e,{x:h,y:n},!1,s);if(nl.bottom||(s<0?cr))return Mn.cursor(c,t.assoc,void 0,a)}}(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Kc(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(e),r=this.bidiSpans(n);return Fa(i,r[Rc.find(r,e-n.from,-1,t)].dir==Qc.LTR==t>0)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(nc)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>hh)return Wc(e.length);let t=this.textDirectionAt(e.from);for(let i of this.bidiCache)if(i.from==e.from&&i.dir==t)return i.order;let i=function(e,t){let i=e.length,n=t==yc?1:2,r=t==yc?2:1;if(!e||1==n&&!Sc.test(e))return Wc(i);for(let t=0,r=n,s=n;t=0;e-=3)if(xc[e+1]==-s){let t=xc[e+2],i=2&t?n:4&t?1&t?r:n:0;i&&(Tc[a]=Tc[xc[e]]=i),l=e;break}}else{if(189==xc.length)break;xc[l++]=a,xc[l++]=t,xc[l++]=c}else if(2==(o=Tc[a])||1==o){let e=o==n;c=e?0:1;for(let t=l-3;t>=0;t-=3){let i=xc[t+2];if(2&i)break;if(e)xc[t+2]|=2;else{if(4&i)break;xc[t+2]|=4}}}for(let e=0;et;){let e=i,n=2!=Tc[--i];for(;i>t&&n==(2!=Tc[i-1]);)i--;s.push(new Rc(i,e,n?2:1))}else s.push(new Rc(t,e,0))}else for(let e=0;eDate.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{tl(this.contentDOM),this.docView.updateSelection()}))}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return sc.of(new rc("number"==typeof e?Mn.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}static domEventHandlers(e){return Oc.define((()=>({})),{eventHandlers:e})}static theme(e,t){let i=Xa.newName(),n=[KO.of(i),gc.of(nh(`.${i}`,e))];return t&&t.dark&&n.push(HO.of(!0)),n}static baseTheme(e){return ar.lowest(gc.of(nh("."+JO,e,ih)))}}Oh.styleModule=gc,Oh.inputHandler=ic,Oh.perLineTextDirection=nc,Oh.exceptionSink=ec,Oh.updateListener=tc,Oh.editable=ac,Oh.mouseSelectionStyle=Jl,Oh.dragMovesSelection=Hl,Oh.clickAddsSelectionRange=Kl,Oh.decorations=fc,Oh.atomicRanges=pc,Oh.scrollMargins=mc,Oh.darkTheme=HO,Oh.contentAttributes=dc,Oh.editorAttributes=uc,Oh.lineWrapping=Oh.contentAttributes.of({class:"cm-lineWrapping"}),Oh.announce=kr.define();const hh=4096,uh={};class dh{constructor(e,t,i,n){this.from=e,this.to=t,this.dir=i,this.order=n}static update(e,t){if(t.empty)return e;let i=[],n=e.length?e[e.length-1].dir:Qc.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=n[r],s="function"==typeof t?t(e):t;s&&Cl(s,i)}return i}const ph=wl.mac?"mac":wl.windows?"win":wl.linux?"linux":"key";function mh(e,t,i){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==i&&t.shiftKey&&(e="Shift-"+e),e}const gh=Oh.domEventHandlers({keydown:(e,t)=>Ph(Qh(t.state),e,t,"editor")}),$h=Ln.define({enables:gh}),bh=new WeakMap;function Qh(e){let t=e.facet($h),i=bh.get(t);return i||bh.set(t,i=function(e,t=ph){let i=Object.create(null),n=Object.create(null),r=(e,t)=>{let i=n[e];if(null==i)n[e]=t;else if(i!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},s=(e,n,s,o)=>{let a=i[e]||(i[e]=Object.create(null)),l=n.split(/ (?!$)/).map((e=>function(e,t){const i=e.split(/-(?!$)/);let n,r,s,o,a=i[i.length-1];"Space"==a&&(a=" ");for(let e=0;e{let n=yh={view:t,prefix:i,scope:e};return setTimeout((()=>{yh==n&&(yh=null)}),4e3),!0}]})}let c=l.join(" ");r(c,!1);let O=a[c]||(a[c]={preventDefault:!1,commands:[]});O.commands.push(s),o&&(O.preventDefault=!0)};for(let i of e){let e=i[t]||i.key;if(e)for(let t of i.scope?i.scope.split(" "):["editor"])s(t,e,i.run,i.preventDefault),i.shift&&s(t,"Shift-"+e,i.shift,i.preventDefault)}return i}(t.reduce(((e,t)=>e.concat(t)),[]))),i}let yh=null;function Ph(e,t,i,n){let r=function(e){var t=!(Va&&(e.ctrlKey||e.altKey||e.metaKey)||(Na||qa)&&e.shiftKey&&e.key&&1==e.key.length)&&e.key||(e.shiftKey?Wa:Ta)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),s=1==r.length&&" "!=r,o="",a=!1;yh&&yh.view==i&&yh.scope==n&&(o=yh.prefix+" ",(a=nO.indexOf(t.keyCode)<0)&&(yh=null));let l,c=e=>{if(e){for(let t of e.commands)if(t(i))return!0;e.preventDefault&&(a=!0)}return!1},O=e[n];if(O){if(c(O[o+mh(r,t,!s)]))return!0;if(s&&(t.shiftKey||t.altKey||t.metaKey)&&(l=Ta[t.keyCode])&&l!=r){if(c(O[o+mh(l,t,!0)]))return!0}else if(s&&t.shiftKey&&c(O[o+mh(r,t,!0)]))return!0}return a}const wh=!wl.ios,kh=Ln.define({combine:e=>qr(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function _h(e={}){return[kh.of(e),xh,Sh]}class vh{constructor(e,t,i,n,r){this.left=e,this.top=t,this.width=i,this.height=n,this.className=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width>=0&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}}const xh=Oc.fromClass(class{constructor(e){this.view=e,this.rangePieces=[],this.cursors=[],this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)},this.selectionLayer=e.scrollDOM.appendChild(document.createElement("div")),this.selectionLayer.className="cm-selectionLayer",this.selectionLayer.setAttribute("aria-hidden","true"),this.cursorLayer=e.scrollDOM.appendChild(document.createElement("div")),this.cursorLayer.className="cm-cursorLayer",this.cursorLayer.setAttribute("aria-hidden","true"),e.requestMeasure(this.measureReq),this.setBlinkRate()}setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(kh).cursorBlinkRate+"ms"}update(e){let t=e.startState.facet(kh)!=e.state.facet(kh);(t||e.selectionSet||e.geometryChanged||e.viewportChanged)&&this.view.requestMeasure(this.measureReq),e.transactions.some((e=>e.scrollIntoView))&&(this.cursorLayer.style.animationName="cm-blink"==this.cursorLayer.style.animationName?"cm-blink2":"cm-blink"),t&&this.setBlinkRate()}readPos(){let{state:e}=this.view,t=e.facet(kh),i=e.selection.ranges.map((e=>e.empty?[]:function(e,t){if(t.to<=e.viewport.from||t.from>=e.viewport.to)return[];let i=Math.max(t.from,e.viewport.from),n=Math.min(t.to,e.viewport.to),r=e.textDirection==Qc.LTR,s=e.contentDOM,o=s.getBoundingClientRect(),a=Rh(e),l=window.getComputedStyle(s.firstChild),c=o.left+parseInt(l.paddingLeft)+Math.min(0,parseInt(l.textIndent)),O=o.right-parseInt(l.paddingRight),h=Wh(e,i),u=Wh(e,n),d=h.type==zl.Text?h:null,f=u.type==zl.Text?u:null;if(e.lineWrapping&&(d&&(d=Th(e,i,d)),f&&(f=Th(e,n,f))),d&&f&&d.from==f.from)return m(g(t.from,t.to,d));{let i=d?g(t.from,null,d):$(h,!1),n=f?g(null,t.to,f):$(u,!0),r=[];return(d||h).to<(f||u).from-1?r.push(p(c,i.bottom,O,n.top)):i.bottomh&&n.from=s)break;a>r&&l(Math.max(e,r),null==t&&e<=h,Math.min(a,s),null==i&&a>=u,o.dir)}if(r=n.to+1,r>=s)break}return 0==a.length&&l(h,null==t,u,null==i,e.textDirection),{top:s,bottom:o,horizontal:a}}function $(e,t){let i=o.top+(t?e.top:e.bottom);return{top:i,bottom:i,horizontal:[]}}}(this.view,e))).reduce(((e,t)=>e.concat(t))),n=[];for(let i of e.selection.ranges){let r=i==e.selection.main;if(i.empty?!r||wh:t.drawRangeCursor){let e=Ah(this.view,i,r);e&&n.push(e)}}return{rangePieces:i,cursors:n}}drawSel({rangePieces:e,cursors:t}){if(e.length!=this.rangePieces.length||e.some(((e,t)=>!e.eq(this.rangePieces[t])))){this.selectionLayer.textContent="";for(let t of e)this.selectionLayer.appendChild(t.draw());this.rangePieces=e}if(t.length!=this.cursors.length||t.some(((e,t)=>!e.eq(this.cursors[t])))){let e=this.cursorLayer.children;if(e.length!==t.length){this.cursorLayer.textContent="";for(const e of t)this.cursorLayer.appendChild(e.draw())}else t.forEach(((t,i)=>t.adjust(e[i])));this.cursors=t}}destroy(){this.selectionLayer.remove(),this.cursorLayer.remove()}}),Xh={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};wh&&(Xh[".cm-line"].caretColor="transparent !important");const Sh=ar.highest(Oh.theme(Xh));function Rh(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==Qc.LTR?t.left:t.right-e.scrollDOM.clientWidth)-e.scrollDOM.scrollLeft,top:t.top-e.scrollDOM.scrollTop}}function Th(e,t,i){let n=Mn.cursor(t);return{from:Math.max(i.from,e.moveToLineBoundary(n,!1,!0).from),to:Math.min(i.to,e.moveToLineBoundary(n,!0,!0).from),type:zl.Text}}function Wh(e,t){let i=e.lineBlockAt(t);if(Array.isArray(i.type))for(let e of i.type)if(e.to>t||e.to==t&&(e.to==i.to||e.type==zl.Text))return e;return i}function Ah(e,t,i){let n=e.coordsAtPos(t.head,t.assoc||1);if(!n)return null;let r=Rh(e);return new vh(n.left-r.left,n.top-r.top,-1,n.bottom-n.top,i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary")}function Nh(e,t,i,n,r){t.lastIndex=0;for(let s,o=e.iterRange(i,n),a=i;!o.next().done;a+=o.value.length)if(!o.lineBreak)for(;s=t.exec(o.value);)r(a+s.index,a+s.index+s[0].length,s)}class Ch{constructor(e){let{regexp:t,decoration:i,boundary:n,maxLength:r=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");this.regexp=t,this.getDeco="function"==typeof i?i:()=>i,this.boundary=n,this.maxLength=r}createDeco(e){let t=new Ur;for(let{from:i,to:n}of function(e,t){let i=e.visibleRanges;if(1==i.length&&i[0].from==e.viewport.from&&i[0].to==e.viewport.to)return i;let n=[];for(let{from:r,to:s}of i)r=Math.max(e.state.doc.lineAt(r).from,r-t),s=Math.min(e.state.doc.lineAt(s).to,s+t),n.length&&n[n.length-1].to>=r?n[n.length-1].to=s:n.push({from:r,to:s});return n}(e,this.maxLength))Nh(e.state.doc,this.regexp,i,n,((i,n,r)=>t.add(i,n,this.getDeco(r,e,i))));return t.finish()}updateDeco(e,t){let i=1e9,n=-1;return e.docChanged&&e.changes.iterChanges(((t,r,s,o)=>{o>e.view.viewport.from&&s1e3?this.createDeco(e.view):n>-1?this.updateRange(e.view,t.map(e.changes),i,n):t}updateRange(e,t,i,n){for(let r of e.visibleRanges){let s=Math.max(r.from,i),o=Math.min(r.to,n);if(o>s){let i=e.state.doc.lineAt(s),n=i.toi.from;s--)if(this.boundary.test(i.text[s-1-i.from])){a=s;break}for(;oO.push(this.getDeco(n,e,t).range(t,i))));t=t.update({filterFrom:a,filterTo:l,filter:(e,t)=>el,add:O})}}return t}}const Eh=null!=/x/.unicode?"gu":"g",qh=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮\ufeff-]",Eh),Vh={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let zh=null;const Ih=Ln.define({combine(e){let t=qr(e,{render:null,specialChars:qh,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==zh&&"undefined"!=typeof document&&document.body){let t=document.body.style;zh=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return zh||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,Eh)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,Eh)),t}});function Yh(e={}){return[Ih.of(e),Zh||(Zh=Oc.fromClass(class{constructor(e){this.view=e,this.decorations=Il.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Ih)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new Ch({regexp:e.specialChars,decoration:(t,i,n)=>{let{doc:r}=i.state,s=Sn(t[0],0);if(9==s){let e=r.lineAt(n),t=i.state.tabSize,s=es(e.text,t,n-e.from);return Il.replace({widget:new Mh((t-s%t)*this.view.defaultCharacterWidth)})}return this.decorationCache[s]||(this.decorationCache[s]=Il.replace({widget:new Uh(e,s)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Ih);e.startState.facet(Ih)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let Zh=null;class Uh extends Vl{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=function(e){return e>=32?"•":10==e?"␤":String.fromCharCode(9216+e)}(this.code),i=e.state.phrase("Control character")+" "+(Vh[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,t);if(n)return n;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class Mh extends Vl{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class Dh extends Vl{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}ignoreEvent(){return!1}}function jh(e){return Oc.fromClass(class{constructor(t){this.view=t,this.placeholder=Il.set([Il.widget({widget:new Dh(e),side:1}).range(0)])}get decorations(){return this.view.state.doc.length?Il.none:this.placeholder}},{decorations:e=>e.decorations})}function Gh(e,t){let i=e.posAtCoords({x:t.clientX,y:t.clientY},!1),n=e.state.doc.lineAt(i),r=i-n.from,s=r>2e3?-1:r==n.length?function(e,t){let i=e.coordsAtPos(e.viewport.from);return i?Math.round(Math.abs((i.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):es(n.text,e.state.tabSize,i-n.from);return{line:n.number,col:s,off:r}}function Lh(e,t){let i=Gh(e,t),n=e.state.selection;return i?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(i.line).from),r=e.state.doc.lineAt(t);i={line:r.number,col:i.col,off:Math.min(i.off,r.length)},n=n.map(e.changes)}},get(t,r,s){let o=Gh(e,t);if(!o)return n;let a=function(e,t,i){let n=Math.min(t.line,i.line),r=Math.max(t.line,i.line),s=[];if(t.off>2e3||i.off>2e3||t.col<0||i.col<0){let o=Math.min(t.off,i.off),a=Math.max(t.off,i.off);for(let t=n;t<=r;t++){let i=e.doc.line(t);i.length<=a&&s.push(Mn.range(i.from+o,i.to+a))}}else{let o=Math.min(t.col,i.col),a=Math.max(t.col,i.col);for(let t=n;t<=r;t++){let i=e.doc.line(t),n=ts(i.text,o,e.tabSize,!0);if(n>-1){let t=ts(i.text,a,e.tabSize);s.push(Mn.range(i.from+n,i.from+t))}}}return s}(e.state,i,o);return a.length?s?Mn.create(a.concat(n.ranges)):Mn.create(a):n}}:null}function Bh(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return Oh.mouseSelectionStyle.of(((e,i)=>t(i)?Lh(e,i):null))}const Fh="-10000px";class Kh{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(i)}update(e){let t=e.state.facet(this.facet),i=t.filter((e=>e));if(t===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let n=[];for(let t=0;t{var t,i,n;return{position:wl.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(i=e.find((e=>e.parent)))||void 0===i?void 0:i.parent)||null,tooltipSpace:(null===(n=e.find((e=>e.tooltipSpace)))||void 0===n?void 0:n.tooltipSpace)||Hh}}}),eu=Oc.fromClass(class{constructor(e){var t;this.view=e,this.inView=!0,this.lastTransaction=0,this.measureTimeout=-1;let i=e.state.facet(Jh);this.position=i.position,this.parent=i.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new Kh(e,nu,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),null===(t=e.dom.ownerDocument.defaultView)||void 0===t||t.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e);t&&this.observeIntersection();let i=t||e.geometryChanged,n=e.state.facet(Jh);if(n.position!=this.position){this.position=n.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=Fh,this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;null===(e=this.view.dom.ownerDocument.defaultView)||void 0===e||e.removeEventListener("resize",this.measureSoon);for(let{dom:e}of this.manager.tooltipViews)e.remove();null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect();return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let i=this.manager.tooltipViews[t];return i.getCoords?i.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(Jh).tooltipSpace(this.view)}}writeMeasure(e){let{editor:t,space:i}=e,n=[];for(let r=0;r=Math.min(t.bottom,i.bottom)||l.rightMath.min(t.right,i.right)+.1){a.style.top=Fh;continue}let O=s.arrow?o.dom.querySelector(".cm-tooltip-arrow"):null,h=O?7:0,u=c.right-c.left,d=c.bottom-c.top,f=o.offset||iu,p=this.view.textDirection==Qc.LTR,m=c.width>i.right-i.left?p?i.left:i.right-c.width:p?Math.min(l.left-(O?14:0)+f.x,i.right-u):Math.max(i.left,l.left-u+(O?14:0)-f.x),g=!!s.above;!s.strictSide&&(g?l.top-(c.bottom-c.top)-f.yi.bottom)&&g==i.bottom-l.bottom>l.top-i.top&&(g=!g);let $=g?l.top-d-h-f.y:l.bottom+h+f.y,b=m+u;if(!0!==o.overlap)for(let e of n)e.leftm&&e.top<$+d&&e.bottom>$&&($=g?e.top-d-2-h:e.bottom+h+2);"absolute"==this.position?(a.style.top=$-e.parent.top+"px",a.style.left=m-e.parent.left+"px"):(a.style.top=$+"px",a.style.left=m+"px"),O&&(O.style.left=l.left+(p?f.x:-f.x)-(m+14-7)+"px"),!0!==o.overlap&&n.push({left:m,top:$,right:b,bottom:$+d}),a.classList.toggle("cm-tooltip-above",g),a.classList.toggle("cm-tooltip-below",!g),o.positioned&&o.positioned()}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let e of this.manager.tooltipViews)e.dom.style.top=Fh}},{eventHandlers:{scroll(){this.maybeMeasure()}}}),tu=Oh.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),iu={x:0,y:0},nu=Ln.define({enables:[eu,tu]});const ru=Ln.define({combine(e){let t,i;for(let n of e)t=t||n.topContainer,i=i||n.bottomContainer;return{topContainer:t,bottomContainer:i}}});function su(e,t){let i=e.plugin(ou),n=i?i.specs.indexOf(t):-1;return n>-1?i.panels[n]:null}const ou=Oc.fromClass(class{constructor(e){this.input=e.state.facet(cu),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(ru);this.top=new au(e,!0,t.topContainer),this.bottom=new au(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(e){let t=e.state.facet(ru);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new au(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new au(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=e.state.facet(cu);if(i!=this.input){let t=i.filter((e=>e)),n=[],r=[],s=[],o=[];for(let i of t){let t,a=this.specs.indexOf(i);a<0?(t=i(e.view),o.push(t)):(t=this.panels[a],t.update&&t.update(e)),n.push(t),(t.top?r:s).push(t)}this.specs=t,this.panels=n,this.top.sync(r),this.bottom.sync(s);for(let e of o)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let t of this.panels)t.update&&t.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>Oh.scrollMargins.of((t=>{let i=t.plugin(e);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}}))});class au{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=lu(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=lu(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(this.container&&this.classes!=this.view.themeClasses){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function lu(e){let t=e.nextSibling;return e.remove(),t}const cu=Ln.define({enables:ou});class Ou extends Vr{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}Ou.prototype.elementClass="",Ou.prototype.toDOM=void 0,Ou.prototype.mapMode=Nn.TrackBefore,Ou.prototype.startSide=Ou.prototype.endSide=-1,Ou.prototype.point=!0;const hu=Ln.define(),uu=Ln.define();const du=Ln.define({combine:e=>e.some((e=>e))});function fu(e){let t=[pu];return e&&!1===e.fixed&&t.push(du.of(!0)),t}const pu=Oc.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight+"px",this.gutters=e.state.facet(uu).map((t=>new bu(e,t)));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!e.state.facet(du),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,i=e.view.viewport,n=Math.min(t.to,i.to)-Math.max(t.from,i.from);this.syncGutters(n<.8*(i.to-i.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(du)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let i=Zr.iter(this.view.state.facet(hu),this.view.viewport.from),n=[],r=this.gutters.map((e=>new $u(e,this.view.viewport,-this.view.documentPadding.top)));for(let e of this.view.viewportLineBlocks){let t;if(Array.isArray(e.type)){for(let i of e.type)if(i.type==zl.Text){t=i;break}}else t=e.type==zl.Text?e:void 0;if(t){n.length&&(n=[]),gu(i,n,e.from);for(let e of r)e.line(this.view,t,n)}}for(let e of r)e.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(uu),i=e.state.facet(uu),n=e.docChanged||e.heightChanged||e.viewportChanged||!Zr.eq(e.startState.facet(hu),e.state.facet(hu),e.view.viewport.from,e.view.viewport.to);if(t==i)for(let t of this.gutters)t.update(e)&&(n=!0);else{n=!0;let r=[];for(let n of i){let i=t.indexOf(n);i<0?r.push(new bu(this.view,n)):(this.gutters[i].update(e),r.push(this.gutters[i]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return n}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>Oh.scrollMargins.of((t=>{let i=t.plugin(e);return i&&0!=i.gutters.length&&i.fixed?t.textDirection==Qc.LTR?{left:i.dom.offsetWidth}:{right:i.dom.offsetWidth}:null}))});function mu(e){return Array.isArray(e)?e:[e]}function gu(e,t,i){for(;e.value&&e.from<=i;)e.from==i&&t.push(e.value),e.next()}class $u{constructor(e,t,i){this.gutter=e,this.height=i,this.localMarkers=[],this.i=0,this.cursor=Zr.iter(e.markers,t.from)}line(e,t,i){this.localMarkers.length&&(this.localMarkers=[]),gu(this.cursor,this.localMarkers,t.from);let n=i.length?this.localMarkers.concat(i):this.localMarkers,r=this.gutter.config.lineMarker(e,t,n);r&&n.unshift(r);let s=this.gutter;if(0==n.length&&!s.config.renderEmptyElements)return;let o=t.top-this.height;if(this.i==s.elements.length){let i=new Qu(e,t.height,o,n);s.elements.push(i),s.dom.appendChild(i.dom)}else s.elements[this.i].update(e,t.height,o,n);this.height=t.bottom,this.i++}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class bu{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,(n=>{let r=e.lineBlockAtHeight(n.clientY-e.documentTop);t.domEventHandlers[i](e,r,n)&&n.preventDefault()}));this.markers=mu(t.markers(e)),t.initialSpacer&&(this.spacer=new Qu(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=mu(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let i=e.view.viewport;return!Zr.eq(this.markers,t,i.from,i.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class Qu{constructor(e,t,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,n)}update(e,t,i,n){this.height!=t&&(this.dom.style.height=(this.height=t)+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let i=0;iqr(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let e in t){let n=i[e],r=t[e];i[e]=n?(e,t,i)=>n(e,t,i)||r(e,t,i):r}return i}})});class wu extends Ou{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ku(e,t){return e.state.facet(Pu).formatNumber(t,e.state)}const _u=uu.compute([Pu],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(yu),lineMarker:(e,t,i)=>i.some((e=>e.toDOM))?null:new wu(ku(e,e.state.doc.lineAt(t.from).number)),lineMarkerChange:e=>e.startState.facet(Pu)!=e.state.facet(Pu),initialSpacer:e=>new wu(ku(e,xu(e.state.doc.lines))),updateSpacer(e,t){let i=ku(t.view,xu(t.view.state.doc.lines));return i==e.number?e:new wu(i)},domEventHandlers:e.facet(Pu).domEventHandlers})));function vu(e={}){return[Pu.of(e),fu(),_u]}function xu(e){let t=9;for(;tt.modified.indexOf(e)>-1?t:Tu.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let Ru=0;class Tu{constructor(){this.instances=[],this.id=Ru++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find((i=>i.base==e&&function(e,t){return e.length==t.length&&e.every(((e,i)=>e==t[i]))}(t,i.modified)));if(i)return i;let n=[],r=new Su(n,e,t);for(let e of t)e.instances.push(r);let s=Wu(t);for(let t of e.set)for(let e of s)n.push(Tu.get(t,e));return r}}function Wu(e){let t=[e];for(let i=0;i0&&t+3==e.length){r=1;break}let n=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!n)throw new RangeError("Invalid path: "+e);if(i.push("*"==n[0]?"":'"'==n[0][0]?JSON.parse(n[0]):n[0]),t+=n[0].length,t==e.length)break;let o=e[t++];if(t==e.length&&"!"==o){r=0;break}if("/"!=o)throw new RangeError("Invalid path: "+e);s=e.slice(t)}let o=i.length-1,a=i[o];if(!a)throw new RangeError("Invalid path: "+e);let l=new Cu(n,r,o>0?i.slice(0,o):null);t[a]=l.sort(t[a])}}return Nu.add(t)}const Nu=new ss;class Cu{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}sort(e){return!e||e.depth{let t=r;for(let n of e)for(let e of n.set){let n=i[e.id];if(n){t=t?t+" "+n:n;break}}return t},scope:n}}function qu(e,t){let i=null;for(let n of e){let e=n.style(t);e&&(i=i?i+" "+e:e)}return i}function Vu(e,t,i,n=0,r=e.length){let s=new zu(n,Array.isArray(t)?t:[t],i);s.highlightRange(e.cursor(),n,r,"",s.highlighters),s.flush(r)}class zu{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,n,r){let{type:s,from:o,to:a}=e;if(o>=i||a<=t)return;s.isTop&&(r=this.highlighters.filter((e=>!e.scope||e.scope(s))));let l=n,c=s.prop(Nu),O=!1;for(;c;){if(!c.context||e.matchContext(c.context)){let e=qu(r,c.tags);e&&(l&&(l+=" "),l+=e,1==c.mode?n+=(n?" ":"")+e:0==c.mode&&(O=!0));break}c=c.next}if(this.startSpan(e.from,l),O)return;let h=e.tree&&e.tree.prop(ss.mounted);if(h&&h.overlay){let s=e.node.enter(h.overlay[0].from+o,1),c=this.highlighters.filter((e=>!e.scope||e.scope(h.tree.type))),O=e.firstChild();for(let u=0,d=o;;u++){let f=u=p)&&e.nextSibling()););if(!f||p>i)break;d=f.to+o,d>t&&(this.highlightRange(s.cursor(),Math.max(t,f.from+o),Math.min(i,d),n,c),this.startSpan(d,l))}O&&e.parent()}else if(e.firstChild()){do{if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,n,r),this.startSpan(Math.min(i,e.to),l)}}while(e.nextSibling());e.parent()}}}const Iu=Su.define,Yu=Iu(),Zu=Iu(),Uu=Iu(Zu),Mu=Iu(Zu),Du=Iu(),ju=Iu(Du),Gu=Iu(Du),Lu=Iu(),Bu=Iu(Lu),Fu=Iu(),Ku=Iu(),Hu=Iu(),Ju=Iu(Hu),ed=Iu(),td={comment:Yu,lineComment:Iu(Yu),blockComment:Iu(Yu),docComment:Iu(Yu),name:Zu,variableName:Iu(Zu),typeName:Uu,tagName:Iu(Uu),propertyName:Mu,attributeName:Iu(Mu),className:Iu(Zu),labelName:Iu(Zu),namespace:Iu(Zu),macroName:Iu(Zu),literal:Du,string:ju,docString:Iu(ju),character:Iu(ju),attributeValue:Iu(ju),number:Gu,integer:Iu(Gu),float:Iu(Gu),bool:Iu(Du),regexp:Iu(Du),escape:Iu(Du),color:Iu(Du),url:Iu(Du),keyword:Fu,self:Iu(Fu),null:Iu(Fu),atom:Iu(Fu),unit:Iu(Fu),modifier:Iu(Fu),operatorKeyword:Iu(Fu),controlKeyword:Iu(Fu),definitionKeyword:Iu(Fu),moduleKeyword:Iu(Fu),operator:Ku,derefOperator:Iu(Ku),arithmeticOperator:Iu(Ku),logicOperator:Iu(Ku),bitwiseOperator:Iu(Ku),compareOperator:Iu(Ku),updateOperator:Iu(Ku),definitionOperator:Iu(Ku),typeOperator:Iu(Ku),controlOperator:Iu(Ku),punctuation:Hu,separator:Iu(Hu),bracket:Ju,angleBracket:Iu(Ju),squareBracket:Iu(Ju),paren:Iu(Ju),brace:Iu(Ju),content:Lu,heading:Bu,heading1:Iu(Bu),heading2:Iu(Bu),heading3:Iu(Bu),heading4:Iu(Bu),heading5:Iu(Bu),heading6:Iu(Bu),contentSeparator:Iu(Lu),list:Iu(Lu),quote:Iu(Lu),emphasis:Iu(Lu),strong:Iu(Lu),link:Iu(Lu),monospace:Iu(Lu),strikethrough:Iu(Lu),inserted:Iu(),deleted:Iu(),changed:Iu(),invalid:Iu(),meta:ed,documentMeta:Iu(ed),annotation:Iu(ed),processingInstruction:Iu(ed),definition:Su.defineModifier(),constant:Su.defineModifier(),function:Su.defineModifier(),standard:Su.defineModifier(),local:Su.defineModifier(),special:Su.defineModifier()};var id;Eu([{tag:td.link,class:"tok-link"},{tag:td.heading,class:"tok-heading"},{tag:td.emphasis,class:"tok-emphasis"},{tag:td.strong,class:"tok-strong"},{tag:td.keyword,class:"tok-keyword"},{tag:td.atom,class:"tok-atom"},{tag:td.bool,class:"tok-bool"},{tag:td.url,class:"tok-url"},{tag:td.labelName,class:"tok-labelName"},{tag:td.inserted,class:"tok-inserted"},{tag:td.deleted,class:"tok-deleted"},{tag:td.literal,class:"tok-literal"},{tag:td.string,class:"tok-string"},{tag:td.number,class:"tok-number"},{tag:[td.regexp,td.escape,td.special(td.string)],class:"tok-string2"},{tag:td.variableName,class:"tok-variableName"},{tag:td.local(td.variableName),class:"tok-variableName tok-local"},{tag:td.definition(td.variableName),class:"tok-variableName tok-definition"},{tag:td.special(td.variableName),class:"tok-variableName2"},{tag:td.definition(td.propertyName),class:"tok-propertyName tok-definition"},{tag:td.typeName,class:"tok-typeName"},{tag:td.namespace,class:"tok-namespace"},{tag:td.className,class:"tok-className"},{tag:td.macroName,class:"tok-macroName"},{tag:td.propertyName,class:"tok-propertyName"},{tag:td.operator,class:"tok-operator"},{tag:td.comment,class:"tok-comment"},{tag:td.meta,class:"tok-meta"},{tag:td.invalid,class:"tok-invalid"},{tag:td.punctuation,class:"tok-punctuation"}]);const nd=new ss;function rd(e){return Ln.define({combine:e?t=>t.concat(e):void 0})}class sd{constructor(e,t,i=[]){this.data=e,Er.prototype.hasOwnProperty("tree")||Object.defineProperty(Er.prototype,"tree",{get(){return ld(this)}}),this.parser=t,this.extension=[gd.of(this),Er.languageData.of(((e,t,i)=>e.facet(od(e,t,i))))].concat(i)}isActiveAt(e,t,i=-1){return od(e,t,i)==this.data}findRegions(e){let t=e.facet(gd);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(e,t)=>{if(e.prop(nd)==this.data)return void i.push({from:t,to:t+e.length});let r=e.prop(ss.mounted);if(r){if(r.tree.prop(nd)==this.data){if(r.overlay)for(let e of r.overlay)i.push({from:e.from+t,to:e.to+t});else i.push({from:t,to:t+e.length});return}if(r.overlay){let e=i.length;if(n(r.tree,r.overlay[0].from+t),i.length>e)return}}for(let i=0;ie.isTop?t:void 0))]}))}configure(e){return new ad(this.data,this.parser.configure(e))}get allowsNesting(){return this.parser.hasWrappers()}}function ld(e){let t=e.field(sd.state,!1);return t?t.tree:ds.empty}class cd{constructor(e,t=e.length){this.doc=e,this.length=t,this.cursorPos=0,this.string="",this.cursor=e.iter()}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Od=null;class hd{constructor(e,t,i=[],n,r,s,o,a){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=s,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new hd(e,t,[],ds.empty,0,i,[],null)}startParse(){return this.parser.startParse(new cd(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=ds.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var i;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext((()=>{for(;!(t=this.parse.advance()););})),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(Ss.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Od;Od=this;try{return e()}finally{Od=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ud(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:r,viewport:s,skipped:o}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,i,n,r)=>t.push({fromA:e,toA:i,fromB:n,toB:r}))),i=Ss.applyChanges(i,t),n=ds.empty,r=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){o=[];for(let t of this.skipped){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);ie.from&&(this.fragments=ud(this.fragments,i,n),this.skipped.splice(t--,1))}return!(this.skipped.length>=t||(this.reset(),0))}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Rs{createParse(t,i,n){let r=n[0].from,s=n[n.length-1].to;return{parsedPos:r,advance(){let t=Od;if(t){for(let e of n)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=s,new ds(ls.none,[],[],s-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return Od}}function ud(e,t,i){return Ss.applyChanges(e,[{fromA:t,toA:i,fromB:t,toB:i}])}class dd{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new dd(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=hd.create(e.facet(gd).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new dd(i)}}sd.state=tr.define({create:dd.init,update(e,t){for(let e of t.effects)if(e.is(sd.setState))return e.value;return t.startState.facet(gd)!=t.state.facet(gd)?dd.init(t.state):e.apply(t)}});let fd=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(fd=e=>{let t=-1,i=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(i):cancelIdleCallback(t)});const pd="undefined"!=typeof navigator&&(null===(id=navigator.scheduling)||void 0===id?void 0:id.isInputPending)?()=>navigator.scheduling.isInputPending():null,md=Oc.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(sd.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(sd.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=fd(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,a=r.context.work((()=>pd&&pd()||Date.now()>s),n+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:sd.setState.of(new dd(r.context))})),this.chunkBudget>0&&(!a||o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>oc(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),gd=Ln.define({combine:e=>e.length?e[0]:null,enables:[sd.state,md]});class $d{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class bd{constructor(e,t,i,n,r,s){this.name=e,this.alias=t,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((e=>this.support=e),(e=>{throw this.loading=null,e})))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new bd(e.name,(e.alias||[]).concat(e.name).map((e=>e.toLowerCase())),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let i=/\.([^.]+)$/.exec(t);if(i)for(let t of e)if(t.extensions.indexOf(i[1])>-1)return t;return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some((e=>e==t)))return i;if(i)for(let i of e)for(let e of i.alias){let n=t.indexOf(e);if(n>-1&&(e.length>2||!/\w/.test(t[n-1])&&!/\w/.test(t[n+e.length])))return i}return null}}const Qd=Ln.define(),yd=Ln.define({combine:e=>{if(!e.length)return" ";if(!/^(?: +|\t+)$/.test(e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return e[0]}});function Pd(e){let t=e.facet(yd);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function wd(e,t){let i="",n=e.tabSize;if(9==e.facet(yd).charCodeAt(0))for(;t>=n;)i+="\t",t-=n;for(let e=0;e=i.from&&n<=i.to?r&&n==e?{text:"",from:e}:(t<0?n-1&&(r+=s-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return es(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(n);if(e>-1)return e}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const vd=new ss;function xd(e){let t=e.type.prop(vd);if(t)return t;let i,n=e.firstChild;if(n&&(i=n.type.prop(ss.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>Ad(e,!0,1,void 0,n&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?Sd:null}function Xd(e,t,i){for(;e;e=e.parent){let n=xd(e);if(n)return n(Rd.create(i,t,e))}return null}function Sd(){return 0}class Rd extends _d{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.node=i}static create(e,t,i){return new Rd(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(Td(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?Xd(e,this.pos,this.base):0}}function Td(e,t){for(let i=t;i;i=i.parent)if(e==i)return!0;return!1}function Wd({closing:e,align:t=!0,units:i=1}){return n=>Ad(n,t,i,e)}function Ad(e,t,i,n,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,a=n&&s.slice(o,o+n.length)==n||r==e.pos+o,l=t?function(e){let t=e.node,i=t.childAfter(t.from),n=t.lastChild;if(!i)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(i.from),o=null==r||r<=s.from?s.to:Math.min(s.to,r);for(let e=i.to;;){let r=t.childAfter(e);if(!r||r==n)return null;if(!r.type.isSkipped)return r.from{let n=e&&e.test(i.textAfter);return i.baseIndent+(n?0:t*i.unit)}}const Cd=Ln.define(),Ed=new ss;function qd(e){let t=e.firstChild,i=e.lastChild;return t&&t.toi)continue;if(r&&s.from=t&&n.to>i&&(r=n)}}return r}(e,t,i)}function Id(e,t){let i=t.mapPos(e.from,1),n=t.mapPos(e.to,-1);return i>=n?void 0:{from:i,to:n}}const Yd=kr.define({map:Id}),Zd=kr.define({map:Id});function Ud(e){let t=[];for(let{head:i}of e.state.selection.ranges)t.some((e=>e.from<=i&&e.to>=i))||t.push(e.lineBlockAt(i));return t}const Md=tr.define({create:()=>Il.none,update(e,t){e=e.map(t.changes);for(let i of t.effects)i.is(Yd)&&!jd(e,i.value.from,i.value.to)?e=e.update({add:[Jd.range(i.value.from,i.value.to)]}):i.is(Zd)&&(e=e.update({filter:(e,t)=>i.value.from!=e||i.value.to!=t,filterFrom:i.value.from,filterTo:i.value.to}));if(t.selection){let i=!1,{head:n}=t.selection.main;e.between(n,n,((e,t)=>{en&&(i=!0)})),i&&(e=e.update({filterFrom:n,filterTo:n,filter:(e,t)=>t<=n||e>=n}))}return e},provide:e=>Oh.decorations.from(e)});function Dd(e,t,i){var n;let r=null;return null===(n=e.field(Md,!1))||void 0===n||n.between(t,i,((e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})})),r}function jd(e,t,i){let n=!1;return e.between(t,t,((e,r)=>{e==t&&r==i&&(n=!0)})),n}function Gd(e,t){return e.field(Md,!1)?t:t.concat(kr.appendConfig.of(Hd()))}function Ld(e,t,i=!0){let n=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return Oh.announce.of(`${e.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${e.state.phrase("to")} ${r}.`)}const Bd=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of Ud(e)){let i=zd(e.state,t.from,t.to);if(i)return e.dispatch({effects:Gd(e.state,[Yd.of(i),Ld(e,i)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Md,!1))return!1;let t=[];for(let i of Ud(e)){let n=Dd(e.state,i.from,i.to);n&&t.push(Zd.of(n),Ld(e,n,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,i=[];for(let n=0;n{let t=e.state.field(Md,!1);if(!t||!t.size)return!1;let i=[];return t.between(0,e.state.doc.length,((e,t)=>{i.push(Zd.of({from:e,to:t}))})),e.dispatch({effects:i}),!0}}],Fd={placeholderDOM:null,placeholderText:"…"},Kd=Ln.define({combine:e=>qr(e,Fd)});function Hd(e){let t=[Md,ef];return e&&t.push(Kd.of(e)),t}const Jd=Il.replace({widget:new class extends Vl{toDOM(e){let{state:t}=e,i=t.facet(Kd),n=t=>{let i=e.lineBlockAt(e.posAtDOM(t.target)),n=Dd(e.state,i.from,i.to);n&&e.dispatch({effects:Zd.of(n)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,n);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=n,r}}});const ef=Oh.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class tf{constructor(e,t){let i;function n(e){let t=Xa.newName();return(i||(i=Object.create(null)))["."+t]=e,t}const r="string"==typeof t.all?t.all:t.all?n(t.all):void 0,s=t.scope;this.scope=s instanceof sd?e=>e.prop(nd)==s.data:s?e=>e==s:void 0,this.style=Eu(e.map((e=>({tag:e.tag,class:e.class||n(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=i?new Xa(i):null,this.themeType=t.themeType}static define(e,t){return new tf(e,t||{})}}const nf=Ln.define(),rf=Ln.define({combine:e=>e.length?[e[0]]:null});function sf(e){let t=e.facet(nf);return t.length?t:e.facet(rf)}function of(e,t){let i,n=[af];return e instanceof tf&&(e.module&&n.push(Oh.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(rf.of(e)):i?n.push(nf.computeN([Oh.darkTheme],(t=>t.facet(Oh.darkTheme)==("dark"==i)?[e]:[]))):n.push(nf.of(e)),n}const af=ar.high(Oc.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=ld(e.state),this.decorations=this.buildDeco(e,sf(e.state))}update(e){let t=ld(e.state),i=sf(e.state),n=i!=sf(e.startState);t.length{i.add(e,t,this.markCache[n]||(this.markCache[n]=Il.mark({class:n})))}),n,r);return i.finish()}},{decorations:e=>e.decorations})),lf=(tf.define([{tag:td.meta,color:"#7a757a"},{tag:td.link,textDecoration:"underline"},{tag:td.heading,textDecoration:"underline",fontWeight:"bold"},{tag:td.emphasis,fontStyle:"italic"},{tag:td.strong,fontWeight:"bold"},{tag:td.strikethrough,textDecoration:"line-through"},{tag:td.keyword,color:"#708"},{tag:[td.atom,td.bool,td.url,td.contentSeparator,td.labelName],color:"#219"},{tag:[td.literal,td.inserted],color:"#164"},{tag:[td.string,td.deleted],color:"#a11"},{tag:[td.regexp,td.escape,td.special(td.string)],color:"#e40"},{tag:td.definition(td.variableName),color:"#00f"},{tag:td.local(td.variableName),color:"#30a"},{tag:[td.typeName,td.namespace],color:"#085"},{tag:td.className,color:"#167"},{tag:[td.special(td.variableName),td.macroName],color:"#256"},{tag:td.definition(td.propertyName),color:"#00c"},{tag:td.comment,color:"#940"},{tag:td.invalid,color:"#f00"}]),Oh.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ln.define({combine:e=>qr(e,{afterCursor:!0,brackets:"()[]{}",maxScanDistance:1e4,renderMatch:hf})})),cf=Il.mark({class:"cm-matchingBracket"}),Of=Il.mark({class:"cm-nonmatchingBracket"});function hf(e){let t=[],i=e.matched?cf:Of;return t.push(i.range(e.start.from,e.start.to)),e.end&&t.push(i.range(e.end.from,e.end.to)),t}tr.define({create:()=>Il.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let i=[],n=t.state.facet(lf);for(let e of t.state.selection.ranges){if(!e.empty)continue;let r=df(t.state,e.head,-1,n)||e.head>0&&df(t.state,e.head-1,1,n)||n.afterCursor&&(df(t.state,e.head,1,n)||e.headOh.decorations.from(e)});function uf(e,t,i){let n=e.prop(t<0?ss.openedBy:ss.closedBy);if(n)return n;if(1==e.name.length){let n=i.indexOf(e.name);if(n>-1&&n%2==(t<0?1:0))return[i[n+t]]}return null}function df(e,t,i,n={}){let r=n.maxScanDistance||1e4,s=n.brackets||"()[]{}",o=ld(e),a=o.resolveInner(t,i);for(let n=a;n;n=n.parent){let r=uf(n.type,i,s);if(r&&n.from0)return null;let c={from:i<0?t-1:t,to:i>0?t+1:t},O=e.doc.iterRange(t,i>0?e.doc.length:0),h=0;for(let e=0;!O.next().done&&e<=s;){let s=O.value;i<0&&(e+=s.length);let a=t+e*i;for(let e=i>0?0:s.length-1,t=i>0?s.length:-1;e!=t;e+=i){let t=o.indexOf(s[e]);if(!(t<0||n.resolve(a+e,1).type!=r))if(t%2==0==i>0)h++;else{if(1==h)return{start:c,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};h--}}i>0&&(e+=s.length)}return O.done?{start:c,matched:!1}:null}(e,t,i,o,a.type,r,s)}function ff(e,t,i,n,r,s){let o=n.parent,a={from:n.from,to:n.to},l=0,c=null==o?void 0:o.cursor();if(c&&(i<0?c.childBefore(n.from):c.childAfter(n.to)))do{if(i<0?c.to<=n.from:c.from>=n.to){if(0==l&&r.indexOf(c.type.name)>-1&&c.from-1||(gf.push(e),console.warn(t))}function Qf(e,t){let i=null;for(let n of t.split(".")){let t=e[n]||td[n];t?"function"==typeof t?i?i=t(i):bf(n,`Modifier ${n} used at start of tag`):i?bf(n,`Tag ${n} used as modifier`):i=t:bf(n,`Unknown highlighting tag ${n}`)}if(!i)return 0;let n=t.replace(/ /g,"_"),r=ls.define({id:mf.length,name:n,props:[Au({[n]:i})]});return mf.push(r),r.id}class yf{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ld(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),i=Math.max(t.from,this.pos-250),n=t.text.slice(i-t.from,this.pos-t.from),r=n.search(xf(e,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function Pf(e){let t=Object.keys(e).join(""),i=/\w/.test(t);return i&&(t=t.replace(/\w/g,"")),`[${i?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function wf(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[i,n]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),i=Object.create(null);for(let{label:n}of e){t[n[0]]=!0;for(let e=1;e{let r=e.matchBefore(n);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:i}:null}}function kf(e,t){return i=>{for(let t=ld(i.state).resolveInner(i.pos,-1);t;t=t.parent)if(e.indexOf(t.name)>-1)return null;return t(i)}}class _f{constructor(e,t,i){this.completion=e,this.source=t,this.match=i}}function vf(e){return e.selection.main.head}function xf(e,t){var i;let{source:n}=e,r=t&&"^"!=n[0],s="$"!=n[n.length-1];return r||s?new RegExp(`${r?"^":""}(?:${n})${s?"$":""}`,null!==(i=e.flags)&&void 0!==i?i:e.ignoreCase?"i":""):e}const Xf=yr.define();function Sf(e,t){const i=t.completion.apply||t.completion.label;let n=t.source;"string"==typeof i?e.dispatch(e.state.changeByRange((t=>{if(t==e.state.selection.main)return{changes:{from:n.from,to:n.to,insert:i},range:Mn.cursor(n.from+i.length)};let r=n.to-n.from;return!t.empty||r&&e.state.sliceDoc(t.from-r,t.from)!=e.state.sliceDoc(n.from,n.to)?{range:t}:{changes:{from:t.from-r,to:t.from,insert:i},range:Mn.cursor(t.from-r+i.length)}})),{userEvent:"input.complete",annotations:Xf.of(t.completion)}):i(e,t.completion,n.from,n.to)}const Rf=new WeakMap;function Tf(e){if(!Array.isArray(e))return e;let t=Rf.get(e);return t||Rf.set(e,t=wf(e)),t}class Wf{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let t=0;t=48&&l<=57||l>=97&&l<=122?2:l>=65&&l<=90?1:0:($=Rn(l))!=$.toLowerCase()?1:$!=$.toUpperCase()?2:0;(!n||1==b&&p||0==g&&0!=b)&&(t[O]==l||i[O]==l&&(h=!0)?s[O++]=n:s.length&&(m=!1)),g=b,n+=Tn(l)}return O==a&&0==s[0]&&m?this.result((h?-200:0)-100,s,e):u==a&&0==d?[-200-e.length,0,f]:o>-1?[-700-e.length,o,o+this.pattern.length]:u==a?[-900-e.length,d,f]:O==a?this.result((h?-200:0)-100-700+(m?0:-1100),s,e):2==t.length?null:this.result((n[0]?-700:0)-200-1100,n,e)}result(e,t,i){let n=[e-i.length],r=1;for(let e of t){let t=e+(this.astral?Tn(Sn(i,e)):1);r>1&&n[r-1]==e?n[r-1]=t:(n[r++]=e,n[r++]=t)}return n}}const Af=Ln.define({combine:e=>qr(e,{activateOnTyping:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[]},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,optionClass:(e,t)=>i=>function(e,t){return e?t?e+" "+t:e:t}(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})});function Nf(e,t,i){if(e<=i)return{from:0,to:e};if(t<=e>>1){let e=Math.floor(t/i);return{from:e*i,to:(e+1)*i}}let n=Math.floor((e-t)/i);return{from:e-(n+1)*i,to:e-n*i}}class Cf{constructor(e,t){this.view=e,this.stateField=t,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:e=>this.positionInfo(e),key:this};let i=e.state.field(t),{options:n,selected:r}=i.open,s=e.state.facet(Af);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,i){let n=document.createElement("span");n.className="cm-completionLabel";let{label:r}=e,s=0;for(let e=1;es&&n.appendChild(document.createTextNode(r.slice(s,t)));let a=n.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(r.slice(t,o))),a.className="cm-completionMatchedText",s=o}return se.position-t.position)).map((e=>e.render))}(s),this.optionClass=s.optionClass,this.range=Nf(n.length,r,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",(t=>{for(let i,r=t.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(i=/-(\d+)$/.exec(r.id))&&+i[1]{this.info&&this.view.requestMeasure(this.placeInfo)}))}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected=this.range.to)&&(this.range=Nf(t.options.length,t.selected,this.view.state.facet(Af).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t.options,e.id,this.range)),this.list.addEventListener("scroll",(()=>{this.info&&this.view.requestMeasure(this.placeInfo)}))),this.updateSelectedOption(t.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:i}=t.options[t.selected],{info:n}=i;if(!n)return;let r="string"==typeof n?document.createTextNode(n):n(i);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t)})).catch((e=>oc(this.view.state,e,"completion info"))):this.addInfoPane(r)}}addInfoPane(e){let t=this.info=document.createElement("div");t.className="cm-tooltip cm-completionInfo",t.appendChild(e),this.dom.appendChild(t),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)n==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&function(e,t){let i=e.getBoundingClientRect(),n=t.getBoundingClientRect();n.topi.bottom&&(e.scrollTop+=n.bottom-i.bottom)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=e.getBoundingClientRect();if(n.top>Math.min(innerHeight,t.bottom)-10||n.bottomnew Cf(t,e)}function qf(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class Vf{constructor(e,t,i,n,r){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=n,this.selected=r}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Vf(this.options,Yf(t,e),this.tooltip,this.timestamp,e)}static build(e,t,i,n,r){let s=function(e,t){let i=[],n=0;for(let r of e)if(r.hasResult())if(!1===r.result.filter){let e=r.result.getMatch;for(let t of r.result.options){let s=[1e9-n++];if(e)for(let i of e(t))s.push(i);i.push(new _f(t,r,s))}}else{let e,n=new Wf(t.sliceDoc(r.from,r.to));for(let t of r.result.options)(e=n.match(t.label))&&(null!=t.boost&&(e[0]+=t.boost),i.push(new _f(t,r,e)))}let r=[],s=null;for(let e of i.sort(Uf))!s||s.label!=e.completion.label||s.detail!=e.completion.detail||null!=s.type&&null!=e.completion.type&&s.type!=e.completion.type||s.apply!=e.completion.apply?r.push(e):qf(e.completion)>qf(s)&&(r[r.length-1]=e),s=e.completion;return r}(e,t);if(!s.length)return null;let o=0;if(n&&n.selected){let e=n.options[n.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:Ef(Kf),above:r.aboveCursor},n?n.timestamp:Date.now(),o)}map(e){return new Vf(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class zf{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new zf(Zf,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Af),n=(i.override||t.languageDataAt("autocomplete",vf(t)).map(Tf)).map((t=>(this.active.find((e=>e.source==t))||new Df(t,this.active.some((e=>0!=e.state))?1:0)).update(e,i)));n.length==this.active.length&&n.every(((e,t)=>e==this.active[t]))&&(n=this.active);let r=e.selection||n.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let i=0,n=0;;){for(;i1!=e.state))&&n.some((e=>e.hasResult()))&&(n=n.map((e=>e.hasResult()?new Df(e.source,0):e)));for(let t of e.effects)t.is(Ff)&&(r=r&&r.setSelected(t.value,this.id));return n==this.active&&r==this.open?this:new zf(n,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:If}}const If={"aria-autocomplete":"list"};function Yf(e,t){return{"aria-autocomplete":"list","aria-haspopup":"listbox","aria-activedescendant":e+"-"+t,"aria-controls":e}}const Zf=[];function Uf(e,t){return t.match[0]-e.match[0]||e.completion.label.localeCompare(t.completion.label)}function Mf(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class Df{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=Mf(e),n=this;i?n=n.handleUserEvent(e,i,t):e.docChanged?n=n.handleChange(e):e.selection&&0!=n.state&&(n=new Df(n.source,0));for(let t of e.effects)if(t.is(Gf))n=new Df(n.source,1,t.value?vf(e.state):-1);else if(t.is(Lf))n=new Df(n.source,0);else if(t.is(Bf))for(let e of t.value)e.source==n.source&&(n=e);return n}handleUserEvent(e,t,i){return"delete"!=t&&i.activateOnTyping?new Df(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(vf(e.startState))?new Df(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Df(this.source,this.state,e.mapPos(this.explicitPos))}}class jf extends Df{constructor(e,t,i,n,r){super(e,2,t),this.result=i,this.from=n,this.to=r}hasResult(){return!0}handleUserEvent(e,t,i){var n;let r=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),o=vf(e.state);if((this.explicitPos<0?o<=r:os||"delete"==t&&vf(e.startState)==this.from)return new Df(this.source,"input"==t&&i.activateOnTyping?1:0);let a,l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,i,n){if(!e)return!1;let r=t.sliceDoc(i,n);return"function"==typeof e?e(r,i,n,t):xf(e,!0).test(r)}(this.result.validFor,e.state,r,s)?new jf(this.source,l,this.result,r,s):this.result.update&&(a=this.result.update(this.result,r,s,new yf(e.state,o,l>=0)))?new jf(this.source,l,a,a.from,null!==(n=a.to)&&void 0!==n?n:vf(e.state)):new Df(this.source,1,l)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Df(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new jf(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const Gf=kr.define(),Lf=kr.define(),Bf=kr.define({map:(e,t)=>e.map((e=>e.map(t)))}),Ff=kr.define(),Kf=tr.define({create:()=>zf.start(),update:(e,t)=>e.update(t),provide:e=>[nu.from(e,(e=>e.tooltip)),Oh.contentAttributes.from(e,(e=>e.attrs))]});function Hf(e,t="option"){return i=>{let n=i.state.field(Kf,!1);if(!n||!n.open||Date.now()-n.open.timestamp<75)return!1;let r,s=1;"page"==t&&(r=function(e,t){let i=e.plugin(eu);if(!i)return null;let n=i.manager.tooltips.indexOf(t);return n<0?null:i.manager.tooltipViews[n]}(i,n.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let o=n.open.selected+s*(e?1:-1),{length:a}=n.open.options;return o<0?o="page"==t?0:a-1:o>=a&&(o="page"==t?a-1:0),i.dispatch({effects:Ff.of(o)}),!0}}const Jf=e=>{let t=e.state.field(Kf,!1);return!(e.state.readOnly||!t||!t.open||Date.now()-t.open.timestamp<75||(Sf(e,t.open.options[t.open.selected]),0))},ep=e=>!!e.state.field(Kf,!1)&&(e.dispatch({effects:Gf.of(!0)}),!0),tp=e=>{let t=e.state.field(Kf,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:Lf.of(null)}),0))};class ip{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const np=Oc.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(Kf).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(Kf);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Kf)==t)return;let i=e.transactions.some((e=>(e.selection||e.docChanged)&&!Mf(e)));for(let t=0;t50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){oc(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let t of e.transactions)"input"==Mf(t)?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(Kf);for(let e of t.active)1!=e.state||this.running.some((t=>t.active.source==e.source))||this.startQuery(e)}startQuery(e){let{state:t}=this.view,i=vf(t),n=new yf(t,i,e.explicitPos==i),r=new ip(e,n);this.running.push(r),Promise.resolve(e.source(n)).then((e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:Lf.of(null)}),oc(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),50))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],i=this.view.state.facet(Af);for(let n=0;ne.source==r.active.source));if(s&&1==s.state)if(null==r.done){let e=new Df(r.active.source,0);for(let t of r.updates)e=e.update(t,i);1!=e.state&&t.push(e)}else this.startQuery(s)}t.length&&this.view.dispatch({effects:Bf.of(t)})}},{eventHandlers:{blur(){let e=this.view.state.field(Kf,!1);e&&e.tooltip&&this.view.state.facet(Af).closeOnBlur&&this.view.dispatch({effects:Lf.of(null)})},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:Gf.of(!1)})),20),this.composing=0}}}),rp=Oh.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class sp{constructor(e,t,i,n){this.field=e,this.line=t,this.from=i,this.to=n}}class op{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,Nn.TrackDel),i=e.mapPos(this.to,1,Nn.TrackDel);return null==t||null==i?null:new op(this.field,t,i)}}class ap{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],n=[t],r=e.doc.lineAt(t),s=/^\s*/.exec(r.text)[0];for(let r of this.lines){if(i.length){let i=s,o=/^\t*/.exec(r)[0].length;for(let t=0;tnew op(e.field,n[e.line]+e.from,n[e.line]+e.to)));return{text:i,ranges:o}}static parse(e){let t,i=[],n=[],r=[];for(let s of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(s);){let e=t[1]?+t[1]:null,o=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}r.push(new sp(a,n.length,t.index,t.index+o.length)),s=s.slice(0,t.index)+o+s.slice(t.index+t[0].length)}n.push(s)}return new ap(n,r)}}let lp=Il.widget({widget:new class extends Vl{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),cp=Il.mark({class:"cm-snippetField"});class Op{constructor(e,t){this.ranges=e,this.active=t,this.deco=Il.set(e.map((e=>(e.from==e.to?lp:cp).range(e.from,e.to))))}map(e){let t=[];for(let i of this.ranges){let n=i.map(e);if(!n)return null;t.push(n)}return new Op(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const hp=kr.define({map:(e,t)=>e&&e.map(t)}),up=kr.define(),dp=tr.define({create:()=>null,update(e,t){for(let i of t.effects){if(i.is(hp))return i.value;if(i.is(up)&&e)return new Op(e.ranges,i.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>Oh.decorations.from(e,(e=>e?e.deco:Il.none))});function fp(e,t){return Mn.create(e.filter((e=>e.field==t)).map((e=>Mn.range(e.from,e.to))))}function pp(e){let t=ap.parse(e);return(e,i,n,r)=>{let{text:s,ranges:o}=t.instantiate(e.state,n),a={changes:{from:n,to:r,insert:un.of(s)}};if(o.length&&(a.selection=fp(o,0)),o.length>1){let t=new Op(o,0),i=a.effects=[hp.of(t)];void 0===e.state.field(dp,!1)&&i.push(kr.appendConfig.of([dp,Pp,kp,rp]))}e.dispatch(e.state.update(a))}}function mp(e){return({state:t,dispatch:i})=>{let n=t.field(dp,!1);if(!n||e<0&&0==n.active)return!1;let r=n.active+e,s=e>0&&!n.ranges.some((t=>t.field==r+e));return i(t.update({selection:fp(n.ranges,r),effects:hp.of(s?null:new Op(n.ranges,r))})),!0}}const gp=({state:e,dispatch:t})=>!!e.field(dp,!1)&&(t(e.update({effects:hp.of(null)})),!0),$p=mp(1),bp=mp(-1),Qp=[{key:"Tab",run:$p,shift:bp},{key:"Escape",run:gp}],yp=Ln.define({combine:e=>e.length?e[0]:Qp}),Pp=ar.highest($h.compute([yp],(e=>e.facet(yp))));function wp(e,t){return Object.assign(Object.assign({},t),{apply:pp(e)})}const kp=Oh.domEventHandlers({mousedown(e,t){let i,n=t.state.field(dp,!1);if(!n||null==(i=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=n.ranges.find((e=>e.from<=i&&e.to>=i));return!(!r||r.field==n.active||(t.dispatch({selection:fp(n.ranges,r.field),effects:hp.of(n.ranges.some((e=>e.field>r.field))?new Op(n.ranges,r.field):null)}),0))}});function _p(e,t){return new RegExp(t(e.source),e.unicode?"u":"")}const vp=Object.create(null);function xp(e){return vp[e]||(vp[e]=new WeakMap)}function Xp(e,t,i,n,r){for(let s=e.iterLines(),o=0;!s.next().done;){let e,{value:a}=s;for(t.lastIndex=0;e=t.exec(a);)if(!n[e[0]]&&o+e.index!=r&&(i.push({type:"text",label:e[0]}),n[e[0]]=!0,i.length>=2e3))return;o+=a.length+1}}function Sp(e,t,i,n,r){let s=e.length>=1e3,o=s&&t.get(e);if(o)return o;let a=[],l=Object.create(null);if(e.children){let s=0;for(let o of e.children){if(o.length>=1e3)for(let e of Sp(o,t,i,n-s,r-s))l[e.label]||(l[e.label]=!0,a.push(e));else Xp(o,i,a,l,r-s);s+=o.length+1}}else Xp(e,i,a,l,r);return s&&a.length<2e3&&t.set(e,a),a}const Rp={brackets:["(","[","{","'",'"'],before:")]}:;>"},Tp=kr.define({map(e,t){let i=t.mapPos(e,-1,Nn.TrackAfter);return null==i?void 0:i}}),Wp=kr.define({map:(e,t)=>t.mapPos(e)}),Ap=new class extends Vr{};Ap.startSide=1,Ap.endSide=-1;const Np=tr.define({create:()=>Zr.empty,update(e,t){if(t.selection){let i=t.state.doc.lineAt(t.selection.main.head).from,n=t.startState.doc.lineAt(t.startState.selection.main.head).from;i!=t.changes.mapPos(n,-1)&&(e=Zr.empty)}e=e.map(t.changes);for(let i of t.effects)i.is(Tp)?e=e.update({add:[Ap.range(i.value,i.value+1)]}):i.is(Wp)&&(e=e.update({filter:e=>e!=i.value}));return e}});function Cp(){return[zp,Np]}function Ep(e){for(let t=0;t<8;t+=2)if("()[]{}<>".charCodeAt(t)==e)return"()[]{}<>".charAt(t+1);return Rn(e<128?e:e+1)}function qp(e,t){return e.languageDataAt("closeBrackets",t)[0]||Rp}const Vp="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),zp=Oh.inputHandler.of(((e,t,i,n)=>{if((Vp?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(n.length>2||2==n.length&&1==Tn(Sn(n,0))||t!=r.from||i!=r.to)return!1;let s=Zp(e.state,n);return!!s&&(e.dispatch(s),!0)})),Ip=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=qp(e,e.selection.main.head).brackets||Rp.brackets,n=null,r=e.changeByRange((t=>{if(t.empty){let n=function(e,t){let i=e.sliceString(t-2,t);return Tn(Sn(i,0))==i.length?i:i.slice(1)}(e.doc,t.head);for(let r of i)if(r==n&&Mp(e.doc,t.head)==Ep(Sn(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:Mn.cursor(t.head-r.length),userEvent:"delete.backward"}}return{range:n=t}}));return n||t(e.update(r,{scrollIntoView:!0})),!n},Yp=[{key:"Backspace",run:Ip}];function Zp(e,t){let i=qp(e,e.selection.main.head),n=i.brackets||Rp.brackets;for(let r of n){let s=Ep(Sn(r,0));if(t==r)return s==r?Gp(e,r,n.indexOf(r+r+r)>-1):Dp(e,r,s,i.before||Rp.before);if(t==s&&Up(e,e.selection.main.from))return jp(e,r,s)}return null}function Up(e,t){let i=!1;return e.field(Np).between(0,e.doc.length,(e=>{e==t&&(i=!0)})),i}function Mp(e,t){let i=e.sliceString(t,t+2);return i.slice(0,Tn(Sn(i,0)))}function Dp(e,t,i,n){let r=null,s=e.changeByRange((s=>{if(!s.empty)return{changes:[{insert:t,from:s.from},{insert:i,from:s.to}],effects:Tp.of(s.to+t.length),range:Mn.range(s.anchor+t.length,s.head+t.length)};let o=Mp(e.doc,s.head);return!o||/\s/.test(o)||n.indexOf(o)>-1?{changes:{insert:t+i,from:s.head},effects:Tp.of(s.head+t.length),range:Mn.cursor(s.head+t.length)}:{range:r=s}}));return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function jp(e,t,i){let n=null,r=e.selection.ranges.map((t=>t.empty&&Mp(e.doc,t.head)==i?Mn.cursor(t.head+i.length):n=t));return n?null:e.update({selection:Mn.create(r,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map((({from:e})=>Wp.of(e)))})}function Gp(e,t,i){let n=null,r=e.changeByRange((r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:Tp.of(r.to+t.length),range:Mn.range(r.anchor+t.length,r.head+t.length)};let s=r.head,o=Mp(e.doc,s);if(o==t){if(Lp(e,s))return{changes:{insert:t+t,from:s},effects:Tp.of(s+t.length),range:Mn.cursor(s+t.length)};if(Up(e,s)){let n=i&&e.sliceDoc(s,s+3*t.length)==t+t+t;return{range:Mn.cursor(s+t.length*(n?3:1)),effects:Wp.of(s)}}}else{if(i&&e.sliceDoc(s-2*t.length,s)==t+t&&Lp(e,s-2*t.length))return{changes:{insert:t+t+t+t,from:s},effects:Tp.of(s+t.length),range:Mn.cursor(s+t.length)};if(e.charCategorizer(s)(o)!=Wr.Word){let i=e.sliceDoc(s-1,s);if(i!=t&&e.charCategorizer(s)(i)!=Wr.Word&&!function(e,t,i){let n=ld(e).resolveInner(t,-1);for(let r=0;r<5;r++){if(e.sliceDoc(n.from,n.from+i.length)==i)return!0;let r=n.to==t&&n.parent;if(!r)break;n=r}return!1}(e,s,t))return{changes:{insert:t+t,from:s},effects:Tp.of(s+t.length),range:Mn.cursor(s+t.length)}}}return{range:n=r}}));return n?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function Lp(e,t){let i=ld(e).resolveInner(t+1);return i.parent&&i.from==t}const Bp=[{key:"Ctrl-Space",run:ep},{key:"Escape",run:tp},{key:"ArrowDown",run:Hf(!0)},{key:"ArrowUp",run:Hf(!1)},{key:"PageDown",run:Hf(!0,"page")},{key:"PageUp",run:Hf(!1,"page")},{key:"Enter",run:Jf}],Fp=ar.highest($h.computeN([Af],(e=>e.facet(Af).defaultKeymap?[Bp]:[])));const Kp=new WeakMap;var Hp=Object.freeze({__proto__:null,CompletionContext:yf,acceptCompletion:Jf,autocompletion:function(e={}){return[Kf,Af.of(e),np,Fp,rp]},clearSnippet:gp,closeBrackets:Cp,closeBracketsKeymap:Yp,closeCompletion:tp,completeAnyWord:e=>{let t=e.state.languageDataAt("wordChars",e.pos).join(""),i=function(e){let t=e.replace(/[\\[.+*?(){|^$]/g,"\\$&");try{return new RegExp(`[\\p{Alphabetic}\\p{Number}_${t}]+`,"ug")}catch(e){return new RegExp(`[w${t}]`,"g")}}(t),n=e.matchBefore(_p(i,(e=>e+"$")));if(!n&&!e.explicit)return null;let r=n?n.from:e.pos;return{from:r,options:Sp(e.state.doc,xp(t),i,5e4,r),validFor:_p(i,(e=>"^"+e))}},completeFromList:wf,completionKeymap:Bp,completionStatus:function(e){let t=e.field(Kf,!1);return t&&t.active.some((e=>1==e.state))?"pending":t&&t.active.some((e=>0!=e.state))?"active":null},currentCompletions:function(e){var t;let i=null===(t=e.field(Kf,!1))||void 0===t?void 0:t.open;if(!i)return[];let n=Kp.get(i.options);return n||Kp.set(i.options,n=i.options.map((e=>e.completion))),n},deleteBracketPair:Ip,ifIn:function(e,t){return i=>{for(let n=ld(i.state).resolveInner(i.pos,-1);n;n=n.parent)if(e.indexOf(n.name)>-1)return t(i);return null}},ifNotIn:kf,insertBracket:Zp,moveCompletionSelection:Hf,nextSnippetField:$p,pickedCompletion:Xf,prevSnippetField:bp,selectedCompletion:function(e){var t;let i=null===(t=e.field(Kf,!1))||void 0===t?void 0:t.open;return i?i.options[i.selected].completion:null},selectedCompletionIndex:function(e){var t;let i=null===(t=e.field(Kf,!1))||void 0===t?void 0:t.open;return i?i.selected:null},setSelectedCompletion:function(e){return Ff.of(e)},snippet:pp,snippetCompletion:wp,snippetKeymap:yp,startCompletion:ep});function Jp({closing:e,units:t=1}){return i=>function(e,t,i){let n=e.textAfter,r=n.match(/^\s*/)[0].length,s=!1;switch(i.length){case 1:s=n.slice(r,r+i[0].length)===i[0];break;case 2:s=n.slice(r,r+i[0].length)===i[0]||n.slice(r,r+i[1].length)===i[1];break;case 3:s=n.slice(r,r+i[0].length)===i[0]||n.slice(r,r+i[1].length)===i[1]||n.slice(r,r+i[2].length)===i[2];break;default:s=i.some((e=>n.slice(r,r+e.length)===e))}return e.baseIndent+(s?0:e.unit*t)}(i,t,e)}function em(e){return e.baseIndent}let tm=function(){let e={indents:{VariableDeclaration:Nd(),AssignmentExpression:Nd()},keywords:[]};for(let t of ka.nodeSet.types){let i,n=t.prop(ss.group);"keyword"===(null!=n?n[0]:null)&&e.keywords.push(t);let r=t.prop(ss.closedBy);i=r?Jp({closing:r}):em,e.indents[t.name]=i}return e}(),im=Au({String:td.string,TripleString:td.string,CommandString:td.string,StringWithoutInterpolation:td.string,TripleStringWithoutInterpolation:td.string,CommandStringWithoutInterpolation:td.string,"String/$ TripleString/$ CommandString/$":td.special(td.brace),"String/( TripleString/( CommandString/(":td.special(td.brace),"String/) TripleString/) CommandString/)":td.special(td.brace),Comment:td.lineComment,BlockComment:td.comment,"mutable struct StructDefinition/end":td.definitionKeyword,"primitive type PrimitiveDefinition/end":td.definitionKeyword,"const local global":td.definitionKeyword,"ForStatement/for ForBinding/in ForStatement/end":td.controlKeyword,"WhileStatement/while WhileStatement/end":td.controlKeyword,"IfClause/if IfClause/elseif ElseClause/else IfStatement/end":td.controlKeyword,"default break return":td.controlKeyword,"TryStatement/try CatchClause/catch FinallyClause/finally TryStatement/end":td.controlKeyword,"( )":td.paren,"[ ]":td.paren,"{ }":td.paren,[tm.keywords.map((e=>e.name)).join(" ")]:td.keyword,BooleanLiteral:td.bool,Number:td.number,"Coefficient/PrefixedString!":td.unit,"Type! TypeParameters!":td.typeName,"StructDefinition/Identifier StructDefinition/AssignmentExpression/Identifier StructDefinition/TypedExpression/Identifier StructDefinition/AssignmentExpression/TypedExpression/Identifier":td.definition(td.propertyName),":: <:":td.typeOperator,Identifier:td.variableName,"MacroIdentifier! MacroFieldExpression!":td.macroName,"MacroDefinition/Definition!":td.definition(td.macroName),"FieldName!":td.propertyName,FieldExpression:td.propertyName,"FieldExpression .":td.derefOperator,"Symbol!":td.atom}),nm=ad.define({parser:ka.configure({props:[im,vd.add(Object.assign(Object.assign({},tm.indents),{ModuleDefinition:em,BareModuleDefinition:em,VariableDeclaration:Nd(),AssignmentExpression:Nd()}))]}),languageData:{commentTokens:{line:"#"},indentOnInput:/^\s*(\]|\}|\)|end|else|elseif|catch|finally)/,closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});const rm=nm.data.of({autocomplete:wf(tm.keywords.map((e=>({label:e.name,type:"keyword"}))))});let sm={enableKeywordCompletion:!1};function om(e=sm){let t=[];return(e=Object.assign(Object.assign({},sm),e)).enableKeywordCompletion&&t.push(rm),new $d(nm,t)}function am(e,t){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=e(t,i);return!!r&&(n(i.update(r)),!0)}}const lm=am((function(e,t,i=t.selection.ranges){let n=[],r=-1;for(let{from:e,to:s}of i){let i=n.length,o=1e9;for(let i=e;i<=s;){let a=t.doc.lineAt(i);if(a.from>r&&(e==s||s>a.from)){r=a.from;let e=hm(t,i).line;if(!e)continue;let s=/^\s*/.exec(a.text)[0].length,l=s==a.length,c=a.text.slice(s,s+e.length)==e?s:-1;se.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:i,indent:r,empty:s,single:o}of n)!o&&s||e.push({from:t.from+r,insert:i+" "});let i=t.changes(e);return{changes:i,selection:t.selection.map(i,1)}}if(1!=e&&n.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:i,token:r}of n)if(i>=0){let n=t.from+i,s=n+r.length;" "==t.text[s-t.from]&&s++,e.push({from:n,to:s})}return{changes:e}}return null}),0),cm=am(um,0),Om=am(((e,t)=>um(e,t,function(e){let t=[];for(let i of e.selection.ranges){let n=e.doc.lineAt(i.from),r=i.to<=n.to?n:e.doc.lineAt(i.to),s=t.length-1;s>=0&&t[s].to>n.from?t[s].to=r.to:t.push({from:n.from,to:r.to})}return t}(t))),0);function hm(e,t=e.selection.main.head){let i=e.languageDataAt("commentTokens",t);return i.length?i[0]:{}}function um(e,t,i=t.selection.ranges){let n=i.map((e=>hm(t,e.from).block));if(!n.every((e=>e)))return null;let r=i.map(((e,i)=>function(e,{open:t,close:i},n,r){let s,o,a=e.sliceDoc(n-50,n),l=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,O=/^\s*/.exec(l)[0].length,h=a.length-c;if(a.slice(h-t.length,h)==t&&l.slice(O,O+i.length)==i)return{open:{pos:n-c,margin:c&&1},close:{pos:r+O,margin:O&&1}};r-n<=100?s=o=e.sliceDoc(n,r):(s=e.sliceDoc(n,n+50),o=e.sliceDoc(r-50,r));let u=/^\s*/.exec(s)[0].length,d=/\s*$/.exec(o)[0].length,f=o.length-d-i.length;return s.slice(u,u+t.length)==t&&o.slice(f,f+i.length)==i?{open:{pos:n+u+t.length,margin:/\s/.test(s.charAt(u+t.length))?1:0},close:{pos:r-d-i.length,margin:/\s/.test(o.charAt(f-1))?1:0}}:null}(t,n[i],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(i.map(((e,t)=>r[t]?[]:[{from:e.from,insert:n[t].open+" "},{from:e.to,insert:" "+n[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,i=0;iqr(e,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})});const gm=tr.define({create:()=>Am.empty,update(e,t){let i=t.state.facet(mm),n=t.annotation(dm);if(n){let r=t.docChanged?Mn.single(function(e){let t=0;return e.iterChangedRanges(((e,i)=>t=i)),t}(t.changes)):void 0,s=km.fromTransaction(t,r),o=n.side,a=0==o?e.undone:e.done;return a=s?_m(a,a.length,i.minDepth,s):Xm(a,t.startState.selection),new Am(0==o?n.rest:a,0==o?a:n.rest)}let r=t.annotation(fm);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(_r.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=km.fromTransaction(t),o=t.annotation(_r.time),a=t.annotation(_r.userEvent);return s?e=e.addChanges(s,o,a,i.newGroupDelay,i.minDepth):t.selection&&(e=e.addSelection(t.startState.selection,o,a,i.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new Am(e.done.map(km.fromJSON),e.undone.map(km.fromJSON))});function $m(e={}){return[gm,mm.of(e),Oh.domEventHandlers({beforeinput(e,t){let i="historyUndo"==e.inputType?Qm:"historyRedo"==e.inputType?ym:null;return!!i&&(e.preventDefault(),i(t))}})]}function bm(e,t){return function({state:i,dispatch:n}){if(!t&&i.readOnly)return!1;let r=i.field(gm,!1);if(!r)return!1;let s=r.pop(e,i,t);return!!s&&(n(s),!0)}}const Qm=bm(0,!1),ym=bm(1,!1),Pm=bm(0,!0),wm=bm(1,!0);class km{constructor(e,t,i,n,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(e){return new km(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(i=this.startSelection)||void 0===i?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new km(e.changes&&En.fromJSON(e.changes),[],e.mapped&&Cn.fromJSON(e.mapped),e.startSelection&&Mn.fromJSON(e.startSelection),e.selectionsAfter.map(Mn.fromJSON))}static fromTransaction(e,t){let i=xm;for(let t of e.startState.facet(pm)){let n=t(e);n.length&&(i=i.concat(n))}return!i.length&&e.changes.empty?null:new km(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,xm)}static selection(e){return new km(void 0,xm,void 0,void 0,e)}}function _m(e,t,i,n){let r=t+1>i+20?t-i-1:0,s=e.slice(r,t);return s.push(n),s}function vm(e,t){return e.length?t.length?e.concat(t):e:t}const xm=[];function Xm(e,t){if(e.length){let i=e[e.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-200));return n.length&&n[n.length-1].eq(t)?e:(n.push(t),_m(e,e.length-1,1e9,i.setSelAfter(n)))}return[km.selection([t])]}function Sm(e){let t=e[e.length-1],i=e.slice();return i[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),i}function Rm(e,t){if(!e.length)return e;let i=e.length,n=xm;for(;i;){let r=Tm(e[i-1],t,n);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,i);return t[i-1]=r,t}t=r.mapped,i--,n=r.selectionsAfter}return n.length?[km.selection(n)]:xm}function Tm(e,t,i){let n=vm(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):xm,i);if(!e.changes)return km.selection(n);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new km(r,kr.mapEffects(e.effects,t),o,e.startSelection.map(s),n)}const Wm=/^(input\.type|delete)($|\.)/;class Am{constructor(e,t,i=0,n){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Am(this.done,this.undone):this}addChanges(e,t,i,n,r){let s=this.done,o=s[s.length-1];return s=o&&o.changes&&!o.changes.empty&&e.changes&&(!i||Wm.test(i))&&(!o.selectionsAfter.length&&t-this.prevTimei.push(e,t))),t.iterChangedRanges(((e,t,r,s)=>{for(let e=0;e=t&&r<=o&&(n=!0)}})),n}(o.changes,e.changes)||"input.type.compose"==i)?_m(s,s.length-1,r,new km(e.changes.compose(o.changes),vm(e.effects,o.effects),o.mapped,o.startSelection,xm)):_m(s,s.length,r,e),new Am(s,xm,t,i)}addSelection(e,t,i,n){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:xm;return r.length>0&&t-this.prevTimee.empty!=t.ranges[i].empty)).length}(r[r.length-1],e)?this:new Am(Xm(this.done,e),this.undone,t,i)}addMapping(e){return new Am(Rm(this.done,e),Rm(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let n=0==e?this.done:this.undone;if(0==n.length)return null;let r=n[n.length-1];if(i&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:dm.of({side:e,rest:Sm(n)}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let i=1==n.length?xm:n.slice(0,n.length-1);return r.mapped&&(i=Rm(i,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:dm.of({side:e,rest:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}Am.empty=new Am(xm,xm);const Nm=[{key:"Mod-z",run:Qm,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:ym,preventDefault:!0},{key:"Mod-u",run:Pm,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:wm,preventDefault:!0}];function Cm(e,t){return Mn.create(e.ranges.map(t),e.mainIndex)}function Em(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function qm({state:e,dispatch:t},i){let n=Cm(e.selection,i);return!n.eq(e.selection)&&(t(Em(e,n)),!0)}function Vm(e,t){return Mn.cursor(t?e.to:e.from)}function zm(e,t){return qm(e,(i=>i.empty?e.moveByChar(i,t):Vm(i,t)))}function Im(e){return e.textDirectionAt(e.state.selection.main.head)==Qc.LTR}const Ym=e=>zm(e,!Im(e)),Zm=e=>zm(e,Im(e));function Um(e,t){return qm(e,(i=>i.empty?e.moveByGroup(i,t):Vm(i,t)))}function Mm(e,t,i){if(t.type.prop(i))return!0;let n=t.to-t.from;return n&&(n>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function Dm(e,t,i){let n,r,s=ld(e).resolveInner(t.head),o=i?ss.closedBy:ss.openedBy;for(let n=t.head;;){let t=i?s.childAfter(n):s.childBefore(n);if(!t)break;Mm(e,t,o)?s=t:n=i?t.to:t.from}return r=s.type.prop(o)&&(n=i?df(e,s.from,1):df(e,s.to,-1))&&n.matched?i?n.end.to:n.end.from:i?s.to:s.from,Mn.cursor(r,i?-1:1)}function jm(e,t){return qm(e,(i=>{if(!i.empty)return Vm(i,t);let n=e.moveVertically(i,t);return n.head!=i.head?n:e.moveToLineBoundary(i,t)}))}const Gm=e=>jm(e,!1),Lm=e=>jm(e,!0);function Bm(e,t){let{state:i}=e,n=Cm(i.selection,(i=>i.empty?e.moveVertically(i,t,Math.min(e.dom.clientHeight,innerHeight)):Vm(i,t)));if(n.eq(i.selection))return!1;let r,s=e.coordsAtPos(i.selection.main.head),o=e.scrollDOM.getBoundingClientRect();return s&&s.top>o.top&&s.bottomBm(e,!1),Km=e=>Bm(e,!0);function Hm(e,t,i){let n=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,i);if(r.head==t.head&&r.head!=(i?n.to:n.from)&&(r=e.moveToLineBoundary(t,i,!1)),!i&&r.head==n.from&&n.length){let i=/^\s*/.exec(e.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&t.head!=n.from+i&&(r=Mn.cursor(n.from+i))}return r}const Jm=e=>qm(e,(t=>Hm(e,t,!0))),eg=e=>qm(e,(t=>Hm(e,t,!1)));function tg(e,t){let i=Cm(e.state.selection,(e=>{let i=t(e);return Mn.range(e.anchor,i.head,i.goalColumn)}));return!i.eq(e.state.selection)&&(e.dispatch(Em(e.state,i)),!0)}function ig(e,t){return tg(e,(i=>e.moveByChar(i,t)))}const ng=e=>ig(e,!Im(e)),rg=e=>ig(e,Im(e));function sg(e,t){return tg(e,(i=>e.moveByGroup(i,t)))}function og(e,t){return tg(e,(i=>e.moveVertically(i,t)))}const ag=e=>og(e,!1),lg=e=>og(e,!0);function cg(e,t){return tg(e,(i=>e.moveVertically(i,t,Math.min(e.dom.clientHeight,innerHeight))))}const Og=e=>cg(e,!1),hg=e=>cg(e,!0),ug=e=>tg(e,(t=>Hm(e,t,!0))),dg=e=>tg(e,(t=>Hm(e,t,!1))),fg=({state:e,dispatch:t})=>(t(Em(e,{anchor:0})),!0),pg=({state:e,dispatch:t})=>(t(Em(e,{anchor:e.doc.length})),!0),mg=({state:e,dispatch:t})=>(t(Em(e,{anchor:e.selection.main.anchor,head:0})),!0),gg=({state:e,dispatch:t})=>(t(Em(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function $g({state:e,dispatch:t},i){if(e.readOnly)return!1;let n="delete.selection",r=e.changeByRange((e=>{let{from:t,to:r}=e;if(t==r){let e=i(t);et&&(n="delete.forward"),t=Math.min(t,e),r=Math.max(r,e)}return t==r?{range:e}:{changes:{from:t,to:r},range:Mn.cursor(t)}}));return!r.changes.empty&&(t(e.update(r,{scrollIntoView:!0,userEvent:n})),!0)}function bg(e,t,i){if(e instanceof Oh)for(let n of e.state.facet(Oh.atomicRanges).map((t=>t(e))))n.between(t,t,((e,n)=>{et&&(t=i?n:e)}));return t}const Qg=(e,t)=>$g(e,(i=>{let n,r,{state:s}=e,o=s.doc.lineAt(i);if(!t&&i>o.from&&iQg(e,!1),Pg=e=>Qg(e,!0),wg=(e,t)=>$g(e,(i=>{let n=i,{state:r}=e,s=r.doc.lineAt(n),o=r.charCategorizer(n);for(let e=null;;){if(n==(t?s.to:s.from)){n==i&&s.number!=(t?r.doc.lines:1)&&(n+=t?1:-1);break}let a=kn(s.text,n-s.from,t)+s.from,l=s.text.slice(Math.min(n,a)-s.from,Math.max(n,a)-s.from),c=o(l);if(null!=e&&c!=e)break;" "==l&&n==i||(e=c),n=a}return bg(e,n,t)})),kg=e=>wg(e,!1),_g=e=>$g(e,(t=>{let i=e.lineBlockAt(t).to;return bg(e,t=r.number){let e=t[t.length-1];e.to=s.to,e.ranges.push(n)}else t.push({from:r.from,to:s.to,ranges:[n]});i=s.number+1}return t}function xg(e,t,i){if(e.readOnly)return!1;let n=[],r=[];for(let t of vg(e)){if(i?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(i?t.to+1:t.from-1),o=s.length+1;if(i){n.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak});for(let i of t.ranges)r.push(Mn.range(Math.min(e.doc.length,i.anchor+o),Math.min(e.doc.length,i.head+o)))}else{n.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text});for(let e of t.ranges)r.push(Mn.range(e.anchor-o,e.head-o))}}return!!n.length&&(t(e.update({changes:n,scrollIntoView:!0,selection:Mn.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Xg(e,t,i){if(e.readOnly)return!1;let n=[];for(let t of vg(e))i?n.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):n.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Sg=Tg(!1),Rg=Tg(!0);function Tg(e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=t.changeByRange((i=>{let{from:n,to:r}=i,s=t.doc.lineAt(n),o=!e&&n==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let i,n=ld(e).resolveInner(t),r=n.childBefore(t),s=n.childAfter(t);return r&&s&&r.to<=t&&s.from>=t&&(i=r.type.prop(ss.closedBy))&&i.indexOf(s.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(s.from).from?{from:r.to,to:s.from}:null}(t,n);e&&(n=r=(r<=s.to?s:t.doc.lineAt(r)).to);let a=new _d(t,{simulateBreak:n,simulateDoubleBreak:!!o}),l=kd(a,n);for(null==l&&(l=/^\s*/.exec(t.doc.lineAt(n).text)[0].length);rs.from&&n{let r=[];for(let s=n.from;s<=n.to;){let o=e.doc.lineAt(s);o.number>i&&(n.empty||n.to>o.from)&&(t(o,r,n),i=o.number),s=o.to+1}let s=e.changes(r);return{changes:r,range:Mn.range(s.mapPos(n.anchor,1),s.mapPos(n.head,1))}}))}const Ag=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Wg(e,((t,i)=>{i.push({from:t.from,insert:e.facet(yd)})})),{userEvent:"input.indent"})),!0),Ng=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Wg(e,((t,i)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let r=es(n,e.tabSize),s=0,o=wd(e,Math.max(0,r-Pd(e)));for(;sqm(e,(t=>Mn.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>tg(e,(t=>Mn.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>qm(e,(t=>Mn.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>tg(e,(t=>Mn.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:Pg},{key:"Ctrl-h",run:yg},{key:"Ctrl-k",run:_g},{key:"Ctrl-Alt-h",run:kg},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:un.of(["",""])},range:Mn.cursor(e.from)})));return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let i=t.from,n=e.doc.lineAt(i),r=i==n.from?i-1:kn(n.text,i-n.from,!1)+n.from,s=i==n.to?i+1:kn(n.text,i-n.from,!0)+n.from;return{changes:{from:r,to:s,insert:e.doc.slice(i,s).append(e.doc.slice(r,i))},range:Mn.cursor(s)}}));return!i.changes.empty&&(t(e.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Km}],Eg=[{key:"ArrowLeft",run:Ym,shift:ng,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>Um(e,!Im(e)),shift:e=>sg(e,!Im(e))},{mac:"Cmd-ArrowLeft",run:eg,shift:dg},{key:"ArrowRight",run:Zm,shift:rg,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>Um(e,Im(e)),shift:e=>sg(e,Im(e))},{mac:"Cmd-ArrowRight",run:Jm,shift:ug},{key:"ArrowUp",run:Gm,shift:ag,preventDefault:!0},{mac:"Cmd-ArrowUp",run:fg,shift:mg},{mac:"Ctrl-ArrowUp",run:Fm,shift:Og},{key:"ArrowDown",run:Lm,shift:lg,preventDefault:!0},{mac:"Cmd-ArrowDown",run:pg,shift:gg},{mac:"Ctrl-ArrowDown",run:Km,shift:hg},{key:"PageUp",run:Fm,shift:Og},{key:"PageDown",run:Km,shift:hg},{key:"Home",run:eg,shift:dg,preventDefault:!0},{key:"Mod-Home",run:fg,shift:mg},{key:"End",run:Jm,shift:ug,preventDefault:!0},{key:"Mod-End",run:pg,shift:gg},{key:"Enter",run:Sg},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:yg,shift:yg},{key:"Delete",run:Pg},{key:"Mod-Backspace",mac:"Alt-Backspace",run:kg},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>wg(e,!0)},{mac:"Mod-Backspace",run:e=>$g(e,(t=>{let i=e.lineBlockAt(t).from;return bg(e,t>i?i:Math.max(0,t-1),!1)}))},{mac:"Mod-Delete",run:_g}].concat(Cg.map((e=>({mac:e.key,run:e.run,shift:e.shift})))),qg=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>qm(e,(t=>Dm(e.state,t,!Im(e)))),shift:e=>tg(e,(t=>Dm(e.state,t,!Im(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>qm(e,(t=>Dm(e.state,t,Im(e)))),shift:e=>tg(e,(t=>Dm(e.state,t,Im(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>xg(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Xg(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>xg(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Xg(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let i=e.selection,n=null;return i.ranges.length>1?n=Mn.create([i.main]):i.main.empty||(n=Mn.create([Mn.cursor(i.main.head)])),!!n&&(t(Em(e,n)),!0)}},{key:"Mod-Enter",run:Rg},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let i=vg(e).map((({from:t,to:i})=>Mn.range(t,Math.min(i+1,e.doc.length))));return t(e.update({selection:Mn.create(i),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let i=Cm(e.selection,(t=>{var i;let n=ld(e).resolveInner(t.head,1);for(;!(n.from=t.to||n.to>t.to&&n.from<=t.from)&&(null===(i=n.parent)||void 0===i?void 0:i.parent);)n=n.parent;return Mn.range(n.to,n.from)}));return t(Em(e,i)),!0},preventDefault:!0},{key:"Mod-[",run:Ng},{key:"Mod-]",run:Ag},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=Object.create(null),n=new _d(e,{overrideIndentation:e=>{let t=i[e];return null==t?-1:t}}),r=Wg(e,((t,r,s)=>{let o=kd(n,t.from);if(null==o)return;/\S/.test(t.text)||(o=0);let a=/^\s*/.exec(t.text)[0],l=wd(e,o);(a!=l||s.from{if(e.state.readOnly)return!1;let{state:t}=e,i=t.changes(vg(t).map((({from:e,to:i})=>(e>0?e--:ie.moveVertically(t,!0))).map(i);return e.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,i){let n=!1,r=Cm(e.selection,(t=>{let r=df(e,t.head,-1)||df(e,t.head,1)||t.head>0&&df(e,t.head-1,1)||t.head{let t=hm(e.state);return t.line?lm(e):!!t.block&&Om(e)}},{key:"Alt-A",run:cm}].concat(Eg);function Vg(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var r=i[n];"string"==typeof r?e.setAttribute(n,r):null!=r&&(e[n]=r)}t++}for(;te.normalize("NFKD"):e=>e;class Yg{constructor(e,t,i=0,n=e.length,r){this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=r?e=>r(Ig(e)):Ig,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Sn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Rn(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Tn(e);let n=this.normalize(t);for(let e=0,r=i;;e++){let s=n.charCodeAt(e),o=this.match(s,r);if(o)return this.value=o,this;if(e==n.length-1)break;r==i&&ethis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=n+(i==n?1:0),i==this.curLine.length&&this.nextLine(),ithis.value.to)return this.value={from:i,to:n,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=i||n.to<=t){let n=new jg(t,e.sliceString(t,i));return Dg.set(e,n),n}if(n.from==t&&n.to==i)return n;let{text:r,from:s}=n;return s>t&&(r=e.sliceString(t,s)+r,s=t),n.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t&&this.flat.tothis.flat.text.length-10&&(t=null),t){let e=this.flat.from+t.index,i=e+t[0].length;return this.value={from:e,to:i,match:t},this.matchPos=i+(e==i?1:0),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=jg.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function Lg(e){let t=Vg("input",{class:"cm-textfield",name:"line"});function i(){let i=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!i)return;let{state:n}=e,r=n.doc.lineAt(n.selection.main.head),[,s,o,a,l]=i,c=a?+a.slice(1):0,O=o?+o:r.number;if(o&&l){let e=O/100;s&&(e=e*("-"==s?-1:1)+r.number/n.doc.lines),O=Math.round(n.doc.lines*e)}else o&&s&&(O=O*("-"==s?-1:1)+r.number);let h=n.doc.line(Math.max(1,Math.min(n.doc.lines,O)));e.dispatch({effects:Bg.of(!1),selection:Mn.cursor(h.from+Math.max(0,Math.min(c,h.length))),scrollIntoView:!0}),e.focus()}return{dom:Vg("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:Bg.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),i())},onsubmit:e=>{e.preventDefault(),i()}},Vg("label",e.state.phrase("Go to line"),": ",t)," ",Vg("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(Mg.prototype[Symbol.iterator]=Gg.prototype[Symbol.iterator]=function(){return this});const Bg=kr.define(),Fg=(tr.define({create:()=>!0,update(e,t){for(let i of t.effects)i.is(Bg)&&(e=i.value);return e},provide:e=>cu.from(e,(e=>e?Lg:null))}),Oh.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),{highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1}),Kg=Ln.define({combine:e=>qr(e,Fg,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function Hg(e){let t=[n$,i$];return e&&t.push(Kg.of(e)),t}const Jg=Il.mark({class:"cm-selectionMatch"}),e$=Il.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function t$(e,t,i,n){return!(0!=i&&e(t.sliceDoc(i-1,i))==Wr.Word||n!=t.doc.length&&e(t.sliceDoc(n,n+1))==Wr.Word)}const i$=Oc.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Kg),{state:i}=e,n=i.selection;if(n.ranges.length>1)return Il.none;let r,s=n.main,o=null;if(s.empty){if(!t.highlightWordAroundCursor)return Il.none;let e=i.wordAt(s.head);if(!e)return Il.none;o=i.charCategorizer(s.head),r=i.sliceDoc(e.from,e.to)}else{let e=s.to-s.from;if(e200)return Il.none;if(t.wholeWords){if(r=i.sliceDoc(s.from,s.to),o=i.charCategorizer(s.head),!t$(o,i,s.from,s.to)||!function(e,t,i,n){return e(t.sliceDoc(i,i+1))==Wr.Word&&e(t.sliceDoc(n-1,n))==Wr.Word}(o,i,s.from,s.to))return Il.none}else if(r=i.sliceDoc(s.from,s.to).trim(),!r)return Il.none}let a=[];for(let n of e.visibleRanges){let e=new Yg(i.doc,r,n.from,n.to);for(;!e.next().done;){let{from:n,to:r}=e.value;if((!o||t$(o,i,n,r))&&(s.empty&&n<=s.from&&r>=s.to?a.push(e$.range(n,r)):(n>=s.to||r<=s.from)&&a.push(Jg.range(n,r)),a.length>t.maxMatches))return Il.none}}return Il.set(a)}},{decorations:e=>e.decorations}),n$=Oh.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});const r$=Ln.define({combine(e){var t;return{top:e.reduce(((e,t)=>null!=e?e:t.top),void 0)||!1,caseSensitive:e.reduce(((e,t)=>null!=e?e:t.caseSensitive),void 0)||!1,createPanel:(null===(t=e.find((e=>e.createPanel)))||void 0===t?void 0:t.createPanel)||(e=>new X$(e))}}});class s${constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||function(e){try{return new RegExp(e,Ug),!0}catch(e){return!1}}(this.search)),this.unquoted=e.literal?this.search:this.search.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"))}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp}create(){return this.regexp?new O$(this):new l$(this)}getCursor(e,t=0,i=e.length){return this.regexp?c$(this,e,t,i):a$(this,e,t,i)}}class o${constructor(e){this.spec=e}}function a$(e,t,i,n){return new Yg(t,e.unquoted,i,n,e.caseSensitive?void 0:e=>e.toLowerCase())}class l$ extends o${constructor(e){super(e)}nextMatch(e,t,i){let n=a$(this.spec,e,i,e.length).nextOverlapping();return n.done&&(n=a$(this.spec,e,0,t).nextOverlapping()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=i;;){let i=Math.max(t,n-1e4-this.spec.unquoted.length),r=a$(this.spec,e,i,n),s=null;for(;!r.nextOverlapping().done;)s=r.value;if(s)return s;if(i==t)return null;n-=1e4}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace}matchAll(e,t){let i=a$(this.spec,e,0,e.length),n=[];for(;!i.next().done;){if(n.length>=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=a$(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function c$(e,t,i,n){return new Mg(t,e.search,e.caseSensitive?void 0:{ignoreCase:!0},i,n)}class O$ extends o${nextMatch(e,t,i){let n=c$(this.spec,e,i,e.length).next();return n.done&&(n=c$(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let r=Math.max(t,i-1e4*n),s=c$(this.spec,e,r,i),o=null;for(;!s.next().done;)o=s.value;if(o&&(r==t||o.from>r+10))return o;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.length)}getReplacement(e){return this.spec.replace.replace(/\$([$&\d+])/g,((t,i)=>"$"==i?"$":"&"==i?e.match[0]:"0"!=i&&+i=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=c$(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const h$=kr.define(),u$=kr.define(),d$=tr.define({create:e=>new f$(_$(e).create(),null),update(e,t){for(let i of t.effects)i.is(h$)?e=new f$(i.value.create(),e.panel):i.is(u$)&&(e=new f$(e.query,i.value?k$:null));return e},provide:e=>cu.from(e,(e=>e.panel))});class f${constructor(e,t){this.query=e,this.panel=t}}const p$=Il.mark({class:"cm-searchMatch"}),m$=Il.mark({class:"cm-searchMatch cm-searchMatch-selected"}),g$=Oc.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(d$))}update(e){let t=e.state.field(d$);(t!=e.startState.field(d$)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return Il.none;let{view:i}=this,n=new Ur;for(let t=0,r=i.visibleRanges,s=r.length;tr[t+1].from-500;)a=r[++t].to;e.highlight(i.state.doc,o,a,((e,t)=>{let r=i.state.selection.ranges.some((i=>i.from==e&&i.to==t));n.add(e,t,r?m$:p$)}))}return n.finish()}},{decorations:e=>e.decorations});function $$(e){return t=>{let i=t.state.field(d$,!1);return i&&i.query.spec.valid?e(t,i):v$(t)}}const b$=$$(((e,{query:t})=>{let{from:i,to:n}=e.state.selection.main,r=t.nextMatch(e.state.doc,i,n);return!(!r||r.from==i&&r.to==n||(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:T$(e,r),userEvent:"select.search"}),0))})),Q$=$$(((e,{query:t})=>{let{state:i}=e,{from:n,to:r}=i.selection.main,s=t.prevMatch(i.doc,n,r);return!!s&&(e.dispatch({selection:{anchor:s.from,head:s.to},scrollIntoView:!0,effects:T$(e,s),userEvent:"select.search"}),!0)})),y$=$$(((e,{query:t})=>{let i=t.matchAll(e.state.doc,1e3);return!(!i||!i.length||(e.dispatch({selection:Mn.create(i.map((e=>Mn.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),P$=$$(((e,{query:t})=>{let{state:i}=e,{from:n,to:r}=i.selection.main;if(i.readOnly)return!1;let s=t.nextMatch(i.doc,n,n);if(!s)return!1;let o,a,l=[];if(s.from==n&&s.to==r&&(a=i.toText(t.getReplacement(s)),l.push({from:s.from,to:s.to,insert:a}),s=t.nextMatch(i.doc,s.from,s.to)),s){let e=0==l.length||l[0].from>=s.to?0:s.to-s.from-a.length;o={anchor:s.from-e,head:s.to-e}}return e.dispatch({changes:l,selection:o,scrollIntoView:!!o,effects:s?T$(e,s):void 0,userEvent:"input.replace"}),!0})),w$=$$(((e,{query:t})=>{if(e.state.readOnly)return!1;let i=t.matchAll(e.state.doc,1e9).map((e=>{let{from:i,to:n}=e;return{from:i,to:n,insert:t.getReplacement(e)}}));return!!i.length&&(e.dispatch({changes:i,userEvent:"input.replace.all"}),!0)}));function k$(e){return e.state.facet(r$).createPanel(e)}function _$(e,t){var i;let n=e.selection.main,r=n.empty||n.to>n.from+100?"":e.sliceDoc(n.from,n.to),s=null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:e.facet(r$).caseSensitive;return t&&!r?t:new s$({search:r.replace(/\n/g,"\\n"),caseSensitive:s})}const v$=e=>{let t=e.state.field(d$,!1);if(t&&t.panel){let i=su(e,k$);if(!i)return!1;let n=i.dom.querySelector("[name=search]");if(n!=e.root.activeElement){let i=_$(e.state,t.query.spec);i.valid&&e.dispatch({effects:h$.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[u$.of(!0),t?h$.of(_$(e.state,t.query.spec)):kr.appendConfig.of(A$)]});return!0},x$=e=>{let t=e.state.field(d$,!1);if(!t||!t.panel)return!1;let i=su(e,k$);return i&&i.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:u$.of(!1)}),!0};class X${constructor(e){this.view=e;let t=this.query=e.state.field(d$).query.spec;function i(e,t,i){return Vg("button",{class:"cm-button",name:e,onclick:t,type:"button"},i)}this.commit=this.commit.bind(this),this.searchField=Vg("input",{value:t.search,placeholder:S$(e,"Find"),"aria-label":S$(e,"Find"),class:"cm-textfield",name:"search",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Vg("input",{value:t.replace,placeholder:S$(e,"Replace"),"aria-label":S$(e,"Replace"),class:"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit}),this.caseField=Vg("input",{type:"checkbox",name:"case",checked:t.caseSensitive,onchange:this.commit}),this.reField=Vg("input",{type:"checkbox",name:"re",checked:t.regexp,onchange:this.commit}),this.dom=Vg("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,i("next",(()=>b$(e)),[S$(e,"next")]),i("prev",(()=>Q$(e)),[S$(e,"previous")]),i("select",(()=>y$(e)),[S$(e,"all")]),Vg("label",null,[this.caseField,S$(e,"match case")]),Vg("label",null,[this.reField,S$(e,"regexp")]),...e.state.readOnly?[]:[Vg("br"),this.replaceField,i("replace",(()=>P$(e)),[S$(e,"replace")]),i("replaceAll",(()=>w$(e)),[S$(e,"replace all")]),Vg("button",{name:"close",onclick:()=>x$(e),"aria-label":S$(e,"close"),type:"button"},["×"])]])}commit(){let e=new s$({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:h$.of(e)}))}keydown(e){!function(e,t,i){return Ph(Qh(e.state),t,e,i)}(this.view,e,"search-panel")?13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Q$:b$)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),P$(this.view)):e.preventDefault()}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(h$)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(r$).top}}function S$(e,t){return e.state.phrase(t)}const R$=/[\s\.,:;?!]/;function T$(e,{from:t,to:i}){let n=e.state.doc.lineAt(t).from,r=e.state.doc.lineAt(i).to,s=Math.max(n,t-30),o=Math.min(r,i+30),a=e.state.sliceDoc(s,o);if(s!=n)for(let e=0;e<30;e++)if(!R$.test(a[e+1])&&R$.test(a[e])){a=a.slice(e);break}if(o!=r)for(let e=a.length-1;e>a.length-30;e--)if(!R$.test(a[e-1])&&R$.test(a[e])){a=a.slice(0,e);break}return Oh.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${e.state.doc.lineAt(t).number}`)}const W$=Oh.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),A$=[d$,ar.lowest(g$),W$];class N${constructor(e,t,i,n,r,s,o){this.type=e,this.value=t,this.from=i,this.hash=n,this.end=r,this.children=s,this.positions=o,this.hashProp=[[ss.contextHash,n]]}static create(e,t,i,n,r){return new N$(e,t,i,n+(n<<8)+e+(t<<4)|0,r,[],[])}addChild(e,t){e.prop(ss.contextHash)!=this.hash&&(e=new ds(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let i=this.children.length-1;return i>=0&&(t=Math.max(t,this.positions[i]+this.children[i].length+this.from)),new ds(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,i)=>new ds(ls.none,e,t,i,this.hashProp)})}}var C$;!function(e){e[e.Document=1]="Document",e[e.CodeBlock=2]="CodeBlock",e[e.FencedCode=3]="FencedCode",e[e.Blockquote=4]="Blockquote",e[e.HorizontalRule=5]="HorizontalRule",e[e.BulletList=6]="BulletList",e[e.OrderedList=7]="OrderedList",e[e.ListItem=8]="ListItem",e[e.ATXHeading1=9]="ATXHeading1",e[e.ATXHeading2=10]="ATXHeading2",e[e.ATXHeading3=11]="ATXHeading3",e[e.ATXHeading4=12]="ATXHeading4",e[e.ATXHeading5=13]="ATXHeading5",e[e.ATXHeading6=14]="ATXHeading6",e[e.SetextHeading1=15]="SetextHeading1",e[e.SetextHeading2=16]="SetextHeading2",e[e.HTMLBlock=17]="HTMLBlock",e[e.LinkReference=18]="LinkReference",e[e.Paragraph=19]="Paragraph",e[e.CommentBlock=20]="CommentBlock",e[e.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",e[e.Escape=22]="Escape",e[e.Entity=23]="Entity",e[e.HardBreak=24]="HardBreak",e[e.Emphasis=25]="Emphasis",e[e.StrongEmphasis=26]="StrongEmphasis",e[e.Link=27]="Link",e[e.Image=28]="Image",e[e.InlineCode=29]="InlineCode",e[e.HTMLTag=30]="HTMLTag",e[e.Comment=31]="Comment",e[e.ProcessingInstruction=32]="ProcessingInstruction",e[e.URL=33]="URL",e[e.HeaderMark=34]="HeaderMark",e[e.QuoteMark=35]="QuoteMark",e[e.ListMark=36]="ListMark",e[e.LinkMark=37]="LinkMark",e[e.EmphasisMark=38]="EmphasisMark",e[e.CodeMark=39]="CodeMark",e[e.CodeText=40]="CodeText",e[e.CodeInfo=41]="CodeInfo",e[e.LinkTitle=42]="LinkTitle",e[e.LinkLabel=43]="LinkLabel"}(C$||(C$={}));class E${constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class q${constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return Y$(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,i=0){for(let n=t;n=t.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;let n=(e.type==C$.OrderedList?L$:G$)(i,t,!1);return n>0&&(e.type!=C$.BulletList||D$(i,t,!1)<0)&&i.text.charCodeAt(i.pos+n-1)==e.value}const z$={[C$.Blockquote]:(e,t,i)=>62==i.next&&(i.markers.push(Pb(C$.QuoteMark,t.lineStart+i.pos,t.lineStart+i.pos+1)),i.moveBase(i.pos+(I$(i.text.charCodeAt(i.pos+1))?2:1)),e.end=t.lineStart+i.text.length,!0),[C$.ListItem]:(e,t,i)=>!(i.indent-1||(i.moveBaseColumn(i.baseIndent+e.value),0)),[C$.OrderedList]:V$,[C$.BulletList]:V$,[C$.Document]:()=>!0};function I$(e){return 32==e||9==e||10==e||13==e}function Y$(e,t=0){for(;ti&&I$(e.charCodeAt(t-1));)t--;return t}function U$(e){if(96!=e.next&&126!=e.next)return-1;let t=e.pos+1;for(;t-1&&e.depth==t.stack.length||n<3?-1:1}function j$(e,t){for(let i=e.stack.length-1;i>=0;i--)if(e.stack[i].type==t)return!0;return!1}function G$(e,t,i){return 45!=e.next&&43!=e.next&&42!=e.next||e.pos!=e.text.length-1&&!I$(e.text.charCodeAt(e.pos+1))||!(!i||j$(t,C$.BulletList)||e.skipSpace(e.pos+2)=48&&r<=57;){if(n++,n==e.text.length)return-1;r=e.text.charCodeAt(n)}return n==e.pos||n>e.pos+9||46!=r&&41!=r||ne.pos+1||49!=e.next)?-1:n+1-e.pos}function B$(e){if(35!=e.next)return-1;let t=e.pos+1;for(;t6?-1:i}function F$(e){if(45!=e.next&&61!=e.next||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t/,J$=/\?>/,eb=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(n);if(s)return e.append(Pb(C$.Comment,i,i+1+s[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return e.append(Pb(C$.ProcessingInstruction,i,i+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(n);return a?e.append(Pb(C$.HTMLTag,i,i+1+a[0].length)):-1},Emphasis(e,t,i){if(95!=t&&42!=t)return-1;let n=i+1;for(;e.char(n)==t;)n++;let r=e.slice(i-1,i),s=e.slice(n,n+1),o=Sb.test(r),a=Sb.test(s),l=/\s|^$/.test(r),c=/\s|^$/.test(s),O=!c&&(!a||l||o),h=!l&&(!o||c||a),u=O&&(42==t||!h||o),d=h&&(42==t||!O||a);return e.append(new xb(95==t?wb:kb,i,n,(u?1:0)|(d?2:0)))},HardBreak(e,t,i){if(92==t&&10==e.char(i+1))return e.append(Pb(C$.HardBreak,i,i+2));if(32==t){let t=i+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=i+2)return e.append(Pb(C$.HardBreak,i,t+1))}return-1},Link:(e,t,i)=>91==t?e.append(new xb(_b,i,i+1,1)):-1,Image:(e,t,i)=>33==t&&91==e.char(i+1)?e.append(new xb(vb,i,i+2,1)):-1,LinkEnd(e,t,i){if(93!=t)return-1;for(let t=e.parts.length-1;t>=0;t--){let n=e.parts[t];if(n instanceof xb&&(n.type==_b||n.type==vb)){if(!n.side||e.skipSpace(n.to)==i&&!/[(\[]/.test(e.slice(i+1,i+2)))return e.parts[t]=null,-1;let r=e.takeContent(t),s=e.parts[t]=Tb(e,r,n.type==_b?C$.Link:C$.Image,n.from,i+1);if(n.type==_b)for(let i=0;it?Pb(C$.URL,t+i,r+i):r==e.length&&null}}function Ab(e,t,i){let n=e.charCodeAt(t);if(39!=n&&34!=n&&40!=n)return!1;let r=40==n?41:n;for(let n=t+1,s=!1;n=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,i,n,r){return this.append(new xb(e,t,i,(n?1:0)|(r?2:0)))}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t=e;o--){let e=this.parts[o];if(e instanceof xb&&1&e.side&&e.type==i.type&&!(r&&(1&i.side||2&e.side)&&(e.to-e.from+s)%3==0&&((e.to-e.from)%3||s%3))){n=e;break}}if(!n)continue;let a=i.type.resolve,l=[],c=n.from,O=i.to;if(r){let e=Math.min(2,n.to-n.from,s);c=n.to-e,O=i.from+e,a=1==e?"Emphasis":"StrongEmphasis"}n.type.mark&&l.push(this.elt(n.type.mark,c,n.to));for(let e=o+1;e=0;t--){let i=this.parts[t];if(i instanceof xb&&i.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}skipSpace(e){return Y$(this.text,e-this.offset)+this.offset}elt(e,t,i,n){return"string"==typeof e?Pb(this.parser.getNodeType(e),t,i,n):new yb(e,t)}}function Eb(e,t){if(!t.length)return e;if(!e.length)return t;let i=e.slice(),n=0;for(let e of t){for(;n(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&"\n"!=this.input.read(e-1,e);)e--;this.fragmentEnd=e?e-1:0}let i=this.cursor;i||(i=this.cursor=this.fragment.tree.cursor(),i.firstChild());let n=e+this.fragment.offset;for(;i.to<=n;)if(!i.parent())return!1;for(;;){if(i.from>=n)return this.fragment.from<=t;if(!i.childAfter(n))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(ss.contextHash)==e}takeNodes(e){let t=this.cursor,i=this.fragment.offset,n=this.fragmentEnd-(this.fragment.openEnd?1:0),r=e.absoluteLineStart,s=r,o=e.block.children.length,a=s,l=o;for(;;){if(t.to-i>n){if(t.type.isAnonymous&&t.firstChild())continue;break}if(e.dontInject.add(t.tree),e.addNode(t.tree,t.from-i),t.type.is("Block")&&(qb.indexOf(t.type.id)<0?(s=t.to-i,o=e.block.children.length):(s=a,o=l,a=t.to-i,l=e.block.children.length)),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return s-r}}const zb=Au({"Blockquote/...":td.quote,HorizontalRule:td.contentSeparator,"ATXHeading1/... SetextHeading1/...":td.heading1,"ATXHeading2/... SetextHeading2/...":td.heading2,"ATXHeading3/...":td.heading3,"ATXHeading4/...":td.heading4,"ATXHeading5/...":td.heading5,"ATXHeading6/...":td.heading6,"Comment CommentBlock":td.comment,Escape:td.escape,Entity:td.character,"Emphasis/...":td.emphasis,"StrongEmphasis/...":td.strong,"Link/... Image/...":td.link,"OrderedList/... BulletList/...":td.list,"BlockQuote/...":td.quote,"InlineCode CodeText":td.monospace,URL:td.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":td.processingInstruction,"CodeInfo LinkLabel":td.labelName,LinkTitle:td.string,Paragraph:td.content}),Ib=new db(new cs(gb).extend(zb),Object.keys(rb).map((e=>rb[e])),Object.keys(rb).map((e=>lb[e])),Object.keys(rb),cb,z$,Object.keys(Rb).map((e=>Rb[e])),Object.keys(Rb),[]);function Yb(e,t,i){let n=[];for(let r=e.firstChild,s=t;;r=r.nextSibling){let e=r?r.from:i;if(e>s&&n.push({from:s,to:e}),!r)break;s=r.to}return n}function Zb(e){let{codeParser:t,htmlParser:i}=e,n=Ws(((e,n)=>{let r=e.type.id;if(!t||r!=C$.CodeBlock&&r!=C$.FencedCode){if(i&&(r==C$.HTMLBlock||r==C$.HTMLTag))return{parser:i,overlay:Yb(e.node,e.from,e.to)}}else{let i="";if(r==C$.FencedCode){let t=e.node.getChild(C$.CodeInfo);t&&(i=n.read(t.from,t.to))}let s=t(i);if(s)return{parser:s,overlay:e=>e.type.id==C$.CodeText}}return null}));return{wrap:n}}const Ub={resolve:"Strikethrough",mark:"StrikethroughMark"},Mb={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":td.strikethrough}},{name:"StrikethroughMark",style:td.processingInstruction}],parseInline:[{name:"Strikethrough",parse:(e,t,i)=>126!=t||126!=e.char(i+1)?-1:e.addDelimiter(Ub,i,i+2,!0,!0),after:"Emphasis"}]};function Db(e,t,i=0,n,r=0){let s=0,o=!0,a=-1,l=-1,c=!1,O=()=>{n.push(e.elt("TableCell",r+a,r+l,e.parser.parseInline(t.slice(a,l),r+a)))};for(let h=i;h-1)&&s++,o=!1,n&&(a>-1&&O(),n.push(e.elt("TableDelimiter",h+r,h+r+1))),a=l=-1),c=!c&&92==i}return a>-1&&(s++,n&&O()),s}function jb(e,t){for(let i=t;ijb(t.content,0)?new Lb:null,endLeaf(e,t,i){if(i.parsers.some((e=>e instanceof Lb))||!jb(t.text,t.basePos))return!1;let n=e.scanLine(e.absoluteLineEnd+1).text;return Gb.test(n)&&Db(e,t.text,t.basePos)==Db(e,n,t.basePos)},before:"SetextHeading"}]};class Fb{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const Kb={defineNodes:[{name:"Task",block:!0,style:td.list},{name:"TaskMarker",style:td.atom}],parseBlock:[{name:"TaskList",leaf:(e,t)=>/^\[[ xX]\]/.test(t.content)&&"ListItem"==e.parentType().name?new Fb:null,after:"SetextHeading"}]},Hb=[Bb,Kb,Mb];function Jb(e,t,i){return(n,r,s)=>{if(r!=e||n.char(s+1)==e)return-1;let o=[n.elt(i,s,s+1)];for(let r=s+1;rt%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new nQ(e,[],t,i,i,0,[],0,n?new rQ(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,i=65535&e,{parser:n}=this.p,r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==t)return this.pushState(n.getGoto(this.state,i,!0),this.reducePos),is;)this.stack.pop();this.reduceContext(i,o)}storeNode(e,t,i,n=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i){let n=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:s}=this.p;(i>this.pos||t<=s.maxNode)&&(this.pos=i,s.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,n),this.shiftContext(t,n),t<=s.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,i){65536&e?this.reduce(e):this.shift(e,t,i)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new nQ(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new oQ(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let e=0;e>19,n=65535&e,r=this.stack.length-3*i;if(r<0||t.getGoto(this.stack[r],n,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class rQ{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}var sQ;!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(sQ||(sQ={}));class oQ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class aQ{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new aQ(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new aQ(this.stack,this.pos,this.index)}}class lQ{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const cQ=new lQ;class OQ{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=cQ,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=cQ,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class hQ{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,i,n){let r=0,s=1<0){let i=e[n];if(a.allows(i)&&(-1==t.token.value||t.token.value==i||o.overrides(i,t.token.value))){t.acceptToken(i);break}}for(let n=t.next,s=0,o=e[r+2];s>1,l=i+a+(a<<1),c=e[l],O=e[l+1];if(n=O)){r=e[l+2],t.advance();continue e}s=a+1}}break}}(this.data,e,t,this.id)}}hQ.prototype.contextual=hQ.prototype.fallback=hQ.prototype.extend=!1;class uQ{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function dQ(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),s+=r,i)break;s*=46}i?i[r++]=s:i=new t(s)}return i}const fQ=void 0!==hn&&hn.env&&/\bparse\b/.test(void 0);let pQ=null;var mQ,gQ;function $Q(e,t,i){let n=e.cursor(us.IncludeAnonymous);for(n.moveTo(t);;)if(!(i<0?n.childBefore(t):n.childAfter(t)))for(;;){if((i<0?n.tot)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(mQ||(mQ={}));class bQ{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?$Q(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?$Q(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof ds){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class QQ{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new lQ))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,s=n.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let n=0;nc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(i=c,t>n))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),i||e.pos!=this.stream.end||(i=new lQ,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new lQ,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){if(t.token(this.stream.reset(i.pos,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=Math.min(i.p.stream.end,i.pos+1)}putAction(e,t,i,n){for(let t=0;t4*e.bufferLength?new bQ(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];for(let s=0;sn)r.push(o);else{if(this.advanceStack(o,r,i))continue;{e||(e=[],t=[]),e.push(o);let i=this.tokens.getMainToken(o);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1)e:for(let e=0;e500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}this.minStackPos=r[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(n);o;){let n=this.parser.nodeSet.types[o.type.id]==o.type?r.getGoto(e.state,o.type.id):-1;if(n>-1&&o.length&&(!t||(o.prop(ss.contextHash)||0)==i))return e.useNode(o,n),fQ&&console.log(s+this.stackID(e)+` (via reuse of ${r.getName(o.type.id)})`),!0;if(!(o instanceof ds)||0==o.children.length||o.positions[0]>0)break;let a=o.children[0];if(!(a instanceof ds&&0==o.positions[0]))break;o=a}}let o=r.stateSlot(e.state,4);if(o>0)return e.reduce(o),fQ&&console.log(s+this.stackID(e)+` (via always-reduce ${r.getName(65535&o)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let o=0;on?t.push(u):i.push(u)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return PQ(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let s=0;s ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),fQ&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let O=o.split(),h=c;for(let e=0;O.forceReduce()&&e<10&&(fQ&&console.log(h+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));e++)fQ&&(h=this.stackID(O)+" -> ");for(let e of o.recoverByInsert(a))fQ&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),fQ&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),PQ(o,i)):(!n||n.scoree;class _Q extends Rs{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let i=0;ie.topRules[t][1])),n=[];for(let e=0;e=0)r(n,e,t[i++]);else{let s=t[i+-n];for(let o=-n;o>0;o--)r(t[i++],e,s);i++}}}this.nodeSet=new cs(t.map(((t,r)=>ls.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:n[r],top:i.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=is;let s=dQ(e.tokenData);if(this.context=e.context,this.specialized=new Uint16Array(e.specialized?e.specialized.length:0),this.specializers=[],e.specialized)for(let t=0;t"number"==typeof e?new hQ(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new yQ(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],s=1&t,o=n[r++];if(s&&i)return o;for(let i=r+(t>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])return!1;i=vQ(this.data,i+2)}if(t==vQ(this.data,i+1))return!0}}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=vQ(this.data,i+2)}if(0==(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}overrides(e,t){let i=xQ(this.data,this.tokenPrecTable,t);return i<0||xQ(this.data,this.tokenPrecTable,e){let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let n of e.split(" ")){let e=t.indexOf(n);e>=0&&(i[e]=!0)}let n=null;for(let e=0;e=65&&e<=90||95==e||e>=97&&e<=122||e>=161}function WQ(e){return 9==e||10==e||13==e||32==e}let AQ=null,NQ=null,CQ=0;function EQ(e,t){let i=e.pos+t;if(CQ==i&&NQ==e)return AQ;let n=e.peek(t);for(;WQ(n);)n=e.peek(++t);let r="";for(;TQ(n);)r+=String.fromCharCode(n),n=e.peek(++t);return NQ=e,CQ=i,AQ=r?r.toLowerCase():n==qQ||n==VQ?void 0:null}const qQ=63,VQ=33;function zQ(e,t){this.name=e,this.parent=t,this.hash=t?t.hash:0;for(let t=0;t0),this.strict=!1!==e.strict}}({start:null,shift:(e,t,i,n)=>IQ.indexOf(t)>-1?new zQ(EQ(n,1)||"",e):e,reduce:(e,t)=>18==t&&e?e.parent:e,reuse(e,t,i,n){let r=t.type.id;return 4==r||35==r?new zQ(EQ(n,1)||"",e):e},hash:e=>e?e.hash:0,strict:!1}),ZQ=new uQ(((e,t)=>{if(60!=e.next)return void(e.next<0&&t.context&&e.acceptToken(56));e.advance();let i=47==e.next;i&&e.advance();let n=EQ(e,0);if(void 0===n)return;if(!n)return e.acceptToken(i?12:4);let r=t.context?t.context.name:null;if(i){if(n==r)return e.acceptToken(9);if(r&&SQ[r])return e.acceptToken(56,-2);if(t.dialectEnabled(0))return e.acceptToken(10);for(let e=t.context;e;e=e.parent)if(e.name==n)return;e.acceptToken(11)}else{if("script"==n)return e.acceptToken(5);if("style"==n)return e.acceptToken(6);if("textarea"==n)return e.acceptToken(7);if(XQ.hasOwnProperty(n))return e.acceptToken(8);r&&RQ[r]&&RQ[r][n]?e.acceptToken(56,-1):e.acceptToken(4)}}),{contextual:!0}),UQ=new uQ((e=>{for(let t=0,i=0;;i++){if(e.next<0){i&&e.acceptToken(57);break}if(45==e.next)t++;else{if(62==e.next&&t>=2){i>3&&e.acceptToken(57,-2);break}t=0}e.advance()}}));function MQ(e,t,i){let n=2+e.length;return new uQ((r=>{for(let s=0,o=0,a=0;;a++){if(r.next<0){a&&r.acceptToken(t);break}if(0==s&&60==r.next||1==s&&47==r.next||s>=2&&so?r.acceptToken(t,-o):r.acceptToken(i,-(o-2));break}if((10==r.next||13==r.next)&&a){r.acceptToken(t,1);break}s=o=0}else o++;r.advance()}}))}const DQ=MQ("script",53,1),jQ=MQ("style",54,2),GQ=MQ("textarea",55,3),LQ=Au({"Text RawText":td.content,"StartTag StartCloseTag SelfCloserEndTag EndTag SelfCloseEndTag":td.angleBracket,TagName:td.tagName,"MismatchedCloseTag/TagName":[td.tagName,td.invalid],AttributeName:td.attributeName,"AttributeValue UnquotedAttributeValue":td.attributeValue,Is:td.definitionOperator,"EntityReference CharacterReference":td.character,Comment:td.blockComment,ProcessingInst:td.processingInstruction,DoctypeDecl:td.documentMeta}),BQ=_Q.deserialize({version:14,states:",xOVOxOOO!WQ!bO'#CoO!]Q!bO'#CyO!bQ!bO'#C|O!gQ!bO'#DPO!lQ!bO'#DRO!qOXO'#CnO!|OYO'#CnO#XO[O'#CnO$eOxO'#CnOOOW'#Cn'#CnO$lO!rO'#DSO$tQ!bO'#DUO$yQ!bO'#DVOOOW'#Dj'#DjOOOW'#DX'#DXQVOxOOO%OQ#tO,59ZO%WQ#tO,59eO%`Q#tO,59hO%hQ#tO,59kO%pQ#tO,59mOOOX'#D]'#D]O%xOXO'#CwO&TOXO,59YOOOY'#D^'#D^O&]OYO'#CzO&hOYO,59YOOO['#D_'#D_O&pO[O'#C}O&{O[O,59YOOOW'#D`'#D`O'TOxO,59YO'[Q!bO'#DQOOOW,59Y,59YOOO`'#Da'#DaO'aO!rO,59nOOOW,59n,59nO'iQ!bO,59pO'nQ!bO,59qOOOW-E7V-E7VO'sQ#tO'#CqOOQO'#DY'#DYO(OQ#tO1G.uOOOX1G.u1G.uO(WQ#tO1G/POOOY1G/P1G/PO(`Q#tO1G/SOOO[1G/S1G/SO(hQ#tO1G/VOOOW1G/V1G/VO(pQ#tO1G/XOOOW1G/X1G/XOOOX-E7Z-E7ZO(xQ!bO'#CxOOOW1G.t1G.tOOOY-E7[-E7[O(}Q!bO'#C{OOO[-E7]-E7]O)SQ!bO'#DOOOOW-E7^-E7^O)XQ!bO,59lOOO`-E7_-E7_OOOW1G/Y1G/YOOOW1G/[1G/[OOOW1G/]1G/]O)^Q&jO,59]OOQO-E7W-E7WOOOX7+$a7+$aOOOY7+$k7+$kOOO[7+$n7+$nOOOW7+$q7+$qOOOW7+$s7+$sO)iQ!bO,59dO)nQ!bO,59gO)sQ!bO,59j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^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue EndTag ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:66,context:YQ,nodeProps:[["closedBy",-11,1,2,3,4,5,6,7,8,9,10,11,"EndTag",-4,19,29,32,35,"CloseTag"],["group",-9,12,15,16,17,18,38,39,40,41,"Entity",14,"Entity TextContent",-3,27,30,33,"TextContent Entity"],["openedBy",26,"StartTag StartCloseTag",-4,28,31,34,36,"OpenTag"]],propSources:[LQ],skippedNodes:[0],repeatNodeCount:9,tokenData:"!#b!aR!WOX$kXY)sYZ)sZ]$k]^)s^p$kpq)sqr$krs*zsv$kvw+dwx2yx}$k}!O3f!O!P$k!P!Q7_!Q![$k![!]8u!]!^$k!^!_>b!_!`!!p!`!a8T!a!c$k!c!}8u!}#R$k#R#S8u#S#T$k#T#o8u#o$f$k$f$g&R$g%W$k%W%o8u%o%p$k%p&a8u&a&b$k&b1p8u1p4U$k4U4d8u4d4e$k4e$IS8u$IS$I`$k$I`$Ib8u$Ib$Kh$k$Kh%#t8u%#t&/x$k&/x&Et8u&Et&FV$k&FV;'S8u;'S;:jiW!``!bpOq(kqr?Rrs'gsv(kwx(]x!a(k!a!bKj!b~(k!R?YZ!``!bpOr(krs'gsv(kwx(]x}(k}!O?{!O!f(k!f!gAR!g#W(k#W#XGz#X~(k!R@SV!``!bpOr(krs'gsv(kwx(]x}(k}!O@i!O~(k!R@rT!``!bp!cPOr(krs'gsv(kwx(]x~(k!RAYV!``!bpOr(krs'gsv(kwx(]x!q(k!q!rAo!r~(k!RAvV!``!bpOr(krs'gsv(kwx(]x!e(k!e!fB]!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&R",tokenizers:[DQ,jQ,GQ,ZQ,UQ,0,1,2,3,4,5],topRules:{Document:[0,13]},dialects:{noMatch:0},tokenPrec:464});function FQ(e,t){let i=Object.create(null);for(let n of e.firstChild.getChildren("Attribute")){let e=n.getChild("AttributeName"),r=n.getChild("AttributeValue")||n.getChild("UnquotedAttributeValue");e&&(i[t.read(e.from,e.to)]=r?"AttributeValue"==r.name?t.read(r.from+1,r.to-1):t.read(r.from,r.to):"")}return i}function KQ(e,t,i){let n;for(let r of i)if(!r.attrs||r.attrs(n||(n=FQ(e.node.parent,t))))return{parser:r.parser};return null}class HQ{constructor(e,t,i,n,r,s,o,a,l,c=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new HQ(e,[],t,i,i,0,[],0,n?new JQ(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,i=65535&e,{parser:n}=this.p,r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==t)return this.pushState(n.getGoto(this.state,i,!0),this.reducePos),is;)this.stack.pop();this.reduceContext(i,o)}storeNode(e,t,i,n=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i){let n=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:s}=this.p;(i>this.pos||t<=s.maxNode)&&(this.pos=i,s.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,n),this.shiftContext(t,n),t<=s.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,i){65536&e?this.reduce(e):this.shift(e,t,i)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new HQ(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new ty(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let e=0;e>19,n=65535&e,r=this.stack.length-3*i;if(r<0||t.getGoto(this.stack[r],n,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class JQ{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}var ey;!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(ey||(ey={}));class ty{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class iy{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new iy(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new iy(this.stack,this.pos,this.index)}}class ny{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const ry=new ny;class sy{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=ry,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=ry,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class oy{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,i,n){let r=0,s=1<0){let i=e[n];if(a.allows(i)&&(-1==t.token.value||t.token.value==i||o.overrides(i,t.token.value))){t.acceptToken(i);break}}for(let n=t.next,s=0,o=e[r+2];s>1,l=i+a+(a<<1),c=e[l],O=e[l+1];if(n=O)){r=e[l+2],t.advance();continue e}s=a+1}}break}}(this.data,e,t,this.id)}}oy.prototype.contextual=oy.prototype.fallback=oy.prototype.extend=!1;class ay{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function ly(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),s+=r,i)break;s*=46}i?i[r++]=s:i=new t(s)}return i}const cy=void 0!==hn&&hn.env&&/\bparse\b/.test(void 0);let Oy=null;var hy,uy;function dy(e,t,i){let n=e.cursor(us.IncludeAnonymous);for(n.moveTo(t);;)if(!(i<0?n.childBefore(t):n.childAfter(t)))for(;;){if((i<0?n.tot)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(hy||(hy={}));class fy{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?dy(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?dy(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof ds){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class py{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new ny))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,s=n.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let n=0;nc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(i=c,t>n))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),i||e.pos!=this.stream.end||(i=new ny,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new ny,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){if(t.token(this.stream.reset(i.pos,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=Math.min(i.p.stream.end,i.pos+1)}putAction(e,t,i,n){for(let t=0;t4*e.bufferLength?new fy(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];for(let s=0;sn)r.push(o);else{if(this.advanceStack(o,r,i))continue;{e||(e=[],t=[]),e.push(o);let i=this.tokens.getMainToken(o);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1)e:for(let e=0;e500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}this.minStackPos=r[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(n);o;){let n=this.parser.nodeSet.types[o.type.id]==o.type?r.getGoto(e.state,o.type.id):-1;if(n>-1&&o.length&&(!t||(o.prop(ss.contextHash)||0)==i))return e.useNode(o,n),cy&&console.log(s+this.stackID(e)+` (via reuse of ${r.getName(o.type.id)})`),!0;if(!(o instanceof ds)||0==o.children.length||o.positions[0]>0)break;let a=o.children[0];if(!(a instanceof ds&&0==o.positions[0]))break;o=a}}let o=r.stateSlot(e.state,4);if(o>0)return e.reduce(o),cy&&console.log(s+this.stackID(e)+` (via always-reduce ${r.getName(65535&o)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let o=0;on?t.push(u):i.push(u)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return gy(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let s=0;s ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),cy&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let O=o.split(),h=c;for(let e=0;O.forceReduce()&&e<10&&(cy&&console.log(h+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));e++)cy&&(h=this.stackID(O)+" -> ");for(let e of o.recoverByInsert(a))cy&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),cy&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),gy(o,i)):(!n||n.scoree.topRules[t][1])),n=[];for(let e=0;e=0)r(n,e,t[i++]);else{let s=t[i+-n];for(let o=-n;o>0;o--)r(t[i++],e,s);i++}}}this.nodeSet=new cs(t.map(((t,r)=>ls.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:n[r],top:i.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=is;let s=ly(e.tokenData);if(this.context=e.context,this.specialized=new Uint16Array(e.specialized?e.specialized.length:0),this.specializers=[],e.specialized)for(let t=0;t"number"==typeof e?new oy(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new my(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],s=1&t,o=n[r++];if(s&&i)return o;for(let i=r+(t>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])return!1;i=Qy(this.data,i+2)}if(t==Qy(this.data,i+1))return!0}}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=Qy(this.data,i+2)}if(0==(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}overrides(e,t){let i=yy(this.data,this.tokenPrecTable,t);return i<0||yy(this.data,this.tokenPrecTable,e){let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let n of e.split(" ")){let e=t.indexOf(n);e>=0&&(i[e]=!0)}let n=null;for(let e=0;e=65&&e<=90||e>=97&&e<=122||e>=161}function ky(e){return e>=48&&e<=57}const _y=new ay(((e,t)=>{for(let i=!1,n=0,r=0;;r++){let{next:s}=e;if(!(wy(s)||45==s||95==s||i&&ky(s))){i&&e.acceptToken(40==s?94:2==n&&t.canShift(2)?2:95);break}!i&&(45!=s||r>0)&&(i=!0),n===r&&45==s&&n++,e.advance()}})),vy=new ay((e=>{if(Py.includes(e.peek(-1))){let{next:t}=e;(wy(t)||95==t||35==t||46==t||91==t||58==t||45==t)&&e.acceptToken(93)}})),xy=new ay((e=>{if(!Py.includes(e.peek(-1))){let{next:t}=e;if(37==t&&(e.advance(),e.acceptToken(1)),wy(t)){do{e.advance()}while(wy(e.next));e.acceptToken(1)}}})),Xy=Au({"import charset namespace keyframes":td.definitionKeyword,"media supports":td.controlKeyword,"from to selector":td.keyword,NamespaceName:td.namespace,KeyframeName:td.labelName,TagName:td.tagName,ClassName:td.className,PseudoClassName:td.constant(td.className),IdName:td.labelName,"FeatureName PropertyName":td.propertyName,AttributeName:td.attributeName,NumberLiteral:td.number,KeywordQuery:td.keyword,UnaryQueryOp:td.operatorKeyword,"CallTag ValueName":td.atom,VariableName:td.variableName,Callee:td.operatorKeyword,Unit:td.unit,"UniversalSelector NestingSelector":td.definitionOperator,AtKeyword:td.keyword,MatchOp:td.compareOperator,"ChildOp SiblingOp, LogicOp":td.logicOperator,BinOp:td.arithmeticOperator,Important:td.modifier,Comment:td.blockComment,ParenthesizedContent:td.special(td.name),ColorLiteral:td.color,StringLiteral:td.string,":":td.punctuation,"PseudoOp #":td.derefOperator,"; ,":td.separator,"( )":td.paren,"[ ]":td.squareBracket,"{ }":td.brace}),Sy={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,dir:32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},Ry={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},Ty={__proto__:null,not:128,only:128,from:158,to:160},Wy=by.deserialize({version:14,states:"7WOYQ[OOOOQP'#Cd'#CdOOQP'#Cc'#CcO!ZQ[O'#CfO!}QXO'#CaO#UQ[O'#ChO#aQ[O'#DPO#fQ[O'#DTOOQP'#Ec'#EcO#kQdO'#DeO$VQ[O'#DrO#kQdO'#DtO$hQ[O'#DvO$sQ[O'#DyO$xQ[O'#EPO%WQ[O'#EROOQS'#Eb'#EbOOQS'#ES'#ESQYQ[OOOOQP'#Cg'#CgOOQP,59Q,59QO!ZQ[O,59QO%_Q[O'#EVO%yQWO,58{O&RQ[O,59SO#aQ[O,59kO#fQ[O,59oO%_Q[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Oy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q_8}S#WPOy%Qz!Q%Q!Q![5Z![~%Q~9`RjSOy%Qz{9i{~%Q~9nSoWOy9iyz9zz{:o{~9i~9}ROz9zz{:W{~9z~:ZTOz9zz{:W{!P9z!P!Q:j!Q~9z~:oOR~~:tUoWOy9iyz9zz{:o{!P9i!P!Q;W!Q~9i~;_QoWR~Oy%Qz~%Q^;jY#ZUOy%Qz!O%Q!O!P5Z!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%QX<_S]POy%Qz![%Q![!]RUOy%Qz!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX>lY!YPoWOy%Qz}%Q}!O>e!O!Q%Q!Q![>e![!c%Q!c!}>e!}#T%Q#T#o>e#o~%QX?aQxPOy%Qz~%Q^?lQvUOy%Qz~%QX?uSOy%Qz#b%Q#b#c@R#c~%QX@WSoWOy%Qz#W%Q#W#X@d#X~%QX@kQ!`PoWOy%Qz~%QX@tSOy%Qz#f%Q#f#g@d#g~%QXAVQ!RPOy%Qz~%Q_AbQ!QVOy%Qz~%QZAmS!PPOy%Qz!_%Q!_!`2e!`~%Q",tokenizers:[vy,xy,_y,0,1,2,3],topRules:{StyleSheet:[0,4]},specialized:[{term:94,get:e=>Sy[e]||-1},{term:56,get:e=>Ry[e]||-1},{term:95,get:e=>Ty[e]||-1}],tokenPrec:1078});let Ay=null;function Ny(){if(!Ay&&"object"==typeof document&&document.body){let e=[];for(let t in document.body.style)/[A-Z]|^-|^(item|length)$/.test(t)||e.push(t);Ay=e.sort().map((e=>({type:"property",label:e})))}return Ay||[]}const Cy=["active","after","before","checked","default","disabled","empty","enabled","first-child","first-letter","first-line","first-of-type","focus","hover","in-range","indeterminate","invalid","lang","last-child","last-of-type","link","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-of-type","only-child","optional","out-of-range","placeholder","read-only","read-write","required","root","selection","target","valid","visited"].map((e=>({type:"class",label:e}))),Ey=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((e=>({type:"keyword",label:e}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((e=>({type:"constant",label:e})))),qy=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((e=>({type:"type",label:e}))),Vy=/^[\w-]*/,zy=e=>{let{state:t,pos:i}=e,n=ld(t).resolveInner(i,-1);if("PropertyName"==n.name)return{from:n.from,options:Ny(),validFor:Vy};if("ValueName"==n.name)return{from:n.from,options:Ey,validFor:Vy};if("PseudoClassName"==n.name)return{from:n.from,options:Cy,validFor:Vy};if("TagName"==n.name){for(let{parent:e}=n;e;e=e.parent)if("Block"==e.name)return{from:n.from,options:Ny(),validFor:Vy};return{from:n.from,options:qy,validFor:Vy}}if(!e.explicit)return null;let r=n.resolve(i),s=r.childBefore(i);return s&&":"==s.name&&"PseudoClassSelector"==r.name?{from:i,options:Cy,validFor:Vy}:s&&":"==s.name&&"Declaration"==r.name||"ArgList"==r.name?{from:i,options:Ey,validFor:Vy}:"Block"==r.name?{from:i,options:Ny(),validFor:Vy}:null},Iy=ad.define({parser:Wy.configure({props:[vd.add({Declaration:Nd()}),Ed.add({Block:qd})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});class Yy{constructor(e,t,i,n,r,s,o,a,l,c=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new Yy(e,[],t,i,i,0,[],0,n?new Zy(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,i=65535&e,{parser:n}=this.p,r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==t)return this.pushState(n.getGoto(this.state,i,!0),this.reducePos),is;)this.stack.pop();this.reduceContext(i,o)}storeNode(e,t,i,n=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i){let n=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:s}=this.p;(i>this.pos||t<=s.maxNode)&&(this.pos=i,s.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,n),this.shiftContext(t,n),t<=s.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,i){65536&e?this.reduce(e):this.shift(e,t,i)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new Yy(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new My(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let e=0;e>19,n=65535&e,r=this.stack.length-3*i;if(r<0||t.getGoto(this.stack[r],n,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Zy{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}var Uy;!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(Uy||(Uy={}));class My{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class Dy{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new Dy(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new Dy(this.stack,this.pos,this.index)}}class jy{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Gy=new jy;class Ly{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Gy,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Gy,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class By{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,i,n){let r=0,s=1<0){let i=e[n];if(a.allows(i)&&(-1==t.token.value||t.token.value==i||o.overrides(i,t.token.value))){t.acceptToken(i);break}}for(let n=t.next,s=0,o=e[r+2];s>1,l=i+a+(a<<1),c=e[l],O=e[l+1];if(n=O)){r=e[l+2],t.advance();continue e}s=a+1}}break}}(this.data,e,t,this.id)}}By.prototype.contextual=By.prototype.fallback=By.prototype.extend=!1;class Fy{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ky(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),s+=r,i)break;s*=46}i?i[r++]=s:i=new t(s)}return i}const Hy=void 0!==hn&&hn.env&&/\bparse\b/.test(void 0);let Jy=null;var eP,tP;function iP(e,t,i){let n=e.cursor(us.IncludeAnonymous);for(n.moveTo(t);;)if(!(i<0?n.childBefore(t):n.childAfter(t)))for(;;){if((i<0?n.tot)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(eP||(eP={}));class nP{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?iP(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?iP(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof ds){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class rP{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new jy))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,s=n.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let n=0;nc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(i=c,t>n))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),i||e.pos!=this.stream.end||(i=new jy,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new jy,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){if(t.token(this.stream.reset(i.pos,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=Math.min(i.p.stream.end,i.pos+1)}putAction(e,t,i,n){for(let t=0;t4*e.bufferLength?new nP(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];for(let s=0;sn)r.push(o);else{if(this.advanceStack(o,r,i))continue;{e||(e=[],t=[]),e.push(o);let i=this.tokens.getMainToken(o);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1)e:for(let e=0;e500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}this.minStackPos=r[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(n);o;){let n=this.parser.nodeSet.types[o.type.id]==o.type?r.getGoto(e.state,o.type.id):-1;if(n>-1&&o.length&&(!t||(o.prop(ss.contextHash)||0)==i))return e.useNode(o,n),Hy&&console.log(s+this.stackID(e)+` (via reuse of ${r.getName(o.type.id)})`),!0;if(!(o instanceof ds)||0==o.children.length||o.positions[0]>0)break;let a=o.children[0];if(!(a instanceof ds&&0==o.positions[0]))break;o=a}}let o=r.stateSlot(e.state,4);if(o>0)return e.reduce(o),Hy&&console.log(s+this.stackID(e)+` (via always-reduce ${r.getName(65535&o)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let o=0;on?t.push(u):i.push(u)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return oP(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let s=0;s ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),Hy&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let O=o.split(),h=c;for(let e=0;O.forceReduce()&&e<10&&(Hy&&console.log(h+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));e++)Hy&&(h=this.stackID(O)+" -> ");for(let e of o.recoverByInsert(a))Hy&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),Hy&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),oP(o,i)):(!n||n.scoree;class cP extends Rs{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let i=0;ie.topRules[t][1])),n=[];for(let e=0;e=0)r(n,e,t[i++]);else{let s=t[i+-n];for(let o=-n;o>0;o--)r(t[i++],e,s);i++}}}this.nodeSet=new cs(t.map(((t,r)=>ls.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:n[r],top:i.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=is;let s=Ky(e.tokenData);if(this.context=e.context,this.specialized=new Uint16Array(e.specialized?e.specialized.length:0),this.specializers=[],e.specialized)for(let t=0;t"number"==typeof e?new By(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new sP(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],s=1&t,o=n[r++];if(s&&i)return o;for(let i=r+(t>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])return!1;i=OP(this.data,i+2)}if(t==OP(this.data,i+1))return!0}}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=OP(this.data,i+2)}if(0==(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}overrides(e,t){let i=hP(this.data,this.tokenPrecTable,t);return i<0||hP(this.data,this.tokenPrecTable,e){let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let n of e.split(" ")){let e=t.indexOf(n);e>=0&&(i[e]=!0)}let n=null;for(let e=0;e0),this.strict=!1!==e.strict}}({start:!1,shift:(e,t)=>5==t||6==t||286==t?e:287==t,strict:!1}),fP=new Fy(((e,t)=>{let{next:i}=e;(125==i||-1==i||t.context)&&t.canShift(284)&&e.acceptToken(284)}),{contextual:!0,fallback:!0}),pP=new Fy(((e,t)=>{let i,{next:n}=e;uP.indexOf(n)>-1||(47!=n||47!=(i=e.peek(1))&&42!=i)&&125!=n&&59!=n&&-1!=n&&!t.context&&t.canShift(281)&&e.acceptToken(281)}),{contextual:!0}),mP=new Fy(((e,t)=>{let{next:i}=e;if((43==i||45==i)&&(e.advance(),i==e.next)){e.advance();let i=!t.context&&t.canShift(1);e.acceptToken(i?1:2)}}),{contextual:!0}),gP=new Fy((e=>{for(let t=!1,i=0;;i++){let{next:n}=e;if(n<0){i&&e.acceptToken(282);break}if(96==n){i?e.acceptToken(282):e.acceptToken(283,1);break}if(123==n&&t){1==i?e.acceptToken(3,1):e.acceptToken(282,-1);break}if(10==n&&i){e.advance(),e.acceptToken(282);break}92==n&&e.advance(),t=36==n,e.advance()}}));const $P=Au({"get set async static":td.modifier,"for while do if else switch try catch finally return throw break continue default case":td.controlKeyword,"in of await yield void typeof delete instanceof":td.operatorKeyword,"let var const function class extends":td.definitionKeyword,"import export from":td.moduleKeyword,"with debugger as new":td.keyword,TemplateString:td.special(td.string),Super:td.atom,BooleanLiteral:td.bool,this:td.self,null:td.null,Star:td.modifier,VariableName:td.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":td.function(td.variableName),VariableDefinition:td.definition(td.variableName),Label:td.labelName,PropertyName:td.propertyName,PrivatePropertyName:td.special(td.propertyName),"CallExpression/MemberExpression/PropertyName":td.function(td.propertyName),"FunctionDeclaration/VariableDefinition":td.function(td.definition(td.variableName)),"ClassDeclaration/VariableDefinition":td.definition(td.className),PropertyDefinition:td.definition(td.propertyName),PrivatePropertyDefinition:td.definition(td.special(td.propertyName)),UpdateOp:td.updateOperator,LineComment:td.lineComment,BlockComment:td.blockComment,Number:td.number,String:td.string,ArithOp:td.arithmeticOperator,LogicOp:td.logicOperator,BitOp:td.bitwiseOperator,CompareOp:td.compareOperator,RegExp:td.regexp,Equals:td.definitionOperator,"Arrow : Spread":td.punctuation,"( )":td.paren,"[ ]":td.squareBracket,"{ }":td.brace,"InterpolationStart InterpolationEnd":td.special(td.brace),".":td.derefOperator,", ;":td.separator,TypeName:td.typeName,TypeDefinition:td.definition(td.typeName),"type enum interface implements namespace module declare":td.definitionKeyword,"abstract global Privacy readonly override":td.modifier,"is keyof unique infer":td.operatorKeyword,JSXAttributeValue:td.attributeValue,JSXText:td.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":td.angleBracket,"JSXIdentifier JSXNameSpacedName":td.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":td.attributeName}),bP={__proto__:null,export:18,as:23,from:29,default:32,async:37,function:38,this:48,true:56,false:56,void:66,typeof:70,null:86,super:88,new:122,await:139,yield:141,delete:142,class:152,extends:154,public:197,private:197,protected:197,readonly:199,instanceof:220,in:222,const:224,import:256,keyof:307,unique:311,infer:317,is:351,abstract:371,implements:373,type:375,let:378,var:380,interface:387,enum:391,namespace:397,module:399,declare:403,global:407,for:428,of:437,while:440,with:444,do:448,if:452,else:454,switch:458,case:464,try:470,catch:474,finally:478,return:482,throw:486,break:490,continue:494,debugger:498},QP={__proto__:null,async:109,get:111,set:113,public:161,private:161,protected:161,static:163,abstract:165,override:167,readonly:173,new:355},yP={__proto__:null,"<":129},PP=cP.deserialize({version:14,states:"$4|O`QYOOO'QQ$IfO'#ChO'XOSO'#DVO)dQYO'#D]O)tQYO'#DhO){QYO'#DrO-xQYO'#DxOOQO'#E]'#E]O.]QWO'#E[O.bQWO'#E[OOQ$IU'#Ef'#EfO0aQ$IfO'#ItO2wQ$IfO'#IuO3eQWO'#EzO3jQpO'#FaOOQ$IU'#FS'#FSO3rO!bO'#FSO4QQWO'#FhO5_QWO'#FgOOQ$IU'#Iu'#IuOOQ$IS'#It'#ItOOQQ'#J^'#J^O5dQWO'#HpO5iQ$I[O'#HqOOQQ'#Ih'#IhOOQQ'#Hr'#HrQ`QYOOO){QYO'#DjO5qQ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S#`#v$UWO!^%T!_!`5T!`#o%T#p~%T6i!]S#g#v$UWO!^%T!_!`5T!`#o%T#p~%T$P!>pR$UW'f#wO!^%T!_#o%T#p~%T~!?OO!T~6d!?VT'w6[$UWO!^%T!_!`5T!`#o%T#p#q!=P#q~%T5g!?oR!S5]nQ$UWO!^%T!_#o%T#p~%TX!@PR!kP$UWO!^%T!_#o%T#p~%T7Z!@gr$UW'Y7R#zS']%k'g2bOX%TXY%cYZ%TZ[%c[p%Tpq%cqt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$f%T$f$g%c$g#BY2`#BY#BZ!@Y#BZ$IS2`$IS$I_!@Y$I_$JT2`$JT$JU!@Y$JU$KV2`$KV$KW!@Y$KW&FU2`&FU&FV!@Y&FV?HT2`?HT?HU!@Y?HU~2`7Z!CO_$UW'Z7R#zS']%k'g2bOt%Ttu2`u}%T}!O3j!O!Q%T!Q![2`![!^%T!_!c%T!c!}2`!}#R%T#R#S2`#S#T%T#T#o2`#p$g%T$g~2`",tokenizers:[pP,mP,gP,0,1,2,3,4,5,6,7,8,9,fP],topRules:{Script:[0,7]},dialects:{jsx:11707,ts:11709},dynamicPrecedences:{149:1,176:1},specialized:[{term:289,get:(e,t)=>function(e,t){return"extends"==e&&t.dialectEnabled(1)?4:-1}(e,t)<<1},{term:289,get:e=>bP[e]||-1},{term:299,get:e=>QP[e]||-1},{term:63,get:e=>yP[e]||-1}],tokenPrec:11730}),wP=[wp("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),wp("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),wp("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),wp("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"block",type:"keyword"}),wp("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),wp('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),wp('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],kP=ad.define({parser:PP.configure({props:[vd.add({IfStatement:Nd({except:/^\s*({|else\b)/}),TryStatement:Nd({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:e=>e.baseIndent,SwitchBody:e=>{let t=e.textAfter,i=/^\s*\}/.test(t),n=/^\s*(case|default)\b/.test(t);return e.baseIndent+(i?0:n?1:2)*e.unit},Block:Wd({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>-1,"Statement Property":Nd({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),Ed.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":qd,BlockComment:e=>({from:e.from+2,to:e.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),_P=kP.configure({dialect:"ts"}),vP=kP.configure({dialect:"jsx"}),xP=kP.configure({dialect:"jsx ts"});function XP(e={}){let t=e.jsx?e.typescript?xP:vP:e.typescript?_P:kP;return new $d(t,[kP.data.of({autocomplete:kf(["LineComment","BlockComment","String"],wf(wP))}),e.jsx?TP:[]])}function SP(e,t,i=e.length){if(!t)return"";let n=t.getChild("JSXIdentifier");return n?e.sliceString(n.from,Math.min(n.to,i)):""}const RP="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),TP=Oh.inputHandler.of(((e,t,i,n)=>{if((RP?e.composing:e.compositionStarted)||e.state.readOnly||t!=i||">"!=n&&"/"!=n||!kP.isActiveAt(e.state,t,-1))return!1;let{state:r}=e,s=r.changeByRange((e=>{var t,i,s;let o,{head:a}=e,l=ld(r).resolveInner(a,-1);if("JSXStartTag"==l.name&&(l=l.parent),">"==n&&"JSXFragmentTag"==l.name)return{range:Mn.cursor(a+1),changes:{from:a,insert:"><>"}};if(">"==n&&"JSXIdentifier"==l.name){if("JSXEndTag"!=(null===(i=null===(t=l.parent)||void 0===t?void 0:t.lastChild)||void 0===i?void 0:i.name)&&(o=SP(r.doc,l.parent,a)))return{range:Mn.cursor(a+1),changes:{from:a,insert:`>`}}}else if("/"==n&&"JSXFragmentTag"==l.name){let e=l.parent,t=null==e?void 0:e.parent;if(e.from==a-1&&"JSXEndTag"!=(null===(s=t.lastChild)||void 0===s?void 0:s.name)&&(o=SP(r.doc,null==t?void 0:t.firstChild,a))){let e=`/${o}>`;return{range:Mn.cursor(a+e.length),changes:{from:a,insert:e}}}}return{range:e}}));return!s.changes.empty&&(e.dispatch(s,{userEvent:"input.type",scrollIntoView:!0}),!0)})),WP=["_blank","_self","_top","_parent"],AP=["ascii","utf-8","utf-16","latin1","latin1"],NP=["get","post","put","delete"],CP=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],EP=["true","false"],qP={},VP={a:{attrs:{href:null,ping:null,type:null,media:null,target:WP,hreflang:null}},abbr:qP,acronym:qP,address:qP,applet:qP,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:qP,aside:qP,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:qP,base:{attrs:{href:null,target:WP}},basefont:qP,bdi:qP,bdo:qP,big:qP,blockquote:{attrs:{cite:null}},body:qP,br:qP,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:CP,formmethod:NP,formnovalidate:["novalidate"],formtarget:WP,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:qP,center:qP,cite:qP,code:qP,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:qP,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:qP,dir:qP,div:qP,dl:qP,dt:qP,em:qP,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:qP,figure:qP,font:qP,footer:qP,form:{attrs:{action:null,name:null,"accept-charset":AP,autocomplete:["on","off"],enctype:CP,method:NP,novalidate:["novalidate"],target:WP}},frame:qP,frameset:qP,h1:qP,h2:qP,h3:qP,h4:qP,h5:qP,h6:qP,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:qP,hgroup:qP,hr:qP,html:{attrs:{manifest:null}},i:qP,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:CP,formmethod:NP,formnovalidate:["novalidate"],formtarget:WP,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:qP,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:qP,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:qP,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:AP,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:qP,noframes:qP,noscript:qP,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:qP,param:{attrs:{name:null,value:null}},pre:qP,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:qP,rt:qP,ruby:qP,s:qP,samp:qP,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:AP}},section:qP,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:qP,source:{attrs:{src:null,type:null,media:null}},span:qP,strike:qP,strong:qP,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:qP,summary:qP,sup:qP,table:qP,tbody:qP,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:qP,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:qP,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:qP,time:{attrs:{datetime:null}},title:qP,tr:qP,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},tt:qP,u:qP,ul:{children:["li","script","template","ul","ol"]},var:qP,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:qP},zP={accesskey:null,class:null,contenteditable:EP,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:EP,autocorrect:EP,autocapitalize:EP,style:null,tabindex:null,title:null,translate:["yes","no"],onclick:null,rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":EP,"aria-autocomplete":["inline","list","both","none"],"aria-busy":EP,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":EP,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":EP,"aria-hidden":EP,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":EP,"aria-multiselectable":EP,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":EP,"aria-relevant":null,"aria-required":EP,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},IP=Object.keys(VP),YP=Object.keys(zP);function ZP(e,t,i=e.length){if(!t)return"";let n=t.firstChild,r=n&&n.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,i)):""}function UP(e,t=!1){for(let i=e.parent;i;i=i.parent)if("Element"==i.name){if(!t)return i;t=!1}return null}function MP(e,t){let i=VP[ZP(e,UP(t,!0))];return(null==i?void 0:i.children)||IP}function DP(e,t){let i=[];for(let n=t;n=UP(n);){let r=ZP(e,n);if(r&&"CloseTag"==n.lastChild.name)break;r&&i.indexOf(r)<0&&("EndTag"==t.name||t.from>=n.firstChild.to)&&i.push(r)}return i}const jP=/^[:\-\.\w\u00b7-\uffff]*$/;function GP(e,t,i,n){let r=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:MP(e.doc,t).map((e=>({label:e,type:"type"}))).concat(DP(e.doc,t).map(((e,t)=>({label:"/"+e,apply:"/"+e+r,type:"type",boost:99-t})))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function LP(e,t,i,n){let r=/\s*>/.test(e.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:DP(e.doc,t).map(((e,t)=>({label:e,apply:e+r,type:"type",boost:99-t}))),validFor:jP}}function BP(e){let{state:t,pos:i}=e,n=ld(t).resolveInner(i),r=n.resolve(i,-1);for(let e,t=i;n==r&&(e=r.childBefore(t));){let i=e.lastChild;if(!i||!i.type.isError||i.from({label:e,type:"property"}))),validFor:jP}}(t,r,"AttributeName"==r.name?r.from:i,i):"Is"==r.name||"AttributeValue"==r.name||"UnquotedAttributeValue"==r.name?function(e,t,i,n){var r;let s,o=null===(r=t.parent)||void 0===r?void 0:r.getChild("AttributeName"),a=[];if(o){let r=e.sliceDoc(o.from,o.to),l=zP[r];if(!l){let i=UP(t),n=i?VP[ZP(e.doc,i)]:null;l=(null==n?void 0:n.attrs)&&n.attrs[r]}if(l){let t=e.sliceDoc(i,n).toLowerCase(),r='"',o='"';/^['"]/.test(t)?(s='"'==t[0]?/^[^"]*$/:/^[^']*$/,r="",o=e.sliceDoc(n,n+1)==t[0]?"":t[0],t=t.slice(1),i++):s=/^[^\s<>='"]*$/;for(let e of l)a.push({label:e,apply:r+e+o,type:"constant"})}}return{from:i,to:n,options:a,validFor:s}}(t,r,"Is"==r.name?i:r.from,i):!e.explicit||"Element"!=n.name&&"Text"!=n.name&&"Document"!=n.name?null:function(e,t,i){let n=[],r=0;for(let i of MP(e.doc,t))n.push({label:"<"+i,type:"type"});for(let i of DP(e.doc,t))n.push({label:"",type:"type",boost:99-r++});return{from:i,to:i,options:n,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}(t,r,i)}const FP=ad.define({parser:BQ.configure({props:[vd.add({Element(e){let t=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+t[0].length?e.continue():e.lineIndent(e.node.from)+(t[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag":e=>e.column(e.node.from)+e.unit,Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length{let s=e.type.id;return 27==s?KQ(e,r,t):30==s?KQ(e,r,i):33==s?KQ(e,r,n):null}))}([{tag:"script",attrs:e=>!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type),parser:kP.parser},{tag:"style",attrs:e=>(!e.lang||"css"==e.lang)&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type)),parser:Iy.parser}])}),languageData:{commentTokens:{block:{open:"\x3c!--",close:"--\x3e"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}});function KP(e={}){let t=FP;return!1===e.matchClosingTags&&(t=t.configure({dialect:"noMatch"})),new $d(t,[FP.data.of({autocomplete:BP}),!1!==e.autoCloseTags?HP:[],XP().support,new $d(Iy,Iy.data.of({autocomplete:zy})).support])}const HP=Oh.inputHandler.of(((e,t,i,n)=>{if(e.composing||e.state.readOnly||t!=i||">"!=n&&"/"!=n||!FP.isActiveAt(e.state,t,-1))return!1;let{state:r}=e,s=r.changeByRange((e=>{var t,i,s;let o,{head:a}=e,l=ld(r).resolveInner(a,-1);if("TagName"!=l.name&&"StartTag"!=l.name||(l=l.parent),">"==n&&"OpenTag"==l.name){if("CloseTag"!=(null===(i=null===(t=l.parent)||void 0===t?void 0:t.lastChild)||void 0===i?void 0:i.name)&&(o=ZP(r.doc,l.parent,a)))return{range:Mn.cursor(a+1),changes:{from:a,insert:`>`}}}else if("/"==n&&"OpenTag"==l.name){let e=l.parent,t=null==e?void 0:e.parent;if(e.from==a-1&&"CloseTag"!=(null===(s=t.lastChild)||void 0===s?void 0:s.name)&&(o=ZP(r.doc,t,a))){let e=`/${o}>`;return{range:Mn.cursor(a+e.length),changes:{from:a,insert:e}}}}return{range:e}}));return!s.changes.empty&&(e.dispatch(s,{userEvent:"input.type",scrollIntoView:!0}),!0)})),JP=rd({block:{open:"\x3c!--",close:"--\x3e"}}),ew=Ib.configure({props:[Ed.add((e=>{if(e.is("Block")&&!e.is("Document"))return(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})),vd.add({Document:()=>null}),nd.add({Document:JP})]});function tw(e){return new sd(JP,e)}const iw=tw(ew),nw=tw(ew.configure([Hb,tQ,eQ,iQ]));function rw(e,t){return t.sliceString(e.from,e.from+50)}class sw{constructor(e,t,i,n,r,s,o){this.node=e,this.from=t,this.to=i,this.spaceBefore=n,this.spaceAfter=r,this.type=s,this.item=o}blank(e=!0){let t=this.spaceBefore;if("Blockquote"==this.node.name)t+=">";else for(let e=this.to-this.from-t.length-this.spaceAfter.length;e>0;e--)t+=" ";return t+(e?this.spaceAfter:"")}marker(e,t){let i="OrderedList"==this.node.name?String(+aw(this.item,e)[2]+t):"";return this.spaceBefore+i+this.type+this.spaceAfter}}function ow(e,t,i){let n=[];for(let t=e;t&&"Document"!=t.name;t=t.parent)"ListItem"!=t.name&&"Blockquote"!=t.name||n.push(t);let r=[],s=0;for(let e=n.length-1;e>=0;e--){let o,a=n[e],l=s;if("Blockquote"==a.name&&(o=/^[ \t]*>( ?)/.exec(t.slice(s))))s+=o[0].length,r.push(new sw(a,l,s,"",o[1],">",null));else if("ListItem"==a.name&&"OrderedList"==a.parent.name&&(o=/^([ \t]*)\d+([.)])([ \t]*)/.exec(rw(a,i)))){let e=o[3],t=o[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),s+=t,r.push(new sw(a.parent,l,s,o[1],e,o[2],a))}else if("ListItem"==a.name&&"BulletList"==a.parent.name&&(o=/^([ \t]*)([-+*])([ \t]{1,4}\[[ xX]\])?([ \t]+)/.exec(rw(a,i)))){let e=o[4],t=o[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let i=o[2];o[3]&&(i+=o[3].replace(/[xX]/," ")),s+=t,r.push(new sw(a.parent,l,s,o[1],e,i,a))}}return r}function aw(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function lw(e,t,i,n=0){for(let r=-1,s=e;;){if("ListItem"==s.name){let e=aw(s,t),o=+e[2];if(r>=0){if(o!=r+1)return;i.push({from:s.from+e[1].length,to:s.from+e[0].length,insert:String(r+2+n)})}r=o}let e=s.nextSibling;if(!e)break;s=e}}function cw(e){return"QuoteMark"==e.name||"ListMark"==e.name}const Ow=[{key:"Enter",run:({state:e,dispatch:t})=>{let i=ld(e),{doc:n}=e,r=null,s=e.changeByRange((t=>{if(!t.empty||!nw.isActiveAt(e,t.from))return r={range:t};let s=t.from,o=n.lineAt(s),a=ow(i.resolveInner(s,-1),o.text,n);for(;a.length&&a[a.length-1].from>s-o.from;)a.pop();if(!a.length)return r={range:t};let l=a[a.length-1];if(l.to-l.spaceAfter.length>s-o.from)return r={range:t};let c=s>=l.to-l.spaceAfter.length&&!/\S/.test(o.text.slice(l.to));if(l.item&&c){if(l.node.firstChild.to>=s||o.from>0&&!/[^\s>]/.test(n.lineAt(o.from-1).text)){let e,t=a.length>1?a[a.length-2]:null,i="";t&&t.item?(e=o.from+t.from,i=t.marker(n,1)):e=o.from+(t?t.to:0);let r=[{from:e,to:s,insert:i}];return"OrderedList"==l.node.name&&lw(l.item,n,r,-2),t&&"OrderedList"==t.node.name&&lw(t.item,n,r),{range:Mn.cursor(e+i.length),changes:r}}{let t="";for(let e=0,i=a.length-2;e<=i;e++)t+=a[e].blank(e\s*$/.exec(i.text);if(r&&r.index==l.from){let n=e.changes([{from:i.from+r.index,to:i.to},{from:o.from+l.from,to:o.to}]);return{range:t.map(n),changes:n}}}let O=[];"OrderedList"==l.node.name&&lw(l.item,n,O);let h=e.lineBreak,u=l.item&&l.item.from]*/.exec(o.text)[0].length>=l.to)for(let e=0,t=a.length-1;e<=t;e++)h+=e!=t||u?a[e].blank():a[e].marker(n,1);let d=s;for(;d>o.from&&/\s/.test(o.text.charAt(d-o.from-1));)d--;return O.push({from:d,to:s,insert:h}),{range:Mn.cursor(d+h.length),changes:O}}));return!r&&(t(e.update(s,{scrollIntoView:!0,userEvent:"input"})),!0)}},{key:"Backspace",run:({state:e,dispatch:t})=>{let i=ld(e),n=null,r=e.changeByRange((t=>{let r=t.from,{doc:s}=e;if(t.empty&&nw.isActiveAt(e,t.from)){let e=s.lineAt(r),n=ow(function(e,t){let i,n=e.resolveInner(t,-1),r=t;for(cw(n)&&(r=n.from,n=n.parent);i=n.childBefore(r);)if(cw(i))r=i.from;else{if("OrderedList"!=i.name&&"BulletList"!=i.name)break;n=i.lastChild,r=n.to}return n}(i,r),e.text,s);if(n.length){let i=n[n.length-1],s=i.to-i.spaceAfter.length+(i.spaceAfter?1:0);if(r-e.from>s&&!/\S/.test(e.text.slice(s,r-e.from)))return{range:Mn.cursor(e.from+s),changes:{from:e.from+s,to:r}};if(r-e.from==s){let n=e.from+i.from;if(i.item&&i.node.from{let n=i&&bd.matchLanguageName(e,i,!0);return n?n.support?n.support.language.parser:hd.getSkippingParser(n.load()):t?t.parser:null}}(t||[],s):void 0;return o.push(Zb({codeParser:l,htmlParser:hw.language.parser})),n&&a.push(ar.high($h.of(Ow))),new $d(tw(r.configure(o)),a)}class dw{constructor(e,t,i,n,r,s,o,a,l,c=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new dw(e,[],t,i,i,0,[],0,n?new fw(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,i=65535&e,{parser:n}=this.p,r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==t)return this.pushState(n.getGoto(this.state,i,!0),this.reducePos),is;)this.stack.pop();this.reduceContext(i,o)}storeNode(e,t,i,n=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i){let n=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:s}=this.p;(i>this.pos||t<=s.maxNode)&&(this.pos=i,s.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,n),this.shiftContext(t,n),t<=s.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,i){65536&e?this.reduce(e):this.shift(e,t,i)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new dw(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new mw(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let e=0;e>19,n=65535&e,r=this.stack.length-3*i;if(r<0||t.getGoto(this.stack[r],n,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class fw{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}var pw;!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(pw||(pw={}));class mw{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class gw{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new gw(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new gw(this.stack,this.pos,this.index)}}class $w{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const bw=new $w;class Qw{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=bw,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=bw,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class yw{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,i,n){let r=0,s=1<0){let i=e[n];if(a.allows(i)&&(-1==t.token.value||t.token.value==i||o.overrides(i,t.token.value))){t.acceptToken(i);break}}for(let n=t.next,s=0,o=e[r+2];s>1,l=i+a+(a<<1),c=e[l],O=e[l+1];if(n=O)){r=e[l+2],t.advance();continue e}s=a+1}}break}}(this.data,e,t,this.id)}}yw.prototype.contextual=yw.prototype.fallback=yw.prototype.extend=!1;class Pw{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function ww(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),s+=r,i)break;s*=46}i?i[r++]=s:i=new t(s)}return i}const kw=void 0!==hn&&hn.env&&/\bparse\b/.test(void 0);let _w=null;var vw,xw;function Xw(e,t,i){let n=e.cursor(us.IncludeAnonymous);for(n.moveTo(t);;)if(!(i<0?n.childBefore(t):n.childAfter(t)))for(;;){if((i<0?n.tot)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(vw||(vw={}));class Sw{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Xw(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Xw(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof ds){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class Rw{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new $w))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,s=n.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let n=0;nc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(i=c,t>n))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),i||e.pos!=this.stream.end||(i=new $w,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new $w,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){if(t.token(this.stream.reset(i.pos,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=Math.min(i.p.stream.end,i.pos+1)}putAction(e,t,i,n){for(let t=0;t4*e.bufferLength?new Sw(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];for(let s=0;sn)r.push(o);else{if(this.advanceStack(o,r,i))continue;{e||(e=[],t=[]),e.push(o);let i=this.tokens.getMainToken(o);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1)e:for(let e=0;e500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}this.minStackPos=r[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(n);o;){let n=this.parser.nodeSet.types[o.type.id]==o.type?r.getGoto(e.state,o.type.id):-1;if(n>-1&&o.length&&(!t||(o.prop(ss.contextHash)||0)==i))return e.useNode(o,n),kw&&console.log(s+this.stackID(e)+` (via reuse of ${r.getName(o.type.id)})`),!0;if(!(o instanceof ds)||0==o.children.length||o.positions[0]>0)break;let a=o.children[0];if(!(a instanceof ds&&0==o.positions[0]))break;o=a}}let o=r.stateSlot(e.state,4);if(o>0)return e.reduce(o),kw&&console.log(s+this.stackID(e)+` (via always-reduce ${r.getName(65535&o)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let o=0;on?t.push(u):i.push(u)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return Ww(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let s=0;s ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),kw&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let O=o.split(),h=c;for(let e=0;O.forceReduce()&&e<10&&(kw&&console.log(h+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));e++)kw&&(h=this.stackID(O)+" -> ");for(let e of o.recoverByInsert(a))kw&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),kw&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),Ww(o,i)):(!n||n.scoree.topRules[t][1])),n=[];for(let e=0;e=0)r(n,e,t[i++]);else{let s=t[i+-n];for(let o=-n;o>0;o--)r(t[i++],e,s);i++}}}this.nodeSet=new cs(t.map(((t,r)=>ls.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:n[r],top:i.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=is;let s=ww(e.tokenData);if(this.context=e.context,this.specialized=new Uint16Array(e.specialized?e.specialized.length:0),this.specializers=[],e.specialized)for(let t=0;t"number"==typeof e?new yw(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new Tw(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],s=1&t,o=n[r++];if(s&&i)return o;for(let i=r+(t>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])return!1;i=Cw(this.data,i+2)}if(t==Cw(this.data,i+1))return!0}}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=Cw(this.data,i+2)}if(0==(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}overrides(e,t){let i=Ew(this.data,this.tokenPrecTable,t);return i<0||Ew(this.data,this.tokenPrecTable,e){let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let n of e.split(" ")){let e=t.indexOf(n);e>=0&&(i[e]=!0)}let n=null;for(let e=0;e=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57}function Vw(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function zw(e,t,i){for(let n=!1;;){if(e.next<0)return;if(e.next==t&&!n)return void e.advance();n=i&&!n&&92==e.next,e.advance()}}function Iw(e,t){for(;95==e.next||qw(e.next);)null!=t&&(t+=String.fromCharCode(e.next)),e.advance();return t}function Yw(e,t){for(;;){if(46==e.next){if(t)break;t=!0}else if(e.next<48||e.next>57)break;e.advance()}if(69==e.next||101==e.next)for(e.advance(),43!=e.next&&45!=e.next||e.advance();e.next>=48&&e.next<=57;)e.advance()}function Zw(e){for(;!(e.next<0||10==e.next);)e.advance()}function Uw(e,t){for(let i=0;i!=&|~^/",specialVar:"?",identifierQuotes:'"',words:Dw(Gw,jw)};function Bw(e){return new Pw((t=>{var i;let{next:n}=t;if(t.advance(),Uw(n,Mw)){for(;Uw(t.next,Mw);)t.advance();t.acceptToken(34)}else if(39==n||34==n&&e.doubleQuotedStrings)zw(t,n,e.backslashEscapes),t.acceptToken(3);else if(35==n&&e.hashComments||47==n&&47==t.next&&e.slashComments)Zw(t),t.acceptToken(1);else if(45!=n||45!=t.next||e.spaceAfterDashes&&32!=t.peek(2))if(47==n&&42==t.next){t.advance();for(let e=-1,i=1;!(t.next<0);)if(t.advance(),42==e&&47==t.next){if(i--,!i)break;e=-1}else 47==e&&42==t.next?(i++,e=-1):e=t.next;t.acceptToken(2)}else if(101!=n&&69!=n||39!=t.next)if(110!=n&&78!=n||39!=t.next||!e.charSetCasts){if(95==n&&e.charSetCasts)for(let i=0;;i++){if(39==t.next&&i>1){t.advance(),zw(t,39,e.backslashEscapes),t.acceptToken(3);break}if(!qw(t.next))break;t.advance()}else if(40==n)t.acceptToken(7);else if(41==n)t.acceptToken(8);else if(123==n)t.acceptToken(9);else if(125==n)t.acceptToken(10);else if(91==n)t.acceptToken(11);else if(93==n)t.acceptToken(12);else if(59==n)t.acceptToken(13);else if(48==n&&(98==t.next||66==t.next)||(98==n||66==n)&&39==t.next){let e=39==t.next;for(t.advance();48==t.next||49==t.next;)t.advance();e&&39==t.next&&t.advance(),t.acceptToken(4)}else if(48==n&&(120==t.next||88==t.next)||(120==n||88==n)&&39==t.next){let e=39==t.next;for(t.advance();Vw(t.next);)t.advance();e&&39==t.next&&t.advance(),t.acceptToken(4)}else if(46==n&&t.next>=48&&t.next<=57)Yw(t,!0),t.acceptToken(4);else if(46==n)t.acceptToken(14);else if(n>=48&&n<=57)Yw(t,!1),t.acceptToken(4);else if(Uw(n,e.operatorChars)){for(;Uw(t.next,e.operatorChars);)t.advance();t.acceptToken(15)}else if(Uw(n,e.specialVar))t.next==n&&t.advance(),function(e){if(39==e.next||34==e.next||96==e.next){let t=e.next;e.advance(),zw(e,t,!1)}else Iw(e)}(t),t.acceptToken(17);else if(Uw(n,e.identifierQuotes))zw(t,n,!1),t.acceptToken(19);else if(58==n||44==n)t.acceptToken(16);else if(qw(n)){let r=Iw(t,String.fromCharCode(n));t.acceptToken(null!==(i=e.words[r.toLowerCase()])&&void 0!==i?i:18)}}else t.advance(),zw(t,39,e.backslashEscapes),t.acceptToken(3);else t.advance(),zw(t,39,!0);else Zw(t),t.acceptToken(1)}))}const Fw=Bw(Lw),Kw=Nw.deserialize({version:14,states:"%dQ]QQOOO#kQRO'#DQO#rQQO'#CuO%RQQO'#CvO%YQQO'#CwO%aQQO'#CxOOQQ'#DQ'#DQOOQQ'#C{'#C{O&lQRO'#CyOOQQ'#Ct'#CtOOQQ'#Cz'#CzQ]QQOOQOQQOOO&vQQO,59aO'RQQO,59aO'WQQO'#DQOOQQ,59b,59bO'eQQO,59bOOQQ,59c,59cO'lQQO,59cOOQQ,59d,59dO'sQQO,59dOOQQ-E6y-E6yOOQQ,59`,59`OOQQ-E6x-E6xOOQQ'#C|'#C|OOQQ1G.{1G.{O&vQQO1G.{OOQQ1G.|1G.|OOQQ1G.}1G.}OOQQ1G/O1G/OP'zQQO'#C{POQQ-E6z-E6zOOQQ7+$g7+$g",stateData:"(R~OrOSPOSQOS~ORUOSUOTUOUUOVROXSOZTO]XO^QO_UO`UOaPObPOcPOdUOeUOfUO~O^]ORtXStXTtXUtXVtXXtXZtX]tX_tX`tXatXbtXctXdtXetXftX~OqtX~P!dOa^Ob^Oc^O~ORUOSUOTUOUUOVROXSOZTO^QO_UO`UOa_Ob_Oc_OdUOeUOfUO~OW`O~P#}OYbO~P#}O[dO~P#}ORUOSUOTUOUUOVROXSOZTO^QO_UO`UOaPObPOcPOdUOeUOfUO~O]gOqmX~P%hOaiObiOciO~O^kO~OWtXYtX[tX~P!dOWlO~P#}OYmO~P#}O[nO~P#}O]gO~P#}O",goto:"#YuPPPPPPPPPPPPPPPPPPPPPPPPvzzzz!W![!b!vPPP!|TYOZeUORSTWZaceoT[OZQZORhZSWOZQaRQcSQeTZfWaceoQj]RqkeVORSTWZaceo",nodeNames:"⚠ LineComment BlockComment String Number Bool Null ( ) [ ] { } ; . Operator Punctuation SpecialVar Identifier QuotedIdentifier Keyword Type Builtin Script Statement CompositeIdentifier Parens Braces Brackets Statement",maxTerm:36,skippedNodes:[0,1,2],repeatNodeCount:3,tokenData:"RORO",tokenizers:[0,Fw],topRules:{Script:[0,23]},tokenPrec:0});function Hw(e){let t=e.cursor().moveTo(e.from,-1);for(;/Comment/.test(t.name);)t.moveTo(t.from,-1);return t.node}function Jw(e){let t=/^[`'"](.*)[`'"]$/.exec(e);return t?t[1]:e}function ek(e,t){return e?t.map((t=>Object.assign(Object.assign({},t),{label:e+t.label+e,apply:void 0}))):t}const tk=/^\w*$/,ik=/^[`'"]?\w*[`'"]?$/;function nk(e,t,i){let n=Object.create(null);for(let t in e)n[t]=e[t].map((e=>"string"==typeof e?{label:e,type:"property"}:e));let r=(t||Object.keys(n).map((e=>({label:e,type:"type"})))).concat(i&&n[i]||[]);return e=>{let{parent:t,from:i,quoted:s,empty:o}=function(e,t){let i=ld(e).resolveInner(t,-1),n=!1;if("Identifier"==i.name||"QuotedIdentifier"==i.name){n=!1;let t=null,r=Hw(i);if(r&&"."==r.name){let i=Hw(r);(i&&"Identifier"==i.name||"QuotedIdentifier"==i.name)&&(t=Jw(e.sliceDoc(i.from,i.to)))}return{parent:t,from:i.from,quoted:"QuotedIdentifier"==i.name?e.sliceDoc(i.from,i.from+1):null}}if("."==i.name){let n=Hw(i);if(n&&"Identifier"==n.name||"QuotedIdentifier"==n.name)return{parent:Jw(e.sliceDoc(n.from,n.to)),from:t,quoted:null}}else n=!0;return{parent:null,from:t,quoted:null,empty:n}}(e.state,e.pos);if(o&&!e.explicit)return null;let a=r;if(t){let e=n[t];if(!e)return null;a=e}return{from:i,to:s&&e.state.sliceDoc(e.pos,e.pos+1)==s?e.pos+1:void 0,options:ek(s,a),validFor:s?ik:tk}}}function rk(e,t){return kf(["QuotedIdentifier","SpecialVar","String","LineComment","BlockComment","."],wf(Object.keys(e).map((i=>({label:t?i.toUpperCase():i,type:21==e[i]?"type":20==e[i]?"keyword":"variable",boost:-1})))))}let sk=Kw.configure({props:[vd.add({Statement:Nd()}),Ed.add({Statement:e=>({from:e.firstChild.to,to:e.to}),BlockComment:e=>({from:e.from+2,to:e.to-2})}),Au({Keyword:td.keyword,Type:td.typeName,Builtin:td.standard(td.name),Bool:td.bool,Null:td.null,Number:td.number,String:td.string,Identifier:td.name,QuotedIdentifier:td.special(td.string),SpecialVar:td.special(td.name),LineComment:td.lineComment,BlockComment:td.blockComment,Operator:td.operator,"Semi Punctuation":td.punctuation,"( )":td.paren,"{ }":td.brace,"[ ]":td.squareBracket})]});class ok{constructor(e,t){this.dialect=e,this.language=t}get extension(){return this.language.extension}static define(e){let t=function(e,t,i,n){let r={};for(let t in Lw)r[t]=(e.hasOwnProperty(t)?e:Lw)[t];return t&&(r.words=Dw(t,i||"",n)),r}(e,e.keywords,e.types,e.builtin),i=ad.define({parser:sk.configure({tokenizers:[{from:Fw,to:Bw(t)}]}),languageData:{commentTokens:{line:"--",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]}}});return new ok(t,i)}}function ak(e,t=!1){return e.language.data.of({autocomplete:rk(e.dialect.words,t)})}function lk(e){return e.schema?(e.dialect||ck).language.data.of({autocomplete:nk(e.schema,e.tables,e.defaultTable)}):[]}const ck=ok.define({}),Ok=ok.define({charSetCasts:!0,operatorChars:"+-*/<>=~!@#%^&|`?",specialVar:"",keywords:Gw+"a abort abs absent access according ada admin aggregate alias also always analyse analyze array_agg array_max_cardinality asensitive assert assignment asymmetric atomic attach attribute attributes avg backward base64 begin_frame begin_partition bernoulli bit_length blocked bom c cache called cardinality catalog_name ceil ceiling chain char_length character_length character_set_catalog character_set_name character_set_schema characteristics characters checkpoint class class_origin cluster coalesce cobol collation_catalog collation_name collation_schema collect column_name columns command_function command_function_code comment comments committed concurrently condition_number configuration conflict connection_name constant constraint_catalog constraint_name constraint_schema contains content control conversion convert copy corr cost covar_pop covar_samp csv cume_dist current_catalog current_row current_schema cursor_name database datalink datatype datetime_interval_code datetime_interval_precision db debug defaults defined definer degree delimiter delimiters dense_rank depends derived detach detail dictionary disable discard dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue document dump dynamic_function dynamic_function_code element elsif empty enable encoding encrypted end_frame end_partition endexec enforced enum errcode error event every exclude excluding exclusive exp explain expression extension extract family file filter final first_value flag floor following force foreach fortran forward frame_row freeze fs functions fusion g generated granted greatest groups handler header hex hierarchy hint id ignore ilike immediately immutable implementation implicit import include including increment indent index indexes info inherit inherits inline insensitive instance instantiable instead integrity intersection invoker isnull k key_member key_type label lag last_value lead leakproof least length library like_regex link listen ln load location lock locked log logged lower m mapping matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text min minvalue mod mode more move multiset mumps name namespace nfc nfd nfkc nfkd nil normalize normalized nothing notice notify notnull nowait nth_value ntile nullable nullif nulls number occurrences_regex octet_length octets off offset oids operator options ordering others over overlay overriding owned owner p parallel parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partition pascal passing passthrough password percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding prepared print_strict_params procedural procedures program publication query quote raise range rank reassign recheck recovery refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex rename repeatable replace replica requiring reset respect restart restore result_oid returned_cardinality returned_length returned_octet_length returned_sqlstate returning reverse routine_catalog routine_name routine_schema routines row_count row_number rowtype rule scale schema_name schemas scope scope_catalog scope_name scope_schema security selective self sensitive sequence sequences serializable server server_name setof share show simple skip slice snapshot source specific_name sqlcode sqlerror sqrt stable stacked standalone statement statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time t table_name tables tablesample tablespace temp template ties token top_level_count transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex trigger_catalog trigger_name trigger_schema trim trim_array truncate trusted type types uescape unbounded uncommitted unencrypted unlink unlisten unlogged unnamed untyped upper uri use_column use_variable user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema vacuum valid validate validator value_of var_pop var_samp varbinary variable_conflict variadic verbose version versioning views volatile warning whitespace width_bucket window within wrapper xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate yes",types:jw+"bigint int8 bigserial serial8 varbit bool box bytea cidr circle precision float8 inet int4 json jsonb line lseg macaddr macaddr8 money numeric pg_lsn point polygon float4 int2 smallserial serial2 serial serial4 text timetz timestamptz tsquery tsvector txid_snapshot uuid xml"});class hk{constructor(e,t,i,n,r,s,o,a,l,c=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=n,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=c,this.parent=O}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let n=e.parser.context;return new hk(e,[],t,i,i,0,[],0,n?new uk(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,i=65535&e,{parser:n}=this.p,r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==t)return this.pushState(n.getGoto(this.state,i,!0),this.reducePos),is;)this.stack.pop();this.reduceContext(i,o)}storeNode(e,t,i,n=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[n-4]&&e.buffer[n-1]>-1){if(t==i)return;if(e.buffer[n-2]>=t)return void(e.buffer[n-2]=i)}}if(r&&this.pos!=i){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>i;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,n>4&&(n-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=i,this.buffer[r+3]=n}else this.buffer.push(e,t,i,n)}shift(e,t,i){let n=this.pos;if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:s}=this.p;(i>this.pos||t<=s.maxNode)&&(this.pos=i,s.stateFlag(r,1)||(this.reducePos=i)),this.pushState(r,n),this.shiftContext(t,n),t<=s.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,i){65536&e?this.reduce(e):this.shift(e,t,i)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let n=this.pos;this.reducePos=this.pos=n+e.length,this.pushState(t,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),n=e.bufferBase+t;for(;e&&n==e.bufferBase;)e=e.parent;return new hk(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new fk(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let n,r=0;r1&t&&e==n))||i.push(t[e],n)}t=i}let i=[];for(let e=0;e>19,n=65535&e,r=this.stack.length-3*i;if(r<0||t.getGoto(this.stack[r],n,!1)<0)return!1;this.storeNode(0,this.reducePos,this.reducePos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class uk{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}var dk;!function(e){e[e.Insert=200]="Insert",e[e.Delete=190]="Delete",e[e.Reduce=100]="Reduce",e[e.MaxNext=4]="MaxNext",e[e.MaxInsertStackDepth=300]="MaxInsertStackDepth",e[e.DampenInsertStackDepth=120]="DampenInsertStackDepth"}(dk||(dk={}));class fk{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,i=e>>19;0==i?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(i-1);let n=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=n}}class pk{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new pk(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new pk(this.stack,this.pos,this.index)}}class mk{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const gk=new mk;class $k{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=gk,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,n=this.rangeIndex,r=this.pos+e;for(;ri.to:r>=i.to;){if(n==this.ranges.length-1)return null;let e=this.ranges[++n];r+=e.from-i.to,i=e}return r}peek(e){let t,i,n=this.chunkOff+e;if(n>=0&&n=this.chunk2Pos&&tn.to&&(this.chunk2=this.chunk2.slice(0,n.to-t)),i=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),i}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(null==i||i=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=gk,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let n of this.ranges){if(n.from>=t)break;n.to>e&&(i+=this.input.read(Math.max(n.from,e),Math.min(n.to,t)))}return i}}class bk{constructor(e,t){this.data=e,this.id=t}token(e,t){!function(e,t,i,n){let r=0,s=1<0){let i=e[n];if(a.allows(i)&&(-1==t.token.value||t.token.value==i||o.overrides(i,t.token.value))){t.acceptToken(i);break}}for(let n=t.next,s=0,o=e[r+2];s>1,l=i+a+(a<<1),c=e[l],O=e[l+1];if(n=O)){r=e[l+2],t.advance();continue e}s=a+1}}break}}(this.data,e,t,this.id)}}bk.prototype.contextual=bk.prototype.fallback=bk.prototype.extend=!1;class Qk{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function yk(e,t=Uint16Array){if("string"!=typeof e)return e;let i=null;for(let n=0,r=0;n=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,i=!0),s+=r,i)break;s*=46}i?i[r++]=s:i=new t(s)}return i}const Pk=void 0!==hn&&hn.env&&/\bparse\b/.test(void 0);let wk=null;var kk,_k;function vk(e,t,i){let n=e.cursor(us.IncludeAnonymous);for(n.moveTo(t);;)if(!(i<0?n.childBefore(t):n.childAfter(t)))for(;;){if((i<0?n.tot)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,t-25)):Math.min(e.length,Math.max(n.from+1,t+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:e.length}}!function(e){e[e.Margin=25]="Margin"}(kk||(kk={}));class xk{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?vk(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?vk(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=s,null;if(r instanceof ds){if(s==e){if(s=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(s),this.index.push(0))}else this.index[t]++,this.nextStart=s+r.length}}}class Xk{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new mk))}getActions(e){let t=0,i=null,{parser:n}=e.p,{tokenizers:r}=n,s=n.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let n=0;nc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let n=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!l.extend&&(i=c,t>n))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),i||e.pos!=this.stream.end||(i=new mk,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new mk,{pos:i,p:n}=e;return t.start=i,t.end=Math.min(i+1,n.stream.end),t.value=i==n.stream.end?n.parser.eofTerm:0,t}updateCachedToken(e,t,i){if(t.token(this.stream.reset(i.pos,e),i),e.value>-1){let{parser:t}=i.p;for(let n=0;n=0&&i.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=Math.min(i.p.stream.end,i.pos+1)}putAction(e,t,i,n){for(let t=0;t4*e.bufferLength?new xk(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,i=this.stacks,n=this.minStackPos,r=this.stacks=[];for(let s=0;sn)r.push(o);else{if(this.advanceStack(o,r,i))continue;{e||(e=[],t=[]),e.push(o);let i=this.tokens.getMainToken(o);t.push(i.value,i.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let i of e){let e=i.p.stoppedAt;(i.pos==i.p.stream.end||null!=e&&i.pos>e)&&i.p.parser.stateFlag(i.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(i)return this.stackToTree(i.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>n))&&this.recovering--}else if(r.length>1)e:for(let e=0;e500&&n.buffer.length>500){if(!((t.score-n.score||t.buffer.length-n.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(i--,1)}}}this.minStackPos=r[0].pos;for(let e=1;e ":"";if(null!=this.stoppedAt&&n>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,i=t?e.curContext.hash:0;for(let o=this.fragments.nodeAt(n);o;){let n=this.parser.nodeSet.types[o.type.id]==o.type?r.getGoto(e.state,o.type.id):-1;if(n>-1&&o.length&&(!t||(o.prop(ss.contextHash)||0)==i))return e.useNode(o,n),Pk&&console.log(s+this.stackID(e)+` (via reuse of ${r.getName(o.type.id)})`),!0;if(!(o instanceof ds)||0==o.children.length||o.positions[0]>0)break;let a=o.children[0];if(!(a instanceof ds&&0==o.positions[0]))break;o=a}}let o=r.stateSlot(e.state,4);if(o>0)return e.reduce(o),Pk&&console.log(s+this.stackID(e)+` (via always-reduce ${r.getName(65535&o)})`),!0;if(e.stack.length>=15e3)for(;e.stack.length>9e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let o=0;on?t.push(u):i.push(u)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return Rk(e,t),!0}}runRecovery(e,t,i){let n=null,r=!1;for(let s=0;s ":"";if(o.deadEnd){if(r)continue;if(r=!0,o.restart(),Pk&&console.log(c+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))continue}let O=o.split(),h=c;for(let e=0;O.forceReduce()&&e<10&&(Pk&&console.log(h+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));e++)Pk&&(h=this.stackID(O)+" -> ");for(let e of o.recoverByInsert(a))Pk&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,i);this.stream.end>o.pos?(l==o.pos&&(l++,a=0),o.recoverByDelete(a,l),Pk&&console.log(c+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),Rk(o,i)):(!n||n.scoree;class Ak extends Rs{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let i=0;ie.topRules[t][1])),n=[];for(let e=0;e=0)r(n,e,t[i++]);else{let s=t[i+-n];for(let o=-n;o>0;o--)r(t[i++],e,s);i++}}}this.nodeSet=new cs(t.map(((t,r)=>ls.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:n[r],top:i.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=is;let s=yk(e.tokenData);if(this.context=e.context,this.specialized=new Uint16Array(e.specialized?e.specialized.length:0),this.specializers=[],e.specialized)for(let t=0;t"number"==typeof e?new bk(s,e):e)),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let n=new Sk(this,e,t,i);for(let r of this.wrappers)n=r(n,e,t,i);return n}getGoto(e,t,i=!1){let n=this.goto;if(t>=n[0])return-1;for(let r=n[t+1];;){let t=n[r++],s=1&t,o=n[r++];if(s&&i)return o;for(let i=r+(t>>1);r0}validAction(e,t){if(t==this.stateSlot(e,4))return!0;for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])return!1;i=Nk(this.data,i+2)}if(t==Nk(this.data,i+1))return!0}}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(65535==this.data[i]){if(1!=this.data[i+1])break;i=Nk(this.data,i+2)}if(0==(1&this.data[i+2])){let e=this.data[i+1];t.some(((t,i)=>1&i&&t==e))||t.push(this.data[i],e)}}return t}overrides(e,t){let i=Ck(this.data,this.tokenPrecTable,t);return i<0||Ck(this.data,this.tokenPrecTable,e){let i=e.tokenizers.find((e=>e.from==t));return i?i.to:t}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map((()=>!1));if(e)for(let n of e.split(" ")){let e=t.indexOf(n);e>=0&&(i[e]=!0)}let n=null;for(let e=0;e{if(e.next<0)e.acceptToken(167);else if(10!=e.next&&13!=e.next);else if(t.context.depth<0)e.acceptToken(165,1);else{e.advance();let t=0;for(;32==e.next||9==e.next;)e.advance(),t++;let i=10==e.next||13==e.next||35==e.next;e.acceptToken(i?166:164,-t)}}),{contextual:!0,fallback:!0}),Vk=new Qk(((e,t)=>{let i=t.context.depth;if(i<0)return;let n=e.peek(-1);if((10==n||13==n)&&t.context.depth>=0){let t=0,n=0;for(;;){if(32==e.next)t++;else{if(9!=e.next)break;t+=8-t%8}e.advance(),n++}t!=i&&10!=e.next&&13!=e.next&&35!=e.next&&(t0),this.strict=!1!==e.strict}}({start:Ik,reduce:(e,t)=>e.depth<0&&Ek.indexOf(t)>-1?e.parent:e,shift:(e,t,i,n)=>162==t?new zk(e,function(e){let t=0;for(let i=0;ie.hash}),Zk=new Qk((e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let i=e.peek(t);if(32!=i&&9!=i)return void(40!=i&&46!=i&&10!=i&&13!=i&&35!=i&&e.acceptToken(1))}})),Uk=Au({'async "*" "**" FormatConversion FormatSpec':td.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield":td.controlKeyword,"in not and or is del":td.operatorKeyword,"from def class global nonlocal lambda":td.definitionKeyword,import:td.moduleKeyword,"with as print":td.keyword,Boolean:td.bool,None:td.null,VariableName:td.variableName,"CallExpression/VariableName":td.function(td.variableName),"FunctionDefinition/VariableName":td.function(td.definition(td.variableName)),"ClassDefinition/VariableName":td.definition(td.className),PropertyName:td.propertyName,"CallExpression/MemberExpression/PropertyName":td.function(td.propertyName),Comment:td.lineComment,Number:td.number,String:td.string,FormatString:td.special(td.string),UpdateOp:td.updateOperator,ArithOp:td.arithmeticOperator,BitOp:td.bitwiseOperator,CompareOp:td.compareOperator,AssignOp:td.definitionOperator,Ellipsis:td.punctuation,At:td.meta,"( )":td.paren,"[ ]":td.squareBracket,"{ }":td.brace,".":td.derefOperator,", ;":td.separator}),Mk={__proto__:null,await:40,or:50,and:52,in:56,not:58,is:60,if:66,else:68,lambda:72,yield:90,from:92,async:98,for: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n`%tp%w!b%y#tOr$}rs&Rsw$}wxFSx!_$}!_!`$-Z!`#O$}#O#P! n#P#o$}#o#p!#U#p#q$}#q#r!!S#r~$}Mk[e]||-1}],tokenPrec:6584});function jk(e,t){let i=e.lineIndent(t.from),n=e.lineAt(e.pos,-1),r=n.from+n.text.length;return!/\S/.test(n.text)&&e.node.toi?null:i+e.unit}const Gk=ad.define({parser:Dk.configure({props:[vd.add({Body:e=>{var t;return null!==(t=jk(e,e.node))&&void 0!==t?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except |finally:)/.test(e.textAfter)?e.baseIndent:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":Wd({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":Wd({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":Wd({closing:"]"}),Script:e=>{if(e.pos+/\s*/.exec(e.textAfter)[0].length>=e.node.to){let t=null;for(let i=e.node,n=i.to;i=i.lastChild,i&&i.to==n;)"Body"==i.type.name&&(t=i);if(t){let i=jk(e,t);if(null!=i)return i}}return e.continue()}}),Ed.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":qd,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""']},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});class Lk{constructor(e,t,i,n){this.origin=e,this.changes=t,this.effects=i,this.clientID=n}}class Bk{constructor(e,t){this.version=e,this.unconfirmed=t}}const Fk=Ln.define({combine(e){let t=qr(e,{startVersion:0,clientID:null,sharedEffects:()=>[]});return null==t.clientID&&(t.clientID=e.length&&e[0].generatedID||""),t}}),Kk=yr.define();tr.define({create:e=>new Bk(e.facet(Fk).startVersion,[]),update(e,t){let i=t.annotation(Kk);if(i)return i;let{sharedEffects:n,clientID:r}=t.startState.facet(Fk),s=n(t);return s.length||!t.changes.empty?new Bk(e.version,e.unconfirmed.concat(new Lk(t,t.changes,s,r))):e}});let{autocompletion:Hk,completionKeymap:Jk}=Hp,e_=Jk.find((e=>"Ctrl-Space"===e.key)),t_=Jk.find((e=>"Enter"===e.key)),i_=Jk.find((e=>"Escape"===e.key));const n_=e=>{if(null==e)throw new Error("Unexpected null value");return e},r_=(e,t,i=!0)=>{e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t},selection:Mn.cursor(t.length)}),i&&(e.scrollDOM.scrollLeft=1e5,setTimeout((()=>{e.scrollDOM.scrollLeft=1e5}),100))};class s_ extends k{constructor(e){super(e),this.state={is_button_disabled:!0},this.forced_value="",this.cm=null,this.suggest_not_tmp=()=>{if(!this.cm)return;const e=this.props.suggest_new_file;null!=e&&0===this.cm.state.doc.length&&(r_(this.cm,e.base,!1),this.request_path_completions()),window.dispatchEvent(new CustomEvent("collapse_cell_selection",{}))};this.on_submit=()=>{if(!this.cm)return!0;const e=this.cm;return e.state.doc.toString()===this.forced_value?(this.suggest_not_tmp(),!0):((async e=>{await e()})((async()=>{try{await this.props.on_submit(e.state.doc.toString()),e.dom.blur()}catch(t){r_(e,this.props.value,!0),e.dom.blur()}})),!0)}}componentDidUpdate(){if(this.forced_value!=this.props.value){if(!this.cm)return;const e=this.cm;r_(e,this.props.value,!0),this.forced_value=this.props.value}}componentDidMount(){const e=window.matchMedia("(prefers-color-scheme: dark)").matches;this.cm=new Oh({state:Er.create({doc:"",extensions:[_h(),Oh.domEventHandlers({focus:(e,t)=>(setTimeout((()=>{this.props.suggest_new_file?this.suggest_not_tmp():0===t.state.doc.length&&this.request_path_completions()}),0),!0),blur:(e,t)=>{setTimeout((()=>{t.hasFocus||r_(t,this.props.value,!0)}),200)}}),Oh.updateListener.of((e=>{e.docChanged&&this.setState({is_button_disabled:0===e.state.doc.length})})),Oh.theme({"&":{fontSize:"inherit"},".cm-scroller":{fontFamily:"inherit",overflowY:"hidden",overflowX:"auto"}},{dark:e}),$m(),Hk({activateOnTyping:!0,override:[o_({suggest_new_file:this.props.suggest_new_file,client:this.props.client})],defaultKeymap:!1,maxRenderedOptions:512,optionClass:e=>e.type??""}),Oh.updateListener.of((e=>{e.transactions.forEach((t=>{null!=t.annotation(Hp.pickedCompletion)&&(e.view.dispatch({effects:Oh.scrollIntoView(e.state.doc.length),selection:Mn.cursor(e.state.doc.length)}),this.request_path_completions())}))})),$h.of([{key:"Enter",run:e=>n_(t_).run(e)},{key:"Enter",run:this.on_submit},{key:"Ctrl-Enter",mac:"Cmd-Enter",run:this.on_submit},{key:"Ctrl-Shift-Enter",mac:"Cmd-Shift-Enter",run:this.on_submit},{key:"Escape",run:e=>(n_(i_).run(e),e.dispatch({changes:{from:0,to:e.state.doc.length,insert:this.props.value},selection:Mn.cursor(this.props.value.length),effects:Oh.scrollIntoView(this.props.value.length)}),document.activeElement.blur(),!0),preventDefault:!0},{key:"Tab",run:e=>n_(t_).run(e)?(this.request_path_completions(),!0):this.request_path_completions()}]),$h.of(Jk),jh(this.props.placeholder)]})}),this.base.insertBefore(this.cm.dom,this.base.firstElementChild)}render(){return xe` + + + + `}request_path_completions(){if(!this.cm)return;let e=this.cm.state.selection.main;return e.from===e.to&&this.cm.state.doc.length===e.to?n_(e_).run(this.cm):void 0}}const o_=({client:e,suggest_new_file:t})=>i=>{i.state.selection.main.to;const n=i.state.doc.toString();return e.send("completepath",{query:n}).then((e=>{const i=n.split("/").pop().split("\\").pop(),r=e.message.results,s=cn(n,e.message.start),o=cn(n,e.message.stop);if(r.length>=1&&r[0]==i)return null;let a=r.map((e=>{let t=e.endsWith("/")||e.endsWith("\\");return{label:e,type:t?"dir":"file",boost:t?1:0}}));if(null!=t)for(let e=3;e>=0;e--){const t=".jl".substring(0,e);if(i.endsWith(t)){let t=i+".jl".substring(e);if(".jl"==t&&(t="notebook.jl"),3==e)return null;r.includes(t)||a.push({label:t+" (new)",apply:t,type:"file new",boost:-99});break}}return{options:a,from:s,to:o}}))},a_=e=>e?Object.entries(e).reduce(((e,[t,i])=>i?t+" "+e:e),""):null;let l_=j(),c_=j(null),O_=j(null);class h_ extends Set{constructor(e){super(),this.callback=e}delete(e){let t=super.delete(e);return t&&0===this.size&&this.callback(),t}}const u_=()=>"visible"===document.visibilityState?Promise.resolve():new Promise((e=>{const t=()=>{u_().then(e),document.removeEventListener("visibilitychange",t)};document.addEventListener("visibilitychange",t)})),d_=({any_code_differs:e,last_update_time:t,last_hot_reload_time:i,connected:n})=>{let r=de(l_);const[s,o]=oe(""),[a,l]=oe(""),c=Oe(null),O=Oe(null);le((()=>(clearTimeout(null==c?void 0:c.current),e?o("ask_to_save"):Date.now()-t<1e3?(o("saved"),c.current=setTimeout((()=>{o("")}),1e3)):o(""),()=>clearTimeout(null==c?void 0:c.current))),[e]);const[h,u]=oe(!1);return le((()=>{n&&setTimeout((()=>u(!0)),1e3)}),[n]),le((()=>{if(console.log("Hottt",i,h),h)return l("reloaded_from_file"),console.log("set state"),u_().then((()=>{O.current=setTimeout((()=>{l(""),console.log("reset state")}),8e3)})),()=>clearTimeout(null==O?void 0:O.current)}),[i]),xe` + ${"ask_to_save"===s?xe` +
+ +
+ `:"saved"===s||"saving"===s?xe` +
+ Saved +
+ `:"reloaded_from_file"===a?xe` +
+ File change detected, notebook updated +
+ `:null} +
`},f_=({frame:e,cell_id:t})=>{const i=e.file.indexOf("#==#");if(-1!=i){const n=e.file.substr(i+4),r=xe`{window.dispatchEvent(new CustomEvent("cell_focus",{detail:{cell_id:n,line:e.line-1}})),t.preventDefault()}} + > + ${n==t?"Local":"Other"}: ${e.line} + `;return xe`${r}`}return xe`${e.file}:${e.line}`},p_=({frame:e})=>{const t=e.call.indexOf("(");return-1!=t?xe`${e.call.substr(0,t)}${e.call.substr(t)}`:xe`${e.call}`},m_=e=>e.flatMap(((t,i)=>i===e.length-1?[t]:i===e.length-2?[t," and "]:[t,", "])),g_=({msg:e,stacktrace:t,cell_id:i})=>{var n;let r=de(l_);const s={pattern:/.?/,display:e=>e.split("\n").map((e=>xe`

${e}

`))},o=[{pattern:/syntax: extra token after end of expression/,display:e=>{const t=xe`{e.preventDefault(),r.wrap_remote_cell(i,"begin")}} + >Wrap all code in a begin ... end block.`;if(e.includes("\n\nBoundaries: ")){const n=JSON.parse(e.split("\n\nBoundaries: ")[1]).map((e=>e-1)),s=xe`

+ {e.preventDefault(),r.split_remote_cell(i,n,!0)}} + >Split this cell into ${n.length} cells, or +

`;return xe`

Multiple expressions in one cell.

+

How would you like to fix it?

+
    +
  • ${s}
  • +
  • ${t}
  • +
`}return xe`

Multiple expressions in one cell.

+

${t}

`}},{pattern:/LoadError: cannot assign a value to variable workspace#\d+\..+ from module workspace#\d+/,display:()=>xe`

Tried to reevaluate an include call, this is not supported. You might need to restart this notebook from the main menu.

+

+ For a workaround, use the alternative version of include described here: + GH issue 115 +

+

In the future, include will be deprecated, and this will be the default.

`},{pattern:/MethodError: no method matching .*\nClosest candidates are:/,display:e=>e.split("\n").map((e=>xe`

${e}

`))},{pattern:/Cyclic references among (.*)\./,display:e=>e.split("\n").map((e=>{const t=e.match(/Cyclic references among (.*)\./);if(t){let e=t[1].split(/, | and /).map((e=>xe`${e}`));return xe`

Cyclic references among${" "}${m_(e)}.

`}return xe`

${e}

`}))},{pattern:/Multiple definitions for (.*)\./,display:e=>e.split("\n").map((e=>{const t=e.match(/Multiple definitions for (.*)\./);if(t){let e=t[1].split(/, | and /).map((e=>xe`{const n=document.querySelector(`pluto-cell:not([id='${i}']) span[id='${encodeURI(e)}']`);t.preventDefault(),null==n||n.scrollIntoView()}}>${e}`));return xe`

Multiple definitions for${" "}${m_(e)}.

`}return xe`

${e}

`}))},{pattern:/^UndefVarError: (.*) not defined\.?$/,display:e=>{const t=r.get_notebook(),n=$_(t,i),s=e.match(/UndefVarError: (.*) not defined/);let o=(null==s?void 0:s[1])??"";const a=Object.values((null==t?void 0:t.cell_dependencies)??{}).some((e=>Object.keys(e.downstream_cells_map).includes(o)));if(0===Object.keys(n).length||!a)return xe`

${e}

`;const l=Object.keys(n).map((e=>xe`{t.preventDefault();const i=document.querySelector(`pluto-cell[id='${n[e]}']`);null==i||i.scrollIntoView()}}>${e}`));return xe`

Another cell defining ${m_(l)} contains errors.

`},show_stacktrace:()=>{const e=$_(r.get_notebook(),i);return 0===Object.keys(e).length}},s],a=o.find((({pattern:t})=>t.test(e)))??s;return xe` +
${a.display(e)}
+ ${0!=t.length&&((null===(n=a.show_stacktrace)||void 0===n?void 0:n.call(a))??1)?xe`
+
    + ${t.map((e=>xe`
  1. + <${p_} frame=${e} /> + @ + <${f_} frame=${e} cell_id=${i} /> + ${e.inlined?xe`[inlined]`:null} +
  2. `))} +
+
`:null} +
`},$_=(e,t,i=[])=>{var n;let r={};if(null!=e&&(null==e||null===(s=e.cell_results)||void 0===s||null===(n=s[t])||void 0===n?void 0:n.errored)){var s;Object.keys(null===(s=e.cell_dependencies[t])||void 0===s?void 0:s.upstream_cells_map).forEach((n=>{if(!i.includes(n)){var s;i.push(n);(null===(s=e.cell_dependencies[t])||void 0===s?void 0:s.upstream_cells_map[n]).forEach((s=>{let o=$_(e,s,i)??{};r={...r,...o},0===Object.keys(o).length&&e.cell_results[s].errored&&s!==t&&(r[n]=s)}))}}))}return r},b_=({mime:e,body:t,cell_id:i,persist_js_state:n})=>{switch(e){case"image/png":case"image/jpg":case"image/jpeg":case"image/gif":case"image/bmp":case"image/svg+xml":return xe`<${QR} mime=${e} body=${t} />`;case"text/plain":return xe`
${t}
`;case"application/vnd.pluto.tree+object":return xe`<${w_} cell_id=${i} body=${t} persist_js_state=${n} />`;default:return yR({mime:e,body:t,cell_id:i,persist_js_state:n,last_run_timestamp:null})}},Q_=({on_click_more:e})=>{const[t,i]=oe(!1);return xe`{t||!1!==e()&&i(!0)}} + >more`},y_=({prefix:e,prefix_short:t})=>xe`${e}${t}`,P_=({pluto_actions:e,cell_id:t,node_ref:i,objectid:n,dim:r})=>{(e??i.current.closest("pluto-cell")._internal_pluto_actions).reshow_cell(t??i.current.closest("pluto-cell").id,n,r)},w_=({mime:e,body:t,cell_id:i,persist_js_state:n})=>{let r=de(l_);const s=Oe(null),o=e=>xe`<${b_} cell_id=${i} mime=${e[1]} body=${e[0]} persist_js_state=${n} />`,a=xe`<${Q_} on_click_more=${()=>{if(null==s.current||null!=s.current.closest("pluto-tree.collapsed"))return!1;P_({pluto_actions:r,cell_id:i,node_ref:s,objectid:t.objectid,dim:1})}} />`;var l=null;switch(t.type){case"Pair":const e=t.key_value;return xe`${o(e[0])}${o(e[1])}`;case"circular":return xe`circular reference`;case"Array":case"Set":case"Tuple":l=xe`${y_(t)}${t.elements.map((e=>"more"===e?a:xe`${"Set"===t.type?"":xe`${e[0]}`}${o(e[1])}`))}`;break;case"Dict":l=xe`${y_(t)}${t.elements.map((e=>"more"===e?a:xe`${o(e[0])}${o(e[1])}`))}`;break;case"NamedTuple":l=xe`${y_(t)}${t.elements.map((e=>"more"===e?a:xe`${e[0]}${o(e[1])}`))}`;break;case"struct":l=xe`${y_(t)}${t.elements.map((e=>xe`${e[0]}${o(e[1])}`))}`}return xe``},k_=({mime:e,body:t,cell_id:i,persist_js_state:n})=>{let r=de(l_);const s=Oe(null),o=e=>xe`<${Q_} + on_click_more=${()=>{P_({pluto_actions:r,cell_id:i,node_ref:s,objectid:t.objectid,dim:e})}} + />`,a=null==t.schema?null:xe` + + ${["",...t.schema.names].map((e=>xe`${"more"===e?o(2):e}`))} + + + ${["",...t.schema.types].map((e=>xe`${"more"===e?null:e}`))} + + `,l=xe` + ${t.rows.map((e=>xe` + ${"more"===e?xe`${o(1)}`:xe`${e[0]} + ${e[1].map((e=>{return xe`${"more"===e?null:(t=e,xe`<${b_} cell_id=${i} mime=${t[1]} body=${t[0]} persist_js_state=${n} />`)}`;var t}))}`} + `))} + `;return xe` + ${a}${l} +
`};const __=e=>null==e?[null]:Object.entries(e).flat(),v_=({nbpkg:e,package_name:t,available_versions:i,is_disable_pkg:n})=>{let r="error",s="error",o=xe`error`,a=!1;const l=(null==e?void 0:e.installed_versions[t])??null,c=((null==e?void 0:e.busy_packages)??[]).includes(t)||!((null==e?void 0:e.instantiated)??1);if(n){r="disable_pkg",s=`${t} disables Pluto's built-in package manager.`,o=xe`${t} disables Pluto's built-in package manager.`}else null!=l||Rt.isEqual(i,["stdlib"])?null==l||"stdlib"===l?(r="installed",s=`${t} is part of Julia's pre-installed 'standard library'.`,o=xe`${t} is part of Julia's pre-installed standard library.`):c?(r="busy",s=`${t} (v${l}) is installing...`,o=xe`
${t} v${l}
+ is installing...`):(r="installed",s=`${t} (v${l}) is installed in the notebook.`,o=xe`
${t} v${l}
+ is installed in the notebook.`,h=i,a=!("stdlib"===(O=l)||!Rt.isArray(h))&&Rt.last(h)!==O):null!=i&&Rt.isArray(i)&&(0===i.length?(r="not_found",s=`The package "${t}" could not be found in the registry. Did you make a typo?`,o=xe`The package "${t}" could not be found in the registry. +
Did you make a typo?
`):(r="will_be_installed",s=`${t} (v${Rt.last(i)}) will be installed in the notebook when you run this cell.`,o=xe`
${t} v${Rt.last(i)}
+ will be installed in the notebook when you run this cell.`));var O,h;return{status:r,hint:o,hint_raw:s,available_versions:i,chosen_version:l,busy:c,offer_update:a}},x_=({package_name:e,pluto_actions:t,notebook_id:i,nbpkg:n})=>{const[r,s]=oe(null);le((()=>{(t.get_avaible_versions({package_name:e,notebook_id:i})??Promise.resolve([])).then((e=>{s(e)}))}),[e]);const{status:o,hint_raw:a}=v_({nbpkg:n,package_name:e,is_disable_pkg:!1,available_versions:r});return xe` + + + + `},X_=({package_name:e})=>{const{hint_raw:t}=v_({nbpkg:null,package_name:e,is_disable_pkg:!0,available_versions:null});return xe` + + + + `};var S_=AnsiUp=window.AnsiUp;const R_=({value:e})=>{const t=Oe(null);return le((()=>{if(!t.current)return;t.current.innerHTML=(new S_).ansi_to_html(e);const i=t.current.parentElement;i&&(i.scrollTop=1e5)}),[t.current,e]),xe`
`},T_=(e,t)=>{const i=((e,t)=>{var i,n;return Object.values((null==t||null===(i=t.cell_dependencies)||void 0===i||null===(n=i[e])||void 0===n?void 0:n.upstream_cells_map)||{}).flatMap((e=>e))})(e,t);return 0===i.length?[]:[...i,...i.flatMap((e=>T_(e,t)))]},W_=({runtime:e,running:t,queued:i,code_differs:n,on_run:r,on_interrupt:s,depends_on_disabled_cells:o,running_disabled:a,cell_id:l})=>{const c=r,O=N_(t),h=null==O?null:1e6*O,u=de(l_),d=t||i?"interrupt":a?"save":o&&!n?"jump":"run";return xe` + + + ${A_(t?h??e:e)} + + `},A_=e=>{if(null==e)return"---";let t=e;const i=["n","μ","m",""];let n=0;for(;n=1e3;)n+=1,t/=1e3;return t.toFixed(e<100||t>=100?0:1)+" "+i[n]+"s"},N_=e=>{const[t,i]=oe(0),[n,r]=oe(0);return le((()=>{let t;if(e){const e=+new Date;r(e),i(e),t=setInterval((()=>i(+new Date)),50)}return()=>{t&&clearInterval(t)}}),[e]),e?t-n:void 0},C_=(e,t=5)=>{const[i,n]=oe(e),r=he((()=>Rt.debounce(n,1e3*t)),[n]);return le((()=>(e?(n(!0),r.cancel()):r(!1),()=>{})),[e]),i};var E_;E_=r("8LcMF").getBundleURL("7rd1W")+r("jTduX").resolve("gLApS");const q_=new URL(E_);var V_;V_=r("8LcMF").getBundleURL("7rd1W")+r("jTduX").resolve("hfbF0");const z_=new URL(V_);var I_;I_=r("8LcMF").getBundleURL("7rd1W")+r("jTduX").resolve("8ladp");const Y_=new URL(I_),Z_=e=>{window.dispatchEvent(new CustomEvent("open pluto popup",{detail:e}))},U_=({notebook:e})=>{const[t,i]=oe(null),n=Oe(null),r=Oe(""),s=e=>{const t=e.detail.source_element;n.current=t;const s=t.getBoundingClientRect(),o=document.body.getBoundingClientRect();r.current=`top: ${.5*(s.top+s.bottom)-o.top}px; left: min(max(0px,100vw - 251px - 30px), ${s.right-o.left}px);`,i(e.detail)};le((()=>{const e=e=>{null!=e.target&&null==e.target.closest("pluto-popup")&&null!=n.current&&(n.current.contains(e.target)||i(null))},t=e=>{"Escape"===e.key&&i(null)};return window.addEventListener("open pluto popup",s),window.addEventListener("pointerdown",e),document.addEventListener("keydown",t),()=>{window.removeEventListener("open pluto popup",s),window.removeEventListener("pointerdown",e),document.removeEventListener("keydown",t)}}),[]);const o=null==t?void 0:t.type;return xe` + ${"nbpkg"===o?xe`<${M_} notebook=${e} recent_event=${t} clear_recent_event=${()=>i(null)} />`:"info"===o?xe`
${null==t?void 0:t.body}
`:null} +
`},M_=({notebook:e,recent_event:t,clear_recent_event:i})=>{var n,r,s,o,a;let l=de(l_);const[c,O]=oe(null);var h;le((()=>{let i=!0;return null==t?O(null):"nbpkg"===(null==t?void 0:t.type)&&(l.get_avaible_versions({package_name:t.package_name,notebook_id:e.notebook_id})??Promise.resolve([])).then((n=>{i&&O(v_({nbpkg:e.nbpkg,package_name:t.package_name,is_disable_pkg:t.is_disable_pkg,available_versions:n}))})),()=>{i=!1}}),[t,...(h=e.nbpkg,null==h?[null]:Object.entries(h).flatMap((([e,t])=>"terminal_outputs"===e?[]:[t])))]),le((()=>{var t;((null===(t=e.nbpkg)||void 0===t?void 0:t.enabled)??1)||i()}),[(null===(n=e.nbpkg)||void 0===n?void 0:n.enabled)??!0]);const[u,d]=oe(!1),f=null!=t&&(((null===(r=e.nbpkg)||void 0===r?void 0:r.busy_packages)??[]).includes(t.package_name)||!((null===(s=e.nbpkg)||void 0===s?void 0:s.instantiated)??1)),p=C_(f,2);le((()=>{d(p)}),[p]);const m=null==(null===(o=e.nbpkg)||void 0===o?void 0:o.terminal_outputs)?"Loading...":(null===(a=e.nbpkg)||void 0===a?void 0:a.terminal_outputs[null==t?void 0:t.package_name])??"",g=(null==c?void 0:c.offer_update)??!1;return xe` + ${(null==c?void 0:c.hint)??"Loading..."} + + <${R_} value=${m??"Loading..."} /> + `};function D_(e){if(!(e instanceof HTMLInputElement))return e instanceof HTMLSelectElement&&e.multiple?Array.from(e.selectedOptions,(e=>e.value)):e.value;switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":var t;return e.multiple?e.files:null===(t=e.files)||void 0===t?void 0:t[0];default:return e.value}}function j_(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}const G_=(e,t)=>{if(!(e instanceof HTMLInputElement&&"file"===e.type))if(null!=t){if(e instanceof HTMLInputElement)switch(e.type){case"range":case"number":return void(e.valueAsNumber!==t&&(e.valueAsNumber=t));case"date":return void(null!=e.valueAsDate&&Number(e.valueAsDate)===Number(t)||(e.valueAsDate=t));case"checkbox":return void(e.checked!==t&&(e.checked=t));case"file":return}else if(e instanceof HTMLSelectElement&&e.multiple){for(let i of Array.from(e.options))i.selected=t.includes(i.value);return}e.value!==t&&(e.value=t)}else e.value=t},L_=(e,t)=>{e.forEach((e=>{let i=e.getAttribute("def");if(null!=i&&null!=e.firstElementChild&&null!=t[i]){let n=t[i].value;try{G_(e.firstElementChild,n)}catch(t){console.error("Error while setting input value",e.firstElementChild,"to value",n,": ",t)}}}))},B_=(e,t,i,n)=>{let r=!1;n.then((()=>{r=!0})),e.forEach((async e=>{const n=e.getAttribute("def"),s=e.firstElementChild;if(null!=n&&null!=s){var o;const e=D_(s);const a=Object.keys(i).includes(n)&&Rt.isEqual(null===(o=i[n])||void 0===o?void 0:o.value,e)?null:t(n,e).catch(console.error);let l=!1;for(let e of function(e){return Wt.Generators.observe((function(t){var i=j_(e),n=D_(e);function r(){t(D_(e))}return e.addEventListener(i,r),void 0!==n&&t(n),function(){e.removeEventListener(i,r)}}))}(s)){if(r)break;if(!1===l){l=!0;continue}const i=await F_(await e);await a,await t(n,i).catch(console.error)}}}))},F_=async e=>e instanceof FileList?Promise.all(Array.from(e).map((e=>F_(e)))):e instanceof File?await new Promise((t=>{const i=new FileReader;i.onload=()=>t({name:e.name,type:e.type,data:new Uint8Array(i.result)}),i.onerror=()=>t({name:e.name,type:e.type,data:null}),i.readAsArrayBuffer(e)})):e;function K_(e){this.getChildContext=()=>e.context;const{context:t,children:i,...n}=e;return D(i,n)}function H_(){if(this.on_connect)this.on_connect();else{const e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e);const t=e.detail.context;this._vdom=Q(K_,{...this._props,context:t},nv(this,this._vdomComponent)),(this.hasAttribute("hydrate")?M:U)(this._vdom,this._root)}}function J_(e){return e.replace(/-(\w)/g,((e,t)=>t?t.toUpperCase():""))}function ev(e,t,i){if(!this._vdom)return;i=null==i?void 0:i;const n={};n[e]=i,n[J_(e)]=i,this._vdom=D(this._vdom,n),U(this._vdom,this._root)}function tv(){const e=setTimeout((()=>{U(this._vdom=null,this._root)}),500);this.on_connect=()=>clearTimeout(e)}function iv(e,t){return Q("slot",{...e,ref:e=>{e?(this.ref=e,this._listener||(this._listener=e=>{e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",this._listener))):this.ref.removeEventListener("_preact",this._listener)}})}function nv(e,t){if(3===e.nodeType)return e.data;if(1!==e.nodeType)return null;let i=[],n={},r=0,s=e.attributes,o=e.childNodes;for(r=s.length;r--;)"slot"!==s[r].name&&(n[s[r].name]=s[r].value,n[J_(s[r].name)]=s[r].value);for(r=o.length;r--;){const e=nv(o[r],null),t=o[r].slot;t?n[t]=Q(iv,{name:t},e):i[r]=e}const a=t?Q(iv,null,i):i;return Q(t||e.nodeName.toLowerCase(),n,a)}var rv={};e(rv,"default",(()=>gv),(e=>gv=e));var sv=Object.create,ov=Object.defineProperty,av=Object.getOwnPropertyDescriptor,lv=Object.getOwnPropertyNames,cv=Object.getPrototypeOf,Ov=Object.prototype.hasOwnProperty,hv=(e,t)=>((e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of lv(t))!Ov.call(e,r)&&(i||"default"!==r)&&ov(e,r,{get:()=>t[r],enumerable:!(n=av(t,r))||n.enumerable});return e})((e=>ov(e,"__esModule",{value:!0}))(ov(null!=e?sv(cv(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),uv=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(((e,t)=>{var i=Symbol("baseMap"),n=class{constructor(e){this.value=e}};function r(e){if(!Array.isArray(e))throw new TypeError("The keys parameter must be an array")}function s({[i]:e},t,n){for(let i of t){if(!e.has(i)){if(!n)return;e.set(i,new WeakMap)}e=e.get(i)}return e}t.exports=class extends WeakMap{constructor(){super(),this[i]=new WeakMap;let[e]=arguments;if(null!=e){if("function"!=typeof e[Symbol.iterator])throw new TypeError(typeof e+" is not iterable (cannot read property Symbol(Symbol.iterator))");for(let[t,i]of e)this.set(t,i)}}set(e,t){return r(e),s(this,e,!0).set(n,t),this}get(e){r(e);let t=s(this,e);return t?t.get(n):void 0}has(e){r(e);let t=s(this,e);return Boolean(t)&&t.has(n)}delete(e){r(e);let t=s(this,e);return Boolean(t)&&t.delete(n)}get[Symbol.toStringTag](){return"ManyKeysWeakMap"}}})),dv=hv(uv()),fv=hv(uv()),{default:pv,...mv}=fv,gv=dv.default??pv??mv;let $v=e=>om().language.parser.parse(e).topNode.firstChild;const bv=!1;let Qv=(e,t=(e=>e),i=new Map)=>(...n)=>{let r=t(...n),s=i.get(r);if(null!=s)return s;{let t=e(...n);if(null==t)throw new Error("Memoized function returned undefined");return i.set(r,t),t}},yv=(e,t=((...e)=>e))=>Qv(e,t,new rv.default),Pv=e=>Qv(e,(e=>e),new WeakMap),wv=function*(e){if(e.firstChild())try{do{yield e}while(e.nextSibling())}finally{e.parent()}},kv=function*(e){if(e.firstChild){let t=e.firstChild;do{yield t}while(t=t.nextSibling)}},_v=(e,t,i,n=!1)=>{if(n){console.group("Current haystack:",e?e.node.name:null),console.groupCollapsed("Details");try{console.log("template:",t),console.log("haystack_cursor:",e?e.node.toString():null),"node"in t?(console.log("template.node:",t.node),console.log("template.node.toString():",t.node.toString())):"pattern"in t&&console.log("template.pattern:",t.pattern)}finally{console.groupEnd()}}try{if("pattern"in t){let r=t.pattern;if("function"!=typeof r)throw new Error(`Unknown pattern "${r}"`);let s={};n&&(s={...i},console.groupCollapsed(`Matching against pattern: ${t.pattern.name}()`));let o=null;try{o=r(e,i,n)}finally{n&&console.groupEnd()}if(n)if(o){if(console.log("✅ because the pattern was happy! All hail the pattern!"),!Rt.isEqual(i,s)){let e=Rt.omit(i,Object.keys(s));console.log(" WE EVEN GOT NEW MATCHES SAY WHAAAAAAT:",e)}}else console.log("❌ because... well, you should ask the pattern that!");return o}if(!("node"in t))throw console.log("template:",t),new Error("waaaah");{let{node:r,children:s}=t;if(n&&console.log(`Matching against node: ${t.node.name}`),!e)return"end"===r.name?(n&&console.log("✅ No node left to match, but it was the end anyway"),!0):(n&&console.log("❌ because no cursor left to match against"),!1);if(e.type.isError)return n&&console.log("✅ because ⚠"),!0;if(e.name!==r.name)return n&&console.log(`❌ because name mismatch "${e.name}" !== "${r.name}"`),!1;if(!e.firstChild()){if(0!==t.children.length){n&&console.log("Haystack node is empty, but template has children... lets see");for(let e of t.children)if(!_v(null,e,i,n))return n&&console.log("❌ because child template wasn't okay with having no children",e),!1;return n&&console.log("✅ All template children we're fine with having no children to check on"),!0}return n&&console.log("✅ Template also has no children, yayyy"),!0}try{let r=!1;for(let t of s){if(r){if(n&&console.log("Haystack is empty, but there are more children in template... lets see"),!_v(null,t,i,n))return n&&console.log("❌ template child did not accept null for an answer",t,e.toString()),!1;n&&console.log("👌🏽 This template child was fine with null");continue}for(;("Comment"===e.name||"BlockComment"===e.name)&&e.nextSibling(););if(!_v(e,t,i,n))return n&&console.log("❌ because a child mismatch",t,e.toString()),!1;r=!e.nextSibling()}if(n&&!r){let i=[];do{i.push(e.node)}while(e.nextSibling());for(let t of i)e.prevSibling();console.warn("We did match all the children of the template, but there are more in the haystack... Might want to actually not match this?",i,t)}return n&&console.log("✅ because all children match"),!0}finally{e.parent()}}}finally{n&&console.groupEnd()}};class vv{constructor(e,t){let i=[],n=[];i.push(e[0]);for(let[r,s]of Rt.zip(e.slice(1),t))if(s instanceof vv){i[i.length-1]+=s.template[0];for(let[e,t]of Rt.zip(s.template.slice(1),s.substitutions))n.push(t),i.push(e);i[i.length-1]+=r}else n.push(s),i.push(r);this.template=i,this.substitutions=n}}let xv=(e,t)=>{for(let i of t)if(e.from===i.from&&e.to===i.to){i.used=!0;let t=i.generator.next({name:e.name,from:e.from,to:e.to,node:e});if(t.done)return t.value;throw new Error("Template generator not done providing ast node")}return{name:e.name,from:e.from,to:e.to,children:Array.from(kv(e)).map((e=>xv(e,t))),node:e}},Xv=function*(e){try{if(e instanceof vv){let t="",i=[];for(let[n,r]of Rt.zip(e.template,e.substitutions))if(t+=n,r){let e=Xv(r),n=Zv(e.next());i.push({from:t.length,to:t.length+n.length,generator:e}),t+=n}let n=yield t,r=i.map((e=>({from:e.from+n.from,to:e.to+n.from,generator:e.generator,used:!1})));bv;let s=xv(n.node,r),o=r.filter((e=>!e.used)).map((e=>({text:t.slice(e.from,e.to),from:e.from,to:e.to})));if(o.length>0)throw new Error(`Some substitutions not applied, this means it couldn't be matched to a AST position: ${JSON.stringify(o)}`);return s}if("function"==typeof e)return yield*e();throw console.log("julia_code_object:",e),new Error("Unknown substition type")}finally{}},Sv=yv(((e,...t)=>new vv(e,t))),Rv=new WeakMap,Tv=(e,...t)=>{let i=Rv.get(e);if(null!=i){let{input:e,result:t}=i;return t}{let i=new vv(e,t);return Rv.set(e,{input:t,result:i}),i}},Wv=Pv((e=>{let t=Xv(e),i=Zv(t.next()),n=$v(i),r=Uv(t.next({from:0,to:i.length,name:n.name,node:n}));return{template_description:r,match(e,t=!1){if("node"in r&&r.node.name!==e.name)return;if(e.type.isError)return null;"cursor"in e&&(e=e.cursor());let i={};t&&console.groupCollapsed(`Starting a match at ${e.name}`);try{return _v(e,r,i,t)?i:null}finally{t&&console.groupEnd()}}}})),Av=Pv((e=>{let t=Xv(e),i=Zv(t.next());return t.return(),i})),Nv=(Pv((e=>$v(Av(e)))),Pv((e=>un.of([Av(e)]))),e=>{let t={},i=Qv((i=>Pv((n=>e(i,n===t?void 0:n)))));return(e,n=t)=>i(e)(n)});function*Cv(){return yield"expression",{pattern:function(e,t,i=!1){return e?!e.type.is("keyword")||(i&&console.log("❌ Keywords are not allowed!"),!1):(i&&console.log("❌ I want anything!! YOU GIVE ME NULL???"),!1)}}}const Ev={any:Cv,many:Nv(((e,t=Cv)=>function*(){let i=Xv(t),n=yield Zv(i.next()),r=null,s=null;return n.node.firstChild&&n.node.from===n.node.firstChild.from&&n.node.to===n.node.firstChild.to?(r=n.node,s=Uv(i.next({...n,node:n.node.firstChild}))):s=Uv(i.next(n)),{narrowed_node:r,sub_template:s,pattern:function(t,i,n=!1){if(!t)return n&&console.log("✅ Nothing to see here... I'm fine with that - many"),!0;if(r){if(t.name!==r.name)return n&&console.log("❌ Tried to go in, but she wasn't my type - many"),t.prevSibling(),!0;t.firstChild()}try{let o=[];for(;;){if(t.type.isError)return t.prevSibling(),n&&console.log("✋ I don't do errors - many"),!0;let e={};if(!_v(t,s,e,n)){t.prevSibling();break}if(o.push({node:t.node,match:e}),!t.nextSibling())break}return null!=e&&(i[e]=o),!0}finally{r&&t.parent()}}}})),maybe:Pv((e=>function*(){let t=yield*Xv(e);return{sub_template:t,pattern:function(e,i,n=!1){if(!e)return!0;if(e.type.isError)return!0;return!1===_v(e,t,i,n)&&e.prevSibling(),!0}}})),anything_that_fits:Pv((e=>function*(){return yield*Xv(e),{pattern:function(e,t,i=!1){return!0}}})),something_with_the_same_type_as:Pv((e=>function*(){let t=Xv(e),i=Zv(t.next()),n=yield i;return t.return(),{pattern:function(e,t,i=!1){return null!=e&&n.name===e.name}}})),as:Nv(((e,t=Cv)=>function*(){let i=yield*Xv(t);return{sub_template:i,pattern:function(t,n,r=!1){let s=_v(t,i,n,r);return!0===s&&(n[e]=null==t?void 0:t.node),null!=t&&s}}})),Identifier:function*(){return yield"identifier",{pattern:function(e,t,i=!1){return null!=e&&"Identifier"===zv(e)}}},Number:function*(){return yield"69",{pattern:function(e,t,i=!1){return null!=e&&"Number"===zv(e)}}},String:function*(){return yield'"A113"',{pattern:function(e,t,i=!1){return null!=e&&("StringWithoutInterpolation"===zv(e)||"TripleStringWithoutInterpolation"===zv(e))}}}};let qv=yv(((e,t)=>{let i=Xv(e),n=Zv(i.next()),r=$v(n),s=null;if(s=t.match(r)){let{content:e}=s,t=[];for(;e.firstChild&&e.firstChild.from==e.from&&e.firstChild.to==e.to;)t.push(e.type),e=e.firstChild;if(null==e)throw console.log("match:",s),new Error("No content match?");let n=Uv(i.next({name:e.name,node:e,from:r.from,to:r.to}));return{possible_parents:t,template_description:n,match(e,i=!1){if(e.type.isError)return i&&console.log(`❌ Short circuiting because haystack(${e.name}) is an error`),!1;"cursor"in e&&(e=e.cursor());let r=0;for(let n of t){if(e.type!==n)break;{let t=e.from,s=e.to;if(e.firstChild()){if(e.from!==t||e.to!==s){e.parent(),i&&console.log(`❌ Was matching possible parent (${n}), but it wasn't filling?! That's weird.... ${e.toString()}`);for(let t=0;te.firstChild&&e.firstChild.from===e.from&&e.firstChild.to===e.to?Vv(e.firstChild):e,zv=e=>{let t=e.from,i=e.to;if(e.firstChild())try{if(e.from===t&&e.to===i)return zv(e)}finally{e.parent()}return e.name},Iv=e=>t=>{let i=Wv(e(Ev.as("content",t)));return qv(e(t),i)};function Yv({tree:e,enter:t,leave:i,from:n=0,to:r=e.length}){let s=e.cursor();for(;;){let e=!1;if(s.from<=r&&s.to>=n&&(s.type.isAnonymous||!1!==t(s))){if(s.firstChild())continue;s.type.isAnonymous||(e=!0)}for(;e&&i&&i(s),e=s.type.isAnonymous,!s.nextSibling();){if(!s.parent())return;e=!0}}}let Zv=e=>{if(e.done)throw new Error("Expected `yield`-d value, but got `return`");return e.value},Uv=e=>{if(e.done)return e.value;throw new Error("Expected `yield`-d value, but got `return`")},Mv=(e,t)=>{if(e===t)return e;let i=[...e.usages,...t.usages],n=new Map(e.definitions);for(let[e,i]of t.definitions)n.set(e,i);return{usages:i,definitions:n,locals:[...e.locals,...t.locals]}},Dv=function*(e){for(let t of wv(e))if("InterpolationExpression"===t.name)yield e;else if("QuoteExpression"===t.name||"QuoteStatement"===t.name)for(let e of Dv(t))yield*Dv(e);else yield*Dv(t)},jv=e=>{let t=Iv(e);return function(e,i=!1){return null==e?(e,...i)=>t(Tv(e,...i)):function(n,...r){return t(Tv(n,...r)).match(e,i)}}},Gv=jv((e=>Sv`[i for i in i ${e}]`)),Lv=jv((e=>Sv`${e} = nothing`)),Bv=jv((e=>Sv`function f(${e}) end`)),Fv=jv((e=>Sv`f(${e})`)),Kv=jv((e=>Sv`f(; ${e})`)),Hv=(e,t,i,n=!1)=>{let r=null;if(r=Fv(e)`; ${Ev.many("named_args")}`){let{named_args:e=[]}=r;for(let{node:r}of e)i=Hv(r,t,i,n);return i}if(r=Bv(e)`${Ev.Identifier}`)return ax(i,t,e);if(r=Bv(e)`${Ev.as("subject")}...`)return Jv(r.subject,t,i,null,n);if(r=Bv(e)`${Ev.as("name")} = ${Ev.as("value")}`){let{name:e,value:s}=r;return i=Jv(e,t,i,s.to,n),i=lx(s.cursor(),t,i,n)}if((r=Bv(e)`${Ev.as("name")}::${Ev.as("type")}`)??(r=Bv(e)`${Ev.as("name")}:`)??(r=Bv(e)`::${Ev.as("type")}`)){let{name:e,type:s}=r;return e&&(i=Jv(e,t,i,s.to,n)),s&&(i=lx(s.cursor(),t,i,n)),i}return n&&console.warn("UNKNOWN FUNCTION DEFINITION ARGUMENT:",e.toString()),i},Jv=(e,t,i,n=null,r=!1)=>{let s=null;r&&console.group("Explorering pattern:",e.toString());try{if(s=Lv(e)`${Ev.Identifier}`)return r&&console.log("It's an identifier, adding it to the scope"),ax(i,t,e,n);if(s=Lv(e)`${Ev.as("object")}::${Ev.as("type")}`){let{object:e,type:n}=s;return i=lx(n.cursor(),t,i,r),i=ax(i,t,e)}if(s=Lv(e)`${Ev.as("subject")}...`)return Jv(s.subject,t,i,n,r);if(s=Bv(e)`${Ev.as("name")} = ${Ev.as("value")}`){let{name:e,value:n}=s;return i=Jv(e,t,i,n.from,r),i=lx(n.cursor(),t,i,r)}if((s=Lv(e)`${Ev.as("first")}, ${Ev.many("rest")}`)??(s=Lv(e)`(${Ev.as("first")}, ${Ev.many("rest")})`)){for(let{node:e}of[{node:s.first},...s.rest??[]])i=Jv(e.cursor(),t,i,n,r);return i}if(s=tx(e)`${Ev.as("prefix")}${Ev.as("string",Ev.String)}`){let{prefix:n,string:o}=s;if("var"===t.sliceString(n.from,n.to)){let n=t.sliceString(o.from+1,o.to-1);0!==n.length&&i.definitions.set(n,{from:e.from,to:e.to,valid_from:e.to})}else i=lx("cursor"in e?e.cursor():e,t,i,r);return i}if(s=Lv(e)`${Ev.as("object")}[${Ev.as("property")}]`){let{object:e,property:n}=s;return i=lx(e.cursor(),t,i,r),n&&(i=lx(n.cursor(),t,i,r)),i}if(s=Lv(e)`${Ev.as("object")}.${Ev.as("property")}`){let{object:e,property:n}=s;return i=lx(e.cursor(),t,i,r)}return r&&console.warn("UNKNOWN PATTERN:",e.toString(),t.sliceString(e.from,e.to)),i}finally{r&&console.groupEnd()}},ex=function(e,t,i,n=!1){let r=null;if("Definition"!==e.name||!e.firstChild()){if("Identifier"===e.name)return{inner:ax(i,t,e),outer:ax(rx(),t,e)};if(r=tx(e)`${Ev.as("subject")}{ ${Ev.many("parameters")} }`){let{subject:e,parameters:n}=r,s=rx();if(e){let n=ex(e.cursor(),t,i);s=n.outer,i=n.inner}for(let{node:e}of n){let{inner:n}=ex(e.cursor(),t,i);i=n}return{inner:i,outer:s}}if(r=tx(e)`${Ev.as("subject")} <: ${Ev.maybe(Ev.as("type"))}`){let{subject:e,type:n}=r,s=rx();return e&&({outer:s,inner:i}=ex(e.cursor(),t,i)),n&&(i=lx(n.cursor(),t,i)),{inner:i,outer:s}}return n&&console.warn(`Unknown thing in definition: "${t.sliceString(e.from,e.to)}", "${e.toString()}"`),{inner:i,outer:rx()}}try{return ex(e,t,i)}finally{e.parent()}},tx=(ix=Wv,function(e,t=!1){return null==e?(e,...t)=>ix(Tv(e,...t)):function(i,...n){return ix(Tv(i,...n)).match(e,t)}});var ix;let nx=(e,t,i,n=!1)=>{let r=null,s=jv((e=>Sv`${e} x y z`));if(r=s(e)`${Ev.as("macro",Tv`@${Ev.any}`)}`){let{macro:e}=r,n=t.sliceString(e.from,e.to);return i.usages.push({usage:e,definition:i.definitions.get(n)??null,name:n}),i}if(r=s(e)`${Ev.as("object")}.@${Ev.as("macro")}`){let{object:e}=r,n=t.sliceString(e.from,e.to);return i.usages.push({usage:e,definition:i.definitions.get(n)??null,name:n}),i}if(r=s(e)`@${Ev.as("object")}.${Ev.as("macro")}`){let{object:e}=r,n=t.sliceString(e.from,e.to);return i.usages.push({usage:e,definition:i.definitions.get(n)??null,name:n}),i}return n&&console.warn("Mwep mweeeep",e.toString()),i},rx=()=>({usages:[],definitions:new Map,locals:[]}),sx=e=>({usages:[],definitions:new Map(e.definitions),locals:[]}),ox=(e,t,i)=>({usages:[...t.usages,...e.usages],definitions:t.definitions,locals:[]}),ax=(e,t,i,n=null)=>(n=null===n?i.to:n,e.definitions.set(t.sliceString(i.from,i.to),{from:i.from,to:i.to,valid_from:n}),e),lx=(e,t,i={usages:[],definitions:new Map,locals:[]},n=!1)=>{"cursor"in e&&(e=e.cursor());let r=null;if(n){console.group(`Explorer: ${e.name}`),console.groupCollapsed("Details");try{console.log(`Full tree: ${e.toString()}`),console.log("Full text:",t.sliceString(e.from,e.to)),console.log("scopestate:",i)}finally{console.groupEnd()}r=e.node}try{let r=null;if(e.type.is("keyword")||"SourceFile"===e.name||"BooleanLiteral"===e.name||"Character"===e.name||"String"===e.name||"Number"===e.name||"Comment"===e.name||"BinaryExpression"===e.name||"Operator"===e.name||"MacroArgumentList"===e.name||"ReturnStatement"===e.name||"BareTupleExpression"===e.name||"ParenthesizedExpression"===e.name||"Type"===e.name||"InterpolationExpression"===e.name||"SpreadExpression"===e.name||"CompoundExpression"===e.name||"ParameterizedIdentifier"===e.name||"TypeArgumentList"===e.name||"TernaryExpression"===e.name||"Coefficient"===e.name||"TripleString"===e.name||"RangeExpression"===e.name||"SubscriptExpression"===e.name||"UnaryExpression"===e.name||"ConstStatement"===e.name||"GlobalStatement"===e.name||"ContinueStatement"===e.name||"MatrixExpression"===e.name||"MatrixRow"===e.name||"ArrayExpression"===e.name){for(let r of wv(e))i=lx(r,t,i,n);return i}if("Identifier"===e.name||"MacroIdentifier"===e.name){let n=t.sliceString(e.from,e.to);return i.usages.push({name:n,usage:{from:e.from,to:e.to},definition:i.definitions.get(n)??null}),i}if(r=tx(e)`:${Ev.any}`)return i;if(r=tx(e)`${Ev.Number}`)return i;if(r=tx(e)`${Ev.String}`)return i;if(r=tx(e)`${Ev.as("object")}.${Ev.as("property")}`){let{object:e,property:s}=r;return e&&(i=lx(e.cursor(),t,i,n)),i}if(r=tx(e)`${Ev.as("assignee")} = ${Ev.maybe(Ev.as("value"))}`){let{assignee:e,value:s}=r;return s&&(i=lx(s.cursor(),t,i,n)),e&&(i=Jv(e.cursor(),t,i,(null==s?void 0:s.to)??null,n)),i}if(r=tx(e)` + ${Ev.as("macro",Ev.anything_that_fits(Tv`@macro`))}(${Ev.many("args")}) ${Ev.maybe(Tv`do ${Ev.maybe(Ev.many("do_args"))} + ${Ev.many("do_expressions")} + end`)}} + `){let{macro:s,args:o=[],do_args:a,do_expressions:l}=r;s&&nx(s.cursor(),t,i,n);for(let{node:e}of o)if(r=Fv(e)`${Ev.as("name")} = ${Ev.as("value")}`){let{name:e,value:s}=r;s&&(i=lx(s.cursor(),t,i,n))}else i=lx(e.cursor(),t,i,n);if(a&&l){let r=sx(i),s=a.firstChild;if("Identifier"===s.name)r=ax(r,t,s);else if("ArgumentList"===s.name)for(let e of kv(s))r=Hv(e,t,r);else if("BareTupleExpression"===s.name)for(let e of kv(s))r=Hv(e,t,r);else n&&console.warn("Unrecognized do args",s.toString());for(let{node:e}of l)r=lx(e.cursor(),t,r,n);return ox(r,i,e.to)}return i}if(r=tx(e)`${Ev.as("macro",Ev.anything_that_fits(Tv`@macro`))} ${Ev.many("args")}`){let{macro:e,args:s=[]}=r;e&&nx(e.cursor(),t,i,n);for(let{node:e}of s)i=lx(e.cursor(),t,i,n);return i}if((r=tx(e)` + struct ${Ev.as("defined_as")} + ${Ev.many("expressions")} + end + `)??(r=tx(e)` + mutable struct ${Ev.as("defined_as")} + ${Ev.many("expressions")} + end + `)){let{defined_as:s,expressions:o=[]}=r;s=Vv(s);let a=sx(i),l=rx();s&&({inner:a,outer:l}=ex(s.cursor(),t,a));for(let{node:i}of o)if("Identifier"===e.name);else if(r=tx(i)`${Ev.as("subject")}::${Ev.as("type")}`){let{subject:e,type:i}=r;a=lx(i.cursor(),t,a,n)}else if(r=tx(i)`${Ev.as("assignee")} = ${Ev.as("value")}`){let{assignee:e,value:i}=r;if(r=tx(e)`${Ev.as("subject")}::${Ev.as("type")}`){let{subject:e,type:i}=r;a=lx(i.cursor(),t,a,n)}a=lx(i.cursor(),t,a,n)}return i=ox(a,i,e.to),i=Mv(i,l)}if(r=tx(e)`abstract type ${Ev.as("name")} end`){let{name:e}=r;if(e){let{outer:n}=ex(e.cursor(),t,i);i=Mv(i,n)}return i}if((r=tx(e)`quote ${Ev.many("body")} end`)??(r=tx(e)`:(${Ev.many("body")})`)){for(let r of function*(e){if("QuoteExpression"!==e.name&&"QuoteStatement"!==e.name)throw new Error("Expected QuotedExpression or QuoteStatement");yield*Dv(e)}(e))i=lx(r,t,i,n);return i}if(r=tx(e)` + module ${Ev.as("name")} + ${Ev.many("expressions")} + end + `){let{name:e,expressions:n=[]}=r;e&&(i=ax(i,t,e));let s=rx();for(let{node:e}of n)s=lx(e.cursor(),t,s);i=Mv(i,{usages:Array.from(s.usages).filter((e=>null!=e.definition)),definitions:new Map,locals:[]});for(let{node:e}of n)i=lx(e.cursor(),t,i);return i}if(r=tx(e)`${Ev.as("prefix")}${Ev.as("string",Ev.String)}`){let{prefix:n,string:s}=r,o=t.sliceString(n.from,n.to);if("var"===o){let n=t.sliceString(s.from+1,s.to-1);return 0!==n.length&&i.usages.push({name:n,usage:{from:e.from,to:e.to},definition:i.definitions.get(n)??null}),i}{let e=`@${o}_str`;i.usages.push({name:e,usage:{from:n.from,to:n.to},definition:i.definitions.get(e)??null})}return i}if(r=tx(e)`${Ev.Number}${Ev.as("unit")}`)return lx(r.unit.cursor(),t,i,n);if((r=tx(e)`import ${Ev.any}: ${Ev.many("specifiers")}`)??(r=tx(e)`using ${Ev.any}: ${Ev.many("specifiers")}`)){let{specifiers:e=[]}=r,s=jv((e=>Sv`import X: ${e}`));for(let{node:o}of e)if(r=s(o)`${Ev.as("name")} as ${Ev.as("alias")}`){let{alias:e}=r;i=ax(i,t,e)}else if(r=s(o)`${Ev.as("name",Ev.Identifier)}`){let{name:e}=r;i=ax(i,t,e)}else(r=s(o)`@${Ev.any}`)?i=ax(i,t,o):n&&console.warn("Hmmmm, I don't know what to do with this selected import specifier:",o.toString());return i}if(r=tx(e)`import ${Ev.many("specifiers")}`){let{specifiers:e=[]}=r,s=jv((e=>Sv`import ${e}`));for(let{node:o}of e)if(r=s(o)`${Ev.any} as ${Ev.as("alias")}`){let{alias:e}=r;i=ax(i,t,e)}else if(r=s(o)`${Ev.as("package")}.${Ev.as("name",Ev.Identifier)}`)i=ax(i,t,r.name);else if(r=s(o)`.${Ev.as("scoped")}`){let e=null;for(;e=s(r.scoped)`.${Ev.as("scoped")}`;)r=e;i=ax(i,t,r.scoped)}else(r=s(o)`${Ev.as("name",Ev.Identifier)}`)?i=ax(i,t,r.name):n&&console.warn("Hmmm, I don't know what to do with this import specifier:",o);return i}if(r=tx(e)`using ${Ev.many()}`)return i;if(r=tx(e)` + for ${Ev.many("bindings",Ev.something_with_the_same_type_as(Tv`x in y`))}; + ${Ev.many("expressions")} + end + `){let s=Iv((e=>Sv`for ${e}; x end`)),o=e=>(...t)=>s(Tv(...t)).match(e),{bindings:a,expressions:l}=r,c=sx(i);for(let{node:e}of a){let i=null;if((i=o(e)`${Ev.as("name")} in ${Ev.as("range")}`)??(i=o(e)`${Ev.as("name")} ∈ ${Ev.as("range")}`)??(i=o(e)`${Ev.as("name")} = ${Ev.as("range")}`)){let{name:e,range:r}=i;r&&(c=lx(r.cursor(),t,c,n)),e&&(c=Jv(e,t,c,(null==r?void 0:r.to)??null,n))}else n&&console.warn("Unrecognized for loop binding",e.toString())}for(let{node:e}of l)c=lx(e.cursor(),t,c,n);return ox(c,i,e.to)}if((r=tx(e)` + ${Ev.as("callee")}(${Ev.many("args")}) ${Ev.maybe(Tv`do ${Ev.maybe(Ev.many("do_args"))} + ${Ev.many("do_expressions")} + end`)} + `)??(r=tx(e)` + ${Ev.as("callee")}.(${Ev.many("args")}) + `)){let{callee:s,args:o=[],do_args:a=[],do_expressions:l=[]}=r;i=lx(s.cursor(),t,i,n);for(let{node:r}of o){let s=null;if(s=Fv(r)`; ${Ev.many("named_args")}`){let{named_args:e=[]}=s;for(let{node:r}of e){let e=null;if(e=Kv(r)`${Ev.as("name")} = ${Ev.as("value")}`){let{name:r,value:s}=e;i=lx(s.cursor(),t,i,n)}else i=lx(r.cursor(),t,i,n)}}else if(s=Fv(r)`${Ev.as("name")} = ${Ev.as("value")}`){let{name:e,value:r}=s;r&&(i=lx(r.cursor(),t,i,n))}else{if(s=Fv(r)`${Ev.as("result")} ${Ev.many("clauses",Ev.anything_that_fits(Tv`for x = y`))}`){let{result:r,clauses:o}=s,a=sx(i);for(let{node:e}of o){let i=null;if((i=Gv(e)`for ${Ev.as("variable")} = ${Ev.maybe(Ev.as("value"))}`)??(i=Gv(e)`for ${Ev.as("variable")} in ${Ev.maybe(Ev.as("value"))}`)??(i=Gv(e)`for ${Ev.as("variable")} ∈ ${Ev.maybe(Ev.as("value"))}`)??(i=Gv(e)`for ${Ev.as("variable")}`)){let{variable:e,value:r}=i;r&&(a=lx(r.cursor(),t,a,n)),e&&(a=Jv(e,t,a))}else if(i=Gv(e)`if ${Ev.maybe(Ev.as("if"))}`){let{if:e}=i;e&&(a=lx(e.cursor(),t,a,n))}else n&&console.log("Hmmm, can't parse for binding",e)}return a=lx(r.cursor(),t,a,n),ox(a,i,e.to)}i=lx(r.cursor(),t,i,n)}}let c=sx(i);for(let{node:e}of a)c=Hv(e,t,c);for(let{node:e}of l)c=lx(e.cursor(),t,c,n);return ox(c,i,e.to)}if(r=tx(e)`(${Ev.many("tuple_elements")},)`){let{tuple_elements:s=[]}=r,o=jv((e=>Sv`(${e},)`)),a=s.map((({node:t})=>null!=o(e)`${Ev.Identifier} = ${Ev.any}`));if(a.every((e=>!0===e))||a.every((e=>!1===e)))for(let{node:r}of s){let s=null;if(s=o(e)`${Ev.as("name")} = ${Ev.as("value")}`){let{name:e,value:r}=s;r&&(i=lx(r.cursor(),t,i,n))}else i=lx(r.cursor(),t,i,n)}else for(let{node:r}of s){let s=null;if(s=o(e)`${Ev.as("name")} = ${Ev.as("value")}`){let{name:e,value:r}=s;r&&(i=lx(r.cursor(),t,i,n)),e&&(i=ax(i,t,e,(null==r?void 0:r.to)??null))}else i=lx(r.cursor(),t,i,n)}return i}if((r=tx(e)`(${Ev.many("args")}) -> ${Ev.many("body")}`)??(r=tx(e)`${Ev.as("arg")} -> ${Ev.many("body")}`)??(r=tx(e)`${Ev.as("name")}(${Ev.many("args")})::${Ev.as("return_type")} = ${Ev.many("body")}`)??(r=tx(e)`${Ev.as("name")}(${Ev.many("args")}) = ${Ev.many("body")}`)??(r=tx(e)`${Ev.as("name")}(${Ev.many("args")}) = ${Ev.many("body",Ev.anything_that_fits(Tv`x, y`))}`)??(r=tx(e)` + function ${Ev.as("name")}(${Ev.many("args")})::${Ev.as("return_type")} where ${Ev.as("type_param")} + ${Ev.many("body")} + end + `)??(r=tx(e)` + function ${Ev.as("name")}(${Ev.many("args")}) where ${Ev.as("type_param")} + ${Ev.many("body")} + end + `)??(r=tx(e)` + function ${Ev.as("name")}(${Ev.many("args")})::${Ev.as("return_type")} + ${Ev.many("body")} + end + `)??(r=tx(e)` + function ${Ev.as("name")}(${Ev.many("args")}) + ${Ev.many("body")} + end + `)??(r=tx(e)` + function ${Ev.as("name",Ev.Identifier)} end + `)??(r=tx(e)`macro ${Ev.as("macro_name")} end`)??(r=tx(e)` + macro ${Ev.as("macro_name")}(${Ev.many("args")}) + ${Ev.many("body")} + end + `)){let{name:s,macro_name:o,arg:a,args:l=[],return_type:c,type_param:O,body:h=[]}=r;a&&l.push({node:a}),s?i=ax(i,t,s):o&&i.definitions.set(`@${t.sliceString(o.from,o.to)}`,{from:o.from,to:o.to,valid_from:o.to});let u=sx(i);if(O){let e=jv((e=>Sv`function X() where ${e} end`)),i=jv((e=>Sv`function X() where {${e}} end`)),r=[{node:O}],s=e(O)`{${Ev.many("type_params")}}`;s&&(r=s.type_params);for(let{node:e}of r){let r=null;if(r=i(e)`${Ev.as("defined",Ev.Identifier)} <: ${Ev.as("parent_type")}`){let{defined:e,parent_type:i}=r;u=lx(i,t,u,n),u=ax(u,t,e)}else if(r=i(e)`${Ev.as("defined",Ev.Identifier)}`){let{defined:e}=r;u=ax(u,t,e)}else n&&console.warn("Can't handle type param:",e)}}c&&(u=lx(Vv(c).cursor(),t,u,n));for(let{node:e}of l)u=Hv(e.cursor(),t,u,n);for(let{node:e}of h)u=lx(e.cursor(),t,u,n);return ox(u,i,e.to)}if(r=tx(e)` + let ${Ev.many("assignments",Tv`${Ev.as("assignee")} = ${Ev.as("value")}`)} + ${Ev.many("body",Ev.any)} + end + `){let{assignments:s=[],body:o=[]}=r,a=sx(i);for(let{match:{assignee:e,value:r}}of s)e&&(a=Jv(e,t,a,(null==r?void 0:r.to)??null,n)),r&&(i=lx(r.cursor(),t,i,n));for(let{node:e}of o)a=lx(e.cursor(),t,a,n);return ox(a,i,e.to)}if((r=tx(e)`[ + ${Ev.as("result")} + ${Ev.many("clauses",Ev.anything_that_fits(Tv`for x = y`))} + ]`)??(r=tx(e)`(${Ev.as("result")} ${Ev.many("clauses",Ev.anything_that_fits(Tv`for x = y`))})`)){let{result:s,clauses:o}=r,a=sx(i);for(let{node:e}of o){let i=null;if((i=Gv(e)`for ${Ev.as("variable")} = ${Ev.maybe(Ev.as("value"))}`)??(i=Gv(e)`for ${Ev.as("variable")} in ${Ev.maybe(Ev.as("value"))}`)??(i=Gv(e)`for ${Ev.as("variable")} ∈ ${Ev.maybe(Ev.as("value"))}`)??(i=Gv(e)`for ${Ev.as("variable")}`)){let{variable:e,value:r}=i;r&&(a=lx(r.cursor(),t,a,n)),e&&(a=Jv(e,t,a))}else if(i=Gv(e)`if ${Ev.maybe(Ev.as("if"))}`){let{if:e}=i;e&&(a=lx(e.cursor(),t,a,n))}else n&&console.warn("Hmmm, can't parse for binding",e)}return a=lx(s.cursor(),t,a,n),ox(a,i,e.to)}n&&(console.groupCollapsed("Cycling through all children of",e.name),console.log("text:",t.sliceString(e.from,e.to)),console.groupEnd());for(let r of wv(e))i=lx(r,t,i,n);return i}finally{n&&console.groupEnd()}},cx=tr.define({create(e){try{let t=ld(e).cursor();return lx(t,e.doc,void 0)}catch(e){return console.error("Something went wrong while parsing variables...",e),{usages:[],definitions:new Map,locals:[]}}},update(e,t){try{if(ld(t.state)!=ld(t.startState)){let e=ld(t.state).cursor();return lx(e,t.state.doc)}return e}catch(e){return console.error("Something went wrong while parsing variables...",e),{usages:[],definitions:new Map,locals:[]}}}}),Ox=e=>"SubscriptExpression"===e.name||"FieldExpression"===e.name?(e.firstChild(),Ox(e)):"Identifier"===e.name?(e.firstChild(),e.node):null,hx=["Identifier","FieldExpression","SubscriptExpression","MacroFieldExpression","MacroIdentifier","Operator","Definition","ParameterizedIdentifier"],ux=["import","export","try","catch","finally","quote","do","struct","mutable"],dx=e=>{if(ux.includes(e.name))return!0;if(hx.includes(e.name)){if(e.firstChild()){do{if("Number"!==e.name&&"TypeArgumentList"!==e.name&&"FieldName"!==e.name&&"MacroName"!==e.name&&"MacroFieldName"!==e.name&&!dx(e))return!1}while(e.nextSibling());return e.parent(),!0}return!0}return!1},fx=(e,t=!1)=>{let i=e.selection.main,n=e.field(cx);if(i.from!==i.to)return e.doc.sliceString(i.from,i.to).trim();{let r=e.doc.lineAt(i.from).text;if("?"===r[0])return r.slice(1);let s=ld(e).cursor();t&&console.log("Full tree:",s.toString()),s.moveTo(i.to,-1);let o=0;do{t&&console.group(`Iteration #${o}`);try{if(t&&console.log("cursor",s.toString()),o>100){console.group("Infinite loop while checking docs"),console.log("Selection:",i,e.doc.sliceString(i.from,i.to).trim()),console.log("Current node:",s.name,e.doc.sliceString(s.from,s.to).trim()),console.groupEnd();break}o+=1;let r=s.node.cursor(),a=[];for(;r.parent();)a.push(r.name);let l=s.node.parent;if(null==l)break;t&&console.log("parents:",a);let c=a.indexOf("StructDefinition");if(-1!==c)if(a.includes("AssignmentExpression")&&a.indexOf("AssignmentExpression")e.usage.from===t.from&&e.usage.to===t.to));if(null==(null==i?void 0:i.definition))return e.doc.sliceString(s.from,s.to)}if("FunctionDefinition"===l.name)return;if("AssignmentExpression"===l.name)return}finally{t&&console.groupEnd()}}while(s.parent())}},px=(e,{scopestate:t,global_definitions:i})=>Il.set(mx(t.usages.map((({definition:e,usage:t,name:n})=>null==e?i[n]?Il.mark({tagName:"pluto-variable-link",attributes:{title:`${Ji}-Click to jump to the definition of ${n}.`,"data-pluto-variable":n,href:`#${n}`}}).range(t.from,t.to):null:Il.mark({tagName:"pluto-variable-link",attributes:{title:`${Ji}-Click to jump to the definition of ${n}.`,"data-cell-variable":n,"data-cell-variable-from":`${e.from}`,"data-cell-variable-to":`${e.to}`,href:"#"}}).range(t.from,t.to)))),!0);const mx=e=>e.filter((e=>null!=e)),gx=Ln.define({combine:e=>e[0],compare:Rt.isEqual}),$x=Oc.fromClass(class{constructor(e){let t=e.state.facet(gx);this.decorations=px(e.state,{scopestate:e.state.field(cx),global_definitions:t})}update(e){let t=e.state.facet(gx);(e.docChanged||e.viewportChanged||t!==e.startState.facet(gx))&&(this.decorations=px(e.state,{scopestate:e.state.field(cx),global_definitions:t}))}},{decorations:e=>e.decorations,eventHandlers:{pointerdown:(e,t)=>{if(en(e)&&0===e.button&&e.target instanceof Element){let n=e.target.closest("[data-pluto-variable]");if(n){var i;let r=n.getAttribute("data-pluto-variable");if(null==r)return!1;e.preventDefault();let s=`[id='${encodeURI(r)}']`;null===(i=document.querySelector(s))||void 0===i||i.scrollIntoView({behavior:"smooth",block:"center"});let o=t.state.facet(gx);if(o[r])return window.dispatchEvent(new CustomEvent("cell_focus",{detail:{cell_id:o[r],line:0,definition_of:r}})),!0}let r=e.target.closest("[data-cell-variable]");if(r){r.getAttribute("data-cell-variable");let e=Number(r.getAttribute("data-cell-variable-from")),i=Number(r.getAttribute("data-cell-variable-to"));return t.dispatch({scrollIntoView:!0,selection:{anchor:e,head:i}}),t.focus(),!0}}}}}),bx=FP.parser,Qx=nw.parser.configure(Zb({htmlParser:bx})),yx=Ok.language.parser,Px=function(e={}){let t=e.dialect||ck;return new $d(t.language,[lk(e),ak(t,!!e.upperCaseKeywords)])}({dialect:Ok}),wx=Gk.parser,kx=["md","mermaid","cm","markdown","mdx","mdl","markdownliteral"].flatMap((e=>[e,`@${e}`])),_x=new Set(["TripleString","String","CommandString","TripleStringWithoutInterpolation","StringWithoutInterpolation","CommandStringWithoutInterpolation"]),vx=Ws(((e,t)=>{var i,n,r;if(!_x.has(e.type.name))return null;const s="TripleString"===e.name||"TripleStringWithoutInterpolation"===e.name?3:1,o=e.from+s,a=Math.min(e.to-s,t.length);if(o>=a)return null;const l=(null===(i=e.node)||void 0===i?void 0:i.prevSibling)||(null===(n=e.node)||void 0===n||null===(r=n.parent)||void 0===r?void 0:r.prevSibling);if(null==l||"MacroIdentifier"!==l.name&&"Prefix"!==l.name)return null;const c="MacroIdentifier"===l.name,O=t.read(l.from,l.to);let h=null;if("@htl"===O||"html"===O)h=bx;else if(kx.includes(O))h=Qx;else if("@javascript"===O||"@js"===O||"js"===O||"javascript"===O)h=kP.parser;else if("py"===O||"pyr"===O||"python"===O||"@python"===O)h=wx;else{if("sql"!==O)return null;h=yx}let u=[];if(null!=e.node.firstChild){let t=o,i=e.node.firstChild.cursor();do{t!==i.from&&u.push({from:t,to:i.from}),t=i.to}while(i.nextSibling());te.flatMap((({from:e,to:i})=>{const n=t.read(e,i),r=[];let s=e;for(let{index:t}of n.matchAll(/\\\$/g)){let i=e+t;s!==i&&r.push({from:s,to:i}),s=i+1}return s!==i&&r.push({from:s,to:i}),r})))(u,t)),[...kx].includes(O)?{parser:h,overlay:[{from:o,to:a}]}:{parser:h,overlay:u}})),xx=e=>{const t=om(e);return t.language.parser=t.language.parser.configure({wrap:vx}),t};let{autocompletion:Xx,completionKeymap:Sx,completionStatus:Rx,acceptCompletion:Tx}=Hp,Wx=Xx()[0];const Ax=kr.define(),Nx=tr.define({create:()=>!1,update(e,t){var i,n;for(let e of t.effects)if(e.is(Ax))return!0;return(null==(null===(i=t.startState.field(Wx,!1))||void 0===i?void 0:i.open)||null!=(null===(n=t.state.field(Wx,!1))||void 0===n?void 0:n.open))&&((null==t.startState.field(Wx,!1).open||t.startState.field(Wx,!1)===t.state.field(Wx,!1))&&e)}});const Cx=[{key:"Tab",run:e=>{if(Tx(e))return!0;let t=e.state.selection.main,i=e.state.sliceDoc(t.from-1,t.from);return!!t.empty&&(!/^(\t| |\n|\=|\)|)$/.test(i)&&(e.dispatch({effects:Ax.of(10)}),Hp.startCompletion(e)))}},{key:"?",run:e=>{var t;if((null===(t=e.state.field(Wx,!1))||void 0===t?void 0:t.open)??!1)return window.dispatchEvent(new CustomEvent("open_live_docs")),!0}},{key:".",run:e=>(Tx(e),!1)}];let Ex=e=>Oh.updateListener.of((t=>{let i=t.state.field(Wx,!1),n=null==i?void 0:i.open;if(null==n)return;let r=n.options[n.selected],s=r.completion.apply??r.completion.label;if("string"!=typeof s)return;let o=t.state.update({changes:{from:r.source.from,to:r.source.to,insert:s}}),a=fx(o.state);null!=a&&e(a)})),qx=e=>async t=>{let i=(e=>e.matchBefore(/\\[^\s"'.`]*/))(t)||(e=>e.matchBefore(/~\//))(t);if(null==i)return null;let n=t.state.sliceDoc(0,t.pos),{start:r,stop:s,results:o}=await e({text:n});return{from:r,to:s,filter:!1,options:o.map((([e],t)=>({label:e})))}},Vx=e=>/^[@a-zA-Z_][a-zA-Z0-9!_]*\"?$/.test(e)?null:":"===e?`:(${e})`:`:${e}`;const zx=function*(e,t,i){let n=0;for(let[r,{valid_from:s}]of e.entries())!t.has(r)&&sasync t=>{let i=t.state.sliceDoc(0,t.pos),n=(e=>e.matchBefore(/\.\:[^\s"'`()\[\].]*/))(t);n&&(i=i.slice(0,n.from+1)+i.slice(n.from+2));let{start:r,stop:s,results:o}=await e({text:i});n&&(s+=1);const a=t.state.field(cx).definitions,l=new Set;let c="."===i.slice(0,r).slice(-1);return{from:r,to:s,options:[...o.map((([e,t,i,n,r],s)=>{let O=c?Vx(e)??e:e;return a.has(e)&&l.add(e),{label:e,apply:O,type:a_({c_notexported:!i,[`c_${t}`]:null!=t,[`completion_${r}`]:null!=r,c_from_notebook:n}),boost:50-s/o.length}})),...o.filter((([e])=>c&&null!=Vx(e))).map((([e,t,i],n)=>{let r=Vx(e);return{label:r,apply:r,type:(i?"":"c_notexported ")+(null==t?"":"c_"+t),boost:-99-n/o.length,is_not_exported:!i}})),...Array.from(zx(a,l,t.pos))]}},Yx=async e=>{const t=await Hp.completeAnyWord(e);return{from:t.from,options:t.options.map((({label:e},t)=>({label:e,apply:e,type:null,boost:0-t})))}};let Zx=({request_autocomplete:e,on_update_doc_query:t})=>{let i=null,n=null,r=async t=>(Rt.isEqual(t,i)||(i=t,n=e(t)),await n);return[Nx,Xx({activateOnTyping:!1,override:[qx(r),Ix(r),Yx],defaultKeymap:!1,maxRenderedOptions:512,optionClass:e=>e.type}),Oh.updateListener.of((e=>{let t=e.state.field(Wx,!1),i=e.state.field(Nx,!1);null!=(null==t?void 0:t.open)&&i&&"active"===Rx(e.state)&&1===t.open.options.length&&((e,t)=>{let i=t.completion.apply||t.completion.label,n=t.source;"string"==typeof i?e.dispatch({changes:{from:n.from,to:n.to,insert:i},selection:{anchor:n.from+i.length},userEvent:"input.complete"}):i(e,t.completion,n.from,n.to)})(e.view,t.open.options[0])})),Oh.updateListener.of((e=>{for(let i of e.transactions){var t;let n=i.annotation(Hp.pickedCompletion);n&&"string"==typeof n.apply&&n.apply.endsWith("/")&&(null===(t=n.type)||void 0===t?void 0:t.match(/(^| )completion_path( |$)/))&&Hp.startCompletion(e.view)}})),Ex(t),$h.of(Cx),$h.of(Sx)]};class Ux extends Vl{constructor(e){super(),this.element=e}eq(e){return!1}toDOM(){let e=document.createElement("span");return U(this.element,e),e}updateDOM(e){return U(this.element,e),!0}}const Mx=["Pkg.activate","Pkg.API.activate","Pkg.develop","Pkg.API.develop","Pkg.add","Pkg.API.add","quickactivate","@quickactivate"];function Dx(e,{pluto_actions:t,notebook_id:i,nbpkg:n}){let r=new Set,s=e.visibleRanges.flatMap((({from:s,to:o})=>{let a=function({doc:e,tree:t,from:i,to:n}){let r=0,s=[];return Yv({tree:t,from:i,to:n,enter:t=>{if("QuoteExpression"!==t.name&&"QuoteStatement"!==t.name||r++,"InterpolationExpression"===t.name&&r--,0!==r)return;if("CallExpression"===t.name||"MacroExpression"===t.name){let i=t.node.firstChild,n=e.sliceString(i.from,i.to);return void(Mx.includes(n)&&s.push({type:"package_disabler",name:n,from:t.to,to:t.to}))}let i=Iv((e=>Sv`import A, ${e}`)),n=e=>{let t=null;return(t=i(Tv`${Ev.as("package")}.${Ev.any}`).match(e))?n(t.package):(t=i(Tv`.${Ev.maybe(Ev.any)}`).match(e))?null:(t=i(Tv`${Ev.Identifier}`).match(e))?e:void console.warn("Unknown nested import specifier: "+e.toString())},o=null;if((o=Wv(Tv`import ${Ev.as("specifier")}: ${Ev.many()}`).match(t))??(o=Wv(Tv`import ${Ev.as("specifier")}, ${Ev.many("specifiers")}`).match(t))??(o=Wv(Tv`using ${Ev.as("specifier")}: ${Ev.many()}`).match(t))??(o=Wv(Tv`using ${Ev.as("specifier")}, ${Ev.many("specifiers")}`).match(t))){let{specifier:r,specifiers:a=[]}=o;r&&(a=[{node:r},...a]);for(let{node:t}of a){t=Vv(t);let r=null;if(r=i(Tv`${Ev.as("package")} as ${Ev.maybe(Ev.any)}`).match(t)){let t=n(r.package);t&&s.push({type:"package",name:e.sliceString(t.from,t.to),from:t.to,to:t.to})}else if(r=i(Tv`${Ev.as("package")}.${Ev.any}`).match(t)){let t=n(r.package);t&&s.push({type:"package",name:e.sliceString(t.from,t.to),from:t.to,to:t.to})}else if(r=i(Tv`.${Ev.as("scoped")}`).match(t));else if(r=i(Tv`${Ev.as("package")}`).match(t)){let t=n(r.package);t&&s.push({type:"package",name:e.sliceString(t.from,t.to),from:t.to,to:t.to})}else console.warn("Unknown import specifier: "+t.toString())}if(o=null,o=Wv(Tv`using ${Ev.as("specifier")}, ${Ev.many("specifiers")}`).match(t)){let{specifier:t}=o;t&&("\n"!==e.sliceString(t.to,t.to+1)&&""!==e.sliceString(t.to,t.to+1)||s.push({type:"implicit_using",name:e.sliceString(t.from,t.to),from:t.to,to:t.to}))}return!1}if("ImportStatement"===t.name)throw new Error("What")},leave:e=>{"QuoteExpression"!==e.name&&"QuoteStatement"!==e.name||r--,"InterpolationExpression"===e.name&&r++}}),s}({doc:e.state.doc,tree:ld(e.state),from:s,to:o});return a.map((e=>{if("package"===e.type){let{name:s}=e;if("Base"!==s&&"Core"!==s&&!r.has(s)){return r.add(s),Il.widget({widget:new Ux(xe` + <${x_} + key=${s} + package_name=${s} + pluto_actions=${t} + notebook_id=${i} + nbpkg=${n} + /> + `),side:1}).range(e.to)}}else{if("package_disabler"===e.type){return Il.widget({widget:new Ux(xe` <${X_} package_name=${e.name} /> `),side:1}).range(e.to)}if("implicit_using"===e.type&&"HypertextLiteral"===e.name){return Il.widget({widget:new Ux(xe` +
+ : @htl, @htl_str +
+
`),side:1}).range(e.to)}}}))})).filter((e=>null!=e));return Il.set(s,!0)}const jx=Ln.define({combine:e=>e[0],compare:Rt.isEqual}),Gx=({pluto_actions:e,notebook_id:t})=>Oc.fromClass(class{update_decos(i){const n=Dx(i,{pluto_actions:e,notebook_id:t,nbpkg:i.state.facet(jx)});this.decorations=n}constructor(e){this.update_decos(e)}update(e){(e.docChanged||e.viewportChanged||e.state.facet(jx)!==e.startState.facet(jx))&&this.update_decos(e.view)}},{decorations:e=>e.decorations,eventHandlers:{pointerdown:(e,t)=>{e.target}}}),Lx=kr.define({}),Bx=tr.define({create:()=>({defaultCharacterWidth:null,measuredSpaceWidth:null,measuredTabWidth:null}),update(e,t){for(let e of t.effects)if(e.is(Lx))return e.value;return e}});let Fx=Oh.updateListener.of((e=>{let t=e.view.defaultCharacterWidth,{defaultCharacterWidth:i,measuredSpaceWidth:n}=e.view.state.field(Bx,!1);if(i!==t){let i,n;e.view.dispatch({effects:[Lx.of({defaultCharacterWidth:t,measuredSpaceWidth:i,measuredTabWidth:n})]})}})),Kx=tr.define({create:()=>Il.none,update(e,t){let i=t.startState.field(Bx,!1),n=i.measuredSpaceWidth??i.defaultCharacterWidth,{measuredSpaceWidth:r,defaultCharacterWidth:s}=t.state.field(Bx,!1),o=r??s;if(null==o)return Il.none;if(!t.docChanged&&e!==Il.none&&n===o)return e;let a=[];for(let e of Rt.range(0,t.state.doc.lines)){let i=t.state.doc.line(e+1);if(0===i.length)continue;let n=0;for(let e of i.text){if("\t"!==e)break;n++}const r=Math.min(n,12),s=4*r*o,l=Il.line({attributes:{style:`--indented: ${s}px;`,class:"awesome-wrapping-plugin-the-line"}});if(a.push(l.range(i.from,i.from)),0!==r&&a.push(Il.mark({class:"awesome-wrapping-plugin-the-tabs"}).range(i.from,i.from+r)),n>r)for(let e of Rt.range(r,n))a.push(Il.replace({widget:new Ux(xe``),block:!1}).range(i.from+e,i.from+e+1))}return Il.set(a)},provide:e=>Oh.decorations.from(e)}),Hx=Il.mark({class:"indentation-so-dont-break"}),Jx=(tr.define({create:()=>Il.none,update(e,t){let i=[];for(const e of t.newDoc)for(const t of e.matchAll(/[^ \t]+([ \t]|$)+/g))null!=t.index&&0!==t.index&&i.push(Hx.range(0+t.index,0+t.index+t[0].length));return Il.set(i,!0)},provide:e=>Oh.decorations.from(e)}),[Bx,Fx,Kx]),eX=Hp.autocompletion()[0],tX=Oh.domEventHandlers({keydown:(e,t)=>{var i;let n=t.state.selection.main;if(!n.empty)return!1;if(!e.repeat)return!1;if("Backspace"===e.key&&0===t.state.doc.length)return!0;if("Delete"===e.key&&0===t.state.doc.length)return!0;let r=(null===(i=t.state.field(eX,!1))||void 0===i?void 0:i.open)??!1;return"ArrowUp"!==e.key||r?"ArrowDown"!==e.key||r?"ArrowLeft"===e.key&&e.repeat?!!t.moveByChar(n,!1).eq(n):"ArrowRight"===e.key?!!t.moveByChar(n,!0).eq(n):void 0:!!t.moveVertically(t.state.selection.main,!0).eq(n):!!t.moveVertically(t.state.selection.main,!1).eq(n)}}),iX=({focus_on_neighbor:e})=>(({focus_on_neighbor:e})=>$h.of([{key:"PageUp",run:()=>(e({cell_delta:-1,line:0,character:0}),!0)},{key:"PageDown",run:()=>(e({cell_delta:1,line:0,character:0}),!0)},{key:"ArrowLeft",run:t=>{let i=t.state.selection.main;return!!i.empty&&!!t.moveByChar(i,!1).eq(i)&&(e({cell_delta:-1,line:1/0,character:1/0}),!0)}},{key:"ArrowUp",run:t=>{let i=t.state.selection.main;return!!i.empty&&!!t.moveVertically(i,!1).eq(i)&&(e({cell_delta:-1,line:1/0,character:1/0}),!0)}},{key:"ArrowRight",run:t=>{let i=t.state.selection.main;return!!i.empty&&!!t.moveByChar(i,!0).eq(i)&&(e({cell_delta:1,line:0,character:0}),!0)}},{key:"ArrowDown",run:t=>{let i=t.state.selection.main;return!!i.empty&&!!t.moveVertically(i,!0).eq(i)&&(e({cell_delta:1,line:0,character:0}),!0)}}]))({focus_on_neighbor:e}),nX=({pluto_actions:e,cell_id:t})=>Oh.domEventHandlers({paste:(i,n)=>{if(!n.hasFocus)return console.log("CodeMirror, why are you registring this paste? You aren't focused!"),!0;i.stopPropagation();const r=i.clipboardData.getData("text/plain"),s=on(r,!1);return null!=s&&(0===n.state.selection.main.from&&n.state.selection.main.to===n.state.doc.length?(e.add_deserialized_cells(r,t,s),e.confirm_delete_multiple("This Should Never Be Visible",[t]),!0):(n.state.selection.main.to===n.state.doc.length||0===n.state.selection.main.from)&&(e.add_deserialized_cells(r,t,s),!0))}});const rX=Oh.baseTheme({".cm-matchingBracket":{backgroundColor:"#328c8252"},".cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),sX="()[]{}",oX=Ln.define({combine:e=>qr(e,{afterCursor:!0,brackets:sX,maxScanDistance:1e4})}),aX=Il.mark({class:"cm-matchingBracket"}),lX=(Il.mark({class:"cm-nonmatchingBracket"}),[tr.define({create:()=>Il.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let i=[],n=t.state.facet(oX);for(let e of t.state.selection.ranges){if(!e.empty)continue;let r=OX(t.state,e.head,-1,n)||e.head>0&&OX(t.state,e.head-1,1,n)||n.afterCursor&&(OX(t.state,e.head,1,n)||e.headOh.decorations.from(e)}),rX]);function cX(e={}){return[oX.of(e),lX]}function OX(e,t,i,n={}){let r=n.maxScanDistance||1e4,s=n.brackets||sX,o=ld(e),a=o.resolveInner(t,i),l=function(e){if("end"===e.name&&(e=e.parent.firstChild),"mutable"===e.name||"struct"===e.name){"struct"===e.name&&(e=e.parent.firstChild);let t=e.parent.getChild("struct"),i=e.parent.lastChild;return"end"===i.name&&t?[{from:e.from,to:t.to},{from:i.from,to:i.to}]:null}if("struct"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("quote"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("begin"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("do"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("for"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("let"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("macro"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("function"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("while"===e.name){let t=e.parent.lastChild;return"end"===t.name?[{from:e.from,to:e.to},{from:t.from,to:t.to}]:null}if("type"===e.name&&(e=e.parent.firstChild),"abstract"===e.name||"primitive"===e.name){let t=e.parent.lastChild,i="end"===t.name,n=e.parent.getChild("type");return i&&n?[{from:e.from,to:n.to},{from:t.from,to:t.to}]:null}if("try"===e.name||"catch"===e.name||"finally"===e.name){var t,i;"catch"===e.name&&(e=e.parent),"finally"===e.name&&(e=e.parent);let n=e.parent.firstChild,r=e.parent.lastChild;if("end"!==r.name)return null;let s=null===(t=e.parent.getChild("CatchClause"))||void 0===t?void 0:t.firstChild,o=null===(i=e.parent.getChild("FinallyClause"))||void 0===i?void 0:i.firstChild;return[{from:n.from,to:n.to},s&&{from:s.from,to:s.to},o&&{from:o.from,to:o.to},{from:r.from,to:r.to}].filter((e=>null!=e))}if("if"===e.name||"else"===e.name||"elseif"===e.name){"else"===e.name&&(e=e.parent);let t=e.parent.firstChild,i=e.parent.lastChild;if("end"!==i.name)return null;let n=[];n.push({from:t.from,to:t.to});for(let t of e.parent.getChildren("ElseClause")){let e=t.firstChild;n.push({from:e.from,to:e.to})}for(let t of e.parent.getChildren("elseif"))n.push({from:t.from,to:t.to});return n.push({from:i.from,to:i.to}),n}return null}(a);return l||function(e,t,i,n,r,s,o){let a=i<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=o.indexOf(a);if(l<0||l%2==0!=i>0)return null;let c={from:i<0?t-1:t,to:i>0?t+1:t},O=e.doc.iterRange(t,i>0?e.doc.length:0),h=0;for(let e=0;!O.next().done&&e<=s;){let s=O.value;i<0&&(e+=s.length);let a=t+e*i;for(let e=i>0?0:s.length-1,t=i>0?s.length:-1;e!=t;e+=i){let t=o.indexOf(s[e]);if(!(t<0||n.resolve(a+e,1).type!=r))if(t%2==0==i>0)h++;else{if(1==h)return t>>1==l>>1?[c,{from:a+e,to:a+e+1}]:null;h--}}i>0&&(e+=s.length)}return O.done?[c]:null}(e,t,i,o,a.type,r,s)}Il.line({attributes:{class:"cm-highlighted-line"}});const hX=Ln.define({combine:e=>e[0],compare:(e,t)=>e===t});function uX(e,t){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let r=e(t,i.selection.ranges,i);return!!r&&(n(i.update(r)),!0)}}const dX=uX($X,0),fX=(uX($X,1),uX($X,2),uX(gX,0)),pX=(uX(gX,1),uX(gX,2),[{key:"Mod-/",run:e=>{let t=mX(e.state);return t.line?dX(e):!!t.block&&fX(e)}},{key:"Alt-A",run:fX}]);function mX(e,t=e.selection.main.head){let i=e.languageDataAt("commentTokens",t);return i.length?i[0]:{}}function gX(e,t,i){let n=t.map((e=>mX(i,e.from).block));if(!n.every((e=>e)))return null;let r=t.map(((e,t)=>function(e,{open:t,close:i},n,r){let s,o,a=e.sliceDoc(n-50,n),l=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,O=/^\s*/.exec(l)[0].length,h=a.length-c;if(a.slice(h-t.length,h)==t&&l.slice(O,O+i.length)==i)return{open:{pos:n-c,margin:c&&1},close:{pos:r+O,margin:O&&1}};r-n<=100?s=o=e.sliceDoc(n,r):(s=e.sliceDoc(n,n+50),o=e.sliceDoc(r-50,r));let u=/^\s*/.exec(s)[0].length,d=/\s*$/.exec(o)[0].length,f=o.length-d-i.length;return s.slice(u,u+t.length)==t&&o.slice(f,f+i.length)==i?{open:{pos:n+u+t.length,margin:/\s/.test(s.charAt(u+t.length))?1:0},close:{pos:r-d-i.length,margin:/\s/.test(o.charAt(f-1))?1:0}}:null}(i,n[t],e.from,e.to)));if(2!=e&&!r.every((e=>e))){let e=0;return i.changeByRange((t=>{let{open:i,close:s}=n[e++];if(r[e])return{range:t};let o=i.length+1;return{changes:[{from:t.from,insert:i+" "},{from:t.to,insert:" "+s}],range:Mn.range(t.anchor+o,t.head+o)}}))}if(1!=e&&r.some((e=>e))){let e=[];for(let t,i=0;ir&&(e==s||s>a.from)){r=a.from;let e=o??mX(i,t).line;if(!e)continue;let s=/^\s*/.exec(a.text)[0].length,c=s==a.length,O=a.text.slice(s,s+e.length)==e?s:-1;se.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:i,indent:r,empty:s,single:o}of n)!o&&s||e.push({from:t.from+r,insert:i+" "});let t=i.changes(e);return{changes:t,selection:i.selection.map(t,1)}}if(1!=e&&n.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:i,token:r}of n)if(i>=0){let n=t.from+i,s=n+r.length;" "==t.text[s-t.from]&&s++,e.push({from:n,to:s})}return{changes:e}}return null}Oh.updateListener.of((e=>{if(e.docChanged||e.selectionSet||ld(e.state)!==ld(e.startState))if(function(e,t=e.doc.length){var i;return(null===(i=e.field(sd.state,!1))||void 0===i?void 0:i.context.isDone(t))||!1}(e.state)){let i=e.state;console.group("Selection");try{console.groupCollapsed("Lezer tree");try{console.log(ld(i).toString())}finally{console.groupEnd()}console.groupCollapsed("Document text");try{console.log(e.state.doc.sliceString(0,e.state.doc.length))}finally{console.groupEnd()}console.group("Lezer errors");try{t=e.state.doc,Yv({tree:ld(i),enter:e=>{if(e.type.isError){var i;console.group(`Found error node in ${null===(i=e.node.parent)||void 0===i?void 0:i.name}`);try{let i=t.sliceString(e.from-10,e.from),n=t.sliceString(e.from,e.to),r=t.sliceString(e.to,e.to+10);""===n?(console.log(`${i}⚠${r}`),console.log(`${" ".repeat(i.length)}^$${" ".repeat(r.length)}`)):(console.log(`${i}${n}${r}`),console.log(`${" ".repeat(i.length)}${"^".repeat(n.length)}$${" ".repeat(r.length)}`))}finally{console.groupEnd()}return!1}},leave:()=>{}})}finally{console.groupEnd()}}finally{console.groupEnd()}}else console.log("⚠️ Full syntax tree not available");var t}));const bX="true"===window.localStorage.getItem("ENABLE_CM_MIXED_PARSER");bX&&console.log("YOU ENABLED THE CODEMIRROR MIXED LANGUAGE PARSER\nThanks! Awesome!\nPlease let us know if you find any bugs...\nIf enough people do this, we can make it the default parser.\n"),window.PLUTO_TOGGLE_CM_MIXED_PARSER=()=>{window.localStorage.setItem("ENABLE_CM_MIXED_PARSER",String(!bX)),window.location.reload()};const QX=tf.define([{tag:td.propertyName,color:"var(--cm-property-color)"},{tag:td.unit,color:"var(--cm-tag-color)"},{tag:td.literal,color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.macroName,color:"var(--cm-macro-color)",fontWeight:700},{tag:td.special(td.brace),color:"var(--cm-macro-color)",fontWeight:700},{tag:td.standard(td.variableName),color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.bool,color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.keyword,color:"var(--cm-keyword-color)"},{tag:td.comment,color:"var(--cm-comment-color)",fontStyle:"italic"},{tag:td.atom,color:"var(--cm-atom-color)"},{tag:td.number,color:"var(--cm-number-color)"},{tag:td.keyword,color:"var(--cm-keyword-color)"},{tag:td.string,color:"var(--cm-string-color)"},{tag:td.variableName,color:"var(--cm-var-color)",fontWeight:700},{tag:td.typeName,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:td.typeOperator,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:td.bracket,color:"var(--cm-bracket-color)"},{tag:td.brace,color:"var(--cm-bracket-color)"},{tag:td.tagName,color:"var(--cm-tag-color)"},{tag:td.link,color:"var(--cm-link-color)"},{tag:td.invalid,color:"var(--cm-error-color)",background:"var(--cm-error-bg-color)"}],{all:{color:"var(--cm-editor-text-color)"},scope:om().language}),yX=tf.define([{tag:td.propertyName,color:"var(--cm-property-color)"},{tag:td.unit,color:"var(--cm-tag-color)"},{tag:td.literal,color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.macroName,color:"var(--cm-macro-color)",fontWeight:700},{tag:td.standard(td.variableName),color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.bool,color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.keyword,color:"var(--cm-keyword-color)"},{tag:td.atom,color:"var(--cm-atom-color)"},{tag:td.number,color:"var(--cm-number-color)"},{tag:td.keyword,color:"var(--cm-keyword-color)"},{tag:td.string,color:"var(--cm-string-color)"},{tag:td.variableName,color:"var(--cm-var-color)",fontWeight:700},{tag:td.typeName,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:td.typeOperator,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:td.bracket,color:"var(--cm-bracket-color)"},{tag:td.brace,color:"var(--cm-bracket-color)"},{tag:td.tagName,color:"var(--cm-tag-color)"},{tag:td.link,color:"var(--cm-link-color)"},{tag:td.invalid,color:"var(--cm-error-color)",background:"var(--cm-error-bg-color)"},{tag:td.comment,color:"var(--cm-comment-color)",fontStyle:"italic",filter:"none"}],{scope:kP,all:{color:"var(--cm-editor-text-color)",filter:"contrast(0.5)"}}),PX=tf.define([{tag:td.propertyName,color:"var(--cm-property-color)"},{tag:td.unit,color:"var(--cm-tag-color)"},{tag:td.literal,color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.macroName,color:"var(--cm-macro-color)",fontWeight:700},{tag:td.standard(td.variableName),color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.bool,color:"var(--cm-builtin-color)",fontWeight:700},{tag:td.keyword,color:"var(--cm-keyword-color)"},{tag:td.comment,color:"var(--cm-comment-color)",fontStyle:"italic"},{tag:td.atom,color:"var(--cm-atom-color)"},{tag:td.number,color:"var(--cm-number-color)"},{tag:td.keyword,color:"var(--cm-keyword-color)"},{tag:td.string,color:"var(--cm-string-color)"},{tag:td.variableName,color:"var(--cm-var-color)",fontWeight:700},{tag:td.typeName,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:td.typeOperator,color:"var(--cm-type-color)",fontStyle:"italic"},{tag:td.bracket,color:"var(--cm-bracket-color)"},{tag:td.brace,color:"var(--cm-bracket-color)"},{tag:td.tagName,color:"var(--cm-tag-color)"},{tag:td.link,color:"var(--cm-link-color)"},{tag:td.invalid,color:"var(--cm-error-color)",background:"var(--cm-error-bg-color)"}],{scope:Gk,all:{color:"var(--cm-editor-text-color)",filter:"contrast(0.5)"}}),wX=tf.define([{tag:td.propertyName,color:"var(--cm-css-accent-color)",fontWeight:700},{tag:td.variableName,color:"var(--cm-css-accent-color)",fontWeight:700},{tag:td.definitionOperator,color:"var(--cm-css-color)"},{tag:td.keyword,color:"var(--cm-css-color)"},{tag:td.modifier,color:"var(--cm-css-accent-color)"},{tag:td.punctuation,opacity:.5},{tag:td.literal,color:"var(--cm-css-color)"},{tag:td.tagName,color:"var(--cm-css-color)",fontWeight:700},{tag:td.className,color:"var(--cm-css-why-doesnt-codemirror-highlight-all-the-text-aaa)"},{tag:td.constant(td.className),color:"var(--cm-css-why-doesnt-codemirror-highlight-all-the-text-aaa)"},{tag:td.comment,color:"var(--cm-comment-color)",fontStyle:"italic"}],{scope:Iy,all:{color:"var(--cm-css-color)"}}),kX=tf.define([{tag:td.tagName,color:"var(--cm-html-accent-color)",fontWeight:600},{tag:td.attributeName,color:"var(--cm-html-accent-color)",fontWeight:600},{tag:td.attributeValue,color:"var(--cm-html-accent-color)"},{tag:td.angleBracket,color:"var(--cm-html-accent-color)",fontWeight:600,opacity:.7},{tag:td.content,color:"var(--cm-html-color)",fontWeight:400},{tag:td.documentMeta,color:"var(--cm-html-accent-color)"},{tag:td.comment,color:"var(--cm-comment-color)",fontStyle:"italic"}],{scope:FP,all:{color:"var(--cm-html-color)"}}),_X=tf.define([{tag:td.content,color:"var(--cm-md-color)"},{tag:td.quote,color:"var(--cm-md-color)"},{tag:td.link,textDecoration:"underline"},{tag:td.url,color:"var(--cm-md-color)",textDecoration:"none"},{tag:td.emphasis,fontStyle:"italic"},{tag:td.strong,fontWeight:"bolder"},{tag:td.heading,color:"var(--cm-md-color)",fontWeight:700},{tag:td.comment,color:"var(--cm-comment-color)",fontStyle:"italic"},{tag:td.processingInstruction,color:"var(--cm-md-accent-color) !important",opacity:"0.5"},{tag:td.monospace,color:"var(--cm-md-accent-color)"}],{scope:nw,all:{color:"var(--cm-md-color)"}}),vX=e=>e.state.doc.toString(),xX=(e,t)=>e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t}}),XX=(e,t,i,n)=>e.dispatch({changes:{from:i,to:n,insert:t}});let SX=(e,t)=>{let i=Oe(new cr),n=Oe(i.current.of(t));return ce((()=>{var n,r;null===(n=e.current)||void 0===n||null===(r=n.dispatch)||void 0===r||r.call(n,{effects:i.current.reconfigure(t)})}),[t]),n.current},RX=(e,{line:t,ch:i})=>{let n=e.line(Rt.clamp(t+1,1,e.lines)),r=Rt.clamp(i,0,n.length);return n.from+r};const TX=({local_code:e,remote_code:t,disable_input:i,focus_after_creation:n,cm_forced_focus:r,set_cm_forced_focus:s,show_input:o,on_submit:a,on_delete:l,on_add_after:c,on_change:O,on_update_doc_query:h,on_focus_neighbor:u,on_line_heights:d,nbpkg:f,cell_id:p,notebook_id:m,any_logs:g,show_logs:$,set_show_logs:b,cm_highlighted_line:Q,metadata:y,global_definition_locations:P})=>{let w=de(l_);const{disabled:k}=y,_=Oe(null),v=Oe(null),x=Oe(null);let X=SX(_,jx.of(f)),S=SX(_,gx.of(P)),R=SX(_,hX.of(Q)),T=SX(_,Er.readOnly.of(i)),W=SX(_,he((()=>Oh.updateListener.of((e=>{e.docChanged&&O(e.state.doc.toString())}))),[O]));return ce((()=>{if(null==v.current)return;const t=e=>((async e=>{await e()})((async()=>{await c();e.state.doc.toString()!==x.current&&a()})),!0);let i=Hp.completionKeymap.find((e=>"Enter"===e.key));const r=()=>{const e=_.current,t=vX(e),i=t.trim(),n=t.length-t.trimStart().length;if(console.table({value:t,trimmed:i,offset:n}),i.startsWith('md"')&&i.endsWith('"')){let t,r;if(i.startsWith('md"""')&&i.endsWith('"""')?(t=5,r=i.length-3):(t=3,r=i.length-1),t>=r||""==i.substring(t,r).trim())xX(e,"");else{for(;/\s/.test(i[t]);)++t;for(;/\s/.test(i[r-1]);)--r;XX(e,"",r+n,e.state.doc.length),XX(e,"",0,t+n)}}else{let t='md"""\n',i='\n"""',n=e.state.selection.main;e.dispatch({changes:[{from:0,to:0,insert:t},{from:e.state.doc.length,to:e.state.doc.length,insert:i}],selection:0===n.from?{anchor:n.from+t.length,head:n.to+t.length}:void 0})}return!0},o=e=>!e.state.facet(Er.readOnly)&&(0===e.state.doc.length&&(u(p,1),l(),!0)),O=e=>!e.state.facet(Er.readOnly)&&(0===e.state.doc.length&&(u(p,-1,1/0,1/0),l(),!0)),f=[{key:"Shift-Enter",run:()=>(a(),!0)},{key:"Ctrl-Enter",mac:"Cmd-Enter",run:t},{key:"Ctrl-Enter",run:t},{key:"Tab",run:e=>{if(null==i?void 0:i.run(e))return!0;let t=e.state.selection.main;return t.empty?(e.dispatch({changes:{from:t.from,to:t.to,insert:"\t"},selection:Mn.cursor(t.from+1)}),!0):Ag(e)},shift:Ng},{key:"Ctrl-m",mac:"Cmd-m",run:r},{key:"Ctrl-m",run:r},{key:"Ctrl-M",run:r},{key:"Delete",run:o},{key:"Ctrl-Delete",run:o},{key:"Backspace",run:O},{key:"Ctrl-Backspace",run:O}];let g=!1;const $=Oh.updateListener.of((e=>{if(e.view.hasFocus&&(e.docChanged||e.selectionSet)){let t=e.state;try{let e=fx(t,g);null!=e&&h(e)}finally{}}}));window.tags=td;const b=window.matchMedia("(prefers-color-scheme: dark)").matches,Q=_.current=new Oh({state:Er.create({doc:e,extensions:[Oh.theme({},{dark:b}),X,R,S,T,tX,Gx({pluto_actions:w,notebook_id:m}),cx,of(QX),of(kX),of(_X),of(yX),of(PX),of(wX),vu(),Yh(),$m(),_h(),Er.allowMultipleSelections.of(!0),Oh.clickAddsSelectionRange.of((e=>e.altKey&&!e.shiftKey)),Er.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let i=e.newDoc,{head:n}=e.newSelection.main,r=i.lineAt(n);if(n>r.from+200)return e;let s=i.sliceString(r.from,n);if(!t.some((e=>e.test(s))))return e;let{state:o}=e,a=-1,l=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==a)continue;a=t.from;let i=kd(o,t.from);if(null==i)continue;let n=/^\s*/.exec(t.text)[0],r=wd(o,i);n!=r&&l.push({from:t.from,to:t.from+n.length,insert:r})}return l.length?[e,{changes:l,sequential:!0}]:e})),Er.languageData.of(((e,t,i)=>[{closeBrackets:{brackets:["(","[","{"]}}])),Cp(),Bh({eventFilter:e=>e.altKey&&e.shiftKey&&0==e.button}),Hg(),cX(),$,Oh.domEventHandlers({blur:(e,t)=>{t.dispatch({selection:{anchor:t.state.selection.main.head,head:t.state.selection.main.head}}),s(null)}}),nX({pluto_actions:w,cell_id:p}),Oh.updateListener.of((e=>{e.docChanged&&e.state.doc.length>0&&"?"===e.state.sliceDoc(0,1)&&window.dispatchEvent(new CustomEvent("open_live_docs"))})),Er.tabSize.of(4),yd.of("\t"),...bX?[xx(),uw({defaultCodeLanguage:xx()}),KP(),XP(),new $d(Gk),Px]:[om()],$x,Zx({request_autocomplete:async({text:e})=>{let{message:t}=await w.send("complete",{query:e},{notebook_id:m});return{start:cn(e,t.start),stop:cn(e,t.stop),results:t.results}},on_update_doc_query:h}),$h.of(f),$h.of(pX),iX({focus_on_neighbor:({cell_delta:e,line:t,character:i})=>u(p,e,t,i)}),$h.of([...Yp,...qg,...Nm,...Bd]),jh("Enter cell code..."),Oh.lineWrapping,Jx,W]}),parent:v.current});Q.dom.CodeMirror={getValue:()=>vX(Q),setValue:e=>xX(Q,e)},n&&setTimeout((()=>{let e=_.current;null!=e&&(e.dom.scrollIntoView({behavior:"smooth",block:"nearest"}),e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length}}),e.focus())}));const y=v.current.querySelector("div.cm-content");if(y){const e=new ResizeObserver((()=>{const e=y.children,t=Rt.map(e,(e=>e.offsetTop)),i=[...t.slice(1).map(((e,i)=>e-t[i])),15];d(i)}));return e.observe(y),()=>{e.unobserve(y)}}}),[]),le((()=>{if(null==_.current)return;const e=vX(_.current)??"";null==x.current&&""===t&&""!==e||(x.current=t,e!==t&&xX(_.current,t))}),[t]),le((()=>{const e=_.current;if(null!=e)if(null==r)e.dispatch({selection:{anchor:e.state.selection.main.head,head:e.state.selection.main.head}});else{let i={anchor:RX(e.state.doc,r[0]),head:RX(e.state.doc,r[1])};if(null===(t=r[2])||void 0===t?void 0:t.definition_of){var t;let n=e.state.field(cx),s=null==n?void 0:n.definitions.get(null===(t=r[2])||void 0===t?void 0:t.definition_of);s&&(i={anchor:s.from,head:s.to})}e.dom.scrollIntoView({behavior:"smooth",block:"nearest"}),e.focus(),e.dispatch({scrollIntoView:!0,selection:i,effects:[Oh.scrollIntoView(Mn.range(i.anchor,i.head),{yMargin:80})]})}}),[r]),xe` + + <${WX} + on_delete=${l} + cell_id=${p} + run_cell=${a} + running_disabled=${k} + any_logs=${g} + show_logs=${$} + set_show_logs=${b} + /> + + `},WX=({on_delete:e,cell_id:t,run_cell:i,running_disabled:n,any_logs:r,show_logs:s,set_show_logs:o})=>{const a=Oe(null);let l=de(l_);const[c,O]=oe(!1);return xe` `}; +/*! + Highlight.js v11.4.0 (git: 2d0e7c1094) + (c) 2006-2022 Ivan Sagalaev and other contributors + License: BSD-3-Clause + */ +var AX={exports:{}};function NX(e){return e instanceof Map?e.clear=e.delete=e.set=()=>{throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{throw Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((t=>{var i=e[t];"object"!=typeof i||Object.isFrozen(i)||NX(i)})),e}AX.exports=NX,AX.exports.default=NX;var CX=AX.exports;class EX{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function qX(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function VX(e,...t){const i=Object.create(null);for(const t in e)i[t]=e[t];return t.forEach((e=>{for(const t in e)i[t]=e[t]})),i}const zX=e=>!!e.kind;class IX{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=qX(e)}openNode(e){if(!zX(e))return;let t=e.kind;t=e.sublanguage?"language-"+t:((e,{prefix:t})=>{if(e.includes(".")){const i=e.split(".");return[`${t}${i.shift()}`,...i.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){zX(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}class YX{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{YX._collapse(e)})))}}class ZX extends YX{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const i=e.root;i.kind=t,i.sublanguage=!0,this.add(i)}toHTML(){return new IX(this,this.options).value()}finalize(){return!0}}function UX(e){return e?"string"==typeof e?e:e.source:null}function MX(e){return GX("(?=",e,")")}function DX(e){return GX("(?:",e,")*")}function jX(e){return GX("(?:",e,")?")}function GX(...e){return e.map((e=>UX(e))).join("")}function LX(...e){const t=(e=>{const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}})(e);return"("+(t.capture?"":"?:")+e.map((e=>UX(e))).join("|")+")"}function BX(e){return RegExp(e.toString()+"|").exec("").length-1}const FX=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function KX(e,{joinWith:t}){let i=0;return e.map((e=>{i+=1;const t=i;let n=UX(e),r="";for(;n.length>0;){const e=FX.exec(n);if(!e){r+=n;break}r+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0],"("===e[0]&&i++)}return r})).map((e=>`(${e})`)).join(t)}const HX="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",JX={begin:"\\\\[\\s\\S]",relevance:0},eS={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[JX]},tS={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[JX]},iS=(e,t,i={})=>{const n=VX({scope:"comment",begin:e,end:t,contains:[]},i);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const r=LX("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:GX(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},nS=iS("//","$"),rS=iS("/\\*","\\*/"),sS=iS("#","$");var oS=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:HX,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=GX(t,/.*\b/,e.binary,/\b.*/)),VX({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:JX,APOS_STRING_MODE:eS,QUOTE_STRING_MODE:tS,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:iS,C_LINE_COMMENT_MODE:nS,C_BLOCK_COMMENT_MODE:rS,HASH_COMMENT_MODE:sS,NUMBER_MODE:{scope:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{scope:"number",begin:HX,relevance:0},BINARY_NUMBER_MODE:{scope:"number",begin:"\\b(0b[01]+)",relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[JX,{begin:/\[/,end:/\]/,relevance:0,contains:[JX]}]}]},TITLE_MODE:{scope:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{scope:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:e=>Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})});function aS(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function lS(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function cS(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=aS,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function OS(e,t){Array.isArray(e.illegal)&&(e.illegal=LX(...e.illegal))}function hS(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function uS(e,t){void 0===e.relevance&&(e.relevance=1)}const dS=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");const i=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=i.keywords,e.begin=GX(i.beforeMatch,MX(i.begin)),e.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},e.relevance=0,delete i.beforeMatch},fS=["of","and","for","in","not","or","if","then","parent","list","value"];function pS(e,t,i="keyword"){const n=Object.create(null);function r(e,i){t&&(i=i.map((e=>e.toLowerCase()))),i.forEach((t=>{const i=t.split("|");n[i[0]]=[e,mS(i[0],i[1])]}))}return"string"==typeof e?r(i,e.split(" ")):Array.isArray(e)?r(i,e):Object.keys(e).forEach((i=>{Object.assign(n,pS(e[i],t,i))})),n}function mS(e,t){return t?Number(t):(e=>fS.includes(e.toLowerCase()))(e)?0:1}const gS={},$S=e=>{console.error(e)},bS=(e,...t)=>{console.log("WARN: "+e,...t)},QS=(e,t)=>{gS[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),gS[`${e}/${t}`]=!0)},yS=Error();function PS(e,t,{key:i}){let n=0;const r=e[i],s={},o={};for(let e=1;e<=t.length;e++)o[e+n]=r[e],s[e+n]=!0,n+=BX(t[e-1]);e[i]=o,e[i]._emit=s,e[i]._multi=!0}function wS(e){(e=>{e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)})(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),(e=>{if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw $S("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),yS;if("object"!=typeof e.beginScope||null===e.beginScope)throw $S("beginScope must be object"),yS;PS(e,e.begin,{key:"beginScope"}),e.begin=KX(e.begin,{joinWith:""})}})(e),(e=>{if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw $S("skip, excludeEnd, returnEnd not compatible with endScope: {}"),yS;if("object"!=typeof e.endScope||null===e.endScope)throw $S("endScope must be object"),yS;PS(e,e.end,{key:"endScope"}),e.end=KX(e.end,{joinWith:""})}})(e)}function kS(e){function t(t,i){return RegExp(UX(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(i?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=BX(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(KX(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const i=t.findIndex(((e,t)=>t>0&&void 0!==e)),n=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,n)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new i;return this.rules.slice(e).forEach((([e,i])=>t.addRule(e,i))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=VX(e.classNameAliases||{}),function i(r,s){const o=r;if(r.isCompiled)return o;[lS,hS,wS,dS].forEach((e=>e(r,s))),e.compilerExtensions.forEach((e=>e(r,s))),r.__beforeBegin=null,[cS,OS,uS].forEach((e=>e(r,s))),r.isCompiled=!0;let a=null;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),a=r.keywords.$pattern,delete r.keywords.$pattern),a=a||/\w+/,r.keywords&&(r.keywords=pS(r.keywords,e.case_insensitive)),o.keywordPatternRe=t(a,!0),s&&(r.begin||(r.begin=/\B|\b/),o.beginRe=t(o.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(o.endRe=t(o.end)),o.terminatorEnd=UX(o.end)||"",r.endsWithParent&&s.terminatorEnd&&(o.terminatorEnd+=(r.end?"|":"")+s.terminatorEnd)),r.illegal&&(o.illegalRe=t(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map((e=>(e=>(e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((t=>VX(e,{variants:null},t)))),e.cachedVariants?e.cachedVariants:_S(e)?VX(e,{starts:e.starts?VX(e.starts):null}):Object.isFrozen(e)?VX(e):e))("self"===e?r:e)))),r.contains.forEach((e=>{i(e,o)})),r.starts&&i(r.starts,s),o.matcher=(e=>{const t=new n;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t})(o),o}(e)}function _S(e){return!!e&&(e.endsWithParent||_S(e.starts))}class vS extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const xS=qX,XS=VX,SS=Symbol("nomatch");var RS=(e=>{const t=Object.create(null),i=Object.create(null),n=[];let r=!0;const s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ZX};function l(e){return a.noHighlightRe.test(e)}function c(e,t,i){let n="",r="";"object"==typeof t?(n=e,i=t.ignoreIllegals,r=t.language):(QS("10.7.0","highlight(lang, code, ...args) has been deprecated."),QS("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,n=t),void 0===i&&(i=!0);const s={code:n,language:r};$("before:highlight",s);const o=s.result?s.result:O(s.language,s.code,i);return o.code=s.code,$("after:highlight",o),o}function O(e,i,n,o){const l=Object.create(null);function c(){if(!k.keywords)return void v.addText(x);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(x),i="";for(;t;){i+=x.substring(e,t.index);const r=y.case_insensitive?t[0].toLowerCase():t[0],s=(n=r,k.keywords[n]);if(s){const[e,n]=s;if(v.addText(i),i="",l[r]=(l[r]||0)+1,l[r]<=7&&(X+=n),e.startsWith("_"))i+=t[0];else{const i=y.classNameAliases[e]||e;v.addKeyword(t[0],i)}}else i+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(x)}var n;i+=x.substr(e),v.addText(i)}function u(){null!=k.subLanguage?(()=>{if(""===x)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void v.addText(x);e=O(k.subLanguage,x,!0,_[k.subLanguage]),_[k.subLanguage]=e._top}else e=h(x,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(X+=e.relevance),v.addSublanguage(e._emitter,e.language)})():c(),x=""}function d(e,t){let i=1;for(;void 0!==t[i];){if(!e._emit[i]){i++;continue}const n=y.classNameAliases[e[i]]||e[i],r=t[i];n?v.addKeyword(r,n):(x=r,c(),x=""),i++}}function f(e,t){return e.scope&&"string"==typeof e.scope&&v.openNode(y.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(v.addKeyword(x,y.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),x=""):e.beginScope._multi&&(d(e.beginScope,t),x="")),k=Object.create(e,{parent:{value:k}}),k}function m(e,t,i){let n=((e,t)=>{const i=e&&e.exec(t);return i&&0===i.index})(e.endRe,i);if(n){if(e["on:end"]){const i=new EX(e);e["on:end"](t,i),i.isMatchIgnored&&(n=!1)}if(n){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return m(e.parent,t,i)}function g(e){return 0===k.matcher.regexIndex?(x+=e[0],1):(T=!0,0)}function $(e){const t=e[0],n=i.substr(e.index),r=m(k,e,n);if(!r)return SS;const s=k;k.endScope&&k.endScope._wrap?(u(),v.addKeyword(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(u(),d(k.endScope,e)):s.skip?x+=t:(s.returnEnd||s.excludeEnd||(x+=t),u(),s.excludeEnd&&(x=t));do{k.scope&&v.closeNode(),k.skip||k.subLanguage||(X+=k.relevance),k=k.parent}while(k!==r.parent);return r.starts&&f(r.starts,e),s.returnEnd?0:t.length}let b={};function Q(t,s){const o=s&&s[0];if(x+=t,null==o)return u(),0;if("begin"===b.type&&"end"===s.type&&b.index===s.index&&""===o){if(x+=i.slice(s.index,s.index+1),!r){const t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=b.rule,t}return 1}if(b=s,"begin"===s.type)return(e=>{const t=e[0],i=e.rule,n=new EX(i),r=[i.__beforeBegin,i["on:begin"]];for(const i of r)if(i&&(i(e,n),n.isMatchIgnored))return g(t);return i.skip?x+=t:(i.excludeBegin&&(x+=t),u(),i.returnBegin||i.excludeBegin||(x=t)),f(i,e),i.returnBegin?0:t.length})(s);if("illegal"===s.type&&!n){const e=Error('Illegal lexeme "'+o+'" for mode "'+(k.scope||"")+'"');throw e.mode=k,e}if("end"===s.type){const e=$(s);if(e!==SS)return e}if("illegal"===s.type&&""===o)return 1;if(R>1e5&&R>3*s.index)throw Error("potential infinite loop, way more iterations than matches");return x+=o,o.length}const y=p(e);if(!y)throw $S(s.replace("{}",e)),Error('Unknown language: "'+e+'"');const P=kS(y);let w="",k=o||P;const _={},v=new a.__emitter(a);(()=>{const e=[];for(let t=k;t!==y;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>v.openNode(e)))})();let x="",X=0,S=0,R=0,T=!1;try{for(k.matcher.considerAll();;){R++,T?T=!1:k.matcher.considerAll(),k.matcher.lastIndex=S;const e=k.matcher.exec(i);if(!e)break;const t=Q(i.substring(S,e.index),e);S=e.index+t}return Q(i.substr(S)),v.closeAllNodes(),v.finalize(),w=v.toHTML(),{language:e,value:w,relevance:X,illegal:!1,_emitter:v,_top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:xS(i),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:S,context:i.slice(S-100,S+100),mode:t.mode,resultSoFar:w},_emitter:v};if(r)return{language:e,value:xS(i),illegal:!1,relevance:0,errorRaised:t,_emitter:v,_top:k};throw t}}function h(e,i){i=i||a.languages||Object.keys(t);const n=(e=>{const t={value:xS(e),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t})(e),r=i.filter(p).filter(g).map((t=>O(t,e,!1)));r.unshift(n);const s=r.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(p(e.language).supersetOf===t.language)return 1;if(p(t.language).supersetOf===e.language)return-1}return 0})),[l,c]=s,h=l;return h.secondBest=c,h}function u(e){let t=null;const n=(e=>{let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const i=a.languageDetectRe.exec(t);if(i){const t=p(i[1]);return t||(bS(s.replace("{}",i[1])),bS("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find((e=>l(e)||p(e)))})(e);if(l(n))return;if($("before:highlightElement",{el:e,language:n}),e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML))throw new vS("One of your code blocks includes unescaped HTML.",e.innerHTML);t=e;const r=t.textContent,o=n?c(r,{language:n,ignoreIllegals:!0}):h(r);e.innerHTML=o.value,((e,t,n)=>{const r=t&&i[t]||n;e.classList.add("hljs"),e.classList.add("language-"+r)})(e,n,o.language),e.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest&&(e.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance}),$("after:highlightElement",{el:e,result:o,text:r})}let d=!1;function f(){"loading"!==document.readyState?document.querySelectorAll(a.cssSelector).forEach(u):d=!0}function p(e){return e=(e||"").toLowerCase(),t[e]||t[i[e]]}function m(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{i[e.toLowerCase()]=t}))}function g(e){const t=p(e);return t&&!t.disableAutodetect}function $(e,t){const i=e;n.forEach((e=>{e[i]&&e[i](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(()=>{d&&f()}),!1),Object.assign(e,{highlight:c,highlightAuto:h,highlightAll:f,highlightElement:u,highlightBlock:e=>(QS("10.7.0","highlightBlock will be removed entirely in v12.0"),QS("10.7.0","Please use highlightElement now."),u(e)),configure:e=>{a=XS(a,e)},initHighlighting:()=>{f(),QS("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:()=>{f(),QS("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:(i,n)=>{let s=null;try{s=n(e)}catch(e){if($S("Language definition for '{}' could not be registered.".replace("{}",i)),!r)throw e;$S(e),s=o}s.name||(s.name=i),t[i]=s,s.rawDefinition=n.bind(null,e),s.aliases&&m(s.aliases,{languageName:i})},unregisterLanguage:e=>{delete t[e];for(const t of Object.keys(i))i[t]===e&&delete i[t]},listLanguages:()=>Object.keys(t),getLanguage:p,registerAliases:m,autoDetection:g,inherit:XS,addPlugin:e=>{(e=>{e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})})(e),n.push(e)}}),e.debugMode=()=>{r=!1},e.safeMode=()=>{r=!0},e.versionString="11.4.0",e.regex={concat:GX,lookahead:MX,either:LX,optional:jX,anyNumberOfTimes:DX};for(const e in oS)"object"==typeof oS[e]&&CX(oS[e]);return Object.assign(e,oS),e})({});const TS=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}),WS=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],AS=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],NS=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],CS=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ES=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-height","max-width","min-height","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),qS=NS.concat(CS);var VS={className:"number",variants:[{begin:"(\\b([0-9](_*[0-9])*)((\\.([0-9](_*[0-9])*))|\\.)?|(\\.([0-9](_*[0-9])*)))[eE][+-]?([0-9](_*[0-9])*)[fFdD]?\\b"},{begin:"\\b([0-9](_*[0-9])*)((\\.([0-9](_*[0-9])*))[fFdD]?\\b|\\.([fFdD]\\b)?)"},{begin:"(\\.([0-9](_*[0-9])*))[fFdD]?\\b"},{begin:"\\b([0-9](_*[0-9])*)[fFdD]\\b"},{begin:"\\b0[xX](([0-9a-fA-F](_*[0-9a-fA-F])*)\\.?|([0-9a-fA-F](_*[0-9a-fA-F])*)?\\.([0-9a-fA-F](_*[0-9a-fA-F])*))[pP][+-]?([0-9](_*[0-9])*)[fFdD]?\\b"},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:"\\b0[xX]([0-9a-fA-F](_*[0-9a-fA-F])*)[lL]?\\b"},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function zS(e,t,i){return-1===i?"":e.replace(t,(n=>zS(e,t,i-1)))}const IS="[A-Za-z$_][0-9A-Za-z$_]*",YS=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],ZS=["true","false","null","undefined","NaN","Infinity"],US=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],MS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],DS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],jS=["arguments","this","super","console","window","document","localStorage","module","global"],GS=[].concat(DS,US,MS);function LS(e){const t=e.regex,i=IS,n={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const i=e[0].length+e.index,n=e.input[i];if("<"===n||","===n)return void t.ignoreMatch();let r;">"===n&&(((e,{after:t})=>{const i="",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[m]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:p,CLASS_REFERENCE:$},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,c,O,h,u,a,$,{className:"attr",begin:i+t.lookahead(":"),relevance:0},_,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[u,e.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:p}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:""},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:n.begin,"on:begin":n.isTrulyOpeningTag,end:n.end}],subLanguage:"xml",contains:[{begin:n.begin,end:n.end,skip:!0,contains:["self"]}]}]},b,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[m,e.inherit(e.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[m]},Q,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},g,w,{match:/\$[(.]/}]}}const BS=e=>GX(/\b/,e,/\w$/.test(e)?/\b/:/\B/),FS=["Protocol","Type"].map(BS),KS=["init","self"].map(BS),HS=["Any","Self"],JS=["actor","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],eR=["false","nil","true"],tR=["assignment","associativity","higherThan","left","lowerThan","none","right"],iR=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],nR=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],rR=LX(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),sR=LX(rR,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),oR=GX(rR,sR,"*"),aR=LX(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),lR=LX(aR,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),cR=GX(aR,lR,"*"),OR=GX(/[A-Z]/,lR,"*"),hR=["autoclosure",GX(/convention\(/,LX("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",GX(/objc\(/,cR,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],uR=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var dR=Object.freeze({__proto__:null,grmr_bash:e=>{const t=e.regex,i={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]};Object.assign(i,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,r]};r.contains.push(o);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z._-]+\b/,keyword:["if","then","else","elif","fi","for","while","in","do","done","case","esac","function"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,s,{match:/(\/[a-z._-]+)+/},o,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},i]}},grmr_c:e=>{const t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="[a-zA-Z_]\\w*::",r="(decltype\\(auto\\)|"+t.optional(n)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},o={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(n)+e.IDENT_RE,relevance:0},O=t.optional(n)+e.IDENT_RE+"\\s*\\(",h={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},u=[l,s,i,e.C_BLOCK_COMMENT_MODE,a,o],d={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:u.concat([{begin:/\(/,end:/\)/,keywords:h,contains:u.concat(["self"]),relevance:0}]),relevance:0},f={begin:"("+r+"[\\*&\\s]+)+"+O,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:h,relevance:0},{begin:O,returnBegin:!0,contains:[e.inherit(c,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,o,a,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,o,a,s]}]},s,i,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C",aliases:["h"],keywords:h,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:l,strings:o,keywords:h}}},grmr_cpp:e=>{const t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="[a-zA-Z_]\\w*::",r="(?!struct)(decltype\\(auto\\)|"+t.optional(n)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},o={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},l={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(o,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(n)+e.IDENT_RE,relevance:0},O=t.optional(n)+e.IDENT_RE+"\\s*\\(",h={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},u={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},d=[u,l,s,i,e.C_BLOCK_COMMENT_MODE,a,o],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:d.concat([{begin:/\(/,end:/\)/,keywords:h,contains:d.concat(["self"]),relevance:0}]),relevance:0},p={className:"function",begin:"("+r+"[\\*&\\s]+)+"+O,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:"decltype\\(auto\\)",keywords:h,relevance:0},{begin:O,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[o,a]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,o,a,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,o,a,s]}]},s,i,e.C_BLOCK_COMMENT_MODE,l]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"",keywords:h,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},i=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),n={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},r={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},s=e.inherit(r,{illegal:/\n/}),o={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(o,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]},O=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});o.contains=[c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,n,e.C_BLOCK_COMMENT_MODE],a.contains=[O,l,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,n,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const h={variants:[c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},i]},d=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},h,n,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},i,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+d+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial",relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[h,n,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}},grmr_css:e=>{const t=e.regex,i=TS(e),n=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+NS.join("|")+")"},{begin:":(:)?("+CS.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ES.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,...n,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:AS.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...n,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+WS.join("|")+")\\b"}]}},grmr_diff:e=>{const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},grmr_go:e=>{const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"{const t=e.regex,i={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},n=e.COMMENT();n.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[n,s,r,o,i,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[n,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[n,a,s,r,o,i]}}]}},grmr_java:e=>{e.regex;const t="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",i=t+zS("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),n={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},r={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:n,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:n,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t,/\s+/,t,/\s+/,/=/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:n,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:n,relevance:0,contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,VS,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},VS,r]}},grmr_javascript:LS,grmr_json:e=>({name:"JSON",contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,{beginKeywords:"true false null"},e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}),grmr_kotlin:e=>{const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},i={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},n={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},r={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},s={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[r,n]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,r,n]}]};n.contains.push(s);const o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(s,{className:"string"})]}]},l=VS,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),O={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},h=O;return h.variants[1].contains=[O],O.variants[1].contains=[h],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i,o,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[O,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,o,a,s,e.C_NUMBER_MODE]},c]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},o,a]},s,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}},grmr_less:e=>{const t=TS(e),i=qS,n="([\\w-]+|@\\{[\\w-]+\\})",r=[],s=[],o=e=>({className:"string",begin:"~?"+e+".*?"+e}),a=(e,t,i)=>({className:e,begin:t,relevance:i}),l={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:AS.join(" ")},c={begin:"\\(",end:"\\)",contains:s,keywords:l,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o("'"),o('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,c,a("variable","@@?[\\w-]+",10),a("variable","@\\{[\\w-]+\\}"),a("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT);const O=s.concat({begin:/\{/,end:/\}/,contains:r}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},u={begin:n+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ES.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},d={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:s,relevance:0}},f={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:O}},p={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:n,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,a("keyword","all\\b"),a("variable","@\\{[\\w-]+\\}"),{begin:"\\b("+WS.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,a("selector-tag",n,0),a("selector-id","#"+n),a("selector-class","\\."+n,0),a("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+NS.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+CS.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:O},{begin:"!important"},t.FUNCTION_DISPATCH]},m={begin:`[\\w-]+:(:)?(${i.join("|")})`,returnBegin:!0,contains:[p]};return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,d,f,m,u,p),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}},grmr_lua:e=>{const t="\\[=*\\[",i="\\]=*\\]",n={begin:t,end:i,contains:["self"]},r=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[",i,{contains:[n],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:i,contains:[n],relevance:5}])}},grmr_makefile:e=>{const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{const t=e.regex,i=t.concat(/[A-Z_]/,t.optional(/[A-Z0-9_.-]*:/),/[A-Z0-9_.-]*/),n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(r,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin://,relevance:10,contains:[r,a,o,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[r,s,a,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},grmr_markdown:e=>{const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},n={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},r={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};n.contains.push(r),r.contains.push(n);let s=[t,i];return n.contains=n.contains.concat(s),r.contains=r.contains.concat(s),s=s.concat(n,r),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:s},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:s}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},n,r,{className:"quote",begin:"^>\\s+",contains:s,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},i,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}},grmr_objectivec:e=>{const t=/[a-zA-Z@][a-zA-Z0-9_]*/,i={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{$pattern:t,keyword:["int","float","while","char","export","sizeof","typedef","const","struct","for","union","unsigned","long","volatile","static","bool","mutable","if","do","return","goto","void","enum","else","break","extern","asm","case","short","default","double","register","explicit","signed","typename","this","switch","continue","wchar_t","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","super","unichar","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["BOOL","dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"]},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+i.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},grmr_perl:e=>{const t=e.regex,i=/[dualxmsipngr]{0,12}/,n={$pattern:/[\w.]+/,keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0"},r={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},s={begin:/->\{/,end:/\}/},o={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[e.BACKSLASH_ESCAPE,r,o],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,n,r="\\1")=>{const s="\\1"===r?r:t.concat(r,n);return t.concat(t.concat("(?:",e,")"),n,/(?:\\.|[^\\\/])*?/,s,/(?:\\.|[^\\\/])*?/,r,i)},O=(e,n,r)=>t.concat(t.concat("(?:",e,")"),n,/(?:\\.|[^\\\/])*?/,r,i),h=[o,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",t.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:O("(?:m|qr)?",/\//,/\//)},{begin:O("m|qr",t.either(...l,{capture:!0}),/\1/)},{begin:O("m|qr",/\(/,/\)/)},{begin:O("m|qr",/\[/,/\]/)},{begin:O("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return r.contains=h,s.contains=h,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:h}},grmr_php:e=>{const t=e.regex,i="[a-zA-Z0-9_-ÿ]*(?![A-Za-z0-9])(?![$]))",n=t.concat("([a-zA-Z_\\x7f-\\xff]",i),r=t.concat("([A-Z]",i),s={scope:"variable",match:"\\$+"+n},o={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(o)}),a,e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(o)})]},O={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],u=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],d={keyword:h,literal:(e=>{const t=[];return["false","null","true"].forEach((e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())})),t})(),built_in:u},f=e=>e.map((e=>e.replace(/\|\d+$/,""))),p={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",f(u).join("\\b|"),"\\b)"),t.concat(/\\?/,n),t.concat(l,"*",/\(/)],scope:{1:"keyword",4:"title.class"}}]},m={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",f(h).join("\\b|"),"|",f(u).join("\\b|"),"\\b)"),n,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"}},g=t.concat(n,"\\b(?!\\()"),$={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),g],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]};return{case_insensitive:!1,keywords:d,contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},s,m,$,{match:[/const/,/\s/,n,/\s*=/],scope:{1:"keyword",3:"variable.constant"}},p,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",s,$,e.C_BLOCK_COMMENT_MODE,c,O]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,O]}},grmr_php_template:e=>({name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}),grmr_plaintext:e=>({name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}),grmr_python:e=>{const t=e.regex,i=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],r={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},s={className:"meta",begin:/^(>>>|\.\.\.) /},o={className:"subst",begin:/\{/,end:/\}/,keywords:r,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,s,a,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,s,a,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",O=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,h="\\b|"+n.join("|"),u={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${O}))[eE][+-]?(${c})[jJ]?(?=${h})`},{begin:`(${O})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${h})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${h})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${h})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${h})`},{begin:`\\b(${c})[jJ](?=${h})`}]},d={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:r,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:["self",s,u,l,e.HASH_COMMENT_MODE]}]};return o.contains=[l,u,s],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:r,illegal:/(<\/|->|\?)|=>/,contains:[s,u,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,d,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,f,l]}]}},grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{const t=e.regex,i=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:i,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:i},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[s,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[i,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{const t=e.regex,i="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor __FILE__",built_in:"proc lambda",literal:"true false nil"},r={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},o=[e.COMMENT("#","$",{contains:[r]}),e.COMMENT("^=begin","^=end",{contains:[r],relevance:10}),e.COMMENT("^__END__","\\n$")],a={className:"subst",begin:/#\{/,end:/\}/,keywords:n},l={className:"string",contains:[e.BACKSLASH_ESCAPE,a],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,a]})]}]},c="[0-9](_?[0-9])*",O={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${c}))?([eE][+-]?(${c})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:n},u=[l,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE,relevance:0}]}].concat(o)},{className:"function",begin:t.concat(/def\s+/,t.lookahead(i+"\\s*(\\(|;|$)")),relevance:0,keywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:i}),h].concat(o)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[l,{begin:i}],relevance:0},O,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,relevance:0,keywords:n},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,a],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,o),relevance:0}].concat(s,o);a.contains=u,h.contains=u;const d=[{begin:/^\s*=>/,starts:{end:"$",contains:u}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",contains:u}}];return o.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:n,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(d).concat(o).concat(u)}},grmr_rust:e=>{const t=e.regex,i={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},n="([ui](8|16|32|64|128|size)|f(32|64))?",r=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bin!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"],keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:r},illegal:""},i]}},grmr_scss:e=>{const t=TS(e),i=CS,n=NS,r="@[a-z-]+",s={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+WS.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+i.join("|")+")"},s,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ES.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,s,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:AS.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},s,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}},grmr_shell:e=>({name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}),grmr_sql:e=>{const t=e.regex,i=e.COMMENT("--","$"),n=["true","false","unknown"],r=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],s=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],o=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],a=s,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter((e=>!s.includes(e))),c={begin:t.concat(/\b/,t.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:t,when:i}={})=>{const n=i;return t=t||[],e.map((e=>e.match(/\|\d+$/)||t.includes(e)?e:n(e)?e+"|0":e))})(l,{when:e=>e.length<3}),literal:n,type:r,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...o),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(o),literal:n,type:r}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,i,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},grmr_swift:e=>{const t={match:/\s+/,relevance:0},i=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,i],r={match:[/\./,LX(...FS,...KS)],className:{2:"keyword"}},s={match:GX(/\./,LX(...JS)),relevance:0},o=JS.filter((e=>"string"==typeof e)).concat(["_|0"]),a={variants:[{className:"keyword",match:LX(...JS.filter((e=>"string"!=typeof e)).concat(HS).map(BS),...KS)}]},l={$pattern:LX(/\b\w+/,/#\w+/),keyword:o.concat(iR),literal:eR},c=[r,s,a],O=[{match:GX(/\./,LX(...nR)),relevance:0},{className:"built_in",match:GX(/\b/,LX(...nR),/(?=\()/)}],h={match:/->/,relevance:0},u=[h,{className:"operator",relevance:0,variants:[{match:oR},{match:`\\.(\\.|${sR})+`}]}],d="([0-9a-fA-F]_*)+",f={className:"number",relevance:0,variants:[{match:"\\b(([0-9]_*)+)(\\.(([0-9]_*)+))?([eE][+-]?(([0-9]_*)+))?\\b"},{match:`\\b0x(${d})(\\.(${d}))?([pP][+-]?(([0-9]_*)+))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},p=(e="")=>({className:"subst",variants:[{match:GX(/\\/,e,/[0\\tnr"']/)},{match:GX(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),m=(e="")=>({className:"subst",match:GX(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),g=(e="")=>({className:"subst",label:"interpol",begin:GX(/\\/,e,/\(/),end:/\)/}),$=(e="")=>({begin:GX(e,/"""/),end:GX(/"""/,e),contains:[p(e),m(e),g(e)]}),b=(e="")=>({begin:GX(e,/"/),end:GX(/"/,e),contains:[p(e),g(e)]}),Q={className:"string",variants:[$(),$("#"),$("##"),$("###"),b(),b("#"),b("##"),b("###")]},y={match:GX(/`/,cR,/`/)},P=[y,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${lR}+`}],w=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:uR,contains:[...u,f,Q]}]}},{className:"keyword",match:GX(/@/,LX(...hR))},{className:"meta",match:GX(/@/,cR)}],k={match:MX(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:GX(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,lR,"+")},{className:"type",match:OR,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:GX(/\s+&\s+/,MX(OR)),relevance:0}]},_={begin://,keywords:l,contains:[...n,...c,...w,h,k]};k.contains.push(_);const v={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:GX(cR,/\s*:/),keywords:"_|0",relevance:0},...n,...c,...O,...u,f,Q,...P,...w,k]},x={begin://,contains:[...n,k]},X={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:LX(MX(GX(cR,/\s*:/)),MX(GX(cR,/\s+/,cR,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:cR}]},...n,...c,...u,f,Q,...w,k,v],endsParent:!0,illegal:/["']/},S={match:[/func/,/\s+/,LX(y.match,cR,oR)],className:{1:"keyword",3:"title.function"},contains:[x,X,t],illegal:[/\[/,/%/]},R={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[x,X,t],illegal:/\[|%/},T={match:[/operator/,/\s+/,oR],className:{1:"keyword",3:"title"}},W={begin:[/precedencegroup/,/\s+/,OR],className:{1:"keyword",3:"title"},contains:[k],keywords:[...tR,...eR],end:/}/};for(const e of Q.variants){const t=e.contains.find((e=>"interpol"===e.label));t.keywords=l;const i=[...c,...O,...u,f,Q,...P];t.contains=[...i,{begin:/\(/,end:/\)/,contains:["self",...i]}]}return{name:"Swift",keywords:l,contains:[...n,S,R,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},T,W,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},...c,...O,...u,f,Q,...P,...w,k,v]}},grmr_typescript:e=>{const t=LS(e),i=["any","void","number","boolean","string","object","never","enum"],n={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},r={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:IS,keyword:YS.concat(["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"]),literal:ZS,built_in:GS.concat(i),"variable.language":jS},o={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},a=(e,t,i)=>{const n=e.contains.findIndex((e=>e.label===t));if(-1===n)throw Error("can not find mode to replace");e.contains.splice(n,1,i)};return Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(o),t.contains=t.contains.concat([o,n,r]),a(t,"shebang",e.SHEBANG()),a(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),t.contains.find((e=>"func.def"===e.label)).relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx"]}),t},grmr_vbnet:e=>{const t=e.regex,i=/\d{1,2}\/\d{1,2}\/\d{4}/,n=/\d{4}-\d{1,2}-\d{1,2}/,r=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,s=/\d{1,2}(:\d{1,2}){1,2}/,o={className:"literal",variants:[{begin:t.concat(/# */,t.either(n,i),/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,r,/ *#/)},{begin:t.concat(/# */,t.either(n,i),/ +/,t.either(r,s),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}},grmr_yaml:e=>{const t="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},r=e.inherit(n,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),s={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},o={begin:/\{/,end:/\}/,contains:[s],illegal:"\\n",relevance:0},a={begin:"\\[",end:"\\]",contains:[s],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},o,a,n],c=[...l];return c.pop(),c.push(r),s.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:l}}});const fR=RS;for(const e of Object.keys(dR)){const t=e.replace("grmr_","").replace("_","-");fR.registerLanguage(t,dR[e])} +/*! `julia` grammar compiled for Highlight.js 11.4.0 */var pR=e=>{var t="[A-Za-z_\\u00A1-\\uFFFF][A-Za-z_0-9\\u00A1-\\uFFFF]*",i={$pattern:t,keyword:["baremodule","begin","break","catch","ccall","const","continue","do","else","elseif","end","export","false","finally","for","function","global","if","import","in","isa","let","local","macro","module","quote","return","true","try","using","where","while"],literal:["ARGS","C_NULL","DEPOT_PATH","ENDIAN_BOM","ENV","Inf","Inf16","Inf32","Inf64","InsertionSort","LOAD_PATH","MergeSort","NaN","NaN16","NaN32","NaN64","PROGRAM_FILE","QuickSort","RoundDown","RoundFromZero","RoundNearest","RoundNearestTiesAway","RoundNearestTiesUp","RoundToZero","RoundUp","VERSION|0","devnull","false","im","missing","nothing","pi","stderr","stdin","stdout","true","undef","π","ℯ"],built_in:["AbstractArray","AbstractChannel","AbstractChar","AbstractDict","AbstractDisplay","AbstractFloat","AbstractIrrational","AbstractMatrix","AbstractRange","AbstractSet","AbstractString","AbstractUnitRange","AbstractVecOrMat","AbstractVector","Any","ArgumentError","Array","AssertionError","BigFloat","BigInt","BitArray","BitMatrix","BitSet","BitVector","Bool","BoundsError","CapturedException","CartesianIndex","CartesianIndices","Cchar","Cdouble","Cfloat","Channel","Char","Cint","Cintmax_t","Clong","Clonglong","Cmd","Colon","Complex","ComplexF16","ComplexF32","ComplexF64","CompositeException","Condition","Cptrdiff_t","Cshort","Csize_t","Cssize_t","Cstring","Cuchar","Cuint","Cuintmax_t","Culong","Culonglong","Cushort","Cvoid","Cwchar_t","Cwstring","DataType","DenseArray","DenseMatrix","DenseVecOrMat","DenseVector","Dict","DimensionMismatch","Dims","DivideError","DomainError","EOFError","Enum","ErrorException","Exception","ExponentialBackOff","Expr","Float16","Float32","Float64","Function","GlobalRef","HTML","IO","IOBuffer","IOContext","IOStream","IdDict","IndexCartesian","IndexLinear","IndexStyle","InexactError","InitError","Int","Int128","Int16","Int32","Int64","Int8","Integer","InterruptException","InvalidStateException","Irrational","KeyError","LinRange","LineNumberNode","LinearIndices","LoadError","MIME","Matrix","Method","MethodError","Missing","MissingException","Module","NTuple","NamedTuple","Nothing","Number","OrdinalRange","OutOfMemoryError","OverflowError","Pair","PartialQuickSort","PermutedDimsArray","Pipe","ProcessFailedException","Ptr","QuoteNode","Rational","RawFD","ReadOnlyMemoryError","Real","ReentrantLock","Ref","Regex","RegexMatch","RoundingMode","SegmentationFault","Set","Signed","Some","StackOverflowError","StepRange","StepRangeLen","StridedArray","StridedMatrix","StridedVecOrMat","StridedVector","String","StringIndexError","SubArray","SubString","SubstitutionString","Symbol","SystemError","Task","TaskFailedException","Text","TextDisplay","Timer","Tuple","Type","TypeError","TypeVar","UInt","UInt128","UInt16","UInt32","UInt64","UInt8","UndefInitializer","UndefKeywordError","UndefRefError","UndefVarError","Union","UnionAll","UnitRange","Unsigned","Val","Vararg","VecElement","VecOrMat","Vector","VersionNumber","WeakKeyDict","WeakRef"]},n={keywords:i,illegal:/<\//},r={className:"subst",begin:/\$\(/,end:/\)/,keywords:i},s={className:"variable",begin:"\\$"+t},o={className:"string",contains:[e.BACKSLASH_ESCAPE,r,s],variants:[{begin:/\w*"""/,end:/"""\w*/,relevance:10},{begin:/\w*"/,end:/"\w*/}]},a={className:"string",contains:[e.BACKSLASH_ESCAPE,r,s],begin:"`",end:"`"},l={className:"meta",begin:"@"+t};return n.name="Julia",n.contains=[{className:"number",begin:/(\b0x[\d_]*(\.[\d_]*)?|0x\.\d[\d_]*)p[-+]?\d+|\b0[box][a-fA-F0-9][a-fA-F0-9_]*|(\b\d[\d_]*(\.[\d_]*)?|\.\d[\d_]*)([eEfF][-+]?\d+)?/,relevance:0},{className:"string",begin:/'(.|\\[xXuU][a-zA-Z0-9]+)'/},o,a,l,{className:"comment",variants:[{begin:"#=",end:"=#",relevance:10},{begin:"#",end:"$"}]},e.HASH_COMMENT_MODE,{className:"keyword",begin:"\\b(((abstract|primitive)\\s+)type|(mutable\\s+)?struct)\\b"},{begin:/<:/}],r.contains=n.contains,n},mR=pR,gR=e=>({name:"Julia REPL",contains:[{className:"meta",begin:/^julia>/,relevance:10,starts:{end:/^(?![ ]{6})/,subLanguage:"julia"}}],aliases:["jldoctest"]});fR.registerLanguage("julia",mR),fR.registerLanguage("julia-repl",gR);var $R=fR;class bR extends k{constructor(){super(),this.state={},this.old_height=0,this.resize_observer=new ResizeObserver((e=>{const t=this.base.offsetHeight;if(document.body.querySelector("pluto-cell:focus-within")){var i;const e=document.body.querySelectorAll("pluto-cell:focus-within ~ pluto-cell > pluto-output");"SUMMARY"===(null===(i=document.activeElement)||void 0===i?void 0:i.tagName)||0!==e.length&&Array.from(e).includes(this.base)||window.scrollBy(0,t-this.old_height)}this.old_height=t}))}shouldComponentUpdate({last_run_timestamp:e}){return e!==this.props.last_run_timestamp}componentDidMount(){this.resize_observer.observe(this.base)}componentWillUnmount(){this.resize_observer.unobserve(this.base)}render(){const e=this.props.errored||!this.props.body||"application/vnd.pluto.tree+object"!==this.props.mime&&"application/vnd.pluto.table+object"!==this.props.mime&&"text/plain"!==this.props.mime,t=!this.props.errored&&e;return xe` + + ${this.props.rootassignee} + <${yR} ...${this.props} /> + + `}}let QR=({body:e,mime:t})=>{let i=Oe();return ce((()=>{let n=URL.createObjectURL(new Blob([e],{type:t}));return i.current.onload=i.current.onerror=()=>{i.current&&(i.current.style.display=null)},""===i.current.src&&(i.current.style.display="none"),i.current.type=t,i.current.src=n,()=>URL.revokeObjectURL(n)}),[e,t]),xe``};const yR=({mime:e,body:t,cell_id:i,persist_js_state:n=!1,last_run_timestamp:r})=>{switch(e){case"image/png":case"image/jpg":case"image/jpeg":case"image/gif":case"image/bmp":case"image/svg+xml":return xe`
<${QR} mime=${e} body=${t} />
`;case"text/html":return t.startsWith("`:xe`<${XR} + cell_id=${i} + body=${t} + persist_js_state=${n} + last_run_timestamp=${r} + />`;case"application/vnd.pluto.tree+object":return xe`
+ <${w_} cell_id=${i} body=${t} persist_js_state=${n} /> +
`;case"application/vnd.pluto.table+object":return xe`<${k_} cell_id=${i} body=${t} persist_js_state=${n} />`;case"application/vnd.pluto.stacktrace+object":return xe`
<${g_} cell_id=${i} ...${t} />
`;case"application/vnd.pluto.divelement+object":return(({cell_id:e,style:t,classname:i,children:n,persist_js_state:r=!1})=>xe`
${n.map((t=>xe`<${b_} cell_id=${e} mime=${t[1]} body=${t[0]} persist_js_state=${r} />`))}
`)({cell_id:i,...t,persist_js_state:n});case"text/plain":return t?xe`
+
${t}
+
`:xe`
`;case null:case void 0:case"":return xe``;default:return xe`
🛑
`}};!function(e,t,i,n){function r(){const t=Reflect.construct(HTMLElement,[],r);return t._vdomComponent=e,t._root=n&&n.shadow?t.attachShadow({mode:"open"}):t,t}r.prototype=Object.create(HTMLElement.prototype),r.prototype.constructor=r,r.prototype.connectedCallback=H_,r.prototype.attributeChangedCallback=ev,r.prototype.disconnectedCallback=tv,i=i||e.observedAttributes||Object.keys(e.propTypes||{}),r.observedAttributes=i,i.forEach((e=>{Object.defineProperty(r.prototype,e,{get(){return this._vdom.props[e]},set(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t,this.connectedCallback());const i=typeof t;null!=t&&"string"!==i&&"boolean"!==i&&"number"!==i||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,r)}(yR,"pluto-display",["mime","body","cell_id","persist_js_state","last_run_timestamp"]);let PR=({body:e})=>{let t=Oe();return ce((()=>{let i=URL.createObjectURL(new Blob([e],{type:"text/html"}));return t.current.src=i,vR((async()=>{await new Promise((e=>t.current.addEventListener("load",(()=>e(null)))));let e=t.current.contentWindow.document,i=document.querySelector("#iframe-resizer-content-window-script"),n=e.createElement("script");n.src=i.src,n.crossOrigin="anonymous",e.head.appendChild(n),new Promise((e=>n.addEventListener("load",(()=>e(null))))),window.iFrameResize({checkOrigin:!1},t.current)})),()=>URL.revokeObjectURL(i)}),[e]),xe``},wR=async({environment:e,code:t})=>{const i=`"use strict"; return (async () => {${t}})()`;let{this:n,...r}=e,s=Object.keys(r),o=Object.values(r);return await Function(...s,i).bind(n)(...o)},kR=async(e,t)=>{let i=document.createElement("script");for(let t of e.attributes)i.attributes.setNamedItem(t.cloneNode(!0));i.textContent="{\n window.____FUNCTION_TO_RUN_INSIDE_SCRIPT.result = window.____FUNCTION_TO_RUN_INSIDE_SCRIPT.function_to_run(window.____FUNCTION_TO_RUN_INSIDE_SCRIPT.currentScript)\n }",window.____FUNCTION_TO_RUN_INSIDE_SCRIPT={function_to_run:t,currentScript:i,result:null};const n=e.parentNode;if(null==n)throw"Failed to execute script it has no parent in DOM.";n.replaceChild(i,e);let r=await window.____FUNCTION_TO_RUN_INSIDE_SCRIPT.result;return window.____FUNCTION_TO_RUN_INSIDE_SCRIPT={function_to_run:t,result:null},{node:i,result:r}};const _R=e=>e instanceof Element&&e.nodeType===Node.ELEMENT_NODE;let vR=e=>e(),xR=e=>{try{const t=e.getAttribute("shadowroot"),i=e.parentElement.attachShadow({mode:t});i.appendChild(e.content),e.remove();return Array.from(i.querySelectorAll("script, template[shadowroot]")).flatMap((e=>"SCRIPT"===e.nodeName?[e]:"TEMPLATE"===e.nodeName?xR(e):void 0))}catch(t){return console.error("Couldn't attach declarative shadow dom to",e,"because of",t),[]}},XR=({body:e,className:t="",persist_js_state:i=!1,last_run_timestamp:n})=>{let r=de(l_),s=de(c_),o=de(O_),a=Oe(new Map),l=Oe((()=>{})),c=Oe(null);return ce((()=>{c.current&&s&&L_(c.current.querySelectorAll("bond"),s)}),[e,i,r,s]),ce((()=>{const t=c.current;if(null==t)return;let n=new Promise((e=>{l.current=()=>{e(null)}}));document.createElement("p-dumpster").append(...t.childNodes),t.innerHTML=e;const O=[...Array.from(t.querySelectorAll("template[shadowroot]")).flatMap((e=>xR(e))),...Array.from(t.querySelectorAll("script"))];return vR((async()=>{try{var e;if(null==o||o.add(t),a.current=await(async({root_node:e,script_nodes:t,previous_results_map:i,invalidation:n,pluto_actions:r})=>{let s=new Map;for(let e of t)if(null!=e.src&&""!==e.src);else{let t=e.id,n=t?i.get(t):null;_R(n)&&(null===(o=e.parentElement)||void 0===o||o.insertBefore(n,e))}for(let a of t)if(null!=a.src&&""!==a.src){let e=Array.from(document.head.querySelectorAll("script")).find((e=>e.src===a.src));null==e&&(e=document.createElement("script"),e.src=a.src,e.type="module"===a.type?"module":"text/javascript",e.pluto_is_loading_me=!0);let t=e;null!=t.pluto_is_loading_me&&(await new Promise((e=>{t.addEventListener("load",e),t.addEventListener("error",e),document.head.appendChild(t)})),t.pluto_is_loading_me=void 0)}else try{let t=a.id,l=t?i.get(t):null;if("module"===a.type&&console.warn("We don't (yet) fully support
\ No newline at end of file diff --git a/frontend-dist/ellipsis-horizontal-circle-outline.6279ed30.svg b/frontend-dist/ellipsis-horizontal-circle-outline.6279ed30.svg new file mode 100644 index 0000000000..4b8d05ea8e --- /dev/null +++ b/frontend-dist/ellipsis-horizontal-circle-outline.6279ed30.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/ellipsis-horizontal-outline.abb6e818.svg b/frontend-dist/ellipsis-horizontal-outline.abb6e818.svg new file mode 100644 index 0000000000..bf94f28aca --- /dev/null +++ b/frontend-dist/ellipsis-horizontal-outline.abb6e818.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/ellipsis-horizontal.c9a6cc29.svg b/frontend-dist/ellipsis-horizontal.c9a6cc29.svg new file mode 100644 index 0000000000..5df322580b --- /dev/null +++ b/frontend-dist/ellipsis-horizontal.c9a6cc29.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/ellipsis-vertical.a30e7430.svg b/frontend-dist/ellipsis-vertical.a30e7430.svg new file mode 100644 index 0000000000..27f793a2cb --- /dev/null +++ b/frontend-dist/ellipsis-vertical.a30e7430.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/error.jl.html b/frontend-dist/error.jl.html new file mode 100644 index 0000000000..7c0236d4a5 --- /dev/null +++ b/frontend-dist/error.jl.html @@ -0,0 +1 @@ +⚡ Pluto.jl ⚡$STYLE

$TITLE

$ADVICE


Go back


$BODYTITLE

$BODY
\ No newline at end of file diff --git a/frontend-dist/eye-off-outline.a37e03db.svg b/frontend-dist/eye-off-outline.a37e03db.svg new file mode 100644 index 0000000000..4a7e915939 --- /dev/null +++ b/frontend-dist/eye-off-outline.a37e03db.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/eye-outline.6e6e0f7c.svg b/frontend-dist/eye-outline.6e6e0f7c.svg new file mode 100644 index 0000000000..6901ef405b --- /dev/null +++ b/frontend-dist/eye-outline.6e6e0f7c.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/favicon-16x16.347d2855.png b/frontend-dist/favicon-16x16.347d2855.png new file mode 100644 index 0000000000..bd77b08001 Binary files /dev/null and b/frontend-dist/favicon-16x16.347d2855.png differ diff --git a/frontend-dist/favicon-32x32.8789add4.png b/frontend-dist/favicon-32x32.8789add4.png new file mode 100644 index 0000000000..96580877eb Binary files /dev/null and b/frontend-dist/favicon-32x32.8789add4.png differ diff --git a/frontend-dist/favicon-96x96.48689391.png b/frontend-dist/favicon-96x96.48689391.png new file mode 100644 index 0000000000..1d5d57d5b2 Binary files /dev/null and b/frontend-dist/favicon-96x96.48689391.png differ diff --git a/frontend-dist/favicon_unsaturated.d1387b25.svg b/frontend-dist/favicon_unsaturated.d1387b25.svg new file mode 100644 index 0000000000..ccc316f314 --- /dev/null +++ b/frontend-dist/favicon_unsaturated.d1387b25.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/firebase-app.42556901.js b/frontend-dist/firebase-app.42556901.js new file mode 100644 index 0000000000..24e12ac5f5 --- /dev/null +++ b/frontend-dist/firebase-app.42556901.js @@ -0,0 +1,213 @@ +(()=>{function e(e,t,n,i){Object.defineProperty(e,t,{get:n,set:i,enumerable:!0,configurable:!0})}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire94c2.register("dN8oq",(function(t,n){e(t.exports,"FirebaseError",(()=>r)),e(t.exports,"_DEFAULT_ENTRY_NAME",(()=>O)),e(t.exports,"_apps",(()=>C)),e(t.exports,"_components",(()=>D)),e(t.exports,"_addComponent",(()=>A)),e(t.exports,"_addOrOverwriteComponent",(()=>N)),e(t.exports,"_registerComponent",(()=>R)),e(t.exports,"_getProvider",(()=>S)),e(t.exports,"_removeServiceInstance",(()=>$)),e(t.exports,"_clearComponents",(()=>j)),e(t.exports,"SDK_VERSION",(()=>k)),e(t.exports,"initializeApp",(()=>z)),e(t.exports,"getApp",(()=>T)),e(t.exports,"getApps",(()=>P)),e(t.exports,"deleteApp",(()=>x)),e(t.exports,"registerVersion",(()=>M)),e(t.exports,"onLog",(()=>U)),e(t.exports,"setLogLevel",(()=>B)); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class i{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class r extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,r.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,s.prototype.create)}}class s{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?function(e,t){return e.replace(o,((e,n)=>{const i=t[n];return null!=i?String(i):`<${n}?>`}))}(s,n):"Error",c=`${this.serviceName}: ${a} (${i}).`;return new r(i,c,n)}}const o=/\{\$([^}]+)}/g;function a(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);for(const r of n){if(!i.includes(r))return!1;const n=e[r],s=t[r];if(c(n)&&c(s)){if(!a(n,s))return!1}else if(n!==s)return!1}for(const e of i)if(!n.includes(e))return!1;return!0}function c(e){return null!==e&&"object"==typeof e}class l{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const p="[DEFAULT]"; +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class h{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new i;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),i=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(i)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(i)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */(e))try{this.getOrInitializeService({instanceIdentifier:p})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e="[DEFAULT]"){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e="[DEFAULT]"){return this.instances.has(e)}getOptions(e="[DEFAULT]"){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(i)}return i}onInit(e,t){var n;const i=this.normalizeInstanceIdentifier(t),r=null!==(n=this.onInitCallbacks.get(i))&&void 0!==n?n:new Set;r.add(e),this.onInitCallbacks.set(i,r);const s=this.instances.get(i);return s&&e(s,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const i of n)try{i(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(i=e,i===p?void 0:i),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var i;return n||null}normalizeInstanceIdentifier(e="[DEFAULT]"){return this.component?this.component.multipleInstances?e:p:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class f{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new h(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const d=[];var u,m;(m=u||(u={}))[m.DEBUG=0]="DEBUG",m[m.VERBOSE=1]="VERBOSE",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.SILENT=5]="SILENT";const g={debug:u.DEBUG,verbose:u.VERBOSE,info:u.INFO,warn:u.WARN,error:u.ERROR,silent:u.SILENT},b=u.INFO,v={[u.DEBUG]:"log",[u.VERBOSE]:"log",[u.INFO]:"info",[u.WARN]:"warn",[u.ERROR]:"error"},I=(e,t,...n)=>{if(t{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const E="https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js",y="0.7.6",_=new class{constructor(e){this.name=e,this._logLevel=b,this._logHandler=I,this._userLogHandler=null,d.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in u))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?g[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,u.DEBUG,...e),this._logHandler(this,u.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,u.VERBOSE,...e),this._logHandler(this,u.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,u.INFO,...e),this._logHandler(this,u.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,u.WARN,...e),this._logHandler(this,u.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,u.ERROR,...e),this._logHandler(this,u.ERROR,...e)}}("https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js"),O="[DEFAULT]",L={[E]:"fire-core","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-check":"fire-app-check","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},C=new Map,D=new Map;function A(e,t){try{e.container.addComponent(t)}catch(n){_.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function N(e,t){e.container.addOrOverwriteComponent(t)}function R(e){const t=e.name;if(D.has(t))return _.debug(`There were multiple attempts to register component ${t}.`),!1;D.set(t,e);for(const t of C.values())A(t,e);return!0}function S(e,t){return e.container.getProvider(t)}function $(e,t,n=O){S(e,t).clearInstance(n)}function j(){D.clear()} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const H=new s("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."}); +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class F{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new l("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw H.create("app-deleted",{appName:this._name})}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const k="9.3.0";function z(e,t={}){if("object"!=typeof t){t={name:t}}const n=Object.assign({name:O,automaticDataCollectionEnabled:!1},t),i=n.name;if("string"!=typeof i||!i)throw H.create("bad-app-name",{appName:String(i)});const r=C.get(i);if(r){if(a(e,r.options)&&a(n,r.config))return r;throw H.create("duplicate-app",{appName:i})}const s=new f(i);for(const e of D.values())s.addComponent(e);const o=new F(e,n,s);return C.set(i,o),o}function T(e=O){const t=C.get(e);if(!t)throw H.create("no-app",{appName:e});return t}function P(){return Array.from(C.values())}async function x(e){const t=e.name;C.has(t)&&(C.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function M(e,t,n){var i;let r=null!==(i=L[e])&&void 0!==i?i:e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const e=[`Unable to register library "${r}" with version "${t}":`];return s&&e.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void _.warn(e.join(" "))}R(new l(`${r}-version`,(()=>({library:r,version:t})),"VERSION"))}function U(e,t){if(null!==e&&"function"!=typeof e)throw H.create("invalid-log-argument");!function(e,t){for(const n of d){let i=null;t&&t.level&&(i=g[t.level]),n.userLogHandler=null===e?null:(t,n,...r)=>{const s=r.map((e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((e=>e)).join(" ");n>=(null!=i?i:t.logLevel)&&e({level:u[n].toLowerCase(),message:s,args:r,type:t.name})}}}(e,t)}function B(e){var t;t=e,d.forEach((e=>{e.setLogLevel(t)}))} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var V;V="",R(new l("platform-logger",(e=>new w(e)),"PRIVATE")),M(E,y,V),M(E,y,"esm2017"),M("fire-js",""); +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +M("firebase","9.3.0","cdn")}))})(); \ No newline at end of file diff --git a/frontend-dist/firebase-app.bead1f66.js b/frontend-dist/firebase-app.bead1f66.js new file mode 100644 index 0000000000..81f08f63da --- /dev/null +++ b/frontend-dist/firebase-app.bead1f66.js @@ -0,0 +1,213 @@ +function e(e,t,n,i){Object.defineProperty(e,t,{get:n,set:i,enumerable:!0,configurable:!0})}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{}).parcelRequire94c2.register("aFiVA",(function(t,n){e(t.exports,"FirebaseError",(()=>r)),e(t.exports,"_DEFAULT_ENTRY_NAME",(()=>O)),e(t.exports,"_apps",(()=>C)),e(t.exports,"_components",(()=>D)),e(t.exports,"_addComponent",(()=>A)),e(t.exports,"_addOrOverwriteComponent",(()=>R)),e(t.exports,"_registerComponent",(()=>N)),e(t.exports,"_getProvider",(()=>S)),e(t.exports,"_removeServiceInstance",(()=>$)),e(t.exports,"_clearComponents",(()=>j)),e(t.exports,"SDK_VERSION",(()=>k)),e(t.exports,"initializeApp",(()=>z)),e(t.exports,"getApp",(()=>T)),e(t.exports,"getApps",(()=>P)),e(t.exports,"deleteApp",(()=>x)),e(t.exports,"registerVersion",(()=>M)),e(t.exports,"onLog",(()=>U)),e(t.exports,"setLogLevel",(()=>B)); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class i{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch((()=>{})),1===e.length?e(t):e(t,n))}}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class r extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,r.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,s.prototype.create)}}class s{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},i=`${this.service}/${e}`,s=this.errors[e],a=s?function(e,t){return e.replace(o,((e,n)=>{const i=t[n];return null!=i?String(i):`<${n}?>`}))}(s,n):"Error",c=`${this.serviceName}: ${a} (${i}).`;return new r(i,c,n)}}const o=/\{\$([^}]+)}/g;function a(e,t){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);for(const r of n){if(!i.includes(r))return!1;const n=e[r],s=t[r];if(c(n)&&c(s)){if(!a(n,s))return!1}else if(n!==s)return!1}for(const e of i)if(!n.includes(e))return!1;return!0}function c(e){return null!==e&&"object"==typeof e}class l{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const p="[DEFAULT]"; +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class h{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new i;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),i=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(i)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(i)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */(e))try{this.getOrInitializeService({instanceIdentifier:p})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e="[DEFAULT]"){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter((e=>"INTERNAL"in e)).map((e=>e.INTERNAL.delete())),...e.filter((e=>"_delete"in e)).map((e=>e._delete()))])}isComponentSet(){return null!=this.component}isInitialized(e="[DEFAULT]"){return this.instances.has(e)}getOptions(e="[DEFAULT]"){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(e)&&t.resolve(i)}return i}onInit(e,t){var n;const i=this.normalizeInstanceIdentifier(t),r=null!==(n=this.onInitCallbacks.get(i))&&void 0!==n?n:new Set;r.add(e),this.onInitCallbacks.set(i,r);const s=this.instances.get(i);return s&&e(s,i),()=>{r.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const i of n)try{i(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(i=e,i===p?void 0:i),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var i;return n||null}normalizeInstanceIdentifier(e="[DEFAULT]"){return this.component?this.component.multipleInstances?e:p:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class f{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new h(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const d=[];var u,m;(m=u||(u={}))[m.DEBUG=0]="DEBUG",m[m.VERBOSE=1]="VERBOSE",m[m.INFO=2]="INFO",m[m.WARN=3]="WARN",m[m.ERROR=4]="ERROR",m[m.SILENT=5]="SILENT";const g={debug:u.DEBUG,verbose:u.VERBOSE,info:u.INFO,warn:u.WARN,error:u.ERROR,silent:u.SILENT},b=u.INFO,v={[u.DEBUG]:"log",[u.VERBOSE]:"log",[u.INFO]:"info",[u.WARN]:"warn",[u.ERROR]:"error"},I=(e,t,...n)=>{if(t{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null})).filter((e=>e)).join(" ")}}const E="https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js",y="0.7.6",_=new class{constructor(e){this.name=e,this._logLevel=b,this._logHandler=I,this._userLogHandler=null,d.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in u))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?g[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,u.DEBUG,...e),this._logHandler(this,u.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,u.VERBOSE,...e),this._logHandler(this,u.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,u.INFO,...e),this._logHandler(this,u.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,u.WARN,...e),this._logHandler(this,u.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,u.ERROR,...e),this._logHandler(this,u.ERROR,...e)}}("https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js"),O="[DEFAULT]",L={[E]:"fire-core","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-check":"fire-app-check","https://www.gstatic.com/firebasejs/9.3.0/firebase-app.js-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},C=new Map,D=new Map;function A(e,t){try{e.container.addComponent(t)}catch(n){_.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function R(e,t){e.container.addOrOverwriteComponent(t)}function N(e){const t=e.name;if(D.has(t))return _.debug(`There were multiple attempts to register component ${t}.`),!1;D.set(t,e);for(const t of C.values())A(t,e);return!0}function S(e,t){return e.container.getProvider(t)}function $(e,t,n=O){S(e,t).clearInstance(n)}function j(){D.clear()} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const F=new s("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."}); +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class H{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new l("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw F.create("app-deleted",{appName:this._name})}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const k="9.3.0";function z(e,t={}){if("object"!=typeof t){t={name:t}}const n=Object.assign({name:O,automaticDataCollectionEnabled:!1},t),i=n.name;if("string"!=typeof i||!i)throw F.create("bad-app-name",{appName:String(i)});const r=C.get(i);if(r){if(a(e,r.options)&&a(n,r.config))return r;throw F.create("duplicate-app",{appName:i})}const s=new f(i);for(const e of D.values())s.addComponent(e);const o=new H(e,n,s);return C.set(i,o),o}function T(e=O){const t=C.get(e);if(!t)throw F.create("no-app",{appName:e});return t}function P(){return Array.from(C.values())}async function x(e){const t=e.name;C.has(t)&&(C.delete(t),await Promise.all(e.container.getProviders().map((e=>e.delete()))),e.isDeleted=!0)}function M(e,t,n){var i;let r=null!==(i=L[e])&&void 0!==i?i:e;n&&(r+=`-${n}`);const s=r.match(/\s|\//),o=t.match(/\s|\//);if(s||o){const e=[`Unable to register library "${r}" with version "${t}":`];return s&&e.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&o&&e.push("and"),o&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void _.warn(e.join(" "))}N(new l(`${r}-version`,(()=>({library:r,version:t})),"VERSION"))}function U(e,t){if(null!==e&&"function"!=typeof e)throw F.create("invalid-log-argument");!function(e,t){for(const n of d){let i=null;t&&t.level&&(i=g[t.level]),n.userLogHandler=null===e?null:(t,n,...r)=>{const s=r.map((e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}})).filter((e=>e)).join(" ");n>=(null!=i?i:t.logLevel)&&e({level:u[n].toLowerCase(),message:s,args:r,type:t.name})}}}(e,t)}function B(e){var t;t=e,d.forEach((e=>{e.setLogLevel(t)}))} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var V;V="",N(new l("platform-logger",(e=>new w(e)),"PRIVATE")),M(E,y,V),M(E,y,"esm2017"),M("fire-js",""); +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +M("firebase","9.3.0","cdn")})); \ No newline at end of file diff --git a/frontend-dist/firebase-firestore.460b9b58.js b/frontend-dist/firebase-firestore.460b9b58.js new file mode 100644 index 0000000000..da4afed70a --- /dev/null +++ b/frontend-dist/firebase-firestore.460b9b58.js @@ -0,0 +1,2039 @@ +var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function e(t,e,n,s){Object.defineProperty(t,e,{get:n,set:s,enumerable:!0,configurable:!0})}var n=t.parcelRequire94c2;n.register("2rOxx",(function(s,r){e(s.exports,"setLogLevel",(()=>Ps)),e(s.exports,"_logWarn",(()=>qs)),e(s.exports,"_debugAssert",(()=>$s)),e(s.exports,"FirestoreError",(()=>zs)),e(s.exports,"_EmptyCredentialsProvider",(()=>Ys)),e(s.exports,"Timestamp",(()=>ar)),e(s.exports,"_FieldPath",(()=>mr)),e(s.exports,"_isBase64Available",(()=>yr)),e(s.exports,"_DocumentKey",(()=>xr)),e(s.exports,"_DatabaseId",(()=>$l)),e(s.exports,"_validateIsNotUsedTogether",(()=>zl)),e(s.exports,"_cast",(()=>Xl)),e(s.exports,"connectFirestoreEmulator",(()=>ed)),e(s.exports,"DocumentReference",(()=>nd)),e(s.exports,"CollectionReference",(()=>rd)),e(s.exports,"Query",(()=>sd)),e(s.exports,"collection",(()=>id)),e(s.exports,"collectionGroup",(()=>od)),e(s.exports,"doc",(()=>ad)),e(s.exports,"refEqual",(()=>cd)),e(s.exports,"queryEqual",(()=>ud)),e(s.exports,"LoadBundleTask",(()=>dd)),e(s.exports,"CACHE_SIZE_UNLIMITED",(()=>fd)),e(s.exports,"Firestore",(()=>gd)),e(s.exports,"initializeFirestore",(()=>md)),e(s.exports,"getFirestore",(()=>pd)),e(s.exports,"ensureFirestoreConfigured",(()=>yd)),e(s.exports,"enableIndexedDbPersistence",(()=>vd)),e(s.exports,"enableMultiTabIndexedDbPersistence",(()=>bd)),e(s.exports,"clearIndexedDbPersistence",(()=>Ed)),e(s.exports,"waitForPendingWrites",(()=>Id)),e(s.exports,"enableNetwork",(()=>Sd)),e(s.exports,"disableNetwork",(()=>_d)),e(s.exports,"terminate",(()=>Nd)),e(s.exports,"loadBundle",(()=>Ad)),e(s.exports,"namedQuery",(()=>Dd)),e(s.exports,"FieldPath",(()=>Cd)),e(s.exports,"documentId",(()=>kd)),e(s.exports,"Bytes",(()=>Rd)),e(s.exports,"FieldValue",(()=>Ld)),e(s.exports,"GeoPoint",(()=>Od)),e(s.exports,"SnapshotMetadata",(()=>lf)),e(s.exports,"DocumentSnapshot",(()=>df)),e(s.exports,"QueryDocumentSnapshot",(()=>ff)),e(s.exports,"QuerySnapshot",(()=>gf)),e(s.exports,"snapshotEqual",(()=>pf)),e(s.exports,"QueryConstraint",(()=>wf)),e(s.exports,"query",(()=>vf)),e(s.exports,"where",(()=>Tf)),e(s.exports,"orderBy",(()=>If)),e(s.exports,"limit",(()=>_f)),e(s.exports,"limitToLast",(()=>Nf)),e(s.exports,"startAt",(()=>Df)),e(s.exports,"startAfter",(()=>xf)),e(s.exports,"endBefore",(()=>kf)),e(s.exports,"endAt",(()=>Rf)),e(s.exports,"AbstractUserDataWriter",(()=>Pf)),e(s.exports,"WriteBatch",(()=>qf)),e(s.exports,"getDoc",(()=>jf)),e(s.exports,"getDocFromCache",(()=>$f)),e(s.exports,"getDocFromServer",(()=>Gf)),e(s.exports,"getDocs",(()=>Hf)),e(s.exports,"getDocsFromCache",(()=>zf)),e(s.exports,"getDocsFromServer",(()=>Qf)),e(s.exports,"setDoc",(()=>Wf)),e(s.exports,"executeWrite",(()=>eg)),e(s.exports,"updateDoc",(()=>Yf)),e(s.exports,"deleteDoc",(()=>Xf)),e(s.exports,"addDoc",(()=>Jf)),e(s.exports,"onSnapshot",(()=>Zf)),e(s.exports,"onSnapshotsInSync",(()=>tg)),e(s.exports,"Transaction",(()=>sg)),e(s.exports,"runTransaction",(()=>rg)),e(s.exports,"deleteField",(()=>ig)),e(s.exports,"serverTimestamp",(()=>og)),e(s.exports,"arrayUnion",(()=>ag)),e(s.exports,"arrayRemove",(()=>cg)),e(s.exports,"increment",(()=>ug)),e(s.exports,"writeBatch",(()=>hg));var i=n("aFiVA"),o=n("fnbc9"); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const a=function(t){const e=[];let n=0;for(let s=0;s>6|192,e[n++]=63&r|128):55296==(64512&r)&&s+1>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128)}return e},c={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let e=0;e>2,h=(3&r)<<4|o>>4;let l=(15&o)<<2|c>>6,d=63&c;a||(d=64,i||(l=64)),s.push(n[u],n[h],n[l],n[d])}return s.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(a(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,s=0;for(;n191&&r<224){const i=t[n++];e[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){const i=((7&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[s++]=String.fromCharCode(55296+(i>>10)),e[s++]=String.fromCharCode(56320+(1023&i))}else{const i=t[n++],o=t[n++];e[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let e=0;e>4;if(s.push(c),64!==o){const t=i<<4&240|o>>2;if(s.push(t),64!==a){const t=o<<6&192|a;s.push(t)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u=function(t){return function(t){const e=a(t);return c.encodeByteArray(e,!0)}(t).replace(/\./g,"")}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function h(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function l(){return!function(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(t){return!1}}()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function d(t,e){if(t===e)return!0;const n=Object.keys(t),s=Object.keys(e);for(const r of n){if(!s.includes(r))return!1;const n=t[r],i=e[r];if(f(n)&&f(i)){if(!d(n,i))return!1}else if(n!==i)return!1}for(const t of s)if(!n.includes(t))return!1;return!0}function f(t){return null!==t&&"object"==typeof t} +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function g(t){return t&&t._delegate?t._delegate:t}class m{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var p,y;(y=p||(p={}))[y.DEBUG=0]="DEBUG",y[y.VERBOSE=1]="VERBOSE",y[y.INFO=2]="INFO",y[y.WARN=3]="WARN",y[y.ERROR=4]="ERROR",y[y.SILENT=5]="SILENT";const w={debug:p.DEBUG,verbose:p.VERBOSE,info:p.INFO,warn:p.WARN,error:p.ERROR,silent:p.SILENT},v=p.INFO,b={[p.DEBUG]:"log",[p.VERBOSE]:"log",[p.INFO]:"info",[p.WARN]:"warn",[p.ERROR]:"error"},T=(t,e,...n)=>{if(e>>0),C=0;function k(t,e,n){return t.call.apply(t.bind,arguments)}function R(t,e,n){if(!t)throw Error();if(2e?1:0}t:{var z=_.navigator;if(z){var Q=z.userAgent;if(Q){K=Q;break t}}K=""}function W(t,e,n){for(const s in t)e.call(n,t[s],s,t)}function Y(t){const e={};for(const n in t)e[n]=t[n];return e}var X="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function J(t,e){let n,s;for(let e=1;eparseFloat(ut)){tt=String(lt);break t}}tt=ut}var dt,ft={};function gt(){return function(t){var e=ft;return Object.prototype.hasOwnProperty.call(e,9)?e[9]:e[9]=t(9)}((function(){let t=0;const e=$(String(tt)).split("."),n=$("9").split("."),s=Math.max(e.length,n.length);for(let o=0;0==t&&o>>0);function Ut(t){return"function"==typeof t?t:(t[Vt]||(t[Vt]=function(e){return t.handleEvent(e)}),t[Vt])}function qt(){F.call(this),this.i=new _t(this),this.P=this,this.I=null}function Bt(t,e){var n,s=t.I;if(s)for(n=[];s;s=s.I)n.push(s);if(t=t.P,s=e.type||e,"string"==typeof e)e=new wt(e,t);else if(e instanceof wt)e.target=e.target||t;else{var r=e;J(e=new wt(s,t),r)}if(r=!0,n)for(var i=n.length-1;0<=i;i--){var o=e.g=n[i];r=jt(o,s,!0,e)&&r}if(r=jt(o=e.g=t,s,!0,e)&&r,r=jt(o,s,!1,e)&&r,n)for(i=0;inew zt),(t=>t.reset()));class zt{constructor(){this.next=this.g=this.h=null}set(t,e){this.h=t,this.g=e,this.next=null}reset(){this.next=this.g=this.h=null}}function Qt(t){_.setTimeout((()=>{throw t}),0)}function Wt(t,e){Gt||function(){var t=_.Promise.resolve(void 0);Gt=function(){t.then(Jt)}}(),Yt||(Gt(),Yt=!0),Xt.add(t,e)}var Yt=!1,Xt=new class{constructor(){this.h=this.g=null}add(t,e){const n=Ht.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n}};function Jt(){for(var t;t=$t();){try{t.h.call(t.g)}catch(t){Qt(t)}var e=Ht;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}Yt=!1}function Zt(t,e){qt.call(this),this.h=t||1,this.g=e||_,this.j=L(this.kb,this),this.l=Date.now()}function te(t){t.da=!1,t.S&&(t.g.clearTimeout(t.S),t.S=null)}function ee(t,e,n){if("function"==typeof t)n&&(t=L(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=L(t.handleEvent,t)}return 2147483647{t.g=null,t.i&&(t.i=!1,ne(t))}),t.j);const e=t.h;t.h=null,t.m.apply(null,e)}M(Zt,qt),(E=Zt.prototype).da=!1,E.S=null,E.kb=function(){if(this.da){var t=Date.now()-this.l;0s.length)){var r=s[1];if(Array.isArray(r)&&!(1>r.length)){var i=r[0];if("noop"!=i&&"stop"!=i&&"close"!=i)for(var o=1;oe.length?Le:(e=e.substr(s,n),t.C=s+n,e))}function Ue(t){t.Y=Date.now()+t.P,qe(t,t.P)}function qe(t,e){if(null!=t.B)throw Error("WatchDog timer not null");t.B=we(L(t.eb,t),e)}function Be(t){t.B&&(_.clearTimeout(t.B),t.B=null)}function je(t){0==t.l.G||t.I||ds(t.l,t)}function Ke(t){Be(t);var e=t.L;e&&"function"==typeof e.na&&e.na(),t.L=null,te(t.W),ae(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function $e(t,e){try{var n=t.l;if(0!=n.G&&(n.g==t||In(n.i,t)))if(n.I=t.N,!t.J&&In(n.i,t)&&3==n.G){try{var s=n.Ca.g.parse(e)}catch(t){s=null}if(Array.isArray(s)&&3==s.length){var r=s;if(0==r[0]){t:if(!n.u){if(n.g){if(!(n.g.F+3e3r[2]&&n.N&&0==n.A&&!n.v&&(n.v=we(L(n.ab,n),6e3));if(1>=En(n.i)&&n.ka){try{n.ka()}catch(t){}n.ka=void 0}}else gs(n,11)}else if((t.J||n.g==t)&&ls(n),!j(e))for(r=n.Ca.g.parse(e),e=0;eh)&&(3!=h||it||this.g&&(this.h.h||this.g.ga()||Wn(this.g)))){this.I||4!=h||7==e||ge(8==e||0>=l?3:2),Be(this);var n=this.g.ba();this.N=n;e:if(Fe(this)){var s=Wn(this.g);t="";var r=s.length,i=4==Qn(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){Ke(this),je(this);var o="";break e}this.h.i=new _.TextDecoder}for(e=0;ee)throw Error("Bad port number "+e);t.m=e}else t.m=null}function en(t,e,n){e instanceof fn?(t.h=e,function(t,e){e&&!t.j&&(gn(t),t.i=null,t.g.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(mn(this,e),yn(this,n,t))}),t)),t.j=e}(t.h,t.g)):(n||(e=on(e,ln)),t.h=new fn(e,t.g))}function nn(t,e,n){t.h.set(e,n)}function sn(t){return nn(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function rn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function on(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,an),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function an(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Ye.prototype.toString=function(){var t=[],e=this.j;e&&t.push(on(e,cn,!0),":");var n=this.i;return(n||"file"==e)&&(t.push("//"),(e=this.s)&&t.push(on(e,cn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&t.push("/"),t.push(on(n,"/"==n.charAt(0)?hn:un,!0))),(n=this.h.toString())&&t.push("?",n),(n=this.o)&&t.push("#",on(n,dn)),t.join("")};var cn=/[#\/\?@]/g,un=/[#\?:]/g,hn=/[#\?]/g,ln=/[#\?@]/g,dn=/#/g;function fn(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function gn(t){t.g||(t.g=new He,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n2*t.i&&ze(t)))}function pn(t,e){return gn(t),e=wn(t,e),Qe(t.g.h,e)}function yn(t,e,n){mn(t,e),0=t.j}function En(t){return t.h?1:t.g?t.g.size:0}function In(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function Sn(t,e){t.g?t.g.add(e):t.h=e}function _n(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Nn(t){if(null!=t.h)return t.i.concat(t.h.D);if(null!=t.g&&0!==t.g.size){let e=t.i;for(const n of t.g.values())e=e.concat(n.D);return e}return B(t.i)}function An(){}function Dn(){this.g=new An}function xn(t,e,n){const s=n||"";try{Ge(t,(function(t,n){let r=t;D(t)&&(r=Kt(t)),e.push(s+n+"="+encodeURIComponent(r))}))}catch(t){throw e.push(s+"type="+encodeURIComponent("_badmap")),t}}function Cn(t,e,n,s,r){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,r(s)}catch(t){}}function kn(t){this.l=t.$b||null,this.j=t.ib||!1}function Rn(t,e){qt.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=Ln,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}vn.prototype.cancel=function(){if(this.i=Nn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const t of this.g.values())t.cancel();this.g.clear()}},An.prototype.stringify=function(t){return _.JSON.stringify(t,void 0)},An.prototype.parse=function(t){return _.JSON.parse(t,void 0)},M(kn,Te),kn.prototype.g=function(){return new Rn(this.l,this.j)},kn.prototype.i=function(t){return function(){return t}}({}),M(Rn,qt);var Ln=0;function On(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function Mn(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Fn(t)}function Fn(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(E=Rn.prototype).open=function(t,e){if(this.readyState!=Ln)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,Fn(this)},E.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||_).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))},E.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Mn(this)),this.readyState=Ln},E.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Fn(this)),this.g&&(this.readyState=3,Fn(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==_.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;On(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},E.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?Mn(this):Fn(this),3==this.readyState&&On(this)}},E.Ua=function(t){this.g&&(this.response=this.responseText=t,Mn(this))},E.Ta=function(t){this.g&&(this.response=t,Mn(this))},E.ha=function(){this.g&&Mn(this)},E.setRequestHeader=function(t,e){this.v.append(t,e)},E.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},E.getAllResponseHeaders=function(){if(!this.h)return"";const t=[],e=this.h.entries();for(var n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(Rn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Pn=_.JSON.parse;function Vn(t){qt.call(this),this.headers=new He,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=Un,this.K=this.L=!1}M(Vn,qt);var Un="",qn=/^https?$/i,Bn=["POST","PUT"];function jn(t){return"content-type"==t.toLowerCase()}function Kn(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,$n(t),Hn(t)}function $n(t){t.D||(t.D=!0,Bt(t,"complete"),Bt(t,"error"))}function Gn(t){if(t.h&&void 0!==S&&(!t.C[1]||4!=Qn(t)||2!=t.ba()))if(t.v&&4==Qn(t))ee(t.Fa,0,t);else if(Bt(t,"readystatechange"),4==Qn(t)){t.h=!1;try{const a=t.ba();t:switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1}var n;if(!(n=e)){var s;if(s=0===a){var r=String(t.H).match(We)[1]||null;if(!r&&_.self&&_.self.location){var i=_.self.location.protocol;r=i.substr(0,i.length-1)}s=!qn.test(r?r.toLowerCase():"")}n=s}if(n)Bt(t,"complete"),Bt(t,"success");else{t.m=6;try{var o=2n)e=Math.max(0,r[o].h-100),i=!1;else try{xn(a,t,"req"+n+"_")}catch(t){s&&s(a)}}if(i){s=t.join("&");break t}}}return t=t.l.splice(0,n),e.D=t,s}function as(t){t.g||t.u||(t.Y=1,Wt(t.Ga,t),t.A=0)}function cs(t){return!(t.g||t.u||3<=t.A)&&(t.Y++,t.u=we(L(t.Ga,t),fs(t,t.A)),t.A++,!0)}function us(t){null!=t.B&&(_.clearTimeout(t.B),t.B=null)}function hs(t){t.g=new xe(t,t.h,"rpc",t.Y),null===t.o&&(t.g.H=t.s),t.g.O=0;var e=Xe(t.oa);nn(e,"RID","rpc"),nn(e,"SID",t.J),nn(e,"CI",t.N?"0":"1"),nn(e,"AID",t.U),is(t,e),nn(e,"TYPE","xmlhttp"),t.o&&t.s&&Yn(e,t.o,t.s),t.K&&t.g.setTimeout(t.K);var n=t.g;t=t.la,n.K=1,n.v=sn(Xe(e)),n.s=null,n.U=!0,Me(n,t)}function ls(t){null!=t.v&&(_.clearTimeout(t.v),t.v=null)}function ds(t,e){var n=null;if(t.g==e){ls(t),us(t),t.g=null;var s=2}else{if(!In(t.i,e))return;n=e.D,_n(t.i,e),s=1}if(t.I=e.N,0!=t.G)if(e.i)if(1==s){n=e.s?e.s.length:0,e=Date.now()-e.F;var r=t.C;Bt(s=de(),new ye(s,n,e,r)),ss(t)}else as(t);else if(3==(r=e.o)||0==r&&0=t.i.j-(t.m?1:0)||(t.m?(t.l=e.D.concat(t.l),0):1==t.G||2==t.G||t.C>=(t.Xa?0:t.Ya)||(t.m=we(L(t.Ha,t,e),fs(t,t.C)),t.C++,0)))}(t,e)||2==s&&cs(t)))switch(n&&0e?null:"string"==typeof t?t.charAt(e):t[e]}(r.T()),n=_.FormData&&t instanceof _.FormData,!(0<=V(Bn,e))||s||n||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach((function(t,e){this.g.setRequestHeader(e,t)}),this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{zn(this),0=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=we(L(this.bb,this),t)}},E.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,pe(10),ts(this),hs(this))},E.ab=function(){null!=this.v&&(this.v=null,ts(this),cs(this),pe(19))},E.jb=function(t){t?(this.h.info("Successfully pinged google.com"),pe(2)):(this.h.info("Failed to ping google.com"),pe(1))},(E=ws.prototype).xa=function(){},E.wa=function(){},E.va=function(){},E.ua=function(){},E.Oa=function(){},vs.prototype.g=function(t,e){return new bs(t,e)},M(bs,qt),bs.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var t=this.g,e=this.l,n=this.h||void 0;t.Wa&&(t.h.info("Origin Trials enabled."),Wt(L(t.hb,t,e))),pe(0),t.W=e,t.aa=n||{},t.N=t.X,t.F=ps(t,null,t.W),ss(t)},bs.prototype.close=function(){Zn(this.g)},bs.prototype.u=function(t){if("string"==typeof t){var e={};e.__data__=t,ns(this.g,e)}else this.v?((e={}).__data__=Kt(t),ns(this.g,e)):ns(this.g,t)},bs.prototype.M=function(){this.g.j=null,delete this.j,Zn(this.g),delete this.g,bs.Z.M.call(this)},M(Ts,Ne),M(Es,Ae),M(Is,ws),Is.prototype.xa=function(){Bt(this.g,"a")},Is.prototype.wa=function(t){Bt(this.g,new Ts(t))},Is.prototype.va=function(t){Bt(this.g,new Es(t))},Is.prototype.ua=function(){Bt(this.g,"b")},vs.prototype.createWebChannel=vs.prototype.g,bs.prototype.send=bs.prototype.u,bs.prototype.open=bs.prototype.m,bs.prototype.close=bs.prototype.close,ve.NO_ERROR=0,ve.TIMEOUT=8,ve.HTTP_ERROR=6,be.COMPLETE="complete",Ie.EventType=_e,_e.OPEN="a",_e.CLOSE="b",_e.ERROR="c",_e.MESSAGE="d",qt.prototype.listen=qt.prototype.N,Vn.prototype.listenOnce=Vn.prototype.O,Vn.prototype.getLastError=Vn.prototype.La,Vn.prototype.getLastErrorCode=Vn.prototype.Da,Vn.prototype.getStatus=Vn.prototype.ba,Vn.prototype.getResponseJson=Vn.prototype.Qa,Vn.prototype.getResponseText=Vn.prototype.ga,Vn.prototype.send=Vn.prototype.ea;var Ss=ve,_s=be,Ns=he,As=10,Ds=11,xs=kn,Cs=Ie,ks=Vn;const Rs="@firebase/firestore"; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ls{constructor(t){this.uid=t}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}Ls.UNAUTHENTICATED=new Ls(null),Ls.GOOGLE_CREDENTIALS=new Ls("google-credentials-uid"),Ls.FIRST_PARTY=new Ls("first-party-uid"),Ls.MOCK_USER=new Ls("mock-user"); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +let Os="9.3.0"; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Ms=new class{constructor(t){this.name=t,this._logLevel=v,this._logHandler=T,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in p))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?w[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,p.DEBUG,...t),this._logHandler(this,p.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,p.VERBOSE,...t),this._logHandler(this,p.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,p.INFO,...t),this._logHandler(this,p.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,p.WARN,...t),this._logHandler(this,p.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,p.ERROR,...t),this._logHandler(this,p.ERROR,...t)}}("@firebase/firestore");function Fs(){return Ms.logLevel}function Ps(t){Ms.setLogLevel(t)}function Vs(t,...e){if(Ms.logLevel<=p.DEBUG){const n=e.map(Bs);Ms.debug(`Firestore (${Os}): ${t}`,...n)}}function Us(t,...e){if(Ms.logLevel<=p.ERROR){const n=e.map(Bs);Ms.error(`Firestore (${Os}): ${t}`,...n)}}function qs(t,...e){if(Ms.logLevel<=p.WARN){const n=e.map(Bs);Ms.warn(`Firestore (${Os}): ${t}`,...n)}}function Bs(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var e} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function js(t="Unexpected state"){const e=`FIRESTORE (${Os}) INTERNAL ASSERTION FAILED: `+t;throw Us(e),new Error(e)}function Ks(t,e){t||js()}function $s(t,e){t||js()}function Gs(t,e){return t} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Hs={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class zs extends Error{constructor(t,e){super(e),this.code=t,this.message=e,this.name="FirebaseError",this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qs{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ws{constructor(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization=`Bearer ${t}`}}class Ys{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,e){t.enqueueRetryable((()=>e(Ls.UNAUTHENTICATED)))}shutdown(){}}class Xs{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,e){this.changeListener=e,t.enqueueRetryable((()=>e(this.token.user)))}shutdown(){this.changeListener=null}}class Js{constructor(t){this.t=t,this.currentUser=Ls.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,e){let n=this.i;const s=t=>this.i!==n?(n=this.i,e(t)):Promise.resolve();let r=new Qs;this.o=()=>{this.i++,this.currentUser=this.u(),r.resolve(),r=new Qs,t.enqueueRetryable((()=>s(this.currentUser)))};const i=()=>{const e=r;t.enqueueRetryable((async()=>{await e.promise,await s(this.currentUser)}))},o=t=>{Vs("FirebaseCredentialsProvider","Auth detected"),this.auth=t,this.auth.addAuthTokenListener(this.o),i()};this.t.onInit((t=>o(t))),setTimeout((()=>{if(!this.auth){const t=this.t.getImmediate({optional:!0});t?o(t):(Vs("FirebaseCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Qs)}}),0),i()}getToken(){const t=this.i,e=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(e).then((e=>this.i!==t?(Vs("FirebaseCredentialsProvider","getToken aborted due to token change."),this.getToken()):e?(Ks("string"==typeof e.accessToken),new Ws(e.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return Ks(null===t||"string"==typeof t),new Ls(t)}}class Zs{constructor(t,e,n){this.h=t,this.l=e,this.m=n,this.type="FirstParty",this.user=Ls.FIRST_PARTY}get authHeaders(){const t={"X-Goog-AuthUser":this.l},e=this.h.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),this.m&&(t["X-Goog-Iam-Authorization-Token"]=this.m),t}}class tr{constructor(t,e,n){this.h=t,this.l=e,this.m=n}getToken(){return Promise.resolve(new Zs(this.h,this.l,this.m))}start(t,e){t.enqueueRetryable((()=>e(Ls.FIRST_PARTY)))}shutdown(){}invalidateToken(){}} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class er{constructor(t,e){this.previousValue=t,e&&(e.sequenceNumberHandler=t=>this.g(t),this.p=t=>e.writeSequenceNumber(t))}g(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.p&&this.p(t),t}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function nr(t){const e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(let e=0;ee?1:0}function ir(t,e,n){return t.length===e.length&&t.every(((t,s)=>n(t,e[s])))}function or(t){return t+"\0"} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ar{constructor(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}static now(){return ar.fromMillis(Date.now())}static fromDate(t){return ar.fromMillis(t.getTime())}static fromMillis(t){const e=Math.floor(t/1e3),n=Math.floor(1e6*(t-1e3*e));return new ar(e,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(t){return this.seconds===t.seconds?rr(this.nanoseconds,t.nanoseconds):rr(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cr{constructor(t){this.timestamp=t}static fromTimestamp(t){return new cr(t)}static min(){return new cr(new ar(0,0))}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ur(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function hr(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function lr(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dr{constructor(t,e,n){void 0===e?e=0:e>t.length&&js(),void 0===n?n=t.length-e:n>t.length-e&&js(),this.segments=t,this.offset=e,this.len=n}get length(){return this.len}isEqual(t){return 0===dr.comparator(this,t)}child(t){const e=this.segments.slice(this.offset,this.limit());return t instanceof dr?t.forEach((t=>{e.push(t)})):e.push(t),this.construct(e)}limit(){return this.offset+this.length}popFirst(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return 0===this.length}isPrefixOf(t){if(t.lengthr)return 1}return t.lengthe.length?1:0}}class fr extends dr{construct(t,e,n){return new fr(t,e,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...t){const e=[];for(const n of t){if(n.indexOf("//")>=0)throw new zs(Hs.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);e.push(...n.split("/").filter((t=>t.length>0)))}return new fr(e)}static emptyPath(){return new fr([])}}const gr=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class mr extends dr{construct(t,e,n){return new mr(t,e,n)}static isValidIdentifier(t){return gr.test(t)}canonicalString(){return this.toArray().map((t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),mr.isValidIdentifier(t)||(t="`"+t+"`"),t))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new mr(["__name__"])}static fromServerFormat(t){const e=[];let n="",s=0;const r=()=>{if(0===n.length)throw new zs(Hs.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);e.push(n),n=""};let i=!1;for(;st.isEqual(e)))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function yr(){return"undefined"!=typeof atob} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class wr{constructor(t){this.binaryString=t}static fromBase64String(t){const e=atob(t);return new wr(e)}static fromUint8Array(t){const e=function(t){let e="";for(let n=0;n=Number.MIN_SAFE_INTEGER} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xr{constructor(t){this.path=t}static fromPath(t){return new xr(fr.fromString(t))}static fromName(t){return new xr(fr.fromString(t).popFirst(5))}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}isEqual(t){return null!==t&&0===fr.comparator(this.path,t.path)}toString(){return this.path.toString()}static comparator(t,e){return fr.comparator(t.path,e.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new xr(new fr(t.slice()))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Cr(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Ir(t)?4:10:js()}function kr(t,e){const n=Cr(t);if(n!==Cr(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return _r(t).isEqual(_r(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;const n=br(t.timestampValue),s=br(e.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return Er(t.bytesValue).isEqual(Er(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Tr(t.geoPointValue.latitude)===Tr(e.geoPointValue.latitude)&&Tr(t.geoPointValue.longitude)===Tr(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return Tr(t.integerValue)===Tr(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){const n=Tr(t.doubleValue),s=Tr(e.doubleValue);return n===s?Ar(n)===Ar(s):isNaN(n)&&isNaN(s)}return!1}(t,e);case 9:return ir(t.arrayValue.values||[],e.arrayValue.values||[],kr);case 10:return function(t,e){const n=t.mapValue.fields||{},s=e.mapValue.fields||{};if(ur(n)!==ur(s))return!1;for(const t in n)if(n.hasOwnProperty(t)&&(void 0===s[t]||!kr(n[t],s[t])))return!1;return!0}(t,e);default:return js()}}function Rr(t,e){return void 0!==(t.values||[]).find((t=>kr(t,e)))}function Lr(t,e){const n=Cr(t),s=Cr(e);if(n!==s)return rr(n,s);switch(n){case 0:return 0;case 1:return rr(t.booleanValue,e.booleanValue);case 2:return function(t,e){const n=Tr(t.integerValue||t.doubleValue),s=Tr(e.integerValue||e.doubleValue);return ns?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(t,e);case 3:return Or(t.timestampValue,e.timestampValue);case 4:return Or(_r(t),_r(e));case 5:return rr(t.stringValue,e.stringValue);case 6:return function(t,e){const n=Er(t),s=Er(e);return n.compareTo(s)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){const n=t.split("/"),s=e.split("/");for(let t=0;te.mapValue.fields[t]=Kr(n))),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Kr(t.arrayValue.values[n]);return e}return Object.assign({},t)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class $r{constructor(t){this.value=t}static empty(){return new $r({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let e=this.value;for(let n=0;n{if(!e.isImmediateParentOf(r)){const t=this.getFieldsMap(e);this.applyChanges(t,n,s),n={},s=[],e=r.popLast()}t?n[r.lastSegment()]=Kr(t):s.push(r.lastSegment())}));const r=this.getFieldsMap(e);this.applyChanges(r,n,s)}delete(t){const e=this.field(t.popLast());jr(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]}isEqual(t){return kr(this.value,t.value)}getFieldsMap(t){let e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(let n=0;nt[e]=n));for(const e of n)delete t[e]}clone(){return new $r(Kr(this.value))}}function Gr(t){const e=[];return hr(t.fields,((t,n)=>{const s=new mr([t]);if(jr(n)){const t=Gr(n.mapValue).fields;if(0===t.length)e.push(s);else for(const n of t)e.push(s.child(n))}else e.push(s)})),new pr(e) +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class Hr{constructor(t,e,n,s,r){this.key=t,this.documentType=e,this.version=n,this.data=s,this.documentState=r}static newInvalidDocument(t){return new Hr(t,0,cr.min(),$r.empty(),0)}static newFoundDocument(t,e,n){return new Hr(t,1,e,n,0)}static newNoDocument(t,e){return new Hr(t,2,e,$r.empty(),0)}static newUnknownDocument(t,e){return new Hr(t,3,e,$r.empty(),2)}convertToFoundDocument(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=$r.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=$r.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(t){return t instanceof Hr&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}clone(){return new Hr(this.key,this.documentType,this.version,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zr{constructor(t,e=null,n=[],s=[],r=null,i=null,o=null){this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=s,this.limit=r,this.startAt=i,this.endAt=o,this.A=null}}function Qr(t,e=null,n=[],s=[],r=null,i=null,o=null){return new zr(t,e,n,s,r,i,o)}function Wr(t){const e=Gs(t);if(null===e.A){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((t=>function(t){return t.field.canonicalString()+t.op.toString()+Mr(t.value)}(t))).join(","),t+="|ob:",t+=e.orderBy.map((t=>function(t){return t.field.canonicalString()+t.dir}(t))).join(","),Nr(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=ci(e.startAt)),e.endAt&&(t+="|ub:",t+=ci(e.endAt)),e.A=t}return e.A}function Yr(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n":return t>0;case">=":return t>=0;default:return js()}}v(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}}class Zr extends Jr{constructor(t,e,n){super(t,e,n),this.key=xr.fromName(n.referenceValue)}matches(t){const e=xr.comparator(t.key,this.key);return this.P(e)}}class ti extends Jr{constructor(t,e){super(t,"in",e),this.keys=ni("in",e)}matches(t){return this.keys.some((e=>e.isEqual(t.key)))}}class ei extends Jr{constructor(t,e){super(t,"not-in",e),this.keys=ni("not-in",e)}matches(t){return!this.keys.some((e=>e.isEqual(t.key)))}}function ni(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((t=>xr.fromName(t.referenceValue)))}class si extends Jr{constructor(t,e){super(t,"array-contains",e)}matches(t){const e=t.data.field(this.field);return Ur(e)&&Rr(e.arrayValue,this.value)}}class ri extends Jr{constructor(t,e){super(t,"in",e)}matches(t){const e=t.data.field(this.field);return null!==e&&Rr(this.value.arrayValue,e)}}class ii extends Jr{constructor(t,e){super(t,"not-in",e)}matches(t){if(Rr(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const e=t.data.field(this.field);return null!==e&&!Rr(this.value.arrayValue,e)}}class oi extends Jr{constructor(t,e){super(t,"array-contains-any",e)}matches(t){const e=t.data.field(this.field);return!(!Ur(e)||!e.arrayValue.values)&&e.arrayValue.values.some((t=>Rr(this.value.arrayValue,t)))}}class ai{constructor(t,e){this.position=t,this.before=e}}function ci(t){return`${t.before?"b":"a"}:${t.position.map((t=>Mr(t))).join(",")}`}class ui{constructor(t,e="asc"){this.field=t,this.dir=e}}function hi(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function li(t,e,n){let s=0;for(let r=0;r0?t.explicitOrderBy[0].field:null}function vi(t){for(const e of t.filters)if(e.v())return e.field;return null}function bi(t){return null!==t.collectionGroup}function Ti(t){const e=Gs(t);if(null===e.V){e.V=[];const t=vi(e),n=wi(e);if(null!==t&&null===n)t.isKeyField()||e.V.push(new ui(t)),e.V.push(new ui(mr.keyField(),"asc"));else{let t=!1;for(const n of e.explicitOrderBy)e.V.push(n),n.field.isKeyField()&&(t=!0);if(!t){const t=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.V.push(new ui(mr.keyField(),t))}}}return e.V}function Ei(t){const e=Gs(t);if(!e.S)if("F"===e.limitType)e.S=Qr(e.path,e.collectionGroup,Ti(e),e.filters,e.limit,e.startAt,e.endAt);else{const t=[];for(const n of Ti(e)){const e="desc"===n.dir?"asc":"desc";t.push(new ui(n.field,e))}const n=e.endAt?new ai(e.endAt.position,!e.endAt.before):null,s=e.startAt?new ai(e.startAt.position,!e.startAt.before):null;e.S=Qr(e.path,e.collectionGroup,t,e.filters,e.limit,n,s)}return e.S}function Ii(t,e,n){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Si(t,e){return Yr(Ei(t),Ei(e))&&t.limitType===e.limitType}function _i(t){return`${Wr(Ei(t))}|lt:${t.limitType}`}function Ni(t){return`Query(target=${function(t){let e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map((t=>{var e;return`${(e=t).field.canonicalString()} ${e.op} ${Mr(e.value)}`})).join(", ")}]`),Nr(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map((t=>function(t){return`${t.field.canonicalString()} (${t.dir})`}(t))).join(", ")}]`),t.startAt&&(e+=", startAt: "+ci(t.startAt)),t.endAt&&(e+=", endAt: "+ci(t.endAt)),`Target(${e})`}(Ei(t))}; limitType=${t.limitType})`}function Ai(t,e){return e.isFoundDocument()&&function(t,e){const n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):xr.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(const n of t.explicitOrderBy)if(!n.field.isKeyField()&&null===e.data.field(n.field))return!1;return!0}(t,e)&&function(t,e){for(const n of t.filters)if(!n.matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!li(t.startAt,Ti(t),e))&&(!t.endAt||!li(t.endAt,Ti(t),e))}(t,e)}function Di(t){return(e,n)=>{let s=!1;for(const r of Ti(t)){const t=xi(r,e,n);if(0!==t)return t;s=s||r.field.isKeyField()}return 0}}function xi(t,e,n){const s=t.field.isKeyField()?xr.comparator(e.key,n.key):function(t,e,n){const s=e.data.field(t),r=n.data.field(t);return null!==s&&null!==r?Lr(s,r):js()}(t.field,e,n);switch(t.dir){case"asc":return s;case"desc":return-1*s;default:return js()}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ci(t,e){if(t.D){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ar(e)?"-0":e}}function ki(t){return{integerValue:""+t}}function Ri(t,e){return Dr(e)?ki(e):Ci(t,e)} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Li{constructor(){this._=void 0}}function Oi(t,e,n){return t instanceof Pi?function(t,e){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof Vi?Ui(t,e):t instanceof qi?Bi(t,e):function(t,e){const n=Fi(t,e),s=Ki(n)+Ki(t.C);return Vr(n)&&Vr(t.C)?ki(s):Ci(t.N,s)}(t,e)}function Mi(t,e,n){return t instanceof Vi?Ui(t,e):t instanceof qi?Bi(t,e):n}function Fi(t,e){var n;return t instanceof ji?Vr(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null}class Pi extends Li{}class Vi extends Li{constructor(t){super(),this.elements=t}}function Ui(t,e){const n=$i(e);for(const e of t.elements)n.some((t=>kr(t,e)))||n.push(e);return{arrayValue:{values:n}}}class qi extends Li{constructor(t){super(),this.elements=t}}function Bi(t,e){let n=$i(e);for(const e of t.elements)n=n.filter((t=>!kr(t,e)));return{arrayValue:{values:n}}}class ji extends Li{constructor(t,e){super(),this.N=t,this.C=e}}function Ki(t){return Tr(t.integerValue||t.doubleValue)}function $i(t){return Ur(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gi{constructor(t,e){this.field=t,this.transform=e}}class Hi{constructor(t,e){this.version=t,this.transformResults=e}}class zi{constructor(t,e){this.updateTime=t,this.exists=e}static none(){return new zi}static exists(t){return new zi(void 0,t)}static updateTime(t){return new zi(t)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Qi(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}class Wi{}function Yi(t,e,n){t instanceof eo?function(t,e,n){const s=t.value.clone(),r=ro(t.fieldTransforms,e,n.transformResults);s.setAll(r),e.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(t,e,n):t instanceof no?function(t,e,n){if(!Qi(t.precondition,e))return void e.convertToUnknownDocument(n.version);const s=ro(t.fieldTransforms,e,n.transformResults),r=e.data;r.setAll(so(t)),r.setAll(s),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function Xi(t,e,n){t instanceof eo?function(t,e,n){if(!Qi(t.precondition,e))return;const s=t.value.clone(),r=io(t.fieldTransforms,n,e);s.setAll(r),e.convertToFoundDocument(to(e),s).setHasLocalMutations()}(t,e,n):t instanceof no?function(t,e,n){if(!Qi(t.precondition,e))return;const s=io(t.fieldTransforms,n,e),r=e.data;r.setAll(so(t)),r.setAll(s),e.convertToFoundDocument(to(e),r).setHasLocalMutations()}(t,e,n):function(t,e){Qi(t.precondition,e)&&e.convertToNoDocument(cr.min())}(t,e)}function Ji(t,e){let n=null;for(const s of t.fieldTransforms){const t=e.data.field(s.field),r=Fi(s.transform,t||null);null!=r&&(null==n&&(n=$r.empty()),n.set(s.field,r))}return n||null}function Zi(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&ir(t,e,((t,e)=>function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Vi&&e instanceof Vi||t instanceof qi&&e instanceof qi?ir(t.elements,e.elements,kr):t instanceof ji&&e instanceof ji?kr(t.C,e.C):t instanceof Pi&&e instanceof Pi}(t.transform,e.transform)}(t,e)))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}function to(t){return t.isFoundDocument()?t.version:cr.min()}class eo extends Wi{constructor(t,e,n,s=[]){super(),this.key=t,this.value=e,this.precondition=n,this.fieldTransforms=s,this.type=0}}class no extends Wi{constructor(t,e,n,s,r=[]){super(),this.key=t,this.data=e,this.fieldMask=n,this.precondition=s,this.fieldTransforms=r,this.type=1}}function so(t){const e=new Map;return t.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const s=t.data.field(n);e.set(n,s)}})),e}function ro(t,e,n){const s=new Map;Ks(t.length===n.length);for(let r=0;r0&&(e=e.right)}return null}indexOf(t){let e=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(t,n.key);if(0===s)return e+n.left.size;s<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal(((e,n)=>(t(e,n),!1)))}toString(){const t=[];return this.inorderTraversal(((e,n)=>(t.push(`${e}:${n}`),!1))),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new mo(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new mo(this.root,t,this.comparator,!1)}getReverseIterator(){return new mo(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new mo(this.root,t,this.comparator,!0)}}class mo{constructor(t,e,n,s){this.isReverse=s,this.nodeStack=[];let r=1;for(;!t.isEmpty();)if(r=e?n(t.key,e):1,s&&(r*=-1),r<0)t=this.isReverse?t.left:t.right;else{if(0===r){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class po{constructor(t,e,n,s,r){this.key=t,this.value=e,this.color=null!=n?n:po.RED,this.left=null!=s?s:po.EMPTY,this.right=null!=r?r:po.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,e,n,s,r){return new po(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,e,n){let s=this;const r=n(t,s.key);return s=r<0?s.copy(null,null,null,s.left.insert(t,e,n),null):0===r?s.copy(null,e,null,null,null):s.copy(null,null,null,null,s.right.insert(t,e,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return po.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,e){let n,s=this;if(e(t,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(t,e),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===e(t,s.key)){if(s.right.isEmpty())return po.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(t,e))}return s.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,po.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,po.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw js();if(this.right.isRed())throw js();const t=this.left.check();if(t!==this.right.check())throw js();return t+(this.isRed()?0:1)}}po.EMPTY=null,po.RED=!0,po.BLACK=!1,po.EMPTY=new class{constructor(){this.size=0}get key(){throw js()}get value(){throw js()}get color(){throw js()}get left(){throw js()}get right(){throw js()}copy(t,e,n,s,r){return this}insert(t,e,n){return new po(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class yo{constructor(t){this.comparator=t,this.data=new go(this.comparator)}has(t){return null!==this.data.get(t)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal(((e,n)=>(t(e),!1)))}forEachInRange(t,e){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,t[1])>=0)return;e(s.key)}}forEachWhile(t,e){let n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null}getIterator(){return new wo(this.data.getIterator())}getIteratorFrom(t){return new wo(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let e=this;return e.size{e=e.add(t)})),e}isEqual(t){if(!(t instanceof yo))return!1;if(this.size!==t.size)return!1;const e=this.data.getIterator(),n=t.data.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(0!==this.comparator(t,s))return!1}return!0}toArray(){const t=[];return this.forEach((e=>{t.push(e)})),t}toString(){const t=[];return this.forEach((e=>t.push(e))),"SortedSet("+t.toString()+")"}copy(t){const e=new yo(this.comparator);return e.data=t,e}}class wo{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vo=new go(xr.comparator);function bo(){return vo}const To=new go(xr.comparator);function Eo(){return To}const Io=new go(xr.comparator);function So(){return Io}const _o=new yo(xr.comparator);function No(...t){let e=_o;for(const n of t)e=e.add(n);return e}const Ao=new yo(rr);function Do(){return Ao} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xo{constructor(t,e,n,s,r){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=s,this.resolvedLimboDocuments=r}static createSynthesizedRemoteEventForCurrentChange(t,e){const n=new Map;return n.set(t,Co.createSynthesizedTargetChangeForCurrentChange(t,e)),new xo(cr.min(),n,Do(),bo(),No())}}class Co{constructor(t,e,n,s,r){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=s,this.removedDocuments=r}static createSynthesizedTargetChangeForCurrentChange(t,e){return new Co(wr.EMPTY_BYTE_STRING,e,No(),No(),No())}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ko{constructor(t,e,n,s){this.k=t,this.removedTargetIds=e,this.key=n,this.$=s}}class Ro{constructor(t,e){this.targetId=t,this.O=e}}class Lo{constructor(t,e,n=wr.EMPTY_BYTE_STRING,s=null){this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=s}}class Oo{constructor(){this.F=0,this.M=Po(),this.L=wr.EMPTY_BYTE_STRING,this.B=!1,this.U=!0}get current(){return this.B}get resumeToken(){return this.L}get q(){return 0!==this.F}get K(){return this.U}j(t){t.approximateByteSize()>0&&(this.U=!0,this.L=t)}W(){let t=No(),e=No(),n=No();return this.M.forEach(((s,r)=>{switch(r){case 0:t=t.add(s);break;case 2:e=e.add(s);break;case 1:n=n.add(s);break;default:js()}})),new Co(this.L,this.B,t,e,n)}G(){this.U=!1,this.M=Po()}H(t,e){this.U=!0,this.M=this.M.insert(t,e)}J(t){this.U=!0,this.M=this.M.remove(t)}Y(){this.F+=1}X(){this.F-=1}Z(){this.U=!0,this.B=!0}}class Mo{constructor(t){this.tt=t,this.et=new Map,this.nt=bo(),this.st=Fo(),this.it=new yo(rr)}rt(t){for(const e of t.k)t.$&&t.$.isFoundDocument()?this.ot(e,t.$):this.ct(e,t.key,t.$);for(const e of t.removedTargetIds)this.ct(e,t.key,t.$)}at(t){this.forEachTarget(t,(e=>{const n=this.ut(e);switch(t.state){case 0:this.ht(e)&&n.j(t.resumeToken);break;case 1:n.X(),n.q||n.G(),n.j(t.resumeToken);break;case 2:n.X(),n.q||this.removeTarget(e);break;case 3:this.ht(e)&&(n.Z(),n.j(t.resumeToken));break;case 4:this.ht(e)&&(this.lt(e),n.j(t.resumeToken));break;default:js()}}))}forEachTarget(t,e){t.targetIds.length>0?t.targetIds.forEach(e):this.et.forEach(((t,n)=>{this.ht(n)&&e(n)}))}ft(t){const e=t.targetId,n=t.O.count,s=this.dt(e);if(s){const t=s.target;if(Xr(t))if(0===n){const n=new xr(t.path);this.ct(e,n,Hr.newNoDocument(n,cr.min()))}else Ks(1===n);else this.wt(e)!==n&&(this.lt(e),this.it=this.it.add(e))}}_t(t){const e=new Map;this.et.forEach(((n,s)=>{const r=this.dt(s);if(r){if(n.current&&Xr(r.target)){const e=new xr(r.target.path);null!==this.nt.get(e)||this.gt(s,e)||this.ct(s,e,Hr.newNoDocument(e,t))}n.K&&(e.set(s,n.W()),n.G())}}));let n=No();this.st.forEach(((t,e)=>{let s=!0;e.forEachWhile((t=>{const e=this.dt(t);return!e||2===e.purpose||(s=!1,!1)})),s&&(n=n.add(t))}));const s=new xo(t,e,this.it,this.nt,n);return this.nt=bo(),this.st=Fo(),this.it=new yo(rr),s}ot(t,e){if(!this.ht(t))return;const n=this.gt(t,e.key)?2:0;this.ut(t).H(e.key,n),this.nt=this.nt.insert(e.key,e),this.st=this.st.insert(e.key,this.yt(e.key).add(t))}ct(t,e,n){if(!this.ht(t))return;const s=this.ut(t);this.gt(t,e)?s.H(e,1):s.J(e),this.st=this.st.insert(e,this.yt(e).delete(t)),n&&(this.nt=this.nt.insert(e,n))}removeTarget(t){this.et.delete(t)}wt(t){const e=this.ut(t).W();return this.tt.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size}Y(t){this.ut(t).Y()}ut(t){let e=this.et.get(t);return e||(e=new Oo,this.et.set(t,e)),e}yt(t){let e=this.st.get(t);return e||(e=new yo(rr),this.st=this.st.insert(t,e)),e}ht(t){const e=null!==this.dt(t);return e||Vs("WatchChangeAggregator","Detected inactive target",t),e}dt(t){const e=this.et.get(t);return e&&e.q?null:this.tt.Tt(t)}lt(t){this.et.set(t,new Oo),this.tt.getRemoteKeysForTarget(t).forEach((e=>{this.ct(t,e,null)}))}gt(t,e){return this.tt.getRemoteKeysForTarget(t).has(e)}}function Fo(){return new go(xr.comparator)}function Po(){return new go(xr.comparator)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vo={asc:"ASCENDING",desc:"DESCENDING"},Uo={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"};class qo{constructor(t,e){this.databaseId=t,this.D=e}}function Bo(t,e){return t.D?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function jo(t,e){return t.D?e.toBase64():e.toUint8Array()}function Ko(t,e){return Bo(t,e.toTimestamp())}function $o(t){return Ks(!!t),cr.fromTimestamp(function(t){const e=br(t);return new ar(e.seconds,e.nanos)}(t))}function Go(t,e){return function(t){return new fr(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function Ho(t){const e=fr.fromString(t);return Ks(pa(e)),e}function zo(t,e){return Go(t.databaseId,e.path)}function Qo(t,e){const n=Ho(e);if(n.get(1)!==t.databaseId.projectId)throw new zs(Hs.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new zs(Hs.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new xr(Jo(n))}function Wo(t,e){return Go(t.databaseId,e)}function Yo(t){const e=Ho(t);return 4===e.length?fr.emptyPath():Jo(e)}function Xo(t){return new fr(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Jo(t){return Ks(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function Zo(t,e,n){return{name:zo(t,e),fields:n.value.mapValue.fields}}function ta(t,e,n){const s=Qo(t,e.name),r=$o(e.updateTime),i=new $r({mapValue:{fields:e.fields}}),o=Hr.newFoundDocument(s,r,i);return n&&o.setHasCommittedMutations(),n?o.setHasCommittedMutations():o}function ea(t,e){let n;if(e instanceof eo)n={update:Zo(t,e.key,e.value)};else if(e instanceof oo)n={delete:zo(t,e.key)};else if(e instanceof no)n={update:Zo(t,e.key,e.data),updateMask:ma(e.fieldMask)};else{if(!(e instanceof ao))return js();n={verify:zo(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((t=>function(t,e){const n=e.transform;if(n instanceof Pi)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Vi)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof qi)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof ji)return{fieldPath:e.field.canonicalString(),increment:n.C};throw js()}(0,t)))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Ko(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:js()}(t,e.precondition)),n}function na(t,e){const n=e.currentDocument?function(t){return void 0!==t.updateTime?zi.updateTime($o(t.updateTime)):void 0!==t.exists?zi.exists(t.exists):zi.none()}(e.currentDocument):zi.none(),s=e.updateTransforms?e.updateTransforms.map((e=>function(t,e){let n=null;if("setToServerValue"in e)Ks("REQUEST_TIME"===e.setToServerValue),n=new Pi;else if("appendMissingElements"in e){const t=e.appendMissingElements.values||[];n=new Vi(t)}else if("removeAllFromArray"in e){const t=e.removeAllFromArray.values||[];n=new qi(t)}else"increment"in e?n=new ji(t,e.increment):js();const s=mr.fromServerFormat(e.fieldPath);return new Gi(s,n)}(t,e))):[];if(e.update){e.update.name;const r=Qo(t,e.update.name),i=new $r({mapValue:{fields:e.update.fields}});if(e.updateMask){const t=function(t){const e=t.fieldPaths||[];return new pr(e.map((t=>mr.fromServerFormat(t))))}(e.updateMask);return new no(r,i,t,n,s)}return new eo(r,i,n,s)}if(e.delete){const s=Qo(t,e.delete);return new oo(s,n)}if(e.verify){const s=Qo(t,e.verify);return new ao(s,n)}return js()}function sa(t,e){return{documents:[Wo(t,e.path)]}}function ra(t,e){const n={structuredQuery:{}},s=e.path;null!==e.collectionGroup?(n.parent=Wo(t,s),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Wo(t,s.popLast()),n.structuredQuery.from=[{collectionId:s.lastSegment()}]);const r=function(t){if(0===t.length)return;const e=t.map((t=>function(t){if("=="===t.op){if(Br(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NAN"}};if(qr(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(Br(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NOT_NAN"}};if(qr(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:la(t.field),op:ha(t.op),value:t.value}}}(t)));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}(e.filters);r&&(n.structuredQuery.where=r);const i=function(t){if(0!==t.length)return t.map((t=>function(t){return{field:la(t.field),direction:ua(t.dir)}}(t)))}(e.orderBy);i&&(n.structuredQuery.orderBy=i);const o=function(t,e){return t.D||Nr(e)?e:{value:e}}(t,e.limit);return null!==o&&(n.structuredQuery.limit=o),e.startAt&&(n.structuredQuery.startAt=aa(e.startAt)),e.endAt&&(n.structuredQuery.endAt=aa(e.endAt)),n}function ia(t){let e=Yo(t.parent);const n=t.structuredQuery,s=n.from?n.from.length:0;let r=null;if(s>0){Ks(1===s);const t=n.from[0];t.allDescendants?r=t.collectionId:e=e.child(t.collectionId)}let i=[];n.where&&(i=oa(n.where));let o=[];n.orderBy&&(o=n.orderBy.map((t=>function(t){return new ui(da(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t))));let a=null;n.limit&&(a=function(t){let e;return e="object"==typeof t?t.value:t,Nr(e)?null:e}(n.limit));let c=null;n.startAt&&(c=ca(n.startAt));let u=null;return n.endAt&&(u=ca(n.endAt)),gi(e,r,o,i,a,"F",c,u)}function oa(t){return t?void 0!==t.unaryFilter?[ga(t)]:void 0!==t.fieldFilter?[fa(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((t=>oa(t))).reduce(((t,e)=>t.concat(e))):js():[]}function aa(t){return{before:t.before,values:t.position}}function ca(t){const e=!!t.before,n=t.values||[];return new ai(n,e)}function ua(t){return Vo[t]}function ha(t){return Uo[t]}function la(t){return{fieldPath:t.canonicalString()}}function da(t){return mr.fromServerFormat(t.fieldPath)}function fa(t){return Jr.create(da(t.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return js()}}(t.fieldFilter.op),t.fieldFilter.value)}function ga(t){switch(t.unaryFilter.op){case"IS_NAN":const e=da(t.unaryFilter.field);return Jr.create(e,"==",{doubleValue:NaN});case"IS_NULL":const n=da(t.unaryFilter.field);return Jr.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=da(t.unaryFilter.field);return Jr.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=da(t.unaryFilter.field);return Jr.create(r,"!=",{nullValue:"NULL_VALUE"});default:return js()}}function ma(t){const e=[];return t.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function pa(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ya(t){let e="";for(let n=0;n0&&(e=va(e)),e=wa(t.get(n),e);return va(e)}function wa(t,e){let n=e;const s=t.length;for(let e=0;e=2),2===e)return Ks(""===t.charAt(0)&&""===t.charAt(1)),fr.emptyPath();const n=e-2,s=[];let r="";for(let i=0;in)&&js(),t.charAt(e+1)){case"":const n=t.substring(i,e);let o;0===r.length?o=n:(r+=n,o=r,r=""),s.push(o);break;case"":r+=t.substring(i,e),r+="\0";break;case"":r+=t.substring(i,e+1);break;default:js()}i=e+2}return new fr(s)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ta{constructor(t,e){this.seconds=t,this.nanoseconds=e}}class Ea{constructor(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n}}Ea.store="owner",Ea.key="owner";class Ia{constructor(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n}}Ia.store="mutationQueues",Ia.keyPath="userId";class Sa{constructor(t,e,n,s,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=s,this.mutations=r}}Sa.store="mutations",Sa.keyPath="batchId",Sa.userMutationsIndex="userMutationsIndex",Sa.userMutationsKeyPath=["userId","batchId"];class _a{constructor(){}static prefixForUser(t){return[t]}static prefixForPath(t,e){return[t,ya(e)]}static key(t,e,n){return[t,ya(e),n]}}_a.store="documentMutations",_a.PLACEHOLDER=new _a;class Na{constructor(t,e){this.path=t,this.readTime=e}}class Aa{constructor(t,e){this.path=t,this.version=e}}class Da{constructor(t,e,n,s,r,i){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=s,this.readTime=r,this.parentPath=i}}Da.store="remoteDocuments",Da.readTimeIndex="readTimeIndex",Da.readTimeIndexPath="readTime",Da.collectionReadTimeIndex="collectionReadTimeIndex",Da.collectionReadTimeIndexPath=["parentPath","readTime"];class xa{constructor(t){this.byteSize=t}}xa.store="remoteDocumentGlobal",xa.key="remoteDocumentGlobalKey";class Ca{constructor(t,e,n,s,r,i,o){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=s,this.lastListenSequenceNumber=r,this.lastLimboFreeSnapshotVersion=i,this.query=o}}Ca.store="targets",Ca.keyPath="targetId",Ca.queryTargetsIndexName="queryTargetsIndex",Ca.queryTargetsKeyPath=["canonicalId","targetId"];class ka{constructor(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n}}ka.store="targetDocuments",ka.keyPath=["targetId","path"],ka.documentTargetsIndex="documentTargetsIndex",ka.documentTargetsKeyPath=["path","targetId"];class Ra{constructor(t,e,n,s){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=s}}Ra.key="targetGlobalKey",Ra.store="targetGlobal";class La{constructor(t,e){this.collectionId=t,this.parent=e}}La.store="collectionParents",La.keyPath=["collectionId","parent"];class Oa{constructor(t,e,n,s){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=s}}Oa.store="clientMetadata",Oa.keyPath="clientId";class Ma{constructor(t,e,n){this.bundleId=t,this.createTime=e,this.version=n}}Ma.store="bundles",Ma.keyPath="bundleId";class Fa{constructor(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n}}Fa.store="namedQueries",Fa.keyPath="name";const Pa=[Ia.store,Sa.store,_a.store,Da.store,Ca.store,Ea.store,Ra.store,ka.store,Oa.store,xa.store,La.store,Ma.store,Fa.store],Va="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Ua{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((t=>t()))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qa{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(t){return this.next(void 0,t)}next(t,e){return this.callbackAttached&&js(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(e,this.error):this.wrapSuccess(t,this.result):new qa(((n,s)=>{this.nextCallback=e=>{this.wrapSuccess(t,e).next(n,s)},this.catchCallback=t=>{this.wrapFailure(e,t).next(n,s)}}))}toPromise(){return new Promise(((t,e)=>{this.next(t,e)}))}wrapUserFunction(t){try{const e=t();return e instanceof qa?e:qa.resolve(e)}catch(t){return qa.reject(t)}}wrapSuccess(t,e){return t?this.wrapUserFunction((()=>t(e))):qa.resolve(e)}wrapFailure(t,e){return t?this.wrapUserFunction((()=>t(e))):qa.reject(e)}static resolve(t){return new qa(((e,n)=>{e(t)}))}static reject(t){return new qa(((e,n)=>{n(t)}))}static waitFor(t){return new qa(((e,n)=>{let s=0,r=0,i=!1;t.forEach((t=>{++s,t.next((()=>{++r,i&&r===s&&e()}),(t=>n(t)))})),i=!0,r===s&&e()}))}static or(t){let e=qa.resolve(!1);for(const n of t)e=e.next((t=>t?qa.resolve(t):n()));return e}static forEach(t,e){const n=[];return t.forEach(((t,s)=>{n.push(e.call(this,t,s))})),this.waitFor(n)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ba{constructor(t,e){this.action=t,this.transaction=e,this.aborted=!1,this.Et=new Qs,this.transaction.oncomplete=()=>{this.Et.resolve()},this.transaction.onabort=()=>{e.error?this.Et.reject(new $a(t,e.error)):this.Et.resolve()},this.transaction.onerror=e=>{const n=Wa(e.target.error);this.Et.reject(new $a(t,n))}}static open(t,e,n,s){try{return new Ba(e,t.transaction(s,n))}catch(t){throw new $a(e,t)}}get It(){return this.Et.promise}abort(t){t&&this.Et.reject(t),this.aborted||(Vs("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}store(t){const e=this.transaction.objectStore(t);return new Ha(e)}}class ja{constructor(t,e,n){this.name=t,this.version=e,this.At=n,12.2===ja.Rt(h())&&Us("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(t){return Vs("SimpleDb","Removing database:",t),za(window.indexedDB.deleteDatabase(t)).toPromise()}static bt(){if("object"!=typeof indexedDB)return!1;if(ja.Pt())return!0;const t=h(),e=ja.Rt(t),n=00||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||n||r)}static Pt(){var t;return void 0!==o&&"YES"===(void 0===(t={})?void 0:t.Vt)}static St(t,e){return t.store(e)}static Rt(t){const e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)}static vt(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}async Dt(t){return this.db||(Vs("SimpleDb","Opening database:",this.name),this.db=await new Promise(((e,n)=>{const s=indexedDB.open(this.name,this.version);s.onsuccess=t=>{const n=t.target.result;e(n)},s.onblocked=()=>{n(new $a(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},s.onerror=e=>{const s=e.target.error;"VersionError"===s.name?n(new zs(Hs.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):"InvalidStateError"===s.name?n(new zs(Hs.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+s)):n(new $a(t,s))},s.onupgradeneeded=t=>{Vs("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',t.oldVersion);const e=t.target.result;this.At.Ct(e,s.transaction,t.oldVersion,this.version).next((()=>{Vs("SimpleDb","Database upgrade to version "+this.version+" complete")}))}}))),this.Nt&&(this.db.onversionchange=t=>this.Nt(t)),this.db}xt(t){this.Nt=t,this.db&&(this.db.onversionchange=e=>t(e))}async runTransaction(t,e,n,s){const r="readonly"===e;let i=0;for(;;){++i;try{this.db=await this.Dt(t);const e=Ba.open(this.db,t,r?"readonly":"readwrite",n),i=s(e).catch((t=>(e.abort(t),qa.reject(t)))).toPromise();return i.catch((()=>{})),await e.It,i}catch(t){const e="FirebaseError"!==t.name&&i<3;if(Vs("SimpleDb","Transaction failed with error:",t.message,"Retrying:",e),this.close(),!e)return Promise.reject(t)}}}close(){this.db&&this.db.close(),this.db=void 0}}class Ka{constructor(t){this.kt=t,this.$t=!1,this.Ot=null}get isDone(){return this.$t}get Ft(){return this.Ot}set cursor(t){this.kt=t}done(){this.$t=!0}Mt(t){this.Ot=t}delete(){return za(this.kt.delete())}}class $a extends zs{constructor(t,e){super(Hs.UNAVAILABLE,`IndexedDB transaction '${t}' failed: ${e}`),this.name="IndexedDbTransactionError"}}function Ga(t){return"IndexedDbTransactionError"===t.name}class Ha{constructor(t){this.store=t}put(t,e){let n;return void 0!==e?(Vs("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(Vs("SimpleDb","PUT",this.store.name,"",t),n=this.store.put(t)),za(n)}add(t){return Vs("SimpleDb","ADD",this.store.name,t,t),za(this.store.add(t))}get(t){return za(this.store.get(t)).next((e=>(void 0===e&&(e=null),Vs("SimpleDb","GET",this.store.name,t,e),e)))}delete(t){return Vs("SimpleDb","DELETE",this.store.name,t),za(this.store.delete(t))}count(){return Vs("SimpleDb","COUNT",this.store.name),za(this.store.count())}Lt(t,e){const n=this.cursor(this.options(t,e)),s=[];return this.Bt(n,((t,e)=>{s.push(e)})).next((()=>s))}Ut(t,e){Vs("SimpleDb","DELETE ALL",this.store.name);const n=this.options(t,e);n.qt=!1;const s=this.cursor(n);return this.Bt(s,((t,e,n)=>n.delete()))}Kt(t,e){let n;e?n=t:(n={},e=t);const s=this.cursor(n);return this.Bt(s,e)}jt(t){const e=this.cursor({});return new qa(((n,s)=>{e.onerror=t=>{const e=Wa(t.target.error);s(e)},e.onsuccess=e=>{const s=e.target.result;s?t(s.primaryKey,s.value).next((t=>{t?s.continue():n()})):n()}}))}Bt(t,e){const n=[];return new qa(((s,r)=>{t.onerror=t=>{r(t.target.error)},t.onsuccess=t=>{const r=t.target.result;if(!r)return void s();const i=new Ka(r),o=e(r.primaryKey,r.value,i);if(o instanceof qa){const t=o.catch((t=>(i.done(),qa.reject(t))));n.push(t)}i.isDone?s():null===i.Ft?r.continue():r.continue(i.Ft)}})).next((()=>qa.waitFor(n)))}options(t,e){let n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}}cursor(t){let e="next";if(t.reverse&&(e="prev"),t.index){const n=this.store.index(t.index);return t.qt?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)}}function za(t){return new qa(((e,n)=>{t.onsuccess=t=>{const n=t.target.result;e(n)},t.onerror=t=>{const e=Wa(t.target.error);n(e)}}))}let Qa=!1;function Wa(t){const e=ja.Rt(h());if(e>=12.2&&e<13){const e="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(e)>=0){const t=new zs("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return Qa||(Qa=!0,setTimeout((()=>{throw t}),0)),t}}return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ya extends Ua{constructor(t,e){super(),this.Qt=t,this.currentSequenceNumber=e}}function Xa(t,e){const n=Gs(t);return ja.St(n.Qt,e)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ja{constructor(t,e,n,s){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(t,e){const n=e.mutationResults;for(let e=0;e{const n=t.get(e.key),s=n;this.applyToLocalView(s),n.isValidDocument()||s.convertToNoDocument(cr.min())}))}keys(){return this.mutations.reduce(((t,e)=>t.add(e.key)),No())}isEqual(t){return this.batchId===t.batchId&&ir(this.mutations,t.mutations,((t,e)=>Zi(t,e)))&&ir(this.baseMutations,t.baseMutations,((t,e)=>Zi(t,e)))}}class Za{constructor(t,e,n,s){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=s}static from(t,e,n){Ks(t.mutations.length===n.length);let s=So();const r=t.mutations;for(let t=0;tna(t.Wt,e)));for(let t=0;tna(t.Wt,e))),r=ar.fromMillis(e.localWriteTimeMs);return new Ja(e.batchId,r,n,s)}function uc(t){const e=ac(t.readTime),n=void 0!==t.lastLimboFreeSnapshotVersion?ac(t.lastLimboFreeSnapshotVersion):cr.min();let s;var r;return void 0!==t.query.documents?(Ks(1===(r=t.query).documents.length),s=Ei(mi(Yo(r.documents[0])))):s=function(t){return Ei(ia(t))}(t.query),new tc(s,t.targetId,0,t.lastListenSequenceNumber,e,n,wr.fromBase64String(t.resumeToken))}function hc(t,e){const n=oc(e.snapshotVersion),s=oc(e.lastLimboFreeSnapshotVersion);let r;r=Xr(e.target)?sa(t.Wt,e.target):ra(t.Wt,e.target);const i=e.resumeToken.toBase64();return new Ca(e.targetId,Wr(e.target),n,i,e.sequenceNumber,s,r)}function lc(t){const e=ia({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Ii(e,e.limit,"L"):e} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dc{getBundleMetadata(t,e){return fc(t).get(e).next((t=>{if(t)return{id:(e=t).bundleId,createTime:ac(e.createTime),version:e.version};var e}))}saveBundleMetadata(t,e){var n;return fc(t).put({bundleId:(n=e).id,createTime:oc($o(n.createTime)),version:n.version})}getNamedQuery(t,e){return gc(t).get(e).next((t=>{if(t)return{name:(e=t).name,query:lc(e.bundledQuery),readTime:ac(e.readTime)};var e}))}saveNamedQuery(t,e){return gc(t).put(function(t){return{name:t.name,readTime:oc($o(t.readTime)),bundledQuery:t.bundledQuery}}(e))}}function fc(t){return Xa(t,Ma.store)}function gc(t){return Xa(t,Fa.store)} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class mc{constructor(){this.Gt=new pc}addToCollectionParentIndex(t,e){return this.Gt.add(e),qa.resolve()}getCollectionParents(t,e){return qa.resolve(this.Gt.getEntries(e))}}class pc{constructor(){this.index={}}add(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e]||new yo(fr.comparator),r=!s.has(n);return this.index[e]=s.add(n),r}has(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e];return s&&s.has(n)}getEntries(t){return(this.index[t]||new yo(fr.comparator)).toArray()}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yc{constructor(){this.zt=new pc}addToCollectionParentIndex(t,e){if(!this.zt.has(e)){const n=e.lastSegment(),s=e.popLast();t.addOnCommittedListener((()=>{this.zt.add(e)}));const r={collectionId:n,parent:ya(s)};return wc(t).put(r)}return qa.resolve()}getCollectionParents(t,e){const n=[],s=IDBKeyRange.bound([e,""],[or(e),""],!1,!0);return wc(t).Lt(s).next((t=>{for(const s of t){if(s.collectionId!==e)break;n.push(ba(s.parent))}return n}))}}function wc(t){return Xa(t,La.store)} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vc={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class bc{constructor(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}static withCacheSize(t){return new bc(t,bc.DEFAULT_COLLECTION_PERCENTILE,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Tc(t,e,n){const s=t.store(Sa.store),r=t.store(_a.store),i=[],o=IDBKeyRange.only(n.batchId);let a=0;const c=s.Kt({range:o},((t,e,n)=>(a++,n.delete())));i.push(c.next((()=>{Ks(1===a)})));const u=[];for(const t of n.mutations){const s=_a.key(e,t.key.path,n.batchId);i.push(r.delete(s)),u.push(t.key)}return qa.waitFor(i).next((()=>u))}function Ec(t){if(!t)return 0;let e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw js();e=t.noDocument}return JSON.stringify(e).length} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */bc.DEFAULT_COLLECTION_PERCENTILE=10,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,bc.DEFAULT=new bc(41943040,bc.DEFAULT_COLLECTION_PERCENTILE,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),bc.DISABLED=new bc(-1,0,0);class Ic{constructor(t,e,n,s){this.userId=t,this.N=e,this.Ht=n,this.referenceDelegate=s,this.Jt={}}static Yt(t,e,n,s){Ks(""!==t.uid);const r=t.isAuthenticated()?t.uid:"";return new Ic(r,e,n,s)}checkEmpty(t){let e=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return _c(t).Kt({index:Sa.userMutationsIndex,range:n},((t,n,s)=>{e=!1,s.done()})).next((()=>e))}addMutationBatch(t,e,n,s){const r=Nc(t),i=_c(t);return i.add({}).next((o=>{Ks("number"==typeof o);const a=new Ja(o,e,n,s),c=function(t,e,n){const s=n.baseMutations.map((e=>ea(t.Wt,e))),r=n.mutations.map((e=>ea(t.Wt,e)));return new Sa(e,n.batchId,n.localWriteTime.toMillis(),s,r)}(this.N,this.userId,a),u=[];let h=new yo(((t,e)=>rr(t.canonicalString(),e.canonicalString())));for(const t of s){const e=_a.key(this.userId,t.key.path,o);h=h.add(t.key.path.popLast()),u.push(i.put(c)),u.push(r.put(e,_a.PLACEHOLDER))}return h.forEach((e=>{u.push(this.Ht.addToCollectionParentIndex(t,e))})),t.addOnCommittedListener((()=>{this.Jt[o]=a.keys()})),qa.waitFor(u).next((()=>a))}))}lookupMutationBatch(t,e){return _c(t).get(e).next((t=>t?(Ks(t.userId===this.userId),cc(this.N,t)):null))}Xt(t,e){return this.Jt[e]?qa.resolve(this.Jt[e]):this.lookupMutationBatch(t,e).next((t=>{if(t){const n=t.keys();return this.Jt[e]=n,n}return null}))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=IDBKeyRange.lowerBound([this.userId,n]);let r=null;return _c(t).Kt({index:Sa.userMutationsIndex,range:s},((t,e,s)=>{e.userId===this.userId&&(Ks(e.batchId>=n),r=cc(this.N,e)),s.done()})).next((()=>r))}getHighestUnacknowledgedBatchId(t){const e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return _c(t).Kt({index:Sa.userMutationsIndex,range:e,reverse:!0},((t,e,s)=>{n=e.batchId,s.done()})).next((()=>n))}getAllMutationBatches(t){const e=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return _c(t).Lt(Sa.userMutationsIndex,e).next((t=>t.map((t=>cc(this.N,t)))))}getAllMutationBatchesAffectingDocumentKey(t,e){const n=_a.prefixForPath(this.userId,e.path),s=IDBKeyRange.lowerBound(n),r=[];return Nc(t).Kt({range:s},((n,s,i)=>{const[o,a,c]=n,u=ba(a);if(o===this.userId&&e.path.isEqual(u))return _c(t).get(c).next((t=>{if(!t)throw js();Ks(t.userId===this.userId),r.push(cc(this.N,t))}));i.done()})).next((()=>r))}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new yo(rr);const s=[];return e.forEach((e=>{const r=_a.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=Nc(t).Kt({range:i},((t,s,r)=>{const[i,o,a]=t,c=ba(o);i===this.userId&&e.path.isEqual(c)?n=n.add(a):r.done()}));s.push(o)})),qa.waitFor(s).next((()=>this.Zt(t,n)))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1,r=_a.prefixForPath(this.userId,n),i=IDBKeyRange.lowerBound(r);let o=new yo(rr);return Nc(t).Kt({range:i},((t,e,r)=>{const[i,a,c]=t,u=ba(a);i===this.userId&&n.isPrefixOf(u)?u.length===s&&(o=o.add(c)):r.done()})).next((()=>this.Zt(t,o)))}Zt(t,e){const n=[],s=[];return e.forEach((e=>{s.push(_c(t).get(e).next((t=>{if(null===t)throw js();Ks(t.userId===this.userId),n.push(cc(this.N,t))})))})),qa.waitFor(s).next((()=>n))}removeMutationBatch(t,e){return Tc(t.Qt,this.userId,e).next((n=>(t.addOnCommittedListener((()=>{this.te(e.batchId)})),qa.forEach(n,(e=>this.referenceDelegate.markPotentiallyOrphaned(t,e))))))}te(t){delete this.Jt[t]}performConsistencyCheck(t){return this.checkEmpty(t).next((e=>{if(!e)return qa.resolve();const n=IDBKeyRange.lowerBound(_a.prefixForUser(this.userId)),s=[];return Nc(t).Kt({range:n},((t,e,n)=>{if(t[0]===this.userId){const e=ba(t[1]);s.push(e)}else n.done()})).next((()=>{Ks(0===s.length)}))}))}containsKey(t,e){return Sc(t,this.userId,e)}ee(t){return Ac(t).get(this.userId).next((t=>t||new Ia(this.userId,-1,"")))}}function Sc(t,e,n){const s=_a.prefixForPath(e,n.path),r=s[1],i=IDBKeyRange.lowerBound(s);let o=!1;return Nc(t).Kt({range:i,qt:!0},((t,n,s)=>{const[i,a,c]=t;i===e&&a===r&&(o=!0),s.done()})).next((()=>o))}function _c(t){return Xa(t,Sa.store)}function Nc(t){return Xa(t,_a.store)}function Ac(t){return Xa(t,Ia.store)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Dc{constructor(t){this.ne=t}next(){return this.ne+=2,this.ne}static se(){return new Dc(0)}static ie(){return new Dc(-1)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xc{constructor(t,e){this.referenceDelegate=t,this.N=e}allocateTargetId(t){return this.re(t).next((e=>{const n=new Dc(e.highestTargetId);return e.highestTargetId=n.next(),this.oe(t,e).next((()=>e.highestTargetId))}))}getLastRemoteSnapshotVersion(t){return this.re(t).next((t=>cr.fromTimestamp(new ar(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(t){return this.re(t).next((t=>t.highestListenSequenceNumber))}setTargetsMetadata(t,e,n){return this.re(t).next((s=>(s.highestListenSequenceNumber=e,n&&(s.lastRemoteSnapshotVersion=n.toTimestamp()),e>s.highestListenSequenceNumber&&(s.highestListenSequenceNumber=e),this.oe(t,s))))}addTargetData(t,e){return this.ce(t,e).next((()=>this.re(t).next((n=>(n.targetCount+=1,this.ae(e,n),this.oe(t,n))))))}updateTargetData(t,e){return this.ce(t,e)}removeTargetData(t,e){return this.removeMatchingKeysForTargetId(t,e.targetId).next((()=>Cc(t).delete(e.targetId))).next((()=>this.re(t))).next((e=>(Ks(e.targetCount>0),e.targetCount-=1,this.oe(t,e))))}removeTargets(t,e,n){let s=0;const r=[];return Cc(t).Kt(((i,o)=>{const a=uc(o);a.sequenceNumber<=e&&null===n.get(a.targetId)&&(s++,r.push(this.removeTargetData(t,a)))})).next((()=>qa.waitFor(r))).next((()=>s))}forEachTarget(t,e){return Cc(t).Kt(((t,n)=>{const s=uc(n);e(s)}))}re(t){return kc(t).get(Ra.key).next((t=>(Ks(null!==t),t)))}oe(t,e){return kc(t).put(Ra.key,e)}ce(t,e){return Cc(t).put(hc(this.N,e))}ae(t,e){let n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n}getTargetCount(t){return this.re(t).next((t=>t.targetCount))}getTargetData(t,e){const n=Wr(e),s=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let r=null;return Cc(t).Kt({range:s,index:Ca.queryTargetsIndexName},((t,n,s)=>{const i=uc(n);Yr(e,i.target)&&(r=i,s.done())})).next((()=>r))}addMatchingKeys(t,e,n){const s=[],r=Rc(t);return e.forEach((e=>{const i=ya(e.path);s.push(r.put(new ka(n,i))),s.push(this.referenceDelegate.addReference(t,n,e))})),qa.waitFor(s)}removeMatchingKeys(t,e,n){const s=Rc(t);return qa.forEach(e,(e=>{const r=ya(e.path);return qa.waitFor([s.delete([n,r]),this.referenceDelegate.removeReference(t,n,e)])}))}removeMatchingKeysForTargetId(t,e){const n=Rc(t),s=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(s)}getMatchingKeysForTargetId(t,e){const n=IDBKeyRange.bound([e],[e+1],!1,!0),s=Rc(t);let r=No();return s.Kt({range:n,qt:!0},((t,e,n)=>{const s=ba(t[1]),i=new xr(s);r=r.add(i)})).next((()=>r))}containsKey(t,e){const n=ya(e.path),s=IDBKeyRange.bound([n],[or(n)],!1,!0);let r=0;return Rc(t).Kt({index:ka.documentTargetsIndex,qt:!0,range:s},(([t,e],n,s)=>{0!==t&&(r++,s.done())})).next((()=>r>0))}Tt(t,e){return Cc(t).get(e).next((t=>t?uc(t):null))}}function Cc(t){return Xa(t,Ca.store)}function kc(t){return Xa(t,Ra.store)}function Rc(t){return Xa(t,ka.store)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */async function Lc(t){if(t.code!==Hs.FAILED_PRECONDITION||t.message!==Va)throw t;Vs("LocalStore","Unexpectedly lost primary lease")} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Oc([t,e],[n,s]){const r=rr(t,n);return 0===r?rr(e,s):r}class Mc{constructor(t){this.ue=t,this.buffer=new yo(Oc),this.he=0}le(){return++this.he}fe(t){const e=[t,this.le()];if(this.buffer.size{this.we=null,this.de=!0;try{await t.collectGarbage(this.garbageCollector)}catch(t){Ga(t)?Vs("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",t):await Lc(t)}await this._e(t)}))}}class Pc{constructor(t,e){this.me=t,this.params=e}calculateTargetCount(t,e){return this.me.ge(t).next((t=>Math.floor(e/100*t)))}nthSequenceNumber(t,e){if(0===e)return qa.resolve(er.T);const n=new Mc(e);return this.me.forEachTarget(t,(t=>n.fe(t.sequenceNumber))).next((()=>this.me.ye(t,(t=>n.fe(t))))).next((()=>n.maxValue))}removeTargets(t,e,n){return this.me.removeTargets(t,e,n)}removeOrphanedDocuments(t,e){return this.me.removeOrphanedDocuments(t,e)}collect(t,e){return-1===this.params.cacheSizeCollectionThreshold?(Vs("LruGarbageCollector","Garbage collection skipped; disabled"),qa.resolve(vc)):this.getCacheSize(t).next((n=>n(e>this.params.maximumSequenceNumbersToCollect?(Vs("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`),s=this.params.maximumSequenceNumbersToCollect):s=e,i=Date.now(),this.nthSequenceNumber(t,s)))).next((s=>(n=s,o=Date.now(),this.removeTargets(t,n,e)))).next((e=>(r=e,a=Date.now(),this.removeOrphanedDocuments(t,n)))).next((t=>(c=Date.now(),Fs()<=p.DEBUG&&Vs("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${i-u}ms\n\tDetermined least recently used ${s} in `+(o-i)+"ms\n"+`\tRemoved ${r} targets in `+(a-o)+"ms\n"+`\tRemoved ${t} documents in `+(c-a)+"ms\n"+`Total Duration: ${c-u}ms`),qa.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:r,documentsRemoved:t}))))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Vc{constructor(t,e){this.db=t,this.garbageCollector=function(t,e){return new Pc(t,e)}(this,e)}ge(t){const e=this.Te(t);return this.db.getTargetCache().getTargetCount(t).next((t=>e.next((e=>t+e))))}Te(t){let e=0;return this.ye(t,(t=>{e++})).next((()=>e))}forEachTarget(t,e){return this.db.getTargetCache().forEachTarget(t,e)}ye(t,e){return this.Ee(t,((t,n)=>e(n)))}addReference(t,e,n){return Uc(t,n)}removeReference(t,e,n){return Uc(t,n)}removeTargets(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)}markPotentiallyOrphaned(t,e){return Uc(t,e)}Ie(t,e){return function(t,e){let n=!1;return Ac(t).jt((s=>Sc(t,s,e).next((t=>(t&&(n=!0),qa.resolve(!t)))))).next((()=>n))}(t,e)}removeOrphanedDocuments(t,e){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[];let r=0;return this.Ee(t,((i,o)=>{if(o<=e){const e=this.Ie(t,i).next((e=>{if(!e)return r++,n.getEntry(t,i).next((()=>(n.removeEntry(i),Rc(t).delete([0,ya(i.path)]))))}));s.push(e)}})).next((()=>qa.waitFor(s))).next((()=>n.apply(t))).next((()=>r))}removeTarget(t,e){const n=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,n)}updateLimboDocument(t,e){return Uc(t,e)}Ee(t,e){const n=Rc(t);let s,r=er.T;return n.Kt({index:ka.documentTargetsIndex},(([t,n],{path:i,sequenceNumber:o})=>{0===t?(r!==er.T&&e(new xr(ba(s)),r),r=o,s=i):r=er.T})).next((()=>{r!==er.T&&e(new xr(ba(s)),r)}))}getCacheSize(t){return this.db.getRemoteDocumentCache().getSize(t)}}function Uc(t,e){return Rc(t).put(function(t,e){return new ka(0,ya(t.path),e)}(e,t.currentSequenceNumber))} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qc{constructor(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={}}get(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(const[e,s]of n)if(this.equalsFn(e,t))return s}has(t){return void 0!==this.get(t)}set(t,e){const n=this.mapKeyFn(t),s=this.inner[n];if(void 0!==s){for(let n=0;n{for(const[e,s]of n)t(e,s)}))}isEmpty(){return lr(this.inner)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Bc{constructor(){this.changes=new qc((t=>t.toString()),((t,e)=>t.isEqual(e))),this.changesApplied=!1}getReadTime(t){const e=this.changes.get(t);return e?e.readTime:cr.min()}addEntry(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})}removeEntry(t,e=null){this.assertNotApplied(),this.changes.set(t,{document:Hr.newInvalidDocument(t),readTime:e})}getEntry(t,e){this.assertNotApplied();const n=this.changes.get(e);return void 0!==n?qa.resolve(n.document):this.getFromCache(t,e)}getEntries(t,e){return this.getAllFromCache(t,e)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class jc{constructor(t,e){this.N=t,this.Ht=e}addEntry(t,e,n){return Gc(t).put(Hc(e),n)}removeEntry(t,e){const n=Gc(t),s=Hc(e);return n.delete(s)}updateMetadata(t,e){return this.getMetadata(t).next((n=>(n.byteSize+=e,this.Ae(t,n))))}getEntry(t,e){return Gc(t).get(Hc(e)).next((t=>this.Re(e,t)))}be(t,e){return Gc(t).get(Hc(e)).next((t=>({document:this.Re(e,t),size:Ec(t)})))}getEntries(t,e){let n=bo();return this.Pe(t,e,((t,e)=>{const s=this.Re(t,e);n=n.insert(t,s)})).next((()=>n))}ve(t,e){let n=bo(),s=new go(xr.comparator);return this.Pe(t,e,((t,e)=>{const r=this.Re(t,e);n=n.insert(t,r),s=s.insert(t,Ec(e))})).next((()=>({documents:n,Ve:s})))}Pe(t,e,n){if(e.isEmpty())return qa.resolve();const s=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),r=e.getIterator();let i=r.getNext();return Gc(t).Kt({range:s},((t,e,s)=>{const o=xr.fromSegments(t);for(;i&&xr.comparator(i,o)<0;)n(i,null),i=r.getNext();i&&i.isEqual(o)&&(n(i,e),i=r.hasNext()?r.getNext():null),i?s.Mt(i.path.toArray()):s.done()})).next((()=>{for(;i;)n(i,null),i=r.hasNext()?r.getNext():null}))}getDocumentsMatchingQuery(t,e,n){let s=bo();const r=e.path.length+1,i={};if(n.isEqual(cr.min())){const t=e.path.toArray();i.range=IDBKeyRange.lowerBound(t)}else{const t=e.path.toArray(),s=rc(n);i.range=IDBKeyRange.lowerBound([t,s],!0),i.index=Da.collectionReadTimeIndex}return Gc(t).Kt(i,((t,n,i)=>{if(t.length!==r)return;const o=nc(this.N,n);e.path.isPrefixOf(o.key.path)?Ai(e,o)&&(s=s.insert(o.key,o)):i.done()})).next((()=>s))}newChangeBuffer(t){return new Kc(this,!!t&&t.trackRemovals)}getSize(t){return this.getMetadata(t).next((t=>t.byteSize))}getMetadata(t){return $c(t).get(xa.key).next((t=>(Ks(!!t),t)))}Ae(t,e){return $c(t).put(xa.key,e)}Re(t,e){if(e){const t=nc(this.N,e);if(!t.isNoDocument()||!t.version.isEqual(cr.min()))return t}return Hr.newInvalidDocument(t)}}class Kc extends Bc{constructor(t,e){super(),this.Se=t,this.trackRemovals=e,this.De=new qc((t=>t.toString()),((t,e)=>t.isEqual(e)))}applyChanges(t){const e=[];let n=0,s=new yo(((t,e)=>rr(t.canonicalString(),e.canonicalString())));return this.changes.forEach(((r,i)=>{const o=this.De.get(r);if(i.document.isValidDocument()){const a=sc(this.Se.N,i.document,this.getReadTime(r));s=s.add(r.path.popLast());const c=Ec(a);n+=c-o,e.push(this.Se.addEntry(t,r,a))}else if(n-=o,this.trackRemovals){const n=sc(this.Se.N,Hr.newNoDocument(r,cr.min()),this.getReadTime(r));e.push(this.Se.addEntry(t,r,n))}else e.push(this.Se.removeEntry(t,r))})),s.forEach((n=>{e.push(this.Se.Ht.addToCollectionParentIndex(t,n))})),e.push(this.Se.updateMetadata(t,n)),qa.waitFor(e)}getFromCache(t,e){return this.Se.be(t,e).next((t=>(this.De.set(e,t.size),t.document)))}getAllFromCache(t,e){return this.Se.ve(t,e).next((({documents:t,Ve:e})=>(e.forEach(((t,e)=>{this.De.set(t,e)})),t)))}}function $c(t){return Xa(t,xa.store)}function Gc(t){return Xa(t,Da.store)}function Hc(t){return t.path.toArray()} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zc{constructor(t){this.N=t}Ct(t,e,n,s){Ks(n=0&&s<=11);const r=new Ba("createOrUpgrade",e);n<1&&s>=1&&(function(t){t.createObjectStore(Ea.store)}(t),function(t){t.createObjectStore(Ia.store,{keyPath:Ia.keyPath}),t.createObjectStore(Sa.store,{keyPath:Sa.keyPath,autoIncrement:!0}).createIndex(Sa.userMutationsIndex,Sa.userMutationsKeyPath,{unique:!0}),t.createObjectStore(_a.store)}(t),Qc(t),function(t){t.createObjectStore(Da.store)}(t));let i=qa.resolve();return n<3&&s>=3&&(0!==n&&(function(t){t.deleteObjectStore(ka.store),t.deleteObjectStore(Ca.store),t.deleteObjectStore(Ra.store)}(t),Qc(t)),i=i.next((()=>function(t){const e=t.store(Ra.store),n=new Ra(0,0,cr.min().toTimestamp(),0);return e.put(Ra.key,n)}(r)))),n<4&&s>=4&&(0!==n&&(i=i.next((()=>function(t,e){return e.store(Sa.store).Lt().next((n=>{t.deleteObjectStore(Sa.store),t.createObjectStore(Sa.store,{keyPath:Sa.keyPath,autoIncrement:!0}).createIndex(Sa.userMutationsIndex,Sa.userMutationsKeyPath,{unique:!0});const s=e.store(Sa.store),r=n.map((t=>s.put(t)));return qa.waitFor(r)}))}(t,r)))),i=i.next((()=>{!function(t){t.createObjectStore(Oa.store,{keyPath:Oa.keyPath})}(t)}))),n<5&&s>=5&&(i=i.next((()=>this.Ce(r)))),n<6&&s>=6&&(i=i.next((()=>(function(t){t.createObjectStore(xa.store)}(t),this.Ne(r))))),n<7&&s>=7&&(i=i.next((()=>this.xe(r)))),n<8&&s>=8&&(i=i.next((()=>this.ke(t,r)))),n<9&&s>=9&&(i=i.next((()=>{!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){const e=t.objectStore(Da.store);e.createIndex(Da.readTimeIndex,Da.readTimeIndexPath,{unique:!1}),e.createIndex(Da.collectionReadTimeIndex,Da.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&s>=10&&(i=i.next((()=>this.$e(r)))),n<11&&s>=11&&(i=i.next((()=>{!function(t){t.createObjectStore(Ma.store,{keyPath:Ma.keyPath})}(t),function(t){t.createObjectStore(Fa.store,{keyPath:Fa.keyPath})}(t)}))),i}Ne(t){let e=0;return t.store(Da.store).Kt(((t,n)=>{e+=Ec(n)})).next((()=>{const n=new xa(e);return t.store(xa.store).put(xa.key,n)}))}Ce(t){const e=t.store(Ia.store),n=t.store(Sa.store);return e.Lt().next((e=>qa.forEach(e,(e=>{const s=IDBKeyRange.bound([e.userId,-1],[e.userId,e.lastAcknowledgedBatchId]);return n.Lt(Sa.userMutationsIndex,s).next((n=>qa.forEach(n,(n=>{Ks(n.userId===e.userId);const s=cc(this.N,n);return Tc(t,e.userId,s).next((()=>{}))}))))}))))}xe(t){const e=t.store(ka.store),n=t.store(Da.store);return t.store(Ra.store).get(Ra.key).next((t=>{const s=[];return n.Kt(((n,r)=>{const i=new fr(n),o=function(t){return[0,ya(t)]}(i);s.push(e.get(o).next((n=>n?qa.resolve():(n=>e.put(new ka(0,ya(n),t.highestListenSequenceNumber)))(i))))})).next((()=>qa.waitFor(s)))}))}ke(t,e){t.createObjectStore(La.store,{keyPath:La.keyPath});const n=e.store(La.store),s=new pc,r=t=>{if(s.add(t)){const e=t.lastSegment(),s=t.popLast();return n.put({collectionId:e,parent:ya(s)})}};return e.store(Da.store).Kt({qt:!0},((t,e)=>{const n=new fr(t);return r(n.popLast())})).next((()=>e.store(_a.store).Kt({qt:!0},(([t,e,n],s)=>{const i=ba(e);return r(i.popLast())}))))}$e(t){const e=t.store(Ca.store);return e.Kt(((t,n)=>{const s=uc(n),r=hc(this.N,s);return e.put(r)}))}}function Qc(t){t.createObjectStore(ka.store,{keyPath:ka.keyPath}).createIndex(ka.documentTargetsIndex,ka.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Ca.store,{keyPath:Ca.keyPath}).createIndex(Ca.queryTargetsIndexName,Ca.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Ra.store)}const Wc="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";class Yc{constructor(t,e,n,s,r,i,o,a,c,u){if(this.allowTabSynchronization=t,this.persistenceKey=e,this.clientId=n,this.Oe=r,this.window=i,this.document=o,this.Fe=c,this.Me=u,this.Le=null,this.Be=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ue=null,this.inForeground=!1,this.qe=null,this.Ke=null,this.je=Number.NEGATIVE_INFINITY,this.Qe=t=>Promise.resolve(),!Yc.bt())throw new zs(Hs.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new Vc(this,s),this.We=e+"main",this.N=new ec(a),this.Ge=new ja(this.We,11,new zc(this.N)),this.ze=new xc(this.referenceDelegate,this.N),this.Ht=new yc,this.He=function(t,e){return new jc(t,e)}(this.N,this.Ht),this.Je=new dc,this.window&&this.window.localStorage?this.Ye=this.window.localStorage:(this.Ye=null,!1===u&&Us("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Xe().then((()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new zs(Hs.FAILED_PRECONDITION,Wc);return this.Ze(),this.tn(),this.en(),this.runTransaction("getHighestListenSequenceNumber","readonly",(t=>this.ze.getHighestSequenceNumber(t)))})).then((t=>{this.Le=new er(t,this.Fe)})).then((()=>{this.Be=!0})).catch((t=>(this.Ge&&this.Ge.close(),Promise.reject(t))))}nn(t){return this.Qe=async e=>{if(this.started)return t(e)},t(this.isPrimary)}setDatabaseDeletedListener(t){this.Ge.xt((async e=>{null===e.newVersion&&await t()}))}setNetworkEnabled(t){this.networkEnabled!==t&&(this.networkEnabled=t,this.Oe.enqueueAndForget((async()=>{this.started&&await this.Xe()})))}Xe(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(t=>Jc(t).put(new Oa(this.clientId,Date.now(),this.networkEnabled,this.inForeground)).next((()=>{if(this.isPrimary)return this.sn(t).next((t=>{t||(this.isPrimary=!1,this.Oe.enqueueRetryable((()=>this.Qe(!1))))}))})).next((()=>this.rn(t))).next((e=>this.isPrimary&&!e?this.on(t).next((()=>!1)):!!e&&this.cn(t).next((()=>!0)))))).catch((t=>{if(Ga(t))return Vs("IndexedDbPersistence","Failed to extend owner lease: ",t),this.isPrimary;if(!this.allowTabSynchronization)throw t;return Vs("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((t=>{this.isPrimary!==t&&this.Oe.enqueueRetryable((()=>this.Qe(t))),this.isPrimary=t}))}sn(t){return Xc(t).get(Ea.key).next((t=>qa.resolve(this.an(t))))}un(t){return Jc(t).delete(this.clientId)}async hn(){if(this.isPrimary&&!this.ln(this.je,18e5)){this.je=Date.now();const t=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(t=>{const e=Xa(t,Oa.store);return e.Lt().next((t=>{const n=this.fn(t,18e5),s=t.filter((t=>-1===n.indexOf(t)));return qa.forEach(s,(t=>e.delete(t.clientId))).next((()=>s))}))})).catch((()=>[]));if(this.Ye)for(const e of t)this.Ye.removeItem(this.dn(e.clientId))}}en(){this.Ke=this.Oe.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.Xe().then((()=>this.hn())).then((()=>this.en()))))}an(t){return!!t&&t.ownerId===this.clientId}rn(t){return this.Me?qa.resolve(!0):Xc(t).get(Ea.key).next((e=>{if(null!==e&&this.ln(e.leaseTimestampMs,5e3)&&!this.wn(e.ownerId)){if(this.an(e)&&this.networkEnabled)return!0;if(!this.an(e)){if(!e.allowTabSynchronization)throw new zs(Hs.FAILED_PRECONDITION,Wc);return!1}}return!(!this.networkEnabled||!this.inForeground)||Jc(t).Lt().next((t=>void 0===this.fn(t,5e3).find((t=>{if(this.clientId!==t.clientId){const e=!this.networkEnabled&&t.networkEnabled,n=!this.inForeground&&t.inForeground,s=this.networkEnabled===t.networkEnabled;if(e||n&&s)return!0}return!1}))))})).next((t=>(this.isPrimary!==t&&Vs("IndexedDbPersistence",`Client ${t?"is":"is not"} eligible for a primary lease.`),t)))}async shutdown(){this.Be=!1,this._n(),this.Ke&&(this.Ke.cancel(),this.Ke=null),this.mn(),this.gn(),await this.Ge.runTransaction("shutdown","readwrite",[Ea.store,Oa.store],(t=>{const e=new Ya(t,er.T);return this.on(e).next((()=>this.un(e)))})),this.Ge.close(),this.yn()}fn(t,e){return t.filter((t=>this.ln(t.updateTimeMs,e)&&!this.wn(t.clientId)))}pn(){return this.runTransaction("getActiveClients","readonly",(t=>Jc(t).Lt().next((t=>this.fn(t,18e5).map((t=>t.clientId))))))}get started(){return this.Be}getMutationQueue(t){return Ic.Yt(t,this.N,this.Ht,this.referenceDelegate)}getTargetCache(){return this.ze}getRemoteDocumentCache(){return this.He}getIndexManager(){return this.Ht}getBundleCache(){return this.Je}runTransaction(t,e,n){Vs("IndexedDbPersistence","Starting transaction:",t);const s="readonly"===e?"readonly":"readwrite";let r;return this.Ge.runTransaction(t,s,Pa,(s=>(r=new Ya(s,this.Le?this.Le.next():er.T),"readwrite-primary"===e?this.sn(r).next((t=>!!t||this.rn(r))).next((e=>{if(!e)throw Us(`Failed to obtain primary lease for action '${t}'.`),this.isPrimary=!1,this.Oe.enqueueRetryable((()=>this.Qe(!1))),new zs(Hs.FAILED_PRECONDITION,Va);return n(r)})).next((t=>this.cn(r).next((()=>t)))):this.Tn(r).next((()=>n(r)))))).then((t=>(r.raiseOnCommittedEvent(),t)))}Tn(t){return Xc(t).get(Ea.key).next((t=>{if(null!==t&&this.ln(t.leaseTimestampMs,5e3)&&!this.wn(t.ownerId)&&!this.an(t)&&!(this.Me||this.allowTabSynchronization&&t.allowTabSynchronization))throw new zs(Hs.FAILED_PRECONDITION,Wc)}))}cn(t){const e=new Ea(this.clientId,this.allowTabSynchronization,Date.now());return Xc(t).put(Ea.key,e)}static bt(){return ja.bt()}on(t){const e=Xc(t);return e.get(Ea.key).next((t=>this.an(t)?(Vs("IndexedDbPersistence","Releasing primary lease."),e.delete(Ea.key)):qa.resolve()))}ln(t,e){const n=Date.now();return!(tn&&(Us(`Detected an update time that is in the future: ${t} > ${n}`),1))}Ze(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.qe=()=>{this.Oe.enqueueAndForget((()=>(this.inForeground="visible"===this.document.visibilityState,this.Xe())))},this.document.addEventListener("visibilitychange",this.qe),this.inForeground="visible"===this.document.visibilityState)}mn(){this.qe&&(this.document.removeEventListener("visibilitychange",this.qe),this.qe=null)}tn(){var t;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Ue=()=>{this._n(),l()&&navigator.appVersion.match("Version/14")&&this.Oe.enterRestrictedMode(!0),this.Oe.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.Ue))}gn(){this.Ue&&(this.window.removeEventListener("pagehide",this.Ue),this.Ue=null)}wn(t){var e;try{const n=null!==(null===(e=this.Ye)||void 0===e?void 0:e.getItem(this.dn(t)));return Vs("IndexedDbPersistence",`Client '${t}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(t){return Us("IndexedDbPersistence","Failed to get zombied client id.",t),!1}}_n(){if(this.Ye)try{this.Ye.setItem(this.dn(this.clientId),String(Date.now()))}catch(t){Us("Failed to set zombie client id.",t)}}yn(){if(this.Ye)try{this.Ye.removeItem(this.dn(this.clientId))}catch(t){}}dn(t){return`firestore_zombie_${this.persistenceKey}_${t}`}}function Xc(t){return Xa(t,Ea.store)}function Jc(t){return Xa(t,Oa.store)}function Zc(t,e){let n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/" +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class tu{constructor(t,e){this.progress=t,this.En=e}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class eu{constructor(t,e,n){this.He=t,this.In=e,this.Ht=n}An(t,e){return this.In.getAllMutationBatchesAffectingDocumentKey(t,e).next((n=>this.Rn(t,e,n)))}Rn(t,e,n){return this.He.getEntry(t,e).next((t=>{for(const e of n)e.applyToLocalView(t);return t}))}bn(t,e){t.forEach(((t,n)=>{for(const t of e)t.applyToLocalView(n)}))}Pn(t,e){return this.He.getEntries(t,e).next((e=>this.vn(t,e).next((()=>e))))}vn(t,e){return this.In.getAllMutationBatchesAffectingDocumentKeys(t,e).next((t=>this.bn(e,t)))}getDocumentsMatchingQuery(t,e,n){return function(t){return xr.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Vn(t,e.path):bi(e)?this.Sn(t,e,n):this.Dn(t,e,n)}Vn(t,e){return this.An(t,new xr(e)).next((t=>{let e=Eo();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))}Sn(t,e,n){const s=e.collectionGroup;let r=Eo();return this.Ht.getCollectionParents(t,s).next((i=>qa.forEach(i,(i=>{const o=function(t,e){return new fi(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,i.child(s));return this.Dn(t,o,n).next((t=>{t.forEach(((t,e)=>{r=r.insert(t,e)}))}))})).next((()=>r))))}Dn(t,e,n){let s,r;return this.He.getDocumentsMatchingQuery(t,e,n).next((n=>(s=n,this.In.getAllMutationBatchesAffectingQuery(t,e)))).next((e=>(r=e,this.Cn(t,r,s).next((t=>{s=t;for(const t of r)for(const e of t.mutations){const n=e.key;let r=s.get(n);null==r&&(r=Hr.newInvalidDocument(n),s=s.insert(n,r)),Xi(e,r,t.localWriteTime),r.isFoundDocument()||(s=s.remove(n))}}))))).next((()=>(s.forEach(((t,n)=>{Ai(e,n)||(s=s.remove(t))})),s)))}Cn(t,e,n){let s=No();for(const t of e)for(const e of t.mutations)e instanceof no&&null===n.get(e.key)&&(s=s.add(e.key));let r=n;return this.He.getEntries(t,s).next((t=>(t.forEach(((t,e)=>{e.isFoundDocument()&&(r=r.insert(t,e))})),r)))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class nu{constructor(t,e,n,s){this.targetId=t,this.fromCache=e,this.Nn=n,this.xn=s}static kn(t,e){let n=No(),s=No();for(const t of e.docChanges)switch(t.type){case 0:n=n.add(t.doc.key);break;case 1:s=s.add(t.doc.key)}return new nu(t,e.fromCache,n,s)}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class su{$n(t){this.On=t}getDocumentsMatchingQuery(t,e,n,s){return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(cr.min())?this.Fn(t,e):this.On.Pn(t,s).next((r=>{const i=this.Mn(e,r);return(pi(e)||yi(e))&&this.Ln(e.limitType,i,s,n)?this.Fn(t,e):(Fs()<=p.DEBUG&&Vs("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Ni(e)),this.On.getDocumentsMatchingQuery(t,e,n).next((t=>(i.forEach((e=>{t=t.insert(e.key,e)})),t))))}))}Mn(t,e){let n=new yo(Di(t));return e.forEach(((e,s)=>{Ai(t,s)&&(n=n.add(s))})),n}Ln(t,e,n,s){if(n.size!==e.size)return!0;const r="F"===t?e.last():e.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(s)>0)}Fn(t,e){return Fs()<=p.DEBUG&&Vs("QueryEngine","Using full collection scan to execute query:",Ni(e)),this.On.getDocumentsMatchingQuery(t,e,cr.min())}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ru{constructor(t,e,n,s){this.persistence=t,this.Bn=e,this.N=s,this.Un=new go(rr),this.qn=new qc((t=>Wr(t)),Yr),this.Kn=cr.min(),this.In=t.getMutationQueue(n),this.jn=t.getRemoteDocumentCache(),this.ze=t.getTargetCache(),this.Qn=new eu(this.jn,this.In,this.persistence.getIndexManager()),this.Je=t.getBundleCache(),this.Bn.$n(this.Qn)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(e=>t.collect(e,this.Un)))}}function iu(t,e,n,s){return new ru(t,e,n,s)}async function ou(t,e){const n=Gs(t);let s=n.In,r=n.Qn;const i=await n.persistence.runTransaction("Handle user change","readonly",(t=>{let i;return n.In.getAllMutationBatches(t).next((o=>(i=o,s=n.persistence.getMutationQueue(e),r=new eu(n.jn,s,n.persistence.getIndexManager()),s.getAllMutationBatches(t)))).next((e=>{const n=[],s=[];let o=No();for(const t of i){n.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}for(const t of e){s.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}return r.Pn(t,o).next((t=>({Wn:t,removedBatchIds:n,addedBatchIds:s})))}))}));return n.In=s,n.Qn=r,n.Bn.$n(n.Qn),i}function au(t){const e=Gs(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.ze.getLastRemoteSnapshotVersion(t)))}function cu(t,e,n,s,r){let i=No();return n.forEach((t=>i=i.add(t))),e.getEntries(t,i).next((t=>{let i=bo();return n.forEach(((n,o)=>{const a=t.get(n),c=(null==r?void 0:r.get(n))||s;o.isNoDocument()&&o.version.isEqual(cr.min())?(e.removeEntry(n,c),i=i.insert(n,o)):!a.isValidDocument()||o.version.compareTo(a.version)>0||0===o.version.compareTo(a.version)&&a.hasPendingWrites?(e.addEntry(o,c),i=i.insert(n,o)):Vs("LocalStore","Ignoring outdated watch update for ",n,". Current version:",a.version," Watch version:",o.version)})),i}))}function uu(t,e){const n=Gs(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(t=>(void 0===e&&(e=-1),n.In.getNextMutationBatchAfterBatchId(t,e))))}function hu(t,e){const n=Gs(t);return n.persistence.runTransaction("Allocate target","readwrite",(t=>{let s;return n.ze.getTargetData(t,e).next((r=>r?(s=r,qa.resolve(s)):n.ze.allocateTargetId(t).next((r=>(s=new tc(e,r,0,t.currentSequenceNumber),n.ze.addTargetData(t,s).next((()=>s)))))))})).then((t=>{const s=n.Un.get(t.targetId);return(null===s||t.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(n.Un=n.Un.insert(t.targetId,t),n.qn.set(e,t.targetId)),t}))}async function lu(t,e,n){const s=Gs(t),r=s.Un.get(e),i=n?"readwrite":"readwrite-primary";try{n||await s.persistence.runTransaction("Release target",i,(t=>s.persistence.referenceDelegate.removeTarget(t,r)))}catch(t){if(!Ga(t))throw t;Vs("LocalStore",`Failed to update sequence numbers for target ${e}: ${t}`)}s.Un=s.Un.remove(e),s.qn.delete(r.target)}function du(t,e,n){const s=Gs(t);let r=cr.min(),i=No();return s.persistence.runTransaction("Execute query","readonly",(t=>function(t,e,n){const s=Gs(t),r=s.qn.get(n);return void 0!==r?qa.resolve(s.Un.get(r)):s.ze.getTargetData(e,n)}(s,t,Ei(e)).next((e=>{if(e)return r=e.lastLimboFreeSnapshotVersion,s.ze.getMatchingKeysForTargetId(t,e.targetId).next((t=>{i=t}))})).next((()=>s.Bn.getDocumentsMatchingQuery(t,e,n?r:cr.min(),n?i:No()))).next((t=>({documents:t,Gn:i})))))}function fu(t,e){const n=Gs(t),s=Gs(n.ze),r=n.Un.get(e);return r?Promise.resolve(r.target):n.persistence.runTransaction("Get target data","readonly",(t=>s.Tt(t,e).next((t=>t?t.target:null))))}function gu(t){const e=Gs(t);return e.persistence.runTransaction("Get new document changes","readonly",(t=>function(t,e,n){const s=Gs(t);let r=bo(),i=rc(n);const o=Gc(e),a=IDBKeyRange.lowerBound(i,!0);return o.Kt({index:Da.readTimeIndex,range:a},((t,e)=>{const n=nc(s.N,e);r=r.insert(n.key,n),i=e.readTime})).next((()=>({En:r,readTime:ic(i)})))}(e.jn,t,e.Kn))).then((({En:t,readTime:n})=>(e.Kn=n,t)))}async function mu(t,e,n=No()){const s=await hu(t,Ei(lc(e.bundledQuery))),r=Gs(t);return r.persistence.runTransaction("Save named query","readwrite",(t=>{const i=$o(e.readTime);if(s.snapshotVersion.compareTo(i)>=0)return r.Je.saveNamedQuery(t,e);const o=s.withResumeToken(wr.EMPTY_BYTE_STRING,i);return r.Un=r.Un.insert(o.targetId,o),r.ze.updateTargetData(t,o).next((()=>r.ze.removeMatchingKeysForTargetId(t,s.targetId))).next((()=>r.ze.addMatchingKeys(t,n,s.targetId))).next((()=>r.Je.saveNamedQuery(t,e)))}))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class pu{constructor(t){this.N=t,this.Yn=new Map,this.Xn=new Map}getBundleMetadata(t,e){return qa.resolve(this.Yn.get(e))}saveBundleMetadata(t,e){var n;return this.Yn.set(e.id,{id:(n=e).id,version:n.version,createTime:$o(n.createTime)}),qa.resolve()}getNamedQuery(t,e){return qa.resolve(this.Xn.get(e))}saveNamedQuery(t,e){return this.Xn.set(e.name,function(t){return{name:t.name,query:lc(t.bundledQuery),readTime:$o(t.readTime)}}(e)),qa.resolve()}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yu{constructor(){this.Zn=new yo(wu.ts),this.es=new yo(wu.ns)}isEmpty(){return this.Zn.isEmpty()}addReference(t,e){const n=new wu(t,e);this.Zn=this.Zn.add(n),this.es=this.es.add(n)}ss(t,e){t.forEach((t=>this.addReference(t,e)))}removeReference(t,e){this.rs(new wu(t,e))}os(t,e){t.forEach((t=>this.removeReference(t,e)))}cs(t){const e=new xr(new fr([])),n=new wu(e,t),s=new wu(e,t+1),r=[];return this.es.forEachInRange([n,s],(t=>{this.rs(t),r.push(t.key)})),r}us(){this.Zn.forEach((t=>this.rs(t)))}rs(t){this.Zn=this.Zn.delete(t),this.es=this.es.delete(t)}hs(t){const e=new xr(new fr([])),n=new wu(e,t),s=new wu(e,t+1);let r=No();return this.es.forEachInRange([n,s],(t=>{r=r.add(t.key)})),r}containsKey(t){const e=new wu(t,0),n=this.Zn.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)}}class wu{constructor(t,e){this.key=t,this.ls=e}static ts(t,e){return xr.comparator(t.key,e.key)||rr(t.ls,e.ls)}static ns(t,e){return rr(t.ls,e.ls)||xr.comparator(t.key,e.key)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class vu{constructor(t,e){this.Ht=t,this.referenceDelegate=e,this.In=[],this.fs=1,this.ds=new yo(wu.ts)}checkEmpty(t){return qa.resolve(0===this.In.length)}addMutationBatch(t,e,n,s){const r=this.fs;this.fs++,this.In.length>0&&this.In[this.In.length-1];const i=new Ja(r,e,n,s);this.In.push(i);for(const e of s)this.ds=this.ds.add(new wu(e.key,r)),this.Ht.addToCollectionParentIndex(t,e.key.path.popLast());return qa.resolve(i)}lookupMutationBatch(t,e){return qa.resolve(this.ws(e))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=this._s(n),r=s<0?0:s;return qa.resolve(this.In.length>r?this.In[r]:null)}getHighestUnacknowledgedBatchId(){return qa.resolve(0===this.In.length?-1:this.fs-1)}getAllMutationBatches(t){return qa.resolve(this.In.slice())}getAllMutationBatchesAffectingDocumentKey(t,e){const n=new wu(e,0),s=new wu(e,Number.POSITIVE_INFINITY),r=[];return this.ds.forEachInRange([n,s],(t=>{const e=this.ws(t.ls);r.push(e)})),qa.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new yo(rr);return e.forEach((t=>{const e=new wu(t,0),s=new wu(t,Number.POSITIVE_INFINITY);this.ds.forEachInRange([e,s],(t=>{n=n.add(t.ls)}))})),qa.resolve(this.gs(n))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1;let r=n;xr.isDocumentKey(r)||(r=r.child(""));const i=new wu(new xr(r),0);let o=new yo(rr);return this.ds.forEachWhile((t=>{const e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===s&&(o=o.add(t.ls)),!0)}),i),qa.resolve(this.gs(o))}gs(t){const e=[];return t.forEach((t=>{const n=this.ws(t);null!==n&&e.push(n)})),e}removeMutationBatch(t,e){Ks(0===this.ys(e.batchId,"removed")),this.In.shift();let n=this.ds;return qa.forEach(e.mutations,(s=>{const r=new wu(s.key,e.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(t,s.key)})).next((()=>{this.ds=n}))}te(t){}containsKey(t,e){const n=new wu(e,0),s=this.ds.firstAfterOrEqual(n);return qa.resolve(e.isEqual(s&&s.key))}performConsistencyCheck(t){return this.In.length,qa.resolve()}ys(t,e){return this._s(t)}_s(t){return 0===this.In.length?0:t-this.In[0].batchId}ws(t){const e=this._s(t);return e<0||e>=this.In.length?null:this.In[e]}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class bu{constructor(t,e){this.Ht=t,this.ps=e,this.docs=new go(xr.comparator),this.size=0}addEntry(t,e,n){const s=e.key,r=this.docs.get(s),i=r?r.size:0,o=this.ps(e);return this.docs=this.docs.insert(s,{document:e.clone(),size:o,readTime:n}),this.size+=o-i,this.Ht.addToCollectionParentIndex(t,s.path.popLast())}removeEntry(t){const e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)}getEntry(t,e){const n=this.docs.get(e);return qa.resolve(n?n.document.clone():Hr.newInvalidDocument(e))}getEntries(t,e){let n=bo();return e.forEach((t=>{const e=this.docs.get(t);n=n.insert(t,e?e.document.clone():Hr.newInvalidDocument(t))})),qa.resolve(n)}getDocumentsMatchingQuery(t,e,n){let s=bo();const r=new xr(e.path.child("")),i=this.docs.getIteratorFrom(r);for(;i.hasNext();){const{key:t,value:{document:r,readTime:o}}=i.getNext();if(!e.path.isPrefixOf(t.path))break;o.compareTo(n)<=0||Ai(e,r)&&(s=s.insert(r.key,r.clone()))}return qa.resolve(s)}Ts(t,e){return qa.forEach(this.docs,(t=>e(t)))}newChangeBuffer(t){return new Tu(this)}getSize(t){return qa.resolve(this.size)}}class Tu extends Bc{constructor(t){super(),this.Se=t}applyChanges(t){const e=[];return this.changes.forEach(((n,s)=>{s.document.isValidDocument()?e.push(this.Se.addEntry(t,s.document,this.getReadTime(n))):this.Se.removeEntry(n)})),qa.waitFor(e)}getFromCache(t,e){return this.Se.getEntry(t,e)}getAllFromCache(t,e){return this.Se.getEntries(t,e)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Eu{constructor(t){this.persistence=t,this.Es=new qc((t=>Wr(t)),Yr),this.lastRemoteSnapshotVersion=cr.min(),this.highestTargetId=0,this.Is=0,this.As=new yu,this.targetCount=0,this.Rs=Dc.se()}forEachTarget(t,e){return this.Es.forEach(((t,n)=>e(n))),qa.resolve()}getLastRemoteSnapshotVersion(t){return qa.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return qa.resolve(this.Is)}allocateTargetId(t){return this.highestTargetId=this.Rs.next(),qa.resolve(this.highestTargetId)}setTargetsMetadata(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.Is&&(this.Is=e),qa.resolve()}ce(t){this.Es.set(t.target,t);const e=t.targetId;e>this.highestTargetId&&(this.Rs=new Dc(e),this.highestTargetId=e),t.sequenceNumber>this.Is&&(this.Is=t.sequenceNumber)}addTargetData(t,e){return this.ce(e),this.targetCount+=1,qa.resolve()}updateTargetData(t,e){return this.ce(e),qa.resolve()}removeTargetData(t,e){return this.Es.delete(e.target),this.As.cs(e.targetId),this.targetCount-=1,qa.resolve()}removeTargets(t,e,n){let s=0;const r=[];return this.Es.forEach(((i,o)=>{o.sequenceNumber<=e&&null===n.get(o.targetId)&&(this.Es.delete(i),r.push(this.removeMatchingKeysForTargetId(t,o.targetId)),s++)})),qa.waitFor(r).next((()=>s))}getTargetCount(t){return qa.resolve(this.targetCount)}getTargetData(t,e){const n=this.Es.get(e)||null;return qa.resolve(n)}addMatchingKeys(t,e,n){return this.As.ss(e,n),qa.resolve()}removeMatchingKeys(t,e,n){this.As.os(e,n);const s=this.persistence.referenceDelegate,r=[];return s&&e.forEach((e=>{r.push(s.markPotentiallyOrphaned(t,e))})),qa.waitFor(r)}removeMatchingKeysForTargetId(t,e){return this.As.cs(e),qa.resolve()}getMatchingKeysForTargetId(t,e){const n=this.As.hs(e);return qa.resolve(n)}containsKey(t,e){return qa.resolve(this.As.containsKey(e))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Iu{constructor(t,e){this.bs={},this.Le=new er(0),this.Be=!1,this.Be=!0,this.referenceDelegate=t(this),this.ze=new Eu(this),this.Ht=new mc,this.He=function(t,e){return new bu(t,e)}(this.Ht,(t=>this.referenceDelegate.Ps(t))),this.N=new ec(e),this.Je=new pu(this.N)}start(){return Promise.resolve()}shutdown(){return this.Be=!1,Promise.resolve()}get started(){return this.Be}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(){return this.Ht}getMutationQueue(t){let e=this.bs[t.toKey()];return e||(e=new vu(this.Ht,this.referenceDelegate),this.bs[t.toKey()]=e),e}getTargetCache(){return this.ze}getRemoteDocumentCache(){return this.He}getBundleCache(){return this.Je}runTransaction(t,e,n){Vs("MemoryPersistence","Starting transaction:",t);const s=new Su(this.Le.next());return this.referenceDelegate.vs(),n(s).next((t=>this.referenceDelegate.Vs(s).next((()=>t)))).toPromise().then((t=>(s.raiseOnCommittedEvent(),t)))}Ss(t,e){return qa.or(Object.values(this.bs).map((n=>()=>n.containsKey(t,e))))}}class Su extends Ua{constructor(t){super(),this.currentSequenceNumber=t}}class _u{constructor(t){this.persistence=t,this.Ds=new yu,this.Cs=null}static Ns(t){return new _u(t)}get xs(){if(this.Cs)return this.Cs;throw js()}addReference(t,e,n){return this.Ds.addReference(n,e),this.xs.delete(n.toString()),qa.resolve()}removeReference(t,e,n){return this.Ds.removeReference(n,e),this.xs.add(n.toString()),qa.resolve()}markPotentiallyOrphaned(t,e){return this.xs.add(e.toString()),qa.resolve()}removeTarget(t,e){this.Ds.cs(e.targetId).forEach((t=>this.xs.add(t.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,e.targetId).next((t=>{t.forEach((t=>this.xs.add(t.toString())))})).next((()=>n.removeTargetData(t,e)))}vs(){this.Cs=new Set}Vs(t){const e=this.persistence.getRemoteDocumentCache().newChangeBuffer();return qa.forEach(this.xs,(n=>{const s=xr.fromPath(n);return this.ks(t,s).next((t=>{t||e.removeEntry(s)}))})).next((()=>(this.Cs=null,e.apply(t))))}updateLimboDocument(t,e){return this.ks(t,e).next((t=>{t?this.xs.delete(e.toString()):this.xs.add(e.toString())}))}Ps(t){return 0}ks(t,e){return qa.or([()=>qa.resolve(this.Ds.containsKey(e)),()=>this.persistence.getTargetCache().containsKey(t,e),()=>this.persistence.Ss(t,e)])}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Nu(t,e){return`firestore_clients_${t}_${e}`}function Au(t,e,n){let s=`firestore_mutations_${t}_${n}`;return e.isAuthenticated()&&(s+=`_${e.uid}`),s}function Du(t,e){return`firestore_targets_${t}_${e}`}class xu{constructor(t,e,n,s){this.user=t,this.batchId=e,this.state=n,this.error=s}static $s(t,e,n){const s=JSON.parse(n);let r,i="object"==typeof s&&-1!==["pending","acknowledged","rejected"].indexOf(s.state)&&(void 0===s.error||"object"==typeof s.error);return i&&s.error&&(i="string"==typeof s.error.message&&"string"==typeof s.error.code,i&&(r=new zs(s.error.code,s.error.message))),i?new xu(t,e,s.state,r):(Us("SharedClientState",`Failed to parse mutation state for ID '${e}': ${n}`),null)}Os(){const t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)}}class Cu{constructor(t,e,n){this.targetId=t,this.state=e,this.error=n}static $s(t,e){const n=JSON.parse(e);let s,r="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return r&&n.error&&(r="string"==typeof n.error.message&&"string"==typeof n.error.code,r&&(s=new zs(n.error.code,n.error.message))),r?new Cu(t,n.state,s):(Us("SharedClientState",`Failed to parse target state for ID '${t}': ${e}`),null)}Os(){const t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)}}class ku{constructor(t,e){this.clientId=t,this.activeTargetIds=e}static $s(t,e){const n=JSON.parse(e);let s="object"==typeof n&&n.activeTargetIds instanceof Array,r=Do();for(let t=0;s&&tthis.shutdown())),this.started=!0}writeSequenceNumber(t){this.setItem(this.Qs,JSON.stringify(t))}getAllActiveQueryTargets(){return this.ti(this.qs)}isActiveQueryTarget(t){let e=!1;return this.qs.forEach(((n,s)=>{s.activeTargetIds.has(t)&&(e=!0)})),e}addPendingMutation(t){this.ei(t,"pending")}updateMutationState(t,e,n){this.ei(t,e,n),this.ni(t)}addLocalQueryTarget(t){let e="not-current";if(this.isActiveQueryTarget(t)){const n=this.storage.getItem(Du(this.persistenceKey,t));if(n){const s=Cu.$s(t,n);s&&(e=s.state)}}return this.si.Fs(t),this.Ys(),e}removeLocalQueryTarget(t){this.si.Ms(t),this.Ys()}isLocalQueryTarget(t){return this.si.activeTargetIds.has(t)}clearQueryState(t){this.removeItem(Du(this.persistenceKey,t))}updateQueryState(t,e,n){this.ii(t,e,n)}handleUserChange(t,e,n){e.forEach((t=>{this.ni(t)})),this.currentUser=t,n.forEach((t=>{this.addPendingMutation(t)}))}setOnlineState(t){this.ri(t)}notifyBundleLoaded(){this.oi()}shutdown(){this.started&&(this.window.removeEventListener("storage",this.Bs),this.removeItem(this.js),this.started=!1)}getItem(t){const e=this.storage.getItem(t);return Vs("SharedClientState","READ",t,e),e}setItem(t,e){Vs("SharedClientState","SET",t,e),this.storage.setItem(t,e)}removeItem(t){Vs("SharedClientState","REMOVE",t),this.storage.removeItem(t)}Us(t){const e=t;if(e.storageArea===this.storage){if(Vs("SharedClientState","EVENT",e.key,e.newValue),e.key===this.js)return void Us("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Oe.enqueueRetryable((async()=>{if(this.started){if(null!==e.key)if(this.Ws.test(e.key)){if(null==e.newValue){const t=this.ci(e.key);return this.ai(t,null)}{const t=this.ui(e.key,e.newValue);if(t)return this.ai(t.clientId,t)}}else if(this.Gs.test(e.key)){if(null!==e.newValue){const t=this.hi(e.key,e.newValue);if(t)return this.li(t)}}else if(this.zs.test(e.key)){if(null!==e.newValue){const t=this.fi(e.key,e.newValue);if(t)return this.di(t)}}else if(e.key===this.Hs){if(null!==e.newValue){const t=this.Xs(e.newValue);if(t)return this.Zs(t)}}else if(e.key===this.Qs){const t=function(t){let e=er.T;if(null!=t)try{const n=JSON.parse(t);Ks("number"==typeof n),e=n}catch(t){Us("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(e.newValue);t!==er.T&&this.sequenceNumberHandler(t)}else if(e.key===this.Js)return this.syncEngine.wi()}else this.Ks.push(e)}))}}get si(){return this.qs.get(this.Ls)}Ys(){this.setItem(this.js,this.si.Os())}ei(t,e,n){const s=new xu(this.currentUser,t,e,n),r=Au(this.persistenceKey,this.currentUser,t);this.setItem(r,s.Os())}ni(t){const e=Au(this.persistenceKey,this.currentUser,t);this.removeItem(e)}ri(t){const e={clientId:this.Ls,onlineState:t};this.storage.setItem(this.Hs,JSON.stringify(e))}ii(t,e,n){const s=Du(this.persistenceKey,t),r=new Cu(t,e,n);this.setItem(s,r.Os())}oi(){this.setItem(this.Js,"value-not-used")}ci(t){const e=this.Ws.exec(t);return e?e[1]:null}ui(t,e){const n=this.ci(t);return ku.$s(n,e)}hi(t,e){const n=this.Gs.exec(t),s=Number(n[1]),r=void 0!==n[2]?n[2]:null;return xu.$s(new Ls(r),s,e)}fi(t,e){const n=this.zs.exec(t),s=Number(n[1]);return Cu.$s(s,e)}Xs(t){return Ru.$s(t)}async li(t){if(t.user.uid===this.currentUser.uid)return this.syncEngine._i(t.batchId,t.state,t.error);Vs("SharedClientState",`Ignoring mutation for non-active user ${t.user.uid}`)}di(t){return this.syncEngine.mi(t.targetId,t.state,t.error)}ai(t,e){const n=e?this.qs.insert(t,e):this.qs.remove(t),s=this.ti(this.qs),r=this.ti(n),i=[],o=[];return r.forEach((t=>{s.has(t)||i.push(t)})),s.forEach((t=>{r.has(t)||o.push(t)})),this.syncEngine.gi(i,o).then((()=>{this.qs=n}))}Zs(t){this.qs.get(t.clientId)&&this.onlineStateHandler(t.onlineState)}ti(t){let e=Do();return t.forEach(((t,n)=>{e=e.unionWith(n.activeTargetIds)})),e}}class Mu{constructor(){this.yi=new Lu,this.pi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,e,n){}addLocalQueryTarget(t){return this.yi.Fs(t),this.pi[t]||"not-current"}updateQueryState(t,e,n){this.pi[t]=e}removeLocalQueryTarget(t){this.yi.Ms(t)}isLocalQueryTarget(t){return this.yi.activeTargetIds.has(t)}clearQueryState(t){delete this.pi[t]}getAllActiveQueryTargets(){return this.yi.activeTargetIds}isActiveQueryTarget(t){return this.yi.activeTargetIds.has(t)}start(){return this.yi=new Lu,Promise.resolve()}handleUserChange(t,e,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Fu{Ti(t){}shutdown(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Pu{constructor(){this.Ei=()=>this.Ii(),this.Ai=()=>this.Ri(),this.bi=[],this.Pi()}Ti(t){this.bi.push(t)}shutdown(){window.removeEventListener("online",this.Ei),window.removeEventListener("offline",this.Ai)}Pi(){window.addEventListener("online",this.Ei),window.addEventListener("offline",this.Ai)}Ii(){Vs("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const t of this.bi)t(0)}Ri(){Vs("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const t of this.bi)t(1)}static bt(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vu={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Uu{constructor(t){this.vi=t.vi,this.Vi=t.Vi}Si(t){this.Di=t}Ci(t){this.Ni=t}onMessage(t){this.xi=t}close(){this.Vi()}send(t){this.vi(t)}ki(){this.Di()}$i(t){this.Ni(t)}Oi(t){this.xi(t)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qu extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const e=t.ssl?"https":"http";this.Fi=e+"://"+t.host,this.Mi="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}Li(t,e,n,s){const r=this.Bi(t,e);Vs("RestConnection","Sending: ",r,n);const i={};return this.Ui(i,s),this.qi(t,r,i,n).then((t=>(Vs("RestConnection","Received: ",t),t)),(e=>{throw qs("RestConnection",`${t} failed with error: `,e,"url: ",r,"request:",n),e}))}Ki(t,e,n,s){return this.Li(t,e,n,s)}Ui(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/"+Os,t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e)for(const n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n])}Bi(t,e){const n=Vu[t];return`${this.Fi}/v1/${e}:${n}`}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams}qi(t,e,n,s){return new Promise(((r,i)=>{const o=new ks;o.listenOnce(_s.COMPLETE,(()=>{try{switch(o.getLastErrorCode()){case Ss.NO_ERROR:const e=o.getResponseJson();Vs("Connection","XHR received:",JSON.stringify(e)),r(e);break;case Ss.TIMEOUT:Vs("Connection",'RPC "'+t+'" timed out'),i(new zs(Hs.DEADLINE_EXCEEDED,"Request time out"));break;case Ss.HTTP_ERROR:const n=o.getStatus();if(Vs("Connection",'RPC "'+t+'" failed with status:',n,"response text:",o.getResponseText()),n>0){const t=o.getResponseJson().error;if(t&&t.status&&t.message){const e=function(t){const e=t.toLowerCase().replace(/_/g,"-");return Object.values(Hs).indexOf(e)>=0?e:Hs.UNKNOWN}(t.status);i(new zs(e,t.message))}else i(new zs(Hs.UNKNOWN,"Server responded with status "+o.getStatus()))}else i(new zs(Hs.UNAVAILABLE,"Connection failed."));break;default:js()}}finally{Vs("Connection",'RPC "'+t+'" completed.')}}));const a=JSON.stringify(s);o.send(e,"POST",a,n,15)}))}ji(t,e){const n=[this.Fi,"/","google.firestore.v1.Firestore","/",t,"/channel"],s=new vs,r=de(),i={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(i.xmlHttpFactory=new xs({})),this.Ui(i.initMessageHeaders,e),"undefined"!=typeof window&&(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(h())||"object"==typeof navigator&&"ReactNative"===navigator.product||h().indexOf("Electron/")>=0||function(){const t=h();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()||h().indexOf("MSAppHost/")>=0||function(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}()||(i.httpHeadersOverwriteParam="$httpHeaders");const o=n.join("");Vs("Connection","Creating WebChannel: "+o,i);const a=s.createWebChannel(o,i);let c=!1,u=!1;const l=new Uu({vi:t=>{u?Vs("Connection","Not sending because WebChannel is closed:",t):(c||(Vs("Connection","Opening WebChannel transport."),a.open(),c=!0),Vs("Connection","WebChannel sending:",t),a.send(t))},Vi:()=>a.close()}),d=(t,e,n)=>{t.listen(e,(t=>{try{n(t)}catch(t){setTimeout((()=>{throw t}),0)}}))};return d(a,Cs.EventType.OPEN,(()=>{u||Vs("Connection","WebChannel transport opened.")})),d(a,Cs.EventType.CLOSE,(()=>{u||(u=!0,Vs("Connection","WebChannel transport closed"),l.$i())})),d(a,Cs.EventType.ERROR,(t=>{u||(u=!0,qs("Connection","WebChannel transport errored:",t),l.$i(new zs(Hs.UNAVAILABLE,"The operation could not be completed")))})),d(a,Cs.EventType.MESSAGE,(t=>{var e;if(!u){const n=t.data[0];Ks(!!n);const s=n,r=s.error||(null===(e=s[0])||void 0===e?void 0:e.error);if(r){Vs("Connection","WebChannel received error:",r);const t=r.status;let e=function(t){const e=uo[t];if(void 0!==e)return fo(e)}(t),n=r.message;void 0===e&&(e=Hs.INTERNAL,n="Unknown error status: "+t+" with message "+r.message),u=!0,l.$i(new zs(e,n)),a.close()}else Vs("Connection","WebChannel received:",n),l.Oi(n)}})),d(r,Ns.STAT_EVENT,(t=>{t.stat===As?Vs("Connection","Detected buffering proxy"):t.stat===Ds&&Vs("Connection","Detected no buffering proxy")})),setTimeout((()=>{l.ki()}),0),l}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Bu(){return"undefined"!=typeof window?window:null}function ju(){return"undefined"!=typeof document?document:null} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ku(t){return new qo(t,!0)}class $u{constructor(t,e,n=1e3,s=1.5,r=6e4){this.Oe=t,this.timerId=e,this.Qi=n,this.Wi=s,this.Gi=r,this.zi=0,this.Hi=null,this.Ji=Date.now(),this.reset()}reset(){this.zi=0}Yi(){this.zi=this.Gi}Xi(t){this.cancel();const e=Math.floor(this.zi+this.Zi()),n=Math.max(0,Date.now()-this.Ji),s=Math.max(0,e-n);s>0&&Vs("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.zi} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),this.Hi=this.Oe.enqueueAfterDelay(this.timerId,s,(()=>(this.Ji=Date.now(),t()))),this.zi*=this.Wi,this.zithis.Gi&&(this.zi=this.Gi)}tr(){null!==this.Hi&&(this.Hi.skipDelay(),this.Hi=null)}cancel(){null!==this.Hi&&(this.Hi.cancel(),this.Hi=null)}Zi(){return(Math.random()-.5)*this.zi}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gu{constructor(t,e,n,s,r,i,o){this.Oe=t,this.er=n,this.nr=s,this.sr=r,this.credentialsProvider=i,this.listener=o,this.state=0,this.ir=0,this.rr=null,this.cr=null,this.stream=null,this.ar=new $u(t,e)}ur(){return 1===this.state||5===this.state||this.hr()}hr(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.lr()}async stop(){this.ur()&&await this.close(0)}dr(){this.state=0,this.ar.reset()}wr(){this.hr()&&null===this.rr&&(this.rr=this.Oe.enqueueAfterDelay(this.er,6e4,(()=>this._r())))}mr(t){this.gr(),this.stream.send(t)}async _r(){if(this.hr())return this.close(0)}gr(){this.rr&&(this.rr.cancel(),this.rr=null)}yr(){this.cr&&(this.cr.cancel(),this.cr=null)}async close(t,e){this.gr(),this.yr(),this.ar.cancel(),this.ir++,4!==t?this.ar.reset():e&&e.code===Hs.RESOURCE_EXHAUSTED?(Us(e.toString()),Us("Using maximum backoff delay to prevent overloading the backend."),this.ar.Yi()):e&&e.code===Hs.UNAUTHENTICATED&&3!==this.state&&this.credentialsProvider.invalidateToken(),null!==this.stream&&(this.pr(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Ci(e)}pr(){}auth(){this.state=1;const t=this.Tr(this.ir),e=this.ir;this.credentialsProvider.getToken().then((t=>{this.ir===e&&this.Er(t)}),(e=>{t((()=>{const t=new zs(Hs.UNKNOWN,"Fetching auth token failed: "+e.message);return this.Ir(t)}))}))}Er(t){const e=this.Tr(this.ir);this.stream=this.Ar(t),this.stream.Si((()=>{e((()=>(this.state=2,this.cr=this.Oe.enqueueAfterDelay(this.nr,1e4,(()=>(this.hr()&&(this.state=3),Promise.resolve()))),this.listener.Si())))})),this.stream.Ci((t=>{e((()=>this.Ir(t)))})),this.stream.onMessage((t=>{e((()=>this.onMessage(t)))}))}lr(){this.state=5,this.ar.Xi((async()=>{this.state=0,this.start()}))}Ir(t){return Vs("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}Tr(t){return e=>{this.Oe.enqueueAndForget((()=>this.ir===t?e():(Vs("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Hu extends Gu{constructor(t,e,n,s,r){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",e,n,r),this.N=s}Ar(t){return this.sr.ji("Listen",t)}onMessage(t){this.ar.reset();const e=function(t,e){let n;if("targetChange"in e){e.targetChange;const s=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:js()}(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],i=function(t,e){return t.D?(Ks(void 0===e||"string"==typeof e),wr.fromBase64String(e||"")):(Ks(void 0===e||e instanceof Uint8Array),wr.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(t){const e=void 0===t.code?Hs.UNKNOWN:fo(t.code);return new zs(e,t.message||"")}(o);n=new Lo(s,r,i,a||null)}else if("documentChange"in e){e.documentChange;const s=e.documentChange;s.document,s.document.name,s.document.updateTime;const r=Qo(t,s.document.name),i=$o(s.document.updateTime),o=new $r({mapValue:{fields:s.document.fields}}),a=Hr.newFoundDocument(r,i,o),c=s.targetIds||[],u=s.removedTargetIds||[];n=new ko(c,u,a.key,a)}else if("documentDelete"in e){e.documentDelete;const s=e.documentDelete;s.document;const r=Qo(t,s.document),i=s.readTime?$o(s.readTime):cr.min(),o=Hr.newNoDocument(r,i),a=s.removedTargetIds||[];n=new ko([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const s=e.documentRemove;s.document;const r=Qo(t,s.document),i=s.removedTargetIds||[];n=new ko([],i,r,null)}else{if(!("filter"in e))return js();{e.filter;const t=e.filter;t.targetId;const s=t.count||0,r=new co(s),i=t.targetId;n=new Ro(i,r)}}return n}(this.N,t),n=function(t){if(!("targetChange"in t))return cr.min();const e=t.targetChange;return e.targetIds&&e.targetIds.length?cr.min():e.readTime?$o(e.readTime):cr.min()}(t);return this.listener.Rr(e,n)}br(t){const e={};e.database=Xo(this.N),e.addTarget=function(t,e){let n;const s=e.target;return n=Xr(s)?{documents:sa(t,s)}:{query:ra(t,s)},n.targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=jo(t,e.resumeToken):e.snapshotVersion.compareTo(cr.min())>0&&(n.readTime=Bo(t,e.snapshotVersion.toTimestamp())),n}(this.N,t);const n=function(t,e){const n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return js()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.N,t);n&&(e.labels=n),this.mr(e)}Pr(t){const e={};e.database=Xo(this.N),e.removeTarget=t,this.mr(e)}}class zu extends Gu{constructor(t,e,n,s,r){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",e,n,r),this.N=s,this.vr=!1}get Vr(){return this.vr}start(){this.vr=!1,this.lastStreamToken=void 0,super.start()}pr(){this.vr&&this.Sr([])}Ar(t){return this.sr.ji("Write",t)}onMessage(t){if(Ks(!!t.streamToken),this.lastStreamToken=t.streamToken,this.vr){this.ar.reset();const e=function(t,e){return t&&t.length>0?(Ks(void 0!==e),t.map((t=>function(t,e){let n=t.updateTime?$o(t.updateTime):$o(e);return n.isEqual(cr.min())&&(n=$o(e)),new Hi(n,t.transformResults||[])}(t,e)))):[]}(t.writeResults,t.commitTime),n=$o(t.commitTime);return this.listener.Dr(n,e)}return Ks(!t.writeResults||0===t.writeResults.length),this.vr=!0,this.listener.Cr()}Nr(){const t={};t.database=Xo(this.N),this.mr(t)}Sr(t){const e={streamToken:this.lastStreamToken,writes:t.map((t=>ea(this.N,t)))};this.mr(e)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qu extends class{}{constructor(t,e,n){super(),this.credentials=t,this.sr=e,this.N=n,this.kr=!1}$r(){if(this.kr)throw new zs(Hs.FAILED_PRECONDITION,"The client has already been terminated.")}Li(t,e,n){return this.$r(),this.credentials.getToken().then((s=>this.sr.Li(t,e,n,s))).catch((t=>{throw"FirebaseError"===t.name?(t.code===Hs.UNAUTHENTICATED&&this.credentials.invalidateToken(),t):new zs(Hs.UNKNOWN,t.toString())}))}Ki(t,e,n){return this.$r(),this.credentials.getToken().then((s=>this.sr.Ki(t,e,n,s))).catch((t=>{throw"FirebaseError"===t.name?(t.code===Hs.UNAUTHENTICATED&&this.credentials.invalidateToken(),t):new zs(Hs.UNKNOWN,t.toString())}))}terminate(){this.kr=!0}}class Wu{constructor(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.Or=0,this.Fr=null,this.Mr=!0}Lr(){0===this.Or&&(this.Br("Unknown"),this.Fr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.Fr=null,this.Ur("Backend didn't respond within 10 seconds."),this.Br("Offline"),Promise.resolve()))))}qr(t){"Online"===this.state?this.Br("Unknown"):(this.Or++,this.Or>=1&&(this.Kr(),this.Ur(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.Br("Offline")))}set(t){this.Kr(),this.Or=0,"Online"===t&&(this.Mr=!1),this.Br(t)}Br(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}Ur(t){const e=`Could not reach Cloud Firestore backend. ${t}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.Mr?(Us(e),this.Mr=!1):Vs("OnlineStateTracker",e)}Kr(){null!==this.Fr&&(this.Fr.cancel(),this.Fr=null)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Yu{constructor(t,e,n,s,r){this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.jr=[],this.Qr=new Map,this.Wr=new Set,this.Gr=[],this.zr=r,this.zr.Ti((t=>{n.enqueueAndForget((async()=>{ih(this)&&(Vs("RemoteStore","Restarting streams for network reachability change."),await async function(t){const e=Gs(t);e.Wr.add(4),await Ju(e),e.Hr.set("Unknown"),e.Wr.delete(4),await Xu(e)}(this))}))})),this.Hr=new Wu(n,s)}}async function Xu(t){if(ih(t))for(const e of t.Gr)await e(!0)}async function Ju(t){for(const e of t.Gr)await e(!1)}function Zu(t,e){const n=Gs(t);n.Qr.has(e.targetId)||(n.Qr.set(e.targetId,e),rh(n)?sh(n):Eh(n).hr()&&eh(n,e))}function th(t,e){const n=Gs(t),s=Eh(n);n.Qr.delete(e),s.hr()&&nh(n,e),0===n.Qr.size&&(s.hr()?s.wr():ih(n)&&n.Hr.set("Unknown"))}function eh(t,e){t.Jr.Y(e.targetId),Eh(t).br(e)}function nh(t,e){t.Jr.Y(e),Eh(t).Pr(e)}function sh(t){t.Jr=new Mo({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Tt:e=>t.Qr.get(e)||null}),Eh(t).start(),t.Hr.Lr()}function rh(t){return ih(t)&&!Eh(t).ur()&&t.Qr.size>0}function ih(t){return 0===Gs(t).Wr.size}function oh(t){t.Jr=void 0}async function ah(t){t.Qr.forEach(((e,n)=>{eh(t,e)}))}async function ch(t,e){oh(t),rh(t)?(t.Hr.qr(e),sh(t)):t.Hr.set("Unknown")}async function uh(t,e,n){if(t.Hr.set("Online"),e instanceof Lo&&2===e.state&&e.cause)try{await async function(t,e){const n=e.cause;for(const s of e.targetIds)t.Qr.has(s)&&(await t.remoteSyncer.rejectListen(s,n),t.Qr.delete(s),t.Jr.removeTarget(s))}(t,e)}catch(n){Vs("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),await hh(t,n)}else if(e instanceof ko?t.Jr.rt(e):e instanceof Ro?t.Jr.ft(e):t.Jr.at(e),!n.isEqual(cr.min()))try{const e=await au(t.localStore);n.compareTo(e)>=0&&await function(t,e){const n=t.Jr._t(e);return n.targetChanges.forEach(((n,s)=>{if(n.resumeToken.approximateByteSize()>0){const r=t.Qr.get(s);r&&t.Qr.set(s,r.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((e=>{const n=t.Qr.get(e);if(!n)return;t.Qr.set(e,n.withResumeToken(wr.EMPTY_BYTE_STRING,n.snapshotVersion)),nh(t,e);const s=new tc(n.target,e,1,n.sequenceNumber);eh(t,s)})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)}catch(e){Vs("RemoteStore","Failed to raise snapshot:",e),await hh(t,e)}}async function hh(t,e,n){if(!Ga(e))throw e;t.Wr.add(1),await Ju(t),t.Hr.set("Offline"),n||(n=()=>au(t.localStore)),t.asyncQueue.enqueueRetryable((async()=>{Vs("RemoteStore","Retrying IndexedDB access"),await n(),t.Wr.delete(1),await Xu(t)}))}function lh(t,e){return e().catch((n=>hh(t,n,e)))}async function dh(t){const e=Gs(t),n=Ih(e);let s=e.jr.length>0?e.jr[e.jr.length-1].batchId:-1;for(;fh(e);)try{const t=await uu(e.localStore,s);if(null===t){0===e.jr.length&&n.wr();break}s=t.batchId,gh(e,t)}catch(t){await hh(e,t)}mh(e)&&ph(e)}function fh(t){return ih(t)&&t.jr.length<10}function gh(t,e){t.jr.push(e);const n=Ih(t);n.hr()&&n.Vr&&n.Sr(e.mutations)}function mh(t){return ih(t)&&!Ih(t).ur()&&t.jr.length>0}function ph(t){Ih(t).start()}async function yh(t){Ih(t).Nr()}async function wh(t){const e=Ih(t);for(const n of t.jr)e.Sr(n.mutations)}async function vh(t,e,n){const s=t.jr.shift(),r=Za.from(s,e,n);await lh(t,(()=>t.remoteSyncer.applySuccessfulWrite(r))),await dh(t)}async function bh(t,e){e&&Ih(t).Vr&&await async function(t,e){if(lo(n=e.code)&&n!==Hs.ABORTED){const n=t.jr.shift();Ih(t).dr(),await lh(t,(()=>t.remoteSyncer.rejectFailedWrite(n.batchId,e))),await dh(t)}var n}(t,e),mh(t)&&ph(t)}async function Th(t,e){const n=Gs(t);e?(n.Wr.delete(2),await Xu(n)):e||(n.Wr.add(2),await Ju(n),n.Hr.set("Unknown"))}function Eh(t){return t.Yr||(t.Yr=function(t,e,n){const s=Gs(t);return s.$r(),new Hu(e,s.sr,s.credentials,s.N,n)}(t.datastore,t.asyncQueue,{Si:ah.bind(null,t),Ci:ch.bind(null,t),Rr:uh.bind(null,t)}),t.Gr.push((async e=>{e?(t.Yr.dr(),rh(t)?sh(t):t.Hr.set("Unknown")):(await t.Yr.stop(),oh(t))}))),t.Yr}function Ih(t){return t.Xr||(t.Xr=function(t,e,n){const s=Gs(t);return s.$r(),new zu(e,s.sr,s.credentials,s.N,n)}(t.datastore,t.asyncQueue,{Si:yh.bind(null,t),Ci:bh.bind(null,t),Cr:wh.bind(null,t),Dr:vh.bind(null,t)}),t.Gr.push((async e=>{e?(t.Xr.dr(),await dh(t)):(await t.Xr.stop(),t.jr.length>0&&(Vs("RemoteStore",`Stopping write stream with ${t.jr.length} pending writes`),t.jr=[]))}))),t.Xr +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class Sh{constructor(t,e,n,s,r){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=s,this.removalCallback=r,this.deferred=new Qs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((t=>{}))}static createAndSchedule(t,e,n,s,r){const i=Date.now()+n,o=new Sh(t,e,i,s,r);return o.start(n),o}start(t){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new zs(Hs.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then((t=>this.deferred.resolve(t)))):Promise.resolve()))}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function _h(t,e){if(Us("AsyncQueue",`${e}: ${t}`),Ga(t))return new zs(Hs.UNAVAILABLE,`${e}: ${t}`);throw t} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Nh{constructor(t){this.comparator=t?(e,n)=>t(e,n)||xr.comparator(e.key,n.key):(t,e)=>xr.comparator(t.key,e.key),this.keyedMap=Eo(),this.sortedSet=new go(this.comparator)}static emptySet(t){return new Nh(t.comparator)}has(t){return null!=this.keyedMap.get(t)}get(t){return this.keyedMap.get(t)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(t){const e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1}get size(){return this.sortedSet.size}forEach(t){this.sortedSet.inorderTraversal(((e,n)=>(t(e),!1)))}add(t){const e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))}delete(t){const e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this}isEqual(t){if(!(t instanceof Nh))return!1;if(this.size!==t.size)return!1;const e=this.sortedSet.getIterator(),n=t.sortedSet.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(!t.isEqual(s))return!1}return!0}toString(){const t=[];return this.forEach((e=>{t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"}copy(t,e){const n=new Nh;return n.comparator=this.comparator,n.keyedMap=t,n.sortedSet=e,n}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ah{constructor(){this.Zr=new go(xr.comparator)}track(t){const e=t.doc.key,n=this.Zr.get(e);n?0!==t.type&&3===n.type?this.Zr=this.Zr.insert(e,t):3===t.type&&1!==n.type?this.Zr=this.Zr.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Zr=this.Zr.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Zr=this.Zr.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Zr=this.Zr.remove(e):1===t.type&&2===n.type?this.Zr=this.Zr.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Zr=this.Zr.insert(e,{type:2,doc:t.doc}):js():this.Zr=this.Zr.insert(e,t)}eo(){const t=[];return this.Zr.inorderTraversal(((e,n)=>{t.push(n)})),t}}class Dh{constructor(t,e,n,s,r,i,o,a){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=s,this.mutatedKeys=r,this.fromCache=i,this.syncStateChanged=o,this.excludesMetadataChanges=a}static fromInitialDocuments(t,e,n,s){const r=[];return e.forEach((t=>{r.push({type:0,doc:t})})),new Dh(t,e,Nh.emptySet(e),r,n,s,!0,!1)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&Si(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;const e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(let t=0;t_i(t)),Si),this.onlineState="Unknown",this.so=new Set}}async function kh(t,e){const n=Gs(t),s=e.query;let r=!1,i=n.queries.get(s);if(i||(r=!0,i=new xh),r)try{i.no=await n.onListen(s)}catch(t){const n=_h(t,`Initialization of query '${Ni(e.query)}' failed`);return void e.onError(n)}n.queries.set(s,i),i.listeners.push(e),e.io(n.onlineState),i.no&&e.ro(i.no)&&Mh(n)}async function Rh(t,e){const n=Gs(t),s=e.query;let r=!1;const i=n.queries.get(s);if(i){const t=i.listeners.indexOf(e);t>=0&&(i.listeners.splice(t,1),r=0===i.listeners.length)}if(r)return n.queries.delete(s),n.onUnlisten(s)}function Lh(t,e){const n=Gs(t);let s=!1;for(const t of e){const e=t.query,r=n.queries.get(e);if(r){for(const e of r.listeners)e.ro(t)&&(s=!0);r.no=t}}s&&Mh(n)}function Oh(t,e,n){const s=Gs(t),r=s.queries.get(e);if(r)for(const t of r.listeners)t.onError(n);s.queries.delete(e)}function Mh(t){t.so.forEach((t=>{t.next()}))}class Fh{constructor(t,e,n){this.query=t,this.oo=e,this.co=!1,this.ao=null,this.onlineState="Unknown",this.options=n||{}}ro(t){if(!this.options.includeMetadataChanges){const e=[];for(const n of t.docChanges)3!==n.type&&e.push(n);t=new Dh(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}let e=!1;return this.co?this.uo(t)&&(this.oo.next(t),e=!0):this.ho(t,this.onlineState)&&(this.lo(t),e=!0),this.ao=t,e}onError(t){this.oo.error(t)}io(t){this.onlineState=t;let e=!1;return this.ao&&!this.co&&this.ho(this.ao,t)&&(this.lo(this.ao),e=!0),e}ho(t,e){if(!t.fromCache)return!0;const n="Offline"!==e;return!(this.options.fo&&n||t.docs.isEmpty()&&"Offline"!==e)}uo(t){if(t.docChanges.length>0)return!0;const e=this.ao&&this.ao.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges}lo(t){t=Dh.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.co=!0,this.oo.next(t)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ph{constructor(t,e){this.payload=t,this.byteLength=e}wo(){return"metadata"in this.payload}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Vh{constructor(t){this.N=t}zn(t){return Qo(this.N,t)}Hn(t){return t.metadata.exists?ta(this.N,t.document,!1):Hr.newNoDocument(this.zn(t.metadata.name),this.Jn(t.metadata.readTime))}Jn(t){return $o(t)}}class Uh{constructor(t,e,n){this._o=t,this.localStore=e,this.N=n,this.queries=[],this.documents=[],this.progress=qh(t)}mo(t){this.progress.bytesLoaded+=t.byteLength;let e=this.progress.documentsLoaded;return t.payload.namedQuery?this.queries.push(t.payload.namedQuery):t.payload.documentMetadata?(this.documents.push({metadata:t.payload.documentMetadata}),t.payload.documentMetadata.exists||++e):t.payload.document&&(this.documents[this.documents.length-1].document=t.payload.document,++e),e!==this.progress.documentsLoaded?(this.progress.documentsLoaded=e,Object.assign({},this.progress)):null}yo(t){const e=new Map,n=new Vh(this.N);for(const s of t)if(s.metadata.queries){const t=n.zn(s.metadata.name);for(const n of s.metadata.queries){const s=(e.get(n)||No()).add(t);e.set(n,s)}}return e}async complete(){const t=await async function(t,e,n,s){const r=Gs(t);let i=No(),o=bo(),a=So();for(const t of n){const n=e.zn(t.metadata.name);t.document&&(i=i.add(n)),o=o.insert(n,e.Hn(t)),a=a.insert(n,e.Jn(t.metadata.readTime))}const c=r.jn.newChangeBuffer({trackRemovals:!0}),u=await hu(r,function(t){return Ei(mi(fr.fromString(`__bundle__/docs/${t}`)))}(s));return r.persistence.runTransaction("Apply bundle documents","readwrite",(t=>cu(t,c,o,cr.min(),a).next((e=>(c.apply(t),e))).next((e=>r.ze.removeMatchingKeysForTargetId(t,u.targetId).next((()=>r.ze.addMatchingKeys(t,i,u.targetId))).next((()=>r.Qn.vn(t,e))).next((()=>e))))))}(this.localStore,new Vh(this.N),this.documents,this._o.id),e=this.yo(this.documents);for(const t of this.queries)await mu(this.localStore,t,e.get(t.name));return this.progress.taskState="Success",new tu(Object.assign({},this.progress),t)}}function qh(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Bh{constructor(t){this.key=t}}class jh{constructor(t){this.key=t}}class Kh{constructor(t,e){this.query=t,this.po=e,this.To=null,this.current=!1,this.Eo=No(),this.mutatedKeys=No(),this.Io=Di(t),this.Ao=new Nh(this.Io)}get Ro(){return this.po}bo(t,e){const n=e?e.Po:new Ah,s=e?e.Ao:this.Ao;let r=e?e.mutatedKeys:this.mutatedKeys,i=s,o=!1;const a=pi(this.query)&&s.size===this.query.limit?s.last():null,c=yi(this.query)&&s.size===this.query.limit?s.first():null;if(t.inorderTraversal(((t,e)=>{const u=s.get(t),h=Ai(this.query,e)?e:null,l=!!u&&this.mutatedKeys.has(u.key),d=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations);let f=!1;u&&h?u.data.isEqual(h.data)?l!==d&&(n.track({type:3,doc:h}),f=!0):this.vo(u,h)||(n.track({type:2,doc:h}),f=!0,(a&&this.Io(h,a)>0||c&&this.Io(h,c)<0)&&(o=!0)):!u&&h?(n.track({type:0,doc:h}),f=!0):u&&!h&&(n.track({type:1,doc:u}),f=!0,(a||c)&&(o=!0)),f&&(h?(i=i.add(h),r=d?r.add(t):r.delete(t)):(i=i.delete(t),r=r.delete(t)))})),pi(this.query)||yi(this.query))for(;i.size>this.query.limit;){const t=pi(this.query)?i.last():i.first();i=i.delete(t.key),r=r.delete(t.key),n.track({type:1,doc:t})}return{Ao:i,Po:n,Ln:o,mutatedKeys:r}}vo(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations}applyChanges(t,e,n){const s=this.Ao;this.Ao=t.Ao,this.mutatedKeys=t.mutatedKeys;const r=t.Po.eo();r.sort(((t,e)=>function(t,e){const n=t=>{switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return js()}};return n(t)-n(e)}(t.type,e.type)||this.Io(t.doc,e.doc))),this.Vo(n);const i=e?this.So():[],o=0===this.Eo.size&&this.current?1:0,a=o!==this.To;return this.To=o,0!==r.length||a?{snapshot:new Dh(this.query,t.Ao,s,r,t.mutatedKeys,0===o,a,!1),Do:i}:{Do:i}}io(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({Ao:this.Ao,Po:new Ah,mutatedKeys:this.mutatedKeys,Ln:!1},!1)):{Do:[]}}Co(t){return!this.po.has(t)&&!!this.Ao.has(t)&&!this.Ao.get(t).hasLocalMutations}Vo(t){t&&(t.addedDocuments.forEach((t=>this.po=this.po.add(t))),t.modifiedDocuments.forEach((t=>{})),t.removedDocuments.forEach((t=>this.po=this.po.delete(t))),this.current=t.current)}So(){if(!this.current)return[];const t=this.Eo;this.Eo=No(),this.Ao.forEach((t=>{this.Co(t.key)&&(this.Eo=this.Eo.add(t.key))}));const e=[];return t.forEach((t=>{this.Eo.has(t)||e.push(new jh(t))})),this.Eo.forEach((n=>{t.has(n)||e.push(new Bh(n))})),e}No(t){this.po=t.Gn,this.Eo=No();const e=this.bo(t.documents);return this.applyChanges(e,!0)}xo(){return Dh.fromInitialDocuments(this.query,this.Ao,this.mutatedKeys,0===this.To)}}class $h{constructor(t,e,n){this.query=t,this.targetId=e,this.view=n}}class Gh{constructor(t){this.key=t,this.ko=!1}}class Hh{constructor(t,e,n,s,r,i){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=s,this.currentUser=r,this.maxConcurrentLimboResolutions=i,this.$o={},this.Oo=new qc((t=>_i(t)),Si),this.Fo=new Map,this.Mo=new Set,this.Lo=new go(xr.comparator),this.Bo=new Map,this.Uo=new yu,this.qo={},this.Ko=new Map,this.jo=Dc.ie(),this.onlineState="Unknown",this.Qo=void 0}get isPrimaryClient(){return!0===this.Qo}}async function zh(t,e){const n=vl(t);let s,r;const i=n.Oo.get(e);if(i)s=i.targetId,n.sharedClientState.addLocalQueryTarget(s),r=i.view.xo();else{const t=await hu(n.localStore,Ei(e)),i=n.sharedClientState.addLocalQueryTarget(t.targetId);s=t.targetId,r=await Qh(n,e,s,"current"===i),n.isPrimaryClient&&Zu(n.remoteStore,t)}return r}async function Qh(t,e,n,s){t.Wo=(e,n,s)=>async function(t,e,n,s){let r=e.view.bo(n);r.Ln&&(r=await du(t.localStore,e.query,!1).then((({documents:t})=>e.view.bo(t,r))));const i=s&&s.targetChanges.get(e.targetId),o=e.view.applyChanges(r,t.isPrimaryClient,i);return il(t,e.targetId,o.Do),o.snapshot}(t,e,n,s);const r=await du(t.localStore,e,!0),i=new Kh(e,r.Gn),o=i.bo(r.documents),a=Co.createSynthesizedTargetChangeForCurrentChange(n,s&&"Offline"!==t.onlineState),c=i.applyChanges(o,t.isPrimaryClient,a);il(t,n,c.Do);const u=new $h(e,n,i);return t.Oo.set(e,u),t.Fo.has(n)?t.Fo.get(n).push(e):t.Fo.set(n,[e]),c.snapshot}async function Wh(t,e){const n=Gs(t),s=n.Oo.get(e),r=n.Fo.get(s.targetId);if(r.length>1)return n.Fo.set(s.targetId,r.filter((t=>!Si(t,e)))),void n.Oo.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(s.targetId),n.sharedClientState.isActiveQueryTarget(s.targetId)||await lu(n.localStore,s.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(s.targetId),th(n.remoteStore,s.targetId),sl(n,s.targetId)})).catch(Lc)):(sl(n,s.targetId),await lu(n.localStore,s.targetId,!0))}async function Yh(t,e){const n=Gs(t);try{const t=await function(t,e){const n=Gs(t),s=e.snapshotVersion;let r=n.Un;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(t=>{const i=n.jn.newChangeBuffer({trackRemovals:!0});r=n.Un;const o=[];e.targetChanges.forEach(((e,i)=>{const a=r.get(i);if(!a)return;o.push(n.ze.removeMatchingKeys(t,e.removedDocuments,i).next((()=>n.ze.addMatchingKeys(t,e.addedDocuments,i))));const c=e.resumeToken;if(c.approximateByteSize()>0){const u=a.withResumeToken(c,s).withSequenceNumber(t.currentSequenceNumber);r=r.insert(i,u),function(t,e,n){return Ks(e.resumeToken.approximateByteSize()>0),0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(a,u,e)&&o.push(n.ze.updateTargetData(t,u))}}));let a=bo();if(e.documentUpdates.forEach(((s,r)=>{e.resolvedLimboDocuments.has(s)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(t,s))})),o.push(cu(t,i,e.documentUpdates,s,void 0).next((t=>{a=t}))),!s.isEqual(cr.min())){const e=n.ze.getLastRemoteSnapshotVersion(t).next((e=>n.ze.setTargetsMetadata(t,t.currentSequenceNumber,s)));o.push(e)}return qa.waitFor(o).next((()=>i.apply(t))).next((()=>n.Qn.vn(t,a))).next((()=>a))})).then((t=>(n.Un=r,t)))}(n.localStore,e);e.targetChanges.forEach(((t,e)=>{const s=n.Bo.get(e);s&&(Ks(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?s.ko=!0:t.modifiedDocuments.size>0?Ks(s.ko):t.removedDocuments.size>0&&(Ks(s.ko),s.ko=!1))})),await cl(n,t,e)}catch(t){await Lc(t)}}function Xh(t,e,n){const s=Gs(t);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const t=[];s.Oo.forEach(((n,s)=>{const r=s.view.io(e);r.snapshot&&t.push(r.snapshot)})),function(t,e){const n=Gs(t);n.onlineState=e;let s=!1;n.queries.forEach(((t,n)=>{for(const t of n.listeners)t.io(e)&&(s=!0)})),s&&Mh(n)}(s.eventManager,e),t.length&&s.$o.Rr(t),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function Jh(t,e,n){const s=Gs(t);s.sharedClientState.updateQueryState(e,"rejected",n);const r=s.Bo.get(e),i=r&&r.key;if(i){let t=new go(xr.comparator);t=t.insert(i,Hr.newNoDocument(i,cr.min()));const n=No().add(i),r=new xo(cr.min(),new Map,new yo(rr),t,n);await Yh(s,r),s.Lo=s.Lo.remove(i),s.Bo.delete(e),al(s)}else await lu(s.localStore,e,!1).then((()=>sl(s,e,n))).catch(Lc)}async function Zh(t,e){const n=Gs(t),s=e.batch.batchId;try{const t=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(t=>{const s=e.batch.keys(),r=n.jn.newChangeBuffer({trackRemovals:!0});return function(t,e,n,s){const r=n.batch,i=r.keys();let o=qa.resolve();return i.forEach((t=>{o=o.next((()=>s.getEntry(e,t))).next((e=>{const i=n.docVersions.get(t);Ks(null!==i),e.version.compareTo(i)<0&&(r.applyToRemoteDocument(e,n),e.isValidDocument()&&s.addEntry(e,n.commitVersion))}))})),o.next((()=>t.In.removeMutationBatch(e,r)))}(n,t,e,r).next((()=>r.apply(t))).next((()=>n.In.performConsistencyCheck(t))).next((()=>n.Qn.Pn(t,s)))}))}(n.localStore,e);nl(n,s,null),el(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await cl(n,t)}catch(t){await Lc(t)}}async function tl(t,e,n){const s=Gs(t);try{const t=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(t=>{let s;return n.In.lookupMutationBatch(t,e).next((e=>(Ks(null!==e),s=e.keys(),n.In.removeMutationBatch(t,e)))).next((()=>n.In.performConsistencyCheck(t))).next((()=>n.Qn.Pn(t,s)))}))}(s.localStore,e);nl(s,e,n),el(s,e),s.sharedClientState.updateMutationState(e,"rejected",n),await cl(s,t)}catch(t){await Lc(t)}}function el(t,e){(t.Ko.get(e)||[]).forEach((t=>{t.resolve()})),t.Ko.delete(e)}function nl(t,e,n){const s=Gs(t);let r=s.qo[s.currentUser.toKey()];if(r){const t=r.get(e);t&&(n?t.reject(n):t.resolve(),r=r.remove(e)),s.qo[s.currentUser.toKey()]=r}}function sl(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const s of t.Fo.get(e))t.Oo.delete(s),n&&t.$o.Go(s,n);t.Fo.delete(e),t.isPrimaryClient&&t.Uo.cs(e).forEach((e=>{t.Uo.containsKey(e)||rl(t,e)}))}function rl(t,e){t.Mo.delete(e.path.canonicalString());const n=t.Lo.get(e);null!==n&&(th(t.remoteStore,n),t.Lo=t.Lo.remove(e),t.Bo.delete(n),al(t))}function il(t,e,n){for(const s of n)s instanceof Bh?(t.Uo.addReference(s.key,e),ol(t,s)):s instanceof jh?(Vs("SyncEngine","Document no longer in limbo: "+s.key),t.Uo.removeReference(s.key,e),t.Uo.containsKey(s.key)||rl(t,s.key)):js()}function ol(t,e){const n=e.key,s=n.path.canonicalString();t.Lo.get(n)||t.Mo.has(s)||(Vs("SyncEngine","New document in limbo: "+n),t.Mo.add(s),al(t))}function al(t){for(;t.Mo.size>0&&t.Lo.size{o.push(s.Wo(a,e,n).then((t=>{if(t){s.isPrimaryClient&&s.sharedClientState.updateQueryState(a.targetId,t.fromCache?"not-current":"current"),r.push(t);const e=nu.kn(a.targetId,t);i.push(e)}})))})),await Promise.all(o),s.$o.Rr(r),await async function(t,e){const n=Gs(t);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(t=>qa.forEach(e,(e=>qa.forEach(e.Nn,(s=>n.persistence.referenceDelegate.addReference(t,e.targetId,s))).next((()=>qa.forEach(e.xn,(s=>n.persistence.referenceDelegate.removeReference(t,e.targetId,s)))))))))}catch(t){if(!Ga(t))throw t;Vs("LocalStore","Failed to update sequence numbers: "+t)}for(const t of e){const e=t.targetId;if(!t.fromCache){const t=n.Un.get(e),s=t.snapshotVersion,r=t.withLastLimboFreeSnapshotVersion(s);n.Un=n.Un.insert(e,r)}}}(s.localStore,i))}async function ul(t,e){const n=Gs(t);if(!n.currentUser.isEqual(e)){Vs("SyncEngine","User change. New user:",e.toKey());const t=await ou(n.localStore,e);n.currentUser=e,function(t,e){t.Ko.forEach((t=>{t.forEach((t=>{t.reject(new zs(Hs.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Ko.clear()}(n),n.sharedClientState.handleUserChange(e,t.removedBatchIds,t.addedBatchIds),await cl(n,t.Wn)}}function hl(t,e){const n=Gs(t),s=n.Bo.get(e);if(s&&s.ko)return No().add(s.key);{let t=No();const s=n.Fo.get(e);if(!s)return t;for(const e of s){const s=n.Oo.get(e);t=t.unionWith(s.view.Ro)}return t}}async function ll(t,e){const n=Gs(t),s=await du(n.localStore,e.query,!0),r=e.view.No(s);return n.isPrimaryClient&&il(n,e.targetId,r.Do),r}async function dl(t){const e=Gs(t);return gu(e.localStore).then((t=>cl(e,t)))}async function fl(t,e,n,s){const r=Gs(t),i=await function(t,e){const n=Gs(t),s=Gs(n.In);return n.persistence.runTransaction("Lookup mutation documents","readonly",(t=>s.Xt(t,e).next((e=>e?n.Qn.Pn(t,e):qa.resolve(null)))))}(r.localStore,e);null!==i?("pending"===n?await dh(r.remoteStore):"acknowledged"===n||"rejected"===n?(nl(r,e,s||null),el(r,e),function(t,e){Gs(Gs(t).In).te(e)}(r.localStore,e)):js(),await cl(r,i)):Vs("SyncEngine","Cannot apply mutation batch with id: "+e)}async function gl(t,e,n){const s=Gs(t),r=[],i=[];for(const t of e){let e;const n=s.Fo.get(t);if(n&&0!==n.length){e=await hu(s.localStore,Ei(n[0]));for(const t of n){const e=s.Oo.get(t),n=await ll(s,e);n.snapshot&&i.push(n.snapshot)}}else{const n=await fu(s.localStore,t);e=await hu(s.localStore,n),await Qh(s,ml(n),t,!1)}r.push(e)}return s.$o.Rr(i),r}function ml(t){return gi(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function pl(t){const e=Gs(t);return Gs(Gs(e.localStore).persistence).pn()}async function yl(t,e,n,s){const r=Gs(t);if(r.Qo)Vs("SyncEngine","Ignoring unexpected query state notification.");else if(r.Fo.has(e))switch(n){case"current":case"not-current":{const t=await gu(r.localStore),s=xo.createSynthesizedRemoteEventForCurrentChange(e,"current"===n);await cl(r,t,s);break}case"rejected":await lu(r.localStore,e,!0),sl(r,e,s);break;default:js()}}async function wl(t,e,n){const s=vl(t);if(s.Qo){for(const t of e){if(s.Fo.has(t)){Vs("SyncEngine","Adding an already active target "+t);continue}const e=await fu(s.localStore,t),n=await hu(s.localStore,e);await Qh(s,ml(e),n.targetId,!1),Zu(s.remoteStore,n)}for(const t of n)s.Fo.has(t)&&await lu(s.localStore,t,!1).then((()=>{th(s.remoteStore,t),sl(s,t)})).catch(Lc)}}function vl(t){const e=Gs(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=Yh.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=hl.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Jh.bind(null,e),e.$o.Rr=Lh.bind(null,e.eventManager),e.$o.Go=Oh.bind(null,e.eventManager),e}function bl(t){const e=Gs(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Zh.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=tl.bind(null,e),e}class Tl{constructor(){this.synchronizeTabs=!1}async initialize(t){this.N=Ku(t.databaseInfo.databaseId),this.sharedClientState=this.Ho(t),this.persistence=this.Jo(t),await this.persistence.start(),this.gcScheduler=this.Yo(t),this.localStore=this.Xo(t)}Yo(t){return null}Xo(t){return iu(this.persistence,new su,t.initialUser,this.N)}Jo(t){return new Iu(_u.Ns,this.N)}Ho(t){return new Mu}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class El extends Tl{constructor(t,e,n){super(),this.Zo=t,this.cacheSizeBytes=e,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(t){await super.initialize(t),await async function(t){const e=Gs(t);return e.persistence.runTransaction("Synchronize last document change read time","readonly",(t=>function(t){const e=Gc(t);let n=cr.min();return e.Kt({index:Da.readTimeIndex,reverse:!0},((t,e,s)=>{e.readTime&&(n=ic(e.readTime)),s.done()})).next((()=>n))}(t))).then((t=>{e.Kn=t}))}(this.localStore),await this.Zo.initialize(this,t),await bl(this.Zo.syncEngine),await dh(this.Zo.remoteStore),await this.persistence.nn((()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(this.localStore),Promise.resolve())))}Xo(t){return iu(this.persistence,new su,t.initialUser,this.N)}Yo(t){const e=this.persistence.referenceDelegate.garbageCollector;return new Fc(e,t.asyncQueue)}Jo(t){const e=Zc(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?bc.withCacheSize(this.cacheSizeBytes):bc.DEFAULT;return new Yc(this.synchronizeTabs,e,t.clientId,n,t.asyncQueue,Bu(),ju(),this.N,this.sharedClientState,!!this.forceOwnership)}Ho(t){return new Mu}}class Il extends El{constructor(t,e){super(t,e,!1),this.Zo=t,this.cacheSizeBytes=e,this.synchronizeTabs=!0}async initialize(t){await super.initialize(t);const e=this.Zo.syncEngine;this.sharedClientState instanceof Ou&&(this.sharedClientState.syncEngine={_i:fl.bind(null,e),mi:yl.bind(null,e),gi:wl.bind(null,e),pn:pl.bind(null,e),wi:dl.bind(null,e)},await this.sharedClientState.start()),await this.persistence.nn((async t=>{await async function(t,e){const n=Gs(t);if(vl(n),bl(n),!0===e&&!0!==n.Qo){const t=n.sharedClientState.getAllActiveQueryTargets(),e=await gl(n,t.toArray());n.Qo=!0,await Th(n.remoteStore,!0);for(const t of e)Zu(n.remoteStore,t)}else if(!1===e&&!1!==n.Qo){const t=[];let e=Promise.resolve();n.Fo.forEach(((s,r)=>{n.sharedClientState.isLocalQueryTarget(r)?t.push(r):e=e.then((()=>(sl(n,r),lu(n.localStore,r,!0)))),th(n.remoteStore,r)})),await e,await gl(n,t),function(t){const e=Gs(t);e.Bo.forEach(((t,n)=>{th(e.remoteStore,n)})),e.Uo.us(),e.Bo=new Map,e.Lo=new go(xr.comparator)}(n),n.Qo=!1,await Th(n.remoteStore,!1)}}(this.Zo.syncEngine,t),this.gcScheduler&&(t&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):t||this.gcScheduler.stop())}))}Ho(t){const e=Bu();if(!Ou.bt(e))throw new zs(Hs.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=Zc(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey);return new Ou(e,t.asyncQueue,n,t.clientId,t.initialUser)}}class Sl{async initialize(t,e){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=t=>Xh(this.syncEngine,t,1),this.remoteStore.remoteSyncer.handleCredentialChange=ul.bind(null,this.syncEngine),await Th(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return new Ch}createDatastore(t){const e=Ku(t.databaseInfo.databaseId),n=(s=t.databaseInfo,new qu(s));var s;return function(t,e,n){return new Qu(t,e,n)}(t.credentials,n,e)}createRemoteStore(t){var e,n,s,r,i;return e=this.localStore,n=this.datastore,s=t.asyncQueue,r=t=>Xh(this.syncEngine,t,0),i=Pu.bt()?new Pu:new Fu,new Yu(e,n,s,r,i)}createSyncEngine(t,e){return function(t,e,n,s,r,i,o){const a=new Hh(t,e,n,s,r,i);return o&&(a.Qo=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)}terminate(){return async function(t){const e=Gs(t);Vs("RemoteStore","RemoteStore shutting down."),e.Wr.add(5),await Ju(e),e.zr.shutdown(),e.Hr.set("Unknown")}(this.remoteStore)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function _l(t,e=10240){let n=0;return{async read(){if(n{this.muted||t(e)}),0)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Al{constructor(t,e){this.nc=t,this.N=e,this.metadata=new Qs,this.buffer=new Uint8Array,this.sc=new TextDecoder("utf-8"),this.ic().then((t=>{t&&t.wo()?this.metadata.resolve(t.payload.metadata):this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\n ${JSON.stringify(null==t?void 0:t.payload)}`))}),(t=>this.metadata.reject(t)))}close(){return this.nc.cancel()}async getMetadata(){return this.metadata.promise}async zo(){return await this.getMetadata(),this.ic()}async ic(){const t=await this.rc();if(null===t)return null;const e=this.sc.decode(t),n=Number(e);isNaN(n)&&this.oc(`length string (${e}) is not valid number`);const s=await this.cc(n);return new Ph(JSON.parse(s),t.length+n)}ac(){return this.buffer.findIndex((t=>t==="{".charCodeAt(0)))}async rc(){for(;this.ac()<0&&!await this.uc(););if(0===this.buffer.length)return null;const t=this.ac();t<0&&this.oc("Reached the end of bundle when a length string is expected.");const e=this.buffer.slice(0,t);return this.buffer=this.buffer.slice(t),e}async cc(t){for(;this.buffer.length0)throw new zs(Hs.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");const e=await async function(t,e){const n=Gs(t),s=Xo(n.N)+"/documents",r={documents:e.map((t=>zo(n.N,t)))},i=await n.Ki("BatchGetDocuments",s,r),o=new Map;i.forEach((t=>{const e=function(t,e){return"found"in e?function(t,e){Ks(!!e.found),e.found.name,e.found.updateTime;const n=Qo(t,e.found.name),s=$o(e.found.updateTime),r=new $r({mapValue:{fields:e.found.fields}});return Hr.newFoundDocument(n,s,r)}(t,e):"missing"in e?function(t,e){Ks(!!e.missing),Ks(!!e.readTime);const n=Qo(t,e.missing),s=$o(e.readTime);return Hr.newNoDocument(n,s)}(t,e):js()}(n.N,t);o.set(e.key.toString(),e)}));const a=[];return e.forEach((t=>{const e=o.get(t.toString());Ks(!!e),a.push(e)})),a}(this.datastore,t);return e.forEach((t=>this.recordVersion(t))),e}set(t,e){this.write(e.toMutation(t,this.precondition(t))),this.writtenDocs.add(t.toString())}update(t,e){try{this.write(e.toMutation(t,this.preconditionForUpdate(t)))}catch(t){this.lastWriteError=t}this.writtenDocs.add(t.toString())}delete(t){this.write(new oo(t,this.precondition(t))),this.writtenDocs.add(t.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;const t=this.readVersions;this.mutations.forEach((e=>{t.delete(e.key.toString())})),t.forEach(((t,e)=>{const n=xr.fromPath(e);this.mutations.push(new ao(n,this.precondition(n)))})),await async function(t,e){const n=Gs(t),s=Xo(n.N)+"/documents",r={writes:e.map((t=>ea(n.N,t)))};await n.Li("Commit",s,r)}(this.datastore,this.mutations),this.committed=!0}recordVersion(t){let e;if(t.isFoundDocument())e=t.version;else{if(!t.isNoDocument())throw js();e=cr.min()}const n=this.readVersions.get(t.key.toString());if(n){if(!e.isEqual(n))throw new zs(Hs.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),e)}precondition(t){const e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?zi.updateTime(e):zi.none()}preconditionForUpdate(t){const e=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&e){if(e.isEqual(cr.min()))throw new zs(Hs.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return zi.updateTime(e)}return zi.exists(!0)}write(t){this.ensureCommitNotCalled(),this.mutations.push(t)}ensureCommitNotCalled(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xl{constructor(t,e,n,s){this.asyncQueue=t,this.datastore=e,this.updateFunction=n,this.deferred=s,this.hc=5,this.ar=new $u(this.asyncQueue,"transaction_retry")}run(){this.hc-=1,this.lc()}lc(){this.ar.Xi((async()=>{const t=new Dl(this.datastore),e=this.fc(t);e&&e.then((e=>{this.asyncQueue.enqueueAndForget((()=>t.commit().then((()=>{this.deferred.resolve(e)})).catch((t=>{this.dc(t)}))))})).catch((t=>{this.dc(t)}))}))}fc(t){try{const e=this.updateFunction(t);return!Nr(e)&&e.catch&&e.then?e:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}}dc(t){this.hc>0&&this.wc(t)?(this.hc-=1,this.asyncQueue.enqueueAndForget((()=>(this.lc(),Promise.resolve())))):this.deferred.reject(t)}wc(t){if("FirebaseError"===t.name){const e=t.code;return"aborted"===e||"failed-precondition"===e||!lo(e)}return!1}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cl{constructor(t,e,n){this.credentials=t,this.asyncQueue=e,this.databaseInfo=n,this.user=Ls.UNAUTHENTICATED,this.clientId=sr.I(),this.credentialListener=()=>Promise.resolve(),this.credentials.start(e,(async t=>{Vs("FirestoreClient","Received user=",t.uid),await this.credentialListener(t),this.user=t}))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.credentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new zs(Hs.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Qs;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this.onlineComponents&&await this.onlineComponents.terminate(),this.offlineComponents&&await this.offlineComponents.terminate(),this.credentials.shutdown(),t.resolve()}catch(e){const n=_h(e,"Failed to shutdown persistence");t.reject(n)}})),t.promise}}async function kl(t,e){t.asyncQueue.verifyOperationInProgress(),Vs("FirestoreClient","Initializing OfflineComponentProvider");const n=await t.getConfiguration();await e.initialize(n);let s=n.initialUser;t.setCredentialChangeListener((async t=>{s.isEqual(t)||(await ou(e.localStore,t),s=t)})),e.persistence.setDatabaseDeletedListener((()=>t.terminate())),t.offlineComponents=e}async function Rl(t,e){t.asyncQueue.verifyOperationInProgress();const n=await Ll(t);Vs("FirestoreClient","Initializing OnlineComponentProvider");const s=await t.getConfiguration();await e.initialize(n,s),t.setCredentialChangeListener((t=>async function(t,e){const n=Gs(t);n.asyncQueue.verifyOperationInProgress(),Vs("RemoteStore","RemoteStore received new credentials");const s=ih(n);n.Wr.add(3),await Ju(n),s&&n.Hr.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Wr.delete(3),await Xu(n)}(e.remoteStore,t))),t.onlineComponents=e}async function Ll(t){return t.offlineComponents||(Vs("FirestoreClient","Using default OfflineComponentProvider"),await kl(t,new Tl)),t.offlineComponents}async function Ol(t){return t.onlineComponents||(Vs("FirestoreClient","Using default OnlineComponentProvider"),await Rl(t,new Sl)),t.onlineComponents}function Ml(t){return Ll(t).then((t=>t.persistence))}function Fl(t){return Ll(t).then((t=>t.localStore))}function Pl(t){return Ol(t).then((t=>t.remoteStore))}function Vl(t){return Ol(t).then((t=>t.syncEngine))}async function Ul(t){const e=await Ol(t),n=e.eventManager;return n.onListen=zh.bind(null,e.syncEngine),n.onUnlisten=Wh.bind(null,e.syncEngine),n}function ql(t,e,n={}){const s=new Qs;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,r){const i=new Nl({next:i=>{e.enqueueAndForget((()=>Rh(t,o)));const a=i.docs.has(n);!a&&i.fromCache?r.reject(new zs(Hs.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&i.fromCache&&s&&"server"===s.source?r.reject(new zs(Hs.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):r.resolve(i)},error:t=>r.reject(t)}),o=new Fh(mi(n.path),i,{includeMetadataChanges:!0,fo:!0});return kh(t,o)}(await Ul(t),t.asyncQueue,e,n,s))),s.promise}function Bl(t,e,n={}){const s=new Qs;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,r){const i=new Nl({next:n=>{e.enqueueAndForget((()=>Rh(t,o))),n.fromCache&&"server"===s.source?r.reject(new zs(Hs.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):r.resolve(n)},error:t=>r.reject(t)}),o=new Fh(n,i,{includeMetadataChanges:!0,fo:!0});return kh(t,o)}(await Ul(t),t.asyncQueue,e,n,s))),s.promise}function jl(t,e,n,s){const r=function(t,e){let n;return n="string"==typeof t?(new TextEncoder).encode(t):t,function(t,e){return new Al(t,e)}(function(t,e){if(t instanceof Uint8Array)return _l(t,e);if(t instanceof ArrayBuffer)return _l(new Uint8Array(t),e);if(t instanceof ReadableStream)return t.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}(n),e)}(n,Ku(e));t.asyncQueue.enqueueAndForget((async()=>{!function(t,e,n){const s=Gs(t);(async function(t,e,n){try{const s=await e.getMetadata();if(await function(t,e){const n=Gs(t),s=$o(e.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",(t=>n.Je.getBundleMetadata(t,e.id))).then((t=>!!t&&t.createTime.compareTo(s)>=0))}(t.localStore,s))return await e.close(),void n._completeWith(function(t){return{taskState:"Success",documentsLoaded:t.totalDocuments,bytesLoaded:t.totalBytes,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}(s));n._updateProgress(qh(s));const r=new Uh(s,t.localStore,e.N);let i=await e.zo();for(;i;){const t=await r.mo(i);t&&n._updateProgress(t),i=await e.zo()}const o=await r.complete();await cl(t,o.En,void 0),await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Save bundle","readwrite",(t=>n.Je.saveBundleMetadata(t,e)))}(t.localStore,s),n._completeWith(o.progress)}catch(t){qs("SyncEngine",`Loading bundle failed with ${t}`),n._failWith(t)}})(s,e,n).then((()=>{s.sharedClientState.notifyBundleLoaded()}))}(await Vl(t),r,s)}))}class Kl{constructor(t,e,n,s,r,i,o,a){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=s,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=o,this.useFetchStreams=a}}class $l{constructor(t,e){this.projectId=t,this.database=e||"(default)"}get isDefaultDatabase(){return"(default)"===this.database}isEqual(t){return t instanceof $l&&t.projectId===this.projectId&&t.database===this.database}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Gl=new Map; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Hl(t,e,n){if(!n)throw new zs(Hs.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function zl(t,e,n,s){if(!0===e&&!0===s)throw new zs(Hs.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function Ql(t){if(!xr.isDocumentKey(t))throw new zs(Hs.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function Wl(t){if(xr.isDocumentKey(t))throw new zs(Hs.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Yl(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";{const e=function(t){return t.constructor?t.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return"function"==typeof t?"a function":js()}function Xl(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new zs(Hs.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Yl(t);throw new zs(Hs.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function Jl(t,e){if(e<=0)throw new zs(Hs.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Zl{constructor(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new zs(Hs.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new zs(Hs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,zl("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class td{constructor(t,e){this._credentials=e,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Zl({}),this._settingsFrozen=!1,t instanceof $l?this._databaseId=t:(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new zs(Hs.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new $l(t.options.projectId)}(t))}get app(){if(!this._app)throw new zs(Hs.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(t){if(this._settingsFrozen)throw new zs(Hs.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Zl(t),void 0!==t.credentials&&(this._credentials=function(t){if(!t)return new Ys;switch(t.type){case"gapi":const e=t.client;return Ks(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new tr(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new zs(Hs.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const e=Gl.get(t);e&&(Vs("ComponentProvider","Removing Datastore"),Gl.delete(t),e.terminate())}(this),Promise.resolve()}}function ed(t,e,n,s={}){var r;const i=(t=Xl(t,td))._getSettings();if("firestore.googleapis.com"!==i.host&&i.host!==e&&qs("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},i),{host:`${e}:${n}`,ssl:!1})),s.mockUserToken){let e,n;if("string"==typeof s.mockUserToken)e=s.mockUserToken,n=Ls.MOCK_USER;else{e= +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",s=t.iat||0,r=t.sub||t.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}}},t);return[u(JSON.stringify({alg:"none",type:"JWT"})),u(JSON.stringify(i)),""].join(".")}(s.mockUserToken,null===(r=t._app)||void 0===r?void 0:r.options.projectId);const i=s.mockUserToken.sub||s.mockUserToken.user_id;if(!i)throw new zs(Hs.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Ls(i)}t._credentials=new Xs(new Ws(e,n))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class nd{constructor(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new rd(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new nd(this.firestore,t,this._key)}}class sd{constructor(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new sd(this.firestore,t,this._query)}}class rd extends sd{constructor(t,e,n){super(t,e,mi(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new nd(this.firestore,null,new xr(t))}withConverter(t){return new rd(this.firestore,t,this._path)}}function id(t,e,...n){if(t=g(t),Hl("collection","path",e),t instanceof td){const s=fr.fromString(e,...n);return Wl(s),new rd(t,null,s)}{if(!(t instanceof nd||t instanceof rd))throw new zs(Hs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(fr.fromString(e,...n));return Wl(s),new rd(t.firestore,null,s)}}function od(t,e){if(t=Xl(t,td),Hl("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new zs(Hs.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new sd(t,null,function(t){return new fi(fr.emptyPath(),t)}(e))}function ad(t,e,...n){if(t=g(t),1===arguments.length&&(e=sr.I()),Hl("doc","path",e),t instanceof td){const s=fr.fromString(e,...n);return Ql(s),new nd(t,null,new xr(s))}{if(!(t instanceof nd||t instanceof rd))throw new zs(Hs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(fr.fromString(e,...n));return Ql(s),new nd(t.firestore,t instanceof rd?t.converter:null,new xr(s))}}function cd(t,e){return t=g(t),e=g(e),(t instanceof nd||t instanceof rd)&&(e instanceof nd||e instanceof rd)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function ud(t,e){return t=g(t),e=g(e),t instanceof sd&&e instanceof sd&&t.firestore===e.firestore&&Si(t._query,e._query)&&t.converter===e.converter +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class hd{constructor(){this._c=Promise.resolve(),this.mc=[],this.gc=!1,this.yc=[],this.Tc=null,this.Ec=!1,this.Ic=!1,this.Ac=[],this.ar=new $u(this,"async_queue_retry"),this.Rc=()=>{const t=ju();t&&Vs("AsyncQueue","Visibility state changed to "+t.visibilityState),this.ar.tr()};const t=ju();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Rc)}get isShuttingDown(){return this.gc}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.bc(),this.Pc(t)}enterRestrictedMode(t){if(!this.gc){this.gc=!0,this.Ic=t||!1;const e=ju();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Rc)}}enqueue(t){if(this.bc(),this.gc)return new Promise((()=>{}));const e=new Qs;return this.Pc((()=>this.gc&&this.Ic?Promise.resolve():(t().then(e.resolve,e.reject),e.promise))).then((()=>e.promise))}enqueueRetryable(t){this.enqueueAndForget((()=>(this.mc.push(t),this.vc())))}async vc(){if(0!==this.mc.length){try{await this.mc[0](),this.mc.shift(),this.ar.reset()}catch(t){if(!Ga(t))throw t;Vs("AsyncQueue","Operation failed with retryable error: "+t)}this.mc.length>0&&this.ar.Xi((()=>this.vc()))}}Pc(t){const e=this._c.then((()=>(this.Ec=!0,t().catch((t=>{this.Tc=t,this.Ec=!1;const e=function(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t);throw Us("INTERNAL UNHANDLED ERROR: ",e),t})).then((t=>(this.Ec=!1,t))))));return this._c=e,e}enqueueAfterDelay(t,e,n){this.bc(),this.Ac.indexOf(t)>-1&&(e=0);const s=Sh.createAndSchedule(this,t,e,n,(t=>this.Vc(t)));return this.yc.push(s),s}bc(){this.Tc&&js()}verifyOperationInProgress(){}async Sc(){let t;do{t=this._c,await t}while(t!==this._c)}Dc(t){for(const e of this.yc)if(e.timerId===t)return!0;return!1}Cc(t){return this.Sc().then((()=>{this.yc.sort(((t,e)=>t.targetTimeMs-e.targetTimeMs));for(const e of this.yc)if(e.skipDelay(),"all"!==t&&e.timerId===t)break;return this.Sc()}))}Nc(t){this.Ac.push(t)}Vc(t){const e=this.yc.indexOf(t);this.yc.splice(e,1)}}function ld(t){return function(t,e){if("object"!=typeof t||null===t)return!1;const n=t;for(const t of["next","error","complete"])if(t in n&&"function"==typeof n[t])return!0;return!1}(t)}class dd{constructor(){this._progressObserver={},this._taskCompletionResolver=new Qs,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(t,e,n){this._progressObserver={next:t,error:e,complete:n}}catch(t){return this._taskCompletionResolver.promise.catch(t)}then(t,e){return this._taskCompletionResolver.promise.then(t,e)}_completeWith(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t)}_failWith(t){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(t),this._taskCompletionResolver.reject(t)}_updateProgress(t){this._lastProgress=t,this._progressObserver.next&&this._progressObserver.next(t)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const fd=-1;class gd extends td{constructor(t,e){super(t,e),this.type="firestore",this._queue=new hd,this._persistenceKey="name"in t?t.name:"[DEFAULT]"}_terminate(){return this._firestoreClient||wd(this),this._firestoreClient.terminate()}}function md(t,e){const n=i._getProvider(t,"firestore");if(n.isInitialized()){const t=n.getImmediate();if(d(n.getOptions(),e))return t;throw new zs(Hs.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(void 0!==e.cacheSizeBytes&&-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new zs(Hs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return n.initialize({options:e})}function pd(t=i.getApp()){return i._getProvider(t,"firestore").getImmediate()}function yd(t){return t._firestoreClient||wd(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function wd(t){var e;const n=t._freezeSettings(),s=function(t,e,n,s){return new Kl(t,e,n,s.host,s.ssl,s.experimentalForceLongPolling,s.experimentalAutoDetectLongPolling,s.useFetchStreams)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new Cl(t._credentials,t._queue,s)}function vd(t,e){xd(t=Xl(t,gd));const n=yd(t),s=t._freezeSettings(),r=new Sl;return Td(n,r,new El(r,s.cacheSizeBytes,null==e?void 0:e.forceOwnership))}function bd(t){xd(t=Xl(t,gd));const e=yd(t),n=t._freezeSettings(),s=new Sl;return Td(e,s,new Il(s,n.cacheSizeBytes))}function Td(t,e,n){const s=new Qs;return t.asyncQueue.enqueue((async()=>{try{await kl(t,n),await Rl(t,e),s.resolve()}catch(t){if(!function(t){return"FirebaseError"===t.name?t.code===Hs.FAILED_PRECONDITION||t.code===Hs.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||(22===t.code||20===t.code||11===t.code)}(t))throw t;console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+t),s.reject(t)}})).then((()=>s.promise))}function Ed(t){if(t._initialized&&!t._terminated)throw new zs(Hs.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const e=new Qs;return t._queue.enqueueAndForgetEvenWhileRestricted((async()=>{try{await async function(t){if(!ja.bt())return Promise.resolve();const e=t+"main";await ja.delete(e)}(Zc(t._databaseId,t._persistenceKey)),e.resolve()}catch(t){e.reject(t)}})),e.promise}function Id(t){return function(t){const e=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e){const n=Gs(t);ih(n.remoteStore)||Vs("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const t=await function(t){const e=Gs(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(t=>e.In.getHighestUnacknowledgedBatchId(t)))}(n.localStore);if(-1===t)return void e.resolve();const s=n.Ko.get(t)||[];s.push(e),n.Ko.set(t,s)}catch(t){const n=_h(t,"Initialization of waitForPendingWrites() operation failed");e.reject(n)}}(await Vl(t),e))),e.promise}(yd(t=Xl(t,gd)))}function Sd(t){return function(t){return t.asyncQueue.enqueue((async()=>{const e=await Ml(t),n=await Pl(t);return e.setNetworkEnabled(!0),function(t){const e=Gs(t);return e.Wr.delete(0),Xu(e)}(n)}))}(yd(t=Xl(t,gd)))}function _d(t){return function(t){return t.asyncQueue.enqueue((async()=>{const e=await Ml(t),n=await Pl(t);return e.setNetworkEnabled(!1),async function(t){const e=Gs(t);e.Wr.add(0),await Ju(e),e.Hr.set("Offline")}(n)}))}(yd(t=Xl(t,gd)))}function Nd(t){return i._removeServiceInstance(t.app,"firestore"),t._delete()}function Ad(t,e){const n=yd(t=Xl(t,gd)),s=new dd;return jl(n,t._databaseId,e,s),s}function Dd(t,e){return function(t,e){return t.asyncQueue.enqueue((async()=>function(t,e){const n=Gs(t);return n.persistence.runTransaction("Get named query","readonly",(t=>n.Je.getNamedQuery(t,e)))}(await Fl(t),e)))}(yd(t=Xl(t,gd)),e).then((e=>e?new sd(t,null,e.query):null))}function xd(t){if(t._initialized||t._terminated)throw new zs(Hs.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cd{constructor(...t){for(let e=0;e90)throw new zs(Hs.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new zs(Hs.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(t){return rr(this._lat,t._lat)||rr(this._long,t._long)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Md=/^__.*__$/;class Fd{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return null!==this.fieldMask?new no(t,this.data,this.fieldMask,e,this.fieldTransforms):new eo(t,this.data,e,this.fieldTransforms)}}class Pd{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return new no(t,this.data,this.fieldMask,e,this.fieldTransforms)}}function Vd(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw js()}}class Ud{constructor(t,e,n,s,r,i){this.settings=t,this.databaseId=e,this.N=n,this.ignoreUndefinedProperties=s,void 0===r&&this.xc(),this.fieldTransforms=r||[],this.fieldMask=i||[]}get path(){return this.settings.path}get kc(){return this.settings.kc}$c(t){return new Ud(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.N,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Oc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.$c({path:n,Fc:!1});return s.Mc(t),s}Lc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.$c({path:n,Fc:!1});return s.xc(),s}Bc(t){return this.$c({path:void 0,Fc:!0})}Uc(t){return of(t,this.settings.methodName,this.settings.qc||!1,this.path,this.settings.Kc)}contains(t){return void 0!==this.fieldMask.find((e=>t.isPrefixOf(e)))||void 0!==this.fieldTransforms.find((e=>t.isPrefixOf(e.field)))}xc(){if(this.path)for(let t=0;tc.covers(t.field)))}else c=null,u=o.fieldTransforms;return new Fd(new $r(a),c,u)}class Kd extends Ld{_toFieldTransform(t){if(2!==t.kc)throw 1===t.kc?t.Uc(`${this._methodName}() can only appear at the top level of your update data`):t.Uc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return t.fieldMask.push(t.path),null}isEqual(t){return t instanceof Kd}}function $d(t,e,n){return new Ud({kc:3,Kc:e.settings.Kc,methodName:t._methodName,Fc:n},e.databaseId,e.N,e.ignoreUndefinedProperties)}class Gd extends Ld{_toFieldTransform(t){return new Gi(t.path,new Pi)}isEqual(t){return t instanceof Gd}}class Hd extends Ld{constructor(t,e){super(t),this.Qc=e}_toFieldTransform(t){const e=$d(this,t,!0),n=this.Qc.map((t=>Jd(t,e))),s=new Vi(n);return new Gi(t.path,s)}isEqual(t){return this===t}}class zd extends Ld{constructor(t,e){super(t),this.Qc=e}_toFieldTransform(t){const e=$d(this,t,!0),n=this.Qc.map((t=>Jd(t,e))),s=new qi(n);return new Gi(t.path,s)}isEqual(t){return this===t}}class Qd extends Ld{constructor(t,e){super(t),this.Wc=e}_toFieldTransform(t){const e=new ji(t.N,Ri(t.N,this.Wc));return new Gi(t.path,e)}isEqual(t){return this===t}}function Wd(t,e,n,s){const r=t.jc(1,e,n);ef("Data must be an object, but it was:",r,s);const i=[],o=$r.empty();hr(s,((t,s)=>{const a=rf(e,t,n);s=g(s);const c=r.Lc(a);if(s instanceof Kd)i.push(a);else{const t=Jd(s,c);null!=t&&(i.push(a),o.set(a,t))}}));const a=new pr(i);return new Pd(o,a,r.fieldTransforms)}function Yd(t,e,n,s,r,i){const o=t.jc(1,e,n),a=[nf(e,s,n)],c=[r];if(i.length%2!=0)throw new zs(Hs.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let t=0;t=0;--t)if(!af(u,a[t])){const e=a[t];let n=c[t];n=g(n);const s=o.Lc(e);if(n instanceof Kd)u.push(e);else{const t=Jd(n,s);null!=t&&(u.push(e),h.set(e,t))}}const l=new pr(u);return new Pd(h,l,o.fieldTransforms)}function Xd(t,e,n,s=!1){return Jd(n,t.jc(s?4:3,e))}function Jd(t,e){if(tf(t=g(t)))return ef("Unsupported field value:",e,t),Zd(t,e);if(t instanceof Ld)return function(t,e){if(!Vd(e.kc))throw e.Uc(`${t._methodName}() can only be used with update() and set()`);if(!e.path)throw e.Uc(`${t._methodName}() is not currently supported inside arrays`);const n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&4!==e.kc)throw e.Uc("Nested arrays are not supported");return function(t,e){const n=[];let s=0;for(const r of t){let t=Jd(r,e.Bc(s));null==t&&(t={nullValue:"NULL_VALUE"}),n.push(t),s++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=g(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return Ri(e.N,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){const n=ar.fromDate(t);return{timestampValue:Bo(e.N,n)}}if(t instanceof ar){const n=new ar(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:Bo(e.N,n)}}if(t instanceof Od)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Rd)return{bytesValue:jo(e.N,t._byteString)};if(t instanceof nd){const n=e.databaseId,s=t.firestore._databaseId;if(!s.isEqual(n))throw e.Uc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:Go(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.Uc(`Unsupported field value: ${Yl(t)}`)}(t,e)}function Zd(t,e){const n={};return lr(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):hr(t,((t,s)=>{const r=Jd(s,e.Oc(t));null!=r&&(n[t]=r)})),{mapValue:{fields:n}}}function tf(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof ar||t instanceof Od||t instanceof Rd||t instanceof nd||t instanceof Ld)}function ef(t,e,n){if(!tf(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){const s=Yl(n);throw"an object"===s?e.Uc(t+" a custom object"):e.Uc(t+" "+s)}}function nf(t,e,n){if((e=g(e))instanceof Cd)return e._internalPath;if("string"==typeof e)return rf(t,e);throw of("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}const sf=new RegExp("[~\\*/\\[\\]]");function rf(t,e,n){if(e.search(sf)>=0)throw of(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Cd(...e.split("."))._internalPath}catch(s){throw of(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function of(t,e,n,s,r){const i=s&&!s.isEmpty(),o=void 0!==r;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(i||o)&&(c+=" (found",i&&(c+=` in field ${s}`),o&&(c+=` in document ${r}`),c+=")"),new zs(Hs.INVALID_ARGUMENT,a+t+c)}function af(t,e){return t.some((t=>t.isEqual(e)))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cf{constructor(t,e,n,s,r){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=s,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new nd(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const t=new uf(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const e=this._document.data.field(hf("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}}}class uf extends cf{data(){return super.data()}}function hf(t,e){return"string"==typeof e?rf(t,e):e instanceof Cd?e._internalPath:e._delegate._internalPath} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class lf{constructor(t,e){this.hasPendingWrites=t,this.fromCache=e}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class df extends cf{constructor(t,e,n,s,r,i){super(t,e,n,s,i),this._firestore=t,this._firestoreImpl=t,this.metadata=r}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const e=new ff(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,e={}){if(this._document){const n=this._document.data.field(hf("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}}}class ff extends df{data(t={}){return super.data(t)}}class gf{constructor(t,e,n,s){this._firestore=t,this._userDataWriter=e,this._snapshot=s,this.metadata=new lf(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const t=[];return this.forEach((e=>t.push(e))),t}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(t,e){this._snapshot.docs.forEach((n=>{t.call(e,new ff(this._firestore,this._userDataWriter,n.key,n,new lf(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(t={}){const e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new zs(Hs.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){let e=0;return t._snapshot.docChanges.map((n=>({type:"added",doc:new ff(t._firestore,t._userDataWriter,n.doc.key,n.doc,new lf(t._snapshot.mutatedKeys.has(n.doc.key),t._snapshot.fromCache),t.query.converter),oldIndex:-1,newIndex:e++})))}{let n=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((t=>e||3!==t.type)).map((e=>{const s=new ff(t._firestore,t._userDataWriter,e.doc.key,e.doc,new lf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);let r=-1,i=-1;return 0!==e.type&&(r=n.indexOf(e.doc.key),n=n.delete(e.doc.key)),1!==e.type&&(n=n.add(e.doc),i=n.indexOf(e.doc.key)),{type:mf(e.type),doc:s,oldIndex:r,newIndex:i}}))}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}}function mf(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return js()}}function pf(t,e){return t instanceof df&&e instanceof df?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(null===t._document?null===e._document:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof gf&&e instanceof gf&&t._firestore===e._firestore&&ud(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function yf(t){if(yi(t)&&0===t.explicitOrderBy.length)throw new zs(Hs.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class wf{}function vf(t,...e){for(const n of e)t=n._apply(t);return t}class bf extends wf{constructor(t,e,n){super(),this.Gc=t,this.zc=e,this.Hc=n,this.type="where"}_apply(t){const e=Bd(t.firestore),n=function(t,e,n,s,r,i,o){let a;if(r.isKeyField()){if("array-contains"===i||"array-contains-any"===i)throw new zs(Hs.INVALID_ARGUMENT,`Invalid Query. You can't perform '${i}' queries on FieldPath.documentId().`);if("in"===i||"not-in"===i){Mf(o,i);const e=[];for(const n of o)e.push(Of(s,t,n));a={arrayValue:{values:e}}}else a=Of(s,t,o)}else"in"!==i&&"not-in"!==i&&"array-contains-any"!==i||Mf(o,i),a=Xd(n,"where",o,"in"===i||"not-in"===i);const c=Jr.create(r,i,a);return function(t,e){if(e.v()){const n=vi(t);if(null!==n&&!n.isEqual(e.field))throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);const s=wi(t);null!==s&&Ff(t,e.field,s)}const n=function(t,e){for(const n of t.filters)if(e.indexOf(n.op)>=0)return n.op;return null}(t,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==n)throw n===e.op?new zs(Hs.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new zs(Hs.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}(t,c),c}(t._query,0,e,t.firestore._databaseId,this.Gc,this.zc,this.Hc);return new sd(t.firestore,t.converter,function(t,e){const n=t.filters.concat([e]);return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))}}function Tf(t,e,n){const s=e,r=hf("where",t);return new bf(r,s,n)}class Ef extends wf{constructor(t,e){super(),this.Gc=t,this.Jc=e,this.type="orderBy"}_apply(t){const e=function(t,e,n){if(null!==t.startAt)throw new zs(Hs.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new zs(Hs.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");const s=new ui(e,n);return function(t,e){if(null===wi(t)){const n=vi(t);null!==n&&Ff(t,n,e.field)}}(t,s),s}(t._query,this.Gc,this.Jc);return new sd(t.firestore,t.converter,function(t,e){const n=t.explicitOrderBy.concat([e]);return new fi(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t._query,e))}}function If(t,e="asc"){const n=e,s=hf("orderBy",t);return new Ef(s,n)}class Sf extends wf{constructor(t,e,n){super(),this.type=t,this.Yc=e,this.Xc=n}_apply(t){return new sd(t.firestore,t.converter,Ii(t._query,this.Yc,this.Xc))}}function _f(t){return Jl("limit",t),new Sf("limit",t,"F")}function Nf(t){return Jl("limitToLast",t),new Sf("limitToLast",t,"L")}class Af extends wf{constructor(t,e,n){super(),this.type=t,this.Zc=e,this.ta=n}_apply(t){const e=Lf(t,this.type,this.Zc,this.ta);return new sd(t.firestore,t.converter,function(t,e){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t._query,e))}}function Df(...t){return new Af("startAt",t,!0)}function xf(...t){return new Af("startAfter",t,!1)}class Cf extends wf{constructor(t,e,n){super(),this.type=t,this.Zc=e,this.ta=n}_apply(t){const e=Lf(t,this.type,this.Zc,this.ta);return new sd(t.firestore,t.converter,function(t,e){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t._query,e))}}function kf(...t){return new Cf("endBefore",t,!0)}function Rf(...t){return new Cf("endAt",t,!1)}function Lf(t,e,n,s){if(n[0]=g(n[0]),n[0]instanceof cf)return function(t,e,n,s,r){if(!s)throw new zs(Hs.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${n}().`);const i=[];for(const n of Ti(t))if(n.field.isKeyField())i.push(Pr(e,s.key));else{const t=s.data.field(n.field);if(Ir(t))throw new zs(Hs.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+n.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===t){const t=n.field.canonicalString();throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`)}i.push(t)}return new ai(i,r)}(t._query,t.firestore._databaseId,e,n[0]._document,s);{const r=Bd(t.firestore);return function(t,e,n,s,r,i){const o=t.explicitOrderBy;if(r.length>o.length)throw new zs(Hs.INVALID_ARGUMENT,`Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const a=[];for(let i=0;i10)throw new zs(Hs.INVALID_ARGUMENT,`Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`)}function Ff(t,e,n){if(!n.isEqual(e))throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Pf{convertValue(t,e="none"){switch(Cr(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Tr(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(Er(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw js()}}convertObject(t,e){const n={};return hr(t.fields,((t,s)=>{n[t]=this.convertValue(s,e)})),n}convertGeoPoint(t){return new Od(Tr(t.latitude),Tr(t.longitude))}convertArray(t,e){return(t.values||[]).map((t=>this.convertValue(t,e)))}convertServerTimestamp(t,e){switch(e){case"previous":const n=Sr(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(_r(t));default:return null}}convertTimestamp(t){const e=br(t);return new ar(e.seconds,e.nanos)}convertDocumentKey(t,e){const n=fr.fromString(t);Ks(pa(n));const s=new $l(n.get(1),n.get(3)),r=new xr(n.popFirst(5));return s.isEqual(e)||Us(`Document ${r} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),r}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Vf(t,e,n){let s;return s=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,s}class Uf extends Pf{constructor(t){super(),this.firestore=t}convertBytes(t){return new Rd(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new nd(this.firestore,null,e)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qf{constructor(t,e){this._firestore=t,this._commitHandler=e,this._mutations=[],this._committed=!1,this._dataReader=Bd(t)}set(t,e,n){this._verifyNotCommitted();const s=Bf(t,this._firestore),r=Vf(s.converter,e,n),i=jd(this._dataReader,"WriteBatch.set",s._key,r,null!==s.converter,n);return this._mutations.push(i.toMutation(s._key,zi.none())),this}update(t,e,n,...s){this._verifyNotCommitted();const r=Bf(t,this._firestore);let i;return i="string"==typeof(e=g(e))||e instanceof Cd?Yd(this._dataReader,"WriteBatch.update",r._key,e,n,s):Wd(this._dataReader,"WriteBatch.update",r._key,e),this._mutations.push(i.toMutation(r._key,zi.exists(!0))),this}delete(t){this._verifyNotCommitted();const e=Bf(t,this._firestore);return this._mutations=this._mutations.concat(new oo(e._key,zi.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new zs(Hs.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Bf(t,e){if((t=g(t)).firestore!==e)throw new zs(Hs.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function jf(t){t=Xl(t,nd);const e=Xl(t.firestore,gd);return ql(yd(e),t._key).then((n=>ng(e,t,n)))}class Kf extends Pf{constructor(t){super(),this.firestore=t}convertBytes(t){return new Rd(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new nd(this.firestore,null,e)}}function $f(t){t=Xl(t,nd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){try{const s=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("read document","readonly",(t=>n.Qn.An(t,e)))}(t,e);s.isFoundDocument()?n.resolve(s):s.isNoDocument()?n.resolve(null):n.reject(new zs(Hs.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(t){const s=_h(t,`Failed to get document '${e} from cache`);n.reject(s)}}(await Fl(t),e,n))),n.promise}(n,t._key).then((n=>new df(e,s,t._key,n,new lf(null!==n&&n.hasLocalMutations,!0),t.converter)))}function Gf(t){t=Xl(t,nd);const e=Xl(t.firestore,gd);return ql(yd(e),t._key,{source:"server"}).then((n=>ng(e,t,n)))}function Hf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return yf(t._query),Bl(n,t._query).then((n=>new gf(e,s,t,n)))}function zf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){try{const s=await du(t,e,!0),r=new Kh(e,s.Gn),i=r.bo(s.documents),o=r.applyChanges(i,!1);n.resolve(o.snapshot)}catch(t){const s=_h(t,`Failed to execute query '${e} against cache`);n.reject(s)}}(await Fl(t),e,n))),n.promise}(n,t._query).then((n=>new gf(e,s,t,n)))}function Qf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return Bl(n,t._query,{source:"server"}).then((n=>new gf(e,s,t,n)))}function Wf(t,e,n){t=Xl(t,nd);const s=Xl(t.firestore,gd),r=Vf(t.converter,e,n);return eg(s,[jd(Bd(s),"setDoc",t._key,r,null!==t.converter,n).toMutation(t._key,zi.none())])}function Yf(t,e,n,...s){t=Xl(t,nd);const r=Xl(t.firestore,gd),i=Bd(r);let o;return o="string"==typeof(e=g(e))||e instanceof Cd?Yd(i,"updateDoc",t._key,e,n,s):Wd(i,"updateDoc",t._key,e),eg(r,[o.toMutation(t._key,zi.exists(!0))])}function Xf(t){return eg(Xl(t.firestore,gd),[new oo(t._key,zi.none())])}function Jf(t,e){const n=Xl(t.firestore,gd),s=ad(t),r=Vf(t.converter,e);return eg(n,[jd(Bd(t.firestore),"addDoc",s._key,r,null!==t.converter,{}).toMutation(s._key,zi.exists(!1))]).then((()=>s))}function Zf(t,...e){var n,s,r;t=g(t);let i={includeMetadataChanges:!1},o=0;"object"!=typeof e[o]||ld(e[o])||(i=e[o],o++);const a={includeMetadataChanges:i.includeMetadataChanges};if(ld(e[o])){const t=e[o];e[o]=null===(n=t.next)||void 0===n?void 0:n.bind(t),e[o+1]=null===(s=t.error)||void 0===s?void 0:s.bind(t),e[o+2]=null===(r=t.complete)||void 0===r?void 0:r.bind(t)}let c,u,h;if(t instanceof nd)u=Xl(t.firestore,gd),h=mi(t._key.path),c={next:n=>{e[o]&&e[o](ng(u,t,n))},error:e[o+1],complete:e[o+2]};else{const n=Xl(t,sd);u=Xl(n.firestore,gd),h=n._query;const s=new Kf(u);c={next:t=>{e[o]&&e[o](new gf(u,s,n,t))},error:e[o+1],complete:e[o+2]},yf(t._query)}return function(t,e,n,s){const r=new Nl(s),i=new Fh(e,r,n);return t.asyncQueue.enqueueAndForget((async()=>kh(await Ul(t),i))),()=>{r.ec(),t.asyncQueue.enqueueAndForget((async()=>Rh(await Ul(t),i)))}}(yd(u),h,a,c)}function tg(t,e){return function(t,e){const n=new Nl(e);return t.asyncQueue.enqueueAndForget((async()=>function(t,e){Gs(t).so.add(e),e.next()}(await Ul(t),n))),()=>{n.ec(),t.asyncQueue.enqueueAndForget((async()=>function(t,e){Gs(t).so.delete(e)}(await Ul(t),n)))}}(yd(t=Xl(t,gd)),ld(e)?e:{next:e})}function eg(t,e){return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){const s=bl(t);try{const t=await function(t,e){const n=Gs(t),s=ar.now(),r=e.reduce(((t,e)=>t.add(e.key)),No());let i;return n.persistence.runTransaction("Locally write mutations","readwrite",(t=>n.Qn.Pn(t,r).next((r=>{i=r;const o=[];for(const t of e){const e=Ji(t,i.get(t.key));null!=e&&o.push(new no(t.key,e,Gr(e.value.mapValue),zi.exists(!0)))}return n.In.addMutationBatch(t,s,o,e)})))).then((t=>(t.applyToLocalDocumentSet(i),{batchId:t.batchId,changes:i})))}(s.localStore,e);s.sharedClientState.addPendingMutation(t.batchId),function(t,e,n){let s=t.qo[t.currentUser.toKey()];s||(s=new go(rr)),s=s.insert(e,n),t.qo[t.currentUser.toKey()]=s}(s,t.batchId,n),await cl(s,t.changes),await dh(s.remoteStore)}catch(t){const e=_h(t,"Failed to persist write");n.reject(e)}}(await Vl(t),e,n))),n.promise}(yd(t),e)}function ng(t,e,n){const s=n.docs.get(e._key),r=new Kf(t);return new df(t,r,e._key,s,new lf(n.hasPendingWrites,n.fromCache),e.converter)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class sg extends class{constructor(t,e){this._firestore=t,this._transaction=e,this._dataReader=Bd(t)}get(t){const e=Bf(t,this._firestore),n=new Uf(this._firestore);return this._transaction.lookup([e._key]).then((t=>{if(!t||1!==t.length)return js();const s=t[0];if(s.isFoundDocument())return new cf(this._firestore,n,s.key,s,e.converter);if(s.isNoDocument())return new cf(this._firestore,n,e._key,null,e.converter);throw js()}))}set(t,e,n){const s=Bf(t,this._firestore),r=Vf(s.converter,e,n),i=jd(this._dataReader,"Transaction.set",s._key,r,null!==s.converter,n);return this._transaction.set(s._key,i),this}update(t,e,n,...s){const r=Bf(t,this._firestore);let i;return i="string"==typeof(e=g(e))||e instanceof Cd?Yd(this._dataReader,"Transaction.update",r._key,e,n,s):Wd(this._dataReader,"Transaction.update",r._key,e),this._transaction.update(r._key,i),this}delete(t){const e=Bf(t,this._firestore);return this._transaction.delete(e._key),this}}{constructor(t,e){super(t,e),this._firestore=t}get(t){const e=Bf(t,this._firestore),n=new Kf(this._firestore);return super.get(t).then((t=>new df(this._firestore,n,e._key,t._document,new lf(!1,!1),e.converter)))}}function rg(t,e){return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>{const s=await function(t){return Ol(t).then((t=>t.datastore))}(t);new xl(t.asyncQueue,s,e,n).run()})),n.promise}(yd(t=Xl(t,gd)),(n=>e(new sg(t,n))))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ig(){return new Kd("deleteField")}function og(){return new Gd("serverTimestamp")}function ag(...t){return new Hd("arrayUnion",t)}function cg(...t){return new zd("arrayRemove",t)}function ug(t){return new Qd("increment",t)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function hg(t){return yd(t=Xl(t,gd)),new qf(t,(e=>eg(t,e)))}!function(t,e=!0){!function(t){Os=t}(i.SDK_VERSION),i._registerComponent(new m("firestore",((t,{options:n})=>{const s=t.getProvider("app").getImmediate(),r=new gd(s,new Js(t.getProvider("auth-internal")));return n=Object.assign({useFetchStreams:e},n),r._setSettings(n),r}),"PUBLIC")),i.registerVersion(Rs,"3.2.1",t),i.registerVersion(Rs,"3.2.1","esm2017")}()})); \ No newline at end of file diff --git a/frontend-dist/firebase-firestore.fc4ff51d.js b/frontend-dist/firebase-firestore.fc4ff51d.js new file mode 100644 index 0000000000..f507c81654 --- /dev/null +++ b/frontend-dist/firebase-firestore.fc4ff51d.js @@ -0,0 +1,2039 @@ +(()=>{var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function e(t,e,n,s){Object.defineProperty(t,e,{get:n,set:s,enumerable:!0,configurable:!0})}var n=t.parcelRequire94c2;n.register("4Odpp",(function(s,r){e(s.exports,"setLogLevel",(()=>Ps)),e(s.exports,"_logWarn",(()=>qs)),e(s.exports,"_debugAssert",(()=>$s)),e(s.exports,"FirestoreError",(()=>zs)),e(s.exports,"_EmptyCredentialsProvider",(()=>Ys)),e(s.exports,"Timestamp",(()=>ar)),e(s.exports,"_FieldPath",(()=>mr)),e(s.exports,"_isBase64Available",(()=>yr)),e(s.exports,"_DocumentKey",(()=>xr)),e(s.exports,"_DatabaseId",(()=>$l)),e(s.exports,"_validateIsNotUsedTogether",(()=>zl)),e(s.exports,"_cast",(()=>Xl)),e(s.exports,"connectFirestoreEmulator",(()=>ed)),e(s.exports,"DocumentReference",(()=>nd)),e(s.exports,"CollectionReference",(()=>rd)),e(s.exports,"Query",(()=>sd)),e(s.exports,"collection",(()=>id)),e(s.exports,"collectionGroup",(()=>od)),e(s.exports,"doc",(()=>ad)),e(s.exports,"refEqual",(()=>cd)),e(s.exports,"queryEqual",(()=>ud)),e(s.exports,"LoadBundleTask",(()=>dd)),e(s.exports,"CACHE_SIZE_UNLIMITED",(()=>fd)),e(s.exports,"Firestore",(()=>gd)),e(s.exports,"initializeFirestore",(()=>md)),e(s.exports,"getFirestore",(()=>pd)),e(s.exports,"ensureFirestoreConfigured",(()=>yd)),e(s.exports,"enableIndexedDbPersistence",(()=>vd)),e(s.exports,"enableMultiTabIndexedDbPersistence",(()=>bd)),e(s.exports,"clearIndexedDbPersistence",(()=>Ed)),e(s.exports,"waitForPendingWrites",(()=>Id)),e(s.exports,"enableNetwork",(()=>Sd)),e(s.exports,"disableNetwork",(()=>_d)),e(s.exports,"terminate",(()=>Nd)),e(s.exports,"loadBundle",(()=>Ad)),e(s.exports,"namedQuery",(()=>Dd)),e(s.exports,"FieldPath",(()=>Cd)),e(s.exports,"documentId",(()=>kd)),e(s.exports,"Bytes",(()=>Rd)),e(s.exports,"FieldValue",(()=>Ld)),e(s.exports,"GeoPoint",(()=>Od)),e(s.exports,"SnapshotMetadata",(()=>lf)),e(s.exports,"DocumentSnapshot",(()=>df)),e(s.exports,"QueryDocumentSnapshot",(()=>ff)),e(s.exports,"QuerySnapshot",(()=>gf)),e(s.exports,"snapshotEqual",(()=>pf)),e(s.exports,"QueryConstraint",(()=>wf)),e(s.exports,"query",(()=>vf)),e(s.exports,"where",(()=>Tf)),e(s.exports,"orderBy",(()=>If)),e(s.exports,"limit",(()=>_f)),e(s.exports,"limitToLast",(()=>Nf)),e(s.exports,"startAt",(()=>Df)),e(s.exports,"startAfter",(()=>xf)),e(s.exports,"endBefore",(()=>kf)),e(s.exports,"endAt",(()=>Rf)),e(s.exports,"AbstractUserDataWriter",(()=>Pf)),e(s.exports,"WriteBatch",(()=>qf)),e(s.exports,"getDoc",(()=>jf)),e(s.exports,"getDocFromCache",(()=>$f)),e(s.exports,"getDocFromServer",(()=>Gf)),e(s.exports,"getDocs",(()=>Hf)),e(s.exports,"getDocsFromCache",(()=>zf)),e(s.exports,"getDocsFromServer",(()=>Qf)),e(s.exports,"setDoc",(()=>Wf)),e(s.exports,"executeWrite",(()=>eg)),e(s.exports,"updateDoc",(()=>Yf)),e(s.exports,"deleteDoc",(()=>Xf)),e(s.exports,"addDoc",(()=>Jf)),e(s.exports,"onSnapshot",(()=>Zf)),e(s.exports,"onSnapshotsInSync",(()=>tg)),e(s.exports,"Transaction",(()=>sg)),e(s.exports,"runTransaction",(()=>rg)),e(s.exports,"deleteField",(()=>ig)),e(s.exports,"serverTimestamp",(()=>og)),e(s.exports,"arrayUnion",(()=>ag)),e(s.exports,"arrayRemove",(()=>cg)),e(s.exports,"increment",(()=>ug)),e(s.exports,"writeBatch",(()=>hg));var i=n("dN8oq"),o=n("6kwV5"); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +const a=function(t){const e=[];let n=0;for(let s=0;s>6|192,e[n++]=63&r|128):55296==(64512&r)&&s+1>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=63&r|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=63&r|128)}return e},c={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let e=0;e>2,h=(3&r)<<4|o>>4;let l=(15&o)<<2|c>>6,d=63&c;a||(d=64,i||(l=64)),s.push(n[u],n[h],n[l],n[d])}return s.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(a(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):function(t){const e=[];let n=0,s=0;for(;n191&&r<224){const i=t[n++];e[s++]=String.fromCharCode((31&r)<<6|63&i)}else if(r>239&&r<365){const i=((7&r)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[s++]=String.fromCharCode(55296+(i>>10)),e[s++]=String.fromCharCode(56320+(1023&i))}else{const i=t[n++],o=t[n++];e[s++]=String.fromCharCode((15&r)<<12|(63&i)<<6|63&o)}}return e.join("")}(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let e=0;e>4;if(s.push(c),64!==o){const t=i<<4&240|o>>2;if(s.push(t),64!==a){const t=o<<6&192|a;s.push(t)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}},u=function(t){return function(t){const e=a(t);return c.encodeByteArray(e,!0)}(t).replace(/\./g,"")}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function h(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function l(){return!function(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(t){return!1}}()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function d(t,e){if(t===e)return!0;const n=Object.keys(t),s=Object.keys(e);for(const r of n){if(!s.includes(r))return!1;const n=t[r],i=e[r];if(f(n)&&f(i)){if(!d(n,i))return!1}else if(n!==i)return!1}for(const t of s)if(!n.includes(t))return!1;return!0}function f(t){return null!==t&&"object"==typeof t} +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function g(t){return t&&t._delegate?t._delegate:t}class m{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var p,y;(y=p||(p={}))[y.DEBUG=0]="DEBUG",y[y.VERBOSE=1]="VERBOSE",y[y.INFO=2]="INFO",y[y.WARN=3]="WARN",y[y.ERROR=4]="ERROR",y[y.SILENT=5]="SILENT";const w={debug:p.DEBUG,verbose:p.VERBOSE,info:p.INFO,warn:p.WARN,error:p.ERROR,silent:p.SILENT},v=p.INFO,b={[p.DEBUG]:"log",[p.VERBOSE]:"log",[p.INFO]:"info",[p.WARN]:"warn",[p.ERROR]:"error"},T=(t,e,...n)=>{if(e>>0),C=0;function k(t,e,n){return t.call.apply(t.bind,arguments)}function R(t,e,n){if(!t)throw Error();if(2e?1:0}t:{var z=_.navigator;if(z){var Q=z.userAgent;if(Q){K=Q;break t}}K=""}function W(t,e,n){for(const s in t)e.call(n,t[s],s,t)}function Y(t){const e={};for(const n in t)e[n]=t[n];return e}var X="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function J(t,e){let n,s;for(let e=1;eparseFloat(ut)){tt=String(lt);break t}}tt=ut}var dt,ft={};function gt(){return function(t){var e=ft;return Object.prototype.hasOwnProperty.call(e,9)?e[9]:e[9]=t(9)}((function(){let t=0;const e=$(String(tt)).split("."),n=$("9").split("."),s=Math.max(e.length,n.length);for(let o=0;0==t&&o>>0);function Ut(t){return"function"==typeof t?t:(t[Vt]||(t[Vt]=function(e){return t.handleEvent(e)}),t[Vt])}function qt(){F.call(this),this.i=new _t(this),this.P=this,this.I=null}function Bt(t,e){var n,s=t.I;if(s)for(n=[];s;s=s.I)n.push(s);if(t=t.P,s=e.type||e,"string"==typeof e)e=new wt(e,t);else if(e instanceof wt)e.target=e.target||t;else{var r=e;J(e=new wt(s,t),r)}if(r=!0,n)for(var i=n.length-1;0<=i;i--){var o=e.g=n[i];r=jt(o,s,!0,e)&&r}if(r=jt(o=e.g=t,s,!0,e)&&r,r=jt(o,s,!1,e)&&r,n)for(i=0;inew zt),(t=>t.reset()));class zt{constructor(){this.next=this.g=this.h=null}set(t,e){this.h=t,this.g=e,this.next=null}reset(){this.next=this.g=this.h=null}}function Qt(t){_.setTimeout((()=>{throw t}),0)}function Wt(t,e){Gt||function(){var t=_.Promise.resolve(void 0);Gt=function(){t.then(Jt)}}(),Yt||(Gt(),Yt=!0),Xt.add(t,e)}var Yt=!1,Xt=new class{constructor(){this.h=this.g=null}add(t,e){const n=Ht.get();n.set(t,e),this.h?this.h.next=n:this.g=n,this.h=n}};function Jt(){for(var t;t=$t();){try{t.h.call(t.g)}catch(t){Qt(t)}var e=Ht;e.j(t),100>e.h&&(e.h++,t.next=e.g,e.g=t)}Yt=!1}function Zt(t,e){qt.call(this),this.h=t||1,this.g=e||_,this.j=L(this.kb,this),this.l=Date.now()}function te(t){t.da=!1,t.S&&(t.g.clearTimeout(t.S),t.S=null)}function ee(t,e,n){if("function"==typeof t)n&&(t=L(t,n));else{if(!t||"function"!=typeof t.handleEvent)throw Error("Invalid listener argument");t=L(t.handleEvent,t)}return 2147483647{t.g=null,t.i&&(t.i=!1,ne(t))}),t.j);const e=t.h;t.h=null,t.m.apply(null,e)}M(Zt,qt),(E=Zt.prototype).da=!1,E.S=null,E.kb=function(){if(this.da){var t=Date.now()-this.l;0s.length)){var r=s[1];if(Array.isArray(r)&&!(1>r.length)){var i=r[0];if("noop"!=i&&"stop"!=i&&"close"!=i)for(var o=1;oe.length?Le:(e=e.substr(s,n),t.C=s+n,e))}function Ue(t){t.Y=Date.now()+t.P,qe(t,t.P)}function qe(t,e){if(null!=t.B)throw Error("WatchDog timer not null");t.B=we(L(t.eb,t),e)}function Be(t){t.B&&(_.clearTimeout(t.B),t.B=null)}function je(t){0==t.l.G||t.I||ds(t.l,t)}function Ke(t){Be(t);var e=t.L;e&&"function"==typeof e.na&&e.na(),t.L=null,te(t.W),ae(t.V),t.g&&(e=t.g,t.g=null,e.abort(),e.na())}function $e(t,e){try{var n=t.l;if(0!=n.G&&(n.g==t||In(n.i,t)))if(n.I=t.N,!t.J&&In(n.i,t)&&3==n.G){try{var s=n.Ca.g.parse(e)}catch(t){s=null}if(Array.isArray(s)&&3==s.length){var r=s;if(0==r[0]){t:if(!n.u){if(n.g){if(!(n.g.F+3e3r[2]&&n.N&&0==n.A&&!n.v&&(n.v=we(L(n.ab,n),6e3));if(1>=En(n.i)&&n.ka){try{n.ka()}catch(t){}n.ka=void 0}}else gs(n,11)}else if((t.J||n.g==t)&&ls(n),!j(e))for(r=n.Ca.g.parse(e),e=0;eh)&&(3!=h||it||this.g&&(this.h.h||this.g.ga()||Wn(this.g)))){this.I||4!=h||7==e||ge(8==e||0>=l?3:2),Be(this);var n=this.g.ba();this.N=n;e:if(Fe(this)){var s=Wn(this.g);t="";var r=s.length,i=4==Qn(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){Ke(this),je(this);var o="";break e}this.h.i=new _.TextDecoder}for(e=0;ee)throw Error("Bad port number "+e);t.m=e}else t.m=null}function en(t,e,n){e instanceof fn?(t.h=e,function(t,e){e&&!t.j&&(gn(t),t.i=null,t.g.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(mn(this,e),yn(this,n,t))}),t)),t.j=e}(t.h,t.g)):(n||(e=on(e,ln)),t.h=new fn(e,t.g))}function nn(t,e,n){t.h.set(e,n)}function sn(t){return nn(t,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),t}function rn(t,e){return t?e?decodeURI(t.replace(/%25/g,"%2525")):decodeURIComponent(t):""}function on(t,e,n){return"string"==typeof t?(t=encodeURI(t).replace(e,an),n&&(t=t.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),t):null}function an(t){return"%"+((t=t.charCodeAt(0))>>4&15).toString(16)+(15&t).toString(16)}Ye.prototype.toString=function(){var t=[],e=this.j;e&&t.push(on(e,cn,!0),":");var n=this.i;return(n||"file"==e)&&(t.push("//"),(e=this.s)&&t.push(on(e,cn,!0),"@"),t.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&t.push(":",String(n))),(n=this.l)&&(this.i&&"/"!=n.charAt(0)&&t.push("/"),t.push(on(n,"/"==n.charAt(0)?hn:un,!0))),(n=this.h.toString())&&t.push("?",n),(n=this.o)&&t.push("#",on(n,dn)),t.join("")};var cn=/[#\/\?@]/g,un=/[#\?:]/g,hn=/[#\?]/g,ln=/[#\?@]/g,dn=/#/g;function fn(t,e){this.h=this.g=null,this.i=t||null,this.j=!!e}function gn(t){t.g||(t.g=new He,t.h=0,t.i&&function(t,e){if(t){t=t.split("&");for(var n=0;n2*t.i&&ze(t)))}function pn(t,e){return gn(t),e=wn(t,e),Qe(t.g.h,e)}function yn(t,e,n){mn(t,e),0=t.j}function En(t){return t.h?1:t.g?t.g.size:0}function In(t,e){return t.h?t.h==e:!!t.g&&t.g.has(e)}function Sn(t,e){t.g?t.g.add(e):t.h=e}function _n(t,e){t.h&&t.h==e?t.h=null:t.g&&t.g.has(e)&&t.g.delete(e)}function Nn(t){if(null!=t.h)return t.i.concat(t.h.D);if(null!=t.g&&0!==t.g.size){let e=t.i;for(const n of t.g.values())e=e.concat(n.D);return e}return B(t.i)}function An(){}function Dn(){this.g=new An}function xn(t,e,n){const s=n||"";try{Ge(t,(function(t,n){let r=t;D(t)&&(r=Kt(t)),e.push(s+n+"="+encodeURIComponent(r))}))}catch(t){throw e.push(s+"type="+encodeURIComponent("_badmap")),t}}function Cn(t,e,n,s,r){try{e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null,r(s)}catch(t){}}function kn(t){this.l=t.$b||null,this.j=t.ib||!1}function Rn(t,e){qt.call(this),this.D=t,this.u=e,this.m=void 0,this.readyState=Ln,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}vn.prototype.cancel=function(){if(this.i=Nn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const t of this.g.values())t.cancel();this.g.clear()}},An.prototype.stringify=function(t){return _.JSON.stringify(t,void 0)},An.prototype.parse=function(t){return _.JSON.parse(t,void 0)},M(kn,Te),kn.prototype.g=function(){return new Rn(this.l,this.j)},kn.prototype.i=function(t){return function(){return t}}({}),M(Rn,qt);var Ln=0;function On(t){t.j.read().then(t.Sa.bind(t)).catch(t.ha.bind(t))}function Mn(t){t.readyState=4,t.l=null,t.j=null,t.A=null,Fn(t)}function Fn(t){t.onreadystatechange&&t.onreadystatechange.call(t)}(E=Rn.prototype).open=function(t,e){if(this.readyState!=Ln)throw this.abort(),Error("Error reopening a connection");this.C=t,this.B=e,this.readyState=1,Fn(this)},E.send=function(t){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const e={headers:this.v,method:this.C,credentials:this.m,cache:void 0};t&&(e.body=t),(this.D||_).fetch(new Request(this.B,e)).then(this.Va.bind(this),this.ha.bind(this))},E.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,Mn(this)),this.readyState=Ln},E.Va=function(t){if(this.g&&(this.l=t,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=t.headers,this.readyState=2,Fn(this)),this.g&&(this.readyState=3,Fn(this),this.g)))if("arraybuffer"===this.responseType)t.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==_.ReadableStream&&"body"in t){if(this.j=t.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;On(this)}else t.text().then(this.Ua.bind(this),this.ha.bind(this))},E.Sa=function(t){if(this.g){if(this.u&&t.value)this.response.push(t.value);else if(!this.u){var e=t.value?t.value:new Uint8Array(0);(e=this.A.decode(e,{stream:!t.done}))&&(this.response=this.responseText+=e)}t.done?Mn(this):Fn(this),3==this.readyState&&On(this)}},E.Ua=function(t){this.g&&(this.response=this.responseText=t,Mn(this))},E.Ta=function(t){this.g&&(this.response=t,Mn(this))},E.ha=function(){this.g&&Mn(this)},E.setRequestHeader=function(t,e){this.v.append(t,e)},E.getResponseHeader=function(t){return this.h&&this.h.get(t.toLowerCase())||""},E.getAllResponseHeaders=function(){if(!this.h)return"";const t=[],e=this.h.entries();for(var n=e.next();!n.done;)n=n.value,t.push(n[0]+": "+n[1]),n=e.next();return t.join("\r\n")},Object.defineProperty(Rn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(t){this.m=t?"include":"same-origin"}});var Pn=_.JSON.parse;function Vn(t){qt.call(this),this.headers=new He,this.u=t||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=Un,this.K=this.L=!1}M(Vn,qt);var Un="",qn=/^https?$/i,Bn=["POST","PUT"];function jn(t){return"content-type"==t.toLowerCase()}function Kn(t,e){t.h=!1,t.g&&(t.l=!0,t.g.abort(),t.l=!1),t.j=e,t.m=5,$n(t),Hn(t)}function $n(t){t.D||(t.D=!0,Bt(t,"complete"),Bt(t,"error"))}function Gn(t){if(t.h&&void 0!==S&&(!t.C[1]||4!=Qn(t)||2!=t.ba()))if(t.v&&4==Qn(t))ee(t.Fa,0,t);else if(Bt(t,"readystatechange"),4==Qn(t)){t.h=!1;try{const a=t.ba();t:switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var e=!0;break t;default:e=!1}var n;if(!(n=e)){var s;if(s=0===a){var r=String(t.H).match(We)[1]||null;if(!r&&_.self&&_.self.location){var i=_.self.location.protocol;r=i.substr(0,i.length-1)}s=!qn.test(r?r.toLowerCase():"")}n=s}if(n)Bt(t,"complete"),Bt(t,"success");else{t.m=6;try{var o=2n)e=Math.max(0,r[o].h-100),i=!1;else try{xn(a,t,"req"+n+"_")}catch(t){s&&s(a)}}if(i){s=t.join("&");break t}}}return t=t.l.splice(0,n),e.D=t,s}function as(t){t.g||t.u||(t.Y=1,Wt(t.Ga,t),t.A=0)}function cs(t){return!(t.g||t.u||3<=t.A)&&(t.Y++,t.u=we(L(t.Ga,t),fs(t,t.A)),t.A++,!0)}function us(t){null!=t.B&&(_.clearTimeout(t.B),t.B=null)}function hs(t){t.g=new xe(t,t.h,"rpc",t.Y),null===t.o&&(t.g.H=t.s),t.g.O=0;var e=Xe(t.oa);nn(e,"RID","rpc"),nn(e,"SID",t.J),nn(e,"CI",t.N?"0":"1"),nn(e,"AID",t.U),is(t,e),nn(e,"TYPE","xmlhttp"),t.o&&t.s&&Yn(e,t.o,t.s),t.K&&t.g.setTimeout(t.K);var n=t.g;t=t.la,n.K=1,n.v=sn(Xe(e)),n.s=null,n.U=!0,Me(n,t)}function ls(t){null!=t.v&&(_.clearTimeout(t.v),t.v=null)}function ds(t,e){var n=null;if(t.g==e){ls(t),us(t),t.g=null;var s=2}else{if(!In(t.i,e))return;n=e.D,_n(t.i,e),s=1}if(t.I=e.N,0!=t.G)if(e.i)if(1==s){n=e.s?e.s.length:0,e=Date.now()-e.F;var r=t.C;Bt(s=de(),new ye(s,n,e,r)),ss(t)}else as(t);else if(3==(r=e.o)||0==r&&0=t.i.j-(t.m?1:0)||(t.m?(t.l=e.D.concat(t.l),0):1==t.G||2==t.G||t.C>=(t.Xa?0:t.Ya)||(t.m=we(L(t.Ha,t,e),fs(t,t.C)),t.C++,0)))}(t,e)||2==s&&cs(t)))switch(n&&0e?null:"string"==typeof t?t.charAt(e):t[e]}(r.T()),n=_.FormData&&t instanceof _.FormData,!(0<=V(Bn,e))||s||n||r.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),r.forEach((function(t,e){this.g.setRequestHeader(e,t)}),this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{zn(this),0=this.O)){var t=2*this.O;this.h.info("BP detection timer enabled: "+t),this.B=we(L(this.bb,this),t)}},E.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,pe(10),ts(this),hs(this))},E.ab=function(){null!=this.v&&(this.v=null,ts(this),cs(this),pe(19))},E.jb=function(t){t?(this.h.info("Successfully pinged google.com"),pe(2)):(this.h.info("Failed to ping google.com"),pe(1))},(E=ws.prototype).xa=function(){},E.wa=function(){},E.va=function(){},E.ua=function(){},E.Oa=function(){},vs.prototype.g=function(t,e){return new bs(t,e)},M(bs,qt),bs.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var t=this.g,e=this.l,n=this.h||void 0;t.Wa&&(t.h.info("Origin Trials enabled."),Wt(L(t.hb,t,e))),pe(0),t.W=e,t.aa=n||{},t.N=t.X,t.F=ps(t,null,t.W),ss(t)},bs.prototype.close=function(){Zn(this.g)},bs.prototype.u=function(t){if("string"==typeof t){var e={};e.__data__=t,ns(this.g,e)}else this.v?((e={}).__data__=Kt(t),ns(this.g,e)):ns(this.g,t)},bs.prototype.M=function(){this.g.j=null,delete this.j,Zn(this.g),delete this.g,bs.Z.M.call(this)},M(Ts,Ne),M(Es,Ae),M(Is,ws),Is.prototype.xa=function(){Bt(this.g,"a")},Is.prototype.wa=function(t){Bt(this.g,new Ts(t))},Is.prototype.va=function(t){Bt(this.g,new Es(t))},Is.prototype.ua=function(){Bt(this.g,"b")},vs.prototype.createWebChannel=vs.prototype.g,bs.prototype.send=bs.prototype.u,bs.prototype.open=bs.prototype.m,bs.prototype.close=bs.prototype.close,ve.NO_ERROR=0,ve.TIMEOUT=8,ve.HTTP_ERROR=6,be.COMPLETE="complete",Ie.EventType=_e,_e.OPEN="a",_e.CLOSE="b",_e.ERROR="c",_e.MESSAGE="d",qt.prototype.listen=qt.prototype.N,Vn.prototype.listenOnce=Vn.prototype.O,Vn.prototype.getLastError=Vn.prototype.La,Vn.prototype.getLastErrorCode=Vn.prototype.Da,Vn.prototype.getStatus=Vn.prototype.ba,Vn.prototype.getResponseJson=Vn.prototype.Qa,Vn.prototype.getResponseText=Vn.prototype.ga,Vn.prototype.send=Vn.prototype.ea;var Ss=ve,_s=be,Ns=he,As=10,Ds=11,xs=kn,Cs=Ie,ks=Vn;const Rs="@firebase/firestore"; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ls{constructor(t){this.uid=t}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}Ls.UNAUTHENTICATED=new Ls(null),Ls.GOOGLE_CREDENTIALS=new Ls("google-credentials-uid"),Ls.FIRST_PARTY=new Ls("first-party-uid"),Ls.MOCK_USER=new Ls("mock-user"); +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +let Os="9.3.0"; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Ms=new class{constructor(t){this.name=t,this._logLevel=v,this._logHandler=T,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in p))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel="string"==typeof t?w[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if("function"!=typeof t)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,p.DEBUG,...t),this._logHandler(this,p.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,p.VERBOSE,...t),this._logHandler(this,p.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,p.INFO,...t),this._logHandler(this,p.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,p.WARN,...t),this._logHandler(this,p.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,p.ERROR,...t),this._logHandler(this,p.ERROR,...t)}}("@firebase/firestore");function Fs(){return Ms.logLevel}function Ps(t){Ms.setLogLevel(t)}function Vs(t,...e){if(Ms.logLevel<=p.DEBUG){const n=e.map(Bs);Ms.debug(`Firestore (${Os}): ${t}`,...n)}}function Us(t,...e){if(Ms.logLevel<=p.ERROR){const n=e.map(Bs);Ms.error(`Firestore (${Os}): ${t}`,...n)}}function qs(t,...e){if(Ms.logLevel<=p.WARN){const n=e.map(Bs);Ms.warn(`Firestore (${Os}): ${t}`,...n)}}function Bs(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */var e} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function js(t="Unexpected state"){const e=`FIRESTORE (${Os}) INTERNAL ASSERTION FAILED: `+t;throw Us(e),new Error(e)}function Ks(t,e){t||js()}function $s(t,e){t||js()}function Gs(t,e){return t} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Hs={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class zs extends Error{constructor(t,e){super(e),this.code=t,this.message=e,this.name="FirebaseError",this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qs{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ws{constructor(t,e){this.user=e,this.type="OAuth",this.authHeaders={},this.authHeaders.Authorization=`Bearer ${t}`}}class Ys{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,e){t.enqueueRetryable((()=>e(Ls.UNAUTHENTICATED)))}shutdown(){}}class Xs{constructor(t){this.token=t,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(t,e){this.changeListener=e,t.enqueueRetryable((()=>e(this.token.user)))}shutdown(){this.changeListener=null}}class Js{constructor(t){this.t=t,this.currentUser=Ls.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,e){let n=this.i;const s=t=>this.i!==n?(n=this.i,e(t)):Promise.resolve();let r=new Qs;this.o=()=>{this.i++,this.currentUser=this.u(),r.resolve(),r=new Qs,t.enqueueRetryable((()=>s(this.currentUser)))};const i=()=>{const e=r;t.enqueueRetryable((async()=>{await e.promise,await s(this.currentUser)}))},o=t=>{Vs("FirebaseCredentialsProvider","Auth detected"),this.auth=t,this.auth.addAuthTokenListener(this.o),i()};this.t.onInit((t=>o(t))),setTimeout((()=>{if(!this.auth){const t=this.t.getImmediate({optional:!0});t?o(t):(Vs("FirebaseCredentialsProvider","Auth not yet detected"),r.resolve(),r=new Qs)}}),0),i()}getToken(){const t=this.i,e=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(e).then((e=>this.i!==t?(Vs("FirebaseCredentialsProvider","getToken aborted due to token change."),this.getToken()):e?(Ks("string"==typeof e.accessToken),new Ws(e.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return Ks(null===t||"string"==typeof t),new Ls(t)}}class Zs{constructor(t,e,n){this.h=t,this.l=e,this.m=n,this.type="FirstParty",this.user=Ls.FIRST_PARTY}get authHeaders(){const t={"X-Goog-AuthUser":this.l},e=this.h.auth.getAuthHeaderValueForFirstParty([]);return e&&(t.Authorization=e),this.m&&(t["X-Goog-Iam-Authorization-Token"]=this.m),t}}class tr{constructor(t,e,n){this.h=t,this.l=e,this.m=n}getToken(){return Promise.resolve(new Zs(this.h,this.l,this.m))}start(t,e){t.enqueueRetryable((()=>e(Ls.FIRST_PARTY)))}shutdown(){}invalidateToken(){}} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class er{constructor(t,e){this.previousValue=t,e&&(e.sequenceNumberHandler=t=>this.g(t),this.p=t=>e.writeSequenceNumber(t))}g(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.p&&this.p(t),t}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function nr(t){const e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(let e=0;ee?1:0}function ir(t,e,n){return t.length===e.length&&t.every(((t,s)=>n(t,e[s])))}function or(t){return t+"\0"} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ar{constructor(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new zs(Hs.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}static now(){return ar.fromMillis(Date.now())}static fromDate(t){return ar.fromMillis(t.getTime())}static fromMillis(t){const e=Math.floor(t/1e3),n=Math.floor(1e6*(t-1e3*e));return new ar(e,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(t){return this.seconds===t.seconds?rr(this.nanoseconds,t.nanoseconds):rr(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cr{constructor(t){this.timestamp=t}static fromTimestamp(t){return new cr(t)}static min(){return new cr(new ar(0,0))}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ur(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function hr(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function lr(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dr{constructor(t,e,n){void 0===e?e=0:e>t.length&&js(),void 0===n?n=t.length-e:n>t.length-e&&js(),this.segments=t,this.offset=e,this.len=n}get length(){return this.len}isEqual(t){return 0===dr.comparator(this,t)}child(t){const e=this.segments.slice(this.offset,this.limit());return t instanceof dr?t.forEach((t=>{e.push(t)})):e.push(t),this.construct(e)}limit(){return this.offset+this.length}popFirst(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(t){return this.segments[this.offset+t]}isEmpty(){return 0===this.length}isPrefixOf(t){if(t.lengthr)return 1}return t.lengthe.length?1:0}}class fr extends dr{construct(t,e,n){return new fr(t,e,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...t){const e=[];for(const n of t){if(n.indexOf("//")>=0)throw new zs(Hs.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);e.push(...n.split("/").filter((t=>t.length>0)))}return new fr(e)}static emptyPath(){return new fr([])}}const gr=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class mr extends dr{construct(t,e,n){return new mr(t,e,n)}static isValidIdentifier(t){return gr.test(t)}canonicalString(){return this.toArray().map((t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),mr.isValidIdentifier(t)||(t="`"+t+"`"),t))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new mr(["__name__"])}static fromServerFormat(t){const e=[];let n="",s=0;const r=()=>{if(0===n.length)throw new zs(Hs.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);e.push(n),n=""};let i=!1;for(;st.isEqual(e)))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function yr(){return"undefined"!=typeof atob} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class wr{constructor(t){this.binaryString=t}static fromBase64String(t){const e=atob(t);return new wr(e)}static fromUint8Array(t){const e=function(t){let e="";for(let n=0;n=Number.MIN_SAFE_INTEGER} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xr{constructor(t){this.path=t}static fromPath(t){return new xr(fr.fromString(t))}static fromName(t){return new xr(fr.fromString(t).popFirst(5))}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}isEqual(t){return null!==t&&0===fr.comparator(this.path,t.path)}toString(){return this.path.toString()}static comparator(t,e){return fr.comparator(t.path,e.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new xr(new fr(t.slice()))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Cr(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Ir(t)?4:10:js()}function kr(t,e){const n=Cr(t);if(n!==Cr(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return _r(t).isEqual(_r(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;const n=br(t.timestampValue),s=br(e.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return Er(t.bytesValue).isEqual(Er(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return Tr(t.geoPointValue.latitude)===Tr(e.geoPointValue.latitude)&&Tr(t.geoPointValue.longitude)===Tr(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return Tr(t.integerValue)===Tr(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){const n=Tr(t.doubleValue),s=Tr(e.doubleValue);return n===s?Ar(n)===Ar(s):isNaN(n)&&isNaN(s)}return!1}(t,e);case 9:return ir(t.arrayValue.values||[],e.arrayValue.values||[],kr);case 10:return function(t,e){const n=t.mapValue.fields||{},s=e.mapValue.fields||{};if(ur(n)!==ur(s))return!1;for(const t in n)if(n.hasOwnProperty(t)&&(void 0===s[t]||!kr(n[t],s[t])))return!1;return!0}(t,e);default:return js()}}function Rr(t,e){return void 0!==(t.values||[]).find((t=>kr(t,e)))}function Lr(t,e){const n=Cr(t),s=Cr(e);if(n!==s)return rr(n,s);switch(n){case 0:return 0;case 1:return rr(t.booleanValue,e.booleanValue);case 2:return function(t,e){const n=Tr(t.integerValue||t.doubleValue),s=Tr(e.integerValue||e.doubleValue);return ns?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(t,e);case 3:return Or(t.timestampValue,e.timestampValue);case 4:return Or(_r(t),_r(e));case 5:return rr(t.stringValue,e.stringValue);case 6:return function(t,e){const n=Er(t),s=Er(e);return n.compareTo(s)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){const n=t.split("/"),s=e.split("/");for(let t=0;te.mapValue.fields[t]=Kr(n))),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Kr(t.arrayValue.values[n]);return e}return Object.assign({},t)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class $r{constructor(t){this.value=t}static empty(){return new $r({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let e=this.value;for(let n=0;n{if(!e.isImmediateParentOf(r)){const t=this.getFieldsMap(e);this.applyChanges(t,n,s),n={},s=[],e=r.popLast()}t?n[r.lastSegment()]=Kr(t):s.push(r.lastSegment())}));const r=this.getFieldsMap(e);this.applyChanges(r,n,s)}delete(t){const e=this.field(t.popLast());jr(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]}isEqual(t){return kr(this.value,t.value)}getFieldsMap(t){let e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(let n=0;nt[e]=n));for(const e of n)delete t[e]}clone(){return new $r(Kr(this.value))}}function Gr(t){const e=[];return hr(t.fields,((t,n)=>{const s=new mr([t]);if(jr(n)){const t=Gr(n.mapValue).fields;if(0===t.length)e.push(s);else for(const n of t)e.push(s.child(n))}else e.push(s)})),new pr(e) +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class Hr{constructor(t,e,n,s,r){this.key=t,this.documentType=e,this.version=n,this.data=s,this.documentState=r}static newInvalidDocument(t){return new Hr(t,0,cr.min(),$r.empty(),0)}static newFoundDocument(t,e,n){return new Hr(t,1,e,n,0)}static newNoDocument(t,e){return new Hr(t,2,e,$r.empty(),0)}static newUnknownDocument(t,e){return new Hr(t,3,e,$r.empty(),2)}convertToFoundDocument(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=$r.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=$r.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(t){return t instanceof Hr&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}clone(){return new Hr(this.key,this.documentType,this.version,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zr{constructor(t,e=null,n=[],s=[],r=null,i=null,o=null){this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=s,this.limit=r,this.startAt=i,this.endAt=o,this.A=null}}function Qr(t,e=null,n=[],s=[],r=null,i=null,o=null){return new zr(t,e,n,s,r,i,o)}function Wr(t){const e=Gs(t);if(null===e.A){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((t=>function(t){return t.field.canonicalString()+t.op.toString()+Mr(t.value)}(t))).join(","),t+="|ob:",t+=e.orderBy.map((t=>function(t){return t.field.canonicalString()+t.dir}(t))).join(","),Nr(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=ci(e.startAt)),e.endAt&&(t+="|ub:",t+=ci(e.endAt)),e.A=t}return e.A}function Yr(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n":return t>0;case">=":return t>=0;default:return js()}}v(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}}class Zr extends Jr{constructor(t,e,n){super(t,e,n),this.key=xr.fromName(n.referenceValue)}matches(t){const e=xr.comparator(t.key,this.key);return this.P(e)}}class ti extends Jr{constructor(t,e){super(t,"in",e),this.keys=ni("in",e)}matches(t){return this.keys.some((e=>e.isEqual(t.key)))}}class ei extends Jr{constructor(t,e){super(t,"not-in",e),this.keys=ni("not-in",e)}matches(t){return!this.keys.some((e=>e.isEqual(t.key)))}}function ni(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((t=>xr.fromName(t.referenceValue)))}class si extends Jr{constructor(t,e){super(t,"array-contains",e)}matches(t){const e=t.data.field(this.field);return Ur(e)&&Rr(e.arrayValue,this.value)}}class ri extends Jr{constructor(t,e){super(t,"in",e)}matches(t){const e=t.data.field(this.field);return null!==e&&Rr(this.value.arrayValue,e)}}class ii extends Jr{constructor(t,e){super(t,"not-in",e)}matches(t){if(Rr(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const e=t.data.field(this.field);return null!==e&&!Rr(this.value.arrayValue,e)}}class oi extends Jr{constructor(t,e){super(t,"array-contains-any",e)}matches(t){const e=t.data.field(this.field);return!(!Ur(e)||!e.arrayValue.values)&&e.arrayValue.values.some((t=>Rr(this.value.arrayValue,t)))}}class ai{constructor(t,e){this.position=t,this.before=e}}function ci(t){return`${t.before?"b":"a"}:${t.position.map((t=>Mr(t))).join(",")}`}class ui{constructor(t,e="asc"){this.field=t,this.dir=e}}function hi(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function li(t,e,n){let s=0;for(let r=0;r0?t.explicitOrderBy[0].field:null}function vi(t){for(const e of t.filters)if(e.v())return e.field;return null}function bi(t){return null!==t.collectionGroup}function Ti(t){const e=Gs(t);if(null===e.V){e.V=[];const t=vi(e),n=wi(e);if(null!==t&&null===n)t.isKeyField()||e.V.push(new ui(t)),e.V.push(new ui(mr.keyField(),"asc"));else{let t=!1;for(const n of e.explicitOrderBy)e.V.push(n),n.field.isKeyField()&&(t=!0);if(!t){const t=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.V.push(new ui(mr.keyField(),t))}}}return e.V}function Ei(t){const e=Gs(t);if(!e.S)if("F"===e.limitType)e.S=Qr(e.path,e.collectionGroup,Ti(e),e.filters,e.limit,e.startAt,e.endAt);else{const t=[];for(const n of Ti(e)){const e="desc"===n.dir?"asc":"desc";t.push(new ui(n.field,e))}const n=e.endAt?new ai(e.endAt.position,!e.endAt.before):null,s=e.startAt?new ai(e.startAt.position,!e.startAt.before):null;e.S=Qr(e.path,e.collectionGroup,t,e.filters,e.limit,n,s)}return e.S}function Ii(t,e,n){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function Si(t,e){return Yr(Ei(t),Ei(e))&&t.limitType===e.limitType}function _i(t){return`${Wr(Ei(t))}|lt:${t.limitType}`}function Ni(t){return`Query(target=${function(t){let e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map((t=>{var e;return`${(e=t).field.canonicalString()} ${e.op} ${Mr(e.value)}`})).join(", ")}]`),Nr(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map((t=>function(t){return`${t.field.canonicalString()} (${t.dir})`}(t))).join(", ")}]`),t.startAt&&(e+=", startAt: "+ci(t.startAt)),t.endAt&&(e+=", endAt: "+ci(t.endAt)),`Target(${e})`}(Ei(t))}; limitType=${t.limitType})`}function Ai(t,e){return e.isFoundDocument()&&function(t,e){const n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):xr.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(const n of t.explicitOrderBy)if(!n.field.isKeyField()&&null===e.data.field(n.field))return!1;return!0}(t,e)&&function(t,e){for(const n of t.filters)if(!n.matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!li(t.startAt,Ti(t),e))&&(!t.endAt||!li(t.endAt,Ti(t),e))}(t,e)}function Di(t){return(e,n)=>{let s=!1;for(const r of Ti(t)){const t=xi(r,e,n);if(0!==t)return t;s=s||r.field.isKeyField()}return 0}}function xi(t,e,n){const s=t.field.isKeyField()?xr.comparator(e.key,n.key):function(t,e,n){const s=e.data.field(t),r=n.data.field(t);return null!==s&&null!==r?Lr(s,r):js()}(t.field,e,n);switch(t.dir){case"asc":return s;case"desc":return-1*s;default:return js()}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ci(t,e){if(t.D){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ar(e)?"-0":e}}function ki(t){return{integerValue:""+t}}function Ri(t,e){return Dr(e)?ki(e):Ci(t,e)} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Li{constructor(){this._=void 0}}function Oi(t,e,n){return t instanceof Pi?function(t,e){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof Vi?Ui(t,e):t instanceof qi?Bi(t,e):function(t,e){const n=Fi(t,e),s=Ki(n)+Ki(t.C);return Vr(n)&&Vr(t.C)?ki(s):Ci(t.N,s)}(t,e)}function Mi(t,e,n){return t instanceof Vi?Ui(t,e):t instanceof qi?Bi(t,e):n}function Fi(t,e){var n;return t instanceof ji?Vr(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null}class Pi extends Li{}class Vi extends Li{constructor(t){super(),this.elements=t}}function Ui(t,e){const n=$i(e);for(const e of t.elements)n.some((t=>kr(t,e)))||n.push(e);return{arrayValue:{values:n}}}class qi extends Li{constructor(t){super(),this.elements=t}}function Bi(t,e){let n=$i(e);for(const e of t.elements)n=n.filter((t=>!kr(t,e)));return{arrayValue:{values:n}}}class ji extends Li{constructor(t,e){super(),this.N=t,this.C=e}}function Ki(t){return Tr(t.integerValue||t.doubleValue)}function $i(t){return Ur(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gi{constructor(t,e){this.field=t,this.transform=e}}class Hi{constructor(t,e){this.version=t,this.transformResults=e}}class zi{constructor(t,e){this.updateTime=t,this.exists=e}static none(){return new zi}static exists(t){return new zi(void 0,t)}static updateTime(t){return new zi(t)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Qi(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}class Wi{}function Yi(t,e,n){t instanceof eo?function(t,e,n){const s=t.value.clone(),r=ro(t.fieldTransforms,e,n.transformResults);s.setAll(r),e.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(t,e,n):t instanceof no?function(t,e,n){if(!Qi(t.precondition,e))return void e.convertToUnknownDocument(n.version);const s=ro(t.fieldTransforms,e,n.transformResults),r=e.data;r.setAll(so(t)),r.setAll(s),e.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function Xi(t,e,n){t instanceof eo?function(t,e,n){if(!Qi(t.precondition,e))return;const s=t.value.clone(),r=io(t.fieldTransforms,n,e);s.setAll(r),e.convertToFoundDocument(to(e),s).setHasLocalMutations()}(t,e,n):t instanceof no?function(t,e,n){if(!Qi(t.precondition,e))return;const s=io(t.fieldTransforms,n,e),r=e.data;r.setAll(so(t)),r.setAll(s),e.convertToFoundDocument(to(e),r).setHasLocalMutations()}(t,e,n):function(t,e){Qi(t.precondition,e)&&e.convertToNoDocument(cr.min())}(t,e)}function Ji(t,e){let n=null;for(const s of t.fieldTransforms){const t=e.data.field(s.field),r=Fi(s.transform,t||null);null!=r&&(null==n&&(n=$r.empty()),n.set(s.field,r))}return n||null}function Zi(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&ir(t,e,((t,e)=>function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof Vi&&e instanceof Vi||t instanceof qi&&e instanceof qi?ir(t.elements,e.elements,kr):t instanceof ji&&e instanceof ji?kr(t.C,e.C):t instanceof Pi&&e instanceof Pi}(t.transform,e.transform)}(t,e)))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}function to(t){return t.isFoundDocument()?t.version:cr.min()}class eo extends Wi{constructor(t,e,n,s=[]){super(),this.key=t,this.value=e,this.precondition=n,this.fieldTransforms=s,this.type=0}}class no extends Wi{constructor(t,e,n,s,r=[]){super(),this.key=t,this.data=e,this.fieldMask=n,this.precondition=s,this.fieldTransforms=r,this.type=1}}function so(t){const e=new Map;return t.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const s=t.data.field(n);e.set(n,s)}})),e}function ro(t,e,n){const s=new Map;Ks(t.length===n.length);for(let r=0;r0&&(e=e.right)}return null}indexOf(t){let e=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(t,n.key);if(0===s)return e+n.left.size;s<0?n=n.left:(e+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal(((e,n)=>(t(e,n),!1)))}toString(){const t=[];return this.inorderTraversal(((e,n)=>(t.push(`${e}:${n}`),!1))),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new mo(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new mo(this.root,t,this.comparator,!1)}getReverseIterator(){return new mo(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new mo(this.root,t,this.comparator,!0)}}class mo{constructor(t,e,n,s){this.isReverse=s,this.nodeStack=[];let r=1;for(;!t.isEmpty();)if(r=e?n(t.key,e):1,s&&(r*=-1),r<0)t=this.isReverse?t.left:t.right;else{if(0===r){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class po{constructor(t,e,n,s,r){this.key=t,this.value=e,this.color=null!=n?n:po.RED,this.left=null!=s?s:po.EMPTY,this.right=null!=r?r:po.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,e,n,s,r){return new po(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=r?r:this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(t,e,n){let s=this;const r=n(t,s.key);return s=r<0?s.copy(null,null,null,s.left.insert(t,e,n),null):0===r?s.copy(null,e,null,null,null):s.copy(null,null,null,null,s.right.insert(t,e,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return po.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,e){let n,s=this;if(e(t,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(t,e),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===e(t,s.key)){if(s.right.isEmpty())return po.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(t,e))}return s.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,po.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,po.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw js();if(this.right.isRed())throw js();const t=this.left.check();if(t!==this.right.check())throw js();return t+(this.isRed()?0:1)}}po.EMPTY=null,po.RED=!0,po.BLACK=!1,po.EMPTY=new class{constructor(){this.size=0}get key(){throw js()}get value(){throw js()}get color(){throw js()}get left(){throw js()}get right(){throw js()}copy(t,e,n,s,r){return this}insert(t,e,n){return new po(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +class yo{constructor(t){this.comparator=t,this.data=new go(this.comparator)}has(t){return null!==this.data.get(t)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal(((e,n)=>(t(e),!1)))}forEachInRange(t,e){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,t[1])>=0)return;e(s.key)}}forEachWhile(t,e){let n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null}getIterator(){return new wo(this.data.getIterator())}getIteratorFrom(t){return new wo(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let e=this;return e.size{e=e.add(t)})),e}isEqual(t){if(!(t instanceof yo))return!1;if(this.size!==t.size)return!1;const e=this.data.getIterator(),n=t.data.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(0!==this.comparator(t,s))return!1}return!0}toArray(){const t=[];return this.forEach((e=>{t.push(e)})),t}toString(){const t=[];return this.forEach((e=>t.push(e))),"SortedSet("+t.toString()+")"}copy(t){const e=new yo(this.comparator);return e.data=t,e}}class wo{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vo=new go(xr.comparator);function bo(){return vo}const To=new go(xr.comparator);function Eo(){return To}const Io=new go(xr.comparator);function So(){return Io}const _o=new yo(xr.comparator);function No(...t){let e=_o;for(const n of t)e=e.add(n);return e}const Ao=new yo(rr);function Do(){return Ao} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xo{constructor(t,e,n,s,r){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=s,this.resolvedLimboDocuments=r}static createSynthesizedRemoteEventForCurrentChange(t,e){const n=new Map;return n.set(t,Co.createSynthesizedTargetChangeForCurrentChange(t,e)),new xo(cr.min(),n,Do(),bo(),No())}}class Co{constructor(t,e,n,s,r){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=s,this.removedDocuments=r}static createSynthesizedTargetChangeForCurrentChange(t,e){return new Co(wr.EMPTY_BYTE_STRING,e,No(),No(),No())}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ko{constructor(t,e,n,s){this.k=t,this.removedTargetIds=e,this.key=n,this.$=s}}class Ro{constructor(t,e){this.targetId=t,this.O=e}}class Lo{constructor(t,e,n=wr.EMPTY_BYTE_STRING,s=null){this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=s}}class Oo{constructor(){this.F=0,this.M=Po(),this.L=wr.EMPTY_BYTE_STRING,this.B=!1,this.U=!0}get current(){return this.B}get resumeToken(){return this.L}get q(){return 0!==this.F}get K(){return this.U}j(t){t.approximateByteSize()>0&&(this.U=!0,this.L=t)}W(){let t=No(),e=No(),n=No();return this.M.forEach(((s,r)=>{switch(r){case 0:t=t.add(s);break;case 2:e=e.add(s);break;case 1:n=n.add(s);break;default:js()}})),new Co(this.L,this.B,t,e,n)}G(){this.U=!1,this.M=Po()}H(t,e){this.U=!0,this.M=this.M.insert(t,e)}J(t){this.U=!0,this.M=this.M.remove(t)}Y(){this.F+=1}X(){this.F-=1}Z(){this.U=!0,this.B=!0}}class Mo{constructor(t){this.tt=t,this.et=new Map,this.nt=bo(),this.st=Fo(),this.it=new yo(rr)}rt(t){for(const e of t.k)t.$&&t.$.isFoundDocument()?this.ot(e,t.$):this.ct(e,t.key,t.$);for(const e of t.removedTargetIds)this.ct(e,t.key,t.$)}at(t){this.forEachTarget(t,(e=>{const n=this.ut(e);switch(t.state){case 0:this.ht(e)&&n.j(t.resumeToken);break;case 1:n.X(),n.q||n.G(),n.j(t.resumeToken);break;case 2:n.X(),n.q||this.removeTarget(e);break;case 3:this.ht(e)&&(n.Z(),n.j(t.resumeToken));break;case 4:this.ht(e)&&(this.lt(e),n.j(t.resumeToken));break;default:js()}}))}forEachTarget(t,e){t.targetIds.length>0?t.targetIds.forEach(e):this.et.forEach(((t,n)=>{this.ht(n)&&e(n)}))}ft(t){const e=t.targetId,n=t.O.count,s=this.dt(e);if(s){const t=s.target;if(Xr(t))if(0===n){const n=new xr(t.path);this.ct(e,n,Hr.newNoDocument(n,cr.min()))}else Ks(1===n);else this.wt(e)!==n&&(this.lt(e),this.it=this.it.add(e))}}_t(t){const e=new Map;this.et.forEach(((n,s)=>{const r=this.dt(s);if(r){if(n.current&&Xr(r.target)){const e=new xr(r.target.path);null!==this.nt.get(e)||this.gt(s,e)||this.ct(s,e,Hr.newNoDocument(e,t))}n.K&&(e.set(s,n.W()),n.G())}}));let n=No();this.st.forEach(((t,e)=>{let s=!0;e.forEachWhile((t=>{const e=this.dt(t);return!e||2===e.purpose||(s=!1,!1)})),s&&(n=n.add(t))}));const s=new xo(t,e,this.it,this.nt,n);return this.nt=bo(),this.st=Fo(),this.it=new yo(rr),s}ot(t,e){if(!this.ht(t))return;const n=this.gt(t,e.key)?2:0;this.ut(t).H(e.key,n),this.nt=this.nt.insert(e.key,e),this.st=this.st.insert(e.key,this.yt(e.key).add(t))}ct(t,e,n){if(!this.ht(t))return;const s=this.ut(t);this.gt(t,e)?s.H(e,1):s.J(e),this.st=this.st.insert(e,this.yt(e).delete(t)),n&&(this.nt=this.nt.insert(e,n))}removeTarget(t){this.et.delete(t)}wt(t){const e=this.ut(t).W();return this.tt.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size}Y(t){this.ut(t).Y()}ut(t){let e=this.et.get(t);return e||(e=new Oo,this.et.set(t,e)),e}yt(t){let e=this.st.get(t);return e||(e=new yo(rr),this.st=this.st.insert(t,e)),e}ht(t){const e=null!==this.dt(t);return e||Vs("WatchChangeAggregator","Detected inactive target",t),e}dt(t){const e=this.et.get(t);return e&&e.q?null:this.tt.Tt(t)}lt(t){this.et.set(t,new Oo),this.tt.getRemoteKeysForTarget(t).forEach((e=>{this.ct(t,e,null)}))}gt(t,e){return this.tt.getRemoteKeysForTarget(t).has(e)}}function Fo(){return new go(xr.comparator)}function Po(){return new go(xr.comparator)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vo={asc:"ASCENDING",desc:"DESCENDING"},Uo={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"};class qo{constructor(t,e){this.databaseId=t,this.D=e}}function Bo(t,e){return t.D?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function jo(t,e){return t.D?e.toBase64():e.toUint8Array()}function Ko(t,e){return Bo(t,e.toTimestamp())}function $o(t){return Ks(!!t),cr.fromTimestamp(function(t){const e=br(t);return new ar(e.seconds,e.nanos)}(t))}function Go(t,e){return function(t){return new fr(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function Ho(t){const e=fr.fromString(t);return Ks(pa(e)),e}function zo(t,e){return Go(t.databaseId,e.path)}function Qo(t,e){const n=Ho(e);if(n.get(1)!==t.databaseId.projectId)throw new zs(Hs.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new zs(Hs.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new xr(Jo(n))}function Wo(t,e){return Go(t.databaseId,e)}function Yo(t){const e=Ho(t);return 4===e.length?fr.emptyPath():Jo(e)}function Xo(t){return new fr(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Jo(t){return Ks(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function Zo(t,e,n){return{name:zo(t,e),fields:n.value.mapValue.fields}}function ta(t,e,n){const s=Qo(t,e.name),r=$o(e.updateTime),i=new $r({mapValue:{fields:e.fields}}),o=Hr.newFoundDocument(s,r,i);return n&&o.setHasCommittedMutations(),n?o.setHasCommittedMutations():o}function ea(t,e){let n;if(e instanceof eo)n={update:Zo(t,e.key,e.value)};else if(e instanceof oo)n={delete:zo(t,e.key)};else if(e instanceof no)n={update:Zo(t,e.key,e.data),updateMask:ma(e.fieldMask)};else{if(!(e instanceof ao))return js();n={verify:zo(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((t=>function(t,e){const n=e.transform;if(n instanceof Pi)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Vi)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof qi)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof ji)return{fieldPath:e.field.canonicalString(),increment:n.C};throw js()}(0,t)))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Ko(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:js()}(t,e.precondition)),n}function na(t,e){const n=e.currentDocument?function(t){return void 0!==t.updateTime?zi.updateTime($o(t.updateTime)):void 0!==t.exists?zi.exists(t.exists):zi.none()}(e.currentDocument):zi.none(),s=e.updateTransforms?e.updateTransforms.map((e=>function(t,e){let n=null;if("setToServerValue"in e)Ks("REQUEST_TIME"===e.setToServerValue),n=new Pi;else if("appendMissingElements"in e){const t=e.appendMissingElements.values||[];n=new Vi(t)}else if("removeAllFromArray"in e){const t=e.removeAllFromArray.values||[];n=new qi(t)}else"increment"in e?n=new ji(t,e.increment):js();const s=mr.fromServerFormat(e.fieldPath);return new Gi(s,n)}(t,e))):[];if(e.update){e.update.name;const r=Qo(t,e.update.name),i=new $r({mapValue:{fields:e.update.fields}});if(e.updateMask){const t=function(t){const e=t.fieldPaths||[];return new pr(e.map((t=>mr.fromServerFormat(t))))}(e.updateMask);return new no(r,i,t,n,s)}return new eo(r,i,n,s)}if(e.delete){const s=Qo(t,e.delete);return new oo(s,n)}if(e.verify){const s=Qo(t,e.verify);return new ao(s,n)}return js()}function sa(t,e){return{documents:[Wo(t,e.path)]}}function ra(t,e){const n={structuredQuery:{}},s=e.path;null!==e.collectionGroup?(n.parent=Wo(t,s),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=Wo(t,s.popLast()),n.structuredQuery.from=[{collectionId:s.lastSegment()}]);const r=function(t){if(0===t.length)return;const e=t.map((t=>function(t){if("=="===t.op){if(Br(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NAN"}};if(qr(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(Br(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NOT_NAN"}};if(qr(t.value))return{unaryFilter:{field:la(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:la(t.field),op:ha(t.op),value:t.value}}}(t)));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}(e.filters);r&&(n.structuredQuery.where=r);const i=function(t){if(0!==t.length)return t.map((t=>function(t){return{field:la(t.field),direction:ua(t.dir)}}(t)))}(e.orderBy);i&&(n.structuredQuery.orderBy=i);const o=function(t,e){return t.D||Nr(e)?e:{value:e}}(t,e.limit);return null!==o&&(n.structuredQuery.limit=o),e.startAt&&(n.structuredQuery.startAt=aa(e.startAt)),e.endAt&&(n.structuredQuery.endAt=aa(e.endAt)),n}function ia(t){let e=Yo(t.parent);const n=t.structuredQuery,s=n.from?n.from.length:0;let r=null;if(s>0){Ks(1===s);const t=n.from[0];t.allDescendants?r=t.collectionId:e=e.child(t.collectionId)}let i=[];n.where&&(i=oa(n.where));let o=[];n.orderBy&&(o=n.orderBy.map((t=>function(t){return new ui(da(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t))));let a=null;n.limit&&(a=function(t){let e;return e="object"==typeof t?t.value:t,Nr(e)?null:e}(n.limit));let c=null;n.startAt&&(c=ca(n.startAt));let u=null;return n.endAt&&(u=ca(n.endAt)),gi(e,r,o,i,a,"F",c,u)}function oa(t){return t?void 0!==t.unaryFilter?[ga(t)]:void 0!==t.fieldFilter?[fa(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((t=>oa(t))).reduce(((t,e)=>t.concat(e))):js():[]}function aa(t){return{before:t.before,values:t.position}}function ca(t){const e=!!t.before,n=t.values||[];return new ai(n,e)}function ua(t){return Vo[t]}function ha(t){return Uo[t]}function la(t){return{fieldPath:t.canonicalString()}}function da(t){return mr.fromServerFormat(t.fieldPath)}function fa(t){return Jr.create(da(t.fieldFilter.field),function(t){switch(t){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return js()}}(t.fieldFilter.op),t.fieldFilter.value)}function ga(t){switch(t.unaryFilter.op){case"IS_NAN":const e=da(t.unaryFilter.field);return Jr.create(e,"==",{doubleValue:NaN});case"IS_NULL":const n=da(t.unaryFilter.field);return Jr.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=da(t.unaryFilter.field);return Jr.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const r=da(t.unaryFilter.field);return Jr.create(r,"!=",{nullValue:"NULL_VALUE"});default:return js()}}function ma(t){const e=[];return t.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function pa(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ya(t){let e="";for(let n=0;n0&&(e=va(e)),e=wa(t.get(n),e);return va(e)}function wa(t,e){let n=e;const s=t.length;for(let e=0;e=2),2===e)return Ks(""===t.charAt(0)&&""===t.charAt(1)),fr.emptyPath();const n=e-2,s=[];let r="";for(let i=0;in)&&js(),t.charAt(e+1)){case"":const n=t.substring(i,e);let o;0===r.length?o=n:(r+=n,o=r,r=""),s.push(o);break;case"":r+=t.substring(i,e),r+="\0";break;case"":r+=t.substring(i,e+1);break;default:js()}i=e+2}return new fr(s)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ta{constructor(t,e){this.seconds=t,this.nanoseconds=e}}class Ea{constructor(t,e,n){this.ownerId=t,this.allowTabSynchronization=e,this.leaseTimestampMs=n}}Ea.store="owner",Ea.key="owner";class Ia{constructor(t,e,n){this.userId=t,this.lastAcknowledgedBatchId=e,this.lastStreamToken=n}}Ia.store="mutationQueues",Ia.keyPath="userId";class Sa{constructor(t,e,n,s,r){this.userId=t,this.batchId=e,this.localWriteTimeMs=n,this.baseMutations=s,this.mutations=r}}Sa.store="mutations",Sa.keyPath="batchId",Sa.userMutationsIndex="userMutationsIndex",Sa.userMutationsKeyPath=["userId","batchId"];class _a{constructor(){}static prefixForUser(t){return[t]}static prefixForPath(t,e){return[t,ya(e)]}static key(t,e,n){return[t,ya(e),n]}}_a.store="documentMutations",_a.PLACEHOLDER=new _a;class Na{constructor(t,e){this.path=t,this.readTime=e}}class Aa{constructor(t,e){this.path=t,this.version=e}}class Da{constructor(t,e,n,s,r,i){this.unknownDocument=t,this.noDocument=e,this.document=n,this.hasCommittedMutations=s,this.readTime=r,this.parentPath=i}}Da.store="remoteDocuments",Da.readTimeIndex="readTimeIndex",Da.readTimeIndexPath="readTime",Da.collectionReadTimeIndex="collectionReadTimeIndex",Da.collectionReadTimeIndexPath=["parentPath","readTime"];class xa{constructor(t){this.byteSize=t}}xa.store="remoteDocumentGlobal",xa.key="remoteDocumentGlobalKey";class Ca{constructor(t,e,n,s,r,i,o){this.targetId=t,this.canonicalId=e,this.readTime=n,this.resumeToken=s,this.lastListenSequenceNumber=r,this.lastLimboFreeSnapshotVersion=i,this.query=o}}Ca.store="targets",Ca.keyPath="targetId",Ca.queryTargetsIndexName="queryTargetsIndex",Ca.queryTargetsKeyPath=["canonicalId","targetId"];class ka{constructor(t,e,n){this.targetId=t,this.path=e,this.sequenceNumber=n}}ka.store="targetDocuments",ka.keyPath=["targetId","path"],ka.documentTargetsIndex="documentTargetsIndex",ka.documentTargetsKeyPath=["path","targetId"];class Ra{constructor(t,e,n,s){this.highestTargetId=t,this.highestListenSequenceNumber=e,this.lastRemoteSnapshotVersion=n,this.targetCount=s}}Ra.key="targetGlobalKey",Ra.store="targetGlobal";class La{constructor(t,e){this.collectionId=t,this.parent=e}}La.store="collectionParents",La.keyPath=["collectionId","parent"];class Oa{constructor(t,e,n,s){this.clientId=t,this.updateTimeMs=e,this.networkEnabled=n,this.inForeground=s}}Oa.store="clientMetadata",Oa.keyPath="clientId";class Ma{constructor(t,e,n){this.bundleId=t,this.createTime=e,this.version=n}}Ma.store="bundles",Ma.keyPath="bundleId";class Fa{constructor(t,e,n){this.name=t,this.readTime=e,this.bundledQuery=n}}Fa.store="namedQueries",Fa.keyPath="name";const Pa=[Ia.store,Sa.store,_a.store,Da.store,Ca.store,Ea.store,Ra.store,ka.store,Oa.store,xa.store,La.store,Ma.store,Fa.store],Va="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Ua{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(t){this.onCommittedListeners.push(t)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((t=>t()))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qa{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(t){return this.next(void 0,t)}next(t,e){return this.callbackAttached&&js(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(e,this.error):this.wrapSuccess(t,this.result):new qa(((n,s)=>{this.nextCallback=e=>{this.wrapSuccess(t,e).next(n,s)},this.catchCallback=t=>{this.wrapFailure(e,t).next(n,s)}}))}toPromise(){return new Promise(((t,e)=>{this.next(t,e)}))}wrapUserFunction(t){try{const e=t();return e instanceof qa?e:qa.resolve(e)}catch(t){return qa.reject(t)}}wrapSuccess(t,e){return t?this.wrapUserFunction((()=>t(e))):qa.resolve(e)}wrapFailure(t,e){return t?this.wrapUserFunction((()=>t(e))):qa.reject(e)}static resolve(t){return new qa(((e,n)=>{e(t)}))}static reject(t){return new qa(((e,n)=>{n(t)}))}static waitFor(t){return new qa(((e,n)=>{let s=0,r=0,i=!1;t.forEach((t=>{++s,t.next((()=>{++r,i&&r===s&&e()}),(t=>n(t)))})),i=!0,r===s&&e()}))}static or(t){let e=qa.resolve(!1);for(const n of t)e=e.next((t=>t?qa.resolve(t):n()));return e}static forEach(t,e){const n=[];return t.forEach(((t,s)=>{n.push(e.call(this,t,s))})),this.waitFor(n)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ba{constructor(t,e){this.action=t,this.transaction=e,this.aborted=!1,this.Et=new Qs,this.transaction.oncomplete=()=>{this.Et.resolve()},this.transaction.onabort=()=>{e.error?this.Et.reject(new $a(t,e.error)):this.Et.resolve()},this.transaction.onerror=e=>{const n=Wa(e.target.error);this.Et.reject(new $a(t,n))}}static open(t,e,n,s){try{return new Ba(e,t.transaction(s,n))}catch(t){throw new $a(e,t)}}get It(){return this.Et.promise}abort(t){t&&this.Et.reject(t),this.aborted||(Vs("SimpleDb","Aborting transaction:",t?t.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}store(t){const e=this.transaction.objectStore(t);return new Ha(e)}}class ja{constructor(t,e,n){this.name=t,this.version=e,this.At=n,12.2===ja.Rt(h())&&Us("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(t){return Vs("SimpleDb","Removing database:",t),za(window.indexedDB.deleteDatabase(t)).toPromise()}static bt(){if("object"!=typeof indexedDB)return!1;if(ja.Pt())return!0;const t=h(),e=ja.Rt(t),n=00||t.indexOf("Trident/")>0||t.indexOf("Edge/")>0||n||r)}static Pt(){var t;return void 0!==o&&"YES"===(void 0===(t={})?void 0:t.Vt)}static St(t,e){return t.store(e)}static Rt(t){const e=t.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=e?e[1].split("_").slice(0,2).join("."):"-1";return Number(n)}static vt(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}async Dt(t){return this.db||(Vs("SimpleDb","Opening database:",this.name),this.db=await new Promise(((e,n)=>{const s=indexedDB.open(this.name,this.version);s.onsuccess=t=>{const n=t.target.result;e(n)},s.onblocked=()=>{n(new $a(t,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},s.onerror=e=>{const s=e.target.error;"VersionError"===s.name?n(new zs(Hs.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):"InvalidStateError"===s.name?n(new zs(Hs.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+s)):n(new $a(t,s))},s.onupgradeneeded=t=>{Vs("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',t.oldVersion);const e=t.target.result;this.At.Ct(e,s.transaction,t.oldVersion,this.version).next((()=>{Vs("SimpleDb","Database upgrade to version "+this.version+" complete")}))}}))),this.Nt&&(this.db.onversionchange=t=>this.Nt(t)),this.db}xt(t){this.Nt=t,this.db&&(this.db.onversionchange=e=>t(e))}async runTransaction(t,e,n,s){const r="readonly"===e;let i=0;for(;;){++i;try{this.db=await this.Dt(t);const e=Ba.open(this.db,t,r?"readonly":"readwrite",n),i=s(e).catch((t=>(e.abort(t),qa.reject(t)))).toPromise();return i.catch((()=>{})),await e.It,i}catch(t){const e="FirebaseError"!==t.name&&i<3;if(Vs("SimpleDb","Transaction failed with error:",t.message,"Retrying:",e),this.close(),!e)return Promise.reject(t)}}}close(){this.db&&this.db.close(),this.db=void 0}}class Ka{constructor(t){this.kt=t,this.$t=!1,this.Ot=null}get isDone(){return this.$t}get Ft(){return this.Ot}set cursor(t){this.kt=t}done(){this.$t=!0}Mt(t){this.Ot=t}delete(){return za(this.kt.delete())}}class $a extends zs{constructor(t,e){super(Hs.UNAVAILABLE,`IndexedDB transaction '${t}' failed: ${e}`),this.name="IndexedDbTransactionError"}}function Ga(t){return"IndexedDbTransactionError"===t.name}class Ha{constructor(t){this.store=t}put(t,e){let n;return void 0!==e?(Vs("SimpleDb","PUT",this.store.name,t,e),n=this.store.put(e,t)):(Vs("SimpleDb","PUT",this.store.name,"",t),n=this.store.put(t)),za(n)}add(t){return Vs("SimpleDb","ADD",this.store.name,t,t),za(this.store.add(t))}get(t){return za(this.store.get(t)).next((e=>(void 0===e&&(e=null),Vs("SimpleDb","GET",this.store.name,t,e),e)))}delete(t){return Vs("SimpleDb","DELETE",this.store.name,t),za(this.store.delete(t))}count(){return Vs("SimpleDb","COUNT",this.store.name),za(this.store.count())}Lt(t,e){const n=this.cursor(this.options(t,e)),s=[];return this.Bt(n,((t,e)=>{s.push(e)})).next((()=>s))}Ut(t,e){Vs("SimpleDb","DELETE ALL",this.store.name);const n=this.options(t,e);n.qt=!1;const s=this.cursor(n);return this.Bt(s,((t,e,n)=>n.delete()))}Kt(t,e){let n;e?n=t:(n={},e=t);const s=this.cursor(n);return this.Bt(s,e)}jt(t){const e=this.cursor({});return new qa(((n,s)=>{e.onerror=t=>{const e=Wa(t.target.error);s(e)},e.onsuccess=e=>{const s=e.target.result;s?t(s.primaryKey,s.value).next((t=>{t?s.continue():n()})):n()}}))}Bt(t,e){const n=[];return new qa(((s,r)=>{t.onerror=t=>{r(t.target.error)},t.onsuccess=t=>{const r=t.target.result;if(!r)return void s();const i=new Ka(r),o=e(r.primaryKey,r.value,i);if(o instanceof qa){const t=o.catch((t=>(i.done(),qa.reject(t))));n.push(t)}i.isDone?s():null===i.Ft?r.continue():r.continue(i.Ft)}})).next((()=>qa.waitFor(n)))}options(t,e){let n;return void 0!==t&&("string"==typeof t?n=t:e=t),{index:n,range:e}}cursor(t){let e="next";if(t.reverse&&(e="prev"),t.index){const n=this.store.index(t.index);return t.qt?n.openKeyCursor(t.range,e):n.openCursor(t.range,e)}return this.store.openCursor(t.range,e)}}function za(t){return new qa(((e,n)=>{t.onsuccess=t=>{const n=t.target.result;e(n)},t.onerror=t=>{const e=Wa(t.target.error);n(e)}}))}let Qa=!1;function Wa(t){const e=ja.Rt(h());if(e>=12.2&&e<13){const e="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(e)>=0){const t=new zs("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${e}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return Qa||(Qa=!0,setTimeout((()=>{throw t}),0)),t}}return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ya extends Ua{constructor(t,e){super(),this.Qt=t,this.currentSequenceNumber=e}}function Xa(t,e){const n=Gs(t);return ja.St(n.Qt,e)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ja{constructor(t,e,n,s){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(t,e){const n=e.mutationResults;for(let e=0;e{const n=t.get(e.key),s=n;this.applyToLocalView(s),n.isValidDocument()||s.convertToNoDocument(cr.min())}))}keys(){return this.mutations.reduce(((t,e)=>t.add(e.key)),No())}isEqual(t){return this.batchId===t.batchId&&ir(this.mutations,t.mutations,((t,e)=>Zi(t,e)))&&ir(this.baseMutations,t.baseMutations,((t,e)=>Zi(t,e)))}}class Za{constructor(t,e,n,s){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=s}static from(t,e,n){Ks(t.mutations.length===n.length);let s=So();const r=t.mutations;for(let t=0;tna(t.Wt,e)));for(let t=0;tna(t.Wt,e))),r=ar.fromMillis(e.localWriteTimeMs);return new Ja(e.batchId,r,n,s)}function uc(t){const e=ac(t.readTime),n=void 0!==t.lastLimboFreeSnapshotVersion?ac(t.lastLimboFreeSnapshotVersion):cr.min();let s;var r;return void 0!==t.query.documents?(Ks(1===(r=t.query).documents.length),s=Ei(mi(Yo(r.documents[0])))):s=function(t){return Ei(ia(t))}(t.query),new tc(s,t.targetId,0,t.lastListenSequenceNumber,e,n,wr.fromBase64String(t.resumeToken))}function hc(t,e){const n=oc(e.snapshotVersion),s=oc(e.lastLimboFreeSnapshotVersion);let r;r=Xr(e.target)?sa(t.Wt,e.target):ra(t.Wt,e.target);const i=e.resumeToken.toBase64();return new Ca(e.targetId,Wr(e.target),n,i,e.sequenceNumber,s,r)}function lc(t){const e=ia({parent:t.parent,structuredQuery:t.structuredQuery});return"LAST"===t.limitType?Ii(e,e.limit,"L"):e} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class dc{getBundleMetadata(t,e){return fc(t).get(e).next((t=>{if(t)return{id:(e=t).bundleId,createTime:ac(e.createTime),version:e.version};var e}))}saveBundleMetadata(t,e){var n;return fc(t).put({bundleId:(n=e).id,createTime:oc($o(n.createTime)),version:n.version})}getNamedQuery(t,e){return gc(t).get(e).next((t=>{if(t)return{name:(e=t).name,query:lc(e.bundledQuery),readTime:ac(e.readTime)};var e}))}saveNamedQuery(t,e){return gc(t).put(function(t){return{name:t.name,readTime:oc($o(t.readTime)),bundledQuery:t.bundledQuery}}(e))}}function fc(t){return Xa(t,Ma.store)}function gc(t){return Xa(t,Fa.store)} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class mc{constructor(){this.Gt=new pc}addToCollectionParentIndex(t,e){return this.Gt.add(e),qa.resolve()}getCollectionParents(t,e){return qa.resolve(this.Gt.getEntries(e))}}class pc{constructor(){this.index={}}add(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e]||new yo(fr.comparator),r=!s.has(n);return this.index[e]=s.add(n),r}has(t){const e=t.lastSegment(),n=t.popLast(),s=this.index[e];return s&&s.has(n)}getEntries(t){return(this.index[t]||new yo(fr.comparator)).toArray()}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yc{constructor(){this.zt=new pc}addToCollectionParentIndex(t,e){if(!this.zt.has(e)){const n=e.lastSegment(),s=e.popLast();t.addOnCommittedListener((()=>{this.zt.add(e)}));const r={collectionId:n,parent:ya(s)};return wc(t).put(r)}return qa.resolve()}getCollectionParents(t,e){const n=[],s=IDBKeyRange.bound([e,""],[or(e),""],!1,!0);return wc(t).Lt(s).next((t=>{for(const s of t){if(s.collectionId!==e)break;n.push(ba(s.parent))}return n}))}}function wc(t){return Xa(t,La.store)} +/** + * @license + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const vc={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class bc{constructor(t,e,n){this.cacheSizeCollectionThreshold=t,this.percentileToCollect=e,this.maximumSequenceNumbersToCollect=n}static withCacheSize(t){return new bc(t,bc.DEFAULT_COLLECTION_PERCENTILE,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Tc(t,e,n){const s=t.store(Sa.store),r=t.store(_a.store),i=[],o=IDBKeyRange.only(n.batchId);let a=0;const c=s.Kt({range:o},((t,e,n)=>(a++,n.delete())));i.push(c.next((()=>{Ks(1===a)})));const u=[];for(const t of n.mutations){const s=_a.key(e,t.key.path,n.batchId);i.push(r.delete(s)),u.push(t.key)}return qa.waitFor(i).next((()=>u))}function Ec(t){if(!t)return 0;let e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw js();e=t.noDocument}return JSON.stringify(e).length} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */bc.DEFAULT_COLLECTION_PERCENTILE=10,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,bc.DEFAULT=new bc(41943040,bc.DEFAULT_COLLECTION_PERCENTILE,bc.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),bc.DISABLED=new bc(-1,0,0);class Ic{constructor(t,e,n,s){this.userId=t,this.N=e,this.Ht=n,this.referenceDelegate=s,this.Jt={}}static Yt(t,e,n,s){Ks(""!==t.uid);const r=t.isAuthenticated()?t.uid:"";return new Ic(r,e,n,s)}checkEmpty(t){let e=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return _c(t).Kt({index:Sa.userMutationsIndex,range:n},((t,n,s)=>{e=!1,s.done()})).next((()=>e))}addMutationBatch(t,e,n,s){const r=Nc(t),i=_c(t);return i.add({}).next((o=>{Ks("number"==typeof o);const a=new Ja(o,e,n,s),c=function(t,e,n){const s=n.baseMutations.map((e=>ea(t.Wt,e))),r=n.mutations.map((e=>ea(t.Wt,e)));return new Sa(e,n.batchId,n.localWriteTime.toMillis(),s,r)}(this.N,this.userId,a),u=[];let h=new yo(((t,e)=>rr(t.canonicalString(),e.canonicalString())));for(const t of s){const e=_a.key(this.userId,t.key.path,o);h=h.add(t.key.path.popLast()),u.push(i.put(c)),u.push(r.put(e,_a.PLACEHOLDER))}return h.forEach((e=>{u.push(this.Ht.addToCollectionParentIndex(t,e))})),t.addOnCommittedListener((()=>{this.Jt[o]=a.keys()})),qa.waitFor(u).next((()=>a))}))}lookupMutationBatch(t,e){return _c(t).get(e).next((t=>t?(Ks(t.userId===this.userId),cc(this.N,t)):null))}Xt(t,e){return this.Jt[e]?qa.resolve(this.Jt[e]):this.lookupMutationBatch(t,e).next((t=>{if(t){const n=t.keys();return this.Jt[e]=n,n}return null}))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=IDBKeyRange.lowerBound([this.userId,n]);let r=null;return _c(t).Kt({index:Sa.userMutationsIndex,range:s},((t,e,s)=>{e.userId===this.userId&&(Ks(e.batchId>=n),r=cc(this.N,e)),s.done()})).next((()=>r))}getHighestUnacknowledgedBatchId(t){const e=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return _c(t).Kt({index:Sa.userMutationsIndex,range:e,reverse:!0},((t,e,s)=>{n=e.batchId,s.done()})).next((()=>n))}getAllMutationBatches(t){const e=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return _c(t).Lt(Sa.userMutationsIndex,e).next((t=>t.map((t=>cc(this.N,t)))))}getAllMutationBatchesAffectingDocumentKey(t,e){const n=_a.prefixForPath(this.userId,e.path),s=IDBKeyRange.lowerBound(n),r=[];return Nc(t).Kt({range:s},((n,s,i)=>{const[o,a,c]=n,u=ba(a);if(o===this.userId&&e.path.isEqual(u))return _c(t).get(c).next((t=>{if(!t)throw js();Ks(t.userId===this.userId),r.push(cc(this.N,t))}));i.done()})).next((()=>r))}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new yo(rr);const s=[];return e.forEach((e=>{const r=_a.prefixForPath(this.userId,e.path),i=IDBKeyRange.lowerBound(r),o=Nc(t).Kt({range:i},((t,s,r)=>{const[i,o,a]=t,c=ba(o);i===this.userId&&e.path.isEqual(c)?n=n.add(a):r.done()}));s.push(o)})),qa.waitFor(s).next((()=>this.Zt(t,n)))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1,r=_a.prefixForPath(this.userId,n),i=IDBKeyRange.lowerBound(r);let o=new yo(rr);return Nc(t).Kt({range:i},((t,e,r)=>{const[i,a,c]=t,u=ba(a);i===this.userId&&n.isPrefixOf(u)?u.length===s&&(o=o.add(c)):r.done()})).next((()=>this.Zt(t,o)))}Zt(t,e){const n=[],s=[];return e.forEach((e=>{s.push(_c(t).get(e).next((t=>{if(null===t)throw js();Ks(t.userId===this.userId),n.push(cc(this.N,t))})))})),qa.waitFor(s).next((()=>n))}removeMutationBatch(t,e){return Tc(t.Qt,this.userId,e).next((n=>(t.addOnCommittedListener((()=>{this.te(e.batchId)})),qa.forEach(n,(e=>this.referenceDelegate.markPotentiallyOrphaned(t,e))))))}te(t){delete this.Jt[t]}performConsistencyCheck(t){return this.checkEmpty(t).next((e=>{if(!e)return qa.resolve();const n=IDBKeyRange.lowerBound(_a.prefixForUser(this.userId)),s=[];return Nc(t).Kt({range:n},((t,e,n)=>{if(t[0]===this.userId){const e=ba(t[1]);s.push(e)}else n.done()})).next((()=>{Ks(0===s.length)}))}))}containsKey(t,e){return Sc(t,this.userId,e)}ee(t){return Ac(t).get(this.userId).next((t=>t||new Ia(this.userId,-1,"")))}}function Sc(t,e,n){const s=_a.prefixForPath(e,n.path),r=s[1],i=IDBKeyRange.lowerBound(s);let o=!1;return Nc(t).Kt({range:i,qt:!0},((t,n,s)=>{const[i,a,c]=t;i===e&&a===r&&(o=!0),s.done()})).next((()=>o))}function _c(t){return Xa(t,Sa.store)}function Nc(t){return Xa(t,_a.store)}function Ac(t){return Xa(t,Ia.store)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Dc{constructor(t){this.ne=t}next(){return this.ne+=2,this.ne}static se(){return new Dc(0)}static ie(){return new Dc(-1)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xc{constructor(t,e){this.referenceDelegate=t,this.N=e}allocateTargetId(t){return this.re(t).next((e=>{const n=new Dc(e.highestTargetId);return e.highestTargetId=n.next(),this.oe(t,e).next((()=>e.highestTargetId))}))}getLastRemoteSnapshotVersion(t){return this.re(t).next((t=>cr.fromTimestamp(new ar(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(t){return this.re(t).next((t=>t.highestListenSequenceNumber))}setTargetsMetadata(t,e,n){return this.re(t).next((s=>(s.highestListenSequenceNumber=e,n&&(s.lastRemoteSnapshotVersion=n.toTimestamp()),e>s.highestListenSequenceNumber&&(s.highestListenSequenceNumber=e),this.oe(t,s))))}addTargetData(t,e){return this.ce(t,e).next((()=>this.re(t).next((n=>(n.targetCount+=1,this.ae(e,n),this.oe(t,n))))))}updateTargetData(t,e){return this.ce(t,e)}removeTargetData(t,e){return this.removeMatchingKeysForTargetId(t,e.targetId).next((()=>Cc(t).delete(e.targetId))).next((()=>this.re(t))).next((e=>(Ks(e.targetCount>0),e.targetCount-=1,this.oe(t,e))))}removeTargets(t,e,n){let s=0;const r=[];return Cc(t).Kt(((i,o)=>{const a=uc(o);a.sequenceNumber<=e&&null===n.get(a.targetId)&&(s++,r.push(this.removeTargetData(t,a)))})).next((()=>qa.waitFor(r))).next((()=>s))}forEachTarget(t,e){return Cc(t).Kt(((t,n)=>{const s=uc(n);e(s)}))}re(t){return kc(t).get(Ra.key).next((t=>(Ks(null!==t),t)))}oe(t,e){return kc(t).put(Ra.key,e)}ce(t,e){return Cc(t).put(hc(this.N,e))}ae(t,e){let n=!1;return t.targetId>e.highestTargetId&&(e.highestTargetId=t.targetId,n=!0),t.sequenceNumber>e.highestListenSequenceNumber&&(e.highestListenSequenceNumber=t.sequenceNumber,n=!0),n}getTargetCount(t){return this.re(t).next((t=>t.targetCount))}getTargetData(t,e){const n=Wr(e),s=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let r=null;return Cc(t).Kt({range:s,index:Ca.queryTargetsIndexName},((t,n,s)=>{const i=uc(n);Yr(e,i.target)&&(r=i,s.done())})).next((()=>r))}addMatchingKeys(t,e,n){const s=[],r=Rc(t);return e.forEach((e=>{const i=ya(e.path);s.push(r.put(new ka(n,i))),s.push(this.referenceDelegate.addReference(t,n,e))})),qa.waitFor(s)}removeMatchingKeys(t,e,n){const s=Rc(t);return qa.forEach(e,(e=>{const r=ya(e.path);return qa.waitFor([s.delete([n,r]),this.referenceDelegate.removeReference(t,n,e)])}))}removeMatchingKeysForTargetId(t,e){const n=Rc(t),s=IDBKeyRange.bound([e],[e+1],!1,!0);return n.delete(s)}getMatchingKeysForTargetId(t,e){const n=IDBKeyRange.bound([e],[e+1],!1,!0),s=Rc(t);let r=No();return s.Kt({range:n,qt:!0},((t,e,n)=>{const s=ba(t[1]),i=new xr(s);r=r.add(i)})).next((()=>r))}containsKey(t,e){const n=ya(e.path),s=IDBKeyRange.bound([n],[or(n)],!1,!0);let r=0;return Rc(t).Kt({index:ka.documentTargetsIndex,qt:!0,range:s},(([t,e],n,s)=>{0!==t&&(r++,s.done())})).next((()=>r>0))}Tt(t,e){return Cc(t).get(e).next((t=>t?uc(t):null))}}function Cc(t){return Xa(t,Ca.store)}function kc(t){return Xa(t,Ra.store)}function Rc(t){return Xa(t,ka.store)} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */async function Lc(t){if(t.code!==Hs.FAILED_PRECONDITION||t.message!==Va)throw t;Vs("LocalStore","Unexpectedly lost primary lease")} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Oc([t,e],[n,s]){const r=rr(t,n);return 0===r?rr(e,s):r}class Mc{constructor(t){this.ue=t,this.buffer=new yo(Oc),this.he=0}le(){return++this.he}fe(t){const e=[t,this.le()];if(this.buffer.size{this.we=null,this.de=!0;try{await t.collectGarbage(this.garbageCollector)}catch(t){Ga(t)?Vs("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",t):await Lc(t)}await this._e(t)}))}}class Pc{constructor(t,e){this.me=t,this.params=e}calculateTargetCount(t,e){return this.me.ge(t).next((t=>Math.floor(e/100*t)))}nthSequenceNumber(t,e){if(0===e)return qa.resolve(er.T);const n=new Mc(e);return this.me.forEachTarget(t,(t=>n.fe(t.sequenceNumber))).next((()=>this.me.ye(t,(t=>n.fe(t))))).next((()=>n.maxValue))}removeTargets(t,e,n){return this.me.removeTargets(t,e,n)}removeOrphanedDocuments(t,e){return this.me.removeOrphanedDocuments(t,e)}collect(t,e){return-1===this.params.cacheSizeCollectionThreshold?(Vs("LruGarbageCollector","Garbage collection skipped; disabled"),qa.resolve(vc)):this.getCacheSize(t).next((n=>n(e>this.params.maximumSequenceNumbersToCollect?(Vs("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${e}`),s=this.params.maximumSequenceNumbersToCollect):s=e,i=Date.now(),this.nthSequenceNumber(t,s)))).next((s=>(n=s,o=Date.now(),this.removeTargets(t,n,e)))).next((e=>(r=e,a=Date.now(),this.removeOrphanedDocuments(t,n)))).next((t=>(c=Date.now(),Fs()<=p.DEBUG&&Vs("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${i-u}ms\n\tDetermined least recently used ${s} in `+(o-i)+"ms\n"+`\tRemoved ${r} targets in `+(a-o)+"ms\n"+`\tRemoved ${t} documents in `+(c-a)+"ms\n"+`Total Duration: ${c-u}ms`),qa.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:r,documentsRemoved:t}))))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Vc{constructor(t,e){this.db=t,this.garbageCollector=function(t,e){return new Pc(t,e)}(this,e)}ge(t){const e=this.Te(t);return this.db.getTargetCache().getTargetCount(t).next((t=>e.next((e=>t+e))))}Te(t){let e=0;return this.ye(t,(t=>{e++})).next((()=>e))}forEachTarget(t,e){return this.db.getTargetCache().forEachTarget(t,e)}ye(t,e){return this.Ee(t,((t,n)=>e(n)))}addReference(t,e,n){return Uc(t,n)}removeReference(t,e,n){return Uc(t,n)}removeTargets(t,e,n){return this.db.getTargetCache().removeTargets(t,e,n)}markPotentiallyOrphaned(t,e){return Uc(t,e)}Ie(t,e){return function(t,e){let n=!1;return Ac(t).jt((s=>Sc(t,s,e).next((t=>(t&&(n=!0),qa.resolve(!t)))))).next((()=>n))}(t,e)}removeOrphanedDocuments(t,e){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[];let r=0;return this.Ee(t,((i,o)=>{if(o<=e){const e=this.Ie(t,i).next((e=>{if(!e)return r++,n.getEntry(t,i).next((()=>(n.removeEntry(i),Rc(t).delete([0,ya(i.path)]))))}));s.push(e)}})).next((()=>qa.waitFor(s))).next((()=>n.apply(t))).next((()=>r))}removeTarget(t,e){const n=e.withSequenceNumber(t.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(t,n)}updateLimboDocument(t,e){return Uc(t,e)}Ee(t,e){const n=Rc(t);let s,r=er.T;return n.Kt({index:ka.documentTargetsIndex},(([t,n],{path:i,sequenceNumber:o})=>{0===t?(r!==er.T&&e(new xr(ba(s)),r),r=o,s=i):r=er.T})).next((()=>{r!==er.T&&e(new xr(ba(s)),r)}))}getCacheSize(t){return this.db.getRemoteDocumentCache().getSize(t)}}function Uc(t,e){return Rc(t).put(function(t,e){return new ka(0,ya(t.path),e)}(e,t.currentSequenceNumber))} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qc{constructor(t,e){this.mapKeyFn=t,this.equalsFn=e,this.inner={}}get(t){const e=this.mapKeyFn(t),n=this.inner[e];if(void 0!==n)for(const[e,s]of n)if(this.equalsFn(e,t))return s}has(t){return void 0!==this.get(t)}set(t,e){const n=this.mapKeyFn(t),s=this.inner[n];if(void 0!==s){for(let n=0;n{for(const[e,s]of n)t(e,s)}))}isEmpty(){return lr(this.inner)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Bc{constructor(){this.changes=new qc((t=>t.toString()),((t,e)=>t.isEqual(e))),this.changesApplied=!1}getReadTime(t){const e=this.changes.get(t);return e?e.readTime:cr.min()}addEntry(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})}removeEntry(t,e=null){this.assertNotApplied(),this.changes.set(t,{document:Hr.newInvalidDocument(t),readTime:e})}getEntry(t,e){this.assertNotApplied();const n=this.changes.get(e);return void 0!==n?qa.resolve(n.document):this.getFromCache(t,e)}getEntries(t,e){return this.getAllFromCache(t,e)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class jc{constructor(t,e){this.N=t,this.Ht=e}addEntry(t,e,n){return Gc(t).put(Hc(e),n)}removeEntry(t,e){const n=Gc(t),s=Hc(e);return n.delete(s)}updateMetadata(t,e){return this.getMetadata(t).next((n=>(n.byteSize+=e,this.Ae(t,n))))}getEntry(t,e){return Gc(t).get(Hc(e)).next((t=>this.Re(e,t)))}be(t,e){return Gc(t).get(Hc(e)).next((t=>({document:this.Re(e,t),size:Ec(t)})))}getEntries(t,e){let n=bo();return this.Pe(t,e,((t,e)=>{const s=this.Re(t,e);n=n.insert(t,s)})).next((()=>n))}ve(t,e){let n=bo(),s=new go(xr.comparator);return this.Pe(t,e,((t,e)=>{const r=this.Re(t,e);n=n.insert(t,r),s=s.insert(t,Ec(e))})).next((()=>({documents:n,Ve:s})))}Pe(t,e,n){if(e.isEmpty())return qa.resolve();const s=IDBKeyRange.bound(e.first().path.toArray(),e.last().path.toArray()),r=e.getIterator();let i=r.getNext();return Gc(t).Kt({range:s},((t,e,s)=>{const o=xr.fromSegments(t);for(;i&&xr.comparator(i,o)<0;)n(i,null),i=r.getNext();i&&i.isEqual(o)&&(n(i,e),i=r.hasNext()?r.getNext():null),i?s.Mt(i.path.toArray()):s.done()})).next((()=>{for(;i;)n(i,null),i=r.hasNext()?r.getNext():null}))}getDocumentsMatchingQuery(t,e,n){let s=bo();const r=e.path.length+1,i={};if(n.isEqual(cr.min())){const t=e.path.toArray();i.range=IDBKeyRange.lowerBound(t)}else{const t=e.path.toArray(),s=rc(n);i.range=IDBKeyRange.lowerBound([t,s],!0),i.index=Da.collectionReadTimeIndex}return Gc(t).Kt(i,((t,n,i)=>{if(t.length!==r)return;const o=nc(this.N,n);e.path.isPrefixOf(o.key.path)?Ai(e,o)&&(s=s.insert(o.key,o)):i.done()})).next((()=>s))}newChangeBuffer(t){return new Kc(this,!!t&&t.trackRemovals)}getSize(t){return this.getMetadata(t).next((t=>t.byteSize))}getMetadata(t){return $c(t).get(xa.key).next((t=>(Ks(!!t),t)))}Ae(t,e){return $c(t).put(xa.key,e)}Re(t,e){if(e){const t=nc(this.N,e);if(!t.isNoDocument()||!t.version.isEqual(cr.min()))return t}return Hr.newInvalidDocument(t)}}class Kc extends Bc{constructor(t,e){super(),this.Se=t,this.trackRemovals=e,this.De=new qc((t=>t.toString()),((t,e)=>t.isEqual(e)))}applyChanges(t){const e=[];let n=0,s=new yo(((t,e)=>rr(t.canonicalString(),e.canonicalString())));return this.changes.forEach(((r,i)=>{const o=this.De.get(r);if(i.document.isValidDocument()){const a=sc(this.Se.N,i.document,this.getReadTime(r));s=s.add(r.path.popLast());const c=Ec(a);n+=c-o,e.push(this.Se.addEntry(t,r,a))}else if(n-=o,this.trackRemovals){const n=sc(this.Se.N,Hr.newNoDocument(r,cr.min()),this.getReadTime(r));e.push(this.Se.addEntry(t,r,n))}else e.push(this.Se.removeEntry(t,r))})),s.forEach((n=>{e.push(this.Se.Ht.addToCollectionParentIndex(t,n))})),e.push(this.Se.updateMetadata(t,n)),qa.waitFor(e)}getFromCache(t,e){return this.Se.be(t,e).next((t=>(this.De.set(e,t.size),t.document)))}getAllFromCache(t,e){return this.Se.ve(t,e).next((({documents:t,Ve:e})=>(e.forEach(((t,e)=>{this.De.set(t,e)})),t)))}}function $c(t){return Xa(t,xa.store)}function Gc(t){return Xa(t,Da.store)}function Hc(t){return t.path.toArray()} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class zc{constructor(t){this.N=t}Ct(t,e,n,s){Ks(n=0&&s<=11);const r=new Ba("createOrUpgrade",e);n<1&&s>=1&&(function(t){t.createObjectStore(Ea.store)}(t),function(t){t.createObjectStore(Ia.store,{keyPath:Ia.keyPath}),t.createObjectStore(Sa.store,{keyPath:Sa.keyPath,autoIncrement:!0}).createIndex(Sa.userMutationsIndex,Sa.userMutationsKeyPath,{unique:!0}),t.createObjectStore(_a.store)}(t),Qc(t),function(t){t.createObjectStore(Da.store)}(t));let i=qa.resolve();return n<3&&s>=3&&(0!==n&&(function(t){t.deleteObjectStore(ka.store),t.deleteObjectStore(Ca.store),t.deleteObjectStore(Ra.store)}(t),Qc(t)),i=i.next((()=>function(t){const e=t.store(Ra.store),n=new Ra(0,0,cr.min().toTimestamp(),0);return e.put(Ra.key,n)}(r)))),n<4&&s>=4&&(0!==n&&(i=i.next((()=>function(t,e){return e.store(Sa.store).Lt().next((n=>{t.deleteObjectStore(Sa.store),t.createObjectStore(Sa.store,{keyPath:Sa.keyPath,autoIncrement:!0}).createIndex(Sa.userMutationsIndex,Sa.userMutationsKeyPath,{unique:!0});const s=e.store(Sa.store),r=n.map((t=>s.put(t)));return qa.waitFor(r)}))}(t,r)))),i=i.next((()=>{!function(t){t.createObjectStore(Oa.store,{keyPath:Oa.keyPath})}(t)}))),n<5&&s>=5&&(i=i.next((()=>this.Ce(r)))),n<6&&s>=6&&(i=i.next((()=>(function(t){t.createObjectStore(xa.store)}(t),this.Ne(r))))),n<7&&s>=7&&(i=i.next((()=>this.xe(r)))),n<8&&s>=8&&(i=i.next((()=>this.ke(t,r)))),n<9&&s>=9&&(i=i.next((()=>{!function(t){t.objectStoreNames.contains("remoteDocumentChanges")&&t.deleteObjectStore("remoteDocumentChanges")}(t),function(t){const e=t.objectStore(Da.store);e.createIndex(Da.readTimeIndex,Da.readTimeIndexPath,{unique:!1}),e.createIndex(Da.collectionReadTimeIndex,Da.collectionReadTimeIndexPath,{unique:!1})}(e)}))),n<10&&s>=10&&(i=i.next((()=>this.$e(r)))),n<11&&s>=11&&(i=i.next((()=>{!function(t){t.createObjectStore(Ma.store,{keyPath:Ma.keyPath})}(t),function(t){t.createObjectStore(Fa.store,{keyPath:Fa.keyPath})}(t)}))),i}Ne(t){let e=0;return t.store(Da.store).Kt(((t,n)=>{e+=Ec(n)})).next((()=>{const n=new xa(e);return t.store(xa.store).put(xa.key,n)}))}Ce(t){const e=t.store(Ia.store),n=t.store(Sa.store);return e.Lt().next((e=>qa.forEach(e,(e=>{const s=IDBKeyRange.bound([e.userId,-1],[e.userId,e.lastAcknowledgedBatchId]);return n.Lt(Sa.userMutationsIndex,s).next((n=>qa.forEach(n,(n=>{Ks(n.userId===e.userId);const s=cc(this.N,n);return Tc(t,e.userId,s).next((()=>{}))}))))}))))}xe(t){const e=t.store(ka.store),n=t.store(Da.store);return t.store(Ra.store).get(Ra.key).next((t=>{const s=[];return n.Kt(((n,r)=>{const i=new fr(n),o=function(t){return[0,ya(t)]}(i);s.push(e.get(o).next((n=>n?qa.resolve():(n=>e.put(new ka(0,ya(n),t.highestListenSequenceNumber)))(i))))})).next((()=>qa.waitFor(s)))}))}ke(t,e){t.createObjectStore(La.store,{keyPath:La.keyPath});const n=e.store(La.store),s=new pc,r=t=>{if(s.add(t)){const e=t.lastSegment(),s=t.popLast();return n.put({collectionId:e,parent:ya(s)})}};return e.store(Da.store).Kt({qt:!0},((t,e)=>{const n=new fr(t);return r(n.popLast())})).next((()=>e.store(_a.store).Kt({qt:!0},(([t,e,n],s)=>{const i=ba(e);return r(i.popLast())}))))}$e(t){const e=t.store(Ca.store);return e.Kt(((t,n)=>{const s=uc(n),r=hc(this.N,s);return e.put(r)}))}}function Qc(t){t.createObjectStore(ka.store,{keyPath:ka.keyPath}).createIndex(ka.documentTargetsIndex,ka.documentTargetsKeyPath,{unique:!0}),t.createObjectStore(Ca.store,{keyPath:Ca.keyPath}).createIndex(Ca.queryTargetsIndexName,Ca.queryTargetsKeyPath,{unique:!0}),t.createObjectStore(Ra.store)}const Wc="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.";class Yc{constructor(t,e,n,s,r,i,o,a,c,u){if(this.allowTabSynchronization=t,this.persistenceKey=e,this.clientId=n,this.Oe=r,this.window=i,this.document=o,this.Fe=c,this.Me=u,this.Le=null,this.Be=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Ue=null,this.inForeground=!1,this.qe=null,this.Ke=null,this.je=Number.NEGATIVE_INFINITY,this.Qe=t=>Promise.resolve(),!Yc.bt())throw new zs(Hs.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new Vc(this,s),this.We=e+"main",this.N=new ec(a),this.Ge=new ja(this.We,11,new zc(this.N)),this.ze=new xc(this.referenceDelegate,this.N),this.Ht=new yc,this.He=function(t,e){return new jc(t,e)}(this.N,this.Ht),this.Je=new dc,this.window&&this.window.localStorage?this.Ye=this.window.localStorage:(this.Ye=null,!1===u&&Us("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Xe().then((()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new zs(Hs.FAILED_PRECONDITION,Wc);return this.Ze(),this.tn(),this.en(),this.runTransaction("getHighestListenSequenceNumber","readonly",(t=>this.ze.getHighestSequenceNumber(t)))})).then((t=>{this.Le=new er(t,this.Fe)})).then((()=>{this.Be=!0})).catch((t=>(this.Ge&&this.Ge.close(),Promise.reject(t))))}nn(t){return this.Qe=async e=>{if(this.started)return t(e)},t(this.isPrimary)}setDatabaseDeletedListener(t){this.Ge.xt((async e=>{null===e.newVersion&&await t()}))}setNetworkEnabled(t){this.networkEnabled!==t&&(this.networkEnabled=t,this.Oe.enqueueAndForget((async()=>{this.started&&await this.Xe()})))}Xe(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(t=>Jc(t).put(new Oa(this.clientId,Date.now(),this.networkEnabled,this.inForeground)).next((()=>{if(this.isPrimary)return this.sn(t).next((t=>{t||(this.isPrimary=!1,this.Oe.enqueueRetryable((()=>this.Qe(!1))))}))})).next((()=>this.rn(t))).next((e=>this.isPrimary&&!e?this.on(t).next((()=>!1)):!!e&&this.cn(t).next((()=>!0)))))).catch((t=>{if(Ga(t))return Vs("IndexedDbPersistence","Failed to extend owner lease: ",t),this.isPrimary;if(!this.allowTabSynchronization)throw t;return Vs("IndexedDbPersistence","Releasing owner lease after error during lease refresh",t),!1})).then((t=>{this.isPrimary!==t&&this.Oe.enqueueRetryable((()=>this.Qe(t))),this.isPrimary=t}))}sn(t){return Xc(t).get(Ea.key).next((t=>qa.resolve(this.an(t))))}un(t){return Jc(t).delete(this.clientId)}async hn(){if(this.isPrimary&&!this.ln(this.je,18e5)){this.je=Date.now();const t=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(t=>{const e=Xa(t,Oa.store);return e.Lt().next((t=>{const n=this.fn(t,18e5),s=t.filter((t=>-1===n.indexOf(t)));return qa.forEach(s,(t=>e.delete(t.clientId))).next((()=>s))}))})).catch((()=>[]));if(this.Ye)for(const e of t)this.Ye.removeItem(this.dn(e.clientId))}}en(){this.Ke=this.Oe.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.Xe().then((()=>this.hn())).then((()=>this.en()))))}an(t){return!!t&&t.ownerId===this.clientId}rn(t){return this.Me?qa.resolve(!0):Xc(t).get(Ea.key).next((e=>{if(null!==e&&this.ln(e.leaseTimestampMs,5e3)&&!this.wn(e.ownerId)){if(this.an(e)&&this.networkEnabled)return!0;if(!this.an(e)){if(!e.allowTabSynchronization)throw new zs(Hs.FAILED_PRECONDITION,Wc);return!1}}return!(!this.networkEnabled||!this.inForeground)||Jc(t).Lt().next((t=>void 0===this.fn(t,5e3).find((t=>{if(this.clientId!==t.clientId){const e=!this.networkEnabled&&t.networkEnabled,n=!this.inForeground&&t.inForeground,s=this.networkEnabled===t.networkEnabled;if(e||n&&s)return!0}return!1}))))})).next((t=>(this.isPrimary!==t&&Vs("IndexedDbPersistence",`Client ${t?"is":"is not"} eligible for a primary lease.`),t)))}async shutdown(){this.Be=!1,this._n(),this.Ke&&(this.Ke.cancel(),this.Ke=null),this.mn(),this.gn(),await this.Ge.runTransaction("shutdown","readwrite",[Ea.store,Oa.store],(t=>{const e=new Ya(t,er.T);return this.on(e).next((()=>this.un(e)))})),this.Ge.close(),this.yn()}fn(t,e){return t.filter((t=>this.ln(t.updateTimeMs,e)&&!this.wn(t.clientId)))}pn(){return this.runTransaction("getActiveClients","readonly",(t=>Jc(t).Lt().next((t=>this.fn(t,18e5).map((t=>t.clientId))))))}get started(){return this.Be}getMutationQueue(t){return Ic.Yt(t,this.N,this.Ht,this.referenceDelegate)}getTargetCache(){return this.ze}getRemoteDocumentCache(){return this.He}getIndexManager(){return this.Ht}getBundleCache(){return this.Je}runTransaction(t,e,n){Vs("IndexedDbPersistence","Starting transaction:",t);const s="readonly"===e?"readonly":"readwrite";let r;return this.Ge.runTransaction(t,s,Pa,(s=>(r=new Ya(s,this.Le?this.Le.next():er.T),"readwrite-primary"===e?this.sn(r).next((t=>!!t||this.rn(r))).next((e=>{if(!e)throw Us(`Failed to obtain primary lease for action '${t}'.`),this.isPrimary=!1,this.Oe.enqueueRetryable((()=>this.Qe(!1))),new zs(Hs.FAILED_PRECONDITION,Va);return n(r)})).next((t=>this.cn(r).next((()=>t)))):this.Tn(r).next((()=>n(r)))))).then((t=>(r.raiseOnCommittedEvent(),t)))}Tn(t){return Xc(t).get(Ea.key).next((t=>{if(null!==t&&this.ln(t.leaseTimestampMs,5e3)&&!this.wn(t.ownerId)&&!this.an(t)&&!(this.Me||this.allowTabSynchronization&&t.allowTabSynchronization))throw new zs(Hs.FAILED_PRECONDITION,Wc)}))}cn(t){const e=new Ea(this.clientId,this.allowTabSynchronization,Date.now());return Xc(t).put(Ea.key,e)}static bt(){return ja.bt()}on(t){const e=Xc(t);return e.get(Ea.key).next((t=>this.an(t)?(Vs("IndexedDbPersistence","Releasing primary lease."),e.delete(Ea.key)):qa.resolve()))}ln(t,e){const n=Date.now();return!(tn&&(Us(`Detected an update time that is in the future: ${t} > ${n}`),1))}Ze(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.qe=()=>{this.Oe.enqueueAndForget((()=>(this.inForeground="visible"===this.document.visibilityState,this.Xe())))},this.document.addEventListener("visibilitychange",this.qe),this.inForeground="visible"===this.document.visibilityState)}mn(){this.qe&&(this.document.removeEventListener("visibilitychange",this.qe),this.qe=null)}tn(){var t;"function"==typeof(null===(t=this.window)||void 0===t?void 0:t.addEventListener)&&(this.Ue=()=>{this._n(),l()&&navigator.appVersion.match("Version/14")&&this.Oe.enterRestrictedMode(!0),this.Oe.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.Ue))}gn(){this.Ue&&(this.window.removeEventListener("pagehide",this.Ue),this.Ue=null)}wn(t){var e;try{const n=null!==(null===(e=this.Ye)||void 0===e?void 0:e.getItem(this.dn(t)));return Vs("IndexedDbPersistence",`Client '${t}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(t){return Us("IndexedDbPersistence","Failed to get zombied client id.",t),!1}}_n(){if(this.Ye)try{this.Ye.setItem(this.dn(this.clientId),String(Date.now()))}catch(t){Us("Failed to set zombie client id.",t)}}yn(){if(this.Ye)try{this.Ye.removeItem(this.dn(this.clientId))}catch(t){}}dn(t){return`firestore_zombie_${this.persistenceKey}_${t}`}}function Xc(t){return Xa(t,Ea.store)}function Jc(t){return Xa(t,Oa.store)}function Zc(t,e){let n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/" +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class tu{constructor(t,e){this.progress=t,this.En=e}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class eu{constructor(t,e,n){this.He=t,this.In=e,this.Ht=n}An(t,e){return this.In.getAllMutationBatchesAffectingDocumentKey(t,e).next((n=>this.Rn(t,e,n)))}Rn(t,e,n){return this.He.getEntry(t,e).next((t=>{for(const e of n)e.applyToLocalView(t);return t}))}bn(t,e){t.forEach(((t,n)=>{for(const t of e)t.applyToLocalView(n)}))}Pn(t,e){return this.He.getEntries(t,e).next((e=>this.vn(t,e).next((()=>e))))}vn(t,e){return this.In.getAllMutationBatchesAffectingDocumentKeys(t,e).next((t=>this.bn(e,t)))}getDocumentsMatchingQuery(t,e,n){return function(t){return xr.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Vn(t,e.path):bi(e)?this.Sn(t,e,n):this.Dn(t,e,n)}Vn(t,e){return this.An(t,new xr(e)).next((t=>{let e=Eo();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))}Sn(t,e,n){const s=e.collectionGroup;let r=Eo();return this.Ht.getCollectionParents(t,s).next((i=>qa.forEach(i,(i=>{const o=function(t,e){return new fi(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,i.child(s));return this.Dn(t,o,n).next((t=>{t.forEach(((t,e)=>{r=r.insert(t,e)}))}))})).next((()=>r))))}Dn(t,e,n){let s,r;return this.He.getDocumentsMatchingQuery(t,e,n).next((n=>(s=n,this.In.getAllMutationBatchesAffectingQuery(t,e)))).next((e=>(r=e,this.Cn(t,r,s).next((t=>{s=t;for(const t of r)for(const e of t.mutations){const n=e.key;let r=s.get(n);null==r&&(r=Hr.newInvalidDocument(n),s=s.insert(n,r)),Xi(e,r,t.localWriteTime),r.isFoundDocument()||(s=s.remove(n))}}))))).next((()=>(s.forEach(((t,n)=>{Ai(e,n)||(s=s.remove(t))})),s)))}Cn(t,e,n){let s=No();for(const t of e)for(const e of t.mutations)e instanceof no&&null===n.get(e.key)&&(s=s.add(e.key));let r=n;return this.He.getEntries(t,s).next((t=>(t.forEach(((t,e)=>{e.isFoundDocument()&&(r=r.insert(t,e))})),r)))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class nu{constructor(t,e,n,s){this.targetId=t,this.fromCache=e,this.Nn=n,this.xn=s}static kn(t,e){let n=No(),s=No();for(const t of e.docChanges)switch(t.type){case 0:n=n.add(t.doc.key);break;case 1:s=s.add(t.doc.key)}return new nu(t,e.fromCache,n,s)}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class su{$n(t){this.On=t}getDocumentsMatchingQuery(t,e,n,s){return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(cr.min())?this.Fn(t,e):this.On.Pn(t,s).next((r=>{const i=this.Mn(e,r);return(pi(e)||yi(e))&&this.Ln(e.limitType,i,s,n)?this.Fn(t,e):(Fs()<=p.DEBUG&&Vs("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),Ni(e)),this.On.getDocumentsMatchingQuery(t,e,n).next((t=>(i.forEach((e=>{t=t.insert(e.key,e)})),t))))}))}Mn(t,e){let n=new yo(Di(t));return e.forEach(((e,s)=>{Ai(t,s)&&(n=n.add(s))})),n}Ln(t,e,n,s){if(n.size!==e.size)return!0;const r="F"===t?e.last():e.first();return!!r&&(r.hasPendingWrites||r.version.compareTo(s)>0)}Fn(t,e){return Fs()<=p.DEBUG&&Vs("QueryEngine","Using full collection scan to execute query:",Ni(e)),this.On.getDocumentsMatchingQuery(t,e,cr.min())}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class ru{constructor(t,e,n,s){this.persistence=t,this.Bn=e,this.N=s,this.Un=new go(rr),this.qn=new qc((t=>Wr(t)),Yr),this.Kn=cr.min(),this.In=t.getMutationQueue(n),this.jn=t.getRemoteDocumentCache(),this.ze=t.getTargetCache(),this.Qn=new eu(this.jn,this.In,this.persistence.getIndexManager()),this.Je=t.getBundleCache(),this.Bn.$n(this.Qn)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(e=>t.collect(e,this.Un)))}}function iu(t,e,n,s){return new ru(t,e,n,s)}async function ou(t,e){const n=Gs(t);let s=n.In,r=n.Qn;const i=await n.persistence.runTransaction("Handle user change","readonly",(t=>{let i;return n.In.getAllMutationBatches(t).next((o=>(i=o,s=n.persistence.getMutationQueue(e),r=new eu(n.jn,s,n.persistence.getIndexManager()),s.getAllMutationBatches(t)))).next((e=>{const n=[],s=[];let o=No();for(const t of i){n.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}for(const t of e){s.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}return r.Pn(t,o).next((t=>({Wn:t,removedBatchIds:n,addedBatchIds:s})))}))}));return n.In=s,n.Qn=r,n.Bn.$n(n.Qn),i}function au(t){const e=Gs(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.ze.getLastRemoteSnapshotVersion(t)))}function cu(t,e,n,s,r){let i=No();return n.forEach((t=>i=i.add(t))),e.getEntries(t,i).next((t=>{let i=bo();return n.forEach(((n,o)=>{const a=t.get(n),c=(null==r?void 0:r.get(n))||s;o.isNoDocument()&&o.version.isEqual(cr.min())?(e.removeEntry(n,c),i=i.insert(n,o)):!a.isValidDocument()||o.version.compareTo(a.version)>0||0===o.version.compareTo(a.version)&&a.hasPendingWrites?(e.addEntry(o,c),i=i.insert(n,o)):Vs("LocalStore","Ignoring outdated watch update for ",n,". Current version:",a.version," Watch version:",o.version)})),i}))}function uu(t,e){const n=Gs(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(t=>(void 0===e&&(e=-1),n.In.getNextMutationBatchAfterBatchId(t,e))))}function hu(t,e){const n=Gs(t);return n.persistence.runTransaction("Allocate target","readwrite",(t=>{let s;return n.ze.getTargetData(t,e).next((r=>r?(s=r,qa.resolve(s)):n.ze.allocateTargetId(t).next((r=>(s=new tc(e,r,0,t.currentSequenceNumber),n.ze.addTargetData(t,s).next((()=>s)))))))})).then((t=>{const s=n.Un.get(t.targetId);return(null===s||t.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(n.Un=n.Un.insert(t.targetId,t),n.qn.set(e,t.targetId)),t}))}async function lu(t,e,n){const s=Gs(t),r=s.Un.get(e),i=n?"readwrite":"readwrite-primary";try{n||await s.persistence.runTransaction("Release target",i,(t=>s.persistence.referenceDelegate.removeTarget(t,r)))}catch(t){if(!Ga(t))throw t;Vs("LocalStore",`Failed to update sequence numbers for target ${e}: ${t}`)}s.Un=s.Un.remove(e),s.qn.delete(r.target)}function du(t,e,n){const s=Gs(t);let r=cr.min(),i=No();return s.persistence.runTransaction("Execute query","readonly",(t=>function(t,e,n){const s=Gs(t),r=s.qn.get(n);return void 0!==r?qa.resolve(s.Un.get(r)):s.ze.getTargetData(e,n)}(s,t,Ei(e)).next((e=>{if(e)return r=e.lastLimboFreeSnapshotVersion,s.ze.getMatchingKeysForTargetId(t,e.targetId).next((t=>{i=t}))})).next((()=>s.Bn.getDocumentsMatchingQuery(t,e,n?r:cr.min(),n?i:No()))).next((t=>({documents:t,Gn:i})))))}function fu(t,e){const n=Gs(t),s=Gs(n.ze),r=n.Un.get(e);return r?Promise.resolve(r.target):n.persistence.runTransaction("Get target data","readonly",(t=>s.Tt(t,e).next((t=>t?t.target:null))))}function gu(t){const e=Gs(t);return e.persistence.runTransaction("Get new document changes","readonly",(t=>function(t,e,n){const s=Gs(t);let r=bo(),i=rc(n);const o=Gc(e),a=IDBKeyRange.lowerBound(i,!0);return o.Kt({index:Da.readTimeIndex,range:a},((t,e)=>{const n=nc(s.N,e);r=r.insert(n.key,n),i=e.readTime})).next((()=>({En:r,readTime:ic(i)})))}(e.jn,t,e.Kn))).then((({En:t,readTime:n})=>(e.Kn=n,t)))}async function mu(t,e,n=No()){const s=await hu(t,Ei(lc(e.bundledQuery))),r=Gs(t);return r.persistence.runTransaction("Save named query","readwrite",(t=>{const i=$o(e.readTime);if(s.snapshotVersion.compareTo(i)>=0)return r.Je.saveNamedQuery(t,e);const o=s.withResumeToken(wr.EMPTY_BYTE_STRING,i);return r.Un=r.Un.insert(o.targetId,o),r.ze.updateTargetData(t,o).next((()=>r.ze.removeMatchingKeysForTargetId(t,s.targetId))).next((()=>r.ze.addMatchingKeys(t,n,s.targetId))).next((()=>r.Je.saveNamedQuery(t,e)))}))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class pu{constructor(t){this.N=t,this.Yn=new Map,this.Xn=new Map}getBundleMetadata(t,e){return qa.resolve(this.Yn.get(e))}saveBundleMetadata(t,e){var n;return this.Yn.set(e.id,{id:(n=e).id,version:n.version,createTime:$o(n.createTime)}),qa.resolve()}getNamedQuery(t,e){return qa.resolve(this.Xn.get(e))}saveNamedQuery(t,e){return this.Xn.set(e.name,function(t){return{name:t.name,query:lc(t.bundledQuery),readTime:$o(t.readTime)}}(e)),qa.resolve()}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class yu{constructor(){this.Zn=new yo(wu.ts),this.es=new yo(wu.ns)}isEmpty(){return this.Zn.isEmpty()}addReference(t,e){const n=new wu(t,e);this.Zn=this.Zn.add(n),this.es=this.es.add(n)}ss(t,e){t.forEach((t=>this.addReference(t,e)))}removeReference(t,e){this.rs(new wu(t,e))}os(t,e){t.forEach((t=>this.removeReference(t,e)))}cs(t){const e=new xr(new fr([])),n=new wu(e,t),s=new wu(e,t+1),r=[];return this.es.forEachInRange([n,s],(t=>{this.rs(t),r.push(t.key)})),r}us(){this.Zn.forEach((t=>this.rs(t)))}rs(t){this.Zn=this.Zn.delete(t),this.es=this.es.delete(t)}hs(t){const e=new xr(new fr([])),n=new wu(e,t),s=new wu(e,t+1);let r=No();return this.es.forEachInRange([n,s],(t=>{r=r.add(t.key)})),r}containsKey(t){const e=new wu(t,0),n=this.Zn.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)}}class wu{constructor(t,e){this.key=t,this.ls=e}static ts(t,e){return xr.comparator(t.key,e.key)||rr(t.ls,e.ls)}static ns(t,e){return rr(t.ls,e.ls)||xr.comparator(t.key,e.key)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class vu{constructor(t,e){this.Ht=t,this.referenceDelegate=e,this.In=[],this.fs=1,this.ds=new yo(wu.ts)}checkEmpty(t){return qa.resolve(0===this.In.length)}addMutationBatch(t,e,n,s){const r=this.fs;this.fs++,this.In.length>0&&this.In[this.In.length-1];const i=new Ja(r,e,n,s);this.In.push(i);for(const e of s)this.ds=this.ds.add(new wu(e.key,r)),this.Ht.addToCollectionParentIndex(t,e.key.path.popLast());return qa.resolve(i)}lookupMutationBatch(t,e){return qa.resolve(this.ws(e))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=this._s(n),r=s<0?0:s;return qa.resolve(this.In.length>r?this.In[r]:null)}getHighestUnacknowledgedBatchId(){return qa.resolve(0===this.In.length?-1:this.fs-1)}getAllMutationBatches(t){return qa.resolve(this.In.slice())}getAllMutationBatchesAffectingDocumentKey(t,e){const n=new wu(e,0),s=new wu(e,Number.POSITIVE_INFINITY),r=[];return this.ds.forEachInRange([n,s],(t=>{const e=this.ws(t.ls);r.push(e)})),qa.resolve(r)}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new yo(rr);return e.forEach((t=>{const e=new wu(t,0),s=new wu(t,Number.POSITIVE_INFINITY);this.ds.forEachInRange([e,s],(t=>{n=n.add(t.ls)}))})),qa.resolve(this.gs(n))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1;let r=n;xr.isDocumentKey(r)||(r=r.child(""));const i=new wu(new xr(r),0);let o=new yo(rr);return this.ds.forEachWhile((t=>{const e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===s&&(o=o.add(t.ls)),!0)}),i),qa.resolve(this.gs(o))}gs(t){const e=[];return t.forEach((t=>{const n=this.ws(t);null!==n&&e.push(n)})),e}removeMutationBatch(t,e){Ks(0===this.ys(e.batchId,"removed")),this.In.shift();let n=this.ds;return qa.forEach(e.mutations,(s=>{const r=new wu(s.key,e.batchId);return n=n.delete(r),this.referenceDelegate.markPotentiallyOrphaned(t,s.key)})).next((()=>{this.ds=n}))}te(t){}containsKey(t,e){const n=new wu(e,0),s=this.ds.firstAfterOrEqual(n);return qa.resolve(e.isEqual(s&&s.key))}performConsistencyCheck(t){return this.In.length,qa.resolve()}ys(t,e){return this._s(t)}_s(t){return 0===this.In.length?0:t-this.In[0].batchId}ws(t){const e=this._s(t);return e<0||e>=this.In.length?null:this.In[e]}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class bu{constructor(t,e){this.Ht=t,this.ps=e,this.docs=new go(xr.comparator),this.size=0}addEntry(t,e,n){const s=e.key,r=this.docs.get(s),i=r?r.size:0,o=this.ps(e);return this.docs=this.docs.insert(s,{document:e.clone(),size:o,readTime:n}),this.size+=o-i,this.Ht.addToCollectionParentIndex(t,s.path.popLast())}removeEntry(t){const e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)}getEntry(t,e){const n=this.docs.get(e);return qa.resolve(n?n.document.clone():Hr.newInvalidDocument(e))}getEntries(t,e){let n=bo();return e.forEach((t=>{const e=this.docs.get(t);n=n.insert(t,e?e.document.clone():Hr.newInvalidDocument(t))})),qa.resolve(n)}getDocumentsMatchingQuery(t,e,n){let s=bo();const r=new xr(e.path.child("")),i=this.docs.getIteratorFrom(r);for(;i.hasNext();){const{key:t,value:{document:r,readTime:o}}=i.getNext();if(!e.path.isPrefixOf(t.path))break;o.compareTo(n)<=0||Ai(e,r)&&(s=s.insert(r.key,r.clone()))}return qa.resolve(s)}Ts(t,e){return qa.forEach(this.docs,(t=>e(t)))}newChangeBuffer(t){return new Tu(this)}getSize(t){return qa.resolve(this.size)}}class Tu extends Bc{constructor(t){super(),this.Se=t}applyChanges(t){const e=[];return this.changes.forEach(((n,s)=>{s.document.isValidDocument()?e.push(this.Se.addEntry(t,s.document,this.getReadTime(n))):this.Se.removeEntry(n)})),qa.waitFor(e)}getFromCache(t,e){return this.Se.getEntry(t,e)}getAllFromCache(t,e){return this.Se.getEntries(t,e)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Eu{constructor(t){this.persistence=t,this.Es=new qc((t=>Wr(t)),Yr),this.lastRemoteSnapshotVersion=cr.min(),this.highestTargetId=0,this.Is=0,this.As=new yu,this.targetCount=0,this.Rs=Dc.se()}forEachTarget(t,e){return this.Es.forEach(((t,n)=>e(n))),qa.resolve()}getLastRemoteSnapshotVersion(t){return qa.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return qa.resolve(this.Is)}allocateTargetId(t){return this.highestTargetId=this.Rs.next(),qa.resolve(this.highestTargetId)}setTargetsMetadata(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.Is&&(this.Is=e),qa.resolve()}ce(t){this.Es.set(t.target,t);const e=t.targetId;e>this.highestTargetId&&(this.Rs=new Dc(e),this.highestTargetId=e),t.sequenceNumber>this.Is&&(this.Is=t.sequenceNumber)}addTargetData(t,e){return this.ce(e),this.targetCount+=1,qa.resolve()}updateTargetData(t,e){return this.ce(e),qa.resolve()}removeTargetData(t,e){return this.Es.delete(e.target),this.As.cs(e.targetId),this.targetCount-=1,qa.resolve()}removeTargets(t,e,n){let s=0;const r=[];return this.Es.forEach(((i,o)=>{o.sequenceNumber<=e&&null===n.get(o.targetId)&&(this.Es.delete(i),r.push(this.removeMatchingKeysForTargetId(t,o.targetId)),s++)})),qa.waitFor(r).next((()=>s))}getTargetCount(t){return qa.resolve(this.targetCount)}getTargetData(t,e){const n=this.Es.get(e)||null;return qa.resolve(n)}addMatchingKeys(t,e,n){return this.As.ss(e,n),qa.resolve()}removeMatchingKeys(t,e,n){this.As.os(e,n);const s=this.persistence.referenceDelegate,r=[];return s&&e.forEach((e=>{r.push(s.markPotentiallyOrphaned(t,e))})),qa.waitFor(r)}removeMatchingKeysForTargetId(t,e){return this.As.cs(e),qa.resolve()}getMatchingKeysForTargetId(t,e){const n=this.As.hs(e);return qa.resolve(n)}containsKey(t,e){return qa.resolve(this.As.containsKey(e))}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Iu{constructor(t,e){this.bs={},this.Le=new er(0),this.Be=!1,this.Be=!0,this.referenceDelegate=t(this),this.ze=new Eu(this),this.Ht=new mc,this.He=function(t,e){return new bu(t,e)}(this.Ht,(t=>this.referenceDelegate.Ps(t))),this.N=new ec(e),this.Je=new pu(this.N)}start(){return Promise.resolve()}shutdown(){return this.Be=!1,Promise.resolve()}get started(){return this.Be}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(){return this.Ht}getMutationQueue(t){let e=this.bs[t.toKey()];return e||(e=new vu(this.Ht,this.referenceDelegate),this.bs[t.toKey()]=e),e}getTargetCache(){return this.ze}getRemoteDocumentCache(){return this.He}getBundleCache(){return this.Je}runTransaction(t,e,n){Vs("MemoryPersistence","Starting transaction:",t);const s=new Su(this.Le.next());return this.referenceDelegate.vs(),n(s).next((t=>this.referenceDelegate.Vs(s).next((()=>t)))).toPromise().then((t=>(s.raiseOnCommittedEvent(),t)))}Ss(t,e){return qa.or(Object.values(this.bs).map((n=>()=>n.containsKey(t,e))))}}class Su extends Ua{constructor(t){super(),this.currentSequenceNumber=t}}class _u{constructor(t){this.persistence=t,this.Ds=new yu,this.Cs=null}static Ns(t){return new _u(t)}get xs(){if(this.Cs)return this.Cs;throw js()}addReference(t,e,n){return this.Ds.addReference(n,e),this.xs.delete(n.toString()),qa.resolve()}removeReference(t,e,n){return this.Ds.removeReference(n,e),this.xs.add(n.toString()),qa.resolve()}markPotentiallyOrphaned(t,e){return this.xs.add(e.toString()),qa.resolve()}removeTarget(t,e){this.Ds.cs(e.targetId).forEach((t=>this.xs.add(t.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,e.targetId).next((t=>{t.forEach((t=>this.xs.add(t.toString())))})).next((()=>n.removeTargetData(t,e)))}vs(){this.Cs=new Set}Vs(t){const e=this.persistence.getRemoteDocumentCache().newChangeBuffer();return qa.forEach(this.xs,(n=>{const s=xr.fromPath(n);return this.ks(t,s).next((t=>{t||e.removeEntry(s)}))})).next((()=>(this.Cs=null,e.apply(t))))}updateLimboDocument(t,e){return this.ks(t,e).next((t=>{t?this.xs.delete(e.toString()):this.xs.add(e.toString())}))}Ps(t){return 0}ks(t,e){return qa.or([()=>qa.resolve(this.Ds.containsKey(e)),()=>this.persistence.getTargetCache().containsKey(t,e),()=>this.persistence.Ss(t,e)])}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Nu(t,e){return`firestore_clients_${t}_${e}`}function Au(t,e,n){let s=`firestore_mutations_${t}_${n}`;return e.isAuthenticated()&&(s+=`_${e.uid}`),s}function Du(t,e){return`firestore_targets_${t}_${e}`}class xu{constructor(t,e,n,s){this.user=t,this.batchId=e,this.state=n,this.error=s}static $s(t,e,n){const s=JSON.parse(n);let r,i="object"==typeof s&&-1!==["pending","acknowledged","rejected"].indexOf(s.state)&&(void 0===s.error||"object"==typeof s.error);return i&&s.error&&(i="string"==typeof s.error.message&&"string"==typeof s.error.code,i&&(r=new zs(s.error.code,s.error.message))),i?new xu(t,e,s.state,r):(Us("SharedClientState",`Failed to parse mutation state for ID '${e}': ${n}`),null)}Os(){const t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)}}class Cu{constructor(t,e,n){this.targetId=t,this.state=e,this.error=n}static $s(t,e){const n=JSON.parse(e);let s,r="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return r&&n.error&&(r="string"==typeof n.error.message&&"string"==typeof n.error.code,r&&(s=new zs(n.error.code,n.error.message))),r?new Cu(t,n.state,s):(Us("SharedClientState",`Failed to parse target state for ID '${t}': ${e}`),null)}Os(){const t={state:this.state,updateTimeMs:Date.now()};return this.error&&(t.error={code:this.error.code,message:this.error.message}),JSON.stringify(t)}}class ku{constructor(t,e){this.clientId=t,this.activeTargetIds=e}static $s(t,e){const n=JSON.parse(e);let s="object"==typeof n&&n.activeTargetIds instanceof Array,r=Do();for(let t=0;s&&tthis.shutdown())),this.started=!0}writeSequenceNumber(t){this.setItem(this.Qs,JSON.stringify(t))}getAllActiveQueryTargets(){return this.ti(this.qs)}isActiveQueryTarget(t){let e=!1;return this.qs.forEach(((n,s)=>{s.activeTargetIds.has(t)&&(e=!0)})),e}addPendingMutation(t){this.ei(t,"pending")}updateMutationState(t,e,n){this.ei(t,e,n),this.ni(t)}addLocalQueryTarget(t){let e="not-current";if(this.isActiveQueryTarget(t)){const n=this.storage.getItem(Du(this.persistenceKey,t));if(n){const s=Cu.$s(t,n);s&&(e=s.state)}}return this.si.Fs(t),this.Ys(),e}removeLocalQueryTarget(t){this.si.Ms(t),this.Ys()}isLocalQueryTarget(t){return this.si.activeTargetIds.has(t)}clearQueryState(t){this.removeItem(Du(this.persistenceKey,t))}updateQueryState(t,e,n){this.ii(t,e,n)}handleUserChange(t,e,n){e.forEach((t=>{this.ni(t)})),this.currentUser=t,n.forEach((t=>{this.addPendingMutation(t)}))}setOnlineState(t){this.ri(t)}notifyBundleLoaded(){this.oi()}shutdown(){this.started&&(this.window.removeEventListener("storage",this.Bs),this.removeItem(this.js),this.started=!1)}getItem(t){const e=this.storage.getItem(t);return Vs("SharedClientState","READ",t,e),e}setItem(t,e){Vs("SharedClientState","SET",t,e),this.storage.setItem(t,e)}removeItem(t){Vs("SharedClientState","REMOVE",t),this.storage.removeItem(t)}Us(t){const e=t;if(e.storageArea===this.storage){if(Vs("SharedClientState","EVENT",e.key,e.newValue),e.key===this.js)return void Us("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Oe.enqueueRetryable((async()=>{if(this.started){if(null!==e.key)if(this.Ws.test(e.key)){if(null==e.newValue){const t=this.ci(e.key);return this.ai(t,null)}{const t=this.ui(e.key,e.newValue);if(t)return this.ai(t.clientId,t)}}else if(this.Gs.test(e.key)){if(null!==e.newValue){const t=this.hi(e.key,e.newValue);if(t)return this.li(t)}}else if(this.zs.test(e.key)){if(null!==e.newValue){const t=this.fi(e.key,e.newValue);if(t)return this.di(t)}}else if(e.key===this.Hs){if(null!==e.newValue){const t=this.Xs(e.newValue);if(t)return this.Zs(t)}}else if(e.key===this.Qs){const t=function(t){let e=er.T;if(null!=t)try{const n=JSON.parse(t);Ks("number"==typeof n),e=n}catch(t){Us("SharedClientState","Failed to read sequence number from WebStorage",t)}return e}(e.newValue);t!==er.T&&this.sequenceNumberHandler(t)}else if(e.key===this.Js)return this.syncEngine.wi()}else this.Ks.push(e)}))}}get si(){return this.qs.get(this.Ls)}Ys(){this.setItem(this.js,this.si.Os())}ei(t,e,n){const s=new xu(this.currentUser,t,e,n),r=Au(this.persistenceKey,this.currentUser,t);this.setItem(r,s.Os())}ni(t){const e=Au(this.persistenceKey,this.currentUser,t);this.removeItem(e)}ri(t){const e={clientId:this.Ls,onlineState:t};this.storage.setItem(this.Hs,JSON.stringify(e))}ii(t,e,n){const s=Du(this.persistenceKey,t),r=new Cu(t,e,n);this.setItem(s,r.Os())}oi(){this.setItem(this.Js,"value-not-used")}ci(t){const e=this.Ws.exec(t);return e?e[1]:null}ui(t,e){const n=this.ci(t);return ku.$s(n,e)}hi(t,e){const n=this.Gs.exec(t),s=Number(n[1]),r=void 0!==n[2]?n[2]:null;return xu.$s(new Ls(r),s,e)}fi(t,e){const n=this.zs.exec(t),s=Number(n[1]);return Cu.$s(s,e)}Xs(t){return Ru.$s(t)}async li(t){if(t.user.uid===this.currentUser.uid)return this.syncEngine._i(t.batchId,t.state,t.error);Vs("SharedClientState",`Ignoring mutation for non-active user ${t.user.uid}`)}di(t){return this.syncEngine.mi(t.targetId,t.state,t.error)}ai(t,e){const n=e?this.qs.insert(t,e):this.qs.remove(t),s=this.ti(this.qs),r=this.ti(n),i=[],o=[];return r.forEach((t=>{s.has(t)||i.push(t)})),s.forEach((t=>{r.has(t)||o.push(t)})),this.syncEngine.gi(i,o).then((()=>{this.qs=n}))}Zs(t){this.qs.get(t.clientId)&&this.onlineStateHandler(t.onlineState)}ti(t){let e=Do();return t.forEach(((t,n)=>{e=e.unionWith(n.activeTargetIds)})),e}}class Mu{constructor(){this.yi=new Lu,this.pi={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,e,n){}addLocalQueryTarget(t){return this.yi.Fs(t),this.pi[t]||"not-current"}updateQueryState(t,e,n){this.pi[t]=e}removeLocalQueryTarget(t){this.yi.Ms(t)}isLocalQueryTarget(t){return this.yi.activeTargetIds.has(t)}clearQueryState(t){delete this.pi[t]}getAllActiveQueryTargets(){return this.yi.activeTargetIds}isActiveQueryTarget(t){return this.yi.activeTargetIds.has(t)}start(){return this.yi=new Lu,Promise.resolve()}handleUserChange(t,e,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Fu{Ti(t){}shutdown(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Pu{constructor(){this.Ei=()=>this.Ii(),this.Ai=()=>this.Ri(),this.bi=[],this.Pi()}Ti(t){this.bi.push(t)}shutdown(){window.removeEventListener("online",this.Ei),window.removeEventListener("offline",this.Ai)}Pi(){window.addEventListener("online",this.Ei),window.addEventListener("offline",this.Ai)}Ii(){Vs("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const t of this.bi)t(0)}Ri(){Vs("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const t of this.bi)t(1)}static bt(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Vu={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"}; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Uu{constructor(t){this.vi=t.vi,this.Vi=t.Vi}Si(t){this.Di=t}Ci(t){this.Ni=t}onMessage(t){this.xi=t}close(){this.Vi()}send(t){this.vi(t)}ki(){this.Di()}$i(t){this.Ni(t)}Oi(t){this.xi(t)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qu extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const e=t.ssl?"https":"http";this.Fi=e+"://"+t.host,this.Mi="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}Li(t,e,n,s){const r=this.Bi(t,e);Vs("RestConnection","Sending: ",r,n);const i={};return this.Ui(i,s),this.qi(t,r,i,n).then((t=>(Vs("RestConnection","Received: ",t),t)),(e=>{throw qs("RestConnection",`${t} failed with error: `,e,"url: ",r,"request:",n),e}))}Ki(t,e,n,s){return this.Li(t,e,n,s)}Ui(t,e){if(t["X-Goog-Api-Client"]="gl-js/ fire/"+Os,t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e)for(const n in e.authHeaders)e.authHeaders.hasOwnProperty(n)&&(t[n]=e.authHeaders[n])}Bi(t,e){const n=Vu[t];return`${this.Fi}/v1/${e}:${n}`}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams}qi(t,e,n,s){return new Promise(((r,i)=>{const o=new ks;o.listenOnce(_s.COMPLETE,(()=>{try{switch(o.getLastErrorCode()){case Ss.NO_ERROR:const e=o.getResponseJson();Vs("Connection","XHR received:",JSON.stringify(e)),r(e);break;case Ss.TIMEOUT:Vs("Connection",'RPC "'+t+'" timed out'),i(new zs(Hs.DEADLINE_EXCEEDED,"Request time out"));break;case Ss.HTTP_ERROR:const n=o.getStatus();if(Vs("Connection",'RPC "'+t+'" failed with status:',n,"response text:",o.getResponseText()),n>0){const t=o.getResponseJson().error;if(t&&t.status&&t.message){const e=function(t){const e=t.toLowerCase().replace(/_/g,"-");return Object.values(Hs).indexOf(e)>=0?e:Hs.UNKNOWN}(t.status);i(new zs(e,t.message))}else i(new zs(Hs.UNKNOWN,"Server responded with status "+o.getStatus()))}else i(new zs(Hs.UNAVAILABLE,"Connection failed."));break;default:js()}}finally{Vs("Connection",'RPC "'+t+'" completed.')}}));const a=JSON.stringify(s);o.send(e,"POST",a,n,15)}))}ji(t,e){const n=[this.Fi,"/","google.firestore.v1.Firestore","/",t,"/channel"],s=new vs,r=de(),i={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(i.xmlHttpFactory=new xs({})),this.Ui(i.initMessageHeaders,e),"undefined"!=typeof window&&(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(h())||"object"==typeof navigator&&"ReactNative"===navigator.product||h().indexOf("Electron/")>=0||function(){const t=h();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}()||h().indexOf("MSAppHost/")>=0||function(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}()||(i.httpHeadersOverwriteParam="$httpHeaders");const o=n.join("");Vs("Connection","Creating WebChannel: "+o,i);const a=s.createWebChannel(o,i);let c=!1,u=!1;const l=new Uu({vi:t=>{u?Vs("Connection","Not sending because WebChannel is closed:",t):(c||(Vs("Connection","Opening WebChannel transport."),a.open(),c=!0),Vs("Connection","WebChannel sending:",t),a.send(t))},Vi:()=>a.close()}),d=(t,e,n)=>{t.listen(e,(t=>{try{n(t)}catch(t){setTimeout((()=>{throw t}),0)}}))};return d(a,Cs.EventType.OPEN,(()=>{u||Vs("Connection","WebChannel transport opened.")})),d(a,Cs.EventType.CLOSE,(()=>{u||(u=!0,Vs("Connection","WebChannel transport closed"),l.$i())})),d(a,Cs.EventType.ERROR,(t=>{u||(u=!0,qs("Connection","WebChannel transport errored:",t),l.$i(new zs(Hs.UNAVAILABLE,"The operation could not be completed")))})),d(a,Cs.EventType.MESSAGE,(t=>{var e;if(!u){const n=t.data[0];Ks(!!n);const s=n,r=s.error||(null===(e=s[0])||void 0===e?void 0:e.error);if(r){Vs("Connection","WebChannel received error:",r);const t=r.status;let e=function(t){const e=uo[t];if(void 0!==e)return fo(e)}(t),n=r.message;void 0===e&&(e=Hs.INTERNAL,n="Unknown error status: "+t+" with message "+r.message),u=!0,l.$i(new zs(e,n)),a.close()}else Vs("Connection","WebChannel received:",n),l.Oi(n)}})),d(r,Ns.STAT_EVENT,(t=>{t.stat===As?Vs("Connection","Detected buffering proxy"):t.stat===Ds&&Vs("Connection","Detected no buffering proxy")})),setTimeout((()=>{l.ki()}),0),l}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Bu(){return"undefined"!=typeof window?window:null}function ju(){return"undefined"!=typeof document?document:null} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Ku(t){return new qo(t,!0)}class $u{constructor(t,e,n=1e3,s=1.5,r=6e4){this.Oe=t,this.timerId=e,this.Qi=n,this.Wi=s,this.Gi=r,this.zi=0,this.Hi=null,this.Ji=Date.now(),this.reset()}reset(){this.zi=0}Yi(){this.zi=this.Gi}Xi(t){this.cancel();const e=Math.floor(this.zi+this.Zi()),n=Math.max(0,Date.now()-this.Ji),s=Math.max(0,e-n);s>0&&Vs("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.zi} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),this.Hi=this.Oe.enqueueAfterDelay(this.timerId,s,(()=>(this.Ji=Date.now(),t()))),this.zi*=this.Wi,this.zithis.Gi&&(this.zi=this.Gi)}tr(){null!==this.Hi&&(this.Hi.skipDelay(),this.Hi=null)}cancel(){null!==this.Hi&&(this.Hi.cancel(),this.Hi=null)}Zi(){return(Math.random()-.5)*this.zi}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Gu{constructor(t,e,n,s,r,i,o){this.Oe=t,this.er=n,this.nr=s,this.sr=r,this.credentialsProvider=i,this.listener=o,this.state=0,this.ir=0,this.rr=null,this.cr=null,this.stream=null,this.ar=new $u(t,e)}ur(){return 1===this.state||5===this.state||this.hr()}hr(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.lr()}async stop(){this.ur()&&await this.close(0)}dr(){this.state=0,this.ar.reset()}wr(){this.hr()&&null===this.rr&&(this.rr=this.Oe.enqueueAfterDelay(this.er,6e4,(()=>this._r())))}mr(t){this.gr(),this.stream.send(t)}async _r(){if(this.hr())return this.close(0)}gr(){this.rr&&(this.rr.cancel(),this.rr=null)}yr(){this.cr&&(this.cr.cancel(),this.cr=null)}async close(t,e){this.gr(),this.yr(),this.ar.cancel(),this.ir++,4!==t?this.ar.reset():e&&e.code===Hs.RESOURCE_EXHAUSTED?(Us(e.toString()),Us("Using maximum backoff delay to prevent overloading the backend."),this.ar.Yi()):e&&e.code===Hs.UNAUTHENTICATED&&3!==this.state&&this.credentialsProvider.invalidateToken(),null!==this.stream&&(this.pr(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Ci(e)}pr(){}auth(){this.state=1;const t=this.Tr(this.ir),e=this.ir;this.credentialsProvider.getToken().then((t=>{this.ir===e&&this.Er(t)}),(e=>{t((()=>{const t=new zs(Hs.UNKNOWN,"Fetching auth token failed: "+e.message);return this.Ir(t)}))}))}Er(t){const e=this.Tr(this.ir);this.stream=this.Ar(t),this.stream.Si((()=>{e((()=>(this.state=2,this.cr=this.Oe.enqueueAfterDelay(this.nr,1e4,(()=>(this.hr()&&(this.state=3),Promise.resolve()))),this.listener.Si())))})),this.stream.Ci((t=>{e((()=>this.Ir(t)))})),this.stream.onMessage((t=>{e((()=>this.onMessage(t)))}))}lr(){this.state=5,this.ar.Xi((async()=>{this.state=0,this.start()}))}Ir(t){return Vs("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}Tr(t){return e=>{this.Oe.enqueueAndForget((()=>this.ir===t?e():(Vs("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Hu extends Gu{constructor(t,e,n,s,r){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",e,n,r),this.N=s}Ar(t){return this.sr.ji("Listen",t)}onMessage(t){this.ar.reset();const e=function(t,e){let n;if("targetChange"in e){e.targetChange;const s=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:js()}(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],i=function(t,e){return t.D?(Ks(void 0===e||"string"==typeof e),wr.fromBase64String(e||"")):(Ks(void 0===e||e instanceof Uint8Array),wr.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(t){const e=void 0===t.code?Hs.UNKNOWN:fo(t.code);return new zs(e,t.message||"")}(o);n=new Lo(s,r,i,a||null)}else if("documentChange"in e){e.documentChange;const s=e.documentChange;s.document,s.document.name,s.document.updateTime;const r=Qo(t,s.document.name),i=$o(s.document.updateTime),o=new $r({mapValue:{fields:s.document.fields}}),a=Hr.newFoundDocument(r,i,o),c=s.targetIds||[],u=s.removedTargetIds||[];n=new ko(c,u,a.key,a)}else if("documentDelete"in e){e.documentDelete;const s=e.documentDelete;s.document;const r=Qo(t,s.document),i=s.readTime?$o(s.readTime):cr.min(),o=Hr.newNoDocument(r,i),a=s.removedTargetIds||[];n=new ko([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const s=e.documentRemove;s.document;const r=Qo(t,s.document),i=s.removedTargetIds||[];n=new ko([],i,r,null)}else{if(!("filter"in e))return js();{e.filter;const t=e.filter;t.targetId;const s=t.count||0,r=new co(s),i=t.targetId;n=new Ro(i,r)}}return n}(this.N,t),n=function(t){if(!("targetChange"in t))return cr.min();const e=t.targetChange;return e.targetIds&&e.targetIds.length?cr.min():e.readTime?$o(e.readTime):cr.min()}(t);return this.listener.Rr(e,n)}br(t){const e={};e.database=Xo(this.N),e.addTarget=function(t,e){let n;const s=e.target;return n=Xr(s)?{documents:sa(t,s)}:{query:ra(t,s)},n.targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=jo(t,e.resumeToken):e.snapshotVersion.compareTo(cr.min())>0&&(n.readTime=Bo(t,e.snapshotVersion.toTimestamp())),n}(this.N,t);const n=function(t,e){const n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return js()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.N,t);n&&(e.labels=n),this.mr(e)}Pr(t){const e={};e.database=Xo(this.N),e.removeTarget=t,this.mr(e)}}class zu extends Gu{constructor(t,e,n,s,r){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",e,n,r),this.N=s,this.vr=!1}get Vr(){return this.vr}start(){this.vr=!1,this.lastStreamToken=void 0,super.start()}pr(){this.vr&&this.Sr([])}Ar(t){return this.sr.ji("Write",t)}onMessage(t){if(Ks(!!t.streamToken),this.lastStreamToken=t.streamToken,this.vr){this.ar.reset();const e=function(t,e){return t&&t.length>0?(Ks(void 0!==e),t.map((t=>function(t,e){let n=t.updateTime?$o(t.updateTime):$o(e);return n.isEqual(cr.min())&&(n=$o(e)),new Hi(n,t.transformResults||[])}(t,e)))):[]}(t.writeResults,t.commitTime),n=$o(t.commitTime);return this.listener.Dr(n,e)}return Ks(!t.writeResults||0===t.writeResults.length),this.vr=!0,this.listener.Cr()}Nr(){const t={};t.database=Xo(this.N),this.mr(t)}Sr(t){const e={streamToken:this.lastStreamToken,writes:t.map((t=>ea(this.N,t)))};this.mr(e)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Qu extends class{}{constructor(t,e,n){super(),this.credentials=t,this.sr=e,this.N=n,this.kr=!1}$r(){if(this.kr)throw new zs(Hs.FAILED_PRECONDITION,"The client has already been terminated.")}Li(t,e,n){return this.$r(),this.credentials.getToken().then((s=>this.sr.Li(t,e,n,s))).catch((t=>{throw"FirebaseError"===t.name?(t.code===Hs.UNAUTHENTICATED&&this.credentials.invalidateToken(),t):new zs(Hs.UNKNOWN,t.toString())}))}Ki(t,e,n){return this.$r(),this.credentials.getToken().then((s=>this.sr.Ki(t,e,n,s))).catch((t=>{throw"FirebaseError"===t.name?(t.code===Hs.UNAUTHENTICATED&&this.credentials.invalidateToken(),t):new zs(Hs.UNKNOWN,t.toString())}))}terminate(){this.kr=!0}}class Wu{constructor(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.Or=0,this.Fr=null,this.Mr=!0}Lr(){0===this.Or&&(this.Br("Unknown"),this.Fr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.Fr=null,this.Ur("Backend didn't respond within 10 seconds."),this.Br("Offline"),Promise.resolve()))))}qr(t){"Online"===this.state?this.Br("Unknown"):(this.Or++,this.Or>=1&&(this.Kr(),this.Ur(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.Br("Offline")))}set(t){this.Kr(),this.Or=0,"Online"===t&&(this.Mr=!1),this.Br(t)}Br(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}Ur(t){const e=`Could not reach Cloud Firestore backend. ${t}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.Mr?(Us(e),this.Mr=!1):Vs("OnlineStateTracker",e)}Kr(){null!==this.Fr&&(this.Fr.cancel(),this.Fr=null)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Yu{constructor(t,e,n,s,r){this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.jr=[],this.Qr=new Map,this.Wr=new Set,this.Gr=[],this.zr=r,this.zr.Ti((t=>{n.enqueueAndForget((async()=>{ih(this)&&(Vs("RemoteStore","Restarting streams for network reachability change."),await async function(t){const e=Gs(t);e.Wr.add(4),await Ju(e),e.Hr.set("Unknown"),e.Wr.delete(4),await Xu(e)}(this))}))})),this.Hr=new Wu(n,s)}}async function Xu(t){if(ih(t))for(const e of t.Gr)await e(!0)}async function Ju(t){for(const e of t.Gr)await e(!1)}function Zu(t,e){const n=Gs(t);n.Qr.has(e.targetId)||(n.Qr.set(e.targetId,e),rh(n)?sh(n):Eh(n).hr()&&eh(n,e))}function th(t,e){const n=Gs(t),s=Eh(n);n.Qr.delete(e),s.hr()&&nh(n,e),0===n.Qr.size&&(s.hr()?s.wr():ih(n)&&n.Hr.set("Unknown"))}function eh(t,e){t.Jr.Y(e.targetId),Eh(t).br(e)}function nh(t,e){t.Jr.Y(e),Eh(t).Pr(e)}function sh(t){t.Jr=new Mo({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Tt:e=>t.Qr.get(e)||null}),Eh(t).start(),t.Hr.Lr()}function rh(t){return ih(t)&&!Eh(t).ur()&&t.Qr.size>0}function ih(t){return 0===Gs(t).Wr.size}function oh(t){t.Jr=void 0}async function ah(t){t.Qr.forEach(((e,n)=>{eh(t,e)}))}async function ch(t,e){oh(t),rh(t)?(t.Hr.qr(e),sh(t)):t.Hr.set("Unknown")}async function uh(t,e,n){if(t.Hr.set("Online"),e instanceof Lo&&2===e.state&&e.cause)try{await async function(t,e){const n=e.cause;for(const s of e.targetIds)t.Qr.has(s)&&(await t.remoteSyncer.rejectListen(s,n),t.Qr.delete(s),t.Jr.removeTarget(s))}(t,e)}catch(n){Vs("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),await hh(t,n)}else if(e instanceof ko?t.Jr.rt(e):e instanceof Ro?t.Jr.ft(e):t.Jr.at(e),!n.isEqual(cr.min()))try{const e=await au(t.localStore);n.compareTo(e)>=0&&await function(t,e){const n=t.Jr._t(e);return n.targetChanges.forEach(((n,s)=>{if(n.resumeToken.approximateByteSize()>0){const r=t.Qr.get(s);r&&t.Qr.set(s,r.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((e=>{const n=t.Qr.get(e);if(!n)return;t.Qr.set(e,n.withResumeToken(wr.EMPTY_BYTE_STRING,n.snapshotVersion)),nh(t,e);const s=new tc(n.target,e,1,n.sequenceNumber);eh(t,s)})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)}catch(e){Vs("RemoteStore","Failed to raise snapshot:",e),await hh(t,e)}}async function hh(t,e,n){if(!Ga(e))throw e;t.Wr.add(1),await Ju(t),t.Hr.set("Offline"),n||(n=()=>au(t.localStore)),t.asyncQueue.enqueueRetryable((async()=>{Vs("RemoteStore","Retrying IndexedDB access"),await n(),t.Wr.delete(1),await Xu(t)}))}function lh(t,e){return e().catch((n=>hh(t,n,e)))}async function dh(t){const e=Gs(t),n=Ih(e);let s=e.jr.length>0?e.jr[e.jr.length-1].batchId:-1;for(;fh(e);)try{const t=await uu(e.localStore,s);if(null===t){0===e.jr.length&&n.wr();break}s=t.batchId,gh(e,t)}catch(t){await hh(e,t)}mh(e)&&ph(e)}function fh(t){return ih(t)&&t.jr.length<10}function gh(t,e){t.jr.push(e);const n=Ih(t);n.hr()&&n.Vr&&n.Sr(e.mutations)}function mh(t){return ih(t)&&!Ih(t).ur()&&t.jr.length>0}function ph(t){Ih(t).start()}async function yh(t){Ih(t).Nr()}async function wh(t){const e=Ih(t);for(const n of t.jr)e.Sr(n.mutations)}async function vh(t,e,n){const s=t.jr.shift(),r=Za.from(s,e,n);await lh(t,(()=>t.remoteSyncer.applySuccessfulWrite(r))),await dh(t)}async function bh(t,e){e&&Ih(t).Vr&&await async function(t,e){if(lo(n=e.code)&&n!==Hs.ABORTED){const n=t.jr.shift();Ih(t).dr(),await lh(t,(()=>t.remoteSyncer.rejectFailedWrite(n.batchId,e))),await dh(t)}var n}(t,e),mh(t)&&ph(t)}async function Th(t,e){const n=Gs(t);e?(n.Wr.delete(2),await Xu(n)):e||(n.Wr.add(2),await Ju(n),n.Hr.set("Unknown"))}function Eh(t){return t.Yr||(t.Yr=function(t,e,n){const s=Gs(t);return s.$r(),new Hu(e,s.sr,s.credentials,s.N,n)}(t.datastore,t.asyncQueue,{Si:ah.bind(null,t),Ci:ch.bind(null,t),Rr:uh.bind(null,t)}),t.Gr.push((async e=>{e?(t.Yr.dr(),rh(t)?sh(t):t.Hr.set("Unknown")):(await t.Yr.stop(),oh(t))}))),t.Yr}function Ih(t){return t.Xr||(t.Xr=function(t,e,n){const s=Gs(t);return s.$r(),new zu(e,s.sr,s.credentials,s.N,n)}(t.datastore,t.asyncQueue,{Si:yh.bind(null,t),Ci:bh.bind(null,t),Cr:wh.bind(null,t),Dr:vh.bind(null,t)}),t.Gr.push((async e=>{e?(t.Xr.dr(),await dh(t)):(await t.Xr.stop(),t.jr.length>0&&(Vs("RemoteStore",`Stopping write stream with ${t.jr.length} pending writes`),t.jr=[]))}))),t.Xr +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class Sh{constructor(t,e,n,s,r){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=s,this.removalCallback=r,this.deferred=new Qs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((t=>{}))}static createAndSchedule(t,e,n,s,r){const i=Date.now()+n,o=new Sh(t,e,i,s,r);return o.start(n),o}start(t){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new zs(Hs.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then((t=>this.deferred.resolve(t)))):Promise.resolve()))}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function _h(t,e){if(Us("AsyncQueue",`${e}: ${t}`),Ga(t))return new zs(Hs.UNAVAILABLE,`${e}: ${t}`);throw t} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Nh{constructor(t){this.comparator=t?(e,n)=>t(e,n)||xr.comparator(e.key,n.key):(t,e)=>xr.comparator(t.key,e.key),this.keyedMap=Eo(),this.sortedSet=new go(this.comparator)}static emptySet(t){return new Nh(t.comparator)}has(t){return null!=this.keyedMap.get(t)}get(t){return this.keyedMap.get(t)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(t){const e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1}get size(){return this.sortedSet.size}forEach(t){this.sortedSet.inorderTraversal(((e,n)=>(t(e),!1)))}add(t){const e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))}delete(t){const e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this}isEqual(t){if(!(t instanceof Nh))return!1;if(this.size!==t.size)return!1;const e=this.sortedSet.getIterator(),n=t.sortedSet.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(!t.isEqual(s))return!1}return!0}toString(){const t=[];return this.forEach((e=>{t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"}copy(t,e){const n=new Nh;return n.comparator=this.comparator,n.keyedMap=t,n.sortedSet=e,n}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ah{constructor(){this.Zr=new go(xr.comparator)}track(t){const e=t.doc.key,n=this.Zr.get(e);n?0!==t.type&&3===n.type?this.Zr=this.Zr.insert(e,t):3===t.type&&1!==n.type?this.Zr=this.Zr.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.Zr=this.Zr.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.Zr=this.Zr.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.Zr=this.Zr.remove(e):1===t.type&&2===n.type?this.Zr=this.Zr.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.Zr=this.Zr.insert(e,{type:2,doc:t.doc}):js():this.Zr=this.Zr.insert(e,t)}eo(){const t=[];return this.Zr.inorderTraversal(((e,n)=>{t.push(n)})),t}}class Dh{constructor(t,e,n,s,r,i,o,a){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=s,this.mutatedKeys=r,this.fromCache=i,this.syncStateChanged=o,this.excludesMetadataChanges=a}static fromInitialDocuments(t,e,n,s){const r=[];return e.forEach((t=>{r.push({type:0,doc:t})})),new Dh(t,e,Nh.emptySet(e),r,n,s,!0,!1)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&Si(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;const e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(let t=0;t_i(t)),Si),this.onlineState="Unknown",this.so=new Set}}async function kh(t,e){const n=Gs(t),s=e.query;let r=!1,i=n.queries.get(s);if(i||(r=!0,i=new xh),r)try{i.no=await n.onListen(s)}catch(t){const n=_h(t,`Initialization of query '${Ni(e.query)}' failed`);return void e.onError(n)}n.queries.set(s,i),i.listeners.push(e),e.io(n.onlineState),i.no&&e.ro(i.no)&&Mh(n)}async function Rh(t,e){const n=Gs(t),s=e.query;let r=!1;const i=n.queries.get(s);if(i){const t=i.listeners.indexOf(e);t>=0&&(i.listeners.splice(t,1),r=0===i.listeners.length)}if(r)return n.queries.delete(s),n.onUnlisten(s)}function Lh(t,e){const n=Gs(t);let s=!1;for(const t of e){const e=t.query,r=n.queries.get(e);if(r){for(const e of r.listeners)e.ro(t)&&(s=!0);r.no=t}}s&&Mh(n)}function Oh(t,e,n){const s=Gs(t),r=s.queries.get(e);if(r)for(const t of r.listeners)t.onError(n);s.queries.delete(e)}function Mh(t){t.so.forEach((t=>{t.next()}))}class Fh{constructor(t,e,n){this.query=t,this.oo=e,this.co=!1,this.ao=null,this.onlineState="Unknown",this.options=n||{}}ro(t){if(!this.options.includeMetadataChanges){const e=[];for(const n of t.docChanges)3!==n.type&&e.push(n);t=new Dh(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}let e=!1;return this.co?this.uo(t)&&(this.oo.next(t),e=!0):this.ho(t,this.onlineState)&&(this.lo(t),e=!0),this.ao=t,e}onError(t){this.oo.error(t)}io(t){this.onlineState=t;let e=!1;return this.ao&&!this.co&&this.ho(this.ao,t)&&(this.lo(this.ao),e=!0),e}ho(t,e){if(!t.fromCache)return!0;const n="Offline"!==e;return!(this.options.fo&&n||t.docs.isEmpty()&&"Offline"!==e)}uo(t){if(t.docChanges.length>0)return!0;const e=this.ao&&this.ao.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges}lo(t){t=Dh.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.co=!0,this.oo.next(t)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Ph{constructor(t,e){this.payload=t,this.byteLength=e}wo(){return"metadata"in this.payload}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Vh{constructor(t){this.N=t}zn(t){return Qo(this.N,t)}Hn(t){return t.metadata.exists?ta(this.N,t.document,!1):Hr.newNoDocument(this.zn(t.metadata.name),this.Jn(t.metadata.readTime))}Jn(t){return $o(t)}}class Uh{constructor(t,e,n){this._o=t,this.localStore=e,this.N=n,this.queries=[],this.documents=[],this.progress=qh(t)}mo(t){this.progress.bytesLoaded+=t.byteLength;let e=this.progress.documentsLoaded;return t.payload.namedQuery?this.queries.push(t.payload.namedQuery):t.payload.documentMetadata?(this.documents.push({metadata:t.payload.documentMetadata}),t.payload.documentMetadata.exists||++e):t.payload.document&&(this.documents[this.documents.length-1].document=t.payload.document,++e),e!==this.progress.documentsLoaded?(this.progress.documentsLoaded=e,Object.assign({},this.progress)):null}yo(t){const e=new Map,n=new Vh(this.N);for(const s of t)if(s.metadata.queries){const t=n.zn(s.metadata.name);for(const n of s.metadata.queries){const s=(e.get(n)||No()).add(t);e.set(n,s)}}return e}async complete(){const t=await async function(t,e,n,s){const r=Gs(t);let i=No(),o=bo(),a=So();for(const t of n){const n=e.zn(t.metadata.name);t.document&&(i=i.add(n)),o=o.insert(n,e.Hn(t)),a=a.insert(n,e.Jn(t.metadata.readTime))}const c=r.jn.newChangeBuffer({trackRemovals:!0}),u=await hu(r,function(t){return Ei(mi(fr.fromString(`__bundle__/docs/${t}`)))}(s));return r.persistence.runTransaction("Apply bundle documents","readwrite",(t=>cu(t,c,o,cr.min(),a).next((e=>(c.apply(t),e))).next((e=>r.ze.removeMatchingKeysForTargetId(t,u.targetId).next((()=>r.ze.addMatchingKeys(t,i,u.targetId))).next((()=>r.Qn.vn(t,e))).next((()=>e))))))}(this.localStore,new Vh(this.N),this.documents,this._o.id),e=this.yo(this.documents);for(const t of this.queries)await mu(this.localStore,t,e.get(t.name));return this.progress.taskState="Success",new tu(Object.assign({},this.progress),t)}}function qh(t){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Bh{constructor(t){this.key=t}}class jh{constructor(t){this.key=t}}class Kh{constructor(t,e){this.query=t,this.po=e,this.To=null,this.current=!1,this.Eo=No(),this.mutatedKeys=No(),this.Io=Di(t),this.Ao=new Nh(this.Io)}get Ro(){return this.po}bo(t,e){const n=e?e.Po:new Ah,s=e?e.Ao:this.Ao;let r=e?e.mutatedKeys:this.mutatedKeys,i=s,o=!1;const a=pi(this.query)&&s.size===this.query.limit?s.last():null,c=yi(this.query)&&s.size===this.query.limit?s.first():null;if(t.inorderTraversal(((t,e)=>{const u=s.get(t),h=Ai(this.query,e)?e:null,l=!!u&&this.mutatedKeys.has(u.key),d=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations);let f=!1;u&&h?u.data.isEqual(h.data)?l!==d&&(n.track({type:3,doc:h}),f=!0):this.vo(u,h)||(n.track({type:2,doc:h}),f=!0,(a&&this.Io(h,a)>0||c&&this.Io(h,c)<0)&&(o=!0)):!u&&h?(n.track({type:0,doc:h}),f=!0):u&&!h&&(n.track({type:1,doc:u}),f=!0,(a||c)&&(o=!0)),f&&(h?(i=i.add(h),r=d?r.add(t):r.delete(t)):(i=i.delete(t),r=r.delete(t)))})),pi(this.query)||yi(this.query))for(;i.size>this.query.limit;){const t=pi(this.query)?i.last():i.first();i=i.delete(t.key),r=r.delete(t.key),n.track({type:1,doc:t})}return{Ao:i,Po:n,Ln:o,mutatedKeys:r}}vo(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations}applyChanges(t,e,n){const s=this.Ao;this.Ao=t.Ao,this.mutatedKeys=t.mutatedKeys;const r=t.Po.eo();r.sort(((t,e)=>function(t,e){const n=t=>{switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return js()}};return n(t)-n(e)}(t.type,e.type)||this.Io(t.doc,e.doc))),this.Vo(n);const i=e?this.So():[],o=0===this.Eo.size&&this.current?1:0,a=o!==this.To;return this.To=o,0!==r.length||a?{snapshot:new Dh(this.query,t.Ao,s,r,t.mutatedKeys,0===o,a,!1),Do:i}:{Do:i}}io(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({Ao:this.Ao,Po:new Ah,mutatedKeys:this.mutatedKeys,Ln:!1},!1)):{Do:[]}}Co(t){return!this.po.has(t)&&!!this.Ao.has(t)&&!this.Ao.get(t).hasLocalMutations}Vo(t){t&&(t.addedDocuments.forEach((t=>this.po=this.po.add(t))),t.modifiedDocuments.forEach((t=>{})),t.removedDocuments.forEach((t=>this.po=this.po.delete(t))),this.current=t.current)}So(){if(!this.current)return[];const t=this.Eo;this.Eo=No(),this.Ao.forEach((t=>{this.Co(t.key)&&(this.Eo=this.Eo.add(t.key))}));const e=[];return t.forEach((t=>{this.Eo.has(t)||e.push(new jh(t))})),this.Eo.forEach((n=>{t.has(n)||e.push(new Bh(n))})),e}No(t){this.po=t.Gn,this.Eo=No();const e=this.bo(t.documents);return this.applyChanges(e,!0)}xo(){return Dh.fromInitialDocuments(this.query,this.Ao,this.mutatedKeys,0===this.To)}}class $h{constructor(t,e,n){this.query=t,this.targetId=e,this.view=n}}class Gh{constructor(t){this.key=t,this.ko=!1}}class Hh{constructor(t,e,n,s,r,i){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=s,this.currentUser=r,this.maxConcurrentLimboResolutions=i,this.$o={},this.Oo=new qc((t=>_i(t)),Si),this.Fo=new Map,this.Mo=new Set,this.Lo=new go(xr.comparator),this.Bo=new Map,this.Uo=new yu,this.qo={},this.Ko=new Map,this.jo=Dc.ie(),this.onlineState="Unknown",this.Qo=void 0}get isPrimaryClient(){return!0===this.Qo}}async function zh(t,e){const n=vl(t);let s,r;const i=n.Oo.get(e);if(i)s=i.targetId,n.sharedClientState.addLocalQueryTarget(s),r=i.view.xo();else{const t=await hu(n.localStore,Ei(e)),i=n.sharedClientState.addLocalQueryTarget(t.targetId);s=t.targetId,r=await Qh(n,e,s,"current"===i),n.isPrimaryClient&&Zu(n.remoteStore,t)}return r}async function Qh(t,e,n,s){t.Wo=(e,n,s)=>async function(t,e,n,s){let r=e.view.bo(n);r.Ln&&(r=await du(t.localStore,e.query,!1).then((({documents:t})=>e.view.bo(t,r))));const i=s&&s.targetChanges.get(e.targetId),o=e.view.applyChanges(r,t.isPrimaryClient,i);return il(t,e.targetId,o.Do),o.snapshot}(t,e,n,s);const r=await du(t.localStore,e,!0),i=new Kh(e,r.Gn),o=i.bo(r.documents),a=Co.createSynthesizedTargetChangeForCurrentChange(n,s&&"Offline"!==t.onlineState),c=i.applyChanges(o,t.isPrimaryClient,a);il(t,n,c.Do);const u=new $h(e,n,i);return t.Oo.set(e,u),t.Fo.has(n)?t.Fo.get(n).push(e):t.Fo.set(n,[e]),c.snapshot}async function Wh(t,e){const n=Gs(t),s=n.Oo.get(e),r=n.Fo.get(s.targetId);if(r.length>1)return n.Fo.set(s.targetId,r.filter((t=>!Si(t,e)))),void n.Oo.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(s.targetId),n.sharedClientState.isActiveQueryTarget(s.targetId)||await lu(n.localStore,s.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(s.targetId),th(n.remoteStore,s.targetId),sl(n,s.targetId)})).catch(Lc)):(sl(n,s.targetId),await lu(n.localStore,s.targetId,!0))}async function Yh(t,e){const n=Gs(t);try{const t=await function(t,e){const n=Gs(t),s=e.snapshotVersion;let r=n.Un;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(t=>{const i=n.jn.newChangeBuffer({trackRemovals:!0});r=n.Un;const o=[];e.targetChanges.forEach(((e,i)=>{const a=r.get(i);if(!a)return;o.push(n.ze.removeMatchingKeys(t,e.removedDocuments,i).next((()=>n.ze.addMatchingKeys(t,e.addedDocuments,i))));const c=e.resumeToken;if(c.approximateByteSize()>0){const u=a.withResumeToken(c,s).withSequenceNumber(t.currentSequenceNumber);r=r.insert(i,u),function(t,e,n){return Ks(e.resumeToken.approximateByteSize()>0),0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(a,u,e)&&o.push(n.ze.updateTargetData(t,u))}}));let a=bo();if(e.documentUpdates.forEach(((s,r)=>{e.resolvedLimboDocuments.has(s)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(t,s))})),o.push(cu(t,i,e.documentUpdates,s,void 0).next((t=>{a=t}))),!s.isEqual(cr.min())){const e=n.ze.getLastRemoteSnapshotVersion(t).next((e=>n.ze.setTargetsMetadata(t,t.currentSequenceNumber,s)));o.push(e)}return qa.waitFor(o).next((()=>i.apply(t))).next((()=>n.Qn.vn(t,a))).next((()=>a))})).then((t=>(n.Un=r,t)))}(n.localStore,e);e.targetChanges.forEach(((t,e)=>{const s=n.Bo.get(e);s&&(Ks(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?s.ko=!0:t.modifiedDocuments.size>0?Ks(s.ko):t.removedDocuments.size>0&&(Ks(s.ko),s.ko=!1))})),await cl(n,t,e)}catch(t){await Lc(t)}}function Xh(t,e,n){const s=Gs(t);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const t=[];s.Oo.forEach(((n,s)=>{const r=s.view.io(e);r.snapshot&&t.push(r.snapshot)})),function(t,e){const n=Gs(t);n.onlineState=e;let s=!1;n.queries.forEach(((t,n)=>{for(const t of n.listeners)t.io(e)&&(s=!0)})),s&&Mh(n)}(s.eventManager,e),t.length&&s.$o.Rr(t),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function Jh(t,e,n){const s=Gs(t);s.sharedClientState.updateQueryState(e,"rejected",n);const r=s.Bo.get(e),i=r&&r.key;if(i){let t=new go(xr.comparator);t=t.insert(i,Hr.newNoDocument(i,cr.min()));const n=No().add(i),r=new xo(cr.min(),new Map,new yo(rr),t,n);await Yh(s,r),s.Lo=s.Lo.remove(i),s.Bo.delete(e),al(s)}else await lu(s.localStore,e,!1).then((()=>sl(s,e,n))).catch(Lc)}async function Zh(t,e){const n=Gs(t),s=e.batch.batchId;try{const t=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(t=>{const s=e.batch.keys(),r=n.jn.newChangeBuffer({trackRemovals:!0});return function(t,e,n,s){const r=n.batch,i=r.keys();let o=qa.resolve();return i.forEach((t=>{o=o.next((()=>s.getEntry(e,t))).next((e=>{const i=n.docVersions.get(t);Ks(null!==i),e.version.compareTo(i)<0&&(r.applyToRemoteDocument(e,n),e.isValidDocument()&&s.addEntry(e,n.commitVersion))}))})),o.next((()=>t.In.removeMutationBatch(e,r)))}(n,t,e,r).next((()=>r.apply(t))).next((()=>n.In.performConsistencyCheck(t))).next((()=>n.Qn.Pn(t,s)))}))}(n.localStore,e);nl(n,s,null),el(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await cl(n,t)}catch(t){await Lc(t)}}async function tl(t,e,n){const s=Gs(t);try{const t=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(t=>{let s;return n.In.lookupMutationBatch(t,e).next((e=>(Ks(null!==e),s=e.keys(),n.In.removeMutationBatch(t,e)))).next((()=>n.In.performConsistencyCheck(t))).next((()=>n.Qn.Pn(t,s)))}))}(s.localStore,e);nl(s,e,n),el(s,e),s.sharedClientState.updateMutationState(e,"rejected",n),await cl(s,t)}catch(t){await Lc(t)}}function el(t,e){(t.Ko.get(e)||[]).forEach((t=>{t.resolve()})),t.Ko.delete(e)}function nl(t,e,n){const s=Gs(t);let r=s.qo[s.currentUser.toKey()];if(r){const t=r.get(e);t&&(n?t.reject(n):t.resolve(),r=r.remove(e)),s.qo[s.currentUser.toKey()]=r}}function sl(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const s of t.Fo.get(e))t.Oo.delete(s),n&&t.$o.Go(s,n);t.Fo.delete(e),t.isPrimaryClient&&t.Uo.cs(e).forEach((e=>{t.Uo.containsKey(e)||rl(t,e)}))}function rl(t,e){t.Mo.delete(e.path.canonicalString());const n=t.Lo.get(e);null!==n&&(th(t.remoteStore,n),t.Lo=t.Lo.remove(e),t.Bo.delete(n),al(t))}function il(t,e,n){for(const s of n)s instanceof Bh?(t.Uo.addReference(s.key,e),ol(t,s)):s instanceof jh?(Vs("SyncEngine","Document no longer in limbo: "+s.key),t.Uo.removeReference(s.key,e),t.Uo.containsKey(s.key)||rl(t,s.key)):js()}function ol(t,e){const n=e.key,s=n.path.canonicalString();t.Lo.get(n)||t.Mo.has(s)||(Vs("SyncEngine","New document in limbo: "+n),t.Mo.add(s),al(t))}function al(t){for(;t.Mo.size>0&&t.Lo.size{o.push(s.Wo(a,e,n).then((t=>{if(t){s.isPrimaryClient&&s.sharedClientState.updateQueryState(a.targetId,t.fromCache?"not-current":"current"),r.push(t);const e=nu.kn(a.targetId,t);i.push(e)}})))})),await Promise.all(o),s.$o.Rr(r),await async function(t,e){const n=Gs(t);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(t=>qa.forEach(e,(e=>qa.forEach(e.Nn,(s=>n.persistence.referenceDelegate.addReference(t,e.targetId,s))).next((()=>qa.forEach(e.xn,(s=>n.persistence.referenceDelegate.removeReference(t,e.targetId,s)))))))))}catch(t){if(!Ga(t))throw t;Vs("LocalStore","Failed to update sequence numbers: "+t)}for(const t of e){const e=t.targetId;if(!t.fromCache){const t=n.Un.get(e),s=t.snapshotVersion,r=t.withLastLimboFreeSnapshotVersion(s);n.Un=n.Un.insert(e,r)}}}(s.localStore,i))}async function ul(t,e){const n=Gs(t);if(!n.currentUser.isEqual(e)){Vs("SyncEngine","User change. New user:",e.toKey());const t=await ou(n.localStore,e);n.currentUser=e,function(t,e){t.Ko.forEach((t=>{t.forEach((t=>{t.reject(new zs(Hs.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.Ko.clear()}(n),n.sharedClientState.handleUserChange(e,t.removedBatchIds,t.addedBatchIds),await cl(n,t.Wn)}}function hl(t,e){const n=Gs(t),s=n.Bo.get(e);if(s&&s.ko)return No().add(s.key);{let t=No();const s=n.Fo.get(e);if(!s)return t;for(const e of s){const s=n.Oo.get(e);t=t.unionWith(s.view.Ro)}return t}}async function ll(t,e){const n=Gs(t),s=await du(n.localStore,e.query,!0),r=e.view.No(s);return n.isPrimaryClient&&il(n,e.targetId,r.Do),r}async function dl(t){const e=Gs(t);return gu(e.localStore).then((t=>cl(e,t)))}async function fl(t,e,n,s){const r=Gs(t),i=await function(t,e){const n=Gs(t),s=Gs(n.In);return n.persistence.runTransaction("Lookup mutation documents","readonly",(t=>s.Xt(t,e).next((e=>e?n.Qn.Pn(t,e):qa.resolve(null)))))}(r.localStore,e);null!==i?("pending"===n?await dh(r.remoteStore):"acknowledged"===n||"rejected"===n?(nl(r,e,s||null),el(r,e),function(t,e){Gs(Gs(t).In).te(e)}(r.localStore,e)):js(),await cl(r,i)):Vs("SyncEngine","Cannot apply mutation batch with id: "+e)}async function gl(t,e,n){const s=Gs(t),r=[],i=[];for(const t of e){let e;const n=s.Fo.get(t);if(n&&0!==n.length){e=await hu(s.localStore,Ei(n[0]));for(const t of n){const e=s.Oo.get(t),n=await ll(s,e);n.snapshot&&i.push(n.snapshot)}}else{const n=await fu(s.localStore,t);e=await hu(s.localStore,n),await Qh(s,ml(n),t,!1)}r.push(e)}return s.$o.Rr(i),r}function ml(t){return gi(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function pl(t){const e=Gs(t);return Gs(Gs(e.localStore).persistence).pn()}async function yl(t,e,n,s){const r=Gs(t);if(r.Qo)Vs("SyncEngine","Ignoring unexpected query state notification.");else if(r.Fo.has(e))switch(n){case"current":case"not-current":{const t=await gu(r.localStore),s=xo.createSynthesizedRemoteEventForCurrentChange(e,"current"===n);await cl(r,t,s);break}case"rejected":await lu(r.localStore,e,!0),sl(r,e,s);break;default:js()}}async function wl(t,e,n){const s=vl(t);if(s.Qo){for(const t of e){if(s.Fo.has(t)){Vs("SyncEngine","Adding an already active target "+t);continue}const e=await fu(s.localStore,t),n=await hu(s.localStore,e);await Qh(s,ml(e),n.targetId,!1),Zu(s.remoteStore,n)}for(const t of n)s.Fo.has(t)&&await lu(s.localStore,t,!1).then((()=>{th(s.remoteStore,t),sl(s,t)})).catch(Lc)}}function vl(t){const e=Gs(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=Yh.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=hl.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Jh.bind(null,e),e.$o.Rr=Lh.bind(null,e.eventManager),e.$o.Go=Oh.bind(null,e.eventManager),e}function bl(t){const e=Gs(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Zh.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=tl.bind(null,e),e}class Tl{constructor(){this.synchronizeTabs=!1}async initialize(t){this.N=Ku(t.databaseInfo.databaseId),this.sharedClientState=this.Ho(t),this.persistence=this.Jo(t),await this.persistence.start(),this.gcScheduler=this.Yo(t),this.localStore=this.Xo(t)}Yo(t){return null}Xo(t){return iu(this.persistence,new su,t.initialUser,this.N)}Jo(t){return new Iu(_u.Ns,this.N)}Ho(t){return new Mu}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class El extends Tl{constructor(t,e,n){super(),this.Zo=t,this.cacheSizeBytes=e,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(t){await super.initialize(t),await async function(t){const e=Gs(t);return e.persistence.runTransaction("Synchronize last document change read time","readonly",(t=>function(t){const e=Gc(t);let n=cr.min();return e.Kt({index:Da.readTimeIndex,reverse:!0},((t,e,s)=>{e.readTime&&(n=ic(e.readTime)),s.done()})).next((()=>n))}(t))).then((t=>{e.Kn=t}))}(this.localStore),await this.Zo.initialize(this,t),await bl(this.Zo.syncEngine),await dh(this.Zo.remoteStore),await this.persistence.nn((()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(this.localStore),Promise.resolve())))}Xo(t){return iu(this.persistence,new su,t.initialUser,this.N)}Yo(t){const e=this.persistence.referenceDelegate.garbageCollector;return new Fc(e,t.asyncQueue)}Jo(t){const e=Zc(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?bc.withCacheSize(this.cacheSizeBytes):bc.DEFAULT;return new Yc(this.synchronizeTabs,e,t.clientId,n,t.asyncQueue,Bu(),ju(),this.N,this.sharedClientState,!!this.forceOwnership)}Ho(t){return new Mu}}class Il extends El{constructor(t,e){super(t,e,!1),this.Zo=t,this.cacheSizeBytes=e,this.synchronizeTabs=!0}async initialize(t){await super.initialize(t);const e=this.Zo.syncEngine;this.sharedClientState instanceof Ou&&(this.sharedClientState.syncEngine={_i:fl.bind(null,e),mi:yl.bind(null,e),gi:wl.bind(null,e),pn:pl.bind(null,e),wi:dl.bind(null,e)},await this.sharedClientState.start()),await this.persistence.nn((async t=>{await async function(t,e){const n=Gs(t);if(vl(n),bl(n),!0===e&&!0!==n.Qo){const t=n.sharedClientState.getAllActiveQueryTargets(),e=await gl(n,t.toArray());n.Qo=!0,await Th(n.remoteStore,!0);for(const t of e)Zu(n.remoteStore,t)}else if(!1===e&&!1!==n.Qo){const t=[];let e=Promise.resolve();n.Fo.forEach(((s,r)=>{n.sharedClientState.isLocalQueryTarget(r)?t.push(r):e=e.then((()=>(sl(n,r),lu(n.localStore,r,!0)))),th(n.remoteStore,r)})),await e,await gl(n,t),function(t){const e=Gs(t);e.Bo.forEach(((t,n)=>{th(e.remoteStore,n)})),e.Uo.us(),e.Bo=new Map,e.Lo=new go(xr.comparator)}(n),n.Qo=!1,await Th(n.remoteStore,!1)}}(this.Zo.syncEngine,t),this.gcScheduler&&(t&&!this.gcScheduler.started?this.gcScheduler.start(this.localStore):t||this.gcScheduler.stop())}))}Ho(t){const e=Bu();if(!Ou.bt(e))throw new zs(Hs.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=Zc(t.databaseInfo.databaseId,t.databaseInfo.persistenceKey);return new Ou(e,t.asyncQueue,n,t.clientId,t.initialUser)}}class Sl{async initialize(t,e){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=t=>Xh(this.syncEngine,t,1),this.remoteStore.remoteSyncer.handleCredentialChange=ul.bind(null,this.syncEngine),await Th(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return new Ch}createDatastore(t){const e=Ku(t.databaseInfo.databaseId),n=(s=t.databaseInfo,new qu(s));var s;return function(t,e,n){return new Qu(t,e,n)}(t.credentials,n,e)}createRemoteStore(t){var e,n,s,r,i;return e=this.localStore,n=this.datastore,s=t.asyncQueue,r=t=>Xh(this.syncEngine,t,0),i=Pu.bt()?new Pu:new Fu,new Yu(e,n,s,r,i)}createSyncEngine(t,e){return function(t,e,n,s,r,i,o){const a=new Hh(t,e,n,s,r,i);return o&&(a.Qo=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)}terminate(){return async function(t){const e=Gs(t);Vs("RemoteStore","RemoteStore shutting down."),e.Wr.add(5),await Ju(e),e.zr.shutdown(),e.Hr.set("Unknown")}(this.remoteStore)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function _l(t,e=10240){let n=0;return{async read(){if(n{this.muted||t(e)}),0)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Al{constructor(t,e){this.nc=t,this.N=e,this.metadata=new Qs,this.buffer=new Uint8Array,this.sc=new TextDecoder("utf-8"),this.ic().then((t=>{t&&t.wo()?this.metadata.resolve(t.payload.metadata):this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\n ${JSON.stringify(null==t?void 0:t.payload)}`))}),(t=>this.metadata.reject(t)))}close(){return this.nc.cancel()}async getMetadata(){return this.metadata.promise}async zo(){return await this.getMetadata(),this.ic()}async ic(){const t=await this.rc();if(null===t)return null;const e=this.sc.decode(t),n=Number(e);isNaN(n)&&this.oc(`length string (${e}) is not valid number`);const s=await this.cc(n);return new Ph(JSON.parse(s),t.length+n)}ac(){return this.buffer.findIndex((t=>t==="{".charCodeAt(0)))}async rc(){for(;this.ac()<0&&!await this.uc(););if(0===this.buffer.length)return null;const t=this.ac();t<0&&this.oc("Reached the end of bundle when a length string is expected.");const e=this.buffer.slice(0,t);return this.buffer=this.buffer.slice(t),e}async cc(t){for(;this.buffer.length0)throw new zs(Hs.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");const e=await async function(t,e){const n=Gs(t),s=Xo(n.N)+"/documents",r={documents:e.map((t=>zo(n.N,t)))},i=await n.Ki("BatchGetDocuments",s,r),o=new Map;i.forEach((t=>{const e=function(t,e){return"found"in e?function(t,e){Ks(!!e.found),e.found.name,e.found.updateTime;const n=Qo(t,e.found.name),s=$o(e.found.updateTime),r=new $r({mapValue:{fields:e.found.fields}});return Hr.newFoundDocument(n,s,r)}(t,e):"missing"in e?function(t,e){Ks(!!e.missing),Ks(!!e.readTime);const n=Qo(t,e.missing),s=$o(e.readTime);return Hr.newNoDocument(n,s)}(t,e):js()}(n.N,t);o.set(e.key.toString(),e)}));const a=[];return e.forEach((t=>{const e=o.get(t.toString());Ks(!!e),a.push(e)})),a}(this.datastore,t);return e.forEach((t=>this.recordVersion(t))),e}set(t,e){this.write(e.toMutation(t,this.precondition(t))),this.writtenDocs.add(t.toString())}update(t,e){try{this.write(e.toMutation(t,this.preconditionForUpdate(t)))}catch(t){this.lastWriteError=t}this.writtenDocs.add(t.toString())}delete(t){this.write(new oo(t,this.precondition(t))),this.writtenDocs.add(t.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;const t=this.readVersions;this.mutations.forEach((e=>{t.delete(e.key.toString())})),t.forEach(((t,e)=>{const n=xr.fromPath(e);this.mutations.push(new ao(n,this.precondition(n)))})),await async function(t,e){const n=Gs(t),s=Xo(n.N)+"/documents",r={writes:e.map((t=>ea(n.N,t)))};await n.Li("Commit",s,r)}(this.datastore,this.mutations),this.committed=!0}recordVersion(t){let e;if(t.isFoundDocument())e=t.version;else{if(!t.isNoDocument())throw js();e=cr.min()}const n=this.readVersions.get(t.key.toString());if(n){if(!e.isEqual(n))throw new zs(Hs.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(t.key.toString(),e)}precondition(t){const e=this.readVersions.get(t.toString());return!this.writtenDocs.has(t.toString())&&e?zi.updateTime(e):zi.none()}preconditionForUpdate(t){const e=this.readVersions.get(t.toString());if(!this.writtenDocs.has(t.toString())&&e){if(e.isEqual(cr.min()))throw new zs(Hs.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return zi.updateTime(e)}return zi.exists(!0)}write(t){this.ensureCommitNotCalled(),this.mutations.push(t)}ensureCommitNotCalled(){}} +/** + * @license + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class xl{constructor(t,e,n,s){this.asyncQueue=t,this.datastore=e,this.updateFunction=n,this.deferred=s,this.hc=5,this.ar=new $u(this.asyncQueue,"transaction_retry")}run(){this.hc-=1,this.lc()}lc(){this.ar.Xi((async()=>{const t=new Dl(this.datastore),e=this.fc(t);e&&e.then((e=>{this.asyncQueue.enqueueAndForget((()=>t.commit().then((()=>{this.deferred.resolve(e)})).catch((t=>{this.dc(t)}))))})).catch((t=>{this.dc(t)}))}))}fc(t){try{const e=this.updateFunction(t);return!Nr(e)&&e.catch&&e.then?e:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}}dc(t){this.hc>0&&this.wc(t)?(this.hc-=1,this.asyncQueue.enqueueAndForget((()=>(this.lc(),Promise.resolve())))):this.deferred.reject(t)}wc(t){if("FirebaseError"===t.name){const e=t.code;return"aborted"===e||"failed-precondition"===e||!lo(e)}return!1}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cl{constructor(t,e,n){this.credentials=t,this.asyncQueue=e,this.databaseInfo=n,this.user=Ls.UNAUTHENTICATED,this.clientId=sr.I(),this.credentialListener=()=>Promise.resolve(),this.credentials.start(e,(async t=>{Vs("FirestoreClient","Received user=",t.uid),await this.credentialListener(t),this.user=t}))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,credentials:this.credentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.credentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new zs(Hs.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new Qs;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this.onlineComponents&&await this.onlineComponents.terminate(),this.offlineComponents&&await this.offlineComponents.terminate(),this.credentials.shutdown(),t.resolve()}catch(e){const n=_h(e,"Failed to shutdown persistence");t.reject(n)}})),t.promise}}async function kl(t,e){t.asyncQueue.verifyOperationInProgress(),Vs("FirestoreClient","Initializing OfflineComponentProvider");const n=await t.getConfiguration();await e.initialize(n);let s=n.initialUser;t.setCredentialChangeListener((async t=>{s.isEqual(t)||(await ou(e.localStore,t),s=t)})),e.persistence.setDatabaseDeletedListener((()=>t.terminate())),t.offlineComponents=e}async function Rl(t,e){t.asyncQueue.verifyOperationInProgress();const n=await Ll(t);Vs("FirestoreClient","Initializing OnlineComponentProvider");const s=await t.getConfiguration();await e.initialize(n,s),t.setCredentialChangeListener((t=>async function(t,e){const n=Gs(t);n.asyncQueue.verifyOperationInProgress(),Vs("RemoteStore","RemoteStore received new credentials");const s=ih(n);n.Wr.add(3),await Ju(n),s&&n.Hr.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Wr.delete(3),await Xu(n)}(e.remoteStore,t))),t.onlineComponents=e}async function Ll(t){return t.offlineComponents||(Vs("FirestoreClient","Using default OfflineComponentProvider"),await kl(t,new Tl)),t.offlineComponents}async function Ol(t){return t.onlineComponents||(Vs("FirestoreClient","Using default OnlineComponentProvider"),await Rl(t,new Sl)),t.onlineComponents}function Ml(t){return Ll(t).then((t=>t.persistence))}function Fl(t){return Ll(t).then((t=>t.localStore))}function Pl(t){return Ol(t).then((t=>t.remoteStore))}function Vl(t){return Ol(t).then((t=>t.syncEngine))}async function Ul(t){const e=await Ol(t),n=e.eventManager;return n.onListen=zh.bind(null,e.syncEngine),n.onUnlisten=Wh.bind(null,e.syncEngine),n}function ql(t,e,n={}){const s=new Qs;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,r){const i=new Nl({next:i=>{e.enqueueAndForget((()=>Rh(t,o)));const a=i.docs.has(n);!a&&i.fromCache?r.reject(new zs(Hs.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&i.fromCache&&s&&"server"===s.source?r.reject(new zs(Hs.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):r.resolve(i)},error:t=>r.reject(t)}),o=new Fh(mi(n.path),i,{includeMetadataChanges:!0,fo:!0});return kh(t,o)}(await Ul(t),t.asyncQueue,e,n,s))),s.promise}function Bl(t,e,n={}){const s=new Qs;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,r){const i=new Nl({next:n=>{e.enqueueAndForget((()=>Rh(t,o))),n.fromCache&&"server"===s.source?r.reject(new zs(Hs.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):r.resolve(n)},error:t=>r.reject(t)}),o=new Fh(n,i,{includeMetadataChanges:!0,fo:!0});return kh(t,o)}(await Ul(t),t.asyncQueue,e,n,s))),s.promise}function jl(t,e,n,s){const r=function(t,e){let n;return n="string"==typeof t?(new TextEncoder).encode(t):t,function(t,e){return new Al(t,e)}(function(t,e){if(t instanceof Uint8Array)return _l(t,e);if(t instanceof ArrayBuffer)return _l(new Uint8Array(t),e);if(t instanceof ReadableStream)return t.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}(n),e)}(n,Ku(e));t.asyncQueue.enqueueAndForget((async()=>{!function(t,e,n){const s=Gs(t);(async function(t,e,n){try{const s=await e.getMetadata();if(await function(t,e){const n=Gs(t),s=$o(e.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",(t=>n.Je.getBundleMetadata(t,e.id))).then((t=>!!t&&t.createTime.compareTo(s)>=0))}(t.localStore,s))return await e.close(),void n._completeWith(function(t){return{taskState:"Success",documentsLoaded:t.totalDocuments,bytesLoaded:t.totalBytes,totalDocuments:t.totalDocuments,totalBytes:t.totalBytes}}(s));n._updateProgress(qh(s));const r=new Uh(s,t.localStore,e.N);let i=await e.zo();for(;i;){const t=await r.mo(i);t&&n._updateProgress(t),i=await e.zo()}const o=await r.complete();await cl(t,o.En,void 0),await function(t,e){const n=Gs(t);return n.persistence.runTransaction("Save bundle","readwrite",(t=>n.Je.saveBundleMetadata(t,e)))}(t.localStore,s),n._completeWith(o.progress)}catch(t){qs("SyncEngine",`Loading bundle failed with ${t}`),n._failWith(t)}})(s,e,n).then((()=>{s.sharedClientState.notifyBundleLoaded()}))}(await Vl(t),r,s)}))}class Kl{constructor(t,e,n,s,r,i,o,a){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=s,this.ssl=r,this.forceLongPolling=i,this.autoDetectLongPolling=o,this.useFetchStreams=a}}class $l{constructor(t,e){this.projectId=t,this.database=e||"(default)"}get isDefaultDatabase(){return"(default)"===this.database}isEqual(t){return t instanceof $l&&t.projectId===this.projectId&&t.database===this.database}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Gl=new Map; +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Hl(t,e,n){if(!n)throw new zs(Hs.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function zl(t,e,n,s){if(!0===e&&!0===s)throw new zs(Hs.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function Ql(t){if(!xr.isDocumentKey(t))throw new zs(Hs.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function Wl(t){if(xr.isDocumentKey(t))throw new zs(Hs.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Yl(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";{const e=function(t){return t.constructor?t.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return"function"==typeof t?"a function":js()}function Xl(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new zs(Hs.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Yl(t);throw new zs(Hs.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function Jl(t,e){if(e<=0)throw new zs(Hs.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Zl{constructor(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new zs(Hs.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new zs(Hs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,zl("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class td{constructor(t,e){this._credentials=e,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Zl({}),this._settingsFrozen=!1,t instanceof $l?this._databaseId=t:(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new zs(Hs.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new $l(t.options.projectId)}(t))}get app(){if(!this._app)throw new zs(Hs.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(t){if(this._settingsFrozen)throw new zs(Hs.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Zl(t),void 0!==t.credentials&&(this._credentials=function(t){if(!t)return new Ys;switch(t.type){case"gapi":const e=t.client;return Ks(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new tr(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new zs(Hs.INVALID_ARGUMENT,"makeCredentialsProvider failed due to invalid credential type")}}(t.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const e=Gl.get(t);e&&(Vs("ComponentProvider","Removing Datastore"),Gl.delete(t),e.terminate())}(this),Promise.resolve()}}function ed(t,e,n,s={}){var r;const i=(t=Xl(t,td))._getSettings();if("firestore.googleapis.com"!==i.host&&i.host!==e&&qs("Host has been set in both settings() and useEmulator(), emulator host will be used"),t._setSettings(Object.assign(Object.assign({},i),{host:`${e}:${n}`,ssl:!1})),s.mockUserToken){let e,n;if("string"==typeof s.mockUserToken)e=s.mockUserToken,n=Ls.MOCK_USER;else{e= +/** + * @license + * Copyright 2021 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +function(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",s=t.iat||0,r=t.sub||t.user_id;if(!r)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const i=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:r,user_id:r,firebase:{sign_in_provider:"custom",identities:{}}},t);return[u(JSON.stringify({alg:"none",type:"JWT"})),u(JSON.stringify(i)),""].join(".")}(s.mockUserToken,null===(r=t._app)||void 0===r?void 0:r.options.projectId);const i=s.mockUserToken.sub||s.mockUserToken.user_id;if(!i)throw new zs(Hs.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Ls(i)}t._credentials=new Xs(new Ws(e,n))}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class nd{constructor(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new rd(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new nd(this.firestore,t,this._key)}}class sd{constructor(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new sd(this.firestore,t,this._query)}}class rd extends sd{constructor(t,e,n){super(t,e,mi(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new nd(this.firestore,null,new xr(t))}withConverter(t){return new rd(this.firestore,t,this._path)}}function id(t,e,...n){if(t=g(t),Hl("collection","path",e),t instanceof td){const s=fr.fromString(e,...n);return Wl(s),new rd(t,null,s)}{if(!(t instanceof nd||t instanceof rd))throw new zs(Hs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(fr.fromString(e,...n));return Wl(s),new rd(t.firestore,null,s)}}function od(t,e){if(t=Xl(t,td),Hl("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new zs(Hs.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new sd(t,null,function(t){return new fi(fr.emptyPath(),t)}(e))}function ad(t,e,...n){if(t=g(t),1===arguments.length&&(e=sr.I()),Hl("doc","path",e),t instanceof td){const s=fr.fromString(e,...n);return Ql(s),new nd(t,null,new xr(s))}{if(!(t instanceof nd||t instanceof rd))throw new zs(Hs.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(fr.fromString(e,...n));return Ql(s),new nd(t.firestore,t instanceof rd?t.converter:null,new xr(s))}}function cd(t,e){return t=g(t),e=g(e),(t instanceof nd||t instanceof rd)&&(e instanceof nd||e instanceof rd)&&t.firestore===e.firestore&&t.path===e.path&&t.converter===e.converter}function ud(t,e){return t=g(t),e=g(e),t instanceof sd&&e instanceof sd&&t.firestore===e.firestore&&Si(t._query,e._query)&&t.converter===e.converter +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */}class hd{constructor(){this._c=Promise.resolve(),this.mc=[],this.gc=!1,this.yc=[],this.Tc=null,this.Ec=!1,this.Ic=!1,this.Ac=[],this.ar=new $u(this,"async_queue_retry"),this.Rc=()=>{const t=ju();t&&Vs("AsyncQueue","Visibility state changed to "+t.visibilityState),this.ar.tr()};const t=ju();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.Rc)}get isShuttingDown(){return this.gc}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.bc(),this.Pc(t)}enterRestrictedMode(t){if(!this.gc){this.gc=!0,this.Ic=t||!1;const e=ju();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.Rc)}}enqueue(t){if(this.bc(),this.gc)return new Promise((()=>{}));const e=new Qs;return this.Pc((()=>this.gc&&this.Ic?Promise.resolve():(t().then(e.resolve,e.reject),e.promise))).then((()=>e.promise))}enqueueRetryable(t){this.enqueueAndForget((()=>(this.mc.push(t),this.vc())))}async vc(){if(0!==this.mc.length){try{await this.mc[0](),this.mc.shift(),this.ar.reset()}catch(t){if(!Ga(t))throw t;Vs("AsyncQueue","Operation failed with retryable error: "+t)}this.mc.length>0&&this.ar.Xi((()=>this.vc()))}}Pc(t){const e=this._c.then((()=>(this.Ec=!0,t().catch((t=>{this.Tc=t,this.Ec=!1;const e=function(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t);throw Us("INTERNAL UNHANDLED ERROR: ",e),t})).then((t=>(this.Ec=!1,t))))));return this._c=e,e}enqueueAfterDelay(t,e,n){this.bc(),this.Ac.indexOf(t)>-1&&(e=0);const s=Sh.createAndSchedule(this,t,e,n,(t=>this.Vc(t)));return this.yc.push(s),s}bc(){this.Tc&&js()}verifyOperationInProgress(){}async Sc(){let t;do{t=this._c,await t}while(t!==this._c)}Dc(t){for(const e of this.yc)if(e.timerId===t)return!0;return!1}Cc(t){return this.Sc().then((()=>{this.yc.sort(((t,e)=>t.targetTimeMs-e.targetTimeMs));for(const e of this.yc)if(e.skipDelay(),"all"!==t&&e.timerId===t)break;return this.Sc()}))}Nc(t){this.Ac.push(t)}Vc(t){const e=this.yc.indexOf(t);this.yc.splice(e,1)}}function ld(t){return function(t,e){if("object"!=typeof t||null===t)return!1;const n=t;for(const t of["next","error","complete"])if(t in n&&"function"==typeof n[t])return!0;return!1}(t)}class dd{constructor(){this._progressObserver={},this._taskCompletionResolver=new Qs,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(t,e,n){this._progressObserver={next:t,error:e,complete:n}}catch(t){return this._taskCompletionResolver.promise.catch(t)}then(t,e){return this._taskCompletionResolver.promise.then(t,e)}_completeWith(t){this._updateProgress(t),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(t)}_failWith(t){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(t),this._taskCompletionResolver.reject(t)}_updateProgress(t){this._lastProgress=t,this._progressObserver.next&&this._progressObserver.next(t)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const fd=-1;class gd extends td{constructor(t,e){super(t,e),this.type="firestore",this._queue=new hd,this._persistenceKey="name"in t?t.name:"[DEFAULT]"}_terminate(){return this._firestoreClient||wd(this),this._firestoreClient.terminate()}}function md(t,e){const n=i._getProvider(t,"firestore");if(n.isInitialized()){const t=n.getImmediate();if(d(n.getOptions(),e))return t;throw new zs(Hs.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(void 0!==e.cacheSizeBytes&&-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new zs(Hs.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return n.initialize({options:e})}function pd(t=i.getApp()){return i._getProvider(t,"firestore").getImmediate()}function yd(t){return t._firestoreClient||wd(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function wd(t){var e;const n=t._freezeSettings(),s=function(t,e,n,s){return new Kl(t,e,n,s.host,s.ssl,s.experimentalForceLongPolling,s.experimentalAutoDetectLongPolling,s.useFetchStreams)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new Cl(t._credentials,t._queue,s)}function vd(t,e){xd(t=Xl(t,gd));const n=yd(t),s=t._freezeSettings(),r=new Sl;return Td(n,r,new El(r,s.cacheSizeBytes,null==e?void 0:e.forceOwnership))}function bd(t){xd(t=Xl(t,gd));const e=yd(t),n=t._freezeSettings(),s=new Sl;return Td(e,s,new Il(s,n.cacheSizeBytes))}function Td(t,e,n){const s=new Qs;return t.asyncQueue.enqueue((async()=>{try{await kl(t,n),await Rl(t,e),s.resolve()}catch(t){if(!function(t){return"FirebaseError"===t.name?t.code===Hs.FAILED_PRECONDITION||t.code===Hs.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&t instanceof DOMException)||(22===t.code||20===t.code||11===t.code)}(t))throw t;console.warn("Error enabling offline persistence. Falling back to persistence disabled: "+t),s.reject(t)}})).then((()=>s.promise))}function Ed(t){if(t._initialized&&!t._terminated)throw new zs(Hs.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const e=new Qs;return t._queue.enqueueAndForgetEvenWhileRestricted((async()=>{try{await async function(t){if(!ja.bt())return Promise.resolve();const e=t+"main";await ja.delete(e)}(Zc(t._databaseId,t._persistenceKey)),e.resolve()}catch(t){e.reject(t)}})),e.promise}function Id(t){return function(t){const e=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e){const n=Gs(t);ih(n.remoteStore)||Vs("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const t=await function(t){const e=Gs(t);return e.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(t=>e.In.getHighestUnacknowledgedBatchId(t)))}(n.localStore);if(-1===t)return void e.resolve();const s=n.Ko.get(t)||[];s.push(e),n.Ko.set(t,s)}catch(t){const n=_h(t,"Initialization of waitForPendingWrites() operation failed");e.reject(n)}}(await Vl(t),e))),e.promise}(yd(t=Xl(t,gd)))}function Sd(t){return function(t){return t.asyncQueue.enqueue((async()=>{const e=await Ml(t),n=await Pl(t);return e.setNetworkEnabled(!0),function(t){const e=Gs(t);return e.Wr.delete(0),Xu(e)}(n)}))}(yd(t=Xl(t,gd)))}function _d(t){return function(t){return t.asyncQueue.enqueue((async()=>{const e=await Ml(t),n=await Pl(t);return e.setNetworkEnabled(!1),async function(t){const e=Gs(t);e.Wr.add(0),await Ju(e),e.Hr.set("Offline")}(n)}))}(yd(t=Xl(t,gd)))}function Nd(t){return i._removeServiceInstance(t.app,"firestore"),t._delete()}function Ad(t,e){const n=yd(t=Xl(t,gd)),s=new dd;return jl(n,t._databaseId,e,s),s}function Dd(t,e){return function(t,e){return t.asyncQueue.enqueue((async()=>function(t,e){const n=Gs(t);return n.persistence.runTransaction("Get named query","readonly",(t=>n.Je.getNamedQuery(t,e)))}(await Fl(t),e)))}(yd(t=Xl(t,gd)),e).then((e=>e?new sd(t,null,e.query):null))}function xd(t){if(t._initialized||t._terminated)throw new zs(Hs.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.")} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Cd{constructor(...t){for(let e=0;e90)throw new zs(Hs.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new zs(Hs.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(t){return rr(this._lat,t._lat)||rr(this._long,t._long)}} +/** + * @license + * Copyright 2017 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */const Md=/^__.*__$/;class Fd{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return null!==this.fieldMask?new no(t,this.data,this.fieldMask,e,this.fieldTransforms):new eo(t,this.data,e,this.fieldTransforms)}}class Pd{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return new no(t,this.data,this.fieldMask,e,this.fieldTransforms)}}function Vd(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw js()}}class Ud{constructor(t,e,n,s,r,i){this.settings=t,this.databaseId=e,this.N=n,this.ignoreUndefinedProperties=s,void 0===r&&this.xc(),this.fieldTransforms=r||[],this.fieldMask=i||[]}get path(){return this.settings.path}get kc(){return this.settings.kc}$c(t){return new Ud(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.N,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Oc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.$c({path:n,Fc:!1});return s.Mc(t),s}Lc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.$c({path:n,Fc:!1});return s.xc(),s}Bc(t){return this.$c({path:void 0,Fc:!0})}Uc(t){return of(t,this.settings.methodName,this.settings.qc||!1,this.path,this.settings.Kc)}contains(t){return void 0!==this.fieldMask.find((e=>t.isPrefixOf(e)))||void 0!==this.fieldTransforms.find((e=>t.isPrefixOf(e.field)))}xc(){if(this.path)for(let t=0;tc.covers(t.field)))}else c=null,u=o.fieldTransforms;return new Fd(new $r(a),c,u)}class Kd extends Ld{_toFieldTransform(t){if(2!==t.kc)throw 1===t.kc?t.Uc(`${this._methodName}() can only appear at the top level of your update data`):t.Uc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return t.fieldMask.push(t.path),null}isEqual(t){return t instanceof Kd}}function $d(t,e,n){return new Ud({kc:3,Kc:e.settings.Kc,methodName:t._methodName,Fc:n},e.databaseId,e.N,e.ignoreUndefinedProperties)}class Gd extends Ld{_toFieldTransform(t){return new Gi(t.path,new Pi)}isEqual(t){return t instanceof Gd}}class Hd extends Ld{constructor(t,e){super(t),this.Qc=e}_toFieldTransform(t){const e=$d(this,t,!0),n=this.Qc.map((t=>Jd(t,e))),s=new Vi(n);return new Gi(t.path,s)}isEqual(t){return this===t}}class zd extends Ld{constructor(t,e){super(t),this.Qc=e}_toFieldTransform(t){const e=$d(this,t,!0),n=this.Qc.map((t=>Jd(t,e))),s=new qi(n);return new Gi(t.path,s)}isEqual(t){return this===t}}class Qd extends Ld{constructor(t,e){super(t),this.Wc=e}_toFieldTransform(t){const e=new ji(t.N,Ri(t.N,this.Wc));return new Gi(t.path,e)}isEqual(t){return this===t}}function Wd(t,e,n,s){const r=t.jc(1,e,n);ef("Data must be an object, but it was:",r,s);const i=[],o=$r.empty();hr(s,((t,s)=>{const a=rf(e,t,n);s=g(s);const c=r.Lc(a);if(s instanceof Kd)i.push(a);else{const t=Jd(s,c);null!=t&&(i.push(a),o.set(a,t))}}));const a=new pr(i);return new Pd(o,a,r.fieldTransforms)}function Yd(t,e,n,s,r,i){const o=t.jc(1,e,n),a=[nf(e,s,n)],c=[r];if(i.length%2!=0)throw new zs(Hs.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let t=0;t=0;--t)if(!af(u,a[t])){const e=a[t];let n=c[t];n=g(n);const s=o.Lc(e);if(n instanceof Kd)u.push(e);else{const t=Jd(n,s);null!=t&&(u.push(e),h.set(e,t))}}const l=new pr(u);return new Pd(h,l,o.fieldTransforms)}function Xd(t,e,n,s=!1){return Jd(n,t.jc(s?4:3,e))}function Jd(t,e){if(tf(t=g(t)))return ef("Unsupported field value:",e,t),Zd(t,e);if(t instanceof Ld)return function(t,e){if(!Vd(e.kc))throw e.Uc(`${t._methodName}() can only be used with update() and set()`);if(!e.path)throw e.Uc(`${t._methodName}() is not currently supported inside arrays`);const n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&4!==e.kc)throw e.Uc("Nested arrays are not supported");return function(t,e){const n=[];let s=0;for(const r of t){let t=Jd(r,e.Bc(s));null==t&&(t={nullValue:"NULL_VALUE"}),n.push(t),s++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=g(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return Ri(e.N,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){const n=ar.fromDate(t);return{timestampValue:Bo(e.N,n)}}if(t instanceof ar){const n=new ar(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:Bo(e.N,n)}}if(t instanceof Od)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof Rd)return{bytesValue:jo(e.N,t._byteString)};if(t instanceof nd){const n=e.databaseId,s=t.firestore._databaseId;if(!s.isEqual(n))throw e.Uc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:Go(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.Uc(`Unsupported field value: ${Yl(t)}`)}(t,e)}function Zd(t,e){const n={};return lr(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):hr(t,((t,s)=>{const r=Jd(s,e.Oc(t));null!=r&&(n[t]=r)})),{mapValue:{fields:n}}}function tf(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof ar||t instanceof Od||t instanceof Rd||t instanceof nd||t instanceof Ld)}function ef(t,e,n){if(!tf(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){const s=Yl(n);throw"an object"===s?e.Uc(t+" a custom object"):e.Uc(t+" "+s)}}function nf(t,e,n){if((e=g(e))instanceof Cd)return e._internalPath;if("string"==typeof e)return rf(t,e);throw of("Field path arguments must be of type string or FieldPath.",t,!1,void 0,n)}const sf=new RegExp("[~\\*/\\[\\]]");function rf(t,e,n){if(e.search(sf)>=0)throw of(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new Cd(...e.split("."))._internalPath}catch(s){throw of(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function of(t,e,n,s,r){const i=s&&!s.isEmpty(),o=void 0!==r;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(i||o)&&(c+=" (found",i&&(c+=` in field ${s}`),o&&(c+=` in document ${r}`),c+=")"),new zs(Hs.INVALID_ARGUMENT,a+t+c)}function af(t,e){return t.some((t=>t.isEqual(e)))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class cf{constructor(t,e,n,s,r){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=s,this._converter=r}get id(){return this._key.path.lastSegment()}get ref(){return new nd(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const t=new uf(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const e=this._document.data.field(hf("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}}}class uf extends cf{data(){return super.data()}}function hf(t,e){return"string"==typeof e?rf(t,e):e instanceof Cd?e._internalPath:e._delegate._internalPath} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class lf{constructor(t,e){this.hasPendingWrites=t,this.fromCache=e}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class df extends cf{constructor(t,e,n,s,r,i){super(t,e,n,s,i),this._firestore=t,this._firestoreImpl=t,this.metadata=r}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const e=new ff(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,e={}){if(this._document){const n=this._document.data.field(hf("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}}}class ff extends df{data(t={}){return super.data(t)}}class gf{constructor(t,e,n,s){this._firestore=t,this._userDataWriter=e,this._snapshot=s,this.metadata=new lf(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const t=[];return this.forEach((e=>t.push(e))),t}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(t,e){this._snapshot.docs.forEach((n=>{t.call(e,new ff(this._firestore,this._userDataWriter,n.key,n,new lf(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(t={}){const e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new zs(Hs.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){let e=0;return t._snapshot.docChanges.map((n=>({type:"added",doc:new ff(t._firestore,t._userDataWriter,n.doc.key,n.doc,new lf(t._snapshot.mutatedKeys.has(n.doc.key),t._snapshot.fromCache),t.query.converter),oldIndex:-1,newIndex:e++})))}{let n=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((t=>e||3!==t.type)).map((e=>{const s=new ff(t._firestore,t._userDataWriter,e.doc.key,e.doc,new lf(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);let r=-1,i=-1;return 0!==e.type&&(r=n.indexOf(e.doc.key),n=n.delete(e.doc.key)),1!==e.type&&(n=n.add(e.doc),i=n.indexOf(e.doc.key)),{type:mf(e.type),doc:s,oldIndex:r,newIndex:i}}))}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}}function mf(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return js()}}function pf(t,e){return t instanceof df&&e instanceof df?t._firestore===e._firestore&&t._key.isEqual(e._key)&&(null===t._document?null===e._document:t._document.isEqual(e._document))&&t._converter===e._converter:t instanceof gf&&e instanceof gf&&t._firestore===e._firestore&&ud(t.query,e.query)&&t.metadata.isEqual(e.metadata)&&t._snapshot.isEqual(e._snapshot)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function yf(t){if(yi(t)&&0===t.explicitOrderBy.length)throw new zs(Hs.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class wf{}function vf(t,...e){for(const n of e)t=n._apply(t);return t}class bf extends wf{constructor(t,e,n){super(),this.Gc=t,this.zc=e,this.Hc=n,this.type="where"}_apply(t){const e=Bd(t.firestore),n=function(t,e,n,s,r,i,o){let a;if(r.isKeyField()){if("array-contains"===i||"array-contains-any"===i)throw new zs(Hs.INVALID_ARGUMENT,`Invalid Query. You can't perform '${i}' queries on FieldPath.documentId().`);if("in"===i||"not-in"===i){Mf(o,i);const e=[];for(const n of o)e.push(Of(s,t,n));a={arrayValue:{values:e}}}else a=Of(s,t,o)}else"in"!==i&&"not-in"!==i&&"array-contains-any"!==i||Mf(o,i),a=Xd(n,"where",o,"in"===i||"not-in"===i);const c=Jr.create(r,i,a);return function(t,e){if(e.v()){const n=vi(t);if(null!==n&&!n.isEqual(e.field))throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. All where filters with an inequality (<, <=, !=, not-in, >, or >=) must be on the same field. But you have inequality filters on '${n.toString()}' and '${e.field.toString()}'`);const s=wi(t);null!==s&&Ff(t,e.field,s)}const n=function(t,e){for(const n of t.filters)if(e.indexOf(n.op)>=0)return n.op;return null}(t,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==n)throw n===e.op?new zs(Hs.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new zs(Hs.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}(t,c),c}(t._query,0,e,t.firestore._databaseId,this.Gc,this.zc,this.Hc);return new sd(t.firestore,t.converter,function(t,e){const n=t.filters.concat([e]);return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))}}function Tf(t,e,n){const s=e,r=hf("where",t);return new bf(r,s,n)}class Ef extends wf{constructor(t,e){super(),this.Gc=t,this.Jc=e,this.type="orderBy"}_apply(t){const e=function(t,e,n){if(null!==t.startAt)throw new zs(Hs.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==t.endAt)throw new zs(Hs.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");const s=new ui(e,n);return function(t,e){if(null===wi(t)){const n=vi(t);null!==n&&Ff(t,n,e.field)}}(t,s),s}(t._query,this.Gc,this.Jc);return new sd(t.firestore,t.converter,function(t,e){const n=t.explicitOrderBy.concat([e]);return new fi(t.path,t.collectionGroup,n,t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(t._query,e))}}function If(t,e="asc"){const n=e,s=hf("orderBy",t);return new Ef(s,n)}class Sf extends wf{constructor(t,e,n){super(),this.type=t,this.Yc=e,this.Xc=n}_apply(t){return new sd(t.firestore,t.converter,Ii(t._query,this.Yc,this.Xc))}}function _f(t){return Jl("limit",t),new Sf("limit",t,"F")}function Nf(t){return Jl("limitToLast",t),new Sf("limitToLast",t,"L")}class Af extends wf{constructor(t,e,n){super(),this.type=t,this.Zc=e,this.ta=n}_apply(t){const e=Lf(t,this.type,this.Zc,this.ta);return new sd(t.firestore,t.converter,function(t,e){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,e,t.endAt)}(t._query,e))}}function Df(...t){return new Af("startAt",t,!0)}function xf(...t){return new Af("startAfter",t,!1)}class Cf extends wf{constructor(t,e,n){super(),this.type=t,this.Zc=e,this.ta=n}_apply(t){const e=Lf(t,this.type,this.Zc,this.ta);return new sd(t.firestore,t.converter,function(t,e){return new fi(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,e)}(t._query,e))}}function kf(...t){return new Cf("endBefore",t,!0)}function Rf(...t){return new Cf("endAt",t,!1)}function Lf(t,e,n,s){if(n[0]=g(n[0]),n[0]instanceof cf)return function(t,e,n,s,r){if(!s)throw new zs(Hs.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${n}().`);const i=[];for(const n of Ti(t))if(n.field.isKeyField())i.push(Pr(e,s.key));else{const t=s.data.field(n.field);if(Ir(t))throw new zs(Hs.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+n.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===t){const t=n.field.canonicalString();throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${t}' (used as the orderBy) does not exist.`)}i.push(t)}return new ai(i,r)}(t._query,t.firestore._databaseId,e,n[0]._document,s);{const r=Bd(t.firestore);return function(t,e,n,s,r,i){const o=t.explicitOrderBy;if(r.length>o.length)throw new zs(Hs.INVALID_ARGUMENT,`Too many arguments provided to ${s}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const a=[];for(let i=0;i10)throw new zs(Hs.INVALID_ARGUMENT,`Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`)}function Ff(t,e,n){if(!n.isEqual(e))throw new zs(Hs.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class Pf{convertValue(t,e="none"){switch(Cr(t)){case 0:return null;case 1:return t.booleanValue;case 2:return Tr(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(Er(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw js()}}convertObject(t,e){const n={};return hr(t.fields,((t,s)=>{n[t]=this.convertValue(s,e)})),n}convertGeoPoint(t){return new Od(Tr(t.latitude),Tr(t.longitude))}convertArray(t,e){return(t.values||[]).map((t=>this.convertValue(t,e)))}convertServerTimestamp(t,e){switch(e){case"previous":const n=Sr(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(_r(t));default:return null}}convertTimestamp(t){const e=br(t);return new ar(e.seconds,e.nanos)}convertDocumentKey(t,e){const n=fr.fromString(t);Ks(pa(n));const s=new $l(n.get(1),n.get(3)),r=new xr(n.popFirst(5));return s.isEqual(e)||Us(`Document ${r} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),r}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function Vf(t,e,n){let s;return s=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,s}class Uf extends Pf{constructor(t){super(),this.firestore=t}convertBytes(t){return new Rd(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new nd(this.firestore,null,e)}} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class qf{constructor(t,e){this._firestore=t,this._commitHandler=e,this._mutations=[],this._committed=!1,this._dataReader=Bd(t)}set(t,e,n){this._verifyNotCommitted();const s=Bf(t,this._firestore),r=Vf(s.converter,e,n),i=jd(this._dataReader,"WriteBatch.set",s._key,r,null!==s.converter,n);return this._mutations.push(i.toMutation(s._key,zi.none())),this}update(t,e,n,...s){this._verifyNotCommitted();const r=Bf(t,this._firestore);let i;return i="string"==typeof(e=g(e))||e instanceof Cd?Yd(this._dataReader,"WriteBatch.update",r._key,e,n,s):Wd(this._dataReader,"WriteBatch.update",r._key,e),this._mutations.push(i.toMutation(r._key,zi.exists(!0))),this}delete(t){this._verifyNotCommitted();const e=Bf(t,this._firestore);return this._mutations=this._mutations.concat(new oo(e._key,zi.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new zs(Hs.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Bf(t,e){if((t=g(t)).firestore!==e)throw new zs(Hs.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function jf(t){t=Xl(t,nd);const e=Xl(t.firestore,gd);return ql(yd(e),t._key).then((n=>ng(e,t,n)))}class Kf extends Pf{constructor(t){super(),this.firestore=t}convertBytes(t){return new Rd(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new nd(this.firestore,null,e)}}function $f(t){t=Xl(t,nd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){try{const s=await function(t,e){const n=Gs(t);return n.persistence.runTransaction("read document","readonly",(t=>n.Qn.An(t,e)))}(t,e);s.isFoundDocument()?n.resolve(s):s.isNoDocument()?n.resolve(null):n.reject(new zs(Hs.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(t){const s=_h(t,`Failed to get document '${e} from cache`);n.reject(s)}}(await Fl(t),e,n))),n.promise}(n,t._key).then((n=>new df(e,s,t._key,n,new lf(null!==n&&n.hasLocalMutations,!0),t.converter)))}function Gf(t){t=Xl(t,nd);const e=Xl(t.firestore,gd);return ql(yd(e),t._key,{source:"server"}).then((n=>ng(e,t,n)))}function Hf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return yf(t._query),Bl(n,t._query).then((n=>new gf(e,s,t,n)))}function zf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){try{const s=await du(t,e,!0),r=new Kh(e,s.Gn),i=r.bo(s.documents),o=r.applyChanges(i,!1);n.resolve(o.snapshot)}catch(t){const s=_h(t,`Failed to execute query '${e} against cache`);n.reject(s)}}(await Fl(t),e,n))),n.promise}(n,t._query).then((n=>new gf(e,s,t,n)))}function Qf(t){t=Xl(t,sd);const e=Xl(t.firestore,gd),n=yd(e),s=new Kf(e);return Bl(n,t._query,{source:"server"}).then((n=>new gf(e,s,t,n)))}function Wf(t,e,n){t=Xl(t,nd);const s=Xl(t.firestore,gd),r=Vf(t.converter,e,n);return eg(s,[jd(Bd(s),"setDoc",t._key,r,null!==t.converter,n).toMutation(t._key,zi.none())])}function Yf(t,e,n,...s){t=Xl(t,nd);const r=Xl(t.firestore,gd),i=Bd(r);let o;return o="string"==typeof(e=g(e))||e instanceof Cd?Yd(i,"updateDoc",t._key,e,n,s):Wd(i,"updateDoc",t._key,e),eg(r,[o.toMutation(t._key,zi.exists(!0))])}function Xf(t){return eg(Xl(t.firestore,gd),[new oo(t._key,zi.none())])}function Jf(t,e){const n=Xl(t.firestore,gd),s=ad(t),r=Vf(t.converter,e);return eg(n,[jd(Bd(t.firestore),"addDoc",s._key,r,null!==t.converter,{}).toMutation(s._key,zi.exists(!1))]).then((()=>s))}function Zf(t,...e){var n,s,r;t=g(t);let i={includeMetadataChanges:!1},o=0;"object"!=typeof e[o]||ld(e[o])||(i=e[o],o++);const a={includeMetadataChanges:i.includeMetadataChanges};if(ld(e[o])){const t=e[o];e[o]=null===(n=t.next)||void 0===n?void 0:n.bind(t),e[o+1]=null===(s=t.error)||void 0===s?void 0:s.bind(t),e[o+2]=null===(r=t.complete)||void 0===r?void 0:r.bind(t)}let c,u,h;if(t instanceof nd)u=Xl(t.firestore,gd),h=mi(t._key.path),c={next:n=>{e[o]&&e[o](ng(u,t,n))},error:e[o+1],complete:e[o+2]};else{const n=Xl(t,sd);u=Xl(n.firestore,gd),h=n._query;const s=new Kf(u);c={next:t=>{e[o]&&e[o](new gf(u,s,n,t))},error:e[o+1],complete:e[o+2]},yf(t._query)}return function(t,e,n,s){const r=new Nl(s),i=new Fh(e,r,n);return t.asyncQueue.enqueueAndForget((async()=>kh(await Ul(t),i))),()=>{r.ec(),t.asyncQueue.enqueueAndForget((async()=>Rh(await Ul(t),i)))}}(yd(u),h,a,c)}function tg(t,e){return function(t,e){const n=new Nl(e);return t.asyncQueue.enqueueAndForget((async()=>function(t,e){Gs(t).so.add(e),e.next()}(await Ul(t),n))),()=>{n.ec(),t.asyncQueue.enqueueAndForget((async()=>function(t,e){Gs(t).so.delete(e)}(await Ul(t),n)))}}(yd(t=Xl(t,gd)),ld(e)?e:{next:e})}function eg(t,e){return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){const s=bl(t);try{const t=await function(t,e){const n=Gs(t),s=ar.now(),r=e.reduce(((t,e)=>t.add(e.key)),No());let i;return n.persistence.runTransaction("Locally write mutations","readwrite",(t=>n.Qn.Pn(t,r).next((r=>{i=r;const o=[];for(const t of e){const e=Ji(t,i.get(t.key));null!=e&&o.push(new no(t.key,e,Gr(e.value.mapValue),zi.exists(!0)))}return n.In.addMutationBatch(t,s,o,e)})))).then((t=>(t.applyToLocalDocumentSet(i),{batchId:t.batchId,changes:i})))}(s.localStore,e);s.sharedClientState.addPendingMutation(t.batchId),function(t,e,n){let s=t.qo[t.currentUser.toKey()];s||(s=new go(rr)),s=s.insert(e,n),t.qo[t.currentUser.toKey()]=s}(s,t.batchId,n),await cl(s,t.changes),await dh(s.remoteStore)}catch(t){const e=_h(t,"Failed to persist write");n.reject(e)}}(await Vl(t),e,n))),n.promise}(yd(t),e)}function ng(t,e,n){const s=n.docs.get(e._key),r=new Kf(t);return new df(t,r,e._key,s,new lf(n.hasPendingWrites,n.fromCache),e.converter)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */class sg extends class{constructor(t,e){this._firestore=t,this._transaction=e,this._dataReader=Bd(t)}get(t){const e=Bf(t,this._firestore),n=new Uf(this._firestore);return this._transaction.lookup([e._key]).then((t=>{if(!t||1!==t.length)return js();const s=t[0];if(s.isFoundDocument())return new cf(this._firestore,n,s.key,s,e.converter);if(s.isNoDocument())return new cf(this._firestore,n,e._key,null,e.converter);throw js()}))}set(t,e,n){const s=Bf(t,this._firestore),r=Vf(s.converter,e,n),i=jd(this._dataReader,"Transaction.set",s._key,r,null!==s.converter,n);return this._transaction.set(s._key,i),this}update(t,e,n,...s){const r=Bf(t,this._firestore);let i;return i="string"==typeof(e=g(e))||e instanceof Cd?Yd(this._dataReader,"Transaction.update",r._key,e,n,s):Wd(this._dataReader,"Transaction.update",r._key,e),this._transaction.update(r._key,i),this}delete(t){const e=Bf(t,this._firestore);return this._transaction.delete(e._key),this}}{constructor(t,e){super(t,e),this._firestore=t}get(t){const e=Bf(t,this._firestore),n=new Kf(this._firestore);return super.get(t).then((t=>new df(this._firestore,n,e._key,t._document,new lf(!1,!1),e.converter)))}}function rg(t,e){return function(t,e){const n=new Qs;return t.asyncQueue.enqueueAndForget((async()=>{const s=await function(t){return Ol(t).then((t=>t.datastore))}(t);new xl(t.asyncQueue,s,e,n).run()})),n.promise}(yd(t=Xl(t,gd)),(n=>e(new sg(t,n))))} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function ig(){return new Kd("deleteField")}function og(){return new Gd("serverTimestamp")}function ag(...t){return new Hd("arrayUnion",t)}function cg(...t){return new zd("arrayRemove",t)}function ug(t){return new Qd("increment",t)} +/** + * @license + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */function hg(t){return yd(t=Xl(t,gd)),new qf(t,(e=>eg(t,e)))}!function(t,e=!0){!function(t){Os=t}(i.SDK_VERSION),i._registerComponent(new m("firestore",((t,{options:n})=>{const s=t.getProvider("app").getImmediate(),r=new gd(s,new Js(t.getProvider("auth-internal")));return n=Object.assign({useFetchStreams:e},n),r._setSettings(n),r}),"PUBLIC")),i.registerVersion(Rs,"3.2.1",t),i.registerVersion(Rs,"3.2.1","esm2017")}()}))})(); \ No newline at end of file diff --git a/frontend-dist/help-circle-outline.a023036a.svg b/frontend-dist/help-circle-outline.a023036a.svg new file mode 100644 index 0000000000..17ce1e0bc9 --- /dev/null +++ b/frontend-dist/help-circle-outline.a023036a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/index.a1ed246a.css b/frontend-dist/index.a1ed246a.css new file mode 100644 index 0000000000..64524ec4ce --- /dev/null +++ b/frontend-dist/index.a1ed246a.css @@ -0,0 +1 @@ +*{box-sizing:border-box}#title{display:block;margin-top:34vh;text-align:center;width:100%}#title h1,#title h2{border-bottom:2px solid var(--rule-color);color:var(--pluto-output-h-color);font-family:Vollkorn,serif;font-size:2em;font-style:italic;font-weight:500;letter-spacing:.08em;margin:0}#title h2{font-size:1.4em}#title img{filter:var(--image-filters);height:1.2em;margin-bottom:-.27em;margin-left:.1em}body{background:var(--main-bg-color);margin:0;min-height:100%;position:absolute;width:100%}main{color:var(--index-text-color);font-family:Roboto Mono,monospace;margin:20vh auto 0;text-align:left;width:15em}p{color:var(--index-clickable-text-color)}ul{list-style:none;padding-left:.5em}li{margin-bottom:.9em;white-space:nowrap}a{color:inherit;color:var(--index-clickable-text-color)}pluto-filepicker{display:flex;flex-direction:row;margin-top:.3rem}pluto-filepicker .cm-editor{background:none;border:2px solid var(--nav-filepicker-border-color);border-radius:3px;border-bottom-right-radius:0;border-right:none;border-top-right-radius:0;color:var(--nav-filepicker-color);display:inline-block;font-family:Roboto Mono,monospace;font-size:.75rem;font-style:normal;font-weight:500;height:calc(1rem + 12px);letter-spacing:1px;width:100%}pluto-filepicker .cm-scroller{scrollbar-width:none}pluto-filepicker .cm-scroller::-webkit-scrollbar{display:none}pluto-filepicker button{background:var(--footer-filepicker-focus-color);border:2px solid var(--nav-filepicker-focus-color);border-radius:3px;border-bottom-left-radius:0;border-top-left-radius:0;color:var(--white);cursor:pointer;font-family:Roboto Mono,monospace;font-size:.75rem;font-weight:600;margin:0}pluto-filepicker button:disabled{cursor:not-allowed;opacity:.7}.cm-editor .cm-tooltip{border:1px solid var(--cm-editor-tooltip-border-color);border-radius:4px;box-shadow:3px 3px 4px rgb(0 0 0/20%)}.cm-tooltip-autocomplete{box-sizing:content-box;max-height:320px;z-index:100}.cm-tooltip.cm-completionInfo.cm-completionInfo-right:empty{display:none}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li{border-radius:3px;height:16px;line-height:16px;margin-bottom:unset;overflow-y:hidden}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li[aria-selected]{background:var(--cm-editor-li-aria-selected-bg-color);color:var(--cm-editor-li-aria-selected-color)}.cm-editor .cm-completionIcon{opacity:1;transform:translateY(-1.5px);width:1em}.cm-completionIcon:before{color:transparent;content:"⚫";margin-right:.5em;opacity:1}.cm-tooltip.cm-tooltip-autocomplete{background:var(--autocomplete-menu-bg-color);margin-left:-1.5em;padding:0}.cm-tooltip-autocomplete li.file.new:before{content:"👉 "}.cm-tooltip-autocomplete li.file:before{content:"📄 "}.cm-tooltip-autocomplete li.dir:before{content:"📁 "}.cm-tooltip-autocomplete>ul{padding:0}.cm-editor .cm-tooltip-autocomplete .cm-completionLabel{font-family:JuliaMono,Menlo,Roboto Mono,Lucida Sans Typewriter,Source Code Pro,monospace!important;font-size:.75rem;font-variant-ligatures:none}body.nosessions ul#new~*{display:none}#recent{margin-bottom:8em}#recent>li.recent{opacity:.8}#recent button{background:none;border:none;color:var(--ui-button-color);cursor:pointer;margin:0 .2em 0 0;opacity:.6;padding:1px}#recent button>span:after{background-size:17px 17px;content:" ";display:block;height:17px;margin-bottom:-3px;width:17px}#recent li.running button>span:after{background-image:url(close-circle.d0f6eac6.svg);filter:var(--image-filters)}#recent li.recent button>span:after{background-image:url(caret-forward-circle-outline.d0bf2b34.svg);filter:var(--image-filters)}#recent li.transitioning button>span:after{background-image:url(ellipsis-horizontal-outline.abb6e818.svg);filter:var(--image-filters)}loading-bar{background-color:var(--loading-grad-color-1);display:none;height:6px;position:fixed;top:0;width:100vw}body.loading loading-bar{animation:load 16s ease-in-out;display:block}@keyframes load{0%{right:100vw}20%{right:30vw}to{right:0}} \ No newline at end of file diff --git a/frontend-dist/index.efce06d6.js b/frontend-dist/index.efce06d6.js new file mode 100644 index 0000000000..fd254a04fc --- /dev/null +++ b/frontend-dist/index.efce06d6.js @@ -0,0 +1,39 @@ +var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},t={},o={},n=e.parcelRequire94c2;null==n&&((n=function(e){if(e in t)return t[e].exports;if(e in o){var n=o[e];delete o[e];var a={id:e,exports:{}};return t[e]=a,n.call(a.exports,a,a.exports),a.exports}var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}).register=function(e,t){o[e]=t},e.parcelRequire94c2=n);var a=n("cNaMA");n("eS9BV");var r,l,i,s,c={};r=c,l="Welcome",i=()=>j,s=e=>j=e,Object.defineProperty(r,l,{get:i,set:s,enumerable:!0,configurable:!0}),n("9Ta4i");a=n("cNaMA"),a=n("cNaMA");var d=n("4zMEb");const u=async()=>{let e=await fetch("https://api.github.com/repos/fonsp/Pluto.jl/releases",{method:"GET",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json"},redirect:"follow",referrerPolicy:"no-referrer"});return(await e.json()).reverse()};n("9Ta4i");a=n("cNaMA");var p=n("2ZZ1r");a=n("cNaMA");const h=e=>{const t=`${e}\n`.replace("\r\n","\n"),o=t.indexOf("### A Pluto.jl notebook ###"),n=t.match(/# ... ........-....-....-....-............/g),a=(null==n?void 0:n.length)??0;let r=t.indexOf("# ╔═╡ Cell order:")+17+1;for(let e=1;e<=a;e++)r=t.indexOf("\n",r+1)+1;return t.slice(o,r)},f=async e=>{var t;let o;if(console.log(e),(null===(t=((null==e?void 0:e.path)??(null==e?void 0:e.composedPath())).filter((e=>{var t;return null==e||null===(t=e.classList)||void 0===t?void 0:t.contains(".cm-editor")})))||void 0===t?void 0:t.length)>0)return;switch(e.type){case"paste":o=h(e.clipboardData.getData("text/plain"));break;case"dragstart":return void(e.dataTransfer.dropEffect="move");case"dragover":return void e.preventDefault();case"drop":e.preventDefault(),o=e.dataTransfer.types.includes("Files")?await(a=e.dataTransfer.files[0],new Promise(((e,t)=>{const{name:o,type:n}=a,r=new FileReader;r.onerror=()=>t("Failed to read file!"),r.onloadstart=()=>{},r.onprogress=({loaded:e,total:t})=>{},r.onload=()=>{},r.onloadend=()=>e({file:r.result,name:o,type:n}),r.readAsText(a)}))).then((({file:e})=>e)):h(await(n=e.dataTransfer.items[0],new Promise(((e,t)=>{try{n.getAsString((t=>{console.log(t),e(t)}))}catch(e){t(e)}}))))}var n,a;if(!o)return;document.body.classList.add("loading");const r=await fetch("./notebookupload",{method:"POST",body:o});if(r.ok)window.location.href=v(await r.text());else{let e=await r.blob();window.location.href=URL.createObjectURL(e)}},m=()=>(a.useEffect((()=>(document.addEventListener("paste",f),document.addEventListener("drop",f),document.addEventListener("dragstart",f),document.addEventListener("dragover",f),()=>{document.removeEventListener("paste",f),document.removeEventListener("drop",f),document.removeEventListener("dragstart",f),document.removeEventListener("dragover",f)}))),a.html``),g=e=>e.toLowerCase().normalize("NFD").replace(/[^a-z1-9]/g,""),b=({client:e,connected:t,CustomPicker:o,show_samples:n})=>{const r=o??{text:"Open from file",placeholder:"Enter path or URL..."};return a.html`

New session:

+ <${m} /> +
    + ${n&&a.html`
  • Open a sample notebook
  • `} +
  • Create a new notebook
  • +
  • + ${r.text}: + <${p.FilePicker} + key=${r.placeholder} + client=${e} + value="" + on_submit=${async e=>{const t=await(async e=>{try{const t=new URL(e);if(!["http:","https:","ftp:","ftps:"].includes(t.protocol))throw"Not a web URL";if("gist.github.com"===t.host){console.log("Gist URL detected");const e=t.pathname.substring(1).split("/")[1],o=await(await fetch(`https://api.github.com/gists/${e}`,{headers:{Accept:"application/vnd.github.v3+json"}}).then((e=>e.ok?e:Promise.reject(e)))).json();console.log(o);const n=Object.values(o.files),a=n.find((e=>g("#file-"+e.filename)===g(t.hash)));return null!=a?{type:"url",path_or_url:a.raw_url}:{type:"url",path_or_url:n[0].raw_url}}return"github.com"===t.host&&t.searchParams.set("raw","true"),{type:"url",path_or_url:t.href}}catch(t){return'"'===e[e.length-1]&&'"'===e[0]&&(e=e.slice(1,-1)),{type:"path",path_or_url:e}}})(e);"path"===t.type?(document.body.classList.add("loading"),window.location.href=_(t.path_or_url)):confirm("Are you sure? This will download and run the file at\n\n"+t.path_or_url)&&(document.body.classList.add("loading"),window.location.href=w(t.path_or_url))}} + button_label="Open" + placeholder=${r.placeholder} + /> +
  • +
`},_=e=>"open?"+new URLSearchParams({path:e}).toString(),w=e=>"open?"+new URLSearchParams({url:e}).toString(),v=e=>"edit?id="+e;var k=n("9Ta4i"),y=(a=n("cNaMA"),a=n("cNaMA"),n("aN0pg"));const $=(e,t=null)=>({transitioning:!1,notebook_id:t,path:e}),L=(e,t)=>e.split(/\/|\\/).slice(-t).join("/"),P=({client:e,connected:t,remote_notebooks:o,CustomRecent:n})=>{const[r,l]=a.useState(null),i=a.useRef(r);i.current=r;const s=(e,t)=>{l((o=>(null==o?void 0:o.map((o=>o.path==e?{...o,...t}:o)))??null))};a.useEffect((()=>{null!=e&&t&&e.send("get_all_notebooks",{},{}).then((({message:e})=>{const t=e.notebooks.map((e=>$(e.path,e.notebook_id))),o=E(),n=[...k.default.sortBy(t,[e=>k.default.findIndex([...o,...t],(t=>t.path===e.path))]),...k.default.differenceBy(o,t,(e=>e.path))];l(n),document.body.classList.remove("loading")}))}),[null!=e&&t]),a.useEffect((()=>{const e=o;if(null!=i.current){const t=[],o=i.current.map((o=>{let n=null;if(n=o.notebook_id?e.find((e=>e.notebook_id==o.notebook_id)):e.find((e=>e.path==o.path)),null==n)return $(o.path);{const e=$(n.path,n.notebook_id);return t.push(n),e}})),n=e.filter((e=>!t.includes(e))).map((e=>$(e.path,e.notebook_id)));l([...n,...o])}}),[o]);a.useEffect((()=>{document.body.classList.toggle("nosessions",!(null==r||r.length>0))}),[r]);const c=null==r?void 0:r.map((e=>e.path));let d=null==r?a.html`
  • Loading...
  • `:r.map((t=>{const o=null!=t.notebook_id;return a.html`
  • + + {o||(document.body.classList.add("loading"),s(t.path,{transitioning:!0}))}} + >${((e,t)=>{let o=1;for(const n of t)if(n!==e)for(;L(e,o)===L(n,o);)o++;return L(e,o)})(t.path,c)} +
  • `}));return null==n?a.html` +

    Recent sessions:

    +
      + ${d} +
    + `:a.html`<${n} cl=${y.cl} combined=${r} client=${e} recents=${d} />`},E=()=>{const e=localStorage.getItem("recent notebooks"),t=null!=e?JSON.parse(e):[];return(t instanceof Array?t:[]).map((e=>$(e)))},j=()=>{const[e,t]=a.useState([]),[o,n]=a.useState(!1),[r,l]=a.useState({show_samples:!0,CustomPicker:null,CustomRecent:null}),i=a.useRef({});a.useEffect((()=>{const e=n;d.create_pluto_connection({on_unrequested_update:({message:e,type:o})=>{"notebook_list"===o&&t(e.notebooks)},on_connection_status:e,on_reconnect:()=>!0}).then((async e=>{Object.assign(i.current,e),n(!0);try{const{default:t}=await import(e.session_options.server.injected_javascript_data_url),{custom_recent:o,custom_filepicker:n,show_samples:r=!0}=t({client:e,editor:void 0,imports:{preact:a}});l((e=>({...e,CustomRecent:o,CustomPicker:n,show_samples:r})))}catch(e){}(e=>{u().then((t=>{const o=e.version_info.pluto,n=t[t.length-1].tag_name;console.log(`Pluto version ${o}`);const a=t.findIndex((e=>e.tag_name===o));-1!==a&&t.slice(a+1).filter((e=>e.body.toLowerCase().includes("recommended update"))).length>0&&(console.log(`Newer version ${n} is available`),e.version_info.dismiss_update_notification||alert("A new version of Pluto.jl is available! 🎉\n\n You have "+o+", the latest is "+n+'.\n\nYou can update Pluto.jl using the julia package manager:\n import Pkg; Pkg.update("Pluto")\nAfterwards, exit Pluto.jl and restart julia.'))})).catch((()=>{}))})(e),e.send("completepath",{query:""},{})}))}),[]);const{show_samples:s,CustomRecent:c,CustomPicker:p}=r;return a.html` + <${b} client=${i.current} connected=${o} CustomPicker=${p} show_samples=${s} /> +
    + <${P} client=${i.current} connected=${o} remote_notebooks=${e} CustomRecent=${c} /> + `};a.render(a.html`<${c.Welcome} />`,document.querySelector("main")); \ No newline at end of file diff --git a/frontend-dist/index.html b/frontend-dist/index.html new file mode 100644 index 0000000000..4dc6c790b2 --- /dev/null +++ b/frontend-dist/index.html @@ -0,0 +1 @@ +⚡ Pluto.jl ⚡

    welcome to

    New session:

    \ No newline at end of file diff --git a/frontend-dist/juliamono.a2a5b30d.css b/frontend-dist/juliamono.a2a5b30d.css new file mode 100644 index 0000000000..3803d5957e --- /dev/null +++ b/frontend-dist/juliamono.a2a5b30d.css @@ -0,0 +1 @@ +@font-face{font-display:swap;font-family:JuliaMono;font-weight:400;src:url(JuliaMono-RegularLatin.d51844a8.woff2) format("woff2");unicode-range:U+00-7f}@font-face{font-display:swap;font-family:JuliaMono;font-weight:700;src:url(JuliaMono-BoldLatin.a78b1eda.woff2) format("woff2");unicode-range:U+00-7f}@font-face{font-display:swap;font-family:JuliaMono;font-weight:400;src:url(JuliaMono-Regular.de4da299.woff2) format("woff2")}@font-face{font-display:swap;font-family:JuliaMono;font-weight:700;src:url(JuliaMono-Bold.68f7f035.woff2) format("woff2")}@font-face{font-display:swap;font-family:JuliaMono;font-style:italic;font-weight:400;src:url(JuliaMono-RegularItalic.963ec4f3.woff2) format("woff2")} \ No newline at end of file diff --git a/frontend-dist/lato-all-400-italic.c29c8c6c.woff b/frontend-dist/lato-all-400-italic.c29c8c6c.woff new file mode 100644 index 0000000000..6131624555 Binary files /dev/null and b/frontend-dist/lato-all-400-italic.c29c8c6c.woff differ diff --git a/frontend-dist/lato-all-400-normal.a1a68bdf.woff b/frontend-dist/lato-all-400-normal.a1a68bdf.woff new file mode 100644 index 0000000000..1f1fd49a12 Binary files /dev/null and b/frontend-dist/lato-all-400-normal.a1a68bdf.woff differ diff --git a/frontend-dist/lato-latin-400-italic.6edbc86c.woff2 b/frontend-dist/lato-latin-400-italic.6edbc86c.woff2 new file mode 100644 index 0000000000..3246c1286f Binary files /dev/null and b/frontend-dist/lato-latin-400-italic.6edbc86c.woff2 differ diff --git a/frontend-dist/lato-latin-400-normal.77db3602.woff2 b/frontend-dist/lato-latin-400-normal.77db3602.woff2 new file mode 100644 index 0000000000..6904b6649f Binary files /dev/null and b/frontend-dist/lato-latin-400-normal.77db3602.woff2 differ diff --git a/frontend-dist/lato-latin-ext-400-italic.336aaf51.woff2 b/frontend-dist/lato-latin-ext-400-italic.336aaf51.woff2 new file mode 100644 index 0000000000..69af6c080d Binary files /dev/null and b/frontend-dist/lato-latin-ext-400-italic.336aaf51.woff2 differ diff --git a/frontend-dist/lato-latin-ext-400-normal.e1ce8ad3.woff2 b/frontend-dist/lato-latin-ext-400-normal.e1ce8ad3.woff2 new file mode 100644 index 0000000000..0a0ee5eaed Binary files /dev/null and b/frontend-dist/lato-latin-ext-400-normal.e1ce8ad3.woff2 differ diff --git a/frontend-dist/logo.004c1d7c.svg b/frontend-dist/logo.004c1d7c.svg new file mode 100644 index 0000000000..cec701dc07 --- /dev/null +++ b/frontend-dist/logo.004c1d7c.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/mic-off-outline.251c22b7.svg b/frontend-dist/mic-off-outline.251c22b7.svg new file mode 100644 index 0000000000..5ff2a050d0 --- /dev/null +++ b/frontend-dist/mic-off-outline.251c22b7.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/mic-outline.e10eafe2.svg b/frontend-dist/mic-outline.e10eafe2.svg new file mode 100644 index 0000000000..96d55c507f --- /dev/null +++ b/frontend-dist/mic-outline.e10eafe2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/newspaper-outline.e481c39c.svg b/frontend-dist/newspaper-outline.e481c39c.svg new file mode 100644 index 0000000000..c142efa0f1 --- /dev/null +++ b/frontend-dist/newspaper-outline.e481c39c.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/parcel-manifest.json b/frontend-dist/parcel-manifest.json new file mode 100644 index 0000000000..9d8b29bf1f --- /dev/null +++ b/frontend-dist/parcel-manifest.json @@ -0,0 +1 @@ +{"editor.html":"./editor.html","img/favicon-16x16.png":"./favicon-16x16.347d2855.png","img/favicon-32x32.png":"./favicon-32x32.8789add4.png","img/favicon-96x96.png":"./favicon-96x96.48689391.png","img/logo.svg":"./logo.004c1d7c.svg","img/favicon_unsaturated.svg":"./favicon_unsaturated.d1387b25.svg","juliamono.css":"./juliamono.a2a5b30d.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-RegularLatin.woff2":"./JuliaMono-RegularLatin.d51844a8.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-BoldLatin.woff2":"./JuliaMono-BoldLatin.a78b1eda.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-Regular.woff2":"./JuliaMono-Regular.de4da299.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-Bold.woff2":"./JuliaMono-Bold.68f7f035.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/cormullion/juliamono@0.043/webfonts/JuliaMono-RegularItalic.woff2":"./JuliaMono-RegularItalic.963ec4f3.woff2","vollkorn.css":"./vollkorn.089565a8.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-SemiBold.woff2":"./Vollkorn-SemiBold.8072eb6c.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-SemiBoldItalic.woff2":"./Vollkorn-SemiBoldItalic.5c3cd265.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-Bold.woff2":"./Vollkorn-Bold.6e1feb70.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-BoldItalic.woff2":"./Vollkorn-BoldItalic.a48ab300.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-Black.woff2":"./Vollkorn-Black.0ebdfbf5.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/fonsp/Vollkorn-Typeface@1/fonts/woff2/Vollkorn-BlackItalic.woff2":"./Vollkorn-BlackItalic.4095acfe.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/lodash@4.17.20/lodash.min.js":"./editor.4b96dd74.js",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@observablehq/stdlib@3.3.1/dist/stdlib.js":"./editor.9f9dc874.js",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/iframe-resizer@4.2.11/js/iframeResizer.min.js":"./editor.90ede145.js",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/ansi_up@5.0.1/ansi_up.min.js":"./editor.dedc49a3.js",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/iframe-resizer@4.2.11/js/iframeResizer.contentWindow.min.js":"./editor.6386bd9d.js","editor.css":"./editor.3815f7e7.css",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-ext-500-normal.woff2":"./roboto-mono-cyrillic-ext-500-normal.d362a132.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-all-500-normal.woff":"./roboto-mono-all-500-normal.cc559149.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-500-normal.woff2":"./roboto-mono-cyrillic-500-normal.8ed3add8.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-greek-500-normal.woff2":"./roboto-mono-greek-500-normal.dd57b097.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-vietnamese-500-normal.woff2":"./roboto-mono-vietnamese-500-normal.1320bb60.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-ext-500-normal.woff2":"./roboto-mono-latin-ext-500-normal.415f7d14.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-500-normal.woff2":"./roboto-mono-latin-500-normal.98ad1d4e.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-ext-700-normal.woff2":"./roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-all-700-normal.woff":"./roboto-mono-all-700-normal.393c796d.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-700-normal.woff2":"./roboto-mono-cyrillic-700-normal.5e6410cf.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-greek-700-normal.woff2":"./roboto-mono-greek-700-normal.b101f80c.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-vietnamese-700-normal.woff2":"./roboto-mono-vietnamese-700-normal.edb1435b.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-ext-700-normal.woff2":"./roboto-mono-latin-ext-700-normal.c497b002.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-700-normal.woff2":"./roboto-mono-latin-700-normal.447ac127.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-400-normal.woff2":"./alegreya-sans-cyrillic-ext-400-normal.5f5cc2ef.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-400-normal.woff":"./alegreya-sans-all-400-normal.a91dc265.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-400-normal.woff2":"./alegreya-sans-cyrillic-400-normal.ab3d1dcc.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-400-normal.woff2":"./alegreya-sans-greek-ext-400-normal.b82a0aea.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-400-normal.woff2":"./alegreya-sans-greek-400-normal.4e5a8597.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-400-normal.woff2":"./alegreya-sans-vietnamese-400-normal.bdc8a622.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-400-normal.woff2":"./alegreya-sans-latin-ext-400-normal.1c1602b0.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-400-normal.woff2":"./alegreya-sans-latin-400-normal.62b57001.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-500-normal.woff2":"./alegreya-sans-cyrillic-ext-500-normal.0e6ee102.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-500-normal.woff":"./alegreya-sans-all-500-normal.5db27a5b.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-500-normal.woff2":"./alegreya-sans-cyrillic-500-normal.8a029e9d.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-500-normal.woff2":"./alegreya-sans-greek-ext-500-normal.00f2c6f3.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-500-normal.woff2":"./alegreya-sans-greek-500-normal.54a6041f.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-500-normal.woff2":"./alegreya-sans-vietnamese-500-normal.97e250df.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-500-normal.woff2":"./alegreya-sans-latin-ext-500-normal.637067c1.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-500-normal.woff2":"./alegreya-sans-latin-500-normal.4428c984.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-700-normal.woff2":"./alegreya-sans-cyrillic-ext-700-normal.2e02b08f.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-700-normal.woff":"./alegreya-sans-all-700-normal.29d7dfa9.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-700-normal.woff2":"./alegreya-sans-cyrillic-700-normal.5a5aa5e3.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-700-normal.woff2":"./alegreya-sans-greek-ext-700-normal.ca9ee8e1.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-700-normal.woff2":"./alegreya-sans-greek-700-normal.452fc62e.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-700-normal.woff2":"./alegreya-sans-vietnamese-700-normal.59390763.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-700-normal.woff2":"./alegreya-sans-latin-ext-700-normal.b5306f41.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-700-normal.woff2":"./alegreya-sans-latin-700-normal.96e2fcc9.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-400-italic.woff2":"./alegreya-sans-cyrillic-ext-400-italic.7c2a4a40.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-400-italic.woff":"./alegreya-sans-all-400-italic.f87bfe89.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-400-italic.woff2":"./alegreya-sans-cyrillic-400-italic.8c81649c.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-400-italic.woff2":"./alegreya-sans-greek-ext-400-italic.550f5118.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-400-italic.woff2":"./alegreya-sans-greek-400-italic.1b909c63.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-400-italic.woff2":"./alegreya-sans-vietnamese-400-italic.d08e8dff.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-400-italic.woff2":"./alegreya-sans-latin-ext-400-italic.b9ce632b.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-400-italic.woff2":"./alegreya-sans-latin-400-italic.ec56f658.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-500-italic.woff2":"./alegreya-sans-cyrillic-ext-500-italic.78248b65.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-500-italic.woff":"./alegreya-sans-all-500-italic.8917c3da.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-500-italic.woff2":"./alegreya-sans-cyrillic-500-italic.a40f95be.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-500-italic.woff2":"./alegreya-sans-greek-ext-500-italic.8b2e952b.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-500-italic.woff2":"./alegreya-sans-greek-500-italic.19d09eea.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-500-italic.woff2":"./alegreya-sans-vietnamese-500-italic.3ff20df8.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-500-italic.woff2":"./alegreya-sans-latin-ext-500-italic.d15c8f11.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-500-italic.woff2":"./alegreya-sans-latin-500-italic.6d8350bf.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-ext-700-italic.woff2":"./alegreya-sans-cyrillic-ext-700-italic.69b0617e.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-all-700-italic.woff":"./alegreya-sans-all-700-italic.a6d70e05.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-cyrillic-700-italic.woff2":"./alegreya-sans-cyrillic-700-italic.c4ef17a2.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-ext-700-italic.woff2":"./alegreya-sans-greek-ext-700-italic.a1ccc0c2.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-greek-700-italic.woff2":"./alegreya-sans-greek-700-italic.5aef27cf.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-vietnamese-700-italic.woff2":"./alegreya-sans-vietnamese-700-italic.7de0cccc.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-ext-700-italic.woff2":"./alegreya-sans-latin-ext-700-italic.733aea09.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/alegreya-sans@4.4.5/files/alegreya-sans-latin-700-italic.woff2":"./alegreya-sans-latin-700-italic.abc64c8a.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-latin-ext-400-normal.woff2":"./lato-latin-ext-400-normal.e1ce8ad3.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-all-400-normal.woff":"./lato-all-400-normal.a1a68bdf.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-latin-400-normal.woff2":"./lato-latin-400-normal.77db3602.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-latin-ext-400-italic.woff2":"./lato-latin-ext-400-italic.336aaf51.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-all-400-italic.woff":"./lato-all-400-italic.c29c8c6c.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/lato@4.4.5/files/lato-latin-400-italic.woff2":"./lato-latin-400-italic.6edbc86c.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/radio-button-on-outline.svg":"./radio-button-on-outline.778acac1.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/stop-circle-outline.svg":"./stop-circle-outline.6623356d.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/shapes-outline.svg":"./shapes-outline.76567c1b.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/close-outline.svg":"./close-outline.9c22a232.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/newspaper-outline.svg":"./newspaper-outline.e481c39c.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/mic-outline.svg":"./mic-outline.e10eafe2.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/mic-off-outline.svg":"./mic-off-outline.251c22b7.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-undo-outline.svg":"./arrow-undo-outline.d8c99108.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/sync-circle-outline.svg":"./sync-circle-outline.65b15d76.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/checkmark-outline.svg":"./checkmark-outline.4fb8c646.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/eye-outline.svg":"./eye-outline.6e6e0f7c.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/eye-off-outline.svg":"./eye-off-outline.a37e03db.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/add-outline.svg":"./add-outline.e3c93c35.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/document-text-outline.svg":"./document-text-outline.8d1e2333.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/bandage-outline.svg":"./bandage-outline.37f88b63.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/caret-forward-circle-outline.svg":"./caret-forward-circle-outline.d0bf2b34.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ban-outline.svg":"./ban-outline.c97da9b4.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/close-circle-outline.svg":"./close-circle-outline.4baeedb9.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ellipsis-horizontal-circle-outline.svg":"./ellipsis-horizontal-circle-outline.6279ed30.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/time-outline.svg":"./time-outline.7c1877f0.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/sync-outline.svg":"./sync-outline.9a1bd27b.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/cloud-offline-outline.svg":"./cloud-offline-outline.ac2eade9.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/cloud-download-outline.svg":"./cloud-download-outline.8c1ff9bb.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/chatbox-ellipses-outline.svg":"./chatbox-ellipses-outline.4334a3a4.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-redo-circle-outline.svg":"./arrow-redo-circle-outline.dfa899f4.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/chevron-forward-circle-outline.svg":"./chevron-forward-circle-outline.babf2a99.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/chevron-down-outline.svg":"./chevron-down-outline.1efaf1cc.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-back-outline.svg":"./arrow-back-outline.9ae1bed8.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-forward-outline.svg":"./arrow-forward-outline.f5f68f5c.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-ext-400-normal.woff2":"./roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-all-400-normal.woff":"./roboto-mono-all-400-normal.364ec368.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-400-normal.woff2":"./roboto-mono-cyrillic-400-normal.638e826e.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-greek-400-normal.woff2":"./roboto-mono-greek-400-normal.dd843e41.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-vietnamese-400-normal.woff2":"./roboto-mono-vietnamese-400-normal.306e7635.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-ext-400-normal.woff2":"./roboto-mono-latin-ext-400-normal.d9409874.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-400-normal.woff2":"./roboto-mono-latin-400-normal.cf1eee5f.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-ext-400-italic.woff2":"./roboto-mono-cyrillic-ext-400-italic.db052448.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-all-400-italic.woff":"./roboto-mono-all-400-italic.31a14f53.woff",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-cyrillic-400-italic.woff2":"./roboto-mono-cyrillic-400-italic.e399ed93.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-greek-400-italic.woff2":"./roboto-mono-greek-400-italic.6f7e0b2f.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-vietnamese-400-italic.woff2":"./roboto-mono-vietnamese-400-italic.d8e0a32a.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-ext-400-italic.woff2":"./roboto-mono-latin-ext-400-italic.aaa9a959.woff2",".parcel-cache/.net/https/cdn.jsdelivr.net/npm/@fontsource/roboto-mono@4.4.5/files/roboto-mono-latin-400-italic.woff2":"./roboto-mono-latin-400-italic.ef82d48f.woff2","hide-ui.css":"./editor.9fb5a9e0.css","binder.css":"./editor.347234ef.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/copy-outline.svg":"./copy-outline.0f561529.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/download-outline.svg":"./download-outline.523a74d8.svg","treeview.css":"./editor.e3402eb2.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/caret-down-outline.svg":"./caret-down-outline.4253a2fe.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/caret-forward-outline.svg":"./caret-forward-outline.348a84b6.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ellipsis-vertical.svg":"./ellipsis-vertical.a30e7430.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ellipsis-horizontal.svg":"./ellipsis-horizontal.c9a6cc29.svg","highlightjs.css":"./editor.e82e08bd.css","editor.js":"./editor.40c84c82.js",".parcel-cache/.net/https/www.gstatic.com/firebasejs/9.3.0/firebase-app.js":"./firebase-app.42556901.js",".parcel-cache/.net/https/www.gstatic.com/firebasejs/9.3.0/firebase-firestore.js":"./firebase-firestore.fc4ff51d.js",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/arrow-up-circle-outline.svg":"./arrow-up-circle-outline.3f146ffe.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/help-circle-outline.svg":"./help-circle-outline.a023036a.svg",".parcel-cache/.net/https/unpkg.com/vmsg@0.4.0/vmsg.wasm":"./vmsg.56bb9389.wasm","warn_old_browsers.js":"./editor.b9f0ac7b.js","index.html":"./index.html","index.css":"./index.a1ed246a.css",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/close-circle.svg":"./close-circle.d0f6eac6.svg",".parcel-cache/.net/https/cdn.jsdelivr.net/gh/ionic-team/ionicons@5.5.1/src/svg/ellipsis-horizontal-outline.svg":"./ellipsis-horizontal-outline.abb6e818.svg","index.js":"./index.efce06d6.js","error.jl.html":"./error.jl.html","sample.html":"./sample.html"} \ No newline at end of file diff --git a/frontend-dist/radio-button-on-outline.778acac1.svg b/frontend-dist/radio-button-on-outline.778acac1.svg new file mode 100644 index 0000000000..061b534687 --- /dev/null +++ b/frontend-dist/radio-button-on-outline.778acac1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/roboto-mono-all-400-italic.31a14f53.woff b/frontend-dist/roboto-mono-all-400-italic.31a14f53.woff new file mode 100644 index 0000000000..723ffe83fc Binary files /dev/null and b/frontend-dist/roboto-mono-all-400-italic.31a14f53.woff differ diff --git a/frontend-dist/roboto-mono-all-400-normal.364ec368.woff b/frontend-dist/roboto-mono-all-400-normal.364ec368.woff new file mode 100644 index 0000000000..379f9ae197 Binary files /dev/null and b/frontend-dist/roboto-mono-all-400-normal.364ec368.woff differ diff --git a/frontend-dist/roboto-mono-all-500-normal.cc559149.woff b/frontend-dist/roboto-mono-all-500-normal.cc559149.woff new file mode 100644 index 0000000000..6fc0cbe59e Binary files /dev/null and b/frontend-dist/roboto-mono-all-500-normal.cc559149.woff differ diff --git a/frontend-dist/roboto-mono-all-700-normal.393c796d.woff b/frontend-dist/roboto-mono-all-700-normal.393c796d.woff new file mode 100644 index 0000000000..bd2a43d0aa Binary files /dev/null and b/frontend-dist/roboto-mono-all-700-normal.393c796d.woff differ diff --git a/frontend-dist/roboto-mono-cyrillic-400-italic.e399ed93.woff2 b/frontend-dist/roboto-mono-cyrillic-400-italic.e399ed93.woff2 new file mode 100644 index 0000000000..8695ed91d2 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-400-italic.e399ed93.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-400-normal.638e826e.woff2 b/frontend-dist/roboto-mono-cyrillic-400-normal.638e826e.woff2 new file mode 100644 index 0000000000..68b8a8dc8c Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-400-normal.638e826e.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-500-normal.8ed3add8.woff2 b/frontend-dist/roboto-mono-cyrillic-500-normal.8ed3add8.woff2 new file mode 100644 index 0000000000..c307876e05 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-500-normal.8ed3add8.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-700-normal.5e6410cf.woff2 b/frontend-dist/roboto-mono-cyrillic-700-normal.5e6410cf.woff2 new file mode 100644 index 0000000000..1967932dfe Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-700-normal.5e6410cf.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-ext-400-italic.db052448.woff2 b/frontend-dist/roboto-mono-cyrillic-ext-400-italic.db052448.woff2 new file mode 100644 index 0000000000..85a9f5b370 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-ext-400-italic.db052448.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2 b/frontend-dist/roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2 new file mode 100644 index 0000000000..1630ec9c56 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-ext-500-normal.d362a132.woff2 b/frontend-dist/roboto-mono-cyrillic-ext-500-normal.d362a132.woff2 new file mode 100644 index 0000000000..b34eed9747 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-ext-500-normal.d362a132.woff2 differ diff --git a/frontend-dist/roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2 b/frontend-dist/roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2 new file mode 100644 index 0000000000..a89f2e8413 Binary files /dev/null and b/frontend-dist/roboto-mono-cyrillic-ext-700-normal.5c7aabac.woff2 differ diff --git a/frontend-dist/roboto-mono-greek-400-italic.6f7e0b2f.woff2 b/frontend-dist/roboto-mono-greek-400-italic.6f7e0b2f.woff2 new file mode 100644 index 0000000000..7bab226ca5 Binary files /dev/null and b/frontend-dist/roboto-mono-greek-400-italic.6f7e0b2f.woff2 differ diff --git a/frontend-dist/roboto-mono-greek-400-normal.dd843e41.woff2 b/frontend-dist/roboto-mono-greek-400-normal.dd843e41.woff2 new file mode 100644 index 0000000000..466f9ec13f Binary files /dev/null and b/frontend-dist/roboto-mono-greek-400-normal.dd843e41.woff2 differ diff --git a/frontend-dist/roboto-mono-greek-500-normal.dd57b097.woff2 b/frontend-dist/roboto-mono-greek-500-normal.dd57b097.woff2 new file mode 100644 index 0000000000..72f600238f Binary files /dev/null and b/frontend-dist/roboto-mono-greek-500-normal.dd57b097.woff2 differ diff --git a/frontend-dist/roboto-mono-greek-700-normal.b101f80c.woff2 b/frontend-dist/roboto-mono-greek-700-normal.b101f80c.woff2 new file mode 100644 index 0000000000..9ab1293a88 Binary files /dev/null and b/frontend-dist/roboto-mono-greek-700-normal.b101f80c.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-400-italic.ef82d48f.woff2 b/frontend-dist/roboto-mono-latin-400-italic.ef82d48f.woff2 new file mode 100644 index 0000000000..721ca2e93a Binary files /dev/null and b/frontend-dist/roboto-mono-latin-400-italic.ef82d48f.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-400-normal.cf1eee5f.woff2 b/frontend-dist/roboto-mono-latin-400-normal.cf1eee5f.woff2 new file mode 100644 index 0000000000..ed384d22fd Binary files /dev/null and b/frontend-dist/roboto-mono-latin-400-normal.cf1eee5f.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-500-normal.98ad1d4e.woff2 b/frontend-dist/roboto-mono-latin-500-normal.98ad1d4e.woff2 new file mode 100644 index 0000000000..01b58ed2c5 Binary files /dev/null and b/frontend-dist/roboto-mono-latin-500-normal.98ad1d4e.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-700-normal.447ac127.woff2 b/frontend-dist/roboto-mono-latin-700-normal.447ac127.woff2 new file mode 100644 index 0000000000..c89a6eb38c Binary files /dev/null and b/frontend-dist/roboto-mono-latin-700-normal.447ac127.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-ext-400-italic.aaa9a959.woff2 b/frontend-dist/roboto-mono-latin-ext-400-italic.aaa9a959.woff2 new file mode 100644 index 0000000000..9831c28b9e Binary files /dev/null and b/frontend-dist/roboto-mono-latin-ext-400-italic.aaa9a959.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-ext-400-normal.d9409874.woff2 b/frontend-dist/roboto-mono-latin-ext-400-normal.d9409874.woff2 new file mode 100644 index 0000000000..d4f9a09cca Binary files /dev/null and b/frontend-dist/roboto-mono-latin-ext-400-normal.d9409874.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-ext-500-normal.415f7d14.woff2 b/frontend-dist/roboto-mono-latin-ext-500-normal.415f7d14.woff2 new file mode 100644 index 0000000000..77a97cf73e Binary files /dev/null and b/frontend-dist/roboto-mono-latin-ext-500-normal.415f7d14.woff2 differ diff --git a/frontend-dist/roboto-mono-latin-ext-700-normal.c497b002.woff2 b/frontend-dist/roboto-mono-latin-ext-700-normal.c497b002.woff2 new file mode 100644 index 0000000000..9b733dd3cc Binary files /dev/null and b/frontend-dist/roboto-mono-latin-ext-700-normal.c497b002.woff2 differ diff --git a/frontend-dist/roboto-mono-vietnamese-400-italic.d8e0a32a.woff2 b/frontend-dist/roboto-mono-vietnamese-400-italic.d8e0a32a.woff2 new file mode 100644 index 0000000000..2ec55df09d Binary files /dev/null and b/frontend-dist/roboto-mono-vietnamese-400-italic.d8e0a32a.woff2 differ diff --git a/frontend-dist/roboto-mono-vietnamese-400-normal.306e7635.woff2 b/frontend-dist/roboto-mono-vietnamese-400-normal.306e7635.woff2 new file mode 100644 index 0000000000..2cf6dfc420 Binary files /dev/null and b/frontend-dist/roboto-mono-vietnamese-400-normal.306e7635.woff2 differ diff --git a/frontend-dist/roboto-mono-vietnamese-500-normal.1320bb60.woff2 b/frontend-dist/roboto-mono-vietnamese-500-normal.1320bb60.woff2 new file mode 100644 index 0000000000..3ab766e250 Binary files /dev/null and b/frontend-dist/roboto-mono-vietnamese-500-normal.1320bb60.woff2 differ diff --git a/frontend-dist/roboto-mono-vietnamese-700-normal.edb1435b.woff2 b/frontend-dist/roboto-mono-vietnamese-700-normal.edb1435b.woff2 new file mode 100644 index 0000000000..12357bd521 Binary files /dev/null and b/frontend-dist/roboto-mono-vietnamese-700-normal.edb1435b.woff2 differ diff --git a/frontend-dist/sample.html b/frontend-dist/sample.html new file mode 100644 index 0000000000..4b67e82c89 --- /dev/null +++ b/frontend-dist/sample.html @@ -0,0 +1 @@ +⚡ Pluto.jl ⚡

    welcome to

    Samples:


    \ No newline at end of file diff --git a/frontend-dist/shapes-outline.76567c1b.svg b/frontend-dist/shapes-outline.76567c1b.svg new file mode 100644 index 0000000000..3b115ca667 --- /dev/null +++ b/frontend-dist/shapes-outline.76567c1b.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/stop-circle-outline.6623356d.svg b/frontend-dist/stop-circle-outline.6623356d.svg new file mode 100644 index 0000000000..30addb7f98 --- /dev/null +++ b/frontend-dist/stop-circle-outline.6623356d.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/sync-circle-outline.65b15d76.svg b/frontend-dist/sync-circle-outline.65b15d76.svg new file mode 100644 index 0000000000..3b41a36e9b --- /dev/null +++ b/frontend-dist/sync-circle-outline.65b15d76.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/sync-outline.9a1bd27b.svg b/frontend-dist/sync-outline.9a1bd27b.svg new file mode 100644 index 0000000000..9f69e76f35 --- /dev/null +++ b/frontend-dist/sync-outline.9a1bd27b.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/time-outline.7c1877f0.svg b/frontend-dist/time-outline.7c1877f0.svg new file mode 100644 index 0000000000..b4d1371332 --- /dev/null +++ b/frontend-dist/time-outline.7c1877f0.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/vmsg.56bb9389.wasm b/frontend-dist/vmsg.56bb9389.wasm new file mode 100644 index 0000000000..224bcc7fd1 Binary files /dev/null and b/frontend-dist/vmsg.56bb9389.wasm differ diff --git a/frontend-dist/vollkorn.089565a8.css b/frontend-dist/vollkorn.089565a8.css new file mode 100644 index 0000000000..83907db83a --- /dev/null +++ b/frontend-dist/vollkorn.089565a8.css @@ -0,0 +1 @@ +@font-face{font-display:swap;font-family:Vollkorn;font-weight:600;src:url(Vollkorn-SemiBold.8072eb6c.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-style:italic;font-weight:600;src:url(Vollkorn-SemiBoldItalic.5c3cd265.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-weight:700;src:url(Vollkorn-Bold.6e1feb70.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-style:italic;font-weight:700;src:url(Vollkorn-BoldItalic.a48ab300.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-weight:900;src:url(Vollkorn-Black.0ebdfbf5.woff2) format("woff2")}@font-face{font-display:swap;font-family:Vollkorn;font-style:italic;font-weight:900;src:url(Vollkorn-BlackItalic.4095acfe.woff2) format("woff2")} \ No newline at end of file