diff --git a/frontend-dist/Inter-Black.woff.a3efb88f6f.efe3f25b.woff b/frontend-dist/Inter-Black.woff.a3efb88f6f.efe3f25b.woff new file mode 100644 index 000000000..8fd1bd531 Binary files /dev/null and b/frontend-dist/Inter-Black.woff.a3efb88f6f.efe3f25b.woff differ diff --git a/frontend-dist/Inter-Black.woff2.a3efb88f6f.1f333c9f.woff2 b/frontend-dist/Inter-Black.woff2.a3efb88f6f.1f333c9f.woff2 new file mode 100644 index 000000000..c354e6390 Binary files /dev/null and b/frontend-dist/Inter-Black.woff2.a3efb88f6f.1f333c9f.woff2 differ diff --git a/frontend-dist/Inter-BlackItalic.woff.a3efb88f6f.f6e2e726.woff b/frontend-dist/Inter-BlackItalic.woff.a3efb88f6f.f6e2e726.woff new file mode 100644 index 000000000..be6a45bcf Binary files /dev/null and b/frontend-dist/Inter-BlackItalic.woff.a3efb88f6f.f6e2e726.woff differ diff --git a/frontend-dist/Inter-BlackItalic.woff2.a3efb88f6f.89710fff.woff2 b/frontend-dist/Inter-BlackItalic.woff2.a3efb88f6f.89710fff.woff2 new file mode 100644 index 000000000..8b2efe952 Binary files /dev/null and b/frontend-dist/Inter-BlackItalic.woff2.a3efb88f6f.89710fff.woff2 differ diff --git a/frontend-dist/Inter-Bold.woff.a3efb88f6f.d92ed350.woff b/frontend-dist/Inter-Bold.woff.a3efb88f6f.d92ed350.woff new file mode 100644 index 000000000..b5221b0e8 Binary files /dev/null and b/frontend-dist/Inter-Bold.woff.a3efb88f6f.d92ed350.woff differ diff --git a/frontend-dist/Inter-Bold.woff2.a3efb88f6f.e8bd971d.woff2 b/frontend-dist/Inter-Bold.woff2.a3efb88f6f.e8bd971d.woff2 new file mode 100644 index 000000000..619c3a741 Binary files /dev/null and b/frontend-dist/Inter-Bold.woff2.a3efb88f6f.e8bd971d.woff2 differ diff --git a/frontend-dist/Inter-BoldItalic.woff.a3efb88f6f.39f68e5f.woff b/frontend-dist/Inter-BoldItalic.woff.a3efb88f6f.39f68e5f.woff new file mode 100644 index 000000000..da912559e Binary files /dev/null and b/frontend-dist/Inter-BoldItalic.woff.a3efb88f6f.39f68e5f.woff differ diff --git a/frontend-dist/Inter-BoldItalic.woff2.a3efb88f6f.cd6e580e.woff2 b/frontend-dist/Inter-BoldItalic.woff2.a3efb88f6f.cd6e580e.woff2 new file mode 100644 index 000000000..4022cc8d9 Binary files /dev/null and b/frontend-dist/Inter-BoldItalic.woff2.a3efb88f6f.cd6e580e.woff2 differ diff --git a/frontend-dist/Inter-ExtraBold.woff.a3efb88f6f.cd51bf91.woff b/frontend-dist/Inter-ExtraBold.woff.a3efb88f6f.cd51bf91.woff new file mode 100644 index 000000000..7221d72ef Binary files /dev/null and b/frontend-dist/Inter-ExtraBold.woff.a3efb88f6f.cd51bf91.woff differ diff --git a/frontend-dist/Inter-ExtraBold.woff2.a3efb88f6f.ffc04ff0.woff2 b/frontend-dist/Inter-ExtraBold.woff2.a3efb88f6f.ffc04ff0.woff2 new file mode 100644 index 000000000..d3d23b43e Binary files /dev/null and b/frontend-dist/Inter-ExtraBold.woff2.a3efb88f6f.ffc04ff0.woff2 differ diff --git a/frontend-dist/Inter-ExtraBoldItalic.woff.a3efb88f6f.122106d3.woff b/frontend-dist/Inter-ExtraBoldItalic.woff.a3efb88f6f.122106d3.woff new file mode 100644 index 000000000..8520a3185 Binary files /dev/null and b/frontend-dist/Inter-ExtraBoldItalic.woff.a3efb88f6f.122106d3.woff differ diff --git a/frontend-dist/Inter-ExtraBoldItalic.woff2.a3efb88f6f.de4f3979.woff2 b/frontend-dist/Inter-ExtraBoldItalic.woff2.a3efb88f6f.de4f3979.woff2 new file mode 100644 index 000000000..863748b2e Binary files /dev/null and b/frontend-dist/Inter-ExtraBoldItalic.woff2.a3efb88f6f.de4f3979.woff2 differ diff --git a/frontend-dist/Inter-ExtraLight.woff.a3efb88f6f.018d6d24.woff b/frontend-dist/Inter-ExtraLight.woff.a3efb88f6f.018d6d24.woff new file mode 100644 index 000000000..559044109 Binary files /dev/null and b/frontend-dist/Inter-ExtraLight.woff.a3efb88f6f.018d6d24.woff differ diff --git a/frontend-dist/Inter-ExtraLight.woff2.a3efb88f6f.735b820a.woff2 b/frontend-dist/Inter-ExtraLight.woff2.a3efb88f6f.735b820a.woff2 new file mode 100644 index 000000000..7cb6e49fb Binary files /dev/null and b/frontend-dist/Inter-ExtraLight.woff2.a3efb88f6f.735b820a.woff2 differ diff --git a/frontend-dist/Inter-ExtraLightItalic.woff.a3efb88f6f.c051c5b4.woff b/frontend-dist/Inter-ExtraLightItalic.woff.a3efb88f6f.c051c5b4.woff new file mode 100644 index 000000000..0a9f00de8 Binary files /dev/null and b/frontend-dist/Inter-ExtraLightItalic.woff.a3efb88f6f.c051c5b4.woff differ diff --git a/frontend-dist/Inter-ExtraLightItalic.woff2.a3efb88f6f.75944d4e.woff2 b/frontend-dist/Inter-ExtraLightItalic.woff2.a3efb88f6f.75944d4e.woff2 new file mode 100644 index 000000000..e63644200 Binary files /dev/null and b/frontend-dist/Inter-ExtraLightItalic.woff2.a3efb88f6f.75944d4e.woff2 differ diff --git a/frontend-dist/Inter-Italic.woff.a3efb88f6f.d9effa31.woff b/frontend-dist/Inter-Italic.woff.a3efb88f6f.d9effa31.woff new file mode 100644 index 000000000..f2c424804 Binary files /dev/null and b/frontend-dist/Inter-Italic.woff.a3efb88f6f.d9effa31.woff differ diff --git a/frontend-dist/Inter-Italic.woff2.a3efb88f6f.85eee0c1.woff2 b/frontend-dist/Inter-Italic.woff2.a3efb88f6f.85eee0c1.woff2 new file mode 100644 index 000000000..b749909b0 Binary files /dev/null and b/frontend-dist/Inter-Italic.woff2.a3efb88f6f.85eee0c1.woff2 differ diff --git a/frontend-dist/Inter-Light.woff.a3efb88f6f.0cf765a1.woff b/frontend-dist/Inter-Light.woff.a3efb88f6f.0cf765a1.woff new file mode 100644 index 000000000..15672799e Binary files /dev/null and b/frontend-dist/Inter-Light.woff.a3efb88f6f.0cf765a1.woff differ diff --git a/frontend-dist/Inter-Light.woff2.a3efb88f6f.f86a8a97.woff2 b/frontend-dist/Inter-Light.woff2.a3efb88f6f.f86a8a97.woff2 new file mode 100644 index 000000000..ac2e1275e Binary files /dev/null and b/frontend-dist/Inter-Light.woff2.a3efb88f6f.f86a8a97.woff2 differ diff --git a/frontend-dist/Inter-LightItalic.woff.a3efb88f6f.6c91af65.woff b/frontend-dist/Inter-LightItalic.woff.a3efb88f6f.6c91af65.woff new file mode 100644 index 000000000..ebbb05b38 Binary files /dev/null and b/frontend-dist/Inter-LightItalic.woff.a3efb88f6f.6c91af65.woff differ diff --git a/frontend-dist/Inter-LightItalic.woff2.a3efb88f6f.cb22faff.woff2 b/frontend-dist/Inter-LightItalic.woff2.a3efb88f6f.cb22faff.woff2 new file mode 100644 index 000000000..d51474ca1 Binary files /dev/null and b/frontend-dist/Inter-LightItalic.woff2.a3efb88f6f.cb22faff.woff2 differ diff --git a/frontend-dist/Inter-Medium.woff.a3efb88f6f.cb391d89.woff b/frontend-dist/Inter-Medium.woff.a3efb88f6f.cb391d89.woff new file mode 100644 index 000000000..dac813a74 Binary files /dev/null and b/frontend-dist/Inter-Medium.woff.a3efb88f6f.cb391d89.woff differ diff --git a/frontend-dist/Inter-Medium.woff2.a3efb88f6f.4f0ea984.woff2 b/frontend-dist/Inter-Medium.woff2.a3efb88f6f.4f0ea984.woff2 new file mode 100644 index 000000000..ab9850258 Binary files /dev/null and b/frontend-dist/Inter-Medium.woff2.a3efb88f6f.4f0ea984.woff2 differ diff --git a/frontend-dist/Inter-MediumItalic.woff.a3efb88f6f.1f636c25.woff b/frontend-dist/Inter-MediumItalic.woff.a3efb88f6f.1f636c25.woff new file mode 100644 index 000000000..ae6e45fe3 Binary files /dev/null and b/frontend-dist/Inter-MediumItalic.woff.a3efb88f6f.1f636c25.woff differ diff --git a/frontend-dist/Inter-MediumItalic.woff2.a3efb88f6f.2b734b7a.woff2 b/frontend-dist/Inter-MediumItalic.woff2.a3efb88f6f.2b734b7a.woff2 new file mode 100644 index 000000000..ceb866e42 Binary files /dev/null and b/frontend-dist/Inter-MediumItalic.woff2.a3efb88f6f.2b734b7a.woff2 differ diff --git a/frontend-dist/Inter-Regular.woff.a3efb88f6f.d9325c13.woff b/frontend-dist/Inter-Regular.woff.a3efb88f6f.d9325c13.woff new file mode 100644 index 000000000..e3200e0b9 Binary files /dev/null and b/frontend-dist/Inter-Regular.woff.a3efb88f6f.d9325c13.woff differ diff --git a/frontend-dist/Inter-Regular.woff2.a3efb88f6f.c52a047f.woff2 b/frontend-dist/Inter-Regular.woff2.a3efb88f6f.c52a047f.woff2 new file mode 100644 index 000000000..28ae0b6ab Binary files /dev/null and b/frontend-dist/Inter-Regular.woff2.a3efb88f6f.c52a047f.woff2 differ diff --git a/frontend-dist/Inter-SemiBold.woff.a3efb88f6f.c6670c13.woff b/frontend-dist/Inter-SemiBold.woff.a3efb88f6f.c6670c13.woff new file mode 100644 index 000000000..295fbdfa9 Binary files /dev/null and b/frontend-dist/Inter-SemiBold.woff.a3efb88f6f.c6670c13.woff differ diff --git a/frontend-dist/Inter-SemiBold.woff2.a3efb88f6f.08366574.woff2 b/frontend-dist/Inter-SemiBold.woff2.a3efb88f6f.08366574.woff2 new file mode 100644 index 000000000..41ebbbb02 Binary files /dev/null and b/frontend-dist/Inter-SemiBold.woff2.a3efb88f6f.08366574.woff2 differ diff --git a/frontend-dist/Inter-SemiBoldItalic.woff.a3efb88f6f.13394743.woff b/frontend-dist/Inter-SemiBoldItalic.woff.a3efb88f6f.13394743.woff new file mode 100644 index 000000000..34d759f72 Binary files /dev/null and b/frontend-dist/Inter-SemiBoldItalic.woff.a3efb88f6f.13394743.woff differ diff --git a/frontend-dist/Inter-SemiBoldItalic.woff2.a3efb88f6f.5c7db07d.woff2 b/frontend-dist/Inter-SemiBoldItalic.woff2.a3efb88f6f.5c7db07d.woff2 new file mode 100644 index 000000000..4dd025adf Binary files /dev/null and b/frontend-dist/Inter-SemiBoldItalic.woff2.a3efb88f6f.5c7db07d.woff2 differ diff --git a/frontend-dist/Inter-Thin.woff.a3efb88f6f.832f7e9d.woff b/frontend-dist/Inter-Thin.woff.a3efb88f6f.832f7e9d.woff new file mode 100644 index 000000000..07ea92efb Binary files /dev/null and b/frontend-dist/Inter-Thin.woff.a3efb88f6f.832f7e9d.woff differ diff --git a/frontend-dist/Inter-Thin.woff2.a3efb88f6f.099a7dc1.woff2 b/frontend-dist/Inter-Thin.woff2.a3efb88f6f.099a7dc1.woff2 new file mode 100644 index 000000000..72707dcd3 Binary files /dev/null and b/frontend-dist/Inter-Thin.woff2.a3efb88f6f.099a7dc1.woff2 differ diff --git a/frontend-dist/Inter-ThinItalic.woff.a3efb88f6f.9a9e646f.woff b/frontend-dist/Inter-ThinItalic.woff.a3efb88f6f.9a9e646f.woff new file mode 100644 index 000000000..d35d6173c Binary files /dev/null and b/frontend-dist/Inter-ThinItalic.woff.a3efb88f6f.9a9e646f.woff differ diff --git a/frontend-dist/Inter-ThinItalic.woff2.a3efb88f6f.f5b32cfe.woff2 b/frontend-dist/Inter-ThinItalic.woff2.a3efb88f6f.f5b32cfe.woff2 new file mode 100644 index 000000000..884fe458c Binary files /dev/null and b/frontend-dist/Inter-ThinItalic.woff2.a3efb88f6f.f5b32cfe.woff2 differ diff --git a/frontend-dist/Inter-italic.var.woff2.a3efb88f6f.e62a3bb2.woff2 b/frontend-dist/Inter-italic.var.woff2.a3efb88f6f.e62a3bb2.woff2 new file mode 100644 index 000000000..b1d4bdc36 Binary files /dev/null and b/frontend-dist/Inter-italic.var.woff2.a3efb88f6f.e62a3bb2.woff2 differ diff --git a/frontend-dist/Inter-roman.var.woff2.a3efb88f6f.8120837c.woff2 b/frontend-dist/Inter-roman.var.woff2.a3efb88f6f.8120837c.woff2 new file mode 100644 index 000000000..f56c09796 Binary files /dev/null and b/frontend-dist/Inter-roman.var.woff2.a3efb88f6f.8120837c.woff2 differ diff --git a/frontend-dist/Inter.var.woff2.a3efb88f6f.ca82f9aa.woff2 b/frontend-dist/Inter.var.woff2.a3efb88f6f.ca82f9aa.woff2 new file mode 100644 index 000000000..0c4143192 Binary files /dev/null and b/frontend-dist/Inter.var.woff2.a3efb88f6f.ca82f9aa.woff2 differ diff --git a/frontend-dist/JuliaMono-Bold.24b57d33.woff2 b/frontend-dist/JuliaMono-Bold.24b57d33.woff2 new file mode 100644 index 000000000..212ccec35 Binary files /dev/null and b/frontend-dist/JuliaMono-Bold.24b57d33.woff2 differ diff --git a/frontend-dist/JuliaMono-BoldLatin.7ec5c608.woff2 b/frontend-dist/JuliaMono-BoldLatin.7ec5c608.woff2 new file mode 100644 index 000000000..1f8dde89e Binary files /dev/null and b/frontend-dist/JuliaMono-BoldLatin.7ec5c608.woff2 differ diff --git a/frontend-dist/JuliaMono-Regular.e0106c6f.woff2 b/frontend-dist/JuliaMono-Regular.e0106c6f.woff2 new file mode 100644 index 000000000..c2db12737 Binary files /dev/null and b/frontend-dist/JuliaMono-Regular.e0106c6f.woff2 differ diff --git a/frontend-dist/JuliaMono-RegularItalic.3159f647.woff2 b/frontend-dist/JuliaMono-RegularItalic.3159f647.woff2 new file mode 100644 index 000000000..987502fed Binary files /dev/null and b/frontend-dist/JuliaMono-RegularItalic.3159f647.woff2 differ diff --git a/frontend-dist/JuliaMono-RegularLatin.26c56b70.woff2 b/frontend-dist/JuliaMono-RegularLatin.26c56b70.woff2 new file mode 100644 index 000000000..f159a9285 Binary files /dev/null and b/frontend-dist/JuliaMono-RegularLatin.26c56b70.woff2 differ diff --git a/frontend-dist/Vollkorn-Black.0ebdfbf5.woff2 b/frontend-dist/Vollkorn-Black.0ebdfbf5.woff2 new file mode 100644 index 000000000..b51a37a40 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 000000000..bb2e060ce 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 000000000..cfb12e152 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 000000000..23d7a6c84 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 000000000..78b781055 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 000000000..2162ab8ef 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 000000000..7c7fb1487 --- /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-cyrillic-400-italic.3566c50a.woff2 b/frontend-dist/alegreya-sans-cyrillic-400-italic.3566c50a.woff2 new file mode 100644 index 000000000..2ade9196b Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-400-italic.3566c50a.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-400-italic.7b502436.woff b/frontend-dist/alegreya-sans-cyrillic-400-italic.7b502436.woff new file mode 100644 index 000000000..de6a851ed Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-400-italic.7b502436.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-400-normal.7ad0b60c.woff2 b/frontend-dist/alegreya-sans-cyrillic-400-normal.7ad0b60c.woff2 new file mode 100644 index 000000000..8828ddb7b Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-400-normal.7ad0b60c.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-400-normal.b3abccdf.woff b/frontend-dist/alegreya-sans-cyrillic-400-normal.b3abccdf.woff new file mode 100644 index 000000000..546400ff9 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-400-normal.b3abccdf.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-500-italic.2b0c87f4.woff2 b/frontend-dist/alegreya-sans-cyrillic-500-italic.2b0c87f4.woff2 new file mode 100644 index 000000000..816ac2281 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-500-italic.2b0c87f4.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-500-italic.4e7fb286.woff b/frontend-dist/alegreya-sans-cyrillic-500-italic.4e7fb286.woff new file mode 100644 index 000000000..370880e5e Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-500-italic.4e7fb286.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-500-normal.6cecb852.woff b/frontend-dist/alegreya-sans-cyrillic-500-normal.6cecb852.woff new file mode 100644 index 000000000..74a86b84d Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-500-normal.6cecb852.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-500-normal.74695d4e.woff2 b/frontend-dist/alegreya-sans-cyrillic-500-normal.74695d4e.woff2 new file mode 100644 index 000000000..b7e18bb25 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-500-normal.74695d4e.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-700-italic.adee9304.woff b/frontend-dist/alegreya-sans-cyrillic-700-italic.adee9304.woff new file mode 100644 index 000000000..5de669adc Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-700-italic.adee9304.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-700-italic.d815e736.woff2 b/frontend-dist/alegreya-sans-cyrillic-700-italic.d815e736.woff2 new file mode 100644 index 000000000..0f2432ffb Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-700-italic.d815e736.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-700-normal.04091397.woff b/frontend-dist/alegreya-sans-cyrillic-700-normal.04091397.woff new file mode 100644 index 000000000..0ef54eab6 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-700-normal.04091397.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-700-normal.59783bb9.woff2 b/frontend-dist/alegreya-sans-cyrillic-700-normal.59783bb9.woff2 new file mode 100644 index 000000000..6c55f17dc Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-700-normal.59783bb9.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.2084dbe9.woff b/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.2084dbe9.woff new file mode 100644 index 000000000..6a108c5b2 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.2084dbe9.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.bd939e0f.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.bd939e0f.woff2 new file mode 100644 index 000000000..161ff0621 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-400-italic.bd939e0f.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.55e5afa4.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.55e5afa4.woff2 new file mode 100644 index 000000000..e92349775 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.55e5afa4.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.e5ff22a5.woff b/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.e5ff22a5.woff new file mode 100644 index 000000000..b8fe91e40 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-400-normal.e5ff22a5.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.228ebc5f.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.228ebc5f.woff2 new file mode 100644 index 000000000..a57171ddd Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.228ebc5f.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.e76d3c34.woff b/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.e76d3c34.woff new file mode 100644 index 000000000..0805e0ace Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-500-italic.e76d3c34.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.7a8f66ad.woff b/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.7a8f66ad.woff new file mode 100644 index 000000000..81b508738 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.7a8f66ad.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.e6a10a6f.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.e6a10a6f.woff2 new file mode 100644 index 000000000..07f70f216 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-500-normal.e6a10a6f.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.027a1147.woff b/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.027a1147.woff new file mode 100644 index 000000000..f81cfa1c6 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.027a1147.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.081c5a3b.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.081c5a3b.woff2 new file mode 100644 index 000000000..19db51284 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-700-italic.081c5a3b.woff2 differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.54d4ed38.woff b/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.54d4ed38.woff new file mode 100644 index 000000000..1582e1147 Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.54d4ed38.woff differ diff --git a/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.d29cb5c7.woff2 b/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.d29cb5c7.woff2 new file mode 100644 index 000000000..cdc68386b Binary files /dev/null and b/frontend-dist/alegreya-sans-cyrillic-ext-700-normal.d29cb5c7.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-400-italic.698a3225.woff2 b/frontend-dist/alegreya-sans-greek-400-italic.698a3225.woff2 new file mode 100644 index 000000000..cfd23bdaf Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-400-italic.698a3225.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-400-italic.a0d1d107.woff b/frontend-dist/alegreya-sans-greek-400-italic.a0d1d107.woff new file mode 100644 index 000000000..ed828fe03 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-400-italic.a0d1d107.woff differ diff --git a/frontend-dist/alegreya-sans-greek-400-normal.02c3b443.woff b/frontend-dist/alegreya-sans-greek-400-normal.02c3b443.woff new file mode 100644 index 000000000..ee05ba579 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-400-normal.02c3b443.woff differ diff --git a/frontend-dist/alegreya-sans-greek-400-normal.5c283724.woff2 b/frontend-dist/alegreya-sans-greek-400-normal.5c283724.woff2 new file mode 100644 index 000000000..8c82c32f9 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-400-normal.5c283724.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-500-italic.731402fe.woff2 b/frontend-dist/alegreya-sans-greek-500-italic.731402fe.woff2 new file mode 100644 index 000000000..d068a9429 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-500-italic.731402fe.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-500-italic.e7f1407d.woff b/frontend-dist/alegreya-sans-greek-500-italic.e7f1407d.woff new file mode 100644 index 000000000..ba00cdc2d Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-500-italic.e7f1407d.woff differ diff --git a/frontend-dist/alegreya-sans-greek-500-normal.4fe45dc3.woff2 b/frontend-dist/alegreya-sans-greek-500-normal.4fe45dc3.woff2 new file mode 100644 index 000000000..f640d0e95 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-500-normal.4fe45dc3.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-500-normal.6e74adef.woff b/frontend-dist/alegreya-sans-greek-500-normal.6e74adef.woff new file mode 100644 index 000000000..bd18e1dbd Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-500-normal.6e74adef.woff differ diff --git a/frontend-dist/alegreya-sans-greek-700-italic.054fd57c.woff b/frontend-dist/alegreya-sans-greek-700-italic.054fd57c.woff new file mode 100644 index 000000000..57ae8534a Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-700-italic.054fd57c.woff differ diff --git a/frontend-dist/alegreya-sans-greek-700-italic.7966e94d.woff2 b/frontend-dist/alegreya-sans-greek-700-italic.7966e94d.woff2 new file mode 100644 index 000000000..b7506623c Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-700-italic.7966e94d.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-700-normal.8306abb5.woff b/frontend-dist/alegreya-sans-greek-700-normal.8306abb5.woff new file mode 100644 index 000000000..c3379d11f Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-700-normal.8306abb5.woff differ diff --git a/frontend-dist/alegreya-sans-greek-700-normal.ad68df15.woff2 b/frontend-dist/alegreya-sans-greek-700-normal.ad68df15.woff2 new file mode 100644 index 000000000..289d51a17 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-700-normal.ad68df15.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-400-italic.61223683.woff b/frontend-dist/alegreya-sans-greek-ext-400-italic.61223683.woff new file mode 100644 index 000000000..0d79fa43a Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-400-italic.61223683.woff differ diff --git a/frontend-dist/alegreya-sans-greek-ext-400-italic.ae95a328.woff2 b/frontend-dist/alegreya-sans-greek-ext-400-italic.ae95a328.woff2 new file mode 100644 index 000000000..03c7b8442 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-400-italic.ae95a328.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-400-normal.532e031f.woff2 b/frontend-dist/alegreya-sans-greek-ext-400-normal.532e031f.woff2 new file mode 100644 index 000000000..8d5795ee5 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-400-normal.532e031f.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-400-normal.649d7068.woff b/frontend-dist/alegreya-sans-greek-ext-400-normal.649d7068.woff new file mode 100644 index 000000000..ad6f5eaa8 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-400-normal.649d7068.woff differ diff --git a/frontend-dist/alegreya-sans-greek-ext-500-italic.d86fb2ec.woff b/frontend-dist/alegreya-sans-greek-ext-500-italic.d86fb2ec.woff new file mode 100644 index 000000000..0457c379c Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-500-italic.d86fb2ec.woff differ diff --git a/frontend-dist/alegreya-sans-greek-ext-500-italic.e29cbb20.woff2 b/frontend-dist/alegreya-sans-greek-ext-500-italic.e29cbb20.woff2 new file mode 100644 index 000000000..0404ea83b Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-500-italic.e29cbb20.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-500-normal.7e2f002e.woff2 b/frontend-dist/alegreya-sans-greek-ext-500-normal.7e2f002e.woff2 new file mode 100644 index 000000000..0e33cf61b Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-500-normal.7e2f002e.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-500-normal.e5a8f936.woff b/frontend-dist/alegreya-sans-greek-ext-500-normal.e5a8f936.woff new file mode 100644 index 000000000..fb63a19d7 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-500-normal.e5a8f936.woff differ diff --git a/frontend-dist/alegreya-sans-greek-ext-700-italic.4e669d1d.woff2 b/frontend-dist/alegreya-sans-greek-ext-700-italic.4e669d1d.woff2 new file mode 100644 index 000000000..d38a9dfdc Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-700-italic.4e669d1d.woff2 differ diff --git a/frontend-dist/alegreya-sans-greek-ext-700-italic.f9328bc7.woff b/frontend-dist/alegreya-sans-greek-ext-700-italic.f9328bc7.woff new file mode 100644 index 000000000..af859f8b1 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-700-italic.f9328bc7.woff differ diff --git a/frontend-dist/alegreya-sans-greek-ext-700-normal.951af0e4.woff b/frontend-dist/alegreya-sans-greek-ext-700-normal.951af0e4.woff new file mode 100644 index 000000000..eae4e029a Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-700-normal.951af0e4.woff differ diff --git a/frontend-dist/alegreya-sans-greek-ext-700-normal.d6a165c3.woff2 b/frontend-dist/alegreya-sans-greek-ext-700-normal.d6a165c3.woff2 new file mode 100644 index 000000000..e514cd7f5 Binary files /dev/null and b/frontend-dist/alegreya-sans-greek-ext-700-normal.d6a165c3.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-400-italic.0d0d3a15.woff2 b/frontend-dist/alegreya-sans-latin-400-italic.0d0d3a15.woff2 new file mode 100644 index 000000000..57e161637 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-400-italic.0d0d3a15.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-400-italic.41a16bae.woff b/frontend-dist/alegreya-sans-latin-400-italic.41a16bae.woff new file mode 100644 index 000000000..15b76343c Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-400-italic.41a16bae.woff differ diff --git a/frontend-dist/alegreya-sans-latin-400-normal.c3cfb12f.woff2 b/frontend-dist/alegreya-sans-latin-400-normal.c3cfb12f.woff2 new file mode 100644 index 000000000..c005bcecc Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-400-normal.c3cfb12f.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-400-normal.d6a3a798.woff b/frontend-dist/alegreya-sans-latin-400-normal.d6a3a798.woff new file mode 100644 index 000000000..fcb2af16b Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-400-normal.d6a3a798.woff differ diff --git a/frontend-dist/alegreya-sans-latin-500-italic.154b3d65.woff b/frontend-dist/alegreya-sans-latin-500-italic.154b3d65.woff new file mode 100644 index 000000000..c823ae556 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-500-italic.154b3d65.woff differ diff --git a/frontend-dist/alegreya-sans-latin-500-italic.b258979c.woff2 b/frontend-dist/alegreya-sans-latin-500-italic.b258979c.woff2 new file mode 100644 index 000000000..466aa33d2 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-500-italic.b258979c.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-500-normal.265ecb58.woff b/frontend-dist/alegreya-sans-latin-500-normal.265ecb58.woff new file mode 100644 index 000000000..73a60c8d5 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-500-normal.265ecb58.woff differ diff --git a/frontend-dist/alegreya-sans-latin-500-normal.5c1a4322.woff2 b/frontend-dist/alegreya-sans-latin-500-normal.5c1a4322.woff2 new file mode 100644 index 000000000..e736abe6b Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-500-normal.5c1a4322.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-700-italic.828e096b.woff b/frontend-dist/alegreya-sans-latin-700-italic.828e096b.woff new file mode 100644 index 000000000..3c78ab7c5 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-700-italic.828e096b.woff differ diff --git a/frontend-dist/alegreya-sans-latin-700-italic.9e7bf2ae.woff2 b/frontend-dist/alegreya-sans-latin-700-italic.9e7bf2ae.woff2 new file mode 100644 index 000000000..e5971a12c Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-700-italic.9e7bf2ae.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-700-normal.2aecb91e.woff2 b/frontend-dist/alegreya-sans-latin-700-normal.2aecb91e.woff2 new file mode 100644 index 000000000..1bec6886b Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-700-normal.2aecb91e.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-700-normal.4a09eb35.woff b/frontend-dist/alegreya-sans-latin-700-normal.4a09eb35.woff new file mode 100644 index 000000000..7589fc074 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-700-normal.4a09eb35.woff differ diff --git a/frontend-dist/alegreya-sans-latin-ext-400-italic.34775b0f.woff2 b/frontend-dist/alegreya-sans-latin-ext-400-italic.34775b0f.woff2 new file mode 100644 index 000000000..262589f7c Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-400-italic.34775b0f.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-400-italic.8e9f5937.woff b/frontend-dist/alegreya-sans-latin-ext-400-italic.8e9f5937.woff new file mode 100644 index 000000000..d2afd1a56 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-400-italic.8e9f5937.woff differ diff --git a/frontend-dist/alegreya-sans-latin-ext-400-normal.065f6826.woff b/frontend-dist/alegreya-sans-latin-ext-400-normal.065f6826.woff new file mode 100644 index 000000000..e2eaf8422 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-400-normal.065f6826.woff differ diff --git a/frontend-dist/alegreya-sans-latin-ext-400-normal.b71a801c.woff2 b/frontend-dist/alegreya-sans-latin-ext-400-normal.b71a801c.woff2 new file mode 100644 index 000000000..0ffce608e Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-400-normal.b71a801c.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-500-italic.0e057840.woff b/frontend-dist/alegreya-sans-latin-ext-500-italic.0e057840.woff new file mode 100644 index 000000000..6de338021 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-500-italic.0e057840.woff differ diff --git a/frontend-dist/alegreya-sans-latin-ext-500-italic.bb5065e8.woff2 b/frontend-dist/alegreya-sans-latin-ext-500-italic.bb5065e8.woff2 new file mode 100644 index 000000000..73ddc49d5 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-500-italic.bb5065e8.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-500-normal.c8c38132.woff b/frontend-dist/alegreya-sans-latin-ext-500-normal.c8c38132.woff new file mode 100644 index 000000000..ffaf3a5a1 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-500-normal.c8c38132.woff differ diff --git a/frontend-dist/alegreya-sans-latin-ext-500-normal.dc4a0b57.woff2 b/frontend-dist/alegreya-sans-latin-ext-500-normal.dc4a0b57.woff2 new file mode 100644 index 000000000..3e4f6f490 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-500-normal.dc4a0b57.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-700-italic.b9a04ae4.woff2 b/frontend-dist/alegreya-sans-latin-ext-700-italic.b9a04ae4.woff2 new file mode 100644 index 000000000..5609ea2cf Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-700-italic.b9a04ae4.woff2 differ diff --git a/frontend-dist/alegreya-sans-latin-ext-700-italic.f6294451.woff b/frontend-dist/alegreya-sans-latin-ext-700-italic.f6294451.woff new file mode 100644 index 000000000..205dba1c9 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-700-italic.f6294451.woff differ diff --git a/frontend-dist/alegreya-sans-latin-ext-700-normal.136a6e5c.woff b/frontend-dist/alegreya-sans-latin-ext-700-normal.136a6e5c.woff new file mode 100644 index 000000000..d31d4b41b Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-700-normal.136a6e5c.woff differ diff --git a/frontend-dist/alegreya-sans-latin-ext-700-normal.cf32efba.woff2 b/frontend-dist/alegreya-sans-latin-ext-700-normal.cf32efba.woff2 new file mode 100644 index 000000000..feeb6d862 Binary files /dev/null and b/frontend-dist/alegreya-sans-latin-ext-700-normal.cf32efba.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-400-italic.0b633f42.woff2 b/frontend-dist/alegreya-sans-vietnamese-400-italic.0b633f42.woff2 new file mode 100644 index 000000000..db439b66a Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-400-italic.0b633f42.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-400-italic.abc8a91e.woff b/frontend-dist/alegreya-sans-vietnamese-400-italic.abc8a91e.woff new file mode 100644 index 000000000..c3dcb80c4 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-400-italic.abc8a91e.woff differ diff --git a/frontend-dist/alegreya-sans-vietnamese-400-normal.32e0786f.woff b/frontend-dist/alegreya-sans-vietnamese-400-normal.32e0786f.woff new file mode 100644 index 000000000..ceb356352 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-400-normal.32e0786f.woff differ diff --git a/frontend-dist/alegreya-sans-vietnamese-400-normal.a906a7f6.woff2 b/frontend-dist/alegreya-sans-vietnamese-400-normal.a906a7f6.woff2 new file mode 100644 index 000000000..1f5072a3e Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-400-normal.a906a7f6.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-500-italic.0a710f4c.woff b/frontend-dist/alegreya-sans-vietnamese-500-italic.0a710f4c.woff new file mode 100644 index 000000000..63cf41ccf Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-500-italic.0a710f4c.woff differ diff --git a/frontend-dist/alegreya-sans-vietnamese-500-italic.d02b2baa.woff2 b/frontend-dist/alegreya-sans-vietnamese-500-italic.d02b2baa.woff2 new file mode 100644 index 000000000..c0f43eb54 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-500-italic.d02b2baa.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-500-normal.5ed8053c.woff b/frontend-dist/alegreya-sans-vietnamese-500-normal.5ed8053c.woff new file mode 100644 index 000000000..0121df69b Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-500-normal.5ed8053c.woff differ diff --git a/frontend-dist/alegreya-sans-vietnamese-500-normal.6639e3ea.woff2 b/frontend-dist/alegreya-sans-vietnamese-500-normal.6639e3ea.woff2 new file mode 100644 index 000000000..3a0e53ef8 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-500-normal.6639e3ea.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-700-italic.59db40f9.woff2 b/frontend-dist/alegreya-sans-vietnamese-700-italic.59db40f9.woff2 new file mode 100644 index 000000000..09f9cd99a Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-700-italic.59db40f9.woff2 differ diff --git a/frontend-dist/alegreya-sans-vietnamese-700-italic.c83635d5.woff b/frontend-dist/alegreya-sans-vietnamese-700-italic.c83635d5.woff new file mode 100644 index 000000000..6b97c0c41 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-700-italic.c83635d5.woff differ diff --git a/frontend-dist/alegreya-sans-vietnamese-700-normal.066a5a17.woff b/frontend-dist/alegreya-sans-vietnamese-700-normal.066a5a17.woff new file mode 100644 index 000000000..c6dd4b864 Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-700-normal.066a5a17.woff differ diff --git a/frontend-dist/alegreya-sans-vietnamese-700-normal.1aa83a58.woff2 b/frontend-dist/alegreya-sans-vietnamese-700-normal.1aa83a58.woff2 new file mode 100644 index 000000000..1de6750ec Binary files /dev/null and b/frontend-dist/alegreya-sans-vietnamese-700-normal.1aa83a58.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 000000000..8fc34ff6e --- /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 000000000..32a9f4f30 --- /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 000000000..d0d9e1124 --- /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 000000000..a5d529e72 --- /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 000000000..ba46f260f --- /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 000000000..c52ff6227 --- /dev/null +++ b/frontend-dist/ban-outline.c97da9b4.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 000000000..c4c15b472 --- /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 000000000..093c8e4ca --- /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 000000000..888285c95 --- /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 000000000..4e04a5854 --- /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 000000000..f62dcf921 --- /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 000000000..e7a50cd11 --- /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 000000000..9e63a3c04 --- /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 000000000..588e2d4c8 --- /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 000000000..cce96081a --- /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 000000000..17d07818e --- /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 000000000..939a8c238 --- /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 000000000..426ff3b0d --- /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 000000000..01e29db63 --- /dev/null +++ b/frontend-dist/copy-outline.0f561529.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/document-lock-outline.69d176a4.svg b/frontend-dist/document-lock-outline.69d176a4.svg new file mode 100644 index 000000000..b602b075c --- /dev/null +++ b/frontend-dist/document-lock-outline.69d176a4.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 000000000..dacd264f4 --- /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 000000000..8f0e68054 --- /dev/null +++ b/frontend-dist/download-outline.523a74d8.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/easel-outline.9b064e1f.svg b/frontend-dist/easel-outline.9b064e1f.svg new file mode 100644 index 000000000..cb8186f59 --- /dev/null +++ b/frontend-dist/easel-outline.9b064e1f.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/editor.21e3b1fd.js b/frontend-dist/editor.21e3b1fd.js new file mode 100644 index 000000000..b037f179f --- /dev/null +++ b/frontend-dist/editor.21e3b1fd.js @@ -0,0 +1,6 @@ +/*! iFrame Resizer (iframeSizer.min.js ) - v4.3.11 - 2024-04-22 + * Desc: Force cross domain iframes to size to content. + * Requires: iframeResizer.contentWindow.min.js to be loaded into the target frame. + * Copyright: (c) 2024 David J. Bradshaw - dave@bradshaw.net + * License: MIT + */!function(e){var n,i,t,o,r,a,s,d,c,l,u,f,m,g,h;function p(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function w(e,n,i){e.addEventListener(n,i,!1)}function b(e,n,i){e.removeEventListener(n,i,!1)}function y(e){return u[e]?u[e].log:t}function v(e,n){M("log",e,n,y(e))}function x(e,n){M("info",e,n,y(e))}function I(e,n){M("warn",e,n,!0)}function M(e,n,i,t){var o;!0===t&&"object"==typeof window.console&&console[e](a+"["+(o="Host page: "+n,o=window.top!==window.self?window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+n:"Nested host page: "+n:o)+"]",i)}function k(e){function n(){i("Height"),i("Width"),W(function(){N(H),R(P),z(P,"onResized",H)},H,"init")}function i(e){var n=Number(u[P]["max"+e]),i=Number(u[P]["min"+e]),e=e.toLowerCase(),t=Number(H[e]);v(P,"Checking "+e+" is in range "+i+"-"+n),tu[c]["max"+e])throw Error("Value for min"+e+" can not be greater than max"+e)}}function H(e,n){null===f&&(f=setTimeout(function(){f=null,e()},n))}function P(){"hidden"!==document.visibilityState&&(v("document","Trigger event: Visibility change"),H(function(){A("Tab Visible","resize")},16))}function A(e,n){Object.keys(u).forEach(function(i){u[i]&&"parent"===u[i].resizeFrom&&u[i].autoResize&&!u[i].firstRun&&C(e,n,u[i].iframe,i)})}function L(){function n(e,n){if(n){if(!n.tagName)throw TypeError("Object is not a valid DOM element");if("IFRAME"!==n.tagName.toUpperCase())throw TypeError("Expected tag, found <"+n.tagName+">");j(n,e),i.push(n)}}for(var i,t=["moz","webkit","o","ms"],o=0;ocode{font-size:inherit}pluto-output.rich_output code{background-color:var(--pluto-output-bg-color);border-radius:8px;padding:.18em}pluto-output.rich_output pre>code{background-color:#0000;padding:0}pluto-log-dot pre,pluto-output pre{white-space:pre-wrap;word-break:break-all;tab-size:4;font-family:var(--julia-mono-font-stack);font-variant-ligatures:none;margin:0;font-size:.8rem;display:inline-block}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);color:var(--blockquote-color);border-radius:15px;margin-block-start:0;margin-block-end:var(--pluto-cell-spacing);padding:15px;display:block}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:1em}pluto-output div.admonition .admonition-title{font-feature-settings:"lnum","pnum";color:var(--admonition-title-color);margin-block-end:0;padding-left:.3em;font-family:Vollkorn,Palatino,sans-serif;font-size:1.3em;font-weight:600}pluto-output div.admonition .admonition-title~*{margin-block:.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;padding-right:.5rem}pluto-output div.admonition .admonition-title{background:var(--jl-message-accent-color);margin:-1px;margin-left:-.55rem;margin-right:-.55rem}pluto-output div.admonition.note,pluto-output div.admonition.info,pluto-output div.admonition.hint{background:var(--jl-info-color);border:5px solid var(--jl-info-accent-color)}pluto-output div.admonition.note>.admonition-title,pluto-output div.admonition.info>.admonition-title,pluto-output div.admonition.hint>.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:hover>.admonition-title~*,pluto-output div.admonition.hint:focus-within>.admonition-title~*{filter:blur()}pluto-output div.footnote{margin-block: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:var(--roboto-mono-font-stack);letter-spacing:-.05em;margin-block-end:0;font-size:.75rem;font-weight:700}pluto-output div.footnote p.footnote-title~*{border-left:5px solid var(--footnote-border-color);padding-left:.4em;padding-bottom:var(--pluto-cell-spacing);margin-left:.1em;margin-block-end:0}pluto-output div.footnote p:last-child{padding-bottom:0}pluto-output.scroll_y{max-height:502px;overflow:auto}pluto-output table{border-collapse:collapse;border:2px solid var(--table-border-color);border-left:none;border-right:none;margin:0 auto;margin-block-start:var(--pluto-cell-spacing);margin-block-end: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-variant-ligatures:none;font-size:.75rem}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}pluto-output kbd,kbd{letter-spacing:-.7px;border:1px solid var(--kbd-border-color);border-radius:3px;padding:0 5px;font-family:Space Mono,monospace;font-size:.7rem}pluto-output mjx-assistive-mml{height:1px}.raw-html-wrapper>div.markdown{overflow:hidden}pluto-output details{border:1px solid var(--rule-color);border-radius:4px;margin-block-start:0;margin-block-end:var(--pluto-cell-spacing);padding:.5em .5em 0}pluto-output details:first-child{margin-block-start:0}pluto-output details:last-child{margin-block-end:0}pluto-output details summary{cursor:pointer;font-family:var(--system-ui-font-stack);background-clip:padding-box;border-radius:3px;margin:-.5em -.5em 0;padding:.5em;font-weight:700;transition:color .25s ease-in-out,background-color .25s ease-in-out}pluto-output details summary:hover{color:var(--blockquote-color);background-color:var(--blockquote-bg)}pluto-output details[open]{padding:.5em}pluto-output details[open] summary{border-bottom:1px solid var(--rule-color);border-bottom-right-radius:0;border-bottom-left-radius:0;margin-bottom:.5em}header#pluto-nav{z-index:60;background-color:var(--header-bg-color);border-bottom:solid 1px var(--header-border-color);width:100%;min-height:60px;font-family:var(--roboto-mono-font-stack);font-size:.8rem;font-weight:400;transition:background-color .5s ease-in-out,transform .25s cubic-bezier(.18,.89,.49,1.13);transform:translateY(0)}header#pluto-nav.show_export{position:sticky;top:0;transform:translateY(130px)}dialog#export{background:var(--export-bg-color);width:100%;height:130px;color:var(--export-color);border:none;max-width:none;max-height:none;margin:0;padding:0;display:block;position:absolute;top:0;overflow:visible;transform:translateY(calc(-100% - 1px))}dialog#export:before{content:"";background:inherit;height:100px;position:absolute;bottom:100%;left:0;right:0}dialog#export div#container{flex-direction:row;max-width:1000px;margin:0 auto;padding-right:10em;display:flex;position:relative}header dialog#export div#container{overflow-x:hidden}header.show_export dialog#export div#container{overflow-x:auto}a.export_card{background:var(--export-card-bg-color);width:169px;height:90px;color:var(--export-card-title-color);box-shadow:0px 2px 10px var(--export-card-shadow-color);border:5px solid #0000;border-radius:8px;flex:none;margin:20px 5px;text-decoration:none}div.export_title{text-orientation:sideways-right;writing-mode:vertical-lr;border-radius:8px;flex:none;height:90px;margin-top:10px;font-size:1rem;font-weight:700;transform:rotate(180deg)}a.export_card header{font-feature-settings:"lnum","pnum";margin-block:0;font-family:Vollkorn,Palatino,sans-serif;font-size:17px}a.export_card section{color:var(--export-card-text-color);padding:3px;font-weight:500}dialog#export .export_small_btns{background:var(--export-bg-color);border-radius:.9em;flex-direction:row;padding:.9em;display:flex;position:absolute;top:0;right:.8em}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{z-index:100;flex-flow:wrap;max-width:1000px;min-height:60px;margin:0 auto;padding-left:20px;padding-right:20px;display:flex}nav#at_the_top>*{flex:none;align-self:center;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 h1{border-bottom:none;font-size:1.8rem;font-weight:700;display:inline}nav#at_the_top img#logo-small,nav#at_the_top img#logo-big{height:39px;filter:var(--image-filters);margin-bottom:-8px}nav#at_the_top img#logo-small{display:none}@media (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,nav#at_the_top>div.desktop_picker{flex-direction:row;flex-grow:1;width:210px;display:flex}nav#at_the_top>pluto-filepicker .cm-editor,nav#at_the_top>div.desktop_picker span{letter-spacing:1px;min-width:10rem;height:calc(1rem + 12px);color:var(--nav-filepicker-color);border:2px solid var(--footer-input-border-color);background:0 0;border-right:none;border-radius:3px 0 0 3px;font-family:inherit;font-size:.8rem;font-style:normal;font-weight:500;display:inline-block}pluto-filepicker .cm-scroller{scrollbar-width:none}pluto-filepicker .cm-scroller::-webkit-scrollbar{display:none}pluto-filepicker button,div.desktop_picker button{cursor:pointer;height:auto}pluto-filepicker button:disabled{cursor:not-allowed}div.desktop_picker span{white-space:nowrap;text-overflow:ellipsis;vertical-align:middle;cursor:pointer;padding:0 5px;line-height:1.8;overflow-x:hidden}button.start_stop_recording,button.toggle_export,.export_small_btns button{cursor:pointer;opacity:.5;background:0 0;border:none}button.start_stop_recording span,button.toggle_export span,.export_small_btns button span{background-size:25px 25px;width:25px;height:25px;display:block;content:" "!important}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{filter:var(--image-filters);background-image:url(share-outline.50164ded.svg)}dialog#export button.toggle_export span{filter:invert();background-image:url(close-outline.9c22a232.svg)}dialog#export button.toggle_frontmatter_edit span{filter:invert();background-image:url(newspaper-outline.e481c39c.svg)}dialog#export button.toggle_presentation span{filter:invert();background-image:url(easel-outline.9b064e1f.svg)}nav#at_the_top:after{align-self:center;margin-left:auto}.cm-tooltip-autocomplete li.file.new:before{content:"👉";color:#000}.cm-tooltip-autocomplete li.file:before{content:"📄";color:#000}.cm-tooltip-autocomplete li.dir:before{content:"📁";color:#000}@media (any-pointer:fine){nav#at_the_top>pluto-filepicker .cm-editor,nav#at_the_top>div.desktop_picker span{border:2px solid #0000;border-right:none;transition:border .15s ease-in-out}nav#at_the_top>pluto-filepicker button,nav#at_the_top>div.desktop_picker button{opacity:0;transition:opacity .15s ease-in-out}header:hover>nav#at_the_top>pluto-filepicker .cm-editor,header:focus-within>nav#at_the_top>pluto-filepicker .cm-editor,header:hover>nav#at_the_top>div.desktop_picker span,header:focus-within>nav#at_the_top>div.desktop_picker span{border:2px solid var(--footer-input-border-color);border-right:none}header:hover>nav#at_the_top>pluto-filepicker button,header:focus-within>nav#at_the_top>pluto-filepicker button,header:hover>nav#at_the_top>div.desktop_picker button,header:focus-within>nav#at_the_top>div.desktop_picker 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{font-size:16px;font-family:var(--julia-mono-font-stack);opacity:.8;text-decoration:none;display:block}body.nbpkg_restart_recommended header#pluto-nav,body.nbpkg_restart_required header#pluto-nav,body.binder.loading header#pluto-nav,body.process_waiting_for_permission header#pluto-nav,body.process_dead header#pluto-nav,body.disconnected header#pluto-nav{-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.process_waiting_for_permission header#pluto-nav{background-color:var(--restart-recc-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);color:var(--nav-process-status-color);z-index:10;border-radius:10px;margin:5px 5px 5px 1em;padding:5px 10px;font-size:1rem;font-weight:500}nav#at_the_top>#process_status:empty{display:none}.statefile-fetch-progress{--w:min(80vw,300px);left:calc(50vw - .5*var(--w));z-index:300000;width:var(--w);position:fixed;top:0}loading-bar{background:linear-gradient(90deg,var(--loading-grad-color-1),var(--loading-grad-color-2),var(--loading-grad-color-1));opacity:0;z-index:12000;background-size:100vw 100%;width:10vw;height:6px;transition:width 2s cubic-bezier(.14,.71,0,.99),opacity .2s linear;animation:2s ease-in-out infinite move-background;display:block;position:fixed;top:0;left:0}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{z-index:1500;pointer-events:none;box-sizing:border-box;width:100vw;height:100vh;position:fixed;top:0;left:0}body.process_waiting_for_permission .outline-frame.safe-preview{border-bottom:12px solid var(--restart-recc-header-color)}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{opacity:1;border:12px solid #357ddcba;transition:top .3s ease-in-out,opacity .3s ease-in-out;position:absolute;box-shadow:inset 0 0 20px 20px #919bff2b}body.recording_waiting_to_start header#pluto-nav,body.is_recording header#pluto-nav{display:none}.outline-frame-actions-container{z-index:1501;flex-flow:wrap;display:flex;position:fixed;top:3px}.outline-frame-actions-container.safe-preview{top:auto;bottom:4px}.outline-frame-actions-container>.overlay-button{border-color:#e86f6c;margin:0 3px}.outline-frame-actions-container>.overlay-button.record-no-audio{border-color:#dcc6c6}.outline-frame-actions-container>.overlay-button.playback{border-color:#c6c6dc}span.pluto-icon.stop-recording-icon:after{background-image:url(stop-circle-outline.6623356d.svg)}span.pluto-icon.microphone-icon:after{background-image:url(mic-outline.e10eafe2.svg)}span.pluto-icon.info-icon:after{background-image:url(information-circle-outline.008b2bb9.svg)}span.pluto-icon.offline-icon:after{background-image:url(cloud-offline-outline.ac2eade9.svg)}span.pluto-icon.mute-icon:after{background-image:url(mic-off-outline.251c22b7.svg)}span.pluto-icon.follow-recording-icon:after{background-image:url(arrow-undo-outline.d8c99108.svg)}div.recording-playback{z-index:1501;width:min(500px,90vw);position:fixed;bottom:16px}div.recording-playback audio{width:100%}.safe-preview-info{color:var(--black);font-family:var(--system-ui-font-stack);background:var(--white);border:3px solid var(--restart-recc-accent-color);border-radius:.8em;padding:.3em .8em;font-weight:700}.safe-preview-info>span{display:flex}.safe-preview-info button{cursor:pointer;background:0 0;border:none}.safe-preview-output{color:var(--helpbox-header-color);font-family:var(--system-ui-font-stack);opacity:.5;background:var(--restart-recc-header-color);border-radius:.4em;align-items:baseline;gap:.3em;margin:.7em 0;padding:.2em .4em;font-size:.8rem;font-weight:700;display:inline-flex}.raw-html-wrapper.preamble{width:100%}main>preamble{z-index:200;pointer-events:none;height:20px;margin-top:5px;padding-right:5px;display:flex;position:sticky;top:5px}.overlay-button{background:var(--overlay-button-bg);color:var(--overlay-button-color);border:3px solid var(--overlay-button-border);height:35px;font-family:var(--roboto-mono-font-stack);pointer-events:all;white-space:nowrap;border-radius:12px;padding:5px 8px;font-size:.75rem}.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:translate(max(0px,100vw - 725px))}@media screen and (width>=1231px){pluto-editor.fullscreen main>preamble #saveall-container{transform:translate(500px)}}main>preamble #saveall-container.ask_to_save{border-color:var(--overlay-button-border-save)}main>preamble #saveall-container.saving,main>preamble #saveall-container.saved{border-color:#0000}main>preamble #saveall-container.saving>span,main>preamble #saveall-container.saved>span{opacity:.5}span.pluto-icon:after{content:"";height:1.3em;filter:var(--image-filters);background-image:url(sync-circle-outline.65b15d76.svg);background-position:right 1px;background-repeat:no-repeat;background-size:1.3em;margin-bottom:-.3em;padding-right:1.5em;display:inline-block;transform:translateY(-.1em)}main>preamble span.saved-icon:after,.overlay-button span.saved-icon:after{filter:var(--image-filters);background-image:url(checkmark-outline.4fb8c646.svg)}#saveall-container .only-on-hover{display:none}#saveall-container:hover .only-on-hover{display:inline}pluto-cell{min-height:25px;margin-top:var(--pluto-cell-spacing);display:block;position:relative}pluto-output{background-color:var(--pluto-output-bg-color);align-items:baseline;padding-left:10px;padding-right:10px;display:block;overflow-x:auto}.scroll_y{max-height:80vh;overflow-y:auto}pluto-output:focus{outline:none}pluto-output:not(.rich_output){flex-wrap:wrap;padding-top:3px;padding-bottom:3px;display:flex}pluto-output>assignee{font-family:var(--julia-mono-font-stack);font-variant-ligatures:none;font-size:.75rem}pluto-output>assignee:after{content:" = ";opacity:.6}pluto-output>assignee:empty,.errored pluto-output>assignee{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:where(.offer_binder,.offer_local) bond{opacity:.6;filter:grayscale()}pluto-display,pluto-display>div{display:contents}.isolated-cell>pluto-output{padding:0}.hidden-cell{display:none}pluto-cell.depends_on_disabled_cells>pluto-output,pluto-cell.running_disabled>pluto-output,pluto-cell.depends_on_disabled_cells>pluto-trafficlight,pluto-cell.running_disabled>pluto-trafficlight,pluto-cell.depends_on_disabled_cells>pluto-input .cm-editor,pluto-cell.running_disabled>pluto-input .cm-editor,pluto-cell.depends_on_disabled_cells>pluto-logs-container,pluto-cell.running_disabled>pluto-logs-container{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.skip_as_script .skip_as_script_marker,pluto-cell.depends_on_skipped_cells .depends_on_skipped_marker{cursor:help;z-index:20;background-color:var(--skip-as-script-background-color);border-radius:0 4px 4px 0;width:4px;display:block;position:absolute;top:0;bottom:0;right:-3px}pluto-cell.depends_on_skipped_cells .depends_on_skipped_marker{background-color:var(--depends-on-skip-as-script-background-color)}pluto-cell.skip_as_script pluto-input .cm-editor,pluto-cell.depends_on_skipped_cells pluto-input .cm-editor{border-bottom-right-radius:0}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-width:thin;scrollbar-color:transparent transparent}pluto-cell:hover>pluto-output>div{scrollbar-color:var(--hover-scrollbar-color-1)var(--hover-scrollbar-color-2)}pluto-output>div::-webkit-scrollbar{background:0 0;height:6px}pluto-output>div::-webkit-scrollbar-thumb{background:0 0}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{z-index:20;border:1px solid var(--normal-cell-color);border-left:none;border-bottom-right-radius:4px;min-height:25px;scroll-margin-block:20vh}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 span.cm-highlighted-range,pluto-input .cm-editor .cm-line.cm-highlighted-line{background-color:var(--cm-highlighted);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}button.floating_back_button,.overlay-button button,pluto-cell>button,pluto-input>button,pluto-runarea>button,pluto-shoulder>button,nav#slide_controls>button{opacity:.5;cursor:pointer;color:var(--ui-button-color);font-family:var(--roboto-mono-font-stack);z-index:30;background:0 0;border:none;margin:0;padding:1px;font-size:.75rem;position:absolute}.overlay-button button{position:relative}pluto-shoulder{--invisible-border:calc(.5*var(--pluto-cell-spacing));--shoulder-width:calc(28px + var(--invisible-border));--border-radius:calc(5px + var(--invisible-border));left:calc(0px - var(--shoulder-width));width:var(--shoulder-width);border-radius:var(--border-radius)0px 0px var(--border-radius);cursor:move;top:calc(0px - var(--invisible-border));bottom:calc(0px - var(--invisible-border));border:var(--invisible-border)solid #0000;border-right:none;flex-direction:row;justify-content:flex-end;align-items:flex-start;display:flex;position:absolute}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:none;padding:4px 5px 4px 10px;position:sticky;top:0}pluto-cell:focus-within>pluto-shoulder>button{padding-right:9px}pluto-shoulder>button>span:after{filter:var(--image-filters);background-image:url(eye-outline.6e6e0f7c.svg)}pluto-cell.code_folded>pluto-shoulder>button>span:after{filter:var(--image-filters);background-image:url(eye-off-outline.a37e03db.svg)}pluto-trafficlight{--patternHeight:22.6274px;box-sizing:content-box;pointer-events:none;border-left-color:var(--normal-cell-color);background:var(--normal-cell-color);border-top-left-radius:4px;border-bottom-left-radius:4px;width:4px;margin-right:-1px;position:absolute;top:0;bottom:0;left:-4px;overflow:hidden}pluto-trafficlight:after{content:"";top:calc(0px - 10*var(--patternHeight));width:100%;height:calc(100% + 10*var(--patternHeight));opacity:0;position:absolute;left:0}pluto-cell.activate_animation pluto-trafficlight:after{animation:10s linear infinite scrollbackground}body:not(.___) pluto-cell.code_folded>pluto-trafficlight{background:0 0}@media screen and (any-pointer:fine){body:not(.disable_ui) pluto-cell:hover>pluto-trafficlight{background:var(--normal-cell-color)}}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);border-left-color:var(--selected-cell-color);background-clip:padding-box}body:not(.___) pluto-cell.code_differs>pluto-trafficlight{background:var(--code-differs-cell-color);border-left-color:var(--code-differs-cell-color);background-clip:padding-box}body:not(.___) pluto-cell.errored>pluto-trafficlight{background:var(--error-cell-color);border-left-color:var(--error-cell-color);background-clip:padding-box}body:not(.___) pluto-cell.queued>pluto-trafficlight:after{background:repeating-linear-gradient(-45deg,#0000,#0000 8px,var(--normal-cell-color)8px,var(--normal-cell-color)16px);opacity:.99;background-clip:padding-box;background-size:4px var(--patternHeight);animation-duration:20s}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);opacity:.99;background-clip:content-box;background-size:4px var(--patternHeight)}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);opacity:.99;background-clip:content-box;background-size:4px var(--patternHeight)}@keyframes scrollbackground{0%{transform:translate(0)}to{transform:translate(0,calc(10*var(--patternHeight)))}}pluto-cell>button>span,pluto-input>button>span{pointer-events:none}@media screen and (any-pointer:fine){pluto-cell>button,pluto-input>button,pluto-runarea>button,pluto-shoulder>button,pluto-cell>pluto-runarea{opacity:0;transition:opacity .25s ease-in-out}.export_small_btns button,button.toggle_export,button.start_stop_recording,pluto-cell:hover>button,pluto-cell:focus-within>button,pluto-cell:hover>pluto-input>button,pluto-cell:focus-within>pluto-input>button,pluto-cell>pluto-runarea>button,pluto-cell:hover>pluto-shoulder>button,pluto-cell:focus-within>pluto-shoulder>button{opacity:.6;transition:opacity .25s ease-in-out}.export_small_btns button:hover,button.toggle_export:hover,button.start_stop_recording:hover,.overlay-button button:hover,pluto-cell>button:hover,pluto-cell>pluto-input>button:hover,pluto-cell>pluto-runarea>button:hover,pluto-cell>pluto-shoulder>button:hover,pluto-cell:hover>pluto-runarea{opacity:1;transition:opacity 50ms ease-in-out}}@media screen and (pointer:coarse){pluto-cell>button.add_cell,pluto-input>button,pluto-shoulder>button{opacity:.25;transition:opacity .25s ease-in-out}pluto-cell:not(:first-of-type,:last-of-type)>button.add_cell{opacity:.125}pluto-cell:focus-within>button.add_cell,pluto-cell:focus-within>pluto-input>button,pluto-cell:focus-within>pluto-runarea,pluto-cell:focus-within>pluto-shoulder>button{opacity:.6;transition:opacity .25s ease-in-out}pluto-cell>pluto-input>button:focus-within,pluto-cell>button:focus-within,pluto-cell>pluto-input>button:focus-within pluto-cell>pluto-runarea>button:focus-within,pluto-cell>pluto-shoulder>button:focus-within,pluto-cell>pluto-runarea{opacity:1;transition:opacity 50ms 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;width:17px;height:17px;display:block;content:" "!important}pluto-cell>button.add_cell{--hit-box-extend:20px;margin-left:calc(-1*var(--hit-box-extend));margin-right:calc(-1*var(--hit-box-extend));padding-left:var(--hit-box-extend);padding-right:var(--hit-box-extend);left:-12px}pluto-cell>button.add_cell.before{margin-top:calc(-19px - .5*(var(--pluto-cell-spacing) - 19px))!important}pluto-cell>button.add_cell.after{margin-bottom:calc(-20px - .5*(var(--pluto-cell-spacing) - 19px));bottom:1px}pluto-cell>button.add_cell>span:after{filter:var(--image-filters);background-image:url(add-outline.e3c93c35.svg)}pluto-input>.input_context_menu ul{border:1px solid var(--input-context-menu-border-color);background-color:var(--input-context-menu-bg-color);border-radius:6px;grid-template-columns:max-content;margin:0;padding:0;display:grid}pluto-input{display:block;position:relative}pluto-input>div.input_context_menu{z-index:1400;position:absolute;top:-8px;left:100%}@media screen and (width>=921px){pluto-input>div.input_context_menu{left:calc(100% - 3px)}}@media screen and (width<=920px){pluto-input>div.input_context_menu{right:0;left:unset;z-index:1401}}pluto-input>.input_context_menu li{flex-direction:column;align-items:stretch;margin-block-end:0;list-style:none;display:flex}pluto-input>.input_context_menu li button{letter-spacing:-.02em;color:var(--input-context-menu-li-color);cursor:pointer;background:0 0;border:none;border-radius:2px;justify-content:flex-start;align-items:center;height:32px;margin-block-end:0;padding:8px;font-family:Roboto Mono,system-ui;font-size:.8rem;display:flex;position:relative}.input_context_menu li:last-child{border-bottom-right-radius:6px;border-bottom-left-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{cursor:not-allowed;background-color:var(--input-context-menu-hover-bg-color)}.input_context_menu li:hover{background-color:var(--input-context-menu-hover-bg-color);transition-property:background-color;transition-duration:.2s}.ctx_icon,.icon{--size:17px;width:var(--size);height:var(--size);background-size:var(--size)var(--size);margin-top:1px;margin-right:calc(var(--size)/3);background-position:50%}.ctx_icon{filter:var(--image-filters)}.ctx_icon.show_logs,.ctx_icon.hide_logs{background-image:url(document-text-outline.8d1e2333.svg)}.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)}.ctx_icon.run_as_script{background-image:url(document-lock-outline.69d176a4.svg)}.ctx_icon.skip_as_script{background-image:url(document-text-outline.8d1e2333.svg)}.ctx_icon.copy_output{background-image:url(copy-outline.0f561529.svg)}pluto-input>button.input_context_menu{padding:5px;right:0}pluto-input>.input_context_menu.open{opacity:1}pluto-input>.input_context_menu span.icon:after{filter:var(--image-filters);background-image:url(ellipsis-horizontal-circle-outline.6279ed30.svg)}pluto-input>.preview_hidden_code_info{text-align:center;background:var(--jl-info-color);width:19ch;height:1.4rem;font-style:italic;font-family:var(--system-ui-font-stack);z-index:22;pointer-events:none;border-radius:.4rem;margin-left:auto;margin-right:auto;font-size:.9rem;display:none;position:absolute;bottom:-1.1rem;left:0;right:0}body:not(.process_waiting_for_permission) pluto-cell.code_folded pluto-input>.preview_hidden_code_info,pluto-cell.code_folded:focus-within pluto-input>.preview_hidden_code_info{display:block}pkg-status-mark{width:1em;height:1em;margin:0 .6em 0 .2em;display:inline-block}body.nbpkg_disabled pkg-status-mark:not(.disable_pkg){display:none}pkg-status-mark>button{cursor:context-menu;background:0 0;border:none;margin:0;padding:0;position:relative;top:-.2em}pkg-status-mark>button>span:after{opacity:.3;width:1.5em;height:1.5em;filter:var(--image-filters);background-image:url(time-outline.7c1877f0.svg);background-size:1.5em;display:inline-block;content:" "!important}pkg-status-mark.installed>button>span:after{filter:var(--image-filters);background-image:url(checkmark-outline.4fb8c646.svg)}pkg-status-mark.busy>button>span:after{filter:var(--image-filters);background-image:url(sync-outline.9a1bd27b.svg);animation:3s ease-in-out infinite loadspin}pkg-status-mark.not_found>button>span:after{opacity:.6;filter:var(--image-filters);background-image:url(cloud-offline-outline.ac2eade9.svg)}pkg-status-mark.will_be_installed>button>span:after{opacity:.6;filter:var(--image-filters);background-image:url(cloud-download-outline.8c1ff9bb.svg)}pkg-status-mark.disable_pkg>button>span:after{opacity:.6;filter:var(--image-filters);background-image:url(chatbox-ellipses-outline.4334a3a4.svg)}pluto-popup{z-index:1800;--max-size:251px;width:min(90vw,var(--max-size));overflow-wrap:break-word;font-family:var(--system-ui-font-stack);opacity:0;transform-origin:0;pointer-events:none;margin-top:-1rem;margin-left:.4rem;transition:transform .5s ease-in-out,opacity .1s ease-in-out;display:block;position:absolute;transform:scale(.2)}pluto-popup.visible{opacity:1;pointer-events:initial;transition:transform .2s ease-in-out,opacity .2s ease-in-out;transform:scale(1)}pluto-popup.big{--max-size:25em}pluto-popup>*{background:var(--overlay-button-bg);border:3px solid var(--overlay-button-border);color:var(--black);border-radius:10px;max-width:100%;max-height:80vh;padding:8px;display:block;position:absolute;overflow-y:auto}pluto-popup>div>:first-child{margin-block-start:0}pluto-popup h1{font-size:1.6em}pluto-popup.warn>*{background:var(--pluto-logs-warn-color);border-color:var(--pluto-logs-warn-accent-color)}pluto-popup code.auto_disabled_variable{font-family:var(--julia-mono-font-stack);font-variant-ligatures:none;font-size:.8rem}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{opacity:.5;font-family:Space Mono,monospace;font-size:.75rem}pkg-popup .pkg-buttons{float:right;flex-direction:row;height:1em;display:inline-flex}.ionicon{filter:var(--image-filters)}.package-name .ionicon{margin-bottom:-.1ch}a.stdout-info img,pkg-popup .pkg-buttons img{filter:var(--image-filters)}a.stdout-info,pkg-popup .pkg-buttons>*{box-sizing:content-box;background:var(--pkg-popup-buttons-bg-color);z-index:52;border-radius:10px;height:17px;margin-left:-4px;padding:4px;display:block}pkg-popup .toggle-terminal{right:20px}.pkg-time-estimate{background:var(--pluto-logs-warn-color);border-radius:.5em;margin:.5em 0;padding:.5em;font-size:.8em}pkg-terminal{cursor:text;background:var(--pkg-terminal-bg-color);color:#fff;border:3px solid var(--pkg-terminal-border-color);border-radius:6px;margin-top:6px;padding:3px;display:block}pkg-terminal>.scroller{width:100%;max-height:10rem;padding:4px;overflow-y:auto}body pkg-terminal:not(.asdf) pre:not(.asdf){white-space:pre-wrap;word-break:break-all;font-variant-ligatures:none;color:inherit;background:0 0;margin:0;font-family:Space Mono,monospace;font-size:.6rem}pkg-terminal .make-me-spin{transform-origin:50% 59%;animation:1s linear infinite identifier-spin;animation-delay:var(--animation-delay);display:inline-block}pkg-popup pkg-terminal{display:none}pkg-popup.showterminal pkg-terminal{display:block}@keyframes loadspin{0%{transform:rotate(0)}25%{transform:rotate(180deg)}50%{transform:rotate(180deg)}75%{transform:rotate(360deg)}to{transform:rotate(360deg)}}pluto-runarea{background-color:var(--pluto-runarea-bg-color);z-index:19;border-top:none;border-bottom-right-radius:5px;border-bottom-left-radius:5px;min-width:75px;height:17px;margin-right:3px;display:block;position:absolute;right:0}pluto-runarea>span{width:45px;font-family:var(--roboto-mono-font-stack);color:var(--pluto-runarea-span-color);text-align:center;font-size:.6em;font-style:italic;display:inline-block;position:absolute;top:1px;left:22px}pluto-runarea>button.runcell{top:-1px;left:1px}pluto-runarea>button.runcell>span:after{filter:var(--image-filters);background-image:url(caret-forward-circle-outline.d0bf2b34.svg)}pluto-runarea.interrupt>button.runcell>span:after{filter:var(--image-filters);background-image:url(stop-circle-outline.6623356d.svg)}pluto-runarea.jump>button.runcell>span:after{filter:var(--image-filters);background-image:url(arrow-redo-circle-outline.dfa899f4.svg)}pluto-runarea.save>button.runcell>span:after{filter:var(--image-filters);background-image:url(chevron-forward-circle-outline.babf2a99.svg)}pluto-cell:not(.show_input)>pluto-runarea{display:none}pluto-cell.code_folded.show_input>pluto-input:not(:focus-within){opacity:.4}pluto-cell:focus-within>pluto-runarea,pluto-cell.code_differs>pluto-runarea{opacity:1}pluto-cell.code_differs>pluto-runarea>button{animation-name:👀;animation-duration:4s;animation-iteration-count:infinite}@keyframes 👀{0%,80%,to{opacity:.5;transform:scale(1)}90%{opacity:1;transform:scale(1.2)}}dropruler{height:4px;margin-top:calc(-2px - .5*var(--pluto-cell-spacing));background:var(--dropruler-bg-color);display:none;position:absolute;left:0;right:0}#helpbox-wrapper{z-index:50;width:100%;height:0;display:none;position:sticky;bottom:0}@media (width>=500px){#helpbox-wrapper{display:block}}pluto-helpbox{background-color:var(--helpbox-bg-color);width:clamp(300px,100vw - 781px,450px);height:min(70vh,900px);color:var(--helpbox-text-color);box-shadow:0 0 11px 0px var(--helpbox-box-shadow-color);border-bottom:none;border-right:none;border-top-left-radius:9px;border-top-right-radius:9px;flex-direction:column;display:flex;position:absolute;bottom:0;right:20px}pluto-helpbox>section{flex-direction:column;height:100%;padding:10px;display:flex;overflow:auto}pluto-helpbox>header{background-color:var(--helpbox-header-bg-color);color:var(--helpbox-header-color);font-family:var(--system-ui-font-stack);font-variant-numeric:tabular-nums;--border-radius:.4em;border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);gap:.5em;padding:.6em;font-size:.9rem;font-weight:500;display:flex}pluto-helpbox>header>button.helpbox-tab-key>.tabicon{--size:1.1em;width:var(--size);height:var(--size);background-size:var(--size);margin-bottom:calc(-.15*var(--size));filter:var(--image-filters);margin-right:.6em;display:inline-block}pluto-helpbox>header>button.helpbox-docs>.tabicon{background-image:url(search.1ca5b3b3.svg)}pluto-helpbox>header>button.helpbox-process>.tabicon{background-image:url(pulse.27a877a7.svg)}pluto-helpbox>header>button.helpbox-tab-key:disabled>.tabicon{opacity:.5}pluto-helpbox .live-docs-searchbox{margin:1em;display:flex}pluto-helpbox .live-docs-searchbox input{background-color:inherit;color:inherit;border:none;border:3px solid var(--helpbox-search-border-color);background:var(--helpbox-search-bg-color);font-family:var(--julia-mono-font-stack);border-radius:.3em;flex-grow:1;margin:auto;padding:.5em;font-size:.9rem}pluto-helpbox .live-docs-searchbox.notfound input{color:var(--helpbox-notfound-search-color)}pluto-helpbox .live-docs-searchbox input:focus{outline:none}button.helpbox-tab-key{cursor:pointer;font-family:inherit;font-weight:inherit;font-style:inherit;font-size:inherit;font-variant:inherit;border-radius:var(--border-radius);background:var(--helpbox-header-tab-bg-color);text-overflow:ellipsis;white-space:nowrap;border:none;padding:.5em .6em;overflow:hidden}button.helpbox-tab-key.helpbox-process{margin-right:auto}button.helpbox-process.busy{outline:6px solid var(--process-busy)}@media (prefers-reduced-motion:no-preference){button.helpbox-process.busy{animation:.8s ease-in infinite alternate outline-heartbeat}}@keyframes outline-heartbeat{0%{outline-offset:-1px;outline-width:3px}to{outline-offset:0px;outline-width:6px}}button.active.helpbox-tab-key{outline:3px solid #99afb9;animation:none}pluto-helpbox>header>button:is(.helpbox-close,.helpbox-popout){cursor:pointer;background:0 0;border:15px solid #0000;margin:-15px}pluto-helpbox>header>button:is(.helpbox-close,.helpbox-popout)>span{width:1em;height:1em;filter:var(--image-filters);background-image:url(chevron-down-outline.1efaf1cc.svg);background-size:1em 1em;display:block;content:" "!important}pluto-helpbox>header>button.helpbox-popout>span{background-image:url(open-outline.87533923.svg)}pluto-helpbox.hidden{height:initial;width:auto}pluto-helpbox.hidden>section{display:none}body>pluto-helpbox{width:auto;height:100vmax;position:static}body>pluto-helpbox>header>button:is(.helpbox-close,.helpbox-popout){display:none}.helpbox-docs{font-family:var(--lato-ui-font-stack);line-height:1.5}.helpbox-docs pre,.helpbox-docs code,.helpbox-docs .cm-line{font-family:var(--julia-mono-font-stack);font-variant-ligatures:none;font-size:.95em;line-height:initial}.helpbox-docs pre code{font-size:1em}.helpbox-docs pre code.hljs,.helpbox-docs code .cm-editor .cm-content{padding:0}.helpbox-docs img{max-width:100%}.helpbox-docs>section h1,.helpbox-docs>section h2,.helpbox-docs>section h3,.helpbox-docs>section h4,.helpbox-docs>section h5,.helpbox-docs>section h6{border-bottom:none;font-family:inherit;font-size:1rem}.helpbox-docs>section h1{overflow-wrap:anywhere;font-size:1.3rem}.helpbox-docs>section pre{-webkit-overflow-scrolling:touch;background:var(--code-section-bg-color);border:1px solid var(--code-section-border-color);white-space:pre;word-wrap:normal;border-radius:4px;padding:.7rem .5rem;overflow-x:auto}.helpbox-docs>section hr{border:none;border-top:3px solid var(--rule-color)}.pluto-docs-binding{background:var(--docs-binding-bg);color:var(--pluto-output-color);border-radius:1em;margin:.5em;padding:1em}.pluto-docs-binding>span{font-family:var(--julia-mono-font-stack);background:var(--pluto-output-bg-color);color:var(--black);border-radius:.4rem;margin-top:-1em;padding:.235rem;font-size:.9rem;font-weight:700;display:inline-block;transform:translate(-1.2em,-73%)}.pluto-docs-binding h1{font-size:1.4em}.pluto-docs-binding h2{font-size:1.3em}.pluto-docs-binding h3,.pluto-docs-binding h4,.pluto-docs-binding h5,.pluto-docs-binding h6{font-size:1.1em}pl-status{--status-color:var(--process-undefined);font-family:var(--system-ui-font-stack);--indent:.7rem;margin-left:var(--indent);border-left:3px solid #0000;border-radius:.2em;flex-direction:column;flex:none;margin-top:.4em;font-size:.9rem;display:flex;overflow:hidden}pl-status:before{background:pink;flex:1 2 auto;width:3px;height:10px;display:inline-block;inset:3px 0}pl-status.busy{--status-color:var(--process-busy)}pl-status.finished{--status-color:var(--process-finished)}pl-status.failed{--status-color:var(--process-failed)}pl-status.can_open{cursor:auto;border-color:#98989854}pl-status.can_open>div{cursor:pointer;border-top-left-radius:0;border-bottom-left-radius:0}pl-status.can_open.is_open{border-color:var(--status-color)}pl-status[data-depth="0"],pl-status[data-depth="1"]{margin-left:0}pl-status>div{background:var(--process-item-bg);border-radius:.4em;flex-direction:row;align-items:center;padding:.2em;display:flex}pl-status>div>.status-icon{content:"";background-color:var(--status-color);border-radius:50%;flex:none;width:1em;height:1em;margin:0 .5em;display:inline-block}pl-status.busy>div>.status-icon{border:3px solid #7ab881;border-color:#0000 #7ab881 #7ab881 #0000;animation:1.7s linear infinite identifier-spin}@keyframes identifier-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.subprogress-counter{opacity:.5;font-size:.8em}pl-status .status-time{opacity:.6;font-variant-numeric:tabular-nums;margin-left:auto;padding-left:.5em;padding-right:.5em;font-size:.7rem}.discrete-progress-bar{background:var(--process-item-bg);contain:strict;border-radius:4px;flex-direction:row;align-items:stretch;gap:2px;height:1em;padding:3px;display:flex}.discrete-progress-bar>div{background:var(--process-undefined);border-radius:2px;flex:auto}.discrete-progress-bar>div.done{background:var(--process-finished)}.discrete-progress-bar>div.busy{background:var(--process-busy)}.discrete-progress-bar>div.failed{background:var(--process-failed)}.discrete-progress-bar.mid{gap:1px}.discrete-progress-bar.big{gap:0}pl-status pkg-terminal{margin-left:var(--indent)}pluto-helpbox.helpbox-process>section{padding-bottom:3.6rem}.notify-when-done{font-family:var(--system-ui-font-stack);opacity:0;-webkit-user-select:none;user-select:none;justify-content:center;font-size:.8rem;font-weight:700;transition:opacity .2s;display:flex;position:absolute;bottom:.3em;left:0;right:0}.notify-when-done.visible{opacity:1}.notify-when-done.visible label{cursor:pointer}.notify-when-done label{background:var(--process-notify-bg);border-radius:1000px;align-items:center;padding:.3em .6em;display:flex;box-shadow:0 3px 5px #0000003b}.notify-when-done label:before{content:"";width:1em;height:1em;filter:var(--image-filters);background-image:url(notifications-outline.aa91b431.svg);background-size:contain;margin-bottom:-.2em;margin-right:.3em;display:inline-block}footer{width:100%;min-height:3.5rem;font-family:var(--roboto-mono-font-stack);background-color:var(--footer-bg-color);color:var(--footer-color);z-index:70;font-size:.75rem}footer form{opacity:1;flex-wrap:wrap;min-height:1.5rem;transition:opacity 5s;display:flex}footer form>*{flex:none}footer form>a,footer form>label{align-self:center}footer form>label,footer form>a{margin-right:1em}footer a{color:var(--footer-atag-color);opacity:.6;font-weight:700}@media (width<=650px){footer form>label{display:none}}footer input{border:2px solid var(--footer-input-border-color);background:var(--white);font-family:inherit;font-size:inherit;border-right:none;border-radius:3px 0 0 3px;margin:0;padding:3px}header#pluto-nav pluto-filepicker button,footer button{background:var(--footer-filepicker-focus-color);border:3px solid var(--footer-filepicker-focus-color);color:var(--footer-filepicker-button-color);border-radius:0 3px 3px 0;height:auto;margin:0;font-family:inherit;font-size:.75rem;font-weight:600}footer #info{text-align:right;flex-direction:row;justify-content:flex-end;align-items:center;max-width:9400px;margin:0 auto;padding:1rem;display:flex}nav#undo_delete{z-index:2000;font-family:var(--roboto-mono-font-stack);background-color:var(--white);color:var(--black);box-shadow:0px 0px 10px 2px var(--undo-delete-box-shadow-color);opacity:1;border-radius:3px;margin:.75rem;padding:.5rem;font-size:.75rem;transition:box-shadow .2s linear,margin-bottom .2s ease-out,opacity 50ms linear;display:block;position:fixed;bottom:0;left:0}nav#undo_delete.hidden{box-shadow:0px 0px 10px -5px var(--undo-delete-box-shadow-color);opacity:0;pointer-events:none;margin-bottom:0}@keyframes shadow-fadeout{0%{box-shadow:0px 0px 10px 2px var(--undo-delete-box-shadow-color);opacity:1}80%{opacity:1}to{opacity:0}}pluto-logs-container{z-index:25;max-height:50vh;margin-right:1.3rem;display:block;overflow:hidden auto}pluto-logs-container:not(:empty){background:var(--pluto-logs-bg-color);padding:6px}pluto-logs-container>header{font-family:var(--roboto-mono-font-stack);opacity:.6;padding:.2em .2em 0;font-size:1.3rem;font-weight:700}pluto-logs-container pluto-progress-bar-container{outline:3px solid var(--pluto-logs-progress-border);outline-offset:-2px;background:var(--pluto-logs-progress-bg);border-radius:6px;flex:0 200px;font-size:.7rem;overflow:hidden}pluto-logs-container pluto-progress-name{white-space:pre-wrap;font-family:var(--julia-mono-font-stack);font-variant-ligatures:none;padding:0 .4rem 0 .1rem;font-size:.8rem}pluto-logs-container pluto-progress-name:empty{padding:0}pluto-logs-container pluto-progress-bar{--c:var(--pluto-logs-progress-fill);background:linear-gradient(90deg,var(--c),var(--c));background-repeat:no-repeat;align-items:center;padding:.3em .6em;transition:background-size .5s cubic-bezier(.14,.71,0,.99),opacity .2s linear;display:grid}pluto-logs-container pluto-progress-bar.collapsed{height:0}pluto-logs{flex-direction:column;display:flex}pluto-logs:not(:first-child):not(:empty){margin-top:10px}pluto-log-dot{font-family:var(--roboto-mono-font-stack);flex-direction:column;flex-grow:1;min-width:18px;min-height:18px;padding:.6em .9em .6em .3em;font-size:.6rem;display:flex;position:relative}pluto-log-dot-positioner{--bg-color:var(--pluto-logs-info-color);--accent-color:var(--pluto-logs-info-accent-color);--icon-image:unset;background:var(--bg-color);background:linear-gradient(148deg,var(--bg-color),transparent);background-size:200% 100%;border-radius:6px;flex-direction:row;margin:2px;display:flex}pluto-log-dot>pre{color:var(--accent-color)}pluto-log-truncated{font-family:var(--system-ui-font-stack);opacity:.7;place-items:center;padding:.7em;font-style:italic;display:grid}pluto-log-icon:before{content:"";background-image:var(--icon-image);width:1em;height:1em;filter:var(--image-filters);background-size:1em;margin:.3em;display:inline-flex}pluto-log-dot-positioner.Info{--icon-image:url(information-circle-outline.008b2bb9.svg)}pluto-log-dot-positioner.Info pluto-log-icon:before{opacity:.4}pluto-log-dot-positioner.Warn{--bg-color:var(--pluto-logs-warn-color);--accent-color:var(--pluto-logs-warn-accent-color);--icon-image:url(warning-outline.d84ed9e8.svg)}pluto-log-dot-positioner.Error{--bg-color:var(--pluto-logs-danger-color);--accent-color:var(--pluto-logs-danger-accent-color);--icon-image:url(close-circle-outline.4baeedb9.svg)}pluto-log-dot-positioner.Debug{--bg-color:var(--pluto-logs-debug-color);--accent-color:var(--pluto-logs-debug-accent-color);--icon-image:url(information-circle-outline.008b2bb9.svg)}pluto-log-dot-positioner.Stdout{--icon-image:url(terminal-outline.79a23031.svg)}pluto-log-dot-positioner.Stdout pluto-log-icon:before{opacity:.4}pluto-log-dot.Progress{flex-direction:row;align-self:center;align-items:center;padding:0;display:flex}pluto-log-dot.Stdout{--inner:#71624b;--outer:#50483f;background:radial-gradient(var(--inner),var(--inner)20%,var(--outer));color:#c0ffab;text-shadow:1px 1px 2px #0000005e;border:6px solid #b7b7b7;border-radius:8px;min-width:18em}pluto-log-dot.Stdout:after,pluto-log-dot.Stdout:before{content:" ";pointer-events:none;display:block;position:absolute;inset:0}pluto-log-dot.Stdout:before{opacity:.3;background:linear-gradient(349deg,#000,#0000)}pluto-log-dot.Stdout:after{--crt-spacing:7px;background:linear-gradient(#534837,#0000,#1a1a1a);background-size:100% var(--crt-spacing);opacity:.2;background-repeat:repeat;animation:1s linear infinite paused scroll-crt}pluto-log-dot.Stdout pre:before{content:" ";float:right;width:24px}a.stdout-info{z-index:unset;pointer-events:initial;position:absolute;top:2px;right:2px}@keyframes scroll-crt{0%{background-position:0 0}to{background-position:0px var(--crt-spacing)}}@media (prefers-reduced-motion:no-preference){pluto-log-dot.Stdout:hover:after{animation-play-state:running}}@media (prefers-contrast:more){pluto-log-dot.Stdout:after{display:none!important}}pluto-log-dot jlerror{background:var(--main-bg-color);border-radius:.5rem;padding:.6rem;display:block}pluto-log-dot jltree,pluto-log-dot jlpair{font-size:.6rem}pluto-log-dot>img{max-width:100px}pluto-log-dot-kwarg{flex-flow:wrap;display:flex}pluto-log-dot-kwarg>*{flex:0 auto}pluto-log-dot-kwarg>pluto-key{color:var(--pluto-logs-key-color);margin-right:calc(1em - 30px)}pluto-log-dot-kwarg>pluto-key:after{content:": "}pluto-log-dot-kwarg>pluto-value{margin-left:30px;overflow-x:auto}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{z-index:100;display:flex;position:fixed;bottom:0;right:0}nav#slide_controls>button{padding:5px;position:static}button.floating_back_button>span:after,nav#slide_controls>button>span:after{background-size:30px 30px;width:30px;height:30px;display:block;content:" "!important}button.floating_back_button>span:after,nav#slide_controls>button.prev>span:after{filter:var(--image-filters);background-image:url(arrow-back-outline.9ae1bed8.svg)}nav#slide_controls>button.next>span:after{filter:var(--image-filters);background-image:url(arrow-forward-outline.f5f68f5c.svg)}button.floating_back_button{z-index:1000;display:flex;position:fixed;top:1em;left:1em}.cm-editor .cm-tooltip{border:1px solid var(--cm-color-editor-tooltip-border);border-radius:4px;box-shadow:3px 3px 4px #0003}.cm-tooltip-lint{z-index:100;font-family:JuliaMono;font-size:.75rem}.cm-tooltip-autocomplete{box-sizing:content-box;z-index:100;max-height:320px}.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]{color:var(--cm-color-editor-li-aria-selected);background:var(--cm-color-editor-li-aria-selected-bg)}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li[aria-selected] .cm-completionLabel{border-color:#0000}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li .cm-completionDetail{float:right;font-size:.8em;font-family:var(--julia-mono-font-stack);margin-right:.5em;font-style:normal}.cm-editor .cm-tooltip.cm-tooltip-autocomplete li.c_notexported{color:var(--cm-color-editor-li-notexported)}.cm-editor .cm-completionIcon{opacity:1;width:1em;transform:translateY(-1.5px)}.cm-completionIcon:before{content:"⚫";color:#0000;opacity:1;margin-right:.5em;font-size:.75rem;font-family:var(--julia-mono-font-stack)!important}[data-pluto-variable]{font-weight:inherit}[data-pluto-variable],[data-pluto-variable]:hover,.cm-editor .cm-tooltip.cm-tooltip-autocomplete li.c_from_notebook .cm-completionLabel{text-decoration:underline;-webkit-text-decoration-color:var(--cm-color-clickable-underline);-webkit-text-decoration-color:var(--cm-color-clickable-underline);text-decoration-color:var(--cm-color-clickable-underline);text-decoration-skip-ink:none;font-weight:700;text-decoration-thickness:3px}body.disable_ui [data-pluto-variable],body.disable_ui [data-cell-variable]{cursor:pointer}body:not(.disable_ui) [data-ctrl-down=true][data-pluto-variable],body:not(.disable_ui) [data-ctrl-down=true][data-cell-variable]{cursor:pointer;text-decoration-color:#d177e6}body:not(.disable_ui) [data-ctrl-down=true][data-pluto-variable]:hover,body:not(.disable_ui) [data-ctrl-down=true][data-pluto-variable]:hover *{text-shadow:0 0 #af5bc3;color:#0000!important}[data-cell-variable]{text-decoration:none}[data-ctrl-down=true][data-cell-variable]:hover *{text-shadow:0 0 #af5bc3;color:#0000!important}.cm-tooltip.cm-tooltip-autocomplete{background:var(--autocomplete-menu-bg-color);margin-left:-1.5em;padding:0}pluto-input .cm-editor .cm-scroller{overflow-y:hidden}pluto-input .cm-editor .cm-content,pluto-input .cm-editor .cm-scroller,.cm-editor .cm-tooltip-autocomplete .cm-completionLabel{font-variant-ligatures:none;font-size:.8rem;font-family:var(--julia-mono-font-stack)!important}pluto-input .cm-editor .cm-content{padding:2px 0}.cm-editor .cm-scroller>.cm-selectionLayer .cm-selectionBackground{background:var(--cm-selection-background-blurred)}.cm-editor.cm-focused .cm-scroller>.cm-selectionLayer .cm-selectionBackground{background:var(--cm-selection-background)}.cm-editor{background:var(--code-background);color:var(--cm-color-editor-text)}.cm-editor.cm-focused:not(.__){outline:unset}.cm-editor .cm-gutter{min-width:31px;min-height:23px}.cm-editor .cm-gutters{background:0 0;border-right:1px solid #0000}pluto-cell.code_differs .cm-editor .cm-gutters{background-color:var(--cm-color-code-differs-gutters)}.cm-editor .cm-lineNumbers .cm-gutterElement{color:#0000}.cm-editor .cm-lineNumbers .cm-gutterElement:after{content:"⋅";color:var(--cm-color-line-numbers);pointer-events:none;font-size:.75rem;position:absolute;right:3px}.cm-editor .cm-lineNumbers .cm-gutterElement:hover{color:var(--cm-color-line-numbers)}.cm-editor .cm-lineNumbers .cm-gutterElement:hover:after{color:#0000}pluto-cell.errored .cm-editor .cm-lineNumbers .cm-gutterElement{color:var(--cm-color-line-numbers)}pluto-cell.errored .cm-editor .cm-lineNumbers .cm-gutterElement:after{color:#0000}@media print{.cm-editor .cm-lineNumbers .cm-gutterElement{color:var(--cm-color-line-numbers)!important}.cm-editor .cm-lineNumbers .cm-gutterElement:after{color:#0000!important}}.cm-completionIcon-c_Number:before{color:var(--cm-color-number)}.cm-completionIcon-c_String:before,.cm-completionIcon-completion_path:before,.cm-completionIcon-completion_dict:before{color:var(--cm-color-string)}.cm-completionIcon-completion_property:before{color:var(--cm-color-property)}.cm-completionIcon-completion_keyword:before{color:var(--cm-color-keyword)}li.completion_keyword_argument .cm-completionLabel{font-style:italic;font-weight:700}.cm-completionIcon-completion_keyword_argument:before{color:var(--cm-color-number)}.cm-completionIcon-c_Any:before,pluto-output>assignee,pluto-popup code.auto_disabled_variable{font-weight:700;color:var(--cm-color-var)!important}.cm-completionIcon-c_Function:before{color:var(--cm-color-function)}.cm-completionIcon-c_Macro:before{color:var(--cm-color-macro)}.cm-completionIcon-c_Array:before{color:var(--cm-color-bracket)}.cm-completionIcon-c_package:before,.cm-completionIcon-c_Module:before{color:var(--cm-color-link)}.cm-editor .cm-activeLine{background:unset}.cm-selectionMatch{text-shadow:0 0 8px #00000080;background:0 0!important}@media (prefers-color-scheme:dark){.cm-selectionMatch{text-shadow:0 0 8px #ffffff80;background:0 0!important}}.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-color-matchingBracket-bg);border-radius:2px;font-weight:700;color:var(--cm-color-matchingBracket)!important}.cm-editor .cm-placeholder{color:var(--cm-color-placeholder-text);font-style:italic}.cm-completionMatchedText{-webkit-text-decoration:unset!important;-webkit-text-decoration:unset!important;text-decoration:unset!important}.awesome-wrapping-plugin-the-line{--correction:0px;margin-left:calc(var(--indented));text-indent:calc(-1*var(--indented))}.awesome-wrapping-plugin-the-line>*{text-indent:initial}.awesome-wrapping-plugin-the-tabs{white-space:pre;vertical-align:top;margin-left:-1px}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:medium 2px 2px medium;border-top-style:none;border-top-color:currentColor;border-left-style:none;border-left-color:currentColor}pluto-cell.hooked_up>pluto-runarea{opacity:1;background-color:var(--pluto-cell-force-color)}pluto-cell.hooked_up pluto-runarea>span{color:#0000004f}pluto-cell.hooked_up pluto-output{border-top:2px solid;border-bottom:2px solid;border-right:2px solid;border-color:var(--pluto-cell-force-color);border-top-right-radius:4px}.fm-table{grid-template-columns:auto 1fr min-content;gap:.3em 1em;display:grid}.pluto-frontmatter{font-family:var(--system-ui-font-stack);width:min(31rem,90vw);color:var(--export-color);background:var(--export-bg-color);border-radius:1em;padding:1em 1.5em}.pluto-frontmatter .card-preview{background:var(--white);border-radius:1rem;margin:1rem 0;padding:1.2rem 1.1rem;box-shadow:inset 0 0 15px -4px #00000054}.pluto-frontmatter .card-preview>h2{color:var(--black);margin-block-start:0}.pluto-frontmatter button{cursor:pointer;background-color:var(--frontmatter-button-bg-color);border:2px solid var(--frontmatter-button-bg-color);border-radius:.5em;font-weight:500}.pluto-frontmatter button:hover{border-color:var(--frontmatter-input-border-color)}.pluto-frontmatter input{background-color:var(--frontmatter-input-bg-color);border:2px solid var(--frontmatter-input-border-color);border-radius:.5em;padding:.3em .5em}.pluto-frontmatter rbl-tag-input{color:var(--black)}.pluto-frontmatter label{font-weight:500}.pluto-frontmatter .deletefield{color:var(--export-color);background-color:#0000;border-width:0;align-self:stretch;margin-left:-1em}.pluto-frontmatter .addentry{grid-column:1/3;margin-top:.5em}.pluto-frontmatter fieldset{grid-column:1/4}.pluto-frontmatter .final{justify-content:flex-end;gap:.5em;margin-top:2rem;display:flex}.markdown-code-block-button{cursor:pointer;float:right;background:0 0;border:none;justify-content:center;align-items:center;padding:0;display:block;position:relative}.markdown-code-block-button:before{content:"";width:14px;height:14px;filter:var(--image-filters);background-image:url(copy-outline.0f561529.svg);display:block}.markdown-code-block-copied-code-button:before{background-image:url(checkmark-outline.4fb8c646.svg)} \ No newline at end of file diff --git a/frontend-dist/editor.46c98966.css b/frontend-dist/editor.46c98966.css new file mode 100644 index 000000000..e52ebc94b --- /dev/null +++ b/frontend-dist/editor.46c98966.css @@ -0,0 +1 @@ +main{cursor:auto;margin-top:20px}body header#pluto-nav,preamble>button,pluto-cell>button,pluto-input>button,pluto-shoulder,footer,pluto-runarea,jlerror .doclink,.dont-panic,#helpbox-wrapper{display:none!important}@media print{.pluto-frontmatter,.edit_or_run,.loading-bar,.floating_back_button,.outline-frame,.outline-frame-actions-container,pkg-status-mark,.MJX_ToolTip,.MJX_HoverRegion,.MJX_LiveRegion,nav#undo_delete{display:none!important}main{padding-bottom:0}pluto-input .cm-editor{border-left:1px solid var(--normal-cell-color);border-radius:4px!important}pluto-cell{break-inside:avoid}pluto-cell.code_folded:has(p){break-inside:auto}pluto-output>div>div.markdown>hr,pluto-output>div>div>hr{visibility:hidden;break-after:page;height:0;margin:0}pluto-output h1{break-before:page}pluto-cell:first-of-type pluto-output h1,pluto-output :is(.admonition,.pluto-docs-binding,blockquote) h1{break-before:avoid}pluto-output :is(h1,h2,h3,h4){break-after:avoid}}@page{widows:2} \ No newline at end of file diff --git a/frontend-dist/editor.4b0b4f92.js b/frontend-dist/editor.4b0b4f92.js new file mode 100644 index 000000000..ec968211e --- /dev/null +++ b/frontend-dist/editor.4b0b4f92.js @@ -0,0 +1,1429 @@ +function e(e,t,n,a){Object.defineProperty(e,t,{get:n,set:a,enumerable:!0,configurable:!0})}var t,n=globalThis,a={},r={},o=n.parcelRequire94c2;null==o&&((o=function(e){if(e in a)return a[e].exports;if(e in r){var t=r[e];delete r[e];var n={id:e,exports:{}};return a[e]=n,t.call(n.exports,n,n.exports),n.exports}var o=Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}).register=function(e,t){r[e]=t},n.parcelRequire94c2=o);var i=o.register;i("7xJa8",function(t,n){function a(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a3?t.i-4:t.i:Array.isArray(e)?1:m(e)?2:h(e)?3:0}function c(e,t){return 2===s(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return 2===s(e)?e.get(t):e[t]}function d(e,t,n){var a=s(e);2===a?e.set(t,n):3===a?(e.delete(t),e.add(n)):e[t]=n}function p(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function m(e){return W&&e instanceof Map}function h(e){return Z&&e instanceof Set}function g(e){return e.o||e.t}function f(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=et(e);delete t[Y];for(var n=ee(t),a=0;a1&&(e.set=e.add=e.clear=e.delete=b),Object.freeze(e),t&&l(e,function(e,t){return _(t,!0)},!0)),e}function b(){a(2)}function y(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function v(e){var t=en[e];return t||a(18,e),t}function w(e,t){en[e]||(en[e]=t)}function k(e,t){t&&(v("Patches"),e.u=[],e.s=[],e.v=t)}function E(e){$(e),e.p.forEach(S),e.p=null}function $(e){e===G&&(G=e.l)}function x(e){return G={p:[],l:G,h:e,m:!0,_:0}}function S(e){var t=e[Y];0===t.i||1===t.i?t.j():t.g=!0}function N(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||v("ES5").S(t,e,r),r?(n[Y].P&&(E(t),a(4)),o(e)&&(e=C(t,e),t.l||M(t,e)),t.u&&v("Patches").M(n[Y],e,t.u,t.s)):e=C(t,n,[]),E(t),t.u&&t.v(t.u,t.s),e!==Q?e:void 0}function C(e,t,n){if(y(t))return t;var a=t[Y];if(!a)return l(t,function(r,o){return A(e,a,t,r,o,n)},!0),t;if(a.A!==e)return t;if(!a.P)return M(e,a.t,!0),a.t;if(!a.I){a.I=!0,a.A._--;var r=4===a.i||5===a.i?a.o=f(a.k):a.o;l(3===a.i?new Set(r):r,function(t,o){return A(e,a,r,t,o,n)}),M(e,r,!1),n&&e.u&&v("Patches").R(a,n,e.u,e.s)}return a.o}function A(e,t,n,a,i,l){if(r(i)){var s=C(e,i,l&&t&&3!==t.i&&!c(t.D,a)?l.concat(a):void 0);if(d(n,a,s),!r(s))return;e.m=!1}if(o(i)&&!y(i)){if(!e.h.N&&e._<1)return;C(e,i),t&&t.A.l||M(e,i)}}function M(e,t,n){void 0===n&&(n=!1),e.h.N&&e.m&&_(t,n)}function O(e,t){var n=e[Y];return(n?g(n):e)[t]}function T(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var a=Object.getOwnPropertyDescriptor(n,t);if(a)return a;n=Object.getPrototypeOf(n)}}function D(e){e.P||(e.P=!0,e.l&&D(e.l))}function R(e){e.o||(e.o=f(e.t))}function L(e,t,n){var a,r,o,i,l,s,c,u=m(t)?v("MapSet").T(t,n):h(t)?v("MapSet").F(t,n):e.O?(o=r={i:(a=Array.isArray(t))?1:0,A:n?n.A:G,P:!1,I:!1,D:{},l:n,t:t,k:null,o:null,j:null,C:!1},i=ea,a&&(o=[r],i=er),s=(l=Proxy.revocable(o,i)).revoke,c=l.proxy,r.k=c,r.j=s,c):v("ES5").J(t,n);return(n?n.A:G).p.push(u),u}function I(e){return r(e)||a(22,e),function e(t){if(!o(t))return t;var n,a=t[Y],r=s(t);if(a){if(!a.P&&(a.i<4||!v("ES5").K(a)))return a.t;a.I=!0,n=P(t,r),a.I=!1}else n=P(t,r);return l(n,function(t,r){a&&u(a.t,t)===r||d(n,t,e(r))}),3===r?new Set(n):n}(e)}function P(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return f(e)}function j(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Y];return ea.get(t,e)},set:function(t){var n=this[Y];ea.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var r=e[t][Y];if(!r.P)switch(r.i){case 5:a(r)&&D(r);break;case 4:n(r)&&D(r)}}}function n(e){for(var t=e.t,n=e.k,a=ee(n),r=a.length-1;r>=0;r--){var o=a[r];if(o!==Y){var i=t[o];if(void 0===i&&!c(t,o))return!0;var l=n[o],s=l&&l[Y];if(s?s.t!==i:!p(l,i))return!0}}var u=!!t[Y];return a.length!==ee(t).length+(u?0:1)}function a(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!n||n.get)}var o={};w("ES5",{J:function(t,n){var a=Array.isArray(t),r=function(t,n){if(t){for(var a=Array(n.length),r=0;rr),e(t.exports,"isDraftable",()=>o),e(t.exports,"immerable",()=>X),e(t.exports,"original",()=>i),e(t.exports,"freeze",()=>_),e(t.exports,"nothing",()=>Q),e(t.exports,"current",()=>I),e(t.exports,"enableES5",()=>j),e(t.exports,"enablePatches",()=>B),e(t.exports,"enableMapSet",()=>U),e(t.exports,"enableAllPlugins",()=>F),e(t.exports,"castDraft",()=>z),e(t.exports,"castImmutable",()=>q),e(t.exports,"Immer",()=>eo),e(t.exports,"produce",()=>el),e(t.exports,"produceWithPatches",()=>es),e(t.exports,"setAutoFreeze",()=>ec),e(t.exports,"setUseProxies",()=>eu),e(t.exports,"applyPatches",()=>ed),e(t.exports,"createDraft",()=>ep),e(t.exports,"finishDraft",()=>em),e(t.exports,"default",()=>eh);var H,G,K="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),W="undefined"!=typeof Map,Z="undefined"!=typeof Set,V="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Q=K?Symbol.for("immer-nothing"):((H={})["immer-nothing"]=!0,H),X=K?Symbol.for("immer-draftable"):"__$immer_draftable",Y=K?Symbol.for("immer-state"):"__$immer_state",J="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",ee="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,et=Object.getOwnPropertyDescriptors||function(e){var t={};return ee(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},en={},ea={get:function(e,t){if(t===Y)return e;var n,a,r=g(e);if(!c(r,t))return(a=T(r,t))?"value"in a?a.value:null===(n=a.get)||void 0===n?void 0:n.call(e.k):void 0;var i=r[t];return e.I||!o(i)?i:i===O(e.t,t)?(R(e),e.o[t]=L(e.A.h,i,e)):i},has:function(e,t){return t in g(e)},ownKeys:function(e){return Reflect.ownKeys(g(e))},set:function(e,t,n){var a=T(g(e),t);if(null==a?void 0:a.set)return a.set.call(e.k,n),!0;if(!e.P){var r=O(g(e),t),o=null==r?void 0:r[Y];if(o&&o.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(p(n,r)&&(void 0!==n||c(e.t,t)))return!0;R(e),D(e)}return e.o[t]=n,e.D[t]=!0,!0},deleteProperty:function(e,t){return void 0!==O(e.t,t)||t in e.t?(e.D[t]=!1,R(e),D(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=g(e),a=Reflect.getOwnPropertyDescriptor(n,t);return a?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:a.enumerable,value:n[t]}:a},defineProperty:function(){a(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){a(12)}},er={};l(ea,function(e,t){er[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),er.deleteProperty=function(e,t){return ea.deleteProperty.call(this,e[0],t)},er.set=function(e,t,n){return ea.set.call(this,e[0],t,n,e[0])};var eo=function(){function e(e){this.O=V,this.N=!0,"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),this.produce=this.produce.bind(this),this.produceWithPatches=this.produceWithPatches.bind(this)}var t=e.prototype;return t.produce=function(e,t,n){if("function"==typeof e&&"function"!=typeof t){var r,i=t;t=e;var l=this;return function(e){var n=this;void 0===e&&(e=i);for(var a=arguments.length,r=Array(a>1?a-1:0),o=1;o1?n-1:0),o=1;o=0;n--){var n,a=t[n];if(0===a.path.length&&"replace"===a.op){e=a.value;break}}var o=v("Patches").$;return r(e)?o(e,t):this.produce(e,function(e){return o(e,t.slice(n+1))})},e}(),ei=new eo,el=ei.produce,es=ei.produceWithPatches.bind(ei),ec=ei.setAutoFreeze.bind(ei),eu=ei.setUseProxies.bind(ei),ed=ei.applyPatches.bind(ei),ep=ei.createDraft.bind(ei),em=ei.finishDraft.bind(ei),eh=el}),i("5nXoD",function(e,t){var n=o("g774k");e.exports=n("g8zEq").then(()=>o("8WRsO"))}),i("g774k",function(e,t){e.exports=function(e){return import(o("ko7kR").resolve(e))}}),i("cFvm7",function(e,t){var n=o("g774k");e.exports=Promise.all([n("g8zEq"),n("9IVCm")]).then(()=>o("4rxkr"))});var l=o("cNaMA");o("eS9BV");var l=o("cNaMA"),s=o("7xJa8"),c=s.default;(0,s.enablePatches)(),(0,s.setAutoFreeze)(!1);var s=o("7xJa8"),u=o("9Ta4i"),d=(o("4zMEb"),o("4zMEb"));let p=async e=>e(),m=null;const h=async()=>(null==m&&(m=p(async()=>{let[{initializeApp:e},t]=await Promise.all([o("5nXoD"),o("cFvm7")]),{getFirestore:n,addDoc:a,doc:r,collection:i}=t,l=e({apiKey:"AIzaSyC0DqEcaM8AZ6cvApXuNcNU2RgZZOj7F68",authDomain:"localhost",projectId:"pluto-feedback"}),s=n(l),c=i(s,"feedback"),u=async e=>{let t=await a(c,e);console.debug("Firestore doc created ",t.id,t)};return console.log("\uD83D\uDD25base loaded",{initializeApp:e,firestore_module:t,app:l,db:s,feedback_db:c,add_feedback:u}),u})),await m),g=async()=>{try{let e=document.querySelector("form#feedback");if(null==e)return;e.addEventListener("submit",t=>{let n=prompt("Would you like us to contact you?\n\nEmail: (leave blank to stay anonymous \uD83D\uDC40)");t.preventDefault(),p(async()=>{try{let a=String(new FormData(t.target).get("opinion"));if(a.length<4)return;let r=await h();await (0,d.timeout_promise)(r({feedback:a,timestamp:Date.now(),email:n||""}),5e3);let o="Submitted. Thank you for your feedback! \uD83D\uDC95";console.log(o),alert(o),e.querySelector("#opinion").value=""}catch(t){let e="Whoops, failed to send feedback \uD83D\uDE22\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(e),console.error(t),alert(e+t)}})}),e.addEventListener("focusin",()=>{h()})}catch(e){for(let t of(console.error("Something went wrong loading the feedback form:",e),document.querySelector("form#feedback").style.opacity=0,"Oh noooooooooooooooooo..."))document.querySelector("form#feedback input").value+=t,await new Promise(e=>setTimeout(e,200))}};function f(e){return e.replace(/\r\n/g,"\n").split(/# ╔═╡ \S+\n/).map(e=>e.trim()).filter(e=>""!==e)}const _="julia> ";function b(e){let t=e.replace(/\r\n/g,"\n").split(_),n=" ".repeat(prompt.length);return t.map(function(e){return(n+e).split("\n").filter(e=>e.startsWith(n)).map(e=>e.replace(n,"")).join("\n")}).map(e=>e.trim()).filter(e=>""!==e)}const y=e=>e.trim().startsWith(_)?b:e.match(/# ╔═╡ ........-....-....-....-............/g)?.length?f:null;var v=o("2ZZ1r"),l=o("cNaMA"),w=o("aN0pg"),l=o("cNaMA");let k=(0,l.createContext)(),E=(0,l.createContext)(null),$=(0,l.createContext)(null);class x extends Set{constructor(e){super(),this.callback=e}delete(e){let t=super.delete(e);return t&&0===this.size&&this.callback(),t}}var S=o("kjWx8");const N=()=>"visible"===document.visibilityState?Promise.resolve():new Promise(e=>{let t=()=>{N().then(e),document.removeEventListener("visibilitychange",t)};document.addEventListener("visibilitychange",t)}),C=({any_code_differs:e,last_update_time:t,last_hot_reload_time:n,connected:a})=>{let r=(0,l.useContext)(k),[o,i]=(0,l.useState)(""),[s,c]=(0,l.useState)(""),u=(0,l.useRef)(null),d=(0,l.useRef)(null);(0,l.useEffect)(()=>(clearTimeout(u?.current),e?i("ask_to_save"):Date.now()-t<1e3?(i("saved"),u.current=setTimeout(()=>{i("")},1e3)):i(""),()=>clearTimeout(u?.current)),[e]);let[p,m]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{a&&setTimeout(()=>m(!0),1e3)},[a]),(0,l.useEffect)(()=>{if(console.log("Hottt",n,p),p)return c("reloaded_from_file"),console.log("set state"),N().then(()=>{d.current=setTimeout(()=>{c(""),console.log("reset state")},8e3)}),()=>clearTimeout(d?.current)},[n]),(0,l.html)` + ${"ask_to_save"===o?(0,l.html)` + + {i("saving"),r.set_and_run_all_changed_remote_cells()}} + class=${(0,w.cl)({runallchanged:!0})} + title="Save and run all changed cells" + > + Save all changes ${S.is_mac_keyboard?(0,l.html)`⌘ S`:(0,l.html)`Ctrl+S`} + + + `:"saved"===o||"saving"===o?(0,l.html)` + + Saved + + `:"reloaded_from_file"===s?(0,l.html)` + + File change detected, notebook updated + + `:null} + `};var l=o("cNaMA"),u=o("9Ta4i"),l=(o("cNaMA"),o("cNaMA")),{entries:A,setPrototypeOf:M,isFrozen:O,getPrototypeOf:T,getOwnPropertyDescriptor:D}=Object,{freeze:R,seal:L,create:I}=Object,{apply:P,construct:j}="u">typeof Reflect&&Reflect;R||(R=function(e){return e}),L||(L=function(e){return e}),P||(P=function(e,t,n){return e.apply(t,n)}),j||(j=function(e,t){return new e(...t)});var B=X(Array.prototype.forEach),U=X(Array.prototype.pop),F=X(Array.prototype.push),z=X(String.prototype.toLowerCase),q=X(String.prototype.toString),H=X(String.prototype.match),G=X(String.prototype.replace),K=X(String.prototype.indexOf),W=X(String.prototype.trim),Z=X(Object.prototype.hasOwnProperty),V=X(RegExp.prototype.test),Q=(t=TypeError,function(){for(var e=arguments.length,n=Array(e),a=0;a1?n-1:0),r=1;r2&&void 0!==arguments[2]?arguments[2]:z;M&&M(e,null);let a=t.length;for(;a--;){let r=t[a];if("string"==typeof r){let e=n(r);e!==r&&(O(t)||(t[a]=e),r=e)}e[r]=!0}return e}function J(e){let t=I(null);for(let[n,a]of A(e))Z(e,n)&&(Array.isArray(a)?t[n]=function(e){for(let t=0;t/gm),eh=L(/\$\{[\w\W]*}/gm),eg=L(/^data-[\-\w.\u00B7-\uFFFF]+$/),ef=L(/^aria-[\-\w]+$/),e_=L(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),eb=L(/^(?:\w+script|data):/i),ey=L(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ev=L(/^html$/i),ew=Object.freeze({__proto__:null,ARIA_ATTR:ef,ATTR_WHITESPACE:ey,CUSTOM_ELEMENT:L(/^[a-z][.\w]*(-[.\w]+)+$/i),DATA_ATTR:eg,DOCTYPE_NAME:ev,ERB_EXPR:em,IS_ALLOWED_URI:e_,IS_SCRIPT_OR_DATA:eb,MUSTACHE_EXPR:ep,TMPLIT_EXPR:eh}),ek={element:1,text:3,progressingInstruction:7,comment:8,document:9},eE=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null,a="data-tt-policy-suffix";t&&t.hasAttribute(a)&&(n=t.getAttribute(a));let r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},e$=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ex=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:typeof window>"u"?null:window,n=t=>e(t);if(n.version="3.2.3",n.removed=[],!t||!t.document||t.document.nodeType!==ek.document)return n.isSupported=!1,n;let{document:a}=t,r=a,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:l,Node:s,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:p,DOMParser:m,trustedTypes:h}=t,g=c.prototype,f=ee(g,"cloneNode"),_=ee(g,"remove"),b=ee(g,"nextSibling"),y=ee(g,"childNodes"),v=ee(g,"parentNode");if("function"==typeof l){let e=a.createElement("template");e.content&&e.content.ownerDocument&&(a=e.content.ownerDocument)}let w,k="",{implementation:E,createNodeIterator:$,createDocumentFragment:x,getElementsByTagName:S}=a,{importNode:N}=r,C=e$();n.isSupported="function"==typeof A&&"function"==typeof v&&E&&void 0!==E.createHTMLDocument;let{MUSTACHE_EXPR:M,ERB_EXPR:O,TMPLIT_EXPR:T,DATA_ATTR:D,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:P,ATTR_WHITESPACE:j,CUSTOM_ELEMENT:X}=ew,{IS_ALLOWED_URI:ep}=ew,em=null,eh=Y({},[...et,...en,...ea,...eo,...el]),eg=null,ef=Y({},[...es,...ec,...eu,...ed]),eb=Object.seal(I(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ey=null,ex=null,eS=!0,eN=!0,eC=!1,eA=!0,eM=!1,eO=!0,eT=!1,eD=!1,eR=!1,eL=!1,eI=!1,eP=!1,ej=!0,eB=!1,eU=!0,eF=!1,ez={},eq=null,eH=Y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),eG=null,eK=Y({},["audio","video","img","source","image","track"]),eW=null,eZ=Y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),eV="http://www.w3.org/1998/Math/MathML",eQ="http://www.w3.org/2000/svg",eX="http://www.w3.org/1999/xhtml",eY=eX,eJ=!1,e0=null,e1=Y({},[eV,eQ,eX],q),e2=Y({},["mi","mo","mn","ms","mtext"]),e3=Y({},["annotation-xml"]),e4=Y({},["title","style","font","a","script"]),e9=null,e6=["application/xhtml+xml","text/html"],e8=null,e5=null,e7=a.createElement("form"),te=function(e){return e instanceof RegExp||e instanceof Function},tt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!(e5&&e5===e)){if(e&&"object"==typeof e||(e={}),e=J(e),e8="application/xhtml+xml"===(e9=-1===e6.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?q:z,em=Z(e,"ALLOWED_TAGS")?Y({},e.ALLOWED_TAGS,e8):eh,eg=Z(e,"ALLOWED_ATTR")?Y({},e.ALLOWED_ATTR,e8):ef,e0=Z(e,"ALLOWED_NAMESPACES")?Y({},e.ALLOWED_NAMESPACES,q):e1,eW=Z(e,"ADD_URI_SAFE_ATTR")?Y(J(eZ),e.ADD_URI_SAFE_ATTR,e8):eZ,eG=Z(e,"ADD_DATA_URI_TAGS")?Y(J(eK),e.ADD_DATA_URI_TAGS,e8):eK,eq=Z(e,"FORBID_CONTENTS")?Y({},e.FORBID_CONTENTS,e8):eH,ey=Z(e,"FORBID_TAGS")?Y({},e.FORBID_TAGS,e8):{},ex=Z(e,"FORBID_ATTR")?Y({},e.FORBID_ATTR,e8):{},ez=!!Z(e,"USE_PROFILES")&&e.USE_PROFILES,eS=!1!==e.ALLOW_ARIA_ATTR,eN=!1!==e.ALLOW_DATA_ATTR,eC=e.ALLOW_UNKNOWN_PROTOCOLS||!1,eA=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,eM=e.SAFE_FOR_TEMPLATES||!1,eO=!1!==e.SAFE_FOR_XML,eT=e.WHOLE_DOCUMENT||!1,eL=e.RETURN_DOM||!1,eI=e.RETURN_DOM_FRAGMENT||!1,eP=e.RETURN_TRUSTED_TYPE||!1,eR=e.FORCE_BODY||!1,ej=!1!==e.SANITIZE_DOM,eB=e.SANITIZE_NAMED_PROPS||!1,eU=!1!==e.KEEP_CONTENT,eF=e.IN_PLACE||!1,ep=e.ALLOWED_URI_REGEXP||e_,eY=e.NAMESPACE||eX,e2=e.MATHML_TEXT_INTEGRATION_POINTS||e2,e3=e.HTML_INTEGRATION_POINTS||e3,eb=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&te(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(eb.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&te(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(eb.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(eb.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),eM&&(eN=!1),eI&&(eL=!0),ez&&(em=Y({},el),eg=[],!0===ez.html&&(Y(em,et),Y(eg,es)),!0===ez.svg&&(Y(em,en),Y(eg,ec),Y(eg,ed)),!0===ez.svgFilters&&(Y(em,ea),Y(eg,ec),Y(eg,ed)),!0===ez.mathMl&&(Y(em,eo),Y(eg,eu),Y(eg,ed))),e.ADD_TAGS&&(em===eh&&(em=J(em)),Y(em,e.ADD_TAGS,e8)),e.ADD_ATTR&&(eg===ef&&(eg=J(eg)),Y(eg,e.ADD_ATTR,e8)),e.ADD_URI_SAFE_ATTR&&Y(eW,e.ADD_URI_SAFE_ATTR,e8),e.FORBID_CONTENTS&&(eq===eH&&(eq=J(eq)),Y(eq,e.FORBID_CONTENTS,e8)),eU&&(em["#text"]=!0),eT&&Y(em,["html","head","body"]),em.table&&(Y(em,["tbody"]),delete ey.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');k=(w=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===w&&(w=eE(h,o)),null!==w&&"string"==typeof k&&(k=w.createHTML(""));R&&R(e),e5=e}},tn=Y({},[...en,...ea,...er]),ta=Y({},[...eo,...ei]),tr=function(e){let t=v(e);t&&t.tagName||(t={namespaceURI:eY,tagName:"template"});let n=z(e.tagName),a=z(t.tagName);return!!e0[e.namespaceURI]&&(e.namespaceURI===eQ?t.namespaceURI===eX?"svg"===n:t.namespaceURI===eV?"svg"===n&&("annotation-xml"===a||e2[a]):!!tn[n]:e.namespaceURI===eV?t.namespaceURI===eX?"math"===n:t.namespaceURI===eQ?"math"===n&&e3[a]:!!ta[n]:e.namespaceURI===eX?(t.namespaceURI!==eQ||!!e3[a])&&(t.namespaceURI!==eV||!!e2[a])&&!ta[n]&&(e4[n]||!tn[n]):!!("application/xhtml+xml"===e9&&e0[e.namespaceURI]))},to=function(e){F(n.removed,{element:e});try{v(e).removeChild(e)}catch{_(e)}},ti=function(e,t){try{F(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch{F(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e){if(eL||eI)try{to(t)}catch{}else try{t.setAttribute(e,"")}catch{}}},tl=function(e){let t=null,n=null;if(eR)e=""+e;else{let t=H(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===e9&&eY===eX&&(e=''+e+"");let r=w?w.createHTML(e):e;if(eY===eX)try{t=new m().parseFromString(r,e9)}catch{}if(!t||!t.documentElement){t=E.createDocument(eY,"template",null);try{t.documentElement.innerHTML=eJ?k:r}catch{}}let o=t.body||t.documentElement;return e&&n&&o.insertBefore(a.createTextNode(n),o.childNodes[0]||null),eY===eX?S.call(t,eT?"html":"body")[0]:eT?t.documentElement:o},ts=function(e){return $.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},tc=function(e){return e instanceof p&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},tu=function(e){return"function"==typeof s&&e instanceof s};function td(e,t,a){B(e,e=>{e.call(n,t,a,e5)})}let tp=function(e){let t=null;if(td(C.beforeSanitizeElements,e,null),tc(e))return to(e),!0;let a=e8(e.nodeName);if(td(C.uponSanitizeElement,e,{tagName:a,allowedTags:em}),e.hasChildNodes()&&!tu(e.firstElementChild)&&V(/<[/\w]/g,e.innerHTML)&&V(/<[/\w]/g,e.textContent)||e.nodeType===ek.progressingInstruction||eO&&e.nodeType===ek.comment&&V(/<[/\w]/g,e.data))return to(e),!0;if(!em[a]||ey[a]){if(!ey[a]&&th(a)&&(eb.tagNameCheck instanceof RegExp&&V(eb.tagNameCheck,a)||eb.tagNameCheck instanceof Function&&eb.tagNameCheck(a)))return!1;if(eU&&!eq[a]){let t=v(e)||e.parentNode,n=y(e)||e.childNodes;if(n&&t){let a=n.length;for(let r=a-1;r>=0;--r){let a=f(n[r],!0);a.__removalCount=(e.__removalCount||0)+1,t.insertBefore(a,b(e))}}}return to(e),!0}return e instanceof c&&!tr(e)||("noscript"===a||"noembed"===a||"noframes"===a)&&V(/<\/no(script|embed|frames)/i,e.innerHTML)?(to(e),!0):(eM&&e.nodeType===ek.text&&(t=e.textContent,B([M,O,T],e=>{t=G(t,e," ")}),e.textContent!==t&&(F(n.removed,{element:e.cloneNode()}),e.textContent=t)),td(C.afterSanitizeElements,e,null),!1)},tm=function(e,t,n){if(ej&&("id"===t||"name"===t)&&(n in a||n in e7))return!1;if(!(eN&&!ex[t]&&V(D,t))&&!(eS&&V(L,t))){if(!eg[t]||ex[t]){if(!(th(e)&&(eb.tagNameCheck instanceof RegExp&&V(eb.tagNameCheck,e)||eb.tagNameCheck instanceof Function&&eb.tagNameCheck(e))&&(eb.attributeNameCheck instanceof RegExp&&V(eb.attributeNameCheck,t)||eb.attributeNameCheck instanceof Function&&eb.attributeNameCheck(t))||"is"===t&&eb.allowCustomizedBuiltInElements&&(eb.tagNameCheck instanceof RegExp&&V(eb.tagNameCheck,n)||eb.tagNameCheck instanceof Function&&eb.tagNameCheck(n))))return!1}else if(!eW[t]&&!V(ep,G(n,j,""))&&!(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===K(n,"data:")&&eG[e])&&!(eC&&!V(P,G(n,j,"")))&&n)return!1}return!0},th=function(e){return"annotation-xml"!==e&&H(e,X)},tg=function(e){td(C.beforeSanitizeAttributes,e,null);let{attributes:t}=e;if(!t||tc(e))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:eg,forceKeepAttr:void 0},r=t.length;for(;r--;){let{name:o,namespaceURI:i,value:l}=t[r],s=e8(o),c="value"===o?l:W(l);if(a.attrName=s,a.attrValue=c,a.keepAttr=!0,a.forceKeepAttr=void 0,td(C.uponSanitizeAttribute,e,a),c=a.attrValue,eB&&("id"===s||"name"===s)&&(ti(o,e),c="user-content-"+c),eO&&V(/((--!?|])>)|<\/(style|title)/i,c)){ti(o,e);continue}if(a.forceKeepAttr||(ti(o,e),!a.keepAttr))continue;if(!eA&&V(/\/>/i,c)){ti(o,e);continue}eM&&B([M,O,T],e=>{c=G(c,e," ")});let u=e8(e.nodeName);if(tm(u,s,c)){if(w&&"object"==typeof h&&"function"==typeof h.getAttributeType&&!i)switch(h.getAttributeType(u,s)){case"TrustedHTML":c=w.createHTML(c);break;case"TrustedScriptURL":c=w.createScriptURL(c)}try{i?e.setAttributeNS(i,o,c):e.setAttribute(o,c),tc(e)?to(e):U(n.removed)}catch{}}}td(C.afterSanitizeAttributes,e,null)},tf=function e(t){let n=null,a=ts(t);for(td(C.beforeSanitizeShadowDOM,t,null);n=a.nextNode();)td(C.uponSanitizeShadowNode,n,null),tp(n),tg(n),n.content instanceof i&&e(n.content);td(C.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=null,o=null,l=null,c=null;if((eJ=!e)&&(e=""),"string"!=typeof e&&!tu(e)){if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw Q("dirty is not a string, aborting")}else throw Q("toString is not a function")}if(!n.isSupported)return e;if(eD||tt(t),n.removed=[],"string"==typeof e&&(eF=!1),eF){if(e.nodeName){let t=e8(e.nodeName);if(!em[t]||ey[t])throw Q("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof s)(o=(a=tl("")).ownerDocument.importNode(e,!0)).nodeType===ek.element&&"BODY"===o.nodeName||"HTML"===o.nodeName?a=o:a.appendChild(o);else{if(!eL&&!eM&&!eT&&-1===e.indexOf("<"))return w&&eP?w.createHTML(e):e;if(!(a=tl(e)))return eL?null:eP?k:""}a&&eR&&to(a.firstChild);let u=ts(eF?e:a);for(;l=u.nextNode();)tp(l),tg(l),l.content instanceof i&&tf(l.content);if(eF)return e;if(eL){if(eI)for(c=x.call(a.ownerDocument);a.firstChild;)c.appendChild(a.firstChild);else c=a;return(eg.shadowroot||eg.shadowrootmode)&&(c=N.call(r,c,!0)),c}let d=eT?a.outerHTML:a.innerHTML;return eT&&em["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&V(ev,a.ownerDocument.doctype.name)&&(d=" +`+d),eM&&B([M,O,T],e=>{d=G(d,e," ")}),w&&eP?w.createHTML(d):d},n.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tt(e),eD=!0},n.clearConfig=function(){e5=null,eD=!1},n.isValidAttribute=function(e,t,n){return e5||tt({}),tm(e8(e),e8(t),n)},n.addHook=function(e,t){"function"==typeof t&&F(C[e],t)},n.removeHook=function(e){return U(C[e])},n.removeHooks=function(e){C[e]=[]},n.removeAllHooks=function(){C=e$()},n}(),w=o("aN0pg"),l=o("cNaMA"),eS=AnsiUp=window.AnsiUp,l=o("cNaMA");const eN=e=>e.replaceAll("◐",`\u{25D0}`),eC=({value:e})=>{let t=(0,l.useRef)(null),n=(0,l.useRef)(Date.now());return(0,l.useEffect)(()=>{if(!t.current)return;t.current.style.cssText=`--animation-delay: -${(Date.now()-n.current)%1e3}ms`,t.current.innerHTML=eN(new eS().ansi_to_html(e));let a=t.current.parentElement;a&&(a.scrollTop=1e5)},[t.current,e]),e?(0,l.html)``:null};var u=o("9Ta4i"),l=o("cNaMA"),w=o("aN0pg"),l=o("cNaMA"),eA=o("fUfdR"),w=o("aN0pg");let eM=({focus_on_open:e,desired_doc_query:t,on_update_doc_query:n,notebook:a,sanitize_html:r=!0})=>{let o=(0,l.useContext)(k),i=(0,l.useRef)(null),[s,u]=(0,l.useState)({shown_query:null,searched_query:null,body:'Welcome to the Live docs! Keep this little window open while you work on the notebook, and you will get documentation of everything you type!You can also type a query above.Still stuck? Here are some tips.',loading:!1}),d=e=>u(c(t=>e(t)));(0,l.useEffect)(()=>{!s.loading&&(null==t||/[^\s]/.test(t))&&s.searched_query!==t&&p(t)},[t,s.loading,s.searched_query]),(0,l.useLayoutEffect)(()=>{e&&i.current&&(i.current.focus({preventScroll:!0}),i.current.select())},[e]);let p=e=>{d(t=>{t.loading=!0,t.searched_query=e}),Promise.race([(0,eA.default).Promises.delay(2e3,!1),o.send("docs",{query:e.replace(/^\?/,"")},{notebook_id:a.notebook_id}).then(t=>"⌛"!==t.message.status&&("\uD83D\uDC4D"===t.message.status?(d(n=>{n.shown_query=e,n.body=t.message.doc}),!0):void 0))]).then(()=>{d(e=>{e.loading=!1})})},m=(0,l.useMemo)(()=>(0,l.html)`<${oW} body=${eT(s.body)} sanitize_html=${r} sanitize_html_message=${!1} />`,[s.body,r]),h=!1===s.loading&&""!==s.searched_query&&s.searched_query!==s.shown_query;return(0,l.html)` + + n(e.target.value)} + value=${t} + type="search" + > + + + null!=e&&eO(e,n)}> + ${s.shown_query} + ${m} + + `};const eO=(e,t)=>{for(let t of e.querySelectorAll("code:not([class])"))oZ(t,"julia");for(let n of e.querySelectorAll("a")){let e=n.getAttribute("href");if(null!=e&&e.startsWith("@ref")){let a=e.length>4?e.substr(5):n.textContent;n.onclick=e=>{t(a),e.preventDefault()}}}},eT=e=>e.replace(/Main\.var"workspace\#\d+"\./g,"").replace(/Main\.workspace\#\d+\./g,"").replace(/ in Main\.var"workspace\#\d+"/g,"").replace(/ in Main\.workspace\#\d+/g,"").replace(/#==#[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\:\d+/g,"");var l=o("cNaMA"),w=o("aN0pg"),u=o("9Ta4i"),l=o("cNaMA");o("kjWx8");var eD=o("1gqBQ");const eR=({runtime:e,running:t,queued:n,code_differs:a,on_run:r,on_interrupt:o,set_cell_disabled:i,depends_on_disabled_cells:s,running_disabled:c,on_jump:u})=>{let d=eI(t);(0,l.useContext)(k);let p=t||n?"interrupt":c?"save":s&&!a?"jump":"run";return(0,l.html)` + + {console.log(c),c&&(0,eD.open_pluto_popup)({type:"info",source_element:e.target,body:(0,l.html)`${"This cell is disabled. "} + {i(!1),e.preventDefault(),window.dispatchEvent(new CustomEvent("close pluto popup"))}} + >Enable this cell + ${" to run the code."}`})}} onClick=${({on_interrupt:o,on_save:r,on_jump:u,on_run:r})[`on_${p}`]} class="runcell" title=${({interrupt:"Interrupt (Ctrl + Q)",save:"Save code without running",jump:"This cell depends on a disabled cell",run:"Run cell (Shift + Enter)"})[p]}> + + + ${eL(t?(null==d?null:1e6*d)??e:e)} + + `},eL=e=>{if(null==e)return"---";let t=e,n=["n","μ","m",""],a=0;for(;a=1e3;)a+=1,t/=1e3;return t.toFixed(e<100||t>=100?0:1)+" "+n[a]+"s"},eI=e=>{let[t,n]=(0,l.useState)(0),[a,r]=(0,l.useState)(0);return(0,l.useEffect)(()=>{let t;if(e){let e=+new Date;r(e),n(e),t=setInterval(()=>n(+new Date),50)}return()=>{t&&clearInterval(t)}},[e]),e?t-a:void 0},eP=(e,t=5)=>{let[n,a]=(0,l.useState)(e),r=(0,l.useMemo)(()=>(0,u.default).debounce(a,1e3*t),[a]);return(0,l.useEffect)(()=>(e?(a(!0),r.cancel()):r(!1),()=>{}),[e]),n};var w=o("aN0pg"),l=o("cNaMA");const ej=({onClick:e,total:t,done:n,busy:a,failed_indices:r})=>(t=Math.max(1,t),(0,l.html)` + =8&&t<48,big:t>=48})} + data-total=${t} + onClick=${e} + > + ${[...Array(t)].map((e,t)=>(0,l.html)`=n&&t`)} + + `);var l=o("cNaMA"),w=o("aN0pg"),eD=o("1gqBQ");let eB=({status:e})=>{let t=Object.values(e.subtasks).every(e1),[n,a]=(0,l.useState)(!1);(0,l.useEffect)(()=>{if(n&&t){console.log("all done");let t=null,n=setTimeout(()=>{a(!1);let n=e4(e);(t=new Notification("Pluto: notebook ready",{tag:"notebook ready",body:`\u{2713} All ${n} steps completed`,lang:"en-US",dir:"ltr",icon:la})).onclick=e=>{parent.focus(),window.focus(),t?.close()}},3e3),r=()=>{"visible"===document.visibilityState&&t?.close()};return document.addEventListener("visibilitychange",r),document.body.addEventListener("click",r),()=>{t?.close(),clearTimeout(n),document.removeEventListener("visibilitychange",r),document.body.removeEventListener("click",r)}}},[t]);let r=tl(!t,2500)||n;return(0,l.html)` + + ${"Notify when done"} + {e.target.checked?Notification.requestPermission().then(t=>{console.log(t);let n="granted"===t;a(n),e.target.checked=n,n||(0,eD.open_pluto_popup)({type:"warn",body:(0,l.html)` + Pluto needs permission to show notifications. Enable notifications in your browser settings to use + this feature. + `})}):a(!1)}} + /> + + `};var u=o("9Ta4i"),l=o("cNaMA"),eU=o("hrGZZ"),l=o("cNaMA");const eF=({active:e})=>{let t=(0,l.useRef)(),n=e=>{t.current={x:e.clientX,y:e.clientY}};return(0,eU.useEventListener)(window,"pointermove",n,[]),(0,eU.useEventListener)(window,"dragover",n,[]),(0,l.useEffect)(()=>{if(e.up||e.down){let n=null,a=!0,r=o=>{if(a){null==n&&(n=o);let a=o-n;if(n=o,t.current){let n=t.current.y/window.innerHeight;e.up&&n<.3?window.scrollBy(0,-1200*(.3-n)/.3*a/1e3):e.down&&n>.7&&window.scrollBy(0,1200*(n-.7)/.3*a/1e3)}window.requestAnimationFrame(r)}};return window.requestAnimationFrame(r),()=>a=!1}},[e.up,e.down]),null},ez=e=>{document.getElementById(e)?.scrollIntoView({block:"center",behavior:"smooth"})},eq=(e,t=500)=>{let[n,a]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let n=setTimeout(()=>{a(e)},t);return()=>clearTimeout(n)},[e]),n},eH=({notebook:e,backend_launch_phase:t,status:n})=>{let[a,r]=(0,l.useState)([]),[o,i]=(0,l.useState)([]);(0,l.useEffect)(()=>{let t=Object.values(e.cell_results).filter(e=>e.running||e.queued).map(e=>e.cell_id);i(t),0===t.length?r([]):r((0,u.default).union(t,a))},Object.values(e.cell_results).map(e=>e.running||e.queued));let s=0===a.length?0:1-Math.max(0,o.length-.3)/a.length,c=n.loading&&n.binder,d=c?t??0:s,p=(c||0!==a.length)&&1!==d,m=eq(p,500)??!1;m&&!(c||0!==a.length)&&(d=1);let h=c?"Loading binder...":`Running cells... (${a.length-o.length}/${a.length} done)`;return(0,l.html)`{c||eG(e)}} + aria-hidden="true" + title=${h} + >`},eG=e=>{let t=null==e?(document.querySelector("pluto-cell.running")??document.querySelector("pluto-cell.queued"))?.id:(Object.values(e.cell_results).find(e=>e.running)??Object.values(e.cell_results).find(e=>e.queued))?.cell_id;t&&ez(t)},eK=({status:e,notebook:t,backend_launch_logs:n,my_clock_is_ahead_by:a})=>(0,l.html)` + + <${eY} + status_tree=${e} + path=${[]} + my_clock_is_ahead_by=${a} + nbpkg=${t.nbpkg} + backend_launch_logs=${n} + /> + <${eB} status=${e} /> + + `,eW=` +workspace + +create_process +init_process + + +pkg + +analysis +waiting_for_others +resolve +remove +add +instantiate +instantiate1 +instantiate2 +instantiate3 +precompile + +run + + +saving + +`.split("\n").map(e=>e.trim()).filter(e=>e.length>0),eZ=["saving"],eV={workspace:"Workspace setup",create_process:"Start Julia",init_process:"Initialize",pkg:"Package management",instantiate1:"instantiate",instantiate2:"instantiate",instantiate3:"instantiate",run:"Evaluating cells",evaluate:"Running code",registry_update:"Updating package registry",waiting_for_others:"Waiting for other notebooks to finish package operations",backend_launch:"Connecting to backend",backend_requesting:"Requesting a worker",backend_created:"Starting Pluto server",backend_responded:"Opening notebook file",backend_notebook_running:"Switching to live editing"},eQ=e=>{let t=eV[e];return null!=t?t:eJ(e)?`Step ${e}`:e},eX=e=>1e9*e,eY=({status_tree:e,path:t,my_clock_is_ahead_by:n,nbpkg:a,backend_launch_logs:r})=>{if(null==e)return null;let o=t.reduce((e,t)=>e.subtasks[t],e);if(!o)return null;let[i,s]=(0,l.useState)(t.length<1),c=t.length>0&&e2(o),u=c&&e1(o),d=c&&!u,p=o.started_at??0,m=o.finished_at??0,h=Math.max((eI(d)??0)/1e3,Date.now()/1e3-p-("local"===o.timing?0:n));(0,l.useEffect)(()=>{if(d||!1===o.success){let e=setTimeout(()=>{s(!0)},Math.max(100,500-200*t.length));return()=>clearTimeout(e)}},[d||!1===o.success]),e8(([e])=>{if(!e&&u){let e=setTimeout(()=>{s(!1)},1800-200*t.length);return()=>clearTimeout(e)}},[u]);let g=i?Object.values(o.subtasks).every(e=>eJ(e.name))&&Object.values(o.subtasks).length>0?(()=>{let e=Object.values(o.subtasks),t=e.reduce((e,t)=>e+(e1(t)?1:0),0),n=e.reduce((e,t)=>e+(e3(t)?1:0),0),a=e.length,r=e.reduce((e,t,n)=>!1===t.success?[...e,n]:e,[]),i="evaluate"===o.name?()=>eG():void 0;return(0,l.html)`<${ej} busy=${n} done=${t} total=${a} failed_indices=${r} onClick=${i} />`})():Object.entries(o.subtasks).sort((e,t)=>e0(e[1],t[1])).map(([o,i])=>eZ.includes(o)?null:(0,l.html)`<${eY} + key=${o} + status_tree=${e} + my_clock_is_ahead_by=${n} + path=${[...t,o]} + nbpkg=${a} + backend_launch_logs=${r} + />`):null,f=null;if(c){let e=e9(o),t=e4(o);e>1&&(f=(0,l.html)`${" "}(${t}/${e})`)}let _=Object.values(o.subtasks).length>0;return 0===t.length?g:(0,l.html)` + {s(!i)}} + > + + ${eQ(o.name)}${f} + ${u?eL(eX(m-p)):d?eL(eX(h)):null} + + ${g} + ${i&&"pkg"===o.name?(0,l.html)`<${eC} value=${a?.terminal_outputs?.nbpkg_sync} />`:i&&"backend_launch"===o.name?(0,l.html)`<${eC} value=${r} />`:void 0} + `},eJ=e=>/^\d+$/.test(e),e0=(e,t)=>{let n=eW.indexOf(e.name),a=eW.indexOf(t.name);if(-1===n&&-1===a)return null!=e.started_at||null!=t.started_at?(e.started_at??1/0)-(t.started_at??1/0):eJ(e.name)&&eJ(t.name)?parseInt(e.name)-parseInt(t.name):e.name.localeCompare(t.name);{let e=e=>-1===e?1/0:e;return e(n)-e(a)}},e1=e=>null!=e.finished_at,e2=e=>null!=e.started_at,e3=e=>e2(e)&&!e1(e),e4=e=>Object.values(e.subtasks).reduce((e,t)=>e+e4(t),e1(e)?1:0),e9=e=>Object.values(e.subtasks).reduce((e,t)=>e+e9(t),1),e6=(e,t,n,a={})=>({name:e,subtasks:a,timing:"local",started_at:(0,l.useMemo)(()=>t||n?Date.now()/1e3:null,[t||n]),finished_at:(0,l.useMemo)(()=>n?Date.now()/1e3:null,[n])}),e8=(e,t)=>{let n=(0,l.useRef)(t);(0,l.useEffect)(()=>{let a=e(n.current);return n.current=t,a},t)};var l=o("cNaMA");const e5=({connected:e})=>{let t=(0,l.useContext)(k),[n,a]=(0,l.useState)(0);return(0,l.useEffect)(()=>{if(e){let e=async()=>{let e=()=>t.send("current_time").then(e=>e.message.time),n=()=>Date.now()/1e3;for(let t=0;t<16;t++)await e();let r=await n(),o=await e(),i=await e(),l=(r+await n())/2-(o+i)/2;isNaN(l)||a(l)};e();let n=setInterval(e,6e4);return()=>clearInterval(n)}},[e]),n};var d=o("4zMEb"),e7=o("41Mhf");const te={wait_for_user:0,requesting:.4,created:.6,responded:.7,notebook_running:.9,ready:1},tt=e=>e.endsWith("/")?e:e+"/",tn=(e,{on_log:t})=>new Promise((n,a)=>{console.log("Starting binder connection to",e);try{let r=new EventSource(e);r.onerror=t=>{console.error("Binder error: Lost connection to "+e,t),r.close(),a(t)};let o=null,i="",l=e=>{console.log("Binder: ",e,` at ${new Date().toLocaleTimeString()}`),i=`${i}${e} +`,t(i)};r.onmessage=t=>{let i=JSON.parse(t.data);switch(i.phase&&i.phase!==o&&(o=i.phase.toLowerCase(),l(` + +\u{23F1}\u{FE0F} Binder subphase: ${o} +`)),i.message&&l(i.message.replace("] ",`] +`)),i.phase){case"failed":console.error("Binder error: Failed to build",e,i),r.close(),a(Error(i));break;case"ready":r.close(),n({binder_session_url:tt(i.url)+"pluto/",binder_session_token:i.token})}}}catch(e){console.error(e),a("Failed to open event source the mybinder.org. This probably means that the URL is invalid.")}}),ta=e=>fetch(`https://stats.plutojl.org/count?p=/${e}&s=${screen.width},${screen.height},${devicePixelRatio}#skip_sw`,{cache:"no-cache"}).catch(()=>{}),tr=async({setStatePromise:e,connect:t,launch_params:n})=>{try{ta("binder-start"),await e(c(e=>{e.backend_launch_phase=te.requesting,e.disable_ui=!1,e.notebook.status_tree=null}));let{binder_session_url:a,binder_session_token:r}=await tn(n.binder_url.replace("mybinder.org/v2/","mybinder.org/build/"),{on_log:t=>e(c(e=>{e.backend_launch_logs=t}))}),o=e=>(0,e7.with_query_params)(e,{token:r});console.log("Binder URL:",o(a)),window.shutdown_binder=()=>{fetch(o(new URL("../api/shutdown",a)),{method:"POST"})},await e(c(e=>{e.backend_launch_phase=te.created,e.binder_session_url=a,e.binder_session_token=r})),await fetch(o(a)),await e(c(e=>{e.backend_launch_phase=te.responded}));let i=async()=>{let e=o((0,e7.with_query_params)(new URL("notebookupload",a),{name:new URLSearchParams(window.location.search).get("name"),execution_allowed:"true"}));return console.log("downloading locally and uploading ",e,n.notebookfile),fetch(e,{method:"POST",body:await (await fetch(new Request(n.notebookfile,{integrity:n.notebookfile_integrity}))).arrayBuffer()})},l=async(e,t)=>{let n=(0,e7.with_query_params)(new URL("open",a),{[e]:t,execution_allowed:"true"});return console.log(`open ${e}:`,n),fetch(o(n),{method:"POST"})},s=(e,t)=>()=>l(e,t),u=n.notebookfile.startsWith("data:")?[i]:[s("path",n.notebookfile),s("url",new URL(n.notebookfile,window.location.href).href),i],p=new Response;for(let e of u)if((p=await e()).ok)break;if(!p.ok){let e=await p.blob();window.location.href=URL.createObjectURL(e);return}let m=await p.text(),h=o((0,e7.with_query_params)(new URL("edit",a),{id:m}));console.info("notebook_id:",m),await e(c(e=>{e.notebook.notebook_id=m,e.backend_launch_phase=te.notebook_running,e.refresh_target=h})),console.log("Connecting WebSocket");let g=t(o(new URL("channels",(0,d.ws_address_from_base)(a))));await (0,d.timeout_promise)(g,2e4).catch(e=>{console.error("Failed to establish connection within 20 seconds. Navigating to the edit URL directly.",e),window.parent.location.href=h})}catch(e){console.error("Failed to initialize binder!",e),alert("Something went wrong! \uD83D\uDE2E\n\nWe failed to initialize the binder connection. Please try again with a different browser, or come back later.")}};var eU=o("hrGZZ");const to=e=>window.dispatchEvent(new CustomEvent("open_bottom_right_panel",{detail:e}));let ti=({desired_doc_query:e,on_update_doc_query:t,notebook:n,connected:a,backend_launch_phase:r,backend_launch_logs:o,sanitize_html:i=!0})=>{let s=(0,l.useRef)(),c=(0,l.useRef)(!1),[u,d]=(0,l.useState)(null),p=null==u;(0,eU.useEventListener)(window,"open_bottom_right_panel",e=>{console.log(e.detail),c.current=!1,d(e.detail),"none"===window.getComputedStyle(s.current).display&&alert("This browser window is too small to show docs.\n\nMake the window bigger, or try zooming out.")},[d]);let m=ts(n,r),[h,g]=(0,l.useMemo)(()=>null==m?[0,0]:[e9(m)-1,e4(m)-(e1(m)?1:0)],[m]),f=g{let e=await documentPictureInPicture.requestWindow();[...document.styleSheets].forEach(t=>{try{let n=document.createElement("style");n.textContent=[...t.cssRules].map(e=>e.cssText).join(""),e.document.head.appendChild(n)}catch(a){let n=document.createElement("link");n.rel="stylesheet",n.type=t.type,n.media=t.media,n.href=t.href,e.document.head.appendChild(n)}}),e.document.body.append(s.current.firstElementChild),e.addEventListener("pagehide",e=>{let t=e.target.querySelector("pluto-helpbox");s.current.append(t)})};return(0,l.html)` + + `};const tl=(e,t)=>{let[n,a]=(0,l.useState)(!1);return(0,l.useEffect)(()=>{if(e){let e=setTimeout(()=>{a(!0)},t);return()=>clearTimeout(e)}a(!1)},[e]),n},ts=(e,t)=>{let n=tc(t);return null==t?e.status_tree:{name:"notebook",started_at:0,finished_at:null,subtasks:{...e.status_tree?.subtasks,backend_launch:n}}},tc=e=>{let t=e??-1,n=Object.fromEntries(["requesting","created","responded","notebook_running"].map(e=>{let n=te[e],a=`backend_${e}`;return[a,e6(a,t>=n,t>n)]}));return e6("backend_launch",null!=e&&e>te.wait_for_user,e===te.ready,n)},tu=e=>{if(e.includes("#@#==#"))return null;let t="#==#",n=e.indexOf(t);return -1!=n?e.substring(n+t.length,n+t.length+36):null},td=(e,t)=>window.dispatchEvent(new CustomEvent("cell_focus",{detail:{cell_id:e,line:t}})),tp=({frame:e})=>{let t=(0,l.useContext)(k);if(tu(e.file)||null==e.parent_module||tg(e))return null;let n=e.func;if(""===n)return null;let a=t.get_notebook(),r=["Main","Core","Base"].includes(e.source_package),o=a?.nbpkg?.installed_versions?.[e.source_package]!=null;return r||a?.nbpkg==null||o?(0,l.html)` {a.preventDefault(),to("docs"),t.set_doc_query(`${e.parent_module}.${n}`)}} + >docs`:null},tm=({frame:e,cell_id:t})=>{if(tf(e))return null;let n=tu(e.file),a=e.line;if(null!=n)return(0,l.html)`{td(n,null==a?null:a-1),e.preventDefault()}} + > + ${n==t?"This cell":"Other cell"}${null==a?null:(0,l.html)`: line ${a}`} + `;{let t=e.source_package,n=["Main","Core","Base"].includes(t)?"julia":t,a=(0,l.html)`${e.file.replace(/#@#==#.*/,"")}:${e.line}`,r=null!=t?(0,l.html)`${n} → ${a}`:a,o=e?.url?.startsWith?.("https")?e.url:null;return(0,l.html)`${r}`}},th=(0,l.html)` from `,tg=e=>"top-level scope"===e.call,tf=e=>"none"===e.file,t_=e=>{let t=e.indexOf(")(");if(-1!=t)return[e.substring(0,t+1),e.substring(t+1)];{let t=e.indexOf("(");return -1!=t?[e.substring(0,t),e.substring(t)]:[e,""]}},tb=({frame:e})=>{let[t,n]=(0,l.useState)(!1);(0,l.useEffect)(()=>{n(!1)},[e]);let a=(e.call_short.match(/…/g)??"").length<=1&&e.call.lengthanonymous function`:i,c=(0,l.html)`${s}<${tw} code=${o[1]} />`,u=(0,l.useMemo)(()=>Math.random().toString(36).substring(7),[e]);return(0,l.html)`${c} ${r?null:(0,l.html)`{e.preventDefault(),n(!0)}} + >...show types...`}`},ty=({frame:e,num_context_lines:t=2})=>{let n=(0,l.useContext)(k),a=tu(e.file);if(a){let r=n.get_notebook()?.cell_inputs[a]?.code;if(r){let n=r.split("\n");return(0,l.html)`{td(a,e.line-1),t.preventDefault()}} + href=${`#${a}`} + class="frame-line-preview" + > + +${n.map((n,a)=>e.line-1-t<=a&&a<=e.line-1+t?(0,l.html)`<${tv} code=${n} i=${a} frameLine=${a===e.line-1} />`:null)} + `}}},tv=({code:e,frameLine:t,i:n})=>{let a=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{a.current&&(a.current.innerText=e,delete a.current.dataset.highlighted,oZ(a.current,"julia"))},[a.current,e]),(0,l.html)``},tw=({code:e})=>{let t=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{if(t.current){let n=e.replaceAll(/([^():{},; ]*)::/g,"$1::");t.current.innerHTML=n}},[t.current,e]),(0,l.html)``},tk=e=>e.flatMap((t,n)=>n===e.length-1?[t]:n===e.length-2?[t," and "]:[t,", "]),tE=({cell_id:e,diagnostics:t})=>((0,l.useEffect)(()=>(window.dispatchEvent(new CustomEvent("cell_diagnostics",{detail:{cell_id:e,diagnostics:t}})),()=>window.dispatchEvent(new CustomEvent("cell_diagnostics",{detail:{cell_id:e,diagnostics:[]}}))),[t]),(0,l.html)` + + Syntax error + + Syntax errors + + ${t.map(({message:t,from:n,to:a,line:r})=>(0,l.html)`window.dispatchEvent(new CustomEvent("cell_highlight_range",{detail:{cell_id:e,from:n,to:a}}))} + onmouseleave=${()=>window.dispatchEvent(new CustomEvent("cell_highlight_range",{detail:{cell_id:e,from:null,to:null}}))} + > + + ${t} + ${th}<${tm} frame=${{file:"#==#"+e,line:r}} cell_id=${e} /> + + `)} + + + + `),t$=(e,t,n,a)=>{if(null!=a)return!0;let[r,o]=t_(e.call);return!(["_collect","collect_similar","iterate","error","macro expansion"].includes(r)||r.includes("throw"))&&!e.inlined&&null!=o&&!((r.match(/#/g)??"").length>=2)},tx=({value:e})=>{let t=(0,l.useRef)(null),n=(0,l.useRef)(!1);(0,l.useLayoutEffect)(()=>{t.current&&(t.current.innerHTML=new eS().ansi_to_html(e),n.current=!0)},[t.current,e]);let a=e.replace(/\u001b\[[0-9;]*m/g,"");return""===e?(0,l.html)``:(0,l.html)`${n.current?null:a}`},tS=({msg:e,stacktrace:t,cell_id:n})=>{let a=(0,l.useContext)(k),r={pattern:/.?/,display:e=>(0,u.default).dropRightWhile(e.split("\n"),e=>""===e).map(e=>(0,l.html)`<${tx} value=${e} />`)},o=[{pattern:/syntax: extra token after end of expression/,display:e=>{let t=(0,l.html)`{e.preventDefault(),a.wrap_remote_cell(n,"begin")}} + >Wrap all code in a begin ... end block.`;if(!e.includes("\n\nBoundaries: "))return(0,l.html)`Multiple expressions in one cell. + ${t}`;{let r=JSON.parse(e.split("\n\nBoundaries: ")[1]).map(e=>e-1),o=(0,l.html)` + {e.preventDefault(),a.split_remote_cell(n,r,!0)}} + >Split this cell into ${r.length} cells, or + `;return(0,l.html)`Multiple expressions in one cell. + How would you like to fix it? + + ${o} + ${t} + `}},show_stacktrace:()=>!1},{pattern:/LoadError: cannot assign a value to variable workspace#\d+\..+ from module workspace#\d+/,display:()=>(0,l.html)`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=>(0,l.html)`${e}`)},{pattern:/Cyclic references among (.*)\./,display:e=>e.split("\n").map(e=>{let t=e.match(/Cyclic references among (.*)\./);if(!t)return(0,l.html)`${e}`;{let e=t[1].split(/, | and /).map(e=>(0,l.html)`${e}`);return(0,l.html)`Cyclic references among${" "}${tk(e)}.`}})},{pattern:/Multiple definitions for (.*)/,display:e=>e.split("\n").map(e=>{let t=e.match(/Multiple definitions for (.*)/);if(!t)return(0,l.html)`${e}`;{let e=t[1].replace(/\.$/,"").split(/, | and /).map(e=>(0,l.html)`{let a=document.querySelector(`pluto-cell:not([id='${n}']) span[id='${encodeURI(e)}']`);t.preventDefault(),a?.scrollIntoView()}}>${e}`);return(0,l.html)`Multiple definitions for${" "}${tk(e)}.`}})},{pattern:/^syntax: (.*)$/,display:r.display,show_stacktrace:()=>!1},{pattern:/^\s*$/,display:()=>r.display("Error")},{pattern:/^UndefVarError: (.*) not defined/,display:e=>{let t=a.get_notebook(),r=tM(t,n),o=e.match(/UndefVarError: (.*) not defined/),i=(o?.[1]??"").replaceAll("`",""),s=Object.values(t?.cell_dependencies??{}).some(e=>Object.keys(e.downstream_cells_map).includes(i));if(0===Object.keys(r).length||!s)return(0,l.html)`${e}`;let c=Object.keys(r).map(e=>(0,l.html)`{t.preventDefault();let n=document.querySelector(`pluto-cell[id='${r[e]}']`);n?.scrollIntoView()}}>${e}`);return(0,l.html)`Another cell defining ${tk(c)} contains errors.`},show_stacktrace:()=>0===Object.keys(tM(a.get_notebook(),n)).length},{pattern:/^ArgumentError: Package (.*) not found in current path/,display:e=>{let t=e.match(/^ArgumentError: Package (.*) not found in current path/),n=(t?.[1]??"").replaceAll("`",""),r=a.get_notebook()?.nbpkg?.terminal_outputs?.[n];return(0,l.html)`The package ${n}.jl could not load because it failed to initialize. + That's not nice! Things you could try: + + Restart the notebook. + Try a different Julia version. + Contact the developers of ${n}.jl about this error. + + You might find useful information in the package installation log: + <${eC} value=${r} />`},show_stacktrace:()=>!1},r].find(({pattern:t})=>t.test(e))??r,[i,s]=(0,l.useState)(!1);(0,l.useEffect)(()=>{s(!1)},[e,t,n]);let c=t.findIndex(e=>null!=tu(e.file)),d=!i&&-1!=c&&c!(tf(e)&&tg(e))),m=tN(p);return(0,l.html)` + + Error message${null==m?null:` from ${m}`} + + + + ${o.display(e)} + ${0!=t.length&&(o.show_stacktrace?.()??!0)?(0,l.html)` + + Stack trace + Here is what happened, the most recent locations are first: + + + + ${p.map((e,t)=>{let a=tu(e.file),r=null!=a,o=n===a,i=t$(e,t,p,a);return(0,l.html)` + + <${tb} frame=${e} /> + + ${th}<${tm} frame=${e} cell_id=${n} /> + <${tp} frame=${e} /> + + + ${r?(0,l.html)`<${ty} frame=${e} num_context_lines=${o?1:2} />`:null} + `})} + ${d?(0,l.html)` + {s(!0),e.preventDefault()}} + >Show more... + `:null} + + `:null} + <${tA} stacktrace=${t} /> + `},tN=e=>{for(let[t,n]of e.entries()){let a=tu(n.file);if(a)return;if(t$(n,t,e,a)&&n.source_package)return n.source_package}},tC=["Don't panic!","Keep calm, you got this!","You got this!","Silly computer!","Silly computer!","beep boop CRASH \uD83E\uDD16","computer bad, you GREAT!","Probably not your fault!","Try asking on Julia Discourse!","uhmmmmmm??!","Maybe time for a break? ☕️","Everything is going to be okay!","Computers are hard!","C'est la vie !","¯\\_(ツ)_/¯","Oh no! \uD83D\uDE40","this suckz \uD83D\uDCA3","Be patient :)"],tA=({stacktrace:e})=>{let t=(0,l.useMemo)(()=>.1>Math.random()?tC[Math.floor(Math.random()*tC.length)]:null,[e]);return null==t?null:(0,l.html)`${t}`},tM=(e,t,n=[])=>{let a={};return null!=e&&e?.cell_results?.[t]?.errored&&Object.keys(e.cell_dependencies[t]?.upstream_cells_map).forEach(r=>{n.includes(r)||(n.push(r),(e.cell_dependencies[t]?.upstream_cells_map[r]).forEach(o=>{let i=tM(e,o,n)??{};a={...a,...i},0===Object.keys(i).length&&e.cell_results[o].errored&&o!==t&&(a[r]=o)}))}),a};var l=o("cNaMA"),eU=o("hrGZZ");const tO=({mime:e,body:t,cell_id:n,persist_js_state:a,sanitize_html:r=!0})=>{switch(e){case"image/png":case"image/jpg":case"image/jpeg":case"image/gif":case"image/bmp":case"image/svg+xml":return(0,l.html)`<${oP} mime=${e} body=${t} />`;case"text/plain":return(0,l.html)`${t}`;case"application/vnd.pluto.tree+object":return(0,l.html)`<${tI} cell_id=${n} body=${t} persist_js_state=${a} sanitize_html=${r} />`;default:return oj({mime:e,body:t,cell_id:n,persist_js_state:a,sanitize_html:r,last_run_timestamp:null})}},tT=({on_click_more:e})=>{let[t,n]=(0,l.useState)(!1),a=(0,l.useRef)(null);return tD(a),(0,l.html)`{t||!1===e()||n(!0)}} + >more`},tD=e=>{(0,eU.useEventListener)(e,"keydown",t=>{" "===t.key&&t.preventDefault(),"Enter"===t.key&&(t.preventDefault(),e.current.click())},[]),(0,eU.useEventListener)(e,"keyup",t=>{" "===t.key&&(t.preventDefault(),e.current.click())},[])},tR=({prefix:e,prefix_short:t})=>{let n=(0,l.useRef)(null);return tD(n),(0,l.html)`${e}${t}`},tL=({pluto_actions:e,cell_id:t,node_ref:n,objectid:a,dim:r})=>{(e??n.current.closest("pluto-cell")._internal_pluto_actions).reshow_cell(t??n.current.closest("pluto-cell").id,a,r)},tI=({mime:e,body:t,cell_id:n,persist_js_state:a,sanitize_html:r=!0})=>{let o=(0,l.useContext)(k),i=(0,l.useRef)(null),s=e=>(0,l.html)`<${tO} cell_id=${n} mime=${e[1]} body=${e[0]} persist_js_state=${a} sanitize_html=${r} />`,c=(0,l.html)`<${tT} on_click_more=${()=>{if(null==i.current||null!=i.current.closest("pluto-tree.collapsed"))return!1;tL({pluto_actions:o,cell_id:n,node_ref:i,objectid:t.objectid,dim:1})}} />`,u=null;switch(t.type){case"Pair":let d=t.key_value;return(0,l.html)`${s(d[0])}${s(d[1])}`;case"circular":return(0,l.html)`circular reference`;case"Array":case"Set":case"Tuple":u=(0,l.html)`<${tR} prefix=${t.prefix} prefix_short=${t.prefix_short} />${t.elements.map(e=>"more"===e?c:(0,l.html)`${"Set"===t.type?"":(0,l.html)`${e[0]}`}${s(e[1])}`)}`;break;case"Dict":u=(0,l.html)`<${tR} prefix=${t.prefix} prefix_short=${t.prefix_short} />${t.elements.map(e=>"more"===e?c:(0,l.html)`${s(e[0])}${s(e[1])}`)}`;break;case"NamedTuple":u=(0,l.html)`<${tR} prefix=${t.prefix} prefix_short=${t.prefix_short} />${t.elements.map(e=>"more"===e?c:(0,l.html)`${e[0]}${s(e[1])}`)}`;break;case"struct":u=(0,l.html)`<${tR} prefix=${t.prefix} prefix_short=${t.prefix_short} />${t.elements.map(e=>(0,l.html)`${e[0]}${s(e[1])}`)}`}return(0,l.html)`{let t=i.current;if(!t||(null!=e.target.closest("pluto-tree-prefix")?e.target.closest("pluto-tree-prefix").parentElement:e.target)!==t&&!t.classList.contains("collapsed"))return;let n=t.parentElement?.closest("pluto-tree");null!=n&&n.classList.contains("collapsed")||t.classList.toggle("collapsed")}} ref=${i}>${u}`},tP=({colspan:e=999})=>(0,l.html)` + + + ⌀ (This table has no columns) + + +`,tj=({colspan:e=999})=>(0,l.html)` + + + ⌀ + (This table has no rows) + + +`,tB=({mime:e,body:t,cell_id:n,persist_js_state:a,sanitize_html:r})=>{let o=(0,l.useContext)(k),i=(0,l.useRef)(null),s=e=>(0,l.html)`<${tO} cell_id=${n} mime=${e[1]} body=${e[0]} persist_js_state=${a} sanitize_html=${r} />`,c=e=>(0,l.html)`<${tT} + on_click_more=${()=>{tL({pluto_actions:o,cell_id:n,node_ref:i,objectid:t.objectid,dim:e})}} + />`,u=3+(t?.schema?.names?.length??1),d=(t?.schema?.names?.length??0)===0?(0,l.html)`<${tP} colspan=${u} />`:(0,l.html)` + + ${["",...t.schema.names].map(e=>(0,l.html)`${"more"===e?c(2):e}`)} + + + ${["",...t.schema.types].map(e=>(0,l.html)`${"more"===e?null:e}`)} + + `,p=(0,l.html)` + ${(t.rows?.length??0)!==0?t.rows.map(e=>(0,l.html)` + ${"more"===e?(0,l.html)`${c(1)}`:(0,l.html)`${e[0]} + ${e[1].map(e=>(0,l.html)`${"more"===e?null:s(e)}`)}`} + `):(0,l.html)`<${tj} colspan=${u} />`} + `;return(0,l.html)` + ${d}${p} + `};let tU=({cell_id:e,style:t,classname:n,children:a,persist_js_state:r=!1,sanitize_html:o=!0})=>(0,l.html)`${a.map(t=>(0,l.html)`<${tO} cell_id=${e} mime=${t[1]} body=${t[0]} persist_js_state=${r} sanitize_html=${o} />`)}`;var eD=o("1gqBQ"),u=o("9Ta4i"),l=o("cNaMA"),eA=o("fUfdR");function tF(e){if(e instanceof HTMLInputElement)switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files?.[0];default:return e.value}else if(e instanceof HTMLSelectElement&&e.multiple)return Array.from(e.selectedOptions,e=>e.value);else return e.value}function tz(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}const tq=(e,t)=>{if(!(e instanceof HTMLInputElement)||"file"!==e.type){if(null==t){e.value=t;return}if(e instanceof HTMLInputElement)switch(e.type){case"range":case"number":e.valueAsNumber!==t&&(e.valueAsNumber=t);return;case"date":(null==e.valueAsDate||Number(e.valueAsDate)!==Number(t))&&(e.valueAsDate=t);return;case"checkbox":e.checked!==t&&(e.checked=t);return;case"file":return}else if(e instanceof HTMLSelectElement&&e.multiple){for(let n of Array.from(e.options))n.selected=t.includes(n.value);return}e.value!==t&&(e.value=t)}},tH=(e,t)=>{e.forEach(e=>{let n=e.getAttribute("def");if(null!=n&&null!=e.firstElementChild&&null!=t[n]){let a=t[n].value;try{tq(e.firstElementChild,a)}catch(t){console.error("Error while setting input value",e.firstElementChild,"to value",a,": ",t)}}})},tG=(e,t)=>{e.forEach(e=>{let n=e=>{e.target.closest(".bonds_disabled:where(.offer_binder, .offer_local)")&&(0,eD.open_pluto_popup)({type:"info",source_element:e.target,body:(0,l.html)`${"You are viewing a static document. "} + {window.open_edit_or_run_popup(),e.preventDefault(),window.dispatchEvent(new CustomEvent("close pluto popup"))}} + >Run this notebook + ${" to enable interactivity."}`})};e.addEventListener("click",n),t.then(()=>{e.removeEventListener("click",n)})})},tK=(e,t,n,a)=>{let r=!1;a.then(()=>{r=!0}),e.forEach(async e=>{let a=e.getAttribute("def"),o=e.firstElementChild;if(null!=a&&null!=o){let e=tF(o),i=Object.keys(n).includes(a)&&(0,u.default).isEqual(n[a]?.value,e)?null:t(a,e).catch(console.error),l=!1;for(let e of(0,eA.default).Generators.observe(function(e){var t=tz(o),n=tF(o);function a(){e(tF(o))}return o.addEventListener(t,a),void 0!==n&&e(n),function(){o.removeEventListener(t,a)}})){if(r)break;if(!1===l){l=!0;continue}let n=await tW(await e);await i,await t(a,n).catch(console.error)}}})},tW=async e=>e instanceof FileList?Promise.all(Array.from(e).map(e=>tW(e))):e instanceof File?await new Promise(t=>{let n=new FileReader;n.onload=()=>t({name:e.name,type:e.type,data:new Uint8Array(n.result)}),n.onerror=()=>t({name:e.name,type:e.type,data:null}),n.readAsArrayBuffer(e)}):e;var w=o("aN0pg"),eA=o("fUfdR"),tZ=o("h2NGW"),tV=o("hiQgq"),l=o("cNaMA"),u=o("9Ta4i"),tQ=o("2P6PH"),tV=(o("hiQgq"),o("hiQgq")),u=o("9Ta4i");const tX=!1,tY=e=>({from:e.from,to:e.to}),tJ=(e,t,n)=>{for(let a of e)if(a.name===t&&n.from>=a.validity.from&&n.to<=a.validity.to)return a},t0=new Set(["WhileStatement","ForStatement","TryStatement","LetStatement","FunctionDefinition","MacroDefinition","DoClause","Generator"]),t1=e=>{if(t0.has(e.name))return!0;if("Assignment"===e.name){let t=e.firstChild();try{if("CallExpression"===e.name)return!0}finally{t&&e.parent()}}return!1},t2=e=>{let t=t4(e),n=[];return e.iterate(e=>{if(("Identifier"===e.name||"MacroIdentifier"===e.name||"Operator"===e.name)&&n.push(tY(e)),"IndexExpression"===e.name||"FieldExpression"===e.name)return!1}),t(),n},t3=e=>{let t=new tV.NodeWeakMap;return t.cursorSet(e,"here"),()=>{for(;"here"!==t.cursorGet(e);)if(!e.parent())throw Error("Could not find my back to the original parent!")}},t4=e=>{let t=new tV.NodeWeakMap;t.cursorSet(e,"yay");let n=e=>`${e.name}(${e.from},${e.to})`,a=n(e);return()=>{if("yay"!==t.cursorGet(e))throw Error(`Cursor changed position when forbidden! Before: ${a}, after: ${n(e)}`)}},t9=e=>{let t=new tV.NodeWeakMap;if(t.cursorSet(e,"here"),!e.parent())throw Error("Cannot be toplevel");e.firstChild();let n=0;for(;"here"!==t.cursorGet(e);)if(n++,!e.nextSibling())throw Error("Could not find my way back");return n},t6=(e,{enter:t,leave:n})=>{let a=[],r=t4(e),o=t3(e);if(!e.firstChild())throw Error(`Expected to go into function definition argument expression, stuck at ${e.name}`);tX&&console.assert("TupleExpression"===e.name||e,"Arguments"===name,e.name),e.firstChild();do if("KeywordArguments"===e.name&&e.firstChild(),"Identifier"===e.name||"Operator"===e.name)a.push(tY(e));else if("KwArg"===e.name){let t=e.firstChild();a.push(tY(e)),t&&e.parent()}while(e.nextSibling())return o(),r(),tX&&console.log({found:a}),a};let t8=(e,t,n,a=tX)=>{let r,o;"cursor"in e&&(console.trace("`explore_variable_usage()` called with a SyntaxNode, not a TreeCursor"),e=e.cursor());let i={usages:[],definitions:new Map,locals:[]},l=[],s=new Map,c=[],d=[],p=new tV.NodeWeakMap;if(r=e=>{if(a){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()}}if(p.cursorGet(e)||"ModuleDefinition"===e.name||"QuoteStatement"===e.name||"QuoteExpression"===e.name||"MacroIdentifier"===e.name||"ImportStatement"===e.name)return a&&console.groupEnd(),!1;let n=e=>{let n=t.sliceString(e.from,e.to);0===l.length?s.set(n,{...e,valid_from:e.from}):c.push({name:n,validity:(0,u.default).last(l),definition:e})};if(t1(e)&&l.push(tY(e)),"Identifier"===e.name||"MacroIdentifier"===e.name||"Operator"===e.name){let n=t.sliceString(e.from,e.to);d.push({name:n,usage:{from:e.from,to:e.to},definition:tJ(c,n,e)??null})}else if("Assignment"===e.name||"KwArg"===e.name||"ForBinding"===e.name||"CatchClause"===e.name)e.firstChild()&&("catch"===e.name&&e.nextSibling(),"CallExpression"!==e.name&&(t2(e).forEach(n),p.cursorSet(e,!0)),e.parent());else if("Parameters"===e.name)return t2(e).forEach(n),a&&console.groupEnd(),!1;else if("Field"===e.name)return a&&console.groupEnd(),!1;else if("CallExpression"===e.name){if(e.matchContext(["FunctionDefinition","Signature"])||e.matchContext(["Assignment"])&&0===t9(e)){let i=t3(e);if(e.firstChild(),e.firstChild(),"Identifier"===e.name||"Operator"===e.name){a&&console.log("found function name",t.sliceString(e.from,e.to));let r=l.pop();n(tY(e)),r&&l.push(r),e.nextSibling()}return a&&console.log("expl funcdef ",t.sliceString(e.from,e.to)),t6(e,{enter:r,leave:o}).forEach(n),a&&console.log("expl funcdef ",t.sliceString(e.from,e.to)),i(),a&&console.log("end of FunctionDefinition, currently at ",e.node),a&&console.groupEnd(),!1}}else if("Generator"===e.name){let t=t3(e);if(e.firstChild()){for(;e.nextSibling();)e.iterate(r,o);t()}return e.firstChild()&&(e.iterate(r,o),t()),o(e),!1}},o=e=>{a&&console.groupEnd(),t1(e)&&l.pop()},e.iterate(a?e=>{let t=t4(e),n=r(e);return t(),n}:r,o),l.length>0)throw Error(`Some scopes were not leaved... ${JSON.stringify(l)}`);let m={usages:d,definitions:s,locals:c};return a&&console.log(m),m},t5=(0,tV.StateField).define({create(e){try{let t=(0,tV.syntaxTree)(e).cursor();return t8(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((0,tV.syntaxTree)(t.state)==(0,tV.syntaxTree)(t.startState))return e;{let e=(0,tV.syntaxTree)(t.state).cursor();return t8(e,t.state.doc,null)}}catch(e){return console.error("Something went wrong while parsing variables...",e),{usages:[],definitions:new Map,locals:[]}}}}),t7=e=>"IndexExpression"===e.name||"FieldExpression"===e.name?(e.firstChild(),t7(e)):"Identifier"===e.name?(e.firstChild(),e.node):null,ne=["Identifier","FieldExpression","IndexExpression","MacroFieldExpression","MacroIdentifier","Operator","TypeHead","Signature","ParametrizedExpression"],nt=["import","export","try","catch","finally","quote","do","struct","mutable","module","baremodule","if","let"],nn=e=>{if(nt.includes(e.name))return!0;if(!ne.includes(e.name))return!1;if(!e.firstChild())return!0;do{if("IntegerLiteral"===e.name||"FloatLiteral"===e.name||"BraceExpression"===e.name||"FieldName"===e.name||"MacroName"===e.name||"MacroFieldName"===e.name)continue;if(!nn(e))return!1}while(e.nextSibling())return e.parent(),!0},na=(e,t=!1)=>{let n=e.selection.main,a=e.field(t5);if(n.from!==n.to)return e.doc.sliceString(n.from,n.to).trim();{let r=e.doc.lineAt(n.from).text;if("?"===r[0])return r.slice(1);let o=(0,tV.syntaxTree)(e).cursor();t&&console.log("Full tree:",o.toString()),o.moveTo(n.to,-1);let i=0;do{t&&console.group(`Iteration #${i}`);try{if(t&&console.log("cursor",o.toString()),i>100){console.group("Infinite loop while checking docs"),console.log("Selection:",n,e.doc.sliceString(n.from,n.to).trim()),console.log("Current node:",o.name,e.doc.sliceString(o.from,o.to).trim()),console.groupEnd();break}i+=1;let r=o.node.cursor(),l=[];for(;r.parent();)l.push(r.name);let s=o.node.parent;if(null==s)break;t&&console.log("parents:",l);let c=l.indexOf("StructDefinition");if(-1!==c){if(l.includes("binding")&&l.indexOf("binding")=o.to)return e.doc.sliceString(t.from,t.to)}else{if("struct"!==o.name&&"mutable"!==o.name)return;if(o.parent(),o.firstChild(),"struct"===o.name)return"struct";if("mutable"===o.name&&(o.nextSibling(),"struct"===o.name))return"mutable struct";return}}if("AbstractDefinition"===o.name)return"abstract type";if("CallExpression"===o.name)return o.firstChild(),nn(o)?e.doc.sliceString(o.from,o.to):void 0;if(("Operator"===o.name||"⚠"===o.name||"Identifier"===o.name)&&"QuoteExpression"===s.name&&"FieldExpression"===s.parent.name)return e.sliceDoc(s.parent.from,s.parent.to);if("ParameterizedIdentifier"===o.name)return o.firstChild(),nn(o)?e.doc.sliceString(o.from,o.to):void 0;if("Identifier"===o.name&&"Prefix"===s.name)continue;if("PrefixedString"===o.name){o.firstChild();let t=e.doc.sliceString(o.from,o.to);return`${t}"`}if("Identifier"===o.name&&"TypedExpression"===s.name)return o.parent(),o.lastChild(),nn(o)?e.doc.sliceString(o.from,o.to):void 0;if("TypedExpression"===o.name)return o.lastChild(),nn(o)?e.doc.sliceString(o.from,o.to):void 0;if("SpreadExpression"===o.name)return"...";if(s.to===o.to&&ne.includes(o.name)&&ne.includes(s.name)||"Identifier"===o.name&&"NamedField"===s.name&&s.lastChild.from!=o.from&&s.lastChild.to!=o.to)continue;if("binding"===o.name){let t=o.node.firstChild.to,n=o.node.lastChild.from;return e.doc.sliceString(t,n).trim()}if("ArgumentList"===o.name||"Identifier"===o.name&&"ArgumentList"===s.name&&("FunctionAssignmentExpression"===s.parent.parent.name||"FunctionDefinition"===s.parent.name)||"Identifier"===o.name&&"Symbol"===s.name)continue;if("FunctionDefinition"===o.name)return o.firstChild(),o.nextSibling(),nn(o)?e.doc.sliceString(o.from,o.to):void 0;if("FunctionAssignmentExpression"===o.name)return o.firstChild(),nn(o)?e.doc.sliceString(o.from,o.to):void 0;if("Identifier"===o.name&&"MacroIdentifier"===s.name)continue;if("MacroExpression"===o.name)return o.firstChild(),e.doc.sliceString(o.from,o.to);if("BinaryExpression"===o.name){let t=o.node.firstChild.to,n=o.node.lastChild.from;return e.doc.sliceString(t,n).trim()}if("TernaryExpression"===o.name)return"??:";if(ne.includes(o.name)||nt.includes(o.name)){if(!nn(o))return;let t=t7(o.node.cursor);if(null==t)return e.doc.sliceString(o.from,o.to);let n=a.usages.find(e=>e.usage.from===t.from&&e.usage.to===t.to);if(n?.definition==null)return e.doc.sliceString(o.from,o.to)}if("FunctionDefinition"===s.name||"binding"===s.name)return}finally{t&&console.groupEnd()}}while(o.parent())}};var tV=o("hiQgq"),S=o("kjWx8"),u=o("9Ta4i");let nr=(e,{scopestate:t,global_definitions:n})=>(0,tV.Decoration).set(no(t.usages.map(({definition:e,usage:t,name:a})=>null!=e?(0,tV.Decoration).mark({tagName:"a",attributes:{title:`${S.ctrl_or_cmd_name}-Click to jump to the definition of ${a}.`,"data-cell-variable":a,"data-cell-variable-from":`${e.from}`,"data-cell-variable-to":`${e.to}`,href:"#"}}).range(t.from,t.to):n[a]?(0,tV.Decoration).mark({tagName:"a",attributes:{title:`${S.ctrl_or_cmd_name}-Click to jump to the definition of ${a}.`,"data-pluto-variable":a,href:`#${a}`}}).range(t.from,t.to):null)),!0);const no=e=>e.filter(e=>null!=e),ni=(0,tV.Facet).define({combine:e=>e[0],compare:u.default.isEqual}),nl=(0,tV.ViewPlugin).fromClass(class{constructor(e){let t=e.state.facet(ni);this.decorations=nr(e.state,{scopestate:e.state.field(t5),global_definitions:t})}update(e){let t=e.state.facet(ni);(e.docChanged||e.viewportChanged||t!==e.startState.facet(ni))&&(this.decorations=nr(e.state,{scopestate:e.state.field(t5),global_definitions:t}))}},{decorations:e=>e.decorations,eventHandlers:{click:(e,t)=>{if(e.target instanceof Element){let n=e.target.closest("[data-pluto-variable]");if(n){let a=n.getAttribute("data-pluto-variable");if(null==a||!((0,S.has_ctrl_or_cmd_pressed)(e)||t.state.readOnly))return!1;e.preventDefault();let r=`[id='${encodeURI(a)}']`;document.querySelector(r)?.scrollIntoView({behavior:"smooth",block:"center"});let o=t.state.facet(ni);if(o[a])return window.dispatchEvent(new CustomEvent("cell_focus",{detail:{cell_id:o[a],line:0,definition_of:a}})),!0}let a=e.target.closest("[data-cell-variable]");if(a){let n=a.getAttribute("data-cell-variable"),r=Number(a.getAttribute("data-cell-variable-from")),o=Number(a.getAttribute("data-cell-variable-to"));return!!(null!=n&&null!=r&&null!=o&&((0,S.has_ctrl_or_cmd_pressed)(e)||t.state.readOnly))&&(e.preventDefault(),t.dispatch({scrollIntoView:!0,selection:{anchor:r,head:o}}),t.focus(),!0)}}}}});var tV=o("hiQgq");o("9Ta4i");var tV=o("hiQgq");const ns=tV.htmlLanguage.parser,nc=(0,tV.markdownLanguage).parser.configure((0,tV.parseCode)({htmlParser:ns})),nu=tV.PostgreSQL.language.parser,nd=(0,tV.sql)({dialect:tV.PostgreSQL}),np=tV.pythonLanguage.parser,nm=["md","mermaid","cm","markdown","mdx","mdl","markdownliteral"].flatMap(e=>[e,`@${e}`]),nh=(e,t)=>e.flatMap(({from:e,to:n})=>{let a=t.read(e,n),r=[],o=e;for(let{index:t}of a.matchAll(/\\\$/g)){let n=e+t;o!==n&&r.push({from:o,to:n}),o=n+1}return o!==n&&r.push({from:o,to:n}),r}),ng=new Set(["StringLiteral","CommandLiteral","NsStringLiteral","NsCommandLiteral"]),nf=(0,tV.parseMixed)((e,t)=>{let n;if("NsStringLiteral"!==e.name&&"StringLiteral"!==e.name)return null;let a=e.node,r=a.getChild('"""')??a.getChild('"');if(null==r)return null;let o=a.lastChild;if(null==o)return null;let i=r.to,l=Math.min(o.from,t.length);if(i>=l)return null;if("NsStringLiteral"===e.name)n=a.firstChild;else{let e=a.parent;if(null!=e&&"Arguments"===e.name){let t=e.parent;null!=t&&"MacrocallExpression"===t.name&&(n=t.getChild("MacroIdentifier"))}}if(null==n)return null;let s="MacroIdentifier"===n.name,c=t.read(n.from,n.to),u=null;if("@htl"===c||"html"===c)u=ns;else if(nm.includes(c))u=nc;else if("@javascript"===c||"@js"===c||"js"===c||"javascript"===c)u=tV.javascriptLanguage.parser;else if("py"===c||"pyr"===c||"python"===c||"@python"===c)u=np;else{if("sql"!==c)return null;u=nu}let d=[];if(null!=a.firstChild){let e=i,t=a.firstChild.cursor();do e{let t=(0,tV.julia)(e);return t.language.parser=t.language.parser.configure({wrap:nf}),t};var tV=o("hiQgq"),u=o("9Ta4i"),tV=o("hiQgq"),w=o("aN0pg");let{autocompletion:nb,completionKeymap:ny,completionStatus:nv,acceptCompletion:nw,selectedCompletion:nk}=tV.autocomplete;const nE=nb()[1],n$=[{key:"Tab",run:e=>{if(nw(e))return!0;if(e.state.readOnly)return!1;let t=e.state.selection.main;if(!t.empty)return!1;let n=e.state.sliceDoc(t.from-1,t.from),a=e.state.sliceDoc(e.state.doc.lineAt(t.from).from,t.from);return!" \n=".includes(n)&&(")"!==n||!!a.includes("?"))&&(0,tV.autocomplete).startCompletion(e)}},{key:"?",run:e=>null!=(0,tV.autocomplete).completionStatus(e.state)&&(to("docs"),!0)}];let nx=e=>{let t=null;return(0,tV.EditorView).updateListener.of(n=>{if(null==nk(n.state))return;let a=n.state.field(nE,!1),r=a?.open;if(null==r)return;let o=r.options[r.selected],i=o.completion.apply??o.completion.label;if("string"!=typeof i)return;let l=n.view.state.field(nE).active.find(e=>e.source==o.source);if(l?.hasResult?.()!==!0)return;let s=l.from,c=Math.min(l.to,n.state.doc.length),u=na(n.state.update({changes:{from:s,to:c,insert:i}}).state);null!=u&&t!=u&&(t=u,e(u))})};const nS=e=>e.matchBefore(/\\[\d\w_\^:]*/),nN=e=>e.matchBefore(/\.\:[^\s"'`()\[\]\{\}\.\,=]*/);let nC=e=>/^[@\p{L}\p{Sc}\d_][\p{L}\p{Nl}\p{Sc}\d_!]*"?$/u.test(e)?null:":"===e?`:(${e})`:`:${e}`;const nA={name:"Suggestions",header:()=>document.createElement("div"),rank:0},nM={name:"Operators",rank:1},nO=(e,t)=>3*t+(/^\p{Ll}/u.test(e)?2:/^\p{Lu}/u.test(e)?1:0),nT=e=>["."],nD=/^(.*\s)?(baremodule|begin|break|catch|const|continue|do|else|elseif|end|export|false|finally|for|function|global|if|import|let|local|macro|module|quote|return|struct|true|try|using|while)$/,nR=e=>/[\p{L}\p{Nl}\p{Sc}\d_!]*$/u.test(e)&&!nD.test(e),nL=e=>async t=>{if(nS(t)||!t.explicit&&nP(t)||!t.explicit&&null!=t.tokenBefore(["IntegerLiteral","FloatLiteral","LineComment","BlockComment","Symbol",...ng]))return null;let n=t.state.sliceDoc(0,t.pos),a=nN(t);a&&(n=n.slice(0,a.from+1)+n.slice(a.from+2));let r=t.state.facet(ni),o=e=>null!=e&&Object.keys(r).includes(e),i=await e({text:n});if(!i)return null;let{start:l,stop:s,results:c}=i;a&&(s+=1);let u=n.slice(0,l).endsWith("."),d=null!=t.matchBefore(/\~[^\s\"]*/);return{from:l,to:s,validFor:nR,commitCharacters:nT(t),filter:!d,options:[...c.filter(([e,n,a,r,i])=>(t.explicit||"path"!=i)&&!(r&&o(e))).map(([e,t,a,r,o,i],l)=>{let s="method"===o?n:u?nC(e)??e:e;return t="Function"===t&&e.startsWith("@")?"Macro":t,{label:e,apply:s,type:(0,w.cl)({c_notexported:!a,[`c_${t}`]:!0,[`completion_${o}`]:!0,c_from_notebook:r})??void 0,section:nA,boost:"keyword_argument"===o?7:u?nO(s,a):void 0,commitCharacters:"keyword_argument"===o||"Macro"===t?[]:void 0}}),...c.filter(([e])=>u&&null!=nC(e)).map(([e,t,n],a)=>{let r=nC(e)??"";return{label:r,apply:r,type:(n?"":"c_notexported ")+(null==t?"":"c_"+t),section:nM,is_not_exported:!n}})]}},nI=async e=>{if(nS(e)||!e.explicit&&nP(e)||!e.explicit&&null!=e.tokenBefore(["IntegerLiteral","FloatLiteral","LineComment","BlockComment","Symbol",...ng]))return null;let t=await (0,tV.autocomplete).completeAnyWord(e);return null===t||e.tokenBefore(["Identifier","IntegerLiteral","FloatLiteral"])?null:{from:t.from,commitCharacters:nT(e),options:t.options.map(({label:e},t)=>({label:e,apply:e,type:void 0,section:nA}))}},nP=e=>{if(e.matchBefore(nD)||e.matchBefore(/(catch|local|module|abstract type|struct|macro|const|for|function|let|do) ([@\p{L}\p{Nl}\p{Sc}\d_!,\(\)]|, )*$/u)||e.matchBefore(/do [\(\), \p{L}\p{Nl}\p{Sc}\d_!]*$/u))return!0;let t=(0,tV.syntaxTree)(e.state).resolve(e.pos,-1),n=t?.parent?.name;if(t?.name==="Identifier"&&"KeywordArguments"===n)return!0;let a="OpenTuple"===n||"TupleExpression"===n?t?.parent:t,r=a?.parent?.name;return t?.name==="Identifier"&&("Assignment"===r||"KwArg"===r)&&a?.nextSibling!=null},nj=(e,t)=>async n=>{if(nS(n)||!n.explicit&&nP(n)||!n.explicit&&null!=n.tokenBefore(["IntegerLiteral","FloatLiteral","LineComment","BlockComment","Symbol",...ng])||n.matchBefore(/\.[\p{L}\p{Nl}\p{Sc}\d_!]*$/u))return null;let a=n.state.facet(ni),r=e(),o=(0,u.default).union(Object.entries(a).filter(([e,t])=>null==r[t]).map(([e])=>e),...Object.values((0,u.default).omit(r,t))),i=await (0,tV.autocomplete).completeFromList(o.map(e=>({label:e,apply:e,type:"c_from_notebook completion_module c_Any",section:nA})))(n);return null==i?null:{...i,validFor:nR,commitCharacters:nT(n)}},nB=["\\sqrt","\\pi","\\approx"],nU=["\uD83D\uDC36","\uD83D\uDC31","\uD83D\uDC2D","\uD83D\uDC30","\uD83D\uDC3C","\uD83D\uDC28","\uD83D\uDC38","\uD83D\uDC14","\uD83D\uDC27"],nF=(e,t,n,a)=>{let r=e.state.sliceDoc(n,a),o=t.detail??t.label;!t.label.startsWith("\\:")&&r!==t.label&&function(e,t){let n=(0,tV.syntaxTree)(e).resolve(t);return!!(null!=n&&ng.has(n.name))}(e.state,a)&&(o=t.label),e.dispatch({...(0,tV.autocomplete).insertCompletionText(e.state,o,n,a),annotations:(0,tV.autocomplete).pickedCompletion.of(t)})},nz=e=>{let t=null,n=async()=>{if(null==t){let n=await e().catch(e=>(console.warn("Failed to fetch special symbols",e),null));if(null!=n){let{latex:e,emoji:a}=n;t=[a,e].flatMap(e=>Object.entries(e).map(([e,t])=>({label:e,apply:nF,detail:t??void 0,type:"c_special_symbol",boost:"\\in"===e?3:nB.includes(e)?2:nU.includes(t)?1:0})))}}return t};return async e=>{if(!nS(e)||!e.explicit&&nP(e)||!e.explicit&&null!=e.tokenBefore(["IntegerLiteral","FloatLiteral","LineComment","BlockComment"]))return null;let t=await n();return await (0,tV.autocomplete).completeFromList(t??[])(e)}};let nq=({request_autocomplete:e,request_special_symbols:t,on_update_doc_query:n,request_unsubmitted_global_definitions:a,cell_id:r})=>{let o=null,i=null,l=async t=>{if((0,u.default).isEqual(t,o)){let e=await i;if(null!=e)return e}return o=t,i=e(t),await i};return[nb({activateOnTyping:a2,override:[nj(a,r),nz(t),nL(l),nI],defaultKeymap:!1,maxRenderedOptions:512,optionClass:e=>e.type??""}),nx(n),(0,tV.keymap).of(n$),(0,tV.keymap).of(ny)]};var u=o("9Ta4i"),tV=o("hiQgq"),eD=o("1gqBQ"),u=o("9Ta4i"),l=(o("cNaMA"),o("cNaMA")),w=o("aN0pg"),l=o("cNaMA"),u=o("9Ta4i");const nH={current:null},nG=()=>{if(null!=nH.current)return nH.current;{let e=fetch("https://julia-loading-times-test.netlify.app/pkg_load_times.csv").then(e=>e.text()).then(e=>{let t=e.split("\n");return t[0].split(","),new Map(t.slice(1).map(e=>{let[t,...n]=e.split(",");return[t,{install:Number(n[0]),precompile:Number(n[1]),load:Number(n[2])}]}))}),t=fetch("https://julia-loading-times-test.netlify.app/top_packages_sorted_with_deps.txt").then(e=>e.text()).then(e=>new Map(e.split("\n").map(e=>{let[t,...n]=e.split(",");return[t,n]})));return nH.current=Promise.all([e,t]).then(([e,t])=>({times:e,packages:t})),nH.current}},nK=()=>{let[e,t]=(0,l.useState)(null);return(0,l.useEffect)(()=>{nG().then(t)},[]),e},nW=(e,t,n=[])=>{let a=e.packages.get(t);if(null==a)return[];{let t=(0,u.default).union(n,a);return[...a,...(0,u.default).difference(a,n).flatMap(n=>nW(e,n,t))]}},nZ=(e,t)=>{let n=t.flatMap(t=>nW(e,t)),a=(0,u.default).uniq([...t,...n]).map(t=>e.times.get(t)).filter(e=>null!=e),r=e=>e.reduce((e,t)=>e+(null==t||isNaN(t)?0:t),0);return{install:r(a.map((0,u.default).property("install")))*nV.install,precompile:r(a.map((0,u.default).property("precompile")))*nV.precompile,load:r(a.map((0,u.default).property("load")))*nV.load}},nV={install:2,load:1,precompile:.3};var u=o("9Ta4i"),l=o("cNaMA");o("kjWx8");var nQ=window.CustomEvent;function nX(e,t){var n="on"+t.type.toLowerCase();return"function"==typeof e[n]&&e[n](t),e.dispatchEvent(t)}function nY(e){for(;e;){if("dialog"===e.localName)return e;e=e.parentElement?e.parentElement:e.parentNode?e.parentNode.host:null}return null}function nJ(e){for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;e&&e.blur&&e!==document.body&&e.blur()}function n0(e){return!(!e||!e.hasAttribute("method"))&&"dialog"===e.getAttribute("method").toLowerCase()}function n1(e){return e.isConnected||document.body.contains(e)}function n2(e){if(e.submitter)return e.submitter;var t=e.target;if(!(t instanceof HTMLFormElement))return null;var n=n9.formSubmitter;if(!n){var a=e.target;n=("getRootNode"in a&&a.getRootNode()||document).activeElement}return n&&n.form===t?n:null}function n3(e){if(!e.defaultPrevented){var t=e.target,n=n9.imagemapUseValue,a=n2(e);null===n&&a&&(n=a.value);var r=nY(t);r&&"dialog"===(a&&a.getAttribute("formmethod")||t.getAttribute("method"))&&(e.preventDefault(),null!=n?r.close(n):r.close())}}function n4(e){if(this.dialog_=e,this.replacedStyleTop_=!1,this.openAsModal_=!1,e.hasAttribute("role")||e.setAttribute("role","dialog"),e.show=this.show.bind(this),e.showModal=this.showModal.bind(this),e.close=this.close.bind(this),e.addEventListener("submit",n3,!1),"returnValue"in e||(e.returnValue=""),"MutationObserver"in window)new MutationObserver(this.maybeHideModal.bind(this)).observe(e,{attributes:!0,attributeFilter:["open"]});else{var t,n=!1,a=(function(){n?this.downgradeModal():this.maybeHideModal(),n=!1}).bind(this),r=function(r){r.target===e&&(n|="DOMNodeRemoved"===r.type.substr(0,14),window.clearTimeout(t),t=window.setTimeout(a,0))};["DOMAttrModified","DOMNodeRemoved","DOMNodeRemovedFromDocument"].forEach(function(t){e.addEventListener(t,r)})}Object.defineProperty(e,"open",{set:this.setOpen.bind(this),get:e.hasAttribute.bind(e,"open")}),this.backdrop_=document.createElement("div"),this.backdrop_.className="backdrop",this.backdrop_.addEventListener("mouseup",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("mousedown",this.backdropMouseEvent_.bind(this)),this.backdrop_.addEventListener("click",this.backdropMouseEvent_.bind(this))}nQ&&"object"!=typeof nQ||((nQ=function(e,t){t=t||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,!!t.bubbles,!!t.cancelable,t.detail||null),n}).prototype=window.Event.prototype),n4.prototype={get dialog(){return this.dialog_},maybeHideModal:function(){this.dialog_.hasAttribute("open")&&n1(this.dialog_)||this.downgradeModal()},downgradeModal:function(){this.openAsModal_&&(this.openAsModal_=!1,this.dialog_.style.zIndex="",this.replacedStyleTop_&&(this.dialog_.style.top="",this.replacedStyleTop_=!1),this.backdrop_.parentNode&&this.backdrop_.parentNode.removeChild(this.backdrop_),n9.dm.removeDialog(this))},setOpen:function(e){e?this.dialog_.hasAttribute("open")||this.dialog_.setAttribute("open",""):(this.dialog_.removeAttribute("open"),this.maybeHideModal())},backdropMouseEvent_:function(e){if(this.dialog_.hasAttribute("tabindex"))this.dialog_.focus();else{var t=document.createElement("div");this.dialog_.insertBefore(t,this.dialog_.firstChild),t.tabIndex=-1,t.focus(),this.dialog_.removeChild(t)}var n=document.createEvent("MouseEvents");n.initMouseEvent(e.type,e.bubbles,e.cancelable,window,e.detail,e.screenX,e.screenY,e.clientX,e.clientY,e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget),this.dialog_.dispatchEvent(n),e.stopPropagation()},focus_:function(){var e=this.dialog_.querySelector("[autofocus]:not([disabled])");!e&&this.dialog_.tabIndex>=0&&(e=this.dialog_),e||(e=function e(t){var n=["button","input","keygen","select","textarea"].map(function(e){return e+":not([disabled])"});n.push('[tabindex]:not([disabled]):not([tabindex=""])');var a=t.querySelector(n.join(", "));if(!a&&"attachShadow"in Element.prototype)for(var r=t.querySelectorAll("*"),o=0;o, the polyfill may not work correctly",e),"dialog"!==e.localName)throw Error("Failed to register dialog: The element is not a dialog.");new n4(e)},registerDialog:function(e){e.showModal||n9.forceRegisterDialog(e)},DialogManager:function(){this.pendingDialogStack=[];var e=this.checkDOM_.bind(this);this.overlay=document.createElement("div"),this.overlay.className="_dialog_overlay",this.overlay.addEventListener("click",(function(t){this.forwardTab_=void 0,t.stopPropagation(),e([])}).bind(this)),this.handleKey_=this.handleKey_.bind(this),this.handleFocus_=this.handleFocus_.bind(this),this.zIndexLow_=1e5,this.zIndexHigh_=100150,this.forwardTab_=void 0,"MutationObserver"in window&&(this.mo_=new MutationObserver(function(t){var n=[];t.forEach(function(e){for(var t,a=0;t=e.removedNodes[a];++a)t instanceof Element&&("dialog"===t.localName&&n.push(t),n=n.concat(t.querySelectorAll("dialog")))}),n.length&&e(n)}))}};if(n9.DialogManager.prototype.blockDocument=function(){document.documentElement.addEventListener("focus",this.handleFocus_,!0),document.addEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.observe(document,{childList:!0,subtree:!0})},n9.DialogManager.prototype.unblockDocument=function(){document.documentElement.removeEventListener("focus",this.handleFocus_,!0),document.removeEventListener("keydown",this.handleKey_),this.mo_&&this.mo_.disconnect()},n9.DialogManager.prototype.updateStacking=function(){for(var e,t=this.zIndexHigh_,n=0;e=this.pendingDialogStack[n];++n)e.updateZIndex(--t,--t),0===n&&(this.overlay.style.zIndex=--t);var a=this.pendingDialogStack[0];a?(a.dialog.parentNode||document.body).appendChild(this.overlay):this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay)},n9.DialogManager.prototype.containedByTopDialog_=function(e){for(;e=nY(e);){for(var t,n=0;t=this.pendingDialogStack[n];++n)if(t.dialog===e)return 0===n;e=e.parentElement}return!1},n9.DialogManager.prototype.handleFocus_=function(e){var t=e.composedPath?e.composedPath()[0]:e.target;if(!this.containedByTopDialog_(t)&&document.activeElement!==document.documentElement&&(e.preventDefault(),e.stopPropagation(),nJ(t),void 0!==this.forwardTab_)){var n=this.pendingDialogStack[0];return n.dialog.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING&&(this.forwardTab_?n.focus_():t!==document.documentElement&&document.documentElement.focus()),!1}},n9.DialogManager.prototype.handleKey_=function(e){if(this.forwardTab_=void 0,27===e.keyCode){e.preventDefault(),e.stopPropagation();var t=new nQ("cancel",{bubbles:!1,cancelable:!0}),n=this.pendingDialogStack[0];n&&nX(n.dialog,t)&&n.dialog.close()}else 9===e.keyCode&&(this.forwardTab_=!e.shiftKey)},n9.DialogManager.prototype.checkDOM_=function(e){this.pendingDialogStack.slice().forEach(function(t){-1!==e.indexOf(t.dialog)?t.downgradeModal():t.maybeHideModal()})},n9.DialogManager.prototype.pushDialog=function(e){var t=(this.zIndexHigh_-this.zIndexLow_)/2-1;return!(this.pendingDialogStack.length>=t)&&(1===this.pendingDialogStack.unshift(e)&&this.blockDocument(),this.updateStacking(),!0)},n9.DialogManager.prototype.removeDialog=function(e){var t=this.pendingDialogStack.indexOf(e);-1!==t&&(this.pendingDialogStack.splice(t,1),0===this.pendingDialogStack.length&&this.unblockDocument(),this.updateStacking())},n9.dm=new n9.DialogManager,n9.formSubmitter=null,n9.imagemapUseValue=null,void 0===window.HTMLDialogElement){var n6=document.createElement("form");if(n6.setAttribute("method","dialog"),"dialog"!==n6.method){var n8=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"method");if(n8){var n5=n8.get;n8.get=function(){return n0(this)?"dialog":n5.call(this)};var n7=n8.set;n8.set=function(e){return"string"==typeof e&&"dialog"===e.toLowerCase()?this.setAttribute("method",e):n7.call(this,e)},Object.defineProperty(HTMLFormElement.prototype,"method",n8)}}document.addEventListener("click",function(e){if(n9.formSubmitter=null,n9.imagemapUseValue=null,!e.defaultPrevented){var t=e.target;if("composedPath"in e&&(t=e.composedPath().shift()||t),t&&n0(t.form)){if(!("submit"===t.type&&["button","input"].indexOf(t.localName)>-1)){if("input"!==t.localName||"image"!==t.type)return;n9.imagemapUseValue=e.offsetX+","+e.offsetY}nY(t)&&(n9.formSubmitter=t)}}},!1),document.addEventListener("submit",function(e){var t=e.target;if(!nY(t)){var n=n2(e);"dialog"===(n&&n.getAttribute("formmethod")||t.getAttribute("method"))&&e.preventDefault()}});var ae=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){if(!n0(this))return ae.call(this);var e=nY(this);e&&e.close()}}var l=o("cNaMA");const at=()=>{let e=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{null!=e.current&&"function"!=typeof HTMLDialogElement&&n9.registerDialog(e.current)},[e.current]),(0,l.useMemo)(()=>[e,()=>{e.current?.open||e.current?.showModal()},()=>{e.current?.open===!0&&e.current?.close?.()},()=>e.current?.open===!0?e.current?.close?.():e.current?.showModal?.()],[e])},an=({show:e,start_local:t})=>(window.open_edit_or_run_popup=()=>{t()},(0,l.html)` + {e.stopPropagation(),e.preventDefault(),t()}} + > + Edit or run this notebook + + `),aa=({offer_binder:e,start_binder:t,notebookfile:n,notebook:a})=>{let[r,o,i,s]=at(),[c,u]=(0,l.useState)(!1),d=(0,l.useRef)("");d.current=n??"",window.open_edit_or_run_popup=o,(0,l.useEffect)(()=>(window.start_binder=e?t:null,()=>{window.start_binder=null}),[t,e]);let p=d.current.startsWith("data:"),m=ao(a);return(0,l.html)` + {s(),e.stopPropagation(),e.preventDefault()}} + > + Edit or run this notebook + + + + ${e?(0,l.html)` + + ${"To be able to edit code and run cells, you need to run the notebook yourself. "} + Where would you like to run the notebook? + + ${null==m?null:(0,l.html)` ${"This notebook takes about "}${m}${" to run."}`} + In the cloud (experimental) + + + + + + + Binder is a free, open source service that runs scientific notebooks in the cloud! + It will take a while, usually 2-7 minutes to get a session. + + On your computer + (Recommended if you want to store your changes.) + `:null} + + + + ${p?(0,l.html)` + Download the notebook: + {"A"===e.target.tagName||e.target.closest("div").firstElementChild.click()}} + class="download_div" + > + notebook.jl + + + `:(0,l.html)` + Copy the notebook URL: + + e.target.select()} value=${d.current} readonly /> + {await navigator.clipboard.writeText(d.current),u(!0),setTimeout(()=>u(!1),3e3)}} + /> + + `} + + + + Run Pluto + + ${"(Also see: "} + How to install Julia and Pluto) + + + + + ${p?(0,l.html)` + Open the notebook file + Type the saved filename in the open box. + + `:(0,l.html)` + Paste URL in the Open box + + `} + + + + `},ar=e=>((e.nbpkg?.install_time_ns??NaN)+(0,u.default).sum(Object.values(e.cell_results).map(e=>e.runtime??0)))/1e9,ao=e=>{let t=ar(e);return isNaN(t)?null:ai((0,u.default).round(15+1.5*t,-1))},ai=e=>{let t=Math.ceil(e),n=Math.round(e/60);return e<60?`${t} second${t>1?"s":""}`:`${n} minute${n>1?"s":""}`};var eU=o("hrGZZ");const al=e=>document.head.querySelector(`link[rel='pluto-external-source'][id='${e}']`),as=al("arrow_up_circle_icon")?.href,ac=al("document_text_icon")?.href,au=al("help_circle_icon")?.href;al("open_icon")?.href;const ad=({notebook:e,disable_input:t})=>{let[n,a]=(0,l.useState)(null),r=(0,l.useRef)(null);r.current=n;let o=(0,l.useRef)(null),i=(0,l.useRef)(""),s=(0,l.useCallback)(e=>{let t=e.detail.source_element;if(o.current=t,null==t)i.current="top: 20%; left: 50%; transform: translate(-50%, -50%); position: fixed;";else{let e=t.getBoundingClientRect(),n=document.body.getBoundingClientRect();i.current=`top: ${.5*(e.top+e.bottom)-n.top}px; left: min(max(0px,100vw - 251px - 30px), ${e.right-n.left}px);`}a(e.detail)},[a]),c=(0,l.useCallback)(()=>{a(null)},[a]);(0,eU.useEventListener)(window,"open pluto popup",s,[s]),(0,eU.useEventListener)(window,"close pluto popup",c,[c]),(0,eU.useEventListener)(window,"pointerdown",e=>{null!=r.current&&null!=e.target&&null==e.target.closest("pluto-popup")&&(null!=o.current&&o.current.contains(e.target)||c())},[c]),(0,eU.useEventListener)(window,"keydown",e=>{"Escape"===e.key&&c()},[c]);let u=(0,l.useRef)(null);(0,l.useLayoutEffect)(()=>{null!=n&&(!0===n.should_focus?requestAnimationFrame(()=>{u.current=document.activeElement;let e=d.current?.querySelector("a")??d.current;e?.focus?.()}):u.current=null)},[null!=n]);let d=(0,l.useRef)(null);(0,eU.useEventListener)(d.current,"focusout",e=>{null!=r.current&&!0===r.current.should_focus&&!(d.current?.matches(":focus-within")||d.current?.contains(e.relatedTarget))&&(null!=o.current&&(o.current.contains(e.relatedTarget)||o.current.matches(":focus-within"))||(c(),e.preventDefault(),u.current?.focus?.()))},[c]);let p=n?.type;return(0,l.html)` + ${"nbpkg"===p?(0,l.html)`<${ap} + notebook=${e} + disable_input=${t} + recent_event=${n} + clear_recent_event=${()=>a(null)} + />`:"info"===p||"warn"===p?(0,l.html)`${n?.body}`:null} + + + + `},ap=({notebook:e,recent_event:t,clear_recent_event:n,disable_input:a})=>{let r=(0,l.useContext)(k),[o,i]=(0,l.useState)(null);(0,l.useEffect)(()=>{let n=!0;return null==t?i(null):t?.type==="nbpkg"&&(r.get_avaible_versions({package_name:t.package_name,notebook_id:e.notebook_id})??Promise.resolve([])).then(({versions:a,url:r})=>{n&&i(af({nbpkg:e.nbpkg,package_name:t.package_name,is_disable_pkg:t.is_disable_pkg,available_versions:a,package_url:r}))}),()=>{n=!1}},[t,...ah(e.nbpkg)]);let s=t.is_disable_pkg||(e.nbpkg?.enabled??!0);(0,l.useEffect)(()=>{s||n()},[s]);let[c,u]=(0,l.useState)(!1),d=e.nbpkg?.restart_required_msg==null&&!(e.nbpkg?.instantiated??!0),p=null!=t&&((e.nbpkg?.busy_packages??[]).includes(t.package_name)||d),m=eP(p,2);(0,l.useEffect)(()=>{u(m)},[m]);let h=e.nbpkg?.terminal_outputs==null?"Loading...":e.nbpkg?.terminal_outputs[t?.package_name]??"",g=o?.offer_update??!1,f=nK(),_=null==f||t?.package_name==null?null:nZ(f,[t?.package_name]),b=null==_?0:_.install+_.load+_.precompile,y=null==_?0:_.load;return(0,l.html)` + ${o?.hint??"Loading..."} + ${(o?.status==="will_be_installed"||o?.status==="busy")&&b>10?(0,l.html)` + Installation can take ${ai(b)}${". "}${"Afterwards, it loads in "} + ${ai(y)}. + `:null} + + ${t?.is_disable_pkg||a||e.nbpkg?.waiting_for_permission?null:(0,l.html)`{p?alert("Pkg is currently busy with other packages... come back later!"):confirm("Would you like to check for updates and install them? A backup of the notebook file will be created.")&&(console.warn("Pkg.updating!"),r.send("pkg_update",{},{notebook_id:e.notebook_id})),t.preventDefault()}} + >`} + {u(!c),e.preventDefault()}} + > + + + <${eC} value=${h??"Loading..."} /> + `},am=e=>null==e?[null]:Object.entries(e).flat(),ah=e=>null==e?[null]:Object.entries(e).flatMap(([e,t])=>"terminal_outputs"===e?[]:[t]),ag=(e,t)=>!!("stdlib"!==e&&(0,u.default).isArray(t))&&(0,u.default).last(t)!==e,af=({nbpkg:e,package_name:t,available_versions:n,is_disable_pkg:a,package_url:r})=>{let o="error",i="error",s=(0,l.html)`error`,c=!1;r=r??`https://juliahub.com/ui/Packages/General/${t}`;let d=e?.installed_versions[t]??null,p=e?.waiting_for_permission??!1,m=!p&&((e?.busy_packages??[]).includes(t)||!(e?.instantiated??!0)),h=(0,l.html)`${t} `;return a?(o="disable_pkg",i=`${t} disables Pluto's built-in package manager.`,s=(0,l.html)`${t} disables Pluto's built-in package manager.`):null!=d||(0,u.default).isEqual(n,["stdlib"])?null==d||"stdlib"===d?(o="installed",i=`${t} is part of Julia's pre-installed 'standard library'.`,s=(0,l.html)`${h} is part of Julia's pre-installed standard library.`):p?(o="will_be_installed",i=`${t} (v${(0,u.default).last(n)}) will be installed when you run this notebook.`,s=(0,l.html)`${h} v${(0,u.default).last(n)} + will be installed when you run this notebook.`):m?(o="busy",i=`${t} (v${d}) is installing...`,s=(0,l.html)`${h} v${d} + is installing...`):(o="installed",i=`${t} (v${d}) is installed in the notebook.`,s=(0,l.html)` + ${h} + v${d} + + is installed in the notebook.`,c=ag(d,n)):null!=n&&(0,u.default).isArray(n)&&(0===n.length?(o="not_found",i=`The package "${t}" could not be found in the registry. Did you make a typo?`,s=(0,l.html)`The package "${t}" could not be found in the registry. + Did you make a typo?`):(o="will_be_installed",i=`${t} (v${(0,u.default).last(n)}) will be installed in the notebook when you run this cell.`,s=(0,l.html)`${h} v${(0,u.default).last(n)} + will be installed in the notebook when you run this cell.`)),{status:o,hint:s,hint_raw:i,available_versions:n??null,chosen_version:d,busy:m,offer_update:c,package_url:r}},a_=({package_name:e,pluto_actions:t,notebook_id:n,nbpkg:a})=>{let[r,o]=(0,l.useState)(null),[i,s]=(0,l.useState)(null);(0,l.useEffect)(()=>{(t.get_avaible_versions({package_name:e,notebook_id:n})??Promise.resolve([])).then(o)},[e]);let{status:c,hint_raw:u}=af({nbpkg:a,package_name:e,is_disable_pkg:!1,available_versions:r?.versions,package_url:r?.package_url});return(0,l.html)` + + {(0,eD.open_pluto_popup)({type:"nbpkg",source_element:t.currentTarget.parentElement,package_name:e,is_disable_pkg:!1,should_focus:!0})}} + > + + + + `},ab=({package_name:e})=>{let{hint_raw:t}=af({nbpkg:null,package_name:e,is_disable_pkg:!0});return(0,l.html)` + + {(0,eD.open_pluto_popup)({type:"nbpkg",source_element:t.currentTarget.parentElement,package_name:e,is_disable_pkg:!0,should_focus:!0})}} + > + + + + `};var l=(o("cNaMA"),o("cNaMA")),tV=o("hiQgq");class ay extends tV.WidgetType{constructor(e){super(),this.element=e}eq(e){return!1}toDOM(){let e=document.createElement("span");return(0,l.render)(this.element,e),e}updateDOM(e){return(0,l.render)(this.element,e),!0}}const av=["Pkg.activate","Pkg.API.activate","Pkg.develop","Pkg.API.develop","Pkg.add","Pkg.API.add","quickactivate","@quickactivate"],aw=(0,tV.Facet).define({combine:e=>e[0],compare:u.default.isEqual}),ak=({pluto_actions:e,notebook_id_ref:t})=>(0,tV.ViewPlugin).fromClass(class{update_decos(n){let a=function(e,{pluto_actions:t,notebook_id:n,nbpkg:a}){let r=new Set,o=e.visibleRanges.flatMap(({from:o,to:i})=>(function({state:e,from:t,to:n}){let a=e.doc,r=(0,tV.syntaxTree)(e),o=[],i="import",l=!1;return!function({tree:e,enter:t,leave:n,from:a=0,to:r=e.length}){let o=e.cursor();for(;;){let e=!1;if(o.from<=r&&o.to>=a&&(o.type.isAnonymous||!1!==t(o))){if(o.firstChild())continue;o.type.isAnonymous||(e=!0)}for(;e&&n&&n(o),e=o.type.isAnonymous,!o.nextSibling();){if(!o.parent())return;e=!0}}}({tree:r,from:t,to:n,enter:e=>{let t=null;if("QuoteExpression"===e.name||"FunctionDefinition"===e.name)return!1;if("import"===e.name&&(i="import"),"using"===e.name&&(i="using"),"CallExpression"===e.name||"MacrocallExpression"===e.name){let t=e.node.firstChild;if(t){let n=a.sliceString(t.from,t.to);av.includes(n)&&o.push({type:"package_disabler",name:n,from:e.from,to:e.to})}return!1}if("ImportStatement"===e.name&&(l=!1),"SelectedImport"===e.name&&(l=!0,e.firstChild(),t=!0),"ImportPath"===e.name){let t={type:"package",name:a.sliceString(e.from,e.to),from:e.from,to:e.to};o.push(t),"using"!==i||l||o.push({...t,type:"implicit_using"})}if(t)return e.parent(),!1}}),o})({state:e.state,from:o,to:i}).map(e=>{if("package"===e.type){let{name:o}=e;if("Base"!==o&&"Core"!==o&&!r.has(o))return r.add(o),(0,tV.Decoration).widget({widget:new ay((0,l.html)` + <${a_} + key=${o} + package_name=${o} + pluto_actions=${t} + notebook_id=${n} + nbpkg=${a} + /> + `),side:1}).range(e.to)}else if("package_disabler"===e.type)return(0,tV.Decoration).widget({widget:new ay((0,l.html)` <${ab} package_name=${e.name} /> `),side:1}).range(e.to);else if("implicit_using"===e.type&&"HypertextLiteral"===e.name)return(0,tV.Decoration).widget({widget:new ay((0,l.html)` + + : @htl, @htl_str + + `),side:1}).range(e.to)})).filter(e=>null!=e);return(0,tV.Decoration).set(o,!0)}(n,{pluto_actions:e,notebook_id:t.current,nbpkg:n.state.facet(aw)});this.decorations=a}constructor(e){this.update_decos(e)}update(e){if(e.docChanged||e.viewportChanged||e.state.facet(aw)!==e.startState.facet(aw)){this.update_decos(e.view);return}}},{decorations:e=>e.decorations});var u=o("9Ta4i"),tV=o("hiQgq"),l=o("cNaMA");const aE=e=>/^\t*/.exec(e)?.[0]??"",a$=e=>{let t=[];for(let n of(0,u.default).range(0,e.doc.lines)){let a=e.doc.line(n+1),r=aE(a.text).length;if(0===r)continue;let o=Math.min(r,12),i=o*e.tabSize,s=(0,tV.Decoration).line({attributes:{style:`--indented: ${i}ch;`,class:"awesome-wrapping-plugin-the-line"}});if(t.push(s.range(a.from,a.from)),o>0&&t.push((0,tV.Decoration).mark({class:"awesome-wrapping-plugin-the-tabs"}).range(a.from,a.from+o)),r>o)for(let e of(0,u.default).range(o,r))t.push((0,tV.Decoration).replace({widget:new ay((0,l.html)`⇥ `),block:!1}).range(a.from+e,a.from+e+1))}return(0,tV.Decoration).set(t)},ax=(0,tV.StateField).define({create:e=>a$(e),update:(e,t)=>t.docChanged?a$(t.state):e,provide:e=>(0,tV.EditorView).decorations.from(e)});var tV=o("hiQgq");let aS=({focus_on_neighbor:e})=>(0,tV.keymap).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 n=t.state.selection.main;return!!(n.empty&&t.moveByChar(n,!1).eq(n))&&(e({cell_delta:-1,line:1/0,character:1/0}),!0)}},{key:"ArrowUp",run:t=>{let n=t.state.selection.main;return!!(n.empty&&t.moveVertically(n,!1).eq(n))&&(e({cell_delta:-1,line:1/0,character:1/0}),!0)}},{key:"ArrowRight",run:t=>{let n=t.state.selection.main;return!!(n.empty&&t.moveByChar(n,!0).eq(n))&&(e({cell_delta:1,line:0,character:0}),!0)}},{key:"ArrowDown",run:t=>{let n=t.state.selection.main;return!!(n.empty&&t.moveVertically(n,!0).eq(n))&&(e({cell_delta:1,line:0,character:0}),!0)}}]),aN=(0,tV.EditorView).domEventHandlers({keydown:(e,t)=>{let n=t.state.selection.main;if(!n.empty||!e.repeat)return!1;if("Backspace"===e.key&&0===t.state.doc.length||"Delete"===e.key&&0===t.state.doc.length)return!0;let a="active"===(0,tV.autocomplete).completionStatus(t.state);return"ArrowUp"!==e.key||a?"ArrowDown"!==e.key||a?"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)}}),aC=({focus_on_neighbor:e})=>aS({focus_on_neighbor:e});var tV=o("hiQgq");let aA=({pluto_actions:e,cell_id:t})=>(0,tV.EditorView).domEventHandlers({paste:(n,a)=>{if(!a.hasFocus)return console.log("CodeMirror, why are you registring this paste? You aren't focused!"),!0;n.stopPropagation();let r=n.clipboardData.getData("text/plain"),o=y(r);return null!=o&&(0===a.state.selection.main.from&&a.state.selection.main.to===a.state.doc.length?(e.add_deserialized_cells(r,t,o),e.confirm_delete_multiple("This Should Never Be Visible",[t]),!0):(a.state.selection.main.to===a.state.doc.length||0===a.state.selection.main.from)&&(e.add_deserialized_cells(r,t,o),!0))}});var tV=o("hiQgq");function aM(e){let t=e.parent.firstChild,n=e.parent.lastChild;if("end"!==n.name)return null;let a=e.parent.getChild("CatchClause")?.firstChild,r=e.parent.getChild("TryElseClause")?.firstChild,o=e.parent.getChild("FinallyClause")?.firstChild;return[{from:t.from,to:t.to},a&&{from:a.from,to:a.to},r&&{from:r.from,to:r.to},o&&{from:o.from,to:o.to},{from:n.from,to:n.to}].filter(e=>null!=e)}const aO=(0,tV.EditorView).baseTheme({".cm-matchingBracket":{backgroundColor:"#328c8252"},".cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),aT="()[]{}",aD=(0,tV.Facet).define({combine:e=>(0,tV.combineConfig)(e,{afterCursor:!0,brackets:aT,maxScanDistance:1e4})}),aR=(0,tV.Decoration).mark({class:"cm-matchingBracket"});(0,tV.Decoration).mark({class:"cm-nonmatchingBracket"});const aL=[(0,tV.StateField).define({create:()=>tV.Decoration.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],a=t.state.facet(aD);for(let e of t.state.selection.ranges){if(!e.empty)continue;let r=aI(t.state,e.head,-1,a)||e.head>0&&aI(t.state,e.head-1,1,a)||a.afterCursor&&(aI(t.state,e.head,1,a)||e.head(0,tV.EditorView).decorations.from(e)}),aO];function aI(e,t,n,a={}){let r=a.maxScanDistance||1e4,o=a.brackets||aT,i=(0,tV.syntaxTree)(e),l=i.resolveInner(t,n);return function(e){if("end"===e.name&&(e="IfStatement"===e.parent.name?e.parent?.firstChild?.firstChild:e.parent.firstChild),null==e)return[];if("mutable"===e.name||"struct"===e.name){"struct"===e.name&&(e=e.parent.firstChild);let t=e.parent.getChild("struct"),n=e.parent.lastChild;return"end"===n.name&&t?[{from:e.from,to:t.to},{from:n.from,to:n.to}]:null}if("struct"===e.name||"quote"===e.name||"begin"===e.name||"do"===e.name||"for"===e.name||"let"===e.name||"macro"===e.name||"function"===e.name||"while"===e.name){let t=e.parent.lastChild;return"end"!==t.name?null:[{from:e.from,to:e.to},{from:t.from,to:t.to}]}if("type"===e.name&&(e=e.parent.firstChild),"abstract"===e.name||"primitive"===e.name){let t=e.parent.lastChild,n="end"===t.name,a=e.parent.getChild("type");return n&&a?[{from:e.from,to:a.to},{from:t.from,to:t.to}]:null}if("if"===e.name||"else"===e.name||"elseif"===e.name){"if"===e.name&&(e=e.parent);let t=!1;"else"===e.name&&(e=e.parent,t=!0),"elseif"===e.name&&(e=e.parent.parent);let n=e.parent.firstChild,a=e.parent.lastChild;if("end"!==a.name)return null;if(t&&"try"===n.name)return aM(e);let r=[];for(let t of(r.push({from:n.from,to:n.to}),e.parent.getChildren("ElseifClause"))){let e=t.firstChild;r.push({from:e.from,to:e.to})}for(let t of e.parent.getChildren("ElseClause")){let e=t.firstChild;r.push({from:e.from,to:e.to})}return r.push({from:a.from,to:a.to}),r}if("try"===e.name||"catch"===e.name||"finally"===e.name||"else"===e.name)return("catch"===e.name&&(e=e.parent),"finally"===e.name&&(e=e.parent),"else"===e.name&&(e=e.parent),"end"!==e.parent.lastChild.name)?null:aM(e);if("module"===e.name||"baremodule"===e.name){let t=e.parent.lastChild;return"end"!==t.name?null:[{from:e.from,to:e.to},{from:t.from,to:t.to}]}return null}(l)||function(e,t,n,a,r,o,i){let l=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=i.indexOf(l);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let e=0;!u.next().done&&e<=o;){let o=u.value;n<0&&(e+=o.length);let l=t+e*n;for(let e=n>0?0:o.length-1,t=n>0?o.length:-1;e!=t;e+=n){let t=i.indexOf(o[e]);if(!(t<0)&&aP(a.resolve(l+e,1).name)==r){if(t%2==0==n>0)d++;else if(1==d){if(t>>1==s>>1)return[c,{from:l+e,to:l+e+1}];return null}else d--}}n>0&&(e+=o.length)}return u.done?[c]:null}(e,t,n,i,aP(l.name),r,o)}const aP=e=>{switch(e){case"(":case")":return"()";case"[":case"]":return"[]";case"{":case"}":return"{}";default:return e}};var w=o("aN0pg"),tV=o("hiQgq");const aj=(0,tV.Decoration).line({attributes:{class:"cm-highlighted-line"}}),aB=(0,tV.Decoration).mark({attributes:{class:"cm-highlighted-range"}}),aU=(0,tV.Facet).define({combine:e=>e[0],compare:(e,t)=>e===t}),aF=(0,tV.Facet).define({combine:e=>e[0],compare:(e,t)=>e===t}),az=()=>(0,tV.ViewPlugin).fromClass(class{updateDecos(e){this.decorations=function(e){let t=e.state.facet(aU);if(null==t||void 0==t||t<0||t>e.state.doc.lines)return(0,tV.Decoration).set([]);let n=e.state.doc.line(t);return(0,tV.Decoration).set([aj.range(n.from,n.from)])}(e)}constructor(e){this.decorations=(0,tV.Decoration).set([]),this.updateDecos(e)}update(e){(e.docChanged||e.state.facet(aU)!==e.startState.facet(aU))&&this.updateDecos(e.view)}},{decorations:e=>e.decorations}),aq=()=>(0,tV.ViewPlugin).fromClass(class{updateDecos(e){this.decorations=function(e){let t=e.state.facet(aF);if(null==t)return(0,tV.Decoration).set([]);let{from:n,to:a}=t;return n<0||n==a?(0,tV.Decoration).set([]):(0,tV.Decoration).set([aB.range(n,a)])}(e)}constructor(e){this.decorations=(0,tV.Decoration).set([]),this.updateDecos(e)}update(e){(e.docChanged||e.state.facet(aF)!==e.startState.facet(aF))&&this.updateDecos(e.view)}},{decorations:e=>e.decorations});var tV=o("hiQgq");function aH(e,t){return({state:n,dispatch:a})=>{if(n.readOnly)return!1;let r=e(t,n.selection.ranges,n);return!!r&&(a(n.update(r)),!0)}}const aG=aH(aQ,0);aH(aQ,1),aH(aQ,2);const aK=aH(aV,0);aH(aV,1),aH(aV,2);const aW=[{key:"Mod-/",run:e=>{let t=aZ(e.state);return t.line?aG(e):!!t.block&&aK(e)}},{key:"Alt-A",run:aK}];function aZ(e,t=e.selection.main.head){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function aV(e,t,n){let a=t.map(e=>aZ(n,e.from).block);if(!a.every(e=>e))return null;let r=t.map((e,t)=>(function(e,{open:t,close:n},a,r){let o,i,l=e.sliceDoc(a-50,a),s=e.sliceDoc(r,r+50),c=/\s*$/.exec(l)[0].length,u=/^\s*/.exec(s)[0].length,d=l.length-c;if(l.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:a-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-a<=100?o=i=e.sliceDoc(a,r):(o=e.sliceDoc(a,a+50),i=e.sliceDoc(r-50,r));let p=/^\s*/.exec(o)[0].length,m=/\s*$/.exec(i)[0].length,h=i.length-m-n.length;return o.slice(p,p+t.length)==t&&i.slice(h,h+n.length)==n?{open:{pos:a+p+t.length,margin:/\s/.test(o.charAt(p+t.length))?1:0},close:{pos:r-m-n.length,margin:/\s/.test(i.charAt(h-1))?1:0}}:null})(n,a[t],e.from,e.to));if(2==e||r.every(e=>e)){if(1!=e&&r.some(e=>e)){let e=[];for(let t=0,n;t{let{open:n,close:o}=a[e++];if(r[e])return{range:t};let i=n.length+1;return{changes:[{from:t.from,insert:n+" "},{from:t.to,insert:" "+o}],range:(0,tV.EditorSelection).range(t.anchor+i,t.head+i)}})}return null}function aQ(e,t,n){let a=[],r=-1;for(let{from:e,to:o}of t){let t=aZ(n,e).line,i=t===aZ(n,o).line?t:null,l=a.length,s=1e9;for(let t=e;t<=o;){let l=n.doc.lineAt(t);if(l.from>r&&(e==o||o>l.from)){r=l.from;let e=i??aZ(n,t).line;if(!e)continue;let o=/^\s*/.exec(l.text)[0].length,c=o==l.length,u=l.text.slice(o,o+e.length)==e?o:-1;oe.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:o,single:i}of a)(i||!o)&&e.push({from:t.from+r,insert:n+" "});let t=n.changes(e);return{changes:t,selection:n.selection.map(t,1)}}if(1!=e&&a.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of a)if(n>=0){let a=t.from+n,o=a+r.length;" "==t.text[o-t.from]&&o++,e.push({from:a,to:o})}return{changes:e}}return null}var tV=o("hiQgq");let aX=(e,t)=>e.slice(t,t+1)[0],aY={key:"Mod-d",run:({state:e,dispatch:t})=>{if(e.selection.main.empty){let n=(0,tV.syntaxTree)(e).cursorAt(e.selection.main.from,-1),a=(0,tV.syntaxTree)(e).cursorAt(e.selection.main.from,1);for(let e of["Identifier","FieldName"]){let r=n.name===e?n:a.name===e?a:null;if(r)return t({selection:{anchor:r.from,head:r.to}}),!0}let r=e.doc.lineAt(e.selection.main.from),o=e.selection.main.from-r.from,i=r.text.slice(0,o),l=r.text.slice(o),s=i.match(/(\w+)$/)?.[0]??"",c=l.match(/^(\w+)/)?.[0]??"";t({selection:{anchor:e.selection.main.from-s.length,head:e.selection.main.from+c.length}})}else(0,tV.selectNextOccurrence)({state:e,dispatch:t});return!1},shift:({state:e,dispatch:t})=>{if(1===e.selection.ranges.length)return!1;let n=e.selection.ranges.at(e.selection.mainIndex-1),a=e.selection.ranges.filter(e=>e!==n),r=a.indexOf(e.selection.main),o=aX(a,e.selection.mainIndex-1);return t({selection:(0,tV.EditorSelection).create(a,r),effects:null==o?[]:(0,tV.EditorView).scrollIntoView(o.from)}),!0},preventDefault:!0};var d=o("4zMEb"),aJ=o("aTIpG"),eU=o("hrGZZ");o("kjWx8");const a0="true"===window.localStorage.getItem("ENABLE_CM_MIXED_PARSER"),a1="true"===window.localStorage.getItem("ENABLE_CM_SPELLCHECK"),a2=(window.localStorage.getItem("ENABLE_CM_AUTOCOMPLETE_ON_TYPE")??(/Mac/.test(navigator.platform)?"true":"false"))==="true";a0&&console.log(`YOU ENABLED THE CODEMIRROR MIXED LANGUAGE PARSER +Thanks! Awesome! +Please let us know if you find any bugs... +If enough people do this, we can make it the default parser. +`),window.PLUTO_TOGGLE_CM_MIXED_PARSER=(e=!a0)=>{window.localStorage.setItem("ENABLE_CM_MIXED_PARSER",String(e)),window.location.reload()},window.PLUTO_TOGGLE_CM_SPELLCHECK=(e=!a1)=>{window.localStorage.setItem("ENABLE_CM_SPELLCHECK",String(e)),window.location.reload()},window.PLUTO_TOGGLE_CM_AUTOCOMPLETE_ON_TYPE=(e=!a2)=>{window.localStorage.setItem("ENABLE_CM_AUTOCOMPLETE_ON_TYPE",String(e)),window.location.reload()};const a3=[{tag:tV.tags.comment,color:"var(--cm-color-comment)",fontStyle:"italic",filter:"none"},{tag:tV.tags.keyword,color:"var(--cm-color-keyword)"},{tag:tV.tags.variableName,color:"var(--cm-color-var)",fontWeight:700},{tag:tV.tags.typeName,color:"var(--cm-color-type)",fontStyle:"italic"},{tag:tV.tags.typeOperator,color:"var(--cm-color-type)",fontStyle:"italic"},{tag:tV.tags.tagName,color:"var(--cm-color-tag)"},{tag:tV.tags.propertyName,color:"var(--cm-color-property)"},{tag:tV.tags.macroName,color:"var(--cm-color-macro)",fontWeight:700},{tag:tV.tags.string,color:"var(--cm-color-string)"},{tag:tV.tags.number,color:"var(--cm-color-number)"},{tag:tV.tags.bool,color:"var(--cm-color-builtin)",fontWeight:700},{tag:tV.tags.atom,color:"var(--cm-color-atom)"},{tag:tV.tags.unit,color:"var(--cm-color-tag)"},{tag:tV.tags.bracket,color:"var(--cm-color-bracket)"},{tag:(0,tV.tags).special(tV.tags.brace),color:"var(--cm-color-macro)",fontWeight:700}],a4=(0,tV.HighlightStyle).define(a3,{all:{color:"var(--cm-color-editor-text)"},scope:(0,tV.julia)().language}),a9=(0,tV.HighlightStyle).define(a3,{all:{color:"var(--cm-color-editor-text)",filter:"contrast(0.5)"},scope:tV.javascriptLanguage}),a6=(0,tV.HighlightStyle).define(a3,{all:{color:"var(--cm-color-editor-text)",filter:"contrast(0.5)"},scope:tV.pythonLanguage}),a8=(0,tV.HighlightStyle).define([{tag:tV.tags.comment,color:"var(--cm-color-comment)",fontStyle:"italic"},{tag:tV.tags.variableName,color:"var(--cm-color-css-accent)",fontWeight:700},{tag:tV.tags.propertyName,color:"var(--cm-color-css-accent)",fontWeight:700},{tag:tV.tags.tagName,color:"var(--cm-color-css)",fontWeight:700},{tag:tV.tags.definitionOperator,color:"var(--cm-color-css)"},{tag:tV.tags.keyword,color:"var(--cm-color-css)"},{tag:tV.tags.modifier,color:"var(--cm-color-css-accent)"},{tag:tV.tags.literal,color:"var(--cm-color-css)"},{tag:tV.tags.punctuation,opacity:.5}],{scope:tV.cssLanguage,all:{color:"var(--cm-color-css)"}}),a5=(0,tV.HighlightStyle).define([{tag:tV.tags.comment,color:"var(--cm-color-comment)",fontStyle:"italic"},{tag:tV.tags.content,color:"var(--cm-color-html)",fontWeight:400},{tag:tV.tags.tagName,color:"var(--cm-color-html-accent)",fontWeight:600},{tag:tV.tags.documentMeta,color:"var(--cm-color-html-accent)"},{tag:tV.tags.attributeName,color:"var(--cm-color-html-accent)",fontWeight:600},{tag:tV.tags.attributeValue,color:"var(--cm-color-html-accent)"},{tag:tV.tags.angleBracket,color:"var(--cm-color-html-accent)",fontWeight:600,opacity:.7}],{all:{color:"var(--cm-color-html)"},scope:tV.htmlLanguage}),a7=(0,tV.HighlightStyle).define([{tag:tV.tags.comment,color:"var(--cm-color-comment)",fontStyle:"italic"},{tag:tV.tags.content,color:"var(--cm-color-md)"},{tag:tV.tags.heading,color:"var(--cm-color-md)",fontWeight:700},{tag:tV.tags.quote,color:"var(--cm-color-md)"},{tag:tV.tags.emphasis,fontStyle:"italic"},{tag:tV.tags.strong,fontWeight:"bolder"},{tag:tV.tags.link,textDecoration:"underline"},{tag:tV.tags.url,color:"var(--cm-color-md)",textDecoration:"none"},{tag:tV.tags.monospace,color:"var(--cm-color-md-accent)"},{tag:tV.tags.processingInstruction,color:"var(--cm-color-md-accent) !important",opacity:"0.5"}],{all:{color:"var(--cm-color-md)"},scope:tV.markdownLanguage}),re=e=>e.state.doc.toString(),rt=(e,t)=>e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t}}),rn=(e,t,n,a)=>e.dispatch({changes:{from:n,to:a,insert:t}});let ra=(e,t)=>{let n=(0,l.useRef)(new tV.Compartment),a=(0,l.useRef)(n.current.of(t));return(0,l.useLayoutEffect)(()=>{e.current?.dispatch?.({effects:n.current.reconfigure(t)})},[t]),a.current},rr=(e,{line:t,ch:n})=>{let a=e.line((0,u.default).clamp(t+1,1,e.lines)),r=(0,u.default).clamp(n,0,a.length);return a.from+r};const ro=({local_code:e,remote_code:t,disable_input:n,focus_after_creation:a,cm_forced_focus:r,set_cm_forced_focus:o,show_input:i,skip_static_fake:s=!1,on_submit:c,on_delete:p,on_add_after:m,on_change:h,on_update_doc_query:g,on_focus_neighbor:f,on_line_heights:_,nbpkg:b,cell_id:y,notebook_id:v,any_logs:w,show_logs:E,set_show_logs:$,set_cell_disabled:x,cm_highlighted_line:S,cm_highlighted_range:N,metadata:C,global_definition_locations:A,cm_diagnostics:M})=>{let O=(0,l.useContext)(k),{disabled:T,skip_as_script:D}=C,[R,L]=(0,l.useState)(null);if(R)throw L(null),R;let I=(0,l.useRef)(v);I.current=v;let P=(0,l.useRef)(null),j=(0,l.useRef)(null),B=(0,l.useRef)(null),U=ra(P,aw.of(b)),F=ra(P,ni.of(A)),z=ra(P,aU.of(S)),q=ra(P,aF.of(N)),H=ra(P,(0,tV.EditorState).readOnly.of(n)),G=ra(P,(0,l.useMemo)(()=>(0,tV.EditorView).updateListener.of(e=>{e.docChanged&&h(e.state.doc.toString())}),[h])),[K,W]=(0,l.useState)(!s),Z=(0,l.useRef)(!1);Z.current||=navigator.userAgent.includes("Firefox")||a||null!=r||s;let V=!Z.current&&K;return(0,l.useLayoutEffect)(()=>{let e;if(!V)return;let t=j.current;if(null==t)return;let n=()=>{W(!1),e.disconnect(),window.removeEventListener("beforeprint",n)};return(e=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&n()})).observe(t),window.addEventListener("beforeprint",n),()=>{e.disconnect(),window.removeEventListener("beforeprint",n)}},[]),(0,l.useLayoutEffect)(()=>{if(V||null==j.current)return;let t=async e=>await e(),n=e=>((0,tV.autocomplete).closeCompletion(e),t(async()=>{await m(),e.state.doc.toString()!==B.current&&c()}),!0),r=(0,tV.autocomplete).completionKeymap.find(e=>"Enter"===e.key),i=()=>{let e=P.current,t=re(e),n=t.trim(),a=t.length-t.trimStart().length;if(console.table({value:t,trimmed:n,offset:a}),n.startsWith('md"')&&n.endsWith('"')){let t,r;if(n.startsWith('md"""')&&n.endsWith('"""')?(t=5,r=n.length-3):(t=3,r=n.length-1),t>=r||""==n.substring(t,r).trim())rt(e,"");else{for(;/\s/.test(n[t]);)++t;for(;/\s/.test(n[r-1]);)--r;rn(e,"",r+a,e.state.doc.length),rn(e,"",0,t+a)}}else{let t=`md""" +`,n=` +"""`,a=e.state.selection.main;e.dispatch({changes:[{from:0,to:0,insert:t},{from:e.state.doc.length,to:e.state.doc.length,insert:n}],selection:0===a.from?{anchor:a.from+t.length,head:a.to+t.length}:void 0})}return!0},l=e=>!e.state.facet(tV.EditorState.readOnly)&&0===e.state.doc.length&&(f(y,1),p(),!0),s=e=>!e.state.facet(tV.EditorState.readOnly)&&0===e.state.doc.length&&(f(y,-1,1/0,1/0),p(),!0),h=(e,t)=>{if(e.state.facet(tV.EditorState.readOnly))return!1;let n=e.state.selection.main;return 0===n.anchor&&n.head===e.state.doc.length||1===e.state.doc.lines?(O.move_remote_cells([y],O.get_notebook().cell_order.indexOf(y)+(-1===t?-1:2)),requestIdleCallback(()=>{e.dispatch({selection:{anchor:0,head:e.state.doc.length},scrollIntoView:!0}),e.focus()}),!0):1===t?(0,tV.moveLineDown)(e):(0,tV.moveLineUp)(e)},b=(e,t)=>(o(!0),O.fold_remote_cells([y],t),!0),v=[{key:"Shift-Enter",run:e=>((0,tV.autocomplete).closeCompletion(e),c(),!0)},{key:"Ctrl-Enter",mac:"Cmd-Enter",run:n},{key:"Ctrl-Enter",run:n},{key:"Tab",run:e=>!e.state.readOnly&&(!!r?.run?.(e)||(e.state.selection.ranges.some(e=>!e.empty)?(0,tV.indentMore)(e):(e.dispatch(e.state.changeByRange(e=>({range:(0,tV.EditorSelection).cursor(e.from+1),changes:{from:e.from,to:e.to,insert:" "}}))),!0))),shift:tV.indentLess},{key:"Ctrl-m",mac:"Cmd-m",run:i},{key:"Ctrl-m",run:i},{key:"Ctrl-M",run:i},{key:"Delete",run:l},{key:"Ctrl-Delete",run:l},{key:"Backspace",run:s},{key:"Ctrl-Backspace",run:s},{key:"Alt-ArrowUp",run:e=>h(e,-1)},{key:"Alt-ArrowDown",run:e=>h(e,1)},{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>b(e,!0)},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>b(e,!1)},aY],w=(0,tV.EditorView).updateListener.of(e=>{if(e.view.hasFocus&&(e.docChanged||e.selectionSet)){let t=e.state;{let e=na(t,!1);null!=e&&g(e)}}}),k=(0,tV.EditorView).updateListener.of(e=>{if(e.docChanged){let t=[...e.startState.field(t5).definitions.keys()],n=[...e.state.field(t5).definitions.keys()];(0,u.default).isEqual(t,n)||O.set_unsubmitted_global_definitions(y,n)}}),E=window.matchMedia("(prefers-color-scheme: dark)").matches,$=P.current=new tV.EditorView({state:(0,tV.EditorState).create({doc:e,extensions:[(0,tV.EditorView).theme({},{dark:E}),U,z,q,F,H,az(),aq(),aN,ak({pluto_actions:O,notebook_id_ref:I}),t5,(0,tV.syntaxHighlighting)(a4),(0,tV.syntaxHighlighting)(a5),(0,tV.syntaxHighlighting)(a7),(0,tV.syntaxHighlighting)(a9),(0,tV.syntaxHighlighting)(a6),(0,tV.syntaxHighlighting)(a8),(0,tV.lineNumbers)(),(0,tV.highlightSpecialChars)(),(0,tV.history)(),(0,tV.drawSelection)(),(0,tV.EditorState).allowMultipleSelections.of(!0),(0,tV.EditorView).clickAddsSelectionRange.of(e=>e.altKey&&!e.shiftKey),(0,tV.indentOnInput)(),(0,tV.EditorState).languageData.of((e,t,n)=>[{closeBrackets:{brackets:["(","[","{"]}}]),(0,tV.closeBrackets)(),(0,tV.rectangularSelection)({eventFilter:e=>e.altKey&&e.shiftKey&&0==e.button}),(0,tV.highlightSelectionMatches)({minSelectionLength:2,wholeWords:!0}),function(e={}){return[aD.of(e),aL]}(),w,k,aJ.tab_help_plugin,(0,tV.EditorView).domEventHandlers({blur:(e,t)=>{document.activeElement!==t.contentDOM&&(setTimeout(()=>{t.dispatch({selection:{anchor:t.state.selection.main.head},scrollIntoView:!1}),t.contentDOM.blur()},0),o(null))}}),aA({pluto_actions:O,cell_id:y}),(0,tV.EditorView).updateListener.of(e=>{e.docChanged&&e.state.doc.length>0&&"?"===e.state.sliceDoc(0,1)&&to("docs")}),(0,tV.EditorState).tabSize.of(4),(0,tV.indentUnit).of(" "),...a0?[n_(),(0,tV.markdown)({defaultCodeLanguage:n_()}),(0,tV.html)(),(0,tV.javascript)(),(0,tV.python)(),nd]:[(0,tV.julia)()],nl,nq({request_autocomplete:async({text:e})=>{let t=await (0,d.timeout_promise)(O.send("complete",{query:e},{notebook_id:I.current}),5e3).catch(console.warn);if(!t)return null;let{message:n}=t;return{start:(0,tQ.utf8index_to_ut16index)(e,n.start),stop:(0,tQ.utf8index_to_ut16index)(e,n.stop),results:n.results}},request_special_symbols:()=>O.send("complete_symbols").then(({message:e})=>e),on_update_doc_query:g,request_unsubmitted_global_definitions:()=>O.get_unsubmitted_global_definitions(),cell_id:y}),(0,tV.keymap).of(v),(0,tV.keymap).of(aW),aC({focus_on_neighbor:({cell_delta:e,line:t,character:n})=>f(y,e,t,n)}),(0,tV.keymap).of([...tV.closeBracketsKeymap,...tV.defaultKeymap,...tV.historyKeymap,...tV.foldKeymap]),(0,tV.placeholder)("Enter cell code..."),(0,tV.EditorView).contentAttributes.of({spellcheck:String(a1)}),tV.EditorView.lineWrapping,ax,(0,tV.EditorView).updateListener.of(e=>{e.docChanged&&e.view.dispatch((0,tV.setDiagnostics)(e.state,[]))}),G,(0,tV.EditorView).exceptionSink.of(e=>{L(e),console.error("EditorView exception!",e)})]}),parent:j.current});$.dom.CodeMirror={getValue:()=>re($),setValue:e=>rt($,e)},a&&setTimeout(()=>{let e=P.current;null!=e&&(e.dom.scrollIntoView({behavior:"smooth",block:"nearest"}),e.dispatch({selection:{anchor:e.state.doc.length,head:e.state.doc.length},effects:[(0,aJ.LastFocusWasForcedEffect).of(!0)]}),e.focus())});let x=j.current.querySelector("div.cm-content");if(x){let e=new ResizeObserver(()=>{let e=x.children,t=(0,u.default).map(e,e=>e.offsetTop);_([...t.slice(1).map((e,n)=>e-t[n]),15])});return e.observe(x),()=>{e.unobserve(x)}}},[V]),(0,l.useEffect)(()=>{if(null==P.current)return;let e=P.current;e.dispatch((0,tV.setDiagnostics)(e.state,M))},[M]),(0,l.useEffect)(()=>{if(null==P.current)return;let e=re(P.current)??"";(null!=B.current||""!==t||""===e)&&(B.current=t,e!==t&&rt(P.current,t))},[t]),(0,l.useEffect)(()=>{let e=P.current;if(null!=e){if(null==r)e.dispatch({selection:{anchor:e.state.selection.main.head,head:e.state.selection.main.head}});else if(!0===r);else{let t={anchor:rr(e.state.doc,r[0]),head:rr(e.state.doc,r[1])};if(r[2]?.definition_of){let n=e.state.field(t5),a=n?.definitions.get(r[2]?.definition_of);a&&(t={anchor:a.from,head:a.to})}e.dom.scrollIntoView({behavior:"smooth",block:"nearest"}),e.focus(),e.dispatch({scrollIntoView:!0,selection:t,effects:[(0,tV.EditorView).scrollIntoView((0,tV.EditorSelection).range(t.anchor,t.head),{yMargin:80}),(0,aJ.LastFocusWasForcedEffect).of(!0)]})}}},[r]),(0,l.html)` + + ${V&&i?(0,l.html)`<${rc} value=${t} />`:null} + <${rl} + on_delete=${p} + cell_id=${y} + run_cell=${c} + skip_as_script=${D} + running_disabled=${T} + any_logs=${w} + show_logs=${E} + set_show_logs=${$} + set_cell_disabled=${x} + /> + ${ri} + + `},ri=(0,l.html)`👀 Reading hidden code`,rl=({on_delete:e,cell_id:t,run_cell:n,skip_as_script:a,running_disabled:r,any_logs:o,show_logs:i,set_show_logs:s,set_cell_disabled:c})=>{let u,d;let p=(0,l.useRef)(null),m=(0,l.useContext)(k),[h,g]=(0,l.useState)(!1),f=(0,l.useRef)(null),_=(0,l.useRef)(null),b=(0,l.useRef)(null),y=e=>{e&&(b.current=document.activeElement),g(e)};(0,l.useLayoutEffect)(()=>{if(h)_.current?.querySelector("button")?.focus();else{let e=b.current;e instanceof HTMLElement&&e.focus()}},[h]);let v=async e=>{let n=!a;e.preventDefault(),await m.update_notebook(e=>{e.cell_inputs[t].metadata.skip_as_script=n})},E=async e=>{await c(!r)};return(0,eU.useEventListener)(window,"keydown",e=>{"Escape"===e.key&&y(!1)},[]),(0,l.html)` + {y(!h)}} + class=${(0,w.cl)({input_context_menu:!0,open:h})} + title="Actions" + ref=${f} + > + + + {(_.current?.matches(":focus-within")||_.current?.contains(e.relatedTarget))&&e.relatedTarget!==_.current||y(!1)}} + > + ${h?(0,l.html)`{p.current&&clearTimeout(p.current)}}> + <${rs} tag="delete" contents="Delete cell" title="Delete cell" onClick=${e} setOpen=${y} /> + + <${rs} + title=${r?"Enable and run the cell":"Disable this cell, and all cells that depend on it"} + tag=${r?"enable_cell":"disable_cell"} + contents=${r?(0,l.html)`Enable cell`:(0,l.html)`Disable cell`} + onClick=${E} + setOpen=${y} + /> + ${o?(0,l.html)`<${rs} + title=${i?"Show cell logs":"Hide cell logs"} + tag=${i?"hide_logs":"show_logs"} + contents=${i?"Hide logs":"Show logs"} + onClick=${()=>s(!i)} + setOpen=${y} + />`:null} + ${(u=m.get_notebook(),(d=u?.cell_results?.[t])&&!d.errored&&!d.queued&&"text/plain"===d.output.mime&&d.output.body)?(0,l.html)`<${rs} + tag="copy_output" + contents="Copy output" + title="Copy the output of this cell to the clipboard." + onClick=${()=>{let e=m.get_notebook(),n=e?.cell_results?.[t]?.output.body??"";n&&navigator.clipboard.writeText(n).catch(e=>{alert("Error copying cell output")})}} + setOpen=${y} + />`:null} + + <${rs} + title=${a?"This cell is currently stored in the notebook file as a Julia comment. Click here to disable.":"Store this code in the notebook file as a Julia comment. This way, it will not run when the notebook runs as a script outside of Pluto."} + tag=${a?"run_as_script":"skip_as_script"} + contents=${a?(0,l.html)`Enable in file`:(0,l.html)`Disable in file`} + onClick=${v} + setOpen=${y} + /> + `:(0,l.html)``} + + `},rs=({contents:e,title:t,onClick:n,setOpen:a,tag:r})=>(0,l.html)` + {a(!1),n(e)}} + class=${r} + > + ${e} + + `,rc=({value:e})=>{let t=e.split("\n").map((e,t)=>{let n=aE(e),a=0==n.length?e:(0,l.html)`${n}${e.substring(n.length)}`;return(0,l.html)` + ${0===e.length?(0,l.html)``:a} + `});return(0,l.html)` + + + + + + + ${t} + + + + `};class ru{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function rd(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function rp(e,...t){let n=Object.create(null);for(let t in e)n[t]=e[t];return t.forEach(e=>{for(let t in e)n[t]=e[t]}),n}const rm=e=>!!e.scope;class rh{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=rd(e)}openNode(e){if(!rm(e))return;let t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){rm(e)&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}const rg=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class rf{constructor(){this.rootNode=rg(),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){let t=rg({scope:e});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=>{rf._collapse(e)}))}}class r_ extends rf{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let n=e.root;t&&(n.scope="language:"+t),this.add(n)}toHTML(){return new rh(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function rb(e){return e?"string"==typeof e?e:e.source:null}function ry(e){return rk("(?=",e,")")}function rv(e){return rk("(?:",e,")*")}function rw(e){return rk("(?:",e,")?")}function rk(...e){return e.map(e=>rb(e)).join("")}function rE(...e){return"("+((e=>{let t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}})(e).capture?"":"?:")+e.map(e=>rb(e)).join("|")+")"}function r$(e){return RegExp(e.toString()+"|").exec("").length-1}const rx=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function rS(e,{joinWith:t}){let n=0;return e.map(e=>{let t=n+=1,a=rb(e),r="";for(;a.length>0;){let e=rx.exec(a);if(!e){r+=a;break}r+=a.substring(0,e.index),a=a.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?r+="\\"+(Number(e[1])+t):(r+=e[0],"("===e[0]&&n++)}return r}).map(e=>`(${e})`).join(t)}const rN="[a-zA-Z]\\w*",rC="[a-zA-Z_]\\w*",rA="\\b\\d+(\\.\\d+)?",rM="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",rO="\\b(0b[01]+)",rT={begin:"\\\\[\\s\\S]",relevance:0},rD=(e,t,n={})=>{let a=rp({scope:"comment",begin:e,end:t,contains:[]},n);a.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=rE("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 a.contains.push({begin:rk(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a},rR=rD("//","$"),rL=rD("/\\*","\\*/"),rI=rD("#","$");var rP=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[rT]},BACKSLASH_ESCAPE:rT,BINARY_NUMBER_MODE:{scope:"number",begin:rO,relevance:0},BINARY_NUMBER_RE:rO,COMMENT:rD,C_BLOCK_COMMENT_MODE:rL,C_LINE_COMMENT_MODE:rR,C_NUMBER_MODE:{scope:"number",begin:rM,relevance:0},C_NUMBER_RE:rM,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()}}),HASH_COMMENT_MODE:rI,IDENT_RE:rN,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+rC,relevance:0},NUMBER_MODE:{scope:"number",begin:rA,relevance:0},NUMBER_RE:rA,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/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[rT]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[rT,{begin:/\[/,end:/\]/,relevance:0,contains:[rT]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=rk(t,/.*\b/,e.binary,/\b.*/)),rp({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:rN,relevance:0},UNDERSCORE_IDENT_RE:rC,UNDERSCORE_TITLE_MODE:{scope:"title",begin:rC,relevance:0}});function rj(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function rB(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function rU(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=rj,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function rF(e,t){Array.isArray(e.illegal)&&(e.illegal=rE(...e.illegal))}function rz(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 rq(e,t){void 0===e.relevance&&(e.relevance=1)}const rH=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=rk(n.beforeMatch,ry(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},rG=["of","and","for","in","not","or","if","then","parent","list","value"],rK={},rW=e=>{console.error(e)},rZ=(e,...t)=>{console.log("WARN: "+e,...t)},rV=(e,t)=>{rK[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),rK[`${e}/${t}`]=!0)},rQ=Error();function rX(e,t,{key:n}){let a=0,r=e[n],o={},i={};for(let e=1;e<=t.length;e++)i[e+a]=r[e],o[e+a]=!0,a+=r$(t[e-1]);e[n]=i,e[n]._emit=o,e[n]._multi=!0}function rY(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope),"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 rW("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),rQ;if("object"!=typeof e.beginScope||null===e.beginScope)throw rW("beginScope must be object"),rQ;rX(e,e.begin,{key:"beginScope"}),e.begin=rS(e.begin,{joinWith:""})}})(e),(e=>{if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw rW("skip, excludeEnd, returnEnd not compatible with endScope: {}"),rQ;if("object"!=typeof e.endScope||null===e.endScope)throw rW("endScope must be object"),rQ;rX(e,e.end,{key:"endScope"}),e.end=rS(e.end,{joinWith:""})}})(e)}class rJ extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const r0=Symbol("nomatch"),r1=e=>{let t=Object.create(null),n=Object.create(null),a=[],r=!0,o="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:r_};function s(e){return l.noHighlightRe.test(e)}function c(e,t,n){let a="",r="";"object"==typeof t?(a=e,n=t.ignoreIllegals,r=t.language):(rV("10.7.0","highlight(lang, code, ...args) has been deprecated."),rV("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),r=e,a=t),void 0===n&&(n=!0);let o={code:a,language:r};b("before:highlight",o);let i=o.result?o.result:u(o.language,o.code,n);return i.code=o.code,b("after:highlight",i),i}function u(e,n,a,i){let s=Object.create(null);function c(){if(!k.keywords)return void $.addText(x);let e=0;k.keywordPatternRe.lastIndex=0;let t=k.keywordPatternRe.exec(x),n="";for(;t;){n+=x.substring(e,t.index);let a=y.case_insensitive?t[0].toLowerCase():t[0],r=k.keywords[a];if(r){let[e,o]=r;if($.addText(n),n="",s[a]=(s[a]||0)+1,s[a]<=7&&(S+=o),e.startsWith("_"))n+=t[0];else{let n=y.classNameAliases[e]||e;m(t[0],n)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(x)}n+=x.substring(e),$.addText(n)}function p(){null!=k.subLanguage?(()=>{if(""===x)return;let e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void $.addText(x);e=u(k.subLanguage,x,!0,E[k.subLanguage]),E[k.subLanguage]=e._top}else e=d(x,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(S+=e.relevance),$.__addSublanguage(e._emitter,e.language)})():c(),x=""}function m(e,t){""!==e&&($.startScope(t),$.addText(e),$.endScope())}function h(e,t){let n=1,a=t.length-1;for(;n<=a;){if(!e._emit[n]){n++;continue}let a=y.classNameAliases[e[n]]||e[n],r=t[n];a?m(r,a):(x=r,c(),x=""),n++}}function f(e,t){return e.scope&&"string"==typeof e.scope&&$.openNode(y.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(x,y.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),x=""):e.beginScope._multi&&(h(e.beginScope,t),x="")),k=Object.create(e,{parent:{value:k}})}let _={};function b(t,o){let i=o&&o[0];if(x+=t,null==i)return p(),0;if("begin"===_.type&&"end"===o.type&&_.index===o.index&&""===i){if(x+=n.slice(o.index,o.index+1),!r){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=_.rule,t}return 1}if(_=o,"begin"===o.type)return(e=>{let t=e[0],n=e.rule,a=new ru(n);for(let r of[n.__beforeBegin,n["on:begin"]])if(r&&(r(e,a),a.isMatchIgnored))return 0===k.matcher.regexIndex?(x+=t[0],1):(A=!0,0);return n.skip?x+=t:(n.excludeBegin&&(x+=t),p(),n.returnBegin||n.excludeBegin||(x=t)),f(n,e),n.returnBegin?0:t.length})(o);if("illegal"===o.type&&!a){let e=Error('Illegal lexeme "'+i+'" for mode "'+(k.scope||"")+'"');throw e.mode=k,e}if("end"===o.type){let e=function(e){let t=e[0],a=n.substring(e.index),r=function e(t,n,a){let r=((e,t)=>{let n=e&&e.exec(t);return n&&0===n.index})(t.endRe,a);if(r){if(t["on:end"]){let e=new ru(t);t["on:end"](n,e),e.isMatchIgnored&&(r=!1)}if(r){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,n,a)}(k,e,a);if(!r)return r0;let o=k;k.endScope&&k.endScope._wrap?(p(),m(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(p(),h(k.endScope,e)):o.skip?x+=t:(o.returnEnd||o.excludeEnd||(x+=t),p(),o.excludeEnd&&(x=t));do k.scope&&$.closeNode(),k.skip||k.subLanguage||(S+=k.relevance),k=k.parent;while(k!==r.parent)return r.starts&&f(r.starts,e),o.returnEnd?0:t.length}(o);if(e!==r0)return e}if("illegal"===o.type&&""===i)return 1;if(C>1e5&&C>3*o.index)throw Error("potential infinite loop, way more iterations than matches");return x+=i,i.length}let y=g(e);if(!y)throw rW(o.replace("{}",e)),Error('Unknown language: "'+e+'"');let v=function(e){function t(t,n){return RegExp(rb(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{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+=r$(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(rS(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let n=t.findIndex((e,t)=>t>0&&void 0!==e),a=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,a)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),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){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition()){if(n&&n.index===this.lastIndex);else{let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}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=rp(e.classNameAliases||{}),function n(r,o){if(r.isCompiled)return r;[rB,rz,rY,rH].forEach(e=>e(r,o)),e.compilerExtensions.forEach(e=>e(r,o)),r.__beforeBegin=null,[rU,rF,rq].forEach(e=>e(r,o)),r.isCompiled=!0;let i=null;return"object"==typeof r.keywords&&r.keywords.$pattern&&(r.keywords=Object.assign({},r.keywords),i=r.keywords.$pattern,delete r.keywords.$pattern),i=i||/\w+/,r.keywords&&(r.keywords=function e(t,n,a="keyword"){let r=Object.create(null);return"string"==typeof t?o(a,t.split(" ")):Array.isArray(t)?o(a,t):Object.keys(t).forEach(a=>{Object.assign(r,e(t[a],n,a))}),r;function o(e,t){n&&(t=t.map(e=>e.toLowerCase())),t.forEach(t=>{var n,a;let o=t.split("|");r[o[0]]=[e,(n=o[0],(a=o[1])?Number(a):rG.includes(n.toLowerCase())?0:1)]})}}(r.keywords,e.case_insensitive)),r.keywordPatternRe=t(i,!0),o&&(r.begin||(r.begin=/\B|\b/),r.beginRe=t(r.begin),r.end||r.endsWithParent||(r.end=/\B|\b/),r.end&&(r.endRe=t(r.end)),r.terminatorEnd=rb(r.end)||"",r.endsWithParent&&o.terminatorEnd&&(r.terminatorEnd+=(r.end?"|":"")+o.terminatorEnd)),r.illegal&&(r.illegalRe=t(r.illegal)),r.contains||(r.contains=[]),r.contains=[].concat(...r.contains.map(e=>{let t;return(t="self"===e?r:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(e=>rp(t,{variants:null},e))),t.cachedVariants?t.cachedVariants:!function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?Object.isFrozen(t)?rp(t):t:rp(t,{starts:t.starts?rp(t.starts):null})})),r.contains.forEach(e=>{n(e,r)}),r.starts&&n(r.starts,o),r.matcher=(e=>{let t=new a;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})(r),r}(e)}(y),w="",k=i||v,E={},$=new l.__emitter(l);(()=>{let e=[];for(let t=k;t!==y;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>$.openNode(e))})();let x="",S=0,N=0,C=0,A=!1;try{if(y.__emitTokens)y.__emitTokens(n,$);else{for(k.matcher.considerAll();;){C++,A?A=!1:k.matcher.considerAll(),k.matcher.lastIndex=N;let e=k.matcher.exec(n);if(!e)break;let t=b(n.substring(N,e.index),e);N=e.index+t}b(n.substring(N))}return $.finalize(),w=$.toHTML(),{language:e,value:w,relevance:S,illegal:!1,_emitter:$,_top:k}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:rd(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:w},_emitter:$};if(r)return{language:e,value:rd(n),illegal:!1,relevance:0,errorRaised:t,_emitter:$,_top:k};throw t}}function d(e,n){n=n||l.languages||Object.keys(t);let a=(e=>{let t={value:rd(e),illegal:!1,relevance:0,_top:i,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t})(e),r=n.filter(g).filter(_).map(t=>u(t,e,!1));r.unshift(a);let[o,s]=r.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(g(e.language).supersetOf===t.language)return 1;if(g(t.language).supersetOf===e.language)return -1}return 0});return o.secondBest=s,o}function p(e){let t=(e=>{let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let n=l.languageDetectRe.exec(t);if(n){let t=g(n[1]);return t||(rZ(o.replace("{}",n[1])),rZ("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>s(e)||g(e))})(e);if(s(t))return;if(b("before:highlightElement",{el:e,language:t}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(l.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)),l.throwUnescapedHTML))throw new rJ("One of your code blocks includes unescaped HTML.",e.innerHTML);let a=e.textContent,r=t?c(a,{language:t,ignoreIllegals:!0}):d(a);e.innerHTML=r.value,e.dataset.highlighted="yes",((e,t,a)=>{let r=t&&n[t]||a;e.classList.add("hljs"),e.classList.add("language-"+r)})(e,t,r.language),e.result={language:r.language,re:r.relevance,relevance:r.relevance},r.secondBest&&(e.secondBest={language:r.secondBest.language,relevance:r.secondBest.relevance}),b("after:highlightElement",{el:e,result:r,text:a})}let m=!1;function h(){"loading"!==document.readyState?document.querySelectorAll(l.cssSelector).forEach(p):m=!0}function g(e){return t[e=(e||"").toLowerCase()]||t[n[e]]}function f(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function _(e){let t=g(e);return t&&!t.disableAutodetect}function b(e,t){a.forEach(n=>{n[e]&&n[e](t)})}for(let o in"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",()=>{m&&h()},!1),Object.assign(e,{highlight:c,highlightAuto:d,highlightAll:h,highlightElement:p,highlightBlock:e=>(rV("10.7.0","highlightBlock will be removed entirely in v12.0"),rV("10.7.0","Please use highlightElement now."),p(e)),configure:e=>{l=rp(l,e)},initHighlighting:()=>{h(),rV("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:()=>{h(),rV("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:(n,a)=>{let o=null;try{o=a(e)}catch(e){if(rW("Language definition for '{}' could not be registered.".replace("{}",n)),!r)throw e;rW(e),o=i}o.name||(o.name=n),t[n]=o,o.rawDefinition=a.bind(null,e),o.aliases&&f(o.aliases,{languageName:n})},unregisterLanguage:e=>{for(let a of(delete t[e],Object.keys(n)))n[a]===e&&delete n[a]},listLanguages:()=>Object.keys(t),getLanguage:g,registerAliases:f,autoDetection:_,inherit:rp,addPlugin:e=>{var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),a.push(e)},removePlugin:e=>{let t=a.indexOf(e);-1!==t&&a.splice(t,1)}}),e.debugMode=()=>{r=!1},e.safeMode=()=>{r=!0},e.versionString="11.9.0",e.regex={concat:rk,lookahead:ry,either:rE,optional:rw,anyNumberOfTimes:rv},rP)"object"==typeof rP[o]&&/*! + Highlight.js v11.9.0 (git: f47103d4f1) + (c) 2006-2023 undefined and other contributors + License: BSD-3-Clause + */function e(t){return t instanceof Map?t.clear=t.delete=t.set=()=>{throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=()=>{throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(n=>{let a=t[n],r=typeof a;"object"!==r&&"function"!==r||Object.isFrozen(a)||e(a)}),t}(rP[o]);return Object.assign(e,rP),e},r2=r1({});r2.newInstance=()=>r1({});const r3=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_-]*/}}),r4=["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"],r9=["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"],r6=["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"],r8=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],r5=["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-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","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-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-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","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","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-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","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-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","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","scrollbar-color","scrollbar-gutter","scrollbar-width","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(),r7=r6.concat(r8);var oe="[0-9](_*[0-9])*",ot=`\\.(${oe})`,on="[0-9a-fA-F](_*[0-9a-fA-F])*",oa={className:"number",variants:[{begin:`(\\b(${oe})((${ot})|\\.)?|(${ot}))[eE][+-]?(${oe})[fFdD]?\\b`},{begin:`\\b(${oe})((${ot})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ot})[fFdD]?\\b`},{begin:`\\b(${oe})[fFdD]\\b`},{begin:`\\b0[xX]((${on})\\.?|(${on})?\\.(${on}))[pP][+-]?(${oe})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${on})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const or="[A-Za-z$_][0-9A-Za-z$_]*",oo=["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"],oi=["true","false","null","undefined","NaN","Infinity"],ol=["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"],os=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],oc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ou=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],od=[].concat(oc,ol,os);function op(e){var t;let n=e.regex,a=/<[A-Za-z0-9\\._:-]+/,r=/\/[A-Za-z0-9\\._:-]+>|\/>/,o={$pattern:or,keyword:oo,literal:oi,built_in:od,"variable.language":ou},i="[0-9](_?[0-9])*",l=`\\.(${i})`,s="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",c={className:"number",variants:[{begin:`(\\b(${s})((${l})|\\.)?|(${l}))[eE][+-]?(${i})\\b`},{begin:`\\b(${s})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},u={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"xml"}},p={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"css"}},m={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,u],subLanguage:"graphql"}},h={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,u]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:or+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,d,p,m,h,{match:/\$\d+/},c];u.contains=f.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(f)});let _=[].concat(g,u.contains),b=_.concat([{begin:/\(/,end:/\)/,keywords:o,contains:["self"].concat(_)}]),y={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b},v={variants:[{match:[/class/,/\s+/,or,/\s+/,/extends/,/\s+/,n.concat(or,"(",n.concat(/\./,or),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,or],scope:{1:"keyword",3:"title.class"}}]},w={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ol,...os]}},k={match:n.concat(/\b/,(t=[...oc,"super","import"],n.concat("(?!",t.join("|"),")")),or,n.lookahead(/\(/)),className:"title.function",relevance:0},E={begin:n.concat(/\./,n.lookahead(n.concat(or,/(?![0-9A-Za-z$_(])/))),end:or,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},$="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",x={match:[/const|var|let/,/\s+/,or,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead($)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:w},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,d,p,m,h,g,{match:/\$\d+/},c,w,{className:"attr",begin:or+n.lookahead(":"),relevance:0},x,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:$,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:o,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:">"},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a,"on:begin":(e,t)=>{let n;let a=e[0].length+e.index,r=e.input[a];if("<"===r||","===r)return void t.ignoreMatch();">"===r&&(((e,{after:t})=>{let n=""+e[0].slice(1);return -1!==e.input.indexOf(n,t)})(e,{after:a})||t.ignoreMatch());let o=e.input.substring(a);((n=o.match(/^\s*=/))||(n=o.match(/^\s+extends\s+/))&&0===n.index)&&t.ignoreMatch()},end:r}],subLanguage:"xml",contains:[{begin:a,end:r,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,or,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[y],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[y,e.inherit(e.TITLE_MODE,{begin:or,className:"title.function"})]},{match:/\.\.\./,relevance:0},E,{match:"\\$"+or,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[y]},k,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,{match:[/get|set/,/\s+/,or,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},y]},{match:/\$[(.]/}]}}const om=e=>rk(/\b/,e,/\w$/.test(e)?/\b/:/\B/),oh=["Protocol","Type"].map(om),og=["init","self"].map(om),of=["Any","Self"],o_=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","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","macro","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"],ob=["false","nil","true"],oy=["assignment","associativity","higherThan","left","lowerThan","none","right"],ov=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],ow=["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"],ok=rE(/[/=\-+!*%<>&|^~?]/,/[\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]/),oE=rE(ok,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),o$=rk(ok,oE,"*"),ox=rE(/[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]/),oS=rE(ox,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),oN=rk(ox,oS,"*"),oC=rk(/[A-Z]/,oS,"*"),oA=["attached","autoclosure",rk(/convention\(/,rE("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",rk(/objc\(/,oN,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],oM=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var oO=Object.freeze({__proto__:null,grmr_bash:e=>{let t=e.regex,n={};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},{begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]}]});let a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},r={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,n,a]};a.contains.push(o);let i={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),s={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][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],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(),s,i,e.HASH_COMMENT_MODE,r,{match:/(\/[a-z._-]+)+/},o,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},n]}},grmr_c:e=>{let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="("+a+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",i={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},l={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})"/})]},s={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},c={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(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",p={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"},m=[c,i,n,e.C_BLOCK_COMMENT_MODE,s,l],h={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:m.concat([{begin:/\(/,end:/\)/,keywords:p,contains:m.concat(["self"]),relevance:0}]),relevance:0},g={begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:p,relevance:0},{begin:d,returnBegin:!0,contains:[e.inherit(u,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,s,i,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,s,i]}]},i,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:p,disableAutodetect:!0,illegal:"",contains:[].concat(h,g,m,[c,{begin:e.IDENT_RE+"::",keywords:p},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:l,keywords:p}}},grmr_cpp:e=>{let t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",o="(?!struct)("+a+"|"+t.optional(r)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",i={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},l={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})"/})]},s={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},c={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(l,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},u={className:"title",begin:t.optional(r)+e.IDENT_RE,relevance:0},d=t.optional(r)+e.IDENT_RE+"\\s*\\(",p={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"]},m={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*\(/))},h=[m,c,i,n,e.C_BLOCK_COMMENT_MODE,s,l],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:h.concat([{begin:/\(/,end:/\)/,keywords:p,contains:h.concat(["self"]),relevance:0}]),relevance:0},f={className:"function",begin:"("+o+"[\\*&\\s]+)+"+d,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:p,relevance:0},{begin:d,returnBegin:!0,contains:[u],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[l,s]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,l,s,i,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,l,s,i]}]},i,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(g,f,m,h,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:p,contains:["self",i]},{begin:e.IDENT_RE+"::",keywords:p},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{let 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","scoped","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"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={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:'""'}]},o=e.inherit(r,{illegal:/\n/}),i={className:"subst",begin:/\{/,end:/\}/,keywords:t},l=e.inherit(i,{illegal:/\n/}),s={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,l]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},i]},u=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},l]});i.contains=[c,s,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],l.contains=[u,s,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let d={variants:[c,s,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},m=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",h={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:""},{begin:"?",end:">"}]}]}),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"}},d,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,p,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:"("+m+"\\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,p],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[d,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},h]}},grmr_css:e=>{let t=e.regex,n=r3(e),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.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},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+r6.join("|")+")"},{begin:":(:)?("+r8.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+r5.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.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:r9.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+r4.join("|")+")\\b"}]}},grmr_diff:e=>{let 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=>{let 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:"",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}},grmr_graphql:e=>{let t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}},grmr_ini:e=>{let t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},i={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[a,{begin:/\[/,end:/\]/,contains:[a,o,r,i,n,"self"],relevance:0},o,r,i,n]}}]}},grmr_java:e=>{let t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",a=n+function e(t,n,a){return -1===a?"":t.replace(n,r=>e(t,n,a-1))}("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),r={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","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},i={className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:r,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+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:r,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,oa,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},oa,o]}},grmr_javascript:op,grmr_json:e=>{let t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}},grmr_kotlin:e=>{let 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"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},r={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[r,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,r,a]}]};a.contains.push(o);let i={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},s=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),c={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]};return c.variants[1].contains=[c],c.variants[1].contains=[c],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,s,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,i,l,{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:/,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[c,e.C_LINE_COMMENT_MODE,s],relevance:0},e.C_LINE_COMMENT_MODE,s,i,l,o,e.C_NUMBER_MODE]},s]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},i,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},oa]}},grmr_less:e=>{let t=r3(e),n="[\\w-]+",a="("+n+"|@\\{"+n+"\\})",r=[],o=[],i=e=>({className:"string",begin:"~?"+e+".*?"+e}),l=(e,t,n)=>({className:e,begin:t,relevance:n}),s={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:r9.join(" ")};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i("'"),i('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,{begin:"\\(",end:"\\)",contains:o,keywords:s,relevance:0},l("variable","@@?"+n,10),l("variable","@\\{"+n+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);let c=o.concat({begin:/\{/,end:/\}/,contains:r}),u={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},d={begin:a+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+r5.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},p={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:a,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+n+"\\}"),{begin:"\\b("+r4.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",a,0),l("selector-id","#"+a),l("selector-class","\\."+a,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+r6.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r8.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:c},{begin:"!important"},t.FUNCTION_DISPATCH]},m={begin:n+":(:)?"+`(${r7.join("|")})`,returnBegin:!0,contains:[p]};return r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:s,returnEnd:!0,contains:o,relevance:0}},{className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:c}},m,d,p,u,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:r}},grmr_lua:e=>{let t="\\[=*\\[",n="\\]=*\\]",a={begin:t,end:n,contains:["self"]},r=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[a],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:n,contains:[a],relevance:5}])}},grmr_makefile:e=>{let t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,{className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t]},a,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},{className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]}]}},grmr_markdown:e=>{let t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={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}]},a={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},r={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},o=e.inherit(a,{contains:[]}),i=e.inherit(r,{contains:[]});a.contains.push(i),r.contains.push(o);let l=[t,n];return[a,r,o,i].forEach(e=>{e.contains=e.contains.concat(l)}),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:l=l.concat(a,r)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:l}]}]},t,{className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a,r,{className:"quote",begin:"^>\\s+",contains:l,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:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}},grmr_objectivec:e=>{let t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","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:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},grmr_perl:e=>{let t=e.regex,n=/[dualxmsipngr]{0,12}/,a={$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:a},o={begin:/->\{/,end:/\}/},i={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[e.BACKSLASH_ESCAPE,r,i],s=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,a,r="\\1")=>{let o="\\1"===r?r:t.concat(r,a);return t.concat(t.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,r,n)},u=(e,a,r)=>t.concat(t.concat("(?:",e,")"),a,/(?:\\.|[^\\\/])*?/,r,n),d=[i,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:l,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(...s,{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:u("(?:m|qr)?",/\//,/\//)},{begin:u("m|qr",t.either(...s,{capture:!0}),/\1/)},{begin:u("m|qr",/\(/,/\)/)},{begin:u("m|qr",/\[/,/\]/)},{begin:u("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=d,o.contains=d,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:d}},grmr_php:e=>{let t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,a=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+a},i={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),s="[ \n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(i)}),l,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(i),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},u={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},d=["false","null","true"],p=["__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"],m=["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"],h={keyword:p,literal:(e=>{let t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(d),built_in:m},g=e=>e.map(e=>e.replace(/\|\d+$/,"")),f={variants:[{match:[/new/,t.concat(s,"+"),t.concat("(?!",g(m).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},_=t.concat(a,"\\b(?!\\()"),b={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,t.concat(/::/,t.lookahead(/(?!class\b)/)),_],scope:{1:"title.class",3:"variable.constant"}},{match:[r,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},y={scope:"attr",match:t.concat(a,t.lookahead(":"),t.lookahead(/(?!::)/))},v={relevance:0,begin:/\(/,end:/\)/,keywords:h,contains:[y,o,b,e.C_BLOCK_COMMENT_MODE,c,u,f]},w={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",g(p).join("\\b|"),"|",g(m).join("\\b|"),"\\b)"),a,t.concat(s,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[v]};v.contains.push(w);let k=[y,b,e.C_BLOCK_COMMENT_MODE,c,u,f];return{case_insensitive:!1,keywords:h,contains:[{begin:t.concat(/#\[\s*/,r),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:d,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:d,keyword:["new","array"]},contains:["self",...k]},...k,{scope:"meta",match:r}]},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:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},o,w,b,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},f,{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:h,contains:["self",o,b,e.C_BLOCK_COMMENT_MODE,c,u]}]},{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,u]}},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=>{let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],r={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,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"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:r,illegal:/#/},l={begin:/\{\{/,relevance:0},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,o,l,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,o,l,i]},{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,l,i]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,l,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",u=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,d="\\b|"+a.join("|"),p={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${u}))[eE][+-]?(${c})[jJ]?(?=${d})`},{begin:`(${u})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${d})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${d})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${d})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${d})`},{begin:`\\b(${c})[jJ](?=${d})`}]},m={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:r,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},h={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:["self",o,p,s,e.HASH_COMMENT_MODE]}]};return i.contains=[s,p,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:r,illegal:/(<\/|\?)|=>/,contains:[o,p,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},s,m,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[p,h,s]}]}},grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{let t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=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=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,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:n},{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,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[o,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(a,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},i={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},s=[e.COMMENT("#","$",{contains:[i]}),e.COMMENT("^=begin","^=end",{contains:[i],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},u={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?,end:/>/},{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,c]})]}]},d="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${d}))?([eE][+-]?(${d})|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"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},h=[u,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:o},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[u,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],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(l,s),relevance:0}].concat(l,s);c.contains=h,m.contains=h;let g=[{begin:/^\s*=>/,starts:{end:"$",contains:h}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:o,contains:h}}];return s.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(g).concat(s).concat(h)}},grmr_rust:e=>{let t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},a="([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!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","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!"],o=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:o,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:"",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+a},{begin:"\\b0o([0-7_]+)"+a},{begin:"\\b0x([A-Fa-f0-9_]+)"+a},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+a}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:r,type:o}},{className:"punctuation",begin:"->"},n]}},grmr_scss:e=>{let t=r3(e),n="@[a-z-]+",a={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};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("+r4.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r6.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r8.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+r5.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:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,a,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:n,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:r9.join(" ")},contains:[{begin:n,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,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.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}),grmr_sql:e=>{let t=e.regex,n=e.COMMENT("--","$"),a=["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"],o=["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"],i=["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"],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=>!o.includes(e)),s={begin:t.concat(/\b/,t.either(...o),/\s*\(/),relevance:0,keywords:{built_in:o}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:((e,{exceptions:t,when:n}={})=>(t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:n(e)?e+"|0":e)))(l,{when:e=>e.length<3}),literal:a,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(...i),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(i),literal:a,type:r}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},s,{className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},grmr_swift:e=>{let t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,n],r={match:[/\./,rE(...oh,...og)],className:{2:"keyword"}},o={match:rk(/\./,rE(...o_)),relevance:0},i=o_.filter(e=>"string"==typeof e).concat(["_|0"]),l={variants:[{className:"keyword",match:rE(...o_.filter(e=>"string"!=typeof e).concat(of).map(om),...og)}]},s={$pattern:rE(/\b\w+/,/#\w+/),keyword:i.concat(ov),literal:ob},c=[r,o,l],u=[{match:rk(/\./,rE(...ow)),relevance:0},{className:"built_in",match:rk(/\b/,rE(...ow),/(?=\()/)}],d={match:/->/,relevance:0},p=[d,{className:"operator",relevance:0,variants:[{match:o$},{match:`\\.(\\.|${oE})+`}]}],m="([0-9]_*)+",h="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:`\\b(${m})(\\.(${m}))?([eE][+-]?(${m}))?\\b`},{match:`\\b0x(${h})(\\.(${h}))?([pP][+-]?(${m}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},f=(e="")=>({className:"subst",variants:[{match:rk(/\\/,e,/[0\\tnr"']/)},{match:rk(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),_=(e="")=>({className:"subst",match:rk(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),b=(e="")=>({className:"subst",label:"interpol",begin:rk(/\\/,e,/\(/),end:/\)/}),y=(e="")=>({begin:rk(e,/"""/),end:rk(/"""/,e),contains:[f(e),_(e),b(e)]}),v=(e="")=>({begin:rk(e,/"/),end:rk(/"/,e),contains:[f(e),b(e)]}),w={className:"string",variants:[y(),y("#"),y("##"),y("###"),v(),v("#"),v("##"),v("###")]},k=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],E=e=>{let t=rk(e,/\//),n=rk(/\//,e);return{begin:t,end:n,contains:[...k,{scope:"comment",begin:`#(?!.*${n})`,end:/$/}]}},$={scope:"regexp",variants:[E("###"),E("##"),E("#"),{begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:k}]},x={match:rk(/`/,oN,/`/)},S=[x,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${oS}+`}],N=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:oM,contains:[...p,g,w]}]}},{scope:"keyword",match:rk(/@/,rE(...oA))},{scope:"meta",match:rk(/@/,oN)}],C={match:ry(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:rk(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,oS,"+")},{className:"type",match:oC,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:rk(/\s+&\s+/,ry(oC)),relevance:0}]},A={begin:/,end:/>/,keywords:s,contains:[...a,...c,...N,d,C]};C.contains.push(A);let M={begin:/\(/,end:/\)/,relevance:0,keywords:s,contains:["self",{match:rk(oN,/\s*:/),keywords:"_|0",relevance:0},...a,$,...c,...u,...p,g,w,...S,...N,C]},O={begin:/,end:/>/,keywords:"repeat each",contains:[...a,C]},T={begin:/\(/,end:/\)/,keywords:s,contains:[{begin:rE(ry(rk(oN,/\s*:/)),ry(rk(oN,/\s+/,oN,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:oN}]},...a,...c,...p,g,w,...N,C,M],endsParent:!0,illegal:/["']/},D={match:[/(func|macro)/,/\s+/,rE(x.match,oN,o$)],className:{1:"keyword",3:"title.function"},contains:[O,T,t],illegal:[/\[/,/%/]},R={begin:[/precedencegroup/,/\s+/,oC],className:{1:"keyword",3:"title"},contains:[C],keywords:[...oy,...ob],end:/}/};for(let e of w.variants){let t=e.contains.find(e=>"interpol"===e.label);t.keywords=s;let n=[...c,...u,...p,g,w,...S];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:s,contains:[...a,D,{match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[O,T,t],illegal:/\[|%/},{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:s,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},{match:[/operator/,/\s+/,o$],className:{1:"keyword",3:"title"}},R,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0},$,...c,...u,...p,g,w,...S,...N,C,M]}},grmr_typescript:e=>{let t=op(e),n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],a={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},r={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[t.exports.CLASS_REFERENCE]},o={$pattern:or,keyword:oo.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:oi,built_in:od.concat(n),"variable.language":ou},i={className:"meta",begin:"@"+or},l=(e,t,n)=>{let a=e.contains.findIndex(e=>e.label===t);if(-1===a)throw Error("can not find mode to replace");e.contains.splice(a,1,n)};return Object.assign(t.keywords,o),t.exports.PARAMS_CONTAINS.push(i),t.contains=t.contains.concat([i,a,r]),l(t,"shebang",e.SHEBANG()),l(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","mts","cts"]}),t},grmr_vbnet:e=>{let t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,r=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,i={className:"literal",variants:[{begin:t.concat(/# */,t.either(a,n),/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,r,/ *#/)},{begin:t.concat(/# */,t.either(a,n),/ +/,t.either(r,o),/ *#/)}]},l=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),s=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:/""/}]},i,{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+:/},l,s,{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:[s]}]}},grmr_wasm:e=>{e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}},grmr_xml:e=>{let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a={className:"symbol",begin:/&[a-z]+;|[0-9]+;|[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(r,{begin:/\(/,end:/\)/}),i=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),s={endsWithParent:!0,illegal:/,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[r,l,i,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[r,o,l,i]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/ + + + + + `;let e=!1;this.shadowRoot.querySelector("#tag-input").addEventListener("input",e=>{e.stopPropagation()}),this.shadowRoot.querySelector("#tag-input").addEventListener("keydown",t=>{let n=this.shadowRoot.querySelector("#tag-input").value;13===t.keyCode?this.addTag(n):188===t.keyCode?(t.preventDefault(),this.addTag(n)):8===t.keyCode&&0===n.length&&(e?(this.deleteTag(this.tags.length-1),this.dispatchEvent(new CustomEvent("input")),e=!1):e=!0)}),this.shadowRoot.querySelector("#tag-input").addEventListener("blur",()=>{let e=this.shadowRoot.querySelector("#tag-input").value;this.addTag(e)})}}customElements.define("rbl-tag-input",iW);var iZ=o("1Mxs0"),eU=o("hrGZZ");const iV=({filename:e,remote_frontmatter:t,set_remote_frontmatter:n})=>{let[a,r]=(0,l.useState)(t??{});(0,l.useEffect)(()=>{r(t??{})},[t]);let o=e=>t=>r(c(n=>{(0,u.default).set(n,e,t)})),[i,s,d,p]=at(),m=(0,l.useRef)(n);m.current=n;let h=(0,l.useCallback)(()=>{m.current(iQ(a)??{}).then(()=>alert("Frontmatter synchronized ✔\n\nThese parameters will be used in future exports.")),d()},[iQ,a,d]);(0,eU.useEventListener)(window,"open pluto frontmatter",s),(0,eU.useEventListener)(window,"keydown",e=>{null!=i.current&&i.current.contains(e.target)&&"Enter"===e.key&&(0,S.has_ctrl_or_cmd_pressed)(e)&&h()},[h]);let g={title:null,description:null,date:null,tags:[],author:[{}],...a},f=([e,t])=>!((0,u.default).isArray(t)&&"tags"!==iJ(e)||(0,u.default).isPlainObject(t)),_=(e,t)=>(0,l.html)` + ${Object.entries(e).filter(f).map(([e,n])=>{let a=`${t}${e}`,i=`fm-${a}`;return(0,l.html)` + ${e} + <${i0} type=${iJ(e)} id=${i} value=${n} on_value=${o(a)} /> + {r(c(e=>{(0,u.default).unset(e,a)}))}} + > + ✕ + + `})} + {let e=prompt("Field name:");e&&r(c(n=>{(0,u.default).set(n,`${t}${e}`,null)}))}} + > + Add entry + + + `;return(0,l.html)` + Frontmatter + + If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and + social media. + + + Preview + <${iZ.FeaturedCard} + entry=${{id:e.replace(/\.jl$/,""),hash:"xx",frontmatter:iQ(a)??{}}} + disable_links=${!0} + /> + + + ${_(g,"")} + ${(0,u.default).isArray(g.author)?g.author.map((e,t)=>{let n={name:null,url:null,...e};return(0,l.html)` + + Author ${t+1} + + ${_(n,`author[${t}].`)} + + `}):null} + ${(0,u.default).isArray(g.author)?(0,l.html)`{r(e=>({...e,author:[...e?.author??[],{}]}))}} + > + Add author + + `:null} + + + {r(t??{}),d()}}>CancelSave + `},iQ=e=>{let t=(0,u.default).isPlainObject(e)?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,iQ(t)]).filter(([e,t])=>null!=t)):(0,u.default).isArray(e)?e.map(iQ).filter(e=>null!=e):e;return!(0,u.default).isNumber(t)&&(0,u.default).isEmpty(t)?null:t};let iX=iQ({a:1,b:"",c:null,d:[],e:[1,"",null,2],f:{},g:[{}],h:[{z:"asdf"}]});console.assert((0,u.default).isEqual(iX,{a:1,e:[1,2],h:[{z:"asdf"}]}),iX);const iY=["tags","date","license","url","color"],iJ=e=>{for(let t of iY)if(e===t||e.endsWith(`_${t}`))return t;return"text"},i0=({value:e,on_value:t,type:n,id:a})=>{let r=(0,l.useRef)(null);return(0,l.useLayoutEffect)(()=>{r.current&&(r.current.value=e)},[r.current,e]),(0,l.useLayoutEffect)(()=>{if(!r.current)return;let e=e=>{r.current&&t(r.current.value)};return r.current.addEventListener("input",e),()=>{r.current?.removeEventListener("input",e)}},[r.current]),"tags"===n?(0,l.html)``:"license"===n?i2({ref:r,id:a}):(0,l.html)``},i1=["AGPL-3.0","GPL-3.0","LGPL-3.0","MPL-2.0","Apache-2.0","MIT","BSL-1.0","Unlicense","CC-BY-4.0","CC-BY-SA-4.0","CC-BY-NC-4.0","CC-BY-NC-SA-4.0","CC-BY-ND-4.0","CC-BY-NC-ND-4.0","CC0-1.0"],i2=({ref:e,id:t})=>(0,l.html)` + + ${i1.map(e=>(0,l.html)`${e}`)} + `;var l=o("cNaMA"),d=o("4zMEb"),e7=o("41Mhf");const i3=async({setStatePromise:e,connect:t,launch_params:n})=>{try{let a;if(null==n.pluto_server_url||null==n.notebookfile)throw Error("Invalid launch parameters for starting locally.");await e(c(e=>{e.backend_launch_phase=te.responded,e.disable_ui=!1,e.notebook.status_tree=null}));let r=e=>String(e),o=new URL(n.pluto_server_url,window.location.href),i=await (await fetch(new Request(n.notebookfile,{integrity:n.notebookfile_integrity??void 0}))).arrayBuffer();if(!(a=await fetch(r((0,e7.with_query_params)(new URL("notebookupload",o),{name:new URLSearchParams(window.location.search).get("name"),clear_frontmatter:"yesplease",execution_allowed:"yepperz"})),{method:"POST",body:i})).ok){let e=await a.blob();window.location.href=URL.createObjectURL(e);return}let l=await a.text(),s=(0,e7.with_query_params)(new URL("edit",o),{id:l});console.info("notebook_id:",l),window.history.replaceState({},"",s),await e(c(e=>{e.notebook.notebook_id=l,e.backend_launch_phase=te.notebook_running})),console.log("Connecting WebSocket");let u=t();await (0,d.timeout_promise)(u,2e4).catch(e=>{console.error("Failed to establish connection within 20 seconds. Navigating to the edit URL directly.",e),window.parent.location.href=r(s)})}catch(e){console.error("Failed to initialize binder!",e),alert("Something went wrong! \uD83D\uDE2E\n\nWe failed to open this notebook. Please try again with a different browser, or come back later.")}},i4=({editor:e,launch_params:t,status:n})=>{try{let n=(0,l.useMemo)(()=>window?.pluto_injected_environment?.environment?.({client:e.client,editor:e,imports:{immer:c,preact:l}})?.custom_run_or_edit,[e.client,e]);if(window?.pluto_injected_environment?.provides_backend)return(0,l.html)`<${n} editor=${e} backend_phases=${te} launch_params=${t} />`}catch(e){}return null==n?null:n.offer_local?(0,l.html)`<${an} + start_local=${()=>i3({setStatePromise:e.setStatePromise,connect:e.connect,launch_params:t})} + />`:n.offer_binder?(0,l.html)`<${aa} + offer_binder=${n.offer_binder} + start_binder=${()=>tr({setStatePromise:e.setStatePromise,connect:e.connect,launch_params:t})} + notebookfile=${null==t.notebookfile?null:new URL(t.notebookfile,window.location.href).href} + notebook=${e.state.notebook} + />`:null};var i9=o("cpCG6"),i6=o("dYd4C"),eD=o("1gqBQ");const i8={disabled:!1,show_logs:!0,skip_as_script:!1},i5=()=>"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)),i7=({children:e})=>(0,l.html)`${e}`,le=(e,t)=>({disconnected:!(e.connected||e.initializing||e.static_preview),loading:null!=e.backend_launch_phase&&te.wait_for_usernull!=e.cell_inputs_local[t]&&e.notebook.cell_inputs[t].code!==e.cell_inputs_local[t].code),recording_waiting_to_start:e.recording_waiting_to_start,is_recording:e.is_recording,isolated_cell_view:null!=t.isolated_cell_ids&&t.isolated_cell_ids.length>0,sanitize_html:e.notebook.process_status===i6.ProcessStatus.waiting_for_permission}),lt=e=>{for(let[t,n]of Object.entries(e))if(n)return t},ln=al("pluto-logo-big")?.href,la=al("pluto-logo-small")?.href;class lr extends l.Component{constructor(e){super(e);let{launch_params:t,initial_notebook_state:n}=this.props;this.state={notebook:n,cell_inputs_local:{},unsumbitted_global_definitions:{},desired_doc_query:null,recently_deleted:[],recently_auto_disabled_cells:{},last_update_time:0,disable_ui:t.disable_ui,static_preview:null!=t.statefile,backend_launch_phase:null!=t.notebookfile&&(null!=t.binder_url||null!=t.pluto_server_url)?te.wait_for_user:null,backend_launch_logs:null,binder_session_url:null,binder_session_token:null,refresh_target:null,connected:!1,initializing:!0,moving_file:!1,scroller:{up:!1,down:!1},export_menu_open:!1,last_created_cell:null,selected_cells:[],extended_components:{CustomHeader:null},is_recording:!1,recording_waiting_to_start:!1,slider_server:{connecting:!1,interactive:!1}},this.setStatePromise=e=>new Promise(t=>this.setState(e,t)),this.real_actions={get_notebook:()=>this?.state?.notebook||{},send:(e,...t)=>this.client.send(e,...t),get_published_object:e=>this.state.notebook.published_objects[e],update_notebook:(...e)=>this.update_notebook(...e),set_doc_query:e=>this.setState({desired_doc_query:e}),set_local_cell:(e,t)=>this.setStatePromise(c(n=>{n.cell_inputs_local[e]={code:t},n.selected_cells=[]})),set_unsubmitted_global_definitions:(e,t)=>this.setStatePromise(c(n=>{n.unsumbitted_global_definitions[e]=t})),get_unsubmitted_global_definitions:()=>(0,u.default).pick(this.state.unsumbitted_global_definitions,this.state.notebook.cell_order),focus_on_neighbor:(e,t,n=-1===t?1/0:-1,a=0)=>{let r=this.state.notebook.cell_order.indexOf(e)+t;r>=0&&r{let a;let r=n(e).map(e=>({cell_id:i5(),code:e,code_folded:!1,metadata:{...i8}}));"number"==typeof t?a=t:-1!==(a=this.state.notebook.cell_order.indexOf(t))&&(a+=1),-1===a&&(a=this.state.notebook.cell_order.length),this.setState(c(e=>{for(let t of(e.selected_cells=[],r))e.cell_inputs_local[t.cell_id]=t;e.last_created_cell=r[0]?.cell_id})),await v(e=>{for(let t of r)e.cell_inputs[t.cell_id]={...t,code:"",metadata:{...i8}};e.cell_order=[...e.cell_order.slice(0,a),...r.map(e=>e.cell_id),...e.cell_order.slice(a,1/0)]})},wrap_remote_cell:async(e,t="begin",n="end")=>{let a=this.state.notebook.cell_inputs[e],r=`${t} + ${a.code.replace(/\n/g,"\n ")} +${n}`;await this.setStatePromise(c(t=>{t.cell_inputs_local[e]={code:r}})),await this.actions.set_and_run_multiple([e])},split_remote_cell:async(e,t,n=!1)=>{let a=this.state.notebook.cell_inputs[e].code,r=[0,...t],o=t.map((e,t)=>(0,tQ.slice_utf8)(a,r[t],e).trim()).filter(e=>""!==e).map(e=>({cell_id:i5(),code:e,code_folded:!1,metadata:{...i8}}));this.setState(c(e=>{for(let t of o)e.cell_inputs_local[t.cell_id]=t})),await v(t=>{for(let n of(delete t.cell_inputs[e],o))t.cell_inputs[n.cell_id]=n;t.cell_order=t.cell_order.flatMap(t=>e===t?o.map(e=>e.cell_id):[t])}),n&&await this.actions.set_and_run_multiple(o.map(e=>e.cell_id))},interrupt_remote:e=>{this.client.send("interrupt_all",{},{notebook_id:this.state.notebook.notebook_id},!1)},move_remote_cells:(e,t)=>v(n=>{t=Math.max(0,t);let a=n.cell_order.slice(0,t).filter(t=>!e.includes(t)),r=n.cell_order.slice(t,1/0).filter(t=>!e.includes(t));n.cell_order=[...a,...e,...r]}),add_remote_cell_at:async(e,t="")=>{let n=i5();return this.setState({last_created_cell:n}),await v(a=>{a.cell_inputs[n]={cell_id:n,code:t,code_folded:!1,metadata:{...i8}},a.cell_order=[...a.cell_order.slice(0,e),n,...a.cell_order.slice(e,1/0)]}),await this.client.send("run_multiple_cells",{cells:[n]},{notebook_id:this.state.notebook.notebook_id}),n},add_remote_cell:async(e,t,n)=>{let a=this.state.notebook.cell_order.indexOf(e);return await this.actions.add_remote_cell_at(a+("before"==t?0:1),n)},confirm_delete_multiple:async(e,t)=>{(t.length<=1||confirm(`${e} ${t.length} cells?`))&&(t.some(e=>this.state.notebook.cell_results[e].running||this.state.notebook.cell_results[e].queued)?confirm("This cell is still running - would you like to interrupt the notebook?")&&this.actions.interrupt_remote(t[0]):(this.setState(c(e=>{for(let n of(e.recently_deleted=t.map(e=>({index:this.state.notebook.cell_order.indexOf(e),cell:this.state.notebook.cell_inputs[e]})),e.selected_cells=[],t))delete e.unsumbitted_global_definitions[n]})),await v(e=>{for(let n of t)delete e.cell_inputs[n];e.cell_order=e.cell_order.filter(e=>!t.includes(e))}),await this.client.send("run_multiple_cells",{cells:[]},{notebook_id:this.state.notebook.notebook_id})))},fold_remote_cells:async(e,t)=>{await v(n=>{for(let a of e)n.cell_inputs[a].code_folded=t??!n.cell_inputs[a].code_folded})},set_and_run_all_changed_remote_cells:()=>{let e=this.state.notebook.cell_order.filter(e=>null!=this.state.cell_inputs_local[e]&&this.state.notebook.cell_inputs[e].code!==this.state.cell_inputs_local[e]?.code);return this.actions.set_and_run_multiple(e),e.length>0},set_and_run_multiple:async e=>{if(e.length>0){window.dispatchEvent(new CustomEvent("set_waiting_to_run_smart",{detail:{cell_ids:e}})),await v(t=>{for(let n of e)this.state.cell_inputs_local[n]&&(t.cell_inputs[n].code=this.state.cell_inputs_local[n].code)}),await this.setStatePromise(c(t=>{for(let n of e)delete t.unsumbitted_global_definitions[n],null!=t.notebook.cell_results[n]&&(t.notebook.cell_results[n].queued=this.is_process_ready())}));let{disabled_cells:t}=(await this.client.send("run_multiple_cells",{cells:e},{notebook_id:this.state.notebook.notebook_id})).message;Object.entries(t).length>0&&await this.setStatePromise({recently_auto_disabled_cells:t})}},set_bond:async(e,t)=>{await v(n=>{n.bonds[e]={value:t}})},reshow_cell:(e,t,n)=>{this.client.send("reshow_cell",{objectid:t,dim:n,cell_id:e},{notebook_id:this.state.notebook.notebook_id},!1)},request_js_link_response:(e,t,n)=>this.client.send("request_js_link_response",{cell_id:e,link_id:t,input:n},{notebook_id:this.state.notebook.notebook_id}).then(e=>e.message),get_selected_cells:(e,t)=>t?this.state.selected_cells:[e],get_avaible_versions:async({package_name:e,notebook_id:t})=>{let{message:n}=await this.client.send("nbpkg_available_versions",{package_name:e},{notebook_id:t});return n}},this.actions={...this.real_actions};let a=(e,n=null,a=!1)=>new Promise(r=>{if(0!==e.length){let o=e=>e.startsWith("status_tree"),i,d=[];this.setState(c(r=>{let c;try{a&&([c,i,d]=(0,s.produceWithPatches)(n??r.notebook,t=>{(0,s.applyPatches)(t,e)})),c=(0,s.applyPatches)(n??r.notebook,e)}catch(s){let n=String(s).match(".*'(.*)'.*")?.[1].replace(/\//gi,".")??s,a=(0,u.default).get(this.state.notebook,n,"Not Found");console.log(String(s).match(".*'(.*)'.*")?.[1].replace(/\//gi,".")??s,n,typeof n);let r=o(n);(r?console.log:console.error)(`#######################**************************######################## +PlutoError: StateOutOfSync: Failed to apply patches. +Please report this: https://github.com/fonsp/Pluto.jl/issues adding the info below: +failing path: ${n} +notebook previous value: ${a} +patch: ${JSON.stringify(e?.find(({path:e})=>e.join("")===n),null,1)} +all patches: ${JSON.stringify(e,null,1)} +#######################**************************########################`,s);let i=n.split(".");for(let e=0;enull==c.cell_inputs[e]);0!==p.length&&(console.warn("cells_stuck_in_limbo:",p),c.cell_order=c.cell_order.filter(e=>null!=c.cell_inputs[e])),this.on_patches_hook(e),r.notebook=c}),()=>r(d))}else r([])});this.apply_notebook_patches=a,this.last_update_counter=-1;let r=e=>{e<=this.last_update_counter&&(console.error("State update out of order",e,this.last_update_counter),alert("Oopsie!! please refresh your browser and everything will be alright!")),this.last_update_counter=e},o=(e,n)=>{if(this.state.notebook.notebook_id===e.notebook_id){let o=null!=t.binder_url;o&&console.debug("on_update",e,n);let i=e.message;if("notebook_diff"===e.type){r(i?.counter);let e=Promise.resolve();i?.response?.from_reset?(console.log("Trying to reset state after failure"),e=a(i.patches,lf({notebook_id:this.state.notebook.notebook_id})).catch(e=>{throw alert("Oopsie!! please refresh your browser and everything will be alright!"),e})):0!==i.patches.length&&(e=a(i.patches)),e.finally(()=>{let e=i?.response?.update_went_well!=null&&0===i.patches.length,t=i.patches.some(({path:e})=>0===e.length||"status_tree"!==e[0]);!e&&t&&(this.waiting_for_bond_to_trigger_execution=!1)}).then(()=>{this.maybe_send_queued_bond_changes()})}else console.error("Received unknown update type!",e);o&&console.debug("on_update done")}},i=async e=>{Object.assign(this.client,e);try{let{custom_editor_header_component:t,custom_non_cell_output:n}=(await (0,i9.get_environment)(e))({client:e,editor:this,imports:{preact:l}});this.setState({extended_components:{...this.state.extended_components,CustomHeader:t,NonCellOutputComponents:n}})}catch(e){}if(window.version_info=this.client.version_info,window.kill_socket=this.client.kill,!e.notebook_exists){console.error("Notebook does not exist. Not connecting.");return}console.debug("Sending update_notebook request..."),await this.client.send("update_notebook",{updates:[]},{notebook_id:this.state.notebook.notebook_id},!1),console.debug("Received update_notebook request"),this.setState({initializing:!1,static_preview:!1,backend_launch_phase:null==this.state.backend_launch_phase?null:te.ready}),this.client.send("complete",{query:"sq"},{notebook_id:this.state.notebook.notebook_id}),this.client.send("complete",{query:"\\sq"},{notebook_id:this.state.notebook.notebook_id}),setTimeout(g,2e3)},p=(e,t)=>{this.setState({connected:e}),t&&(0,eD.open_pluto_popup)({type:"warn",body:(0,l.html)`A new server was started - this notebook session is no longer running. + Would you like to go back to the main menu? + + Go back + + {e.preventDefault(),window.dispatchEvent(new CustomEvent("close pluto popup"))}} + >Stay here`,should_focus:!1})},m=async()=>(console.warn("Reconnected! Checking states"),await this.client.send("reset_shared_state",{},{notebook_id:this.state.notebook.notebook_id},!1),!0);this.export_url=e=>null==this.state.binder_session_url?`./${e}?id=${this.state.notebook.notebook_id}`:`${this.state.binder_session_url}${e}?id=${this.state.notebook.notebook_id}&token=${this.state.binder_session_token}`,this.client={},this.connect=e=>(0,d.create_pluto_connection)({ws_address:e,on_unrequested_update:o,on_connection_status:p,on_reconnect:m,connect_metadata:{notebook_id:this.state.notebook.notebook_id}}).then(i),this.on_disable_ui=()=>{lu(this.state.disable_ui),Object.assign(this.actions,this.state.disable_ui||null!=t.slider_server_url&&!this.state.connected?null!=t.slider_server_url?iO({setStatePromise:this.setStatePromise,actions:this.actions,launch_params:t,apply_notebook_patches:a,get_original_state:()=>this.props.initial_notebook_state,get_current_state:()=>this.state.notebook}):iM({actions:this.actions}):this.real_actions)},this.on_disable_ui(),setInterval(()=>{this.state.static_preview||"visible"!==document.visibilityState||ta(`editing/${window?.version_info?.pluto??this.state.notebook.pluto_version??"unknown"}${window.plutoDesktop?"-desktop":""}`)},9e5),setInterval(()=>{this.state.static_preview||"visible"!==document.visibilityState||lo(this.state.notebook.path)},5e3),this.bond_changes_to_apply_when_done=[],this.maybe_send_queued_bond_changes=()=>{if(this.notebook_is_idle()&&0!==this.bond_changes_to_apply_when_done.length){let e=this.bond_changes_to_apply_when_done;this.bond_changes_to_apply_when_done=[],this.update_notebook(t=>{(0,s.applyPatches)(t,e)})}},this.waiting_for_bond_to_trigger_execution=!1,this.pending_local_updates=0,this.js_init_set=new x(()=>{this.maybe_send_queued_bond_changes()}),document.body._js_init_set=this.js_init_set,this.notebook_is_idle=()=>!(this.waiting_for_bond_to_trigger_execution||this.pending_local_updates>0||Object.values(this.state.notebook.cell_results).some(e=>e.running||e.queued)||!(0,u.default).isEmpty(this.js_init_set)||!this.is_process_ready()),this.is_process_ready=()=>this.state.notebook.process_status===i6.ProcessStatus.starting||this.state.notebook.process_status===i6.ProcessStatus.ready;let h=e=>Object.entries(this.state.notebook.cell_dependencies).some(([t,n])=>{if(n.upstream_cells_map.hasOwnProperty(e)){let e=this.state.notebook.cell_inputs[t].metadata.disabled,n=this.state.notebook.cell_results[t].depends_on_disabled_cells;return!(e||n)}}),_=e=>"replace"===e.op&&e.path.length>=1&&h(e.path[1]),b=Promise.resolve(),v=e=>{let t=b.then(async()=>{let[t,n,a]=(0,s.produceWithPatches)(this.state.notebook,t=>{e(t)}),r=this.notebook_is_idle(),o=n.filter(e=>"bonds"===e.path[0]);for(let e of(r||(this.bond_changes_to_apply_when_done=[...this.bond_changes_to_apply_when_done,...o],n=n.filter(e=>"bonds"!==e.path[0])),n))if(e.path.some(e=>"number"==typeof e))throw Error("This sounds like it is editing an array...");if(0!==n.length){r&&(this.waiting_for_bond_to_trigger_execution=this.waiting_for_bond_to_trigger_execution||o.some(_)),this.pending_local_updates++,this.on_patches_hook(n);try{await Promise.all([this.client.send("update_notebook",{updates:n},{notebook_id:this.state.notebook.notebook_id},!1).then(e=>{if(e.message?.response?.update_went_well==="\uD83D\uDC4E")throw Error(`Pluto update_notebook error: (from Julia: ${e.message.response.why_not})`)}),this.setStatePromise({notebook:t,last_update_time:Date.now()})])}finally{this.pending_local_updates--,document.body._update_is_ongoing=this.pending_local_updates>0}}});return b=t.catch(console.error),t};this.update_notebook=v,window.shutdownNotebook=this.close=()=>{this.client.send("shutdown_notebook",{keep_in_session:!1},{notebook_id:this.state.notebook.notebook_id},!1)},this.submit_file_change=async(e,t)=>{let n=this.state.notebook.path;if(n!==e){if(!this.state.notebook.in_temp_dir&&!confirm("Are you sure? Will move from\n\n"+n+"\n\nto\n\n"+e))throw Error("Declined by user");this.setState({moving_file:!0});try{await v(t=>{t.in_temp_dir=!1,t.path=e}),document.activeElement?.blur()}catch(e){alert("Failed to move file:\n\n"+e.message)}finally{this.setState({moving_file:!1})}}},this.desktop_submit_file_change=async()=>{this.setState({moving_file:!0}),window.plutoDesktop?.ipcRenderer.once("PLUTO-MOVE-NOTEBOOK",async e=>{e&&await this.setStatePromise(c(t=>{t.notebook.in_temp_dir=!1,t.notebook.path=e})),this.setState({moving_file:!1}),document.activeElement?.blur()}),window.plutoDesktop?.fileSystem.moveNotebook()},this.delete_selected=e=>{if(this.state.selected_cells.length>0)return this.actions.confirm_delete_multiple(e,this.state.selected_cells),!0},this.run_selected=()=>this.actions.set_and_run_multiple(this.state.selected_cells),this.fold_selected=e=>{if(!(0,u.default).isEmpty(this.state.selected_cells))return this.actions.fold_remote_cells(this.state.selected_cells,e)},this.move_selected=(e,t)=>{if(this.state.selected_cells.length>0){let n=(t>0?Math.max:Math.min)(...this.state.selected_cells.map(e=>this.state.notebook.cell_order.indexOf(e)))+(-1===t?-1:2);return e.preventDefault(),this.actions.move_remote_cells(this.state.selected_cells,n).then(()=>{document.getElementById((t>0?u.default.last:u.default.first)(this.state.selected_cells)??"")?.scrollIntoView({block:"nearest"})})}},this.serialize_selected=(e=null)=>{let t=null==e||this.state.selected_cells.includes(e)?this.state.selected_cells:[e];if(t.length)return t.map(e=>this.state.notebook.cell_inputs[e]).map(e=>`# \u{2554}\u{2550}\u{2561} ${e.cell_id} +`+e.code+"\n").join("\n")},this.patch_listeners=[],this.on_patches_hook=e=>{this.patch_listeners.forEach(t=>t(e))};let w={current:!1},k=e=>{e!==w.current&&(w.current=e,document.body.querySelectorAll("[data-pluto-variable], [data-cell-variable]").forEach(t=>{t.setAttribute("data-ctrl-down",e?"true":"false")}))};document.addEventListener("keyup",e=>{k((0,S.has_ctrl_or_cmd_pressed)(e))}),document.addEventListener("visibilitychange",e=>{k(!1),setTimeout(()=>{k(!1)},100)}),document.addEventListener("keydown",e=>{if(k((0,S.has_ctrl_or_cmd_pressed)(e)),e.key?.toLowerCase()==="q"&&(0,S.has_ctrl_or_cmd_pressed)(e))Object.values(this.state.notebook.cell_results).some(e=>e.running||e.queued)&&this.actions.interrupt_remote(),e.preventDefault();else if(e.key?.toLowerCase()==="s"&&(0,S.has_ctrl_or_cmd_pressed)(e))this.actions.set_and_run_all_changed_remote_cells(),e.preventDefault();else if(["BracketLeft","BracketRight"].includes(e.code)&&(S.is_mac_keyboard?e.altKey&&e.metaKey:e.ctrlKey&&e.shiftKey))this.fold_selected("BracketLeft"===e.code);else if("Backspace"===e.key||"Delete"===e.key)this.delete_selected("Delete")&&e.preventDefault();else if("Enter"===e.key&&e.shiftKey)this.run_selected();else if("ArrowUp"===e.key&&e.altKey)this.move_selected(e,-1);else if("ArrowDown"===e.key&&e.altKey)this.move_selected(e,1);else if("?"===e.key&&(0,S.has_ctrl_or_cmd_pressed)(e)||"F1"===e.key){let t=S.is_mac_keyboard?`\u{2325}${S.and}\u{2318}`:`Ctrl${S.and}Shift`;alert(` +\u{21E7}${S.and}Enter: run cell +${S.ctrl_or_cmd_name}${S.and}Enter: run cell and add cell below +${S.ctrl_or_cmd_name}${S.and}S: submit all changes +Delete or Backspace: delete empty cell + +PageUp or fn${S.and}\u{2191}: jump to cell above +PageDown or fn${S.and}\u{2193}: jump to cell below +${S.alt_or_options_name}${S.and}\u{2191}: move line/cell up +${S.alt_or_options_name}${S.and}\u{2193}: move line/cell down + +${S.control_name}${S.and}M: toggle markdown +${t}${S.and}[: hide cell code +${t}${S.and}]: show cell code +${S.ctrl_or_cmd_name}${S.and}Q: interrupt notebook + +Select multiple cells by dragging a selection box from the space between cells. +${S.ctrl_or_cmd_name}${S.and}C: copy selected cells +${S.ctrl_or_cmd_name}${S.and}X: cut selected cells +${S.ctrl_or_cmd_name}${S.and}V: paste selected cells + +The notebook file saves every time you run a cell.`),e.preventDefault()}else"Escape"===e.key&&this.setState({recording_waiting_to_start:!1,selected_cells:[],export_menu_open:!1});this.state.disable_ui&&this.state.backend_launch_phase===te.wait_for_user&&("Enter"===e.key||e.key?.length===1)&&!document.body.classList.contains("wiggle_binder")&&(document.body.classList.add("wiggle_binder"),setTimeout(()=>{document.body.classList.remove("wiggle_binder")},1e3))}),document.addEventListener("copy",e=>{if(!(0,S.in_textarea_or_input)()){let t=this.serialize_selected();t&&(e.preventDefault(),requestAnimationFrame(()=>navigator.clipboard.writeText(t).catch(t=>{console.error("Error copying cells",e,t,navigator.userActivation),alert(`Error copying cells: ${t?.message??t}`)})))}}),document.addEventListener("cut",e=>{}),document.addEventListener("paste",async e=>{let t=e.clipboardData?.getData("text/plain");if(t){let n=y(t);null!=n&&(this.actions.add_deserialized_cells(t,-1,n),e.preventDefault())}}),window.addEventListener("beforeunload",e=>{let t=this.state.notebook.cell_order.filter(e=>this.state.cell_inputs_local[e]&&this.state.notebook.cell_inputs[e].code!==this.state.cell_inputs_local[e].code)[0];null!=t?(window.dispatchEvent(new CustomEvent("cell_focus",{detail:{cell_id:t}})),console.log("Preventing unload"),e.stopImmediatePropagation(),e.preventDefault(),e.returnValue=""):(console.warn("unloading \uD83D\uDC49 disconnecting websocket"),window.shutdown_binder)})}componentDidMount(){let e=this.props.launch_params;this.state.static_preview?(this.setState({initializing:!1}),ta(null!=e.pluto_server_url?`featured-view${null!=e.notebookfile?new URL(e.notebookfile).pathname:""}`:`article-view/${window?.version_info?.pluto??this.state.notebook.pluto_version??"unknown"}`)):this.connect(e.pluto_server_url?(0,d.ws_address_from_base)(e.pluto_server_url):void 0)}componentDidUpdate(e,t){window.editor_state=this.state,window.editor_state_set=this.setStatePromise;let n=this.state;if(t?.notebook?.path!==n.notebook.path&&lo(n.notebook.path,t?.notebook?.path),t?.notebook?.shortpath!==n.notebook.shortpath&&(document.title="\uD83C\uDF88 "+n.notebook.shortpath+" — Pluto.jl"),this.maybe_send_queued_bond_changes(),t.backend_launch_phase!==this.state.backend_launch_phase&&null!=this.state.backend_launch_phase){let e=Object.entries(te).find(([e,t])=>t==this.state.backend_launch_phase)?.[0];console.info(`Binder phase: ${e} at ${new Date().toLocaleTimeString()}`)}(t.disable_ui!==this.state.disable_ui||t.connected!==this.state.connected)&&this.on_disable_ui(),this.state.initializing||ik(),t.notebook.nbpkg?.restart_recommended_msg!==n.notebook.nbpkg?.restart_recommended_msg&&console.warn(`New restart recommended message: ${n.notebook.nbpkg?.restart_recommended_msg}`),t.notebook.nbpkg?.restart_required_msg!==n.notebook.nbpkg?.restart_required_msg&&console.warn(`New restart required message: ${n.notebook.nbpkg?.restart_required_msg}`)}componentWillUpdate(e,t){this.cached_status=le(t,this.props.launch_params),Object.entries(this.cached_status).forEach(([e,t])=>{document.body.classList.toggle(e,!0===t)})}render(){let{launch_params:e}=this.props,{export_menu_open:t,notebook:n}=this.state,a=this.cached_status??le(this.state,e),r=lt(a);if(a.isolated_cell_view)return(0,l.html)` + <${k.Provider} value=${this.actions}> + <${E.Provider} value=${this.state.notebook.bonds}> + <${$.Provider} value=${this.js_init_set}> + <${eH} notebook=${this.state.notebook} backend_launch_phase=${this.state.backend_launch_phase} status=${a}/> + + ${this.state.notebook.cell_order.map((t,r)=>(0,l.html)` + <${it} + cell_input=${n.cell_inputs[t]} + cell_result=${this.state.notebook.cell_results[t]} + hidden=${!e.isolated_cell_ids?.includes(t)} + sanitize_html=${a.sanitize_html} + /> + `)} + + ${$.Provider}> + ${E.Provider}> + ${k.Provider}> + `;let o=this.client.session_options?.security?.warn_about_untrusted_code??!0,i=async(e=!1)=>{let t=n.metadata?.risky_file_source;(!o||!e||null==t||confirm(`\u{26A0}\u{FE0F} Danger! Are you sure that you trust this file? + +${t} + +A malicious notebook can steal passwords and data.`))&&(await this.actions.update_notebook(e=>{delete e.metadata.risky_file_source}),await this.client.send("restart_process",{},{notebook_id:n.notebook_id}))},s=(e,t=!1)=>(0,l.html)`i(t)}>${e}`;return(0,l.html)` + ${!1===this.state.disable_ui&&(0,l.html)`<${iK} />`} + + <${k.Provider} value=${this.actions}> + <${E.Provider} value=${this.state.notebook.bonds}> + <${$.Provider} value=${this.js_init_set}> + ${a.static_preview&&a.offer_local?(0,l.html)`{history.back()}} + class="floating_back_button" + > + + `:null} + <${eF} active=${this.state.scroller} /> + <${eH} notebook=${this.state.notebook} backend_launch_phase=${this.state.backend_launch_phase} status=${a}/> + + <${iv} + notebook_id=${this.state.notebook.notebook_id} + print_title=${this.state.notebook.metadata?.frontmatter?.title??new URLSearchParams(window.location.search).get("name")??this.state.notebook.shortpath} + notebookfile_url=${this.export_url("notebookfile")} + notebookexport_url=${this.export_url("notebookexport")} + open=${t} + onClose=${()=>this.setState({export_menu_open:!1})} + start_recording=${()=>this.setState({recording_waiting_to_start:!0})} + /> + ${a.binder?(0,l.html)` + + + + `:null} + + + + + ${this.state.extended_components.CustomHeader&&(0,l.html)`<${this.state.extended_components.CustomHeader} notebook_id=${this.state.notebook.notebook_id} />`} + + ${null==this.state.extended_components.CustomHeader&&(a.binder?(0,l.html)`Save notebook...`:(0,l.html)`<${v.FilePicker} + client=${this.client} + value=${n.in_temp_dir?"":n.path} + on_submit=${this.submit_file_change} + on_desktop_submit=${this.desktop_submit_file_change} + clear_on_blur=${!0} + suggest_new_file=${{base:this.client.session_options?.server?.notebook_path_suggestion??""}} + placeholder="Save notebook..." + button_label=${n.in_temp_dir?"Choose":"Move"} + />`)} + + ${a.binder&&a.loading?"Loading binder...":"disconnected"===r?"Reconnecting...":"loading"===r?"Loading...":"nbpkg_restart_required"===r?(0,l.html)`${s("Restart notebook")}${" (required)"}`:"nbpkg_restart_recommended"===r?(0,l.html)`${s("Restart notebook")}${" (recommended)"}`:"process_restarting"===r?"Process exited — restarting...":"process_dead"===r?(0,l.html)`${"Process exited — "}${s("restart")}`:"process_waiting_for_permission"===r?(0,l.html)`${s("Run notebook code",!0)}`:null} + {this.setState({export_menu_open:!t})}}> + + + + <${oT} + process_waiting_for_permission=${a.process_waiting_for_permission} + risky_file_source=${n.metadata?.risky_file_source} + restart=${i} + warn_about_untrusted_code=${o} + /> + + <${iq} + notebook_name=${n.shortpath} + recording_waiting_to_start=${this.state.recording_waiting_to_start} + set_recording_states=${({is_recording:e,recording_waiting_to_start:t})=>this.setState({is_recording:e,recording_waiting_to_start:t})} + is_recording=${this.state.is_recording} + patch_listeners=${this.patch_listeners} + export_url=${this.export_url} + /> + <${iG} + launch_params=${e} + initializing=${this.state.initializing} + apply_notebook_patches=${this.apply_notebook_patches} + reset_notebook_state=${()=>this.setStatePromise(c(e=>{e.notebook=this.props.initial_notebook_state}))} + /> + <${i4} editor=${this} launch_params=${e} status=${a} /> + <${iV} + filename=${n.shortpath} + remote_frontmatter=${n.metadata?.frontmatter} + set_remote_frontmatter=${e=>this.actions.update_notebook(t=>{t.metadata.frontmatter=e})} + /> + ${this.props.preamble_element} + <${i7}> + <${C} + last_update_time=${this.state.last_update_time} + any_code_differs=${a.code_differs} + last_hot_reload_time=${n.last_hot_reload_time} + connected=${this.state.connected} + /> + <${io} + notebook=${n} + cell_inputs_local=${this.state.cell_inputs_local} + disable_input=${this.state.disable_ui||!this.state.connected} + last_created_cell=${this.state.last_created_cell} + selected_cells=${this.state.selected_cells} + is_initializing=${this.state.initializing} + is_process_ready=${this.is_process_ready()} + process_waiting_for_permission=${a.process_waiting_for_permission} + sanitize_html=${a.sanitize_html} + /> + <${ii} + actions=${this.actions} + selected_cells=${this.state.selected_cells} + set_scroller=${e=>this.setState({scroller:e})} + serialize_selected=${this.serialize_selected} + /> + ${this.state.disable_ui||(0,l.html)`<${id} + cell_order=${this.state.notebook.cell_order} + set_scroller=${e=>{this.setState({scroller:e})}} + on_selection=${e=>{(e.length!==this.state.selected_cells.length||0!==(0,u.default).difference(e,this.state.selected_cells).length)&&this.setState({selected_cells:e})}} + />`} + <${iT} + notebook_id=${this.state.notebook.notebook_id} + environment_component=${this.state.extended_components.NonCellOutputComponents} /> + ${i7}> + <${ti} + desired_doc_query=${this.state.desired_doc_query} + on_update_doc_query=${this.actions.set_doc_query} + connected=${this.state.connected} + backend_launch_phase=${this.state.backend_launch_phase} + backend_launch_logs=${this.state.backend_launch_logs} + notebook=${this.state.notebook} + sanitize_html=${a.sanitize_html} + /> + <${ad} + notebook=${this.state.notebook} + disable_input=${this.state.disable_ui||!this.state.connected} + /> + <${im} + recently_auto_disabled_cells=${this.state.recently_auto_disabled_cells} + notebook=${this.state.notebook} + /> + <${ip} + recently_deleted=${this.state.recently_deleted} + on_click=${()=>{let e=this.state.recently_deleted;null!=e&&this.update_notebook(t=>{for(let{index:n,cell:a}of e)t.cell_inputs[a.cell_id]=a,t.cell_order=[...t.cell_order.slice(0,n),a.cell_id,...t.cell_order.slice(n,1/0)]}).then(()=>{this.actions.set_and_run_multiple(e.map(({cell:e})=>e.cell_id))})}} + /> + <${ih} /> + + ${$.Provider}> + ${E.Provider}> + ${k.Provider}> + `}}const lo=(e,t)=>{if(null!=e&&""!==e){let n=localStorage.getItem("recent notebooks"),a=null!=n?JSON.parse(n):[],r=[e,...a.filter(n=>n!==e&&n!==t)];(0,u.default).isEqual(a,r)||localStorage.setItem("recent notebooks",JSON.stringify(r.slice(0,50)))}};var l=o("cNaMA");const li=async(e,t)=>{if(null==e.body)return new Uint8Array(await e.arrayBuffer());{let n=e.headers.get("Content-Length"),a=null==n?null:Number(n),r=e.body.getReader(),o=0,i=[];for(;;){let{done:e,value:n}=await r.read();if(e)break;i.push(n),o+=n.length,t(null!=a?Math.min(1,o/a):1-1e6/(o-1e6)),console.log({receivedLength:o})}t(1);let l=new Uint8Array(o),s=0;for(let e of i)l.set(e,s),s+=e.length;return l}},ll=({progress:e})=>null==e||1===e?null:(0,l.html)` + ${"indeterminate"===e?null:Math.round(100*e)}% + `;var i$=o("k9crH"),i6=o("dYd4C");const ls=new URLSearchParams(window.location.search),lc=(e,t,n)=>{e.getAttribute(t)!==n&&e.setAttribute(t,n)},lu=e=>{document.body.classList.toggle("disable_ui",e),lc(document.head.querySelector("link[data-pluto-file='hide-ui']"),"media",e?"all":"print")},ld=(()=>{let e=new URLSearchParams(window.location.search);return{notebook_id:e.get("id")??window.pluto_notebook_id,statefile:e.get("statefile")??window.pluto_statefile,statefile_integrity:e.get("statefile_integrity")??window.pluto_statefile_integrity,notebookfile:e.get("notebookfile")??window.pluto_notebookfile,notebookfile_integrity:e.get("notebookfile_integrity")??window.pluto_notebookfile_integrity,disable_ui:!!(e.get("disable_ui")??window.pluto_disable_ui),preamble_html:e.get("preamble_html")??window.pluto_preamble_html,isolated_cell_ids:e.has("isolated_cell_id")?e.getAll("isolated_cell_id"):window.pluto_isolated_cell_ids,binder_url:e.get("binder_url")??window.pluto_binder_url,pluto_server_url:e.get("pluto_server_url")??window.pluto_pluto_server_url,slider_server_url:e.get("slider_server_url")??window.pluto_slider_server_url,recording_url:e.get("recording_url")??window.pluto_recording_url,recording_url_integrity:e.get("recording_url_integrity")??window.pluto_recording_url_integrity,recording_audio_url:e.get("recording_audio_url")??window.pluto_recording_audio_url}})(),lp=e=>""===e||"true"===e,lm=e=>"false"===e,lh=(e,t)=>{let n=e.getAttribute(t)??e.getAttribute(t.replaceAll("_","-"));return"disable_ui"===t?!!lp(n)||!lm(n)&&null:"isolated_cell_id"===t?null==n?null:n.split(","):n},lg=ls.has("preamble_url"),lf=({notebook_id:e})=>({metadata:{},notebook_id:e,path:"",shortpath:"",in_temp_dir:!0,process_status:i6.ProcessStatus.starting,last_save_time:0,last_hot_reload_time:0,cell_inputs:{},cell_results:{},cell_dependencies:{},cell_order:[],cell_execution_order:[],published_objects:{},bonds:{},nbpkg:null,status_tree:null}),l_=e=>({...e,path:"",shortpath:""}),lb=window?.pluto_injected_environment?.custom_get_statefile?.(li,l_,i$.unpack)??(async(e,t)=>{t("indeterminate");let n=await fetch(new Request(e.statefile,{integrity:e.statefile_integrity??void 0}),{priority:"high"});t(.2);let a=await li(n,e=>t(.8*e+.2));return l_((0,i$.unpack)(a))}),ly=({launch_params:e})=>{let{statefile:t,statefile_integrity:n}=e,a=null!=t,[r,o]=(0,l.useState)(null),i=(0,l.useRef)(lf(e)),[s,c]=(0,l.useState)(null),[u,d]=(0,l.useState)(!a);(0,l.useEffect)(()=>{!u&&a&&lb(e,o).then(e=>{console.log({state:e}),i.current=e,d(!0)}).catch(t=>{console.error(t),c((0,l.html)` + + Failed to load notebook + The statefile failed to download. Original error message: + ${t.toString()} + Launch parameters: + ${JSON.stringify(e,null,2)} + + `)})},[u,a,t]),(0,l.useEffect)(()=>{lu(e.disable_ui)},[e.disable_ui]);let p=e.preamble_html?(0,l.html)`<${oW} body=${e.preamble_html} className=${"preamble"} sanitize_html=${lg} />`:null;return null!=s?s:u?(0,l.html)`<${lr} initial_notebook_state=${i.current} launch_params=${e} preamble_element=${p} />`:(0,l.html)` + ${p} + <${ll} progress=${r} /> + `};class lv extends HTMLElement{constructor(){super()}connectedCallback(){let e=Object.fromEntries(Object.entries(ld).map(([e,t])=>[e,lh(this,e)??t]));console.log("Launch parameters: ",e),document.querySelector(".delete-me-when-live")?.remove(),(0,l.render)((0,l.html)`<${ly} launch_params=${e} />`,this)}}customElements.define("pluto-editor",lv); \ No newline at end of file diff --git a/frontend-dist/editor.69996afe.js b/frontend-dist/editor.69996afe.js new file mode 100644 index 000000000..f4869c7d0 --- /dev/null +++ b/frontend-dist/editor.69996afe.js @@ -0,0 +1,7 @@ +/*! iFrame Resizer (iframeSizer.contentWindow.min.js) - v4.3.11 - 2024-04-22 + * Desc: Include this file in any page being loaded into an iframe + * to force the iframe to resize to the content size. + * Requires: iframeResizer.min.js on host page. + * Copyright: (c) 2024 David J. Bradshaw - dave@bradshaw.net + * License: MIT + */!function(e){if("undefined"!=typeof window){var t=!0,n="",o=0,i="",r=null,a="",c=!1,u={resize:1,click:1},s=128,d=!0,l=1,m="bodyOffset",f=m,h=!0,g="",p={},v=32,y=null,w=!1,b=!1,T="[iFrameSizer]",E=T.length,O="",S={max:1,min:1,bodyScroll:1,documentElementScroll:1},M="child",I=!0,N=window.parent,A="*",C=0,z=!1,R=null,k=16,x=1,L="scroll",F=L,P=window,D=function(){ei("onMessage function not defined")},j=function(){},q=function(){},H={height:function(){return ei("Custom height calculation function not defined"),document.documentElement.offsetHeight},width:function(){return ei("Custom width calculation function not defined"),document.body.scrollWidth}},W={},B=!1;try{var J=Object.create({},{passive:{get:function(){B=!0}}});window.addEventListener("test",_,J),window.removeEventListener("test",_,J)}catch(e){}var U,V,X,Y,K,Q,G={bodyOffset:function(){return document.body.offsetHeight+eh("marginTop")+eh("marginBottom")},offset:function(){return G.bodyOffset()},bodyScroll:function(){return document.body.scrollHeight},custom:function(){return H.height()},documentElementOffset:function(){return document.documentElement.offsetHeight},documentElementScroll:function(){return document.documentElement.scrollHeight},max:function(){return Math.max.apply(null,ep(G))},min:function(){return Math.min.apply(null,ep(G))},grow:function(){return G.max()},lowestElement:function(){return Math.max(G.bodyOffset()||G.documentElementOffset(),eg("bottom",ey()))},taggedElement:function(){return ev("bottom","data-iframe-height")}},Z={bodyScroll:function(){return document.body.scrollWidth},bodyOffset:function(){return document.body.offsetWidth},custom:function(){return H.width()},documentElementScroll:function(){return document.documentElement.scrollWidth},documentElementOffset:function(){return document.documentElement.offsetWidth},scroll:function(){return Math.max(Z.bodyScroll(),Z.documentElementScroll())},max:function(){return Math.max.apply(null,ep(Z))},min:function(){return Math.min.apply(null,ep(Z))},rightMostElement:function(){return eg("right",ey())},taggedElement:function(){return ev("right","data-iframe-width")}},$=(U=ew,K=null,Q=0,function(){var e=Date.now(),t=k-(e-(Q=Q||e));return V=this,X=arguments,t<=0||kpluto-tree-prefix:before{content:"";opacity:.5;cursor:pointer;width:1em;height:1em;filter:var(--image-filters);background-image:url(caret-down-outline.4253a2fe.svg);background-size:100%;display:inline-block;position:relative;bottom:-2px}pluto-tree.collapsed pluto-tree>pluto-tree-prefix:before{display:none}pluto-tree.collapsed>pluto-tree-prefix:before{background-image:url(caret-forward-outline.348a84b6.svg)}pluto-tree p-r>p-v{color:var(--pluto-output-color);display:inline-flex}pluto-tree.collapsed pluto-tree-items.Array>p-r>p-k,pluto-tree.collapsed pluto-tree-items.Set>p-r>p-k,pluto-tree.collapsed pluto-tree-items.Tuple>p-r>p-k,pluto-tree.collapsed pluto-tree-items.struct>p-r>p-k{display:none}pluto-tree>pluto-tree-prefix>.long{display:block}pluto-tree>pluto-tree-prefix>.short,pluto-tree.collapsed>pluto-tree-prefix>.long{display:none}pluto-tree.collapsed>pluto-tree-prefix>.short{display:block}pluto-tree p-r{margin-left:3em}pluto-tree.collapsed p-r{margin-left:.5em}pluto-tree.collapsed p-r:first-child{margin-left:0}pluto-tree pluto-tree-items.Array>p-r>p-k,pluto-tree pluto-tree-items.Set>p-r>p-k,pluto-tree pluto-tree-items.Tuple>p-r>p-k{opacity:.5;-webkit-user-select:none;user-select:none;margin-right:1em}pluto-tree.Array>pluto-tree-prefix:after{content:"["}pluto-tree pluto-tree-items.Array:after{content:"]"}pluto-tree.Set>pluto-tree-prefix:after{content:"(["}pluto-tree pluto-tree-items.Set:after{content:"])"}pluto-tree.Tuple>pluto-tree-prefix:after,pluto-tree.Dict>pluto-tree-prefix:after,pluto-tree.NamedTuple>pluto-tree-prefix:after,pluto-tree.struct>pluto-tree-prefix:after{content:"("}pluto-tree pluto-tree-items.Tuple:after,pluto-tree pluto-tree-items.Dict:after,pluto-tree pluto-tree-items.NamedTuple:after,pluto-tree pluto-tree-items.struct:after{content:")"}pluto-tree pluto-tree-items.Array>p-r>p-k:after,pluto-tree pluto-tree-items.Set>p-r>p-k:after,pluto-tree pluto-tree-items.Tuple>p-r>p-k:after{content:":"}pluto-tree-pair>p-r>p-k:after,pluto-tree pluto-tree-items.Dict>p-r>p-k:after{content:" => "}pluto-tree pluto-tree-items.NamedTuple>p-r>p-k:after,pluto-tree pluto-tree-items.struct>p-r>p-k:after{content:" = "}pluto-tree.collapsed p-r:after{content:","}pluto-tree.collapsed p-r:last-child:after{content:""}pluto-tree-more{cursor:pointer;white-space:nowrap;width:100%;padding:.6em 0;display:inline-block}pluto-tree-more:before{content:"";opacity:.5;width:1em;height:1em;filter:var(--image-filters);background-image:url(ellipsis-vertical.a30e7430.svg);background-size:100%;margin-left:.2em;margin-right:.5em;display:inline-block;position:relative;bottom:-.1em}pluto-tree-more.loading:before{background-image:url(sync-outline.9a1bd27b.svg);animation:3s ease-in-out infinite loadspin}@keyframes loadspin{0%{transform:rotate(0)}25%{transform:rotate(180deg)}50%{transform:rotate(180deg)}75%{transform:rotate(360deg)}to{transform:rotate(360deg)}}pluto-tree.collapsed pluto-tree-more{margin:0}pluto-tree.collapsed pluto-tree-more:before{background-image:url(ellipsis-horizontal.c9a6cc29.svg)}pluto-tree.collapsed img{max-width:4rem;max-height:4rem}pluto-tree img{max-width:12rem;max-height:8rem}pluto-tree p-r pre{white-space:pre;word-break:normal}jlerror{font-size:.75rem;font-family:var(--julia-mono-font-stack);background-color:var(--code-section-bg-color);border:3px solid var(--pkg-terminal-border-color);overflow-wrap:break-word;border-radius:.6em;margin:1em 0;padding:1em;display:block}jlerror>header{color:var(--jlerror-header-color);border-left:3px solid var(--jlerror-header-color);background:var(--white);border-radius:3px;padding:.7rem}jlerror>header>p{white-space:pre-wrap;margin-block-end:.2em}jlerror>header>p:first-child{margin-block-start:0;font-weight:700}jlerror .stacktrace-header,jlerror .error-header{font-family:var(--system-ui-font-stack)}jlerror .error-header{margin-block-end:1em}jlerror secret-h1{font-size:1.9rem;font-weight:700}jlerror>section{border-block-start:3px dashed var(--pkg-terminal-border-color);margin-block-start:1rem;padding-block-start:1rem}jlerror>section>ol{line-height:1.6}jlerror>section>ol>li{margin-block-end:1em}jlerror>section>ol>li:not(.important):not(:hover){opacity:.5}jlerror>section>ol>li:not(.important)::marker{font-weight:100}jlerror>section>ol>li.from_this_notebook{--bg:var(--jl-info-acccolor);background:var(--bg);outline:3px solid var(--bg);border-radius:.6em;padding:.4em 0}jlerror>section .classical-frame>mark{background:var(--jlerror-mark-bg-color);color:var(--jlerror-mark-color);font-family:var(--julia-mono-font-stack);font-variant-ligatures:none;border-radius:6px}jlerror>section .classical-frame>mark>strong{color:var(--black)}jlerror>section .classical-frame s-span .argument_name{color:var(--cm-color-type)}jlerror>section .frame-source{flex-direction:row;align-items:baseline;display:flex}jlerror>section .frame-source>a{background:var(--jlerror-a-bg-color);border-left:3px solid var(--jlerror-a-border-left-color);border-radius:4px;padding:1px 7px;text-decoration:none}jlerror>section .frame-source>a:not([href]){filter:grayscale()}jlerror>section .frame-source>a[href].remote-url{filter:hue-rotate(160deg)}jlerror>section li.from_this_notebook:not(.from_this_cell) .frame-source>a[href]{filter:hue-rotate(50deg)}jlerror>section .frame-source>span{opacity:.4;padding:0 .2em}jlerror>section .doclink{-webkit-user-select:none;user-select:none}jlerror li::marker{color:var(--pluto-logs-key-color);background:red;border:3px solid red;font-weight:900}jlerror li a.frame-line-preview{border:3px solid var(--cm-color-clickable-underline);--br:.6em;border-radius:var(--br);--crop:-.5em;text-decoration:none;display:block}jlerror li .frame-line-preview pre:not(.asdfdsaf){background-color:var(--code-background);border-radius:var(--br);padding:0;display:block;position:relative;overflow:hidden}jlerror li:not(.from_this_cell) .frame-line-preview pre:after{content:"cell preview";opacity:.6;font-weight:900;display:block;position:absolute;bottom:0;right:1ch}jlerror li .frame-line-preview pre>code{padding:0}jlerror li .frame-line-preview pre>code:not(:only-child).frame-line{background:var(--cm-highlighted)}jlerror li .frame-line-preview pre>code:not(.frame-line){opacity:.7}jlerror li .frame-line-preview pre>code:before{content:var(--before-content);color:var(--cm-color-line-numbers);text-align:right;width:2ch;margin-right:.7em;display:inline-block}jlerror li .frame-line-preview pre>code:first-of-type:not(.frame-line){margin-top:var(--crop)}jlerror li .frame-line-preview pre>code:last-of-type:not(.frame-line){margin-bottom:var(--crop)}jlerror .dont-panic{background:var(--pluto-logs-debug-color);color:var(--black);font-family:var(--system-ui-font-stack);border-radius:.2em;padding:.5em;font-size:1.2rem;font-weight:700;position:absolute;top:0;right:0;transform:rotate(6deg)}body.disable_ui jlerror .dont-panic,pluto-logs jlerror .dont-panic{display:none}table.pluto-table{table-layout:fixed}table.pluto-table td{max-width:300px;overflow:auto}@supports ((-moz-appearance:none)){table.pluto-table td{max-width:unset;overflow:visible}table.pluto-table td>div{max-width:300px;overflow:auto}}table.pluto-table .schema-types{color:var(--pluto-schema-types-color);font-family:var(--julia-mono-font-stack);opacity:0;font-size:.75rem}table.pluto-table .schema-types th{border-bottom:1px solid var(--pluto-schema-types-border-color);background-color:var(--main-bg-color);height:2rem}table.pluto-table thead:hover .schema-types{opacity:1}table.pluto-table .schema-names th{transition:transform .1s ease-in-out;transform:translateY(.5em)}table.pluto-table .schema-names th:first-child,table.pluto-table .schema-types th:first-child{z-index:2;left:-10px}table.pluto-table .schema-names th,table.pluto-table .schema-types th:first-child{background-color:var(--main-bg-color);top:calc(.25rem - var(--pluto-cell-spacing));z-index:1;height:2rem;position:sticky}table.pluto-table thead:hover .schema-names th{transform:translate(0)}table.pluto-table tbody th:first-child{background-color:var(--main-bg-color);white-space:nowrap;position:sticky;left:-10px}table.pluto-table .pluto-tree-more-td{text-align:left;overflow:unset}table.pluto-table .pluto-tree-more-td pluto-tree-more{overflow:unset;max-width:650px;position:sticky;top:2rem;left:0}table.pluto-table tr.empty div{flex-flow:column;justify-content:center;align-items:center;width:100%;font-size:1.5rem;display:flex}table.pluto-table tr.empty small{font-size:.5rem}pluto-tree.collapsed p-v>pre{max-height:2em;overflow-y:hidden} \ No newline at end of file diff --git a/frontend-dist/editor.97d6fa3c.js b/frontend-dist/editor.97d6fa3c.js new file mode 100644 index 000000000..0e0085db5 --- /dev/null +++ b/frontend-dist/editor.97d6fa3c.js @@ -0,0 +1 @@ +!function(e,t){if("function"==typeof define&&define.amd)define(["exports"],t);else if("object"==typeof exports&&"string"!=typeof exports.nodeName)t(exports);else{var n={};t(n),e.AnsiUp=n.default}}(this,function(e){var t,n,i=this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e};(t=n||(n={}))[t.EOS=0]="EOS",t[t.Text=1]="Text",t[t.Incomplete=2]="Incomplete",t[t.ESC=3]="ESC",t[t.Unknown=4]="Unknown",t[t.SGR=5]="SGR",t[t.OSCURL=6]="OSCURL";var s=function(){function e(){this.VERSION="5.1.0",this.setup_palettes(),this._use_classes=!1,this.bold=!1,this.italic=!1,this.underline=!1,this.fg=this.bg=null,this._buffer="",this._url_whitelist={http:1,https:1}}return Object.defineProperty(e.prototype,"use_classes",{get:function(){return this._use_classes},set:function(e){this._use_classes=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url_whitelist",{get:function(){return this._url_whitelist},set:function(e){this._url_whitelist=e},enumerable:!1,configurable:!0}),e.prototype.setup_palettes=function(){var e=this;this.ansi_colors=[[{rgb:[0,0,0],class_name:"ansi-black"},{rgb:[187,0,0],class_name:"ansi-red"},{rgb:[0,187,0],class_name:"ansi-green"},{rgb:[187,187,0],class_name:"ansi-yellow"},{rgb:[0,0,187],class_name:"ansi-blue"},{rgb:[187,0,187],class_name:"ansi-magenta"},{rgb:[0,187,187],class_name:"ansi-cyan"},{rgb:[255,255,255],class_name:"ansi-white"}],[{rgb:[85,85,85],class_name:"ansi-bright-black"},{rgb:[255,85,85],class_name:"ansi-bright-red"},{rgb:[0,255,0],class_name:"ansi-bright-green"},{rgb:[255,255,85],class_name:"ansi-bright-yellow"},{rgb:[85,85,255],class_name:"ansi-bright-blue"},{rgb:[255,85,255],class_name:"ansi-bright-magenta"},{rgb:[85,255,255],class_name:"ansi-bright-cyan"},{rgb:[255,255,255],class_name:"ansi-bright-white"}]],this.palette_256=[],this.ansi_colors.forEach(function(t){t.forEach(function(t){e.palette_256.push(t)})});for(var t=[0,95,135,175,215,255],n=0;n<6;++n)for(var i=0;i<6;++i)for(var s=0;s<6;++s){var r={rgb:[t[n],t[i],t[s]],class_name:"truecolor"};this.palette_256.push(r)}for(var a=8,l=0;l<24;++l,a+=10){var f={rgb:[a,a,a],class_name:"truecolor"};this.palette_256.push(f)}},e.prototype.escape_txt_for_html=function(e){return e.replace(/[&<>"']/gm,function(e){return"&"===e?"&":"<"===e?"<":">"===e?">":'"'===e?""":"'"===e?"'":void 0})},e.prototype.append_buffer=function(e){var t=this._buffer+e;this._buffer=t},e.prototype.get_next_packet=function(){var e={kind:n.EOS,text:"",url:""},t=this._buffer.length;if(0==t)return e;var s=this._buffer.indexOf("\x1b");if(-1==s)return e.kind=n.Text,e.text=this._buffer,this._buffer="",e;if(s>0)return e.kind=n.Text,e.text=this._buffer.slice(0,s),this._buffer=this._buffer.slice(s),e;if(0==s){if(1==t)return e.kind=n.Incomplete,e;var a=this._buffer.charAt(1);if("["!=a&&"]"!=a)return e.kind=n.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;if("["==a){if(this._csi_regex||(this._csi_regex=r(i(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \x1b[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \x1b[ # CSI\n [ -~]* # anything legal\n ([\0-\x1f:]) # anything illegal\n )\n "],["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]))),null===(h=this._buffer.match(this._csi_regex)))return e.kind=n.Incomplete,e;if(h[4])return e.kind=n.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;""!=h[1]||"m"!=h[3]?e.kind=n.Unknown:e.kind=n.SGR,e.text=h[2];var l=h[0].length;return this._buffer=this._buffer.slice(l),e}if("]"==a){if(t<4)return e.kind=n.Incomplete,e;if("8"!=this._buffer.charAt(2)||";"!=this._buffer.charAt(3))return e.kind=n.ESC,e.text=this._buffer.slice(0,1),this._buffer=this._buffer.slice(1),e;this._osc_st||(this._osc_st=function(e){for(var t=[],n=1;n0;){var n=parseInt(t.shift(),10);if(isNaN(n)||0===n)this.fg=this.bg=null,this.bold=!1,this.italic=!1,this.underline=!1;else if(1===n)this.bold=!0;else if(3===n)this.italic=!0;else if(4===n)this.underline=!0;else if(22===n)this.bold=!1;else if(23===n)this.italic=!1;else if(24===n)this.underline=!1;else if(39===n)this.fg=null;else if(49===n)this.bg=null;else if(n>=30&&n<38)this.fg=this.ansi_colors[0][n-30];else if(n>=40&&n<48)this.bg=this.ansi_colors[0][n-40];else if(n>=90&&n<98)this.fg=this.ansi_colors[1][n-90];else if(n>=100&&n<108)this.bg=this.ansi_colors[1][n-100];else if((38===n||48===n)&&t.length>0){var i=38===n,s=t.shift();if("5"===s&&t.length>0){var r=parseInt(t.shift(),10);r>=0&&r<=255&&(i?this.fg=this.palette_256[r]:this.bg=this.palette_256[r])}if("2"===s&&t.length>2){var a=parseInt(t.shift(),10),l=parseInt(t.shift(),10),f=parseInt(t.shift(),10);if(a>=0&&a<=255&&l>=0&&l<=255&&f>=0&&f<=255){var h={rgb:[a,l,f],class_name:"truecolor"};i?this.fg=h:this.bg=h}}}}},e.prototype.transform_to_html=function(e){var t=e.text;if(0===t.length||(t=this.escape_txt_for_html(t),!e.bold&&!e.italic&&!e.underline&&null===e.fg&&null===e.bg))return t;var n=[],i=[],s=e.fg,r=e.bg;e.bold&&n.push("font-weight:bold"),e.italic&&n.push("font-style:italic"),e.underline&&n.push("text-decoration:underline"),this._use_classes?(s&&("truecolor"!==s.class_name?i.push(s.class_name+"-fg"):n.push("color:rgb("+s.rgb.join(",")+")")),r&&("truecolor"!==r.class_name?i.push(r.class_name+"-bg"):n.push("background-color:rgb("+r.rgb.join(",")+")"))):(s&&n.push("color:rgb("+s.rgb.join(",")+")"),r&&n.push("background-color:rgb("+r.rgb+")"));var a="",l="";return i.length&&(a=' class="'+i.join(" ")+'"'),n.length&&(l=' style="'+n.join(";")+'"'),""+t+""},e.prototype.process_hyperlink=function(e){var t=e.url.split(":");return t.length<1?"":this._url_whitelist[t[0]]?''+this.escape_txt_for_html(e.text)+"":""},e}();function r(e){for(var t=[],n=1;nbutton{animation:.3s ease-in-out wiggle-binder-button}@keyframes wiggle-binder-button{0%{transform:rotate(0)}30%{transform:rotate(10deg)}70%{transform:rotate(-10deg)}to{transform:rotate(0)}}.binder_help_text button img{color:#000;height:2.2em;margin:-8px -8px -8px 0;font-style:normal;font-weight:900}.edit_or_run>button{text-align:center;z-index:2000;width:100%;box-shadow:none;cursor:pointer;background:unset;background-color:var(--overlay-button-bg);font-size:16px;font-family:var(--lato-ui-font-stack);letter-spacing:.1px;color:var(--black);white-space:nowrap;border:3px solid #5c61a375;border-radius:30px;padding:8px 16px;display:block}.edit_or_run>button:hover{text-decoration:underline}.binder_help_text{--width:min(85vw,570px);max-height:calc(100vh - 4rem);width:var(--width);color:#000;color-scheme:light;font-family:var(--sans-serif-font-stack);background-color:#fff;border:0;border-radius:8px;padding:16px;position:fixed;overflow:auto;box-shadow:0 0 0 100vmax #0000004a}.binder_help_text a{color:#000}@media (width<=500px){.binder_help_text{width:100vw;max-height:100vh;top:0;left:0}}.binder_help_text .close{--size:32px;width:var(--size);height:var(--size);background-size:var(--size)var(--size);cursor:pointer;background-image:url(close-outline.9c22a232.svg);position:absolute;top:5px;right:5px}.download_div,.copy_div{justify-content:space-between;align-items:center;height:40px;margin-bottom:.75rem;padding:4px 8px;display:flex}.download_div,.binder_help_text button,.download_div,.copy_div{border:3px solid #3f448c5e;border-radius:8px;width:max(60%,10rem);margin:0 auto;overflow:hidden}.download_div a,.copy_div input{cursor:text;border:none;outline:none;width:calc(100% - 8px - 1rem);font-family:Roboto Mono,monospace;font-size:.7rem;line-height:1.4}.download_div,.download_div a{cursor:pointer}.download_icon,.copy_icon{cursor:pointer;background-image:url(copy-outline.0f561529.svg);background-position:50%;background-repeat:no-repeat;background-size:1rem 1rem;width:1.5rem;height:1.5rem;position:relative;box-shadow:0 0 60px 60px #fff}.download_icon{background-image:url(download-outline.523a74d8.svg)}.copy_icon.success_copy:after{content:"Copied!";text-align:center;background-color:#dcebf5;border-radius:.5rem;width:4rem;font-family:JuliaMono,monospace;font-size:.75rem;font-weight:700;line-height:1.5rem;animation:3s fadeout;position:absolute}.copy_icon:not(.success_copy):hover:after{content:"Copy";text-align:center;background-color:#f4f5dc;border-radius:.5rem;width:4rem;font-family:JuliaMono,monospace;font-size:.75rem;font-weight:700;line-height:1.5rem;position:absolute}.copy_icon:after{right:1.5rem}@keyframes fadeout{0%{opacity:1}20%{opacity:1}40%{opacity:0}to{opacity:0}}.command{margin-bottom:.75rem;font-size:1.2rem;font-weight:700}.edit_or_run li{margin-bottom:2rem}.edit_or_run li video,.edit_or_run li img{border:5px solid #d4d4d4;border-radius:5px;width:100%}.expected_runtime_box{color:#323232;background:linear-gradient(45deg,#cdd7ef,#e5f7ff);border-radius:.6em;margin:2em 0 -2em;padding:.6em 1em;font-style:italic;display:block}.expected_runtime_box span{font-style:initial;font-weight:700} \ No newline at end of file diff --git a/frontend-dist/editor.e8dd1839.css b/frontend-dist/editor.e8dd1839.css new file mode 100644 index 000000000..4bad9df61 --- /dev/null +++ b/frontend-dist/editor.e8dd1839.css @@ -0,0 +1 @@ +@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:url(roboto-mono-cyrillic-ext-400-normal.dcb520ee.woff2)format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:url(roboto-mono-cyrillic-400-normal.638e826e.woff2)format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff)format("woff");unicode-range:U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:url(roboto-mono-greek-400-normal.dd843e41.woff2)format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff)format("woff");unicode-range:U+370-3FF}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:url(roboto-mono-vietnamese-400-normal.306e7635.woff2)format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:url(roboto-mono-latin-ext-400-normal.d9409874.woff2)format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:url(roboto-mono-latin-400-normal.cf1eee5f.woff2)format("woff2"),url(roboto-mono-all-400-normal.364ec368.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Roboto Mono;font-style:italic;font-display:swap;font-weight:400;src:url(roboto-mono-cyrillic-ext-400-italic.db052448.woff2)format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff)format("woff");unicode-range:U+460-52F,U+1C80-1C88,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F}@font-face{font-family:Roboto Mono;font-style:italic;font-display:swap;font-weight:400;src:url(roboto-mono-cyrillic-400-italic.e399ed93.woff2)format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff)format("woff");unicode-range:U+400-45F,U+490-491,U+4B0-4B1,U+2116}@font-face{font-family:Roboto Mono;font-style:italic;font-display:swap;font-weight:400;src:url(roboto-mono-greek-400-italic.6f7e0b2f.woff2)format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff)format("woff");unicode-range:U+370-3FF}@font-face{font-family:Roboto Mono;font-style:italic;font-display:swap;font-weight:400;src:url(roboto-mono-vietnamese-400-italic.d8e0a32a.woff2)format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff)format("woff");unicode-range:U+102-103,U+110-111,U+128-129,U+168-169,U+1A0-1A1,U+1AF-1B0,U+1EA0-1EF9,U+20AB}@font-face{font-family:Roboto Mono;font-style:italic;font-display:swap;font-weight:400;src:url(roboto-mono-latin-ext-400-italic.aaa9a959.woff2)format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff)format("woff");unicode-range:U+100-24F,U+259,U+1E??,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF}@font-face{font-family:Roboto Mono;font-style:italic;font-display:swap;font-weight:400;src:url(roboto-mono-latin-400-italic.ef82d48f.woff2)format("woff2"),url(roboto-mono-all-400-italic.31a14f53.woff)format("woff");unicode-range:U+??,U+131,U+152-153,U+2BB-2BC,U+2C6,U+2DA,U+2DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}@font-face{font-family:Vollkorn;src:url(Vollkorn-SemiBold.8072eb6c.woff2)format("woff2");font-display:swap;font-weight:600}@font-face{font-family:Vollkorn;font-style:italic;src:url(Vollkorn-SemiBoldItalic.5c3cd265.woff2)format("woff2");font-display:swap;font-weight:600}@font-face{font-family:Vollkorn;src:url(Vollkorn-Bold.6e1feb70.woff2)format("woff2");font-display:swap;font-weight:700}@font-face{font-family:Vollkorn;font-style:italic;src:url(Vollkorn-BoldItalic.a48ab300.woff2)format("woff2");font-display:swap;font-weight:700}@font-face{font-family:Vollkorn;src:url(Vollkorn-Black.0ebdfbf5.woff2)format("woff2");font-display:swap;font-weight:900}@font-face{font-family:Vollkorn;font-style:italic;src:url(Vollkorn-BlackItalic.4095acfe.woff2)format("woff2");font-display:swap;font-weight:900}@font-face{font-family:JuliaMono;src:url(JuliaMono-RegularLatin.26c56b70.woff2)format("woff2");font-display:swap;font-weight:400;unicode-range:U+0-7F}@font-face{font-family:JuliaMono;src:url(JuliaMono-BoldLatin.7ec5c608.woff2)format("woff2");font-display:swap;font-weight:700;unicode-range:U+0-7F}@font-face{font-family:JuliaMono;src:url(JuliaMono-Regular.e0106c6f.woff2)format("woff2");font-display:swap;font-weight:400}@font-face{font-family:JuliaMono;src:url(JuliaMono-Bold.24b57d33.woff2)format("woff2");font-display:swap;font-weight:700}@font-face{font-family:JuliaMono;src:url(JuliaMono-RegularItalic.3159f647.woff2)format("woff2");font-display:swap;font-weight:400;font-style:italic}@media (prefers-color-scheme:light){:root{--image-filters:none;--out-of-focus-opacity:.25;--main-bg-color:white;--rule-color:#00000026;--kbd-border-color:#dfdfdf;--header-bg-color:white;--header-border-color:#0000001a;--ui-button-color:#2a2a2b;--cursor-color:black;--normal-cell:0,0,0;--code-differs:160,130,28;--error-color:240,168,168;--normal-cell-color:rgba(var(--normal-cell),.1);--dark-normal-cell-color:rgba(var(--normal-cell),.2);--selected-cell-color:#284ebd66;--code-differs-cell-color:rgba(var(--code-differs),.68);--error-cell-color:rgba(var(--error-color),.7);--bright-error-cell-color:rgb(var(--error-color));--light-error-cell-color:rgba(var(--error-color),.05);--export-bg-color:#3c4365;--export-color:#e4e4e4;--export-card-bg-color:#fffc;--export-card-title-color:#000000b3;--export-card-text-color:#00000080;--export-card-shadow-color:#00000029;--frontmatter-button-bg-color:white;--frontmatter-outline-color:#181920;--frontmatter-input-bg-color:#fbfbfb;--frontmatter-input-border-color:#d6dfe6;--pluto-schema-types-color:#0006;--pluto-schema-types-border-color:#0003;--pluto-output-color:#404040;--pluto-output-h-color:#1f1f1f;--pluto-output-bg-color:white;--a-underline:#00000059;--blockquote-color:#555;--blockquote-bg:#f2f2f2;--admonition-title-color:white;--jl-message-color:#dbe9d4;--jl-message-accent-color:#9ec889;--jl-info-color:#d6e3f4;--jl-info-accent-color:#94b6e2;--jl-warn-color:#ecead5;--jl-warn-accent-color:#cfc78a;--jl-danger-color:#f5dad7;--jl-danger-accent-color:#e29d94;--jl-debug-color:#f5dad7;--jl-debug-accent-color:#e29d94;--footnote-border-color:#17737726;--table-border-color:#0003;--table-bg-hover-color:#9f9ee026;--pluto-tree-color:#00000061;--disabled-cell-bg-color:#8b8b8b40;--selected-cell-bg-color:#284ebd3d;--hover-scrollbar-color-1:#00000026;--hover-scrollbar-color-2:#0000000d;--skip-as-script-background-color:#ccc;--depends-on-skip-as-script-background-color:#eee;--shoulder-hover-bg-color:#0000000d;--pluto-logs-bg-color:#fafafa;--pluto-logs-key-color:#00000082;--pluto-logs-progress-fill:#fff;--pluto-logs-progress-bg:#e7e7e7;--pluto-logs-progress-border:#b2bdc7;--pluto-logs-info-color:white;--pluto-logs-info-accent-color:inherit;--pluto-logs-warn-color:#ecead5;--pluto-logs-warn-accent-color:#665f26;--pluto-logs-danger-color:#f5dad7;--pluto-logs-danger-accent-color:#ac4234;--pluto-logs-debug-color:#ecdff7;--pluto-logs-debug-accent-color:#6432b3;--nav-h1-text-color:black;--nav-filepicker-color:#6f6f6f;--nav-filepicker-border-color:#b2b2b2;--nav-process-status-bg-color:white;--nav-process-status-color:var(--pluto-output-h-color);--restart-recc-header-color:#72c0ff8f;--restart-recc-accent-color:#72c0ff;--restart-req-header-color:#aa29208f;--dead-process-header-color:#e6582e61;--loading-header-color:#cfc7d180;--disconnected-header-color:#ffa9728f;--binder-loading-header-color:#f6f1d580;--loading-grad-color-1:#f1dba9;--loading-grad-color-2:#d7d7d0;--overlay-button-bg:#fff;--overlay-button-border:#e9e7e7;--overlay-button-border-save:#f3f2f2;--input-context-menu-border-color:#0000001a;--input-context-menu-bg-color:white;--input-context-menu-soon-color:#5554;--input-context-menu-hover-bg-color:#0000001a;--input-context-menu-li-color:#6b6a6a;--pkg-popup-bg:white;--pkg-popup-border-color:#f0e4ee;--pkg-popup-buttons-bg-color:white;--black:black;--white:white;--pkg-terminal-bg-color:#232433;--pkg-terminal-border-color:#c3c3c3;--pluto-runarea-bg-color:hsl(0,0,97%);--pluto-runarea-span-color:#a89fa0;--dropruler-bg-color:#00000080;--jlerror-header-color:#4f1616;--jlerror-mark-bg-color:#f3f3f3;--jlerror-a-bg-color:#f5efd9;--jlerror-a-border-left-color:#704141;--jlerror-mark-color:black;--helpbox-bg-color:white;--helpbox-box-shadow-color:#00000010;--helpbox-header-bg-color:#ebebeb;--helpbox-header-tab-bg-color:white;--helpbox-header-color:#181920;--helpbox-search-bg-color:#fbfbfb;--helpbox-search-border-color:#d6dfe6;--helpbox-notfound-search-color:#8b8b8b;--helpbox-text-color:black;--code-section-bg-color:#f3f3f3;--process-item-bg:#f2f2f2;--process-busy:#ffcd70;--process-finished:#7ab881;--process-undefined:#979797;--process-failed:#e66363;--process-notify-bg:#f7f3e8;--footer-color:#333;--footer-bg-color:#d7dcd3;--footer-atag-color:black;--footer-input-border-color:#818181;--footer-filepicker-button-color:white;--footer-filepicker-focus-color:#896c6c;--undo-delete-box-shadow-color:#0083;--cm-color-editor-tooltip-border:#0003;--cm-color-editor-li-aria-selected-bg:#16659d;--cm-color-editor-li-aria-selected:white;--cm-color-editor-li-notexported:#00000080;--code-background:#fefcf5;--cm-color-code-differs-gutters:#d6ac2333;--cm-color-line-numbers:#8d86875e;--cm-selection-background:#75b1ff7a;--cm-selection-background-blurred:#bababa7a;--cm-highlighted:#cbceb668;--cm-color-editor-text:#41323f;--cm-color-comment:#e96ba8;--cm-color-atom:#815ba4;--cm-color-number:#815ba4;--cm-color-property:#b67a48;--cm-color-keyword:#ef6155;--cm-color-string:#da5616;--cm-color-var:#5668a4;--cm-color-var2:#37768a;--cm-color-macro:#5c8c5f;--cm-color-builtin:#5e7ad3;--cm-color-function:#cc80ac;--cm-color-type:#879794;--cm-color-bracket:#41323f;--cm-color-tag:#ef6155;--cm-color-link:#815ba4;--cm-color-error-bg:#ef6155;--cm-color-error:#f7f7f7;--cm-color-matchingBracket:black;--cm-color-matchingBracket-bg:#1b4bbb21;--cm-color-placeholder-text:#0003;--cm-color-clickable-underline:#ced2ef;--cm-color-html:#48b685;--cm-color-html-accent:#00ab85;--cm-color-css:#876800;--cm-color-css-accent:#696200;--cm-css-why-doesnt-codemirror-highlight-all-the-text-aaa:#3b3700;--cm-color-md:#005a9b;--cm-color-md-accent:#00a9d1;--autocomplete-menu-bg-color:white;--index-text-color:hsl(0,0,60);--index-light-text-color:#838383;--index-clickable-text-color:black;--docs-binding-bg:#8383830a;--index-card-bg:white;--welcome-mywork-bg:#f9efe1;--welcome-newnotebook-bg:whitesmoke;--welcome-recentnotebook-bg:white;--welcome-recentnotebook-border:#dfdfdf;--welcome-open-bg:#fbfbfb;--welcome-card-author-backdrop:#ffffffb0}}@media (prefers-color-scheme:dark){:root{--image-filters:invert(1)hue-rotate(180deg)contrast(.8);--out-of-focus-opacity:.5;--main-bg-color:#1f1f1f;--rule-color:#ffffff26;--kbd-border-color:#222;--header-bg-color:#2a2928;--header-border-color:transparent;--ui-button-color:#fff;--cursor-color:white;--normal-cell:100,100,100;--error-color:255,125,125;--normal-cell-color:rgba(var(--normal-cell),.2);--dark-normal-cell-color:rgba(var(--normal-cell),.4);--selected-cell-color:#2893bda6;--code-differs-cell-color:#9b906c;--error-cell-color:rgba(var(--error-color),.6);--bright-error-cell-color:rgba(var(--error-color),.9);--light-error-cell-color:rgba(var(--error-color),0);--export-bg-color:#262a36;--export-color:#ffffffd6;--export-card-bg-color:#494949;--export-card-title-color:#ffffffd9;--export-card-text-color:#ffffffb3;--export-card-shadow-color:#0000001c;--frontmatter-button-bg-color:#554e4e;--frontmatter-outline-color:#fff8eb;--frontmatter-input-bg-color:#2c2c2c;--frontmatter-input-border-color:#757575;--pluto-schema-types-color:#fff9;--pluto-schema-types-border-color:#fff3;--pluto-dim-output-color:hsl(0,0,70%);--pluto-output-color:#c4c4c4;--pluto-output-h-color:#e6e6e6;--pluto-output-bg-color:var(--main-bg-color);--a-underline:#ffffff69;--blockquote-color:inherit;--blockquote-bg:#2e2e2e;--admonition-title-color:black;--jl-message-color:#265a20;--jl-message-accent-color:#83bf8a;--jl-info-color:#2a4973;--jl-info-accent-color:#5c8ccd;--jl-warn-color:#605a22;--jl-warn-accent-color:#ddd464;--jl-danger-color:#642f27;--jl-danger-accent-color:#ff7562;--jl-debug-color:#522e5c;--jl-debug-accent-color:#c481df;--table-border-color:#fff3;--table-bg-hover-color:#c1c0eb26;--pluto-tree-color:#d1cfcf9c;--disabled-cell-bg-color:#8b8b8b40;--selected-cell-bg-color:#2a73cdc7;--hover-scrollbar-color-1:#00000026;--hover-scrollbar-color-2:#0000000d;--skip-as-script-background-color:#888;--depends-on-skip-as-script-background-color:#666;--shoulder-hover-bg-color:#ffffff0d;--pluto-logs-bg-color:#2b2b2b;--pluto-logs-key-color:#fff9;--pluto-logs-progress-fill:#5f7f5b;--pluto-logs-progress-bg:#3d3d3d;--pluto-logs-progress-border:#9fb8d1;--pluto-logs-info-color:#484848;--pluto-logs-info-accent-color:inherit;--pluto-logs-warn-color:#504c26;--pluto-logs-warn-accent-color:#efe787;--pluto-logs-danger-color:#642f27;--pluto-logs-danger-accent-color:#ff9384;--pluto-logs-debug-color:#47344c;--pluto-logs-debug-accent-color:#d6abe7;--nav-h1-text-color:white;--nav-filepicker-color:#b6b6b6;--nav-filepicker-border-color:#c7c7c7;--nav-process-status-bg-color:#525252;--nav-process-status-color:var(--pluto-output-h-color);--restart-recc-header-color:#2c6a9d8f;--restart-recc-accent-color:#2c6a9d;--restart-req-header-color:#91423c8f;--dead-process-header-color:#fa4b1579;--loading-header-color:#33333380;--disconnected-header-color:#ffa9728f;--binder-loading-header-color:#f6f1d580;--loading-grad-color-1:#a9d4f1;--loading-grad-color-2:#d0d4d7;--overlay-button-bg:#2c2c2c;--overlay-button-border:#9e9e9e70;--overlay-button-border-save:#c7a74670;--overlay-button-color:white;--input-context-menu-border-color:#ffffff1a;--input-context-menu-bg-color:#27282f;--input-context-menu-soon-color:#b1b1b144;--input-context-menu-hover-bg-color:#ffffff1a;--input-context-menu-li-color:#c7c7c7;--pkg-popup-bg:#3d2f44;--pkg-popup-border-color:#574f56;--pkg-popup-buttons-bg-color:var(--input-context-menu-bg-color);--black:white;--white:black;--pkg-terminal-bg-color:#252627;--pkg-terminal-border-color:#c3c3c388;--pluto-runarea-bg-color:#2b2b2b;--pluto-runarea-span-color:#a89fa0;--dropruler-bg-color:#ffffff1a;--jlerror-header-color:#d9baba;--jlerror-mark-bg-color:#0000002e;--jlerror-a-bg-color:#50523a;--jlerror-a-border-left-color:#6d7141;--jlerror-mark-color:#b1a9a9;--helpbox-bg-color:#1e221f;--helpbox-box-shadow-color:#00000017;--helpbox-header-bg-color:#2c3e36;--helpbox-header-tab-bg-color:#554e4e;--helpbox-header-color:#fff8eb;--helpbox-search-bg-color:#2c2c2c;--helpbox-search-border-color:#757575;--helpbox-notfound-search-color:#8b8b8b;--helpbox-text-color:#e6e6e6;--code-section-bg-color:#2c2c2c;--code-section-border-color:#555a64;--process-item-bg:#443d44;--process-busy:#ffcd70;--process-finished:#7ab881;--process-undefined:#979797;--process-failed:#b87e7a;--process-notify-bg:#363636;--footer-color:#cacaca;--footer-bg-color:var(--header-bg-color);--footer-atag-color:#72a1df;--footer-input-border-color:#6c6c6c;--footer-filepicker-button-color:black;--footer-filepicker-focus-color:#c1c1c1;--footnote-border-color:#72e1e726;--undo-delete-box-shadow-color:#d5d5d633;--cm-color-editor-tooltip-border:#0003;--cm-color-editor-li-aria-selected-bg:#3271e7;--cm-color-editor-li-aria-selected:white;--cm-color-editor-li-notexported:#ffffff80;--code-background:#292d38;--cm-color-code-differs-gutters:#ebd51c1c;--cm-color-line-numbers:#8d86875e;--cm-selection-background:#548bd97a;--cm-selection-background-blurred:#9696967a;--cm-highlighted:#cbceb629;--cm-color-editor-text:#ffe9fc;--cm-color-comment:#e96ba8;--cm-color-atom:#e46b58;--cm-color-number:#a57acd;--cm-color-property:#f99b15;--cm-color-keyword:#ff7a6f;--cm-color-string:#df7e4e;--cm-color-var:#afb7d3;--cm-color-var2:#06b6ef;--cm-color-macro:#82b38b;--cm-color-builtin:#5e7ad3;--cm-color-function:#f99b15;--cm-color-type:#94894c;--cm-color-bracket:#a2a273;--cm-color-tag:#ef6155;--cm-color-link:#815ba4;--cm-color-error-bg:#ef6155;--cm-color-error:#f7f7f7;--cm-color-matchingBracket:white;--cm-color-matchingBracket-bg:#c58c237a;--cm-color-placeholder-text:#fff3;--cm-color-clickable-underline:#5d5f70;--cm-color-html:#00ab85;--cm-color-html-accent:#00e7b4;--cm-color-css:#ebd073;--cm-color-css-accent:#fffed2;--cm-css-why-doesnt-codemirror-highlight-all-the-text-aaa:#ffffea;--cm-color-md:#a2c9d5;--cm-color-md-accent:#00a9d1;--autocomplete-menu-bg-color:var(--input-context-menu-bg-color);--index-text-color:#c7c7c7;--index-light-text-color:#c7c7c7;--index-clickable-text-color:#ebebeb;--docs-binding-bg:#323431;--index-card-bg:#313131;--welcome-mywork-bg:var(--header-bg-color);--welcome-newnotebook-bg:#444866;--welcome-recentnotebook-bg:#3b3b3b;--welcome-recentnotebook-border:#6e6e6e;--welcome-open-bg:#434765;--welcome-card-author-backdrop:#0000006b}@media (prefers-contrast:more){:root{--cm-color-line-numbers:#b3b3b3}}}:root{--card-width:15rem}featured-card{--card-color:hsl(var(--card-color-hue),77%,82%);--card-border-radius:10px;--card-border-width:3px;border:var(--card-border-width)solid var(--card-color);border-radius:var(--card-border-radius);font-family:var(--inter-ui-font-stack);word-break:break-word;hyphens:auto;background:var(--index-card-bg);max-width:var(--card-width);margin:10px;padding-bottom:.3rem;display:block;position:relative;box-shadow:0 2px 6px #00000014}featured-card .banner img{--zz:calc(var(--card-border-radius) - var(--card-border-width));aspect-ratio:3/2;object-fit:cover;background:var(--card-color);border-radius:var(--zz)var(--zz)0 0;flex:200px;width:100%;min-width:0}featured-card a{text-decoration:none}featured-card a.banner{display:flex}featured-card .author{background:var(--welcome-card-author-backdrop);backdrop-filter:blur(15px);color:var(--index-light-text-color);border-radius:117px;align-items:center;gap:.4ch;margin-left:.3rem;padding:.3em .8em .3em .3em;font-weight:600;display:flex;position:absolute;top:.3em;right:.3em}featured-card .author img{--size:1.6em;width:var(--size);height:var(--size);object-fit:cover;background:#b6b6b6;border-radius:100%;flex:none;display:inline-block;overflow:hidden}featured-card h3 a{-webkit-line-clamp:2;background:var(--index-card-bg);border-radius:.6em;-webkit-box-orient:vertical;padding:.6em .6em 0;display:-webkit-inline-box;overflow:hidden}featured-card p{color:var(--index-light-text-color);-webkit-line-clamp:4;-webkit-box-orient:vertical;margin:.3rem .8rem;display:-webkit-inline-box;overflow:hidden}featured-card h3{margin:-1.1rem 0 0}featured-card.big{grid-row-end:span 2;grid-column-end:span 2}featured-card.big .banner img{height:16rem}featured-card.special:before{content:"New!";text-transform:uppercase;color:#833bc6;text-shadow:0 0 1px #ff6767;pointer-events:none;background:#fcf492;padding:2px 19px;font-size:1.4rem;font-style:italic;font-weight:700;display:block;position:absolute;left:-9px;transform:translateY(calc(15px - 100%))rotate(-5deg)} \ No newline at end of file diff --git a/frontend-dist/editor.html b/frontend-dist/editor.html new file mode 100644 index 000000000..94cd8fe21 --- /dev/null +++ b/frontend-dist/editor.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/editor.runtime.6e97799a.js b/frontend-dist/editor.runtime.6e97799a.js new file mode 100644 index 000000000..7581e5747 --- /dev/null +++ b/frontend-dist/editor.runtime.6e97799a.js @@ -0,0 +1 @@ +function e(e,r,t,o){Object.defineProperty(e,r,{get:t,set:o,enumerable:!0,configurable:!0})}var r=globalThis,t={},o={},n=r.parcelRequire94c2;null==n&&((n=function(e){if(e in t)return t[e].exports;if(e in o){var r=o[e];delete o[e];var n={id:e,exports:{}};return t[e]=n,r.call(n.exports,n,n.exports),n.exports}var i=Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(e,r){o[e]=r},r.parcelRequire94c2=n),(0,n.register)("ko7kR",function(r,t){e(r.exports,"register",()=>o,e=>o=e),e(r.exports,"resolve",()=>n,e=>n=e);var o,n,i=new Map;o=function(e,r){for(var t=0;t \ 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 000000000..bf94f28ac --- /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 000000000..5df322580 --- /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 000000000..27f793a2c --- /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 000000000..7c839e684 --- /dev/null +++ b/frontend-dist/error.jl.html @@ -0,0 +1 @@ +$TITLE$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 000000000..4a7e91593 --- /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 000000000..6901ef405 --- /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.267aebbe.png b/frontend-dist/favicon-16x16.267aebbe.png new file mode 100644 index 000000000..a80b6b70f Binary files /dev/null and b/frontend-dist/favicon-16x16.267aebbe.png differ diff --git a/frontend-dist/favicon-32x32.1b9d3e70.png b/frontend-dist/favicon-32x32.1b9d3e70.png new file mode 100644 index 000000000..b822925cb Binary files /dev/null and b/frontend-dist/favicon-32x32.1b9d3e70.png differ diff --git a/frontend-dist/favicon-96x96.26e08763.png b/frontend-dist/favicon-96x96.26e08763.png new file mode 100644 index 000000000..1ed515431 Binary files /dev/null and b/frontend-dist/favicon-96x96.26e08763.png differ diff --git a/frontend-dist/favicon_unsaturated.c11d4d33.svg b/frontend-dist/favicon_unsaturated.c11d4d33.svg new file mode 100644 index 000000000..af7c24856 --- /dev/null +++ b/frontend-dist/favicon_unsaturated.c11d4d33.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/frontend-dist/firebase-app.fe96ed86.js b/frontend-dist/firebase-app.fe96ed86.js new file mode 100644 index 000000000..aaee7854e --- /dev/null +++ b/frontend-dist/firebase-app.fe96ed86.js @@ -0,0 +1,181 @@ +var e=globalThis;function t(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var r=e.parcelRequire94c2;(0,r.register)("8WRsO",function(n,a){let i,s,o;t(n.exports,"FirebaseError",()=>S),t(n.exports,"_DEFAULT_ENTRY_NAME",()=>et),t(n.exports,"_apps",()=>en),t(n.exports,"_components",()=>ea),t(n.exports,"_addComponent",()=>ei),t(n.exports,"_addOrOverwriteComponent",()=>es),t(n.exports,"_registerComponent",()=>eo),t(n.exports,"_getProvider",()=>el),t(n.exports,"_removeServiceInstance",()=>ec),t(n.exports,"_clearComponents",()=>eh),t(n.exports,"SDK_VERSION",()=>ep),t(n.exports,"initializeApp",()=>ef),t(n.exports,"getApp",()=>eg),t(n.exports,"getApps",()=>em),t(n.exports,"deleteApp",()=>eb),t(n.exports,"registerVersion",()=>ev),t(n.exports,"onLog",()=>e_),t(n.exports,"setLogLevel",()=>eE);/** + * @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. + */var l,c,h=r("fnbc9");let d=function(e){let t=[],r=0;for(let n=0;n>6|192:((64512&a)==55296&&n+1>18|240,t[r++]=a>>12&63|128):t[r++]=a>>12|224,t[r++]=a>>6&63|128),t[r++]=63&a|128)}return t},u=function(e){let t=[],r=0,n=0;for(;r191&&a<224){let i=e[r++];t[n++]=String.fromCharCode((31&a)<<6|63&i)}else if(a>239&&a<365){let i=((7&a)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++])-65536;t[n++]=String.fromCharCode(55296+(i>>10)),t[n++]=String.fromCharCode(56320+(1023&i))}else{let i=e[r++],s=e[r++];t[n++]=String.fromCharCode((15&a)<<12|(63&i)<<6|63&s)}}return t.join("")},p={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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();let r=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let t=0;t>2,h=(3&a)<<4|s>>4,d=(15&s)<<2|l>>6,u=63&l;o||(u=64,i||(d=64)),n.push(r[c],r[h],r[d],r[u])}return n.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(d(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):u(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let r=t?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let t=0;t>4;if(n.push(l),64!==s){let e=i<<4&240|s>>2;if(n.push(e),64!==o){let e=s<<6&192|o;n.push(e)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class f extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}let g=function(e){let t=d(e);return p.encodeByteArray(t,!0)},m=function(e){return g(e).replace(/\./g,"")},b=function(e){try{return p.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null},v=()=>/** + * @license + * Copyright 2022 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(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw Error("Unable to locate global object.")})().__FIREBASE_DEFAULTS__,_=()=>{if(void 0===h||void 0===h.env)return;let e=void 0;if(e)return JSON.parse(e)},E=()=>{let e;if("undefined"==typeof document)return;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}let t=e&&b(e[1]);return t&&JSON.parse(t)},y=()=>{try{return v()||_()||E()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},w=()=>{var e;return null===(e=y())||void 0===e?void 0:e.config};/** + * @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,r)=>{t?this.reject(t):this.resolve(r),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,r))}}}class S extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name="FirebaseError",Object.setPrototypeOf(this,S.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,D.prototype.create)}}class D{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){let r=t[0]||{},n=`${this.service}/${e}`,a=this.errors[e],i=a?a.replace(C,(e,t)=>{let n=r[t];return null!=n?String(n):`<${t}?>`}):"Error",s=`${this.serviceName}: ${i} (${n}).`;return new S(n,s,r)}}let C=/\{\$([^}]+)}/g;function A(e,t){if(e===t)return!0;let r=Object.keys(e),n=Object.keys(t);for(let a of r){if(!n.includes(a))return!1;let r=e[a],i=t[a];if(O(r)&&O(i)){if(!A(r,i))return!1}else if(r!==i)return!1}for(let e of n)if(!r.includes(e))return!1;return!0}function O(e){return null!==e&&"object"==typeof e}class L{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,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. + */let B="[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 N{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){let t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){let e=new I;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{let r=this.getOrInitializeService({instanceIdentifier:t});r&&e.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;let r=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),n=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(e){if(n)return null;throw e}else{if(n)return null;throw Error(`Service ${this.name} is not available`)}}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("EAGER"===e.instantiationMode)try{this.getOrInitializeService({instanceIdentifier:B})}catch(e){}for(let[e,t]of this.instancesDeferred.entries()){let r=this.normalizeInstanceIdentifier(e);try{let e=this.getOrInitializeService({instanceIdentifier:r});t.resolve(e)}catch(e){}}}}clearInstance(e=B){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){let 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=B){return this.instances.has(e)}getOptions(e=B){return this.instancesOptions.get(e)||{}}initialize(e={}){let{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);let n=this.getOrInitializeService({instanceIdentifier:r,options:t});for(let[e,t]of this.instancesDeferred.entries())r===this.normalizeInstanceIdentifier(e)&&t.resolve(n);return n}onInit(e,t){var r;let n=this.normalizeInstanceIdentifier(t),a=null!==(r=this.onInitCallbacks.get(n))&&void 0!==r?r:new Set;a.add(e),this.onInitCallbacks.set(n,a);let i=this.instances.get(n);return i&&e(i,n),()=>{a.delete(e)}}invokeOnInitCallbacks(e,t){let r=this.onInitCallbacks.get(t);if(r)for(let n of r)try{n(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:e===B?void 0:e,options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch(e){}return r||null}normalizeInstanceIdentifier(e=B){return this.component?this.component.multipleInstances?e:B:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.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. + */class T{constructor(e){this.name=e,this.providers=new Map}addComponent(e){let t=this.getProvider(e.name);if(t.isComponentSet())throw 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);let t=new N(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. + */let M=[];(l=c||(c={}))[l.DEBUG=0]="DEBUG",l[l.VERBOSE=1]="VERBOSE",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.SILENT=5]="SILENT";let R={debug:c.DEBUG,verbose:c.VERBOSE,info:c.INFO,warn:c.WARN,error:c.ERROR,silent:c.SILENT},P=c.INFO,x={[c.DEBUG]:"log",[c.VERBOSE]:"log",[c.INFO]:"info",[c.WARN]:"warn",[c.ERROR]:"error"},H=(e,t,...r)=>{if(tt.some(t=>e instanceof t),k=new WeakMap,j=new WeakMap,V=new WeakMap,F=new WeakMap,z=new WeakMap,W={get(e,t,r){if(e instanceof IDBTransaction){if("done"===t)return j.get(e);if("objectStoreNames"===t)return e.objectStoreNames||V.get(e);if("store"===t)return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return U(e[t])},set:(e,t,r)=>(e[t]=r,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function U(e){var t;if(e instanceof IDBRequest)return function(e){let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",i)},a=()=>{t(U(e.result)),n()},i=()=>{r(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",i)});return t.then(t=>{t instanceof IDBCursor&&k.set(t,e)}).catch(()=>{}),z.set(t,e),t}(e);if(F.has(e))return F.get(e);let r="function"==typeof(t=e)?t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(s||(s=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(G(this),e),U(k.get(this))}:function(...e){return U(t.apply(G(this),e))}:function(e,...r){let n=t.call(G(this),e,...r);return V.set(n,e.sort?e.sort():[e]),U(n)}:(t instanceof IDBTransaction&&function(e){if(j.has(e))return;let t=new Promise((t,r)=>{let n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",i),e.removeEventListener("abort",i)},a=()=>{t(),n()},i=()=>{r(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",i),e.addEventListener("abort",i)});j.set(e,t)}(t),$(t,i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(t,W):t;return r!==e&&(F.set(e,r),z.set(r,e)),r}let G=e=>z.get(e),J=["get","getKey","getAll","getAllKeys","count"],K=["put","add","delete","clear"],q=new Map;function Y(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(q.get(t))return q.get(t);let r=t.replace(/FromIndex$/,""),n=t!==r,a=K.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(a||J.includes(r)))return;let i=async function(e,...t){let i=this.transaction(e,a?"readwrite":"readonly"),s=i.store;return n&&(s=s.index(t.shift())),(await Promise.all([s[r](...t),a&&i.done]))[0]};return q.set(t,i),i}W={...o=W,get:(e,t,r)=>Y(e,t)||o.get(e,t,r),has:(e,t)=>!!Y(e,t)||o.has(e,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. + */class X{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(!function(e){let t=e.getComponent();return(null==t?void 0:t.type)==="VERSION"}(e))return null;{let t=e.getImmediate();return`${t.library}/${t.version}`}}).filter(e=>e).join(" ")}}let Z="https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js",Q="0.9.27",ee=new class{constructor(e){this.name=e,this._logLevel=P,this._logHandler=H,this._userLogHandler=null,M.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in c))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?R[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw 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,c.DEBUG,...e),this._logHandler(this,c.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,c.VERBOSE,...e),this._logHandler(this,c.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,c.INFO,...e),this._logHandler(this,c.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,c.WARN,...e),this._logHandler(this,c.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,c.ERROR,...e),this._logHandler(this,c.ERROR,...e)}}("https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js"),et="[DEFAULT]",er={[Z]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-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"},en=new Map,ea=new Map;function ei(e,t){try{e.container.addComponent(t)}catch(r){ee.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,r)}}function es(e,t){e.container.addOrOverwriteComponent(t)}function eo(e){let t=e.name;if(ea.has(t))return ee.debug(`There were multiple attempts to register component ${t}.`),!1;for(let r of(ea.set(t,e),en.values()))ei(r,e);return!0}function el(e,t){let r=e.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),e.container.getProvider(t)}function ec(e,t,r=et){el(e,t).clearInstance(r)}function eh(){ea.clear()}let ed=new D("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","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","no-options":"Need to provide options, when not being deployed to hosting via source.","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.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."});/** + * @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 eu{constructor(e,t,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,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 ed.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. + */let ep="10.8.0";function ef(e,t={}){let r=e;"object"!=typeof t&&(t={name:t});let n=Object.assign({name:et,automaticDataCollectionEnabled:!1},t),a=n.name;if("string"!=typeof a||!a)throw ed.create("bad-app-name",{appName:String(a)});if(r||(r=w()),!r)throw ed.create("no-options");let i=en.get(a);if(i){if(A(r,i.options)&&A(n,i.config))return i;throw ed.create("duplicate-app",{appName:a})}let s=new T(a);for(let e of ea.values())s.addComponent(e);let o=new eu(r,n,s);return en.set(a,o),o}function eg(e=et){let t=en.get(e);if(!t&&e===et&&w())return ef();if(!t)throw ed.create("no-app",{appName:e});return t}function em(){return Array.from(en.values())}async function eb(e){let t=e.name;en.has(t)&&(en.delete(t),await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function ev(e,t,r){var n;let a=null!==(n=er[e])&&void 0!==n?n:e;r&&(a+=`-${r}`);let i=a.match(/\s|\//),s=t.match(/\s|\//);if(i||s){let e=[`Unable to register library "${a}" with version "${t}":`];i&&e.push(`library name "${a}" contains illegal characters (whitespace or "/")`),i&&s&&e.push("and"),s&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),ee.warn(e.join(" "));return}eo(new L(`${a}-version`,()=>({library:a,version:t}),"VERSION"))}function e_(e,t){if(null!==e&&"function"!=typeof e)throw ed.create("invalid-log-argument");!function(e,t){for(let r of M){let n=null;t&&t.level&&(n=R[t.level]),null===e?r.userLogHandler=null:r.userLogHandler=(t,r,...a)=>{let i=a.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(" ");r>=(null!=n?n:t.logLevel)&&e({level:c[r].toLowerCase(),message:i,args:a,type:t.name})}}}(e,t)}function eE(e){M.forEach(t=>{t.setLogLevel(e)})}let ey="firebase-heartbeat-store",ew=null;function eI(){return ew||(ew=(function(e,t,{blocked:r,upgrade:n,blocking:a,terminated:i}={}){let s=indexedDB.open(e,1),o=U(s);return n&&s.addEventListener("upgradeneeded",e=>{n(U(s.result),e.oldVersion,e.newVersion,U(s.transaction),e)}),r&&s.addEventListener("blocked",e=>r(e.oldVersion,e.newVersion,e)),o.then(e=>{i&&e.addEventListener("close",()=>i()),a&&e.addEventListener("versionchange",e=>a(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o})("firebase-heartbeat-database",0,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(ey)}catch(e){console.warn(e)}}}).catch(e=>{throw ed.create("idb-open",{originalErrorMessage:e.message})})),ew}async function eS(e){try{let t=(await eI()).transaction(ey),r=await t.objectStore(ey).get(eC(e));return await t.done,r}catch(e){if(e instanceof S)ee.warn(e.message);else{let t=ed.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});ee.warn(t.message)}}}async function eD(e,t){try{let r=(await eI()).transaction(ey,"readwrite"),n=r.objectStore(ey);await n.put(t,eC(e)),await r.done}catch(e){if(e instanceof S)ee.warn(e.message);else{let t=ed.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});ee.warn(t.message)}}}function eC(e){return`${e.name}!${e.options.appId}`}class eA{constructor(e){this.container=e,this._heartbeatsCache=null;let t=this.container.getProvider("app").getImmediate();this._storage=new eL(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;let r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),n=eO();return(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)==null)?void 0:this._heartbeatsCache.lastSentHeartbeatDate===n||this._heartbeatsCache.heartbeats.some(e=>e.date===n)?void 0:(this._heartbeatsCache.heartbeats.push({date:n,agent:r}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{let t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache))}async getHeartbeatsHeader(){var e;if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)==null||0===this._heartbeatsCache.heartbeats.length)return"";let t=eO(),{heartbeatsToSend:r,unsentEntries:n}=function(e,t=1024){let r=[],n=e.slice();for(let a of e){let e=r.find(e=>e.agent===a.agent);if(e){if(e.dates.push(a.date),eB(r)>t){e.dates.pop();break}}else if(r.push({agent:a.agent,dates:[a.date]}),eB(r)>t){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}(this._heartbeatsCache.heartbeats),a=m(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}}function eO(){return new Date().toISOString().substring(0,10)}class eL{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!function(){try{return"object"==typeof indexedDB}catch(e){return!1}}()&&new Promise((e,t)=>{try{let r=!0,n="validate-browser-context-for-indexeddb-analytics-module",a=self.indexedDB.open(n);a.onsuccess=()=>{a.result.close(),r||self.indexedDB.deleteDatabase(n),e(!0)},a.onupgradeneeded=()=>{r=!1},a.onerror=()=>{var e;t((null===(e=a.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}}).then(()=>!0).catch(()=>!1)}async read(){if(!await this._canUseIndexedDBPromise)return{heartbeats:[]};{let e=await eS(this.app);return(null==e?void 0:e.heartbeats)?e:{heartbeats:[]}}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){let r=await this.read();return eD(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){let r=await this.read();return eD(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}}}function eB(e){return m(JSON.stringify({version:2,heartbeats:e})).length}eo(new L("platform-logger",e=>new X(e),"PRIVATE")),eo(new L("heartbeat",e=>new eA(e),"PRIVATE")),ev(Z,Q,""),ev(Z,Q,"esm2017"),ev("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. + */ev("firebase","10.8.0","cdn")}); \ No newline at end of file diff --git a/frontend-dist/firebase-firestore.2ca21bf2.js b/frontend-dist/firebase-firestore.2ca21bf2.js new file mode 100644 index 000000000..22a2e4300 --- /dev/null +++ b/frontend-dist/firebase-firestore.2ca21bf2.js @@ -0,0 +1,8 @@ +var e=globalThis;function t(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}var n=e.parcelRequire94c2;(0,n.register)("4rxkr",function(r,i){t(r.exports,"setLogLevel",()=>re),t(r.exports,"_logWarn",()=>rr),t(r.exports,"_debugAssert",()=>ra),t(r.exports,"FirestoreError",()=>rl),t(r.exports,"_EmptyAuthCredentialsProvider",()=>rc),t(r.exports,"_EmptyAppCheckTokenProvider",()=>rw),t(r.exports,"_AutoId",()=>rv),t(r.exports,"Timestamp",()=>r_),t(r.exports,"_FieldPath",()=>rC),t(r.exports,"_DocumentKey",()=>rD),t(r.exports,"_isBase64Available",()=>ik),t(r.exports,"_ByteString",()=>iR),t(r.exports,"_DatabaseId",()=>iU),t(r.exports,"_validateIsNotUsedTogether",()=>hK),t(r.exports,"_cast",()=>hW),t(r.exports,"connectFirestoreEmulator",()=>hZ),t(r.exports,"Query",()=>h0),t(r.exports,"DocumentReference",()=>h1),t(r.exports,"CollectionReference",()=>h2),t(r.exports,"collection",()=>h5),t(r.exports,"collectionGroup",()=>h6),t(r.exports,"doc",()=>h3),t(r.exports,"refEqual",()=>h4),t(r.exports,"queryEqual",()=>h8),t(r.exports,"LoadBundleTask",()=>ce),t(r.exports,"CACHE_SIZE_UNLIMITED",()=>ct),t(r.exports,"Firestore",()=>cn),t(r.exports,"initializeFirestore",()=>cr),t(r.exports,"getFirestore",()=>ci),t(r.exports,"ensureFirestoreConfigured",()=>cs),t(r.exports,"enableIndexedDbPersistence",()=>co),t(r.exports,"enableMultiTabIndexedDbPersistence",()=>cl),t(r.exports,"clearIndexedDbPersistence",()=>ch),t(r.exports,"waitForPendingWrites",()=>cc),t(r.exports,"enableNetwork",()=>cf),t(r.exports,"disableNetwork",()=>cd),t(r.exports,"terminate",()=>cg),t(r.exports,"loadBundle",()=>cm),t(r.exports,"namedQuery",()=>cp),t(r.exports,"AggregateField",()=>cw),t(r.exports,"AggregateQuerySnapshot",()=>cv),t(r.exports,"Bytes",()=>cb),t(r.exports,"FieldPath",()=>cx),t(r.exports,"documentId",()=>c_),t(r.exports,"FieldValue",()=>cI),t(r.exports,"GeoPoint",()=>cE),t(r.exports,"QueryConstraint",()=>c2),t(r.exports,"query",()=>c5),t(r.exports,"QueryCompositeFilterConstraint",()=>c4),t(r.exports,"QueryFieldFilterConstraint",()=>c6),t(r.exports,"where",()=>c3),t(r.exports,"or",()=>c8),t(r.exports,"and",()=>c9),t(r.exports,"QueryOrderByConstraint",()=>c7),t(r.exports,"orderBy",()=>fe),t(r.exports,"QueryLimitConstraint",()=>ft),t(r.exports,"limit",()=>fn),t(r.exports,"limitToLast",()=>fr),t(r.exports,"QueryStartAtConstraint",()=>fi),t(r.exports,"startAt",()=>fs),t(r.exports,"startAfter",()=>fa),t(r.exports,"QueryEndAtConstraint",()=>fo),t(r.exports,"endBefore",()=>fl),t(r.exports,"endAt",()=>fu),t(r.exports,"AbstractUserDataWriter",()=>fm),t(r.exports,"sum",()=>fw),t(r.exports,"average",()=>fv),t(r.exports,"count",()=>fb),t(r.exports,"aggregateFieldEqual",()=>fx),t(r.exports,"aggregateQuerySnapshotEqual",()=>f_),t(r.exports,"SnapshotMetadata",()=>fI),t(r.exports,"DocumentSnapshot",()=>fE),t(r.exports,"QueryDocumentSnapshot",()=>fT),t(r.exports,"QuerySnapshot",()=>fS),t(r.exports,"snapshotEqual",()=>fC),t(r.exports,"getDoc",()=>fD),t(r.exports,"getDocFromCache",()=>fN),t(r.exports,"getDocFromServer",()=>fk),t(r.exports,"getDocs",()=>fR),t(r.exports,"getDocsFromCache",()=>fM),t(r.exports,"getDocsFromServer",()=>fL),t(r.exports,"setDoc",()=>fO),t(r.exports,"executeWrite",()=>fU),t(r.exports,"updateDoc",()=>fP),t(r.exports,"deleteDoc",()=>fF),t(r.exports,"addDoc",()=>fV),t(r.exports,"onSnapshot",()=>fq),t(r.exports,"onSnapshotsInSync",()=>fB),t(r.exports,"getCountFromServer",()=>fG),t(r.exports,"getAggregateFromServer",()=>fj),t(r.exports,"persistentSingleTabManager",()=>f1),t(r.exports,"memoryEagerGarbageCollector",()=>fW),t(r.exports,"memoryLruGarbageCollector",()=>fY),t(r.exports,"memoryLocalCache",()=>fX),t(r.exports,"persistentLocalCache",()=>fJ),t(r.exports,"persistentMultipleTabManager",()=>f2),t(r.exports,"WriteBatch",()=>f6),t(r.exports,"Transaction",()=>f4),t(r.exports,"runTransaction",()=>f8),t(r.exports,"deleteField",()=>f9),t(r.exports,"serverTimestamp",()=>f7),t(r.exports,"arrayUnion",()=>de),t(r.exports,"arrayRemove",()=>dt),t(r.exports,"increment",()=>dn),t(r.exports,"writeBatch",()=>dr),t(r.exports,"setIndexConfiguration",()=>di),t(r.exports,"PersistentCacheIndexManager",()=>da),t(r.exports,"getPersistentCacheIndexManager",()=>dl),t(r.exports,"enablePersistentCacheIndexAutoCreation",()=>du),t(r.exports,"disablePersistentCacheIndexAutoCreation",()=>dh),t(r.exports,"deleteAllPersistentCacheIndexes",()=>dc),t(r.exports,"_TestingHooks",()=>dg);var s,a,o,l=n("8WRsO"),u=n("fnbc9");let h=function(e){let t=[],n=0;for(let r=0;r>6|192:(55296==(64512&i)&&r+1>18|240,t[n++]=i>>12&63|128):t[n++]=i>>12|224,t[n++]=i>>6&63|128),t[n++]=63&i|128)}return t},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(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();let n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t>2,h=(3&i)<<4|a>>4,c=(15&a)<<2|l>>6,f=63&l;o||(f=64,s||(c=64)),r.push(n[u],n[h],n[c],n[f])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(h(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){let t=[],n=0,r=0;for(;n191&&i<224){let s=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){let s=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(s>>10)),t[r++]=String.fromCharCode(56320+(1023&s))}else{let s=e[n++],a=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&a)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();let n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t>4;if(r.push(l),64!==a){let e=s<<4&240|a>>2;if(r.push(e),64!==o){let e=a<<6&192|o;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class f extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}let d=function(e){return(function(e){let t=h(e);return c.encodeByteArray(t,!0)})(e).replace(/\./g,"")},g=()=>(function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw Error("Unable to locate global object.")})().__FIREBASE_DEFAULTS__,m=()=>{let e;if("undefined"==typeof document)return;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}let t=e&&function(e){try{return c.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null}(e[1]);return t&&JSON.parse(t)},p=()=>{try{return g()||(()=>{if(void 0===u||void 0===u.env)return;let e=void 0;return e?JSON.parse(e):void 0})()||m()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},y=e=>{var t,n;let r=null===(n=null===(t=p())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e];if(!r)return;let i=r.lastIndexOf(":");if(i<=0||i+1===r.length)throw Error(`Invalid host ${r} with no separate hostname and port!`);let s=parseInt(r.substring(i+1),10);return"["===r[0]?[r.substring(1,i-1),s]:[r.substring(0,i),s]};function w(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function v(){return!function(){var t;let n=null===(t=p())||void 0===t?void 0:t.forceEnvironment;if("node"===n)return!0;if("browser"===n)return!1;try{return"[object process]"===Object.prototype.toString.call(e.process)}catch(e){return!1}}()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}class b extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,b.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,x.prototype.create)}}class x{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){let n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],s=i?i.replace(_,(e,t)=>{let r=n[t];return null!=r?String(r):`<${t}?>`}):"Error",a=`${this.serviceName}: ${s} (${r}).`;return new b(r,a,n)}}let _=/\{\$([^}]+)}/g;function I(e,t){if(e===t)return!0;let n=Object.keys(e),r=Object.keys(t);for(let i of n){if(!r.includes(i))return!1;let n=e[i],s=t[i];if(E(n)&&E(s)){if(!I(n,s))return!1}else if(n!==s)return!1}for(let e of r)if(!n.includes(e))return!1;return!0}function E(e){return null!==e&&"object"==typeof e}function T(e){return e&&e._delegate?e._delegate:e}class S{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}}(k=R||(R={}))[k.DEBUG=0]="DEBUG",k[k.VERBOSE=1]="VERBOSE",k[k.INFO=2]="INFO",k[k.WARN=3]="WARN",k[k.ERROR=4]="ERROR",k[k.SILENT=5]="SILENT";let C={debug:R.DEBUG,verbose:R.VERBOSE,info:R.INFO,warn:R.WARN,error:R.ERROR,silent:R.SILENT},D=R.INFO,A={[R.DEBUG]:"log",[R.VERBOSE]:"log",[R.INFO]:"info",[R.WARN]:"warn",[R.ERROR]:"error"},N=(e,t,...n)=>{if(t{};O.addEventListener("test",e,t),O.removeEventListener("test",e,t)}catch(e){}return e}();function W(e){return/^[\s\xa0]*$/.test(e)}function Y(){var e=O.navigator;return e&&(e=e.userAgent)?e:""}function X(e){return -1!=Y().indexOf(e)}function J(e){return J[" "](e),e}J[" "]=function(){};var Z,ee,et=X("Opera"),en=X("Trident")||X("MSIE"),er=X("Edge"),ei=er||en,es=X("Gecko")&&!(-1!=Y().toLowerCase().indexOf("webkit")&&!X("Edge"))&&!(X("Trident")||X("MSIE"))&&!X("Edge"),ea=-1!=Y().toLowerCase().indexOf("webkit")&&!X("Edge");function eo(){var e=O.document;return e?e.documentMode:void 0}e:{var el="",eu=(ee=Y(),es?/rv:([^\);]+)(\)|;)/.exec(ee):er?/Edge\/([\d\.]+)/.exec(ee):en?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(ee):ea?/WebKit\/(\S+)/.exec(ee):et?/(?:Version)[ \/]?(\S+)/.exec(ee):void 0);if(eu&&(el=eu?eu[1]:""),en){var eh=eo();if(null!=eh&&eh>parseFloat(el)){Z=String(eh);break e}}Z=el}var ec=O.document&&en&&(eo()||parseInt(Z,10))||void 0;function ef(e,t){if(Q.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(es){e:{try{J(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:ed[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&ef.$.h.call(this)}}z(ef,Q);var ed={2:"touch",3:"pen",4:"mouse"};ef.prototype.h=function(){ef.$.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var eg="closure_listenable_"+(1e6*Math.random()|0),em=0;function ep(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.la=i,this.key=++em,this.fa=this.ia=!1}function ey(e){e.fa=!0,e.listener=null,e.proxy=null,e.src=null,e.la=null}function ew(e,t,n){for(let r in e)t.call(n,e[r],r,e)}function ev(e){let t={};for(let n in e)t[n]=e[n];return t}let eb="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function ex(e,t){let n,r;for(let t=1;t>>0);function eM(e){return"function"==typeof e?e:(e[eR]||(e[eR]=function(t){return e.handleEvent(t)}),e[eR])}function eL(){G.call(this),this.i=new e_(this),this.S=this,this.J=null}function eO(e,t){var n,r=e.J;if(r)for(n=[];r;r=r.J)n.push(r);if(e=e.S,r=t.type||t,"string"==typeof t)t=new Q(t,e);else if(t instanceof Q)t.target=t.target||e;else{var i=t;ex(t=new Q(r,e),i)}if(i=!0,n)for(var s=n.length-1;0<=s;s--){var a=t.g=n[s];i=eP(a,r,!0,t)&&i}if(i=eP(a=t.g=e,r,!0,t)&&i,i=eP(a,r,!1,t)&&i,n)for(s=0;snew eq,e=>e.reset());class eq{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let eB,eU=!1,ez=new class{constructor(){this.h=this.g=null}add(e,t){let n=eV.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},eG=()=>{let e=O.Promise.resolve(void 0);eB=()=>{e.then(ej)}};var ej=()=>{let e;for(var t;e=null,ez.g&&(e=ez.g,ez.g=ez.g.next,ez.g||(ez.h=null),e.next=null),t=e;){try{t.h.call(t.g)}catch(e){!function(e){O.setTimeout(()=>{throw e},0)}(e)}eV.j(t),100>eV.h&&(eV.h++,t.next=eV.g,eV.g=t)}eU=!1};function eK(e,t){eL.call(this),this.h=e||1,this.g=t||O,this.j=B(this.qb,this),this.l=Date.now()}function e$(e){e.ga=!1,e.T&&(e.g.clearTimeout(e.T),e.T=null)}function eQ(e,t,n){if("function"==typeof e)n&&(e=B(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=B(e.handleEvent,e)}return 0x7fffffff{t.g=null,t.i&&(t.i=!1,e(t))},t.j);let n=t.h;t.h=null,t.m.apply(null,n)}(this)}N(){super.N(),this.g&&(O.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function eW(e){G.call(this),this.h=e,this.g={}}z(eW,G);var eY=[];function eX(e,t,n,r){Array.isArray(n)||(n&&(eY[0]=n.toString()),n=eY);for(var i=0;ir.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var a=1;at.length?tg:(t=t.slice(r,r+n),e.o=r+n,t)}(e,n))==tg){4==t&&(e.s=4,e8(14),i=!1),e0(e.j,e.m,null,"[Incomplete Response]");break}if(r==td){e.s=4,e8(15),e0(e.j,e.m,n,"[Invalid Chunk]"),i=!1;break}e0(e.j,e.m,r,null),tE(e,r)}ty(e)&&0!=e.o&&(e.h.g=e.h.g.slice(e.o),e.o=0),4!=t||0!=n.length||e.h.h||(e.s=1,e8(16),i=!1),e.i=e.i&&i,i?0i[2]&&n.G&&0==n.A&&!n.v&&(n.v=e7(B(n.ib,n),6e3));if(1>=tX(n.i)&&n.oa){try{n.oa()}catch(e){}n.oa=void 0}}else nN(n,11)}else if((e.K||n.g==e)&&nC(n),!W(t))for(i=n.Ja.g.parse(t),t=0;th)&&(3!=h||ei||this.g&&(this.h.h||this.g.ja()||nc(this.g)))){this.J||4!=h||7==t||e3(),tx(this);var n=this.g.da();this.ca=n;t:if(ty(this)){var r=nc(this.g);e="";var i=r.length,s=4==nh(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){tI(this),t_(this);var a="";break t}this.h.i=new O.TextDecoder}for(t=0;tt)throw Error("Bad port number "+t);e.m=t}else e.m=null}function tk(e,t,n){var r,i;t instanceof tz?(e.i=t,r=e.i,(i=e.h)&&!r.j&&(tG(r),r.i=null,r.g.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(tj(this,t),t$(this,n,e))},r)),r.j=i):(n||(t=tO(t,tB)),e.i=new tz(t,e.h))}function tR(e,t,n){e.i.set(t,n)}function tM(e){return tR(e,"zx",Math.floor(0x80000000*Math.random()).toString(36)+Math.abs(Math.floor(0x80000000*Math.random())^Date.now()).toString(36)),e}function tL(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function tO(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,tP),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function tP(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}tC.prototype.toString=function(){var e=[],t=this.j;t&&e.push(tO(t,tF,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(tO(t,tF,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(tO(n,"/"==n.charAt(0)?tq:tV,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.o)&&e.push("#",tO(n,tU)),e.join("")};var tF=/[#\/\?@]/g,tV=/[#\?:]/g,tq=/[#\?]/g,tB=/[#\?@]/g,tU=/#/g;function tz(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function tG(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n=e.j}function tX(e){return e.h?1:e.g?e.g.size:0}function tJ(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function tZ(e,t){e.g?e.g.add(t):e.h=t}function t0(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function t1(e){if(null!=e.h)return e.i.concat(e.h.F);if(null!=e.g&&0!==e.g.size){let t=e.i;for(let n of e.g.values())t=t.concat(n.F);return t}return K(e.i)}function t2(){this.g=new class{stringify(e){return O.JSON.stringify(e,void 0)}parse(e){return O.JSON.parse(e,void 0)}}}function t5(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}function t6(e){this.l=e.ec||null,this.j=e.ob||!1}function t3(e,t){eL.call(this),this.F=e,this.u=t,this.m=void 0,this.readyState=t4,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}tH.prototype.cancel=function(){if(this.i=t1(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(let e of this.g.values())e.cancel();this.g.clear()}},z(t6,tn),t6.prototype.g=function(){return new t3(this.l,this.j)},t6.prototype.i=(s={},function(){return s}),z(t3,eL);var t4=0;function t8(e){e.j.read().then(e.Xa.bind(e)).catch(e.ka.bind(e))}function t9(e){e.readyState=4,e.l=null,e.j=null,e.A=null,t7(e)}function t7(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(M=t3.prototype).open=function(e,t){if(this.readyState!=t4)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,t7(this)},M.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;let t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.F||O).fetch(new Request(this.B,t)).then(this.$a.bind(this),this.ka.bind(this))},M.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,t9(this)),this.readyState=t4},M.$a=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,t7(this)),this.g&&(this.readyState=3,t7(this),this.g))){if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(void 0!==O.ReadableStream&&"body"in e){if(this.j=e.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;t8(this)}else e.text().then(this.Za.bind(this),this.ka.bind(this))}},M.Xa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?t9(this):t7(this),3==this.readyState&&t8(this)}},M.Za=function(e){this.g&&(this.response=this.responseText=e,t9(this))},M.Ya=function(e){this.g&&(this.response=e,t9(this))},M.ka=function(){this.g&&t9(this)},M.setRequestHeader=function(e,t){this.v.append(e,t)},M.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},M.getAllResponseHeaders=function(){if(!this.h)return"";let e=[],t=this.h.entries();for(var n=t.next();!n.done;)e.push((n=n.value)[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(t3.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var ne=O.JSON.parse;function nt(e){eL.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=nn,this.L=this.M=!1}z(nt,eL);var nn="",nr=/^https?$/i,ni=["POST","PUT"];function ns(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,na(e),nl(e)}function na(e){e.F||(e.F=!0,eO(e,"complete"),eO(e,"error"))}function no(e){if(e.h&&void 0!==L&&(!e.C[1]||4!=nh(e)||2!=e.da())){if(e.v&&4==nh(e))eQ(e.La,0,e);else if(eO(e,"readystatechange"),4==nh(e)){e.h=!1;try{let a=e.da();switch(a){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t,n,r=!0;break;default:r=!1}if(!(t=r)){if(n=0===a){var i=String(e.I).match(tS)[1]||null;!i&&O.self&&O.self.location&&(i=O.self.location.protocol.slice(0,-1)),n=!nr.test(i?i.toLowerCase():"")}t=n}if(t)eO(e,"complete"),eO(e,"success");else{e.m=6;try{var s=2{}:null;e.g=null,e.C=null,t||eO(e,"ready");try{n.onreadystatechange=r}catch(e){}}}function nu(e){e.g&&e.L&&(e.g.ontimeout=null),e.A&&(O.clearTimeout(e.A),e.A=null)}function nh(e){return e.g?e.g.readyState:0}function nc(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.K){case nn:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function nf(e){let t="";return ew(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function nd(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=nf(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):tR(e,t,n))}function ng(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function nm(e){this.Ga=0,this.j=[],this.l=new eZ,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=ng("failFast",!1,e),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=ng("baseRetryDelayMs",5e3,e),this.hb=ng("retryDelaySeedMs",1e4,e),this.eb=ng("forwardChannelMaxRetries",2,e),this.xa=ng("forwardChannelRequestTimeoutMs",2e4,e),this.va=e&&e.xmlHttpFactory||void 0,this.Ha=e&&e.useFetchStreams||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.i=new tH(e&&e.concurrentRequestLimit),this.Ja=new t2,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=e&&e.bc||!1,e&&e.Ea&&this.l.Ea(),e&&e.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&e&&e.detectBufferingProxy||!1,this.qa=void 0,e&&e.longPollingTimeout&&0(n-=t))t=Math.max(0,i[a].g-100),s=!1;else try{!function(e,t,n){let r=n||"";try{tT(e,function(e,n){let i=e;F(e)&&(i=eF(e)),t.push(r+n+"="+encodeURIComponent(i))})}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}(o,e,"req"+n+"_")}catch(e){r&&r(o)}}if(s){r=e.join("&");break e}}}return e=e.j.splice(0,n),t.F=e,r}function nI(e){if(!e.g&&!e.u){e.ba=1;var t=e.Ma;eB||eG(),eU||(eB(),eU=!0),ez.add(t,e),e.A=0}}function nE(e){return!(e.g||e.u||3<=e.A)&&(e.ba++,e.u=e7(B(e.Ma,e),nA(e,e.A)),e.A++,!0)}function nT(e){null!=e.B&&(O.clearTimeout(e.B),e.B=null)}function nS(e){e.g=new th(e,e.l,"rpc",e.ba),null===e.o&&(e.g.I=e.s),e.g.O=0;var t=tD(e.wa);tR(t,"RID","rpc"),tR(t,"SID",e.K),tR(t,"AID",e.V),tR(t,"CI",e.G?"0":"1"),!e.G&&e.qa&&tR(t,"TO",e.qa),tR(t,"TYPE","xmlhttp"),nx(e,t),e.o&&e.s&&nd(t,e.o,e.s),e.L&&e.g.setTimeout(e.L);var n=e.g;e=e.pa,n.L=1,n.A=tM(tD(t)),n.u=null,n.S=!0,tp(n,e)}function nC(e){null!=e.v&&(O.clearTimeout(e.v),e.v=null)}function nD(e,t){var n=null;if(e.g==t){nC(e),nT(e),e.g=null;var r=2}else{if(!tJ(e.i,t))return;n=t.F,t0(e.i,t),r=1}if(0!=e.H){if(t.i){if(1==r){n=t.u?t.u.length:0,t=Date.now()-t.G;var i,s=e.C;eO(r=e5(),new e9(r,n)),nv(e)}else nI(e)}else if(3==(s=t.s)||0==s&&0=e.i.j-(e.m?1:0)||(e.m?(e.j=i.F.concat(e.j),0):1==e.H||2==e.H||e.C>=(e.cb?0:e.eb)||(e.m=e7(B(e.Na,e,i),nA(e,e.C)),e.C++,0))))||2==r&&nE(e)))switch(n&&0i;++i)r[i]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(i=0;16>i;++i)r[i]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],i=e.g[2];var s=e.g[3],a=t+(s^n&(i^s))+r[0]+0xd76aa478&0xffffffff;a=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=n+(a<<7&0xffffffff|a>>>25))+((a=s+(i^t&(n^i))+r[1]+0xe8c7b756&0xffffffff)<<12&0xffffffff|a>>>20))+((a=i+(n^s&(t^n))+r[2]+0x242070db&0xffffffff)<<17&0xffffffff|a>>>15))+((a=n+(t^i&(s^t))+r[3]+0xc1bdceee&0xffffffff)<<22&0xffffffff|a>>>10))+((a=t+(s^n&(i^s))+r[4]+0xf57c0faf&0xffffffff)<<7&0xffffffff|a>>>25))+((a=s+(i^t&(n^i))+r[5]+0x4787c62a&0xffffffff)<<12&0xffffffff|a>>>20))+((a=i+(n^s&(t^n))+r[6]+0xa8304613&0xffffffff)<<17&0xffffffff|a>>>15))+((a=n+(t^i&(s^t))+r[7]+0xfd469501&0xffffffff)<<22&0xffffffff|a>>>10))+((a=t+(s^n&(i^s))+r[8]+0x698098d8&0xffffffff)<<7&0xffffffff|a>>>25))+((a=s+(i^t&(n^i))+r[9]+0x8b44f7af&0xffffffff)<<12&0xffffffff|a>>>20))+((a=i+(n^s&(t^n))+r[10]+0xffff5bb1&0xffffffff)<<17&0xffffffff|a>>>15))+((a=n+(t^i&(s^t))+r[11]+0x895cd7be&0xffffffff)<<22&0xffffffff|a>>>10))+((a=t+(s^n&(i^s))+r[12]+0x6b901122&0xffffffff)<<7&0xffffffff|a>>>25))+((a=s+(i^t&(n^i))+r[13]+0xfd987193&0xffffffff)<<12&0xffffffff|a>>>20))+((a=i+(n^s&(t^n))+r[14]+0xa679438e&0xffffffff)<<17&0xffffffff|a>>>15))+((a=n+(t^i&(s^t))+r[15]+0x49b40821&0xffffffff)<<22&0xffffffff|a>>>10))+((a=t+(i^s&(n^i))+r[1]+0xf61e2562&0xffffffff)<<5&0xffffffff|a>>>27))+((a=s+(n^i&(t^n))+r[6]+0xc040b340&0xffffffff)<<9&0xffffffff|a>>>23))+((a=i+(t^n&(s^t))+r[11]+0x265e5a51&0xffffffff)<<14&0xffffffff|a>>>18))+((a=n+(s^t&(i^s))+r[0]+0xe9b6c7aa&0xffffffff)<<20&0xffffffff|a>>>12))+((a=t+(i^s&(n^i))+r[5]+0xd62f105d&0xffffffff)<<5&0xffffffff|a>>>27))+((a=s+(n^i&(t^n))+r[10]+0x2441453&0xffffffff)<<9&0xffffffff|a>>>23))+((a=i+(t^n&(s^t))+r[15]+0xd8a1e681&0xffffffff)<<14&0xffffffff|a>>>18))+((a=n+(s^t&(i^s))+r[4]+0xe7d3fbc8&0xffffffff)<<20&0xffffffff|a>>>12))+((a=t+(i^s&(n^i))+r[9]+0x21e1cde6&0xffffffff)<<5&0xffffffff|a>>>27))+((a=s+(n^i&(t^n))+r[14]+0xc33707d6&0xffffffff)<<9&0xffffffff|a>>>23))+((a=i+(t^n&(s^t))+r[3]+0xf4d50d87&0xffffffff)<<14&0xffffffff|a>>>18))+((a=n+(s^t&(i^s))+r[8]+0x455a14ed&0xffffffff)<<20&0xffffffff|a>>>12))+((a=t+(i^s&(n^i))+r[13]+0xa9e3e905&0xffffffff)<<5&0xffffffff|a>>>27))+((a=s+(n^i&(t^n))+r[2]+0xfcefa3f8&0xffffffff)<<9&0xffffffff|a>>>23))+((a=i+(t^n&(s^t))+r[7]+0x676f02d9&0xffffffff)<<14&0xffffffff|a>>>18))+((a=n+(s^t&(i^s))+r[12]+0x8d2a4c8a&0xffffffff)<<20&0xffffffff|a>>>12))+((a=t+(n^i^s)+r[5]+0xfffa3942&0xffffffff)<<4&0xffffffff|a>>>28))+((a=s+(t^n^i)+r[8]+0x8771f681&0xffffffff)<<11&0xffffffff|a>>>21))+((a=i+(s^t^n)+r[11]+0x6d9d6122&0xffffffff)<<16&0xffffffff|a>>>16))+((a=n+(i^s^t)+r[14]+0xfde5380c&0xffffffff)<<23&0xffffffff|a>>>9))+((a=t+(n^i^s)+r[1]+0xa4beea44&0xffffffff)<<4&0xffffffff|a>>>28))+((a=s+(t^n^i)+r[4]+0x4bdecfa9&0xffffffff)<<11&0xffffffff|a>>>21))+((a=i+(s^t^n)+r[7]+0xf6bb4b60&0xffffffff)<<16&0xffffffff|a>>>16))+((a=n+(i^s^t)+r[10]+0xbebfbc70&0xffffffff)<<23&0xffffffff|a>>>9))+((a=t+(n^i^s)+r[13]+0x289b7ec6&0xffffffff)<<4&0xffffffff|a>>>28))+((a=s+(t^n^i)+r[0]+0xeaa127fa&0xffffffff)<<11&0xffffffff|a>>>21))+((a=i+(s^t^n)+r[3]+0xd4ef3085&0xffffffff)<<16&0xffffffff|a>>>16))+((a=n+(i^s^t)+r[6]+0x4881d05&0xffffffff)<<23&0xffffffff|a>>>9))+((a=t+(n^i^s)+r[9]+0xd9d4d039&0xffffffff)<<4&0xffffffff|a>>>28))+((a=s+(t^n^i)+r[12]+0xe6db99e5&0xffffffff)<<11&0xffffffff|a>>>21))+((a=i+(s^t^n)+r[15]+0x1fa27cf8&0xffffffff)<<16&0xffffffff|a>>>16))+((a=n+(i^s^t)+r[2]+0xc4ac5665&0xffffffff)<<23&0xffffffff|a>>>9))+((a=t+(i^(n|~s))+r[0]+0xf4292244&0xffffffff)<<6&0xffffffff|a>>>26))+((a=s+(n^(t|~i))+r[7]+0x432aff97&0xffffffff)<<10&0xffffffff|a>>>22))+((a=i+(t^(s|~n))+r[14]+0xab9423a7&0xffffffff)<<15&0xffffffff|a>>>17))+((a=n+(s^(i|~t))+r[5]+0xfc93a039&0xffffffff)<<21&0xffffffff|a>>>11))+((a=t+(i^(n|~s))+r[12]+0x655b59c3&0xffffffff)<<6&0xffffffff|a>>>26))+((a=s+(n^(t|~i))+r[3]+0x8f0ccc92&0xffffffff)<<10&0xffffffff|a>>>22))+((a=i+(t^(s|~n))+r[10]+0xffeff47d&0xffffffff)<<15&0xffffffff|a>>>17))+((a=n+(s^(i|~t))+r[1]+0x85845dd1&0xffffffff)<<21&0xffffffff|a>>>11))+((a=t+(i^(n|~s))+r[8]+0x6fa87e4f&0xffffffff)<<6&0xffffffff|a>>>26))+((a=s+(n^(t|~i))+r[15]+0xfe2ce6e0&0xffffffff)<<10&0xffffffff|a>>>22))+((a=i+(t^(s|~n))+r[6]+0xa3014314&0xffffffff)<<15&0xffffffff|a>>>17))+((a=n+(s^(i|~t))+r[13]+0x4e0811a1&0xffffffff)<<21&0xffffffff|a>>>11))+((s=(t=n+((a=t+(i^(n|~s))+r[4]+0xf7537e82&0xffffffff)<<6&0xffffffff|a>>>26))+((a=s+(n^(t|~i))+r[11]+0xbd3af235&0xffffffff)<<10&0xffffffff|a>>>22))^((i=s+((a=i+(t^(s|~n))+r[2]+0x2ad7d2bb&0xffffffff)<<15&0xffffffff|a>>>17))|~t))+r[9]+0xeb86d391&0xffffffff,e.g[0]=e.g[0]+t&0xffffffff,e.g[1]=e.g[1]+(i+(a<<21&0xffffffff|a>>>11))&0xffffffff,e.g[2]=e.g[2]+i&0xffffffff,e.g[3]=e.g[3]+s&0xffffffff}function nz(e,t){this.h=t;for(var n=[],r=!0,i=e.length-1;0<=i;i--){var s=0|e[i];r&&s==t||(n[i]=s,r=!1)}this.g=n}(M=nt.prototype).Oa=function(e){this.M=e},M.ha=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+e);t=t?t.toUpperCase():"GET",this.I=e,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():ts.g(),this.C=this.u?tr(this.u):tr(ts),this.g.onreadystatechange=B(this.La,this);try{this.G=!0,this.g.open(t,String(e),!0),this.G=!1}catch(e){return void ns(this,e)}if(e=n||"",n=new Map(this.headers),r){if(Object.getPrototypeOf(r)===Object.prototype)for(var i in r)n.set(i,r[i]);else{if("function"!=typeof r.keys||"function"!=typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));for(let e of r.keys())n.set(e,r.get(e))}}for(let[s,a]of(r=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),i=O.FormData&&e instanceof O.FormData,!(0<=j(ni,t))||r||i||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),n))this.g.setRequestHeader(s,a);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{var s;nu(this),0=this.S)){var e=2*this.S;this.l.info("BP detection timer enabled: "+e),this.B=e7(B(this.jb,this),e)}},M.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,e8(10),ny(this),nS(this))},M.ib=function(){null!=this.v&&(this.v=null,ny(this),nE(this),e8(19))},M.pb=function(e){e?(this.l.info("Successfully pinged google.com"),e8(2)):(this.l.info("Failed to ping google.com"),e8(1))},M.isActive=function(){return!!this.h&&this.h.isActive(this)},(M=nL.prototype).Ba=function(){},M.Aa=function(){},M.za=function(){},M.ya=function(){},M.isActive=function(){return!0},M.Va=function(){},nO.prototype.g=function(e,t){return new nP(e,t)},z(nP,eL),nP.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var e=this.g,t=this.l,n=this.h||void 0;e8(0),e.Y=t,e.na=n||{},e.G=e.aa,e.I=nR(e,null,e.Y),nv(e)},nP.prototype.close=function(){np(this.g)},nP.prototype.u=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=eF(e),e=n);t.j.push(new class{constructor(e,t){this.g=e,this.map=t}}(t.fb++,e)),3==t.H&&nv(t)},nP.prototype.N=function(){this.g.h=null,delete this.j,np(this.g),delete this.g,nP.$.N.call(this)},z(nF,to),z(nV,tl),z(nq,nL),nq.prototype.Ba=function(){eO(this.g,"a")},nq.prototype.Aa=function(e){eO(this.g,new nF(e))},nq.prototype.za=function(e){eO(this.g,new nV)},nq.prototype.ya=function(){eO(this.g,"b")},z(nB,function(){this.blockSize=-1}),nB.prototype.reset=function(){this.g[0]=0x67452301,this.g[1]=0xefcdab89,this.g[2]=0x98badcfe,this.g[3]=0x10325476,this.i=this.h=0},nB.prototype.j=function(e,t){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=this.m,i=this.h,s=0;sthis.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;tt;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};var nG={};function nj(e){var t;return -128<=e&&128>e?(t=function(e){return new nz([0|e],0>e?-1:0)},Object.prototype.hasOwnProperty.call(nG,e)?nG[e]:nG[e]=t(e)):new nz([0|e],0>e?-1:0)}function nK(e){if(isNaN(e)||!isFinite(e))return nQ;if(0>e)return nJ(nK(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=n$;return new nz(t,0)}var n$=0x100000000,nQ=nj(0),nH=nj(1),nW=nj(0x1000000);function nY(e){if(0!=e.h)return!1;for(var t=0;t>>16,e[t]&=65535,t++}function n1(e,t){this.g=e,this.h=t}function n2(e,t){if(nY(t))throw Error("division by zero");if(nY(e))return new n1(nQ,nQ);if(nX(e))return t=n2(nJ(e),t),new n1(nJ(t.g),nJ(t.h));if(nX(t))return t=n2(e,nJ(t)),new n1(nJ(t.g),t.h);if(30=r.X(e);)n=n5(n),r=n5(r);var i=n6(n,1),s=n6(r,1);for(r=n6(r,2),n=n6(n,2);!nY(r);){var a=s.add(r);0>=a.X(e)&&(i=i.add(n),s=a),r=n6(r,1),n=n6(n,1)}return t=nZ(e,i.R(t)),new n1(i,t)}for(i=nQ;0<=e.X(t);){for(r=48>=(r=Math.ceil(Math.log(n=Math.max(1,Math.floor(e.ea()/t.ea())))/Math.LN2))?1:Math.pow(2,r-48),a=(s=nK(n)).R(t);nX(a)||0>>31;return new nz(n,e.h)}function n6(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,i=[],s=0;s>>t|e.D(s+n+1)<<32-t:e.D(s+n);return new nz(i,e.h)}(M=nz.prototype).ea=function(){if(nX(this))return-nJ(this).ea();for(var e=0,t=1,n=0;n(e=e||10)||36>>0).toString(e);if(nY(n=i))return s+r;for(;6>s.length;)s="0"+s;r=s+r}},M.D=function(e){return 0>e?0:e>>16)+(this.D(i)>>>16)+(e.D(i)>>>16);r=a>>>16,s&=65535,a&=65535,n[i]=a<<16|s}return new nz(n,-0x80000000&n[n.length-1]?-1:0)},M.R=function(e){if(nY(this)||nY(e))return nQ;if(nX(this))return nX(e)?nJ(this).R(nJ(e)):nJ(nJ(this).R(e));if(nX(e))return nJ(this.R(nJ(e)));if(0>this.X(nW)&&0>e.X(nW))return nK(this.ea()*e.ea());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r>>16,a=65535&this.D(r),o=e.D(i)>>>16,l=65535&e.D(i);n[2*r+2*i]+=a*l,n0(n,2*r+2*i),n[2*r+2*i+1]+=s*l,n0(n,2*r+2*i+1),n[2*r+2*i+1]+=a*o,n0(n,2*r+2*i+1),n[2*r+2*i+2]+=s*o,n0(n,2*r+2*i+2)}for(r=0;r(n=n||10)||36a?(a=nK(Math.pow(n,a)),i=i.R(a).add(nK(o))):i=(i=i.R(r)).add(nK(o))}return i};let n3="@firebase/firestore";class n4{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}n4.UNAUTHENTICATED=new n4(null),n4.GOOGLE_CREDENTIALS=new n4("google-credentials-uid"),n4.FIRST_PARTY=new n4("first-party-uid"),n4.MOCK_USER=new n4("mock-user");let n8="10.8.0",n9=new class{constructor(e){this.name=e,this._logLevel=D,this._logHandler=N,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in R))throw TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?C[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw 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,R.DEBUG,...e),this._logHandler(this,R.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,R.VERBOSE,...e),this._logHandler(this,R.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,R.INFO,...e),this._logHandler(this,R.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,R.WARN,...e),this._logHandler(this,R.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,R.ERROR,...e),this._logHandler(this,R.ERROR,...e)}}("@firebase/firestore");function n7(){return n9.logLevel}function re(e){n9.setLogLevel(e)}function rt(e,...t){if(n9.logLevel<=R.DEBUG){let n=t.map(ri);n9.debug(`Firestore (${n8}): ${e}`,...n)}}function rn(e,...t){if(n9.logLevel<=R.ERROR){let n=t.map(ri);n9.error(`Firestore (${n8}): ${e}`,...n)}}function rr(e,...t){if(n9.logLevel<=R.WARN){let n=t.map(ri);n9.warn(`Firestore (${n8}): ${e}`,...n)}}function ri(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(t){return e}}function rs(e="Unexpected state"){let t=`FIRESTORE (${n8}) INTERNAL ASSERTION FAILED: `+e;throw rn(t),Error(t)}function ra(e,t){e||rs()}let ro={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 rl extends b{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class ru{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class rh{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class rc{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(n4.UNAUTHENTICATED))}shutdown(){}}class rf{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class rd{constructor(e){this.t=e,this.currentUser=n4.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){let n=this.i,r=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve(),i=new ru;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new ru,e.enqueueRetryable(()=>r(this.currentUser))};let s=()=>{let t=i;e.enqueueRetryable(async()=>{await t.promise,await r(this.currentUser)})},a=e=>{rt("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.auth.addAuthTokenListener(this.o),s()};this.t.onInit(e=>a(e)),setTimeout(()=>{if(!this.auth){let e=this.t.getImmediate({optional:!0});e?a(e):(rt("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new ru)}},0),s()}getToken(){let e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(rt("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?("string"==typeof t.accessToken||rs(),new rh(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){let e=this.auth&&this.auth.getUid();return null===e||"string"==typeof e||rs(),new n4(e)}}class rg{constructor(e,t,n){this.l=e,this.h=t,this.P=n,this.type="FirstParty",this.user=n4.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);let e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class rm{constructor(e,t,n){this.l=e,this.h=t,this.P=n}getToken(){return Promise.resolve(new rg(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(n4.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class rp{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class ry{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,t){let n=e=>{null!=e.error&&rt("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);let n=e.token!==this.R;return this.R=e.token,rt("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>n(t))};let r=e=>{rt("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.appCheck.addTokenListener(this.o)};this.A.onInit(e=>r(e)),setTimeout(()=>{if(!this.appCheck){let e=this.A.getImmediate({optional:!0});e?r(e):rt("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){let e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?("string"==typeof e.token||rs(),this.R=e.token,new rp(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}class rw{getToken(){return Promise.resolve(new rp(""))}invalidateToken(){}start(e,t){}shutdown(){}}class rv{static newId(){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=Math.floor(256/e.length)*e.length,n="";for(;n.length<20;){let r=function(e){let t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(40);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let e=0;e<40;e++)n[e]=Math.floor(256*Math.random());return n}(0);for(let i=0;it?1:0}function rx(e,t,n){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}class r_{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0||t>=1e9)throw new rl(ro.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-0xe7791f700||e>=0x3afff44180)throw new rl(ro.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return r_.fromMillis(Date.now())}static fromDate(e){return r_.fromMillis(e.getTime())}static fromMillis(e){let t=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*t));return new r_(t,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?rb(this.nanoseconds,e.nanoseconds):rb(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){return String(this.seconds- -0xe7791f700).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}class rI{constructor(e){this.timestamp=e}static fromTimestamp(e){return new rI(e)}static min(){return new rI(new r_(0,0))}static max(){return new rI(new r_(0x3afff4417f,0x3b9ac9ff))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class rE{constructor(e,t,n){void 0===t?t=0:t>e.length&&rs(),void 0===n?n=e.length-t:n>e.length-t&&rs(),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===rE.comparator(this,e)}child(e){let t=this.segments.slice(this.offset,this.limit());return e instanceof rE?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}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(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.lengthi)return 1}return e.lengtht.length?1:0}}class rT extends rE{construct(e,t,n){return new rT(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){let t=[];for(let n of e){if(n.indexOf("//")>=0)throw new rl(ro.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter(e=>e.length>0))}return new rT(t)}static emptyPath(){return new rT([])}}let rS=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class rC extends rE{construct(e,t,n){return new rC(e,t,n)}static isValidIdentifier(e){return rS.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),rC.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new rC(["__name__"])}static fromServerFormat(e){let t=[],n="",r=0,i=()=>{if(0===n.length)throw new rl(ro.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""},s=!1;for(;r=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===rT.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return rT.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new rD(new rT(e.slice()))}}class rA{constructor(e,t,n,r){this.indexId=e,this.collectionGroup=t,this.fields=n,this.indexState=r}}function rN(e){return e.fields.find(e=>2===e.kind)}function rk(e){return e.fields.filter(e=>2!==e.kind)}function rR(e,t){let n=rb(e.collectionGroup,t.collectionGroup);if(0!==n)return n;for(let r=0;re())}}async function rU(e){if(e.code!==ro.FAILED_PRECONDITION||e.message!==rq)throw e;rt("LocalStore","Unexpectedly lost primary lease")}class rz{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&rs(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new rz((n,r)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,r)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,r)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{let t=e();return t instanceof rz?t:rz.resolve(t)}catch(e){return rz.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):rz.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):rz.reject(t)}static resolve(e){return new rz((t,n)=>{t(e)})}static reject(e){return new rz((t,n)=>{n(e)})}static waitFor(e){return new rz((t,n)=>{let r=0,i=0,s=!1;e.forEach(e=>{++r,e.next(()=>{++i,s&&i===r&&t()},e=>n(e))}),s=!0,i===r&&t()})}static or(e){let t=rz.resolve(!1);for(let n of e)t=t.next(e=>e?rz.resolve(e):n());return t}static forEach(e,t){let n=[];return e.forEach((e,r)=>{n.push(t.call(this,e,r))}),this.waitFor(n)}static mapArray(e,t){return new rz((n,r)=>{let i=e.length,s=Array(i),a=0;for(let o=0;o{s[l]=e,++a===i&&n(s)},e=>r(e))}})}static doWhile(e,t){return new rz((n,r)=>{let i=()=>{!0===e()?t().next(()=>{i()},r):n()};i()})}}class rG{constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.V=new ru,this.transaction.oncomplete=()=>{this.V.resolve()},this.transaction.onabort=()=>{t.error?this.V.reject(new r$(e,t.error)):this.V.resolve()},this.transaction.onerror=t=>{let n=rX(t.target.error);this.V.reject(new r$(e,n))}}static open(e,t,n,r){try{return new rG(t,e.transaction(r,n))}catch(e){throw new r$(t,e)}}get m(){return this.V.promise}abort(e){e&&this.V.reject(e),this.aborted||(rt("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}g(){let e=this.transaction;this.aborted||"function"!=typeof e.commit||e.commit()}store(e){return new rH(this.transaction.objectStore(e))}}class rj{constructor(e,t,n){this.name=e,this.version=t,this.p=n,12.2===rj.S(w())&&rn("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(e){return rt("SimpleDb","Removing database:",e),rW(window.indexedDB.deleteDatabase(e)).toPromise()}static D(){if(!function(){try{return"object"==typeof indexedDB}catch(e){return!1}}())return!1;if(rj.C())return!0;let e=w(),t=rj.S(e),n=rj.v(e);return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||0{let r=indexedDB.open(this.name,this.version);r.onsuccess=e=>{t(e.target.result)},r.onblocked=()=>{n(new r$(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},r.onerror=t=>{let r=t.target.error;"VersionError"===r.name?n(new rl(ro.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"===r.name?n(new rl(ro.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: "+r)):n(new r$(e,r))},r.onupgradeneeded=e=>{rt("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',e.oldVersion);let t=e.target.result;this.p.N(t,r.transaction,e.oldVersion,this.version).next(()=>{rt("SimpleDb","Database upgrade to version "+this.version+" complete")})}})),this.B&&(this.db.onversionchange=e=>this.B(e)),this.db}L(e){this.B=e,this.db&&(this.db.onversionchange=t=>e(t))}async runTransaction(e,t,n,r){let i="readonly"===t,s=0;for(;;){++s;try{this.db=await this.O(e);let t=rG.open(this.db,e,i?"readonly":"readwrite",n),s=r(t).next(e=>(t.g(),e)).catch(e=>(t.abort(e),rz.reject(e))).toPromise();return s.catch(()=>{}),await t.m,s}catch(t){let e="FirebaseError"!==t.name&&s<3;if(rt("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 rK{constructor(e){this.k=e,this.q=!1,this.K=null}get isDone(){return this.q}get $(){return this.K}set cursor(e){this.k=e}done(){this.q=!0}U(e){this.K=e}delete(){return rW(this.k.delete())}}class r$ extends rl{constructor(e,t){super(ro.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function rQ(e){return"IndexedDbTransactionError"===e.name}class rH{constructor(e){this.store=e}put(e,t){let n;return void 0!==t?(rt("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(rt("SimpleDb","PUT",this.store.name,"",e),n=this.store.put(e)),rW(n)}add(e){return rt("SimpleDb","ADD",this.store.name,e,e),rW(this.store.add(e))}get(e){return rW(this.store.get(e)).next(t=>(void 0===t&&(t=null),rt("SimpleDb","GET",this.store.name,e,t),t))}delete(e){return rt("SimpleDb","DELETE",this.store.name,e),rW(this.store.delete(e))}count(){return rt("SimpleDb","COUNT",this.store.name),rW(this.store.count())}W(e,t){let n=this.options(e,t),r=n.index?this.store.index(n.index):this.store;if("function"==typeof r.getAll){let e=r.getAll(n.range);return new rz((t,n)=>{e.onerror=e=>{n(e.target.error)},e.onsuccess=e=>{t(e.target.result)}})}{let e=this.cursor(n),t=[];return this.G(e,(e,n)=>{t.push(n)}).next(()=>t)}}j(e,t){let n=this.store.getAll(e,null===t?void 0:t);return new rz((e,t)=>{n.onerror=e=>{t(e.target.error)},n.onsuccess=t=>{e(t.target.result)}})}H(e,t){rt("SimpleDb","DELETE ALL",this.store.name);let n=this.options(e,t);n.J=!1;let r=this.cursor(n);return this.G(r,(e,t,n)=>n.delete())}Y(e,t){let n;t?n=e:(n={},t=e);let r=this.cursor(n);return this.G(r,t)}Z(e){let t=this.cursor({});return new rz((n,r)=>{t.onerror=e=>{r(rX(e.target.error))},t.onsuccess=t=>{let r=t.target.result;r?e(r.primaryKey,r.value).next(e=>{e?r.continue():n()}):n()}})}G(e,t){let n=[];return new rz((r,i)=>{e.onerror=e=>{i(e.target.error)},e.onsuccess=e=>{let i=e.target.result;if(!i)return void r();let s=new rK(i),a=t(i.primaryKey,i.value,s);if(a instanceof rz){let e=a.catch(e=>(s.done(),rz.reject(e)));n.push(e)}s.isDone?r():null===s.$?i.continue():i.continue(s.$)}}).next(()=>rz.waitFor(n))}options(e,t){let n;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){let n=this.store.index(e.index);return e.J?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function rW(e){return new rz((t,n)=>{e.onsuccess=e=>{t(e.target.result)},e.onerror=e=>{n(rX(e.target.error))}})}let rY=!1;function rX(e){let t=rj.S(w());if(t>=12.2&&t<13){let t="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(t)>=0){let e=new rl("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return rY||(rY=!0,setTimeout(()=>{throw e},0)),e}}return e}class rJ{constructor(e,t){this.asyncQueue=e,this.X=t,this.task=null}start(){this.ee(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return null!==this.task}ee(e){rt("IndexBackfiller",`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,async()=>{this.task=null;try{rt("IndexBackfiller",`Documents written: ${await this.X.te()}`)}catch(e){rQ(e)?rt("IndexBackfiller","Ignoring IndexedDB error during index backfill: ",e):await rU(e)}await this.ee(6e4)})}}class rZ{constructor(e,t){this.localStore=e,this.persistence=t}async te(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",t=>this.ne(t,e))}ne(e,t){let n=new Set,r=t,i=!0;return rz.doWhile(()=>!0===i&&r>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(t=>{if(null!==t&&!n.has(t))return rt("IndexBackfiller",`Processing collection: ${t}`),this.re(e,t,r).next(e=>{r-=e,n.add(t)});i=!1})).next(()=>t-r)}re(e,t,n){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next(r=>this.localStore.localDocuments.getNextDocuments(e,t,r,n).next(n=>{let i=n.changes;return this.localStore.indexManager.updateIndexEntries(e,i).next(()=>this.ie(r,n)).next(n=>(rt("IndexBackfiller",`Updating offset: ${n}`),this.localStore.indexManager.updateCollectionGroup(e,t,n))).next(()=>i.size)}))}ie(e,t){let n=e;return t.changes.forEach((e,t)=>{let r=rP(t);rV(r,n)>0&&(n=r)}),new rF(n.readTime,n.documentKey,Math.max(t.batchId,e.largestBatchId))}}class r0{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.se(e),this.oe=e=>t.writeSequenceNumber(e))}se(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){let e=++this.previousValue;return this.oe&&this.oe(e),e}}function r1(e){return null==e}function r2(e){return 0===e&&1/e==-1/0}function r5(e){return"number"==typeof e&&Number.isInteger(e)&&!r2(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}function r6(e){let t="";for(let n=0;n0&&(t+="\x01\x01"),t=function(e,t){let n=t,r=e.length;for(let t=0;t=2||rs(),2===t)return"\x01"===e.charAt(0)&&"\x01"===e.charAt(1)||rs(),rT.emptyPath();let n=t-2,r=[],i="";for(let s=0;sn)&&rs(),e.charAt(t+1)){case"\x01":let a;let o=e.substring(s,t);0===i.length?a=o:(i+=o,a=i,i=""),r.push(a);break;case"\x10":i+=e.substring(s,t),i+="\0";break;case"\x11":i+=e.substring(s,t+1);break;default:rs()}s=t+2}return new rT(r)}r0._e=-1;let r4=["userId","batchId"],r8={},r9=["prefixPath","collectionGroup","readTime","documentId"],r7=["prefixPath","collectionGroup","documentId"],ie=["collectionGroup","readTime","prefixPath","documentId"],it=["canonicalId","targetId"],ir=["targetId","path"],ii=["path","targetId"],is=["collectionId","parent"],ia=["indexId","uid"],io=["uid","sequenceNumber"],il=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],iu=["indexId","uid","orderedDocumentKey"],ih=["userId","collectionPath","documentId"],ic=["userId","collectionPath","largestBatchId"],id=["userId","collectionGroup","largestBatchId"],ig=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],im=[...ig,"documentOverlays"],ip=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],iy=[...ip,"indexConfiguration","indexState","indexEntries"];class iw extends rB{constructor(e,t){super(),this.ae=e,this.currentSequenceNumber=t}}function iv(e,t){return rj.M(e.ae,t)}function ib(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ix(e,t){for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function i_(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class iI{constructor(e,t){this.comparator=e,this.root=t||iT.EMPTY}insert(e,t){return new iI(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,iT.BLACK,null,null))}remove(e){return new iI(this.comparator,this.root.remove(e,this.comparator).copy(null,null,iT.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){let n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){let r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=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(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){let e=[];return this.inorderTraversal((t,n)=>(e.push(`${t}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new iE(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new iE(this.root,e,this.comparator,!1)}getReverseIterator(){return new iE(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new iE(this.root,e,this.comparator,!0)}}class iE{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,t&&r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop(),t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;let e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class iT{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:iT.RED,this.left=null!=r?r:iT.EMPTY,this.right=null!=i?i:iT.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,i){return new iT(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}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(e,t,n){let r=this,i=n(e,r.key);return(r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n))).fixUp()}removeMin(){if(this.left.isEmpty())return iT.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),(e=e.copy(null,null,null,e.left.removeMin(),null)).fixUp()}remove(e,t){let n,r=this;if(0>t(e,r.key))r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===t(e,r.key)){if(r.right.isEmpty())return iT.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=(e=(e=e.copy(null,null,null,null,e.right.rotateRight())).rotateLeft()).colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=(e=e.rotateRight()).colorFlip()),e}rotateLeft(){let e=this.copy(null,null,iT.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){let e=this.copy(null,null,iT.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){let e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){return Math.pow(2,this.check())<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw rs();let e=this.left.check();if(e!==this.right.check())throw rs();return e+(this.isRed()?0:1)}}iT.EMPTY=null,iT.RED=!0,iT.BLACK=!1,iT.EMPTY=new class{constructor(){this.size=0}get key(){throw rs()}get value(){throw rs()}get color(){throw rs()}get left(){throw rs()}get right(){throw rs()}copy(e,t,n,r,i){return this}insert(e,t,n){return new iT(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class iS{constructor(e){this.comparator=e,this.data=new iI(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){let n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){let r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){let t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new iC(this.data.getIterator())}getIteratorFrom(e){return new iC(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size{t=t.add(e)}),t}isEqual(e){if(!(e instanceof iS)||this.size!==e.size)return!1;let t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){let e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){let e=[];return this.forEach(t=>{e.push(t)}),e}toString(){let e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){let t=new iS(this.comparator);return t.data=e,t}}class iC{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function iD(e){return e.hasNext()?e.getNext():void 0}class iA{constructor(e){this.fields=e,e.sort(rC.comparator)}static empty(){return new iA([])}unionWith(e){let t=new iS(rC.comparator);for(let e of this.fields)t=t.add(e);for(let n of e)t=t.add(n);return new iA(t.toArray())}covers(e){for(let t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return rx(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class iN extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}function ik(){return"undefined"!=typeof atob}class iR{constructor(e){this.binaryString=e}static fromBase64String(e){return new iR(function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new iN("Invalid base64 string: "+e):e}}(e))}static fromUint8Array(e){return new iR(function(e){let t="";for(let n=0;neiK(e,t))}function iQ(e,t){if(e===t)return 0;let n=ij(e),r=ij(t);if(n!==r)return rb(n,r);switch(n){case 0:case 0x1fffffffffffff:return 0;case 1:return rb(e.booleanValue,t.booleanValue);case 2:return function(e,t){let n=iO(e.integerValue||e.doubleValue),r=iO(t.integerValue||t.doubleValue);return nr?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return iH(e.timestampValue,t.timestampValue);case 4:return iH(iq(e),iq(t));case 5:return rb(e.stringValue,t.stringValue);case 6:return function(e,t){let n=iP(e),r=iP(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){let n=e.split("/"),r=t.split("/");for(let e=0;et.mapValue.fields[e]=i2(n)),t}if(e.arrayValue){let t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=i2(e.arrayValue.values[n]);return t}return Object.assign({},e)}function i5(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue}function i6(e,t){let n=iQ(e.value,t.value);return 0!==n?n:e.inclusive&&!t.inclusive?-1:!e.inclusive&&t.inclusive?1:0}function i3(e,t){let n=iQ(e.value,t.value);return 0!==n?n:e.inclusive&&!t.inclusive?1:!e.inclusive&&t.inclusive?-1:0}class i4{constructor(e){this.value=e}static empty(){return new i4({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n{if(!t.isImmediateParentOf(i)){let e=this.getFieldsMap(t);this.applyChanges(e,n,r),n={},r=[],t=i.popLast()}e?n[i.lastSegment()]=i2(e):r.push(i.lastSegment())});let i=this.getFieldsMap(t);this.applyChanges(i,n,r)}delete(e){let t=this.field(e.popLast());i1(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return iK(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;ne[t]=n),n))delete e[r]}clone(){return new i4(i2(this.value))}}class i8{constructor(e,t,n,r,i,s,a){this.key=e,this.documentType=t,this.version=n,this.readTime=r,this.createTime=i,this.data=s,this.documentState=a}static newInvalidDocument(e){return new i8(e,0,rI.min(),rI.min(),rI.min(),i4.empty(),0)}static newFoundDocument(e,t,n,r){return new i8(e,1,t,rI.min(),n,r,0)}static newNoDocument(e,t){return new i8(e,2,t,rI.min(),rI.min(),i4.empty(),0)}static newUnknownDocument(e,t){return new i8(e,3,t,rI.min(),rI.min(),i4.empty(),2)}convertToFoundDocument(e,t){return this.createTime.isEqual(rI.min())&&(2===this.documentType||0===this.documentType)&&(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=i4.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=i4.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=rI.min(),this}setReadTime(e){return this.readTime=e,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(e){return e instanceof i8&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new i8(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class i9{constructor(e,t){this.position=e,this.inclusive=t}}function i7(e,t,n){let r=0;for(let i=0;i":return e>0;case">=":return e>=0;default:return rs()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class si extends sn{constructor(e,t){super(),this.filters=e,this.op=t,this.ue=null}static create(e,t){return new si(e,t)}matches(e){return ss(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.ue||(this.ue=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ue}getFilters(){return Object.assign([],this.filters)}}function ss(e){return"and"===e.op}function sa(e){return"or"===e.op}function so(e){return sl(e)&&ss(e)}function sl(e){for(let t of e.filters)if(t instanceof si)return!1;return!0}function su(e,t){let n=e.filters.concat(t);return si.create(n,e.op)}class sh extends sr{constructor(e,t,n){super(e,t,n),this.key=rD.fromName(n.referenceValue)}matches(e){let t=rD.comparator(e.key,this.key);return this.matchesComparison(t)}}class sc extends sr{constructor(e,t){super(e,"in",t),this.keys=sd("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class sf extends sr{constructor(e,t){super(e,"not-in",t),this.keys=sd("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function sd(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map(e=>rD.fromName(e.referenceValue))}class sg extends sr{constructor(e,t){super(e,"array-contains",t)}matches(e){let t=e.data.field(this.field);return iJ(t)&&i$(t.arrayValue,this.value)}}class sm extends sr{constructor(e,t){super(e,"in",t)}matches(e){let t=e.data.field(this.field);return null!==t&&i$(this.value.arrayValue,t)}}class sp extends sr{constructor(e,t){super(e,"not-in",t)}matches(e){if(i$(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;let t=e.data.field(this.field);return null!==t&&!i$(this.value.arrayValue,t)}}class sy extends sr{constructor(e,t){super(e,"array-contains-any",t)}matches(e){let t=e.data.field(this.field);return!(!iJ(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>i$(this.value.arrayValue,e))}}class sw{constructor(e,t=null,n=[],r=[],i=null,s=null,a=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=s,this.endAt=a,this.ce=null}}function sv(e,t=null,n=[],r=[],i=null,s=null,a=null){return new sw(e,t,n,r,i,s,a)}function sb(e){if(null===e.ce){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(e=>(function e(t){if(t instanceof sr)return t.field.canonicalString()+t.op.toString()+iW(t.value);if(so(t))return t.filters.map(t=>e(t)).join(",");{let n=t.filters.map(t=>e(t)).join(",");return`${t.op}(${n})`}})(e)).join(","),t+="|ob:",t+=e.orderBy.map(e=>e.field.canonicalString()+e.dir).join(","),r1(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>iW(e)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>iW(e)).join(",")),e.ce=t}return e.ce}function sx(e,t){if(e.limit!==t.limit||e.orderBy.length!==t.orderBy.length)return!1;for(let i=0;it&&e(r,n.filters[i]),!0):void rs()}(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!se(e.startAt,t.startAt)&&se(e.endAt,t.endAt)}function s_(e){return rD.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}function sI(e,t){return e.filters.filter(e=>e instanceof sr&&e.field.isEqual(t))}function sE(e,t,n){let r=iG,i=!0;for(let n of sI(e,t)){let e=iG,t=!0;switch(n.op){case"<":case"<=":var s;e="nullValue"in(s=n.value)?iG:"booleanValue"in s?{booleanValue:!1}:"integerValue"in s||"doubleValue"in s?{doubleValue:NaN}:"timestampValue"in s?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in s?{stringValue:""}:"bytesValue"in s?{bytesValue:""}:"referenceValue"in s?iY(iU.empty(),rD.empty()):"geoPointValue"in s?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in s?{arrayValue:{}}:"mapValue"in s?{mapValue:{}}:rs();break;case"==":case"in":case">=":e=n.value;break;case">":e=n.value,t=!1;break;case"!=":case"not-in":e=iG}0>i6({value:r,inclusive:i},{value:e,inclusive:t})&&(r=e,i=t)}if(null!==n){for(let s=0;si6({value:r,inclusive:i},{value:e,inclusive:n.inclusive})&&(r=e,i=n.inclusive);break}}return{value:r,inclusive:i}}function sT(e,t,n){let r=iz,i=!0;for(let n of sI(e,t)){let e=iz,t=!0;switch(n.op){case">=":case">":var s;e="nullValue"in(s=n.value)?{booleanValue:!1}:"booleanValue"in s?{doubleValue:NaN}:"integerValue"in s||"doubleValue"in s?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in s?{stringValue:""}:"stringValue"in s?{bytesValue:""}:"bytesValue"in s?iY(iU.empty(),rD.empty()):"referenceValue"in s?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in s?{arrayValue:{}}:"arrayValue"in s?{mapValue:{}}:"mapValue"in s?iz:rs(),t=!1;break;case"==":case"in":case"<=":e=n.value;break;case"<":e=n.value,t=!1;break;case"!=":case"not-in":e=iz}i3({value:r,inclusive:i},{value:e,inclusive:t})>0&&(r=e,i=t)}if(null!==n){for(let s=0;s0&&(r=e,i=n.inclusive);break}}return{value:r,inclusive:i}}class sS{constructor(e,t=null,n=[],r=[],i=null,s="F",a=null,o=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=s,this.startAt=a,this.endAt=o,this.le=null,this.he=null,this.Pe=null,this.startAt,this.endAt}}function sC(e){return new sS(e)}function sD(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function sA(e){return null!==e.collectionGroup}function sN(e){if(null===e.le){let t;e.le=[];let n=new Set;for(let t of e.explicitOrderBy)e.le.push(t),n.add(t.field.canonicalString());let r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(t=new iS(rC.comparator),e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t).forEach(t=>{n.has(t.canonicalString())||t.isKeyField()||e.le.push(new st(t,r))}),n.has(rC.keyField().canonicalString())||e.le.push(new st(rC.keyField(),r))}return e.le}function sk(e){return e.he||(e.he=sR(e,sN(e))),e.he}function sR(e,t){if("F"===e.limitType)return sv(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{let t="desc"===e.dir?"asc":"desc";return new st(e.field,t)});let n=e.endAt?new i9(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new i9(e.startAt.position,e.startAt.inclusive):null;return sv(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}}function sM(e,t){let n=e.filters.concat([t]);return new sS(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}function sL(e,t,n){return new sS(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function sO(e,t){return sx(sk(e),sk(t))&&e.limitType===t.limitType}function sP(e){return`${sb(sk(e))}|lt:${e.limitType}`}function sF(e){var t;let n;return`Query(target=${n=(t=sk(e)).path.canonicalString(),null!==t.collectionGroup&&(n+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(n+=`, filters: [${t.filters.map(e=>(function e(t){return t instanceof sr?`${t.field.canonicalString()} ${t.op} ${iW(t.value)}`:t instanceof si?t.op.toString()+" {"+t.getFilters().map(e).join(" ,")+"}":"Filter"})(e)).join(", ")}]`),r1(t.limit)||(n+=", limit: "+t.limit),t.orderBy.length>0&&(n+=`, orderBy: [${t.orderBy.map(e=>`${e.field.canonicalString()} (${e.dir})`).join(", ")}]`),t.startAt&&(n+=", startAt: ",n+=t.startAt.inclusive?"b:":"a:",n+=t.startAt.position.map(e=>iW(e)).join(",")),t.endAt&&(n+=", endAt: ",n+=t.endAt.inclusive?"a:":"b:",n+=t.endAt.position.map(e=>iW(e)).join(",")),`Target(${n})`}; limitType=${e.limitType})`}function sV(e,t){return t.isFoundDocument()&&function(e,t){let n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):rD.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(let n of sN(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(let n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&!(e.startAt&&!function(e,t,n){let r=i7(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,sN(e),t))&&!(e.endAt&&!function(e,t,n){let r=i7(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,sN(e),t))}function sq(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function sB(e){return(t,n)=>{let r=!1;for(let i of sN(e)){let e=function(e,t,n){let r=e.field.isKeyField()?rD.comparator(t.key,n.key):function(e,t,n){let r=t.data.field(e),i=n.data.field(e);return null!==r&&null!==i?iQ(r,i):rs()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return -1*r;default:return rs()}}(i,t,n);if(0!==e)return e;r=r||i.field.isKeyField()}return 0}}class sU{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){let t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n){for(let[t,r]of n)if(this.equalsFn(t,e))return r}}has(e){return void 0!==this.get(e)}set(e,t){let n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(let n=0;n{for(let[t,r]of n)e(t,r)})}isEmpty(){return i_(this.inner)}size(){return this.innerSize}}let sz=new iI(rD.comparator),sG=new iI(rD.comparator);function sj(...e){let t=sG;for(let n of e)t=t.insert(n.key,n);return t}function sK(e){let t=sG;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function s$(){return new sU(e=>e.toString(),(e,t)=>e.isEqual(t))}let sQ=new iI(rD.comparator),sH=new iS(rD.comparator);function sW(...e){let t=sH;for(let n of e)t=t.add(n);return t}let sY=new iS(rb);function sX(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:r2(t)?"-0":t}}function sJ(e){return{integerValue:""+e}}function sZ(e,t){return r5(t)?sJ(t):sX(e,t)}class s0{constructor(){this._=void 0}}function s1(e,t){return e instanceof s8?iX(t)||t&&"doubleValue"in t?t:{integerValue:0}:null}class s2 extends s0{}class s5 extends s0{constructor(e){super(),this.elements=e}}function s6(e,t){let n=s7(t);for(let t of e.elements)n.some(e=>iK(e,t))||n.push(t);return{arrayValue:{values:n}}}class s3 extends s0{constructor(e){super(),this.elements=e}}function s4(e,t){let n=s7(t);for(let t of e.elements)n=n.filter(e=>!iK(e,t));return{arrayValue:{values:n}}}class s8 extends s0{constructor(e,t){super(),this.serializer=e,this.Ie=t}}function s9(e){return iO(e.integerValue||e.doubleValue)}function s7(e){return iJ(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class ae{constructor(e,t){this.field=e,this.transform=t}}class at{constructor(e,t){this.version=e,this.transformResults=t}}class an{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new an}static exists(e){return new an(void 0,e)}static updateTime(e){return new an(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function ar(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class ai{}function as(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new ad(e.key,an.none()):new al(e.key,e.data,an.none());{let n=e.data,r=i4.empty(),i=new iS(rC.comparator);for(let e of t.fields)if(!i.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?r.delete(e):r.set(e,t),i=i.add(e)}return new au(e.key,r,new iA(i.toArray()),an.none())}}function aa(e,t,n,r){return e instanceof al?function(e,t,n,r){if(!ar(e.precondition,t))return n;let i=e.value.clone(),s=af(e.fieldTransforms,r,t);return i.setAll(s),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null}(e,t,n,r):e instanceof au?function(e,t,n,r){if(!ar(e.precondition,t))return n;let i=af(e.fieldTransforms,r,t),s=t.data;return s.setAll(ah(e)),s.setAll(i),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,r):ar(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}function ao(e,t){var n,r;return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&(n=e.fieldTransforms,r=t.fieldTransforms,!!(void 0===n&&void 0===r||!(!n||!r)&&rx(n,r,(e,t)=>{var n,r;return e.field.isEqual(t.field)&&(n=e.transform,r=t.transform,n instanceof s5&&r instanceof s5||n instanceof s3&&r instanceof s3?rx(n.elements,r.elements,iK):n instanceof s8&&r instanceof s8?iK(n.Ie,r.Ie):n instanceof s2&&r instanceof s2)})))&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class al extends ai{constructor(e,t,n,r=[]){super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class au extends ai{constructor(e,t,n,r,i=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=r,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function ah(e){let t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){let r=e.data.field(n);t.set(n,r)}}),t}function ac(e,t,n){var r;let i=new Map;e.length===n.length||rs();for(let s=0;s{let i=e.get(r.key),s=i.overlayedDocument,a=this.applyToLocalView(s,i.mutatedFields),o=as(s,a=t.has(r.key)?null:a);null!==o&&n.set(r.key,o),s.isValidDocument()||s.convertToNoDocument(rI.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),sW())}isEqual(e){return this.batchId===e.batchId&&rx(this.mutations,e.mutations,(e,t)=>ao(e,t))&&rx(this.baseMutations,e.baseMutations,(e,t)=>ao(e,t))}}class ap{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){e.mutations.length===n.length||rs();let r=sQ,i=e.mutations;for(let e=0;e=8)throw new aD(`Invalid padding: ${t}`);if(n<0||e.length>0&&0===this.hashCount)throw new aD(`Invalid hash count: ${n}`);if(0===e.length&&0!==t)throw new aD(`Invalid padding when bitmap length is 0: ${t}`);this.Te=8*e.length-t,this.Ee=nz.fromNumber(this.Te)}de(e,t,n){let r=e.add(t.multiply(nz.fromNumber(n)));return 1===r.compare(aE)&&(r=new nz([r.getBits(0),r.getBits(1)],0)),r.modulo(this.Ee).toNumber()}Ae(e){return 0!=(this.bitmap[Math.floor(e/8)]&1<r.insert(e)),r}insert(e){if(0===this.Te)return;let[t,n]=aS(aT(e));for(let e=0;e0&&(this.Se=!0,this.ye=e)}ve(){let e=sW(),t=sW(),n=sW();return this.pe.forEach((r,i)=>{switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:rs()}}),new aN(this.ye,this.we,e,t,n)}Fe(){this.Se=!1,this.pe=aF()}Me(e,t){this.Se=!0,this.pe=this.pe.insert(e,t)}xe(e){this.Se=!0,this.pe=this.pe.remove(e)}Oe(){this.ge+=1}Ne(){this.ge-=1,this.ge>=0||rs()}Be(){this.Se=!0,this.we=!0}}class aO{constructor(e){this.Le=e,this.ke=new Map,this.qe=sz,this.Qe=aP(),this.Ke=new iI(rb)}$e(e){for(let t of e.Ve)e.me&&e.me.isFoundDocument()?this.Ue(t,e.me):this.We(t,e.key,e.me);for(let t of e.removedTargetIds)this.We(t,e.key,e.me)}Ge(e){this.forEachTarget(e,t=>{let n=this.ze(t);switch(e.state){case 0:this.je(t)&&n.Ce(e.resumeToken);break;case 1:n.Ne(),n.be||n.Fe(),n.Ce(e.resumeToken);break;case 2:n.Ne(),n.be||this.removeTarget(t);break;case 3:this.je(t)&&(n.Be(),n.Ce(e.resumeToken));break;case 4:this.je(t)&&(this.He(t),n.Ce(e.resumeToken));break;default:rs()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ke.forEach((e,n)=>{this.je(n)&&t(n)})}Je(e){let t=e.targetId,n=e.fe.count,r=this.Ye(t);if(r){let i=r.target;if(s_(i)){if(0===n){let e=new rD(i.path);this.We(t,e,i8.newNoDocument(e,rI.min()))}else 1===n||rs()}else{let r=this.Ze(t);if(r!==n){let n=this.Xe(e),i=n?this.et(n,e,r):1;0!==i&&(this.He(t),this.Ke=this.Ke.insert(t,2===i?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch")),null==a_||a_.tt(function(e,t,n,r,i){var s,a,o,l,u,h;let c={localCacheCount:e,existenceFilterCount:t.count,databaseId:n.database,projectId:n.projectId},f=t.unchangedNames;return f&&(c.bloomFilter={applied:0===i,hashCount:null!==(s=null==f?void 0:f.hashCount)&&void 0!==s?s:0,bitmapLength:null!==(l=null===(o=null===(a=null==f?void 0:f.bits)||void 0===a?void 0:a.bitmap)||void 0===o?void 0:o.length)&&void 0!==l?l:0,padding:null!==(h=null===(u=null==f?void 0:f.bits)||void 0===u?void 0:u.padding)&&void 0!==h?h:0,mightContain:e=>{var t;return null!==(t=null==r?void 0:r.mightContain(e))&&void 0!==t&&t}}),c}(r,e.fe,this.Le.nt(),n,i))}}}}Xe(e){let t,n;let r=e.fe.unchangedNames;if(!r||!r.bits)return null;let{bits:{bitmap:i="",padding:s=0},hashCount:a=0}=r;try{t=iP(i).toUint8Array()}catch(e){if(e instanceof iN)return rr("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw e}try{n=new aC(t,s,a)}catch(e){return rr(e instanceof aD?"BloomFilter error: ":"Applying bloom filter failed: ",e),null}return 0===n.Te?null:n}et(e,t,n){return t.fe.count===n-this.rt(e,t.targetId)?0:2}rt(e,t){let n=this.Le.getRemoteKeysForTarget(t),r=0;return n.forEach(n=>{let i=this.Le.nt(),s=`projects/${i.projectId}/databases/${i.database}/documents/${n.path.canonicalString()}`;e.mightContain(s)||(this.We(t,n,null),r++)}),r}it(e){let t=new Map;this.ke.forEach((n,r)=>{let i=this.Ye(r);if(i){if(n.current&&s_(i.target)){let t=new rD(i.target.path);null!==this.qe.get(t)||this.st(r,t)||this.We(r,t,i8.newNoDocument(t,e))}n.De&&(t.set(r,n.ve()),n.Fe())}});let n=sW();this.Qe.forEach((e,t)=>{let r=!0;t.forEachWhile(e=>{let t=this.Ye(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(r=!1,!1)}),r&&(n=n.add(e))}),this.qe.forEach((t,n)=>n.setReadTime(e));let r=new aA(e,t,this.Ke,this.qe,n);return this.qe=sz,this.Qe=aP(),this.Ke=new iI(rb),r}Ue(e,t){if(!this.je(e))return;let n=this.st(e,t.key)?2:0;this.ze(e).Me(t.key,n),this.qe=this.qe.insert(t.key,t),this.Qe=this.Qe.insert(t.key,this.ot(t.key).add(e))}We(e,t,n){if(!this.je(e))return;let r=this.ze(e);this.st(e,t)?r.Me(t,1):r.xe(t),this.Qe=this.Qe.insert(t,this.ot(t).delete(e)),n&&(this.qe=this.qe.insert(t,n))}removeTarget(e){this.ke.delete(e)}Ze(e){let t=this.ze(e).ve();return this.Le.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Oe(e){this.ze(e).Oe()}ze(e){let t=this.ke.get(e);return t||(t=new aL,this.ke.set(e,t)),t}ot(e){let t=this.Qe.get(e);return t||(t=new iS(rb),this.Qe=this.Qe.insert(e,t)),t}je(e){let t=null!==this.Ye(e);return t||rt("WatchChangeAggregator","Detected inactive target",e),t}Ye(e){let t=this.ke.get(e);return t&&t.be?null:this.Le._t(e)}He(e){this.ke.set(e,new aL),this.Le.getRemoteKeysForTarget(e).forEach(t=>{this.We(e,t,null)})}st(e,t){return this.Le.getRemoteKeysForTarget(e).has(t)}}function aP(){return new iI(rD.comparator)}function aF(){return new iI(rD.comparator)}let aV={asc:"ASCENDING",desc:"DESCENDING"},aq={"<":"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"},aB={and:"AND",or:"OR"};class aU{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function az(e,t){return e.useProto3Json||r1(t)?t:{value:t}}function aG(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function aj(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function aK(e){return e||rs(),rI.fromTimestamp(function(e){let t=iL(e);return new r_(t.seconds,t.nanos)}(e))}function a$(e,t){return aQ(e,t).canonicalString()}function aQ(e,t){let n=new rT(["projects",e.projectId,"databases",e.database]).child("documents");return void 0===t?n:n.child(t)}function aH(e){let t=rT.fromString(e);return oe(t)||rs(),t}function aW(e,t){return a$(e.databaseId,t.path)}function aY(e,t){let n=aH(t);if(n.get(1)!==e.databaseId.projectId)throw new rl(ro.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new rl(ro.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new rD(a0(n))}function aX(e,t){return a$(e.databaseId,t)}function aJ(e){let t=aH(e);return 4===t.length?rT.emptyPath():a0(t)}function aZ(e){return new rT(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function a0(e){return e.length>4&&"documents"===e.get(4)||rs(),e.popFirst(5)}function a1(e,t,n){return{name:aW(e,t),fields:n.value.mapValue.fields}}function a2(e,t,n){let r=aY(e,t.name),i=aK(t.updateTime),s=t.createTime?aK(t.createTime):rI.min(),a=new i4({mapValue:{fields:t.fields}}),o=i8.newFoundDocument(r,i,s,a);return n&&o.setHasCommittedMutations(),n?o.setHasCommittedMutations():o}function a5(e,t){var n;let r;if(t instanceof al)r={update:a1(e,t.key,t.value)};else if(t instanceof ad)r={delete:aW(e,t.key)};else if(t instanceof au)r={update:a1(e,t.key,t.data),updateMask:function(e){let t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}(t.fieldMask)};else{if(!(t instanceof ag))return rs();r={verify:aW(e,t.key)}}return t.fieldTransforms.length>0&&(r.updateTransforms=t.fieldTransforms.map(e=>(function(e,t){let n=t.transform;if(n instanceof s2)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof s5)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof s3)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof s8)return{fieldPath:t.field.canonicalString(),increment:n.Ie};throw rs()})(0,e))),t.precondition.isNone||(r.currentDocument=void 0!==(n=t.precondition).updateTime?{updateTime:aG(e,n.updateTime.toTimestamp())}:void 0!==n.exists?{exists:n.exists}:rs()),r}function a6(e,t){var n;let r=t.currentDocument?void 0!==(n=t.currentDocument).updateTime?an.updateTime(aK(n.updateTime)):void 0!==n.exists?an.exists(n.exists):an.none():an.none(),i=t.updateTransforms?t.updateTransforms.map(t=>{let n;return n=null,"setToServerValue"in t?("REQUEST_TIME"===t.setToServerValue||rs(),n=new s2):"appendMissingElements"in t?n=new s5(t.appendMissingElements.values||[]):"removeAllFromArray"in t?n=new s3(t.removeAllFromArray.values||[]):"increment"in t?n=new s8(e,t.increment):rs(),new ae(rC.fromServerFormat(t.fieldPath),n)}):[];if(t.update){t.update.name;let n=aY(e,t.update.name),s=new i4({mapValue:{fields:t.update.fields}});return t.updateMask?new au(n,s,new iA((t.updateMask.fieldPaths||[]).map(e=>rC.fromServerFormat(e))),r,i):new al(n,s,r,i)}return t.delete?new ad(aY(e,t.delete),r):t.verify?new ag(aY(e,t.verify),r):rs()}function a3(e,t){return{documents:[aX(e,t.path)]}}function a4(e,t){var n,r;let i;let s={structuredQuery:{}},a=t.path;null!==t.collectionGroup?(i=a,s.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(i=a.popLast(),s.structuredQuery.from=[{collectionId:a.lastSegment()}]),s.parent=aX(e,i);let o=function(e){if(0!==e.length)return function e(t){return t instanceof sr?function(e){if("=="===e.op){if(i0(e.value))return{unaryFilter:{field:a9(e.field),op:"IS_NAN"}};if(iZ(e.value))return{unaryFilter:{field:a9(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(i0(e.value))return{unaryFilter:{field:a9(e.field),op:"IS_NOT_NAN"}};if(iZ(e.value))return{unaryFilter:{field:a9(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:a9(e.field),op:aq[e.op],value:e.value}}}(t):t instanceof si?function(t){let n=t.getFilters().map(t=>e(t));return 1===n.length?n[0]:{compositeFilter:{op:aB[t.op],filters:n}}}(t):rs()}(si.create(e,"and"))}(t.filters);o&&(s.structuredQuery.where=o);let l=function(e){if(0!==e.length)return e.map(e=>({field:a9(e.field),direction:aV[e.dir]}))}(t.orderBy);l&&(s.structuredQuery.orderBy=l);let u=az(e,t.limit);return null!==u&&(s.structuredQuery.limit=u),t.startAt&&(s.structuredQuery.startAt={before:(n=t.startAt).inclusive,values:n.position}),t.endAt&&(s.structuredQuery.endAt={before:!(r=t.endAt).inclusive,values:r.position}),{ut:s,parent:i}}function a8(e){var t;let n,r=aJ(e.parent),i=e.structuredQuery,s=i.from?i.from.length:0,a=null;if(s>0){1===s||rs();let e=i.from[0];e.allDescendants?a=e.collectionId:r=r.child(e.collectionId)}let o=[];i.where&&(o=function(e){let t=function e(t){return void 0!==t.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":let t=a7(e.unaryFilter.field);return sr.create(t,"==",{doubleValue:NaN});case"IS_NULL":let n=a7(e.unaryFilter.field);return sr.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":let r=a7(e.unaryFilter.field);return sr.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":let i=a7(e.unaryFilter.field);return sr.create(i,"!=",{nullValue:"NULL_VALUE"});default:return rs()}}(t):void 0!==t.fieldFilter?sr.create(a7(t.fieldFilter.field),function(e){switch(e){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 rs()}}(t.fieldFilter.op),t.fieldFilter.value):void 0!==t.compositeFilter?si.create(t.compositeFilter.filters.map(t=>e(t)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return rs()}}(t.compositeFilter.op)):rs()}(e);return t instanceof si&&so(t)?t.getFilters():[t]}(i.where));let l=[];i.orderBy&&(l=i.orderBy.map(e=>new st(a7(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))));let u=null;i.limit&&(u=r1(n="object"==typeof(t=i.limit)?t.value:t)?null:n);let h=null;i.startAt&&(h=function(e){let t=!!e.before;return new i9(e.values||[],t)}(i.startAt));let c=null;return i.endAt&&(c=function(e){let t=!e.before;return new i9(e.values||[],t)}(i.endAt)),new sS(r,a,l,o,u,"F",h,c)}function a9(e){return{fieldPath:e.canonicalString()}}function a7(e){return rC.fromServerFormat(e.fieldPath)}function oe(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}class ot{constructor(e,t,n,r,i=rI.min(),s=rI.min(),a=iR.EMPTY_BYTE_STRING,o=null){this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=a,this.expectedCount=o}withSequenceNumber(e){return new ot(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new ot(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new ot(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new ot(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class on{constructor(e){this.ct=e}}function or(e,t){let n=t.key,r={prefixPath:n.getCollectionPath().popLast().toArray(),collectionGroup:n.collectionGroup,documentId:n.path.lastSegment(),readTime:oi(t.readTime),hasCommittedMutations:t.hasCommittedMutations};if(t.isFoundDocument()){var i;r.document={name:aW(i=e.ct,t.key),fields:t.data.value.mapValue.fields,updateTime:aG(i,t.version.toTimestamp()),createTime:aG(i,t.createTime.toTimestamp())}}else if(t.isNoDocument())r.noDocument={path:n.path.toArray(),readTime:os(t.version)};else{if(!t.isUnknownDocument())return rs();r.unknownDocument={path:n.path.toArray(),version:os(t.version)}}return r}function oi(e){let t=e.toTimestamp();return[t.seconds,t.nanoseconds]}function os(e){let t=e.toTimestamp();return{seconds:t.seconds,nanoseconds:t.nanoseconds}}function oa(e){let t=new r_(e.seconds,e.nanoseconds);return rI.fromTimestamp(t)}function oo(e,t){let n=(t.baseMutations||[]).map(t=>a6(e.ct,t));for(let e=0;ea6(e.ct,t)),i=r_.fromMillis(t.localWriteTimeMs);return new am(t.batchId,i,n,r)}function ol(e){var t;let n=oa(e.readTime),r=void 0!==e.lastLimboFreeSnapshotVersion?oa(e.lastLimboFreeSnapshotVersion):rI.min();return new ot(void 0!==e.query.documents?(1===(t=e.query).documents.length||rs(),sk(sC(aJ(t.documents[0])))):sk(a8(e.query)),e.targetId,"TargetPurposeListen",e.lastListenSequenceNumber,n,r,iR.fromBase64String(e.resumeToken))}function ou(e,t){let n;let r=os(t.snapshotVersion),i=os(t.lastLimboFreeSnapshotVersion);n=s_(t.target)?a3(e.ct,t.target):a4(e.ct,t.target).ut;let s=t.resumeToken.toBase64();return{targetId:t.targetId,canonicalId:sb(t.target),readTime:r,resumeToken:s,lastListenSequenceNumber:t.sequenceNumber,lastLimboFreeSnapshotVersion:i,query:n}}function oh(e){let t=a8({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?sL(t,t.limit,"L"):t}function oc(e,t){return new ay(t.largestBatchId,a6(e.ct,t.overlayMutation))}function of(e,t){let n=t.path.lastSegment();return[e,r6(t.path.popLast()),n]}function od(e,t,n,r){return{indexId:e,uid:t,sequenceNumber:n,readTime:os(r.readTime),documentKey:r6(r.documentKey.path),largestBatchId:r.largestBatchId}}class og{getBundleMetadata(e,t){return om(e).get(t).next(e=>{if(e)return{id:e.bundleId,createTime:oa(e.createTime),version:e.version}})}saveBundleMetadata(e,t){return om(e).put({bundleId:t.id,createTime:os(aK(t.createTime)),version:t.version})}getNamedQuery(e,t){return op(e).get(t).next(e=>{if(e)return{name:e.name,query:oh(e.bundledQuery),readTime:oa(e.readTime)}})}saveNamedQuery(e,t){return op(e).put({name:t.name,readTime:os(aK(t.readTime)),bundledQuery:t.bundledQuery})}}function om(e){return iv(e,"bundles")}function op(e){return iv(e,"namedQueries")}class oy{constructor(e,t){this.serializer=e,this.userId=t}static lt(e,t){return new oy(e,t.uid||"")}getOverlay(e,t){return ow(e).get(of(this.userId,t)).next(e=>e?oc(this.serializer,e):null)}getOverlays(e,t){let n=s$();return rz.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){let r=[];return n.forEach((n,i)=>{let s=new ay(t,i);r.push(this.ht(e,s))}),rz.waitFor(r)}removeOverlaysForBatchId(e,t,n){let r=new Set;t.forEach(e=>r.add(r6(e.getCollectionPath())));let i=[];return r.forEach(t=>{let r=IDBKeyRange.bound([this.userId,t,n],[this.userId,t,n+1],!1,!0);i.push(ow(e).H("collectionPathOverlayIndex",r))}),rz.waitFor(i)}getOverlaysForCollection(e,t,n){let r=s$(),i=r6(t),s=IDBKeyRange.bound([this.userId,i,n],[this.userId,i,Number.POSITIVE_INFINITY],!0);return ow(e).W("collectionPathOverlayIndex",s).next(e=>{for(let t of e){let e=oc(this.serializer,t);r.set(e.getKey(),e)}return r})}getOverlaysForCollectionGroup(e,t,n,r){let i;let s=s$(),a=IDBKeyRange.bound([this.userId,t,n],[this.userId,t,Number.POSITIVE_INFINITY],!0);return ow(e).Y({index:"collectionGroupOverlayIndex",range:a},(e,t,n)=>{let a=oc(this.serializer,t);s.size()s)}ht(e,t){return ow(e).put(function(e,t,n){let[r,i,s]=of(t,n.mutation.key);return{userId:t,collectionPath:i,documentId:s,collectionGroup:n.mutation.key.getCollectionGroup(),largestBatchId:n.largestBatchId,overlayMutation:a5(e.ct,n.mutation)}}(this.serializer,this.userId,t))}}function ow(e){return iv(e,"documentOverlays")}class ov{constructor(){}Pt(e,t){this.It(e,t),t.Tt()}It(e,t){if("nullValue"in e)this.Et(t,5);else if("booleanValue"in e)this.Et(t,10),t.dt(e.booleanValue?1:0);else if("integerValue"in e)this.Et(t,15),t.dt(iO(e.integerValue));else if("doubleValue"in e){let n=iO(e.doubleValue);isNaN(n)?this.Et(t,13):(this.Et(t,15),r2(n)?t.dt(0):t.dt(n))}else if("timestampValue"in e){let n=e.timestampValue;this.Et(t,20),"string"==typeof n?t.At(n):(t.At(`${n.seconds||""}`),t.dt(n.nanos||0))}else if("stringValue"in e)this.Rt(e.stringValue,t),this.Vt(t);else if("bytesValue"in e)this.Et(t,30),t.ft(iP(e.bytesValue)),this.Vt(t);else if("referenceValue"in e)this.gt(e.referenceValue,t);else if("geoPointValue"in e){let n=e.geoPointValue;this.Et(t,45),t.dt(n.latitude||0),t.dt(n.longitude||0)}else"mapValue"in e?i5(e)?this.Et(t,Number.MAX_SAFE_INTEGER):(this.yt(e.mapValue,t),this.Vt(t)):"arrayValue"in e?(this.wt(e.arrayValue,t),this.Vt(t)):rs()}Rt(e,t){this.Et(t,25),this.St(e,t)}St(e,t){t.At(e)}yt(e,t){let n=e.fields||{};for(let e of(this.Et(t,55),Object.keys(n)))this.Rt(e,t),this.It(n[e],t)}wt(e,t){let n=e.values||[];for(let e of(this.Et(t,50),n))this.It(e,t)}gt(e,t){this.Et(t,37),rD.fromName(e).path.forEach(e=>{this.Et(t,60),this.St(e,t)})}Et(e,t){e.dt(t)}Vt(e){e.dt(2)}}function ob(e){return Math.ceil((64-function(e){let t=0;for(let n=0;n<8;++n){let r=function(e){if(0===e)return 8;let t=0;return e>>4==0&&(t+=4,e<<=4),e>>6==0&&(t+=2,e<<=2),e>>7==0&&(t+=1),t}(255&e[n]);if(t+=r,8!==r)break}return t}(e))/8)}ov.bt=new ov;class ox{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Dt(e){let t=e[Symbol.iterator](),n=t.next();for(;!n.done;)this.Ct(n.value),n=t.next();this.vt()}Ft(e){let t=e[Symbol.iterator](),n=t.next();for(;!n.done;)this.Mt(n.value),n=t.next();this.xt()}Ot(e){for(let t of e){let e=t.charCodeAt(0);if(e<128)this.Ct(e);else if(e<2048)this.Ct(960|e>>>6),this.Ct(128|63&e);else if(t<"\ud800"||"\udbff">>12),this.Ct(128|63&e>>>6),this.Ct(128|63&e);else{let e=t.codePointAt(0);this.Ct(240|e>>>18),this.Ct(128|63&e>>>12),this.Ct(128|63&e>>>6),this.Ct(128|63&e)}}this.vt()}Nt(e){for(let t of e){let e=t.charCodeAt(0);if(e<128)this.Mt(e);else if(e<2048)this.Mt(960|e>>>6),this.Mt(128|63&e);else if(t<"\ud800"||"\udbff">>12),this.Mt(128|63&e>>>6),this.Mt(128|63&e);else{let e=t.codePointAt(0);this.Mt(240|e>>>18),this.Mt(128|63&e>>>12),this.Mt(128|63&e>>>6),this.Mt(128|63&e)}}this.xt()}Bt(e){let t=this.Lt(e),n=ob(t);this.kt(1+n),this.buffer[this.position++]=255&n;for(let e=t.length-n;erC.comparator(e.field,t.field)),this.collectionId=null!=e.collectionGroup?e.collectionGroup:e.path.lastSegment(),this.Zt=e.orderBy,this.Xt=[],e.filters))t.isInequality()?this.Yt=this.Yt.add(t):this.Xt.push(t)}get en(){return this.Yt.size>1}tn(e){if(e.collectionGroup===this.collectionId||rs(),this.en)return!1;let t=rN(e);if(void 0!==t&&!this.nn(t))return!1;let n=rk(e),r=new Set,i=0,s=0;for(;i0){let e=this.Yt.getIterator().getNext();if(!r.has(e.field.canonicalString())){let t=n[i];if(!this.rn(e,t)||!this.sn(this.Zt[s++],t))return!1}++i}for(;i=this.Zt.length||!this.sn(this.Zt[s++],e))return!1}return!0}on(){if(this.en)return null;let e=new iS(rC.comparator),t=[];for(let n of this.Xt)if(!n.field.isKeyField()){if("array-contains"===n.op||"array-contains-any"===n.op)t.push(new rM(n.field,2));else{if(e.has(n.field))continue;e=e.add(n.field),t.push(new rM(n.field,0))}}for(let n of this.Zt)n.field.isKeyField()||e.has(n.field)||(e=e.add(n.field),t.push(new rM(n.field,"asc"===n.dir?0:1)));return new rA(rA.UNKNOWN_ID,this.collectionId,t,rL.empty())}nn(e){for(let t of this.Xt)if(this.rn(t,e))return!0;return!1}rn(e,t){if(void 0===e||!e.field.isEqual(t.fieldPath))return!1;let n="array-contains"===e.op||"array-contains-any"===e.op;return 2===t.kind===n}sn(e,t){return!!e.field.isEqual(t.fieldPath)&&(0===t.kind&&"asc"===e.dir||1===t.kind&&"desc"===e.dir)}}function oA(e){return e instanceof sr}function oN(e){return e instanceof si&&so(e)}function ok(e){return oA(e)||oN(e)||function(e){if(e instanceof si&&sa(e)){for(let t of e.getFilters())if(!oA(t)&&!oN(t))return!1;return!0}return!1}(e)}function oR(e,t){return e instanceof sr||e instanceof si||rs(),t instanceof sr||t instanceof si||rs(),oL(e instanceof sr?t instanceof sr?si.create([e,t],"and"):oM(e,t):t instanceof sr?oM(t,e):function(e,t){if(e.filters.length>0&&t.filters.length>0||rs(),ss(e)&&ss(t))return su(e,t.getFilters());let n=sa(e)?e:t,r=sa(e)?t:e,i=n.filters.map(e=>oR(e,r));return si.create(i,"or")}(e,t))}function oM(e,t){if(ss(t))return su(t,e.getFilters());{let n=t.filters.map(t=>oR(e,t));return si.create(n,"or")}}function oL(e){if(e instanceof sr||e instanceof si||rs(),e instanceof sr)return e;let t=e.getFilters();if(1===t.length)return oL(t[0]);if(sl(e))return e;let n=t.map(e=>oL(e)),r=[];return n.forEach(t=>{t instanceof sr?r.push(t):t instanceof si&&(t.op===e.op?r.push(...t.filters):r.push(t))}),1===r.length?r[0]:si.create(r,e.op)}class oO{constructor(){this._n=new oP}addToCollectionParentIndex(e,t){return this._n.add(t),rz.resolve()}getCollectionParents(e,t){return rz.resolve(this._n.getEntries(t))}addFieldIndex(e,t){return rz.resolve()}deleteFieldIndex(e,t){return rz.resolve()}deleteAllFieldIndexes(e){return rz.resolve()}createTargetIndexes(e,t){return rz.resolve()}getDocumentsMatchingTarget(e,t){return rz.resolve(null)}getIndexType(e,t){return rz.resolve(0)}getFieldIndexes(e,t){return rz.resolve([])}getNextCollectionGroupToUpdate(e){return rz.resolve(null)}getMinOffset(e,t){return rz.resolve(rF.min())}getMinOffsetFromCollectionGroup(e,t){return rz.resolve(rF.min())}updateCollectionGroup(e,t,n){return rz.resolve()}updateIndexEntries(e,t){return rz.resolve()}}class oP{constructor(){this.index={}}add(e){let t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new iS(rT.comparator),i=!r.has(n);return this.index[t]=r.add(n),i}has(e){let t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new iS(rT.comparator)).toArray()}}let oF=new Uint8Array(0);class oV{constructor(e,t){this.databaseId=t,this.an=new oP,this.un=new sU(e=>sb(e),(e,t)=>sx(e,t)),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.an.has(t)){let n=t.lastSegment(),r=t.popLast();e.addOnCommittedListener(()=>{this.an.add(t)});let i={collectionId:n,parent:r6(r)};return oq(e).put(i)}return rz.resolve()}getCollectionParents(e,t){let n=[],r=IDBKeyRange.bound([t,""],[t+"\0",""],!1,!0);return oq(e).W(r).next(e=>{for(let r of e){if(r.collectionId!==t)break;n.push(r3(r.parent))}return n})}addFieldIndex(e,t){let n=oU(e),r={indexId:t.indexId,collectionGroup:t.collectionGroup,fields:t.fields.map(e=>[e.fieldPath.canonicalString(),e.kind])};delete r.indexId;let i=n.add(r);if(t.indexState){let n=oz(e);return i.next(e=>{n.put(od(e,this.uid,t.indexState.sequenceNumber,t.indexState.offset))})}return i.next()}deleteFieldIndex(e,t){let n=oU(e),r=oz(e),i=oB(e);return n.delete(t.indexId).next(()=>r.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))).next(()=>i.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))}deleteAllFieldIndexes(e){let t=oU(e),n=oB(e),r=oz(e);return t.H().next(()=>n.H()).next(()=>r.H())}createTargetIndexes(e,t){return rz.forEach(this.cn(t),t=>this.getIndexType(e,t).next(n=>{if(0===n||1===n){let n=new oD(t).on();if(null!=n)return this.addFieldIndex(e,n)}}))}getDocumentsMatchingTarget(e,t){let n=oB(e),r=!0,i=new Map;return rz.forEach(this.cn(t),t=>this.ln(e,t).next(e=>{r&&(r=!!e),i.set(t,e)})).next(()=>{if(r){let e=sW(),r=[];return rz.forEach(i,(i,s)=>{rt("IndexedDbIndexManager",`Using index id=${i.indexId}|cg=${i.collectionGroup}|f=${i.fields.map(e=>`${e.fieldPath}:${e.kind}`).join(",")} to execute ${sb(t)}`);let a=function(e,t){let n=rN(t);if(void 0===n)return null;for(let t of sI(e,n.fieldPath))switch(t.op){case"array-contains-any":return t.value.arrayValue.values||[];case"array-contains":return[t.value]}return null}(s,i),o=function(e,t){let n=new Map;for(let r of rk(t))for(let t of sI(e,r.fieldPath))switch(t.op){case"==":case"in":n.set(r.fieldPath.canonicalString(),t.value);break;case"not-in":case"!=":return n.set(r.fieldPath.canonicalString(),t.value),Array.from(n.values())}return null}(s,i),l=function(e,t){let n=[],r=!0;for(let i of rk(t)){let t=0===i.kind?sE(e,i.fieldPath,e.startAt):sT(e,i.fieldPath,e.startAt);n.push(t.value),r&&(r=t.inclusive)}return new i9(n,r)}(s,i),u=function(e,t){let n=[],r=!0;for(let i of rk(t)){let t=0===i.kind?sT(e,i.fieldPath,e.endAt):sE(e,i.fieldPath,e.endAt);n.push(t.value),r&&(r=t.inclusive)}return new i9(n,r)}(s,i),h=this.hn(i,s,l),c=this.hn(i,s,u),f=this.Pn(i,s,o),d=this.In(i.indexId,a,h,l.inclusive,c,u.inclusive,f);return rz.forEach(d,i=>n.j(i,t.limit).next(t=>{t.forEach(t=>{let n=rD.fromSegments(t.documentKey);e.has(n)||(e=e.add(n),r.push(n))})}))}).next(()=>r)}return rz.resolve(null)})}cn(e){let t=this.un.get(e);return t||(t=0===e.filters.length?[e]:(function(e){if(0===e.getFilters().length)return[];let t=function e(t){if(t instanceof sr||t instanceof si||rs(),t instanceof sr)return t;if(1===t.filters.length)return e(t.filters[0]);let n=t.filters.map(t=>e(t)),r=si.create(n,t.op);return ok(r=oL(r))?r:(r instanceof si||rs(),ss(r)||rs(),r.filters.length>1||rs(),r.filters.reduce((e,t)=>oR(e,t)))}(function e(t){var n,r;if(t instanceof sr||t instanceof si||rs(),t instanceof sr){if(t instanceof sm){let e=(null===(r=null===(n=t.value.arrayValue)||void 0===n?void 0:n.values)||void 0===r?void 0:r.map(e=>sr.create(t.field,"==",e)))||[];return si.create(e,"or")}return t}let i=t.filters.map(t=>e(t));return si.create(i,t.op)}(e));return ok(t)||rs(),oA(t)||oN(t)?[t]:t.getFilters()})(si.create(e.filters,"and")).map(t=>sv(e.path,e.collectionGroup,e.orderBy,t.getFilters(),e.limit,e.startAt,e.endAt)),this.un.set(e,t),t)}In(e,t,n,r,i,s,a){let o=(null!=t?t.length:1)*Math.max(n.length,i.length),l=o/(null!=t?t.length:1),u=[];for(let h=0;hthis.En(e,o,t,!0));u.push(...this.createRange(c,f,d))}return u}En(e,t,n,r){let i=new oT(e,rD.empty(),t,n);return r?i:i.Jt()}dn(e,t,n,r){let i=new oT(e,rD.empty(),t,n);return r?i.Jt():i}ln(e,t){let n=new oD(t),r=null!=t.collectionGroup?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,r).next(e=>{let t=null;for(let r of e)n.tn(r)&&(!t||r.fields.length>t.fields.length)&&(t=r);return t})}getIndexType(e,t){let n=2,r=this.cn(t);return rz.forEach(r,t=>this.ln(e,t).next(e=>{e?0!==n&&e.fields.lengthnull!==t.limit&&r.length>1&&2===n?1:n)}An(e,t){let n=new oE;for(let r of rk(e)){let e=t.data.field(r.fieldPath);if(null==e)return null;let i=n.Ht(r.kind);ov.bt.Pt(e,i)}return n.Wt()}Tn(e){let t=new oE;return ov.bt.Pt(e,t.Ht(0)),t.Wt()}Rn(e,t){let n=new oE;return ov.bt.Pt(iY(this.databaseId,t),n.Ht(function(e){let t=rk(e);return 0===t.length?0:t[t.length-1].kind}(e))),n.Wt()}Pn(e,t,n){if(null===n)return[];let r=[];r.push(new oE);let i=0;for(let s of rk(e)){let e=n[i++];for(let n of r)if(this.Vn(t,s.fieldPath)&&iJ(e))r=this.mn(r,s,e);else{let t=n.Ht(s.kind);ov.bt.Pt(e,t)}}return this.fn(r)}hn(e,t,n){return this.Pn(e,t,n.position)}fn(e){let t=[];for(let n=0;ne instanceof sr&&e.field.isEqual(t)&&("in"===e.op||"not-in"===e.op))}getFieldIndexes(e,t){let n=oU(e),r=oz(e);return(t?n.W("collectionGroupIndex",IDBKeyRange.bound(t,t)):n.W()).next(e=>{let t=[];return rz.forEach(e,e=>r.get([e.indexId,this.uid]).next(n=>{t.push(function(e,t){let n=t?new rL(t.sequenceNumber,new rF(oa(t.readTime),new rD(r3(t.documentKey)),t.largestBatchId)):rL.empty(),r=e.fields.map(([e,t])=>new rM(rC.fromServerFormat(e),t));return new rA(e.indexId,e.collectionGroup,r,n)}(e,n))})).next(()=>t)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(e=>0===e.length?null:(e.sort((e,t)=>{let n=e.indexState.sequenceNumber-t.indexState.sequenceNumber;return 0!==n?n:rb(e.collectionGroup,t.collectionGroup)}),e[0].collectionGroup))}updateCollectionGroup(e,t,n){let r=oU(e),i=oz(e);return this.gn(e).next(e=>r.W("collectionGroupIndex",IDBKeyRange.bound(t,t)).next(t=>rz.forEach(t,t=>i.put(od(t.indexId,this.uid,e,n)))))}updateIndexEntries(e,t){let n=new Map;return rz.forEach(t,(t,r)=>{let i=n.get(t.collectionGroup);return(i?rz.resolve(i):this.getFieldIndexes(e,t.collectionGroup)).next(i=>(n.set(t.collectionGroup,i),rz.forEach(i,n=>this.pn(e,t,n).next(t=>{let i=this.yn(r,n);return t.isEqual(i)?rz.resolve():this.wn(e,r,n,t,i)}))))})}Sn(e,t,n,r){return oB(e).put({indexId:r.indexId,uid:this.uid,arrayValue:r.arrayValue,directionalValue:r.directionalValue,orderedDocumentKey:this.Rn(n,t.key),documentKey:t.key.path.toArray()})}bn(e,t,n,r){return oB(e).delete([r.indexId,this.uid,r.arrayValue,r.directionalValue,this.Rn(n,t.key),t.key.path.toArray()])}pn(e,t,n){let r=oB(e),i=new iS(oS);return r.Y({index:"documentKeyIndex",range:IDBKeyRange.only([n.indexId,this.uid,this.Rn(n,t)])},(e,r)=>{i=i.add(new oT(n.indexId,t,r.arrayValue,r.directionalValue))}).next(()=>i)}yn(e,t){let n=new iS(oS),r=this.An(t,e);if(null==r)return n;let i=rN(t);if(null!=i){let s=e.data.field(i.fieldPath);if(iJ(s))for(let i of s.arrayValue.values||[])n=n.add(new oT(t.indexId,e.key,this.Tn(i),r))}else n=n.add(new oT(t.indexId,e.key,oF,r));return n}wn(e,t,n,r,i){rt("IndexedDbIndexManager","Updating index entries for document '%s'",t.key);let s=[];return function(e,t,n,r,i){let s=e.getIterator(),a=t.getIterator(),o=iD(s),l=iD(a);for(;o||l;){let e=!1,t=!1;if(o&&l){let r=n(o,l);r<0?t=!0:r>0&&(e=!0)}else null!=o?t=!0:e=!0;e?(r(l),l=iD(a)):t?(i(o),o=iD(s)):(o=iD(s),l=iD(a))}}(r,i,oS,r=>{s.push(this.Sn(e,t,n,r))},r=>{s.push(this.bn(e,t,n,r))}),rz.waitFor(s)}gn(e){let t=1;return oz(e).Y({index:"sequenceNumberIndex",reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(e,n,r)=>{r.done(),t=n.sequenceNumber+1}).next(()=>t)}createRange(e,t,n){n=n.sort((e,t)=>oS(e,t)).filter((e,t,n)=>!t||0!==oS(e,n[t-1]));let r=[];for(let i of(r.push(e),n)){let n=oS(i,e),s=oS(i,t);if(0===n)r[0]=e.Jt();else if(n>0&&s<0)r.push(i),r.push(i.Jt());else if(s>0)break}r.push(t);let i=[];for(let e=0;e0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(oG)}getMinOffset(e,t){return rz.mapArray(this.cn(t),t=>this.ln(e,t).next(e=>e||rs())).next(oG)}}function oq(e){return iv(e,"collectionParents")}function oB(e){return iv(e,"indexEntries")}function oU(e){return iv(e,"indexConfiguration")}function oz(e){return iv(e,"indexState")}function oG(e){0!==e.length||rs();let t=e[0].indexState.offset,n=t.largestBatchId;for(let r=1;rrV(i,t)&&(t=i),n(o++,n.delete()));s.push(l.next(()=>{1===o||rs()}));let u=[];for(let e of n.mutations){var h,c;let r=(h=e.key.path,c=n.batchId,[t,r6(h),c]);s.push(i.delete(r)),u.push(e.key)}return rz.waitFor(s).next(()=>u)}function oQ(e){let t;if(!e)return 0;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw rs();t=e.noDocument}return JSON.stringify(t).length}oK.DEFAULT_COLLECTION_PERCENTILE=10,oK.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,oK.DEFAULT=new oK(0x2800000,oK.DEFAULT_COLLECTION_PERCENTILE,oK.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),oK.DISABLED=new oK(-1,0,0);class oH{constructor(e,t,n,r){this.userId=e,this.serializer=t,this.indexManager=n,this.referenceDelegate=r,this.Cn={}}static lt(e,t,n,r){return""!==e.uid||rs(),new oH(e.isAuthenticated()?e.uid:"",t,n,r)}checkEmpty(e){let t=!0,n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return oY(e).Y({index:"userMutationsIndex",range:n},(e,n,r)=>{t=!1,r.done()}).next(()=>t)}addMutationBatch(e,t,n,r){let i=oX(e),s=oY(e);return s.add({}).next(a=>{"number"==typeof a||rs();let o=new am(a,t,n,r),l=function(e,t,n){let r=n.baseMutations.map(t=>a5(e.ct,t)),i=n.mutations.map(t=>a5(e.ct,t));return{userId:t,batchId:n.batchId,localWriteTimeMs:n.localWriteTime.toMillis(),baseMutations:r,mutations:i}}(this.serializer,this.userId,o),u=[],h=new iS((e,t)=>rb(e.canonicalString(),t.canonicalString()));for(let e of r){let t=[this.userId,r6(e.key.path),a];h=h.add(e.key.path.popLast()),u.push(s.put(l)),u.push(i.put(t,r8))}return h.forEach(t=>{u.push(this.indexManager.addToCollectionParentIndex(e,t))}),e.addOnCommittedListener(()=>{this.Cn[a]=o.keys()}),rz.waitFor(u).next(()=>o)})}lookupMutationBatch(e,t){return oY(e).get(t).next(e=>e?(e.userId===this.userId||rs(),oo(this.serializer,e)):null)}vn(e,t){return this.Cn[t]?rz.resolve(this.Cn[t]):this.lookupMutationBatch(e,t).next(e=>{if(e){let n=e.keys();return this.Cn[t]=n,n}return null})}getNextMutationBatchAfterBatchId(e,t){let n=t+1,r=IDBKeyRange.lowerBound([this.userId,n]),i=null;return oY(e).Y({index:"userMutationsIndex",range:r},(e,t,r)=>{t.userId===this.userId&&(t.batchId>=n||rs(),i=oo(this.serializer,t)),r.done()}).next(()=>i)}getHighestUnacknowledgedBatchId(e){let t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]),n=-1;return oY(e).Y({index:"userMutationsIndex",range:t,reverse:!0},(e,t,r)=>{n=t.batchId,r.done()}).next(()=>n)}getAllMutationBatches(e){let t=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return oY(e).W("userMutationsIndex",t).next(e=>e.map(e=>oo(this.serializer,e)))}getAllMutationBatchesAffectingDocumentKey(e,t){let n=[this.userId,r6(t.path)],r=IDBKeyRange.lowerBound(n),i=[];return oX(e).Y({range:r},(n,r,s)=>{let[a,o,l]=n,u=r3(o);if(a===this.userId&&t.path.isEqual(u))return oY(e).get(l).next(e=>{if(!e)throw rs();e.userId===this.userId||rs(),i.push(oo(this.serializer,e))});s.done()}).next(()=>i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new iS(rb),r=[];return t.forEach(t=>{let i=[this.userId,r6(t.path)],s=IDBKeyRange.lowerBound(i),a=oX(e).Y({range:s},(e,r,i)=>{let[s,a,o]=e,l=r3(a);s===this.userId&&t.path.isEqual(l)?n=n.add(o):i.done()});r.push(a)}),rz.waitFor(r).next(()=>this.Fn(e,n))}getAllMutationBatchesAffectingQuery(e,t){let n=t.path,r=n.length+1,i=[this.userId,r6(n)],s=IDBKeyRange.lowerBound(i),a=new iS(rb);return oX(e).Y({range:s},(e,t,i)=>{let[s,o,l]=e,u=r3(o);s===this.userId&&n.isPrefixOf(u)?u.length===r&&(a=a.add(l)):i.done()}).next(()=>this.Fn(e,a))}Fn(e,t){let n=[],r=[];return t.forEach(t=>{r.push(oY(e).get(t).next(e=>{if(null===e)throw rs();e.userId===this.userId||rs(),n.push(oo(this.serializer,e))}))}),rz.waitFor(r).next(()=>n)}removeMutationBatch(e,t){return o$(e.ae,this.userId,t).next(n=>(e.addOnCommittedListener(()=>{this.Mn(t.batchId)}),rz.forEach(n,t=>this.referenceDelegate.markPotentiallyOrphaned(e,t))))}Mn(e){delete this.Cn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(t=>{if(!t)return rz.resolve();let n=IDBKeyRange.lowerBound([this.userId]),r=[];return oX(e).Y({range:n},(e,t,n)=>{if(e[0]===this.userId){let t=r3(e[1]);r.push(t)}else n.done()}).next(()=>{0===r.length||rs()})})}containsKey(e,t){return oW(e,this.userId,t)}xn(e){return oJ(e).get(this.userId).next(e=>e||{userId:this.userId,lastAcknowledgedBatchId:-1,lastStreamToken:""})}}function oW(e,t,n){let r=[t,r6(n.path)],i=r[1],s=IDBKeyRange.lowerBound(r),a=!1;return oX(e).Y({range:s,J:!0},(e,n,r)=>{let[s,o,l]=e;s===t&&o===i&&(a=!0),r.done()}).next(()=>a)}function oY(e){return iv(e,"mutations")}function oX(e){return iv(e,"documentMutations")}function oJ(e){return iv(e,"mutationQueues")}class oZ{constructor(e){this.On=e}next(){return this.On+=2,this.On}static Nn(){return new oZ(0)}static Bn(){return new oZ(-1)}}class o0{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.Ln(e).next(t=>{let n=new oZ(t.highestTargetId);return t.highestTargetId=n.next(),this.kn(e,t).next(()=>t.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.Ln(e).next(e=>rI.fromTimestamp(new r_(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.Ln(e).next(e=>e.highestListenSequenceNumber)}setTargetsMetadata(e,t,n){return this.Ln(e).next(r=>(r.highestListenSequenceNumber=t,n&&(r.lastRemoteSnapshotVersion=n.toTimestamp()),t>r.highestListenSequenceNumber&&(r.highestListenSequenceNumber=t),this.kn(e,r)))}addTargetData(e,t){return this.qn(e,t).next(()=>this.Ln(e).next(n=>(n.targetCount+=1,this.Qn(t,n),this.kn(e,n))))}updateTargetData(e,t){return this.qn(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next(()=>o1(e).delete(t.targetId)).next(()=>this.Ln(e)).next(t=>(t.targetCount>0||rs(),t.targetCount-=1,this.kn(e,t)))}removeTargets(e,t,n){let r=0,i=[];return o1(e).Y((s,a)=>{let o=ol(a);o.sequenceNumber<=t&&null===n.get(o.targetId)&&(r++,i.push(this.removeTargetData(e,o)))}).next(()=>rz.waitFor(i)).next(()=>r)}forEachTarget(e,t){return o1(e).Y((e,n)=>{t(ol(n))})}Ln(e){return o2(e).get("targetGlobalKey").next(e=>(null!==e||rs(),e))}kn(e,t){return o2(e).put("targetGlobalKey",t)}qn(e,t){return o1(e).put(ou(this.serializer,t))}Qn(e,t){let n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n}getTargetCount(e){return this.Ln(e).next(e=>e.targetCount)}getTargetData(e,t){let n=sb(t),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]),i=null;return o1(e).Y({range:r,index:"queryTargetsIndex"},(e,n,r)=>{let s=ol(n);sx(t,s.target)&&(i=s,r.done())}).next(()=>i)}addMatchingKeys(e,t,n){let r=[],i=o5(e);return t.forEach(t=>{let s=r6(t.path);r.push(i.put({targetId:n,path:s})),r.push(this.referenceDelegate.addReference(e,n,t))}),rz.waitFor(r)}removeMatchingKeys(e,t,n){let r=o5(e);return rz.forEach(t,t=>{let i=r6(t.path);return rz.waitFor([r.delete([n,i]),this.referenceDelegate.removeReference(e,n,t)])})}removeMatchingKeysForTargetId(e,t){let n=o5(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)}getMatchingKeysForTargetId(e,t){let n=IDBKeyRange.bound([t],[t+1],!1,!0),r=o5(e),i=sW();return r.Y({range:n,J:!0},(e,t,n)=>{let r=new rD(r3(e[1]));i=i.add(r)}).next(()=>i)}containsKey(e,t){let n=r6(t.path),r=IDBKeyRange.bound([n],[n+"\0"],!1,!0),i=0;return o5(e).Y({index:"documentTargetsIndex",J:!0,range:r},([e,t],n,r)=>{0!==e&&(i++,r.done())}).next(()=>i>0)}_t(e,t){return o1(e).get(t).next(e=>e?ol(e):null)}}function o1(e){return iv(e,"targets")}function o2(e){return iv(e,"targetGlobal")}function o5(e){return iv(e,"targetDocuments")}function o6([e,t],[n,r]){let i=rb(e,n);return 0===i?rb(t,r):i}class o3{constructor(e){this.Kn=e,this.buffer=new iS(o6),this.$n=0}Un(){return++this.$n}Wn(e){let t=[e,this.Un()];if(this.buffer.sizeo6(t,e)&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class o4{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.Gn=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.zn(6e4)}stop(){this.Gn&&(this.Gn.cancel(),this.Gn=null)}get started(){return null!==this.Gn}zn(e){rt("LruGarbageCollector",`Garbage collection scheduled in ${e}ms`),this.Gn=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Gn=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){rQ(e)?rt("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e):await rU(e)}await this.zn(3e5)})}}class o8{constructor(e,t){this.jn=e,this.params=t}calculateTargetCount(e,t){return this.jn.Hn(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return rz.resolve(r0._e);let n=new o3(t);return this.jn.forEachTarget(e,e=>n.Wn(e.sequenceNumber)).next(()=>this.jn.Jn(e,e=>n.Wn(e))).next(()=>n.maxValue)}removeTargets(e,t,n){return this.jn.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.jn.removeOrphanedDocuments(e,t)}collect(e,t){return -1===this.params.cacheSizeCollectionThreshold?(rt("LruGarbageCollector","Garbage collection skipped; disabled"),rz.resolve(oj)):this.getCacheSize(e).next(n=>n(t>this.params.maximumSequenceNumbersToCollect?(rt("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),r=this.params.maximumSequenceNumbersToCollect):r=t,s=Date.now(),this.nthSequenceNumber(e,r))).next(r=>(n=r,a=Date.now(),this.removeTargets(e,n,t))).next(t=>(i=t,o=Date.now(),this.removeOrphanedDocuments(e,n))).next(e=>(l=Date.now(),n7()<=R.DEBUG&&rt("LruGarbageCollector",`LRU Garbage Collection + Counted targets in ${s-u}ms + Determined least recently used ${r} in `+(a-s)+"ms\n"+` Removed ${i} targets in `+(o-a)+"ms\n"+` Removed ${e} documents in `+(l-o)+"ms\n"+`Total Duration: ${l-u}ms`),rz.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:e})))}}class o9{constructor(e,t){this.db=e,this.garbageCollector=new o8(this,t)}Hn(e){let t=this.Zn(e);return this.db.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Zn(e){let t=0;return this.Jn(e,e=>{t++}).next(()=>t)}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}Jn(e,t){return this.Xn(e,(e,n)=>t(n))}addReference(e,t,n){return o7(e,n)}removeReference(e,t,n){return o7(e,n)}removeTargets(e,t,n){return this.db.getTargetCache().removeTargets(e,t,n)}markPotentiallyOrphaned(e,t){return o7(e,t)}er(e,t){let n;return n=!1,oJ(e).Z(r=>oW(e,r,t).next(e=>(e&&(n=!0),rz.resolve(!e)))).next(()=>n)}removeOrphanedDocuments(e,t){let n=this.db.getRemoteDocumentCache().newChangeBuffer(),r=[],i=0;return this.Xn(e,(s,a)=>{if(a<=t){let t=this.er(e,s).next(t=>{if(!t)return i++,n.getEntry(e,s).next(()=>(n.removeEntry(s,rI.min()),o5(e).delete([0,r6(s.path)])))});r.push(t)}}).next(()=>rz.waitFor(r)).next(()=>n.apply(e)).next(()=>i)}removeTarget(e,t){let n=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,n)}updateLimboDocument(e,t){return o7(e,t)}Xn(e,t){let n=o5(e),r,i=r0._e;return n.Y({index:"documentTargetsIndex"},([e,n],{path:s,sequenceNumber:a})=>{0===e?(i!==r0._e&&t(new rD(r3(r)),i),i=a,r=s):i=r0._e}).next(()=>{i!==r0._e&&t(new rD(r3(r)),i)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function o7(e,t){var n;return o5(e).put((n=e.currentSequenceNumber,{targetId:0,path:r6(t.path),sequenceNumber:n}))}class le{constructor(){this.changes=new sU(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,i8.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();let n=this.changes.get(t);return void 0!==n?rz.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class lt{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,n){return li(e).put(n)}removeEntry(e,t,n){return li(e).delete(function(e,t){let n=e.path.toArray();return[n.slice(0,n.length-2),n[n.length-2],oi(t),n[n.length-1]]}(t,n))}updateMetadata(e,t){return this.getMetadata(e).next(n=>(n.byteSize+=t,this.tr(e,n)))}getEntry(e,t){let n=i8.newInvalidDocument(t);return li(e).Y({index:"documentKeyIndex",range:IDBKeyRange.only(ls(t))},(e,r)=>{n=this.nr(t,r)}).next(()=>n)}rr(e,t){let n={size:0,document:i8.newInvalidDocument(t)};return li(e).Y({index:"documentKeyIndex",range:IDBKeyRange.only(ls(t))},(e,r)=>{n={document:this.nr(t,r),size:oQ(r)}}).next(()=>n)}getEntries(e,t){let n=sz;return this.ir(e,t,(e,t)=>{let r=this.nr(e,t);n=n.insert(e,r)}).next(()=>n)}sr(e,t){let n=sz,r=new iI(rD.comparator);return this.ir(e,t,(e,t)=>{let i=this.nr(e,t);n=n.insert(e,i),r=r.insert(e,oQ(t))}).next(()=>({documents:n,_r:r}))}ir(e,t,n){if(t.isEmpty())return rz.resolve();let r=new iS(lo);t.forEach(e=>r=r.add(e));let i=IDBKeyRange.bound(ls(r.first()),ls(r.last())),s=r.getIterator(),a=s.getNext();return li(e).Y({index:"documentKeyIndex",range:i},(e,t,r)=>{let i=rD.fromSegments([...t.prefixPath,t.collectionGroup,t.documentId]);for(;a&&0>lo(a,i);)n(a,null),a=s.getNext();a&&a.isEqual(i)&&(n(a,t),a=s.hasNext()?s.getNext():null),a?r.U(ls(a)):r.done()}).next(()=>{for(;a;)n(a,null),a=s.hasNext()?s.getNext():null})}getDocumentsMatchingQuery(e,t,n,r,i){let s=t.path,a=[s.popLast().toArray(),s.lastSegment(),oi(n.readTime),n.documentKey.path.isEmpty()?"":n.documentKey.path.lastSegment()],o=[s.popLast().toArray(),s.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return li(e).W(IDBKeyRange.bound(a,o,!0)).next(e=>{null==i||i.incrementDocumentReadCount(e.length);let n=sz;for(let i of e){let e=this.nr(rD.fromSegments(i.prefixPath.concat(i.collectionGroup,i.documentId)),i);e.isFoundDocument()&&(sV(t,e)||r.has(e.key))&&(n=n.insert(e.key,e))}return n})}getAllFromCollectionGroup(e,t,n,r){let i=sz,s=la(t,n),a=la(t,rF.max());return li(e).Y({index:"collectionGroupIndex",range:IDBKeyRange.bound(s,a,!0)},(e,t,n)=>{let s=this.nr(rD.fromSegments(t.prefixPath.concat(t.collectionGroup,t.documentId)),t);(i=i.insert(s.key,s)).size===r&&n.done()}).next(()=>i)}newChangeBuffer(e){return new ln(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(e=>e.byteSize)}getMetadata(e){return lr(e).get("remoteDocumentGlobalKey").next(e=>(e||rs(),e))}tr(e,t){return lr(e).put("remoteDocumentGlobalKey",t)}nr(e,t){if(t){let e=function(e,t){let n;if(t.document)n=a2(e.ct,t.document,!!t.hasCommittedMutations);else if(t.noDocument){let e=rD.fromSegments(t.noDocument.path),r=oa(t.noDocument.readTime);n=i8.newNoDocument(e,r),t.hasCommittedMutations&&n.setHasCommittedMutations()}else{if(!t.unknownDocument)return rs();{let e=rD.fromSegments(t.unknownDocument.path),r=oa(t.unknownDocument.version);n=i8.newUnknownDocument(e,r)}}return t.readTime&&n.setReadTime(function(e){let t=new r_(e[0],e[1]);return rI.fromTimestamp(t)}(t.readTime)),n}(this.serializer,t);if(!e.isNoDocument()||!e.version.isEqual(rI.min()))return e}return i8.newInvalidDocument(e)}}class ln extends le{constructor(e,t){super(),this.ar=e,this.trackRemovals=t,this.ur=new sU(e=>e.toString(),(e,t)=>e.isEqual(t))}applyChanges(e){let t=[],n=0,r=new iS((e,t)=>rb(e.canonicalString(),t.canonicalString()));return this.changes.forEach((i,s)=>{let a=this.ur.get(i);if(t.push(this.ar.removeEntry(e,i,a.readTime)),s.isValidDocument()){let o=or(this.ar.serializer,s);r=r.add(i.path.popLast());let l=oQ(o);n+=l-a.size,t.push(this.ar.addEntry(e,i,o))}else if(n-=a.size,this.trackRemovals){let n=or(this.ar.serializer,s.convertToNoDocument(rI.min()));t.push(this.ar.addEntry(e,i,n))}}),r.forEach(n=>{t.push(this.ar.indexManager.addToCollectionParentIndex(e,n))}),t.push(this.ar.updateMetadata(e,n)),rz.waitFor(t)}getFromCache(e,t){return this.ar.rr(e,t).next(e=>(this.ur.set(t,{size:e.size,readTime:e.document.readTime}),e.document))}getAllFromCache(e,t){return this.ar.sr(e,t).next(({documents:e,_r:t})=>(t.forEach((t,n)=>{this.ur.set(t,{size:n,readTime:e.get(t).readTime})}),e))}}function lr(e){return iv(e,"remoteDocumentGlobal")}function li(e){return iv(e,"remoteDocumentsV14")}function ls(e){let t=e.path.toArray();return[t.slice(0,t.length-2),t[t.length-2],t[t.length-1]]}function la(e,t){let n=t.documentKey.path.toArray();return[e,oi(t.readTime),n.slice(0,n.length-2),n.length>0?n[n.length-1]:""]}function lo(e,t){let n=e.path.toArray(),r=t.path.toArray(),i=0;for(let e=0;e(n=r,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&aa(n.mutation,e,iA.empty(),r_.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,sW()).next(()=>t))}getLocalViewOfDocuments(e,t,n=sW()){let r=s$();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,n).next(e=>{let t=sj();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){let n=s$();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,sW()))}populateOverlays(e,t,n){let r=[];return n.forEach(e=>{t.has(e)||r.push(e)}),this.documentOverlayCache.getOverlays(e,r).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,r){let i=sz,s=s$(),a=s$();return t.forEach((e,t)=>{let a=n.get(t.key);r.has(t.key)&&(void 0===a||a.mutation instanceof au)?i=i.insert(t.key,t):void 0!==a?(s.set(t.key,a.mutation.getFieldMask()),aa(a.mutation,t,a.mutation.getFieldMask(),r_.now())):s.set(t.key,iA.empty())}),this.recalculateAndSaveOverlays(e,i).next(e=>(e.forEach((e,t)=>s.set(e,t)),t.forEach((e,t)=>{var n;return a.set(e,new ll(t,null!==(n=s.get(e))&&void 0!==n?n:null))}),a))}recalculateAndSaveOverlays(e,t){let n=s$(),r=new iI((e,t)=>e-t),i=sW();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(let i of e)i.keys().forEach(e=>{let s=t.get(e);if(null===s)return;let a=n.get(e)||iA.empty();a=i.applyToLocalView(s,a),n.set(e,a);let o=(r.get(i.batchId)||sW()).add(e);r=r.insert(i.batchId,o)})}).next(()=>{let s=[],a=r.getReverseIterator();for(;a.hasNext();){let r=a.getNext(),o=r.key,l=r.value,u=s$();l.forEach(e=>{if(!i.has(e)){let r=as(t.get(e),n.get(e));null!==r&&u.set(e,r),i=i.add(e)}}),s.push(this.documentOverlayCache.saveOverlays(e,o,u))}return rz.waitFor(s)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n,r){return rD.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length?this.getDocumentsMatchingDocumentQuery(e,t.path):sA(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,r):this.getDocumentsMatchingCollectionQuery(e,t,n,r)}getNextDocuments(e,t,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,r).next(i=>{let s=r-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,r-i.size):rz.resolve(s$()),a=-1,o=i;return s.next(t=>rz.forEach(t,(t,n)=>(a{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,i)).next(()=>this.computeViews(e,o,t,sW())).next(e=>({batchId:a,changes:sK(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new rD(t)).next(e=>{let t=sj();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n,r){let i=t.collectionGroup,s=sj();return this.indexManager.getCollectionParents(e,i).next(a=>rz.forEach(a,a=>{let o=new sS(a.child(i),null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt);return this.getDocumentsMatchingCollectionQuery(e,o,n,r).next(e=>{e.forEach((e,t)=>{s=s.insert(e,t)})})}).next(()=>s))}getDocumentsMatchingCollectionQuery(e,t,n,r){let i;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(s=>(i=s,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,i,r))).next(e=>{i.forEach((t,n)=>{let r=n.getKey();null===e.get(r)&&(e=e.insert(r,i8.newInvalidDocument(r)))});let n=sj();return e.forEach((e,r)=>{let s=i.get(e);void 0!==s&&aa(s.mutation,r,iA.empty(),r_.now()),sV(t,r)&&(n=n.insert(e,r))}),n})}}class lh{constructor(e){this.serializer=e,this.cr=new Map,this.lr=new Map}getBundleMetadata(e,t){return rz.resolve(this.cr.get(t))}saveBundleMetadata(e,t){return this.cr.set(t.id,{id:t.id,version:t.version,createTime:aK(t.createTime)}),rz.resolve()}getNamedQuery(e,t){return rz.resolve(this.lr.get(t))}saveNamedQuery(e,t){return this.lr.set(t.name,{name:t.name,query:oh(t.bundledQuery),readTime:aK(t.readTime)}),rz.resolve()}}class lc{constructor(){this.overlays=new iI(rD.comparator),this.hr=new Map}getOverlay(e,t){return rz.resolve(this.overlays.get(t))}getOverlays(e,t){let n=s$();return rz.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){return n.forEach((n,r)=>{this.ht(e,t,r)}),rz.resolve()}removeOverlaysForBatchId(e,t,n){let r=this.hr.get(n);return void 0!==r&&(r.forEach(e=>this.overlays=this.overlays.remove(e)),this.hr.delete(n)),rz.resolve()}getOverlaysForCollection(e,t,n){let r=s$(),i=t.length+1,s=new rD(t.child("")),a=this.overlays.getIteratorFrom(s);for(;a.hasNext();){let e=a.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===i&&e.largestBatchId>n&&r.set(e.getKey(),e)}return rz.resolve(r)}getOverlaysForCollectionGroup(e,t,n,r){let i=new iI((e,t)=>e-t),s=this.overlays.getIterator();for(;s.hasNext();){let e=s.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=i.get(e.largestBatchId);null===t&&(t=s$(),i=i.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}let a=s$(),o=i.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>a.set(e,t)),!(a.size()>=r)););return rz.resolve(a)}ht(e,t,n){let r=this.overlays.get(n.key);if(null!==r){let e=this.hr.get(r.largestBatchId).delete(n.key);this.hr.set(r.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new ay(t,n));let i=this.hr.get(t);void 0===i&&(i=sW(),this.hr.set(t,i)),this.hr.set(t,i.add(n.key))}}class lf{constructor(){this.Pr=new iS(ld.Ir),this.Tr=new iS(ld.Er)}isEmpty(){return this.Pr.isEmpty()}addReference(e,t){let n=new ld(e,t);this.Pr=this.Pr.add(n),this.Tr=this.Tr.add(n)}dr(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Ar(new ld(e,t))}Rr(e,t){e.forEach(e=>this.removeReference(e,t))}Vr(e){let t=new rD(new rT([])),n=new ld(t,e),r=new ld(t,e+1),i=[];return this.Tr.forEachInRange([n,r],e=>{this.Ar(e),i.push(e.key)}),i}mr(){this.Pr.forEach(e=>this.Ar(e))}Ar(e){this.Pr=this.Pr.delete(e),this.Tr=this.Tr.delete(e)}gr(e){let t=new rD(new rT([])),n=new ld(t,e),r=new ld(t,e+1),i=sW();return this.Tr.forEachInRange([n,r],e=>{i=i.add(e.key)}),i}containsKey(e){let t=new ld(e,0),n=this.Pr.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class ld{constructor(e,t){this.key=e,this.pr=t}static Ir(e,t){return rD.comparator(e.key,t.key)||rb(e.pr,t.pr)}static Er(e,t){return rb(e.pr,t.pr)||rD.comparator(e.key,t.key)}}class lg{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.yr=1,this.wr=new iS(ld.Ir)}checkEmpty(e){return rz.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,r){let i=this.yr;this.yr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];let s=new am(i,t,n,r);for(let t of(this.mutationQueue.push(s),r))this.wr=this.wr.add(new ld(t.key,i)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return rz.resolve(s)}lookupMutationBatch(e,t){return rz.resolve(this.Sr(t))}getNextMutationBatchAfterBatchId(e,t){let n=this.br(t+1),r=n<0?0:n;return rz.resolve(this.mutationQueue.length>r?this.mutationQueue[r]:null)}getHighestUnacknowledgedBatchId(){return rz.resolve(0===this.mutationQueue.length?-1:this.yr-1)}getAllMutationBatches(e){return rz.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){let n=new ld(t,0),r=new ld(t,Number.POSITIVE_INFINITY),i=[];return this.wr.forEachInRange([n,r],e=>{let t=this.Sr(e.pr);i.push(t)}),rz.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new iS(rb);return t.forEach(e=>{let t=new ld(e,0),r=new ld(e,Number.POSITIVE_INFINITY);this.wr.forEachInRange([t,r],e=>{n=n.add(e.pr)})}),rz.resolve(this.Dr(n))}getAllMutationBatchesAffectingQuery(e,t){let n=t.path,r=n.length+1,i=n;rD.isDocumentKey(i)||(i=i.child(""));let s=new ld(new rD(i),0),a=new iS(rb);return this.wr.forEachWhile(e=>{let t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(a=a.add(e.pr)),!0)},s),rz.resolve(this.Dr(a))}Dr(e){let t=[];return e.forEach(e=>{let n=this.Sr(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){0===this.Cr(t.batchId,"removed")||rs(),this.mutationQueue.shift();let n=this.wr;return rz.forEach(t.mutations,r=>{let i=new ld(r.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)}).next(()=>{this.wr=n})}Mn(e){}containsKey(e,t){let n=new ld(t,0),r=this.wr.firstAfterOrEqual(n);return rz.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,rz.resolve()}Cr(e,t){return this.br(e)}br(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Sr(e){let t=this.br(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class lm{constructor(e){this.vr=e,this.docs=new iI(rD.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){let n=t.key,r=this.docs.get(n),i=r?r.size:0,s=this.vr(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:s}),this.size+=s-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){let t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){let n=this.docs.get(t);return rz.resolve(n?n.document.mutableCopy():i8.newInvalidDocument(t))}getEntries(e,t){let n=sz;return t.forEach(e=>{let t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():i8.newInvalidDocument(e))}),rz.resolve(n)}getDocumentsMatchingQuery(e,t,n,r){let i=sz,s=t.path,a=new rD(s.child("")),o=this.docs.getIteratorFrom(a);for(;o.hasNext();){let{key:e,value:{document:a}}=o.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>s.length+1||0>=rV(rP(a),n)||(r.has(a.key)||sV(t,a))&&(i=i.insert(a.key,a.mutableCopy()))}return rz.resolve(i)}getAllFromCollectionGroup(e,t,n,r){rs()}Fr(e,t){return rz.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new lp(this)}getSize(e){return rz.resolve(this.size)}}class lp extends le{constructor(e){super(),this.ar=e}applyChanges(e){let t=[];return this.changes.forEach((n,r)=>{r.isValidDocument()?t.push(this.ar.addEntry(e,r)):this.ar.removeEntry(n)}),rz.waitFor(t)}getFromCache(e,t){return this.ar.getEntry(e,t)}getAllFromCache(e,t){return this.ar.getEntries(e,t)}}class ly{constructor(e){this.persistence=e,this.Mr=new sU(e=>sb(e),sx),this.lastRemoteSnapshotVersion=rI.min(),this.highestTargetId=0,this.Or=0,this.Nr=new lf,this.targetCount=0,this.Br=oZ.Nn()}forEachTarget(e,t){return this.Mr.forEach((e,n)=>t(n)),rz.resolve()}getLastRemoteSnapshotVersion(e){return rz.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return rz.resolve(this.Or)}allocateTargetId(e){return this.highestTargetId=this.Br.next(),rz.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.Or&&(this.Or=t),rz.resolve()}qn(e){this.Mr.set(e.target,e);let t=e.targetId;t>this.highestTargetId&&(this.Br=new oZ(t),this.highestTargetId=t),e.sequenceNumber>this.Or&&(this.Or=e.sequenceNumber)}addTargetData(e,t){return this.qn(t),this.targetCount+=1,rz.resolve()}updateTargetData(e,t){return this.qn(t),rz.resolve()}removeTargetData(e,t){return this.Mr.delete(t.target),this.Nr.Vr(t.targetId),this.targetCount-=1,rz.resolve()}removeTargets(e,t,n){let r=0,i=[];return this.Mr.forEach((s,a)=>{a.sequenceNumber<=t&&null===n.get(a.targetId)&&(this.Mr.delete(s),i.push(this.removeMatchingKeysForTargetId(e,a.targetId)),r++)}),rz.waitFor(i).next(()=>r)}getTargetCount(e){return rz.resolve(this.targetCount)}getTargetData(e,t){let n=this.Mr.get(t)||null;return rz.resolve(n)}addMatchingKeys(e,t,n){return this.Nr.dr(t,n),rz.resolve()}removeMatchingKeys(e,t,n){this.Nr.Rr(t,n);let r=this.persistence.referenceDelegate,i=[];return r&&t.forEach(t=>{i.push(r.markPotentiallyOrphaned(e,t))}),rz.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this.Nr.Vr(t),rz.resolve()}getMatchingKeysForTargetId(e,t){let n=this.Nr.gr(t);return rz.resolve(n)}containsKey(e,t){return rz.resolve(this.Nr.containsKey(t))}}class lw{constructor(e,t){this.Lr={},this.overlays={},this.kr=new r0(0),this.qr=!1,this.qr=!0,this.referenceDelegate=e(this),this.Qr=new ly(this),this.indexManager=new oO,this.remoteDocumentCache=new lm(e=>this.referenceDelegate.Kr(e)),this.serializer=new on(t),this.$r=new lh(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.qr=!1,Promise.resolve()}get started(){return this.qr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new lc,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.Lr[e.toKey()];return n||(n=new lg(t,this.referenceDelegate),this.Lr[e.toKey()]=n),n}getTargetCache(){return this.Qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.$r}runTransaction(e,t,n){rt("MemoryPersistence","Starting transaction:",e);let r=new lv(this.kr.next());return this.referenceDelegate.Ur(),n(r).next(e=>this.referenceDelegate.Wr(r).next(()=>e)).toPromise().then(e=>(r.raiseOnCommittedEvent(),e))}Gr(e,t){return rz.or(Object.values(this.Lr).map(n=>()=>n.containsKey(e,t)))}}class lv extends rB{constructor(e){super(),this.currentSequenceNumber=e}}class lb{constructor(e){this.persistence=e,this.zr=new lf,this.jr=null}static Hr(e){return new lb(e)}get Jr(){if(this.jr)return this.jr;throw rs()}addReference(e,t,n){return this.zr.addReference(n,t),this.Jr.delete(n.toString()),rz.resolve()}removeReference(e,t,n){return this.zr.removeReference(n,t),this.Jr.add(n.toString()),rz.resolve()}markPotentiallyOrphaned(e,t){return this.Jr.add(t.toString()),rz.resolve()}removeTarget(e,t){this.zr.Vr(t.targetId).forEach(e=>this.Jr.add(e.toString()));let n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.Jr.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}Ur(){this.jr=new Set}Wr(e){let t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return rz.forEach(this.Jr,n=>{let r=rD.fromPath(n);return this.Yr(e,r).next(e=>{e||t.removeEntry(r,rI.min())})}).next(()=>(this.jr=null,t.apply(e)))}updateLimboDocument(e,t){return this.Yr(e,t).next(e=>{e?this.Jr.delete(t.toString()):this.Jr.add(t.toString())})}Kr(e){return 0}Yr(e,t){return rz.or([()=>rz.resolve(this.zr.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Gr(e,t)])}}class lx{constructor(e,t){this.persistence=e,this.Zr=new sU(e=>r6(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=new o8(this,t)}static Hr(e,t){return new lx(e,t)}Ur(){}Wr(e){return rz.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}Hn(e){let t=this.Zn(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Zn(e){let t=0;return this.Jn(e,e=>{t++}).next(()=>t)}Jn(e,t){return rz.forEach(this.Zr,(n,r)=>this.er(e,n,r).next(e=>e?rz.resolve():t(r)))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0,r=this.persistence.getRemoteDocumentCache(),i=r.newChangeBuffer();return r.Fr(e,r=>this.er(e,r,t).next(e=>{e||(n++,i.removeEntry(r,rI.min()))})).next(()=>i.apply(e)).next(()=>n)}markPotentiallyOrphaned(e,t){return this.Zr.set(t,e.currentSequenceNumber),rz.resolve()}removeTarget(e,t){let n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.Zr.set(n,e.currentSequenceNumber),rz.resolve()}removeReference(e,t,n){return this.Zr.set(n,e.currentSequenceNumber),rz.resolve()}updateLimboDocument(e,t){return this.Zr.set(t,e.currentSequenceNumber),rz.resolve()}Kr(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=function e(t){switch(ij(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:let n=iV(t);return n?16+e(n):16;case 5:return 2*t.stringValue.length;case 6:return iP(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return(t.arrayValue.values||[]).reduce((t,n)=>t+e(n),0);case 10:var r;let i;return r=t.mapValue,i=0,ix(r.fields,(t,n)=>{i+=t.length+e(n)}),i;default:throw rs()}}(e.data.value)),t}er(e,t,n){return rz.or([()=>this.persistence.Gr(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{let e=this.Zr.get(t);return rz.resolve(void 0!==e&&e>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class l_{constructor(e){this.serializer=e}N(e,t,n,r){let i=new rG("createOrUpgrade",t);n<1&&r>=1&&(function(e){e.createObjectStore("owner")}(e),e.createObjectStore("mutationQueues",{keyPath:"userId"}),e.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",r4,{unique:!0}),e.createObjectStore("documentMutations"),lI(e),function(e){e.createObjectStore("remoteDocuments")}(e));let s=rz.resolve();return n<3&&r>=3&&(0!==n&&(e.deleteObjectStore("targetDocuments"),e.deleteObjectStore("targets"),e.deleteObjectStore("targetGlobal"),lI(e)),s=s.next(()=>(function(e){let t=e.store("targetGlobal"),n={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:rI.min().toTimestamp(),targetCount:0};return t.put("targetGlobalKey",n)})(i))),n<4&&r>=4&&(0!==n&&(s=s.next(()=>i.store("mutations").W().next(t=>{e.deleteObjectStore("mutations"),e.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",r4,{unique:!0});let n=i.store("mutations"),r=t.map(e=>n.put(e));return rz.waitFor(r)}))),s=s.next(()=>{!function(e){e.createObjectStore("clientMetadata",{keyPath:"clientId"})}(e)})),n<5&&r>=5&&(s=s.next(()=>this.Xr(i))),n<6&&r>=6&&(s=s.next(()=>((function(e){e.createObjectStore("remoteDocumentGlobal")})(e),this.ei(i)))),n<7&&r>=7&&(s=s.next(()=>this.ti(i))),n<8&&r>=8&&(s=s.next(()=>this.ni(e,i))),n<9&&r>=9&&(s=s.next(()=>{e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")})),n<10&&r>=10&&(s=s.next(()=>this.ri(i))),n<11&&r>=11&&(s=s.next(()=>{(function(e){e.createObjectStore("bundles",{keyPath:"bundleId"})})(e),function(e){e.createObjectStore("namedQueries",{keyPath:"name"})}(e)})),n<12&&r>=12&&(s=s.next(()=>{!function(e){let t=e.createObjectStore("documentOverlays",{keyPath:ih});t.createIndex("collectionPathOverlayIndex",ic,{unique:!1}),t.createIndex("collectionGroupOverlayIndex",id,{unique:!1})}(e)})),n<13&&r>=13&&(s=s.next(()=>(function(e){let t=e.createObjectStore("remoteDocumentsV14",{keyPath:r9});t.createIndex("documentKeyIndex",r7),t.createIndex("collectionGroupIndex",ie)})(e)).next(()=>this.ii(e,i)).next(()=>e.deleteObjectStore("remoteDocuments"))),n<14&&r>=14&&(s=s.next(()=>this.si(e,i))),n<15&&r>=15&&(s=s.next(()=>{e.createObjectStore("indexConfiguration",{keyPath:"indexId",autoIncrement:!0}).createIndex("collectionGroupIndex","collectionGroup",{unique:!1}),e.createObjectStore("indexState",{keyPath:ia}).createIndex("sequenceNumberIndex",io,{unique:!1}),e.createObjectStore("indexEntries",{keyPath:il}).createIndex("documentKeyIndex",iu,{unique:!1})})),s}ei(e){let t=0;return e.store("remoteDocuments").Y((e,n)=>{t+=oQ(n)}).next(()=>{let n={byteSize:t};return e.store("remoteDocumentGlobal").put("remoteDocumentGlobalKey",n)})}Xr(e){let t=e.store("mutationQueues"),n=e.store("mutations");return t.W().next(t=>rz.forEach(t,t=>{let r=IDBKeyRange.bound([t.userId,-1],[t.userId,t.lastAcknowledgedBatchId]);return n.W("userMutationsIndex",r).next(n=>rz.forEach(n,n=>{n.userId===t.userId||rs();let r=oo(this.serializer,n);return o$(e,t.userId,r).next(()=>{})}))}))}ti(e){let t=e.store("targetDocuments"),n=e.store("remoteDocuments");return e.store("targetGlobal").get("targetGlobalKey").next(e=>{let r=[];return n.Y((n,i)=>{let s=new rT(n),a=[0,r6(s)];r.push(t.get(a).next(n=>n?rz.resolve():t.put({targetId:0,path:r6(s),sequenceNumber:e.highestListenSequenceNumber})))}).next(()=>rz.waitFor(r))})}ni(e,t){e.createObjectStore("collectionParents",{keyPath:is});let n=t.store("collectionParents"),r=new oP,i=e=>{if(r.add(e)){let t=e.lastSegment(),r=e.popLast();return n.put({collectionId:t,parent:r6(r)})}};return t.store("remoteDocuments").Y({J:!0},(e,t)=>i(new rT(e).popLast())).next(()=>t.store("documentMutations").Y({J:!0},([e,t,n],r)=>i(r3(t).popLast())))}ri(e){let t=e.store("targets");return t.Y((e,n)=>{let r=ol(n),i=ou(this.serializer,r);return t.put(i)})}ii(e,t){let n=t.store("remoteDocuments"),r=[];return n.Y((e,n)=>{let i=t.store("remoteDocumentsV14"),s=(n.document?new rD(rT.fromString(n.document.name).popFirst(5)):n.noDocument?rD.fromSegments(n.noDocument.path):n.unknownDocument?rD.fromSegments(n.unknownDocument.path):rs()).path.toArray(),a={prefixPath:s.slice(0,s.length-2),collectionGroup:s[s.length-2],documentId:s[s.length-1],readTime:n.readTime||[0,0],unknownDocument:n.unknownDocument,noDocument:n.noDocument,document:n.document,hasCommittedMutations:!!n.hasCommittedMutations};r.push(i.put(a))}).next(()=>rz.waitFor(r))}si(e,t){let n=t.store("mutations"),r=new lt(this.serializer),i=new lw(lb.Hr,this.serializer.ct);return n.W().next(e=>{let n=new Map;return e.forEach(e=>{var t;let r=null!==(t=n.get(e.userId))&&void 0!==t?t:sW();oo(this.serializer,e).keys().forEach(e=>r=r.add(e)),n.set(e.userId,r)}),rz.forEach(n,(e,n)=>{let s=new n4(n),a=oy.lt(this.serializer,s),o=i.getIndexManager(s);return new lu(r,oH.lt(s,this.serializer,o,i.referenceDelegate),a,o).recalculateAndSaveOverlaysForDocumentKeys(new iw(t,r0._e),e).next()})})}}function lI(e){e.createObjectStore("targetDocuments",{keyPath:ir}).createIndex("documentTargetsIndex",ii,{unique:!0}),e.createObjectStore("targets",{keyPath:"targetId"}).createIndex("queryTargetsIndex",it,{unique:!0}),e.createObjectStore("targetGlobal")}let lE="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 lT{constructor(e,t,n,r,i,s,a,o,l,u,h=15){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=n,this.oi=i,this.window=s,this.document=a,this._i=l,this.ai=u,this.ui=h,this.kr=null,this.qr=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ci=null,this.inForeground=!1,this.li=null,this.hi=null,this.Pi=Number.NEGATIVE_INFINITY,this.Ii=e=>Promise.resolve(),!lT.D())throw new rl(ro.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new o9(this,r),this.Ti=t+"main",this.serializer=new on(o),this.Ei=new rj(this.Ti,this.ui,new l_(this.serializer)),this.Qr=new o0(this.referenceDelegate,this.serializer),this.remoteDocumentCache=new lt(this.serializer),this.$r=new og,this.window&&this.window.localStorage?this.di=this.window.localStorage:(this.di=null,!1===u&&rn("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.Ai().then(()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new rl(ro.FAILED_PRECONDITION,lE);return this.Ri(),this.Vi(),this.mi(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.Qr.getHighestSequenceNumber(e))}).then(e=>{this.kr=new r0(e,this._i)}).then(()=>{this.qr=!0}).catch(e=>(this.Ei&&this.Ei.close(),Promise.reject(e)))}fi(e){return this.Ii=async t=>{if(this.started)return e(t)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.Ei.L(async t=>{null===t.newVersion&&await e()})}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.oi.enqueueAndForget(async()=>{this.started&&await this.Ai()}))}Ai(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>lC(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.gi(e).next(e=>{e||(this.isPrimary=!1,this.oi.enqueueRetryable(()=>this.Ii(!1)))})}).next(()=>this.pi(e)).next(t=>this.isPrimary&&!t?this.yi(e).next(()=>!1):!!t&&this.wi(e).next(()=>!0))).catch(e=>{if(rQ(e))return rt("IndexedDbPersistence","Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return rt("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.oi.enqueueRetryable(()=>this.Ii(e)),this.isPrimary=e})}gi(e){return lS(e).get("owner").next(e=>rz.resolve(this.Si(e)))}bi(e){return lC(e).delete(this.clientId)}async Di(){if(this.isPrimary&&!this.Ci(this.Pi,18e5)){this.Pi=Date.now();let e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",e=>{let t=iv(e,"clientMetadata");return t.W().next(e=>{let n=this.vi(e,18e5),r=e.filter(e=>-1===n.indexOf(e));return rz.forEach(r,e=>t.delete(e.clientId)).next(()=>r)})}).catch(()=>[]);if(this.di)for(let t of e)this.di.removeItem(this.Fi(t.clientId))}}mi(){this.hi=this.oi.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.Ai().then(()=>this.Di()).then(()=>this.mi()))}Si(e){return!!e&&e.ownerId===this.clientId}pi(e){return this.ai?rz.resolve(!0):lS(e).get("owner").next(t=>{if(null!==t&&this.Ci(t.leaseTimestampMs,5e3)&&!this.Mi(t.ownerId)){if(this.Si(t)&&this.networkEnabled)return!0;if(!this.Si(t)){if(!t.allowTabSynchronization)throw new rl(ro.FAILED_PRECONDITION,lE);return!1}}return!(!this.networkEnabled||!this.inForeground)||lC(e).W().next(e=>void 0===this.vi(e,5e3).find(e=>{if(this.clientId!==e.clientId){let t=!this.networkEnabled&&e.networkEnabled,n=!this.inForeground&&e.inForeground,r=this.networkEnabled===e.networkEnabled;if(t||n&&r)return!0}return!1}))}).next(e=>(this.isPrimary!==e&&rt("IndexedDbPersistence",`Client ${e?"is":"is not"} eligible for a primary lease.`),e))}async shutdown(){this.qr=!1,this.xi(),this.hi&&(this.hi.cancel(),this.hi=null),this.Oi(),this.Ni(),await this.Ei.runTransaction("shutdown","readwrite",["owner","clientMetadata"],e=>{let t=new iw(e,r0._e);return this.yi(t).next(()=>this.bi(t))}),this.Ei.close(),this.Bi()}vi(e,t){return e.filter(e=>this.Ci(e.updateTimeMs,t)&&!this.Mi(e.clientId))}Li(){return this.runTransaction("getActiveClients","readonly",e=>lC(e).W().next(e=>this.vi(e,18e5).map(e=>e.clientId)))}get started(){return this.qr}getMutationQueue(e,t){return oH.lt(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.Qr}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new oV(e,this.serializer.ct.databaseId)}getDocumentOverlayCache(e){return oy.lt(this.serializer,e)}getBundleCache(){return this.$r}runTransaction(e,t,n){var r;let i;rt("IndexedDbPersistence","Starting transaction:",e);let s=15===(r=this.ui)?iy:14===r?ip:13===r?ip:12===r?im:11===r?ig:void rs();return this.Ei.runTransaction(e,"readonly"===t?"readonly":"readwrite",s,r=>(i=new iw(r,this.kr?this.kr.next():r0._e),"readwrite-primary"===t?this.gi(i).next(e=>!!e||this.pi(i)).next(t=>{if(!t)throw rn(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.oi.enqueueRetryable(()=>this.Ii(!1)),new rl(ro.FAILED_PRECONDITION,rq);return n(i)}).next(e=>this.wi(i).next(()=>e)):this.ki(i).next(()=>n(i)))).then(e=>(i.raiseOnCommittedEvent(),e))}ki(e){return lS(e).get("owner").next(e=>{if(null!==e&&this.Ci(e.leaseTimestampMs,5e3)&&!this.Mi(e.ownerId)&&!this.Si(e)&&!(this.ai||this.allowTabSynchronization&&e.allowTabSynchronization))throw new rl(ro.FAILED_PRECONDITION,lE)})}wi(e){let t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return lS(e).put("owner",t)}static D(){return rj.D()}yi(e){let t=lS(e);return t.get("owner").next(e=>this.Si(e)?(rt("IndexedDbPersistence","Releasing primary lease."),t.delete("owner")):rz.resolve())}Ci(e,t){let n=Date.now();return!(en&&(rn(`Detected an update time that is in the future: ${e} > ${n}`),1))}Ri(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.li=()=>{this.oi.enqueueAndForget(()=>(this.inForeground="visible"===this.document.visibilityState,this.Ai()))},this.document.addEventListener("visibilitychange",this.li),this.inForeground="visible"===this.document.visibilityState)}Oi(){this.li&&(this.document.removeEventListener("visibilitychange",this.li),this.li=null)}Vi(){var e;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.ci=()=>{this.xi();let e=/(?:Version|Mobile)\/1[456]/;v()&&(navigator.appVersion.match(e)||navigator.userAgent.match(e))&&this.oi.enterRestrictedMode(!0),this.oi.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.ci))}Ni(){this.ci&&(this.window.removeEventListener("pagehide",this.ci),this.ci=null)}Mi(e){var t;try{let n=null!==(null===(t=this.di)||void 0===t?void 0:t.getItem(this.Fi(e)));return rt("IndexedDbPersistence",`Client '${e}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(e){return rn("IndexedDbPersistence","Failed to get zombied client id.",e),!1}}xi(){if(this.di)try{this.di.setItem(this.Fi(this.clientId),String(Date.now()))}catch(e){rn("Failed to set zombie client id.",e)}}Bi(){if(this.di)try{this.di.removeItem(this.Fi(this.clientId))}catch(e){}}Fi(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function lS(e){return iv(e,"owner")}function lC(e){return iv(e,"clientMetadata")}function lD(e,t){let n=e.projectId;return e.isDefaultDatabase||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}class lA{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.qi=n,this.Qi=r}static Ki(e,t){let n=sW(),r=sW();for(let e of t.docChanges)switch(e.type){case 0:n=n.add(e.doc.key);break;case 1:r=r.add(e.doc.key)}return new lA(e,t.fromCache,n,r)}}class lN{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class lk{constructor(){this.$i=!1,this.Ui=!1,this.Wi=100,this.Gi=v()?8:rj.v(w())>0?6:4}initialize(e,t){this.zi=e,this.indexManager=t,this.$i=!0}getDocumentsMatchingQuery(e,t,n,r){let i={result:null};return this.ji(e,t).next(e=>{i.result=e}).next(()=>{if(!i.result)return this.Hi(e,t,r,n).next(e=>{i.result=e})}).next(()=>{if(i.result)return;let n=new lN;return this.Ji(e,t,n).next(r=>{if(i.result=r,this.Ui)return this.Yi(e,t,n,r.size)})}).next(()=>i.result)}Yi(e,t,n,r){return n.documentReadCountthis.Gi*r?(n7()<=R.DEBUG&&rt("QueryEngine","The SDK decides to create cache indexes for query:",sF(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,sk(t))):rz.resolve())}ji(e,t){if(sD(t))return rz.resolve(null);let n=sk(t);return this.indexManager.getIndexType(e,n).next(r=>0===r?null:(null!==t.limit&&1===r&&(n=sk(t=sL(t,null,"F"))),this.indexManager.getDocumentsMatchingTarget(e,n).next(r=>{let i=sW(...r);return this.zi.getDocuments(e,i).next(r=>this.indexManager.getMinOffset(e,n).next(n=>{let s=this.Zi(t,r);return this.Xi(t,s,i,n.readTime)?this.ji(e,sL(t,null,"F")):this.es(e,s,t,n)}))})))}Hi(e,t,n,r){return sD(t)||r.isEqual(rI.min())?rz.resolve(null):this.zi.getDocuments(e,n).next(i=>{let s=this.Zi(t,i);return this.Xi(t,s,n,r)?rz.resolve(null):(n7()<=R.DEBUG&&rt("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),sF(t)),this.es(e,s,t,rO(r,-1)).next(e=>e))})}Zi(e,t){let n=new iS(sB(e));return t.forEach((t,r)=>{sV(e,r)&&(n=n.add(r))}),n}Xi(e,t,n,r){if(null===e.limit)return!1;if(n.size!==t.size)return!0;let i="F"===e.limitType?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}Ji(e,t,n){return n7()<=R.DEBUG&&rt("QueryEngine","Using full collection scan to execute query:",sF(t)),this.zi.getDocumentsMatchingQuery(e,t,rF.min(),n)}es(e,t,n,r){return this.zi.getDocumentsMatchingQuery(e,n,r).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}class lR{constructor(e,t,n,r){this.persistence=e,this.ts=t,this.serializer=r,this.ns=new iI(rb),this.rs=new sU(e=>sb(e),sx),this.ss=new Map,this.os=e.getRemoteDocumentCache(),this.Qr=e.getTargetCache(),this.$r=e.getBundleCache(),this._s(n)}_s(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new lu(this.os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.os.setIndexManager(this.indexManager),this.ts.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.ns))}}async function lM(e,t){return await e.persistence.runTransaction("Handle user change","readonly",n=>{let r;return e.mutationQueue.getAllMutationBatches(n).next(i=>(r=i,e._s(t),e.mutationQueue.getAllMutationBatches(n))).next(t=>{let i=[],s=[],a=sW();for(let e of r)for(let t of(i.push(e.batchId),e.mutations))a=a.add(t.key);for(let e of t)for(let t of(s.push(e.batchId),e.mutations))a=a.add(t.key);return e.localDocuments.getDocuments(n,a).next(e=>({us:e,removedBatchIds:i,addedBatchIds:s}))})})}function lL(e){return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Qr.getLastRemoteSnapshotVersion(t))}function lO(e,t,n){let r=sW(),i=sW();return n.forEach(e=>r=r.add(e)),t.getEntries(e,r).next(e=>{let r=sz;return n.forEach((n,s)=>{let a=e.get(n);s.isFoundDocument()!==a.isFoundDocument()&&(i=i.add(n)),s.isNoDocument()&&s.version.isEqual(rI.min())?(t.removeEntry(n,s.readTime),r=r.insert(n,s)):!a.isValidDocument()||s.version.compareTo(a.version)>0||0===s.version.compareTo(a.version)&&a.hasPendingWrites?(t.addEntry(s),r=r.insert(n,s)):rt("LocalStore","Ignoring outdated watch update for ",n,". Current version:",a.version," Watch version:",s.version)}),{cs:r,ls:i}})}function lP(e,t){return e.persistence.runTransaction("Allocate target","readwrite",n=>{let r;return e.Qr.getTargetData(n,t).next(i=>i?(r=i,rz.resolve(r)):e.Qr.allocateTargetId(n).next(i=>(r=new ot(t,i,"TargetPurposeListen",n.currentSequenceNumber),e.Qr.addTargetData(n,r).next(()=>r))))}).then(n=>{let r=e.ns.get(n.targetId);return(null===r||n.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(e.ns=e.ns.insert(n.targetId,n),e.rs.set(t,n.targetId)),n})}async function lF(e,t,n){let r=e.ns.get(t);try{n||await e.persistence.runTransaction("Release target",n?"readwrite":"readwrite-primary",t=>e.persistence.referenceDelegate.removeTarget(t,r))}catch(e){if(!rQ(e))throw e;rt("LocalStore",`Failed to update sequence numbers for target ${t}: ${e}`)}e.ns=e.ns.remove(t),e.rs.delete(r.target)}function lV(e,t,n){let r=rI.min(),i=sW();return e.persistence.runTransaction("Execute query","readwrite",s=>(function(e,t,n){let r=e.rs.get(n);return void 0!==r?rz.resolve(e.ns.get(r)):e.Qr.getTargetData(t,n)})(e,s,sk(t)).next(t=>{if(t)return r=t.lastLimboFreeSnapshotVersion,e.Qr.getMatchingKeysForTargetId(s,t.targetId).next(e=>{i=e})}).next(()=>e.ts.getDocumentsMatchingQuery(s,t,n?r:rI.min(),n?i:sW())).next(n=>(lU(e,sq(t),n),{documents:n,hs:i})))}function lq(e,t){let n=e.Qr,r=e.ns.get(t);return r?Promise.resolve(r.target):e.persistence.runTransaction("Get target data","readonly",e=>n._t(e,t).next(e=>e?e.target:null))}function lB(e,t){let n=e.ss.get(t)||rI.min();return e.persistence.runTransaction("Get new document changes","readonly",r=>e.os.getAllFromCollectionGroup(r,t,rO(n,-1),Number.MAX_SAFE_INTEGER)).then(n=>(lU(e,t,n),n))}function lU(e,t,n){let r=e.ss.get(t)||rI.min();n.forEach((e,t)=>{t.readTime.compareTo(r)>0&&(r=t.readTime)}),e.ss.set(t,r)}async function lz(e,t,n=sW()){let r=await lP(e,sk(oh(t.bundledQuery)));return e.persistence.runTransaction("Save named query","readwrite",i=>{let s=aK(t.readTime);if(r.snapshotVersion.compareTo(s)>=0)return e.$r.saveNamedQuery(i,t);let a=r.withResumeToken(iR.EMPTY_BYTE_STRING,s);return e.ns=e.ns.insert(a.targetId,a),e.Qr.updateTargetData(i,a).next(()=>e.Qr.removeMatchingKeysForTargetId(i,r.targetId)).next(()=>e.Qr.addMatchingKeys(i,n,r.targetId)).next(()=>e.$r.saveNamedQuery(i,t))})}function lG(e,t){return`firestore_clients_${e}_${t}`}function lj(e,t,n){let r=`firestore_mutations_${e}_${n}`;return t.isAuthenticated()&&(r+=`_${t.uid}`),r}function lK(e,t){return`firestore_targets_${e}_${t}`}class l${constructor(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}static Es(e,t,n){let r=JSON.parse(n),i,s="object"==typeof r&&-1!==["pending","acknowledged","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return s&&r.error&&(s="string"==typeof r.error.message&&"string"==typeof r.error.code)&&(i=new rl(r.error.code,r.error.message)),s?new l$(e,t,r.state,i):(rn("SharedClientState",`Failed to parse mutation state for ID '${t}': ${n}`),null)}ds(){let e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class lQ{constructor(e,t,n){this.targetId=e,this.state=t,this.error=n}static Es(e,t){let n=JSON.parse(t),r,i="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return i&&n.error&&(i="string"==typeof n.error.message&&"string"==typeof n.error.code)&&(r=new rl(n.error.code,n.error.message)),i?new lQ(e,n.state,r):(rn("SharedClientState",`Failed to parse target state for ID '${e}': ${t}`),null)}ds(){let e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class lH{constructor(e,t){this.clientId=e,this.activeTargetIds=t}static Es(e,t){let n=JSON.parse(t),r="object"==typeof n&&n.activeTargetIds instanceof Array,i=sY;for(let e=0;r&ðis.shutdown()),this.started=!0}writeSequenceNumber(e){this.setItem(this.Ss,JSON.stringify(e))}getAllActiveQueryTargets(){return this.Ns(this.ps)}isActiveQueryTarget(e){let t=!1;return this.ps.forEach((n,r)=>{r.activeTargetIds.has(e)&&(t=!0)}),t}addPendingMutation(e){this.Bs(e,"pending")}updateMutationState(e,t,n){this.Bs(e,t,n),this.Ls(e)}addLocalQueryTarget(e){let t="not-current";if(this.isActiveQueryTarget(e)){let n=this.storage.getItem(lK(this.persistenceKey,e));if(n){let r=lQ.Es(e,n);r&&(t=r.state)}}return this.ks.As(e),this.Ms(),t}removeLocalQueryTarget(e){this.ks.Rs(e),this.Ms()}isLocalQueryTarget(e){return this.ks.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(lK(this.persistenceKey,e))}updateQueryState(e,t,n){this.qs(e,t,n)}handleUserChange(e,t,n){t.forEach(e=>{this.Ls(e)}),this.currentUser=e,n.forEach(e=>{this.addPendingMutation(e)})}setOnlineState(e){this.Qs(e)}notifyBundleLoaded(e){this.Ks(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.fs),this.removeItem(this.ws),this.started=!1)}getItem(e){let t=this.storage.getItem(e);return rt("SharedClientState","READ",e,t),t}setItem(e,t){rt("SharedClientState","SET",e,t),this.storage.setItem(e,t)}removeItem(e){rt("SharedClientState","REMOVE",e),this.storage.removeItem(e)}gs(e){if(e.storageArea===this.storage){if(rt("SharedClientState","EVENT",e.key,e.newValue),e.key===this.ws)return void rn("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.oi.enqueueRetryable(async()=>{if(this.started){if(null!==e.key){if(this.bs.test(e.key)){if(null==e.newValue){let t=this.$s(e.key);return this.Us(t,null)}{let t=this.Ws(e.key,e.newValue);if(t)return this.Us(t.clientId,t)}}else if(this.Ds.test(e.key)){if(null!==e.newValue){let t=this.Gs(e.key,e.newValue);if(t)return this.zs(t)}}else if(this.Cs.test(e.key)){if(null!==e.newValue){let t=this.js(e.key,e.newValue);if(t)return this.Hs(t)}}else if(e.key===this.vs){if(null!==e.newValue){let t=this.xs(e.newValue);if(t)return this.Os(t)}}else if(e.key===this.Ss){let t=function(e){let t=r0._e;if(null!=e)try{let n=JSON.parse(e);"number"==typeof n||rs(),t=n}catch(e){rn("SharedClientState","Failed to read sequence number from WebStorage",e)}return t}(e.newValue);t!==r0._e&&this.sequenceNumberHandler(t)}else if(e.key===this.Fs){let t=this.Js(e.newValue);await Promise.all(t.map(e=>this.syncEngine.Ys(e)))}}}else this.ys.push(e)})}}get ks(){return this.ps.get(this.Vs)}Ms(){this.setItem(this.ws,this.ks.ds())}Bs(e,t,n){let r=new l$(this.currentUser,e,t,n),i=lj(this.persistenceKey,this.currentUser,e);this.setItem(i,r.ds())}Ls(e){let t=lj(this.persistenceKey,this.currentUser,e);this.removeItem(t)}Qs(e){let t={clientId:this.Vs,onlineState:e};this.storage.setItem(this.vs,JSON.stringify(t))}qs(e,t,n){let r=lK(this.persistenceKey,e),i=new lQ(e,t,n);this.setItem(r,i.ds())}Ks(e){let t=JSON.stringify(Array.from(e));this.setItem(this.Fs,t)}$s(e){let t=this.bs.exec(e);return t?t[1]:null}Ws(e,t){let n=this.$s(e);return lH.Es(n,t)}Gs(e,t){let n=this.Ds.exec(e),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return l$.Es(new n4(i),r,t)}js(e,t){let n=Number(this.Cs.exec(e)[1]);return lQ.Es(n,t)}xs(e){return lW.Es(e)}Js(e){return JSON.parse(e)}async zs(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.Zs(e.batchId,e.state,e.error);rt("SharedClientState",`Ignoring mutation for non-active user ${e.user.uid}`)}Hs(e){return this.syncEngine.Xs(e.targetId,e.state,e.error)}Us(e,t){let n=t?this.ps.insert(e,t):this.ps.remove(e),r=this.Ns(this.ps),i=this.Ns(n),s=[],a=[];return i.forEach(e=>{r.has(e)||s.push(e)}),r.forEach(e=>{i.has(e)||a.push(e)}),this.syncEngine.eo(s,a).then(()=>{this.ps=n})}Os(e){this.ps.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}Ns(e){let t=sY;return e.forEach((e,n)=>{t=t.unionWith(n.activeTargetIds)}),t}}class lJ{constructor(){this.no=new lY,this.ro={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return this.no.As(e),this.ro[e]||"not-current"}updateQueryState(e,t,n){this.ro[e]=t}removeLocalQueryTarget(e){this.no.Rs(e)}isLocalQueryTarget(e){return this.no.activeTargetIds.has(e)}clearQueryState(e){delete this.ro[e]}getAllActiveQueryTargets(){return this.no.activeTargetIds}isActiveQueryTarget(e){return this.no.activeTargetIds.has(e)}start(){return this.no=new lY,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class lZ{io(e){}shutdown(){}}class l0{constructor(){this.so=()=>this.oo(),this._o=()=>this.ao(),this.uo=[],this.co()}io(e){this.uo.push(e)}shutdown(){window.removeEventListener("online",this.so),window.removeEventListener("offline",this._o)}co(){window.addEventListener("online",this.so),window.addEventListener("offline",this._o)}oo(){for(let e of(rt("ConnectivityMonitor","Network connectivity changed: AVAILABLE"),this.uo))e(0)}ao(){for(let e of(rt("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE"),this.uo))e(1)}static D(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let l1=null;function l2(){return null===l1?l1=0x10000000+Math.round(0x80000000*Math.random()):l1++,"0x"+l1.toString(16)}let l5={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class l6{constructor(e){this.lo=e.lo,this.ho=e.ho}Po(e){this.Io=e}To(e){this.Eo=e}onMessage(e){this.Ao=e}close(){this.ho()}send(e){this.lo(e)}Ro(){this.Io()}Vo(e){this.Eo(e)}mo(e){this.Ao(e)}}let l3="WebChannelConnection";class l4 extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;let t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),r=encodeURIComponent(this.databaseId.database);this.fo=t+"://"+e.host,this.po=`projects/${n}/databases/${r}`,this.yo="(default)"===this.databaseId.database?`project_id=${n}`:`project_id=${n}&database_id=${r}`}get wo(){return!1}So(e,t,n,r,i){let s=l2(),a=this.bo(e,t.toUriEncodedString());rt("RestConnection",`Sending RPC '${e}' ${s}:`,a,n);let o={"google-cloud-resource-prefix":this.po,"x-goog-request-params":this.yo};return this.Do(o,r,i),this.Co(e,a,o,n).then(t=>(rt("RestConnection",`Received RPC '${e}' ${s}: `,t),t),t=>{throw rr("RestConnection",`RPC '${e}' ${s} failed with error: `,t,"url: ",a,"request:",n),t})}vo(e,t,n,r,i,s){return this.So(e,t,n,r,i)}Do(e,t,n){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+n8}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t)}bo(e,t){let n=l5[e];return`${this.fo}/v1/${t}:${n}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Co(e,t,n,r){let i=l2();return new Promise((s,a)=>{let o=new nt;o.setWithCredentials(!0),o.listenOnce(tt.COMPLETE,()=>{try{switch(o.getLastErrorCode()){case te.NO_ERROR:let t=o.getResponseJson();rt(l3,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),s(t);break;case te.TIMEOUT:rt(l3,`RPC '${e}' ${i} timed out`),a(new rl(ro.DEADLINE_EXCEEDED,"Request time out"));break;case te.HTTP_ERROR:let n=o.getStatus();if(rt(l3,`RPC '${e}' ${i} failed with status:`,n,"response text:",o.getResponseText()),n>0){let e=o.getResponseJson();Array.isArray(e)&&(e=e[0]);let t=null==e?void 0:e.error;if(t&&t.status&&t.message){let e=function(e){let t=e.toLowerCase().replace(/_/g,"-");return Object.values(ro).indexOf(t)>=0?t:ro.UNKNOWN}(t.status);a(new rl(e,t.message))}else a(new rl(ro.UNKNOWN,"Server responded with status "+o.getStatus()))}else a(new rl(ro.UNAVAILABLE,"Connection failed."));break;default:rs()}}finally{rt(l3,`RPC '${e}' ${i} completed.`)}});let l=JSON.stringify(r);rt(l3,`RPC '${e}' ${i} sending request:`,r),o.send(t,"POST",l,n,15)})}Fo(e,t,n){let r=l2(),i=[this.fo,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=new nO,o=e5(),l={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},u=this.longPollingOptions.timeoutSeconds;void 0!==u&&(l.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(l.useFetchStreams=!0),this.Do(l.initMessageHeaders,t,n),l.encodeInitMessageHeaders=!0;let h=i.join("");rt(l3,`Creating RPC '${e}' stream ${r}: ${h}`,l);let c=s.createWebChannel(h,l),f=!1,d=!1,g=new l6({lo:t=>{d?rt(l3,`Not sending because RPC '${e}' stream ${r} is closed:`,t):(f||(rt(l3,`Opening RPC '${e}' stream ${r} transport.`),c.open(),f=!0),rt(l3,`RPC '${e}' stream ${r} sending:`,t),c.send(t))},ho:()=>c.close()}),m=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(e){setTimeout(()=>{throw e},0)}})};return m(c,ti.EventType.OPEN,()=>{d||rt(l3,`RPC '${e}' stream ${r} transport opened.`)}),m(c,ti.EventType.CLOSE,()=>{d||(d=!0,rt(l3,`RPC '${e}' stream ${r} transport closed`),g.Vo())}),m(c,ti.EventType.ERROR,t=>{d||(d=!0,rr(l3,`RPC '${e}' stream ${r} transport errored:`,t),g.Vo(new rl(ro.UNAVAILABLE,"The operation could not be completed")))}),m(c,ti.EventType.MESSAGE,t=>{var n;if(!d){let i=t.data[0];i||rs();let s=i.error||(null===(n=i[0])||void 0===n?void 0:n.error);if(s){rt(l3,`RPC '${e}' stream ${r} received error:`,s);let t=s.status,n=function(e){let t=a[e];if(void 0!==t)return ax(t)}(t),i=s.message;void 0===n&&(n=ro.INTERNAL,i="Unknown error status: "+t+" with message "+s.message),d=!0,g.Vo(new rl(n,i)),c.close()}else rt(l3,`RPC '${e}' stream ${r} received:`,i),g.mo(i)}}),m(o,e1.STAT_EVENT,t=>{10===t.stat?rt(l3,`RPC '${e}' stream ${r} detected buffering proxy`):11===t.stat&&rt(l3,`RPC '${e}' stream ${r} detected no buffering proxy`)}),setTimeout(()=>{g.Ro()},0),g}}function l8(){return"undefined"!=typeof window?window:null}function l9(){return"undefined"!=typeof document?document:null}function l7(e){return new aU(e,!0)}class ue{constructor(e,t,n=1e3,r=1.5,i=6e4){this.oi=e,this.timerId=t,this.Mo=n,this.xo=r,this.Oo=i,this.No=0,this.Bo=null,this.Lo=Date.now(),this.reset()}reset(){this.No=0}ko(){this.No=this.Oo}qo(e){this.cancel();let t=Math.floor(this.No+this.Qo()),n=Math.max(0,Date.now()-this.Lo),r=Math.max(0,t-n);r>0&&rt("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.No} ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.Bo=this.oi.enqueueAfterDelay(this.timerId,r,()=>(this.Lo=Date.now(),e())),this.No*=this.xo,this.Nothis.Oo&&(this.No=this.Oo)}Ko(){null!==this.Bo&&(this.Bo.skipDelay(),this.Bo=null)}cancel(){null!==this.Bo&&(this.Bo.cancel(),this.Bo=null)}Qo(){return(Math.random()-.5)*this.No}}class ut{constructor(e,t,n,r,i,s,a,o){this.oi=e,this.$o=n,this.Uo=r,this.connection=i,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=a,this.listener=o,this.state=0,this.Wo=0,this.Go=null,this.zo=null,this.stream=null,this.jo=new ue(e,t)}Ho(){return 1===this.state||5===this.state||this.Jo()}Jo(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.Yo()}async stop(){this.Ho()&&await this.close(0)}Zo(){this.state=0,this.jo.reset()}Xo(){this.Jo()&&null===this.Go&&(this.Go=this.oi.enqueueAfterDelay(this.$o,6e4,()=>this.e_()))}t_(e){this.n_(),this.stream.send(e)}async e_(){if(this.Jo())return this.close(0)}n_(){this.Go&&(this.Go.cancel(),this.Go=null)}r_(){this.zo&&(this.zo.cancel(),this.zo=null)}async close(e,t){this.n_(),this.r_(),this.jo.cancel(),this.Wo++,4!==e?this.jo.reset():t&&t.code===ro.RESOURCE_EXHAUSTED?(rn(t.toString()),rn("Using maximum backoff delay to prevent overloading the backend."),this.jo.ko()):t&&t.code===ro.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.i_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.To(t)}i_(){}auth(){this.state=1;let e=this.s_(this.Wo),t=this.Wo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,n])=>{this.Wo===t&&this.o_(e,n)},t=>{e(()=>{let e=new rl(ro.UNKNOWN,"Fetching auth token failed: "+t.message);return this.__(e)})})}o_(e,t){let n=this.s_(this.Wo);this.stream=this.a_(e,t),this.stream.Po(()=>{n(()=>(this.state=2,this.zo=this.oi.enqueueAfterDelay(this.Uo,1e4,()=>(this.Jo()&&(this.state=3),Promise.resolve())),this.listener.Po()))}),this.stream.To(e=>{n(()=>this.__(e))}),this.stream.onMessage(e=>{n(()=>this.onMessage(e))})}Yo(){this.state=5,this.jo.qo(async()=>{this.state=0,this.start()})}__(e){return rt("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}s_(e){return t=>{this.oi.enqueueAndForget(()=>this.Wo===e?t():(rt("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class un extends ut{constructor(e,t,n,r,i,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,r,s),this.serializer=i}a_(e,t){return this.connection.Fo("Listen",e,t)}onMessage(e){this.jo.reset();let t=function(e,t){let n;if("targetChange"in t){var r,i;t.targetChange;let s="NO_CHANGE"===(r=t.targetChange.targetChangeType||"NO_CHANGE")?0:"ADD"===r?1:"REMOVE"===r?2:"CURRENT"===r?3:"RESET"===r?4:rs(),a=t.targetChange.targetIds||[],o=(i=t.targetChange.resumeToken,e.useProto3Json?(void 0===i||"string"==typeof i||rs(),iR.fromBase64String(i||"")):(void 0===i||i instanceof Uint8Array||rs(),iR.fromUint8Array(i||new Uint8Array))),l=t.targetChange.cause;n=new aM(s,a,o,l&&new rl(void 0===l.code?ro.UNKNOWN:ax(l.code),l.message||"")||null)}else if("documentChange"in t){t.documentChange;let r=t.documentChange;r.document,r.document.name,r.document.updateTime;let i=aY(e,r.document.name),s=aK(r.document.updateTime),a=r.document.createTime?aK(r.document.createTime):rI.min(),o=new i4({mapValue:{fields:r.document.fields}}),l=i8.newFoundDocument(i,s,a,o);n=new ak(r.targetIds||[],r.removedTargetIds||[],l.key,l)}else if("documentDelete"in t){t.documentDelete;let r=t.documentDelete;r.document;let i=aY(e,r.document),s=r.readTime?aK(r.readTime):rI.min(),a=i8.newNoDocument(i,s);n=new ak([],r.removedTargetIds||[],a.key,a)}else if("documentRemove"in t){t.documentRemove;let r=t.documentRemove;r.document;let i=aY(e,r.document);n=new ak([],r.removedTargetIds||[],i,null)}else{if(!("filter"in t))return rs();{t.filter;let e=t.filter;e.targetId;let{count:r=0,unchangedNames:i}=e,s=new av(r,i);n=new aR(e.targetId,s)}}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return rI.min();let t=e.targetChange;return t.targetIds&&t.targetIds.length?rI.min():t.readTime?aK(t.readTime):rI.min()}(e);return this.listener.u_(t,n)}c_(e){let t={};t.database=aZ(this.serializer),t.addTarget=function(e,t){let n;let r=t.target;if((n=s_(r)?{documents:a3(e,r)}:{query:a4(e,r).ut}).targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=aj(e,t.resumeToken);let r=az(e,t.expectedCount);null!==r&&(n.expectedCount=r)}else if(t.snapshotVersion.compareTo(rI.min())>0){n.readTime=aG(e,t.snapshotVersion.toTimestamp());let r=az(e,t.expectedCount);null!==r&&(n.expectedCount=r)}return n}(this.serializer,e);let n=function(e,t){let n=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return rs()}}(t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.t_(t)}l_(e){let t={};t.database=aZ(this.serializer),t.removeTarget=e,this.t_(t)}}class ur extends ut{constructor(e,t,n,r,i,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,r,s),this.serializer=i,this.h_=!1}get P_(){return this.h_}start(){this.h_=!1,this.lastStreamToken=void 0,super.start()}i_(){this.h_&&this.I_([])}a_(e,t){return this.connection.Fo("Write",e,t)}onMessage(e){var t,n;if(e.streamToken||rs(),this.lastStreamToken=e.streamToken,this.h_){this.jo.reset();let r=(t=e.writeResults,n=e.commitTime,t&&t.length>0?(void 0!==n||rs(),t.map(e=>{let t;return(t=e.updateTime?aK(e.updateTime):aK(n)).isEqual(rI.min())&&(t=aK(n)),new at(t,e.transformResults||[])})):[]),i=aK(e.commitTime);return this.listener.T_(i,r)}return e.writeResults&&0!==e.writeResults.length&&rs(),this.h_=!0,this.listener.E_()}d_(){let e={};e.database=aZ(this.serializer),this.t_(e)}I_(e){let t={streamToken:this.lastStreamToken,writes:e.map(e=>a5(this.serializer,e))};this.t_(t)}}class ui extends class{}{constructor(e,t,n,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=r,this.A_=!1}R_(){if(this.A_)throw new rl(ro.FAILED_PRECONDITION,"The client has already been terminated.")}So(e,t,n,r){return this.R_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,s])=>this.connection.So(e,aQ(t,n),r,i,s)).catch(e=>{throw"FirebaseError"===e.name?(e.code===ro.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new rl(ro.UNKNOWN,e.toString())})}vo(e,t,n,r,i){return this.R_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([s,a])=>this.connection.vo(e,aQ(t,n),r,s,a,i)).catch(e=>{throw"FirebaseError"===e.name?(e.code===ro.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new rl(ro.UNKNOWN,e.toString())})}terminate(){this.A_=!0,this.connection.terminate()}}class us{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.m_=0,this.f_=null,this.g_=!0}p_(){0===this.m_&&(this.y_("Unknown"),this.f_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.f_=null,this.w_("Backend didn't respond within 10 seconds."),this.y_("Offline"),Promise.resolve())))}S_(e){"Online"===this.state?this.y_("Unknown"):(this.m_++,this.m_>=1&&(this.b_(),this.w_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.y_("Offline")))}set(e){this.b_(),this.m_=0,"Online"===e&&(this.g_=!1),this.y_(e)}y_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}w_(e){let t=`Could not reach Cloud Firestore backend. ${e} +This 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.g_?(rn(t),this.g_=!1):rt("OnlineStateTracker",t)}b_(){null!==this.f_&&(this.f_.cancel(),this.f_=null)}}class ua{constructor(e,t,n,r,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.D_=[],this.C_=new Map,this.v_=new Set,this.F_=[],this.M_=i,this.M_.io(e=>{n.enqueueAndForget(async()=>{um(this)&&(rt("RemoteStore","Restarting streams for network reachability change."),await async function(e){e.v_.add(4),await ul(e),e.x_.set("Unknown"),e.v_.delete(4),await uo(e)}(this))})}),this.x_=new us(n,r)}}async function uo(e){if(um(e))for(let t of e.F_)await t(!0)}async function ul(e){for(let t of e.F_)await t(!1)}function uu(e,t){e.C_.has(t.targetId)||(e.C_.set(t.targetId,t),ug(e)?ud(e):uN(e).Jo()&&uc(e,t))}function uh(e,t){let n=uN(e);e.C_.delete(t),n.Jo()&&uf(e,t),0===e.C_.size&&(n.Jo()?n.Xo():um(e)&&e.x_.set("Unknown"))}function uc(e,t){if(e.O_.Oe(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(rI.min())>0){let n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}uN(e).c_(t)}function uf(e,t){e.O_.Oe(t),uN(e).l_(t)}function ud(e){e.O_=new aO({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),_t:t=>e.C_.get(t)||null,nt:()=>e.datastore.serializer.databaseId}),uN(e).start(),e.x_.p_()}function ug(e){return um(e)&&!uN(e).Ho()&&e.C_.size>0}function um(e){return 0===e.v_.size}async function up(e){e.C_.forEach((t,n)=>{uc(e,t)})}async function uy(e,t){e.O_=void 0,ug(e)?(e.x_.S_(t),ud(e)):e.x_.set("Unknown")}async function uw(e,t,n){if(e.x_.set("Online"),t instanceof aM&&2===t.state&&t.cause)try{await async function(e,t){let n=t.cause;for(let r of t.targetIds)e.C_.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e.C_.delete(r),e.O_.removeTarget(r))}(e,t)}catch(n){rt("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),await uv(e,n)}else if(t instanceof ak?e.O_.$e(t):t instanceof aR?e.O_.Je(t):e.O_.Ge(t),!n.isEqual(rI.min()))try{let t=await lL(e.localStore);n.compareTo(t)>=0&&await function(e,t){let n=e.O_.it(t);return n.targetChanges.forEach((n,r)=>{if(n.resumeToken.approximateByteSize()>0){let i=e.C_.get(r);i&&e.C_.set(r,i.withResumeToken(n.resumeToken,t))}}),n.targetMismatches.forEach((t,n)=>{let r=e.C_.get(t);if(!r)return;e.C_.set(t,r.withResumeToken(iR.EMPTY_BYTE_STRING,r.snapshotVersion)),uf(e,t);let i=new ot(r.target,t,n,r.sequenceNumber);uc(e,i)}),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){rt("RemoteStore","Failed to raise snapshot:",t),await uv(e,t)}}async function uv(e,t,n){if(!rQ(t))throw t;e.v_.add(1),await ul(e),e.x_.set("Offline"),n||(n=()=>lL(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{rt("RemoteStore","Retrying IndexedDB access"),await n(),e.v_.delete(1),await uo(e)})}function ub(e,t){return t().catch(n=>uv(e,n,t))}async function ux(e){let t=uk(e),n=e.D_.length>0?e.D_[e.D_.length-1].batchId:-1;for(;um(e)&&e.D_.length<10;)try{let r=await function(e,t){return e.persistence.runTransaction("Get next mutation batch","readonly",n=>(void 0===t&&(t=-1),e.mutationQueue.getNextMutationBatchAfterBatchId(n,t)))}(e.localStore,n);if(null===r){0===e.D_.length&&t.Xo();break}n=r.batchId,function(e,t){e.D_.push(t);let n=uk(e);n.Jo()&&n.P_&&n.I_(t.mutations)}(e,r)}catch(t){await uv(e,t)}u_(e)&&uI(e)}function u_(e){return um(e)&&!uk(e).Ho()&&e.D_.length>0}function uI(e){uk(e).start()}async function uE(e){uk(e).d_()}async function uT(e){let t=uk(e);for(let n of e.D_)t.I_(n.mutations)}async function uS(e,t,n){let r=e.D_.shift(),i=ap.from(r,t,n);await ub(e,()=>e.remoteSyncer.applySuccessfulWrite(i)),await ux(e)}async function uC(e,t){t&&uk(e).P_&&await async function(e,t){var n;if(ab(n=t.code)&&n!==ro.ABORTED){let n=e.D_.shift();uk(e).Zo(),await ub(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await ux(e)}}(e,t),u_(e)&&uI(e)}async function uD(e,t){e.asyncQueue.verifyOperationInProgress(),rt("RemoteStore","RemoteStore received new credentials");let n=um(e);e.v_.add(3),await ul(e),n&&e.x_.set("Unknown"),await e.remoteSyncer.handleCredentialChange(t),e.v_.delete(3),await uo(e)}async function uA(e,t){t?(e.v_.delete(2),await uo(e)):t||(e.v_.add(2),await ul(e),e.x_.set("Unknown"))}function uN(e){var t,n,r;return e.N_||(e.N_=(t=e.datastore,n=e.asyncQueue,r={Po:up.bind(null,e),To:uy.bind(null,e),u_:uw.bind(null,e)},t.R_(),new un(n,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,r)),e.F_.push(async t=>{t?(e.N_.Zo(),ug(e)?ud(e):e.x_.set("Unknown")):(await e.N_.stop(),e.O_=void 0)})),e.N_}function uk(e){var t,n,r;return e.B_||(e.B_=(t=e.datastore,n=e.asyncQueue,r={Po:uE.bind(null,e),To:uC.bind(null,e),E_:uT.bind(null,e),T_:uS.bind(null,e)},t.R_(),new ur(n,t.connection,t.authCredentials,t.appCheckCredentials,t.serializer,r)),e.F_.push(async t=>{t?(e.B_.Zo(),await ux(e)):(await e.B_.stop(),e.D_.length>0&&(rt("RemoteStore",`Stopping write stream with ${e.D_.length} pending writes`),e.D_=[]))})),e.B_}class uR{constructor(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new ru,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,r,i){let s=new uR(e,t,Date.now()+n,r,i);return s.start(n),s}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new rl(ro.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function uM(e,t){if(rn("AsyncQueue",`${t}: ${e}`),rQ(e))return new rl(ro.UNAVAILABLE,`${t}: ${e}`);throw e}class uL{constructor(e){this.comparator=e?(t,n)=>e(t,n)||rD.comparator(t.key,n.key):(e,t)=>rD.comparator(e.key,t.key),this.keyedMap=sj(),this.sortedSet=new iI(this.comparator)}static emptySet(e){return new uL(e.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){let t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,n)=>(e(t),!1))}add(e){let t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){let t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof uL)||this.size!==e.size)return!1;let t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){let e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){let e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"}copy(e,t){let n=new uL;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}class uO{constructor(){this.L_=new iI(rD.comparator)}track(e){let t=e.doc.key,n=this.L_.get(t);n?0!==e.type&&3===n.type?this.L_=this.L_.insert(t,e):3===e.type&&1!==n.type?this.L_=this.L_.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.L_=this.L_.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.L_=this.L_.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.L_=this.L_.remove(t):1===e.type&&2===n.type?this.L_=this.L_.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.L_=this.L_.insert(t,{type:2,doc:e.doc}):rs():this.L_=this.L_.insert(t,e)}k_(){let e=[];return this.L_.inorderTraversal((t,n)=>{e.push(n)}),e}}class uP{constructor(e,t,n,r,i,s,a,o,l){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=s,this.syncStateChanged=a,this.excludesMetadataChanges=o,this.hasCachedResults=l}static fromInitialDocuments(e,t,n,r,i){let s=[];return t.forEach(e=>{s.push({type:0,doc:e})}),new uP(e,t,uL.emptySet(t),s,n,r,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&sO(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;let t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let e=0;esP(e),sO),this.onlineState="Unknown",this.K_=new Set}}async function uq(e,t){let n=t.query,r=!1,i=e.queries.get(n);if(i||(r=!0,i=new uF),r)try{i.q_=await e.onListen(n)}catch(n){let e=uM(n,`Initialization of query '${sF(t.query)}' failed`);return void t.onError(e)}e.queries.set(n,i),i.Q_.push(t),t.U_(e.onlineState),i.q_&&t.W_(i.q_)&&uG(e)}async function uB(e,t){let n=t.query,r=!1,i=e.queries.get(n);if(i){let e=i.Q_.indexOf(t);e>=0&&(i.Q_.splice(e,1),r=0===i.Q_.length)}if(r)return e.queries.delete(n),e.onUnlisten(n)}function uU(e,t){let n=!1;for(let r of t){let t=r.query,i=e.queries.get(t);if(i){for(let e of i.Q_)e.W_(r)&&(n=!0);i.q_=r}}n&&uG(e)}function uz(e,t,n){let r=e.queries.get(t);if(r)for(let e of r.Q_)e.onError(n);e.queries.delete(t)}function uG(e){e.K_.forEach(e=>{e.next()})}class uj{constructor(e,t,n){this.query=e,this.G_=t,this.z_=!1,this.j_=null,this.onlineState="Unknown",this.options=n||{}}W_(e){if(!this.options.includeMetadataChanges){let t=[];for(let n of e.docChanges)3!==n.type&&t.push(n);e=new uP(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.z_?this.H_(e)&&(this.G_.next(e),t=!0):this.J_(e,this.onlineState)&&(this.Y_(e),t=!0),this.j_=e,t}onError(e){this.G_.error(e)}U_(e){this.onlineState=e;let t=!1;return this.j_&&!this.z_&&this.J_(this.j_,e)&&(this.Y_(this.j_),t=!0),t}J_(e,t){return!e.fromCache||(!this.options.Z_||!("Offline"!==t))&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}H_(e){if(e.docChanges.length>0)return!0;let t=this.j_&&this.j_.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}Y_(e){e=uP.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.z_=!0,this.G_.next(e)}}class uK{constructor(e,t){this.X_=e,this.byteLength=t}ea(){return"metadata"in this.X_}}class u${constructor(e){this.serializer=e}Ps(e){return aY(this.serializer,e)}Is(e){return e.metadata.exists?a2(this.serializer,e.document,!1):i8.newNoDocument(this.Ps(e.metadata.name),this.Ts(e.metadata.readTime))}Ts(e){return aK(e)}}class uQ{constructor(e,t,n){this.ta=e,this.localStore=t,this.serializer=n,this.queries=[],this.documents=[],this.collectionGroups=new Set,this.progress=uH(e)}na(e){this.progress.bytesLoaded+=e.byteLength;let t=this.progress.documentsLoaded;if(e.X_.namedQuery)this.queries.push(e.X_.namedQuery);else if(e.X_.documentMetadata){this.documents.push({metadata:e.X_.documentMetadata}),e.X_.documentMetadata.exists||++t;let n=rT.fromString(e.X_.documentMetadata.name);this.collectionGroups.add(n.get(n.length-2))}else e.X_.document&&(this.documents[this.documents.length-1].document=e.X_.document,++t);return t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,Object.assign({},this.progress)):null}ra(e){let t=new Map,n=new u$(this.serializer);for(let r of e)if(r.metadata.queries){let e=n.Ps(r.metadata.name);for(let n of r.metadata.queries){let r=(t.get(n)||sW()).add(e);t.set(n,r)}}return t}async complete(){let e=await async function(e,t,n,r){let i=sW(),s=sz;for(let e of n){let n=t.Ps(e.metadata.name);e.document&&(i=i.add(n));let r=t.Is(e);r.setReadTime(t.Ts(e.metadata.readTime)),s=s.insert(n,r)}let a=e.os.newChangeBuffer({trackRemovals:!0}),o=await lP(e,sk(sC(rT.fromString(`__bundle__/docs/${r}`))));return e.persistence.runTransaction("Apply bundle documents","readwrite",t=>lO(t,a,s).next(e=>(a.apply(t),e)).next(n=>e.Qr.removeMatchingKeysForTargetId(t,o.targetId).next(()=>e.Qr.addMatchingKeys(t,i,o.targetId)).next(()=>e.localDocuments.getLocalViewOfDocuments(t,n.cs,n.ls)).next(()=>n.cs)))}(this.localStore,new u$(this.serializer),this.documents,this.ta.id),t=this.ra(this.documents);for(let e of this.queries)await lz(this.localStore,e,t.get(e.name));return this.progress.taskState="Success",{progress:this.progress,ia:this.collectionGroups,sa:e}}}function uH(e){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}class uW{constructor(e){this.key=e}}class uY{constructor(e){this.key=e}}class uX{constructor(e,t){this.query=e,this.oa=t,this._a=null,this.hasCachedResults=!1,this.current=!1,this.aa=sW(),this.mutatedKeys=sW(),this.ua=sB(e),this.ca=new uL(this.ua)}get la(){return this.oa}ha(e,t){let n=t?t.Pa:new uO,r=t?t.ca:this.ca,i=t?t.mutatedKeys:this.mutatedKeys,s=r,a=!1,o="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,l="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((e,t)=>{let u=r.get(e),h=sV(this.query,t)?t:null,c=!!u&&this.mutatedKeys.has(u.key),f=!!h&&(h.hasLocalMutations||this.mutatedKeys.has(h.key)&&h.hasCommittedMutations),d=!1;u&&h?u.data.isEqual(h.data)?c!==f&&(n.track({type:3,doc:h}),d=!0):this.Ia(u,h)||(n.track({type:2,doc:h}),d=!0,(o&&this.ua(h,o)>0||l&&0>this.ua(h,l))&&(a=!0)):!u&&h?(n.track({type:0,doc:h}),d=!0):u&&!h&&(n.track({type:1,doc:u}),d=!0,(o||l)&&(a=!0)),d&&(h?(s=s.add(h),i=f?i.add(e):i.delete(e)):(s=s.delete(e),i=i.delete(e)))}),null!==this.query.limit)for(;s.size>this.query.limit;){let e="F"===this.query.limitType?s.last():s.first();s=s.delete(e.key),i=i.delete(e.key),n.track({type:1,doc:e})}return{ca:s,Pa:n,Xi:a,mutatedKeys:i}}Ia(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n,r){let i=this.ca;this.ca=e.ca,this.mutatedKeys=e.mutatedKeys;let s=e.Pa.k_();s.sort((e,t)=>(function(e,t){let n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return rs()}};return n(e)-n(t)})(e.type,t.type)||this.ua(e.doc,t.doc)),this.Ta(n),r=null!=r&&r;let a=t&&!r?this.Ea():[],o=0===this.aa.size&&this.current&&!r?1:0,l=o!==this._a;return this._a=o,0!==s.length||l?{snapshot:new uP(this.query,e.ca,i,s,e.mutatedKeys,0===o,l,!1,!!n&&n.resumeToken.approximateByteSize()>0),da:a}:{da:a}}U_(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({ca:this.ca,Pa:new uO,mutatedKeys:this.mutatedKeys,Xi:!1},!1)):{da:[]}}Aa(e){return!this.oa.has(e)&&!!this.ca.has(e)&&!this.ca.get(e).hasLocalMutations}Ta(e){e&&(e.addedDocuments.forEach(e=>this.oa=this.oa.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.oa=this.oa.delete(e)),this.current=e.current)}Ea(){if(!this.current)return[];let e=this.aa;this.aa=sW(),this.ca.forEach(e=>{this.Aa(e.key)&&(this.aa=this.aa.add(e.key))});let t=[];return e.forEach(e=>{this.aa.has(e)||t.push(new uY(e))}),this.aa.forEach(n=>{e.has(n)||t.push(new uW(n))}),t}Ra(e){this.oa=e.hs,this.aa=sW();let t=this.ha(e.documents);return this.applyChanges(t,!0)}Va(){return uP.fromInitialDocuments(this.query,this.ca,this.mutatedKeys,0===this._a,this.hasCachedResults)}}class uJ{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class uZ{constructor(e){this.key=e,this.ma=!1}}class u0{constructor(e,t,n,r,i,s){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=s,this.fa={},this.ga=new sU(e=>sP(e),sO),this.pa=new Map,this.ya=new Set,this.wa=new iI(rD.comparator),this.Sa=new Map,this.ba=new lf,this.Da={},this.Ca=new Map,this.va=oZ.Bn(),this.onlineState="Unknown",this.Fa=void 0}get isPrimaryClient(){return!0===this.Fa}}async function u1(e,t){let n,r;let i=hp(e),s=i.ga.get(t);if(s)n=s.targetId,i.sharedClientState.addLocalQueryTarget(n),r=s.view.Va();else{let e=await lP(i.localStore,sk(t)),s=i.sharedClientState.addLocalQueryTarget(e.targetId);n=e.targetId,r=await u2(i,t,n,"current"===s,e.resumeToken),i.isPrimaryClient&&uu(i.remoteStore,e)}return r}async function u2(e,t,n,r,i){e.Ma=(t,n,r)=>(async function(e,t,n,r){let i=t.view.ha(n);i.Xi&&(i=await lV(e.localStore,t.query,!1).then(({documents:e})=>t.view.ha(e,i)));let s=r&&r.targetChanges.get(t.targetId),a=r&&null!=r.targetMismatches.get(t.targetId),o=t.view.applyChanges(i,e.isPrimaryClient,s,a);return hr(e,t.targetId,o.da),o.snapshot})(e,t,n,r);let s=await lV(e.localStore,t,!0),a=new uX(t,s.hs),o=a.ha(s.documents),l=aN.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState,i),u=a.applyChanges(o,e.isPrimaryClient,l);hr(e,n,u.da);let h=new uJ(t,n,a);return e.ga.set(t,h),e.pa.has(n)?e.pa.get(n).push(t):e.pa.set(n,[t]),u.snapshot}async function u5(e,t){let n=e.ga.get(t),r=e.pa.get(n.targetId);if(r.length>1)return e.pa.set(n.targetId,r.filter(e=>!sO(e,t))),void e.ga.delete(t);e.isPrimaryClient?(e.sharedClientState.removeLocalQueryTarget(n.targetId),e.sharedClientState.isActiveQueryTarget(n.targetId)||await lF(e.localStore,n.targetId,!1).then(()=>{e.sharedClientState.clearQueryState(n.targetId),uh(e.remoteStore,n.targetId),ht(e,n.targetId)}).catch(rU)):(ht(e,n.targetId),await lF(e.localStore,n.targetId,!0))}async function u6(e,t){try{let n=await function(e,t){let n=t.snapshotVersion,r=e.ns;return e.persistence.runTransaction("Apply remote event","readwrite-primary",i=>{let s=e.os.newChangeBuffer({trackRemovals:!0});r=e.ns;let a=[];t.targetChanges.forEach((s,o)=>{var l;let u=r.get(o);if(!u)return;a.push(e.Qr.removeMatchingKeys(i,s.removedDocuments,o).next(()=>e.Qr.addMatchingKeys(i,s.addedDocuments,o)));let h=u.withSequenceNumber(i.currentSequenceNumber);null!==t.targetMismatches.get(o)?h=h.withResumeToken(iR.EMPTY_BYTE_STRING,rI.min()).withLastLimboFreeSnapshotVersion(rI.min()):s.resumeToken.approximateByteSize()>0&&(h=h.withResumeToken(s.resumeToken,n)),r=r.insert(o,h),l=h,(0===u.resumeToken.approximateByteSize()||l.snapshotVersion.toMicroseconds()-u.snapshotVersion.toMicroseconds()>=3e8||s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size>0)&&a.push(e.Qr.updateTargetData(i,h))});let o=sz,l=sW();if(t.documentUpdates.forEach(n=>{t.resolvedLimboDocuments.has(n)&&a.push(e.persistence.referenceDelegate.updateLimboDocument(i,n))}),a.push(lO(i,s,t.documentUpdates).next(e=>{o=e.cs,l=e.ls})),!n.isEqual(rI.min())){let t=e.Qr.getLastRemoteSnapshotVersion(i).next(t=>e.Qr.setTargetsMetadata(i,i.currentSequenceNumber,n));a.push(t)}return rz.waitFor(a).next(()=>s.apply(i)).next(()=>e.localDocuments.getLocalViewOfDocuments(i,o,l)).next(()=>o)}).then(t=>(e.ns=r,t))}(e.localStore,t);t.targetChanges.forEach((t,n)=>{let r=e.Sa.get(n);r&&(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1||rs(),t.addedDocuments.size>0?r.ma=!0:t.modifiedDocuments.size>0?r.ma||rs():t.removedDocuments.size>0&&(r.ma||rs(),r.ma=!1))}),await hs(e,n,t)}catch(e){await rU(e)}}function u3(e,t,n){var r;if(e.isPrimaryClient&&0===n||!e.isPrimaryClient&&1===n){let n;let i=[];e.ga.forEach((e,n)=>{let r=n.view.U_(t);r.snapshot&&i.push(r.snapshot)}),(r=e.eventManager).onlineState=t,n=!1,r.queries.forEach((e,r)=>{for(let e of r.Q_)e.U_(t)&&(n=!0)}),n&&uG(r),i.length&&e.fa.u_(i),e.onlineState=t,e.isPrimaryClient&&e.sharedClientState.setOnlineState(t)}}async function u4(e,t,n){e.sharedClientState.updateQueryState(t,"rejected",n);let r=e.Sa.get(t),i=r&&r.key;if(i){let n=new iI(rD.comparator);n=n.insert(i,i8.newNoDocument(i,rI.min()));let r=sW().add(i),s=new aA(rI.min(),new Map,new iI(rb),n,r);await u6(e,s),e.wa=e.wa.remove(i),e.Sa.delete(t),hi(e)}else await lF(e.localStore,t,!1).then(()=>ht(e,t,n)).catch(rU)}async function u8(e,t){var n;let r=t.batch.batchId;try{let i=await (n=e.localStore).persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{let r=t.batch.keys(),i=n.os.newChangeBuffer({trackRemovals:!0});return(function(e,t,n,r){let i=n.batch,s=i.keys(),a=rz.resolve();return s.forEach(e=>{a=a.next(()=>r.getEntry(t,e)).next(t=>{let s=n.docVersions.get(e);null!==s||rs(),0>t.version.compareTo(s)&&(i.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))})}),a.next(()=>e.mutationQueue.removeMutationBatch(t,i))})(n,e,t,i).next(()=>i.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=sW();for(let n=0;n0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,r))});he(e,r,null),u7(e,r),e.sharedClientState.updateMutationState(r,"acknowledged"),await hs(e,i)}catch(e){await rU(e)}}async function u9(e,t,n){var r;try{let i=await (r=e.localStore).persistence.runTransaction("Reject batch","readwrite-primary",e=>{let n;return r.mutationQueue.lookupMutationBatch(e,t).next(t=>(null!==t||rs(),n=t.keys(),r.mutationQueue.removeMutationBatch(e,t))).next(()=>r.mutationQueue.performConsistencyCheck(e)).next(()=>r.documentOverlayCache.removeOverlaysForBatchId(e,n,t)).next(()=>r.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,n)).next(()=>r.localDocuments.getDocuments(e,n))});he(e,t,n),u7(e,t),e.sharedClientState.updateMutationState(t,"rejected",n),await hs(e,i)}catch(e){await rU(e)}}function u7(e,t){(e.Ca.get(t)||[]).forEach(e=>{e.resolve()}),e.Ca.delete(t)}function he(e,t,n){let r=e.Da[e.currentUser.toKey()];if(r){let i=r.get(t);i&&(n?i.reject(n):i.resolve(),r=r.remove(t)),e.Da[e.currentUser.toKey()]=r}}function ht(e,t,n=null){for(let r of(e.sharedClientState.removeLocalQueryTarget(t),e.pa.get(t)))e.ga.delete(r),n&&e.fa.xa(r,n);e.pa.delete(t),e.isPrimaryClient&&e.ba.Vr(t).forEach(t=>{e.ba.containsKey(t)||hn(e,t)})}function hn(e,t){e.ya.delete(t.path.canonicalString());let n=e.wa.get(t);null!==n&&(uh(e.remoteStore,n),e.wa=e.wa.remove(t),e.Sa.delete(n),hi(e))}function hr(e,t,n){for(let r of n)r instanceof uW?(e.ba.addReference(r.key,t),function(e,t){let n=t.key,r=n.path.canonicalString();e.wa.get(n)||e.ya.has(r)||(rt("SyncEngine","New document in limbo: "+n),e.ya.add(r),hi(e))}(e,r)):r instanceof uY?(rt("SyncEngine","Document no longer in limbo: "+r.key),e.ba.removeReference(r.key,t),e.ba.containsKey(r.key)||hn(e,r.key)):rs()}function hi(e){for(;e.ya.size>0&&e.wa.size{s.push(e.Ma(o,t,n).then(t=>{if((t||n)&&e.isPrimaryClient&&e.sharedClientState.updateQueryState(o.targetId,(null==t?void 0:t.fromCache)?"not-current":"current"),t){r.push(t);let e=lA.Ki(o.targetId,t);i.push(e)}}))}),await Promise.all(s),e.fa.u_(r),await async function(e,t){try{await e.persistence.runTransaction("notifyLocalViewChanges","readwrite",n=>rz.forEach(t,t=>rz.forEach(t.qi,r=>e.persistence.referenceDelegate.addReference(n,t.targetId,r)).next(()=>rz.forEach(t.Qi,r=>e.persistence.referenceDelegate.removeReference(n,t.targetId,r)))))}catch(e){if(!rQ(e))throw e;rt("LocalStore","Failed to update sequence numbers: "+e)}for(let n of t){let t=n.targetId;if(!n.fromCache){let n=e.ns.get(t),r=n.snapshotVersion,i=n.withLastLimboFreeSnapshotVersion(r);e.ns=e.ns.insert(t,i)}}}(e.localStore,i))}async function ha(e,t){var n;if(!e.currentUser.isEqual(t)){rt("SyncEngine","User change. New user:",t.toKey());let r=await lM(e.localStore,t);e.currentUser=t,n="'waitForPendingWrites' promise is rejected due to a user change.",e.Ca.forEach(e=>{e.forEach(e=>{e.reject(new rl(ro.CANCELLED,n))})}),e.Ca.clear(),e.sharedClientState.handleUserChange(t,r.removedBatchIds,r.addedBatchIds),await hs(e,r.us)}}function ho(e,t){let n=e.Sa.get(t);if(n&&n.ma)return sW().add(n.key);{let n=sW(),r=e.pa.get(t);if(!r)return n;for(let t of r){let r=e.ga.get(t);n=n.unionWith(r.view.la)}return n}}async function hl(e,t){let n=await lV(e.localStore,t.query,!0),r=t.view.Ra(n);return e.isPrimaryClient&&hr(e,t.targetId,r.da),r}async function hu(e,t){return lB(e.localStore,t).then(t=>hs(e,t))}async function hh(e,t,n,r){let i=await function(e,t){let n=e.mutationQueue;return e.persistence.runTransaction("Lookup mutation documents","readonly",r=>n.vn(r,t).next(t=>t?e.localDocuments.getDocuments(r,t):rz.resolve(null)))}(e.localStore,t);null!==i?("pending"===n?await ux(e.remoteStore):"acknowledged"===n||"rejected"===n?(he(e,t,r||null),u7(e,t),function(e,t){e.mutationQueue.Mn(t)}(e.localStore,t)):rs(),await hs(e,i)):rt("SyncEngine","Cannot apply mutation batch with id: "+t)}async function hc(e,t,n){let r=[],i=[];for(let n of t){let t;let s=e.pa.get(n);if(s&&0!==s.length)for(let n of(t=await lP(e.localStore,sk(s[0])),s)){let t=e.ga.get(n),r=await hl(e,t);r.snapshot&&i.push(r.snapshot)}else{let r=await lq(e.localStore,n);t=await lP(e.localStore,r),await u2(e,hf(r),n,!1,t.resumeToken)}r.push(t)}return e.fa.u_(i),r}function hf(e){var t,n,r,i;return t=e.path,n=e.collectionGroup,r=e.orderBy,i=e.filters,new sS(t,n,r,i,e.limit,"F",e.startAt,e.endAt)}function hd(e){return e.localStore.persistence.Li()}async function hg(e,t,n,r){if(e.Fa)return void rt("SyncEngine","Ignoring unexpected query state notification.");let i=e.pa.get(t);if(i&&i.length>0)switch(n){case"current":case"not-current":{let r=await lB(e.localStore,sq(i[0])),s=aA.createSynthesizedRemoteEventForCurrentChange(t,"current"===n,iR.EMPTY_BYTE_STRING);await hs(e,r,s);break}case"rejected":await lF(e.localStore,t,!0),ht(e,t,r);break;default:rs()}}async function hm(e,t,n){let r=hp(e);if(r.Fa){for(let e of t){if(r.pa.has(e)){rt("SyncEngine","Adding an already active target "+e);continue}let t=await lq(r.localStore,e),n=await lP(r.localStore,t);await u2(r,hf(t),n.targetId,!1,n.resumeToken),uu(r.remoteStore,n)}for(let e of n)r.pa.has(e)&&await lF(r.localStore,e,!1).then(()=>{uh(r.remoteStore,e),ht(r,e)}).catch(rU)}}function hp(e){return e.remoteStore.remoteSyncer.applyRemoteEvent=u6.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=ho.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=u4.bind(null,e),e.fa.u_=uU.bind(null,e.eventManager),e.fa.xa=uz.bind(null,e.eventManager),e}function hy(e){return e.remoteStore.remoteSyncer.applySuccessfulWrite=u8.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=u9.bind(null,e),e}class hw{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=l7(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedClientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,t){return null}createIndexBackfillerScheduler(e,t){return null}createLocalStore(e){var t;return t=this.persistence,new lR(t,new lk,e.initialUser,this.serializer)}createPersistence(e){return new lw(lb.Hr,this.serializer)}createSharedClientState(e){return new lJ}async terminate(){var e,t;null===(e=this.gcScheduler)||void 0===e||e.stop(),null===(t=this.indexBackfillerScheduler)||void 0===t||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class hv extends hw{constructor(e){super(),this.cacheSizeBytes=e}createGarbageCollectionScheduler(e,t){return this.persistence.referenceDelegate instanceof lx||rs(),new o4(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}createPersistence(e){let t=void 0!==this.cacheSizeBytes?oK.withCacheSize(this.cacheSizeBytes):oK.DEFAULT;return new lw(e=>lx.Hr(e,t),this.serializer)}}class hb extends hw{constructor(e,t,n){super(),this.Na=e,this.cacheSizeBytes=t,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.Na.initialize(this,e),await hy(this.Na.syncEngine),await ux(this.Na.remoteStore),await this.persistence.fi(()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve()))}createLocalStore(e){var t;return t=this.persistence,new lR(t,new lk,e.initialUser,this.serializer)}createGarbageCollectionScheduler(e,t){return new o4(this.persistence.referenceDelegate.garbageCollector,e.asyncQueue,t)}createIndexBackfillerScheduler(e,t){let n=new rZ(t,this.persistence);return new rJ(e.asyncQueue,n)}createPersistence(e){let t=lD(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?oK.withCacheSize(this.cacheSizeBytes):oK.DEFAULT;return new lT(this.synchronizeTabs,t,e.clientId,n,e.asyncQueue,l8(),l9(),this.serializer,this.sharedClientState,!!this.forceOwnership)}createSharedClientState(e){return new lJ}}class hx extends hb{constructor(e,t){super(e,t,!1),this.Na=e,this.cacheSizeBytes=t,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);let t=this.Na.syncEngine;this.sharedClientState instanceof lX&&(this.sharedClientState.syncEngine={Zs:hh.bind(null,t),Xs:hg.bind(null,t),eo:hm.bind(null,t),Li:hd.bind(null,t),Ys:hu.bind(null,t)},await this.sharedClientState.start()),await this.persistence.fi(async e=>{await async function(e,t){if(hp(e),hy(e),!0===t&&!0!==e.Fa){let t=e.sharedClientState.getAllActiveQueryTargets(),n=await hc(e,t.toArray());for(let t of(e.Fa=!0,await uA(e.remoteStore,!0),n))uu(e.remoteStore,t)}else if(!1===t&&!1!==e.Fa){let t=[],n=Promise.resolve();e.pa.forEach((r,i)=>{e.sharedClientState.isLocalQueryTarget(i)?t.push(i):n=n.then(()=>(ht(e,i),lF(e.localStore,i,!0))),uh(e.remoteStore,i)}),await n,await hc(e,t),e.Sa.forEach((t,n)=>{uh(e.remoteStore,n)}),e.ba.mr(),e.Sa=new Map,e.wa=new iI(rD.comparator),e.Fa=!1,await uA(e.remoteStore,!1)}}(this.Na.syncEngine,e),this.gcScheduler&&(e&&!this.gcScheduler.started?this.gcScheduler.start():e||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(e&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():e||this.indexBackfillerScheduler.stop())})}createSharedClientState(e){let t=l8();if(!lX.D(t))throw new rl(ro.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");let n=lD(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new lX(t,e.asyncQueue,n,e.clientId,e.initialUser)}}class h_{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>u3(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=ha.bind(null,this.syncEngine),await uA(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new uV}createDatastore(e){let t=l7(e.databaseInfo.databaseId),n=new l4(e.databaseInfo);return new ui(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){var t;return t=this.localStore,new ua(t,this.datastore,e.asyncQueue,e=>u3(this.syncEngine,e,0),l0.D()?new l0:new lZ)}createSyncEngine(e,t){return function(e,t,n,r,i,s,a){let o=new u0(e,t,n,r,i,s);return a&&(o.Fa=!0),o}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e;await async function(e){rt("RemoteStore","RemoteStore shutting down."),e.v_.add(5),await ul(e),e.M_.shutdown(),e.x_.set("Unknown")}(this.remoteStore),null===(e=this.datastore)||void 0===e||e.terminate()}}function hI(e,t=10240){let n=0;return{async read(){if(n{this.muted||e(t)},0)}}class hT{constructor(e,t){this.ka=e,this.serializer=t,this.metadata=new ru,this.buffer=new Uint8Array,this.qa=new TextDecoder("utf-8"),this.Qa().then(e=>{e&&e.ea()?this.metadata.resolve(e.X_.metadata):this.metadata.reject(Error(`The first element of the bundle is not a metadata, it is + ${JSON.stringify(null==e?void 0:e.X_)}`))},e=>this.metadata.reject(e))}close(){return this.ka.cancel()}async getMetadata(){return this.metadata.promise}async Oa(){return await this.getMetadata(),this.Qa()}async Qa(){let e=await this.Ka();if(null===e)return null;let t=this.qa.decode(e),n=Number(t);return isNaN(n)&&this.$a(`length string (${t}) is not valid number`),new uK(JSON.parse(await this.Ua(n)),e.length+n)}Wa(){return this.buffer.findIndex(e=>123===e)}async Ka(){for(;0>this.Wa()&&!await this.Ga(););if(0===this.buffer.length)return null;let e=this.Wa();e<0&&this.$a("Reached the end of bundle when a length string is expected.");let t=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),t}async Ua(e){for(;this.buffer.length0)throw this.lastTransactionError=new rl(ro.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;let t=await async function(e,t){let n={documents:t.map(t=>aW(e.serializer,t))},r=await e.vo("BatchGetDocuments",e.serializer.databaseId,rT.emptyPath(),n,t.length),i=new Map;r.forEach(t=>{var n;let r=(n=e.serializer,"found"in t?function(e,t){t.found||rs(),t.found.name,t.found.updateTime;let n=aY(e,t.found.name),r=aK(t.found.updateTime),i=t.found.createTime?aK(t.found.createTime):rI.min(),s=new i4({mapValue:{fields:t.found.fields}});return i8.newFoundDocument(n,r,i,s)}(n,t):"missing"in t?function(e,t){t.missing||rs(),t.readTime||rs();let n=aY(e,t.missing),r=aK(t.readTime);return i8.newNoDocument(n,r)}(n,t):rs());i.set(r.key.toString(),r)});let s=[];return t.forEach(e=>{let t=i.get(e.toString());t||rs(),s.push(t)}),s}(this.datastore,e);return t.forEach(e=>this.recordVersion(e)),t}set(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(e){this.lastTransactionError=e}this.writtenDocs.add(e.toString())}delete(e){this.write(new ad(e,this.precondition(e))),this.writtenDocs.add(e.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;let e=this.readVersions;this.mutations.forEach(t=>{e.delete(t.key.toString())}),e.forEach((e,t)=>{let n=rD.fromPath(t);this.mutations.push(new ag(n,this.precondition(n)))}),await async function(e,t){let n={writes:t.map(t=>a5(e.serializer,t))};await e.So("Commit",e.serializer.databaseId,rT.emptyPath(),n)}(this.datastore,this.mutations),this.committed=!0}recordVersion(e){let t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw rs();t=rI.min()}let n=this.readVersions.get(e.key.toString());if(n){if(!t.isEqual(n))throw new rl(ro.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)}precondition(e){let t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?t.isEqual(rI.min())?an.exists(!1):an.updateTime(t):an.none()}preconditionForUpdate(e){let t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(rI.min()))throw new rl(ro.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return an.updateTime(t)}return an.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}}class hC{constructor(e,t,n,r,i){this.asyncQueue=e,this.datastore=t,this.options=n,this.updateFunction=r,this.deferred=i,this.za=n.maxAttempts,this.jo=new ue(this.asyncQueue,"transaction_retry")}ja(){this.za-=1,this.Ha()}Ha(){this.jo.qo(async()=>{let e=new hS(this.datastore),t=this.Ja(e);t&&t.then(t=>{this.asyncQueue.enqueueAndForget(()=>e.commit().then(()=>{this.deferred.resolve(t)}).catch(e=>{this.Ya(e)}))}).catch(e=>{this.Ya(e)})})}Ja(e){try{let t=this.updateFunction(e);return!r1(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.deferred.reject(e),null}}Ya(e){this.za>0&&this.Za(e)?(this.za-=1,this.asyncQueue.enqueueAndForget(()=>(this.Ha(),Promise.resolve()))):this.deferred.reject(e)}Za(e){if("FirebaseError"===e.name){let t=e.code;return"aborted"===t||"failed-precondition"===t||"already-exists"===t||!ab(t)}return!1}}class hD{constructor(e,t,n,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=n4.UNAUTHENTICATED,this.clientId=rv.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,async e=>{rt("FirestoreClient","Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(rt("FirestoreClient","Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new rl(ro.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();let e=new ru;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){let t=uM(n,"Failed to shutdown persistence");e.reject(t)}}),e.promise}}async function hA(e,t){e.asyncQueue.verifyOperationInProgress(),rt("FirestoreClient","Initializing OfflineComponentProvider");let n=e.configuration;await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener(async e=>{r.isEqual(e)||(await lM(t.localStore,e),r=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function hN(e,t){e.asyncQueue.verifyOperationInProgress();let n=await hR(e);rt("FirestoreClient","Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(e=>uD(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>uD(t.remoteStore,n)),e._onlineComponents=t}function hk(e){return"FirebaseError"===e.name?e.code===ro.FAILED_PRECONDITION||e.code===ro.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}async function hR(e){if(!e._offlineComponents){if(e._uninitializedComponentsProvider){rt("FirestoreClient","Using user provided OfflineComponentProvider");try{await hA(e,e._uninitializedComponentsProvider._offline)}catch(t){if(!hk(t))throw t;rr("Error using user provided cache. Falling back to memory cache: "+t),await hA(e,new hw)}}else rt("FirestoreClient","Using default OfflineComponentProvider"),await hA(e,new hw)}return e._offlineComponents}async function hM(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(rt("FirestoreClient","Using user provided OnlineComponentProvider"),await hN(e,e._uninitializedComponentsProvider._online)):(rt("FirestoreClient","Using default OnlineComponentProvider"),await hN(e,new h_))),e._onlineComponents}function hL(e){return hR(e).then(e=>e.persistence)}function hO(e){return hR(e).then(e=>e.localStore)}function hP(e){return hM(e).then(e=>e.remoteStore)}function hF(e){return hM(e).then(e=>e.syncEngine)}function hV(e){return hM(e).then(e=>e.datastore)}async function hq(e){let t=await hM(e),n=t.eventManager;return n.onListen=u1.bind(null,t.syncEngine),n.onUnlisten=u5.bind(null,t.syncEngine),n}function hB(e,t,n={}){let r=new ru;return e.asyncQueue.enqueueAndForget(async()=>(function(e,t,n,r,i){let s=new hE({next:s=>{t.enqueueAndForget(()=>uB(e,a));let o=s.docs.has(n);!o&&s.fromCache?i.reject(new rl(ro.UNAVAILABLE,"Failed to get document because the client is offline.")):o&&s.fromCache&&r&&"server"===r.source?i.reject(new rl(ro.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.)')):i.resolve(s)},error:e=>i.reject(e)}),a=new uj(sC(n.path),s,{includeMetadataChanges:!0,Z_:!0});return uq(e,a)})(await hq(e),e.asyncQueue,t,n,r)),r.promise}function hU(e,t,n={}){let r=new ru;return e.asyncQueue.enqueueAndForget(async()=>(function(e,t,n,r,i){let s=new uj(n,new hE({next:n=>{t.enqueueAndForget(()=>uB(e,s)),n.fromCache&&"server"===r.source?i.reject(new rl(ro.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.)')):i.resolve(n)},error:e=>i.reject(e)}),{includeMetadataChanges:!0,Z_:!0});return uq(e,s)})(await hq(e),e.asyncQueue,t,n,r)),r.promise}function hz(e){let t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}let hG=new Map;function hj(e,t,n){if(!n)throw new rl(ro.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function hK(e,t,n,r){if(!0===t&&!0===r)throw new rl(ro.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}function h$(e){if(!rD.isDocumentKey(e))throw new rl(ro.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function hQ(e){if(rD.isDocumentKey(e))throw new rl(ro.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function hH(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{var t;let n=(t=e).constructor?t.constructor.name:null;return n?`a custom ${n} object`:"an object"}}return"function"==typeof e?"a function":rs()}function hW(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new rl(ro.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{let n=hH(e);throw new rl(ro.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}function hY(e,t){if(t<=0)throw new rl(ro.INVALID_ARGUMENT,`Function ${e}() requires a positive number, but it was: ${t}.`)}class hX{constructor(e){var t,n;if(void 0===e.host){if(void 0!==e.ssl)throw new rl(ro.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=0x2800000;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new rl(ro.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}hK("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=hz(null!==(n=e.experimentalLongPollingOptions)&&void 0!==n?n:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new rl(ro.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new rl(ro.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new rl(ro.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){var t,n;return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(t=this.experimentalLongPollingOptions,n=e.experimentalLongPollingOptions,t.timeoutSeconds===n.timeoutSeconds)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class hJ{constructor(e,t,n,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new hX({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new rl(ro.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(e){if(this._settingsFrozen)throw new rl(ro.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 hX(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new rc;switch(e.type){case"firstParty":return new rm(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new rl(ro.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.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(e){let t=hG.get(e);t&&(rt("ComponentProvider","Removing Datastore"),hG.delete(e),t.terminate())}(this),Promise.resolve()}}function hZ(e,t,n,r={}){var i;let s=(e=hW(e,hJ))._getSettings(),a=`${t}:${n}`;if("firestore.googleapis.com"!==s.host&&s.host!==a&&rr("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},s),{host:a,ssl:!1})),r.mockUserToken){let t,n;if("string"==typeof r.mockUserToken)t=r.mockUserToken,n=n4.MOCK_USER;else{t=function(e,t){if(e.uid)throw Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');let n=t||"demo-project",r=e.iat||0,i=e.sub||e.user_id;if(!i)throw Error("mockUserToken must contain 'sub' or 'user_id' field!");let s=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[d(JSON.stringify({alg:"none",type:"JWT"})),d(JSON.stringify(s)),""].join(".")}(r.mockUserToken,null===(i=e._app)||void 0===i?void 0:i.options.projectId);let s=r.mockUserToken.sub||r.mockUserToken.user_id;if(!s)throw new rl(ro.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new n4(s)}e._authCredentials=new rf(new rh(t,n))}}class h0{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new h0(this.firestore,e,this._query)}}class h1{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new h2(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new h1(this.firestore,e,this._key)}}class h2 extends h0{constructor(e,t,n){super(e,t,sC(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){let e=this._path.popLast();return e.isEmpty()?null:new h1(this.firestore,null,new rD(e))}withConverter(e){return new h2(this.firestore,e,this._path)}}function h5(e,t,...n){if(e=T(e),hj("collection","path",t),e instanceof hJ){let r=rT.fromString(t,...n);return hQ(r),new h2(e,null,r)}{if(!(e instanceof h1||e instanceof h2))throw new rl(ro.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=e._path.child(rT.fromString(t,...n));return hQ(r),new h2(e.firestore,null,r)}}function h6(e,t){if(e=hW(e,hJ),hj("collectionGroup","collection id",t),t.indexOf("/")>=0)throw new rl(ro.INVALID_ARGUMENT,`Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new h0(e,null,new sS(rT.emptyPath(),t))}function h3(e,t,...n){if(e=T(e),1==arguments.length&&(t=rv.newId()),hj("doc","path",t),e instanceof hJ){let r=rT.fromString(t,...n);return h$(r),new h1(e,null,new rD(r))}{if(!(e instanceof h1||e instanceof h2))throw new rl(ro.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");let r=e._path.child(rT.fromString(t,...n));return h$(r),new h1(e.firestore,e instanceof h2?e.converter:null,new rD(r))}}function h4(e,t){return e=T(e),t=T(t),(e instanceof h1||e instanceof h2)&&(t instanceof h1||t instanceof h2)&&e.firestore===t.firestore&&e.path===t.path&&e.converter===t.converter}function h8(e,t){return e=T(e),t=T(t),e instanceof h0&&t instanceof h0&&e.firestore===t.firestore&&sO(e._query,t._query)&&e.converter===t.converter}class h9{constructor(){this.Xa=Promise.resolve(),this.eu=[],this.tu=!1,this.nu=[],this.ru=null,this.iu=!1,this.su=!1,this.ou=[],this.jo=new ue(this,"async_queue_retry"),this._u=()=>{let e=l9();e&&rt("AsyncQueue","Visibility state changed to "+e.visibilityState),this.jo.Ko()};let e=l9();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this._u)}get isShuttingDown(){return this.tu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.au(),this.uu(e)}enterRestrictedMode(e){if(!this.tu){this.tu=!0,this.su=e||!1;let t=l9();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this._u)}}enqueue(e){if(this.au(),this.tu)return new Promise(()=>{});let t=new ru;return this.uu(()=>this.tu&&this.su?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.eu.push(e),this.cu()))}async cu(){if(0!==this.eu.length){try{await this.eu[0](),this.eu.shift(),this.jo.reset()}catch(e){if(!rQ(e))throw e;rt("AsyncQueue","Operation failed with retryable error: "+e)}this.eu.length>0&&this.jo.qo(()=>this.cu())}}uu(e){let t=this.Xa.then(()=>(this.iu=!0,e().catch(e=>{let t;throw this.ru=e,this.iu=!1,rn("INTERNAL UNHANDLED ERROR: ",(t=e.message||"",e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t)),e}).then(e=>(this.iu=!1,e))));return this.Xa=t,t}enqueueAfterDelay(e,t,n){this.au(),this.ou.indexOf(e)>-1&&(t=0);let r=uR.createAndSchedule(this,e,t,n,e=>this.lu(e));return this.nu.push(r),r}au(){this.ru&&rs()}verifyOperationInProgress(){}async hu(){let e;do e=this.Xa,await e;while(e!==this.Xa)}Pu(e){for(let t of this.nu)if(t.timerId===e)return!0;return!1}Iu(e){return this.hu().then(()=>{for(let t of(this.nu.sort((e,t)=>e.targetTimeMs-t.targetTimeMs),this.nu))if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.hu()})}Tu(e){this.ou.push(e)}lu(e){let t=this.nu.indexOf(e);this.nu.splice(t,1)}}function h7(e){return function(e,t){if("object"!=typeof e||null===e)return!1;for(let n of t)if(n in e&&"function"==typeof e[n])return!0;return!1}(e,["next","error","complete"])}class ce{constructor(){this._progressObserver={},this._taskCompletionResolver=new ru,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(e,t,n){this._progressObserver={next:e,error:t,complete:n}}catch(e){return this._taskCompletionResolver.promise.catch(e)}then(e,t){return this._taskCompletionResolver.promise.then(e,t)}_completeWith(e){this._updateProgress(e),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(e)}_failWith(e){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(e),this._taskCompletionResolver.reject(e)}_updateProgress(e){this._lastProgress=e,this._progressObserver.next&&this._progressObserver.next(e)}}let ct=-1;class cn extends hJ{constructor(e,t,n,r){super(e,t,n,r),this.type="firestore",this._queue=new h9,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||ca(this),this._firestoreClient.terminate()}}function cr(e,t,n){n||(n="(default)");let r=(0,l._getProvider)(e,"firestore");if(r.isInitialized(n)){let e=r.getImmediate({identifier:n});if(I(r.getOptions(n),t))return e;throw new rl(ro.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!==t.cacheSizeBytes&&void 0!==t.localCache)throw new rl(ro.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(void 0!==t.cacheSizeBytes&&-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new rl(ro.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return r.initialize({options:t,instanceIdentifier:n})}function ci(e,t){let n="object"==typeof e?e:(0,l.getApp)(),r=(0,l._getProvider)(n,"firestore").getImmediate({identifier:"string"==typeof e?e:t||"(default)"});if(!r._initialized){let e=y("firestore");e&&hZ(r,...e)}return r}function cs(e){return e._firestoreClient||ca(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function ca(e){var t,n,r,i;let s=e._freezeSettings(),a=(i=e._databaseId,new iB(i,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,s.host,s.ssl,s.experimentalForceLongPolling,s.experimentalAutoDetectLongPolling,hz(s.experimentalLongPollingOptions),s.useFetchStreams));e._firestoreClient=new hD(e._authCredentials,e._appCheckCredentials,e._queue,a),(null===(n=s.localCache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(r=s.localCache)||void 0===r?void 0:r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:s.localCache.kind,_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider})}function co(e,t){cy(e=hW(e,cn));let n=cs(e);if(n._uninitializedComponentsProvider)throw new rl(ro.FAILED_PRECONDITION,"SDK cache is already specified.");rr("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");let r=e._freezeSettings(),i=new h_;return cu(n,i,new hb(i,r.cacheSizeBytes,null==t?void 0:t.forceOwnership))}function cl(e){cy(e=hW(e,cn));let t=cs(e);if(t._uninitializedComponentsProvider)throw new rl(ro.FAILED_PRECONDITION,"SDK cache is already specified.");rr("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");let n=e._freezeSettings(),r=new h_;return cu(t,r,new hx(r,n.cacheSizeBytes))}function cu(e,t,n){let r=new ru;return e.asyncQueue.enqueue(async()=>{try{await hA(e,n),await hN(e,t),r.resolve()}catch(e){if(!hk(e))throw e;rr("Error enabling indexeddb cache. Falling back to memory cache: "+e),r.reject(e)}}).then(()=>r.promise)}function ch(e){if(e._initialized&&!e._terminated)throw new rl(ro.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");let t=new ru;return e._queue.enqueueAndForgetEvenWhileRestricted(async()=>{try{await async function(e){if(!rj.D())return Promise.resolve();await rj.delete(e+"main")}(lD(e._databaseId,e._persistenceKey)),t.resolve()}catch(e){t.reject(e)}}),t.promise}function cc(e){return function(e){let t=new ru;return e.asyncQueue.enqueueAndForget(async()=>(async function(e,t){var n;um(e.remoteStore)||rt("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{let r=await (n=e.localStore).persistence.runTransaction("Get highest unacknowledged batch id","readonly",e=>n.mutationQueue.getHighestUnacknowledgedBatchId(e));if(-1===r)return void t.resolve();let i=e.Ca.get(r)||[];i.push(t),e.Ca.set(r,i)}catch(n){let e=uM(n,"Initialization of waitForPendingWrites() operation failed");t.reject(e)}})(await hF(e),t)),t.promise}(cs(e=hW(e,cn)))}function cf(e){var t;return(t=cs(e=hW(e,cn))).asyncQueue.enqueue(async()=>{let e=await hL(t),n=await hP(t);return e.setNetworkEnabled(!0),n.v_.delete(0),uo(n)})}function cd(e){var t;return(t=cs(e=hW(e,cn))).asyncQueue.enqueue(async()=>{let e=await hL(t),n=await hP(t);return e.setNetworkEnabled(!1),async function(e){e.v_.add(0),await ul(e),e.x_.set("Offline")}(n)})}function cg(e){return(0,l._removeServiceInstance)(e.app,"firestore",e._databaseId.database),e._delete()}function cm(e,t){let n=cs(e=hW(e,cn)),r=new ce;return function(e,t,n,r){var i;let s=(i=l7(t),new hT(function(e,t){if(e instanceof Uint8Array)return hI(e,void 0);if(e instanceof ArrayBuffer)return hI(new Uint8Array(e),void 0);if(e instanceof ReadableStream)return e.getReader();throw Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}("string"==typeof n?aI().encode(n):n),i));e.asyncQueue.enqueueAndForget(async()=>{!function(e,t,n){(async function(e,t,n){try{var r;let i=await t.getMetadata();if(await function(e,t){let n=aK(t.createTime);return e.persistence.runTransaction("hasNewerBundle","readonly",n=>e.$r.getBundleMetadata(n,t.id)).then(e=>!!e&&e.createTime.compareTo(n)>=0)}(e.localStore,i))return await t.close(),n._completeWith({taskState:"Success",documentsLoaded:i.totalDocuments,bytesLoaded:i.totalBytes,totalDocuments:i.totalDocuments,totalBytes:i.totalBytes}),Promise.resolve(new Set);n._updateProgress(uH(i));let s=new uQ(i,e.localStore,t.serializer),a=await t.Oa();for(;a;){let e=await s.na(a);e&&n._updateProgress(e),a=await t.Oa()}let o=await s.complete();return await hs(e,o.sa,void 0),await (r=e.localStore).persistence.runTransaction("Save bundle","readwrite",e=>r.$r.saveBundleMetadata(e,i)),n._completeWith(o.progress),Promise.resolve(o.ia)}catch(e){return rr("SyncEngine",`Loading bundle failed with ${e}`),n._failWith(e),Promise.resolve(new Set)}})(e,t,n).then(t=>{e.sharedClientState.notifyBundleLoaded(t)})}(await hF(e),s,r)})}(n,e._databaseId,t,r),r}function cp(e,t){var n;return(n=cs(e=hW(e,cn))).asyncQueue.enqueue(async()=>{var e;return(e=await hO(n)).persistence.runTransaction("Get named query","readonly",n=>e.$r.getNamedQuery(n,t))}).then(t=>t?new h0(e,null,t.query):null)}function cy(e){if(e._initialized||e._terminated)throw new rl(ro.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.")}class cw{constructor(e="count",t){this._internalFieldPath=t,this.type="AggregateField",this.aggregateType=e}}class cv{constructor(e,t,n){this._userDataWriter=t,this._data=n,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}}class cb{constructor(e){this._byteString=e}static fromBase64String(e){try{return new cb(iR.fromBase64String(e))}catch(e){throw new rl(ro.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new cb(iR.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}class cx{constructor(...e){for(let t=0;t90)throw new rl(ro.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new rl(ro.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return rb(this._lat,e._lat)||rb(this._long,e._long)}}let cT=/^__.*__$/;class cS{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new au(e,this.data,this.fieldMask,t,this.fieldTransforms):new al(e,this.data,t,this.fieldTransforms)}}class cC{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new au(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function cD(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw rs()}}class cA{constructor(e,t,n,r,i,s){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.Eu(),this.fieldTransforms=i||[],this.fieldMask=s||[]}get path(){return this.settings.path}get du(){return this.settings.du}Au(e){return new cA(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Ru(e){var t;let n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Au({path:n,Vu:!1});return r.mu(e),r}fu(e){var t;let n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Au({path:n,Vu:!1});return r.Eu(),r}gu(e){return this.Au({path:void 0,Vu:!0})}pu(e){return cW(e,this.settings.methodName,this.settings.yu||!1,this.path,this.settings.wu)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}Eu(){if(this.path)for(let e=0;ea.covers(e.field))}else a=null,o=l.fieldTransforms;return new cS(new i4(u),a,o)}class cM extends cI{_toFieldTransform(e){if(2!==e.du)throw 1===e.du?e.pu(`${this._methodName}() can only appear at the top level of your update data`):e.pu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof cM}}function cL(e,t,n){return new cA({du:3,wu:t.settings.wu,methodName:e._methodName,Vu:n},t.databaseId,t.serializer,t.ignoreUndefinedProperties)}class cO extends cI{_toFieldTransform(e){return new ae(e.path,new s2)}isEqual(e){return e instanceof cO}}class cP extends cI{constructor(e,t){super(e),this.bu=t}_toFieldTransform(e){let t=cL(this,e,!0),n=new s5(this.bu.map(e=>cz(e,t)));return new ae(e.path,n)}isEqual(e){return e instanceof cP&&I(this.bu,e.bu)}}class cF extends cI{constructor(e,t){super(e),this.bu=t}_toFieldTransform(e){let t=cL(this,e,!0),n=new s3(this.bu.map(e=>cz(e,t)));return new ae(e.path,n)}isEqual(e){return e instanceof cF&&I(this.bu,e.bu)}}class cV extends cI{constructor(e,t){super(e),this.Du=t}_toFieldTransform(e){let t=new s8(e.serializer,sZ(e.serializer,this.Du));return new ae(e.path,t)}isEqual(e){return e instanceof cV&&this.Du===e.Du}}function cq(e,t,n,r){let i=e.Su(1,t,n);cK("Data must be an object, but it was:",i,r);let s=[],a=i4.empty();return ix(r,(e,r)=>{let o=cH(t,e,n);r=T(r);let l=i.fu(o);if(r instanceof cM)s.push(o);else{let e=cz(r,l);null!=e&&(s.push(o),a.set(o,e))}}),new cC(a,new iA(s),i.fieldTransforms)}function cB(e,t,n,r,i,s){let a=e.Su(1,t,n),o=[c$(t,r,n)],l=[i];if(s.length%2!=0)throw new rl(ro.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let e=0;e=0;--e)if(!cY(u,o[e])){let t=o[e],n=l[e];n=T(n);let r=a.fu(t);if(n instanceof cM)u.push(t);else{let e=cz(n,r);null!=e&&(u.push(t),h.set(t,e))}}return new cC(h,new iA(u),a.fieldTransforms)}function cU(e,t,n,r=!1){return cz(n,e.Su(r?4:3,t))}function cz(e,t){if(cj(e=T(e)))return cK("Unsupported field value:",t,e),cG(e,t);if(e instanceof cI)return function(e,t){if(!cD(t.du))throw t.pu(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t.pu(`${e._methodName}() is not currently supported inside arrays`);let n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.Vu&&4!==t.du)throw t.pu("Nested arrays are not supported");return function(e,t){let n=[],r=0;for(let i of e){let e=cz(i,t.gu(r));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=T(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return sZ(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){let n=r_.fromDate(e);return{timestampValue:aG(t.serializer,n)}}if(e instanceof r_){let n=new r_(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:aG(t.serializer,n)}}if(e instanceof cE)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof cb)return{bytesValue:aj(t.serializer,e._byteString)};if(e instanceof h1){let n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t.pu(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:a$(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t.pu(`Unsupported field value: ${hH(e)}`)}(e,t)}function cG(e,t){let n={};return i_(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):ix(e,(e,r)=>{let i=cz(r,t.Ru(e));null!=i&&(n[e]=i)}),{mapValue:{fields:n}}}function cj(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof r_||e instanceof cE||e instanceof cb||e instanceof h1||e instanceof cI)}function cK(e,t,n){if(!cj(n)||!("object"==typeof n&&null!==n&&(Object.getPrototypeOf(n)===Object.prototype||null===Object.getPrototypeOf(n)))){let r=hH(n);throw"an object"===r?t.pu(e+" a custom object"):t.pu(e+" "+r)}}function c$(e,t,n){if((t=T(t))instanceof cx)return t._internalPath;if("string"==typeof t)return cH(e,t);throw cW("Field path arguments must be of type string or ",e,!1,void 0,n)}let cQ=RegExp("[~\\*/\\[\\]]");function cH(e,t,n){if(t.search(cQ)>=0)throw cW(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new cx(...t.split("."))._internalPath}catch(r){throw cW(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function cW(e,t,n,r,i){let s=r&&!r.isEmpty(),a=void 0!==i,o=`Function ${t}() called with invalid data`;n&&(o+=" (via `toFirestore()`)"),o+=". ";let l="";return(s||a)&&(l+=" (found",s&&(l+=` in field ${r}`),a&&(l+=` in document ${i}`),l+=")"),new rl(ro.INVALID_ARGUMENT,o+e+l)}function cY(e,t){return e.some(e=>e.isEqual(t))}class cX{constructor(e,t,n,r,i){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new h1(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){let e=new cJ(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){let t=this._document.data.field(cZ("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class cJ extends cX{data(){return super.data()}}function cZ(e,t){return"string"==typeof t?cH(e,t):t instanceof cx?t._internalPath:t._delegate._internalPath}function c0(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new rl(ro.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class c1{}class c2 extends c1{}function c5(e,t,...n){let r=[];for(let i of(t instanceof c1&&r.push(t),function(e){let t=e.filter(e=>e instanceof c4).length,n=e.filter(e=>e instanceof c6).length;if(t>1||t>0&&n>0)throw new rl(ro.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r=r.concat(n)),r))e=i._apply(e);return e}class c6 extends c2{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new c6(e,t,n)}_apply(e){let t=this._parse(e);return fd(e._query,t),new h0(e.firestore,e.converter,sM(e._query,t))}_parse(e){let t=ck(e.firestore);return function(e,t,n,r,i,s,a){let o;if(i.isKeyField()){if("array-contains"===s||"array-contains-any"===s)throw new rl(ro.INVALID_ARGUMENT,`Invalid Query. You can't perform '${s}' queries on documentId().`);if("in"===s||"not-in"===s){ff(a,s);let t=[];for(let n of a)t.push(fc(r,e,n));o={arrayValue:{values:t}}}else o=fc(r,e,a)}else"in"!==s&&"not-in"!==s&&"array-contains-any"!==s||ff(a,s),o=cU(n,t,a,"in"===s||"not-in"===s);return sr.create(i,s,o)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function c3(e,t,n){let r=cZ("where",e);return c6._create(r,t,n)}class c4 extends c1{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new c4(e,t)}_parse(e){let t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:si.create(t,this._getOperator())}_apply(e){let t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;for(let e of t.getFlattenedFilters())fd(n,e),n=sM(n,e)}(e._query,t),new h0(e.firestore,e.converter,sM(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}function c8(...e){return e.forEach(e=>fg("or",e)),c4._create("or",e)}function c9(...e){return e.forEach(e=>fg("and",e)),c4._create("and",e)}class c7 extends c2{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new c7(e,t)}_apply(e){let t=function(e,t,n){if(null!==e.startAt)throw new rl(ro.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new rl(ro.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new st(t,n)}(e._query,this._field,this._direction);return new h0(e.firestore,e.converter,function(e,t){let n=e.explicitOrderBy.concat([t]);return new sS(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function fe(e,t="asc"){let n=cZ("orderBy",e);return c7._create(n,t)}class ft extends c2{constructor(e,t,n){super(),this.type=e,this._limit=t,this._limitType=n}static _create(e,t,n){return new ft(e,t,n)}_apply(e){return new h0(e.firestore,e.converter,sL(e._query,this._limit,this._limitType))}}function fn(e){return hY("limit",e),ft._create("limit",e,"F")}function fr(e){return hY("limitToLast",e),ft._create("limitToLast",e,"L")}class fi extends c2{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new fi(e,t,n)}_apply(e){var t;let n=fh(e,this.type,this._docOrFields,this._inclusive);return new h0(e.firestore,e.converter,new sS((t=e._query).path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,n,t.endAt))}}function fs(...e){return fi._create("startAt",e,!0)}function fa(...e){return fi._create("startAfter",e,!1)}class fo extends c2{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new fo(e,t,n)}_apply(e){var t;let n=fh(e,this.type,this._docOrFields,this._inclusive);return new h0(e.firestore,e.converter,new sS((t=e._query).path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,n))}}function fl(...e){return fo._create("endBefore",e,!1)}function fu(...e){return fo._create("endAt",e,!0)}function fh(e,t,n,r){if(n[0]=T(n[0]),n[0]instanceof cX)return function(e,t,n,r,i){if(!r)throw new rl(ro.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${n}().`);let s=[];for(let n of sN(e))if(n.field.isKeyField())s.push(iY(t,r.key));else{let e=r.data.field(n.field);if(iF(e))throw new rl(ro.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===e){let e=n.field.canonicalString();throw new rl(ro.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${e}' (used as the orderBy) does not exist.`)}s.push(e)}return new i9(s,i)}(e._query,e.firestore._databaseId,t,n[0]._document,r);{let i=ck(e.firestore);return function(e,t,n,r,i,s){let a=e.explicitOrderBy;if(i.length>a.length)throw new rl(ro.INVALID_ARGUMENT,`Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);let o=[];for(let s=0;s=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new rl(ro.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new rl(ro.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`)}function fg(e,t){if(!(t instanceof c6||t instanceof c4))throw new rl(ro.INVALID_ARGUMENT,`Function ${e}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}class fm{convertValue(e,t="none"){switch(ij(e)){case 0:return null;case 1:return e.booleanValue;case 2:return iO(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(iP(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw rs()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){let n={};return ix(e,(e,r)=>{n[e]=this.convertValue(r,t)}),n}convertGeoPoint(e){return new cE(iO(e.latitude),iO(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":let n=iV(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(iq(e));default:return null}}convertTimestamp(e){let t=iL(e);return new r_(t.seconds,t.nanos)}convertDocumentKey(e,t){let n=rT.fromString(e);oe(n)||rs();let r=new iU(n.get(1),n.get(3)),i=new rD(n.popFirst(5));return r.isEqual(t)||rn(`Document ${i} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}function fp(e,t,n){return e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t}class fy extends fm{constructor(e){super(),this.firestore=e}convertBytes(e){return new cb(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new h1(this.firestore,null,t)}}function fw(e){return new cw("sum",c$("sum",e))}function fv(e){return new cw("avg",c$("average",e))}function fb(){return new cw("count")}function fx(e,t){var n,r;return e instanceof cw&&t instanceof cw&&e.aggregateType===t.aggregateType&&(null===(n=e._internalFieldPath)||void 0===n?void 0:n.canonicalString())===(null===(r=t._internalFieldPath)||void 0===r?void 0:r.canonicalString())}function f_(e,t){return h8(e.query,t.query)&&I(e.data(),t.data())}class fI{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class fE extends cX{constructor(e,t,n,r,i,s){super(e,t,n,r,s),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){let t=new fT(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){let n=this._document.data.field(cZ("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class fT extends fE{data(e={}){return super.data(e)}}class fS{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new fI(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){let e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new fT(this._firestore,this._userDataWriter,n.key,n,new fI(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){let t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new rl(ro.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{let r=new fT(e._firestore,e._userDataWriter,n.doc.key,n.doc,new fI(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{let r=new fT(e._firestore,e._userDataWriter,t.doc.key,t.doc,new fI(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter),i=-1,s=-1;return 0!==t.type&&(i=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(s=(n=n.add(t.doc)).indexOf(t.doc.key)),{type:function(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return rs()}}(t.type),doc:r,oldIndex:i,newIndex:s}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function fC(e,t){return e instanceof fE&&t instanceof fE?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(null===e._document?null===t._document:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof fS&&t instanceof fS&&e._firestore===t._firestore&&h8(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)}function fD(e){e=hW(e,h1);let t=hW(e.firestore,cn);return hB(cs(t),e._key).then(n=>fz(t,e,n))}class fA extends fm{constructor(e){super(),this.firestore=e}convertBytes(e){return new cb(e)}convertReference(e){let t=this.convertDocumentKey(e,this.firestore._databaseId);return new h1(this.firestore,null,t)}}function fN(e){e=hW(e,h1);let t=hW(e.firestore,cn),n=cs(t),r=new fA(t);return(function(e,t){let n=new ru;return e.asyncQueue.enqueueAndForget(async()=>(async function(e,t,n){try{let r=await e.persistence.runTransaction("read document","readonly",n=>e.localDocuments.getDocument(n,t));r.isFoundDocument()?n.resolve(r):r.isNoDocument()?n.resolve(null):n.reject(new rl(ro.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(r){let e=uM(r,`Failed to get document '${t} from cache`);n.reject(e)}})(await hO(e),t,n)),n.promise})(n,e._key).then(n=>new fE(t,r,e._key,n,new fI(null!==n&&n.hasLocalMutations,!0),e.converter))}function fk(e){e=hW(e,h1);let t=hW(e.firestore,cn);return hB(cs(t),e._key,{source:"server"}).then(n=>fz(t,e,n))}function fR(e){e=hW(e,h0);let t=hW(e.firestore,cn),n=cs(t),r=new fA(t);return c0(e._query),hU(n,e._query).then(n=>new fS(t,r,e,n))}function fM(e){e=hW(e,h0);let t=hW(e.firestore,cn),n=cs(t),r=new fA(t);return(function(e,t){let n=new ru;return e.asyncQueue.enqueueAndForget(async()=>(async function(e,t,n){try{let r=await lV(e,t,!0),i=new uX(t,r.hs),s=i.ha(r.documents),a=i.applyChanges(s,!1);n.resolve(a.snapshot)}catch(r){let e=uM(r,`Failed to execute query '${t} against cache`);n.reject(e)}})(await hO(e),t,n)),n.promise})(n,e._query).then(n=>new fS(t,r,e,n))}function fL(e){e=hW(e,h0);let t=hW(e.firestore,cn),n=cs(t),r=new fA(t);return hU(n,e._query,{source:"server"}).then(n=>new fS(t,r,e,n))}function fO(e,t,n){e=hW(e,h1);let r=hW(e.firestore,cn),i=fp(e.converter,t,n);return fU(r,[cR(ck(r),"setDoc",e._key,i,null!==e.converter,n).toMutation(e._key,an.none())])}function fP(e,t,n,...r){e=hW(e,h1);let i=hW(e.firestore,cn),s=ck(i);return fU(i,[("string"==typeof(t=T(t))||t instanceof cx?cB(s,"updateDoc",e._key,t,n,r):cq(s,"updateDoc",e._key,t)).toMutation(e._key,an.exists(!0))])}function fF(e){return fU(hW(e.firestore,cn),[new ad(e._key,an.none())])}function fV(e,t){let n=hW(e.firestore,cn),r=h3(e),i=fp(e.converter,t);return fU(n,[cR(ck(e.firestore),"addDoc",r._key,i,null!==e.converter,{}).toMutation(r._key,an.exists(!1))]).then(()=>r)}function fq(e,...t){var n,r,i;let s,a,o;e=T(e);let l={includeMetadataChanges:!1},u=0;"object"!=typeof t[0]||h7(t[u])||(l=t[u],u++);let h={includeMetadataChanges:l.includeMetadataChanges};if(h7(t[u])){let e=t[u];t[u]=null===(n=e.next)||void 0===n?void 0:n.bind(e),t[u+1]=null===(r=e.error)||void 0===r?void 0:r.bind(e),t[u+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}if(e instanceof h1)a=hW(e.firestore,cn),o=sC(e._key.path),s={next:n=>{t[u]&&t[u](fz(a,e,n))},error:t[u+1],complete:t[u+2]};else{let n=hW(e,h0);a=hW(n.firestore,cn),o=n._query;let r=new fA(a);s={next:e=>{t[u]&&t[u](new fS(a,r,n,e))},error:t[u+1],complete:t[u+2]},c0(e._query)}return function(e,t,n,r){let i=new hE(r),s=new uj(t,i,n);return e.asyncQueue.enqueueAndForget(async()=>uq(await hq(e),s)),()=>{i.La(),e.asyncQueue.enqueueAndForget(async()=>uB(await hq(e),s))}}(cs(a),o,h,s)}function fB(e,t){return function(e,t){let n=new hE(t);return e.asyncQueue.enqueueAndForget(async()=>{(await hq(e)).K_.add(n),n.next()}),()=>{n.La(),e.asyncQueue.enqueueAndForget(async()=>(function(e,t){e.K_.delete(t)})(await hq(e),n))}}(cs(e=hW(e,cn)),h7(t)?t:{next:t})}function fU(e,t){return function(e,t){let n=new ru;return e.asyncQueue.enqueueAndForget(async()=>(async function(e,t,n){let r=hy(e);try{var i;let e;let s=await function(e,t){let n,r;let i=r_.now(),s=t.reduce((e,t)=>e.add(t.key),sW());return e.persistence.runTransaction("Locally write mutations","readwrite",a=>{let o=sz,l=sW();return e.os.getEntries(a,s).next(e=>{(o=e).forEach((e,t)=>{t.isValidDocument()||(l=l.add(e))})}).next(()=>e.localDocuments.getOverlayedDocuments(a,o)).next(r=>{n=r;let s=[];for(let e of t){let t=function(e,t){let n=null;for(let r of e.fieldTransforms){let e=t.data.field(r.field),i=s1(r.transform,e||null);null!=i&&(null===n&&(n=i4.empty()),n.set(r.field,i))}return n||null}(e,n.get(e.key).overlayedDocument);null!=t&&s.push(new au(e.key,t,function e(t){let n=[];return ix(t.fields,(t,r)=>{let i=new rC([t]);if(i1(r)){let t=e(r.mapValue).fields;if(0===t.length)n.push(i);else for(let e of t)n.push(i.child(e))}else n.push(i)}),new iA(n)}(t.value.mapValue),an.exists(!0)))}return e.mutationQueue.addMutationBatch(a,i,s,t)}).next(t=>{r=t;let i=t.applyToLocalDocumentSet(n,l);return e.documentOverlayCache.saveOverlays(a,t.batchId,i)})}).then(()=>({batchId:r.batchId,changes:sK(n)}))}(r.localStore,t);r.sharedClientState.addPendingMutation(s.batchId),i=s.batchId,(e=r.Da[r.currentUser.toKey()])||(e=new iI(rb)),e=e.insert(i,n),r.Da[r.currentUser.toKey()]=e,await hs(r,s.changes),await ux(r.remoteStore)}catch(t){let e=uM(t,"Failed to persist write");n.reject(e)}})(await hF(e),t,n)),n.promise}(cs(e),t)}function fz(e,t,n){let r=n.docs.get(t._key),i=new fA(e);return new fE(e,i,t._key,r,new fI(n.hasPendingWrites,n.fromCache),t.converter)}function fG(e){return fj(e,{count:fb()})}function fj(e,t){let n=hW(e.firestore,cn),r=cs(n),i=function(e,t){let n=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.push(t(e[r],r,e));return n}(t,(e,t)=>new aw(t,e.aggregateType,e._internalFieldPath));return(function(e,t,n){let r=new ru;return e.asyncQueue.enqueueAndForget(async()=>{try{let i=await hV(e);r.resolve(async function(e,t,n){var r;let{request:i,V_:s,parent:a}=function(e,t,n){let{ut:r,parent:i}=a4(e,t),s={},a=[],o=0;return n.forEach(e=>{let t="aggregate_"+o++;s[t]=e.alias,"count"===e.aggregateType?a.push({alias:t,count:{}}):"avg"===e.aggregateType?a.push({alias:t,avg:{field:a9(e.fieldPath)}}):"sum"===e.aggregateType&&a.push({alias:t,sum:{field:a9(e.fieldPath)}})}),{request:{structuredAggregationQuery:{aggregations:a,structuredQuery:r.structuredQuery},parent:r.parent},V_:s,parent:i}}(e.serializer,(t.Pe||(t.Pe=sR(t,t.explicitOrderBy)),t.Pe),n);e.connection.wo||delete i.parent;let o=(await e.vo("RunAggregationQuery",e.serializer.databaseId,a,i,1)).filter(e=>!!e.result);1===o.length||rs();let l=null===(r=o[0].result)||void 0===r?void 0:r.aggregateFields;return Object.keys(l).reduce((e,t)=>(e[s[t]]=l[t],e),{})}(i,t,n))}catch(e){r.reject(e)}}),r.promise})(r,e._query,i).then(t=>new cv(e,new fA(n),t))}class fK{constructor(e){this.kind="memory",this._onlineComponentProvider=new h_,(null==e?void 0:e.garbageCollector)?this._offlineComponentProvider=e.garbageCollector._offlineComponentProvider:this._offlineComponentProvider=new hw}toJSON(){return{kind:this.kind}}}class f${constructor(e){let t;this.kind="persistent",(null==e?void 0:e.tabManager)?(e.tabManager._initialize(e),t=e.tabManager):(t=f1(void 0))._initialize(e),this._onlineComponentProvider=t._onlineComponentProvider,this._offlineComponentProvider=t._offlineComponentProvider}toJSON(){return{kind:this.kind}}}class fQ{constructor(){this.kind="memoryEager",this._offlineComponentProvider=new hw}toJSON(){return{kind:this.kind}}}class fH{constructor(e){this.kind="memoryLru",this._offlineComponentProvider=new hv(e)}toJSON(){return{kind:this.kind}}}function fW(){return new fQ}function fY(e){return new fH(null==e?void 0:e.cacheSizeBytes)}function fX(e){return new fK(e)}function fJ(e){return new f$(e)}class fZ{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=new h_,this._offlineComponentProvider=new hb(this._onlineComponentProvider,null==e?void 0:e.cacheSizeBytes,this.forceOwnership)}}class f0{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=new h_,this._offlineComponentProvider=new hx(this._onlineComponentProvider,null==e?void 0:e.cacheSizeBytes)}}function f1(e){return new fZ(null==e?void 0:e.forceOwnership)}function f2(){return new f0}let f5={maxAttempts:5};class f6{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=ck(e)}set(e,t,n){this._verifyNotCommitted();let r=f3(e,this._firestore),i=fp(r.converter,t,n),s=cR(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(s.toMutation(r._key,an.none())),this}update(e,t,n,...r){let i;this._verifyNotCommitted();let s=f3(e,this._firestore);return i="string"==typeof(t=T(t))||t instanceof cx?cB(this._dataReader,"WriteBatch.update",s._key,t,n,r):cq(this._dataReader,"WriteBatch.update",s._key,t),this._mutations.push(i.toMutation(s._key,an.exists(!0))),this}delete(e){this._verifyNotCommitted();let t=f3(e,this._firestore);return this._mutations=this._mutations.concat(new ad(t._key,an.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 rl(ro.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function f3(e,t){if((e=T(e)).firestore!==t)throw new rl(ro.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}class f4 extends class{constructor(e,t){this._firestore=e,this._transaction=t,this._dataReader=ck(e)}get(e){let t=f3(e,this._firestore),n=new fy(this._firestore);return this._transaction.lookup([t._key]).then(e=>{if(!e||1!==e.length)return rs();let r=e[0];if(r.isFoundDocument())return new cX(this._firestore,n,r.key,r,t.converter);if(r.isNoDocument())return new cX(this._firestore,n,t._key,null,t.converter);throw rs()})}set(e,t,n){let r=f3(e,this._firestore),i=fp(r.converter,t,n),s=cR(this._dataReader,"Transaction.set",r._key,i,null!==r.converter,n);return this._transaction.set(r._key,s),this}update(e,t,n,...r){let i;let s=f3(e,this._firestore);return i="string"==typeof(t=T(t))||t instanceof cx?cB(this._dataReader,"Transaction.update",s._key,t,n,r):cq(this._dataReader,"Transaction.update",s._key,t),this._transaction.update(s._key,i),this}delete(e){let t=f3(e,this._firestore);return this._transaction.delete(t._key),this}}{constructor(e,t){super(e,t),this._firestore=e}get(e){let t=f3(e,this._firestore),n=new fA(this._firestore);return super.get(e).then(e=>new fE(this._firestore,n,t._key,e._document,new fI(!1,!1),t.converter))}}function f8(e,t,n){e=hW(e,cn);let r=Object.assign(Object.assign({},f5),n);return function(e){if(e.maxAttempts<1)throw new rl(ro.INVALID_ARGUMENT,"Max attempts must be at least 1")}(r),function(e,t,n){let r=new ru;return e.asyncQueue.enqueueAndForget(async()=>{let i=await hV(e);new hC(e.asyncQueue,i,n,t,r).ja()}),r.promise}(cs(e),n=>t(new f4(e,n)),r)}function f9(){return new cM("deleteField")}function f7(){return new cO("serverTimestamp")}function de(...e){return new cP("arrayUnion",e)}function dt(...e){return new cF("arrayRemove",e)}function dn(e){return new cV("increment",e)}function dr(e){return cs(e=hW(e,cn)),new f6(e,t=>fU(e,t))}function di(e,t){var n;let r=cs(e=hW(e,cn));if(!r._uninitializedComponentsProvider||"memory"===(null===(n=r._uninitializedComponentsProvider)||void 0===n?void 0:n._offlineKind))return rr("Cannot enable indexes when persistence is disabled"),Promise.resolve();let i=function(e){let t="string"==typeof e?function(e){try{return JSON.parse(e)}catch(e){throw new rl(ro.INVALID_ARGUMENT,"Failed to parse JSON: "+(null==e?void 0:e.message))}}(e):e,n=[];if(Array.isArray(t.indexes))for(let e of t.indexes){let t=ds(e,"collectionGroup"),r=[];if(Array.isArray(e.fields))for(let t of e.fields){let e=cH("setIndexConfiguration",ds(t,"fieldPath"));"CONTAINS"===t.arrayConfig?r.push(new rM(e,2)):"ASCENDING"===t.order?r.push(new rM(e,0)):"DESCENDING"===t.order&&r.push(new rM(e,1))}n.push(new rA(rA.UNKNOWN_ID,t,r,rL.empty()))}return n}(t);return r.asyncQueue.enqueue(async()=>(async function(e,t){let n=e.indexManager,r=[];return e.persistence.runTransaction("Configure indexes","readwrite",e=>n.getFieldIndexes(e).next(i=>(function(e,t,n,r,i){t=[...t],(e=[...e]).sort(n),t.sort(n);let s=e.length,a=t.length,o=0,l=0;for(;o0?r(t[o++]):(o++,l++)}for(;o{r.push(n.addFieldIndex(e,t))},t=>{r.push(n.deleteFieldIndex(e,t))})).next(()=>rz.waitFor(r)))})(await hO(r),i))}function ds(e,t){if("string"!=typeof e[t])throw new rl(ro.INVALID_ARGUMENT,"Missing string value for: "+t);return e[t]}class da{constructor(e){this._client=e,this.type="PersistentCacheIndexManager"}}function dl(e){var t;e=hW(e,cn);let n=dd.get(e);if(n)return n;let r=cs(e);if("persistent"!==(null===(t=r._uninitializedComponentsProvider)||void 0===t?void 0:t._offlineKind))return null;let i=new da(r);return dd.set(e,i),i}function du(e){df(e,!0)}function dh(e){df(e,!1)}function dc(e){var t;e._client.verifyNotTerminated(),(t=e._client).asyncQueue.enqueue(async()=>(function(e){let t=e.indexManager;return e.persistence.runTransaction("Delete All Indexes","readwrite",e=>t.deleteAllFieldIndexes(e))})(await hO(t))).then(e=>rt("deleting all persistent cache indexes succeeded")).catch(e=>rr("deleting all persistent cache indexes failed",e))}function df(e,t){var n;e._client.verifyNotTerminated(),(n=e._client).asyncQueue.enqueue(async()=>{(await hO(n)).ts.Ui=t}).then(e=>rt(`setting persistent cache index auto creation isEnabled=${t} succeeded`)).catch(e=>rr(`setting persistent cache index auto creation isEnabled=${t} failed`,e))}let dd=new WeakMap;class dg{constructor(){throw Error("instances of this class should not be created")}static onExistenceFilterMismatch(e){return dm.instance.onExistenceFilterMismatch(e)}}class dm{constructor(){this.Cu=new Map}static get instance(){return dp||function(e){if(a_)throw Error("a TestingHooksSpi instance is already set");a_=e}(dp=new dm),dp}tt(e){this.Cu.forEach(t=>t(e))}onExistenceFilterMismatch(e){let t=Symbol(),n=this.Cu;return n.set(t,e),()=>n.delete(t)}}let dp=null;!function(e,t=!0){n8=l.SDK_VERSION,(0,l._registerComponent)(new S("firestore",(e,{instanceIdentifier:n,options:r})=>{let i=e.getProvider("app").getImmediate(),s=new cn(new rd(e.getProvider("auth-internal")),new ry(e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new rl(ro.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new iU(e.options.projectId,t)}(i,n),i);return r=Object.assign({useFetchStreams:t},r),s._setSettings(r),s},"PUBLIC").setMultipleInstances(!0)),(0,l.registerVersion)(n3,"4.4.2",void 0),(0,l.registerVersion)(n3,"4.4.2","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 000000000..17ce1e0bc --- /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.082b8539.css b/frontend-dist/index.082b8539.css new file mode 100644 index 000000000..f14a3810f --- /dev/null +++ b/frontend-dist/index.082b8539.css @@ -0,0 +1 @@ +@font-face{font-family:Inter;font-style:normal;font-weight:100;font-display:swap;src:url(Inter-Thin.woff2.a3efb88f6f.099a7dc1.woff2)format("woff2"),url(Inter-Thin.woff.a3efb88f6f.832f7e9d.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:100;font-display:swap;src:url(Inter-ThinItalic.woff2.a3efb88f6f.f5b32cfe.woff2)format("woff2"),url(Inter-ThinItalic.woff.a3efb88f6f.9a9e646f.woff)format("woff")}@font-face{font-family:Inter;font-style:normal;font-weight:200;font-display:swap;src:url(Inter-ExtraLight.woff2.a3efb88f6f.735b820a.woff2)format("woff2"),url(Inter-ExtraLight.woff.a3efb88f6f.018d6d24.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:200;font-display:swap;src:url(Inter-ExtraLightItalic.woff2.a3efb88f6f.75944d4e.woff2)format("woff2"),url(Inter-ExtraLightItalic.woff.a3efb88f6f.c051c5b4.woff)format("woff")}@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:swap;src:url(Inter-Light.woff2.a3efb88f6f.f86a8a97.woff2)format("woff2"),url(Inter-Light.woff.a3efb88f6f.0cf765a1.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:300;font-display:swap;src:url(Inter-LightItalic.woff2.a3efb88f6f.cb22faff.woff2)format("woff2"),url(Inter-LightItalic.woff.a3efb88f6f.6c91af65.woff)format("woff")}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:swap;src:url(Inter-Regular.woff2.a3efb88f6f.c52a047f.woff2)format("woff2"),url(Inter-Regular.woff.a3efb88f6f.d9325c13.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:400;font-display:swap;src:url(Inter-Italic.woff2.a3efb88f6f.85eee0c1.woff2)format("woff2"),url(Inter-Italic.woff.a3efb88f6f.d9effa31.woff)format("woff")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url(Inter-Medium.woff2.a3efb88f6f.4f0ea984.woff2)format("woff2"),url(Inter-Medium.woff.a3efb88f6f.cb391d89.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:500;font-display:swap;src:url(Inter-MediumItalic.woff2.a3efb88f6f.2b734b7a.woff2)format("woff2"),url(Inter-MediumItalic.woff.a3efb88f6f.1f636c25.woff)format("woff")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:swap;src:url(Inter-SemiBold.woff2.a3efb88f6f.08366574.woff2)format("woff2"),url(Inter-SemiBold.woff.a3efb88f6f.c6670c13.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:600;font-display:swap;src:url(Inter-SemiBoldItalic.woff2.a3efb88f6f.5c7db07d.woff2)format("woff2"),url(Inter-SemiBoldItalic.woff.a3efb88f6f.13394743.woff)format("woff")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:swap;src:url(Inter-Bold.woff2.a3efb88f6f.e8bd971d.woff2)format("woff2"),url(Inter-Bold.woff.a3efb88f6f.d92ed350.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:700;font-display:swap;src:url(Inter-BoldItalic.woff2.a3efb88f6f.cd6e580e.woff2)format("woff2"),url(Inter-BoldItalic.woff.a3efb88f6f.39f68e5f.woff)format("woff")}@font-face{font-family:Inter;font-style:normal;font-weight:800;font-display:swap;src:url(Inter-ExtraBold.woff2.a3efb88f6f.ffc04ff0.woff2)format("woff2"),url(Inter-ExtraBold.woff.a3efb88f6f.cd51bf91.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:800;font-display:swap;src:url(Inter-ExtraBoldItalic.woff2.a3efb88f6f.de4f3979.woff2)format("woff2"),url(Inter-ExtraBoldItalic.woff.a3efb88f6f.122106d3.woff)format("woff")}@font-face{font-family:Inter;font-style:normal;font-weight:900;font-display:swap;src:url(Inter-Black.woff2.a3efb88f6f.1f333c9f.woff2)format("woff2"),url(Inter-Black.woff.a3efb88f6f.efe3f25b.woff)format("woff")}@font-face{font-family:Inter;font-style:italic;font-weight:900;font-display:swap;src:url(Inter-BlackItalic.woff2.a3efb88f6f.89710fff.woff2)format("woff2"),url(Inter-BlackItalic.woff.a3efb88f6f.f6e2e726.woff)format("woff")}@font-face{font-family:Inter var;font-weight:100 900;font-style:normal;font-named-instance:"Regular";font-display:swap;src:url(Inter-roman.var.woff2.a3efb88f6f.8120837c.woff2)format("woff2 supports variations(gvar)"),url(Inter-roman.var.woff2.a3efb88f6f.8120837c.woff2)format("woff2-variations"),url(Inter-roman.var.woff2.a3efb88f6f.8120837c.woff2)format("woff2")}@font-face{font-family:Inter var;font-weight:100 900;font-style:italic;font-named-instance:"Italic";font-display:swap;src:url(Inter-italic.var.woff2.a3efb88f6f.e62a3bb2.woff2)format("woff2 supports variations(gvar)"),url(Inter-italic.var.woff2.a3efb88f6f.e62a3bb2.woff2)format("woff2-variations"),url(Inter-italic.var.woff2.a3efb88f6f.e62a3bb2.woff2)format("woff2")}@font-face{font-family:Inter var experimental;font-weight:100 900;font-style:oblique 0deg 10deg;font-display:swap;src:url(Inter.var.woff2.a3efb88f6f.ca82f9aa.woff2)format("woff2-variations"),url(Inter.var.woff2.a3efb88f6f.ca82f9aa.woff2)format("woff2")}: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,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",system-ui,sans-serif;--inter-ui-font-stack:"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Cantarell,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol",system-ui,sans-serif;color-scheme:light dark}html{font-family:var(--inter-ui-font-stack);font-size:17px}main{max-width:1200px;margin:0 auto;padding:1rem;display:block}header{background-color:#f5efd2;background-size:cover;justify-content:center;padding:1.3rem;display:flex}header h1{text-align:center;font-weight:500}section#mywork,section#open{background:var(--welcome-mywork-bg);position:relative}.pluto-logo{color:inherit;font-style:normal;font-weight:800;font-family:var(--inter-ui-font-stack);flex-direction:row;align-items:center;gap:.5ch;padding:.5em;display:flex;transform:translateY(.23em)}.pluto-logo img{width:1.2em;height:1.2em}#new{background:var(--welcome-open-bg);border-radius:.6rem;margin:1rem;padding:1.3rem;box-shadow:-2px 4px 9px #00000012}#new.desktop_opener{box-shadow:none;flex-direction:row;place-content:center space-around;display:flex;position:relative}#new.desktop_opener .desktop_picker{width:100%}section{flex-direction:row;justify-content:center;display:flex}section>div{flex:auto;min-width:0;max-width:614px;margin:1rem}.pluto-logo{background:#fff;border-radius:.4em;flex:0 auto;font-size:1.6rem;display:flex;transform:none}section#open{position:relative}section#featured>div{max-width:900px}header>div{z-index:1;flex:auto;max-width:62rem;display:flex}section#mywork:before,section#open:after{--c:#3548500f;content:"";background:linear-gradient(0deg,transparent,var(--c));pointer-events:none;z-index:0;height:50px;display:block;position:absolute;top:0;left:0;right:0}:where(#mywork,#open) h2{--off:4px;--offm:-4px;--oc:#fff;border-radius:.4em;margin:2rem 0 0;display:inline-block}section#open:after{top:unset;background:linear-gradient(0deg,var(--c),transparent);bottom:0}div#app{background-position:0 77%;background-size:cover}.new a{font-style:italic;font-weight:500;text-decoration:none}li.new{background:var(--welcome-newnotebook-bg);z-index:2;position:sticky;top:0}h1{margin-block-end:0;font-size:2.8rem}.collection{margin:6em 0}.collection h2{margin:0;font-size:2.5rem;font-weight:600}#featured p{max-width:54ch}#github img{aspect-ratio:1;filter:var(--image-filters);width:2rem}a#github{display:block;position:absolute;top:.5rem;right:.5rem}.show_scrollbar::-webkit-scrollbar{opacity:.1;width:10px}.show_scrollbar::-webkit-scrollbar-thumb{background-color:var(--black);opacity:.6;border-radius:1000px}.show_scrollbar::-webkit-scrollbar-thumb:hover{opacity:1} \ No newline at end of file diff --git a/frontend-dist/index.11569726.js b/frontend-dist/index.11569726.js new file mode 100644 index 000000000..8e03b6d24 --- /dev/null +++ b/frontend-dist/index.11569726.js @@ -0,0 +1 @@ +window.addEventListener("DOMContentLoaded",function(){!function(){try{return!!String.prototype.replaceAll}catch(t){return!1}}()&&(document.body.innerHTML="You need a shiny new browser to use Pluto!The latest versions of Firefox and Chrome will work best.")}); \ No newline at end of file diff --git a/frontend-dist/index.2db9e182.js b/frontend-dist/index.2db9e182.js new file mode 100644 index 000000000..3e9f01bbf --- /dev/null +++ b/frontend-dist/index.2db9e182.js @@ -0,0 +1 @@ +var e,t;e=this,t=function(e){async function t(e){let t=await fetch(await e.url());if(!t.ok)throw Error(`Unable to load file: ${e.name}`);return t}class n{constructor(e,t){Object.defineProperties(this,{_url:{value:e},name:{value:t,enumerable:!0}})}async url(){return this._url}async blob(){return(await t(this)).blob()}async arrayBuffer(){return(await t(this)).arrayBuffer()}async text(){return(await t(this)).text()}async json(){return(await t(this)).json()}async stream(){return(await t(this)).body}async image(){let e=await this.url();return new Promise((t,n)=>{let r=new Image;new URL(e,document.baseURI).origin!==new URL(location).origin&&(r.crossOrigin="anonymous"),r.onload=()=>t(r),r.onerror=()=>n(Error(`Unable to load file: ${this.name}`)),r.src=e})}}function r(e){throw Error(`File not found: ${e}`)}let o=new Map,i=[],a=i.map,l=i.some,u=i.hasOwnProperty,s="https://cdn.jsdelivr.net/npm/",c=/^((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(?:\/(.*))?$/,f=/^\d+\.\d+\.\d+(-[\w-.+]+)?$/,d=/\.[^/]*$/,m=["unpkg","jsdelivr","browser","main"];class h extends Error{constructor(e){super(e)}}function v(e){let t=c.exec(e);return t&&{name:t[1],version:t[2],path:t[3]}}function w(e){let t=`${s}${e.name}${e.version?`@${e.version}`:""}/package.json`,n=o.get(t);return n||o.set(t,n=fetch(t).then(e=>{if(!e.ok)throw new h("unable to load package.json");return e.redirected&&!o.has(e.url)&&o.set(e.url,n),e.json()})),n}h.prototype.name=h.name;var p=b(async function(e,t){if(e.startsWith(s)&&(e=e.substring(s.length)),/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw new h("illegal name");let n=v(e);if(!n)return`${s}${e}`;if(!n.version&&null!=t&&t.startsWith(s)){let e=await w(v(t.substring(s.length)));n.version=e.dependencies&&e.dependencies[n.name]||e.peerDependencies&&e.peerDependencies[n.name]}if(n.path&&!d.test(n.path)&&(n.path+=".js"),n.path&&n.version&&f.test(n.version))return`${s}${n.name}@${n.version}/${n.path}`;let r=await w(n);return`${s}${r.name}@${r.version}/${n.path||function(e){for(let t of m){let n=e[t];if("string"==typeof n)return d.test(n)?n:`${n}.js`}}(r)||"index.js"}`});function b(e){let t=new Map,n=o(null);function r(e){if("string"!=typeof e)return e;let n=t.get(e);return n||t.set(e,n=new Promise((t,n)=>{let r=document.createElement("script");r.onload=()=>{try{t(i.pop()(o(e)))}catch(e){n(new h("invalid module"))}r.remove()},r.onerror=()=>{n(new h("unable to load module")),r.remove()},r.async=!0,r.src=e,window.define=x,document.head.appendChild(r)})),n}function o(t){return n=>Promise.resolve(e(n,t)).then(r)}function l(e){return arguments.length>1?Promise.all(a.call(arguments,n)).then(g):n(e)}return l.alias=function(t){return b((n,r)=>n in t&&(r=null,"string"!=typeof(n=t[n]))?n:e(n,r))},l.resolve=e,l}function g(e){let t={};for(let n of e)for(let e in n)u.call(n,e)&&(null==n[e]?Object.defineProperty(t,e,{get:function(e,t){return()=>e[t]}(n,e)}):t[e]=n[e]);return t}function y(e){return"exports"==(e+="")||"module"===e}function x(e,t,n){let r=arguments.length;r<2?(n=e,t=[]):r<3&&(n=t,t="string"==typeof e?[]:e),i.push(l.call(t,y)?e=>{let r={},o={exports:r};return Promise.all(a.call(t,t=>"exports"==(t+="")?r:"module"===t?o:e(t))).then(e=>(n.apply(null,e),o.exports))}:e=>Promise.all(a.call(t,e)).then(e=>"function"==typeof n?n.apply(null,e):n))}function E(e){return function(){return e}}x.amd={};var P={math:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},j=0;function k(e){this.id=e,this.href=new URL(`#${e}`,location)+""}k.prototype.toString=function(){return"url("+this.href+")"};var L={canvas:function(e,t){var n=document.createElement("canvas");return n.width=e,n.height=t,n},context2d:function(e,t,n){null==n&&(n=devicePixelRatio);var r=document.createElement("canvas");r.width=e*n,r.height=t*n,r.style.width=e+"px";var o=r.getContext("2d");return o.scale(n,n),o},download:function(e,t="untitled",n="Save"){let r=document.createElement("a"),o=r.appendChild(document.createElement("button"));async function i(){await new Promise(requestAnimationFrame),URL.revokeObjectURL(r.href),r.removeAttribute("href"),o.textContent=n,o.disabled=!1}return o.textContent=n,r.download=t,r.onclick=async t=>{if(o.disabled=!0,r.href)return i();o.textContent="Saving…";try{let t=await ("function"==typeof e?e():e);o.textContent="Download",r.href=URL.createObjectURL(t)}catch(e){o.textContent=n}if(t.eventPhase)return i();o.disabled=!1},r},element:function(e,t){var n,r=e+="",o=r.indexOf(":");o>=0&&"xmlns"!==(r=e.slice(0,o))&&(e=e.slice(o+1));var i=P.hasOwnProperty(r)?document.createElementNS(P[r],e):document.createElement(e);if(t)for(var a in t)o=(r=a).indexOf(":"),n=t[a],o>=0&&"xmlns"!==(r=a.slice(0,o))&&(a=a.slice(o+1)),P.hasOwnProperty(r)?i.setAttributeNS(P[r],a,n):i.setAttribute(a,n);return i},input:function(e){var t=document.createElement("input");return null!=e&&(t.type=e),t},range:function(e,t,n){1==arguments.length&&(t=e,e=null);var r=document.createElement("input");return r.min=e=null==e?0:+e,r.max=t=null==t?1:+t,r.step=null==n?"any":n=+n,r.type="range",r},select:function(e){var t=document.createElement("select");return Array.prototype.forEach.call(e,function(e){var n=document.createElement("option");n.value=n.textContent=e,t.appendChild(n)}),t},svg:function(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");return n.setAttribute("viewBox",[0,0,e,t]),n.setAttribute("width",e),n.setAttribute("height",t),n},text:function(e){return document.createTextNode(e)},uid:function(e){return new k("O-"+(null==e?"":e+"-")+ ++j)}},$={buffer:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsArrayBuffer(e)})},text:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsText(e)})},url:function(e){return new Promise(function(t,n){var r=new FileReader;r.onload=function(){t(r.result)},r.onerror=n,r.readAsDataURL(e)})}};function A(){return this}function N(e,t){let n=!1;if("function"!=typeof t)throw Error("dispose is not a function");return{[Symbol.iterator]:A,next:()=>n?{done:!0}:(n=!0,{done:!1,value:e}),return:()=>(n=!0,t(e),{done:!0}),throw:()=>({done:n=!0})}}function O(e){let t,n,r=!1,o=e(function(e){return n?(n(e),n=null):r=!0,t=e});if(null!=o&&"function"!=typeof o)throw Error("function"==typeof o.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:A,throw:()=>({done:!0}),return:()=>(null!=o&&o(),{done:!0}),next:function(){return{done:!1,value:r?(r=!1,Promise.resolve(t)):new Promise(e=>n=e)}}}}function C(e){switch(e.type){case"range":case"number":return e.valueAsNumber;case"date":return e.valueAsDate;case"checkbox":return e.checked;case"file":return e.multiple?e.files:e.files[0];case"select-multiple":return Array.from(e.selectedOptions,e=>e.value);default:return e.value}}var M={disposable:N,filter:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)t(n.value,++r)&&(yield n.value)},input:function(e){return O(function(t){var n=function(e){switch(e.type){case"button":case"submit":case"checkbox":return"click";case"file":return"change";default:return"input"}}(e),r=C(e);function o(){t(C(e))}return e.addEventListener(n,o),void 0!==r&&t(r),function(){e.removeEventListener(n,o)}})},map:function*(e,t){for(var n,r=-1;!(n=e.next()).done;)yield t(n.value,++r)},observe:O,queue:function(e){let t;let n=[],r=e(function(e){return n.push(e),t&&(t(n.shift()),t=null),e});if(null!=r&&"function"!=typeof r)throw Error("function"==typeof r.then?"async initializers are not supported":"initializer returned something, but not a dispose function");return{[Symbol.iterator]:A,throw:()=>({done:!0}),return:()=>(null!=r&&r(),{done:!0}),next:function(){return{done:!1,value:n.length?Promise.resolve(n.shift()):new Promise(e=>t=e)}}}},range:function*(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=0|Math.max(0,Math.ceil((t-e)/n));++r{n.terminate(),URL.revokeObjectURL(t)})}};function R(e,t){return function(n){var r,o,i,a,l,u,s,c,f=n[0],d=[],m=null,h=-1;for(l=1,u=arguments.length;l";else if(Array.isArray(r)){for(s=0,c=r.length;s"),m.appendChild(o)):(m=null,f+=o);m=null}else f+=r;f+=n[l]}if(m=e(f),++h>0){for(i=Array(h),a=document.createTreeWalker(m,NodeFilter.SHOW_COMMENT,null,!1);a.nextNode();)o=a.currentNode,/^o:/.test(o.nodeValue)&&(i[+o.nodeValue.slice(2)]=o);for(l=0;lvoid(t=e))},value:{get:()=>e,set:n=>t(e=n)}}),void 0!==e&&t(e)}function*q(){for(;;)yield Date.now()}var D=new Map;function T(e,t){var n,r,o,i;return(n=D.get(e=+e))?n.then(E(t)):(n=Date.now())>=e?Promise.resolve(t):(r=n,o=e,i=new Promise(function(e){D.delete(o);var t=o-r;if(!(t>0))throw Error("invalid time");if(t>0x7fffffff)throw Error("too long to wait");setTimeout(e,t)}),D.set(o,i),i).then(E(t))}var W={delay:function(e,t){return new Promise(function(n){setTimeout(function(){n(t)},e)})},tick:function(e,t){return T(Math.ceil((Date.now()+1)/e)*e,t)},when:T};function _(e,t){if(/^(\w+:)|\/\//i.test(e))return e;if(/^[.]{0,2}\//i.test(e))return new URL(e,null==t?location:t).href;if(!e.length||/^[\s._]/.test(e)||/\s$/.test(e))throw Error("illegal name");return"https://unpkg.com/"+e}var z=R(function(e){var t=document.createElementNS("http://www.w3.org/2000/svg","g");return t.innerHTML=e.trim(),t},function(){return document.createElementNS("http://www.w3.org/2000/svg","g")}),B=String.raw;function H(e){return new Promise(function(t,n){var r=document.createElement("link");r.rel="stylesheet",r.href=e,r.onerror=n,r.onload=t,document.head.appendChild(r)})}function I(){return O(function(e){var t=e(document.body.clientWidth);function n(){var n=document.body.clientWidth;n!==t&&e(t=n)}return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}})}var V=Object.assign(function(e){let t=null==e?p:b(e);Object.defineProperties(this,{DOM:{value:L,writable:!0,enumerable:!0},FileAttachment:{value:E(r),writable:!0,enumerable:!0},Files:{value:$,writable:!0,enumerable:!0},Generators:{value:M,writable:!0,enumerable:!0},html:{value:E(U),writable:!0,enumerable:!0},md:{value:function(){return t("marked@0.3.12/marked.min.js").then(function(e){return R(function(n){var r=document.createElement("div");r.innerHTML=e(n,{langPrefix:""}).trim();var o=r.querySelectorAll("pre code[class]");return o.length>0&&t(S+"highlight.min.js").then(function(e){o.forEach(function(n){function r(){e.highlightBlock(n),n.parentNode.classList.add("observablehq--md-pre")}e.getLanguage(n.className)?r():t(S+"async-languages/index.js").then(r=>{if(r.has(n.className))return t(S+"async-languages/"+r.get(n.className)).then(t=>{e.registerLanguage(n.className,t)})}).then(r,r)})}),r},function(){return document.createElement("div")})})},writable:!0,enumerable:!0},Mutable:{value:E(F),writable:!0,enumerable:!0},now:{value:q,writable:!0,enumerable:!0},Promises:{value:W,writable:!0,enumerable:!0},require:{value:E(t),writable:!0,enumerable:!0},resolve:{value:E(_),writable:!0,enumerable:!0},svg:{value:E(z),writable:!0,enumerable:!0},tex:{value:function(){return Promise.all([t("@observablehq/katex@0.11.1/dist/katex.min.js"),t.resolve("@observablehq/katex@0.11.1/dist/katex.min.css").then(H)]).then(function(e){var t=e[0],n=r();function r(e){return function(){var n=document.createElement("div");return t.render(B.apply(String,arguments),n,e),n.removeChild(n.firstChild)}}return n.options=r,n.block=r({displayMode:!0}),n})},writable:!0,enumerable:!0},width:{value:I,writable:!0,enumerable:!0}})},{resolve:p.resolve});e.FileAttachments=function(e){return t=>{let r=e(t+="");if(null==r)throw Error(`File not found: ${t}`);return new n(r,t)}},e.Library=V,Object.defineProperty(e,"__esModule",{value:!0})},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).observablehq=e.observablehq||{}); \ No newline at end of file diff --git a/frontend-dist/index.30277b43.css b/frontend-dist/index.30277b43.css new file mode 100644 index 000000000..acdbb7429 --- /dev/null +++ b/frontend-dist/index.30277b43.css @@ -0,0 +1 @@ +*{box-sizing:border-box}html{font-size:17px}#title h1{letter-spacing:.08em;color:var(--pluto-output-h-color);text-align:center;margin:0;padding:4rem 1rem 3rem;font-family:Vollkorn,Palatino,serif;font-size:2em;font-style:italic;font-weight:500}#title h1 img{width:4.9em;height:1.2em;filter:var(--image-filters);margin-bottom:-.27em;margin-left:.1em}body{background:var(--main-bg-color);width:100%;min-height:100%;margin:0;position:absolute}p{color:var(--index-text-color)}ul{padding-left:0;list-style:none}li{white-space:nowrap;border-bottom:1px solid var(--welcome-recentnotebook-border);padding:.4em}a{color:var(--index-clickable-text-color)}pluto-filepicker{background:var(--white);flex-direction:row;display:flex}.desktop_picker{flex-direction:row;margin-left:5px;display:flex}pluto-filepicker .cm-editor{width:100%;height:calc(1rem + 12px);font-style:normal;font-weight:500;font-family:var(--inter-ui-font-stack);letter-spacing:1px;color:var(--nav-filepicker-color);border:2px solid var(--footer-filepicker-focus-color);background:0 0;border-right:none;border-radius:3px 0 0 3px;flex:auto;width:0;font-size:.75rem;display:inline-block}pluto-filepicker .cm-scroller{scrollbar-width:none}pluto-filepicker .cm-scroller::-webkit-scrollbar{display:none}pluto-filepicker button,.desktop_picker button{background:var(--footer-filepicker-focus-color);border:2px solid var(--nav-filepicker-focus-color);color:var(--white);border-radius:3px;margin:0;font-family:Roboto Mono,monospace;font-size:.75rem;font-weight:600}.desktop_picker_group{display:inline-flex}.desktop_picker_group>input{margin-left:1em}.desktop_picker>button{cursor:pointer}.desktop_picker>button.full_width{width:100%}pluto-filepicker button{cursor:pointer;border-top-left-radius:0;border-bottom-left-radius:0;flex:0 auto}pluto-filepicker button:disabled{cursor:not-allowed;opacity:.7}.cm-editor .cm-tooltip{border:1px solid var(--cm-color-editor-tooltip-border);border-radius:4px;box-shadow:3px 3px 4px #0003}.cm-tooltip-autocomplete{box-sizing:content-box;z-index:100}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul{max-height:max(3em,min(50dvh,20em))}.cm-tooltip.cm-completionInfo.cm-completionInfo-right:empty{display:none}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li{height:18px;margin-bottom:unset;border-radius:3px;overflow-y:hidden}.cm-editor .cm-tooltip.cm-tooltip-autocomplete>ul>li[aria-selected]{color:var(--cm-color-editor-li-aria-selected);background:var(--cm-color-editor-li-aria-selected-bg)}.cm-editor .cm-completionIcon{display:none}.cm-completionIcon:before{content:"⚫";color:#0000;opacity:1;margin-right:.5em}.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:var(--inter-ui-font-stack);font-variant-ligatures:none;font-size:.8rem;font-weight:400}body.nosessions ul#new~*{display:none}#recent{scrollbar-gutter:stable;background:var(--welcome-recentnotebook-bg);border:.2rem solid #d5d5d5;border-radius:.4rem;max-height:16em;overflow:hidden auto;box-shadow:-2px 4px 9px #00000012}#recent>li.recent{opacity:.8}#recent button{opacity:.6;cursor:pointer;color:var(--ui-button-color);background:0 0;border:none;margin:0 .2em 0 0;padding:1px}span.ionicon:after{content:" ";width:1rem;height:1rem;filter:var(--image-filters);background-size:1rem 1rem;margin-bottom:-.17rem;display:inline-block}#recent li.running button>span:after{background-image:url(close-circle.d0f6eac6.svg)}#recent li.recent button>span:after{background-image:url(caret-forward-circle-outline.d0bf2b34.svg)}#recent li.transitioning button>span:after{background-image:url(ellipsis-horizontal-outline.abb6e818.svg)}#recent li.new span:after{background-image:url(add-outline.e3c93c35.svg)}loading-bar{background-color:var(--loading-grad-color-1);width:100vw;height:6px;display:none;position:fixed;top:0}body.loading loading-bar{animation:16s ease-in-out load;display:block}@keyframes load{0%{right:100vw}20%{right:30vw}to{right:0}}.card-list{grid-template-columns:repeat(auto-fit,minmax(var(--card-width),1fr));place-items:stretch stretch;gap:0;display:grid}.navigating-away-banner{place-content:center;width:100vw;min-height:70vh;padding:3em;display:grid}.navigating-away-banner h2{white-space:nowrap;text-overflow:ellipsis;overflow:hidden} \ No newline at end of file diff --git a/frontend-dist/index.3165a108.js b/frontend-dist/index.3165a108.js new file mode 100644 index 000000000..21a545c62 --- /dev/null +++ b/frontend-dist/index.3165a108.js @@ -0,0 +1,124 @@ +var e=globalThis,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 r={id:e,exports:{}};return t[e]=r,n.call(r.exports,r,r.exports),r.exports}var a=Error("Cannot find module '"+e+"'");throw a.code="MODULE_NOT_FOUND",a}).register=function(e,t){o[e]=t},e.parcelRequire94c2=n),n.register;var r=n("cNaMA");n("eS9BV"),n("9Ta4i");var r=n("cNaMA"),a=n("4zMEb");const l=e=>i().then(t=>{let o=e.version_info.pluto,n=t[t.length-1].tag_name;console.log(`Pluto version ${o}`);let r=t.findIndex(e=>e.tag_name===o);-1!==r&&t.slice(r+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! \uD83C\uDF89\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(()=>{}),i=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");var r=n("cNaMA"),s=n("2ZZ1r"),u=n("hrGZZ"),r=n("cNaMA");const c=e=>{let t=`${e} +`.replace("\r\n","\n"),o=t.indexOf("### A Pluto.jl notebook ###"),n=t.match(/# ... ........-....-....-....-............/g),r=n?.length??0,a=t.indexOf("# ╔═╡ Cell order:")+17+1;for(let e=1;e<=r;e++)a=t.indexOf("\n",a+1)+1;return t.slice(o,a)},d=e=>new Promise((t,o)=>{try{e.getAsString(e=>{console.log(e),t(e)})}catch(e){o(e)}}),p=e=>new Promise((t,o)=>{let{name:n,type:r}=e,a=new FileReader;a.onerror=()=>o("Failed to read file!"),a.onloadstart=()=>{},a.onprogress=({loaded:e,total:t})=>{},a.onload=()=>{},a.onloadend=()=>t({file:a.result,name:n,type:r}),a.readAsText(e)}),h=({on_start_navigation:e})=>{let t=async t=>{let o;if(console.log(t),(t?.path??t?.composedPath()).filter(e=>e?.classList?.contains(".cm-editor"))?.length>0)return;switch(t.type){case"paste":o=c(t.clipboardData.getData("text/plain"));break;case"dragstart":t.dataTransfer.dropEffect="move";return;case"dragover":t.preventDefault();return;case"drop":t.preventDefault(),o=t.dataTransfer.types.includes("Files")?await p(t.dataTransfer.files[0]).then(({file:e})=>e):c(await d(t.dataTransfer.items[0]))}if(!o)return;e("notebook from clipboard",!1),document.body.classList.add("loading");let n=await fetch("./notebookupload",{method:"POST",body:o});if(n.ok)window.location.href=w(await n.text());else{let e=await n.blob();window.location.href=URL.createObjectURL(e)}};return(0,u.useEventListener)(document,"paste",t,[t]),(0,u.useEventListener)(document,"drop",t,[t]),(0,u.useEventListener)(document,"dragstart",t,[t]),(0,u.useEventListener)(document,"dragover",t,[t]),(0,r.html)``};var m=n("1xJnC");const f=({client:e,connected:t,CustomPicker:o,show_samples:n,on_start_navigation:a})=>{let l=async e=>{let t=await (0,m.guess_notebook_location)(e);a(t.path_or_url),window.location.href=("path"===t.type?_:g)(t.path_or_url)},i=async e=>{window.plutoDesktop?.fileSystem.openNotebook("path")},u=async e=>{window.plutoDesktop?.fileSystem.openNotebook("url",e)},c=o??{text:"Open a notebook",placeholder:"Enter path or URL..."};return(0,r.html)`<${h} on_start_navigation=${a} /> + ${c.text} + + <${s.FilePicker} + key=${c.placeholder} + client=${e} + value="" + on_submit=${l} + on_desktop_submit=${i} + clear_on_blur=${!1} + button_label=${window.plutoDesktop?"Open File":"Open"} + placeholder=${c.placeholder} + /> + ${null!=window.plutoDesktop?(0,r.html)`<${s.FilePicker} + key=${c.placeholder} + client=${e} + value="" + on_desktop_submit=${u} + button_label="Open from URL" + placeholder=${c.placeholder} + />`:null} + `},_=(e,t=!1)=>"open?"+new URLSearchParams({path:e}).toString(),g=e=>"open?"+new URLSearchParams({url:e}).toString(),w=e=>"edit?id="+e;var b=n("9Ta4i"),r=n("cNaMA"),v=n("aN0pg"),k=n("dYd4C");const y=e=>({transitioning:!1,entry:void 0,path:e}),$=e=>({transitioning:!1,entry:e,path:e.path}),j=(e,t)=>e.split(/\/|\\/).slice(-t).join("/"),P=(e,t)=>{let o=1;for(let n of t)if(n!==e)for(;j(e,o)===j(n,o);)o++;return j(e,o)},S=({client:e,connected:t,remote_notebooks:o,CustomRecent:n,on_start_navigation:a})=>{let[l,i]=(0,r.useState)(null),s=(0,r.useRef)(l);s.current=l;let u=(e,t)=>{i(o=>o?.map(o=>o.path==e?{...o,...t}:o)??null)};(0,r.useEffect)(()=>{null!=e&&t&&e.send("get_all_notebooks",{},{}).then(({message:e})=>{let t=e.notebooks.map(e=>$(e)),o=E();i([...(0,b.default).sortBy(t,[e=>(0,b.default).findIndex([...o,...t],t=>t.path===e.path)]),...(0,b.default).differenceBy(o,t,e=>e.path)]),document.body.classList.remove("loading")})},[null!=e&&t]),(0,r.useEffect)(()=>{if(null!=s.current){let e=[],t=s.current.map(t=>{let n=null;if(null==(n=null!=t.entry?o.find(e=>e.notebook_id===t.entry?.notebook_id):o.find(e=>e.path===t.path)))return y(t.path);{let t=$(n);return e.push(n),t}});i([...o.filter(t=>!e.includes(t)).map($),...t])}},[o]);let c=t=>{!t.transitioning&&(null!=t.entry?null!=e&&confirm(t.entry?.process_status===k.ProcessStatus.waiting_for_permission?"Close notebook session?":"Shut down notebook process?")&&(u(t.path,{running:!1,transitioning:!0}),e.send("shutdown_notebook",{keep_in_session:!1},{notebook_id:t.entry?.notebook_id},!1)):(u(t.path,{transitioning:!0}),fetch(_(t.path)+"&execution_allowed=true",{method:"GET"}).then(e=>{if(!e.redirected)throw Error("file not found maybe? try opening the notebook directly")}).catch(e=>{console.error("Failed to start notebook in background"),console.error(e),u(t.path,{transitioning:!1,notebook_id:null})})))};(0,r.useEffect)(()=>{document.body.classList.toggle("nosessions",!(null==l||l.length>0))},[l]);let d=l?.map(e=>e.path),p=null==l?(0,r.html)`Loading...`:l.map(e=>{let t=null!=e.entry;return(0,r.html)` + c(e)} + title=${t?e.entry?.process_status===k.ProcessStatus.waiting_for_permission?"Stop session":"Shut down notebook":"Start notebook in background"} + > + + + {t||(a(P(e.path,d)),u(e.path,{transitioning:!0}))}} + >${P(e.path,d)} + `});return null==n?(0,r.html)` + My work + + + {a("new notebook")}} + >Create a new notebook + + ${p} + + `:(0,r.html)`<${n} cl=${v.cl} combined=${l} client=${e} recents=${p} />`},E=()=>{let e=localStorage.getItem("recent notebooks"),t=null!=e?JSON.parse(e):[];return(t instanceof Array?t:[]).map(y)};var b=n("9Ta4i"),r=n("cNaMA"),x=n("h2NGW"),C=n("1Mxs0");const L=[{title:"Featured Notebooks",description:"These notebooks from the Julia community show off what you can do with Pluto. Give it a try, you might learn something new!",collections:[{title:"Loading...",tags:[]}],notebooks:{}}],T=(0,r.html)` + + ${L[0].title} + Here are a couple of notebooks to get started with Pluto.jl: + + 1. Getting started + 2. Markdown + 3. Basic mathematics + 4. Interactivity + 5. PlutoUI.jl + 6. Plots.jl + 7. Tower of Hanoi + 8. JavaScript + + + + + + + + Tip: Visit this page again when you are connected to the internet to read our online collection of featured notebooks. + +`,N=[{title:"Notebooks",tags:"everything"}],R=e=>e?.id??e.url,A=({sources:e,direct_html_links:t})=>{let[o,n]=(0,r.useState)({});(0,r.useEffect)(()=>{null!=e&&(l(!1),n({}),Promise.any(Array.from(new Set(e.map(R))).map(t=>D(e.filter(e=>R(e)===t).map(async e=>{let{url:o,integrity:n,valid_until:r}=e;if(null!=r&&new Date(r){n(n=>({...n,[t]:{...e,source_url:o}}))}))).catch(e=>{console.error("All featured sources failed to load: ",e),(e?.errors??[]).forEach(e=>console.error(e)),l(!0)}))},[e]),(0,r.useEffect)(()=>{Object.entries(o).length>0&&console.log("Sources:",o)},[o]);let[a,l]=(0,r.useState)(!1);(0,r.useEffect)(()=>{setTimeout(()=>{l(!0)},8e3)},[]);let i=0===Object.entries(o).length,s=Array.from(new Set(e?.map(R)??[])).map(e=>o[e]).filter(e=>null!=e);return i&&a?T:(0,r.html)` + ${(i?L:s).map(e=>{let o=e?.collections??N;return(0,r.html)` + + ${e.title} + ${e.description} + ${o.map(o=>(0,r.html)` + + ${o.title} + ${o.description} + + ${O(Object.values(e.notebooks),o.tags??[]).map(o=>(0,r.html)`<${C.FeaturedCard} entry=${o} source_manifest=${e} direct_html_links=${t} />`)} + + + `)} + + `})} + `};(0,x.default)(A,"pluto-featured",["sources","direct_html_links"]);const O=(e,t)=>{let o="everything"===t?e:e.filter(e=>t.some(t=>(e.frontmatter?.tags??[]).includes(t))),n=e=>isNaN(e)?e:Number(e);return(0,b.default).sortBy(o,[e=>n(e?.frontmatter?.order),"id"])},D=(e,t=[])=>e.length<=1?Promise.any([...e,...t]):e[0].catch(()=>D(e.slice(1),[...t,e[0]]));var M=n("cpCG6"),F={sources:[{url:"https://featured.plutojl.org/pluto_export.json",valid_until:"2025-10",id:"featured pluto"},{id:"featured pluto",url:"https://cdn.jsdelivr.net/gh/JuliaPluto/featured@v5/pluto_export.json",integrity:"sha256-+zI9b/gHEIJGV/DrckBY85hkxNWGIewgYffkAkEq4/w="},{url:"https://plutojl.org/pluto_export.json",valid_until:"2025-10",id:"pluto website"}]};const I=document.head.querySelector("link[rel='pluto-logo-big']")?.getAttribute("href")??"",U=new URLSearchParams(window.location.search),G={featured_direct_html_links:!!(U.get("featured_direct_html_links")??window.pluto_featured_direct_html_links),featured_sources:window.pluto_featured_sources,featured_source_url:U.get("featured_source_url")??window.pluto_featured_source_url,featured_source_integrity:U.get("featured_source_integrity")??window.pluto_featured_source_integrity,pluto_server_url:U.get("pluto_server_url")??window.pluto_server_url};console.log("Launch parameters: ",G),(0,r.render)((0,r.html)`<${({launch_params:e})=>{let[t,o]=(0,r.useState)([]),[n,i]=(0,r.useState)(!1),[s,u]=(0,r.useState)({show_samples:!0,CustomPicker:null,CustomRecent:null}),c=(0,r.useRef)({});(0,r.useEffect)(()=>{(0,a.create_pluto_connection)({on_unrequested_update:({message:e,type:t})=>{"notebook_list"===t&&o(e.notebooks)},on_connection_status:i,on_reconnect:async()=>!0,ws_address:e.pluto_server_url?(0,a.ws_address_from_base)(e.pluto_server_url):void 0}).then(async e=>{Object.assign(c.current,e),i(!0);try{let{custom_recent:t,custom_filepicker:o,show_samples:n=!0}=(await (0,M.get_environment)(e))({client:e,editor:void 0,imports:{preact:r}});u(e=>({...e,CustomRecent:t,CustomPicker:o,show_samples:n}))}catch(e){}l(e),e.send("current_time"),e.send("completepath",{query:""},{})})},[]);let{show_samples:d,CustomRecent:p,CustomPicker:h}=s,[m,_]=(0,r.useState)(null),g=(e,t=!0)=>{if(t){let t=t=>{_(e)};window.addEventListener("beforeunload",t),setTimeout(()=>window.removeEventListener("beforeunload",t),1e3)}else _(e)},w=r.useMemo(()=>e.featured_sources??(e.featured_source_url?[{url:e.featured_source_url,integrity:e.featured_source_integrity}]:F.sources),[e]);return null!=m?(0,r.html)` + + Loading ${m}... + + `:(0,r.html)` + + welcome to + + + + <${S} + client=${c.current} + connected=${n} + remote_notebooks=${t} + CustomRecent=${p} + on_start_navigation=${g} + /> + + + + + <${f} + client=${c.current} + connected=${n} + CustomPicker=${h} + show_samples=${d} + on_start_navigation=${g} + /> + + + + + <${A} sources=${w} direct_html_links=${e.featured_direct_html_links} /> + + + `}} launch_params=${G} />`,document.querySelector("#app")); \ No newline at end of file diff --git a/frontend-dist/index.65d5caa1.js b/frontend-dist/index.65d5caa1.js new file mode 100644 index 000000000..d0fc5ef20 --- /dev/null +++ b/frontend-dist/index.65d5caa1.js @@ -0,0 +1,8 @@ +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */(function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u-1}function o(n,t,r){for(var e=-1,u=null==n?0:n.length;++e-1;);return r}function R(n,t){for(var r=n.length;r--&&_(t,n[r],0)>-1;);return r}function z(n){return"\\"+tk[n]}function E(n){return tb.test(n)}function S(n){var t=-1,r=Array(n.size);return n.forEach(function(n,e){r[++t]=[e,n]}),r}function W(n,t){return function(r){return n(t(r))}}function L(n,t){for(var r=-1,e=n.length,u=0,i=[];++r"']/g,nj=RegExp(nm.source),nA=RegExp(nx.source),nk=/<%-([\s\S]+?)%>/g,nO=/<%([\s\S]+?)%>/g,nI=/<%=([\s\S]+?)%>/g,nR=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nz=/^\w*$/,nE=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nS=/[\\^$.*+?()[\]{}|]/g,nW=RegExp(nS.source),nL=/^\s+/,nC=/\s/,nU=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,nB=/\{\n\/\* \[wrapped with (.+)\] \*/,nT=/,? & /,n$=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,nD=/[()=,{}\[\]\/\s]/,nM=/\\(\\)?/g,nF=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,nN=/\w*$/,nP=/^[-+]0x[0-9a-f]+$/i,nq=/^0b[01]+$/i,nZ=/^\[object .+?Constructor\]$/,nK=/^0o[0-7]+$/i,nV=/^(?:0|[1-9]\d*)$/,nG=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,nH=/($^)/,nJ=/['\n\r\u2028\u2029\\]/g,nY="\ud800-\udfff",nQ="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",nX="\\u2700-\\u27bf",n0="a-z\\xdf-\\xf6\\xf8-\\xff",n1="A-Z\\xc0-\\xd6\\xd8-\\xde",n2="\\ufe0e\\ufe0f",n3="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",n8="['’]",n6="["+n3+"]",n4="["+nQ+"]",n9="["+n0+"]",n5="[^"+nY+n3+"\\d+"+nX+n0+n1+"]",n7="\ud83c[\udffb-\udfff]",tn="[^"+nY+"]",tt="(?:\ud83c[\udde6-\uddff]){2}",tr="[\ud800-\udbff][\udc00-\udfff]",te="["+n1+"]",tu="\\u200d",ti="(?:"+n9+"|"+n5+")",to="(?:"+te+"|"+n5+")",tf="(?:"+n8+"(?:d|ll|m|re|s|t|ve))?",ta="(?:"+n8+"(?:D|LL|M|RE|S|T|VE))?",tc="(?:"+n4+"|"+n7+")?",tl="["+n2+"]?",ts="(?:"+tu+"(?:"+[tn,tt,tr].join("|")+")"+tl+tc+")*",th=tl+tc+ts,tp="(?:"+["["+nX+"]",tt,tr].join("|")+")"+th,t_="(?:"+[tn+n4+"?",n4,tt,tr,"["+nY+"]"].join("|")+")",tv=RegExp(n8,"g"),tg=RegExp(n4,"g"),ty=RegExp(n7+"(?="+n7+")|"+t_+th,"g"),td=RegExp([te+"?"+n9+"+"+tf+"(?="+[n6,te,"$"].join("|")+")",to+"+"+ta+"(?="+[n6,te+ti,"$"].join("|")+")",te+"?"+ti+"+"+tf,te+"+"+ta,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",tp].join("|"),"g"),tb=RegExp("["+tu+nY+nQ+n2+"]"),tw=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tm=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tx=-1,tj={};tj[nc]=tj[nl]=tj[ns]=tj[nh]=tj[np]=tj[n_]=tj[nv]=tj[ng]=tj[ny]=!0,tj[Z]=tj[K]=tj[nf]=tj[V]=tj[na]=tj[G]=tj[H]=tj[J]=tj[Q]=tj[X]=tj[nn]=tj[nr]=tj[ne]=tj[nu]=tj[no]=!1;var tA={};tA[Z]=tA[K]=tA[nf]=tA[na]=tA[V]=tA[G]=tA[nc]=tA[nl]=tA[ns]=tA[nh]=tA[np]=tA[Q]=tA[X]=tA[nn]=tA[nr]=tA[ne]=tA[nu]=tA[ni]=tA[n_]=tA[nv]=tA[ng]=tA[ny]=!0,tA[H]=tA[J]=tA[no]=!1;var tk={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},tO=parseFloat,tI=parseInt,tR="object"==typeof global&&global&&global.Object===Object&&global,tz="object"==typeof self&&self&&self.Object===Object&&self,tE=tR||tz||Function("return this")(),tS="object"==typeof exports&&exports&&!exports.nodeType&&exports,tW=tS&&"object"==typeof module&&module&&!module.nodeType&&module,tL=tW&&tW.exports===tS,tC=tL&&tR.process,tU=function(){try{return tW&&tW.require&&tW.require("util").types||tC&&tC.binding&&tC.binding("util")}catch(n){}}(),tB=tU&&tU.isArrayBuffer,tT=tU&&tU.isDate,t$=tU&&tU.isMap,tD=tU&&tU.isRegExp,tM=tU&&tU.isSet,tF=tU&&tU.isTypedArray,tN=d("length"),tP=b({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tq=b({"&":"&","<":"<",">":">",'"':""","'":"'"}),tZ=b({"&":"&","<":"<",">":">",""":'"',"'":"'"}),tK=function b(nC){function nY(n){if(eP(n)&&!of(n)&&!(n instanceof n0)){if(n instanceof nX)return n;if(uO.call(n,"__wrapped__"))return ev(n)}return new nX(n)}function nQ(){}function nX(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=$}function n0(n){this.__wrapped__=n,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=0xffffffff,this.__views__=[]}function n1(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function to(n,t,e,u,i,o){var f,a=1&t,c=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==$)return f;if(!eN(n))return n;var s=of(n);if(s){if(h=n.length,p=new n.constructor(h),h&&"string"==typeof n[0]&&uO.call(n,"index")&&(p.index=n.index,p.input=n.input),f=p,!a)return rI(n,f)}else{var h,p,_,v,g,y=iI(n),d=y==J||y==Y;if(oc(n))return rm(n,a);if(y==nn||y==Z||d&&!i){if(f=c||d?{}:r7(n),!a)return c?(_=(g=f)&&rR(n,e8(n),g),rR(n,iO(n),_)):(v=tr(f,n),rR(n,ik(n),v))}else{if(!tA[y])return i?n:{};f=function(n,t,r){var e,u=n.constructor;switch(t){case nf:return rx(n);case V:case G:return new u(+n);case na:return new n.constructor(r?rx(n.buffer):n.buffer,n.byteOffset,n.byteLength);case nc:case nl:case ns:case nh:case np:case n_:case nv:case ng:case ny:return rj(n,r);case Q:return new u;case X:case nu:return new u(n);case nr:return(e=new n.constructor(n.source,nN.exec(n))).lastIndex=n.lastIndex,e;case ne:return new u;case ni:return ip?uy(ip.call(n)):{}}}(n,y,a)}}o||(o=new n6);var b=o.get(n);if(b)return b;o.set(n,f),op(n)?n.forEach(function(r){f.add(to(r,t,e,r,n,o))}):os(n)&&n.forEach(function(r,u){f.set(u,to(r,t,e,u,n,o))});var w=l?c?r1:r0:c?e8:e3,m=s?$:w(n);return r(m||n,function(r,u){m&&(r=n[u=r]),n7(f,u,to(r,t,e,u,n,o))}),f}function tf(n,t,r){var e=r.length;if(null==n)return!e;for(n=uy(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===$&&!(u in n)||!i(o))return!1}return!0}function ta(n,t,r){if("function"!=typeof n)throw new uw(D);return iE(function(){n.apply($,r)},t)}function tc(n,t,r,e){var u=-1,a=i,c=!0,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=f(t,A(r))),e?(a=o,c=!1):t.length>=200&&(a=O,c=!1,t=new n8(t));n:for(;++u0&&r(f)?t>1?tp(f,t-1,r,e,u):a(u,f):e||(u[u.length]=f)}return u}function t_(n,t){return n&&id(n,t,e3)}function ty(n,t){return n&&ib(n,t,e3)}function tb(n,t){return u(t,function(t){return eD(n[t])})}function tk(n,t){t=rb(t,n);for(var r=0,e=t.length;null!=n&&rt}function tW(n,t){return null!=n&&uO.call(n,t)}function tC(n,t){return null!=n&&t in uy(n)}function tU(n,t,r){for(var e=r?o:i,u=n[0].length,a=n.length,c=a,l=uh(a),s=1/0,h=[];c--;){var p=n[c];c&&t&&(p=f(p,A(t))),s=u2(p.length,s),l[c]=!r&&(t||u>=120&&p.length>=120)?new n8(c&&p):$}p=n[0];var _=-1,v=l[0];n:for(;++_=f)return a;return a*("desc"==r[e]?-1:1)}}return n.index-t.index}(n,t,r)})}function t4(n,t,r){for(var e=-1,u=t.length,i={};++e-1;)a!==n&&uM.call(a,c,1),uM.call(n,c,1);return n}function t5(n,t){for(var r=n?t.length:0,e=r-1;r--;){var u=t[r];if(r==e||u!==i){var i=u;et(u)?uM.call(n,u,1):rs(n,u)}}return n}function t7(n,t){return n+uH(u6()*(t-n+1))}function rn(n,t){var r="";if(!n||t<1||t>0x1fffffffffffff)return r;do t%2&&(r+=n),(t=uH(t/2))&&(n+=n);while(t)return r}function rt(n,t){return iS(ef(n,t,ut),n+"")}function rr(n,t,r,e){if(!eN(n))return n;t=rb(t,n);for(var u=-1,i=t.length,o=i-1,f=n;null!=f&&++uu?0:u+t),(r=r>u?u:r)<0&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0;for(var i=uh(u);++e>>1,o=n[i];null!==o&&!eV(o)&&(r?o<=t:o=200){var s=t?null:ij(n);if(s)return C(s);a=!1,u=O,l=new n8}else l=t?[]:c;n:for(;++e=e?n:re(n,t,r)}function rm(n,t){if(t)return n.slice();var r=n.length,e=uB?uB(r):new n.constructor(r);return n.copy(e),e}function rx(n){var t=new n.constructor(n.byteLength);return new uU(t).set(new uU(n)),t}function rj(n,t){return new n.constructor(t?rx(n.buffer):n.buffer,n.byteOffset,n.length)}function rA(n,t){if(n!==t){var r=n!==$,e=null===n,u=n==n,i=eV(n),o=t!==$,f=null===t,a=t==t,c=eV(t);if(!f&&!c&&!i&&n>t||i&&o&&a&&!f&&!c||e&&o&&a||!r&&a||!u)return 1;if(!e&&!i&&!c&&n1?r[u-1]:$,o=u>2?r[2]:$;for(i=n.length>3&&"function"==typeof i?(u--,i):$,o&&er(r[0],r[1],o)&&(i=u<3?$:i,u=1),t=uy(t);++e-1?u[i?t[o]:o]:$}}function rT(n){return rX(function(t){var r=t.length,e=r,u=nX.prototype.thru;for(n&&t.reverse();e--;){var i=t[e];if("function"!=typeof i)throw new uw(D);if(u&&!o&&"wrapper"==r2(i))var o=new nX([],!0)}for(e=o?e:r;++e1&&d.reverse(),l&&af))return!1;var c=i.get(n),l=i.get(t);if(c&&l)return c==t&&l==n;var h=-1,p=!0,_=2&r?new n8:$;for(i.set(n,t),i.set(t,n);++h-1&&n%1==0&&n1?"& ":"")+t[e],t=t.join(r>2?", ":" "),n.replace(nU,"{\n/* [wrapped with "+t+"] */\n")}(f,(u=(o=f.match(nB))?o[1].split(nT):[],r(q,function(n){var t="_."+n[0];e&n[1]&&!i(u,t)&&u.push(t)}),u.sort())))}function es(n){var t=0,r=0;return function(){var e=u3(),u=16-(e-r);if(r=e,u>0){if(++t>=800)return arguments[0]}else t=0;return n.apply($,arguments)}}function eh(n,t){var r=-1,e=n.length,u=e-1;for(t=t===$?e:t;++r0&&(r=t.apply(this,arguments)),n<=1&&(t=$),r}}function eW(n,t,r){function e(t){var r=a,e=c;return a=c=$,_=t,s=n.apply(e,r)}function u(n){var r=n-p,e=n-_;return p===$||r>=t||r<0||g&&e>=l}function i(){var n,r,e,f=i6();return u(f)?o(f):(h=iE(i,(n=f-p,r=f-_,e=t-n,g?u2(e,l-r):e)),$)}function o(n){return h=$,y&&a?e(n):(a=c=$,s)}function f(){var n,r=i6(),o=u(r);if(a=arguments,c=this,p=r,o){if(h===$)return _=n=p,h=iE(i,t),v?e(n):s;if(g)return ix(h),h=iE(i,t),e(p)}return h===$&&(h=iE(i,t)),s}var a,c,l,s,h,p,_=0,v=!1,g=!1,y=!0;if("function"!=typeof n)throw new uw(D);return t=eQ(t)||0,eN(r)&&(v=!!r.leading,l=(g="maxWait"in r)?u1(eQ(r.maxWait)||0,t):l,y="trailing"in r?!!r.trailing:y),f.cancel=function(){h!==$&&ix(h),_=0,a=p=c=h=$},f.flush=function(){return h===$?s:o(i6())},f}function eL(n,t){if("function"!=typeof n||null!=t&&"function"!=typeof t)throw new uw(D);var r=function(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache;if(i.has(u))return i.get(u);var o=n.apply(this,e);return r.cache=i.set(u,o)||i,o};return r.cache=new(eL.Cache||n3),r}function eC(n){if("function"!=typeof n)throw new uw(D);return function(){var t=arguments;switch(t.length){case 0:return!n.call(this);case 1:return!n.call(this,t[0]);case 2:return!n.call(this,t[0],t[1]);case 3:return!n.call(this,t[0],t[1],t[2])}return!n.apply(this,t)}}function eU(n,t){return n===t||n!=n&&t!=t}function eB(n){return null!=n&&eF(n.length)&&!eD(n)}function eT(n){return eP(n)&&eB(n)}function e$(n){if(!eP(n))return!1;var t=tz(n);return t==H||"[object DOMException]"==t||"string"==typeof n.message&&"string"==typeof n.name&&!eZ(n)}function eD(n){if(!eN(n))return!1;var t=tz(n);return t==J||t==Y||"[object AsyncFunction]"==t||"[object Proxy]"==t}function eM(n){return"number"==typeof n&&n==eJ(n)}function eF(n){return"number"==typeof n&&n>-1&&n%1==0&&n<=0x1fffffffffffff}function eN(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function eP(n){return null!=n&&"object"==typeof n}function eq(n){return"number"==typeof n||eP(n)&&tz(n)==X}function eZ(n){if(!eP(n)||tz(n)!=nn)return!1;var t=uT(n);if(null===t)return!0;var r=uO.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&uk.call(r)==uE}function eK(n){return"string"==typeof n||!of(n)&&eP(n)&&tz(n)==nu}function eV(n){return"symbol"==typeof n||eP(n)&&tz(n)==ni}function eG(n){if(!n)return[];if(eB(n))return eK(n)?B(n):rI(n);if(uN&&n[uN])return function(n){for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}(n[uN]());var t=iI(n);return(t==Q?S:t==ne?C:e4)(n)}function eH(n){return n?(n=eQ(n))===N||n===-N?(n<0?-1:1)*17976931348623157e292:n==n?n:0:0===n?n:0}function eJ(n){var t=eH(n),r=t%1;return t==t?r?t-r:t:0}function eY(n){return n?ti(eJ(n),0,0xffffffff):0}function eQ(n){if("number"==typeof n)return n;if(eV(n))return P;if(eN(n)){var t="function"==typeof n.valueOf?n.valueOf():n;n=eN(t)?t+"":t}if("string"!=typeof n)return 0===n?n:+n;n=j(n);var r=nq.test(n);return r||nK.test(n)?tI(n.slice(2),r?2:8):nP.test(n)?P:+n}function eX(n){return rR(n,e8(n))}function e0(n){return null==n?"":rc(n)}function e1(n,t,r){var e=null==n?$:tk(n,t);return e===$?r:e}function e2(n,t){return null!=n&&r5(n,t,tC)}function e3(n){return eB(n)?n4(n):tQ(n)}function e8(n){return eB(n)?n4(n,!0):function(n){if(!eN(n))return function(n){var t=[];if(null!=n)for(var r in uy(n))t.push(r);return t}(n);var t=ei(n),r=[];for(var e in n)("constructor"!=e||!t&&uO.call(n,e))&&r.push(e);return r}(n)}function e6(n,t){if(null==n)return{};var r=f(r1(n),function(n){return[n]});return t=r8(t),t4(n,r,function(n,r){return t(n,r[0])})}function e4(n){return null==n?[]:k(n,e3(n))}function e9(n){return oM(e0(n).toLowerCase())}function e5(n){return(n=e0(n))&&n.replace(nG,tP).replace(tg,"")}function e7(n,t,r){return n=e0(n),(t=r?$:t)===$?tw.test(n)?n.match(td)||[]:n.match(n$)||[]:n.match(t)||[]}function un(n){return function(){return n}}function ut(n){return n}function ur(n){return tY("function"==typeof n?n:to(n,1))}function ue(n,t,e){var u=e3(t),i=tb(t,u);null!=e||eN(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=tb(t,e3(t)));var o=!(eN(e)&&"chain"in e&&!e.chain),f=eD(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return(r.__actions__=rI(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))})}),n}function uu(){}function ui(n){return ee(n)?d(ep(n)):function(t){return tk(t,n)}}function uo(){return[]}function uf(){return!1}var ua,uc,ul,us,uh=(nC=null==nC?tE:tK.defaults(tE.Object(),nC,tK.pick(tE,tm))).Array,up=nC.Date,u_=nC.Error,uv=nC.Function,ug=nC.Math,uy=nC.Object,ud=nC.RegExp,ub=nC.String,uw=nC.TypeError,um=uh.prototype,ux=uv.prototype,uj=uy.prototype,uA=nC["__core-js_shared__"],uk=ux.toString,uO=uj.hasOwnProperty,uI=0,uR=(ua=/[^.]+$/.exec(uA&&uA.keys&&uA.keys.IE_PROTO||""))?"Symbol(src)_1."+ua:"",uz=uj.toString,uE=uk.call(uy),uS=tE._,uW=ud("^"+uk.call(uO).replace(nS,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),uL=tL?nC.Buffer:$,uC=nC.Symbol,uU=nC.Uint8Array,uB=uL?uL.allocUnsafe:$,uT=W(uy.getPrototypeOf,uy),u$=uy.create,uD=uj.propertyIsEnumerable,uM=um.splice,uF=uC?uC.isConcatSpreadable:$,uN=uC?uC.iterator:$,uP=uC?uC.toStringTag:$,uq=function(){try{var n=r9(uy,"defineProperty");return n({},"",{}),n}catch(n){}}(),uZ=nC.clearTimeout!==tE.clearTimeout&&nC.clearTimeout,uK=up&&up.now!==tE.Date.now&&up.now,uV=nC.setTimeout!==tE.setTimeout&&nC.setTimeout,uG=ug.ceil,uH=ug.floor,uJ=uy.getOwnPropertySymbols,uY=uL?uL.isBuffer:$,uQ=nC.isFinite,uX=um.join,u0=W(uy.keys,uy),u1=ug.max,u2=ug.min,u3=up.now,u8=nC.parseInt,u6=ug.random,u4=um.reverse,u9=r9(nC,"DataView"),u5=r9(nC,"Map"),u7=r9(nC,"Promise"),it=r9(nC,"Set"),ir=r9(nC,"WeakMap"),ie=r9(uy,"create"),iu=ir&&new ir,ii={},io=e_(u9),ia=e_(u5),ic=e_(u7),il=e_(it),is=e_(ir),ih=uC?uC.prototype:$,ip=ih?ih.valueOf:$,i_=ih?ih.toString:$,iv=function(){function n(){}return function(t){if(!eN(t))return{};if(u$)return u$(t);n.prototype=t;var r=new n;return n.prototype=$,r}}();nY.templateSettings={escape:nk,evaluate:nO,interpolate:nI,variable:"",imports:{_:nY}},nY.prototype=nQ.prototype,nY.prototype.constructor=nY,nX.prototype=iv(nQ.prototype),nX.prototype.constructor=nX,n0.prototype=iv(nQ.prototype),n0.prototype.constructor=n0,n1.prototype.clear=function(){this.__data__=ie?ie(null):{},this.size=0},n1.prototype.delete=function(n){var t=this.has(n)&&delete this.__data__[n];return this.size-=t?1:0,t},n1.prototype.get=function(n){var t=this.__data__;if(ie){var r=t[n];return r===M?$:r}return uO.call(t,n)?t[n]:$},n1.prototype.has=function(n){var t=this.__data__;return ie?t[n]!==$:uO.call(t,n)},n1.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=ie&&t===$?M:t,this},n2.prototype.clear=function(){this.__data__=[],this.size=0},n2.prototype.delete=function(n){var t=this.__data__,r=tn(t,n);return!(r<0)&&(r==t.length-1?t.pop():uM.call(t,r,1),--this.size,!0)},n2.prototype.get=function(n){var t=this.__data__,r=tn(t,n);return r<0?$:t[r][1]},n2.prototype.has=function(n){return tn(this.__data__,n)>-1},n2.prototype.set=function(n,t){var r=this.__data__,e=tn(r,n);return e<0?(++this.size,r.push([n,t])):r[e][1]=t,this},n3.prototype.clear=function(){this.size=0,this.__data__={hash:new n1,map:new(u5||n2),string:new n1}},n3.prototype.delete=function(n){var t=r6(this,n).delete(n);return this.size-=t?1:0,t},n3.prototype.get=function(n){return r6(this,n).get(n)},n3.prototype.has=function(n){return r6(this,n).has(n)},n3.prototype.set=function(n,t){var r=r6(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},n8.prototype.add=n8.prototype.push=function(n){return this.__data__.set(n,M),this},n8.prototype.has=function(n){return this.__data__.has(n)},n6.prototype.clear=function(){this.__data__=new n2,this.size=0},n6.prototype.delete=function(n){var t=this.__data__,r=t.delete(n);return this.size=t.size,r},n6.prototype.get=function(n){return this.__data__.get(n)},n6.prototype.has=function(n){return this.__data__.has(n)},n6.prototype.set=function(n,t){var r=this.__data__;if(r instanceof n2){var e=r.__data__;if(!u5||e.length<199)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new n3(e)}return r.set(n,t),this.size=r.size,this};var ig=rS(t_),iy=rS(ty,!0),id=rW(),ib=rW(!0),iw=iu?function(n,t){return iu.set(n,t),n}:ut,im=uq?function(n,t){return uq(n,"toString",{configurable:!0,enumerable:!1,value:un(t),writable:!0})}:ut,ix=uZ||function(n){return tE.clearTimeout(n)},ij=it&&1/C(new it([,-0]))[1]==N?function(n){return new it(n)}:uu,iA=iu?function(n){return iu.get(n)}:uu,ik=uJ?function(n){return null==n?[]:u(uJ(n=uy(n)),function(t){return uD.call(n,t)})}:uo,iO=uJ?function(n){for(var t=[];n;)a(t,ik(n)),n=uT(n);return t}:uo,iI=tz;(u9&&iI(new u9(new ArrayBuffer(1)))!=na||u5&&iI(new u5)!=Q||u7&&iI(u7.resolve())!=nt||it&&iI(new it)!=ne||ir&&iI(new ir)!=no)&&(iI=function(n){var t=tz(n),r=t==nn?n.constructor:$,e=r?e_(r):"";if(e)switch(e){case io:return na;case ia:return Q;case ic:return nt;case il:return ne;case is:return no}return t});var iR=uA?eD:uf,iz=es(iw),iE=uV||function(n,t){return tE.setTimeout(n,t)},iS=es(im),iW=(ul=(uc=eL(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(nE,function(n,r,e,u){t.push(e?u.replace(nM,"$1"):r||n)}),t},function(n){return 500===ul.size&&ul.clear(),n})).cache,uc),iL=rt(function(n,t){return eT(n)?tc(n,tp(t,1,eT,!0)):[]}),iC=rt(function(n,t){var r=ew(t);return eT(r)&&(r=$),eT(n)?tc(n,tp(t,1,eT,!0),r8(r,2)):[]}),iU=rt(function(n,t){var r=ew(t);return eT(r)&&(r=$),eT(n)?tc(n,tp(t,1,eT,!0),$,r):[]}),iB=rt(function(n){var t=f(n,ry);return t.length&&t[0]===n[0]?tU(t):[]}),iT=rt(function(n){var t=ew(n),r=f(n,ry);return t===ew(r)?t=$:r.pop(),r.length&&r[0]===n[0]?tU(r,r8(t,2)):[]}),i$=rt(function(n){var t=ew(n),r=f(n,ry);return(t="function"==typeof t?t:$)&&r.pop(),r.length&&r[0]===n[0]?tU(r,$,t):[]}),iD=rt(em),iM=rX(function(n,t){var r=null==n?0:n.length,e=tu(n,t);return t5(n,f(t,function(n){return et(n,r)?+n:n}).sort(rA)),e}),iF=rt(function(n){return rl(tp(n,1,eT,!0))}),iN=rt(function(n){var t=ew(n);return eT(t)&&(t=$),rl(tp(n,1,eT,!0),r8(t,2))}),iP=rt(function(n){var t=ew(n);return t="function"==typeof t?t:$,rl(tp(n,1,eT,!0),$,t)}),iq=rt(function(n,t){return eT(n)?tc(n,t):[]}),iZ=rt(function(n){return rv(u(n,eT))}),iK=rt(function(n){var t=ew(n);return eT(t)&&(t=$),rv(u(n,eT),r8(t,2))}),iV=rt(function(n){var t=ew(n);return t="function"==typeof t?t:$,rv(u(n,eT),$,t)}),iG=rt(ej),iH=rt(function(n){var t=n.length,r=t>1?n[t-1]:$;return r="function"==typeof r?(n.pop(),r):$,eA(n,r)}),iJ=rX(function(n){var t=n.length,r=t?n[0]:0,e=this.__wrapped__,u=function(t){return tu(t,n)};return!(t>1||this.__actions__.length)&&e instanceof n0&&et(r)?((e=e.slice(r,+r+(t?1:0))).__actions__.push({func:eO,args:[u],thisArg:$}),new nX(e,this.__chain__).thru(function(n){return t&&!n.length&&n.push($),n})):this.thru(u)}),iY=rz(function(n,t,r){uO.call(n,r)?++n[r]:te(n,r,1)}),iQ=rB(eg),iX=rB(ey),i0=rz(function(n,t,r){uO.call(n,r)?n[r].push(t):te(n,r,[t])}),i1=rt(function(t,r,e){var u=-1,i="function"==typeof r,o=eB(t)?uh(t.length):[];return ig(t,function(t){o[++u]=i?n(r,t,e):tN(t,r,e)}),o}),i2=rz(function(n,t,r){te(n,r,t)}),i3=rz(function(n,t,r){n[r?0:1].push(t)},function(){return[[],[]]}),i8=rt(function(n,t){if(null==n)return[];var r=t.length;return r>1&&er(n,t[0],t[1])?t=[]:r>2&&er(t[0],t[1],t[2])&&(t=[t[0]]),t6(n,tp(t,1),[])}),i6=uK||function(){return tE.Date.now()},i4=rt(function(n,t,r){var e=1;if(r.length){var u=L(r,r3(i4));e|=32}return rG(n,e,t,r,u)}),i9=rt(function(n,t,r){var e=3;if(r.length){var u=L(r,r3(i9));e|=32}return rG(t,e,n,r,u)}),i5=rt(function(n,t){return ta(n,1,t)}),i7=rt(function(n,t,r){return ta(n,eQ(t)||0,r)});eL.Cache=n3;var on=rt(function(t,r){var e=(r=1==r.length&&of(r[0])?f(r[0],A(r8())):f(tp(r,1),A(r8()))).length;return rt(function(u){for(var i=-1,o=u2(u.length,e);++i=t}),oo=tV(function(){return arguments}())?tV:function(n){return eP(n)&&uO.call(n,"callee")&&!uD.call(n,"callee")},of=uh.isArray,oa=tB?A(tB):function(n){return eP(n)&&tz(n)==nf},oc=uY||uf,ol=tT?A(tT):function(n){return eP(n)&&tz(n)==G},os=t$?A(t$):function(n){return eP(n)&&iI(n)==Q},oh=tD?A(tD):function(n){return eP(n)&&tz(n)==nr},op=tM?A(tM):function(n){return eP(n)&&iI(n)==ne},o_=tF?A(tF):function(n){return eP(n)&&eF(n.length)&&!!tj[tz(n)]},ov=rq(tX),og=rq(function(n,t){return n<=t}),oy=rE(function(n,t){if(ei(t)||eB(t))return rR(t,e3(t),n),$;for(var r in t)uO.call(t,r)&&n7(n,r,t[r])}),od=rE(function(n,t){rR(t,e8(t),n)}),ob=rE(function(n,t,r,e){rR(t,e8(t),n,e)}),ow=rE(function(n,t,r,e){rR(t,e3(t),n,e)}),om=rX(tu),ox=rt(function(n,t){n=uy(n);var r=-1,e=t.length,u=e>2?t[2]:$;for(u&&er(t[0],t[1],u)&&(e=1);++r1),t}),rR(n,r1(n),r),e&&(r=to(r,7,rY));for(var u=t.length;u--;)rs(r,t[u]);return r}),oE=rX(function(n,t){return null==n?{}:t4(n,t,function(t,r){return e2(n,r)})}),oS=rV(e3),oW=rV(e8),oL=rC(function(n,t,r){return t=t.toLowerCase(),n+(r?e9(t):t)}),oC=rC(function(n,t,r){return n+(r?"-":"")+t.toLowerCase()}),oU=rC(function(n,t,r){return n+(r?" ":"")+t.toLowerCase()}),oB=rL("toLowerCase"),oT=rC(function(n,t,r){return n+(r?"_":"")+t.toLowerCase()}),o$=rC(function(n,t,r){return n+(r?" ":"")+oM(t)}),oD=rC(function(n,t,r){return n+(r?" ":"")+t.toUpperCase()}),oM=rL("toUpperCase"),oF=rt(function(t,r){try{return n(t,$,r)}catch(n){return e$(n)?n:new u_(n)}}),oN=rX(function(n,t){return r(t,function(t){te(n,t=ep(t),i4(n[t],n))}),n}),oP=rT(),oq=rT(!0),oZ=rt(function(n,t){return function(r){return tN(r,n,t)}}),oK=rt(function(n,t){return function(r){return tN(n,r,t)}}),oV=rF(f),oG=rF(e),oH=rF(s),oJ=rP(),oY=rP(!0),oQ=rM(function(n,t){return n+t},0),oX=rK("ceil"),o0=rM(function(n,t){return n/t},1),o1=rK("floor"),o2=rM(function(n,t){return n*t},1),o3=rK("round"),o8=rM(function(n,t){return n-t},0);return nY.after=function(n,t){if("function"!=typeof t)throw new uw(D);return n=eJ(n),function(){if(--n<1)return t.apply(this,arguments)}},nY.ary=eE,nY.assign=oy,nY.assignIn=od,nY.assignInWith=ob,nY.assignWith=ow,nY.at=om,nY.before=eS,nY.bind=i4,nY.bindAll=oN,nY.bindKey=i9,nY.castArray=function(){if(!arguments.length)return[];var n=arguments[0];return of(n)?n:[n]},nY.chain=ek,nY.chunk=function(n,t,r){t=(r?er(n,t,r):t===$)?1:u1(eJ(t),0);var e=null==n?0:n.length;if(!e||t<1)return[];for(var u=0,i=0,o=uh(uG(e/t));uu?0:u+r),(e=e===$||e>u?u:eJ(e))<0&&(e+=u),e=r>e?0:eY(e);r>>0)?(n=e0(n))&&("string"==typeof t||null!=t&&!oh(t))&&!(t=rc(t))&&E(n)?rw(B(n),0,r):n.split(t,r):[]},nY.spread=function(t,r){if("function"!=typeof t)throw new uw(D);return r=null==r?0:u1(eJ(r),0),rt(function(e){var u=e[r],i=rw(e,0,r);return u&&a(i,u),n(t,this,i)})},nY.tail=function(n){var t=null==n?0:n.length;return t?re(n,1,t):[]},nY.take=function(n,t,r){return n&&n.length?re(n,0,(t=r||t===$?1:eJ(t))<0?0:t):[]},nY.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?re(n,(t=e-(t=r||t===$?1:eJ(t)))<0?0:t,e):[]},nY.takeRightWhile=function(n,t){return n&&n.length?rp(n,r8(t,3),!1,!0):[]},nY.takeWhile=function(n,t){return n&&n.length?rp(n,r8(t,3)):[]},nY.tap=function(n,t){return t(n),n},nY.throttle=function(n,t,r){var e=!0,u=!0;if("function"!=typeof n)throw new uw(D);return eN(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),eW(n,t,{leading:e,maxWait:t,trailing:u})},nY.thru=eO,nY.toArray=eG,nY.toPairs=oS,nY.toPairsIn=oW,nY.toPath=function(n){return of(n)?f(n,ep):eV(n)?[n]:rI(iW(e0(n)))},nY.toPlainObject=eX,nY.transform=function(n,t,e){var u=of(n),i=u||oc(n)||o_(n);if(t=r8(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:eN(n)&&eD(o)?iv(uT(n)):{}}return(i?r:t_)(n,function(n,r,u){return t(e,n,r,u)}),e},nY.unary=function(n){return eE(n,1)},nY.union=iF,nY.unionBy=iN,nY.unionWith=iP,nY.uniq=function(n){return n&&n.length?rl(n):[]},nY.uniqBy=function(n,t){return n&&n.length?rl(n,r8(t,2)):[]},nY.uniqWith=function(n,t){return t="function"==typeof t?t:$,n&&n.length?rl(n,$,t):[]},nY.unset=function(n,t){return null==n||rs(n,t)},nY.unzip=ej,nY.unzipWith=eA,nY.update=function(n,t,r){return null==n?n:rh(n,t,rd(r))},nY.updateWith=function(n,t,r,e){return e="function"==typeof e?e:$,null==n?n:rh(n,t,rd(r),e)},nY.values=e4,nY.valuesIn=function(n){return null==n?[]:k(n,e8(n))},nY.without=iq,nY.words=e7,nY.wrap=function(n,t){return ot(rd(t),n)},nY.xor=iZ,nY.xorBy=iK,nY.xorWith=iV,nY.zip=iG,nY.zipObject=function(n,t){return rg(n||[],t||[],n7)},nY.zipObjectDeep=function(n,t){return rg(n||[],t||[],rr)},nY.zipWith=iH,nY.entries=oS,nY.entriesIn=oW,nY.extend=od,nY.extendWith=ob,ue(nY,nY),nY.add=oQ,nY.attempt=oF,nY.camelCase=oL,nY.capitalize=e9,nY.ceil=oX,nY.clamp=function(n,t,r){return r===$&&(r=t,t=$),r!==$&&(r=(r=eQ(r))==r?r:0),t!==$&&(t=(t=eQ(t))==t?t:0),ti(eQ(n),t,r)},nY.clone=function(n){return to(n,4)},nY.cloneDeep=function(n){return to(n,5)},nY.cloneDeepWith=function(n,t){return to(n,5,t="function"==typeof t?t:$)},nY.cloneWith=function(n,t){return to(n,4,t="function"==typeof t?t:$)},nY.conformsTo=function(n,t){return null==t||tf(n,t,e3(t))},nY.deburr=e5,nY.defaultTo=function(n,t){return null==n||n!=n?t:n},nY.divide=o0,nY.endsWith=function(n,t,r){n=e0(n),t=rc(t);var e=n.length,u=r=r===$?e:ti(eJ(r),0,e);return(r-=t.length)>=0&&n.slice(r,u)==t},nY.eq=eU,nY.escape=function(n){return(n=e0(n))&&nA.test(n)?n.replace(nx,tq):n},nY.escapeRegExp=function(n){return(n=e0(n))&&nW.test(n)?n.replace(nS,"\\$&"):n},nY.every=function(n,t,r){var u=of(n)?e:tl;return r&&er(n,t,r)&&(t=$),u(n,r8(t,3))},nY.find=iQ,nY.findIndex=eg,nY.findKey=function(n,t){return h(n,r8(t,3),t_)},nY.findLast=iX,nY.findLastIndex=ey,nY.findLastKey=function(n,t){return h(n,r8(t,3),ty)},nY.floor=o1,nY.forEach=eI,nY.forEachRight=eR,nY.forIn=function(n,t){return null==n?n:id(n,r8(t,3),e8)},nY.forInRight=function(n,t){return null==n?n:ib(n,r8(t,3),e8)},nY.forOwn=function(n,t){return n&&t_(n,r8(t,3))},nY.forOwnRight=function(n,t){return n&&ty(n,r8(t,3))},nY.get=e1,nY.gt=ou,nY.gte=oi,nY.has=function(n,t){return null!=n&&r5(n,t,tW)},nY.hasIn=e2,nY.head=eb,nY.identity=ut,nY.includes=function(n,t,r,e){n=eB(n)?n:e4(n),r=r&&!e?eJ(r):0;var u=n.length;return r<0&&(r=u1(u+r,0)),eK(n)?r<=u&&n.indexOf(t,r)>-1:!!u&&_(n,t,r)>-1},nY.indexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return -1;var u=null==r?0:eJ(r);return u<0&&(u=u1(e+u,0)),_(n,t,u)},nY.inRange=function(n,t,r){var e,u,i;return t=eH(t),r===$?(r=t,t=0):r=eH(r),(e=n=eQ(n))>=u2(u=t,i=r)&&e=-0x1fffffffffffff&&n<=0x1fffffffffffff},nY.isSet=op,nY.isString=eK,nY.isSymbol=eV,nY.isTypedArray=o_,nY.isUndefined=function(n){return n===$},nY.isWeakMap=function(n){return eP(n)&&iI(n)==no},nY.isWeakSet=function(n){return eP(n)&&"[object WeakSet]"==tz(n)},nY.join=function(n,t){return null==n?"":uX.call(n,t)},nY.kebabCase=oC,nY.last=ew,nY.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return -1;var u=e;return r!==$&&(u=(u=eJ(r))<0?u1(e+u,0):u2(u,e-1)),t==t?function(n,t,r){for(var e=r+1;e--&&n[e]!==t;);return e}(n,t,u):p(n,g,u,!0)},nY.lowerCase=oU,nY.lowerFirst=oB,nY.lt=ov,nY.lte=og,nY.max=function(n){return n&&n.length?ts(n,ut,tS):$},nY.maxBy=function(n,t){return n&&n.length?ts(n,r8(t,2),tS):$},nY.mean=function(n){return y(n,ut)},nY.meanBy=function(n,t){return y(n,r8(t,2))},nY.min=function(n){return n&&n.length?ts(n,ut,tX):$},nY.minBy=function(n,t){return n&&n.length?ts(n,r8(t,2),tX):$},nY.stubArray=uo,nY.stubFalse=uf,nY.stubObject=function(){return{}},nY.stubString=function(){return""},nY.stubTrue=function(){return!0},nY.multiply=o2,nY.nth=function(n,t){return n&&n.length?t8(n,eJ(t)):$},nY.noConflict=function(){return tE._===this&&(tE._=uS),this},nY.noop=uu,nY.now=i6,nY.pad=function(n,t,r){n=e0(n);var e=(t=eJ(t))?U(n):0;if(!t||e>=t)return n;var u=(t-e)/2;return rN(uH(u),r)+n+rN(uG(u),r)},nY.padEnd=function(n,t,r){n=e0(n);var e=(t=eJ(t))?U(n):0;return t&&et){var e=n;n=t,t=e}if(r||n%1||t%1){var u=u6();return u2(n+u*(t-n+tO("1e-"+((u+"").length-1))),t)}return t7(n,t)},nY.reduce=function(n,t,r){var e=of(n)?c:w,u=arguments.length<3;return e(n,r8(t,4),r,u,ig)},nY.reduceRight=function(n,t,r){var e=of(n)?l:w,u=arguments.length<3;return e(n,r8(t,4),r,u,iy)},nY.repeat=function(n,t,r){return t=(r?er(n,t,r):t===$)?1:eJ(t),rn(e0(n),t)},nY.replace=function(){var n=arguments,t=e0(n[0]);return n.length<3?t:t.replace(n[1],n[2])},nY.result=function(n,t,r){t=rb(t,n);var e=-1,u=t.length;for(u||(u=1,n=$);++e0x1fffffffffffff)return[];var r=0xffffffff,e=u2(n,0xffffffff);t=r8(t),n-=0xffffffff;for(var u=x(e,t);++r=i)return n;var f=r-U(e);if(f<1)return e;var a=o?rw(o,0,f).join(""):n.slice(0,f);if(u===$)return a+e;if(o&&(f+=a.length-f),oh(u)){if(n.slice(f).search(u)){var c,l=a;for(u.global||(u=ud(u.source,e0(nN.exec(u))+"g")),u.lastIndex=0;c=u.exec(l);)var s=c.index;a=a.slice(0,s===$?f:s)}}else if(n.indexOf(rc(u),f)!=f){var h=a.lastIndexOf(u);h>-1&&(a=a.slice(0,h))}return a+e},nY.unescape=function(n){return(n=e0(n))&&nj.test(n)?n.replace(nm,tZ):n},nY.uniqueId=function(n){var t=++uI;return e0(n)+t},nY.upperCase=oD,nY.upperFirst=oM,nY.each=eI,nY.eachRight=eR,nY.first=eb,ue(nY,(us={},t_(nY,function(n,t){uO.call(nY.prototype,t)||(us[t]=n)}),us),{chain:!1}),nY.VERSION="4.17.21",r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(n){nY[n].placeholder=nY}),r(["drop","take"],function(n,t){n0.prototype[n]=function(r){r=r===$?1:u1(eJ(r),0);var e=this.__filtered__&&!t?new n0(this):this.clone();return e.__filtered__?e.__takeCount__=u2(r,e.__takeCount__):e.__views__.push({size:u2(r,0xffffffff),type:n+(e.__dir__<0?"Right":"")}),e},n0.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()}}),r(["filter","map","takeWhile"],function(n,t){var r=t+1,e=1==r||3==r;n0.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:r8(n,3),type:r}),t.__filtered__=t.__filtered__||e,t}}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");n0.prototype[n]=function(){return this[r](1).value()[0]}}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");n0.prototype[n]=function(){return this.__filtered__?new n0(this):this[r](1)}}),n0.prototype.compact=function(){return this.filter(ut)},n0.prototype.find=function(n){return this.filter(n).head()},n0.prototype.findLast=function(n){return this.reverse().find(n)},n0.prototype.invokeMap=rt(function(n,t){return"function"==typeof n?new n0(this):this.map(function(r){return tN(r,n,t)})}),n0.prototype.reject=function(n){return this.filter(eC(r8(n)))},n0.prototype.slice=function(n,t){n=eJ(n);var r=this;return r.__filtered__&&(n>0||t<0)?new n0(r):(n<0?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==$&&(r=(t=eJ(t))<0?r.dropRight(-t):r.take(t-n)),r)},n0.prototype.takeRightWhile=function(n){return this.reverse().takeWhile(n).reverse()},n0.prototype.toArray=function(){return this.take(0xffffffff)},t_(n0.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=nY[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(nY.prototype[t]=function(){var t=this.__wrapped__,o=e?[1]:arguments,f=t instanceof n0,c=o[0],l=f||of(t),s=function(n){var t=u.apply(nY,a([n],o));return e&&h?t[0]:t};l&&r&&"function"==typeof c&&1!=c.length&&(f=l=!1);var h=this.__chain__,p=!!this.__actions__.length,_=i&&!h,v=f&&!p;if(!i&&l){t=v?t:new n0(this);var g=n.apply(t,o);return g.__actions__.push({func:eO,args:[s],thisArg:$}),new nX(g,h)}return _&&v?n.apply(this,o):(g=this.thru(s),_?e?g.value()[0]:g.value():g)})}),r(["pop","push","shift","sort","splice","unshift"],function(n){var t=um[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);nY.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(of(u)?u:[],n)}return this[r](function(r){return t.apply(of(r)?r:[],n)})}}),t_(n0.prototype,function(n,t){var r=nY[t];if(r){var e=r.name+"";uO.call(ii,e)||(ii[e]=[]),ii[e].push({name:t,func:r})}}),ii[r$($,2).name]=[{name:"wrapper",func:$}],n0.prototype.clone=function(){var n=new n0(this.__wrapped__);return n.__actions__=rI(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=rI(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=rI(this.__views__),n},n0.prototype.reverse=function(){if(this.__filtered__){var n=new n0(this);n.__dir__=-1,n.__filtered__=!0}else n=this.clone(),n.__dir__*=-1;return n},n0.prototype.value=function(){var n=this.__wrapped__.value(),t=this.__dir__,r=of(n),e=t<0,u=r?n.length:0,i=function(n,t,r){for(var e=-1,u=r.length;++e=this.__values__.length;return{done:n,value:n?$:this.__values__[this.__index__++]}},nY.prototype.plant=function(n){for(var t,r=this;r instanceof nQ;){var e=ev(r);e.__index__=0,e.__values__=$,t?u.__wrapped__=e:t=e;var u=e;r=r.__wrapped__}return u.__wrapped__=n,t},nY.prototype.reverse=function(){var n=this.__wrapped__;if(n instanceof n0){var t=n;return this.__actions__.length&&(t=new n0(this)),(t=t.reverse()).__actions__.push({func:eO,args:[ex],thisArg:$}),new nX(t,this.__chain__)}return this.thru(ex)},nY.prototype.toJSON=nY.prototype.valueOf=nY.prototype.value=function(){return r_(this.__wrapped__,this.__actions__)},nY.prototype.first=nY.prototype.head,uN&&(nY.prototype[uN]=function(){return this}),nY}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(tE._=tK,define(function(){return tK})):tW?((tW.exports=tK)._=tK,tS._=tK):tE._=tK}).call(this); \ No newline at end of file diff --git a/frontend-dist/index.e10141f8.js b/frontend-dist/index.e10141f8.js new file mode 100644 index 000000000..aa3256721 --- /dev/null +++ b/frontend-dist/index.e10141f8.js @@ -0,0 +1,54 @@ +function t(t,e,i,r){Object.defineProperty(t,e,{get:i,set:r,enumerable:!0,configurable:!0})}var e=globalThis,i={},r={},n=e.parcelRequire94c2;null==n&&((n=function(t){if(t in i)return i[t].exports;if(t in r){var e=r[t];delete r[t];var n={id:t,exports:{}};return i[t]=n,e.call(n.exports,n,n.exports),n.exports}var s=Error("Cannot find module '"+t+"'");throw s.code="MODULE_NOT_FOUND",s}).register=function(t,e){r[t]=e},e.parcelRequire94c2=n);var s=n.register;s("cNaMA",function(e,i){t(e.exports,"html",()=>s),t(e.exports,"render",()=>n("3vOYv").render),t(e.exports,"Component",()=>n("3vOYv").Component),t(e.exports,"useEffect",()=>n("exxBE").useEffect),t(e.exports,"useLayoutEffect",()=>n("exxBE").useLayoutEffect),t(e.exports,"useState",()=>n("exxBE").useState),t(e.exports,"useRef",()=>n("exxBE").useRef),t(e.exports,"useMemo",()=>n("exxBE").useMemo),t(e.exports,"useCallback",()=>n("exxBE").useCallback),t(e.exports,"useErrorBoundary",()=>n("exxBE").useErrorBoundary),t(e.exports,"createContext",()=>n("3vOYv").createContext),t(e.exports,"createRef",()=>n("3vOYv").createRef),t(e.exports,"useContext",()=>n("exxBE").useContext),t(e.exports,"h",()=>n("3vOYv").h),t(e.exports,"cloneElement",()=>n("3vOYv").cloneElement),t(e.exports,"hydrate",()=>n("3vOYv").hydrate),n("648C5");var r=n("3vOYv");n("g47wy"),n("exxBE"),n("4KWiy");let s=(0,n("lNRSt").default).bind(r.h)}),s("648C5",function(e,i){t(e.exports,"cloneElement",()=>n("3vOYv").cloneElement),t(e.exports,"Component",()=>n("3vOYv").Component),t(e.exports,"createContext",()=>n("3vOYv").createContext),t(e.exports,"createRef",()=>n("3vOYv").createRef),t(e.exports,"h",()=>n("3vOYv").h),t(e.exports,"hydrate",()=>n("3vOYv").hydrate),t(e.exports,"render",()=>n("3vOYv").render),n("3vOYv")}),s("3vOYv",function(e,i){t(e.exports,"options",()=>n),t(e.exports,"createRef",()=>m),t(e.exports,"Component",()=>Q),t(e.exports,"render",()=>q),t(e.exports,"hydrate",()=>R),t(e.exports,"cloneElement",()=>W),t(e.exports,"createContext",()=>j),t(e.exports,"h",()=>p);var r,n,s,o,a,$,O,l,h={},c=[],f=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function u(t,e){for(var i in e)t[i]=e[i];return t}function d(t){var e=t.parentNode;e&&e.removeChild(t)}function p(t,e,i){var n,s,o,a={};for(o in e)"key"==o?n=e[o]:"ref"==o?s=e[o]:a[o]=e[o];if(arguments.length>2&&(a.children=arguments.length>3?r.call(arguments,2):i),"function"==typeof t&&null!=t.defaultProps)for(o in t.defaultProps)void 0===a[o]&&(a[o]=t.defaultProps[o]);return g(t,a,n,s,null)}function g(t,e,i,r,o){var a={type:t,props:e,key:i,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:o??++s};return null==o&&null!=n.vnode&&n.vnode(a),a}function m(){return{current:null}}function X(t){return t.children}function Q(t,e){this.props=t,this.context=e}function x(t,e){if(null==e)return t.__?x(t.__,t.__.__k.indexOf(t)+1):null;for(var i;ee&&o.sort(O));b.__r=0}function S(t,e,i,r,s,o,a,$,O,l){var f,u,p,m,Q,y,b,S=r&&r.__k||c,P=S.length;for(i.__k=[],f=0;f0?g(m.type,m.props,m.key,m.ref?m.ref:null,m.__v):m)){if(m.__=i,m.__b=i.__b+1,null===(p=S[f])||p&&m.key==p.key&&m.type===p.type)S[f]=void 0;else for(u=0;u=0;i--)if((r=e.__k[i])&&(n=t(r)))return n}return null}(r).nextSibling),function t(e,i,r){var s,o;if(n.unmount&&n.unmount(e),(s=e.ref)&&(s.current&&s.current!==e.__e||_(s,null,i)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(t){n.__e(t,i)}s.base=s.__P=null,e.__c=void 0}if(s=e.__k)for(o=0;o2&&(a.children=arguments.length>3?r.call(arguments,2):i),g(t.type,a,n||t.key,s||t.ref,null)}function j(t,e){var i={__c:e="__cC"+l++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var i,r;return this.getChildContext||(i=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&i.some(function(t){t.__e=!0,y(t)})},this.sub=function(t){i.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i.splice(i.indexOf(t),1),e&&e.call(t)}}),t.children}};return i.Provider.__=i.Consumer.contextType=i}r=c.slice,n={__e:function(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},s=0,Q.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof t&&(t=t(u({},i),this.props)),t&&u(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),y(this))},Q.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),y(this))},Q.prototype.render=X,o=[],$="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,O=function(t,e){return t.__v.__b-e.__v.__b},b.__r=0,l=0}),s("g47wy",function(e,i){t(e.exports,"useCallback",()=>n("exxBE").useCallback),t(e.exports,"useContext",()=>n("exxBE").useContext),t(e.exports,"useEffect",()=>n("exxBE").useEffect),t(e.exports,"useErrorBoundary",()=>n("exxBE").useErrorBoundary),t(e.exports,"useLayoutEffect",()=>n("exxBE").useLayoutEffect),t(e.exports,"useMemo",()=>n("exxBE").useMemo),t(e.exports,"useRef",()=>n("exxBE").useRef),t(e.exports,"useState",()=>n("exxBE").useState),n("3vOYv"),n("exxBE")}),s("exxBE",function(e,i){t(e.exports,"useState",()=>m),t(e.exports,"useEffect",()=>X),t(e.exports,"useLayoutEffect",()=>Q),t(e.exports,"useRef",()=>x),t(e.exports,"useMemo",()=>y),t(e.exports,"useCallback",()=>b),t(e.exports,"useContext",()=>S),t(e.exports,"useErrorBoundary",()=>v);var r,s,o,a,$=n("3vOYv"),O=0,l=[],h=[],c=$.options.__b,f=$.options.__r,u=$.options.diffed,d=$.options.__c,p=$.options.unmount;function g(t,e){$.options.__h&&(0,$.options).__h(s,t,O||e),O=0;var i=s.__H||(s.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:h}),i.__[t]}function m(t){return O=1,function(t,e,i){var n=g(r++,2);if(n.t=t,!n.__c&&(n.__=[L(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],i=n.t(e,t);e!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=s,!s.u)){var o=function(t,e,i){if(!n.__c.__H)return!0;var r=n.__c.__H.__.filter(function(t){return t.__c});if(r.every(function(t){return!t.__N}))return!a||a.call(this,t,e,i);var s=!1;return r.forEach(function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}}),!(!s&&n.__c.props===t)&&(!a||a.call(this,t,e,i))};s.u=!0;var a=s.shouldComponentUpdate,$=s.componentWillUpdate;s.componentWillUpdate=function(t,e,i){if(this.__e){var r=a;a=void 0,o(t,e,i),a=r}$&&$.call(this,t,e,i)},s.shouldComponentUpdate=o}return n.__N||n.__}(L,t)}function X(t,e){var i=g(r++,3);!$.options.__s&&T(i.__H,e)&&(i.__=t,i.i=e,s.__H.__h.push(i))}function Q(t,e){var i=g(r++,4);!$.options.__s&&T(i.__H,e)&&(i.__=t,i.i=e,s.__h.push(i))}function x(t){return O=5,y(function(){return{current:t}},[])}function y(t,e){var i=g(r++,7);return T(i.__H,e)?(i.__V=t(),i.i=e,i.__h=t,i.__V):i.__}function b(t,e){return O=8,y(function(){return t},e)}function S(t){var e=s.context[t.__c],i=g(r++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(s)),e.props.value):t.__}function v(t){var e=g(r++,10),i=m();return e.__=t,s.componentDidCatch||(s.componentDidCatch=function(t,r){e.__&&e.__(t,r),i[1](t)}),[i[0],function(){i[1](void 0)}]}function P(){for(var t;t=l.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(w),t.__H.__h.forEach(U),t.__H.__h=[]}catch(e){t.__H.__h=[],(0,$.options).__e(e,t.__v)}}$.options.__b=function(t){s=null,c&&c(t)},$.options.__r=function(t){f&&f(t),r=0;var e=(s=t.__c).__H;e&&(o===s?(e.__h=[],s.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=h,t.__N=t.i=void 0})):(e.__h.forEach(w),e.__h.forEach(U),e.__h=[])),o=s},$.options.diffed=function(t){u&&u(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==l.push(e)&&a===$.options.requestAnimationFrame||((a=(0,$.options).requestAnimationFrame)||function(t){var e,i=function(){clearTimeout(r),k&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,100);k&&(e=requestAnimationFrame(i))})(P)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==h&&(t.__=t.__V),t.i=void 0,t.__V=h})),o=s=null},$.options.__c=function(t,e){e.some(function(t){try{t.__h.forEach(w),t.__h=t.__h.filter(function(t){return!t.__||U(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],(0,$.options).__e(i,t.__v)}}),d&&d(t,e)},$.options.unmount=function(t){p&&p(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach(function(t){try{w(t)}catch(t){e=t}}),i.__H=void 0,e&&(0,$.options).__e(e,i.__v))};var k="function"==typeof requestAnimationFrame;function w(t){var e=s,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),s=e}function U(t){var e=s;t.__c=t.__(),s=e}function T(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function L(t,e){return"function"==typeof e?e(t):e}}),s("4KWiy",function(e,i){t(e.exports,"default",()=>n("lNRSt").default),n("lNRSt")}),s("lNRSt",function(e,i){t(e.exports,"default",()=>s);var r=function(t,e,i,n){var s;e[0]=0;for(var o=1;o=5&&((n||!t&&5===r)&&(o.push(r,0,n,i),r=6),t&&(o.push(r,t,0,i),r=6)),n=""},$=0;$"===e?(r=1,n=""):n=e+n[0]:s?e===s?s="":n+=e:'"'===e||"'"===e?s=e:">"===e?(a(),r=1):r&&("="===e?(r=5,i=n,n=""):"/"===e&&(r<5||">"===t[$][O+1])?(a(),3===r&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):" "===e||" "===e||e===` +`||"\r"===e?(a(),r=2):n+=e),3===r&&"!--"===n&&(r=4,o=o[0])}return a(),o}(t)),e),arguments,[])).length>1?e:e[0]}}),s("eS9BV",function(t,e){try{null==window.process&&(window.process={}),null==window.process.env&&(window.process.env={}),window.process.env.NODE_ENV="production"}catch(t){console.warn("Couldn't set window.process.env, this might break some things")}}),s("9Ta4i",function(e,i){t(e.exports,"default",()=>r);var r=window._}),s("4zMEb",function(e,i){t(e.exports,"timeout_promise",()=>$),t(e.exports,"ws_address_from_base",()=>g),t(e.exports,"create_pluto_connection",()=>X);var r=n("fUfdR"),s=n("k9crH");n("iYcLY");var o=n("enQH9"),a=n("41Mhf");let $=(t,e)=>Promise.race([t,new Promise((t,i)=>{setTimeout(()=>{i(Error("Promise timed out."))},e)})]),O=()=>{let t=()=>{},e=()=>{};return{current:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}},l=()=>crypto.getRandomValues(new Uint32Array(1))[0].toString(36),h=t=>t.readyState==WebSocket.OPEN||t.readyState==WebSocket.CONNECTING,c=t=>new Promise(e=>{h(t)?e(!0):setTimeout(()=>{e(h(t))},1e3)}),f=t=>{t.onopen=()=>{f(t)},t.onmessage=t.onclose=t.onerror=null;try{t.close(1e3,"byebye")}catch(t){}},u=(t,{on_message:e,on_socket_close:i},r=30)=>new Promise((n,o)=>{let a=new WebSocket(t),$=!1,O=setTimeout(()=>{console.warn("Creating websocket timed out",new Date().toLocaleTimeString()),f(a),o("Socket timeout")},1e3*r),l=t=>{let e=(0,s.pack)(t);if(a.readyState===WebSocket.CLOSED||a.readyState===WebSocket.CLOSING)throw Error("Socket is closed");a.send(e)},h=Promise.resolve();a.onmessage=t=>{h=h.then(async()=>{try{let i=await t.data.arrayBuffer(),r=(0,s.unpack)(new Uint8Array(i));try{e(r)}catch(e){console.error("Failed to process message from websocket",e,{message:r}),alert(`Something went wrong! You might need to refresh the page. + +Please open an issue on https://github.com/fonsp/Pluto.jl with this info: + +Failed to process update +${e.message} + +${JSON.stringify(t)}`)}}catch(e){console.error("Failed to unpack message from websocket",e,{event:t}),alert(`Something went wrong! You might need to refresh the page. + +Please open an issue on https://github.com/fonsp/Pluto.jl with this info: + +Failed to unpack message +${e} + +${JSON.stringify(t)}`)}})},a.onerror=async t=>{console.error(`Socket did an oopsie - ${t.type}`,new Date().toLocaleTimeString(),"was open:",$,t),await c(a)?(console.log("The socket somehow recovered from an error?! Onbegrijpelijk"),console.log(a),console.log(a.readyState)):$?(i(),f(a)):o(t)},a.onclose=async t=>{console.warn(`Socket did an oopsie - ${t.type}`,new Date().toLocaleTimeString(),"was open:",$,t),$?(i(),f(a)):o(t)},a.onopen=()=>{console.log("Socket opened",new Date().toLocaleTimeString()),clearInterval(O),$=!0,n({socket:a,send:l})},console.log("Waiting for socket to open...",new Date().toLocaleTimeString())}),d=()=>new Promise(t=>setTimeout(t,0)),p=t=>{let e=null,i=[],r=null;return async(n,s,o,a)=>{if("update_notebook"!==n)return await t(n,s,o,a);if(null!=r&&r!=o.notebook_id)throw Error("Switched notebook inbetween same-tick updates??? WHAT?!?!");return i=[...i,...s.updates],r=o.notebook_id,null==e&&(e=d().then(async()=>{let s=i;return e=null,i=[],r=null,await t(n,{updates:s},o,a)})),await e}},g=t=>{let e=new URL("./",t);return e.protocol=e.protocol.replace("http","ws"),(0,a.with_query_params)(e,{secret:new URL(t).searchParams.get("secret")})},m=()=>g(window.location.href),X=async({on_unrequested_update:t,on_reconnect:e,on_connection_status:i,connect_metadata:n={},ws_address:s=m()})=>{let a=null,$=new o.Stack(100);window.pluto_get_message_log=()=>$.get();let h={version_info:{julia:"unknown",pluto:"unknown",dismiss_update_notification:!1},notebook_exists:!0,message_log:$},c=l(),f=new Map,d=async(e,i={},r={},n=!0)=>{if(null==a)throw Error("No connection established yet");let s=l(),o={type:e,client_id:c,request_id:s,body:i,...r},$=O();return f.set(s,e=>{$.resolve(e),!1===n&&t(e,!0)}),a.send(o),await $.current};h.send=p(d);let g=async()=>{(async()=>{try{let t=new URL(window.location.href),e=await fetch("possible_binder_token_please");if(!e.ok)return;let i=await e.text();""!==i&&t.searchParams.get("token")!==i&&(t.searchParams.set("token",i),history.replaceState({},"",t.toString()))}catch(t){console.warn("Error while setting binder url:",t)}})();try{a=await u(String(s),{on_message:e=>{$.push(e);let i=e.initiator_id==c,r=e.request_id;if(i&&r){let t=f.get(r);if(t){t(e),f.delete(r);return}}t(e,i)},on_socket_close:async()=>{i(!1,!1),console.log("Starting new websocket",new Date().toLocaleTimeString()),await (0,r.Promises).delay(500),await g(),console.log("Starting state sync",new Date().toLocaleTimeString());let t=await e();console.log(`State sync ${t?"":"not "}successful`,new Date().toLocaleTimeString()),i(t,!1),t||alert("Connection out of sync \uD83D\uDE25\n\nRefresh the page to continue")}}),console.log("Hello?");let o=await d("connect",{},n);if(console.log("Hello!"),h.kill=()=>{a&&a.socket.close()},h.session_options=o.message.options,h.version_info=o.message.version_info,h.notebook_exists=o.message.notebook_exists,console.log("Client object: ",h),null!=n.notebook_id&&!o.message.notebook_exists)return i(!1,!0),{};i(!0,!1);let O=()=>{d("ping",{},{}).then(()=>{setTimeout(O,28e3)}).catch(()=>void 0)};return O(),o.message}catch(t){return console.error("connect() failed",t),await (0,r.Promises).delay(5e3),await g()}};return await g(),h}}),s("fUfdR",function(e,i){t(e.exports,"default",()=>n),t(e.exports,"observablehq_for_cells",()=>s),t(e.exports,"Promises",()=>o);let r=()=>{let t=new window.observablehq.Library;return{DOM:t.DOM,Files:t.Files,Generators:t.Generators,Promises:t.Promises,now:t.now,svg:t.svg(),html:t.html(),require:t.require()}},n=r(),s=r();n.DOM,n.Files,n.Generators;let o=n.Promises;n.now,n.svg,n.html,n.require}),s("k9crH",function(e,i){t(e.exports,"pack",()=>a),t(e.exports,"unpack",()=>$);var r=n("e52WV");let s=(0,r.default).createCodec(),o=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);s.addExtPacker(17,Int8Array,o),s.addExtPacker(18,Uint8Array,o),s.addExtPacker(19,Int16Array,o),s.addExtPacker(20,Uint16Array,o),s.addExtPacker(21,Int32Array,o),s.addExtPacker(22,Uint32Array,o),s.addExtPacker(23,Float32Array,o),s.addExtPacker(24,Float64Array,o),s.addExtPacker(18,Uint8ClampedArray,o),s.addExtPacker(18,ArrayBuffer,t=>new Uint8Array(t)),s.addExtPacker(18,DataView,o),s.addExtPacker(13,Date,t=>new BigInt64Array([BigInt(+t)])),s.addExtUnpacker(13,t=>{if(!("getBigInt64"in DataView.prototype))return new Date(NaN);{let e=new DataView(t.buffer,t.byteOffset,t.byteLength).getBigInt64(0,!0);if(e>Number.MAX_SAFE_INTEGER)throw Error("Can't read too big number as date (how far in the future is this?!)");return new Date(Number(e))}}),s.addExtUnpacker(17,t=>new Int8Array(t.buffer)),s.addExtUnpacker(18,t=>new Uint8Array(t.buffer)),s.addExtUnpacker(19,t=>new Int16Array(t.buffer)),s.addExtUnpacker(20,t=>new Uint16Array(t.buffer)),s.addExtUnpacker(21,t=>new Int32Array(t.buffer)),s.addExtUnpacker(22,t=>new Uint32Array(t.buffer)),s.addExtUnpacker(23,t=>new Float32Array(t.buffer)),s.addExtUnpacker(24,t=>new Float64Array(t.buffer));let a=t=>(0,r.default).encode(t,{codec:s}),$=t=>(0,r.default).decode(t,{codec:s})}),s("e52WV",function(e,i){t(e.exports,"default",()=>r);var r=n("8RXlh").default}),s("8RXlh",function(i,r){t(i.exports,"default",()=>n);var n=(function t(e,i,r){function n(o,a){if(!i[o]){if(!e[o]){var $=void 0;if(!a&&$)return $(o,!0);if(s)return s(o,!0);var O=Error("Cannot find module '"+o+"'");throw O.code="MODULE_NOT_FOUND",O}var l=i[o]={exports:{}};e[o][0].call(l.exports,function(t){return n(e[o][1][t]||t)},l,l.exports,t,e,i,r)}return i[o].exports}for(var s=void 0,o=0;o=0;n--)t[n+e]=this[n+i];else for(n=0;n=65536?(s-=65536,n+=String.fromCharCode((s>>>10)+55296,(1023&s)+56320)):n+=String.fromCharCode(s));return n},i.write=function(t,e){for(var i=e||(e|=0),r=t.length,n=0,s=0;s>>6:(n<55296||n>57343?this[i++]=224|n>>>12:(n=(n-55296<<10|t.charCodeAt(s++)-56320)+65536,this[i++]=240|n>>>18,this[i++]=128|n>>>12&63),this[i++]=128|n>>>6&63),this[i++]=128|63&n);return i-e}},{}],4:[function(t,e,i){function r(t){return Array(t)}var n=t("./bufferish"),i=e.exports=r(0);i.alloc=r,i.concat=n.concat,i.from=function(t){if(!n.isBuffer(t)&&n.isView(t))t=n.Uint8Array.from(t);else if(n.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return n.from.call(i,t);if("number"==typeof t)throw TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(t)}},{"./bufferish":8}],5:[function(t,e,i){function r(t){return new s(t)}var n=t("./bufferish"),s=n.global,i=e.exports=n.hasBuffer?r(0):[];i.alloc=n.hasBuffer&&s.alloc||r,i.concat=n.concat,i.from=function(t){if(!n.isBuffer(t)&&n.isView(t))t=n.Uint8Array.from(t);else if(n.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return n.from.call(i,t);if("number"==typeof t)throw TypeError('"value" argument must not be a number')}return s.from&&1!==s.from.length?s.from(t):new s(t)}},{"./bufferish":8}],6:[function(t,e,i){function r(t,e,i,r){var s=a.isBuffer(this),$=a.isBuffer(t);if(s&&$)return this.copy(t,e,i,r);if(l||s||$||!a.isView(this)||!a.isView(t))return o.copy.call(this,t,e,i,r);var O=i||null!=r?n.call(this,i,r):this;return t.set(O,e),O.length}function n(t,e){var i=this.slice||!l&&this.subarray;if(i)return i.call(this,t,e);var n=a.alloc.call(this,e-t);return r.call(this,n,0,t,e),n}var s,o=t("./buffer-lite");i.copy=r,i.slice=n,i.toString=function(t,e,i){return(!O&&a.isBuffer(this)?this.toString:o.toString).apply(this,arguments)},i.write=(s="write",function(){return(this[s]||o[s]).apply(this,arguments)});var a=t("./bufferish"),$=a.global,O=a.hasBuffer&&"TYPED_ARRAY_SUPPORT"in $,l=O&&!$.TYPED_ARRAY_SUPPORT},{"./buffer-lite":3,"./bufferish":8}],7:[function(t,e,i){function r(t){return new Uint8Array(t)}var n=t("./bufferish"),i=e.exports=n.hasArrayBuffer?r(0):[];i.alloc=r,i.concat=n.concat,i.from=function(t){if(n.isView(t)){var e=t.byteOffset,r=t.byteLength;(t=t.buffer).byteLength!==r&&(t.slice?t=t.slice(e,e+r):(t=new Uint8Array(t)).byteLength!==r&&(t=Array.prototype.slice.call(t,e,e+r)))}else{if("string"==typeof t)return n.from.call(i,t);if("number"==typeof t)throw TypeError('"value" argument must not be a number')}return new Uint8Array(t)}},{"./bufferish":8}],8:[function(t,e,i){function r(t){return s(this).alloc(t)}function n(t){var e=3*t.length,i=r.call(this,e),n=g.write.call(i,t);return e!==n&&(i=g.slice.call(i,0,n)),i}function s(t){return c(t)?d:f(t)?p:h(t)?u:O?d:l?p:u}function o(){return!1}function a(t,e){return t="[object "+t+"]",function(i){return null!=i&&({}).toString.call(e?i[e]:i)===t}}var $=i.global=t("./buffer-global"),O=i.hasBuffer=$&&!!$.isBuffer,l=i.hasArrayBuffer="undefined"!=typeof ArrayBuffer,h=i.isArray=t("isarray");i.isArrayBuffer=l?function(t){return t instanceof ArrayBuffer||m(t)}:o;var c=i.isBuffer=O?$.isBuffer:o,f=i.isView=l?ArrayBuffer.isView||a("ArrayBuffer","buffer"):o;i.alloc=r,i.concat=function(t,e){e||(e=0,Array.prototype.forEach.call(t,function(t){e+=t.length}));var n=this!==i&&this||t[0],s=r.call(n,e),o=0;return Array.prototype.forEach.call(t,function(t){o+=g.copy.call(t,s,o)}),s},i.from=function(t){return"string"==typeof t?n.call(this,t):s(this).from(t)};var u=i.Array=t("./bufferish-array"),d=i.Buffer=t("./bufferish-buffer"),p=i.Uint8Array=t("./bufferish-uint8array"),g=i.prototype=t("./bufferish-proto"),m=a("ArrayBuffer")},{"./buffer-global":2,"./bufferish-array":4,"./bufferish-buffer":5,"./bufferish-proto":6,"./bufferish-uint8array":7,isarray:34}],9:[function(t,e,i){function r(t){return this instanceof r?(this.options=t,void this.init()):new r(t)}function n(t){return new r(t)}var s=t("isarray");i.createCodec=n,i.install=function(t){for(var e in t)r.prototype[e]=function(t,e){return t&&e?function(){return t.apply(this,arguments),e.apply(this,arguments)}:t||e}(r.prototype[e],t[e])},i.filter=function(t){return s(t)?function(t){function e(t,e){return e(t)}return t=t.slice(),function(i){return t.reduce(e,i)}}(t):t};var o=t("./bufferish");r.prototype.init=function(){var t=this.options;return t&&t.uint8array&&(this.bufferish=o.Uint8Array),this},i.preset=n({preset:!0})},{"./bufferish":8,isarray:34}],10:[function(t,e,i){t("./read-core"),t("./write-core"),i.codec={preset:t("./codec-base").preset}},{"./codec-base":9,"./read-core":22,"./write-core":25}],11:[function(t,e,i){function r(t){if(!(this instanceof r))return new r(t);if(t&&(this.options=t,t.codec)){var e=this.codec=t.codec;e.bufferish&&(this.bufferish=e.bufferish)}}i.DecodeBuffer=r;var n=t("./read-core").preset;t("./flex-buffer").FlexDecoder.mixin(r.prototype),r.prototype.codec=n,r.prototype.fetch=function(){return this.codec.decode(this)}},{"./flex-buffer":21,"./read-core":22}],12:[function(t,e,i){i.decode=function(t,e){var i=new r(e);return i.write(t),i.read()};var r=t("./decode-buffer").DecodeBuffer},{"./decode-buffer":11}],13:[function(t,e,i){function r(t){return this instanceof r?void s.call(this,t):new r(t)}i.Decoder=r;var n=t("event-lite"),s=t("./decode-buffer").DecodeBuffer;r.prototype=new s,n.mixin(r.prototype),r.prototype.decode=function(t){arguments.length&&this.write(t),this.flush()},r.prototype.push=function(t){this.emit("data",t)},r.prototype.end=function(t){this.decode(t),this.emit("end")}},{"./decode-buffer":11,"event-lite":31}],14:[function(t,e,i){function r(t){if(!(this instanceof r))return new r(t);if(t&&(this.options=t,t.codec)){var e=this.codec=t.codec;e.bufferish&&(this.bufferish=e.bufferish)}}i.EncodeBuffer=r;var n=t("./write-core").preset;t("./flex-buffer").FlexEncoder.mixin(r.prototype),r.prototype.codec=n,r.prototype.write=function(t){this.codec.encode(this,t)}},{"./flex-buffer":21,"./write-core":25}],15:[function(t,e,i){i.encode=function(t,e){var i=new r(e);return i.write(t),i.read()};var r=t("./encode-buffer").EncodeBuffer},{"./encode-buffer":14}],16:[function(t,e,i){function r(t){return this instanceof r?void s.call(this,t):new r(t)}i.Encoder=r;var n=t("event-lite"),s=t("./encode-buffer").EncodeBuffer;r.prototype=new s,n.mixin(r.prototype),r.prototype.encode=function(t){this.write(t),this.emit("data",this.read())},r.prototype.end=function(t){arguments.length&&this.encode(t),this.flush(),this.emit("end")}},{"./encode-buffer":14,"event-lite":31}],17:[function(t,e,i){i.ExtBuffer=function t(e,i){return this instanceof t?(this.buffer=r.from(e),void(this.type=i)):new t(e,i)};var r=t("./bufferish")},{"./bufferish":8}],18:[function(t,e,i){function r(e){return a||(a=t("./encode").encode),a(e)}function n(t){return t.valueOf()}function s(t){(t=RegExp.prototype.toString.call(t).split("/")).shift();var e=[t.pop()];return e.unshift(t.join("/")),e}function o(t){var e={};for(var i in h)e[i]=t[i];return e}i.setExtPackers=function(t){t.addExtPacker(14,Error,[o,r]),t.addExtPacker(1,EvalError,[o,r]),t.addExtPacker(2,RangeError,[o,r]),t.addExtPacker(3,ReferenceError,[o,r]),t.addExtPacker(4,SyntaxError,[o,r]),t.addExtPacker(5,TypeError,[o,r]),t.addExtPacker(6,URIError,[o,r]),t.addExtPacker(10,RegExp,[s,r]),t.addExtPacker(11,Boolean,[n,r]),t.addExtPacker(12,String,[n,r]),t.addExtPacker(13,Date,[Number,r]),t.addExtPacker(15,Number,[n,r]),"undefined"!=typeof Uint8Array&&(t.addExtPacker(17,Int8Array,l),t.addExtPacker(18,Uint8Array,l),t.addExtPacker(19,Int16Array,l),t.addExtPacker(20,Uint16Array,l),t.addExtPacker(21,Int32Array,l),t.addExtPacker(22,Uint32Array,l),t.addExtPacker(23,Float32Array,l),"undefined"!=typeof Float64Array&&t.addExtPacker(24,Float64Array,l),"undefined"!=typeof Uint8ClampedArray&&t.addExtPacker(25,Uint8ClampedArray,l),t.addExtPacker(26,ArrayBuffer,l),t.addExtPacker(29,DataView,l)),$.hasBuffer&&t.addExtPacker(27,O,$.from)};var a,$=t("./bufferish"),O=$.global,l=$.Uint8Array.from,h={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1}},{"./bufferish":8,"./encode":15}],19:[function(t,e,i){function r(e){return $||($=t("./decode").decode),$(e)}function n(t){return RegExp.apply(null,t)}function s(t){return function(e){var i=new t;for(var r in h)i[r]=e[r];return i}}function o(t){return function(e){return new t(e)}}function a(t){return new Uint8Array(t).buffer}i.setExtUnpackers=function(t){t.addExtUnpacker(14,[r,s(Error)]),t.addExtUnpacker(1,[r,s(EvalError)]),t.addExtUnpacker(2,[r,s(RangeError)]),t.addExtUnpacker(3,[r,s(ReferenceError)]),t.addExtUnpacker(4,[r,s(SyntaxError)]),t.addExtUnpacker(5,[r,s(TypeError)]),t.addExtUnpacker(6,[r,s(URIError)]),t.addExtUnpacker(10,[r,n]),t.addExtUnpacker(11,[r,o(Boolean)]),t.addExtUnpacker(12,[r,o(String)]),t.addExtUnpacker(13,[r,o(Date)]),t.addExtUnpacker(15,[r,o(Number)]),"undefined"!=typeof Uint8Array&&(t.addExtUnpacker(17,o(Int8Array)),t.addExtUnpacker(18,o(Uint8Array)),t.addExtUnpacker(19,[a,o(Int16Array)]),t.addExtUnpacker(20,[a,o(Uint16Array)]),t.addExtUnpacker(21,[a,o(Int32Array)]),t.addExtUnpacker(22,[a,o(Uint32Array)]),t.addExtUnpacker(23,[a,o(Float32Array)]),"undefined"!=typeof Float64Array&&t.addExtUnpacker(24,[a,o(Float64Array)]),"undefined"!=typeof Uint8ClampedArray&&t.addExtUnpacker(25,o(Uint8ClampedArray)),t.addExtUnpacker(26,a),t.addExtUnpacker(29,[a,o(DataView)])),O.hasBuffer&&t.addExtUnpacker(27,o(l))};var $,O=t("./bufferish"),l=O.global,h={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1}},{"./bufferish":8,"./decode":12}],20:[function(t,e,i){t("./read-core"),t("./write-core"),i.createCodec=t("./codec-base").createCodec},{"./codec-base":9,"./read-core":22,"./write-core":25}],21:[function(t,e,i){function r(){if(!(this instanceof r))return new r}function n(){if(!(this instanceof n))return new n}function s(){return this.buffers&&this.buffers.length?(this.flush(),this.pull()):this.fetch()}function o(t){(this.buffers||(this.buffers=[])).push(t)}function a(t){return function(e){for(var i in t)e[i]=t[i];return e}}i.FlexDecoder=r,i.FlexEncoder=n;var $=t("./bufferish"),O="BUFFER_SHORTAGE";r.mixin=a({bufferish:$,write:function(t){var e=this.offset?$.prototype.slice.call(this.buffer,this.offset):this.buffer;this.buffer=e?t?this.bufferish.concat([e,t]):e:t,this.offset=0},fetch:function(){throw Error("method not implemented: fetch()")},flush:function(){for(;this.offsetthis.buffer.length)throw Error(O);return this.offset=i,e},offset:0}),r.mixin(r.prototype),n.mixin=a({bufferish:$,write:function(){throw Error("method not implemented: write()")},fetch:function(){var t=this.start;if(t1?this.bufferish.concat(t):t[0];return t.length=0,e},read:s,reserve:function(t){var e=0|t;if(this.buffer){var i=this.buffer.length,r=0|this.offset,n=r+e;if(nthis.minBufferSize)this.flush(),this.push(t);else{var i=this.reserve(e);$.prototype.copy.call(t,this.buffer,i)}},maxBufferSize:65536,minBufferSize:2048,offset:0,start:0}),n.mixin(n.prototype)},{"./bufferish":8}],22:[function(t,e,i){function r(){var t,e=this.options;return this.decode=(t=a.getReadToken(e),function(e){var i=o(e),r=t[i];if(!r)throw Error("Invalid type: "+(i?"0x"+i.toString(16):i));return r(e)}),e&&e.preset&&s.setExtUnpackers(this),this}var n=t("./ext-buffer").ExtBuffer,s=t("./ext-unpacker"),o=t("./read-format").readUint8,a=t("./read-token"),$=t("./codec-base");$.install({addExtUnpacker:function(t,e){(this.extUnpackers||(this.extUnpackers=[]))[t]=$.filter(e)},getExtUnpacker:function(t){return(this.extUnpackers||(this.extUnpackers=[]))[t]||function(e){return new n(e,t)}},init:r}),i.preset=r.call($.preset)},{"./codec-base":9,"./ext-buffer":17,"./ext-unpacker":19,"./read-format":23,"./read-token":24}],23:[function(t,e,i){function r(t,e){var i,r={},n=Array(e),s=Array(e),o=t.codec.decode;for(i=0;i>>8,n[r]=i}}function o(t){return function(e,i){var r=e.reserve(5),n=e.buffer;n[r++]=t,n[r++]=i>>>24,n[r++]=i>>>16,n[r++]=i>>>8,n[r]=i}}function a(t,e,i,r){return function(n,s){var o=n.reserve(e+1);n.buffer[o++]=t,i.call(n.buffer,s,o,r)}}function $(t,e){new u(this,e,t)}function O(t,e){new d(this,e,t)}function l(t,e){c.write(this,t,e,!1,23,4)}function h(t,e){c.write(this,t,e,!1,52,8)}var c=t("ieee754"),f=t("int64-buffer"),u=f.Uint64BE,d=f.Int64BE,p=t("./write-uint8").uint8,g=t("./bufferish"),m=g.global,X=g.hasBuffer&&"TYPED_ARRAY_SUPPORT"in m&&!m.TYPED_ARRAY_SUPPORT,Q=g.hasBuffer&&m.prototype||{};i.getWriteToken=function(t){var e,i;return t&&t.uint8array?((e=r())[202]=a(202,4,l),e[203]=a(203,8,h),e):X||g.hasBuffer&&t&&t.safe?((i=p.slice())[196]=a(196,1,m.prototype.writeUInt8),i[197]=a(197,2,m.prototype.writeUInt16BE),i[198]=a(198,4,m.prototype.writeUInt32BE),i[199]=a(199,1,m.prototype.writeUInt8),i[200]=a(200,2,m.prototype.writeUInt16BE),i[201]=a(201,4,m.prototype.writeUInt32BE),i[202]=a(202,4,m.prototype.writeFloatBE),i[203]=a(203,8,m.prototype.writeDoubleBE),i[204]=a(204,1,m.prototype.writeUInt8),i[205]=a(205,2,m.prototype.writeUInt16BE),i[206]=a(206,4,m.prototype.writeUInt32BE),i[207]=a(207,8,$),i[208]=a(208,1,m.prototype.writeInt8),i[209]=a(209,2,m.prototype.writeInt16BE),i[210]=a(210,4,m.prototype.writeInt32BE),i[211]=a(211,8,O),i[217]=a(217,1,m.prototype.writeUInt8),i[218]=a(218,2,m.prototype.writeUInt16BE),i[219]=a(219,4,m.prototype.writeUInt32BE),i[220]=a(220,2,m.prototype.writeUInt16BE),i[221]=a(221,4,m.prototype.writeUInt32BE),i[222]=a(222,2,m.prototype.writeUInt16BE),i[223]=a(223,4,m.prototype.writeUInt32BE),i):r()}},{"./bufferish":8,"./write-uint8":28,ieee754:32,"int64-buffer":33}],27:[function(t,e,i){var r=t("isarray"),n=t("int64-buffer"),s=n.Uint64BE,o=n.Int64BE,a=t("./bufferish"),$=t("./bufferish-proto"),O=t("./write-token"),l=t("./write-uint8").uint8,h=t("./ext-buffer").ExtBuffer,c="undefined"!=typeof Uint8Array,f="undefined"!=typeof Map,u=[];u[1]=212,u[2]=213,u[4]=214,u[8]=215,u[16]=216,i.getWriteType=function(t){function e(t,e){if(null===e)return i(t,e);if(Q(e))return x(t,e);if(r(e))return function(t,e){var i=e.length;g[i<16?144+i:i<=65535?220:221](t,i);for(var r=t.codec.encode,n=0;n=i())throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function h(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return P(t).length;default:if(r)return S(t).length;e=(""+e).toLowerCase(),r=!0}}function c(t,e,i){var r,n,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0)||(i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,i){var r,n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var s="",o=e;o0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),isNaN(i=+i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return -1;i=t.length-1}else if(i<0){if(!n)return -1;i=0}if("string"==typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:d(t,e,i,r,n);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):d(t,[e],i,r,n);throw TypeError("val must be string, number or Buffer")}function d(t,e,i,r,n){function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var o,a=1,$=t.length,O=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return -1;a=2,$/=2,O/=2,i/=2}if(n){var l=-1;for(o=i;o<$;o++)if(s(t,o)===s(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===O)return l*a}else -1!==l&&(o-=o-l),l=-1}else for(i+O>$&&(i=$-O),o=i;o>=0;o--){for(var h=!0,c=0;c239?4:O>223?3:O>191?2:1;if(n+h<=i)switch(h){case 1:O<128&&(l=O);break;case 2:128==(192&(s=t[n+1]))&&($=(31&O)<<6|63&s)>127&&(l=$);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&($=(15&O)<<12|(63&s)<<6|63&o)>2047&&($<55296||$>57343)&&(l=$);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&($=(15&O)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&$<1114112&&(l=$)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),n+=h}return function(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);for(var i="",r=0;ri)throw RangeError("Trying to access beyond buffer length")}function m(t,e,i,r,n,o){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw RangeError("Index out of range")}function X(t,e,i,r){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-i,2);n>>8*(r?n:1-n)}function Q(t,e,i,r){e<0&&(e=0xffffffff+e+1);for(var n=0,s=Math.min(t.length-i,4);n>>8*(r?n:3-n)&255}function x(t,e,i,r,n,s){if(i+r>t.length||i<0)throw RangeError("Index out of range")}function y(t,e,i,r,n){return n||x(t,e,i,4,34028234663852886e22,-34028234663852886e22),U.write(t,e,i,r,23,4),i+4}function b(t,e,i,r,n){return n||x(t,e,i,8,17976931348623157e292,-17976931348623157e292),U.write(t,e,i,r,52,8),i+8}function S(t,e){e=e||1/0;for(var i,r=t.length,n=null,s=[],o=0;o55295&&i<57344){if(!n){if(i>56319||o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function v(t){for(var e=[],i=0;i=e.length||n>=t.length);++n)e[n+i]=t[n];return n}var w=t("base64-js"),U=t("ieee754"),T=t("isarray");r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=i(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,i){return o(null,t,e,i)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,i){return a(t),t<=0?n(null,t):void 0!==e?"string"==typeof i?n(null,t).fill(e,i):n(null,t).fill(e):n(null,t)},s.allocUnsafe=function(t){return $(null,t)},s.allocUnsafeSlow=function(t){return $(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,r=e.length,n=0,o=Math.min(i,r);n0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,i,r,n){if(!s.isBuffer(t))throw TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),e<0||i>t.length||r<0||n>this.length)throw RangeError("out of range index");if(r>=n&&e>=i)return 0;if(r>=n)return -1;if(e>=i)return 1;if(e>>>=0,i>>>=0,r>>>=0,n>>>=0,this===t)return 0;for(var o=n-r,a=i-e,$=Math.min(o,a),O=this.slice(r,n),l=t.slice(e,i),h=0;h<$;++h)if(O[h]!==l[h]){o=O[h],a=l[h];break}return op)&&(i=p),t.length>0&&(i<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var g=!1;;)switch(r){case"hex":return function(t,e,i,r){i=Number(i)||0;var n=t.length-i;r?(r=Number(r))>n&&(r=n):r=n;var s=e.length;if(s%2!=0)throw TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o>8,n.push(i%256),n.push(r);return n}(t,this.length-u),this,u,d);default:if(g)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),g=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;s.prototype.slice=function(t,e){var i,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(n*=256);)r+=this[t+--e]*n;return r},s.prototype.readUInt8=function(t,e){return e||g(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||g(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||g(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||g(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||g(t,e,this.length);for(var r=this[t],n=1,s=0;++s=(n*=128)&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||g(t,e,this.length);for(var r=e,n=1,s=this[t+--r];r>0&&(n*=256);)s+=this[t+--r]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},s.prototype.readInt8=function(t,e){return e||g(t,1,this.length),128&this[t]?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){e||g(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?0xffff0000|i:i},s.prototype.readInt16BE=function(t,e){e||g(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?0xffff0000|i:i},s.prototype.readInt32LE=function(t,e){return e||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||g(t,4,this.length),U.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||g(t,4,this.length),U.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||g(t,8,this.length),U.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||g(t,8,this.length),U.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,i,r){if(t=+t,e|=0,i|=0,!r){var n=Math.pow(2,8*i)-1;m(this,t,e,i,n,0)}var s=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+s]=t/o&255;return e+i},s.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):X(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):X(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,4,0xffffffff,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Q(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,4,0xffffffff,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Q(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);m(this,t,e,i,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+i},s.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);m(this,t,e,i,n-1,-n)}var s=i-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+i},s.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):X(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):X(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,4,0x7fffffff,-0x80000000),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Q(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Q(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,i){return y(this,t,e,!0,i)},s.prototype.writeFloatBE=function(t,e,i){return y(this,t,e,!1,i)},s.prototype.writeDoubleLE=function(t,e,i){return b(this,t,e,!0,i)},s.prototype.writeDoubleBE=function(t,e,i){return b(this,t,e,!1,i)},s.prototype.copy=function(t,e,i,r){if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw RangeError("sourceStart out of bounds");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--n)t[n+e]=this[n+i];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(n=e;n0)throw Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}i.byteLength=function(t){return 3*t.length/4-r(t)},i.toByteArray=function(t){var e,i,n,a,$,O,l=t.length;O=new o(3*l/4-($=r(t))),n=$>0?l-4:l;var h=0;for(e=0,i=0;e>16&255,O[h++]=a>>8&255,O[h++]=255&a;return 2===$?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,O[h++]=255&a):1===$&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,O[h++]=a>>8&255,O[h++]=255&a),O},i.fromByteArray=function(t){for(var e,i=t.length,r=i%3,s="",o=[],a=0,$=i-r;a<$;a+=16383)o.push(function(t,e,i){for(var r,s=[],o=e;o>18&63]+n[r>>12&63]+n[r>>6&63]+n[63&r]);return s.join("")}(t,a,a+16383>$?$:a+16383));return 1===r?(s+=n[(e=t[i-1])>>2],s+=n[e<<4&63],s+="=="):2===r&&(s+=n[(e=(t[i-2]<<8)+t[i-1])>>10],s+=n[e>>4&63],s+=n[e<<2&63],s+="="),o.push(s),o.join("")};for(var n=[],s=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,O=a.length;$>1,l=-7,h=i?n-1:0,c=i?-1:1,f=t[e+h];for(h+=c,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+t[e+h],h+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+h],h+=c,l-=8);if(0===s)s=1-O;else{if(s===$)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=O}return(f?-1:1)*o*Math.pow(2,s-r)},i.write=function(t,e,i,r,n,s){var o,a,$,O=8*s-n-1,l=(1<>1,c=23===n?5960464477539062e-23:0,f=r?0:s-1,u=r?1:-1,d=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*($=Math.pow(2,-o))<1&&(o--,$*=2),(e+=o+h>=1?c/$:c*Math.pow(2,1-h))*$>=2&&(o++,$/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*$-1)*Math.pow(2,n),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;t[i+f]=255&a,f+=u,a/=256,n-=8);for(o=o<0;t[i+f]=255&o,f+=u,o/=256,O-=8);t[i+f-u]|=128*d}},{}],33:[function(t,e,i){(function(t){!function(e){function i(t,i,X){function y(t,e,i,r){return this instanceof y?function(t,e,i,r,n){if(p&&g&&(e instanceof g&&(e=new p(e)),r instanceof g&&(r=new p(r))),!(e||i||r||f))return void(t.buffer=$(m,0));if(!o(e,i)){var s=f||Array;n=i,r=e,i=0,e=new s(8)}t.buffer=e,t.offset=i|=0,u!==typeof r&&("string"==typeof r?function(t,e,i,r){var n=0,s=i.length,o=0,a=0;"-"===i[0]&&n++;for(var $=n;n=0))break;a=a*r+O,o=o*r+Math.floor(a/Q),a%=Q}$&&(o=~o,a?a=Q-a:o++),S(t,e+P,o),S(t,e+k,a)}(e,i,r,n||10):o(r,n)?a(e,i,r,n):"number"==typeof n?(S(e,i+P,r),S(e,i+k,n)):r>0?_(e,i,r):r<0?Z(e,i,r):a(e,i,m,0))}(this,t,e,i,r):new y(t,e,i,r)}function b(){var t=this.buffer,e=this.offset,i=v(t,e+P),r=v(t,e+k);return X||(i|=0),i?i*Q+r:r}function S(t,e,i){t[e+L]=255&i,i>>=8,t[e+T]=255&i,i>>=8,t[e+U]=255&i,i>>=8,t[e+w]=255&i}function v(t,e){return t[e+w]*x+(t[e+U]<<16)+(t[e+T]<<8)+t[e+L]}var P=i?0:4,k=i?4:0,w=i?0:3,U=i?1:2,T=i?2:1,L=i?3:0,_=i?O:h,Z=i?l:c,q=y.prototype,R="is"+t,W="_"+R;return q.buffer=void 0,q.offset=0,q[W]=!0,q.toNumber=b,q.toString=function(t){var e=this.buffer,i=this.offset,r=v(e,i+P),n=v(e,i+k),s="",o=!X&&0x80000000&r;for(o&&(r=~r,n=Q-n),t=t||10;;){var a=r%t*Q+n;if(r=Math.floor(r/t),n=Math.floor(a/t),s=(a%t).toString(t)+s,!r&&!n)break}return o&&(s="-"+s),s},q.toJSON=b,q.toArray=r,d&&(q.toBuffer=n),p&&(q.toArrayBuffer=s),y[R]=function(t){return!(!t||!t[W])},e[t]=y,y}function r(t){var e=this.buffer,i=this.offset;return f=null,!1!==t&&0===i&&8===e.length&&X(e)?e:$(e,i)}function n(e){var i=this.buffer,r=this.offset;if(f=d,!1!==e&&0===r&&8===i.length&&t.isBuffer(i))return i;var n=new d(8);return a(n,0,i,r),n}function s(t){var e=this.buffer,i=this.offset,r=e.buffer;if(f=p,!1!==t&&0===i&&r instanceof g&&8===r.byteLength)return r;var n=new p(8);return a(n,0,e,i),n.buffer}function o(t,e){var i=t&&t.length;return e|=0,i&&e+8<=i&&"string"!=typeof t[e]}function a(t,e,i,r){e|=0,r|=0;for(var n=0;n<8;n++)t[e++]=255&i[r++]}function $(t,e){return Array.prototype.slice.call(t,e,e+8)}function O(t,e,i){for(var r=e+8;r>e;)t[--r]=255&i,i/=256}function l(t,e,i){var r=e+8;for(i++;r>e;)t[--r]=255&-i^255,i/=256}function h(t,e,i){for(var r=e+8;e{t.onload=()=>{e(t.result)},t.onerror=e=>{t.abort(),i(e)}});return t.readAsText(this),e}),null==Blob.prototype.arrayBuffer&&(Blob.prototype.arrayBuffer=function(){return new Response(this).arrayBuffer()}),(0,i.polyfill)()}),s("dLFsX",function(e,i){t(e.exports,"polyfill",()=>n("bL2Te").polyfill),n("bL2Te")}),s("bL2Te",function(e,i){t(e.exports,"polyfill",()=>F);var r=t=>void 0===t||"auto"===t||"instant"===t||"smooth"===t;function n(t,e){this.scrollLeft=t,this.scrollTop=e}var s=(t,e,i="cannot convert to dictionary.")=>`Failed to execute '${t}' on '${e}': ${i}`,o=(t,e,i)=>s(t,e,`The provided value '${i}' is not a valid enum value of type ScrollBehavior.`),a=(t,e,i)=>{var r;let n=`__SEAMLESS.BACKUP$${e}`;return t[n]||!t[e]||!(null===(r=t[e])||void 0===r)&&r.__isPolyfill||(t[n]=t[e]),t[n]||i},$=t=>{let e=typeof t;return null!==t&&("object"===e||"function"===e)},O=()=>"scrollBehavior"in window.document.documentElement.style,l=t=>{Object.defineProperty(t,"__isPolyfill",{value:!0})},h=(t,e)=>{l(e),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach(i=>{a(i,t),i[t]=e})},c=t=>t.ownerDocument.scrollingElement||t.ownerDocument.documentElement,f=t=>.5*(1-Math.cos(Math.PI*t));function u(){var t;let e;return u=e=!(null===(t=window.performance)||void 0===t)&&t.now?()=>window.performance.now():()=>window.Date.now(),e()}var d=t=>{let e=(u()-t.timeStamp)/(t.duration||500);if(e>1){t.method(t.targetX,t.targetY),t.callback();return}let i=(t.timingFunc||f)(e),r=t.startX+(t.targetX-t.startX)*i,n=t.startY+(t.targetY-t.startY)*i;t.method(r,n),t.rafId=window.requestAnimationFrame(()=>{d(t)})},p=t=>isFinite(t)?Number(t):0,g=t=>{var e;return null!==(e=t.isConnected)&&void 0!==e?e:!t.ownerDocument||!(1&t.ownerDocument.compareDocumentPosition(t))},m=(t,e,i)=>{var r,s;if(!g(t))return;let o=t.scrollLeft,$=t.scrollTop,O=p(null!==(r=e.left)&&void 0!==r?r:o),l=p(null!==(s=e.top)&&void 0!==s?s:$);if(O===o&&l===$)return;let h=a(HTMLElement.prototype,"scroll",n),c=a(Object.getPrototypeOf(t),"scroll",h).bind(t);if("smooth"!==e.behavior){c(O,l);return}let f=()=>{window.removeEventListener("wheel",X),window.removeEventListener("touchmove",X)},m=Object.assign(Object.assign({},i),{timeStamp:u(),startX:o,startY:$,targetX:O,targetY:l,rafId:0,method:c,callback:f}),X=()=>{window.cancelAnimationFrame(m.rafId),f()};window.addEventListener("wheel",X,{passive:!0,once:!0}),window.addEventListener("touchmove",X,{passive:!0,once:!0}),d(m)},X=t=>t.window===t,Q=t=>(e,i,n)=>{let[a,O]=X(e)?[c(e.document.documentElement),"Window"]:[e,"Element"],l=i??{};if(!$(l))throw TypeError(s(t,O));if(!r(l.behavior))throw TypeError(o(t,O,l.behavior));"scrollBy"===t&&(l.left=p(l.left)+a.scrollLeft,l.top=p(l.top)+a.scrollTop),m(a,l,n)},x=Q("scroll"),y=Q("scrollTo"),b=Q("scrollBy"),S=(t,e)=>i=>{if(O())return;let r={scroll:x,scrollTo:y,scrollBy:b}[t];e(t,function(){let t=arguments;if(1==arguments.length){r(this,t[0],i);return}r(this,{left:t[0],top:t[1]})})},v=S("scroll",h),P=S("scrollTo",h),k=S("scrollBy",h),w=(t,e)=>{l(e),a(window,t),window[t]=e},U=S("scroll",w),T=S("scrollTo",w),L=S("scrollBy",w),_=t=>{switch(t){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":break;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},Z=(t,e,i,r)=>{let n=0;switch(e||(n^=2),t){case 0:n=n>>1|(1&n)<<1,[i,r]=[r,i];break;case 1:case 3:n^=1;break;case 4:n^=2}return[n,i,r]},q=t=>(1&Z(_(t.writingMode),"rtl"!==t.direction,void 0,void 0)[0])==1,R=(t,e,i)=>{let[r,n,s]=Z(e,i,t.block||"start",t.inline||"nearest");return[n,s].map((t,e)=>{switch(t){case"center":return 1;case"nearest":return 0;default:return"start"===t==!(r>>e&1)?2:3}})},W=(t,e,i,r,n,s,o)=>0!==t?t:ni||n>e&&s=i&&o>=r?2:s>i&&or?3:null,j=t=>"visible"!==t&&"clip"!==t,K=t=>{var e;try{return(null===(e=t.ownerDocument.defaultView)||void 0===e?void 0:e.frameElement)||null}catch{return null}},Y=(t,e)=>(t.clientHeight{let e=t.parentNode,i=t.parentElement;if(null===i&&null!==e){if(11===e.nodeType)return e.host;if(9===e.nodeType)return K(t)}return i},z=(t,e,i)=>ti?i:t,C=t=>["scroll-margin","scroll-snap-margin"].filter(e=>e in t.documentElement.style)[0],E=(t,e,i)=>{let{top:r,right:n,bottom:s,left:o}=e,a=C(t.ownerDocument);if(!a)return[r,n,s,o];let $=t=>parseInt(i.getPropertyValue(`${a}-${t}`),10)||0;return[r-$("top"),n+$("right"),s+$("bottom"),o-$("left")]},A=(t,e,i)=>{switch(t){case 1:return(e+i)/2;case 3:return i;case 2:case 0:return e}},M=(t,e)=>{var i,r,n;let s=null===(i=t.ownerDocument.defaultView)||void 0===i?void 0:i.visualViewport,[o,a,$,O]=t===c(t)?[0,0,null!==(r=s?.width)&&void 0!==r?r:t.clientWidth,null!==(n=s?.height)&&void 0!==n?n:t.clientHeight]:[e.left,e.top,t.clientWidth,t.clientHeight],l=o+t.clientLeft,h=a+t.clientTop;return[h,l+$,h+O,l]},D=(t,e)=>{let i=[],r=t.ownerDocument,n=r.defaultView;if(!n)return i;let s=window.getComputedStyle(t),o="rtl"!==s.direction,[a,$]=R(e,_(s.writingMode||s.getPropertyValue("-webkit-writing-mode")||s.getPropertyValue("-ms-writing-mode")),o),[O,l,h,c]=E(t,t.getBoundingClientRect(),s);for(let s=V(t);null!==s;s=V(s)){if(r!==s.ownerDocument){if(!(n=(r=s.ownerDocument).defaultView))break;let{left:t,top:e}=s.getBoundingClientRect();O+=e,l+=t,h+=e,c+=t}let t=n.getComputedStyle(s);if("fixed"===t.position)break;if(!Y(s,t))continue;let o=s.getBoundingClientRect(),[f,u,d,p]=M(s,o),g=W(a,p,u,s.clientWidth,c,l,l-c),m=W($,f,d,s.clientHeight,O,h,h-O),X=null===g?0:A(g,c,l)-A(g,p,u),Q=null===m?0:A(m,O,h)-A(m,f,d),x=q(t)?z(X,-s.scrollWidth+s.clientWidth-s.scrollLeft,-s.scrollLeft):z(X,-s.scrollLeft,s.scrollWidth-s.clientWidth-s.scrollLeft),y=z(Q,-s.scrollTop,s.scrollHeight-s.clientHeight-s.scrollTop);i.push([s,{left:s.scrollLeft+x,top:s.scrollTop+y,behavior:e.behavior}]),O=Math.max(O-y,f),l=Math.min(l-x,u),h=Math.min(h-y,d),c=Math.max(c-x,p)}return i},G=(t,e,i)=>{let n=e||{};if(!r(n.behavior))throw TypeError(o("scrollIntoView","Element",n.behavior));D(t,n).forEach(([t,e])=>{x(t,e,i)})};function J(t){G(this,{block:t??!0?"start":"end",inline:"nearest"})}var I=t=>{if(O())return;let e=a(window.HTMLElement.prototype,"scrollIntoView",J);h("scrollIntoView",function(){let i=arguments,r=i[0];if(1===i.length&&$(r)){G(this,r,t);return}e.apply(this,i)})},F=t=>{O()||(v(t),P(t),k(t),I(t),U(t),T(t),L(t))}}),s("enQH9",function(e,i){t(e.exports,"Stack",()=>r);class r{constructor(t){this.max_size=t,this.arr=[]}push(t){this.arr.push(t),this.arr.length>this.max_size&&this.arr.shift()}get(){return this.arr}}}),s("41Mhf",function(e,i){t(e.exports,"with_query_params",()=>r);let r=(t,e)=>{let i="http://delete-me.com/",r=new URL(t,i);return Object.entries(e).forEach(([t,e])=>{null!=e&&r.searchParams.append(t,e)}),r.toString().replace(i,"")};console.assert("https://example.com/?a=b+c"===r("https://example.com/",{a:"b c"})),console.assert("https://example.com/?a=b+c"===r(new URL("https://example.com/"),{a:"b c"})),console.assert("https://example.com/?a=b+c&xx=123"===r(new URL("https://example.com/"),{a:"b c",asdf:null,xx:"123"})),console.assert("index.html?a=b+c"===r("index.html",{a:"b c"})),console.assert("index.html?x=123&a=b+c"===r("index.html?x=123",{a:"b c"})),console.assert("index.html?x=123&a=b+c#asdf"===r("index.html?x=123#asdf",{a:"b c"}))}),s("2ZZ1r",function(e,i){t(e.exports,"FilePicker",()=>g);var r=n("cNaMA"),s=n("exxBE"),o=n("2P6PH");n("kjWx8"),n("hiQgq");var a=n("lFzXt"),$=n("1xJnC"),O=n("aTIpG");let{autocompletion:l,completionKeymap:h}=a.autocomplete,c=h.find(t=>"Ctrl-Space"===t.key),f=h.find(t=>"Enter"===t.key);h.find(t=>"Escape"===t.key);let u=t=>{if(null!=t)return t;throw Error("Unexpected null value")},d=(t,e,i=!0)=>{t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e},selection:(0,a.EditorSelection).cursor(e.length),scrollIntoView:i})},p=!!window.plutoDesktop;p&&console.log("Running in Desktop Environment! Found following properties/methods:",window.plutoDesktop);let g=({value:t,suggest_new_file:e,button_label:i,placeholder:n,on_submit:o,on_desktop_submit:g,client:X,clear_on_blur:Q})=>{let[x,y]=(0,s.useState)(!0),[b,S]=(0,s.useState)(""),v=(0,s.useRef)(""),P=(0,s.useRef)(null),k=(0,s.useRef)(null),w=()=>{let t=k.current;null!=t&&(null!=e&&0===t.state.doc.length&&(d(t,e.base,!1),L()),window.dispatchEvent(new CustomEvent("collapse_cell_selection",{})))},U=async t=>await t(),T=()=>{let t=k.current;if(null!=t)return p||t.state.doc.toString()!==v.current?U(async()=>{try{p&&g?await g((await (0,$.guess_notebook_location)(b)).path_or_url):await o(t.state.doc.toString()),t.dom.blur()}catch(e){d(t,v.current,!0),t.dom.blur()}}):w(),!0},L=()=>{let t=k.current;if(null==t)return;let e=t.state.selection.main;if(e.from===e.to&&t.state.doc.length===e.to)return u(c).run(t)};return(0,s.useLayoutEffect)(()=>{let t=window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>(T(),!0);k.current=new a.EditorView({state:(0,a.EditorState).create({doc:"",extensions:[(0,a.drawSelection)(),(0,a.EditorView).domEventHandlers({focus:(t,i)=>(setTimeout(()=>{e?w():L()},0),!0)}),(0,a.EditorView).updateListener.of(t=>{t.docChanged&&y(0===t.state.doc.length)}),(0,a.EditorView).theme({"&":{fontSize:"inherit"},".cm-scroller":{fontFamily:"inherit",overflowY:"hidden",overflowX:"auto"}},{dark:t}),(0,a.history)(),l({activateOnTyping:!0,override:[m({suggest_new_file:e,client:X})],defaultKeymap:!1,maxRenderedOptions:512,optionClass:t=>t.type??""}),(0,a.EditorView).updateListener.of(t=>{t.transactions.forEach(e=>{null!=e.annotation(a.autocomplete.pickedCompletion)&&(t.view.dispatch({effects:(0,a.EditorView).scrollIntoView(t.state.doc.length),selection:(0,a.EditorSelection).cursor(t.state.doc.length)}),L())})}),(0,a.keymap).of([{key:"Enter",run:t=>u(f).run(t)},{key:"Enter",run:i},{key:"Ctrl-Enter",mac:"Cmd-Enter",run:i},{key:"Ctrl-Shift-Enter",mac:"Cmd-Shift-Enter",run:i},{key:"Tab",run:t=>u(f).run(t)?(L(),!0):L()}]),(0,a.keymap).of(h),(0,a.placeholder)(n),O.tab_help_plugin]})});let r=k.current;p||P.current.insertBefore(r.dom,P.current.firstElementChild)},[]),(0,s.useLayoutEffect)(()=>{v.current!=t&&null!=k.current&&(d(k.current,t,!0),v.current=t)}),p?(0,r.html)` + {S(t.target.value)}} + /> + + ${i} + + `:(0,r.html)` + {if(P.current?.matches(":focus-within")||P.current?.contains(t.relatedTarget))return;let e=k.current;null!=e&&Q&&requestAnimationFrame(()=>{e.hasFocus||d(e,v.current,!0)})}}> + ${i} + + `},m=({client:t,suggest_new_file:e})=>i=>{i.state.selection.main.to;let r=i.state.doc.toString();return t.send("completepath",{query:r}).then(t=>{let i=(r.split("/").pop()??"").split("\\").pop()??"",n=t.message.results,s=(0,o.utf8index_to_ut16index)(r,t.message.start),a=(0,o.utf8index_to_ut16index)(r,t.message.stop);if(n.length>=1&&n[0]==i)return null;let $=n.map(t=>{let e=t.endsWith("/")||t.endsWith("\\");return{label:t,type:e?"dir":"file",boost:e?1:0}});if(null!=e)for(let t=3;t>=0;t--){let e=".jl".substring(0,t);if(i.endsWith(e)){let e=i+".jl".substring(t);if(".jl"==e&&(e="notebook.jl"),3==t)return null;n.includes(e)||$.push({label:e+" (new)",apply:e,type:"file new",boost:-99});break}}return{options:$,from:s,to:a}})}}),s("2P6PH",function(e,i){t(e.exports,"utf8index_to_ut16index",()=>s),t(e.exports,"slice_utf8",()=>o);let r=new TextEncoder,n=new TextDecoder,s=(t,e)=>n.decode(r.encode(t).slice(0,e)).length,o=(t,e,i)=>{let s=r.encode(t);return n.decode(s.slice(e,i))};console.assert("e é hannes ❤ is a dog"===((t,e,i,s)=>{let o=r.encode(t),a=r.encode(s),$=new Uint8Array(o.length+a.length-(i-e));return $.set(o.slice(0,e),0),$.set(a,e),$.set(o.slice(i),e+a.length),n.decode($)})("e é \uD83D\uDC36 is a dog",5,9,"hannes ❤")),console.assert("\uD83D\uDC36"===o("e é \uD83D\uDC36 is a dog",5,9))}),s("kjWx8",function(e,i){t(e.exports,"is_mac_keyboard",()=>r),t(e.exports,"control_name",()=>n),t(e.exports,"ctrl_or_cmd_name",()=>s),t(e.exports,"alt_or_options_name",()=>o),t(e.exports,"and",()=>a),t(e.exports,"has_ctrl_or_cmd_pressed",()=>$),t(e.exports,"in_textarea_or_input",()=>O);let r=/Mac/i.test(navigator.userAgentData?.platform??navigator.platform),n=r?"⌃":"Ctrl",s=r?"⌘":"Ctrl",o=r?"⌥":"Alt",a=r?" ":"+",$=t=>t.ctrlKey||r&&t.metaKey,O=()=>{let t=document.activeElement?.closest("footer")!=null,e=document.activeElement?.closest("header")!=null,i=document.activeElement?.closest(".cm-editor")!=null,{tagName:r}=document.activeElement??{};return"INPUT"===r||"TEXTAREA"===r||t||e||i}}),s("hiQgq",function(e,i){t(e.exports,"EditorState",()=>n("lFzXt").EditorState),t(e.exports,"EditorSelection",()=>n("lFzXt").EditorSelection),t(e.exports,"Compartment",()=>n("lFzXt").Compartment),t(e.exports,"EditorView",()=>n("lFzXt").EditorView),t(e.exports,"placeholder",()=>n("lFzXt").placeholder),t(e.exports,"julia",()=>n("lFzXt").julia),t(e.exports,"keymap",()=>n("lFzXt").keymap),t(e.exports,"syntaxHighlighting",()=>n("lFzXt").syntaxHighlighting),t(e.exports,"history",()=>n("lFzXt").history),t(e.exports,"historyKeymap",()=>n("lFzXt").historyKeymap),t(e.exports,"defaultKeymap",()=>n("lFzXt").defaultKeymap),t(e.exports,"indentMore",()=>n("lFzXt").indentMore),t(e.exports,"indentLess",()=>n("lFzXt").indentLess),t(e.exports,"moveLineUp",()=>n("lFzXt").moveLineUp),t(e.exports,"moveLineDown",()=>n("lFzXt").moveLineDown),t(e.exports,"tags",()=>n("lFzXt").tags),t(e.exports,"HighlightStyle",()=>n("lFzXt").HighlightStyle),t(e.exports,"lineNumbers",()=>n("lFzXt").lineNumbers),t(e.exports,"highlightSpecialChars",()=>n("lFzXt").highlightSpecialChars),t(e.exports,"drawSelection",()=>n("lFzXt").drawSelection),t(e.exports,"indentOnInput",()=>n("lFzXt").indentOnInput),t(e.exports,"defaultHighlightStyle",()=>n("lFzXt").defaultHighlightStyle),t(e.exports,"closeBrackets",()=>n("lFzXt").closeBrackets),t(e.exports,"rectangularSelection",()=>n("lFzXt").rectangularSelection),t(e.exports,"highlightSelectionMatches",()=>n("lFzXt").highlightSelectionMatches),t(e.exports,"closeBracketsKeymap",()=>n("lFzXt").closeBracketsKeymap),t(e.exports,"foldKeymap",()=>n("lFzXt").foldKeymap),t(e.exports,"syntaxTree",()=>n("lFzXt").syntaxTree),t(e.exports,"Decoration",()=>n("lFzXt").Decoration),t(e.exports,"ViewPlugin",()=>n("lFzXt").ViewPlugin),t(e.exports,"WidgetType",()=>n("lFzXt").WidgetType),t(e.exports,"Facet",()=>n("lFzXt").Facet),t(e.exports,"StateField",()=>n("lFzXt").StateField),t(e.exports,"StateEffect",()=>n("lFzXt").StateEffect),t(e.exports,"indentUnit",()=>n("lFzXt").indentUnit),t(e.exports,"combineConfig",()=>n("lFzXt").combineConfig),t(e.exports,"NodeWeakMap",()=>n("lFzXt").NodeWeakMap),t(e.exports,"autocomplete",()=>n("lFzXt").autocomplete),t(e.exports,"html",()=>n("lFzXt").html),t(e.exports,"htmlLanguage",()=>n("lFzXt").htmlLanguage),t(e.exports,"javascriptLanguage",()=>n("lFzXt").javascriptLanguage),t(e.exports,"markdown",()=>n("lFzXt").markdown),t(e.exports,"markdownLanguage",()=>n("lFzXt").markdownLanguage),t(e.exports,"parseCode",()=>n("lFzXt").parseCode),t(e.exports,"parseMixed",()=>n("lFzXt").parseMixed),t(e.exports,"PostgreSQL",()=>n("lFzXt").PostgreSQL),t(e.exports,"pythonLanguage",()=>n("lFzXt").pythonLanguage),t(e.exports,"sql",()=>n("lFzXt").sql),t(e.exports,"javascript",()=>n("lFzXt").javascript),t(e.exports,"python",()=>n("lFzXt").python),t(e.exports,"cssLanguage",()=>n("lFzXt").cssLanguage),t(e.exports,"selectNextOccurrence",()=>n("lFzXt").selectNextOccurrence),t(e.exports,"setDiagnostics",()=>n("lFzXt").setDiagnostics),n("lFzXt")}),s("lFzXt",function(e,i){let r,s;t(e.exports,"EditorSelection",()=>I),t(e.exports,"Facet",()=>N),t(e.exports,"StateField",()=>tn),t(e.exports,"Compartment",()=>tO),t(e.exports,"StateEffect",()=>tS),t(e.exports,"EditorState",()=>t_),t(e.exports,"combineConfig",()=>tZ),t(e.exports,"WidgetType",()=>eF),t(e.exports,"Decoration",()=>eN),t(e.exports,"ViewPlugin",()=>iR),t(e.exports,"EditorView",()=>nr),t(e.exports,"keymap",()=>nh),t(e.exports,"drawSelection",()=>nv),t(e.exports,"highlightSpecialChars",()=>nY),t(e.exports,"placeholder",()=>nM),t(e.exports,"rectangularSelection",()=>nG),t(e.exports,"lineNumbers",()=>sb),t(e.exports,"NodeWeakMap",()=>sN),t(e.exports,"parseMixed",()=>s5),t(e.exports,"tags",()=>ok),t(e.exports,"syntaxTree",()=>oq),t(e.exports,"indentUnit",()=>oG),t(e.exports,"indentOnInput",()=>o7),t(e.exports,"foldKeymap",()=>a$),t(e.exports,"HighlightStyle",()=>ad),t(e.exports,"syntaxHighlighting",()=>aX),t(e.exports,"defaultHighlightStyle",()=>ax),t(e.exports,"history",()=>aG),t(e.exports,"historyKeymap",()=>a4),t(e.exports,"moveLineUp",()=>$V),t(e.exports,"moveLineDown",()=>$z),t(e.exports,"indentMore",()=>$G),t(e.exports,"indentLess",()=>$J),t(e.exports,"defaultKeymap",()=>$F),t(e.exports,"closeBrackets",()=>O2),t(e.exports,"closeBracketsKeymap",()=>lt),t(e.exports,"autocomplete",()=>lO),t(e.exports,"highlightSelectionMatches",()=>lS),t(e.exports,"selectNextOccurrence",()=>lL),t(e.exports,"setDiagnostics",()=>hO),t(e.exports,"julia",()=>cm),t(e.exports,"parseCode",()=>fh),t(e.exports,"cssLanguage",()=>ug),t(e.exports,"javascriptLanguage",()=>uz),t(e.exports,"javascript",()=>uI),t(e.exports,"htmlLanguage",()=>dc),t(e.exports,"html",()=>df),t(e.exports,"markdownLanguage",()=>db),t(e.exports,"markdown",()=>dZ),t(e.exports,"sql",()=>pt),t(e.exports,"PostgreSQL",()=>pi),t(e.exports,"pythonLanguage",()=>pT),t(e.exports,"python",()=>pL);var o,a,$,O,l,h,c,f,u,d,p=n("fnbc9");let g=[],m=[];function X(t){return t>=127462&&t<=127487}function Q(t,e,i){if(e==t.length)return e;e&&y(t.charCodeAt(e))&&b(t.charCodeAt(e-1))&&e--;let r=x(t,e);for(e+=S(r);e>1;if(t=m[r]))return!0;e=r+1}if(e==i)return!1}}(n))e+=S(n),r=n;else{if(!X(n))break;{let i=0,r=e-2;for(;r>=0&&X(x(t,r));)i++,r-=2;if(i%2==0)break;e+=2}}}return e}function x(t,e){let i=t.charCodeAt(e);if(!b(i)||e+1==t.length)return i;let r=t.charCodeAt(e+1);return y(r)?r-56320+(i-55296<<10)+65536:i}function y(t){return t>=56320&&t<57344}function b(t){return t>=55296&&t<56320}function S(t){return t<65536?1:2}(()=>{let t="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(t=>t?parseInt(t,36):1);for(let e=0,i=0;ethis.length)throw RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Z(this,t,e);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(e,this.length,r,1),k.from(r,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Z(this,t,e);let i=[];return this.decompose(t,e,i,0),k.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new U(this),n=new U(t);for(let t=e,s=e;;){if(r.next(t),n.next(t),t=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(s+=r.value.length,r.done||s>=i)return!0}}iter(t=1){return new U(this,t)}iterRange(t,e=this.length){return new T(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new L(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new P(t):k.from(P.split(t,[])):v.empty}}class P extends v{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,r){for(let n=0;;n++){let s=this.text[n],o=r+s.length;if((e?i:o)>=t)return new _(r,o,i,s);r=o+1,i++}}decompose(t,e,i,r){let n=t<=0&&e>=this.length?this:new P(w(this.text,[""],t,e),Math.min(e,this.length)-Math.max(0,t));if(1&r){let t=i.pop(),e=w(n.text,t.text.slice(),0,n.length);if(e.length<=32)i.push(new P(e,t.length+n.length));else{let t=e.length>>1;i.push(new P(e.slice(0,t)),new P(e.slice(t)))}}else i.push(n)}replace(t,e,i){if(!(i instanceof P))return super.replace(t,e,i);[t,e]=Z(this,t,e);let r=w(this.text,w(i.text,w(this.text,[""],0,t)),e),n=this.length+i.length-(e-t);return r.length<=32?new P(r,n):k.from(P.split(r,[]),n)}sliceString(t,e=this.length,i="\n"){[t,e]=Z(this,t,e);let r="";for(let n=0,s=0;n<=e&&st&&s&&(r+=i),tn&&(r+=o.slice(Math.max(0,t-n),e-n)),n=a+1}return r}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],r=-1;for(let n of t)i.push(n),r+=n.length+1,32==i.length&&(e.push(new P(i,r)),i=[],r=-1);return r>-1&&e.push(new P(i,r)),e}}class k extends v{constructor(t,e){for(let i of(super(),this.children=t,this.length=e,this.lines=0,t))this.lines+=i.lines}lineInner(t,e,i,r){for(let n=0;;n++){let s=this.children[n],o=r+s.length,a=i+s.lines-1;if((e?a:o)>=t)return s.lineInner(t,e,i,r);r=o+1,i=a+1}}decompose(t,e,i,r){for(let n=0,s=0;s<=e&&n=s){let n=r&((s<=t?1:0)|(a>=e?2:0));s>=t&&a<=e&&!n?i.push(o):o.decompose(t-s,e-s,i,n)}s=a+1}}replace(t,e,i){if([t,e]=Z(this,t,e),i.lines=n&&e<=o){let a=s.replace(t-n,e-n,i),$=this.lines-s.lines+a.lines;if(a.lines<$>>4&&a.lines>$>>6){let n=this.children.slice();return n[r]=a,new k(n,this.length-(e-t)+i.length)}return super.replace(n,o,a)}n=o+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=Z(this,t,e);let r="";for(let n=0,s=0;nt&&n&&(r+=i),ts&&(r+=o.sliceString(t-s,e-s,i)),s=a+1}return r}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof k))return 0;let i=0,[r,n,s,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=e,n+=e){if(r==s||n==o)return i;let a=this.children[r],$=t.children[n];if(a!=$)return i+a.scanIdentical($,e);i+=a.length+1}}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new P(i,e)}let r=Math.max(32,i>>5),n=r<<1,s=r>>1,o=[],a=0,$=-1,O=[];function l(){0!=a&&(o.push(1==O.length?O[0]:k.from(O,$)),$=-1,a=O.length=0)}for(let e of t)!function t(e){let i;if(e.lines>n&&e instanceof k)for(let i of e.children)t(i);else e.lines>s&&(a>s||!a)?(l(),o.push(e)):e instanceof P&&a&&(i=O[O.length-1])instanceof P&&e.lines+i.lines<=32?(a+=e.lines,$+=e.length+1,O[O.length-1]=new P(i.text.concat(e.text),i.length+1+e.length)):(a+e.lines>r&&l(),a+=e.lines,$+=e.length+1,O.push(e))}(e);return l(),1==o.length?o[0]:new k(o,e)}}function w(t,e,i=0,r=1e9){for(let n=0,s=0,o=!0;s=i&&($>r&&(a=a.slice(0,r-n)),n0?1:(t instanceof P?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],n=this.offsets[i],s=n>>1,o=r instanceof P?r.text.length:r.children.length;if(s==(e>0?o:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&n)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(r instanceof P){let n=r.text[s+(e<0?-1:0)];if(this.offsets[i]+=e,n.length>Math.max(0,t))return this.value=0==t?n:e>0?n.slice(t):n.slice(0,n.length-t),this;t-=n.length}else{let n=r.children[s+(e<0?-1:0)];t>n.length?(t-=n.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(n),this.offsets.push(e>0?1:(n instanceof P?n.text.length:n.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class T{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new U(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*e,this.value=r.length<=i?r:e<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class L{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:r}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(v.prototype[Symbol.iterator]=function(){return this.iter()},U.prototype[Symbol.iterator]=T.prototype[Symbol.iterator]=L.prototype[Symbol.iterator]=function(){return this});let _=class{constructor(t,e,i,r){this.from=t,this.to=e,this.number=i,this.text=r}get length(){return this.to-this.from}};function Z(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}function q(t,e,i=!0,r=!0){return function(t,e,i=!0,r=!0){return(i?Q:function(t,e,i){for(;e>0;){let r=Q(t,e-2,i);if(r=55296&&i<56320)||e+1==t.length)return i;let r=t.charCodeAt(e+1);return r>=56320&&r<57344?r-56320+(i-55296<<10)+65536:i}function W(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}function j(t){return t<65536?1:2}let K=/\r\n?|\n/;var Y=((o=Y||(Y={}))[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o);class V{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return n+(t-r);n+=o}else{if(i!=Y.Simple&&$>=t&&(i==Y.TrackDel&&rt||i==Y.TrackBefore&&rt))return null;if($>t||$==t&&e<0&&!o)return t==r||e<0?n:n+a;n+=a}r=$}if(t>r)throw RangeError(`Position ${t} is out of range for changeset of length ${r}`);return n}touchesRange(t,e=t){for(let i=0,r=0;i=0&&r<=e&&n>=t)return!(re)||"cover";r=n}return!1}toString(){let t="";for(let e=0;e=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(t=>"number"!=typeof t))throw RangeError("Invalid JSON representation of ChangeDesc");return new V(t)}static create(t){return new V(t)}}class z extends V{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw RangeError("Applying change set to a document with the wrong length");return A(this,(e,i,r,n,s)=>t=t.replace(r,r+(i-e),s),!1),t}mapDesc(t,e=!1){return M(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let r=0,n=0;r=0){e[r]=o,e[r+1]=s;let a=r>>1;for(;i.length0&&E(i,e,n.text),n.forward(t),o+=t}let $=t[s++];for(;o<$;){if(n.done)break t;let t=Math.min(n.len,$-o);C(e,t,-1),C(r,t,-1==n.ins?-1:0==n.off?n.ins:0),n.forward(t),o+=t}}return{changes:new z(e,i),filtered:V.create(r)}}toJSON(){let t=[];for(let e=0;e>1].toJSON()))}return t}static of(t,e,i){let r=[],n=[],s=0,o=null;function a(t=!1){if(!t&&!r.length)return;so||t<0||o>e)throw RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let l=O?"string"==typeof O?v.of(O.split(i||K)):O:v.empty,h=l.length;if(t==o&&0==h)return;ts&&C(r,t-s,-1),C(r,o-t,h),E(n,r,l),s=o}}(t),a(!o),o}static empty(t){return new z(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let r=0;re&&"string"!=typeof t))throw RangeError("Invalid JSON representation of ChangeSet");if(1==n.length)e.push(n[0],0);else{for(;i.length=0&&i<=0&&i==t[n+1]?t[n]+=e:n>=0&&0==e&&0==t[n]?t[n+1]+=i:r?(t[n]+=e,t[n+1]+=i):t.push(e,i)}function E(t,e,i){if(0==i.length)return;let r=e.length-2>>1;if(r>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],$=t.sections[o++];e(n,O,s,l,h),n=O,s=l}}}function M(t,e,i,r=!1){let n=[],s=r?[]:null,o=new G(t),a=new G(e);for(let t=-1;;){if(o.done&&a.len||a.done&&o.len)throw Error("Mismatched change set lengths");if(-1==o.ins&&-1==a.ins){let t=Math.min(o.len,a.len);C(n,t,-1),o.forward(t),a.forward(t)}else if(a.ins>=0&&(o.ins<0||t==o.i||0==o.off&&(a.len=0&&t=0)){if(o.done&&a.done)return s?z.createSet(n,s):V.create(n);throw Error("Mismatched change set lengths")}{let e=0,i=o.len;for(;i;)if(-1==a.ins){let t=Math.min(i,a.len);e+=t,i-=t,a.forward(t)}else{if(!(0==a.ins&&a.lene||o.ins>=0&&o.len>e)&&(t||r.length>i),s.forward2(e),o.forward(e)}}else C(r,0,o.ins,t),n&&E(n,r,o.text),o.next()}}class G{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?v.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?v.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class J{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 0xffffff==t?void 0:t}map(t,e=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new J(i,r,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return I.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return I.range(this.anchor,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid JSON representation for SelectionRange");return I.range(t.anchor,t.head)}static create(t,e,i){return new J(t,e,i)}}class I{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:I.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new I(t.ranges.map(t=>J.fromJSON(t)),t.main)}static single(t,e=t){return new I([I.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw RangeError("A selection needs at least one range");for(let i=0,r=0;rt?8:0)|n)}static normalized(t,e=0){let i=t[e];t.sort((t,e)=>t.from-e.from),e=t.indexOf(i);for(let i=1;ir.head?I.range(o,s):I.range(s,o))}}return new I(t,e)}}function F(t,e){for(let i of t.ranges)if(i.to>e)throw RangeError("Selection points outside of document")}let B=0;class N{constructor(t,e,i,r,n){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=r,this.id=B++,this.default=t([]),this.extensions="function"==typeof n?n(this):n}get reader(){return this}static define(t={}){return new N(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:H),!!t.static,t.enables)}of(t){return new tt([],this,0,t)}compute(t,e){if(this.isStatic)throw Error("Can't compute a static facet");return new tt(t,this,1,e)}computeN(t,e){if(this.isStatic)throw Error("Can't compute a static facet");return new tt(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],i=>e(i.field(t)))}}function H(t,e){return t==e||t.length==e.length&&t.every((t,i)=>t===e[i])}class tt{constructor(t,e,i,r){this.dependencies=t,this.facet=e,this.type=i,this.value=r,this.id=B++}dynamicSlot(t){var e;let i=this.value,r=this.facet.compareInput,n=this.id,s=t[n]>>1,o=2==this.type,a=!1,$=!1,O=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?$=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||O.push(t[i.id]);return{create:t=>(t.values[s]=i(t),1),update(t,e){if(a&&e.docChanged||$&&(e.docChanged||e.selection)||ti(t,O)){let e=i(t);if(o?!te(e,t.values[s],r):!r(e,t.values[s]))return t.values[s]=e,1}return 0},reconfigure:(t,e)=>{let a,$=e.config.address[n];if(null!=$){let n=tf(e,$);if(this.dependencies.every(i=>i instanceof N?e.facet(i)===t.facet(i):!(i instanceof tn)||e.field(i,!1)==t.field(i,!1))||(o?te(a=i(t),n,r):r(a=i(t),n)))return t.values[s]=n,0}else a=i(t);return t.values[s]=a,1}}}}function te(t,e,i){if(t.length!=e.length)return!1;for(let r=0;rt===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(tr).find(t=>t.field==this);return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let r=t.values[e],n=this.updateF(r,i);return this.compareF(r,n)?0:(t.values[e]=n,1)},reconfigure:(t,i)=>null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,tr.of({field:this,create:t})]}get extension(){return this}}let ts={lowest:4,low:3,default:2,high:1,highest:0};function to(t){return e=>new t$(e,t)}let ta={highest:to(ts.highest),high:to(ts.high),default:to(ts.default),low:to(ts.low),lowest:to(ts.lowest)};class t${constructor(t,e){this.inner=t,this.prec=e}}class tO{of(t){return new tl(this,t)}reconfigure(t){return tO.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class tl{constructor(t,e){this.compartment=t,this.inner=e}}class th{constructor(t,e,i,r,n,s){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=r,this.staticValues=n,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let r,n,s=[],o=Object.create(null),a=new Map;for(let i of(r=[[],[],[],[],[]],n=new Map,function t(i,s){let o=n.get(i);if(null!=o){if(o<=s)return;let t=r[o].indexOf(i);t>-1&&r[o].splice(t,1),i instanceof tl&&a.delete(i.compartment)}if(n.set(i,s),Array.isArray(i))for(let e of i)t(e,s);else if(i instanceof tl){if(a.has(i.compartment))throw RangeError("Duplicate use of compartment in extensions");let r=e.get(i.compartment)||i.inner;a.set(i.compartment,r),t(r,s)}else if(i instanceof t$)t(i.inner,i.prec);else if(i instanceof tn)r[s].push(i),i.provides&&t(i.provides,s);else if(i instanceof tt)r[s].push(i),i.facet.extensions&&t(i.facet.extensions,ts.default);else{let e=i.extension;if(!e)throw Error(`Unrecognized extension value in extension set (${i}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(e,s)}}(t,ts.default),r.reduce((t,e)=>t.concat(e))))i instanceof tn?s.push(i):(o[i.facet.id]||(o[i.facet.id]=[])).push(i);let $=Object.create(null),O=[],l=[];for(let t of s)$[t.id]=l.length<<1,l.push(e=>t.slot(e));let h=null==i?void 0:i.config.facets;for(let t in o){let e=o[t],r=e[0].facet,n=h&&h[t]||[];if(e.every(t=>0==t.type)){if($[r.id]=O.length<<1|1,H(n,e))O.push(i.facet(r));else{let t=r.combine(e.map(t=>t.value));O.push(i&&r.compare(t,i.facet(r))?i.facet(r):t)}}else{for(let t of e)0==t.type?($[t.id]=O.length<<1|1,O.push(t.value)):($[t.id]=l.length<<1,l.push(e=>t.dynamicSlot(e)));$[r.id]=l.length<<1,l.push(t=>(function(t,e,i){let r=i.map(e=>t[e.id]),n=i.map(t=>t.type),s=r.filter(t=>!(1&t)),o=t[e.id]>>1;function a(t){let i=[];for(let e=0;et($)),$,O,o)}}function tc(t,e){if(1&e)return 2;let i=e>>1,r=t.status[i];if(4==r)throw Error("Cyclic dependency between fields and/or facets");if(2&r)return r;t.status[i]=4;let n=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|n}function tf(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}let tu=N.define(),td=N.define({combine:t=>t.some(t=>t),static:!0}),tp=N.define({combine:t=>t.length?t[0]:void 0,static:!0}),tg=N.define(),tm=N.define(),tX=N.define(),tQ=N.define({combine:t=>!!t.length&&t[0]});class tx{constructor(t,e){this.type=t,this.value=e}static define(){return new ty}}class ty{of(t){return new tx(this,t)}}class tb{constructor(t){this.map=t}of(t){return new tS(this,t)}}class tS{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new tS(this.type,e)}is(t){return this.type==t}static define(t={}){return new tb(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let r of t){let t=r.map(e);t&&i.push(t)}return i}}tS.reconfigure=tS.define(),tS.appendConfig=tS.define();class tv{constructor(t,e,i,r,n,s){this.startState=t,this.changes=e,this.selection=i,this.effects=r,this.annotations=n,this.scrollIntoView=s,this._doc=null,this._state=null,i&&F(i,e.newLength),n.some(t=>t.type==tv.time)||(this.annotations=n.concat(tv.time.of(Date.now())))}static create(t,e,i,r,n,s){return new tv(t,e,i,r,n,s)}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(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(tv.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function tP(t,e,i){var r;let n,s,o;return i?(n=e.changes,s=z.empty(e.changes.length),o=t.changes.compose(e.changes)):(n=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(n)),{changes:o,selection:e.selection?e.selection.map(s):null===(r=t.selection)||void 0===r?void 0:r.map(n),effects:tS.mapEffects(t.effects,n).concat(tS.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function tk(t,e,i){let r=e.selection,n=tU(e.annotations);return e.userEvent&&(n=n.concat(tv.userEvent.of(e.userEvent))),{changes:e.changes instanceof z?e.changes:z.of(e.changes||[],i,t.facet(tp)),selection:r&&(r instanceof I?r:I.single(r.anchor,r.head)),effects:tU(e.effects),annotations:n,scrollIntoView:!!e.scrollIntoView}}tv.time=tx.define(),tv.userEvent=tx.define(),tv.addToHistory=tx.define(),tv.remote=tx.define();let tw=[];function tU(t){return null==t?tw:Array.isArray(t)?t:[t]}var tT=((a=tT||(tT={}))[a.Word=0]="Word",a[a.Space=1]="Space",a[a.Other=2]="Other",a);let tL=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{r=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}class t_{constructor(t,e,i,r,n,s){this.config=t,this.doc=e,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=n,s&&(s._state=this);for(let t=0;t=0;n--){let s=i[n](t);s&&Object.keys(s).length&&(r=tP(r,tk(e,s,t.changes.newLength),!0))}return r==t?t:tv.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}(r?function(e){let i=e.startState,r=!0;for(let t of i.facet(tg)){let i=t(e);if(!1===i){r=!1;break}Array.isArray(i)&&(r=!0===r?i:function(t,e){let i=[];for(let r=0,n=0;;){let s,o;if(r=t[r]))s=t[r++],o=t[r++];else{if(!(n=0;r--){let s=n[r](e);e=s instanceof tv?s:Array.isArray(s)&&1==s.length&&s[0]instanceof tv?s[0]:t(i,tU(s),!1)}return e}(s):s)}(this,t,!0)}applyTransaction(t){let e,i=this.config,{base:r,compartments:n}=i;for(let e of t.effects)e.is(tO.reconfigure)?(i&&(n=new Map,i.compartments.forEach((t,e)=>n.set(e,t)),i=null),n.set(e.value.compartment,e.value.extension)):e.is(tS.reconfigure)?(i=null,r=e.value):e.is(tS.appendConfig)&&(i=null,r=tU(r).concat(e.value));e=i?t.startState.values.slice():new t_(i=th.resolve(r,n,this),this.doc,this.selection,i.dynamicSlots.map(()=>null),(t,e)=>e.reconfigure(t,this),null).values;let s=t.startState.facet(td)?t.newSelection:t.newSelection.asSingle();new t_(i,t.newDoc,s,e,(e,i)=>i.update(e,t),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:I.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),r=this.changes(i.changes),n=[i.range],s=tU(i.effects);for(let i=1;in.spec.fromJSON(s,t)))}}return t_.create({doc:t.doc,selection:I.fromJSON(t.selection),extensions:e.extensions?r.concat([e.extensions]):r})}static create(t={}){let e=th.resolve(t.extensions||[],new Map),i=t.doc instanceof v?t.doc:v.of((t.doc||"").split(e.staticFacet(t_.lineSeparator)||K)),r=t.selection?t.selection instanceof I?t.selection:I.single(t.selection.anchor,t.selection.head):I.single(0);return F(r,i.length),e.staticFacet(td)||(r=r.asSingle()),new t_(e,i,r,e.dynamicSlots.map(()=>null),(t,e)=>e.create(t),null)}get tabSize(){return this.facet(t_.tabSize)}get lineBreak(){return this.facet(t_.lineSeparator)||"\n"}get readOnly(){return this.facet(tQ)}phrase(t,...e){for(let e of this.facet(t_.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(t,i)=>{if("$"==i)return"$";let r=+(i||1);return!r||r>e.length?t:e[r-1]})),t}languageDataAt(t,e,i=-1){let r=[];for(let n of this.facet(tu))for(let s of n(this,e,i))Object.prototype.hasOwnProperty.call(s,t)&&r.push(s[t]);return r}charCategorizer(t){var e;return e=this.languageDataAt("wordChars",t).join(""),t=>{if(!/\S/.test(t))return tT.Space;if(function(t){if(r)return r.test(t);for(let e=0;e""&&(i.toUpperCase()!=i.toLowerCase()||tL.test(i)))return!0}return!1}(t))return tT.Word;for(let i=0;i-1)return tT.Word;return tT.Other}}wordAt(t){let{text:e,from:i,length:r}=this.doc.lineAt(t),n=this.charCategorizer(t),s=t-i,o=t-i;for(;s>0;){let t=q(e,s,!1);if(n(e.slice(t,s))!=tT.Word)break;s=t}for(;ot.length?t[0]:4}),t_.lineSeparator=tp,t_.readOnly=tQ,t_.phrases=N.define({compare(t,e){let i=Object.keys(t),r=Object.keys(e);return i.length==r.length&&i.every(i=>t[i]==e[i])}}),t_.languageData=tu,t_.changeFilter=tg,t_.transactionFilter=tm,t_.transactionExtender=tX,tO.reconfigure=tS.define();class tq{eq(t){return this==t}range(t,e=t){return tR.create(t,e,this)}}tq.prototype.startSide=tq.prototype.endSide=0,tq.prototype.point=!1,tq.prototype.mapMode=Y.TrackDel;let tR=class t{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(e,i,r){return new t(e,i,r)}};function tW(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class tj{constructor(t,e,i,r){this.from=t,this.to=e,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,r=0){let n=i?this.to:this.from;for(let s=r,o=n.length;;){if(s==o)return s;let r=s+o>>1,a=n[r]-t||(i?this.value[r].endSide:this.value[r].startSide)-e;if(r==s)return a>=0?s:o;a>=0?o=r:s=r+1}}between(t,e,i,r){for(let n=this.findIndex(e,-1e9,!0),s=this.findIndex(i,1e9,!1,n);n(O=e.mapPos(c,l.endSide))||$==O&&l.startSide>0&&l.endSide<=0)continue;0>(O-$||l.endSide-l.startSide)||(s<0&&(s=$),l.point&&(o=Math.max(o,O-$)),i.push(l),r.push($-s),n.push(O-s))}return{mapped:i.length?new tj(r,n,i,o):null,pos:s}}}class tK{constructor(t,e,i,r){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=r}static create(t,e,i,r){return new tK(t,e,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:r=0,filterTo:n=this.length}=t,s=t.filter;if(0==e.length&&!s)return this;if(i&&(e=e.slice().sort(tW)),this.isEmpty)return e.length?tK.of(e):this;let o=new tz(this,null,-1).goto(0),a=0,$=[],O=new tY;for(;o.value||a=0){let t=e[a++];O.addInner(t.from,t.to,t.value)||$.push(t)}else 1==o.rangeIndex&&o.chunkIndex
Welcome to the Live docs! Keep this little window open while you work on the notebook, and you will get documentation of everything you type!
You can also type a query above.
Still stuck? Here are some tips.
${s.shown_query}
+${n.map((n,a)=>e.line-1-t<=a&&a<=e.line-1+t?(0,l.html)`<${tv} code=${n} i=${a} frameLine=${a===e.line-1} />`:null)}
Syntax error
${n.current?null:a}
Multiple expressions in one cell.
${t}
+ {e.preventDefault(),a.split_remote_cell(n,r,!0)}} + >Split this cell into ${r.length} cells, or +
How would you like to fix it?
Tried to reevaluate an include call, this is not supported. You might need to restart this notebook from the main menu.
include
+ 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.
${e}
Cyclic references among${" "}${tk(e)}.
Multiple definitions for${" "}${tk(e)}.
Another cell defining ${tk(c)} contains errors.
The package ${n}.jl could not load because it failed to initialize.
That's not nice! Things you could try:
You might find useful information in the package installation log:
Here is what happened, the most recent locations are first:
+ ${"To be able to edit code and run cells, you need to run the notebook yourself. "} + Where would you like to run the notebook? +
+ Binder is a free, open source service that runs scientific notebooks in the cloud! + It will take a while, usually 2-7 minutes to get a session. +
(Recommended if you want to store your changes.)
+ ${"(Also see: "} + How to install Julia and Pluto) +
Type the saved filename in the open box.
+ If you are publishing this notebook on the web, you can set the parameters below to provide HTML metadata. This is useful for search engines and + social media. +
A new server was started - this notebook session is no longer running.
Would you like to go back to the main menu?
The statefile failed to download. Original error message:
${t.toString()}
Launch parameters:
${JSON.stringify(e,null,2)}
$ADVICE
Go back
$BODYTITLE
$BODY
The latest versions of Firefox and Chrome will work best.
Here are a couple of notebooks to get started with Pluto.jl:
Tip: Visit this page again when you are connected to the internet to read our online collection of featured notebooks.
${e.description}
${o.description}
=0;i--)if((r=e.__k[i])&&(n=t(r)))return n}return null}(r).nextSibling),function t(e,i,r){var s,o;if(n.unmount&&n.unmount(e),(s=e.ref)&&(s.current&&s.current!==e.__e||_(s,null,i)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(t){n.__e(t,i)}s.base=s.__P=null,e.__c=void 0}if(s=e.__k)for(o=0;o2&&(a.children=arguments.length>3?r.call(arguments,2):i),g(t.type,a,n||t.key,s||t.ref,null)}function j(t,e){var i={__c:e="__cC"+l++,__:t,Consumer:function(t,e){return t.children(e)},Provider:function(t){var i,r;return this.getChildContext||(i=[],(r={})[e]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(t){this.props.value!==t.value&&i.some(function(t){t.__e=!0,y(t)})},this.sub=function(t){i.push(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){i.splice(i.indexOf(t),1),e&&e.call(t)}}),t.children}};return i.Provider.__=i.Consumer.contextType=i}r=c.slice,n={__e:function(t,e,i,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&null!=s.getDerivedStateFromError&&(n.setState(s.getDerivedStateFromError(t)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(t,r||{}),o=n.__d),o)return n.__E=n}catch(e){t=e}throw t}},s=0,Q.prototype.setState=function(t,e){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=u({},this.state),"function"==typeof t&&(t=t(u({},i),this.props)),t&&u(i,t),null!=t&&this.__v&&(e&&this._sb.push(e),y(this))},Q.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),y(this))},Q.prototype.render=X,o=[],$="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,O=function(t,e){return t.__v.__b-e.__v.__b},b.__r=0,l=0}),s("g47wy",function(e,i){t(e.exports,"useCallback",()=>n("exxBE").useCallback),t(e.exports,"useContext",()=>n("exxBE").useContext),t(e.exports,"useEffect",()=>n("exxBE").useEffect),t(e.exports,"useErrorBoundary",()=>n("exxBE").useErrorBoundary),t(e.exports,"useLayoutEffect",()=>n("exxBE").useLayoutEffect),t(e.exports,"useMemo",()=>n("exxBE").useMemo),t(e.exports,"useRef",()=>n("exxBE").useRef),t(e.exports,"useState",()=>n("exxBE").useState),n("3vOYv"),n("exxBE")}),s("exxBE",function(e,i){t(e.exports,"useState",()=>m),t(e.exports,"useEffect",()=>X),t(e.exports,"useLayoutEffect",()=>Q),t(e.exports,"useRef",()=>x),t(e.exports,"useMemo",()=>y),t(e.exports,"useCallback",()=>b),t(e.exports,"useContext",()=>S),t(e.exports,"useErrorBoundary",()=>v);var r,s,o,a,$=n("3vOYv"),O=0,l=[],h=[],c=$.options.__b,f=$.options.__r,u=$.options.diffed,d=$.options.__c,p=$.options.unmount;function g(t,e){$.options.__h&&(0,$.options).__h(s,t,O||e),O=0;var i=s.__H||(s.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:h}),i.__[t]}function m(t){return O=1,function(t,e,i){var n=g(r++,2);if(n.t=t,!n.__c&&(n.__=[L(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],i=n.t(e,t);e!==i&&(n.__N=[i,n.__[1]],n.__c.setState({}))}],n.__c=s,!s.u)){var o=function(t,e,i){if(!n.__c.__H)return!0;var r=n.__c.__H.__.filter(function(t){return t.__c});if(r.every(function(t){return!t.__N}))return!a||a.call(this,t,e,i);var s=!1;return r.forEach(function(t){if(t.__N){var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(s=!0)}}),!(!s&&n.__c.props===t)&&(!a||a.call(this,t,e,i))};s.u=!0;var a=s.shouldComponentUpdate,$=s.componentWillUpdate;s.componentWillUpdate=function(t,e,i){if(this.__e){var r=a;a=void 0,o(t,e,i),a=r}$&&$.call(this,t,e,i)},s.shouldComponentUpdate=o}return n.__N||n.__}(L,t)}function X(t,e){var i=g(r++,3);!$.options.__s&&T(i.__H,e)&&(i.__=t,i.i=e,s.__H.__h.push(i))}function Q(t,e){var i=g(r++,4);!$.options.__s&&T(i.__H,e)&&(i.__=t,i.i=e,s.__h.push(i))}function x(t){return O=5,y(function(){return{current:t}},[])}function y(t,e){var i=g(r++,7);return T(i.__H,e)?(i.__V=t(),i.i=e,i.__h=t,i.__V):i.__}function b(t,e){return O=8,y(function(){return t},e)}function S(t){var e=s.context[t.__c],i=g(r++,9);return i.c=t,e?(null==i.__&&(i.__=!0,e.sub(s)),e.props.value):t.__}function v(t){var e=g(r++,10),i=m();return e.__=t,s.componentDidCatch||(s.componentDidCatch=function(t,r){e.__&&e.__(t,r),i[1](t)}),[i[0],function(){i[1](void 0)}]}function P(){for(var t;t=l.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(w),t.__H.__h.forEach(U),t.__H.__h=[]}catch(e){t.__H.__h=[],(0,$.options).__e(e,t.__v)}}$.options.__b=function(t){s=null,c&&c(t)},$.options.__r=function(t){f&&f(t),r=0;var e=(s=t.__c).__H;e&&(o===s?(e.__h=[],s.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=h,t.__N=t.i=void 0})):(e.__h.forEach(w),e.__h.forEach(U),e.__h=[])),o=s},$.options.diffed=function(t){u&&u(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==l.push(e)&&a===$.options.requestAnimationFrame||((a=(0,$.options).requestAnimationFrame)||function(t){var e,i=function(){clearTimeout(r),k&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(i,100);k&&(e=requestAnimationFrame(i))})(P)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==h&&(t.__=t.__V),t.i=void 0,t.__V=h})),o=s=null},$.options.__c=function(t,e){e.some(function(t){try{t.__h.forEach(w),t.__h=t.__h.filter(function(t){return!t.__||U(t)})}catch(i){e.some(function(t){t.__h&&(t.__h=[])}),e=[],(0,$.options).__e(i,t.__v)}}),d&&d(t,e)},$.options.unmount=function(t){p&&p(t);var e,i=t.__c;i&&i.__H&&(i.__H.__.forEach(function(t){try{w(t)}catch(t){e=t}}),i.__H=void 0,e&&(0,$.options).__e(e,i.__v))};var k="function"==typeof requestAnimationFrame;function w(t){var e=s,i=t.__c;"function"==typeof i&&(t.__c=void 0,i()),s=e}function U(t){var e=s;t.__c=t.__(),s=e}function T(t,e){return!t||t.length!==e.length||e.some(function(e,i){return e!==t[i]})}function L(t,e){return"function"==typeof e?e(t):e}}),s("4KWiy",function(e,i){t(e.exports,"default",()=>n("lNRSt").default),n("lNRSt")}),s("lNRSt",function(e,i){t(e.exports,"default",()=>s);var r=function(t,e,i,n){var s;e[0]=0;for(var o=1;o=5&&((n||!t&&5===r)&&(o.push(r,0,n,i),r=6),t&&(o.push(r,t,0,i),r=6)),n=""},$=0;$"===e?(r=1,n=""):n=e+n[0]:s?e===s?s="":n+=e:'"'===e||"'"===e?s=e:">"===e?(a(),r=1):r&&("="===e?(r=5,i=n,n=""):"/"===e&&(r<5||">"===t[$][O+1])?(a(),3===r&&(o=o[0]),r=o,(o=o[0]).push(2,0,r),r=0):" "===e||" "===e||e===` +`||"\r"===e?(a(),r=2):n+=e),3===r&&"!--"===n&&(r=4,o=o[0])}return a(),o}(t)),e),arguments,[])).length>1?e:e[0]}}),s("eS9BV",function(t,e){try{null==window.process&&(window.process={}),null==window.process.env&&(window.process.env={}),window.process.env.NODE_ENV="production"}catch(t){console.warn("Couldn't set window.process.env, this might break some things")}}),s("9Ta4i",function(e,i){t(e.exports,"default",()=>r);var r=window._}),s("4zMEb",function(e,i){t(e.exports,"timeout_promise",()=>$),t(e.exports,"ws_address_from_base",()=>g),t(e.exports,"create_pluto_connection",()=>X);var r=n("fUfdR"),s=n("k9crH");n("iYcLY");var o=n("enQH9"),a=n("41Mhf");let $=(t,e)=>Promise.race([t,new Promise((t,i)=>{setTimeout(()=>{i(Error("Promise timed out."))},e)})]),O=()=>{let t=()=>{},e=()=>{};return{current:new Promise((i,r)=>{t=i,e=r}),resolve:t,reject:e}},l=()=>crypto.getRandomValues(new Uint32Array(1))[0].toString(36),h=t=>t.readyState==WebSocket.OPEN||t.readyState==WebSocket.CONNECTING,c=t=>new Promise(e=>{h(t)?e(!0):setTimeout(()=>{e(h(t))},1e3)}),f=t=>{t.onopen=()=>{f(t)},t.onmessage=t.onclose=t.onerror=null;try{t.close(1e3,"byebye")}catch(t){}},u=(t,{on_message:e,on_socket_close:i},r=30)=>new Promise((n,o)=>{let a=new WebSocket(t),$=!1,O=setTimeout(()=>{console.warn("Creating websocket timed out",new Date().toLocaleTimeString()),f(a),o("Socket timeout")},1e3*r),l=t=>{let e=(0,s.pack)(t);if(a.readyState===WebSocket.CLOSED||a.readyState===WebSocket.CLOSING)throw Error("Socket is closed");a.send(e)},h=Promise.resolve();a.onmessage=t=>{h=h.then(async()=>{try{let i=await t.data.arrayBuffer(),r=(0,s.unpack)(new Uint8Array(i));try{e(r)}catch(e){console.error("Failed to process message from websocket",e,{message:r}),alert(`Something went wrong! You might need to refresh the page. + +Please open an issue on https://github.com/fonsp/Pluto.jl with this info: + +Failed to process update +${e.message} + +${JSON.stringify(t)}`)}}catch(e){console.error("Failed to unpack message from websocket",e,{event:t}),alert(`Something went wrong! You might need to refresh the page. + +Please open an issue on https://github.com/fonsp/Pluto.jl with this info: + +Failed to unpack message +${e} + +${JSON.stringify(t)}`)}})},a.onerror=async t=>{console.error(`Socket did an oopsie - ${t.type}`,new Date().toLocaleTimeString(),"was open:",$,t),await c(a)?(console.log("The socket somehow recovered from an error?! Onbegrijpelijk"),console.log(a),console.log(a.readyState)):$?(i(),f(a)):o(t)},a.onclose=async t=>{console.warn(`Socket did an oopsie - ${t.type}`,new Date().toLocaleTimeString(),"was open:",$,t),$?(i(),f(a)):o(t)},a.onopen=()=>{console.log("Socket opened",new Date().toLocaleTimeString()),clearInterval(O),$=!0,n({socket:a,send:l})},console.log("Waiting for socket to open...",new Date().toLocaleTimeString())}),d=()=>new Promise(t=>setTimeout(t,0)),p=t=>{let e=null,i=[],r=null;return async(n,s,o,a)=>{if("update_notebook"!==n)return await t(n,s,o,a);if(null!=r&&r!=o.notebook_id)throw Error("Switched notebook inbetween same-tick updates??? WHAT?!?!");return i=[...i,...s.updates],r=o.notebook_id,null==e&&(e=d().then(async()=>{let s=i;return e=null,i=[],r=null,await t(n,{updates:s},o,a)})),await e}},g=t=>{let e=new URL("./",t);return e.protocol=e.protocol.replace("http","ws"),(0,a.with_query_params)(e,{secret:new URL(t).searchParams.get("secret")})},m=()=>g(window.location.href),X=async({on_unrequested_update:t,on_reconnect:e,on_connection_status:i,connect_metadata:n={},ws_address:s=m()})=>{let a=null,$=new o.Stack(100);window.pluto_get_message_log=()=>$.get();let h={version_info:{julia:"unknown",pluto:"unknown",dismiss_update_notification:!1},notebook_exists:!0,message_log:$},c=l(),f=new Map,d=async(e,i={},r={},n=!0)=>{if(null==a)throw Error("No connection established yet");let s=l(),o={type:e,client_id:c,request_id:s,body:i,...r},$=O();return f.set(s,e=>{$.resolve(e),!1===n&&t(e,!0)}),a.send(o),await $.current};h.send=p(d);let g=async()=>{(async()=>{try{let t=new URL(window.location.href),e=await fetch("possible_binder_token_please");if(!e.ok)return;let i=await e.text();""!==i&&t.searchParams.get("token")!==i&&(t.searchParams.set("token",i),history.replaceState({},"",t.toString()))}catch(t){console.warn("Error while setting binder url:",t)}})();try{a=await u(String(s),{on_message:e=>{$.push(e);let i=e.initiator_id==c,r=e.request_id;if(i&&r){let t=f.get(r);if(t){t(e),f.delete(r);return}}t(e,i)},on_socket_close:async()=>{i(!1,!1),console.log("Starting new websocket",new Date().toLocaleTimeString()),await (0,r.Promises).delay(500),await g(),console.log("Starting state sync",new Date().toLocaleTimeString());let t=await e();console.log(`State sync ${t?"":"not "}successful`,new Date().toLocaleTimeString()),i(t,!1),t||alert("Connection out of sync \uD83D\uDE25\n\nRefresh the page to continue")}}),console.log("Hello?");let o=await d("connect",{},n);if(console.log("Hello!"),h.kill=()=>{a&&a.socket.close()},h.session_options=o.message.options,h.version_info=o.message.version_info,h.notebook_exists=o.message.notebook_exists,console.log("Client object: ",h),null!=n.notebook_id&&!o.message.notebook_exists)return i(!1,!0),{};i(!0,!1);let O=()=>{d("ping",{},{}).then(()=>{setTimeout(O,28e3)}).catch(()=>void 0)};return O(),o.message}catch(t){return console.error("connect() failed",t),await (0,r.Promises).delay(5e3),await g()}};return await g(),h}}),s("fUfdR",function(e,i){t(e.exports,"default",()=>n),t(e.exports,"observablehq_for_cells",()=>s),t(e.exports,"Promises",()=>o);let r=()=>{let t=new window.observablehq.Library;return{DOM:t.DOM,Files:t.Files,Generators:t.Generators,Promises:t.Promises,now:t.now,svg:t.svg(),html:t.html(),require:t.require()}},n=r(),s=r();n.DOM,n.Files,n.Generators;let o=n.Promises;n.now,n.svg,n.html,n.require}),s("k9crH",function(e,i){t(e.exports,"pack",()=>a),t(e.exports,"unpack",()=>$);var r=n("e52WV");let s=(0,r.default).createCodec(),o=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength);s.addExtPacker(17,Int8Array,o),s.addExtPacker(18,Uint8Array,o),s.addExtPacker(19,Int16Array,o),s.addExtPacker(20,Uint16Array,o),s.addExtPacker(21,Int32Array,o),s.addExtPacker(22,Uint32Array,o),s.addExtPacker(23,Float32Array,o),s.addExtPacker(24,Float64Array,o),s.addExtPacker(18,Uint8ClampedArray,o),s.addExtPacker(18,ArrayBuffer,t=>new Uint8Array(t)),s.addExtPacker(18,DataView,o),s.addExtPacker(13,Date,t=>new BigInt64Array([BigInt(+t)])),s.addExtUnpacker(13,t=>{if(!("getBigInt64"in DataView.prototype))return new Date(NaN);{let e=new DataView(t.buffer,t.byteOffset,t.byteLength).getBigInt64(0,!0);if(e>Number.MAX_SAFE_INTEGER)throw Error("Can't read too big number as date (how far in the future is this?!)");return new Date(Number(e))}}),s.addExtUnpacker(17,t=>new Int8Array(t.buffer)),s.addExtUnpacker(18,t=>new Uint8Array(t.buffer)),s.addExtUnpacker(19,t=>new Int16Array(t.buffer)),s.addExtUnpacker(20,t=>new Uint16Array(t.buffer)),s.addExtUnpacker(21,t=>new Int32Array(t.buffer)),s.addExtUnpacker(22,t=>new Uint32Array(t.buffer)),s.addExtUnpacker(23,t=>new Float32Array(t.buffer)),s.addExtUnpacker(24,t=>new Float64Array(t.buffer));let a=t=>(0,r.default).encode(t,{codec:s}),$=t=>(0,r.default).decode(t,{codec:s})}),s("e52WV",function(e,i){t(e.exports,"default",()=>r);var r=n("8RXlh").default}),s("8RXlh",function(i,r){t(i.exports,"default",()=>n);var n=(function t(e,i,r){function n(o,a){if(!i[o]){if(!e[o]){var $=void 0;if(!a&&$)return $(o,!0);if(s)return s(o,!0);var O=Error("Cannot find module '"+o+"'");throw O.code="MODULE_NOT_FOUND",O}var l=i[o]={exports:{}};e[o][0].call(l.exports,function(t){return n(e[o][1][t]||t)},l,l.exports,t,e,i,r)}return i[o].exports}for(var s=void 0,o=0;o=0;n--)t[n+e]=this[n+i];else for(n=0;n=65536?(s-=65536,n+=String.fromCharCode((s>>>10)+55296,(1023&s)+56320)):n+=String.fromCharCode(s));return n},i.write=function(t,e){for(var i=e||(e|=0),r=t.length,n=0,s=0;s>>6:(n<55296||n>57343?this[i++]=224|n>>>12:(n=(n-55296<<10|t.charCodeAt(s++)-56320)+65536,this[i++]=240|n>>>18,this[i++]=128|n>>>12&63),this[i++]=128|n>>>6&63),this[i++]=128|63&n);return i-e}},{}],4:[function(t,e,i){function r(t){return Array(t)}var n=t("./bufferish"),i=e.exports=r(0);i.alloc=r,i.concat=n.concat,i.from=function(t){if(!n.isBuffer(t)&&n.isView(t))t=n.Uint8Array.from(t);else if(n.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return n.from.call(i,t);if("number"==typeof t)throw TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(t)}},{"./bufferish":8}],5:[function(t,e,i){function r(t){return new s(t)}var n=t("./bufferish"),s=n.global,i=e.exports=n.hasBuffer?r(0):[];i.alloc=n.hasBuffer&&s.alloc||r,i.concat=n.concat,i.from=function(t){if(!n.isBuffer(t)&&n.isView(t))t=n.Uint8Array.from(t);else if(n.isArrayBuffer(t))t=new Uint8Array(t);else{if("string"==typeof t)return n.from.call(i,t);if("number"==typeof t)throw TypeError('"value" argument must not be a number')}return s.from&&1!==s.from.length?s.from(t):new s(t)}},{"./bufferish":8}],6:[function(t,e,i){function r(t,e,i,r){var s=a.isBuffer(this),$=a.isBuffer(t);if(s&&$)return this.copy(t,e,i,r);if(l||s||$||!a.isView(this)||!a.isView(t))return o.copy.call(this,t,e,i,r);var O=i||null!=r?n.call(this,i,r):this;return t.set(O,e),O.length}function n(t,e){var i=this.slice||!l&&this.subarray;if(i)return i.call(this,t,e);var n=a.alloc.call(this,e-t);return r.call(this,n,0,t,e),n}var s,o=t("./buffer-lite");i.copy=r,i.slice=n,i.toString=function(t,e,i){return(!O&&a.isBuffer(this)?this.toString:o.toString).apply(this,arguments)},i.write=(s="write",function(){return(this[s]||o[s]).apply(this,arguments)});var a=t("./bufferish"),$=a.global,O=a.hasBuffer&&"TYPED_ARRAY_SUPPORT"in $,l=O&&!$.TYPED_ARRAY_SUPPORT},{"./buffer-lite":3,"./bufferish":8}],7:[function(t,e,i){function r(t){return new Uint8Array(t)}var n=t("./bufferish"),i=e.exports=n.hasArrayBuffer?r(0):[];i.alloc=r,i.concat=n.concat,i.from=function(t){if(n.isView(t)){var e=t.byteOffset,r=t.byteLength;(t=t.buffer).byteLength!==r&&(t.slice?t=t.slice(e,e+r):(t=new Uint8Array(t)).byteLength!==r&&(t=Array.prototype.slice.call(t,e,e+r)))}else{if("string"==typeof t)return n.from.call(i,t);if("number"==typeof t)throw TypeError('"value" argument must not be a number')}return new Uint8Array(t)}},{"./bufferish":8}],8:[function(t,e,i){function r(t){return s(this).alloc(t)}function n(t){var e=3*t.length,i=r.call(this,e),n=g.write.call(i,t);return e!==n&&(i=g.slice.call(i,0,n)),i}function s(t){return c(t)?d:f(t)?p:h(t)?u:O?d:l?p:u}function o(){return!1}function a(t,e){return t="[object "+t+"]",function(i){return null!=i&&({}).toString.call(e?i[e]:i)===t}}var $=i.global=t("./buffer-global"),O=i.hasBuffer=$&&!!$.isBuffer,l=i.hasArrayBuffer="undefined"!=typeof ArrayBuffer,h=i.isArray=t("isarray");i.isArrayBuffer=l?function(t){return t instanceof ArrayBuffer||m(t)}:o;var c=i.isBuffer=O?$.isBuffer:o,f=i.isView=l?ArrayBuffer.isView||a("ArrayBuffer","buffer"):o;i.alloc=r,i.concat=function(t,e){e||(e=0,Array.prototype.forEach.call(t,function(t){e+=t.length}));var n=this!==i&&this||t[0],s=r.call(n,e),o=0;return Array.prototype.forEach.call(t,function(t){o+=g.copy.call(t,s,o)}),s},i.from=function(t){return"string"==typeof t?n.call(this,t):s(this).from(t)};var u=i.Array=t("./bufferish-array"),d=i.Buffer=t("./bufferish-buffer"),p=i.Uint8Array=t("./bufferish-uint8array"),g=i.prototype=t("./bufferish-proto"),m=a("ArrayBuffer")},{"./buffer-global":2,"./bufferish-array":4,"./bufferish-buffer":5,"./bufferish-proto":6,"./bufferish-uint8array":7,isarray:34}],9:[function(t,e,i){function r(t){return this instanceof r?(this.options=t,void this.init()):new r(t)}function n(t){return new r(t)}var s=t("isarray");i.createCodec=n,i.install=function(t){for(var e in t)r.prototype[e]=function(t,e){return t&&e?function(){return t.apply(this,arguments),e.apply(this,arguments)}:t||e}(r.prototype[e],t[e])},i.filter=function(t){return s(t)?function(t){function e(t,e){return e(t)}return t=t.slice(),function(i){return t.reduce(e,i)}}(t):t};var o=t("./bufferish");r.prototype.init=function(){var t=this.options;return t&&t.uint8array&&(this.bufferish=o.Uint8Array),this},i.preset=n({preset:!0})},{"./bufferish":8,isarray:34}],10:[function(t,e,i){t("./read-core"),t("./write-core"),i.codec={preset:t("./codec-base").preset}},{"./codec-base":9,"./read-core":22,"./write-core":25}],11:[function(t,e,i){function r(t){if(!(this instanceof r))return new r(t);if(t&&(this.options=t,t.codec)){var e=this.codec=t.codec;e.bufferish&&(this.bufferish=e.bufferish)}}i.DecodeBuffer=r;var n=t("./read-core").preset;t("./flex-buffer").FlexDecoder.mixin(r.prototype),r.prototype.codec=n,r.prototype.fetch=function(){return this.codec.decode(this)}},{"./flex-buffer":21,"./read-core":22}],12:[function(t,e,i){i.decode=function(t,e){var i=new r(e);return i.write(t),i.read()};var r=t("./decode-buffer").DecodeBuffer},{"./decode-buffer":11}],13:[function(t,e,i){function r(t){return this instanceof r?void s.call(this,t):new r(t)}i.Decoder=r;var n=t("event-lite"),s=t("./decode-buffer").DecodeBuffer;r.prototype=new s,n.mixin(r.prototype),r.prototype.decode=function(t){arguments.length&&this.write(t),this.flush()},r.prototype.push=function(t){this.emit("data",t)},r.prototype.end=function(t){this.decode(t),this.emit("end")}},{"./decode-buffer":11,"event-lite":31}],14:[function(t,e,i){function r(t){if(!(this instanceof r))return new r(t);if(t&&(this.options=t,t.codec)){var e=this.codec=t.codec;e.bufferish&&(this.bufferish=e.bufferish)}}i.EncodeBuffer=r;var n=t("./write-core").preset;t("./flex-buffer").FlexEncoder.mixin(r.prototype),r.prototype.codec=n,r.prototype.write=function(t){this.codec.encode(this,t)}},{"./flex-buffer":21,"./write-core":25}],15:[function(t,e,i){i.encode=function(t,e){var i=new r(e);return i.write(t),i.read()};var r=t("./encode-buffer").EncodeBuffer},{"./encode-buffer":14}],16:[function(t,e,i){function r(t){return this instanceof r?void s.call(this,t):new r(t)}i.Encoder=r;var n=t("event-lite"),s=t("./encode-buffer").EncodeBuffer;r.prototype=new s,n.mixin(r.prototype),r.prototype.encode=function(t){this.write(t),this.emit("data",this.read())},r.prototype.end=function(t){arguments.length&&this.encode(t),this.flush(),this.emit("end")}},{"./encode-buffer":14,"event-lite":31}],17:[function(t,e,i){i.ExtBuffer=function t(e,i){return this instanceof t?(this.buffer=r.from(e),void(this.type=i)):new t(e,i)};var r=t("./bufferish")},{"./bufferish":8}],18:[function(t,e,i){function r(e){return a||(a=t("./encode").encode),a(e)}function n(t){return t.valueOf()}function s(t){(t=RegExp.prototype.toString.call(t).split("/")).shift();var e=[t.pop()];return e.unshift(t.join("/")),e}function o(t){var e={};for(var i in h)e[i]=t[i];return e}i.setExtPackers=function(t){t.addExtPacker(14,Error,[o,r]),t.addExtPacker(1,EvalError,[o,r]),t.addExtPacker(2,RangeError,[o,r]),t.addExtPacker(3,ReferenceError,[o,r]),t.addExtPacker(4,SyntaxError,[o,r]),t.addExtPacker(5,TypeError,[o,r]),t.addExtPacker(6,URIError,[o,r]),t.addExtPacker(10,RegExp,[s,r]),t.addExtPacker(11,Boolean,[n,r]),t.addExtPacker(12,String,[n,r]),t.addExtPacker(13,Date,[Number,r]),t.addExtPacker(15,Number,[n,r]),"undefined"!=typeof Uint8Array&&(t.addExtPacker(17,Int8Array,l),t.addExtPacker(18,Uint8Array,l),t.addExtPacker(19,Int16Array,l),t.addExtPacker(20,Uint16Array,l),t.addExtPacker(21,Int32Array,l),t.addExtPacker(22,Uint32Array,l),t.addExtPacker(23,Float32Array,l),"undefined"!=typeof Float64Array&&t.addExtPacker(24,Float64Array,l),"undefined"!=typeof Uint8ClampedArray&&t.addExtPacker(25,Uint8ClampedArray,l),t.addExtPacker(26,ArrayBuffer,l),t.addExtPacker(29,DataView,l)),$.hasBuffer&&t.addExtPacker(27,O,$.from)};var a,$=t("./bufferish"),O=$.global,l=$.Uint8Array.from,h={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1}},{"./bufferish":8,"./encode":15}],19:[function(t,e,i){function r(e){return $||($=t("./decode").decode),$(e)}function n(t){return RegExp.apply(null,t)}function s(t){return function(e){var i=new t;for(var r in h)i[r]=e[r];return i}}function o(t){return function(e){return new t(e)}}function a(t){return new Uint8Array(t).buffer}i.setExtUnpackers=function(t){t.addExtUnpacker(14,[r,s(Error)]),t.addExtUnpacker(1,[r,s(EvalError)]),t.addExtUnpacker(2,[r,s(RangeError)]),t.addExtUnpacker(3,[r,s(ReferenceError)]),t.addExtUnpacker(4,[r,s(SyntaxError)]),t.addExtUnpacker(5,[r,s(TypeError)]),t.addExtUnpacker(6,[r,s(URIError)]),t.addExtUnpacker(10,[r,n]),t.addExtUnpacker(11,[r,o(Boolean)]),t.addExtUnpacker(12,[r,o(String)]),t.addExtUnpacker(13,[r,o(Date)]),t.addExtUnpacker(15,[r,o(Number)]),"undefined"!=typeof Uint8Array&&(t.addExtUnpacker(17,o(Int8Array)),t.addExtUnpacker(18,o(Uint8Array)),t.addExtUnpacker(19,[a,o(Int16Array)]),t.addExtUnpacker(20,[a,o(Uint16Array)]),t.addExtUnpacker(21,[a,o(Int32Array)]),t.addExtUnpacker(22,[a,o(Uint32Array)]),t.addExtUnpacker(23,[a,o(Float32Array)]),"undefined"!=typeof Float64Array&&t.addExtUnpacker(24,[a,o(Float64Array)]),"undefined"!=typeof Uint8ClampedArray&&t.addExtUnpacker(25,o(Uint8ClampedArray)),t.addExtUnpacker(26,a),t.addExtUnpacker(29,[a,o(DataView)])),O.hasBuffer&&t.addExtUnpacker(27,o(l))};var $,O=t("./bufferish"),l=O.global,h={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1}},{"./bufferish":8,"./decode":12}],20:[function(t,e,i){t("./read-core"),t("./write-core"),i.createCodec=t("./codec-base").createCodec},{"./codec-base":9,"./read-core":22,"./write-core":25}],21:[function(t,e,i){function r(){if(!(this instanceof r))return new r}function n(){if(!(this instanceof n))return new n}function s(){return this.buffers&&this.buffers.length?(this.flush(),this.pull()):this.fetch()}function o(t){(this.buffers||(this.buffers=[])).push(t)}function a(t){return function(e){for(var i in t)e[i]=t[i];return e}}i.FlexDecoder=r,i.FlexEncoder=n;var $=t("./bufferish"),O="BUFFER_SHORTAGE";r.mixin=a({bufferish:$,write:function(t){var e=this.offset?$.prototype.slice.call(this.buffer,this.offset):this.buffer;this.buffer=e?t?this.bufferish.concat([e,t]):e:t,this.offset=0},fetch:function(){throw Error("method not implemented: fetch()")},flush:function(){for(;this.offsetthis.buffer.length)throw Error(O);return this.offset=i,e},offset:0}),r.mixin(r.prototype),n.mixin=a({bufferish:$,write:function(){throw Error("method not implemented: write()")},fetch:function(){var t=this.start;if(t1?this.bufferish.concat(t):t[0];return t.length=0,e},read:s,reserve:function(t){var e=0|t;if(this.buffer){var i=this.buffer.length,r=0|this.offset,n=r+e;if(nthis.minBufferSize)this.flush(),this.push(t);else{var i=this.reserve(e);$.prototype.copy.call(t,this.buffer,i)}},maxBufferSize:65536,minBufferSize:2048,offset:0,start:0}),n.mixin(n.prototype)},{"./bufferish":8}],22:[function(t,e,i){function r(){var t,e=this.options;return this.decode=(t=a.getReadToken(e),function(e){var i=o(e),r=t[i];if(!r)throw Error("Invalid type: "+(i?"0x"+i.toString(16):i));return r(e)}),e&&e.preset&&s.setExtUnpackers(this),this}var n=t("./ext-buffer").ExtBuffer,s=t("./ext-unpacker"),o=t("./read-format").readUint8,a=t("./read-token"),$=t("./codec-base");$.install({addExtUnpacker:function(t,e){(this.extUnpackers||(this.extUnpackers=[]))[t]=$.filter(e)},getExtUnpacker:function(t){return(this.extUnpackers||(this.extUnpackers=[]))[t]||function(e){return new n(e,t)}},init:r}),i.preset=r.call($.preset)},{"./codec-base":9,"./ext-buffer":17,"./ext-unpacker":19,"./read-format":23,"./read-token":24}],23:[function(t,e,i){function r(t,e){var i,r={},n=Array(e),s=Array(e),o=t.codec.decode;for(i=0;i>>8,n[r]=i}}function o(t){return function(e,i){var r=e.reserve(5),n=e.buffer;n[r++]=t,n[r++]=i>>>24,n[r++]=i>>>16,n[r++]=i>>>8,n[r]=i}}function a(t,e,i,r){return function(n,s){var o=n.reserve(e+1);n.buffer[o++]=t,i.call(n.buffer,s,o,r)}}function $(t,e){new u(this,e,t)}function O(t,e){new d(this,e,t)}function l(t,e){c.write(this,t,e,!1,23,4)}function h(t,e){c.write(this,t,e,!1,52,8)}var c=t("ieee754"),f=t("int64-buffer"),u=f.Uint64BE,d=f.Int64BE,p=t("./write-uint8").uint8,g=t("./bufferish"),m=g.global,X=g.hasBuffer&&"TYPED_ARRAY_SUPPORT"in m&&!m.TYPED_ARRAY_SUPPORT,Q=g.hasBuffer&&m.prototype||{};i.getWriteToken=function(t){var e,i;return t&&t.uint8array?((e=r())[202]=a(202,4,l),e[203]=a(203,8,h),e):X||g.hasBuffer&&t&&t.safe?((i=p.slice())[196]=a(196,1,m.prototype.writeUInt8),i[197]=a(197,2,m.prototype.writeUInt16BE),i[198]=a(198,4,m.prototype.writeUInt32BE),i[199]=a(199,1,m.prototype.writeUInt8),i[200]=a(200,2,m.prototype.writeUInt16BE),i[201]=a(201,4,m.prototype.writeUInt32BE),i[202]=a(202,4,m.prototype.writeFloatBE),i[203]=a(203,8,m.prototype.writeDoubleBE),i[204]=a(204,1,m.prototype.writeUInt8),i[205]=a(205,2,m.prototype.writeUInt16BE),i[206]=a(206,4,m.prototype.writeUInt32BE),i[207]=a(207,8,$),i[208]=a(208,1,m.prototype.writeInt8),i[209]=a(209,2,m.prototype.writeInt16BE),i[210]=a(210,4,m.prototype.writeInt32BE),i[211]=a(211,8,O),i[217]=a(217,1,m.prototype.writeUInt8),i[218]=a(218,2,m.prototype.writeUInt16BE),i[219]=a(219,4,m.prototype.writeUInt32BE),i[220]=a(220,2,m.prototype.writeUInt16BE),i[221]=a(221,4,m.prototype.writeUInt32BE),i[222]=a(222,2,m.prototype.writeUInt16BE),i[223]=a(223,4,m.prototype.writeUInt32BE),i):r()}},{"./bufferish":8,"./write-uint8":28,ieee754:32,"int64-buffer":33}],27:[function(t,e,i){var r=t("isarray"),n=t("int64-buffer"),s=n.Uint64BE,o=n.Int64BE,a=t("./bufferish"),$=t("./bufferish-proto"),O=t("./write-token"),l=t("./write-uint8").uint8,h=t("./ext-buffer").ExtBuffer,c="undefined"!=typeof Uint8Array,f="undefined"!=typeof Map,u=[];u[1]=212,u[2]=213,u[4]=214,u[8]=215,u[16]=216,i.getWriteType=function(t){function e(t,e){if(null===e)return i(t,e);if(Q(e))return x(t,e);if(r(e))return function(t,e){var i=e.length;g[i<16?144+i:i<=65535?220:221](t,i);for(var r=t.codec.encode,n=0;n=i())throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i().toString(16)+" bytes");return 0|t}function h(t,e){if(s.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return P(t).length;default:if(r)return S(t).length;e=(""+e).toLowerCase(),r=!0}}function c(t,e,i){var r,n,s=!1;if((void 0===e||e<0)&&(e=0),e>this.length||((void 0===i||i>this.length)&&(i=this.length),i<=0)||(i>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,i){var r,n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);for(var s="",o=e;o0x7fffffff?i=0x7fffffff:i<-0x80000000&&(i=-0x80000000),isNaN(i=+i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return -1;i=t.length-1}else if(i<0){if(!n)return -1;i=0}if("string"==typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:d(t,e,i,r,n);if("number"==typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):d(t,[e],i,r,n);throw TypeError("val must be string, number or Buffer")}function d(t,e,i,r,n){function s(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var o,a=1,$=t.length,O=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return -1;a=2,$/=2,O/=2,i/=2}if(n){var l=-1;for(o=i;o<$;o++)if(s(t,o)===s(e,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===O)return l*a}else -1!==l&&(o-=o-l),l=-1}else for(i+O>$&&(i=$-O),o=i;o>=0;o--){for(var h=!0,c=0;c239?4:O>223?3:O>191?2:1;if(n+h<=i)switch(h){case 1:O<128&&(l=O);break;case 2:128==(192&(s=t[n+1]))&&($=(31&O)<<6|63&s)>127&&(l=$);break;case 3:s=t[n+1],o=t[n+2],128==(192&s)&&128==(192&o)&&($=(15&O)<<12|(63&s)<<6|63&o)>2047&&($<55296||$>57343)&&(l=$);break;case 4:s=t[n+1],o=t[n+2],a=t[n+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&($=(15&O)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&$<1114112&&(l=$)}null===l?(l=65533,h=1):l>65535&&(l-=65536,r.push(l>>>10&1023|55296),l=56320|1023&l),r.push(l),n+=h}return function(t){var e=t.length;if(e<=L)return String.fromCharCode.apply(String,t);for(var i="",r=0;ri)throw RangeError("Trying to access beyond buffer length")}function m(t,e,i,r,n,o){if(!s.isBuffer(t))throw TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw RangeError("Index out of range")}function X(t,e,i,r){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-i,2);n>>8*(r?n:1-n)}function Q(t,e,i,r){e<0&&(e=0xffffffff+e+1);for(var n=0,s=Math.min(t.length-i,4);n>>8*(r?n:3-n)&255}function x(t,e,i,r,n,s){if(i+r>t.length||i<0)throw RangeError("Index out of range")}function y(t,e,i,r,n){return n||x(t,e,i,4,34028234663852886e22,-34028234663852886e22),U.write(t,e,i,r,23,4),i+4}function b(t,e,i,r,n){return n||x(t,e,i,8,17976931348623157e292,-17976931348623157e292),U.write(t,e,i,r,52,8),i+8}function S(t,e){e=e||1/0;for(var i,r=t.length,n=null,s=[],o=0;o55295&&i<57344){if(!n){if(i>56319||o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),n=i;continue}i=(n-55296<<10|i-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function v(t){for(var e=[],i=0;i=e.length||n>=t.length);++n)e[n+i]=t[n];return n}var w=t("base64-js"),U=t("ieee754"),T=t("isarray");r.Buffer=s,r.SlowBuffer=function(t){return+t!=t&&(t=0),s.alloc(+t)},r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),r.kMaxLength=i(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,e,i){return o(null,t,e,i)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,e,i){return a(t),t<=0?n(null,t):void 0!==e?"string"==typeof i?n(null,t).fill(e,i):n(null,t).fill(e):n(null,t)},s.allocUnsafe=function(t){return $(null,t)},s.allocUnsafeSlow=function(t){return $(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,e){if(!s.isBuffer(t)||!s.isBuffer(e))throw TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,r=e.length,n=0,o=Math.min(i,r);n0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},s.prototype.compare=function(t,e,i,r,n){if(!s.isBuffer(t))throw TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),e<0||i>t.length||r<0||n>this.length)throw RangeError("out of range index");if(r>=n&&e>=i)return 0;if(r>=n)return -1;if(e>=i)return 1;if(e>>>=0,i>>>=0,r>>>=0,n>>>=0,this===t)return 0;for(var o=n-r,a=i-e,$=Math.min(o,a),O=this.slice(r,n),l=t.slice(e,i),h=0;h<$;++h)if(O[h]!==l[h]){o=O[h],a=l[h];break}return op)&&(i=p),t.length>0&&(i<0||e<0)||e>this.length)throw RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var g=!1;;)switch(r){case"hex":return function(t,e,i,r){i=Number(i)||0;var n=t.length-i;r?(r=Number(r))>n&&(r=n):r=n;var s=e.length;if(s%2!=0)throw TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o>8,n.push(i%256),n.push(r);return n}(t,this.length-u),this,u,d);default:if(g)throw TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),g=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var L=4096;s.prototype.slice=function(t,e){var i,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(n*=256);)r+=this[t+--e]*n;return r},s.prototype.readUInt8=function(t,e){return e||g(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||g(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||g(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||g(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+0x1000000*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||g(t,4,this.length),0x1000000*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||g(t,e,this.length);for(var r=this[t],n=1,s=0;++s=(n*=128)&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||g(t,e,this.length);for(var r=e,n=1,s=this[t+--r];r>0&&(n*=256);)s+=this[t+--r]*n;return s>=(n*=128)&&(s-=Math.pow(2,8*e)),s},s.prototype.readInt8=function(t,e){return e||g(t,1,this.length),128&this[t]?-((255-this[t]+1)*1):this[t]},s.prototype.readInt16LE=function(t,e){e||g(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?0xffff0000|i:i},s.prototype.readInt16BE=function(t,e){e||g(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?0xffff0000|i:i},s.prototype.readInt32LE=function(t,e){return e||g(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||g(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||g(t,4,this.length),U.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||g(t,4,this.length),U.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||g(t,8,this.length),U.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||g(t,8,this.length),U.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,i,r){if(t=+t,e|=0,i|=0,!r){var n=Math.pow(2,8*i)-1;m(this,t,e,i,n,0)}var s=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+s]=t/o&255;return e+i},s.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):X(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):X(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,4,0xffffffff,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Q(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,4,0xffffffff,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Q(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);m(this,t,e,i,n-1,-n)}var s=0,o=1,a=0;for(this[e]=255&t;++s>0)-a&255;return e+i},s.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);m(this,t,e,i,n-1,-n)}var s=i-1,o=1,a=0;for(this[e+s]=255&t;--s>=0&&(o*=256);)t<0&&0===a&&0!==this[e+s+1]&&(a=1),this[e+s]=(t/o>>0)-a&255;return e+i},s.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):X(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):X(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,4,0x7fffffff,-0x80000000),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Q(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||m(this,t,e,4,0x7fffffff,-0x80000000),t<0&&(t=0xffffffff+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Q(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,i){return y(this,t,e,!0,i)},s.prototype.writeFloatBE=function(t,e,i){return y(this,t,e,!1,i)},s.prototype.writeDoubleLE=function(t,e,i){return b(this,t,e,!0,i)},s.prototype.writeDoubleBE=function(t,e,i){return b(this,t,e,!1,i)},s.prototype.copy=function(t,e,i,r){if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw RangeError("sourceStart out of bounds");if(r<0)throw RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--n)t[n+e]=this[n+i];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"==typeof t)for(n=e;n0)throw Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}i.byteLength=function(t){return 3*t.length/4-r(t)},i.toByteArray=function(t){var e,i,n,a,$,O,l=t.length;O=new o(3*l/4-($=r(t))),n=$>0?l-4:l;var h=0;for(e=0,i=0;e>16&255,O[h++]=a>>8&255,O[h++]=255&a;return 2===$?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,O[h++]=255&a):1===$&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,O[h++]=a>>8&255,O[h++]=255&a),O},i.fromByteArray=function(t){for(var e,i=t.length,r=i%3,s="",o=[],a=0,$=i-r;a<$;a+=16383)o.push(function(t,e,i){for(var r,s=[],o=e;o>18&63]+n[r>>12&63]+n[r>>6&63]+n[63&r]);return s.join("")}(t,a,a+16383>$?$:a+16383));return 1===r?(s+=n[(e=t[i-1])>>2],s+=n[e<<4&63],s+="=="):2===r&&(s+=n[(e=(t[i-2]<<8)+t[i-1])>>10],s+=n[e>>4&63],s+=n[e<<2&63],s+="="),o.push(s),o.join("")};for(var n=[],s=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$=0,O=a.length;$>1,l=-7,h=i?n-1:0,c=i?-1:1,f=t[e+h];for(h+=c,s=f&(1<<-l)-1,f>>=-l,l+=a;l>0;s=256*s+t[e+h],h+=c,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=r;l>0;o=256*o+t[e+h],h+=c,l-=8);if(0===s)s=1-O;else{if(s===$)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=O}return(f?-1:1)*o*Math.pow(2,s-r)},i.write=function(t,e,i,r,n,s){var o,a,$,O=8*s-n-1,l=(1<>1,c=23===n?5960464477539062e-23:0,f=r?0:s-1,u=r?1:-1,d=e<0||0===e&&1/e<0?1:0;for(isNaN(e=Math.abs(e))||e===1/0?(a=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*($=Math.pow(2,-o))<1&&(o--,$*=2),(e+=o+h>=1?c/$:c*Math.pow(2,1-h))*$>=2&&(o++,$/=2),o+h>=l?(a=0,o=l):o+h>=1?(a=(e*$-1)*Math.pow(2,n),o+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,n),o=0));n>=8;t[i+f]=255&a,f+=u,a/=256,n-=8);for(o=o<0;t[i+f]=255&o,f+=u,o/=256,O-=8);t[i+f-u]|=128*d}},{}],33:[function(t,e,i){(function(t){!function(e){function i(t,i,X){function y(t,e,i,r){return this instanceof y?function(t,e,i,r,n){if(p&&g&&(e instanceof g&&(e=new p(e)),r instanceof g&&(r=new p(r))),!(e||i||r||f))return void(t.buffer=$(m,0));if(!o(e,i)){var s=f||Array;n=i,r=e,i=0,e=new s(8)}t.buffer=e,t.offset=i|=0,u!==typeof r&&("string"==typeof r?function(t,e,i,r){var n=0,s=i.length,o=0,a=0;"-"===i[0]&&n++;for(var $=n;n=0))break;a=a*r+O,o=o*r+Math.floor(a/Q),a%=Q}$&&(o=~o,a?a=Q-a:o++),S(t,e+P,o),S(t,e+k,a)}(e,i,r,n||10):o(r,n)?a(e,i,r,n):"number"==typeof n?(S(e,i+P,r),S(e,i+k,n)):r>0?_(e,i,r):r<0?Z(e,i,r):a(e,i,m,0))}(this,t,e,i,r):new y(t,e,i,r)}function b(){var t=this.buffer,e=this.offset,i=v(t,e+P),r=v(t,e+k);return X||(i|=0),i?i*Q+r:r}function S(t,e,i){t[e+L]=255&i,i>>=8,t[e+T]=255&i,i>>=8,t[e+U]=255&i,i>>=8,t[e+w]=255&i}function v(t,e){return t[e+w]*x+(t[e+U]<<16)+(t[e+T]<<8)+t[e+L]}var P=i?0:4,k=i?4:0,w=i?0:3,U=i?1:2,T=i?2:1,L=i?3:0,_=i?O:h,Z=i?l:c,q=y.prototype,R="is"+t,W="_"+R;return q.buffer=void 0,q.offset=0,q[W]=!0,q.toNumber=b,q.toString=function(t){var e=this.buffer,i=this.offset,r=v(e,i+P),n=v(e,i+k),s="",o=!X&&0x80000000&r;for(o&&(r=~r,n=Q-n),t=t||10;;){var a=r%t*Q+n;if(r=Math.floor(r/t),n=Math.floor(a/t),s=(a%t).toString(t)+s,!r&&!n)break}return o&&(s="-"+s),s},q.toJSON=b,q.toArray=r,d&&(q.toBuffer=n),p&&(q.toArrayBuffer=s),y[R]=function(t){return!(!t||!t[W])},e[t]=y,y}function r(t){var e=this.buffer,i=this.offset;return f=null,!1!==t&&0===i&&8===e.length&&X(e)?e:$(e,i)}function n(e){var i=this.buffer,r=this.offset;if(f=d,!1!==e&&0===r&&8===i.length&&t.isBuffer(i))return i;var n=new d(8);return a(n,0,i,r),n}function s(t){var e=this.buffer,i=this.offset,r=e.buffer;if(f=p,!1!==t&&0===i&&r instanceof g&&8===r.byteLength)return r;var n=new p(8);return a(n,0,e,i),n.buffer}function o(t,e){var i=t&&t.length;return e|=0,i&&e+8<=i&&"string"!=typeof t[e]}function a(t,e,i,r){e|=0,r|=0;for(var n=0;n<8;n++)t[e++]=255&i[r++]}function $(t,e){return Array.prototype.slice.call(t,e,e+8)}function O(t,e,i){for(var r=e+8;r>e;)t[--r]=255&i,i/=256}function l(t,e,i){var r=e+8;for(i++;r>e;)t[--r]=255&-i^255,i/=256}function h(t,e,i){for(var r=e+8;e{t.onload=()=>{e(t.result)},t.onerror=e=>{t.abort(),i(e)}});return t.readAsText(this),e}),null==Blob.prototype.arrayBuffer&&(Blob.prototype.arrayBuffer=function(){return new Response(this).arrayBuffer()}),(0,i.polyfill)()}),s("dLFsX",function(e,i){t(e.exports,"polyfill",()=>n("bL2Te").polyfill),n("bL2Te")}),s("bL2Te",function(e,i){t(e.exports,"polyfill",()=>F);var r=t=>void 0===t||"auto"===t||"instant"===t||"smooth"===t;function n(t,e){this.scrollLeft=t,this.scrollTop=e}var s=(t,e,i="cannot convert to dictionary.")=>`Failed to execute '${t}' on '${e}': ${i}`,o=(t,e,i)=>s(t,e,`The provided value '${i}' is not a valid enum value of type ScrollBehavior.`),a=(t,e,i)=>{var r;let n=`__SEAMLESS.BACKUP$${e}`;return t[n]||!t[e]||!(null===(r=t[e])||void 0===r)&&r.__isPolyfill||(t[n]=t[e]),t[n]||i},$=t=>{let e=typeof t;return null!==t&&("object"===e||"function"===e)},O=()=>"scrollBehavior"in window.document.documentElement.style,l=t=>{Object.defineProperty(t,"__isPolyfill",{value:!0})},h=(t,e)=>{l(e),[HTMLElement.prototype,SVGElement.prototype,Element.prototype].forEach(i=>{a(i,t),i[t]=e})},c=t=>t.ownerDocument.scrollingElement||t.ownerDocument.documentElement,f=t=>.5*(1-Math.cos(Math.PI*t));function u(){var t;let e;return u=e=!(null===(t=window.performance)||void 0===t)&&t.now?()=>window.performance.now():()=>window.Date.now(),e()}var d=t=>{let e=(u()-t.timeStamp)/(t.duration||500);if(e>1){t.method(t.targetX,t.targetY),t.callback();return}let i=(t.timingFunc||f)(e),r=t.startX+(t.targetX-t.startX)*i,n=t.startY+(t.targetY-t.startY)*i;t.method(r,n),t.rafId=window.requestAnimationFrame(()=>{d(t)})},p=t=>isFinite(t)?Number(t):0,g=t=>{var e;return null!==(e=t.isConnected)&&void 0!==e?e:!t.ownerDocument||!(1&t.ownerDocument.compareDocumentPosition(t))},m=(t,e,i)=>{var r,s;if(!g(t))return;let o=t.scrollLeft,$=t.scrollTop,O=p(null!==(r=e.left)&&void 0!==r?r:o),l=p(null!==(s=e.top)&&void 0!==s?s:$);if(O===o&&l===$)return;let h=a(HTMLElement.prototype,"scroll",n),c=a(Object.getPrototypeOf(t),"scroll",h).bind(t);if("smooth"!==e.behavior){c(O,l);return}let f=()=>{window.removeEventListener("wheel",X),window.removeEventListener("touchmove",X)},m=Object.assign(Object.assign({},i),{timeStamp:u(),startX:o,startY:$,targetX:O,targetY:l,rafId:0,method:c,callback:f}),X=()=>{window.cancelAnimationFrame(m.rafId),f()};window.addEventListener("wheel",X,{passive:!0,once:!0}),window.addEventListener("touchmove",X,{passive:!0,once:!0}),d(m)},X=t=>t.window===t,Q=t=>(e,i,n)=>{let[a,O]=X(e)?[c(e.document.documentElement),"Window"]:[e,"Element"],l=i??{};if(!$(l))throw TypeError(s(t,O));if(!r(l.behavior))throw TypeError(o(t,O,l.behavior));"scrollBy"===t&&(l.left=p(l.left)+a.scrollLeft,l.top=p(l.top)+a.scrollTop),m(a,l,n)},x=Q("scroll"),y=Q("scrollTo"),b=Q("scrollBy"),S=(t,e)=>i=>{if(O())return;let r={scroll:x,scrollTo:y,scrollBy:b}[t];e(t,function(){let t=arguments;if(1==arguments.length){r(this,t[0],i);return}r(this,{left:t[0],top:t[1]})})},v=S("scroll",h),P=S("scrollTo",h),k=S("scrollBy",h),w=(t,e)=>{l(e),a(window,t),window[t]=e},U=S("scroll",w),T=S("scrollTo",w),L=S("scrollBy",w),_=t=>{switch(t){case"horizontal-tb":case"lr":case"lr-tb":case"rl":case"rl-tb":break;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},Z=(t,e,i,r)=>{let n=0;switch(e||(n^=2),t){case 0:n=n>>1|(1&n)<<1,[i,r]=[r,i];break;case 1:case 3:n^=1;break;case 4:n^=2}return[n,i,r]},q=t=>(1&Z(_(t.writingMode),"rtl"!==t.direction,void 0,void 0)[0])==1,R=(t,e,i)=>{let[r,n,s]=Z(e,i,t.block||"start",t.inline||"nearest");return[n,s].map((t,e)=>{switch(t){case"center":return 1;case"nearest":return 0;default:return"start"===t==!(r>>e&1)?2:3}})},W=(t,e,i,r,n,s,o)=>0!==t?t:ni||n>e&&s=i&&o>=r?2:s>i&&or?3:null,j=t=>"visible"!==t&&"clip"!==t,K=t=>{var e;try{return(null===(e=t.ownerDocument.defaultView)||void 0===e?void 0:e.frameElement)||null}catch{return null}},Y=(t,e)=>(t.clientHeight{let e=t.parentNode,i=t.parentElement;if(null===i&&null!==e){if(11===e.nodeType)return e.host;if(9===e.nodeType)return K(t)}return i},z=(t,e,i)=>ti?i:t,C=t=>["scroll-margin","scroll-snap-margin"].filter(e=>e in t.documentElement.style)[0],E=(t,e,i)=>{let{top:r,right:n,bottom:s,left:o}=e,a=C(t.ownerDocument);if(!a)return[r,n,s,o];let $=t=>parseInt(i.getPropertyValue(`${a}-${t}`),10)||0;return[r-$("top"),n+$("right"),s+$("bottom"),o-$("left")]},A=(t,e,i)=>{switch(t){case 1:return(e+i)/2;case 3:return i;case 2:case 0:return e}},M=(t,e)=>{var i,r,n;let s=null===(i=t.ownerDocument.defaultView)||void 0===i?void 0:i.visualViewport,[o,a,$,O]=t===c(t)?[0,0,null!==(r=s?.width)&&void 0!==r?r:t.clientWidth,null!==(n=s?.height)&&void 0!==n?n:t.clientHeight]:[e.left,e.top,t.clientWidth,t.clientHeight],l=o+t.clientLeft,h=a+t.clientTop;return[h,l+$,h+O,l]},D=(t,e)=>{let i=[],r=t.ownerDocument,n=r.defaultView;if(!n)return i;let s=window.getComputedStyle(t),o="rtl"!==s.direction,[a,$]=R(e,_(s.writingMode||s.getPropertyValue("-webkit-writing-mode")||s.getPropertyValue("-ms-writing-mode")),o),[O,l,h,c]=E(t,t.getBoundingClientRect(),s);for(let s=V(t);null!==s;s=V(s)){if(r!==s.ownerDocument){if(!(n=(r=s.ownerDocument).defaultView))break;let{left:t,top:e}=s.getBoundingClientRect();O+=e,l+=t,h+=e,c+=t}let t=n.getComputedStyle(s);if("fixed"===t.position)break;if(!Y(s,t))continue;let o=s.getBoundingClientRect(),[f,u,d,p]=M(s,o),g=W(a,p,u,s.clientWidth,c,l,l-c),m=W($,f,d,s.clientHeight,O,h,h-O),X=null===g?0:A(g,c,l)-A(g,p,u),Q=null===m?0:A(m,O,h)-A(m,f,d),x=q(t)?z(X,-s.scrollWidth+s.clientWidth-s.scrollLeft,-s.scrollLeft):z(X,-s.scrollLeft,s.scrollWidth-s.clientWidth-s.scrollLeft),y=z(Q,-s.scrollTop,s.scrollHeight-s.clientHeight-s.scrollTop);i.push([s,{left:s.scrollLeft+x,top:s.scrollTop+y,behavior:e.behavior}]),O=Math.max(O-y,f),l=Math.min(l-x,u),h=Math.min(h-y,d),c=Math.max(c-x,p)}return i},G=(t,e,i)=>{let n=e||{};if(!r(n.behavior))throw TypeError(o("scrollIntoView","Element",n.behavior));D(t,n).forEach(([t,e])=>{x(t,e,i)})};function J(t){G(this,{block:t??!0?"start":"end",inline:"nearest"})}var I=t=>{if(O())return;let e=a(window.HTMLElement.prototype,"scrollIntoView",J);h("scrollIntoView",function(){let i=arguments,r=i[0];if(1===i.length&&$(r)){G(this,r,t);return}e.apply(this,i)})},F=t=>{O()||(v(t),P(t),k(t),I(t),U(t),T(t),L(t))}}),s("enQH9",function(e,i){t(e.exports,"Stack",()=>r);class r{constructor(t){this.max_size=t,this.arr=[]}push(t){this.arr.push(t),this.arr.length>this.max_size&&this.arr.shift()}get(){return this.arr}}}),s("41Mhf",function(e,i){t(e.exports,"with_query_params",()=>r);let r=(t,e)=>{let i="http://delete-me.com/",r=new URL(t,i);return Object.entries(e).forEach(([t,e])=>{null!=e&&r.searchParams.append(t,e)}),r.toString().replace(i,"")};console.assert("https://example.com/?a=b+c"===r("https://example.com/",{a:"b c"})),console.assert("https://example.com/?a=b+c"===r(new URL("https://example.com/"),{a:"b c"})),console.assert("https://example.com/?a=b+c&xx=123"===r(new URL("https://example.com/"),{a:"b c",asdf:null,xx:"123"})),console.assert("index.html?a=b+c"===r("index.html",{a:"b c"})),console.assert("index.html?x=123&a=b+c"===r("index.html?x=123",{a:"b c"})),console.assert("index.html?x=123&a=b+c#asdf"===r("index.html?x=123#asdf",{a:"b c"}))}),s("2ZZ1r",function(e,i){t(e.exports,"FilePicker",()=>g);var r=n("cNaMA"),s=n("exxBE"),o=n("2P6PH");n("kjWx8"),n("hiQgq");var a=n("lFzXt"),$=n("1xJnC"),O=n("aTIpG");let{autocompletion:l,completionKeymap:h}=a.autocomplete,c=h.find(t=>"Ctrl-Space"===t.key),f=h.find(t=>"Enter"===t.key);h.find(t=>"Escape"===t.key);let u=t=>{if(null!=t)return t;throw Error("Unexpected null value")},d=(t,e,i=!0)=>{t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e},selection:(0,a.EditorSelection).cursor(e.length),scrollIntoView:i})},p=!!window.plutoDesktop;p&&console.log("Running in Desktop Environment! Found following properties/methods:",window.plutoDesktop);let g=({value:t,suggest_new_file:e,button_label:i,placeholder:n,on_submit:o,on_desktop_submit:g,client:X,clear_on_blur:Q})=>{let[x,y]=(0,s.useState)(!0),[b,S]=(0,s.useState)(""),v=(0,s.useRef)(""),P=(0,s.useRef)(null),k=(0,s.useRef)(null),w=()=>{let t=k.current;null!=t&&(null!=e&&0===t.state.doc.length&&(d(t,e.base,!1),L()),window.dispatchEvent(new CustomEvent("collapse_cell_selection",{})))},U=async t=>await t(),T=()=>{let t=k.current;if(null!=t)return p||t.state.doc.toString()!==v.current?U(async()=>{try{p&&g?await g((await (0,$.guess_notebook_location)(b)).path_or_url):await o(t.state.doc.toString()),t.dom.blur()}catch(e){d(t,v.current,!0),t.dom.blur()}}):w(),!0},L=()=>{let t=k.current;if(null==t)return;let e=t.state.selection.main;if(e.from===e.to&&t.state.doc.length===e.to)return u(c).run(t)};return(0,s.useLayoutEffect)(()=>{let t=window.matchMedia("(prefers-color-scheme: dark)").matches,i=()=>(T(),!0);k.current=new a.EditorView({state:(0,a.EditorState).create({doc:"",extensions:[(0,a.drawSelection)(),(0,a.EditorView).domEventHandlers({focus:(t,i)=>(setTimeout(()=>{e?w():L()},0),!0)}),(0,a.EditorView).updateListener.of(t=>{t.docChanged&&y(0===t.state.doc.length)}),(0,a.EditorView).theme({"&":{fontSize:"inherit"},".cm-scroller":{fontFamily:"inherit",overflowY:"hidden",overflowX:"auto"}},{dark:t}),(0,a.history)(),l({activateOnTyping:!0,override:[m({suggest_new_file:e,client:X})],defaultKeymap:!1,maxRenderedOptions:512,optionClass:t=>t.type??""}),(0,a.EditorView).updateListener.of(t=>{t.transactions.forEach(e=>{null!=e.annotation(a.autocomplete.pickedCompletion)&&(t.view.dispatch({effects:(0,a.EditorView).scrollIntoView(t.state.doc.length),selection:(0,a.EditorSelection).cursor(t.state.doc.length)}),L())})}),(0,a.keymap).of([{key:"Enter",run:t=>u(f).run(t)},{key:"Enter",run:i},{key:"Ctrl-Enter",mac:"Cmd-Enter",run:i},{key:"Ctrl-Shift-Enter",mac:"Cmd-Shift-Enter",run:i},{key:"Tab",run:t=>u(f).run(t)?(L(),!0):L()}]),(0,a.keymap).of(h),(0,a.placeholder)(n),O.tab_help_plugin]})});let r=k.current;p||P.current.insertBefore(r.dom,P.current.firstElementChild)},[]),(0,s.useLayoutEffect)(()=>{v.current!=t&&null!=k.current&&(d(k.current,t,!0),v.current=t)}),p?(0,r.html)` + {S(t.target.value)}} + /> + + ${i} + + `:(0,r.html)` + {if(P.current?.matches(":focus-within")||P.current?.contains(t.relatedTarget))return;let e=k.current;null!=e&&Q&&requestAnimationFrame(()=>{e.hasFocus||d(e,v.current,!0)})}}> + ${i} + + `},m=({client:t,suggest_new_file:e})=>i=>{i.state.selection.main.to;let r=i.state.doc.toString();return t.send("completepath",{query:r}).then(t=>{let i=(r.split("/").pop()??"").split("\\").pop()??"",n=t.message.results,s=(0,o.utf8index_to_ut16index)(r,t.message.start),a=(0,o.utf8index_to_ut16index)(r,t.message.stop);if(n.length>=1&&n[0]==i)return null;let $=n.map(t=>{let e=t.endsWith("/")||t.endsWith("\\");return{label:t,type:e?"dir":"file",boost:e?1:0}});if(null!=e)for(let t=3;t>=0;t--){let e=".jl".substring(0,t);if(i.endsWith(e)){let e=i+".jl".substring(t);if(".jl"==e&&(e="notebook.jl"),3==t)return null;n.includes(e)||$.push({label:e+" (new)",apply:e,type:"file new",boost:-99});break}}return{options:$,from:s,to:a}})}}),s("2P6PH",function(e,i){t(e.exports,"utf8index_to_ut16index",()=>s),t(e.exports,"slice_utf8",()=>o);let r=new TextEncoder,n=new TextDecoder,s=(t,e)=>n.decode(r.encode(t).slice(0,e)).length,o=(t,e,i)=>{let s=r.encode(t);return n.decode(s.slice(e,i))};console.assert("e é hannes ❤ is a dog"===((t,e,i,s)=>{let o=r.encode(t),a=r.encode(s),$=new Uint8Array(o.length+a.length-(i-e));return $.set(o.slice(0,e),0),$.set(a,e),$.set(o.slice(i),e+a.length),n.decode($)})("e é \uD83D\uDC36 is a dog",5,9,"hannes ❤")),console.assert("\uD83D\uDC36"===o("e é \uD83D\uDC36 is a dog",5,9))}),s("kjWx8",function(e,i){t(e.exports,"is_mac_keyboard",()=>r),t(e.exports,"control_name",()=>n),t(e.exports,"ctrl_or_cmd_name",()=>s),t(e.exports,"alt_or_options_name",()=>o),t(e.exports,"and",()=>a),t(e.exports,"has_ctrl_or_cmd_pressed",()=>$),t(e.exports,"in_textarea_or_input",()=>O);let r=/Mac/i.test(navigator.userAgentData?.platform??navigator.platform),n=r?"⌃":"Ctrl",s=r?"⌘":"Ctrl",o=r?"⌥":"Alt",a=r?" ":"+",$=t=>t.ctrlKey||r&&t.metaKey,O=()=>{let t=document.activeElement?.closest("footer")!=null,e=document.activeElement?.closest("header")!=null,i=document.activeElement?.closest(".cm-editor")!=null,{tagName:r}=document.activeElement??{};return"INPUT"===r||"TEXTAREA"===r||t||e||i}}),s("hiQgq",function(e,i){t(e.exports,"EditorState",()=>n("lFzXt").EditorState),t(e.exports,"EditorSelection",()=>n("lFzXt").EditorSelection),t(e.exports,"Compartment",()=>n("lFzXt").Compartment),t(e.exports,"EditorView",()=>n("lFzXt").EditorView),t(e.exports,"placeholder",()=>n("lFzXt").placeholder),t(e.exports,"julia",()=>n("lFzXt").julia),t(e.exports,"keymap",()=>n("lFzXt").keymap),t(e.exports,"syntaxHighlighting",()=>n("lFzXt").syntaxHighlighting),t(e.exports,"history",()=>n("lFzXt").history),t(e.exports,"historyKeymap",()=>n("lFzXt").historyKeymap),t(e.exports,"defaultKeymap",()=>n("lFzXt").defaultKeymap),t(e.exports,"indentMore",()=>n("lFzXt").indentMore),t(e.exports,"indentLess",()=>n("lFzXt").indentLess),t(e.exports,"moveLineUp",()=>n("lFzXt").moveLineUp),t(e.exports,"moveLineDown",()=>n("lFzXt").moveLineDown),t(e.exports,"tags",()=>n("lFzXt").tags),t(e.exports,"HighlightStyle",()=>n("lFzXt").HighlightStyle),t(e.exports,"lineNumbers",()=>n("lFzXt").lineNumbers),t(e.exports,"highlightSpecialChars",()=>n("lFzXt").highlightSpecialChars),t(e.exports,"drawSelection",()=>n("lFzXt").drawSelection),t(e.exports,"indentOnInput",()=>n("lFzXt").indentOnInput),t(e.exports,"defaultHighlightStyle",()=>n("lFzXt").defaultHighlightStyle),t(e.exports,"closeBrackets",()=>n("lFzXt").closeBrackets),t(e.exports,"rectangularSelection",()=>n("lFzXt").rectangularSelection),t(e.exports,"highlightSelectionMatches",()=>n("lFzXt").highlightSelectionMatches),t(e.exports,"closeBracketsKeymap",()=>n("lFzXt").closeBracketsKeymap),t(e.exports,"foldKeymap",()=>n("lFzXt").foldKeymap),t(e.exports,"syntaxTree",()=>n("lFzXt").syntaxTree),t(e.exports,"Decoration",()=>n("lFzXt").Decoration),t(e.exports,"ViewPlugin",()=>n("lFzXt").ViewPlugin),t(e.exports,"WidgetType",()=>n("lFzXt").WidgetType),t(e.exports,"Facet",()=>n("lFzXt").Facet),t(e.exports,"StateField",()=>n("lFzXt").StateField),t(e.exports,"StateEffect",()=>n("lFzXt").StateEffect),t(e.exports,"indentUnit",()=>n("lFzXt").indentUnit),t(e.exports,"combineConfig",()=>n("lFzXt").combineConfig),t(e.exports,"NodeWeakMap",()=>n("lFzXt").NodeWeakMap),t(e.exports,"autocomplete",()=>n("lFzXt").autocomplete),t(e.exports,"html",()=>n("lFzXt").html),t(e.exports,"htmlLanguage",()=>n("lFzXt").htmlLanguage),t(e.exports,"javascriptLanguage",()=>n("lFzXt").javascriptLanguage),t(e.exports,"markdown",()=>n("lFzXt").markdown),t(e.exports,"markdownLanguage",()=>n("lFzXt").markdownLanguage),t(e.exports,"parseCode",()=>n("lFzXt").parseCode),t(e.exports,"parseMixed",()=>n("lFzXt").parseMixed),t(e.exports,"PostgreSQL",()=>n("lFzXt").PostgreSQL),t(e.exports,"pythonLanguage",()=>n("lFzXt").pythonLanguage),t(e.exports,"sql",()=>n("lFzXt").sql),t(e.exports,"javascript",()=>n("lFzXt").javascript),t(e.exports,"python",()=>n("lFzXt").python),t(e.exports,"cssLanguage",()=>n("lFzXt").cssLanguage),t(e.exports,"selectNextOccurrence",()=>n("lFzXt").selectNextOccurrence),t(e.exports,"setDiagnostics",()=>n("lFzXt").setDiagnostics),n("lFzXt")}),s("lFzXt",function(e,i){let r,s;t(e.exports,"EditorSelection",()=>I),t(e.exports,"Facet",()=>N),t(e.exports,"StateField",()=>tn),t(e.exports,"Compartment",()=>tO),t(e.exports,"StateEffect",()=>tS),t(e.exports,"EditorState",()=>t_),t(e.exports,"combineConfig",()=>tZ),t(e.exports,"WidgetType",()=>eF),t(e.exports,"Decoration",()=>eN),t(e.exports,"ViewPlugin",()=>iR),t(e.exports,"EditorView",()=>nr),t(e.exports,"keymap",()=>nh),t(e.exports,"drawSelection",()=>nv),t(e.exports,"highlightSpecialChars",()=>nY),t(e.exports,"placeholder",()=>nM),t(e.exports,"rectangularSelection",()=>nG),t(e.exports,"lineNumbers",()=>sb),t(e.exports,"NodeWeakMap",()=>sN),t(e.exports,"parseMixed",()=>s5),t(e.exports,"tags",()=>ok),t(e.exports,"syntaxTree",()=>oq),t(e.exports,"indentUnit",()=>oG),t(e.exports,"indentOnInput",()=>o7),t(e.exports,"foldKeymap",()=>a$),t(e.exports,"HighlightStyle",()=>ad),t(e.exports,"syntaxHighlighting",()=>aX),t(e.exports,"defaultHighlightStyle",()=>ax),t(e.exports,"history",()=>aG),t(e.exports,"historyKeymap",()=>a4),t(e.exports,"moveLineUp",()=>$V),t(e.exports,"moveLineDown",()=>$z),t(e.exports,"indentMore",()=>$G),t(e.exports,"indentLess",()=>$J),t(e.exports,"defaultKeymap",()=>$F),t(e.exports,"closeBrackets",()=>O2),t(e.exports,"closeBracketsKeymap",()=>lt),t(e.exports,"autocomplete",()=>lO),t(e.exports,"highlightSelectionMatches",()=>lS),t(e.exports,"selectNextOccurrence",()=>lL),t(e.exports,"setDiagnostics",()=>hO),t(e.exports,"julia",()=>cm),t(e.exports,"parseCode",()=>fh),t(e.exports,"cssLanguage",()=>ug),t(e.exports,"javascriptLanguage",()=>uz),t(e.exports,"javascript",()=>uI),t(e.exports,"htmlLanguage",()=>dc),t(e.exports,"html",()=>df),t(e.exports,"markdownLanguage",()=>db),t(e.exports,"markdown",()=>dZ),t(e.exports,"sql",()=>pt),t(e.exports,"PostgreSQL",()=>pi),t(e.exports,"pythonLanguage",()=>pT),t(e.exports,"python",()=>pL);var o,a,$,O,l,h,c,f,u,d,p=n("fnbc9");let g=[],m=[];function X(t){return t>=127462&&t<=127487}function Q(t,e,i){if(e==t.length)return e;e&&y(t.charCodeAt(e))&&b(t.charCodeAt(e-1))&&e--;let r=x(t,e);for(e+=S(r);e>1;if(t=m[r]))return!0;e=r+1}if(e==i)return!1}}(n))e+=S(n),r=n;else{if(!X(n))break;{let i=0,r=e-2;for(;r>=0&&X(x(t,r));)i++,r-=2;if(i%2==0)break;e+=2}}}return e}function x(t,e){let i=t.charCodeAt(e);if(!b(i)||e+1==t.length)return i;let r=t.charCodeAt(e+1);return y(r)?r-56320+(i-55296<<10)+65536:i}function y(t){return t>=56320&&t<57344}function b(t){return t>=55296&&t<56320}function S(t){return t<65536?1:2}(()=>{let t="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(t=>t?parseInt(t,36):1);for(let e=0,i=0;ethis.length)throw RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Z(this,t,e);let r=[];return this.decompose(0,t,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(e,this.length,r,1),k.from(r,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Z(this,t,e);let i=[];return this.decompose(t,e,i,0),k.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),r=new U(this),n=new U(t);for(let t=e,s=e;;){if(r.next(t),n.next(t),t=0,r.lineBreak!=n.lineBreak||r.done!=n.done||r.value!=n.value)return!1;if(s+=r.value.length,r.done||s>=i)return!0}}iter(t=1){return new U(this,t)}iterRange(t,e=this.length){return new T(this,t,e)}iterLines(t,e){let i;if(null==t)i=this.iter();else{null==e&&(e=this.lines+1);let r=this.line(t).from;i=this.iterRange(r,Math.max(r,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new L(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(0==t.length)throw RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new P(t):k.from(P.split(t,[])):v.empty}}class P extends v{constructor(t,e=function(t){let e=-1;for(let i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,r){for(let n=0;;n++){let s=this.text[n],o=r+s.length;if((e?i:o)>=t)return new _(r,o,i,s);r=o+1,i++}}decompose(t,e,i,r){let n=t<=0&&e>=this.length?this:new P(w(this.text,[""],t,e),Math.min(e,this.length)-Math.max(0,t));if(1&r){let t=i.pop(),e=w(n.text,t.text.slice(),0,n.length);if(e.length<=32)i.push(new P(e,t.length+n.length));else{let t=e.length>>1;i.push(new P(e.slice(0,t)),new P(e.slice(t)))}}else i.push(n)}replace(t,e,i){if(!(i instanceof P))return super.replace(t,e,i);[t,e]=Z(this,t,e);let r=w(this.text,w(i.text,w(this.text,[""],0,t)),e),n=this.length+i.length-(e-t);return r.length<=32?new P(r,n):k.from(P.split(r,[]),n)}sliceString(t,e=this.length,i="\n"){[t,e]=Z(this,t,e);let r="";for(let n=0,s=0;n<=e&&st&&s&&(r+=i),tn&&(r+=o.slice(Math.max(0,t-n),e-n)),n=a+1}return r}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],r=-1;for(let n of t)i.push(n),r+=n.length+1,32==i.length&&(e.push(new P(i,r)),i=[],r=-1);return r>-1&&e.push(new P(i,r)),e}}class k extends v{constructor(t,e){for(let i of(super(),this.children=t,this.length=e,this.lines=0,t))this.lines+=i.lines}lineInner(t,e,i,r){for(let n=0;;n++){let s=this.children[n],o=r+s.length,a=i+s.lines-1;if((e?a:o)>=t)return s.lineInner(t,e,i,r);r=o+1,i=a+1}}decompose(t,e,i,r){for(let n=0,s=0;s<=e&&n=s){let n=r&((s<=t?1:0)|(a>=e?2:0));s>=t&&a<=e&&!n?i.push(o):o.decompose(t-s,e-s,i,n)}s=a+1}}replace(t,e,i){if([t,e]=Z(this,t,e),i.lines=n&&e<=o){let a=s.replace(t-n,e-n,i),$=this.lines-s.lines+a.lines;if(a.lines<$>>4&&a.lines>$>>6){let n=this.children.slice();return n[r]=a,new k(n,this.length-(e-t)+i.length)}return super.replace(n,o,a)}n=o+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i="\n"){[t,e]=Z(this,t,e);let r="";for(let n=0,s=0;nt&&n&&(r+=i),ts&&(r+=o.sliceString(t-s,e-s,i)),s=a+1}return r}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof k))return 0;let i=0,[r,n,s,o]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;r+=e,n+=e){if(r==s||n==o)return i;let a=this.children[r],$=t.children[n];if(a!=$)return i+a.scanIdentical($,e);i+=a.length+1}}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let i=0;for(let e of t)i+=e.lines;if(i<32){let i=[];for(let e of t)e.flatten(i);return new P(i,e)}let r=Math.max(32,i>>5),n=r<<1,s=r>>1,o=[],a=0,$=-1,O=[];function l(){0!=a&&(o.push(1==O.length?O[0]:k.from(O,$)),$=-1,a=O.length=0)}for(let e of t)!function t(e){let i;if(e.lines>n&&e instanceof k)for(let i of e.children)t(i);else e.lines>s&&(a>s||!a)?(l(),o.push(e)):e instanceof P&&a&&(i=O[O.length-1])instanceof P&&e.lines+i.lines<=32?(a+=e.lines,$+=e.length+1,O[O.length-1]=new P(i.text.concat(e.text),i.length+1+e.length)):(a+e.lines>r&&l(),a+=e.lines,$+=e.length+1,O.push(e))}(e);return l(),1==o.length?o[0]:new k(o,e)}}function w(t,e,i=0,r=1e9){for(let n=0,s=0,o=!0;s=i&&($>r&&(a=a.slice(0,r-n)),n0?1:(t instanceof P?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],n=this.offsets[i],s=n>>1,o=r instanceof P?r.text.length:r.children.length;if(s==(e>0?o:0)){if(0==i)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&n)==(e>0?0:1)){if(this.offsets[i]+=e,0==t)return this.lineBreak=!0,this.value="\n",this;t--}else if(r instanceof P){let n=r.text[s+(e<0?-1:0)];if(this.offsets[i]+=e,n.length>Math.max(0,t))return this.value=0==t?n:e>0?n.slice(t):n.slice(0,n.length-t),this;t-=n.length}else{let n=r.children[s+(e<0?-1:0)];t>n.length?(t-=n.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(n),this.offsets.push(e>0?1:(n instanceof P?n.text.length:n.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class T{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new U(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:r}=this.cursor.next(t);return this.pos+=(r.length+t)*e,this.value=r.length<=i?r:e<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}}class L{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:r}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(v.prototype[Symbol.iterator]=function(){return this.iter()},U.prototype[Symbol.iterator]=T.prototype[Symbol.iterator]=L.prototype[Symbol.iterator]=function(){return this});let _=class{constructor(t,e,i,r){this.from=t,this.to=e,this.number=i,this.text=r}get length(){return this.to-this.from}};function Z(t,e,i){return[e=Math.max(0,Math.min(t.length,e)),Math.max(e,Math.min(t.length,i))]}function q(t,e,i=!0,r=!0){return function(t,e,i=!0,r=!0){return(i?Q:function(t,e,i){for(;e>0;){let r=Q(t,e-2,i);if(r=55296&&i<56320)||e+1==t.length)return i;let r=t.charCodeAt(e+1);return r>=56320&&r<57344?r-56320+(i-55296<<10)+65536:i}function W(t){return t<=65535?String.fromCharCode(t):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}function j(t){return t<65536?1:2}let K=/\r\n?|\n/;var Y=((o=Y||(Y={}))[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o);class V{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;et)return n+(t-r);n+=o}else{if(i!=Y.Simple&&$>=t&&(i==Y.TrackDel&&rt||i==Y.TrackBefore&&rt))return null;if($>t||$==t&&e<0&&!o)return t==r||e<0?n:n+a;n+=a}r=$}if(t>r)throw RangeError(`Position ${t} is out of range for changeset of length ${r}`);return n}touchesRange(t,e=t){for(let i=0,r=0;i=0&&r<=e&&n>=t)return!(re)||"cover";r=n}return!1}toString(){let t="";for(let e=0;e=0?":"+r:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(t=>"number"!=typeof t))throw RangeError("Invalid JSON representation of ChangeDesc");return new V(t)}static create(t){return new V(t)}}class z extends V{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw RangeError("Applying change set to a document with the wrong length");return A(this,(e,i,r,n,s)=>t=t.replace(r,r+(i-e),s),!1),t}mapDesc(t,e=!1){return M(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let r=0,n=0;r=0){e[r]=o,e[r+1]=s;let a=r>>1;for(;i.length0&&E(i,e,n.text),n.forward(t),o+=t}let $=t[s++];for(;o<$;){if(n.done)break t;let t=Math.min(n.len,$-o);C(e,t,-1),C(r,t,-1==n.ins?-1:0==n.off?n.ins:0),n.forward(t),o+=t}}return{changes:new z(e,i),filtered:V.create(r)}}toJSON(){let t=[];for(let e=0;e>1].toJSON()))}return t}static of(t,e,i){let r=[],n=[],s=0,o=null;function a(t=!1){if(!t&&!r.length)return;so||t<0||o>e)throw RangeError(`Invalid change range ${t} to ${o} (in doc of length ${e})`);let l=O?"string"==typeof O?v.of(O.split(i||K)):O:v.empty,h=l.length;if(t==o&&0==h)return;ts&&C(r,t-s,-1),C(r,o-t,h),E(n,r,l),s=o}}(t),a(!o),o}static empty(t){return new z(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let r=0;re&&"string"!=typeof t))throw RangeError("Invalid JSON representation of ChangeSet");if(1==n.length)e.push(n[0],0);else{for(;i.length=0&&i<=0&&i==t[n+1]?t[n]+=e:n>=0&&0==e&&0==t[n]?t[n+1]+=i:r?(t[n]+=e,t[n+1]+=i):t.push(e,i)}function E(t,e,i){if(0==i.length)return;let r=e.length-2>>1;if(r>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)a=t.sections[o++],$=t.sections[o++];e(n,O,s,l,h),n=O,s=l}}}function M(t,e,i,r=!1){let n=[],s=r?[]:null,o=new G(t),a=new G(e);for(let t=-1;;){if(o.done&&a.len||a.done&&o.len)throw Error("Mismatched change set lengths");if(-1==o.ins&&-1==a.ins){let t=Math.min(o.len,a.len);C(n,t,-1),o.forward(t),a.forward(t)}else if(a.ins>=0&&(o.ins<0||t==o.i||0==o.off&&(a.len=0&&t=0)){if(o.done&&a.done)return s?z.createSet(n,s):V.create(n);throw Error("Mismatched change set lengths")}{let e=0,i=o.len;for(;i;)if(-1==a.ins){let t=Math.min(i,a.len);e+=t,i-=t,a.forward(t)}else{if(!(0==a.ins&&a.lene||o.ins>=0&&o.len>e)&&(t||r.length>i),s.forward2(e),o.forward(e)}}else C(r,0,o.ins,t),n&&E(n,r,o.text),o.next()}}class G{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i>1;return e>=t.length?v.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?v.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class J{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let t=7&this.flags;return 7==t?null:t}get goalColumn(){let t=this.flags>>6;return 0xffffff==t?void 0:t}map(t,e=-1){let i,r;return this.empty?i=r=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),r=t.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new J(i,r,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return I.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return I.range(this.anchor,i)}eq(t,e=!1){return!(this.anchor!=t.anchor||this.head!=t.head||e&&this.empty&&this.assoc!=t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw RangeError("Invalid JSON representation for SelectionRange");return I.range(t.anchor,t.head)}static create(t,e,i){return new J(t,e,i)}}class I{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:I.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;it.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new I(t.ranges.map(t=>J.fromJSON(t)),t.main)}static single(t,e=t){return new I([I.range(t,e)],0)}static create(t,e=0){if(0==t.length)throw RangeError("A selection needs at least one range");for(let i=0,r=0;rt?8:0)|n)}static normalized(t,e=0){let i=t[e];t.sort((t,e)=>t.from-e.from),e=t.indexOf(i);for(let i=1;ir.head?I.range(o,s):I.range(s,o))}}return new I(t,e)}}function F(t,e){for(let i of t.ranges)if(i.to>e)throw RangeError("Selection points outside of document")}let B=0;class N{constructor(t,e,i,r,n){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=r,this.id=B++,this.default=t([]),this.extensions="function"==typeof n?n(this):n}get reader(){return this}static define(t={}){return new N(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:H),!!t.static,t.enables)}of(t){return new tt([],this,0,t)}compute(t,e){if(this.isStatic)throw Error("Can't compute a static facet");return new tt(t,this,1,e)}computeN(t,e){if(this.isStatic)throw Error("Can't compute a static facet");return new tt(t,this,2,e)}from(t,e){return e||(e=t=>t),this.compute([t],i=>e(i.field(t)))}}function H(t,e){return t==e||t.length==e.length&&t.every((t,i)=>t===e[i])}class tt{constructor(t,e,i,r){this.dependencies=t,this.facet=e,this.type=i,this.value=r,this.id=B++}dynamicSlot(t){var e;let i=this.value,r=this.facet.compareInput,n=this.id,s=t[n]>>1,o=2==this.type,a=!1,$=!1,O=[];for(let i of this.dependencies)"doc"==i?a=!0:"selection"==i?$=!0:1&(null!==(e=t[i.id])&&void 0!==e?e:1)||O.push(t[i.id]);return{create:t=>(t.values[s]=i(t),1),update(t,e){if(a&&e.docChanged||$&&(e.docChanged||e.selection)||ti(t,O)){let e=i(t);if(o?!te(e,t.values[s],r):!r(e,t.values[s]))return t.values[s]=e,1}return 0},reconfigure:(t,e)=>{let a,$=e.config.address[n];if(null!=$){let n=tf(e,$);if(this.dependencies.every(i=>i instanceof N?e.facet(i)===t.facet(i):!(i instanceof tn)||e.field(i,!1)==t.field(i,!1))||(o?te(a=i(t),n,r):r(a=i(t),n)))return t.values[s]=n,0}else a=i(t);return t.values[s]=a,1}}}}function te(t,e,i){if(t.length!=e.length)return!1;for(let r=0;rt===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(tr).find(t=>t.field==this);return((null==e?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:t=>(t.values[e]=this.create(t),1),update:(t,i)=>{let r=t.values[e],n=this.updateF(r,i);return this.compareF(r,n)?0:(t.values[e]=n,1)},reconfigure:(t,i)=>null!=i.config.address[this.id]?(t.values[e]=i.field(this),0):(t.values[e]=this.create(t),1)}}init(t){return[this,tr.of({field:this,create:t})]}get extension(){return this}}let ts={lowest:4,low:3,default:2,high:1,highest:0};function to(t){return e=>new t$(e,t)}let ta={highest:to(ts.highest),high:to(ts.high),default:to(ts.default),low:to(ts.low),lowest:to(ts.lowest)};class t${constructor(t,e){this.inner=t,this.prec=e}}class tO{of(t){return new tl(this,t)}reconfigure(t){return tO.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class tl{constructor(t,e){this.compartment=t,this.inner=e}}class th{constructor(t,e,i,r,n,s){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=r,this.staticValues=n,this.facets=s,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,i){let r,n,s=[],o=Object.create(null),a=new Map;for(let i of(r=[[],[],[],[],[]],n=new Map,function t(i,s){let o=n.get(i);if(null!=o){if(o<=s)return;let t=r[o].indexOf(i);t>-1&&r[o].splice(t,1),i instanceof tl&&a.delete(i.compartment)}if(n.set(i,s),Array.isArray(i))for(let e of i)t(e,s);else if(i instanceof tl){if(a.has(i.compartment))throw RangeError("Duplicate use of compartment in extensions");let r=e.get(i.compartment)||i.inner;a.set(i.compartment,r),t(r,s)}else if(i instanceof t$)t(i.inner,i.prec);else if(i instanceof tn)r[s].push(i),i.provides&&t(i.provides,s);else if(i instanceof tt)r[s].push(i),i.facet.extensions&&t(i.facet.extensions,ts.default);else{let e=i.extension;if(!e)throw Error(`Unrecognized extension value in extension set (${i}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);t(e,s)}}(t,ts.default),r.reduce((t,e)=>t.concat(e))))i instanceof tn?s.push(i):(o[i.facet.id]||(o[i.facet.id]=[])).push(i);let $=Object.create(null),O=[],l=[];for(let t of s)$[t.id]=l.length<<1,l.push(e=>t.slot(e));let h=null==i?void 0:i.config.facets;for(let t in o){let e=o[t],r=e[0].facet,n=h&&h[t]||[];if(e.every(t=>0==t.type)){if($[r.id]=O.length<<1|1,H(n,e))O.push(i.facet(r));else{let t=r.combine(e.map(t=>t.value));O.push(i&&r.compare(t,i.facet(r))?i.facet(r):t)}}else{for(let t of e)0==t.type?($[t.id]=O.length<<1|1,O.push(t.value)):($[t.id]=l.length<<1,l.push(e=>t.dynamicSlot(e)));$[r.id]=l.length<<1,l.push(t=>(function(t,e,i){let r=i.map(e=>t[e.id]),n=i.map(t=>t.type),s=r.filter(t=>!(1&t)),o=t[e.id]>>1;function a(t){let i=[];for(let e=0;et($)),$,O,o)}}function tc(t,e){if(1&e)return 2;let i=e>>1,r=t.status[i];if(4==r)throw Error("Cyclic dependency between fields and/or facets");if(2&r)return r;t.status[i]=4;let n=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|n}function tf(t,e){return 1&e?t.config.staticValues[e>>1]:t.values[e>>1]}let tu=N.define(),td=N.define({combine:t=>t.some(t=>t),static:!0}),tp=N.define({combine:t=>t.length?t[0]:void 0,static:!0}),tg=N.define(),tm=N.define(),tX=N.define(),tQ=N.define({combine:t=>!!t.length&&t[0]});class tx{constructor(t,e){this.type=t,this.value=e}static define(){return new ty}}class ty{of(t){return new tx(this,t)}}class tb{constructor(t){this.map=t}of(t){return new tS(this,t)}}class tS{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return void 0===e?void 0:e==this.value?this:new tS(this.type,e)}is(t){return this.type==t}static define(t={}){return new tb(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let r of t){let t=r.map(e);t&&i.push(t)}return i}}tS.reconfigure=tS.define(),tS.appendConfig=tS.define();class tv{constructor(t,e,i,r,n,s){this.startState=t,this.changes=e,this.selection=i,this.effects=r,this.annotations=n,this.scrollIntoView=s,this._doc=null,this._state=null,i&&F(i,e.newLength),n.some(t=>t.type==tv.time)||(this.annotations=n.concat(tv.time.of(Date.now())))}static create(t,e,i,r,n,s){return new tv(t,e,i,r,n,s)}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(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(tv.userEvent);return!(!e||!(e==t||e.length>t.length&&e.slice(0,t.length)==t&&"."==e[t.length]))}}function tP(t,e,i){var r;let n,s,o;return i?(n=e.changes,s=z.empty(e.changes.length),o=t.changes.compose(e.changes)):(n=e.changes.map(t.changes),s=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(n)),{changes:o,selection:e.selection?e.selection.map(s):null===(r=t.selection)||void 0===r?void 0:r.map(n),effects:tS.mapEffects(t.effects,n).concat(tS.mapEffects(e.effects,s)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function tk(t,e,i){let r=e.selection,n=tU(e.annotations);return e.userEvent&&(n=n.concat(tv.userEvent.of(e.userEvent))),{changes:e.changes instanceof z?e.changes:z.of(e.changes||[],i,t.facet(tp)),selection:r&&(r instanceof I?r:I.single(r.anchor,r.head)),effects:tU(e.effects),annotations:n,scrollIntoView:!!e.scrollIntoView}}tv.time=tx.define(),tv.userEvent=tx.define(),tv.addToHistory=tx.define(),tv.remote=tx.define();let tw=[];function tU(t){return null==t?tw:Array.isArray(t)?t:[t]}var tT=((a=tT||(tT={}))[a.Word=0]="Word",a[a.Space=1]="Space",a[a.Other=2]="Other",a);let tL=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{r=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(t){}class t_{constructor(t,e,i,r,n,s){this.config=t,this.doc=e,this.selection=i,this.values=r,this.status=t.statusTemplate.slice(),this.computeSlot=n,s&&(s._state=this);for(let t=0;t=0;n--){let s=i[n](t);s&&Object.keys(s).length&&(r=tP(r,tk(e,s,t.changes.newLength),!0))}return r==t?t:tv.create(e,t.changes,t.selection,r.effects,r.annotations,r.scrollIntoView)}(r?function(e){let i=e.startState,r=!0;for(let t of i.facet(tg)){let i=t(e);if(!1===i){r=!1;break}Array.isArray(i)&&(r=!0===r?i:function(t,e){let i=[];for(let r=0,n=0;;){let s,o;if(r=t[r]))s=t[r++],o=t[r++];else{if(!(n=0;r--){let s=n[r](e);e=s instanceof tv?s:Array.isArray(s)&&1==s.length&&s[0]instanceof tv?s[0]:t(i,tU(s),!1)}return e}(s):s)}(this,t,!0)}applyTransaction(t){let e,i=this.config,{base:r,compartments:n}=i;for(let e of t.effects)e.is(tO.reconfigure)?(i&&(n=new Map,i.compartments.forEach((t,e)=>n.set(e,t)),i=null),n.set(e.value.compartment,e.value.extension)):e.is(tS.reconfigure)?(i=null,r=e.value):e.is(tS.appendConfig)&&(i=null,r=tU(r).concat(e.value));e=i?t.startState.values.slice():new t_(i=th.resolve(r,n,this),this.doc,this.selection,i.dynamicSlots.map(()=>null),(t,e)=>e.reconfigure(t,this),null).values;let s=t.startState.facet(td)?t.newSelection:t.newSelection.asSingle();new t_(i,t.newDoc,s,e,(e,i)=>i.update(e,t),t)}replaceSelection(t){return"string"==typeof t&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:I.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),r=this.changes(i.changes),n=[i.range],s=tU(i.effects);for(let i=1;in.spec.fromJSON(s,t)))}}return t_.create({doc:t.doc,selection:I.fromJSON(t.selection),extensions:e.extensions?r.concat([e.extensions]):r})}static create(t={}){let e=th.resolve(t.extensions||[],new Map),i=t.doc instanceof v?t.doc:v.of((t.doc||"").split(e.staticFacet(t_.lineSeparator)||K)),r=t.selection?t.selection instanceof I?t.selection:I.single(t.selection.anchor,t.selection.head):I.single(0);return F(r,i.length),e.staticFacet(td)||(r=r.asSingle()),new t_(e,i,r,e.dynamicSlots.map(()=>null),(t,e)=>e.create(t),null)}get tabSize(){return this.facet(t_.tabSize)}get lineBreak(){return this.facet(t_.lineSeparator)||"\n"}get readOnly(){return this.facet(tQ)}phrase(t,...e){for(let e of this.facet(t_.phrases))if(Object.prototype.hasOwnProperty.call(e,t)){t=e[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(t,i)=>{if("$"==i)return"$";let r=+(i||1);return!r||r>e.length?t:e[r-1]})),t}languageDataAt(t,e,i=-1){let r=[];for(let n of this.facet(tu))for(let s of n(this,e,i))Object.prototype.hasOwnProperty.call(s,t)&&r.push(s[t]);return r}charCategorizer(t){var e;return e=this.languageDataAt("wordChars",t).join(""),t=>{if(!/\S/.test(t))return tT.Space;if(function(t){if(r)return r.test(t);for(let e=0;e""&&(i.toUpperCase()!=i.toLowerCase()||tL.test(i)))return!0}return!1}(t))return tT.Word;for(let i=0;i-1)return tT.Word;return tT.Other}}wordAt(t){let{text:e,from:i,length:r}=this.doc.lineAt(t),n=this.charCategorizer(t),s=t-i,o=t-i;for(;s>0;){let t=q(e,s,!1);if(n(e.slice(t,s))!=tT.Word)break;s=t}for(;ot.length?t[0]:4}),t_.lineSeparator=tp,t_.readOnly=tQ,t_.phrases=N.define({compare(t,e){let i=Object.keys(t),r=Object.keys(e);return i.length==r.length&&i.every(i=>t[i]==e[i])}}),t_.languageData=tu,t_.changeFilter=tg,t_.transactionFilter=tm,t_.transactionExtender=tX,tO.reconfigure=tS.define();class tq{eq(t){return this==t}range(t,e=t){return tR.create(t,e,this)}}tq.prototype.startSide=tq.prototype.endSide=0,tq.prototype.point=!1,tq.prototype.mapMode=Y.TrackDel;let tR=class t{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(e,i,r){return new t(e,i,r)}};function tW(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class tj{constructor(t,e,i,r){this.from=t,this.to=e,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,r=0){let n=i?this.to:this.from;for(let s=r,o=n.length;;){if(s==o)return s;let r=s+o>>1,a=n[r]-t||(i?this.value[r].endSide:this.value[r].startSide)-e;if(r==s)return a>=0?s:o;a>=0?o=r:s=r+1}}between(t,e,i,r){for(let n=this.findIndex(e,-1e9,!0),s=this.findIndex(i,1e9,!1,n);n(O=e.mapPos(c,l.endSide))||$==O&&l.startSide>0&&l.endSide<=0)continue;0>(O-$||l.endSide-l.startSide)||(s<0&&(s=$),l.point&&(o=Math.max(o,O-$)),i.push(l),r.push($-s),n.push(O-s))}return{mapped:i.length?new tj(r,n,i,o):null,pos:s}}}class tK{constructor(t,e,i,r){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=r}static create(t,e,i,r){return new tK(t,e,i,r)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:r=0,filterTo:n=this.length}=t,s=t.filter;if(0==e.length&&!s)return this;if(i&&(e=e.slice().sort(tW)),this.isEmpty)return e.length?tK.of(e):this;let o=new tz(this,null,-1).goto(0),a=0,$=[],O=new tY;for(;o.value||a=0){let t=e[a++];O.addInner(t.from,t.to,t.value)||$.push(t)}else 1==o.rangeIndex&&o.chunkIndex