diff --git a/apps/mobile/.gitignore b/apps/mobile/.gitignore index a21b48b9a..333c95067 100644 --- a/apps/mobile/.gitignore +++ b/apps/mobile/.gitignore @@ -34,8 +34,6 @@ build/ .gradle local.properties *.iml -web.bundle/ -web.bundle # node.js # node_modules/ diff --git a/apps/mobile/features.ts b/apps/mobile/features.ts index b6ad15003..d054cbb2a 100644 --- a/apps/mobile/features.ts +++ b/apps/mobile/features.ts @@ -3,7 +3,7 @@ import { FeatureType } from './src/components/sheets/new-feature'; export const features: FeatureType[] = [ { title: 'A brand new editor', - body: 'We have switched to a completely new editor for Notesnook. Why? Because we wanted something that was extensible and future proof so that we could build amazing features fast!' + body: 'We have switched to a completely new editor for Notesnook. Why? Because we wanted something that was extensible and future proof.' }, { title: 'Configurable toolbar', @@ -17,6 +17,10 @@ export const features: FeatureType[] = [ title: 'Task list', body: 'A new task list that keeps track of your progess and supports reordering items with drag & drop.' }, + { + title: 'Math support', + body: 'Inline and multi-line math support is here using KaTex.' + }, { title: 'Overhaul Settings UI', body: 'New Settings that are more organized and look miles better than before.' diff --git a/apps/mobile/tests.txt b/apps/mobile/tests.txt new file mode 100644 index 000000000..dc6d3c884 --- /dev/null +++ b/apps/mobile/tests.txt @@ -0,0 +1,11 @@ +1. Attach image from gallery +2. Attacah image from camera +3. Add a file +4. Logout +5. Login +6. Image download progress +7. Attachment download progress + +// Issues + +1. Attachment properties are not opening \ No newline at end of file diff --git a/apps/mobile/web.bundle/asset-manifest.json b/apps/mobile/web.bundle/asset-manifest.json new file mode 100644 index 000000000..1ffec42ef --- /dev/null +++ b/apps/mobile/web.bundle/asset-manifest.json @@ -0,0 +1,23 @@ +{ + "files": { + "static/js/0.5eeb08ce.chunk.js": "./static/js/0.5eeb08ce.chunk.js", + "main.css": "./static/css/main.f2465fba.chunk.css", + "main.js": "./static/js/main.f99b17c3.chunk.js", + "runtime-main.js": "./static/js/runtime-main.bd5c4477.js", + "static/css/3.c1694623.chunk.css": "./static/css/3.c1694623.chunk.css", + "static/js/3.d673b030.chunk.js": "./static/js/3.d673b030.chunk.js", + "static/js/4.932ef39d.chunk.js": "./static/js/4.932ef39d.chunk.js", + "static/js/5.ac8fa90a.chunk.js": "./static/js/5.ac8fa90a.chunk.js", + "index.html": "./index.html", + "static/js/3.d673b030.chunk.js.LICENSE.txt": "./static/js/3.d673b030.chunk.js.LICENSE.txt", + "static/media/katex.min.css": "./static/media/KaTeX_Typewriter-Regular.c5c02d76.ttf", + "static/media/fonts.css": "./static/media/hack-regular.fe74d490.woff2" + }, + "entrypoints": [ + "static/js/runtime-main.bd5c4477.js", + "static/css/3.c1694623.chunk.css", + "static/js/3.d673b030.chunk.js", + "static/css/main.f2465fba.chunk.css", + "static/js/main.f99b17c3.chunk.js" + ] +} \ No newline at end of file diff --git a/apps/mobile/web.bundle/favicon.ico b/apps/mobile/web.bundle/favicon.ico new file mode 100644 index 000000000..2994e3a2b Binary files /dev/null and b/apps/mobile/web.bundle/favicon.ico differ diff --git a/apps/mobile/web.bundle/fonts.css b/apps/mobile/web.bundle/fonts.css new file mode 100644 index 000000000..72cd4b88a --- /dev/null +++ b/apps/mobile/web.bundle/fonts.css @@ -0,0 +1,71 @@ +/* open-sans-regular - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: normal; + font-weight: 400; + src: local('Open Sans'), url(./fonts/OpenSans-Regular.ttf) format('truetype'); +} + +/* open-sans-italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: italic; + font-weight: 400; + src: local('Open Sans'), url(./fonts/OpenSans-Italic.ttf) format('truetype'); +} + +/* open-sans-600 - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: normal; + font-weight: 500; + src: local('Open Sans'), url(./fonts/OpenSans-Medium.ttf) format('truetype'); +} + +/* open-sans-600italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: italic; + font-weight: 500; + src: local('Open Sans'), url(./fonts/OpenSans-MediumItalic.ttf) format('truetype'); +} + +/* open-sans-600 - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: normal; + font-weight: 600; + src: local('Open Sans'), url(./fonts/OpenSans-SemiBold.ttf) format('truetype'); +} + +/* open-sans-600italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: italic; + font-weight: 600; + src: local('Open Sans'), url(./fonts/OpenSans-SemiBoldItalic.ttf) format('truetype'); +} + +/* open-sans-700 - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: normal; + font-weight: 700; + src: local('Open Sans'), url(./fonts/OpenSans-Bold.ttf) format('truetype'); +} + +/* open-sans-700italic - latin */ +@font-face { + font-family: 'Open Sans'; + font-display: swap; + font-style: italic; + font-weight: 700; + src: local('Open Sans'), url(./fonts/OpenSans-BoldItalic.ttf) format('truetype'); +} diff --git a/apps/mobile/web.bundle/fonts/OpenSans-Bold.ttf b/apps/mobile/web.bundle/fonts/OpenSans-Bold.ttf new file mode 100644 index 000000000..b379424ec Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-Bold.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-BoldItalic.ttf b/apps/mobile/web.bundle/fonts/OpenSans-BoldItalic.ttf new file mode 100644 index 000000000..0b0764c38 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-BoldItalic.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-Italic.ttf b/apps/mobile/web.bundle/fonts/OpenSans-Italic.ttf new file mode 100644 index 000000000..25def2ac3 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-Italic.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-Medium.ttf b/apps/mobile/web.bundle/fonts/OpenSans-Medium.ttf new file mode 100644 index 000000000..d9d5d82bb Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-Medium.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-MediumItalic.ttf b/apps/mobile/web.bundle/fonts/OpenSans-MediumItalic.ttf new file mode 100644 index 000000000..17def2546 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-MediumItalic.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-Regular.ttf b/apps/mobile/web.bundle/fonts/OpenSans-Regular.ttf new file mode 100644 index 000000000..472faab14 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-Regular.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-SemiBold.ttf b/apps/mobile/web.bundle/fonts/OpenSans-SemiBold.ttf new file mode 100644 index 000000000..2f7861c60 Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-SemiBold.ttf differ diff --git a/apps/mobile/web.bundle/fonts/OpenSans-SemiBoldItalic.ttf b/apps/mobile/web.bundle/fonts/OpenSans-SemiBoldItalic.ttf new file mode 100644 index 000000000..dcad0fcfd Binary files /dev/null and b/apps/mobile/web.bundle/fonts/OpenSans-SemiBoldItalic.ttf differ diff --git a/apps/mobile/web.bundle/index.html b/apps/mobile/web.bundle/index.html new file mode 100644 index 000000000..582b548bc --- /dev/null +++ b/apps/mobile/web.bundle/index.html @@ -0,0 +1 @@ +Notesnook editor
\ No newline at end of file diff --git a/apps/mobile/web.bundle/manifest.json b/apps/mobile/web.bundle/manifest.json new file mode 100644 index 000000000..1035ad7aa --- /dev/null +++ b/apps/mobile/web.bundle/manifest.json @@ -0,0 +1,15 @@ +{ + "short_name": "Notesnook editor", + "name": "Notesnook editor for mobile", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/apps/mobile/web.bundle/placeholder.svg b/apps/mobile/web.bundle/placeholder.svg new file mode 100644 index 000000000..ec79d8588 --- /dev/null +++ b/apps/mobile/web.bundle/placeholder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/apps/mobile/web.bundle/robots.txt b/apps/mobile/web.bundle/robots.txt new file mode 100644 index 000000000..e9e57dc4d --- /dev/null +++ b/apps/mobile/web.bundle/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/apps/mobile/web.bundle/static/css/3.c1694623.chunk.css b/apps/mobile/web.bundle/static/css/3.c1694623.chunk.css new file mode 100644 index 000000000..5716ceb36 --- /dev/null +++ b/apps/mobile/web.bundle/static/css/3.c1694623.chunk.css @@ -0,0 +1,5 @@ +@font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_AMS-Regular.73ea273a.woff2) format("woff2"),url(../../static/media/KaTeX_AMS-Regular.d562e886.woff) format("woff"),url(../../static/media/KaTeX_AMS-Regular.853be924.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Caligraphic-Bold.a1abf90d.woff2) format("woff2"),url(../../static/media/KaTeX_Caligraphic-Bold.d757c535.woff) format("woff"),url(../../static/media/KaTeX_Caligraphic-Bold.7489a2fb.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Caligraphic-Regular.d6484fce.woff2) format("woff2"),url(../../static/media/KaTeX_Caligraphic-Regular.db074fa2.woff) format("woff"),url(../../static/media/KaTeX_Caligraphic-Regular.7e873d38.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Fraktur-Bold.931d67ea.woff2) format("woff2"),url(../../static/media/KaTeX_Fraktur-Bold.354501ba.woff) format("woff"),url(../../static/media/KaTeX_Fraktur-Bold.4c761b37.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Fraktur-Regular.172d3529.woff2) format("woff2"),url(../../static/media/KaTeX_Fraktur-Regular.6fdf0ac5.woff) format("woff"),url(../../static/media/KaTeX_Fraktur-Regular.ed305b54.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_Main-Bold.39890742.woff2) format("woff2"),url(../../static/media/KaTeX_Main-Bold.0c3b8929.woff) format("woff"),url(../../static/media/KaTeX_Main-Bold.8169508b.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(../../static/media/KaTeX_Main-BoldItalic.20f389c4.woff2) format("woff2"),url(../../static/media/KaTeX_Main-BoldItalic.428978dc.woff) format("woff"),url(../../static/media/KaTeX_Main-BoldItalic.828abcb2.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_Main-Italic.fe2176f7.woff2) format("woff2"),url(../../static/media/KaTeX_Main-Italic.fd947498.woff) format("woff"),url(../../static/media/KaTeX_Main-Italic.fa675e5e.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Main-Regular.f650f111.woff2) format("woff2"),url(../../static/media/KaTeX_Main-Regular.4f35fbcc.woff) format("woff"),url(../../static/media/KaTeX_Main-Regular.9eba1d77.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(../../static/media/KaTeX_Math-BoldItalic.dcbcbd93.woff2) format("woff2"),url(../../static/media/KaTeX_Math-BoldItalic.3f07ed67.woff) format("woff"),url(../../static/media/KaTeX_Math-BoldItalic.bf2d440b.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_Math-Italic.6d3d25f4.woff2) format("woff2"),url(../../static/media/KaTeX_Math-Italic.96759856.woff) format("woff"),url(../../static/media/KaTeX_Math-Italic.8a5f9363.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(../../static/media/KaTeX_SansSerif-Bold.95591a92.woff2) format("woff2"),url(../../static/media/KaTeX_SansSerif-Bold.b9cd458a.woff) format("woff"),url(../../static/media/KaTeX_SansSerif-Bold.5b49f499.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(../../static/media/KaTeX_SansSerif-Italic.7d393d38.woff2) format("woff2"),url(../../static/media/KaTeX_SansSerif-Italic.8d593cfa.woff) format("woff"),url(../../static/media/KaTeX_SansSerif-Italic.b257a18c.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_SansSerif-Regular.cd5e231e.woff2) format("woff2"),url(../../static/media/KaTeX_SansSerif-Regular.02271ec5.woff) format("woff"),url(../../static/media/KaTeX_SansSerif-Regular.2f7bc363.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Script-Regular.c81d1b2a.woff2) format("woff2"),url(../../static/media/KaTeX_Script-Regular.073b3402.woff) format("woff"),url(../../static/media/KaTeX_Script-Regular.fc9ba524.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size1-Regular.6eec866c.woff2) format("woff2"),url(../../static/media/KaTeX_Size1-Regular.0108e89c.woff) format("woff"),url(../../static/media/KaTeX_Size1-Regular.6de7d4b5.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size2-Regular.2960900c.woff2) format("woff2"),url(../../static/media/KaTeX_Size2-Regular.3a99e70a.woff) format("woff"),url(../../static/media/KaTeX_Size2-Regular.57f5c183.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size3-Regular.e1951519.woff2) format("woff2"),url(../../static/media/KaTeX_Size3-Regular.7947224e.woff) format("woff"),url(../../static/media/KaTeX_Size3-Regular.8d6b6822.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Size4-Regular.e418bf25.woff2) format("woff2"),url(../../static/media/KaTeX_Size4-Regular.aeffd802.woff) format("woff"),url(../../static/media/KaTeX_Size4-Regular.4ad7c7e8.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(../../static/media/KaTeX_Typewriter-Regular.c295e7f7.woff2) format("woff2"),url(../../static/media/KaTeX_Typewriter-Regular.4c6b94fd.woff) format("woff"),url(../../static/media/KaTeX_Typewriter-Regular.c5c02d76.ttf) format("truetype")}.katex{text-rendering:auto;font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.0"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,"Andale Mono","Ubuntu Mono",monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#282a36}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#6272a4}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#ff79c6}.token.boolean,.token.number{color:#bd93f9}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#50fa7b}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#f1fa8c}.token.keyword{color:#8be9fd}.token.important,.token.regex{color:#ffb86c}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} +/*! + * Hack typeface https://github.com/source-foundry/Hack + * License: https://github.com/source-foundry/Hack/blob/master/LICENSE.md + */@font-face{font-family:"Hack";src:url(../../static/media/hack-regular.fe74d490.woff2) format("woff2"),url(../../static/media/hack-regular.5f578b55.woff) format("woff");font-weight:400;font-style:normal}@font-face{font-family:"Hack";src:url(../../static/media/hack-bold.295cc4d6.woff2) format("woff2"),url(../../static/media/hack-bold.924f36e9.woff) format("woff");font-weight:700;font-style:normal}@font-face{font-family:"Hack";src:url(../../static/media/hack-italic.6ea8f4c2.woff2) format("woff2"),url(../../static/media/hack-italic.9f7e0ced.woff) format("woff");font-weight:400;font-style:italic}@font-face{font-family:"Hack";src:url(../../static/media/hack-bolditalic.a6ae752b.woff2) format("woff2"),url(../../static/media/hack-bolditalic.f979444f.woff) format("woff");font-weight:700;font-style:italic}.ProseMirror p.is-editor-empty:first-child:before{color:var(--placeholder);content:attr(data-placeholder);float:left;height:0;pointer-events:none}.ProseMirror:first-child{margin-top:10px}.ProseMirror hr{background-color:var(--border);border-width:0;height:2px}.ProseMirror code:not(pre code){background-color:var(--bgSecondary);border:1px solid var(--border);border-radius:5px;padding:3px 5px 0;font-family:ui-monospace,SFMono-Regular,SF Mono,Consolas,Liberation Mono,Menlo,monospace!important;font-size:10pt!important}.ProseMirror li p{margin:0}.ProseMirror li{margin-bottom:5px}.ProseMirror a{color:var(--primary);cursor:pointer}.ProseMirror a:hover{-webkit-filter:brightness(70%);filter:brightness(70%)}.ProseMirror{position:relative;word-wrap:break-word;white-space:pre-wrap;white-space:break-spaces;-webkit-font-variant-ligatures:none;font-variant-ligatures:none;-webkit-font-feature-settings:"liga" 0,none;font-feature-settings:"liga" 0,none}.ProseMirror [contenteditable=false]{white-space:normal}.ProseMirror [contenteditable=false] [contenteditable=true],.ProseMirror pre{white-space:pre-wrap}img.ProseMirror-separator{display:inline!important;border:none!important;margin:0!important;width:1px!important;height:1px!important}.ProseMirror-gapcursor{display:none;pointer-events:none;position:absolute;margin:0}.ProseMirror-gapcursor:after{content:"";display:block;position:absolute;top:-2px;width:20px;border-top:1px solid var(--text);-webkit-animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite;animation:ProseMirror-cursor-blink 1.1s steps(2,start) infinite}@-webkit-keyframes ProseMirror-cursor-blink{to{visibility:hidden}}@keyframes ProseMirror-cursor-blink{to{visibility:hidden}}.ProseMirror-hideselection ::selection{background:transparent;color:var(--text)}.ProseMirror-hideselection ::-moz-selection{background:transparent;color:var(--text)}.ProseMirror-hideselection *{caret-color:transparent}.ProseMirror-focused .ProseMirror-gapcursor{display:block}.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}.ProseMirror li.node-taskItem{list-style-type:none}.ProseMirror table{border-collapse:collapse;margin:0;overflow:hidden;table-layout:fixed}.ProseMirror table td,.ProseMirror table th{border:1px solid var(--border);box-sizing:border-box;min-width:1em;padding:3px 5px;position:relative;vertical-align:top}.ProseMirror table td>*,.ProseMirror table th>*{margin-bottom:0}.ProseMirror table th{background-color:var(--bgSecondary);font-weight:700;text-align:left}.ProseMirror table .selectedCell:after{background:var(--primary);content:"";left:0;right:0;top:0;bottom:0;pointer-events:none;position:absolute;z-index:2;opacity:.2}.ProseMirror table .column-resize-handle{background-color:var(--primary);bottom:-2px;position:absolute;right:-2px;pointer-events:none;top:0;width:5px}.ProseMirror table p{margin:0}.tableWrapper{overflow-x:auto}.resize-cursor{cursor:ew-resize;cursor:col-resize}.drop-cursor{background-color:var(--text)!important}.search-result{background-color:var(--disabled)}.line-number-widget,.line-number:before{color:var(--codeFg);pointer-events:none;border-right:1px solid;margin-right:10px;padding-right:10px}.line-number:before{content:attr(data-line)}.line-number-widget.active,.line-number.active:before{color:var(--codeHighlight)}.line-number-widget.active:after,.line-number.active:after{content:" ";width:100%;position:absolute;left:0;pointer-events:none;background-color:var(--overlay)}pre::selection,pre ::selection{background-color:var(--codeSelection)!important;color:currentColor}.hide-scrollbar::-webkit-scrollbar{display:none}.ProseMirror blockquote{border-left:5px solid var(--border);padding-left:15px}@-webkit-keyframes blink{49%{border-color:unset}50%{border-color:#fff}99%{border-color:#fff}}@keyframes blink{49%{border-color:unset}50%{border-color:#fff}99%{border-color:#fff}}.no-cursor{caret-color:transparent}div:focus .fake-cursor,span:focus .fake-cursor{margin-right:-1px;border-left-width:1px;border-left-style:solid;-webkit-animation:blink 1s;animation:blink 1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;position:relative;z-index:1}.math-node{min-width:1em;min-height:1em;font-size:.95em;font-family:"Consolas","Ubuntu Mono",monospace;cursor:auto}.math-node.empty-math .math-render:before{content:"(empty)";color:red}.math-node .math-render.parse-error:before{content:"(math error)";color:red;cursor:help}.math-node.ProseMirror-selectednode{outline:none}.math-node .math-src{display:none;color:var(--text);tab-size:4}.math-node.ProseMirror-selectednode .math-src{display:inline}.math-node.ProseMirror-selectednode .math-render{display:none}.math-inline{display:inline;white-space:nowrap}.math-inline .math-render{display:inline-block;cursor:pointer}.math-inline .math-src .ProseMirror{display:inline;border-right:1px solid transparent;border-left:1px solid transparent;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace!important}.math-inline.ProseMirror-selectednode{background-color:var(--bgSecondary);padding:3px;border-radius:5px;border:1px solid var(--border)}.math-inline .math-src:after,.math-inline .math-src:before{content:"$$";color:var(--disabled)}.math-block,.math-block .math-render{display:block}.math-block.ProseMirror-selectednode{background-color:var(--bgSecondary);padding:10px;border-radius:5px;border:1px solid var(--border)}.math-block .math-src .ProseMirror{width:100%;display:block;margin-top:10px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace!important}.math-block .math-src:before{content:"Math";text-align:left;color:var(--disabled);margin-bottom:10px}.math-block .katex-display{margin:0} \ No newline at end of file diff --git a/apps/mobile/web.bundle/static/css/main.f2465fba.chunk.css b/apps/mobile/web.bundle/static/css/main.f2465fba.chunk.css new file mode 100644 index 000000000..1d4dc95a1 --- /dev/null +++ b/apps/mobile/web.bundle/static/css/main.f2465fba.chunk.css @@ -0,0 +1 @@ +body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}input:active,input:focus{outline:none}*{-webkit-tap-highlight-color:transparent}.App{flex:1 1}.ProseMirror:focus{outline:none}.ProseMirror p.is-editor-empty:first-child:before{color:#a9a9a9;content:attr(data-placeholder);float:left;height:0;pointer-events:none}.styles_btn__19MaA{background-color:var(--nn_nav)}.styles_btn__19MaA:active{background-color:var(--nn_transGray)}.styles_btn_header__2xGXR{width:40;height:40;background-color:transparent}.styles_btn_header__2xGXR:active{background-color:var(--nn_transGray)}.styles_titleBar__2hePW::-webkit-input-placeholder{color:var(--nn_placeholder)}.styles_titleBar__2hePW:-ms-input-placeholder{color:var(--nn_placeholder)}.styles_titleBar__2hePW::placeholder{color:var(--nn_placeholder)} \ No newline at end of file diff --git a/apps/mobile/web.bundle/static/js/0.5eeb08ce.chunk.js b/apps/mobile/web.bundle/static/js/0.5eeb08ce.chunk.js new file mode 100644 index 000000000..680c5cd46 --- /dev/null +++ b/apps/mobile/web.bundle/static/js/0.5eeb08ce.chunk.js @@ -0,0 +1 @@ +(this.webpackJsonptiptap=this.webpackJsonptiptap||[]).push([[0],{128:function(e,t,r){var n;"undefined"!==typeof self&&self,n=function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return Jn}});var r=function e(t,r){this.position=void 0;var n,a="KaTeX parse error: "+t,i=r&&r.loc;if(i&&i.start<=i.end){var o=i.lexer.input;n=i.start;var s=i.end;n===o.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var l=o.slice(n,s).replace(/[^]/g,"$&\u0332");a+=(n>15?"\u2026"+o.slice(n-15,n):o.slice(0,n))+l+(s+15":">","<":"<",'"':""","'":"'"},o=/[&><"']/g,s=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},l={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(o,(function(e){return i[e]}))},hyphenate:function(e){return e.replace(a,"-$1").toLowerCase()},getBaseElem:s,isCharacterBox:function(e){var t=s(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},h={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:function(e){return"#"+e}},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:function(e,t){return t.push(e),t}},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:function(e){return Math.max(0,e)},cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:function(e){return Math.max(0,e)},cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:function(e){return Math.max(0,e)},cli:"-e, --max-expand ",cliProcessor:function(e){return"Infinity"===e?1/0:parseInt(e)}},globalGroup:{type:"boolean",cli:!1}};function m(e){if(e.default)return e.default;var t=e.type,r=Array.isArray(t)?t[0]:t;if("string"!==typeof r)return r.enum[0];switch(r){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}var c=function(){function e(e){for(var t in this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},h)if(h.hasOwnProperty(t)){var r=h[t];this[t]=void 0!==e[t]?r.processor?r.processor(e[t]):e[t]:m(r)}}var t=e.prototype;return t.reportNonstrict=function(e,t,r){var a=this.strict;if("function"===typeof a&&(a=a(e,t,r)),a&&"ignore"!==a){if(!0===a||"error"===a)throw new n("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",r);"warn"===a?"undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+a+"': "+t+" ["+e+"]")}},t.useStrictBehavior=function(e,t,r){var n=this.strict;if("function"===typeof n)try{n=n(e,t,r)}catch(a){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!==typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]"),!1)))},t.isTrusted=function(e){e.url&&!e.protocol&&(e.protocol=l.protocolFromUrl(e.url));var t="function"===typeof this.trust?this.trust(e):this.trust;return Boolean(t)},e}(),u=function(){function e(e,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=r}var t=e.prototype;return t.sup=function(){return p[d[this.id]]},t.sub=function(){return p[f[this.id]]},t.fracNum=function(){return p[g[this.id]]},t.fracDen=function(){return p[v[this.id]]},t.cramp=function(){return p[b[this.id]]},t.text=function(){return p[y[this.id]]},t.isTight=function(){return this.size>=2},e}(),p=[new u(0,0,!1),new u(1,0,!0),new u(2,1,!1),new u(3,1,!0),new u(4,2,!1),new u(5,2,!0),new u(6,3,!1),new u(7,3,!0)],d=[4,5,4,5,6,7,6,7],f=[5,5,5,5,7,7,7,7],g=[2,3,4,5,6,7,6,7],v=[3,3,5,5,7,7,7,7],b=[1,1,3,3,5,5,7,7],y=[0,1,2,3,2,3,2,3],x={DISPLAY:p[0],TEXT:p[2],SCRIPT:p[4],SCRIPTSCRIPT:p[6]},w=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}],k=[];function S(e){for(var t=0;t=k[t]&&e<=k[t+1])return!0;return!1}w.forEach((function(e){return e.blocks.forEach((function(e){return k.push.apply(k,e)}))}));var M=80,z={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:"M40 281 V428 H0 V94 H40 V241 H400000 v40z\nM40 281 V428 H0 V94 H40 V241 H400000 v40z",leftmapsto:"M40 281 V448H0V74H40V241H400000v40z\nM40 281 V448H0V74H40V241H400000v40z",leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:"M0 50 h400000 v40H0z m0 194h40000v40H0z\nM0 50 h400000 v40H0z m0 194h40000v40H0z",midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:"M399960 241 V94 h40 V428 h-40 V281 H0 v-40z\nM399960 241 V94 h40 V428 h-40 V281 H0 v-40z",rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"},A=function(){function e(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){for(var e=document.createDocumentFragment(),t=0;t=5?0:e>=3?1:2]){var r=N[t]={cssEmPerMu:B.quad[t]/18};for(var n in B)B.hasOwnProperty(n)&&(r[n]=B[n][t])}return N[t]}(this.size)),this._fontMetrics},t.getColor=function(){return this.phantom?"transparent":this.color},e}();H.BASESIZE=6;var E=H,L={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},D={ex:!0,em:!0,mu:!0},P=function(e){return"string"!==typeof e&&(e=e.unit),e in L||e in D||"ex"===e},F=function(e,t){var r;if(e.unit in L)r=L[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)r=t.fontMetrics().cssEmPerMu;else{var a;if(a=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)r=a.fontMetrics().xHeight;else{if("em"!==e.unit)throw new n("Invalid unit: '"+e.unit+"'");r=a.fontMetrics().quad}a!==t&&(r*=a.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},V=function(e){return+e.toFixed(4)+"em"},G=function(e){return e.filter((function(e){return e})).join(" ")},U=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},Y=function(e){var t=document.createElement(e);for(var r in t.className=G(this.classes),this.style)this.style.hasOwnProperty(r)&&(t.style[r]=this.style[r]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var a=0;a"},W=function(){function e(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,U.call(this,e,r,n),this.children=t||[]}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){return Y.call(this,"span")},t.toMarkup=function(){return X.call(this,"span")},e}(),_=function(){function e(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,U.call(this,t,n),this.children=r||[],this.setAttribute("href",e)}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){return Y.call(this,"a")},t.toMarkup=function(){return X.call(this,"a")},e}(),j=function(){function e(e,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=r}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){var e=document.createElement("img");for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e},t.toMarkup=function(){var e=""+this.alt+"=a[0]&&e<=a[1])return r.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),/[\xee\xef\xed\xec]/.test(this.text)&&(this.text=$[this.text])}var t=e.prototype;return t.hasClass=function(e){return l.contains(this.classes,e)},t.toNode=function(){var e=document.createTextNode(this.text),t=null;for(var r in this.italic>0&&((t=document.createElement("span")).style.marginRight=V(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=G(this.classes)),this.style)this.style.hasOwnProperty(r)&&((t=t||document.createElement("span")).style[r]=this.style[r]);return t?(t.appendChild(e),t):e},t.toMarkup=function(){var e=!1,t="0&&(r+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(n)&&(r+=l.hyphenate(n)+":"+this.style[n]+";");r&&(e=!0,t+=' style="'+l.escape(r)+'"');var a=l.escape(this.text);return e?(t+=">",t+=a,t+=""):a},e}(),K=function(){function e(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var r=0;r":""},e}(),Q=function(){function e(e){this.attributes=void 0,this.attributes=e||{}}var t=e.prototype;return t.toNode=function(){var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e},t.toMarkup=function(){var e="","\\gt",!0),ie(oe,le,be,"\u2208","\\in",!0),ie(oe,le,be,"\ue020","\\@not"),ie(oe,le,be,"\u2282","\\subset",!0),ie(oe,le,be,"\u2283","\\supset",!0),ie(oe,le,be,"\u2286","\\subseteq",!0),ie(oe,le,be,"\u2287","\\supseteq",!0),ie(oe,he,be,"\u2288","\\nsubseteq",!0),ie(oe,he,be,"\u2289","\\nsupseteq",!0),ie(oe,le,be,"\u22a8","\\models"),ie(oe,le,be,"\u2190","\\leftarrow",!0),ie(oe,le,be,"\u2264","\\le"),ie(oe,le,be,"\u2264","\\leq",!0),ie(oe,le,be,"<","\\lt",!0),ie(oe,le,be,"\u2192","\\rightarrow",!0),ie(oe,le,be,"\u2192","\\to"),ie(oe,he,be,"\u2271","\\ngeq",!0),ie(oe,he,be,"\u2270","\\nleq",!0),ie(oe,le,ye,"\xa0","\\ "),ie(oe,le,ye,"\xa0","\\space"),ie(oe,le,ye,"\xa0","\\nobreakspace"),ie(se,le,ye,"\xa0","\\ "),ie(se,le,ye,"\xa0"," "),ie(se,le,ye,"\xa0","\\space"),ie(se,le,ye,"\xa0","\\nobreakspace"),ie(oe,le,ye,null,"\\nobreak"),ie(oe,le,ye,null,"\\allowbreak"),ie(oe,le,ve,",",","),ie(oe,le,ve,";",";"),ie(oe,he,ce,"\u22bc","\\barwedge",!0),ie(oe,he,ce,"\u22bb","\\veebar",!0),ie(oe,le,ce,"\u2299","\\odot",!0),ie(oe,le,ce,"\u2295","\\oplus",!0),ie(oe,le,ce,"\u2297","\\otimes",!0),ie(oe,le,xe,"\u2202","\\partial",!0),ie(oe,le,ce,"\u2298","\\oslash",!0),ie(oe,he,ce,"\u229a","\\circledcirc",!0),ie(oe,he,ce,"\u22a1","\\boxdot",!0),ie(oe,le,ce,"\u25b3","\\bigtriangleup"),ie(oe,le,ce,"\u25bd","\\bigtriangledown"),ie(oe,le,ce,"\u2020","\\dagger"),ie(oe,le,ce,"\u22c4","\\diamond"),ie(oe,le,ce,"\u22c6","\\star"),ie(oe,le,ce,"\u25c3","\\triangleleft"),ie(oe,le,ce,"\u25b9","\\triangleright"),ie(oe,le,ge,"{","\\{"),ie(se,le,xe,"{","\\{"),ie(se,le,xe,"{","\\textbraceleft"),ie(oe,le,ue,"}","\\}"),ie(se,le,xe,"}","\\}"),ie(se,le,xe,"}","\\textbraceright"),ie(oe,le,ge,"{","\\lbrace"),ie(oe,le,ue,"}","\\rbrace"),ie(oe,le,ge,"[","\\lbrack",!0),ie(se,le,xe,"[","\\lbrack",!0),ie(oe,le,ue,"]","\\rbrack",!0),ie(se,le,xe,"]","\\rbrack",!0),ie(oe,le,ge,"(","\\lparen",!0),ie(oe,le,ue,")","\\rparen",!0),ie(se,le,xe,"<","\\textless",!0),ie(se,le,xe,">","\\textgreater",!0),ie(oe,le,ge,"\u230a","\\lfloor",!0),ie(oe,le,ue,"\u230b","\\rfloor",!0),ie(oe,le,ge,"\u2308","\\lceil",!0),ie(oe,le,ue,"\u2309","\\rceil",!0),ie(oe,le,xe,"\\","\\backslash"),ie(oe,le,xe,"\u2223","|"),ie(oe,le,xe,"\u2223","\\vert"),ie(se,le,xe,"|","\\textbar",!0),ie(oe,le,xe,"\u2225","\\|"),ie(oe,le,xe,"\u2225","\\Vert"),ie(se,le,xe,"\u2225","\\textbardbl"),ie(se,le,xe,"~","\\textasciitilde"),ie(se,le,xe,"\\","\\textbackslash"),ie(se,le,xe,"^","\\textasciicircum"),ie(oe,le,be,"\u2191","\\uparrow",!0),ie(oe,le,be,"\u21d1","\\Uparrow",!0),ie(oe,le,be,"\u2193","\\downarrow",!0),ie(oe,le,be,"\u21d3","\\Downarrow",!0),ie(oe,le,be,"\u2195","\\updownarrow",!0),ie(oe,le,be,"\u21d5","\\Updownarrow",!0),ie(oe,le,fe,"\u2210","\\coprod"),ie(oe,le,fe,"\u22c1","\\bigvee"),ie(oe,le,fe,"\u22c0","\\bigwedge"),ie(oe,le,fe,"\u2a04","\\biguplus"),ie(oe,le,fe,"\u22c2","\\bigcap"),ie(oe,le,fe,"\u22c3","\\bigcup"),ie(oe,le,fe,"\u222b","\\int"),ie(oe,le,fe,"\u222b","\\intop"),ie(oe,le,fe,"\u222c","\\iint"),ie(oe,le,fe,"\u222d","\\iiint"),ie(oe,le,fe,"\u220f","\\prod"),ie(oe,le,fe,"\u2211","\\sum"),ie(oe,le,fe,"\u2a02","\\bigotimes"),ie(oe,le,fe,"\u2a01","\\bigoplus"),ie(oe,le,fe,"\u2a00","\\bigodot"),ie(oe,le,fe,"\u222e","\\oint"),ie(oe,le,fe,"\u222f","\\oiint"),ie(oe,le,fe,"\u2230","\\oiiint"),ie(oe,le,fe,"\u2a06","\\bigsqcup"),ie(oe,le,fe,"\u222b","\\smallint"),ie(se,le,pe,"\u2026","\\textellipsis"),ie(oe,le,pe,"\u2026","\\mathellipsis"),ie(se,le,pe,"\u2026","\\ldots",!0),ie(oe,le,pe,"\u2026","\\ldots",!0),ie(oe,le,pe,"\u22ef","\\@cdots",!0),ie(oe,le,pe,"\u22f1","\\ddots",!0),ie(oe,le,xe,"\u22ee","\\varvdots"),ie(oe,le,me,"\u02ca","\\acute"),ie(oe,le,me,"\u02cb","\\grave"),ie(oe,le,me,"\xa8","\\ddot"),ie(oe,le,me,"~","\\tilde"),ie(oe,le,me,"\u02c9","\\bar"),ie(oe,le,me,"\u02d8","\\breve"),ie(oe,le,me,"\u02c7","\\check"),ie(oe,le,me,"^","\\hat"),ie(oe,le,me,"\u20d7","\\vec"),ie(oe,le,me,"\u02d9","\\dot"),ie(oe,le,me,"\u02da","\\mathring"),ie(oe,le,de,"\ue131","\\@imath"),ie(oe,le,de,"\ue237","\\@jmath"),ie(oe,le,xe,"\u0131","\u0131"),ie(oe,le,xe,"\u0237","\u0237"),ie(se,le,xe,"\u0131","\\i",!0),ie(se,le,xe,"\u0237","\\j",!0),ie(se,le,xe,"\xdf","\\ss",!0),ie(se,le,xe,"\xe6","\\ae",!0),ie(se,le,xe,"\u0153","\\oe",!0),ie(se,le,xe,"\xf8","\\o",!0),ie(se,le,xe,"\xc6","\\AE",!0),ie(se,le,xe,"\u0152","\\OE",!0),ie(se,le,xe,"\xd8","\\O",!0),ie(se,le,me,"\u02ca","\\'"),ie(se,le,me,"\u02cb","\\`"),ie(se,le,me,"\u02c6","\\^"),ie(se,le,me,"\u02dc","\\~"),ie(se,le,me,"\u02c9","\\="),ie(se,le,me,"\u02d8","\\u"),ie(se,le,me,"\u02d9","\\."),ie(se,le,me,"\xb8","\\c"),ie(se,le,me,"\u02da","\\r"),ie(se,le,me,"\u02c7","\\v"),ie(se,le,me,"\xa8",'\\"'),ie(se,le,me,"\u02dd","\\H"),ie(se,le,me,"\u25ef","\\textcircled");var we={"--":!0,"---":!0,"``":!0,"''":!0};ie(se,le,xe,"\u2013","--",!0),ie(se,le,xe,"\u2013","\\textendash"),ie(se,le,xe,"\u2014","---",!0),ie(se,le,xe,"\u2014","\\textemdash"),ie(se,le,xe,"\u2018","`",!0),ie(se,le,xe,"\u2018","\\textquoteleft"),ie(se,le,xe,"\u2019","'",!0),ie(se,le,xe,"\u2019","\\textquoteright"),ie(se,le,xe,"\u201c","``",!0),ie(se,le,xe,"\u201c","\\textquotedblleft"),ie(se,le,xe,"\u201d","''",!0),ie(se,le,xe,"\u201d","\\textquotedblright"),ie(oe,le,xe,"\xb0","\\degree",!0),ie(se,le,xe,"\xb0","\\degree"),ie(se,le,xe,"\xb0","\\textdegree",!0),ie(oe,le,xe,"\xa3","\\pounds"),ie(oe,le,xe,"\xa3","\\mathsterling",!0),ie(se,le,xe,"\xa3","\\pounds"),ie(se,le,xe,"\xa3","\\textsterling",!0),ie(oe,he,xe,"\u2720","\\maltese"),ie(se,he,xe,"\u2720","\\maltese");for(var ke='0123456789/@."',Se=0;Set&&(t=i.height),i.depth>r&&(r=i.depth),i.maxFontSize>n&&(n=i.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=n},Xe=function(e,t,r,n){var a=new W(e,t,r,n);return Ye(a),a},We=function(e,t,r,n){return new W(e,t,r,n)},_e=function(e){var t=new A(e);return Ye(t),t},je=function(e,t,r){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}return n+"-"+("textbf"===t&&"textit"===r?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},$e={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Ze={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Ke={fontMap:$e,makeSymbol:Ge,mathsym:function(e,t,r,n){return void 0===n&&(n=[]),"boldsymbol"===r.font&&Ve(e,"Main-Bold",t).metrics?Ge(e,"Main-Bold",t,r,n.concat(["mathbf"])):"\\"===e||"main"===ae[t][e].font?Ge(e,"Main-Regular",t,r,n):Ge(e,"AMS-Regular",t,r,n.concat(["amsrm"]))},makeSpan:Xe,makeSvgSpan:We,makeLineSpan:function(e,t,r){var n=Xe([e],[],t);return n.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=V(n.height),n.maxFontSize=1,n},makeAnchor:function(e,t,r,n){var a=new _(e,t,r,n);return Ye(a),a},makeFragment:_e,wrapFragment:function(e,t){return e instanceof A?Xe([],[e],t):e},makeVList:function(e,t){for(var r=function(e){if("individualShift"===e.positionType){for(var t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth,a=n,i=1;i0&&(o.push(kt(s,t)),s=[]),o.push(a[l]));s.length>0&&o.push(kt(s,t)),r?((i=kt(ft(r,t,!0))).classes=["tag"],o.push(i)):n&&o.push(n);var m=mt(["katex-html"],o);if(m.setAttribute("aria-hidden","true"),i){var c=i.children[0];c.style.height=V(m.height+m.depth),m.depth&&(c.style.verticalAlign=V(-m.depth))}return m}function Mt(e){return new A(e)}var zt=function(){function e(e,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=r||[]}var t=e.prototype;return t.setAttribute=function(e,t){this.attributes[e]=t},t.getAttribute=function(e){return this.attributes[e]},t.toNode=function(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=G(this.classes));for(var r=0;r0&&(e+=' class ="'+l.escape(G(this.classes))+'"'),e+=">";for(var r=0;r"},t.toText=function(){return this.children.map((function(e){return e.toText()})).join("")},e}(),At=function(){function e(e){this.text=void 0,this.text=e}var t=e.prototype;return t.toNode=function(){return document.createTextNode(this.text)},t.toMarkup=function(){return l.escape(this.toText())},t.toText=function(){return this.text},e}(),Tt={MathNode:zt,TextNode:At,SpaceNode:function(){function e(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?"\u200a":e>=.1666&&e<=.1667?"\u2009":e>=.2222&&e<=.2223?"\u2005":e>=.2777&&e<=.2778?"\u2005\u200a":e>=-.05556&&e<=-.05555?"\u200a\u2063":e>=-.1667&&e<=-.1666?"\u2009\u2063":e>=-.2223&&e<=-.2222?"\u205f\u2063":e>=-.2778&&e<=-.2777?"\u2005\u2063":null}var t=e.prototype;return t.toNode=function(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",V(this.width)),e},t.toMarkup=function(){return this.character?""+this.character+"":''},t.toText=function(){return this.character?this.character:" "},e}(),newDocumentFragment:Mt},Bt=function(e,t,r){return!ae[t][e]||!ae[t][e].replace||55349===e.charCodeAt(0)||we.hasOwnProperty(e)&&r&&(r.fontFamily&&"tt"===r.fontFamily.substr(4,2)||r.font&&"tt"===r.font.substr(4,2))||(e=ae[t][e].replace),new Tt.TextNode(e)},Ct=function(e){return 1===e.length?e[0]:new Tt.MathNode("mrow",e)},qt=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var r=t.font;if(!r||"mathnormal"===r)return null;var n=e.mode;if("mathit"===r)return"italic";if("boldsymbol"===r)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===r)return"bold";if("mathbb"===r)return"double-struck";if("mathfrak"===r)return"fraktur";if("mathscr"===r||"mathcal"===r)return"script";if("mathsf"===r)return"sans-serif";if("mathtt"===r)return"monospace";var a=e.text;return l.contains(["\\imath","\\jmath"],a)?null:(ae[n][a]&&ae[n][a].replace&&(a=ae[n][a].replace),q(a,Ke.fontMap[r].fontName,n)?Ke.fontMap[r].variant:null)},Nt=function(e,t,r){if(1===e.length){var n=Rt(e[0],t);return r&&n instanceof zt&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var a,i=[],o=0;o0&&(p.text=p.text.slice(0,1)+"\u0338"+p.text.slice(1),i.pop())}}}i.push(s),a=s}return i},It=function(e,t,r){return Ct(Nt(e,t,r))},Rt=function(e,t){if(!e)return new Tt.MathNode("mrow");if(it[e.type])return it[e.type](e,t);throw new n("Got group of unknown type: '"+e.type+"'")};function Ot(e,t,r,n,a){var i,o=Nt(e,r);i=1===o.length&&o[0]instanceof zt&&l.contains(["mrow","mtable"],o[0].type)?o[0]:new Tt.MathNode("mrow",o);var s=new Tt.MathNode("annotation",[new Tt.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var h=new Tt.MathNode("semantics",[i,s]),m=new Tt.MathNode("math",[h]);m.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&m.setAttribute("display","block");var c=a?"katex":"katex-mathml";return Ke.makeSpan([c],[m])}var Ht=function(e){return new E({style:e.displayMode?x.DISPLAY:x.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Et=function(e,t){if(t.displayMode){var r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=Ke.makeSpan(r,[e])}return e},Lt={widehat:"^",widecheck:"\u02c7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23df",overbrace:"\u23de",overgroup:"\u23e0",undergroup:"\u23e1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21d2",xRightarrow:"\u21d2",overleftharpoon:"\u21bc",xleftharpoonup:"\u21bc",overrightharpoon:"\u21c0",xrightharpoonup:"\u21c0",xLeftarrow:"\u21d0",xLeftrightarrow:"\u21d4",xhookleftarrow:"\u21a9",xhookrightarrow:"\u21aa",xmapsto:"\u21a6",xrightharpoondown:"\u21c1",xleftharpoondown:"\u21bd",xrightleftharpoons:"\u21cc",xleftrightharpoons:"\u21cb",xtwoheadleftarrow:"\u219e",xtwoheadrightarrow:"\u21a0",xlongequal:"=",xtofrom:"\u21c4",xrightleftarrows:"\u21c4",xrightequilibrium:"\u21cc",xleftequilibrium:"\u21cb","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Dt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},Pt=function(e,t,r,n,a){var i,o=e.height+e.depth+r+n;if(/fbox|color|angl/.test(t)){if(i=Ke.makeSpan(["stretchy",t],[],a),"fbox"===t){var s=a.color&&a.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new Q({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Q({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var h=new K(l,{width:"100%",height:V(o)});i=Ke.makeSvgSpan([],[h],a)}return i.height=o,i.style.height=V(o),i},Ft=function(e){var t=new Tt.MathNode("mo",[new Tt.TextNode(Lt[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Vt=function(e,t){var r=function(){var r=4e5,n=e.label.substr(1);if(l.contains(["widehat","widecheck","widetilde","utilde"],n)){var a,i,o,s="ordgroup"===(d=e.base).type?d.body.length:1;if(s>5)"widehat"===n||"widecheck"===n?(a=420,r=2364,o=.42,i=n+"4"):(a=312,r=2340,o=.34,i="tilde4");else{var h=[1,1,2,2,3,3][s];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][h],a=[0,239,300,360,420][h],o=[0,.24,.3,.3,.36,.42][h],i=n+h):(r=[0,600,1033,2339,2340][h],a=[0,260,286,306,312][h],o=[0,.26,.286,.3,.306,.34][h],i="tilde"+h)}var m=new J(i),c=new K([m],{width:"100%",height:V(o),viewBox:"0 0 "+r+" "+a,preserveAspectRatio:"none"});return{span:Ke.makeSvgSpan([],[c],t),minWidth:0,height:o}}var u,p,d,f=[],g=Dt[n],v=g[0],b=g[1],y=g[2],x=y/1e3,w=v.length;if(1===w)u=["hide-tail"],p=[g[3]];else if(2===w)u=["halfarrow-left","halfarrow-right"],p=["xMinYMin","xMaxYMin"];else{if(3!==w)throw new Error("Correct katexImagesData or update code here to support\n "+w+" children.");u=["brace-left","brace-center","brace-right"],p=["xMinYMin","xMidYMin","xMaxYMin"]}for(var k=0;k0&&(n.style.minWidth=V(a)),n};function Gt(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function Ut(e){var t=Yt(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Yt(e){return e&&("atom"===e.type||re.hasOwnProperty(e.type))?e:null}var Xt=function(e,t){var r,n,a;e&&"supsub"===e.type?(r=(n=Gt(e.base,"accent")).base,e.base=r,a=function(e){if(e instanceof W)return e;throw new Error("Expected span but got "+String(e)+".")}(wt(e,t)),e.base=n):r=(n=Gt(e,"accent")).base;var i=wt(r,t.havingCrampedStyle()),o=0;if(n.isShifty&&l.isCharacterBox(r)){var s=l.getBaseElem(r);o=ee(wt(s,t.havingCrampedStyle())).skew}var h,m="\\c"===n.label,c=m?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight);if(n.isStretchy)h=Vt(n,t),h=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:o>0?{width:"calc(100% - "+V(2*o)+")",marginLeft:V(2*o)}:void 0}]},t);else{var u,p;"\\vec"===n.label?(u=Ke.staticSvg("vec",t),p=Ke.svgData.vec[1]):((u=ee(u=Ke.makeOrd({mode:n.mode,text:n.label},t,"textord"))).italic=0,p=u.width,m&&(c+=u.depth)),h=Ke.makeSpan(["accent-body"],[u]);var d="\\textcircled"===n.label;d&&(h.classes.push("accent-full"),c=i.height);var f=o;d||(f-=p/2),h.style.left=V(f),"\\textcircled"===n.label&&(h.style.top=".2em"),h=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-c},{type:"elem",elem:h}]},t)}var g=Ke.makeSpan(["mord","accent"],[h],t);return a?(a.children[0]=g,a.height=Math.max(g.height,a.height),a.classes[0]="mord",a):g},Wt=function(e,t){var r=e.isStretchy?Ft(e.label):new Tt.MathNode("mo",[Bt(e.label,e.mode)]),n=new Tt.MathNode("mover",[Rt(e.base,t),r]);return n.setAttribute("accent","true"),n},_t=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((function(e){return"\\"+e})).join("|"));ot({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:function(e,t){var r=lt(t[0]),n=!_t.test(e.funcName),a=!n||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:a,base:r}},htmlBuilder:Xt,mathmlBuilder:Wt}),ot({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:function(e,t){var r=t[0],n=e.parser.mode;return"math"===n&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:Xt,mathmlBuilder:Wt}),ot({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:a}},htmlBuilder:function(e,t){var r=wt(e.base,t),n=Vt(e,t),a="\\utilde"===e.label?.12:0,i=Ke.makeVList({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:a},{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord","accentunder"],[i],t)},mathmlBuilder:function(e,t){var r=Ft(e.label),n=new Tt.MathNode("munder",[Rt(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});var jt=function(e){var t=new Tt.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};ot({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler:function(e,t,r){var n=e.parser,a=e.funcName;return{type:"xArrow",mode:n.mode,label:a,body:t[0],below:r[0]}},htmlBuilder:function(e,t){var r,n=t.style,a=t.havingStyle(n.sup()),i=Ke.wrapFragment(wt(e.body,a,t),t),o="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(o+"-arrow-pad"),e.below&&(a=t.havingStyle(n.sub()),(r=Ke.wrapFragment(wt(e.below,a,t),t)).classes.push(o+"-arrow-pad"));var s,l=Vt(e,t),h=-t.fontMetrics().axisHeight+.5*l.height,m=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(m-=i.depth),r){var c=-t.fontMetrics().axisHeight+r.height+.5*l.height+.111;s=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:m},{type:"elem",elem:l,shift:h},{type:"elem",elem:r,shift:c}]},t)}else s=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:m},{type:"elem",elem:l,shift:h}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),Ke.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder:function(e,t){var r,n=Ft(e.label);if(n.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var a=jt(Rt(e.body,t));if(e.below){var i=jt(Rt(e.below,t));r=new Tt.MathNode("munderover",[n,i,a])}else r=new Tt.MathNode("mover",[n,a])}else if(e.below){var o=jt(Rt(e.below,t));r=new Tt.MathNode("munder",[n,o])}else r=jt(),r=new Tt.MathNode("mover",[n,r]);return r}});var $t={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Zt=function(e){return"textord"===e.type&&"@"===e.text};function Kt(e,t,r){var n=$t[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var a={type:"atom",text:n,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[t[0]],[]),r.callFunction("\\Big",[a],[]),r.callFunction("\\\\cdright",[t[1]],[])]};return r.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return r.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}}}ot({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder:function(e,t){var r=t.havingStyle(t.style.sup()),n=Ke.wrapFragment(wt(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=V(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mrow",[Rt(e.label,t)]);return(r=new Tt.MathNode("mpadded",[r])).setAttribute("width","0"),"left"===e.side&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),(r=new Tt.MathNode("mstyle",[r])).setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),ot({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler:function(e,t){return{type:"cdlabelparent",mode:e.parser.mode,fragment:t[0]}},htmlBuilder:function(e,t){var r=Ke.wrapFragment(wt(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder:function(e,t){return new Tt.MathNode("mrow",[Rt(e.fragment,t)])}}),ot({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){for(var r=e.parser,a=Gt(t[0],"ordgroup").body,i="",o=0;o=1114111)throw new n("\\@char with invalid code point "+i);return l<=65535?s=String.fromCharCode(l):(l-=65536,s=String.fromCharCode(55296+(l>>10),56320+(1023&l))),{type:"textord",mode:r.mode,text:s}}});var Jt=function(e,t){var r=ft(e.body,t.withColor(e.color),!1);return Ke.makeFragment(r)},Qt=function(e,t){var r=Nt(e.body,t.withColor(e.color)),n=new Tt.MathNode("mstyle",r);return n.setAttribute("mathcolor",e.color),n};ot({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler:function(e,t){var r=e.parser,n=Gt(t[0],"color-token").color,a=t[1];return{type:"color",mode:r.mode,color:n,body:ht(a)}},htmlBuilder:Jt,mathmlBuilder:Qt}),ot({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler:function(e,t){var r=e.parser,n=e.breakOnTokenText,a=Gt(t[0],"color-token").color;r.gullet.macros.set("\\current@color",a);var i=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:a,body:i}},htmlBuilder:Jt,mathmlBuilder:Qt}),ot({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler:function(e,t,r){var n=e.parser,a=r[0],i=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:i,size:a&&Gt(a,"size").value}},htmlBuilder:function(e,t){var r=Ke.makeSpan(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=V(F(e.size,t)))),r},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",V(F(e.size,t)))),r}});var er={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},tr=function(e){var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new n("Expected a control sequence",e);return t},rr=function(e,t,r,n){var a=e.gullet.macros.get(r.text);null==a&&(r.noexpand=!0,a={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,a,n)};ot({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler:function(e){var t=e.parser,r=e.funcName;t.consumeSpaces();var a=t.fetch();if(er[a.text])return"\\global"!==r&&"\\\\globallong"!==r||(a.text=er[a.text]),Gt(t.parseFunction(),"internal");throw new n("Invalid token after macro prefix",a)}}),ot({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,a=t.gullet.popToken(),i=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new n("Expected a control sequence",a);for(var o,s=0,l=[[]];"{"!==t.gullet.future().text;)if("#"===(a=t.gullet.popToken()).text){if("{"===t.gullet.future().text){o=t.gullet.future(),l[s].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new n('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==s+1)throw new n('Argument number "'+a.text+'" out of order');s++,l.push([])}else{if("EOF"===a.text)throw new n("Expected a macro definition");l[s].push(a.text)}var h=t.gullet.consumeArg().tokens;return o&&h.unshift(o),"\\edef"!==r&&"\\xdef"!==r||(h=t.gullet.expandTokens(h)).reverse(),t.gullet.macros.set(i,{tokens:h,numArgs:s,delimiters:l},r===er[r]),{type:"internal",mode:t.mode}}}),ot({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=tr(t.gullet.popToken());t.gullet.consumeSpaces();var a=function(e){var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t}(t);return rr(t,n,a,"\\\\globallet"===r),{type:"internal",mode:t.mode}}}),ot({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e){var t=e.parser,r=e.funcName,n=tr(t.gullet.popToken()),a=t.gullet.popToken(),i=t.gullet.popToken();return rr(t,n,i,"\\\\globalfuture"===r),t.gullet.pushToken(i),t.gullet.pushToken(a),{type:"internal",mode:t.mode}}});var nr=function(e,t,r){var n=q(ae.math[e]&&ae.math[e].replace||e,t,r);if(!n)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return n},ar=function(e,t,r,n){var a=r.havingBaseStyle(t),i=Ke.makeSpan(n.concat(a.sizingClasses(r)),[e],r),o=a.sizeMultiplier/r.sizeMultiplier;return i.height*=o,i.depth*=o,i.maxFontSize=a.sizeMultiplier,i},ir=function(e,t,r){var n=t.havingBaseStyle(r),a=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=V(a),e.height-=a,e.depth+=a},or=function(e,t,r,n,a,i){var o=function(e,t,r,n){return Ke.makeSymbol(e,"Size"+t+"-Regular",r,n)}(e,t,a,n),s=ar(Ke.makeSpan(["delimsizing","size"+t],[o],n),x.TEXT,n,i);return r&&ir(s,n,x.TEXT),s},sr=function(e,t,r){var n;return n="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Ke.makeSpan(["delimsizinginner",n],[Ke.makeSpan([],[Ke.makeSymbol(e,t,r)])])}},lr=function(e,t,r){var n=T["Size4-Regular"][e.charCodeAt(0)]?T["Size4-Regular"][e.charCodeAt(0)][4]:T["Size1-Regular"][e.charCodeAt(0)][4],a=new J("inner",function(e,t){switch(e){case"\u239c":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"\u2223":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"\u2225":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"\u239f":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"\u23a2":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"\u23a5":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"\u23aa":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"\u23d0":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"\u2016":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),i=new K([a],{width:V(n),height:V(t),style:"width:"+V(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),o=Ke.makeSvgSpan([],[i],r);return o.height=t,o.style.height=V(t),o.style.width=V(n),{type:"elem",elem:o}},hr={type:"kern",size:-.008},mr=["|","\\lvert","\\rvert","\\vert"],cr=["\\|","\\lVert","\\rVert","\\Vert"],ur=function(e,t,r,n,a,i){var o,s,h,m;o=h=m=e,s=null;var c="Size1-Regular";"\\uparrow"===e?h=m="\u23d0":"\\Uparrow"===e?h=m="\u2016":"\\downarrow"===e?o=h="\u23d0":"\\Downarrow"===e?o=h="\u2016":"\\updownarrow"===e?(o="\\uparrow",h="\u23d0",m="\\downarrow"):"\\Updownarrow"===e?(o="\\Uparrow",h="\u2016",m="\\Downarrow"):l.contains(mr,e)?h="\u2223":l.contains(cr,e)?h="\u2225":"["===e||"\\lbrack"===e?(o="\u23a1",h="\u23a2",m="\u23a3",c="Size4-Regular"):"]"===e||"\\rbrack"===e?(o="\u23a4",h="\u23a5",m="\u23a6",c="Size4-Regular"):"\\lfloor"===e||"\u230a"===e?(h=o="\u23a2",m="\u23a3",c="Size4-Regular"):"\\lceil"===e||"\u2308"===e?(o="\u23a1",h=m="\u23a2",c="Size4-Regular"):"\\rfloor"===e||"\u230b"===e?(h=o="\u23a5",m="\u23a6",c="Size4-Regular"):"\\rceil"===e||"\u2309"===e?(o="\u23a4",h=m="\u23a5",c="Size4-Regular"):"("===e||"\\lparen"===e?(o="\u239b",h="\u239c",m="\u239d",c="Size4-Regular"):")"===e||"\\rparen"===e?(o="\u239e",h="\u239f",m="\u23a0",c="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(o="\u23a7",s="\u23a8",m="\u23a9",h="\u23aa",c="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(o="\u23ab",s="\u23ac",m="\u23ad",h="\u23aa",c="Size4-Regular"):"\\lgroup"===e||"\u27ee"===e?(o="\u23a7",m="\u23a9",h="\u23aa",c="Size4-Regular"):"\\rgroup"===e||"\u27ef"===e?(o="\u23ab",m="\u23ad",h="\u23aa",c="Size4-Regular"):"\\lmoustache"===e||"\u23b0"===e?(o="\u23a7",m="\u23ad",h="\u23aa",c="Size4-Regular"):"\\rmoustache"!==e&&"\u23b1"!==e||(o="\u23ab",m="\u23a9",h="\u23aa",c="Size4-Regular");var u=nr(o,c,a),p=u.height+u.depth,d=nr(h,c,a),f=d.height+d.depth,g=nr(m,c,a),v=g.height+g.depth,b=0,y=1;if(null!==s){var w=nr(s,c,a);b=w.height+w.depth,y=2}var k=p+v+b,S=k+Math.max(0,Math.ceil((t-k)/(y*f)))*y*f,M=n.fontMetrics().axisHeight;r&&(M*=n.sizeMultiplier);var z=S/2-M,A=[];if(A.push(sr(m,c,a)),A.push(hr),null===s){var T=S-p-v+.016;A.push(lr(h,T,n))}else{var B=(S-p-v-b)/2+.016;A.push(lr(h,B,n)),A.push(hr),A.push(sr(s,c,a)),A.push(hr),A.push(lr(h,B,n))}A.push(hr),A.push(sr(o,c,a));var C=n.havingBaseStyle(x.TEXT),q=Ke.makeVList({positionType:"bottom",positionData:z,children:A},C);return ar(Ke.makeSpan(["delimsizing","mult"],[q],C),x.TEXT,n,i)},pr=.08,dr=function(e,t,r,n,a){var i=function(e,t,r){t*=1e3;var n="";switch(e){case"sqrtMain":n=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize1":n=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize2":n=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize3":n=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,M);break;case"sqrtSize4":n=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,M);break;case"sqrtTall":n=function(e,t,r){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(r-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,M,r)}return n}(e,n,r),o=new J(e,i),s=new K([o],{width:"400em",height:V(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return Ke.makeSvgSpan(["hide-tail"],[s],a)},fr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","\\surd"],gr=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1"],vr=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],br=[0,1.2,1.8,2.4,3],yr=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],xr=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"stack"}],wr=[{type:"small",style:x.SCRIPTSCRIPT},{type:"small",style:x.SCRIPT},{type:"small",style:x.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],kr=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Sr=function(e,t,r,n){for(var a=Math.min(2,3-n.style.size);at)return r[a]}return r[r.length-1]},Mr=function(e,t,r,n,a,i){var o;"<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),o=l.contains(vr,e)?yr:l.contains(fr,e)?wr:xr;var s=Sr(e,t,o,n);return"small"===s.type?function(e,t,r,n,a,i){var o=Ke.makeSymbol(e,"Main-Regular",a,n),s=ar(o,t,n,i);return r&&ir(s,n,t),s}(e,s.style,r,n,a,i):"large"===s.type?or(e,s.size,r,n,a,i):ur(e,t,r,n,a,i)},zr={sqrtImage:function(e,t){var r,n,a=t.havingBaseSizing(),i=Sr("\\surd",e*a.sizeMultiplier,wr,a),o=a.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,h=0,m=0;return"small"===i.type?(e<1?o=1:e<1.4&&(o=.7),h=(1+s)/o,(r=dr("sqrtMain",l=(1+s+pr)/o,m=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",n=.833/o):"large"===i.type?(m=1080*br[i.size],h=(br[i.size]+s)/o,l=(br[i.size]+s+pr)/o,(r=dr("sqrtSize"+i.size,l,m,s,t)).style.minWidth="1.02em",n=1/o):(l=e+s+pr,h=e+s,m=Math.floor(1e3*e+s)+80,(r=dr("sqrtTall",l,m,s,t)).style.minWidth="0.742em",n=1.056),r.height=h,r.style.height=V(l),{span:r,advanceWidth:n,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*o}},sizedDelim:function(e,t,r,a,i){if("<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),l.contains(fr,e)||l.contains(vr,e))return or(e,t,!1,r,a,i);if(l.contains(gr,e))return ur(e,br[t],!1,r,a,i);throw new n("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:br,customSizedDelim:Mr,leftRightDelim:function(e,t,r,n,a,i){var o=n.fontMetrics().axisHeight*n.sizeMultiplier,s=5/n.fontMetrics().ptPerEm,l=Math.max(t-o,r+o),h=Math.max(l/500*901,2*l-s);return Mr(e,h,!0,n,a,i)}},Ar={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Tr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27e8","\\rangle","\u27e9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Br(e,t){var r=Yt(e);if(r&&l.contains(Tr,r.text))return r;throw new n(r?"Invalid delimiter '"+r.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Cr(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}ot({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:function(e,t){var r=Br(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:Ar[e.funcName].size,mclass:Ar[e.funcName].mclass,delim:r.text}},htmlBuilder:function(e,t){return"."===e.delim?Ke.makeSpan([e.mclass]):zr.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass])},mathmlBuilder:function(e){var t=[];"."!==e.delim&&t.push(Bt(e.delim,e.mode));var r=new Tt.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");var n=V(zr.sizeToMaxHeight[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}}),ot({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=e.parser.gullet.macros.get("\\current@color");if(r&&"string"!==typeof r)throw new n("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Br(t[0],e).text,color:r}}}),ot({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:function(e,t){var r=Br(t[0],e),n=e.parser;++n.leftrightDepth;var a=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);var i=Gt(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:a,left:r.text,right:i.delim,rightColor:i.color}},htmlBuilder:function(e,t){Cr(e);for(var r,n,a=ft(e.body,t,!0,["mopen","mclose"]),i=0,o=0,s=!1,l=0;l-1?"mpadded":"menclose",[Rt(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===e.label){var a=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+a+"em solid "+String(e.borderColor))}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};ot({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler:function(e,t,r){var n=e.parser,a=e.funcName,i=Gt(t[0],"color-token").color,o=t[1];return{type:"enclose",mode:n.mode,label:a,backgroundColor:i,body:o}},htmlBuilder:qr,mathmlBuilder:Nr}),ot({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler:function(e,t,r){var n=e.parser,a=e.funcName,i=Gt(t[0],"color-token").color,o=Gt(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:n.mode,label:a,backgroundColor:o,borderColor:i,body:s}},htmlBuilder:qr,mathmlBuilder:Nr}),ot({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler:function(e,t){return{type:"enclose",mode:e.parser.mode,label:"\\fbox",body:t[0]}}}),ot({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"enclose",mode:r.mode,label:n,body:a}},htmlBuilder:qr,mathmlBuilder:Nr}),ot({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler:function(e,t){return{type:"enclose",mode:e.parser.mode,label:"\\angl",body:t[0]}}});var Ir={};function Rr(e){for(var t=e.type,r=e.names,n=e.props,a=e.handler,i=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:a},l=0;l1||!c)&&g.pop(),b.length0&&(y+=.25),m.push({pos:y,isDashed:e[t]})}for(w(o[0]),r=0;r0&&(M<(B+=b)&&(M=B),B=0),e.addJot&&(M+=f),z.height=S,z.depth=M,y+=S,z.pos=y,y+=M+B,h[r]=z,w(o[r+1])}var C,q,N=y/2+t.fontMetrics().axisHeight,I=e.cols||[],R=[],O=[];if(e.tags&&e.tags.some((function(e){return e})))for(r=0;r=s)){var W=void 0;(a>0||e.hskipBeforeAndAfter)&&0!==(W=l.deflt(P.pregap,p))&&((C=Ke.makeSpan(["arraycolsep"],[])).style.width=V(W),R.push(C));var _=[];for(r=0;r0){for(var K=Ke.makeLineSpan("hline",t,c),J=Ke.makeLineSpan("hdashline",t,c),Q=[{type:"elem",elem:h,shift:0}];m.length>0;){var ee=m.pop(),te=ee.pos-N;ee.isDashed?Q.push({type:"elem",elem:J,shift:te}):Q.push({type:"elem",elem:K,shift:te})}h=Ke.makeVList({positionType:"individualShift",children:Q},t)}if(0===O.length)return Ke.makeSpan(["mord"],[h],t);var re=Ke.makeVList({positionType:"individualShift",children:O},t);return re=Ke.makeSpan(["tag"],[re],t),Ke.makeFragment([h,re])},Yr={c:"center ",l:"left ",r:"right "},Xr=function(e,t){for(var r=[],n=new Tt.MathNode("mtd",[],["mtr-glue"]),a=new Tt.MathNode("mtd",[],["mml-eqn-num"]),i=0;i0){var p=e.cols,d="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(c+="top ",g=1),"separator"===p[p.length-1].type&&(c+="bottom ",v-=1);for(var b=g;b0?"left ":"",c+=S[S.length-1].length>0?"right ":"";for(var M=1;M-1?"alignat":"align",o="split"===e.envName,s=Vr(e.parser,{cols:a,addJot:!0,autoTag:o?void 0:Fr(e.envName),emptySingleRow:!0,colSeparationType:i,maxNumCols:o?2:void 0,leqno:e.parser.settings.leqno},"display"),l=0,h={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var m="",c=0;c0&&u&&(f=1),a[p]={type:"align",align:d,pregap:f,postgap:0}}return s.colSeparationType=u?"align":"alignat",s};Rr({type:"array",names:["array","darray"],props:{numArgs:1},handler:function(e,t){var r=(Yt(t[0])?[t[0]]:Gt(t[0],"ordgroup").body).map((function(e){var t=Ut(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new n("Unknown column alignment: "+t,e)})),a={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return Vr(e.parser,a,Gr(e.envName))},htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler:function(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],r="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===e.envName.charAt(e.envName.length-1)){var i=e.parser;if(i.consumeSpaces(),"["===i.fetch().text){if(i.consume(),i.consumeSpaces(),r=i.fetch().text,-1==="lcr".indexOf(r))throw new n("Expected l or c or r",i.nextToken);i.consume(),i.consumeSpaces(),i.expect("]"),i.consume(),a.cols=[{type:"align",align:r}]}}var o=Vr(e.parser,a,Gr(e.envName)),s=Math.max.apply(Math,[0].concat(o.body.map((function(e){return e.length}))));return o.cols=new Array(s).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[o],left:t[0],right:t[1],rightColor:void 0}:o},htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["smallmatrix"],props:{numArgs:0},handler:function(e){var t=Vr(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["subarray"],props:{numArgs:1},handler:function(e,t){var r=(Yt(t[0])?[t[0]]:Gt(t[0],"ordgroup").body).map((function(e){var t=Ut(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new n("Unknown column alignment: "+t,e)}));if(r.length>1)throw new n("{subarray} can contain only one column");var a={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5};if((a=Vr(e.parser,a,"script")).body.length>0&&a.body[0].length>1)throw new n("{subarray} can contain only one column");return a},htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler:function(e){var t=Vr(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},Gr(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:Wr,htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler:function(e){l.contains(["gather","gather*"],e.envName)&&Pr(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:Fr(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return Vr(e.parser,t,"display")},htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:Wr,htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["equation","equation*"],props:{numArgs:0},handler:function(e){Pr(e);var t={autoTag:Fr(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return Vr(e.parser,t,"display")},htmlBuilder:Ur,mathmlBuilder:Xr}),Rr({type:"array",names:["CD"],props:{numArgs:0},handler:function(e){return Pr(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var r=e.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===t[t.length-1].length&&t.pop();break}throw new n("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var a,i,o=[],s=[o],l=0;l-1);else{if(!("<>AV".indexOf(u)>-1))throw new n('Expected one of "<>AV=|." after @',h[c]);for(var d=0;d<2;d++){for(var f=!0,g=c+1;g=x.SCRIPT.id?r.text():x.DISPLAY:"text"===e&&r.size===x.DISPLAY.size?r=x.TEXT:"script"===e?r=x.SCRIPT:"scriptscript"===e&&(r=x.SCRIPTSCRIPT),r},rn=function(e,t){var r,n=tn(e.size,t.style),a=n.fracNum(),i=n.fracDen();r=t.havingStyle(a);var o=wt(e.numer,r,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;o.height=o.height0?3*c:7*c,d=t.fontMetrics().denom1):(m>0?(u=t.fontMetrics().num2,p=c):(u=t.fontMetrics().num3,p=3*c),d=t.fontMetrics().denom2),h){var w=t.fontMetrics().axisHeight;u-o.depth-(w+.5*m)0&&(t="."===(t=e)?null:t),t};ot({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler:function(e,t){var r,n=e.parser,a=t[4],i=t[5],o=lt(t[0]),s="atom"===o.type&&"open"===o.family?on(o.text):null,l=lt(t[1]),h="atom"===l.type&&"close"===l.family?on(l.text):null,m=Gt(t[2],"size"),c=null;r=!!m.isBlank||(c=m.value).number>0;var u="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var d=Gt(p.body[0],"textord");u=an[Number(d.text)]}}else p=Gt(p,"textord"),u=an[Number(p.text)];return{type:"genfrac",mode:n.mode,numer:a,denom:i,continued:!1,hasBarLine:r,barSize:c,leftDelim:s,rightDelim:h,size:u}},htmlBuilder:rn,mathmlBuilder:nn}),ot({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler:function(e,t){var r=e.parser,n=(e.funcName,e.token);return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:Gt(t[0],"size").value,token:n}}}),ot({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:function(e,t){var r=e.parser,n=(e.funcName,t[0]),a=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(Gt(t[1],"infix").size),i=t[2],o=a.number>0;return{type:"genfrac",mode:r.mode,numer:n,denom:i,continued:!1,hasBarLine:o,barSize:a,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:rn,mathmlBuilder:nn});var sn=function(e,t){var r,n,a=t.style;"supsub"===e.type?(r=e.sup?wt(e.sup,t.havingStyle(a.sup()),t):wt(e.sub,t.havingStyle(a.sub()),t),n=Gt(e.base,"horizBrace")):n=Gt(e,"horizBrace");var i,o=wt(n.base,t.havingBaseStyle(x.DISPLAY)),s=Vt(n,t);if(n.isOver?(i=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=Ke.makeVList({positionType:"bottom",positionData:o.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},t)).children[0].children[0].children[0].classes.push("svg-align"),r){var l=Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t);i=n.isOver?Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:r}]},t):Ke.makeVList({positionType:"bottom",positionData:l.depth+.2+r.height+r.depth,children:[{type:"elem",elem:r},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return Ke.makeSpan(["mord",n.isOver?"mover":"munder"],[i],t)};ot({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler:function(e,t){var r=e.parser,n=e.funcName;return{type:"horizBrace",mode:r.mode,label:n,isOver:/^\\over/.test(n),base:t[0]}},htmlBuilder:sn,mathmlBuilder:function(e,t){var r=Ft(e.label);return new Tt.MathNode(e.isOver?"mover":"munder",[Rt(e.base,t),r])}}),ot({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=t[1],a=Gt(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:a})?{type:"href",mode:r.mode,href:a,body:ht(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:function(e,t){var r=ft(e.body,t,!1);return Ke.makeAnchor(e.href,[],r,t)},mathmlBuilder:function(e,t){var r=It(e.body,t);return r instanceof zt||(r=new zt("mrow",[r])),r.setAttribute("href",e.href),r}}),ot({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:function(e,t){var r=e.parser,n=Gt(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");for(var a=[],i=0;i0&&(n=F(e.totalheight,t)-r);var a=0;e.width.number>0&&(a=F(e.width,t));var i={height:V(r+n)};a>0&&(i.width=V(a)),n>0&&(i.verticalAlign=V(-n));var o=new j(e.src,e.alt,i);return o.height=r,o.depth=n,o},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mglyph",[]);r.setAttribute("alt",e.alt);var n=F(e.height,t),a=0;if(e.totalheight.number>0&&(a=F(e.totalheight,t)-n,r.setAttribute("valign",V(-a))),r.setAttribute("height",V(n+a)),e.width.number>0){var i=F(e.width,t);r.setAttribute("width",V(i))}return r.setAttribute("src",e.src),r}}),ot({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=Gt(t[0],"size");if(r.settings.strict){var i="m"===n[1],o="mu"===a.value.unit;i?(o||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+a.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):o&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:a.value}},htmlBuilder:function(e,t){return Ke.makeGlue(e.dimension,t)},mathmlBuilder:function(e,t){var r=F(e.dimension,t);return new Tt.SpaceNode(r)}}),ot({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:a}},htmlBuilder:function(e,t){var r;"clap"===e.alignment?(r=Ke.makeSpan([],[wt(e.body,t)]),r=Ke.makeSpan(["inner"],[r],t)):r=Ke.makeSpan(["inner"],[wt(e.body,t)]);var n=Ke.makeSpan(["fix"],[]),a=Ke.makeSpan([e.alignment],[r,n],t),i=Ke.makeSpan(["strut"]);return i.style.height=V(a.height+a.depth),a.depth&&(i.style.verticalAlign=V(-a.depth)),a.children.unshift(i),a=Ke.makeSpan(["thinbox"],[a],t),Ke.makeSpan(["mord","vbox"],[a],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mpadded",[Rt(e.body,t)]);if("rlap"!==e.alignment){var n="llap"===e.alignment?"-1":"-0.5";r.setAttribute("lspace",n+"width")}return r.setAttribute("width","0px"),r}}),ot({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){var r=e.funcName,n=e.parser,a=n.mode;n.switchMode("math");var i="\\("===r?"\\)":"$",o=n.parseExpression(!1,i);return n.expect(i),n.switchMode(a),{type:"styling",mode:n.mode,style:"text",body:o}}}),ot({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler:function(e,t){throw new n("Mismatched "+e.funcName)}});var hn=function(e,t){switch(t.style.size){case x.DISPLAY.size:return e.display;case x.TEXT.size:return e.text;case x.SCRIPT.size:return e.script;case x.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};ot({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:function(e,t){return{type:"mathchoice",mode:e.parser.mode,display:ht(t[0]),text:ht(t[1]),script:ht(t[2]),scriptscript:ht(t[3])}},htmlBuilder:function(e,t){var r=hn(e,t),n=ft(r,t,!1);return Ke.makeFragment(n)},mathmlBuilder:function(e,t){var r=hn(e,t);return It(r,t)}});var mn=function(e,t,r,n,a,i,o){e=Ke.makeSpan([],[e]);var s,h,m,c=r&&l.isCharacterBox(r);if(t){var u=wt(t,n.havingStyle(a.sup()),n);h={elem:u,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-u.depth)}}if(r){var p=wt(r,n.havingStyle(a.sub()),n);s={elem:p,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-p.height)}}if(h&&s){var d=n.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+o;m=Ke.makeVList({positionType:"bottom",positionData:d,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:V(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:V(i)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}else if(s){var f=e.height-o;m=Ke.makeVList({positionType:"top",positionData:f,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:V(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},n)}else{if(!h)return e;var g=e.depth+o;m=Ke.makeVList({positionType:"bottom",positionData:g,children:[{type:"elem",elem:e},{type:"kern",size:h.kern},{type:"elem",elem:h.elem,marginLeft:V(i)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]},n)}var v=[m];if(s&&0!==i&&!c){var b=Ke.makeSpan(["mspace"],[],n);b.style.marginRight=V(i),v.unshift(b)}return Ke.makeSpan(["mop","op-limits"],v,n)},cn=["\\smallint"],un=function(e,t){var r,n,a,i=!1;"supsub"===e.type?(r=e.sup,n=e.sub,a=Gt(e.base,"op"),i=!0):a=Gt(e,"op");var o,s=t.style,h=!1;if(s.size===x.DISPLAY.size&&a.symbol&&!l.contains(cn,a.name)&&(h=!0),a.symbol){var m=h?"Size2-Regular":"Size1-Regular",c="";if("\\oiint"!==a.name&&"\\oiiint"!==a.name||(c=a.name.substr(1),a.name="oiint"===c?"\\iint":"\\iiint"),o=Ke.makeSymbol(a.name,m,"math",t,["mop","op-symbol",h?"large-op":"small-op"]),c.length>0){var u=o.italic,p=Ke.staticSvg(c+"Size"+(h?"2":"1"),t);o=Ke.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:p,shift:h?.08:0}]},t),a.name="\\"+c,o.classes.unshift("mop"),o.italic=u}}else if(a.body){var d=ft(a.body,t,!0);1===d.length&&d[0]instanceof Z?(o=d[0]).classes[0]="mop":o=Ke.makeSpan(["mop"],d,t)}else{for(var f=[],g=1;g0){for(var s=a.body.map((function(e){var t=e.text;return"string"===typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=ft(s,t.withFont("mathrm"),!0),h=0;h=0?s.setAttribute("height",V(a)):(s.setAttribute("height",V(a)),s.setAttribute("depth",V(-a))),s.setAttribute("voffset",V(a)),s}});var bn=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];ot({type:"sizing",names:bn,props:{numArgs:0,allowedInText:!0},handler:function(e,t){var r=e.breakOnTokenText,n=e.funcName,a=e.parser,i=a.parseExpression(!1,r);return{type:"sizing",mode:a.mode,size:bn.indexOf(n)+1,body:i}},htmlBuilder:function(e,t){var r=t.havingSize(e.size);return vn(e.body,r,t)},mathmlBuilder:function(e,t){var r=t.havingSize(e.size),n=Nt(e.body,r),a=new Tt.MathNode("mstyle",n);return a.setAttribute("mathsize",V(r.sizeMultiplier)),a}}),ot({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:function(e,t,r){var n=e.parser,a=!1,i=!1,o=r[0]&&Gt(r[0],"ordgroup");if(o)for(var s="",l=0;lr.height+r.depth+i&&(i=(i+c-r.height-r.depth)/2);var u=l.height-r.height-i-h;r.style.paddingLeft=V(m);var p=Ke.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+u)},{type:"elem",elem:l},{type:"kern",size:h}]},t);if(e.index){var d=t.havingStyle(x.SCRIPTSCRIPT),f=wt(e.index,d,t),g=.6*(p.height-p.depth),v=Ke.makeVList({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f}]},t),b=Ke.makeSpan(["root"],[v]);return Ke.makeSpan(["mord","sqrt"],[b,p],t)}return Ke.makeSpan(["mord","sqrt"],[p],t)},mathmlBuilder:function(e,t){var r=e.body,n=e.index;return n?new Tt.MathNode("mroot",[Rt(r,t),Rt(n,t)]):new Tt.MathNode("msqrt",[Rt(r,t)])}});var yn={display:x.DISPLAY,text:x.TEXT,script:x.SCRIPT,scriptscript:x.SCRIPTSCRIPT};ot({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler:function(e,t){var r=e.breakOnTokenText,n=e.funcName,a=e.parser,i=a.parseExpression(!0,r),o=n.slice(1,n.length-5);return{type:"styling",mode:a.mode,style:o,body:i}},htmlBuilder:function(e,t){var r=yn[e.style],n=t.havingStyle(r).withFont("");return vn(e.body,n,t)},mathmlBuilder:function(e,t){var r=yn[e.style],n=t.havingStyle(r),a=Nt(e.body,n),i=new Tt.MathNode("mstyle",a),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",o[0]),i.setAttribute("displaystyle",o[1]),i}});var xn=function(e,t){var r=e.base;return r?"op"===r.type?r.limits&&(t.style.size===x.DISPLAY.size||r.alwaysHandleSupSub)?un:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(t.style.size===x.DISPLAY.size||r.limits)?gn:null:"accent"===r.type?l.isCharacterBox(r.base)?Xt:null:"horizBrace"===r.type&&!e.sub===r.isOver?sn:null:null};st({type:"supsub",htmlBuilder:function(e,t){var r=xn(e,t);if(r)return r(e,t);var n,a,i,o=e.base,s=e.sup,h=e.sub,m=wt(o,t),c=t.fontMetrics(),u=0,p=0,d=o&&l.isCharacterBox(o);if(s){var f=t.havingStyle(t.style.sup());n=wt(s,f,t),d||(u=m.height-f.fontMetrics().supDrop*f.sizeMultiplier/t.sizeMultiplier)}if(h){var g=t.havingStyle(t.style.sub());a=wt(h,g,t),d||(p=m.depth+g.fontMetrics().subDrop*g.sizeMultiplier/t.sizeMultiplier)}i=t.style===x.DISPLAY?c.sup1:t.style.cramped?c.sup3:c.sup2;var v,b=t.sizeMultiplier,y=V(.5/c.ptPerEm/b),w=null;if(a){var k=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(m instanceof Z||k)&&(w=V(-m.italic))}if(n&&a){u=Math.max(u,i,n.depth+.25*c.xHeight),p=Math.max(p,c.sub2);var S=4*c.defaultRuleThickness;if(u-n.depth-(a.height-p)0&&(u+=M,p-=M)}var z=[{type:"elem",elem:a,shift:p,marginRight:y,marginLeft:w},{type:"elem",elem:n,shift:-u,marginRight:y}];v=Ke.makeVList({positionType:"individualShift",children:z},t)}else if(a){p=Math.max(p,c.sub1,a.height-.8*c.xHeight);var A=[{type:"elem",elem:a,marginLeft:w,marginRight:y}];v=Ke.makeVList({positionType:"shift",positionData:p,children:A},t)}else{if(!n)throw new Error("supsub must have either sup or sub.");u=Math.max(u,i,n.depth+.25*c.xHeight),v=Ke.makeVList({positionType:"shift",positionData:-u,children:[{type:"elem",elem:n,marginRight:y}]},t)}var T=yt(m,"right")||"mord";return Ke.makeSpan([T],[m,Ke.makeSpan(["msupsub"],[v])],t)},mathmlBuilder:function(e,t){var r,n=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(n=!0,r=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var a,i=[Rt(e.base,t)];if(e.sub&&i.push(Rt(e.sub,t)),e.sup&&i.push(Rt(e.sup,t)),n)a=r?"mover":"munder";else if(e.sub)if(e.sup){var o=e.base;a=o&&"op"===o.type&&o.limits&&t.style===x.DISPLAY||o&&"operatorname"===o.type&&o.alwaysHandleSupSub&&(t.style===x.DISPLAY||o.limits)?"munderover":"msubsup"}else{var s=e.base;a=s&&"op"===s.type&&s.limits&&(t.style===x.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===x.DISPLAY)?"munder":"msub"}else{var l=e.base;a=l&&"op"===l.type&&l.limits&&(t.style===x.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===x.DISPLAY)?"mover":"msup"}return new Tt.MathNode(a,i)}}),st({type:"atom",htmlBuilder:function(e,t){return Ke.mathsym(e.text,e.mode,t,["m"+e.family])},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[Bt(e.text,e.mode)]);if("bin"===e.family){var n=qt(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});var wn={mi:"italic",mn:"normal",mtext:"normal"};st({type:"mathord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"mathord")},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mi",[Bt(e.text,e.mode,t)]),n=qt(e,t)||"italic";return n!==wn[r.type]&&r.setAttribute("mathvariant",n),r}}),st({type:"textord",htmlBuilder:function(e,t){return Ke.makeOrd(e,t,"textord")},mathmlBuilder:function(e,t){var r,n=Bt(e.text,e.mode,t),a=qt(e,t)||"normal";return r="text"===e.mode?new Tt.MathNode("mtext",[n]):/[0-9]/.test(e.text)?new Tt.MathNode("mn",[n]):"\\prime"===e.text?new Tt.MathNode("mo",[n]):new Tt.MathNode("mi",[n]),a!==wn[r.type]&&r.setAttribute("mathvariant",a),r}});var kn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Sn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};st({type:"spacing",htmlBuilder:function(e,t){if(Sn.hasOwnProperty(e.text)){var r=Sn[e.text].className||"";if("text"===e.mode){var a=Ke.makeOrd(e,t,"textord");return a.classes.push(r),a}return Ke.makeSpan(["mspace",r],[Ke.mathsym(e.text,e.mode,t)],t)}if(kn.hasOwnProperty(e.text))return Ke.makeSpan(["mspace",kn[e.text]],[],t);throw new n('Unknown type of space "'+e.text+'"')},mathmlBuilder:function(e,t){if(!Sn.hasOwnProperty(e.text)){if(kn.hasOwnProperty(e.text))return new Tt.MathNode("mspace");throw new n('Unknown type of space "'+e.text+'"')}return new Tt.MathNode("mtext",[new Tt.TextNode("\xa0")])}});var Mn=function(){var e=new Tt.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};st({type:"tag",mathmlBuilder:function(e,t){var r=new Tt.MathNode("mtable",[new Tt.MathNode("mtr",[Mn(),new Tt.MathNode("mtd",[It(e.body,t)]),Mn(),new Tt.MathNode("mtd",[It(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});var zn={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},An={"\\textbf":"textbf","\\textmd":"textmd"},Tn={"\\textit":"textit","\\textup":"textup"},Bn=function(e,t){var r=e.font;return r?zn[r]?t.withTextFontFamily(zn[r]):An[r]?t.withTextFontWeight(An[r]):t.withTextFontShape(Tn[r]):t};ot({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler:function(e,t){var r=e.parser,n=e.funcName,a=t[0];return{type:"text",mode:r.mode,body:ht(a),font:n}},htmlBuilder:function(e,t){var r=Bn(e,t),n=ft(e.body,r,!0);return Ke.makeSpan(["mord","text"],n,r)},mathmlBuilder:function(e,t){var r=Bn(e,t);return It(e.body,r)}}),ot({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler:function(e,t){return{type:"underline",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=Ke.makeLineSpan("underline-line",t),a=t.fontMetrics().defaultRuleThickness,i=Ke.makeVList({positionType:"top",positionData:r.height,children:[{type:"kern",size:a},{type:"elem",elem:n},{type:"kern",size:3*a},{type:"elem",elem:r}]},t);return Ke.makeSpan(["mord","underline"],[i],t)},mathmlBuilder:function(e,t){var r=new Tt.MathNode("mo",[new Tt.TextNode("\u203e")]);r.setAttribute("stretchy","true");var n=new Tt.MathNode("munder",[Rt(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),ot({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler:function(e,t){return{type:"vcenter",mode:e.parser.mode,body:t[0]}},htmlBuilder:function(e,t){var r=wt(e.body,t),n=t.fontMetrics().axisHeight,a=.5*(r.height-n-(r.depth+n));return Ke.makeVList({positionType:"shift",positionData:a,children:[{type:"elem",elem:r}]},t)},mathmlBuilder:function(e,t){return new Tt.MathNode("mpadded",[Rt(e.body,t)],["vcenter"])}}),ot({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler:function(e,t,r){throw new n("\\verb ended by end of line instead of matching delimiter")},htmlBuilder:function(e,t){for(var r=Cn(e),n=[],a=t.havingStyle(t.style.text()),i=0;i0;)this.endGroup()},t.has=function(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)},t.get=function(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]},t.set=function(e,t,r){if(void 0===r&&(r=!1),r){for(var n=0;n0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(e)&&(a[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t},e}(),On=Or;Hr("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),Hr("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),Hr("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),Hr("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),Hr("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var r=e.future();return 1===t[0].length&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),Hr("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),Hr("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var Hn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};Hr("\\char",(function(e){var t,r=e.popToken(),a="";if("'"===r.text)t=8,r=e.popToken();else if('"'===r.text)t=16,r=e.popToken();else if("`"===r.text)if("\\"===(r=e.popToken()).text[0])a=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new n("\\char` missing argument");a=r.text.charCodeAt(0)}else t=10;if(t){if(null==(a=Hn[r.text])||a>=t)throw new n("Invalid base-"+t+" digit "+r.text);for(var i;null!=(i=Hn[e.future().text])&&i":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};Hr("\\dots",(function(e){var t="\\dotso",r=e.expandAfterFuture().text;return r in Ln?t=Ln[r]:("\\not"===r.substr(0,4)||r in ae.math&&l.contains(["bin","rel"],ae.math[r].group))&&(t="\\dotsb"),t}));var Dn={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};Hr("\\dotso",(function(e){return e.future().text in Dn?"\\ldots\\,":"\\ldots"})),Hr("\\dotsc",(function(e){var t=e.future().text;return t in Dn&&","!==t?"\\ldots\\,":"\\ldots"})),Hr("\\cdots",(function(e){return e.future().text in Dn?"\\@cdots\\,":"\\@cdots"})),Hr("\\dotsb","\\cdots"),Hr("\\dotsm","\\cdots"),Hr("\\dotsi","\\!\\cdots"),Hr("\\dotsx","\\ldots\\,"),Hr("\\DOTSI","\\relax"),Hr("\\DOTSB","\\relax"),Hr("\\DOTSX","\\relax"),Hr("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),Hr("\\,","\\tmspace+{3mu}{.1667em}"),Hr("\\thinspace","\\,"),Hr("\\>","\\mskip{4mu}"),Hr("\\:","\\tmspace+{4mu}{.2222em}"),Hr("\\medspace","\\:"),Hr("\\;","\\tmspace+{5mu}{.2777em}"),Hr("\\thickspace","\\;"),Hr("\\!","\\tmspace-{3mu}{.1667em}"),Hr("\\negthinspace","\\!"),Hr("\\negmedspace","\\tmspace-{4mu}{.2222em}"),Hr("\\negthickspace","\\tmspace-{5mu}{.277em}"),Hr("\\enspace","\\kern.5em "),Hr("\\enskip","\\hskip.5em\\relax"),Hr("\\quad","\\hskip1em\\relax"),Hr("\\qquad","\\hskip2em\\relax"),Hr("\\tag","\\@ifstar\\tag@literal\\tag@paren"),Hr("\\tag@paren","\\tag@literal{({#1})}"),Hr("\\tag@literal",(function(e){if(e.macros.get("\\df@tag"))throw new n("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),Hr("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),Hr("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),Hr("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),Hr("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),Hr("\\pmb","\\html@mathml{\\@binrel{#1}{\\mathrlap{#1}\\kern0.5px#1}}{\\mathbf{#1}}"),Hr("\\newline","\\\\\\relax"),Hr("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Pn=V(T["Main-Regular"]["T".charCodeAt(0)][1]-.7*T["Main-Regular"]["A".charCodeAt(0)][1]);Hr("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+Pn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),Hr("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+Pn+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),Hr("\\hspace","\\@ifstar\\@hspacer\\@hspace"),Hr("\\@hspace","\\hskip #1\\relax"),Hr("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),Hr("\\ordinarycolon",":"),Hr("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),Hr("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),Hr("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),Hr("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),Hr("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),Hr("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),Hr("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),Hr("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),Hr("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),Hr("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),Hr("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),Hr("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),Hr("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),Hr("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),Hr("\u2237","\\dblcolon"),Hr("\u2239","\\eqcolon"),Hr("\u2254","\\coloneqq"),Hr("\u2255","\\eqqcolon"),Hr("\u2a74","\\Coloneqq"),Hr("\\ratio","\\vcentcolon"),Hr("\\coloncolon","\\dblcolon"),Hr("\\colonequals","\\coloneqq"),Hr("\\coloncolonequals","\\Coloneqq"),Hr("\\equalscolon","\\eqqcolon"),Hr("\\equalscoloncolon","\\Eqqcolon"),Hr("\\colonminus","\\coloneq"),Hr("\\coloncolonminus","\\Coloneq"),Hr("\\minuscolon","\\eqcolon"),Hr("\\minuscoloncolon","\\Eqcolon"),Hr("\\coloncolonapprox","\\Colonapprox"),Hr("\\coloncolonsim","\\Colonsim"),Hr("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Hr("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Hr("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),Hr("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),Hr("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220c}}"),Hr("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),Hr("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),Hr("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),Hr("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),Hr("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),Hr("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),Hr("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),Hr("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),Hr("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),Hr("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),Hr("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),Hr("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),Hr("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),Hr("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),Hr("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),Hr("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),Hr("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),Hr("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),Hr("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228a}"),Hr("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2acb}"),Hr("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228b}"),Hr("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2acc}"),Hr("\\imath","\\html@mathml{\\@imath}{\u0131}"),Hr("\\jmath","\\html@mathml{\\@jmath}{\u0237}"),Hr("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27e6}}"),Hr("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27e7}}"),Hr("\u27e6","\\llbracket"),Hr("\u27e7","\\rrbracket"),Hr("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),Hr("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),Hr("\u2983","\\lBrace"),Hr("\u2984","\\rBrace"),Hr("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29b5}}"),Hr("\u29b5","\\minuso"),Hr("\\darr","\\downarrow"),Hr("\\dArr","\\Downarrow"),Hr("\\Darr","\\Downarrow"),Hr("\\lang","\\langle"),Hr("\\rang","\\rangle"),Hr("\\uarr","\\uparrow"),Hr("\\uArr","\\Uparrow"),Hr("\\Uarr","\\Uparrow"),Hr("\\N","\\mathbb{N}"),Hr("\\R","\\mathbb{R}"),Hr("\\Z","\\mathbb{Z}"),Hr("\\alef","\\aleph"),Hr("\\alefsym","\\aleph"),Hr("\\Alpha","\\mathrm{A}"),Hr("\\Beta","\\mathrm{B}"),Hr("\\bull","\\bullet"),Hr("\\Chi","\\mathrm{X}"),Hr("\\clubs","\\clubsuit"),Hr("\\cnums","\\mathbb{C}"),Hr("\\Complex","\\mathbb{C}"),Hr("\\Dagger","\\ddagger"),Hr("\\diamonds","\\diamondsuit"),Hr("\\empty","\\emptyset"),Hr("\\Epsilon","\\mathrm{E}"),Hr("\\Eta","\\mathrm{H}"),Hr("\\exist","\\exists"),Hr("\\harr","\\leftrightarrow"),Hr("\\hArr","\\Leftrightarrow"),Hr("\\Harr","\\Leftrightarrow"),Hr("\\hearts","\\heartsuit"),Hr("\\image","\\Im"),Hr("\\infin","\\infty"),Hr("\\Iota","\\mathrm{I}"),Hr("\\isin","\\in"),Hr("\\Kappa","\\mathrm{K}"),Hr("\\larr","\\leftarrow"),Hr("\\lArr","\\Leftarrow"),Hr("\\Larr","\\Leftarrow"),Hr("\\lrarr","\\leftrightarrow"),Hr("\\lrArr","\\Leftrightarrow"),Hr("\\Lrarr","\\Leftrightarrow"),Hr("\\Mu","\\mathrm{M}"),Hr("\\natnums","\\mathbb{N}"),Hr("\\Nu","\\mathrm{N}"),Hr("\\Omicron","\\mathrm{O}"),Hr("\\plusmn","\\pm"),Hr("\\rarr","\\rightarrow"),Hr("\\rArr","\\Rightarrow"),Hr("\\Rarr","\\Rightarrow"),Hr("\\real","\\Re"),Hr("\\reals","\\mathbb{R}"),Hr("\\Reals","\\mathbb{R}"),Hr("\\Rho","\\mathrm{P}"),Hr("\\sdot","\\cdot"),Hr("\\sect","\\S"),Hr("\\spades","\\spadesuit"),Hr("\\sub","\\subset"),Hr("\\sube","\\subseteq"),Hr("\\supe","\\supseteq"),Hr("\\Tau","\\mathrm{T}"),Hr("\\thetasym","\\vartheta"),Hr("\\weierp","\\wp"),Hr("\\Zeta","\\mathrm{Z}"),Hr("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),Hr("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),Hr("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),Hr("\\bra","\\mathinner{\\langle{#1}|}"),Hr("\\ket","\\mathinner{|{#1}\\rangle}"),Hr("\\braket","\\mathinner{\\langle{#1}\\rangle}"),Hr("\\Bra","\\left\\langle#1\\right|"),Hr("\\Ket","\\left|#1\\right\\rangle");var Fn=function(e){return function(t){var r=t.consumeArg().tokens,n=t.consumeArg().tokens,a=t.consumeArg().tokens,i=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=function(t){return function(r){e&&(r.macros.set("|",o),a.length&&r.macros.set("\\|",s));var i=t;return!t&&a.length&&"|"===r.future().text&&(r.popToken(),i=!0),{tokens:i?a:n,numArgs:0}}};t.macros.set("|",l(!1)),a.length&&t.macros.set("\\|",l(!0));var h=t.consumeArg().tokens,m=t.expandTokens([].concat(i,h,r));return t.macros.endGroup(),{tokens:m.reverse(),numArgs:0}}};Hr("\\bra@ket",Fn(!1)),Hr("\\bra@set",Fn(!0)),Hr("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),Hr("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),Hr("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),Hr("\\angln","{\\angl n}"),Hr("\\blue","\\textcolor{##6495ed}{#1}"),Hr("\\orange","\\textcolor{##ffa500}{#1}"),Hr("\\pink","\\textcolor{##ff00af}{#1}"),Hr("\\red","\\textcolor{##df0030}{#1}"),Hr("\\green","\\textcolor{##28ae7b}{#1}"),Hr("\\gray","\\textcolor{gray}{#1}"),Hr("\\purple","\\textcolor{##9d38bd}{#1}"),Hr("\\blueA","\\textcolor{##ccfaff}{#1}"),Hr("\\blueB","\\textcolor{##80f6ff}{#1}"),Hr("\\blueC","\\textcolor{##63d9ea}{#1}"),Hr("\\blueD","\\textcolor{##11accd}{#1}"),Hr("\\blueE","\\textcolor{##0c7f99}{#1}"),Hr("\\tealA","\\textcolor{##94fff5}{#1}"),Hr("\\tealB","\\textcolor{##26edd5}{#1}"),Hr("\\tealC","\\textcolor{##01d1c1}{#1}"),Hr("\\tealD","\\textcolor{##01a995}{#1}"),Hr("\\tealE","\\textcolor{##208170}{#1}"),Hr("\\greenA","\\textcolor{##b6ffb0}{#1}"),Hr("\\greenB","\\textcolor{##8af281}{#1}"),Hr("\\greenC","\\textcolor{##74cf70}{#1}"),Hr("\\greenD","\\textcolor{##1fab54}{#1}"),Hr("\\greenE","\\textcolor{##0d923f}{#1}"),Hr("\\goldA","\\textcolor{##ffd0a9}{#1}"),Hr("\\goldB","\\textcolor{##ffbb71}{#1}"),Hr("\\goldC","\\textcolor{##ff9c39}{#1}"),Hr("\\goldD","\\textcolor{##e07d10}{#1}"),Hr("\\goldE","\\textcolor{##a75a05}{#1}"),Hr("\\redA","\\textcolor{##fca9a9}{#1}"),Hr("\\redB","\\textcolor{##ff8482}{#1}"),Hr("\\redC","\\textcolor{##f9685d}{#1}"),Hr("\\redD","\\textcolor{##e84d39}{#1}"),Hr("\\redE","\\textcolor{##bc2612}{#1}"),Hr("\\maroonA","\\textcolor{##ffbde0}{#1}"),Hr("\\maroonB","\\textcolor{##ff92c6}{#1}"),Hr("\\maroonC","\\textcolor{##ed5fa6}{#1}"),Hr("\\maroonD","\\textcolor{##ca337c}{#1}"),Hr("\\maroonE","\\textcolor{##9e034e}{#1}"),Hr("\\purpleA","\\textcolor{##ddd7ff}{#1}"),Hr("\\purpleB","\\textcolor{##c6b9fc}{#1}"),Hr("\\purpleC","\\textcolor{##aa87ff}{#1}"),Hr("\\purpleD","\\textcolor{##7854ab}{#1}"),Hr("\\purpleE","\\textcolor{##543b78}{#1}"),Hr("\\mintA","\\textcolor{##f5f9e8}{#1}"),Hr("\\mintB","\\textcolor{##edf2df}{#1}"),Hr("\\mintC","\\textcolor{##e0e5cc}{#1}"),Hr("\\grayA","\\textcolor{##f6f7f7}{#1}"),Hr("\\grayB","\\textcolor{##f0f1f2}{#1}"),Hr("\\grayC","\\textcolor{##e3e5e6}{#1}"),Hr("\\grayD","\\textcolor{##d6d8da}{#1}"),Hr("\\grayE","\\textcolor{##babec2}{#1}"),Hr("\\grayF","\\textcolor{##888d93}{#1}"),Hr("\\grayG","\\textcolor{##626569}{#1}"),Hr("\\grayH","\\textcolor{##3b3e40}{#1}"),Hr("\\grayI","\\textcolor{##21242c}{#1}"),Hr("\\kaBlue","\\textcolor{##314453}{#1}"),Hr("\\kaGreen","\\textcolor{##71B307}{#1}");var Vn={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},Gn=function(){function e(e,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new Rn(On,t.macros),this.mode=r,this.stack=[]}var t=e.prototype;return t.feed=function(e){this.lexer=new In(e,this.settings)},t.switchMode=function(e){this.mode=e},t.beginGroup=function(){this.macros.beginGroup()},t.endGroup=function(){this.macros.endGroup()},t.endGroups=function(){this.macros.endGroups()},t.future=function(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]},t.popToken=function(){return this.future(),this.stack.pop()},t.pushToken=function(e){this.stack.push(e)},t.pushTokens=function(e){var t;(t=this.stack).push.apply(t,e)},t.scanArgument=function(e){var t,r,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken();var a=this.consumeArg(["]"]);n=a.tokens,r=a.end}else{var i=this.consumeArg();n=i.tokens,t=i.start,r=i.end}return this.pushToken(new Lr("EOF",r.loc)),this.pushTokens(n),t.range(r,"")},t.consumeSpaces=function(){for(;" "===this.future().text;)this.stack.pop()},t.consumeArg=function(e){var t=[],r=e&&e.length>0;r||this.consumeSpaces();var a,i=this.future(),o=0,s=0;do{if(a=this.popToken(),t.push(a),"{"===a.text)++o;else if("}"===a.text){if(-1===--o)throw new n("Extra }",a)}else if("EOF"===a.text)throw new n("Unexpected end of input in a macro argument, expected '"+(e&&r?e[s]:"}")+"'",a);if(e&&r)if((0===o||1===o&&"{"===e[s])&&a.text===e[s]){if(++s===e.length){t.splice(-s,s);break}}else s=0}while(0!==o||r);return"{"===i.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:i,end:a}},t.consumeArgs=function(e,t){if(t){if(t.length!==e+1)throw new n("The length of delimiters doesn't match the number of args!");for(var r=t[0],a=0;athis.settings.maxExpand)throw new n("Too many expansions: infinite loop or need to increase maxExpand setting");var i=a.tokens,o=this.consumeArgs(a.numArgs,a.delimiters);if(a.numArgs)for(var s=(i=i.slice()).length-1;s>=0;--s){var l=i[s];if("#"===l.text){if(0===s)throw new n("Incomplete placeholder at end of macro body",l);if("#"===(l=i[--s]).text)i.splice(s+1,1);else{if(!/^[1-9]$/.test(l.text))throw new n("Not a valid argument number",l);var h;(h=i).splice.apply(h,[s,2].concat(o[+l.text-1]))}}}return this.pushTokens(i),i},t.expandAfterFuture=function(){return this.expandOnce(),this.future()},t.expandNextToken=function(){for(;;){var e=this.expandOnce();if(e instanceof Lr)return e.treatAsRelax&&(e.text="\\relax"),this.stack.pop()}throw new Error},t.expandMacro=function(e){return this.macros.has(e)?this.expandTokens([new Lr(e)]):void 0},t.expandTokens=function(e){var t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;){var n=this.expandOnce(!0);n instanceof Lr&&(n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),t.push(this.stack.pop()))}return t},t.expandMacroAsText=function(e){var t=this.expandMacro(e);return t?t.map((function(e){return e.text})).join(""):t},t._getExpansion=function(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var r=this.lexer.catcodes[e];if(null!=r&&13!==r)return}var n="function"===typeof t?t(this):t;if("string"===typeof n){var a=0;if(-1!==n.indexOf("#"))for(var i=n.replace(/##/g,"");-1!==i.indexOf("#"+(a+1));)++a;for(var o=new In(n,this.settings),s=[],l=o.lex();"EOF"!==l.text;)s.push(l),l=o.lex();return s.reverse(),{tokens:s,numArgs:a}}return n},t.isDefined=function(e){return this.macros.has(e)||qn.hasOwnProperty(e)||ae.math.hasOwnProperty(e)||ae.text.hasOwnProperty(e)||Vn.hasOwnProperty(e)},t.isExpandable=function(e){var t=this.macros.get(e);return null!=t?"string"===typeof t||"function"===typeof t||!t.unexpandable:qn.hasOwnProperty(e)&&!qn[e].primitive},e}(),Un=/^[\u208a\u208b\u208c\u208d\u208e\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2090\u2091\u2095\u1d62\u2c7c\u2096\u2097\u2098\u2099\u2092\u209a\u1d63\u209b\u209c\u1d64\u1d65\u2093\u1d66\u1d67\u1d68\u1d69\u1d6a]/,Yn=Object.freeze({"\u208a":"+","\u208b":"-","\u208c":"=","\u208d":"(","\u208e":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1d62":"i","\u2c7c":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209a":"p","\u1d63":"r","\u209b":"s","\u209c":"t","\u1d64":"u","\u1d65":"v","\u2093":"x","\u1d66":"\u03b2","\u1d67":"\u03b3","\u1d68":"\u03c1","\u1d69":"\u03d5","\u1d6a":"\u03c7","\u207a":"+","\u207b":"-","\u207c":"=","\u207d":"(","\u207e":")","\u2070":"0","\xb9":"1","\xb2":"2","\xb3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1d2c":"A","\u1d2e":"B","\u1d30":"D","\u1d31":"E","\u1d33":"G","\u1d34":"H","\u1d35":"I","\u1d36":"J","\u1d37":"K","\u1d38":"L","\u1d39":"M","\u1d3a":"N","\u1d3c":"O","\u1d3e":"P","\u1d3f":"R","\u1d40":"T","\u1d41":"U","\u2c7d":"V","\u1d42":"W","\u1d43":"a","\u1d47":"b","\u1d9c":"c","\u1d48":"d","\u1d49":"e","\u1da0":"f","\u1d4d":"g","\u02b0":"h","\u2071":"i","\u02b2":"j","\u1d4f":"k","\u02e1":"l","\u1d50":"m","\u207f":"n","\u1d52":"o","\u1d56":"p","\u02b3":"r","\u02e2":"s","\u1d57":"t","\u1d58":"u","\u1d5b":"v","\u02b7":"w","\u02e3":"x","\u02b8":"y","\u1dbb":"z","\u1d5d":"\u03b2","\u1d5e":"\u03b3","\u1d5f":"\u03b4","\u1d60":"\u03d5","\u1d61":"\u03c7","\u1dbf":"\u03b8"}),Xn={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030c":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030a":{text:"\\r",math:"\\mathring"},"\u030b":{text:"\\H"},"\u0327":{text:"\\c"}},Wn={"\xe1":"a\u0301","\xe0":"a\u0300","\xe4":"a\u0308","\u01df":"a\u0308\u0304","\xe3":"a\u0303","\u0101":"a\u0304","\u0103":"a\u0306","\u1eaf":"a\u0306\u0301","\u1eb1":"a\u0306\u0300","\u1eb5":"a\u0306\u0303","\u01ce":"a\u030c","\xe2":"a\u0302","\u1ea5":"a\u0302\u0301","\u1ea7":"a\u0302\u0300","\u1eab":"a\u0302\u0303","\u0227":"a\u0307","\u01e1":"a\u0307\u0304","\xe5":"a\u030a","\u01fb":"a\u030a\u0301","\u1e03":"b\u0307","\u0107":"c\u0301","\u1e09":"c\u0327\u0301","\u010d":"c\u030c","\u0109":"c\u0302","\u010b":"c\u0307","\xe7":"c\u0327","\u010f":"d\u030c","\u1e0b":"d\u0307","\u1e11":"d\u0327","\xe9":"e\u0301","\xe8":"e\u0300","\xeb":"e\u0308","\u1ebd":"e\u0303","\u0113":"e\u0304","\u1e17":"e\u0304\u0301","\u1e15":"e\u0304\u0300","\u0115":"e\u0306","\u1e1d":"e\u0327\u0306","\u011b":"e\u030c","\xea":"e\u0302","\u1ebf":"e\u0302\u0301","\u1ec1":"e\u0302\u0300","\u1ec5":"e\u0302\u0303","\u0117":"e\u0307","\u0229":"e\u0327","\u1e1f":"f\u0307","\u01f5":"g\u0301","\u1e21":"g\u0304","\u011f":"g\u0306","\u01e7":"g\u030c","\u011d":"g\u0302","\u0121":"g\u0307","\u0123":"g\u0327","\u1e27":"h\u0308","\u021f":"h\u030c","\u0125":"h\u0302","\u1e23":"h\u0307","\u1e29":"h\u0327","\xed":"i\u0301","\xec":"i\u0300","\xef":"i\u0308","\u1e2f":"i\u0308\u0301","\u0129":"i\u0303","\u012b":"i\u0304","\u012d":"i\u0306","\u01d0":"i\u030c","\xee":"i\u0302","\u01f0":"j\u030c","\u0135":"j\u0302","\u1e31":"k\u0301","\u01e9":"k\u030c","\u0137":"k\u0327","\u013a":"l\u0301","\u013e":"l\u030c","\u013c":"l\u0327","\u1e3f":"m\u0301","\u1e41":"m\u0307","\u0144":"n\u0301","\u01f9":"n\u0300","\xf1":"n\u0303","\u0148":"n\u030c","\u1e45":"n\u0307","\u0146":"n\u0327","\xf3":"o\u0301","\xf2":"o\u0300","\xf6":"o\u0308","\u022b":"o\u0308\u0304","\xf5":"o\u0303","\u1e4d":"o\u0303\u0301","\u1e4f":"o\u0303\u0308","\u022d":"o\u0303\u0304","\u014d":"o\u0304","\u1e53":"o\u0304\u0301","\u1e51":"o\u0304\u0300","\u014f":"o\u0306","\u01d2":"o\u030c","\xf4":"o\u0302","\u1ed1":"o\u0302\u0301","\u1ed3":"o\u0302\u0300","\u1ed7":"o\u0302\u0303","\u022f":"o\u0307","\u0231":"o\u0307\u0304","\u0151":"o\u030b","\u1e55":"p\u0301","\u1e57":"p\u0307","\u0155":"r\u0301","\u0159":"r\u030c","\u1e59":"r\u0307","\u0157":"r\u0327","\u015b":"s\u0301","\u1e65":"s\u0301\u0307","\u0161":"s\u030c","\u1e67":"s\u030c\u0307","\u015d":"s\u0302","\u1e61":"s\u0307","\u015f":"s\u0327","\u1e97":"t\u0308","\u0165":"t\u030c","\u1e6b":"t\u0307","\u0163":"t\u0327","\xfa":"u\u0301","\xf9":"u\u0300","\xfc":"u\u0308","\u01d8":"u\u0308\u0301","\u01dc":"u\u0308\u0300","\u01d6":"u\u0308\u0304","\u01da":"u\u0308\u030c","\u0169":"u\u0303","\u1e79":"u\u0303\u0301","\u016b":"u\u0304","\u1e7b":"u\u0304\u0308","\u016d":"u\u0306","\u01d4":"u\u030c","\xfb":"u\u0302","\u016f":"u\u030a","\u0171":"u\u030b","\u1e7d":"v\u0303","\u1e83":"w\u0301","\u1e81":"w\u0300","\u1e85":"w\u0308","\u0175":"w\u0302","\u1e87":"w\u0307","\u1e98":"w\u030a","\u1e8d":"x\u0308","\u1e8b":"x\u0307","\xfd":"y\u0301","\u1ef3":"y\u0300","\xff":"y\u0308","\u1ef9":"y\u0303","\u0233":"y\u0304","\u0177":"y\u0302","\u1e8f":"y\u0307","\u1e99":"y\u030a","\u017a":"z\u0301","\u017e":"z\u030c","\u1e91":"z\u0302","\u017c":"z\u0307","\xc1":"A\u0301","\xc0":"A\u0300","\xc4":"A\u0308","\u01de":"A\u0308\u0304","\xc3":"A\u0303","\u0100":"A\u0304","\u0102":"A\u0306","\u1eae":"A\u0306\u0301","\u1eb0":"A\u0306\u0300","\u1eb4":"A\u0306\u0303","\u01cd":"A\u030c","\xc2":"A\u0302","\u1ea4":"A\u0302\u0301","\u1ea6":"A\u0302\u0300","\u1eaa":"A\u0302\u0303","\u0226":"A\u0307","\u01e0":"A\u0307\u0304","\xc5":"A\u030a","\u01fa":"A\u030a\u0301","\u1e02":"B\u0307","\u0106":"C\u0301","\u1e08":"C\u0327\u0301","\u010c":"C\u030c","\u0108":"C\u0302","\u010a":"C\u0307","\xc7":"C\u0327","\u010e":"D\u030c","\u1e0a":"D\u0307","\u1e10":"D\u0327","\xc9":"E\u0301","\xc8":"E\u0300","\xcb":"E\u0308","\u1ebc":"E\u0303","\u0112":"E\u0304","\u1e16":"E\u0304\u0301","\u1e14":"E\u0304\u0300","\u0114":"E\u0306","\u1e1c":"E\u0327\u0306","\u011a":"E\u030c","\xca":"E\u0302","\u1ebe":"E\u0302\u0301","\u1ec0":"E\u0302\u0300","\u1ec4":"E\u0302\u0303","\u0116":"E\u0307","\u0228":"E\u0327","\u1e1e":"F\u0307","\u01f4":"G\u0301","\u1e20":"G\u0304","\u011e":"G\u0306","\u01e6":"G\u030c","\u011c":"G\u0302","\u0120":"G\u0307","\u0122":"G\u0327","\u1e26":"H\u0308","\u021e":"H\u030c","\u0124":"H\u0302","\u1e22":"H\u0307","\u1e28":"H\u0327","\xcd":"I\u0301","\xcc":"I\u0300","\xcf":"I\u0308","\u1e2e":"I\u0308\u0301","\u0128":"I\u0303","\u012a":"I\u0304","\u012c":"I\u0306","\u01cf":"I\u030c","\xce":"I\u0302","\u0130":"I\u0307","\u0134":"J\u0302","\u1e30":"K\u0301","\u01e8":"K\u030c","\u0136":"K\u0327","\u0139":"L\u0301","\u013d":"L\u030c","\u013b":"L\u0327","\u1e3e":"M\u0301","\u1e40":"M\u0307","\u0143":"N\u0301","\u01f8":"N\u0300","\xd1":"N\u0303","\u0147":"N\u030c","\u1e44":"N\u0307","\u0145":"N\u0327","\xd3":"O\u0301","\xd2":"O\u0300","\xd6":"O\u0308","\u022a":"O\u0308\u0304","\xd5":"O\u0303","\u1e4c":"O\u0303\u0301","\u1e4e":"O\u0303\u0308","\u022c":"O\u0303\u0304","\u014c":"O\u0304","\u1e52":"O\u0304\u0301","\u1e50":"O\u0304\u0300","\u014e":"O\u0306","\u01d1":"O\u030c","\xd4":"O\u0302","\u1ed0":"O\u0302\u0301","\u1ed2":"O\u0302\u0300","\u1ed6":"O\u0302\u0303","\u022e":"O\u0307","\u0230":"O\u0307\u0304","\u0150":"O\u030b","\u1e54":"P\u0301","\u1e56":"P\u0307","\u0154":"R\u0301","\u0158":"R\u030c","\u1e58":"R\u0307","\u0156":"R\u0327","\u015a":"S\u0301","\u1e64":"S\u0301\u0307","\u0160":"S\u030c","\u1e66":"S\u030c\u0307","\u015c":"S\u0302","\u1e60":"S\u0307","\u015e":"S\u0327","\u0164":"T\u030c","\u1e6a":"T\u0307","\u0162":"T\u0327","\xda":"U\u0301","\xd9":"U\u0300","\xdc":"U\u0308","\u01d7":"U\u0308\u0301","\u01db":"U\u0308\u0300","\u01d5":"U\u0308\u0304","\u01d9":"U\u0308\u030c","\u0168":"U\u0303","\u1e78":"U\u0303\u0301","\u016a":"U\u0304","\u1e7a":"U\u0304\u0308","\u016c":"U\u0306","\u01d3":"U\u030c","\xdb":"U\u0302","\u016e":"U\u030a","\u0170":"U\u030b","\u1e7c":"V\u0303","\u1e82":"W\u0301","\u1e80":"W\u0300","\u1e84":"W\u0308","\u0174":"W\u0302","\u1e86":"W\u0307","\u1e8c":"X\u0308","\u1e8a":"X\u0307","\xdd":"Y\u0301","\u1ef2":"Y\u0300","\u0178":"Y\u0308","\u1ef8":"Y\u0303","\u0232":"Y\u0304","\u0176":"Y\u0302","\u1e8e":"Y\u0307","\u0179":"Z\u0301","\u017d":"Z\u030c","\u1e90":"Z\u0302","\u017b":"Z\u0307","\u03ac":"\u03b1\u0301","\u1f70":"\u03b1\u0300","\u1fb1":"\u03b1\u0304","\u1fb0":"\u03b1\u0306","\u03ad":"\u03b5\u0301","\u1f72":"\u03b5\u0300","\u03ae":"\u03b7\u0301","\u1f74":"\u03b7\u0300","\u03af":"\u03b9\u0301","\u1f76":"\u03b9\u0300","\u03ca":"\u03b9\u0308","\u0390":"\u03b9\u0308\u0301","\u1fd2":"\u03b9\u0308\u0300","\u1fd1":"\u03b9\u0304","\u1fd0":"\u03b9\u0306","\u03cc":"\u03bf\u0301","\u1f78":"\u03bf\u0300","\u03cd":"\u03c5\u0301","\u1f7a":"\u03c5\u0300","\u03cb":"\u03c5\u0308","\u03b0":"\u03c5\u0308\u0301","\u1fe2":"\u03c5\u0308\u0300","\u1fe1":"\u03c5\u0304","\u1fe0":"\u03c5\u0306","\u03ce":"\u03c9\u0301","\u1f7c":"\u03c9\u0300","\u038e":"\u03a5\u0301","\u1fea":"\u03a5\u0300","\u03ab":"\u03a5\u0308","\u1fe9":"\u03a5\u0304","\u1fe8":"\u03a5\u0306","\u038f":"\u03a9\u0301","\u1ffa":"\u03a9\u0300"},_n=function(){function e(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new Gn(e,t,this.mode),this.settings=t,this.leftrightDepth=0}var t=e.prototype;return t.expect=function(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new n("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()},t.consume=function(){this.nextToken=null},t.fetch=function(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken},t.switchMode=function(e){this.mode=e,this.gullet.switchMode(e)},t.parse=function(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}},t.subparse=function(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Lr("}")),this.gullet.pushTokens(e);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r},t.parseExpression=function(t,r){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var a=this.fetch();if(-1!==e.endOfExpression.indexOf(a.text))break;if(r&&a.text===r)break;if(t&&qn[a.text]&&qn[a.text].infix)break;var i=this.parseAtom(r);if(!i)break;"internal"!==i.type&&n.push(i)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)},t.handleInfixNodes=function(e){for(var t,r=-1,a=0;a=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var s,l=ae[this.mode][t].group,h=Er.range(e);if(te.hasOwnProperty(l)){var m=l;s={type:"atom",mode:this.mode,family:m,loc:h,text:t}}else s={type:l,mode:this.mode,loc:h,text:t};i=s}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(S(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),i={type:"textord",mode:"text",loc:Er.range(e),text:t}}if(this.consume(),o)for(var c=0;c1&&void 0!==arguments[1]?arguments[1]:u.Slice.empty,n=t.content.lastChild,r=null,o=0;o2&&void 0!==arguments[2]&&arguments[2],r=e.parent.inlineContent?new v(e):x(e.node(0),e.parent,e.pos,e.index(),t,n);if(r)return r;for(var o=e.depth-1;o>=0;o--){var i=t<0?x(e.node(0),e.node(o),e.before(o+1),e.index(o),t,n):x(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,n);if(i)return i}return null}},{key:"near",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this.findFrom(e,t)||this.findFrom(e,-t)||new w(e.node(0))}},{key:"atStart",value:function(e){return x(e,e,0,0,1)||new w(e)}},{key:"atEnd",value:function(e){return x(e,e,e.content.size,e.childCount,-1)||new w(e)}},{key:"fromJSON",value:function(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");var n=f[t.type];if(!n)throw new RangeError("No selection type ".concat(t.type," defined"));return n.fromJSON(e,t)}},{key:"jsonID",value:function(e,t){if(e in f)throw new RangeError("Duplicate use of selection JSON ID "+e);return f[e]=t,t.prototype.jsonID=e,t}}]),e}();d.prototype.visible=!0;var p=Object(l.a)((function e(t,n){Object(s.a)(this,e),this.$from=t,this.$to=n})),h=!1;function m(e){h||e.parent.inlineContent||(h=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var v=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return Object(s.a)(this,n),m(e),m(r),t.call(this,e,r)}return Object(l.a)(n,[{key:"$cursor",get:function(){return this.$anchor.pos==this.$head.pos?this.$head:null}},{key:"map",value:function(e,t){var r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return d.near(r);var o=e.resolve(t.map(this.anchor));return new n(o.parent.inlineContent?o:r,r)}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.Slice.empty;if(Object(r.a)(Object(o.a)(n.prototype),"replace",this).call(this,e,t),t==u.Slice.empty){var i=this.$from.marksAcross(this.$to);i&&e.ensureMarks(i)}}},{key:"eq",value:function(e){return e instanceof n&&e.anchor==this.anchor&&e.head==this.head}},{key:"getBookmark",value:function(){return new g(this.anchor,this.head)}},{key:"toJSON",value:function(){return{type:"text",anchor:this.anchor,head:this.head}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid input for TextSelection.fromJSON");return new n(e.resolve(t.anchor),e.resolve(t.head))}},{key:"create",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=e.resolve(t);return new this(r,n==t?r:e.resolve(n))}},{key:"between",value:function(e,t,r){var o=e.pos-t.pos;if(r&&!o||(r=o>=0?1:-1),!t.parent.inlineContent){var i=d.findFrom(t,r,!0)||d.findFrom(t,-r,!0);if(!i)return d.near(t,r);t=i.$head}return e.parent.inlineContent||(0==o||(e=(d.findFrom(e,-r,!0)||d.findFrom(e,r,!0)).$anchor).pos1&&void 0!==arguments[1]?arguments[1]:u.Slice.empty;if(t==u.Slice.empty){e.delete(0,e.doc.content.size);var i=d.atStart(e.doc);i.eq(e.selection)||e.setSelection(i)}else Object(r.a)(Object(o.a)(n.prototype),"replace",this).call(this,e,t)}},{key:"toJSON",value:function(){return{type:"all"}}},{key:"map",value:function(e){return new n(e)}},{key:"eq",value:function(e){return e instanceof n}},{key:"getBookmark",value:function(){return k}}],[{key:"fromJSON",value:function(e){return new n(e)}}]),n}(d);d.jsonID("all",w);var k={map:function(){return this},resolve:function(e){return new w(e)}};function x(e,t,n,r,o){var i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];if(t.inlineContent)return v.create(e,n);for(var a=r-(o>0?0:1);o>0?a=0;a+=o){var s=t.child(a);if(s.isAtom){if(!i&&y.isSelectable(s))return y.create(e,n-(o<0?s.nodeSize:0))}else{var l=x(e,s,n+o,o<0?s.childCount:0,o,i);if(l)return l}n+=s.nodeSize*o}return null}function O(e,t,n){var r=e.steps.length-1;if(!(r0}},{key:"setStoredMarks",value:function(e){return this.storedMarks=e,this.updated|=2,this}},{key:"ensureMarks",value:function(e){return u.Mark.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}},{key:"addStoredMark",value:function(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}},{key:"removeStoredMark",value:function(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}},{key:"storedMarksSet",get:function(){return(2&this.updated)>0}},{key:"addStep",value:function(e,t){Object(r.a)(Object(o.a)(n.prototype),"addStep",this).call(this,e,t),this.updated=-3&this.updated,this.storedMarks=null}},{key:"setTime",value:function(e){return this.time=e,this}},{key:"replaceSelection",value:function(e){return this.selection.replace(this,e),this}},{key:"replaceSelectionWith",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.selection;return t&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||u.Mark.none))),n.replaceWith(this,e),this}},{key:"deleteSelection",value:function(){return this.selection.replace(this),this}},{key:"insertText",value:function(e,t,n){var r=this.doc.type.schema;if(null==t)return e?this.replaceSelectionWith(r.text(e),!0):this.deleteSelection();if(null==n&&(n=t),n=null==n?t:n,!e)return this.deleteRange(t,n);var o=this.storedMarks;if(!o){var i=this.doc.resolve(t);o=n==t?i.marks():i.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(t,n,r.text(e,o)),this.selection.empty||this.setSelection(d.near(this.selection.$to)),this}},{key:"setMeta",value:function(e,t){return this.meta["string"==typeof e?e:e.key]=t,this}},{key:"getMeta",value:function(e){return this.meta["string"==typeof e?e:e.key]}},{key:"isGeneric",get:function(){for(var e in this.meta)return!1;return!0}},{key:"scrollIntoView",value:function(){return this.updated|=4,this}},{key:"scrolledIntoView",get:function(){return(4&this.updated)>0}}]),n}(c.e);function S(e,t){return t&&e?e.bind(t):e}var j=Object(l.a)((function e(t,n,r){Object(s.a)(this,e),this.name=t,this.init=S(n.init,r),this.apply=S(n.apply,r)})),A=[new j("doc",{init:function(e){return e.doc||e.schema.topNodeType.createAndFill()},apply:function(e){return e.doc}}),new j("selection",{init:function(e,t){return e.selection||d.atStart(t.doc)},apply:function(e){return e.selection}}),new j("storedMarks",{init:function(e){return e.storedMarks||null},apply:function(e,t,n,r){return r.selection.$cursor?e.storedMarks:null}}),new j("scrollToSelection",{init:function(){return 0},apply:function(e,t){return e.scrolledIntoView?t+1:t}})],E=Object(l.a)((function e(t,n){var r=this;Object(s.a)(this,e),this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=A.slice(),n&&n.forEach((function(e){if(r.pluginsByKey[e.key])throw new RangeError("Adding different instances of a keyed plugin ("+e.key+")");r.plugins.push(e),r.pluginsByKey[e.key]=e,e.spec.state&&r.fields.push(new j(e.key,e.spec.state,e))}))})),D=function(){function e(t){Object(s.a)(this,e),this.config=t}return Object(l.a)(e,[{key:"schema",get:function(){return this.config.schema}},{key:"plugins",get:function(){return this.config.plugins}},{key:"apply",value:function(e){return this.applyTransaction(e).state}},{key:"filterTransaction",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=0;n0&&void 0!==arguments[0]?arguments[0]:"key";Object(s.a)(this,e),this.key=P(t)}return Object(l.a)(e,[{key:"get",value:function(e){return e.config.pluginsByKey[this.key]}},{key:"getState",value:function(e){return e[this.key]}}]),e}()},function(e,t,n){"use strict";n.r(t),n.d(t,"ContentMatch",(function(){return B})),n.d(t,"DOMParser",(function(){return oe})),n.d(t,"DOMSerializer",(function(){return he})),n.d(t,"Fragment",(function(){return h})),n.d(t,"Mark",(function(){return y})),n.d(t,"MarkType",(function(){return te})),n.d(t,"Node",(function(){return V})),n.d(t,"NodeRange",(function(){return N})),n.d(t,"NodeType",(function(){return Q})),n.d(t,"ReplaceError",(function(){return b})),n.d(t,"ResolvedPos",(function(){return L})),n.d(t,"Schema",(function(){return ne})),n.d(t,"Slice",(function(){return w}));var r=n(16),o=n(13),i=n(11),a=n(12),s=n(48),l=n(4),u=n(5);function c(e){this.content=e}c.prototype={constructor:c,find:function(e){for(var t=0;t>1}},c.from=function(e){if(e instanceof c)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new c(t)};var f=c;function d(e,t,n){for(var r=0;;r++){if(r==e.childCount||r==t.childCount)return e.childCount==t.childCount?null:n;var o=e.child(r),i=t.child(r);if(o!=i){if(!o.sameMarkup(i))return n;if(o.isText&&o.text!=i.text){for(var a=0;o.text[a]==i.text[a];a++)n++;return n}if(o.content.size||i.content.size){var s=d(o.content,i.content,n+1);if(null!=s)return s}n+=o.nodeSize}else n+=o.nodeSize}}function p(e,t,n,r){for(var o=e.childCount,i=t.childCount;;){if(0==o||0==i)return o==i?null:{a:n,b:r};var a=e.child(--o),s=t.child(--i),l=a.nodeSize;if(a!=s){if(!a.sameMarkup(s))return{a:n,b:r};if(a.isText&&a.text!=s.text){for(var u=0,c=Math.min(a.text.length,s.text.length);u3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4?arguments[4]:void 0,i=0,a=0;ae&&!1!==n(s,r+a,o||null,i)&&s.content.size){var u=a+1;s.nodesBetween(Math.max(0,e-u),Math.min(s.content.size,t-u),n,r+u)}a=l}}},{key:"descendants",value:function(e){this.nodesBetween(0,this.size,e)}},{key:"textBetween",value:function(e,t,n,r){var o="",i=!0;return this.nodesBetween(e,t,(function(a,s){a.isText?(o+=a.text.slice(Math.max(e,s)-s,t-s),i=!n):a.isLeaf?(r?o+="function"===typeof r?r(a):r:a.type.spec.leafText&&(o+=a.type.spec.leafText(a)),i=!n):!i&&a.isBlock&&(o+=n,i=!0)}),0),o}},{key:"append",value:function(t){if(!t.size)return this;if(!this.size)return t;var n=this.lastChild,r=t.firstChild,o=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(r)&&(o[o.length-1]=n.withText(n.text+r.text),i=1);i1&&void 0!==arguments[1]?arguments[1]:this.size;if(0==t&&n==this.size)return this;var r=[],o=0;if(n>t)for(var i=0,a=0;at&&((an)&&(s=s.isText?s.cut(Math.max(0,t-a),Math.min(s.text.length,n-a)):s.cut(Math.max(0,t-a-1),Math.min(s.content.size,n-a-1))),r.push(s),o+=s.nodeSize),a=l}return new e(r,o)}},{key:"cutByIndex",value:function(t,n){return t==n?e.empty:0==t&&n==this.content.length?this:new e(this.content.slice(t,n))}},{key:"replaceChild",value:function(t,n){var r=this.content[t];if(r==n)return this;var o=this.content.slice(),i=this.size+n.nodeSize-r.nodeSize;return o[t]=n,new e(o,i)}},{key:"addToStart",value:function(t){return new e([t].concat(this.content),this.size+t.nodeSize)}},{key:"addToEnd",value:function(t){return new e(this.content.concat(t),this.size+t.nodeSize)}},{key:"eq",value:function(e){if(this.content.length!=e.content.length)return!1;for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0;return d(this,e,t)}},{key:"findDiffEnd",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.size,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.size;return p(this,e,t,n)}},{key:"findIndex",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;if(0==e)return v(0,e);if(e==this.size)return v(this.content.length,e);if(e>this.size||e<0)throw new RangeError("Position ".concat(e," outside of fragment (").concat(this,")"));for(var n=0,r=0;;n++){var o=this.child(n),i=r+o.nodeSize;if(i>=e)return i==e||t>0?v(n+1,i):v(n,r);r=i}}},{key:"toString",value:function(){return"<"+this.toStringInner()+">"}},{key:"toStringInner",value:function(){return this.content.join(", ")}},{key:"toJSON",value:function(){return this.content.length?this.content.map((function(e){return e.toJSON()})):null}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return new e(n.map(t.nodeFromJSON))}},{key:"fromArray",value:function(t){if(!t.length)return e.empty;for(var n,r=0,o=0;othis.type.rank&&(t||(t=e.slice(0,r)),t.push(this),n=!0),t&&t.push(o)}}return t||(t=e.slice()),n||t.push(this),t}},{key:"removeFromSet",value:function(e){for(var t=0;t0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}}],[{key:"fromJSON",value:function(t,n){if(!n)return e.empty;var r=n.openStart||0,o=n.openEnd||0;if("number"!=typeof r||"number"!=typeof o)throw new RangeError("Invalid input for Slice.fromJSON");return new e(h.fromJSON(t,n.content),r,o)}},{key:"maxOpen",value:function(t){for(var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=0,o=0,i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)r++;for(var a=t.lastChild;a&&!a.isLeaf&&(n||!a.type.spec.isolating);a=a.lastChild)o++;return new e(t,r,o)}}]),e}();function k(e,t,n){var r=e.findIndex(t),o=r.index,i=r.offset,a=e.maybeChild(o),s=e.findIndex(n),l=s.index,u=s.offset;if(i==t||a.isText){if(u!=n&&!e.child(l).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(o!=l)throw new RangeError("Removing non-flat range");return e.replaceChild(o,a.copy(k(a.content,t-i-1,n-i-1)))}function x(e,t,n,r){var o=e.findIndex(t),i=o.index,a=o.offset,s=e.maybeChild(i);if(a==t||s.isText)return r&&!r.canReplace(i,i,n)?null:e.cut(0,t).append(n).append(e.cut(t));var l=x(s.content,t-a-1,n);return l&&e.replaceChild(i,s.copy(l))}function O(e,t,n){if(n.openStart>e.depth)throw new b("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new b("Inconsistent open depths");return C(e,t,n,0)}function C(e,t,n,r){var o=e.index(r),i=e.node(r);if(o==t.index(r)&&r=0;o--)r=t.node(o).copy(h.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}(n,e);return D(i,M(e,s.start,s.end,t,r))}var l=e.parent,u=l.content;return D(l,u.cut(0,e.parentOffset).append(n.content).append(u.cut(t.parentOffset)))}return D(i,T(e,t,r))}function S(e,t){if(!t.type.compatibleContent(e.type))throw new b("Cannot join "+t.type.name+" onto "+e.type.name)}function j(e,t,n){var r=e.node(n);return S(r,t.node(n)),r}function A(e,t){var n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function E(e,t,n,r){var o=(t||e).node(n),i=0,a=t?t.index(n):o.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(A(e.nodeAfter,r),i++));for(var s=i;so&&j(e,t,o+1),a=r.depth>o&&j(n,r,o+1),s=[];return E(null,e,o,s),i&&a&&t.index(o)==n.index(o)?(S(i,a),A(D(i,M(e,t,n,r,o+1)),s)):(i&&A(D(i,T(e,t,o+1)),s),E(t,n,o,s),a&&A(D(a,T(n,r,o+1)),s)),E(r,null,o,s),new h(s)}function T(e,t,n){var r=[];(E(null,e,n,r),e.depth>n)&&A(D(j(e,t,n+1),T(e,t,n+1)),r);return E(t,null,n,r),new h(r)}w.empty=new w(h.empty,0,0);var L=function(){function e(t,n,r){Object(l.a)(this,e),this.pos=t,this.path=n,this.parentOffset=r,this.depth=n.length/3-1}return Object(u.a)(e,[{key:"resolveDepth",value:function(e){return null==e?this.depth:e<0?this.depth+e:e}},{key:"parent",get:function(){return this.node(this.depth)}},{key:"doc",get:function(){return this.node(0)}},{key:"node",value:function(e){return this.path[3*this.resolveDepth(e)]}},{key:"index",value:function(e){return this.path[3*this.resolveDepth(e)+1]}},{key:"indexAfter",value:function(e){return e=this.resolveDepth(e),this.index(e)+(e!=this.depth||this.textOffset?1:0)}},{key:"start",value:function(e){return 0==(e=this.resolveDepth(e))?0:this.path[3*e-1]+1}},{key:"end",value:function(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}},{key:"before",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]}},{key:"after",value:function(e){if(!(e=this.resolveDepth(e)))throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[3*e-1]+this.path[3*e].nodeSize}},{key:"textOffset",get:function(){return this.pos-this.path[this.path.length-1]}},{key:"nodeAfter",get:function(){var e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;var n=this.pos-this.path[this.path.length-1],r=e.child(t);return n?e.child(t).cut(n):r}},{key:"nodeBefore",get:function(){var e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):0==e?null:this.parent.child(e-1)}},{key:"posAtIndex",value:function(e,t){t=this.resolveDepth(t);for(var n=this.path[3*t],r=0==t?0:this.path[3*t-1]+1,o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}},{key:"blockRange",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this,t=arguments.length>1?arguments[1]:void 0;if(e.pos=0;n--)if(e.pos<=this.end(n)&&(!t||t(this.node(n))))return new N(this,e,n);return null}},{key:"sameParent",value:function(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}},{key:"max",value:function(e){return e.pos>this.pos?e:this}},{key:"min",value:function(e){return e.pos=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");for(var r=[],o=0,i=n,a=t;;){var s=a.content.findIndex(i),l=s.index,u=s.offset,c=i-u;if(r.push(a,l,o+u),!c)break;if((a=a.child(l)).isText)break;i=c-1,o+=u+1}return new e(n,r,i)}},{key:"resolveCached",value:function(t,n){for(var r=0;r3&&void 0!==arguments[3]?arguments[3]:y.none;Object(l.a)(this,e),this.type=t,this.attrs=n,this.marks=o,this.content=r||h.empty}return Object(u.a)(e,[{key:"nodeSize",get:function(){return this.isLeaf?1:2+this.content.size}},{key:"childCount",get:function(){return this.content.childCount}},{key:"child",value:function(e){return this.content.child(e)}},{key:"maybeChild",value:function(e){return this.content.maybeChild(e)}},{key:"forEach",value:function(e){this.content.forEach(e)}},{key:"nodesBetween",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;this.content.nodesBetween(e,t,n,r,this)}},{key:"descendants",value:function(e){this.nodesBetween(0,this.content.size,e)}},{key:"textContent",get:function(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}},{key:"textBetween",value:function(e,t,n,r){return this.content.textBetween(e,t,n,r)}},{key:"firstChild",get:function(){return this.content.firstChild}},{key:"lastChild",get:function(){return this.content.lastChild}},{key:"eq",value:function(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}},{key:"sameMarkup",value:function(e){return this.hasMarkup(e.type,e.attrs,e.marks)}},{key:"hasMarkup",value:function(e,t,n){return this.type==e&&g(this.attrs,t||e.defaultAttrs||F)&&y.sameSet(this.marks,n||y.none)}},{key:"copy",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}},{key:"mark",value:function(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}},{key:"cut",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size;return 0==e&&t==this.content.size?this:this.copy(this.content.cut(e,t))}},{key:"slice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.content.size,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e==t)return w.empty;var r=this.resolve(e),o=this.resolve(t),i=n?0:r.sharedDepth(t),a=r.start(i),s=r.node(i),l=s.content.cut(r.pos-a,o.pos-a);return new w(l,r.depth-i,o.depth-i)}},{key:"replace",value:function(e,t,n){return O(this.resolve(e),this.resolve(t),n)}},{key:"nodeAt",value:function(e){for(var t=this;;){var n=t.content.findIndex(e),r=n.index,o=n.offset;if(!(t=t.maybeChild(r)))return null;if(o==e||t.isText)return t;e-=o+1}}},{key:"childAfter",value:function(e){var t=this.content.findIndex(e),n=t.index,r=t.offset;return{node:this.content.maybeChild(n),index:n,offset:r}}},{key:"childBefore",value:function(e){if(0==e)return{node:null,index:0,offset:0};var t=this.content.findIndex(e),n=t.index,r=t.offset;if(re&&this.nodesBetween(e,t,(function(e){return n.isInSet(e.marks)&&(r=!0),!r})),r}},{key:"isBlock",get:function(){return this.type.isBlock}},{key:"isTextblock",get:function(){return this.type.isTextblock}},{key:"inlineContent",get:function(){return this.type.inlineContent}},{key:"isInline",get:function(){return this.type.isInline}},{key:"isText",get:function(){return this.type.isText}},{key:"isLeaf",get:function(){return this.type.isLeaf}},{key:"isAtom",get:function(){return this.type.isAtom}},{key:"toString",value:function(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);var e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),_(this.marks,e)}},{key:"contentMatchAt",value:function(e){var t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}},{key:"canReplace",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h.empty,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:n.childCount,i=this.contentMatchAt(e).matchFragment(n,r,o),a=i&&i.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(var s=r;s0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.text.length;return 0==e&&t==this.text.length?this:this.withText(this.text.slice(e,t))}},{key:"eq",value:function(e){return this.sameMarkup(e)&&this.text==e.text}},{key:"toJSON",value:function(){var e=Object(r.a)(Object(o.a)(n.prototype),"toJSON",this).call(this);return e.text=this.text,e}}]),n}(V);function _(e,t){for(var n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}var B=function(){function e(t){Object(l.a)(this,e),this.validEnd=t,this.next=[],this.wrapCache=[]}return Object(u.a)(e,[{key:"matchType",value:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.childCount,r=this,o=t;r&&o1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=[this];function o(i,a){var s=i.matchFragment(e,n);if(s&&(!t||s.validEnd))return h.from(a.map((function(e){return e.createAndFill()})));for(var l=0;l=this.next.length)throw new RangeError("There's no ".concat(e,"th edge in this content match"));return this.next[e]}},{key:"toString",value:function(){var e=[];return function t(n){e.push(n);for(var r=0;r"+e.indexOf(t.next[o].next);return r})).join("\n")}}],[{key:"parse",value:function(t,n){var r=new I(t,n);if(null==r.next)return e.empty;var o=$(r);r.next&&r.err("Unexpected trailing text");var i=function(e){var t=Object.create(null);return n(J(e,0));function n(r){var o=[];r.forEach((function(t){e[t].forEach((function(t){var n=t.term,r=t.to;if(n){for(var i,a=0;a-1),a=0;a-1&&o.push(a)}0==o.length&&e.err("No node type or group '"+t+"' found");return o}(e,e.next).map((function(t){return null==e.inline?e.inline=t.isInline:e.inline!=t.isInline&&e.err("Mixing inline and block content"),{type:"name",value:t}}));return e.pos++,1==n.length?n[0]:{type:"choice",exprs:n}}e.err("Unexpected token '"+e.next+"'")}(e);;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else{if(!e.eat("{"))break;t=K(e,t)}return t}function U(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");var t=Number(e.next);return e.pos++,t}function K(e,t){var n=U(e),r=n;return e.eat(",")&&(r="}"!=e.next?U(e):-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:r,expr:t}}function G(e,t){return t-e}function J(e,t){var n=[];return function t(r){var o=e[r];if(1==o.length&&!o[0].term)return t(o[0].to);n.push(r);for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new V(this,this.computeAttrs(e),h.from(t),y.setFrom(n))}},{key:"createChecked",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(t=h.from(t),!this.validContent(t))throw new RangeError("Invalid content for node "+this.name);return new V(this,this.computeAttrs(e),t,y.setFrom(n))}},{key:"createAndFill",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;if(e=this.computeAttrs(e),(t=h.from(t)).size){var r=this.contentMatch.fillBefore(t);if(!r)return null;t=r.append(t)}var o=this.contentMatch.matchFragment(t),i=o&&o.fillBefore(h.empty,!0);return i?new V(this,e,t.append(i),y.setFrom(n)):null}},{key:"validContent",value:function(e){var t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(var n=0;n-1}},{key:"allowsMarks",value:function(e){if(null==this.markSet)return!0;for(var t=0;t0&&void 0!==arguments[0]?arguments[0]:null;return!e&&this.instance?this.instance:new y(this,Y(this.attrs,e))}},{key:"removeFromSet",value:function(e){for(var t=0;t-1}}],[{key:"compile",value:function(t,n){var r=Object.create(null),o=0;return t.forEach((function(t,i){return r[t]=new e(t,o++,n,i)})),r}}]),e}(),ne=function(){function e(t){Object(l.a)(this,e),this.cached=Object.create(null),this.spec={nodes:f.from(t.nodes),marks:f.from(t.marks||{}),topNode:t.topNode},this.nodes=Q.compile(this.spec.nodes,this),this.marks=te.compile(this.spec.marks,this);var n=Object.create(null);for(var r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");var o=this.nodes[r],i=o.spec.content||"",a=o.spec.marks;o.contentMatch=n[i]||(n[i]=B.parse(i,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.markSet="_"==a?null:a?re(this,a.split(" ")):""!=a&&o.inlineContent?null:[]}for(var s in this.marks){var u=this.marks[s],c=u.spec.excludes;u.excluded=null==c?[u]:""==c?[]:re(this,c.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}return Object(u.a)(e,[{key:"node",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if("string"==typeof e)e=this.nodeType(e);else{if(!(e instanceof Q))throw new RangeError("Invalid node type: "+e);if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}return e.createChecked(t,n,r)}},{key:"text",value:function(e,t){var n=this.nodes.text;return new z(n,n.defaultAttrs,e,y.setFrom(t))}},{key:"mark",value:function(e,t){return"string"==typeof e&&(e=this.marks[e]),e.create(t)}},{key:"nodeFromJSON",value:function(e){return V.fromJSON(this,e)}},{key:"markFromJSON",value:function(e){return y.fromJSON(this,e)}},{key:"nodeType",value:function(e){var t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}]),e}();function re(e,t){for(var n=[],r=0;r-1)&&n.push(a=l)}if(!a)throw new SyntaxError("Unknown mark type: '"+t[r]+"'")}return n}var oe=function(){function e(t,n){var r=this;Object(l.a)(this,e),this.schema=t,this.rules=n,this.tags=[],this.styles=[],n.forEach((function(e){e.tag?r.tags.push(e):e.style&&r.styles.push(e)})),this.normalizeLists=!this.tags.some((function(e){if(!/^(ul|ol)\b/.test(e.tag)||!e.node)return!1;var n=t.nodes[e.node];return n.contentMatch.matchType(n)}))}return Object(u.a)(e,[{key:"parse",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ce(this,t,!1);return n.addAll(e,t.from,t.to),n.finish()}},{key:"parseSlice",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new ce(this,t,!0);return n.addAll(e,t.from,t.to),w.maxOpen(n.finish())}},{key:"matchTag",value:function(e,t,n){for(var r=n?this.tags.indexOf(n)+1:0;re.length&&(61!=a.charCodeAt(e.length)||a.slice(e.length+1)!=t))){if(i.getAttrs){var s=i.getAttrs(t);if(!1===s)continue;i.attrs=s||void 0}return i}}}}],[{key:"schemaRules",value:function(e){var t=[];function n(e){for(var n=null==e.priority?50:e.priority,r=0;r=0;t--)if(e.eq(this.stashMarks[t]))return this.stashMarks.splice(t,1)[0]}},{key:"applyPending",value:function(e){for(var t=0,n=this.pendingMarks;t=0;r--){var o=this.nodes[r],i=o.findWrapping(e);if(i&&(!t||t.length>i.length)&&(t=i,n=o,!i.length))break;if(o.solid)break}if(!t)return!1;this.sync(n);for(var a=0;a1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0;this.closeExtra();var o=this.top;o.applyPending(e),o.match=o.match&&o.match.matchType(e);var i=le(e,r,o.options);4&o.options&&0==o.content.length&&(i|=4),this.nodes.push(new ue(e,t,o.activeMarks,o.pendingMarks,n,null,i)),this.open++}},{key:"closeExtra",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}},{key:"finish",value:function(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(this.isOpen||this.options.topOpen)}},{key:"sync",value:function(e){for(var t=this.open;t>=0;t--)if(this.nodes[t]==e)return this.open=t,!0;return!1}},{key:"currentPos",get:function(){this.closeExtra();for(var e=0,t=this.open;t>=0;t--){for(var n=this.nodes[t].content,r=n.length-1;r>=0;r--)e+=n[r].nodeSize;t&&e++}return e}},{key:"findAtPoint",value:function(e,t){if(this.find)for(var n=0;n-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);var n=e.split("/"),r=this.options.context,o=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),i=-(r?r.depth+1:0)+(o?0:1);return function e(a,s){for(;a>=0;a--){var l=n[a];if(""==l){if(a==n.length-1||0==a)continue;for(;s>=i;s--)if(e(a-1,s))return!0;return!1}var u=s>0||0==s&&o?t.nodes[s].type:r&&s>=i?r.node(s-i).type:null;if(!u||u.name!=l&&-1==u.groups.indexOf(l))return!1;s--}return!0}(n.length-1,this.open)}},{key:"textblockFromContext",value:function(){var e=this.options.context;if(e)for(var t=e.depth;t>=0;t--){var n=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(n&&n.isTextblock&&n.defaultAttrs)return n}for(var r in this.parser.schema.nodes){var o=this.parser.schema.nodes[r];if(o.isTextblock&&o.defaultAttrs)return o}}},{key:"addPendingMark",value:function(e){var t=function(e,t){for(var n=0;n=0;n--){var r=this.nodes[n];if(r.pendingMarks.lastIndexOf(e)>-1)r.pendingMarks=e.removeFromSet(r.pendingMarks);else{r.activeMarks=e.removeFromSet(r.activeMarks);var o=r.popFromStashMark(e);o&&r.type&&r.type.allowsMarkType(o.type)&&(r.activeMarks=o.addToSet(r.activeMarks))}if(r==t)break}}}]),e}();function fe(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function de(e){var t={};for(var n in e)t[n]=e[n];return t}function pe(e,t){var n=t.schema.nodes,r=function(r){var o=n[r];if(!o.allowsMarkType(e))return"continue";var i=[];return function e(n){i.push(n);for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;r||(r=ve(n).createDocumentFragment());var o=r,i=[];return e.forEach((function(e){if(i.length||e.marks.length){for(var r=0,a=0;r1&&void 0!==arguments[1]?arguments[1]:{},n=this.serializeNodeInner(e,t),r=e.marks.length-1;r>=0;r--){var o=this.serializeMark(e.marks[r],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(n),n=o.dom)}return n}},{key:"serializeMark",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=this.marks[t.type.name];return o&&e.renderSpec(ve(r),o(t,n))}}],[{key:"renderSpec",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("string"==typeof n)return{dom:t.createTextNode(n)};if(null!=n.nodeType)return{dom:n};if(n.dom&&null!=n.dom.nodeType)return n;var o,i=n[0],a=i.indexOf(" ");a>0&&(r=i.slice(0,a),i=i.slice(a+1));var s=r?t.createElementNS(r,i):t.createElement(i),l=n[1],u=1;if(l&&"object"==typeof l&&null==l.nodeType&&!Array.isArray(l))for(var c in u=2,l)if(null!=l[c]){var f=c.indexOf(" ");f>0?s.setAttributeNS(c.slice(0,f),c.slice(f+1),l[c]):s.setAttribute(c,l[c])}for(var d=u;du)throw new RangeError("Content hole must be the only child of its parent node");return{dom:s,contentDOM:s}}var h=e.renderSpec(t,p,r),m=h.dom,v=h.contentDOM;if(s.appendChild(m),v){if(o)throw new RangeError("Multiple content holes");o=v}}return{dom:s,contentDOM:o}}},{key:"fromSchema",value:function(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}},{key:"nodesFromSchema",value:function(e){var t=me(e.nodes);return t.text||(t.text=function(e){return e.text}),t}},{key:"marksFromSchema",value:function(e){return me(e.marks)}}]),e}();function me(e){var t={};for(var n in e){var r=e[n].spec.toDOM;r&&(t[n]=r)}return t}function ve(e){return e.document||window.document}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(e,t){for(var n=0;n0}},{key:"deletedBefore",get:function(){return(5&this.delInfo)>0}},{key:"deletedAfter",get:function(){return(6&this.delInfo)>0}},{key:"deletedAcross",get:function(){return(4&this.delInfo)>0}}]),e}(),d=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(Object(a.a)(this,e),this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}return Object(s.a)(e,[{key:"recover",value:function(e){var t=0,n=c(e);if(!this.inverted)for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!0)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.inverted?2:1,i=this.inverted?1:2,a=0;ae)break;var l=this.ranges[a+o],c=this.ranges[a+i],d=s+l;if(e<=d){var p=s+r+((l?e==s?-1:e==d?1:t:t)<0?0:c);if(n)return p;var h=e==(t<0?s:d)?null:a/3+(e-s)*u,m=e==s?2:e==d?1:4;return(t<0?e!=s:e!=d)&&(m|=8),new f(p,m,h)}r+=c-l}return n?e+r:new f(e+r,0,null)}},{key:"touches",value:function(e,t){for(var n=0,r=c(t),o=this.inverted?2:1,i=this.inverted?1:2,a=0;ae)break;var l=this.ranges[a+o];if(e<=s+l&&a==3*r)return!0;n+=this.ranges[a+i]-l}return!1}},{key:"forEach",value:function(e){for(var t=this.inverted?2:1,n=this.inverted?1:2,r=0,o=0;r0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length;Object(a.a)(this,e),this.maps=t,this.mirror=n,this.from=r,this.to=o}return Object(s.a)(e,[{key:"slice",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.maps.length;return new e(this.maps,this.mirror,t,n)}},{key:"copy",value:function(){return new e(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}},{key:"appendMap",value:function(e,t){this.to=this.maps.push(e),null!=t&&this.setMirror(this.maps.length-1,t)}},{key:"appendMapping",value:function(e){for(var t=0,n=this.maps.length;t=0;t--){var r=e.getMirror(t);this.appendMap(e.maps[t].invert(),null!=r&&r>t?n-r-1:void 0)}}},{key:"invert",value:function(){var t=new e;return t.appendMappingInverted(this),t}},{key:"map",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(this.mirror)return this._map(e,t,!0);for(var n=this.from;n1&&void 0!==arguments[1]?arguments[1]:1;return this._map(e,t,!1)}},{key:"_map",value:function(e,t,n){for(var r=0,o=this.from;oo&&a=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(m);m.jsonID("addMark",y);var b=function(e){Object(o.a)(n,e);var t=Object(i.a)(n);function n(e,r,o){var i;return Object(a.a)(this,n),(i=t.call(this)).from=e,i.to=r,i.mark=o,i}return Object(s.a)(n,[{key:"apply",value:function(e){var t=this,n=e.slice(this.from,this.to),r=new l.Slice(g(n.content,(function(e){return e.mark(t.mark.removeFromSet(e.marks))}),e),n.openStart,n.openEnd);return v.fromReplace(e,this.from,this.to,r)}},{key:"invert",value:function(){return new y(this.from,this.to,this.mark)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}},{key:"merge",value:function(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}},{key:"toJSON",value:function(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}}]),n}(m);m.jsonID("removeMark",b);var w=function(e){Object(o.a)(n,e);var t=Object(i.a)(n);function n(e,r,o){var i,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Object(a.a)(this,n),(i=t.call(this)).from=e,i.to=r,i.slice=o,i.structure=s,i}return Object(s.a)(n,[{key:"apply",value:function(e){return this.structure&&x(e,this.from,this.to)?v.fail("Structure replace would overwrite content"):v.fromReplace(e,this.from,this.to,this.slice)}},{key:"getMap",value:function(){return new d([this.from,this.to-this.from,this.slice.size])}},{key:"invert",value:function(e){return new n(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new n(t.pos,Math.max(t.pos,r.pos),this.slice)}},{key:"merge",value:function(e){if(!(e instanceof n)||e.structure||this.structure)return null;if(this.from+this.slice.size!=e.from||this.slice.openEnd||e.slice.openStart){if(e.to!=this.from||this.slice.openStart||e.slice.openEnd)return null;var t=this.slice.size+e.slice.size==0?l.Slice.empty:new l.Slice(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new n(e.from,this.to,t,this.structure)}var r=this.slice.size+e.slice.size==0?l.Slice.empty:new l.Slice(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new n(this.from,this.to+(e.to-e.from),r,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to)throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new n(t.from,t.to,l.Slice.fromJSON(e,t.slice),!!t.structure)}}]),n}(m);m.jsonID("replace",w);var k=function(e){Object(o.a)(n,e);var t=Object(i.a)(n);function n(e,r,o,i,s,l){var u,c=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return Object(a.a)(this,n),(u=t.call(this)).from=e,u.to=r,u.gapFrom=o,u.gapTo=i,u.slice=s,u.insert=l,u.structure=c,u}return Object(s.a)(n,[{key:"apply",value:function(e){if(this.structure&&(x(e,this.from,this.gapFrom)||x(e,this.gapTo,this.to)))return v.fail("Structure gap-replace would overwrite content");var t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return v.fail("Gap is not a flat range");var n=this.slice.insertAt(this.insert,t.content);return n?v.fromReplace(e,this.from,this.to,n):v.fail("Content does not fit in gap")}},{key:"getMap",value:function(){return new d([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}},{key:"invert",value:function(e){var t=this.gapTo-this.gapFrom;return new n(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}},{key:"map",value:function(e){var t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),o=e.map(this.gapFrom,-1),i=e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||or.pos?null:new n(t.pos,r.pos,o,i,this.slice,this.insert,this.structure)}},{key:"toJSON",value:function(){var e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.from||"number"!=typeof t.to||"number"!=typeof t.gapFrom||"number"!=typeof t.gapTo||"number"!=typeof t.insert)throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(t.from,t.to,t.gapFrom,t.gapTo,l.Slice.fromJSON(e,t.slice),t.insert,!!t.structure)}}]),n}(m);function x(e,t,n){for(var r=e.resolve(t),o=n-t,i=r.depth;o>0&&i>0&&r.indexAfter(i)==r.node(i).childCount;)i--,o--;if(o>0)for(var a=r.node(i).maybeChild(r.indexAfter(i));o>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,o--}return!1}function O(e,t,n){return(0==t||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function C(e){for(var t=e.parent.content.cutByIndex(e.startIndex,e.endIndex),n=e.depth;;--n){var r=e.$from.node(n),o=e.$from.index(n),i=e.$to.indexAfter(n);if(n2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=A(e,t),i=o&&E(r,t);return i?o.map(j).concat({type:t,attrs:n}).concat(i.map(j)):null}function j(e){return{type:e,attrs:null}}function A(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.contentMatchAt(r).findWrapping(t);if(!i)return null;var a=i.length?i[0]:t;return n.canReplaceWith(r,o,a)?i:null}function E(e,t){var n=e.parent,r=e.startIndex,o=e.endIndex,i=n.child(r),a=t.contentMatch.findWrapping(i.type);if(!a)return null;for(var s=(a.length?a[a.length-1]:t).contentMatch,l=r;s&&l2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.resolve(t),i=o.depth-n,a=r&&r[r.length-1]||o.parent;if(i<0||o.parent.type.spec.isolating||!o.parent.canReplace(o.index(),o.parent.childCount)||!a.type.validContent(o.parent.content.cutByIndex(o.index(),o.parent.childCount)))return!1;for(var s=o.depth-1,l=n-2;s>i;s--,l--){var u=o.node(s),c=o.index(s);if(u.type.spec.isolating)return!1;var f=u.content.cutByIndex(c,u.childCount),d=r&&r[l]||u;if(d!=u&&(f=f.replaceChild(0,d.type.create(d.attrs))),!u.canReplace(c+1,u.childCount)||!d.type.validContent(f))return!1}var p=o.indexAfter(i),h=r&&r[0];return o.node(i).canReplaceWith(p,p,h?h.type:o.node(i+1).type)}function L(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3?arguments[3]:void 0,o=e.doc.resolve(t),i=l.Fragment.empty,a=l.Fragment.empty,s=o.depth,u=o.depth-n,c=n-1;s>u;s--,c--){i=l.Fragment.from(o.node(s).copy(i));var f=r&&r[c];a=l.Fragment.from(f?f.type.create(f.attrs,a):o.node(s).copy(a))}e.step(new w(t,t,new l.Slice(i.append(a),n,n),!0))}function P(e,t){var n=e.resolve(t),r=n.index();return R(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(r,r+1)}function R(e,t){return!(!e||!t||e.isLeaf||!e.canAppend(t))}function H(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=e.resolve(t),o=r.depth;;o--){var i=void 0,a=void 0,s=r.index(o);if(o==r.depth?(i=r.nodeBefore,a=r.nodeAfter):n>0?(i=r.node(o+1),s++,a=r.node(o).maybeChild(s)):(i=r.node(o).maybeChild(s-1),a=r.node(o+1)),i&&!i.isTextblock&&R(i,a)&&r.node(o).canReplace(s,s+1))return t;if(0==o)break;t=n<0?r.before(o):r.after(o)}}function N(e,t,n){var r=new w(t-n,t+n,l.Slice.empty,!0);e.step(r)}function F(e,t,n){var r=e.resolve(t);if(!n.content.size)return t;for(var o=n.content,i=0;i=0;s--){var l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,u=r.index(s)+(l>0?1:0),c=r.node(s),f=!1;if(1==a)f=c.canReplace(u,u,o);else{var d=c.contentMatchAt(u).findWrapping(o.firstChild.type);f=d&&c.canReplaceWith(u,u,d[0])}if(f)return 0==l?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function V(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:l.Slice.empty;if(t==n&&!r.size)return null;var o=e.resolve(t),i=e.resolve(n);return z(o,i,r)?new w(t,n,r):new _(o,i,r).fit()}function z(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}m.jsonID("replaceAround",k);var _=function(){function e(t,n,r){Object(a.a)(this,e),this.$from=t,this.$to=n,this.unplaced=r,this.frontier=[],this.placed=l.Fragment.empty;for(var o=0;o<=t.depth;o++){var i=t.node(o);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(o))})}for(var s=t.depth;s>0;s--)this.placed=l.Fragment.from(t.node(s).copy(this.placed))}return Object(s.a)(e,[{key:"depth",get:function(){return this.frontier.length-1}},{key:"fit",value:function(){for(;this.unplaced.size;){var e=this.findFittable();e?this.placeNodes(e):this.openMore()||this.dropNode()}var t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,r=this.$from,o=this.close(t<0?this.$to:r.doc.resolve(t));if(!o)return null;for(var i=this.placed,a=r.depth,s=o.depth;a&&s&&1==i.childCount;)i=i.firstChild.content,a--,s--;var u=new l.Slice(i,a,s);return t>-1?new k(r.pos,t,this.$to.pos,this.$to.end(),u,n):u.size||r.pos!=this.$to.pos?new w(r.pos,o.pos,u):null}},{key:"findFittable",value:function(){for(var e=1;e<=2;e++)for(var t=this.unplaced.openStart;t>=0;t--)for(var n=null,r=(t?(n=$(this.unplaced.content,t-1).firstChild).content:this.unplaced.content).firstChild,o=this.depth;o>=0;o--){var i=this.frontier[o],a=i.type,s=i.match,u=void 0,c=null;if(1==e&&(r?s.matchType(r.type)||(c=s.fillBefore(l.Fragment.from(r),!1)):n&&a.compatibleContent(n.type)))return{sliceDepth:t,frontierDepth:o,parent:n,inject:c};if(2==e&&r&&(u=s.findWrapping(r.type)))return{sliceDepth:t,frontierDepth:o,parent:n,wrap:u};if(n&&s.matchType(n.type))break}}},{key:"openMore",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=$(t,n);return!(!o.childCount||o.firstChild.isLeaf)&&(this.unplaced=new l.Slice(t,n+1,Math.max(r,o.size+n>=t.size-r?n+1:0)),!0)}},{key:"dropNode",value:function(){var e=this.unplaced,t=e.content,n=e.openStart,r=e.openEnd,o=$(t,n);if(o.childCount<=1&&n>0){var i=t.size-n<=n+o.size;this.unplaced=new l.Slice(B(t,n-1,1),n-1,i?n-1:r)}else this.unplaced=new l.Slice(B(t,n,1),n,r)}},{key:"placeNodes",value:function(e){for(var t=e.sliceDepth,n=e.frontierDepth,r=e.parent,o=e.inject,i=e.wrap;this.depth>n;)this.closeFrontierNode();if(i)for(var a=0;a1||0==c||g.content.size)&&(h=y,d.push(q(g.mark(m.allowedMarks(g.marks)),1==f?c:0,f==u.childCount?v:-1)))}var b=f==u.childCount;b||(v=-1),this.placed=I(this.placed,n,l.Fragment.from(d)),this.frontier[n].match=h,b&&v<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(var w=0,k=u;w1&&r==this.$to.end(--n);)++r;return r}},{key:"findCloseLevel",value:function(e){e:for(var t=Math.min(this.depth,e.depth);t>=0;t--){var n=this.frontier[t],r=n.match,o=n.type,i=t=0;s--){var l=this.frontier[s],u=l.match,c=W(e,s,l.type,u,!0);if(!c||c.childCount)continue e}return{depth:t,fit:a,move:i?e.doc.resolve(e.after(t+1)):e}}}}},{key:"close",value:function(e){var t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=I(this.placed,t.depth,t.fit)),e=t.move;for(var n=t.depth+1;n<=e.depth;n++){var r=e.node(n),o=r.type.contentMatch.fillBefore(r.content,!0,e.index(n));this.openFrontierNode(r.type,r.attrs,o)}return e}},{key:"openFrontierNode",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2?arguments[2]:void 0,r=this.frontier[this.depth];r.match=r.match.matchType(e),this.placed=I(this.placed,this.depth,l.Fragment.from(e.create(t,n))),this.frontier.push({type:e,match:e.contentMatch})}},{key:"closeFrontierNode",value:function(){var e=this.frontier.pop().match.fillBefore(l.Fragment.empty,!0);e.childCount&&(this.placed=I(this.placed,this.frontier.length,e))}}]),e}();function B(e,t,n){return 0==t?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(B(e.firstChild.content,t-1,n)))}function I(e,t,n){return 0==t?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(I(e.lastChild.content,t-1,n)))}function $(e,t){for(var n=0;n1&&(r=r.replaceChild(0,q(r.firstChild,t-1,1==r.childCount?n-1:0))),t>0&&(r=e.type.contentMatch.fillBefore(r).append(r),n<=0&&(r=r.append(e.type.contentMatch.matchFragment(r).fillBefore(l.Fragment.empty,!0)))),e.copy(r)}function W(e,t,n,r,o){var i=e.node(t),a=o?e.indexAfter(t):e.index(t);if(a==i.childCount&&!n.compatibleContent(i.type))return null;var s=r.fillBefore(i.content,!0,a);return s&&!function(e,t,n){for(var r=n;rr){var a=o.contentMatchAt(0),s=a.fillBefore(e).append(e);e=s.append(a.matchFragment(s).fillBefore(l.Fragment.empty,!0))}return e}function G(e,t){for(var n=[],r=Math.min(e.depth,t.depth);r>=0;r--){var o=e.start(r);if(ot.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(o==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==o-1)&&n.push(r)}return n}var J=Error;((J=function e(t){var n=Error.call(this,t);return n.__proto__=e.prototype,n}).prototype=Object.create(Error.prototype)).constructor=J,J.prototype.name="TransformError";var Z=function(){function e(t){Object(a.a)(this,e),this.doc=t,this.steps=[],this.docs=[],this.mapping=new p}return Object(s.a)(e,[{key:"before",get:function(){return this.docs.length?this.docs[0]:this.doc}},{key:"step",value:function(e){var t=this.maybeStep(e);if(t.failed)throw new J(t.failed);return this}},{key:"maybeStep",value:function(e){var t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}},{key:"docChanged",get:function(){return this.steps.length>0}},{key:"addStep",value:function(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}},{key:"replace",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:l.Slice.empty,r=V(this.doc,e,t,n);return r&&this.step(r),this}},{key:"replaceWith",value:function(e,t,n){return this.replace(e,t,new l.Slice(l.Fragment.from(n),0,0))}},{key:"delete",value:function(e,t){return this.replace(e,t,l.Slice.empty)}},{key:"insert",value:function(e,t){return this.replaceWith(e,e,t)}},{key:"replaceRange",value:function(e,t,n){return function(e,t,n,r){if(!r.size)return e.deleteRange(t,n);var o=e.doc.resolve(t),i=e.doc.resolve(n);if(z(o,i,r))return e.step(new w(t,n,r));var a=G(o,e.doc.resolve(n));0==a[a.length-1]&&a.pop();var s=-(o.depth+1);a.unshift(s);for(var u=o.depth,c=o.pos-1;u>0;u--,c--){var f=o.node(u).type.spec;if(f.defining||f.definingAsContext||f.isolating)break;a.indexOf(u)>-1?s=u:o.before(u)==c&&a.splice(1,0,-u)}for(var d=a.indexOf(s),p=[],h=r.openStart,m=r.content,v=0;;v++){var g=m.firstChild;if(p.push(g),v==r.openStart)break;m=g.content}for(var y=h-1;y>=0;y--){var b=p[y].type,k=U(b);if(k&&o.node(d).type!=b)h=y;else if(k||!b.isTextblock)break}for(var x=r.openStart;x>=0;x--){var O=(x+h+1)%(r.openStart+1),C=p[O];if(C)for(var S=0;S=0&&(e.replace(t,n,r),!(e.steps.length>M));T--){var L=a[T];L<0||(t=o.before(L),n=i.after(L))}}(this,e,t,n),this}},{key:"replaceRangeWith",value:function(e,t,n){return function(e,t,n,r){if(!r.isInline&&t==n&&e.doc.resolve(t).parent.content.size){var o=function(e,t,n){var r=e.resolve(t);if(r.parent.canReplaceWith(r.index(),r.index(),n))return t;if(0==r.parentOffset)for(var o=r.depth-1;o>=0;o--){var i=r.index(o);if(r.node(o).canReplaceWith(i,i,n))return r.before(o+1);if(i>0)return null}if(r.parentOffset==r.parent.content.size)for(var a=r.depth-1;a>=0;a--){var s=r.indexAfter(a);if(r.node(a).canReplaceWith(s,s,n))return r.after(a+1);if(s0&&(l||r.node(s-1).canReplace(r.index(s-1),o.indexAfter(s-1))))return e.delete(r.before(s),o.after(s))}for(var u=1;u<=r.depth&&u<=o.depth;u++)if(t-r.start(u)==r.depth-u&&n>r.end(u)&&o.end(u)-n!=o.depth-u)return e.delete(r.before(u),n);e.delete(t,n)}(this,e,t),this}},{key:"lift",value:function(e,t){return function(e,t,n){for(var r=t.$from,o=t.$to,i=t.depth,a=r.before(i+1),s=o.after(i+1),u=a,c=s,f=l.Fragment.empty,d=0,p=i,h=!1;p>n;p--)h||r.index(p)>0?(h=!0,f=l.Fragment.from(r.node(p).copy(f)),d++):u--;for(var m=l.Fragment.empty,v=0,g=i,y=!1;g>n;g--)y||o.after(g+1)1&&void 0!==arguments[1]?arguments[1]:1;return N(this,e,t),this}},{key:"wrap",value:function(e,t){return function(e,t,n){for(var r=l.Fragment.empty,o=n.length-1;o>=0;o--){if(r.size){var i=n[o].type.contentMatch.matchFragment(r);if(!i||!i.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=l.Fragment.from(n[o].type.create(n[o].attrs,r))}var a=t.start,s=t.end;e.step(new k(a,s,a,s,new l.Slice(r,0,0),n.length,!0))}(this,e,t),this}},{key:"setBlockType",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return D(this,e,t,n,r),this}},{key:"setNodeMarkup",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return M(this,e,t,n,r),this}},{key:"split",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2?arguments[2]:void 0;return L(this,e,t,n),this}},{key:"addMark",value:function(e,t,n){return function(e,t,n,r){var o,i,a=[],s=[];e.doc.nodesBetween(t,n,(function(e,l,u){if(e.isInline){var c=e.marks;if(!r.isInSet(c)&&u.type.allowsMarkType(r.type)){for(var f=Math.max(l,t),d=Math.min(l+e.nodeSize,n),p=r.addToSet(c),h=0;h3&&void 0!==arguments[3]?arguments[3]:n.contentMatch,o=e.doc.nodeAt(t),i=[],a=t+1,s=0;s=0;h--)e.step(i[h])}(this,e,t,n),this}}]),e}()},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(39);var o=n(36);function i(e){return function(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Object(o.a)(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";e.exports=n(119)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(32);function o(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Object(r.a)(e,t)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var r=n(13),o=n(43),i=n(44),a=n(22);function s(e,t){if(t&&("object"===Object(i.a)(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Object(a.a)(e)}function l(e){var t=Object(o.a)();return function(){var n,o=Object(r.a)(e);if(t){var i=Object(r.a)(this).constructor;n=Reflect.construct(o,arguments,i)}else n=o.apply(this,arguments);return s(this,n)}}},function(e,t,n){"use strict";function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(36);function o(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Object(r.a)(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){l=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(l)throw a}}}}},,function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(13);function o(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Object(r.a)(e)););return e}function i(){return i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=o(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},i.apply(this,arguments)}},function(e,t,n){"use strict";function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(o){return!1}}()?Object.assign:function(e,t){for(var n,s,l=a(e),u=1;u1&&l.forEach((function(n){var o;r[n]=e(((o={})[n]=t[n],o))})),r},f=function(e,t,n,r,i){var a={};return r.slice(0,e.length).forEach((function(r,s){var l,u=e[s],c=t(r,n,i);u?o()(a,((l={})[u]=o()({},a[u],c),l)):o()(a,c)})),a},d=function(e,t,n,r,i){var a={};for(var l in r){var u=e[l],c=t(r[l],n,i);if(u){var f,d=s(u);o()(a,((f={})[d]=o()({},a[d],c),f))}else o()(a,c)}return a},p=function(e){var t=e.properties,n=e.property,r=e.scale,o=e.transform,i=void 0===o?l:o,a=e.defaultScale;t=t||[n];var s=function(e,n,r){var o={},a=i(e,n,r);if(null!==a)return t.forEach((function(e){o[e]=a})),o};return s.scale=r,s.defaults=a,s},h=function(e){void 0===e&&(e={});var t={};return Object.keys(e).forEach((function(n){var r=e[n];t[n]=!0!==r?"function"!==typeof r?p(r):r:p({property:n,scale:n})})),c(t)},m=function(){for(var e={},t=arguments.length,n=new Array(t),r=0;r1?e:100*e+"%")}},height:{property:"height",scale:"sizes"},minWidth:{property:"minWidth",scale:"sizes"},minHeight:{property:"minHeight",scale:"sizes"},maxWidth:{property:"maxWidth",scale:"sizes"},maxHeight:{property:"maxHeight",scale:"sizes"},size:{properties:["width","height"],scale:"sizes"},overflow:!0,overflowX:!0,overflowY:!0,display:!0,verticalAlign:!0}),g=v,y={color:{property:"color",scale:"colors"},backgroundColor:{property:"backgroundColor",scale:"colors"},opacity:!0};y.bg=y.backgroundColor;var b=h(y),w=b,k=h({fontFamily:{property:"fontFamily",scale:"fonts"},fontSize:{property:"fontSize",scale:"fontSizes",defaultScale:[12,14,16,20,24,32,48,64,72]},fontWeight:{property:"fontWeight",scale:"fontWeights"},lineHeight:{property:"lineHeight",scale:"lineHeights"},letterSpacing:{property:"letterSpacing",scale:"letterSpacings"},textAlign:!0,fontStyle:!0}),x=k,O=h({alignItems:!0,alignContent:!0,justifyItems:!0,justifyContent:!0,flexWrap:!0,flexDirection:!0,flex:!0,flexGrow:!0,flexShrink:!0,flexBasis:!0,justifySelf:!0,alignSelf:!0,order:!0}),C=O,S={space:[0,4,8,16,32,64,128,256,512]},j=h({gridGap:{property:"gridGap",scale:"space",defaultScale:S.space},gridColumnGap:{property:"gridColumnGap",scale:"space",defaultScale:S.space},gridRowGap:{property:"gridRowGap",scale:"space",defaultScale:S.space},gridColumn:!0,gridRow:!0,gridAutoFlow:!0,gridAutoColumns:!0,gridAutoRows:!0,gridTemplateColumns:!0,gridTemplateRows:!0,gridTemplateAreas:!0,gridArea:!0}),A=j,E={border:{property:"border",scale:"borders"},borderWidth:{property:"borderWidth",scale:"borderWidths"},borderStyle:{property:"borderStyle",scale:"borderStyles"},borderColor:{property:"borderColor",scale:"colors"},borderRadius:{property:"borderRadius",scale:"radii"},borderTop:{property:"borderTop",scale:"borders"},borderTopLeftRadius:{property:"borderTopLeftRadius",scale:"radii"},borderTopRightRadius:{property:"borderTopRightRadius",scale:"radii"},borderRight:{property:"borderRight",scale:"borders"},borderBottom:{property:"borderBottom",scale:"borders"},borderBottomLeftRadius:{property:"borderBottomLeftRadius",scale:"radii"},borderBottomRightRadius:{property:"borderBottomRightRadius",scale:"radii"},borderLeft:{property:"borderLeft",scale:"borders"},borderX:{properties:["borderLeft","borderRight"],scale:"borders"},borderY:{properties:["borderTop","borderBottom"],scale:"borders"},borderTopWidth:{property:"borderTopWidth",scale:"borderWidths"},borderTopColor:{property:"borderTopColor",scale:"colors"},borderTopStyle:{property:"borderTopStyle",scale:"borderStyles"}};E.borderTopLeftRadius={property:"borderTopLeftRadius",scale:"radii"},E.borderTopRightRadius={property:"borderTopRightRadius",scale:"radii"},E.borderBottomWidth={property:"borderBottomWidth",scale:"borderWidths"},E.borderBottomColor={property:"borderBottomColor",scale:"colors"},E.borderBottomStyle={property:"borderBottomStyle",scale:"borderStyles"},E.borderBottomLeftRadius={property:"borderBottomLeftRadius",scale:"radii"},E.borderBottomRightRadius={property:"borderBottomRightRadius",scale:"radii"},E.borderLeftWidth={property:"borderLeftWidth",scale:"borderWidths"},E.borderLeftColor={property:"borderLeftColor",scale:"colors"},E.borderLeftStyle={property:"borderLeftStyle",scale:"borderStyles"},E.borderRightWidth={property:"borderRightWidth",scale:"borderWidths"},E.borderRightColor={property:"borderRightColor",scale:"colors"},E.borderRightStyle={property:"borderRightStyle",scale:"borderStyles"};var D=h(E),M=D,T={background:!0,backgroundImage:!0,backgroundSize:!0,backgroundPosition:!0,backgroundRepeat:!0};T.bgImage=T.backgroundImage,T.bgSize=T.backgroundSize,T.bgPosition=T.backgroundPosition,T.bgRepeat=T.backgroundRepeat;var L=h(T),P=L,R={space:[0,4,8,16,32,64,128,256,512]},H=h({position:!0,zIndex:{property:"zIndex",scale:"zIndices"},top:{property:"top",scale:"space",defaultScale:R.space},right:{property:"right",scale:"space",defaultScale:R.space},bottom:{property:"bottom",scale:"space",defaultScale:R.space},left:{property:"left",scale:"space",defaultScale:R.space}}),N=H,F={space:[0,4,8,16,32,64,128,256,512]},V=function(e){return"number"===typeof e&&!isNaN(e)},z=function(e,t){if(!V(e))return u(t,e,e);var n=e<0,r=Math.abs(e),o=u(t,r,r);return V(o)?o*(n?-1:1):n?"-"+o:o},_={};_.margin={margin:{property:"margin",scale:"space",transform:z,defaultScale:F.space},marginTop:{property:"marginTop",scale:"space",transform:z,defaultScale:F.space},marginRight:{property:"marginRight",scale:"space",transform:z,defaultScale:F.space},marginBottom:{property:"marginBottom",scale:"space",transform:z,defaultScale:F.space},marginLeft:{property:"marginLeft",scale:"space",transform:z,defaultScale:F.space},marginX:{properties:["marginLeft","marginRight"],scale:"space",transform:z,defaultScale:F.space},marginY:{properties:["marginTop","marginBottom"],scale:"space",transform:z,defaultScale:F.space}},_.margin.m=_.margin.margin,_.margin.mt=_.margin.marginTop,_.margin.mr=_.margin.marginRight,_.margin.mb=_.margin.marginBottom,_.margin.ml=_.margin.marginLeft,_.margin.mx=_.margin.marginX,_.margin.my=_.margin.marginY,_.padding={padding:{property:"padding",scale:"space",defaultScale:F.space},paddingTop:{property:"paddingTop",scale:"space",defaultScale:F.space},paddingRight:{property:"paddingRight",scale:"space",defaultScale:F.space},paddingBottom:{property:"paddingBottom",scale:"space",defaultScale:F.space},paddingLeft:{property:"paddingLeft",scale:"space",defaultScale:F.space},paddingX:{properties:["paddingLeft","paddingRight"],scale:"space",defaultScale:F.space},paddingY:{properties:["paddingTop","paddingBottom"],scale:"space",defaultScale:F.space}},_.padding.p=_.padding.padding,_.padding.pt=_.padding.paddingTop,_.padding.pr=_.padding.paddingRight,_.padding.pb=_.padding.paddingBottom,_.padding.pl=_.padding.paddingLeft,_.padding.px=_.padding.paddingX,_.padding.py=_.padding.paddingY;var B=h(_.margin),I=h(_.padding),$=m(B,I),q=h({boxShadow:{property:"boxShadow",scale:"shadows"},textShadow:{property:"textShadow",scale:"shadows"}}),W=q,U=n(41),K=function(e){var t,n,r=e.scale,o=e.prop,i=void 0===o?"variant":o,a=e.variants,s=void 0===a?{}:a,l=e.key;n=Object.keys(s).length?function(e,t,n){return Object(U.default)(u(t,e,null))(n.theme)}:function(e,t){return u(t,e,null)},n.scale=r||l,n.defaults=s;var f=((t={})[i]=n,t);return c(f)},G=K({key:"buttons"}),J=K({key:"textStyles",prop:"textStyle"}),Z=K({key:"colorStyles",prop:"colors"}),Y=g.width,X=g.height,Q=g.minWidth,ee=g.minHeight,te=g.maxWidth,ne=g.maxHeight,re=g.size,oe=g.verticalAlign,ie=g.display,ae=g.overflow,se=g.overflowX,le=g.overflowY,ue=w.opacity,ce=x.fontSize,fe=x.fontFamily,de=x.fontWeight,pe=x.lineHeight,he=x.textAlign,me=x.fontStyle,ve=x.letterSpacing,ge=C.alignItems,ye=C.alignContent,be=C.justifyItems,we=C.justifyContent,ke=C.flexWrap,xe=C.flexDirection,Oe=C.flex,Ce=C.flexGrow,Se=C.flexShrink,je=C.flexBasis,Ae=C.justifySelf,Ee=C.alignSelf,De=C.order,Me=A.gridGap,Te=A.gridColumnGap,Le=A.gridRowGap,Pe=A.gridColumn,Re=A.gridRow,He=A.gridAutoFlow,Ne=A.gridAutoColumns,Fe=A.gridAutoRows,Ve=A.gridTemplateColumns,ze=A.gridTemplateRows,_e=A.gridTemplateAreas,Be=A.gridArea,Ie=M.borderWidth,$e=M.borderStyle,qe=M.borderColor,We=M.borderTop,Ue=M.borderRight,Ke=M.borderBottom,Ge=M.borderLeft,Je=M.borderRadius,Ze=P.backgroundImage,Ye=P.backgroundSize,Xe=P.backgroundPosition,Qe=P.backgroundRepeat,et=N.zIndex,tt=N.top,nt=N.right,rt=N.bottom,ot=N.left,it=function(e){var t=e.prop,n=e.cssProperty,r=e.alias,o=e.key,i=e.transformValue,a=e.scale,s=e.properties,l={};return l[t]=p({properties:s,property:n||t,scale:o,defaultScale:a,transform:i}),r&&(l[r]=l[t]),c(l)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flex=t.Box=void 0;l(n(10));var r=l(n(58)),o=n(19),i=function(e){if(e&&e.__esModule)return e;var t=s();if(t&&t.has(e))return t.get(e);var n={};if(null!=e){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}}n.default=e,t&&t.set(e,n);return n}(n(41)),a=l(n(42));function s(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function l(e){return e&&e.__esModule?e:{default:e}}var u=(0,r.default)("div",{shouldForwardProp:a.default})({boxSizing:"border-box",margin:0,minWidth:0},(function(e){return(0,i.default)(e.__css)(e.theme)}),(function(e){var t=e.theme,n=e.variant,r=e.tx,o=void 0===r?"variants":r;return(0,i.default)((0,i.get)(t,o+"."+n,(0,i.get)(t,n)))(t)}),(function(e){return(0,i.default)(e.sx)(e.theme)}),(function(e){return e.css}),(0,o.compose)(o.space,o.layout,o.typography,o.color,o.flexbox));t.Box=u;var c=(0,r.default)(u)({display:"flex"});t.Flex=c},,function(e,t,n){"use strict";function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";e.exports=n(107)},,function(e,t,n){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(79)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(2),o=n(3),i=function(e,t){return function(n){Array.isArray(e)||(e=[e]);for(var r=0,o=e.length;r1&&void 0!==arguments[1]?arguments[1]:1;return function(n){var o=r.Selection.findFrom(n.doc.resolve(e),t,!0);return o?n.setSelection(o):n}},l=function(e){return e.type&&e.type.spec.selectable},u=function(e,t,n){return function(e){return l(e)&&e.type.isLeaf}(e)?n.setSelection(new r.NodeSelection(n.doc.resolve(t))):s(t)(n)},c=function(e){return e instanceof r.NodeSelection},f=function(e,t){return Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e},d=function(e){return Object.assign(Object.create(e),e).setTime(Date.now())},p=function(e,t){return function(n){var r=n.doc.nodeAt(e),o=n.doc.resolve(e);if(h(o,t)){var i=(n=n.replaceWith(e,e+r.nodeSize,t)).selection.$from.pos-1;return n=s(Math.max(i,0),-1)(n),n=s(n.selection.$from.start())(n),d(n)}return n}},h=function(e,t){var n=e.node(e.depth);return n&&n.type.validContent(t instanceof o.Fragment?t:o.Fragment.from(t))},m=function(e){return function(t){var n=t.doc.nodeAt(e);return d(t.delete(e,e+n.nodeSize))}},v=function(e,t){var n=e.index();return t instanceof o.Fragment?e.parent.canReplace(n,n,t):t instanceof o.Node&&e.parent.canReplaceWith(n,n,t.type)},g=function(e){return!e||"paragraph"===e.type.name&&2===e.nodeSize},y=function(e){return function(t){var n=t.$from;return b(n,e)}},b=function(e,t){for(var n=e.depth;n>0;n--){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}},w=function(e,t){return function(n){var r=y(e)(n);if(r)return C(r.pos,t)}},k=function(e){return function(t){return!!y(e)(t)}},x=function(e){return function(t){return y((function(t){return f(e,t)}))(t)}},O=function(e){var t=e.$from.nodeBefore,n=r.Selection.findFrom(e.$from,-1);if(n&&t){var o=x(t.type)(n);return o?o.pos:n.$from.pos}},C=function(e,t){var n=t(e),r=n.node.childNodes[n.offset];return n.node.nodeType===Node.TEXT_NODE?n.node.parentNode:r&&r.nodeType!==Node.TEXT_NODE?r:n.node},S=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!e)throw new Error('Invalid "node" parameter');var n=[];return e.descendants((function(e,r){if(n.push({node:e,pos:r}),!t)return!1})),n},j=function(e,t,n){if(!e)throw new Error('Invalid "node" parameter');if(!t)throw new Error('Invalid "predicate" parameter');return S(e,n).filter((function(e){return t(e.node)}))},A=function(e,t,n){return j(e,(function(e){return e.type===t}),n)};t.isNodeSelection=c,t.canInsert=v,t.findParentNode=y,t.findParentNodeClosestToPos=b,t.findParentDomRef=w,t.hasParentNode=k,t.findParentNodeOfType=x,t.findParentNodeOfTypeClosestToPos=function(e,t){return b(e,(function(e){return f(t,e)}))},t.hasParentNodeOfType=function(e){return function(t){return k((function(t){return f(e,t)}))(t)}},t.findParentDomRefOfType=function(e,t){return function(n){return w((function(t){return f(e,t)}),t)(n)}},t.findSelectedNodeOfType=function(e){return function(t){if(c(t)){var n=t.node,r=t.$from;if(f(e,n))return{node:n,pos:r.pos,depth:r.depth}}}},t.findPositionOfNodeBefore=O,t.findDomRefAtPos=C,t.flatten=S,t.findChildren=j,t.findTextNodes=function(e,t){return j(e,(function(e){return e.isText}),t)},t.findInlineNodes=function(e,t){return j(e,(function(e){return e.isInline}),t)},t.findBlockNodes=function(e,t){return j(e,(function(e){return e.isBlock}),t)},t.findChildrenByAttr=function(e,t,n){return j(e,(function(e){return!!t(e.attrs)}),n)},t.findChildrenByType=A,t.findChildrenByMark=function(e,t,n){return j(e,(function(e){return t.isInSet(e.marks)}),n)},t.contains=function(e,t){return!!A(e,t).length},t.removeParentNodeOfType=function(e){return function(t){var n=x(e)(t.selection);return n?m(n.pos)(t):t}},t.replaceParentNodeOfType=i,t.removeSelectedNode=function(e){if(c(e.selection)){var t=e.selection.$from.pos,n=e.selection.$to.pos;return d(e.delete(t,n))}return e},t.replaceSelectedNode=a,t.setTextSelection=s,t.safeInsert=function(e,t,n){return function(r){var o="number"===typeof t,s=r.selection.$from,f=o?r.doc.resolve(t):c(r.selection)?r.doc.resolve(s.pos+1):s,p=f.parent;if(c(r.selection)&&n&&r!==(r=a(e)(r)))return r;if(g(p)&&r!==(r=i(p.type,e)(r))){var h=l(e)?f.before(f.depth):f.pos;return u(e,h,r)}if(v(f,e)){r.insert(f.pos,e);var m=o?f.pos:l(e)?r.selection.$anchor.pos-1:r.selection.$anchor.pos;return d(u(e,m,r))}for(var y=f.depth;y>0;y--){var b=f.after(y),w=r.doc.resolve(b);if(v(w,e))return r.insert(b,e),d(u(e,b,r))}return r}},t.setParentNodeMarkup=function(e,t,n,r){return function(o){var i=x(e)(o.selection);return i?d(o.setNodeMarkup(i.pos,t,Object.assign({},i.node.attrs,n),r)):o}},t.selectParentNodeOfType=function(e){return function(t){if(!c(t.selection)){var n=x(e)(t.selection);if(n)return d(t.setSelection(r.NodeSelection.create(t.doc,n.pos)))}return t}},t.removeNodeBefore=function(e){var t=O(e.selection);return"number"===typeof t?m(t)(e):e}},function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)},o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=n(37),a=/[A-Z]|^ms/g,s=/_EMO_([^_]+?)_([^]*?)_EMO_/g,l=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!==typeof e},c=Object(i.a)((function(e){return l(e)?e:e.replace(a,"-$&").toLowerCase()})),f=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(s,(function(e,t,n){return p={name:t,styles:n,next:p},t}))}return 1===o[e]||l(e)||"number"!==typeof t||0===t?t:t+"px"};function d(e,t,n,r){if(null==n)return"";if(void 0!==n.__emotion_styles)return n;switch(typeof n){case"boolean":return"";case"object":if(1===n.anim)return p={name:n.name,styles:n.styles,next:p},n.name;if(void 0!==n.styles){var o=n.next;if(void 0!==o)for(;void 0!==o;)p={name:o.name,styles:o.styles,next:p},o=o.next;return n.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=P(e,360),t=P(t,100),n=P(n,100),0===t)r=o=i=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;r=a(l,s,e+1/3),o=a(l,s,e),i=a(l,s,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,r,l),f=!0,d="hsl"),e.hasOwnProperty("a")&&(n=e.a));var p,h,m;return n=L(n),{ok:f,format:e.format||d,r:u(255,c(t.r,0)),g:u(255,c(t.g,0)),b:u(255,c(t.b,0)),a:n}}(e);this._originalInput=e,this._r=n.r,this._g=n.g,this._b=n.b,this._a=n.a,this._roundA=l(100*this._a)/100,this._format=t.format||n.format,this._gradientType=t.gradientType,this._r<1&&(this._r=l(this._r)),this._g<1&&(this._g=l(this._g)),this._b<1&&(this._b=l(this._b)),this._ok=n.ok,this._tc_id=s++}function p(e,t,n){e=P(e,255),t=P(t,255),n=P(n,255);var r,o,i=c(e,t,n),a=u(e,t,n),s=(i+a)/2;if(i==a)r=o=0;else{var l=i-a;switch(o=s>.5?l/(2-i-a):l/(i+a),i){case e:r=(t-n)/l+(t>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(d(r));return i}function D(e,t){t=t||6;for(var n=d(e).toHsv(),r=n.h,o=n.s,i=n.v,a=[],s=1/t;t--;)a.push(d({h:r,s:o,v:i})),i=(i+s)%1;return a}d.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,t=r.g/255,n=r.b/255,.2126*(e<=.03928?e/12.92:o.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:o.pow((t+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:o.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=L(e),this._roundA=l(100*this._a)/100,this},toHsv:function(){var e=h(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=h(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=p(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=p(this._r,this._g,this._b),t=l(360*e.h),n=l(100*e.s),r=l(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return m(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,n,r,o){var i=[N(l(e).toString(16)),N(l(t).toString(16)),N(l(n).toString(16)),N(V(r))];if(o&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)&&i[3].charAt(0)==i[3].charAt(1))return i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0);return i.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:l(this._r),g:l(this._g),b:l(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+l(this._r)+", "+l(this._g)+", "+l(this._b)+")":"rgba("+l(this._r)+", "+l(this._g)+", "+l(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:l(100*P(this._r,255))+"%",g:l(100*P(this._g,255))+"%",b:l(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+l(100*P(this._r,255))+"%, "+l(100*P(this._g,255))+"%, "+l(100*P(this._b,255))+"%)":"rgba("+l(100*P(this._r,255))+"%, "+l(100*P(this._g,255))+"%, "+l(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(T[m(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+v(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var o=d(e);n="#"+v(o._r,o._g,o._b,o._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return t||!r||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return d(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(k,arguments)},darken:function(){return this._applyModification(x,arguments)},desaturate:function(){return this._applyModification(g,arguments)},saturate:function(){return this._applyModification(y,arguments)},greyscale:function(){return this._applyModification(b,arguments)},spin:function(){return this._applyModification(O,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(C,arguments)},monochromatic:function(){return this._applyCombination(D,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(S,arguments)},tetrad:function(){return this._applyCombination(j,arguments)}},d.fromRatio=function(e,t){if("object"==typeof e){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]="a"===r?e[r]:F(e[r]));e=n}return d(e,t)},d.equals=function(e,t){return!(!e||!t)&&d(e).toRgbString()==d(t).toRgbString()},d.random=function(){return d.fromRatio({r:f(),g:f(),b:f()})},d.mix=function(e,t,n){n=0===n?0:n||50;var r=d(e).toRgb(),o=d(t).toRgb(),i=n/100;return d({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},d.readability=function(e,t){var n=d(e),r=d(t);return(o.max(n.getLuminance(),r.getLuminance())+.05)/(o.min(n.getLuminance(),r.getLuminance())+.05)},d.isReadable=function(e,t,n){var r,o,i=d.readability(e,t);switch(o=!1,(r=function(e){var t,n;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),n=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==n&&"large"!==n&&(n="small");return{level:t,size:n}}(n)).level+r.size){case"AAsmall":case"AAAlarge":o=i>=4.5;break;case"AAlarge":o=i>=3;break;case"AAAsmall":o=i>=7}return o},d.mostReadable=function(e,t,n){var r,o,i,a,s=null,l=0;o=(n=n||{}).includeFallbackColors,i=n.level,a=n.size;for(var u=0;ul&&(l=r,s=d(t[u]));return d.isReadable(e,s,{level:i,size:a})||!o?s:(n.includeFallbackColors=!1,d.mostReadable(e,["#fff","#000"],n))};var M=d.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},T=d.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(M);function L(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function P(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"===typeof e&&-1!=e.indexOf("%")}(e);return e=u(t,c(0,parseFloat(e))),n&&(e=parseInt(e*t,10)/100),o.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function R(e){return u(1,c(0,e))}function H(e){return parseInt(e,16)}function N(e){return 1==e.length?"0"+e:""+e}function F(e){return e<=1&&(e=100*e+"%"),e}function V(e){return o.round(255*parseFloat(e)).toString(16)}function z(e){return H(e)/255}var _=function(){var e="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",t="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?",n="[\\s|\\(]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")[,|\\s]+("+e+")\\s*\\)?";return{CSS_UNIT:new RegExp(e),rgb:new RegExp("rgb"+t),rgba:new RegExp("rgba"+n),hsl:new RegExp("hsl"+t),hsla:new RegExp("hsla"+n),hsv:new RegExp("hsv"+t),hsva:new RegExp("hsva"+n),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function B(e){return!!_.CSS_UNIT.exec(e)}e.exports?e.exports=d:void 0===(r=function(){return d}.call(t,n,t,e))||(e.exports=r)}(Math)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Flex=t.Box=void 0;l(n(23));var r=l(n(58)),o=n(19),i=function(e){if(e&&e.__esModule)return e;var t=s();if(t&&t.has(e))return t.get(e);var n={};if(null!=e){var r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)){var i=r?Object.getOwnPropertyDescriptor(e,o):null;i&&(i.get||i.set)?Object.defineProperty(n,o,i):n[o]=e[o]}}n.default=e,t&&t.set(e,n);return n}(n(41)),a=l(n(42));function s(){if("function"!==typeof WeakMap)return null;var e=new WeakMap;return s=function(){return e},e}function l(e){return e&&e.__esModule?e:{default:e}}var u=(0,r.default)("div",{shouldForwardProp:a.default})({boxSizing:"border-box",margin:0,minWidth:0},(function(e){return(0,i.default)(e.__css)(e.theme)}),(function(e){var t=e.theme,n=e.variant,r=e.tx,o=void 0===r?"variants":r;return(0,i.default)((0,i.get)(t,o+"."+n,(0,i.get)(t,n)))(t)}),(function(e){return(0,i.default)(e.sx)(e.theme)}),(function(e){return e.css}),(0,o.compose)(o.space,o.layout,o.typography,o.color,o.flexbox));t.Box=u;var c=(0,r.default)(u)({display:"flex"});t.Flex=c},function(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return m})),n.d(t,"b",(function(){return v}));var r=n(32);var o=n(1);var i=function(){function e(e){this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.before=null}var t=e.prototype;return t.insert=function(e){if(this.ctr%(this.isSpeedy?65e3:1)===0){var t,n=function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t}(this);t=0===this.tags.length?this.before:this.tags[this.tags.length-1].nextSibling,this.container.insertBefore(n,t),this.tags.push(n)}var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=function(e){if(e.sheet)return e.sheet;for(var t=0;tp)&&(z=(I=I.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(v,"$1"+e.trim());case 58:return e.trim()+t.replace(v,"$1"+e.trim());default:if(0<1*n&&0l.charCodeAt(8))break;case 115:a=a.replace(l,"-webkit-"+l)+";"+a;break;case 207:case 102:a=a.replace(l,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],02),L=T||!!y&&/Mac/.test(y.platform),P=/Android \d/.test(w),R=!!b&&"webkitFontSmoothing"in b.documentElement.style,H=R?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,N=function(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t},F=function(e){var t=e.assignedSlot||e.parentNode;return t&&11==t.nodeType?t.host:t},V=null,z=function(e,t,n){var r=V||(V=document.createRange());return r.setEnd(e,null==n?e.nodeValue.length:n),r.setStart(e,t||0),r},_=function(e,t,n,r){return n&&(I(e,t,n,r,-1)||I(e,t,n,r,1))},B=/^(img|br|input|textarea|hr)$/i;function I(e,t,n,r,o){for(;;){if(e==n&&t==r)return!0;if(t==(o<0?0:$(e))){var i=e.parentNode;if(!i||1!=i.nodeType||W(e)||B.test(e.nodeName)||"false"==e.contentEditable)return!1;t=N(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if("false"==(e=e.childNodes[t+(o<0?-1:0)]).contentEditable)return!1;t=o<0?$(e):0}}}function $(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function q(e,t,n){for(var r=0==t,o=t==$(e);r||o;){if(e==n)return!0;var i=N(e);if(!(e=e.parentNode))return!1;r=r&&0==i,o=o&&i==$(e)}}function W(e){for(var t,n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var U=function(e){var t=e.isCollapsed;return t&&E&&e.rangeCount&&!e.getRangeAt(0).collapsed&&(t=!1),t};function K(e,t){var n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function G(e){return{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function J(e,t){return"number"==typeof e?e:e[t]}function Z(e){var t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,r=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*r}}function Y(e,t,n){for(var r=e.someProp("scrollThreshold")||0,o=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument,a=n||e.dom;a;a=F(a))if(1==a.nodeType){var s=a,l=s==i.body,u=l?G(i):Z(s),c=0,f=0;if(t.topu.bottom-J(r,"bottom")&&(f=t.bottom-u.bottom+J(o,"bottom")),t.leftu.right-J(r,"right")&&(c=t.right-u.right+J(o,"right")),c||f)if(l)i.defaultView.scrollBy(c,f);else{var d=s.scrollLeft,p=s.scrollTop;f&&(s.scrollTop+=f),c&&(s.scrollLeft+=c);var h=s.scrollLeft-d,m=s.scrollTop-p;t={left:t.left-h,top:t.top-m,right:t.right-h,bottom:t.bottom-m}}if(l)break}}function X(e){for(var t=[],n=e.ownerDocument,r=e;r&&(t.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),e!=n);r=F(r));return t}function Q(e,t){for(var n=0;n=s){a=Math.max(d.bottom,a),s=Math.min(d.top,s);var p=d.left>t.left?d.left-t.left:d.right=(d.left+d.right)/2?1:0));continue}}!n&&(t.left>=d.right&&t.top>=d.top||t.left>=d.left&&t.top>=d.bottom)&&(i=u+1)}}return n&&3==n.nodeType?function(e,t){for(var n=e.nodeValue.length,r=document.createRange(),o=0;o=(i.left+i.right)/2?1:0)}}return{node:e,offset:0}}(n,r):!n||o&&1==n.nodeType?{node:e,offset:i}:te(n,r)}function ne(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function re(e,t,n){var r=e.childNodes.length;if(r&&n.topt.top&&o++}n==e.dom&&o==n.childNodes.length-1&&1==n.lastChild.nodeType&&t.top>n.lastChild.getBoundingClientRect().bottom?s=e.state.doc.content.size:0!=o&&1==n.nodeType&&"BR"==n.childNodes[o-1].nodeName||(s=function(e,t,n,r){for(var o=-1,i=t;i!=e.dom;){var a=e.docView.nearestDesc(i,!0);if(!a)return null;if(a.node.isBlock&&a.parent){var s=a.dom.getBoundingClientRect();if(s.left>r.left||s.top>r.top)o=a.posBefore;else{if(!(s.right-1?o:e.docView.posFromDOM(t,n,1)}(e,n,o,t))}null==s&&(s=function(e,t,n){var r=te(t,n),o=r.node,i=r.offset,a=-1;if(1==o.nodeType&&!o.firstChild){var s=o.getBoundingClientRect();a=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,i,a)}(e,l,t));var p=e.docView.nearestDesc(l,!0);return{pos:s,inside:p?p.posAtStart-p.border:-1}}function ie(e,t){var n=e.getClientRects();return n.length?n[t<0?0:n.length-1]:e.getBoundingClientRect()}var ae=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function se(e,t,n){var r=e.docView.domFromPos(t,n<0?-1:1),o=r.node,i=r.offset,a=R||j;if(3==o.nodeType){if(!a||!ae.test(o.nodeValue)&&(n<0?i:i!=o.nodeValue.length)){var s=i,l=i,u=n<0?1:-1;return n<0&&!i?(l++,u=-1):n>=0&&i==o.nodeValue.length?(s--,u=1):n<0?s--:l++,le(ie(z(o,s,l),u),u<0)}var c=ie(z(o,i,i),n);if(j&&i&&/\s/.test(o.nodeValue[i-1])&&i=0)}if(i&&(n<0||i==$(o))){var m=o.childNodes[i-1],v=3==m.nodeType?z(m,$(m)-(a?0:1)):1!=m.nodeType||"BR"==m.nodeName&&m.nextSibling?null:m;if(v)return le(ie(v,1),!1)}if(i<$(o)){for(var g=o.childNodes[i];g.pmViewDesc&&g.pmViewDesc.ignoreForCoords;)g=g.nextSibling;var y=g?3==g.nodeType?z(g,0,a?0:1):1==g.nodeType?g:null:null;if(y)return le(ie(y,-1),!0)}return le(ie(3==o.nodeType?z(o):o,-n),n>=0)}function le(e,t){if(0==e.width)return e;var n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function ue(e,t){if(0==e.height)return e;var n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function ce(e,t,n){var r=e.state,o=e.root.activeElement;r!=t&&e.updateState(t),o!=e.dom&&e.focus();try{return n()}finally{r!=t&&e.updateState(r),o!=e.dom&&o&&o.focus()}}var fe=/[\u0590-\u08ac]/;var de=null,pe=null,he=!1;function me(e,t,n){return de==t&&pe==n?he:(de=t,pe=n,he="up"==n||"down"==n?function(e,t,n){var r=t.selection,o="up"==n?r.$from:r.$to;return ce(e,t,(function(){for(var t=e.docView.domFromPos(o.pos,"up"==n?-1:1).node;;){var r=e.docView.nearestDesc(t,!0);if(!r)break;if(r.node.isBlock){t=r.dom;break}t=r.dom.parentNode}for(var i=se(e,o.pos,1),a=t.firstChild;a;a=a.nextSibling){var s=void 0;if(1==a.nodeType)s=a.getClientRects();else{if(3!=a.nodeType)continue;s=z(a,0,a.nodeValue.length).getClientRects()}for(var l=0;lu.top+1&&("up"==n?i.top-u.top>2*(u.bottom-i.top):u.bottom-i.bottom>2*(i.bottom-u.top)))return!1}}return!0}))}(e,t,n):function(e,t,n){var r=t.selection.$head;if(!r.parent.isTextblock)return!1;var o=r.parentOffset,i=!o,a=o==r.parent.content.size,s=e.domSelection();return fe.test(r.parent.textContent)&&s.modify?ce(e,t,(function(){var t=s.getRangeAt(0),o=s.focusNode,i=s.focusOffset,a=s.caretBidiLevel;s.modify("move",n,"character");var l=!(r.depth?e.docView.domAfterPos(r.before()):e.dom).contains(1==s.focusNode.nodeType?s.focusNode:s.focusNode.parentNode)||o==s.focusNode&&i==s.focusOffset;return s.removeAllRanges(),s.addRange(t),null!=a&&(s.caretBidiLevel=a),l})):"left"==n||"backward"==n?i:a}(e,t,n))}var ve=function(){function e(t,n,r,o){Object(c.a)(this,e),this.parent=t,this.children=n,this.dom=r,this.contentDOM=o,this.dirty=0,r.pmViewDesc=this}return Object(f.a)(e,[{key:"matchesWidget",value:function(e){return!1}},{key:"matchesMark",value:function(e){return!1}},{key:"matchesNode",value:function(e,t,n){return!1}},{key:"matchesHack",value:function(e){return!1}},{key:"parseRule",value:function(){return null}},{key:"stopEvent",value:function(e){return!1}},{key:"size",get:function(){for(var e=0,t=0;tN(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))s=2&e.compareDocumentPosition(this.contentDOM);else if(this.dom.firstChild){if(0==t)for(var l=e;;l=l.parentNode){if(l==this.dom){s=!1;break}if(l.previousSibling)break}if(null==s&&t==e.childNodes.length)for(var u=e;;u=u.parentNode){if(u==this.dom){s=!0;break}if(u.nextSibling)break}}return(null==s?n>0:s)?this.posAtEnd:this.posAtStart}},{key:"nearestDesc",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!0,r=e;r;r=r.parentNode){var o=this.getDesc(r),i=void 0;if(o&&(!t||o.node)){if(!n||!(i=o.nodeDOM)||(1==i.nodeType?i.contains(1==e.nodeType?e:e.parentNode):i==e))return o;n=!1}}}},{key:"getDesc",value:function(e){for(var t=e.pmViewDesc,n=t;n;n=n.parent)if(n==this)return t}},{key:"posFromDOM",value:function(e,t,n){for(var r=e;r;r=r.parentNode){var o=this.getDesc(r);if(o)return o.localPosFromDOM(e,t,n)}return-1}},{key:"descAt",value:function(e){for(var t=0,n=0;te||a instanceof Oe){o=e-i;break}i=s}if(o)return this.children[r].domFromPos(o-this.children[r].border,t);for(;r&&!(n=this.children[r-1]).size&&n instanceof ge&&n.side>=0;r--);if(t<=0){for(var l,u=!0;(l=r?this.children[r-1]:null)&&l.dom.parentNode!=this.contentDOM;r--,u=!1);return l&&t&&u&&!l.border&&!l.domAtom?l.domFromPos(l.size,t):{node:this.contentDOM,offset:l?N(l.dom)+1:0}}for(var c,f=!0;(c=r2&&void 0!==arguments[2]?arguments[2]:0;if(0==this.children.length)return{node:this.contentDOM,from:e,to:t,fromOffset:0,toOffset:this.contentDOM.childNodes.length};for(var r=-1,o=-1,i=n,a=0;;a++){var s=this.children[a],l=i+s.size;if(-1==r&&e<=l){var u=i+s.border;if(e>=u&&t<=l-s.border&&s.node&&s.contentDOM&&this.contentDOM.contains(s.contentDOM))return s.parseRange(e,t,u);e=i;for(var c=a;c>0;c--){var f=this.children[c-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=N(f.dom)+1;break}e-=f.size}-1==r&&(r=0)}if(r>-1&&(l>t||a==this.children.length-1)){t=l;for(var d=a+1;d3&&void 0!==arguments[3]&&arguments[3],o=Math.min(e,t),i=Math.max(e,t),a=0,s=0;as&&it){var O=c;c=f,f=O}var C=document.createRange();C.setEnd(f.node,f.offset),C.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(C)}}}},{key:"ignoreMutation",value:function(e){return!this.contentDOM&&"selection"!=e.type}},{key:"contentLost",get:function(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}},{key:"markDirty",value:function(e,t){for(var n=0,r=0;r=n:en){var a=n+o.border,s=i-o.border;if(e>=a&&t<=s)return this.dirty=e==n||t==i?2:1,void(e!=a||t!=s||!o.contentLost&&o.dom.parentNode==this.contentDOM?o.markDirty(e-a,t-a):o.dirty=3);o.dirty=o.dom!=o.contentDOM||o.dom.parentNode!=this.contentDOM||o.children.length?3:2}n=i}this.dirty=2}},{key:"markParentsDirty",value:function(){for(var e=1,t=this.parent;t;t=t.parent,e++){var n=1==e?2:1;t.dirty0&&(i=Ne(i,0,e,r));for(var s=0;s=0;n--){var r=this.children[n];if(this.dom.contains(r.dom.parentNode)){t.contentElement=r.dom.parentNode;break}}t.contentElement||(t.getContent=function(){return v.Fragment.empty})}else t.contentElement=this.contentDOM;else t.getContent=function(){return e.node.content};return t}},{key:"matchesNode",value:function(e,t,n){return 0==this.dirty&&e.eq(this.node)&&Le(t,this.outerDeco)&&n.eq(this.innerDeco)}},{key:"size",get:function(){return this.node.nodeSize}},{key:"border",get:function(){return this.node.isLeaf?0:1}},{key:"updateChildren",value:function(e,t){var n=this,r=this.node.inlineContent,o=t,i=e.composing?this.localCompositionInfo(e,t):null,a=i&&i.pos>-1?i:null,s=i&&i.pos<0,l=new Re(this,a&&a.node);!function(e,t,n,r){var o=t.locals(e),i=0;if(0==o.length){for(var a=0;ai;)u.push(o[l++]);var y=i+m.nodeSize;if(m.isText){var b=y;l=0&&!a&&l.syncToMarks(i==n.node.childCount?v.Mark.none:n.node.child(i).marks,r,e),l.placeWidget(t,e,o)}),(function(t,n,a,u){var c;l.syncToMarks(t.marks,r,e),l.findNodeMatch(t,n,a,u)||s&&e.state.selection.from>o&&e.state.selection.to-1&&l.updateNodeAt(t,n,a,c,e)||l.updateNextNode(t,n,a,e,u)||l.addNode(t,n,a,e,o),o+=t.nodeSize})),l.syncToMarks([],r,e),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||2==this.dirty)&&(a&&this.protectLocalComposition(e,a),Se(this.contentDOM,this.children,e),T&&function(e){if("UL"==e.nodeName||"OL"==e.nodeName){var t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}(this.dom))}},{key:"localCompositionInfo",value:function(e,t){var n=e.state.selection,r=n.from,o=n.to;if(!(e.state.selection instanceof p.TextSelection)||rt+this.node.content.size)return null;var i=e.domSelection(),a=function(e,t){for(;;){if(3==e.nodeType)return e;if(1==e.nodeType&&t>0){if(e.childNodes.length>t&&3==e.childNodes[t].nodeType)return e.childNodes[t];t=$(e=e.childNodes[t-1])}else{if(!(1==e.nodeType&&t=n){var c=s=0&&c+t.length+s>=n)return s+c;if(n==r&&l.length>=r+t.length-s&&l.slice(r-s,r-s+t.length)==t)return r}}}return-1}(this.node.content,s,r-t,o-t);return l<0?null:{node:a,pos:l,text:s}}return{node:a,pos:-1,text:""}}},{key:"protectLocalComposition",value:function(e,t){var n=t.node,r=t.pos,o=t.text;if(!this.getDesc(n)){for(var i=n;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}var a=new ye(this,i,n,o);e.input.compositionNodes.push(a),this.children=Ne(this.children,r,r+o.length,e,a)}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||!e.sameMarkup(this.node))&&(this.updateInner(e,t,n,r),!0)}},{key:"updateInner",value:function(e,t,n,r){this.updateOuterDeco(t),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=0}},{key:"updateOuterDeco",value:function(e){if(!Le(e,this.outerDeco)){var t=1!=this.nodeDOM.nodeType,n=this.dom;this.dom=De(this.dom,this.nodeDOM,Ee(this.outerDeco,this.node,t),Ee(e,this.node,t)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}}},{key:"selectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.add("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||(this.dom.draggable=!0)}},{key:"deselectNode",value:function(){1==this.nodeDOM.nodeType&&this.nodeDOM.classList.remove("ProseMirror-selectednode"),!this.contentDOM&&this.node.type.spec.draggable||this.dom.removeAttribute("draggable")}},{key:"domAtom",get:function(){return this.node.isAtom}}],[{key:"create",value:function(e,t,r,o,i,a){var s,l=i.nodeViews[t.type.name],u=l&&l(t,i,(function(){return s?s.parent?s.parent.posBeforeChild(s):void 0:a}),r,o),c=u&&u.dom,f=u&&u.contentDOM;if(t.isText)if(c){if(3!=c.nodeType)throw new RangeError("Text must be rendered as a DOM text node")}else c=document.createTextNode(t.text);else if(!c){var d=v.DOMSerializer.renderSpec(document,t.type.spec.toDOM(t));c=d.dom,f=d.contentDOM}f||t.isText||"BR"==c.nodeName||(c.hasAttribute("contenteditable")||(c.contentEditable="false"),t.type.spec.draggable&&(c.draggable=!0));var p=c;return c=Te(c,r,t),u?s=new Ce(e,t,r,o,c,f||null,p,u,i,a+1):t.isText?new xe(e,t,r,o,c,p,i):new n(e,t,r,o,c,f||null,p,i,a+1)}}]),n}(ve);function ke(e,t,n,r,o){return Te(r,t,e),new we(void 0,e,t,n,r,r,r,o,0)}var xe=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e,r,o,i,a,s,l){return Object(c.a)(this,n),t.call(this,e,r,o,i,a,null,s,l,0)}return Object(f.a)(n,[{key:"parseRule",value:function(){for(var e=this.nodeDOM.parentNode;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}},{key:"update",value:function(e,t,n,r){return!(3==this.dirty||0!=this.dirty&&!this.inParent()||!e.sameMarkup(this.node))&&(this.updateOuterDeco(t),0==this.dirty&&e.text==this.node.text||e.text==this.nodeDOM.nodeValue||(this.nodeDOM.nodeValue=e.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=e,this.dirty=0,!0)}},{key:"inParent",value:function(){for(var e=this.parent.contentDOM,t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}},{key:"domFromPos",value:function(e){return{node:this.nodeDOM,offset:e}}},{key:"localPosFromDOM",value:function(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):Object(h.a)(Object(m.a)(n.prototype),"localPosFromDOM",this).call(this,e,t,r)}},{key:"ignoreMutation",value:function(e){return"characterData"!=e.type&&"selection"!=e.type}},{key:"slice",value:function(e,t,r){var o=this.node.cut(e,t),i=document.createTextNode(o.text);return new n(this.parent,o,this.outerDeco,this.innerDeco,i,i,r)}},{key:"markDirty",value:function(e,t){Object(h.a)(Object(m.a)(n.prototype),"markDirty",this).call(this,e,t),this.dom==this.nodeDOM||0!=e&&t!=this.nodeDOM.nodeValue.length||(this.dirty=3)}},{key:"domAtom",get:function(){return!1}}]),n}(we),Oe=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(f.a)(n,[{key:"parseRule",value:function(){return{ignore:!0}}},{key:"matchesHack",value:function(e){return 0==this.dirty&&this.dom.nodeName==e}},{key:"domAtom",get:function(){return!0}},{key:"ignoreForCoords",get:function(){return"IMG"==this.dom.nodeName}}]),n}(ve),Ce=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e,r,o,i,a,s,l,u,f,d){var p;return Object(c.a)(this,n),(p=t.call(this,e,r,o,i,a,s,l,f,d)).spec=u,p}return Object(f.a)(n,[{key:"update",value:function(e,t,r,o){if(3==this.dirty)return!1;if(this.spec.update){var i=this.spec.update(e,t,r);return i&&this.updateInner(e,t,r,o),i}return!(!this.contentDOM&&!e.isLeaf)&&Object(h.a)(Object(m.a)(n.prototype),"update",this).call(this,e,t,r,o)}},{key:"selectNode",value:function(){this.spec.selectNode?this.spec.selectNode():Object(h.a)(Object(m.a)(n.prototype),"selectNode",this).call(this)}},{key:"deselectNode",value:function(){this.spec.deselectNode?this.spec.deselectNode():Object(h.a)(Object(m.a)(n.prototype),"deselectNode",this).call(this)}},{key:"setSelection",value:function(e,t,r,o){this.spec.setSelection?this.spec.setSelection(e,t,r):Object(h.a)(Object(m.a)(n.prototype),"setSelection",this).call(this,e,t,r,o)}},{key:"destroy",value:function(){this.spec.destroy&&this.spec.destroy(),Object(h.a)(Object(m.a)(n.prototype),"destroy",this).call(this)}},{key:"stopEvent",value:function(e){return!!this.spec.stopEvent&&this.spec.stopEvent(e)}},{key:"ignoreMutation",value:function(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):Object(h.a)(Object(m.a)(n.prototype),"ignoreMutation",this).call(this,e)}}]),n}(we);function Se(e,t,n){for(var r=e.firstChild,o=!1,i=0;i0;){for(var s=void 0;;)if(r){var l=n.children[r-1];if(!(l instanceof be)){s=l,r--;break}n=l,r=l.children.length}else{if(n==t)break e;r=n.parent.children.indexOf(n),n=n.parent}var u=s.node;if(u){if(u!=e.child(o-1))break;--o,i.set(s,o),a.push(s)}}return{index:o,matched:i,matches:a.reverse()}}(t.node.content,t)}return Object(f.a)(e,[{key:"destroyBetween",value:function(e,t){if(e!=t){for(var n=e;n>1,i=Math.min(o,e.length);r-1)a>this.index&&(this.changed=!0,this.destroyBetween(this.index,a)),this.top=this.top.children[this.index];else{var l=be.create(this.top,e[o],t,n);this.top.children.splice(this.index,0,l),this.top=l,this.changed=!0}this.index=0,o++}}},{key:"findNodeMatch",value:function(e,t,n,r){var o,i=-1;if(r>=this.preMatch.index&&(o=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&o.matchesNode(e,t,n))i=this.top.children.indexOf(o,this.index);else for(var a=this.index,s=Math.min(this.top.children.length,a+5);a=n||c<=t?i.push(l):(un&&i.push(l.slice(n-u,l.size,r)))}return i}function Fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=e.domSelection(),r=e.state.doc;if(!n.focusNode)return null;var o=e.docView.nearestDesc(n.focusNode),i=o&&0==o.size,a=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(a<0)return null;var s,l,u=r.resolve(a);if(U(n)){for(s=u;o&&!o.node;)o=o.parent;var c=o.node;if(o&&c.isAtom&&p.NodeSelection.isSelectable(c)&&o.parent&&(!c.isInline||!q(n.focusNode,n.focusOffset,o.dom))){var f=o.posBefore;l=new p.NodeSelection(a==f?u:r.resolve(f))}}else{var d=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(d<0)return null;s=r.resolve(d)}if(!l){var h="pointer"==t||e.state.selection.head1&&void 0!==arguments[1]&&arguments[1],n=e.state.selection;if(Ue(e,n),Ve(e)){if(!t&&e.input.mouseDown&&e.input.mouseDown.allowDefault&&E){var r=e.domSelection(),o=e.domObserver.currentSelection;if(r.anchorNode&&o.anchorNode&&_(r.anchorNode,r.anchorOffset,o.anchorNode,o.anchorOffset))return e.input.mouseDown.delayedSelectionSync=!0,void e.domObserver.setCurSelection()}if(e.domObserver.disconnectSelection(),e.cursorWrapper)We(e);else{var i,a,s=n.anchor,l=n.head;!_e||n instanceof p.TextSelection||(n.$from.parent.inlineContent||(i=Be(e,n.from)),n.empty||n.$from.parent.inlineContent||(a=Be(e,n.to))),e.docView.setSelection(s,l,e.root,t),_e&&(i&&$e(i),a&&$e(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&qe(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}}var _e=M||E&&D<63;function Be(e,t){var n=e.docView.domFromPos(t,0),r=n.node,o=n.offset,i=o0?r.max(o):r.min(o),a=i.parent.inlineContent?i.depth?e.doc.resolve(t>0?i.after():i.before()):null:i;return a&&p.Selection.findFrom(a,t)}function Xe(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function Qe(e,t,n){var r=e.state.selection;if(!(r instanceof p.TextSelection)){if(r instanceof p.NodeSelection&&r.node.isInline)return Xe(e,new p.TextSelection(t>0?r.$to:r.$from));var o=Ye(e.state,t);return!!o&&Xe(e,o)}if(!r.empty||n.indexOf("s")>-1)return!1;if(e.endOfTextblock(t>0?"right":"left")){var i=Ye(e.state,t);return!!(i&&i instanceof p.NodeSelection)&&Xe(e,i)}if(!(L&&n.indexOf("m")>-1)){var a,s=r.$head,l=s.textOffset?null:t<0?s.nodeBefore:s.nodeAfter;if(!l||l.isText)return!1;var u=t<0?s.pos-l.nodeSize:s.pos;return!!(l.isAtom||(a=e.docView.descAt(u))&&!a.contentDOM)&&(p.NodeSelection.isSelectable(l)?Xe(e,new p.NodeSelection(t<0?e.state.doc.resolve(s.pos-l.nodeSize):s)):!!R&&Xe(e,new p.TextSelection(e.state.doc.resolve(t<0?u:u+l.nodeSize))))}}function et(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function tt(e){var t=e.pmViewDesc;return t&&0==t.size&&(e.nextSibling||"BR"!=e.nodeName)}function nt(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){var o,i,a=!1;for(j&&1==n.nodeType&&r0){if(1!=n.nodeType)break;var s=n.childNodes[r-1];if(tt(s))o=n,i=--r;else{if(3!=s.nodeType)break;r=(n=s).nodeValue.length}}else{if(ot(n))break;for(var l=n.previousSibling;l&&tt(l);)o=n.parentNode,i=N(l),l=l.previousSibling;if(l)r=et(n=l);else{if((n=n.parentNode)==e.dom)break;r=0}}a?it(e,t,n,r):o&&it(e,t,o,i)}}function rt(e){var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n){for(var o,i,a=et(n);;)if(r-1)return!1;if(L&&n.indexOf("m")>-1)return!1;var o=r.$from,i=r.$to;if(!o.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){var a=Ye(e.state,t);if(a&&a instanceof p.NodeSelection)return Xe(e,a)}if(!o.parent.inlineContent){var s=t<0?o:i,l=r instanceof p.AllSelection?p.Selection.near(s,t):p.Selection.findFrom(s,t);return!!l&&Xe(e,l)}return!1}function st(e,t){if(!(e.state.selection instanceof p.TextSelection))return!0;var n=e.state.selection,r=n.$head,o=n.$anchor,i=n.empty;if(!r.sameParent(o))return!0;if(!i)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;var a=!r.textOffset&&(t<0?r.nodeBefore:r.nodeAfter);if(a&&!a.isText){var s=e.state.tr;return t<0?s.delete(r.pos-a.nodeSize,r.pos):s.delete(r.pos,r.pos+a.nodeSize),e.dispatch(s),!0}return!1}function lt(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function ut(e,t){var n=t.keyCode,r=function(e){var t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}(t);return 8==n||L&&72==n&&"c"==r?st(e,-1)||nt(e):46==n||L&&68==n&&"c"==r?st(e,1)||rt(e):13==n||27==n||(37==n||L&&66==n&&"c"==r?Qe(e,-1,r)||nt(e):39==n||L&&70==n&&"c"==r?Qe(e,1,r)||rt(e):38==n||L&&80==n&&"c"==r?at(e,-1,r)||nt(e):40==n||L&&78==n&&"c"==r?function(e){if(!M||e.state.selection.$head.parentOffset>0)return!1;var t=e.domSelection(),n=t.focusNode,r=t.focusOffset;if(n&&1==n.nodeType&&0==r&&n.firstChild&&"false"==n.firstChild.contentEditable){var o=n.firstChild;lt(e,o,"true"),setTimeout((function(){return lt(e,o,"false")}),20)}return!1}(e)||at(e,1,r)||rt(e):r==(L?"m":"c")&&(66==n||73==n||89==n||90==n))}function ct(e,t){for(var n=[],r=t.content,o=t.openStart,i=t.openEnd;o>1&&i>1&&1==r.childCount&&1==r.firstChild.childCount;){o--,i--;var a=r.firstChild;n.push(a.type.name,a.attrs!=a.type.defaultAttrs?a.attrs:null),r=a.content}var s=e.someProp("clipboardSerializer")||v.DOMSerializer.fromSchema(e.state.schema),l=wt(),u=l.createElement("div");u.appendChild(s.serializeFragment(r,{document:l}));for(var c,f=u.firstChild,d=0;f&&1==f.nodeType&&(c=yt[f.nodeName.toLowerCase()]);){for(var p=c.length-1;p>=0;p--){for(var h=l.createElement(c[p]);u.firstChild;)h.appendChild(u.firstChild);u.appendChild(h),d++}f=u.firstChild}return f&&1==f.nodeType&&f.setAttribute("data-pm-slice","".concat(o," ").concat(i).concat(d?" -".concat(d):""," ").concat(JSON.stringify(n))),{dom:u,text:e.someProp("clipboardTextSerializer",(function(e){return e(t)}))||t.content.textBetween(0,t.content.size,"\n\n")}}function ft(e,t,n,r,o){var i,a,s=o.parent.type.spec.code;if(!n&&!t)return null;var l=t&&(r||s||!n);if(l){if(e.someProp("transformPastedText",(function(e){t=e(t,s||r)})),s)return t?new v.Slice(v.Fragment.from(e.state.schema.text(t.replace(/\r\n?/g,"\n"))),0,0):v.Slice.empty;var u=e.someProp("clipboardTextParser",(function(e){return e(t,o,r)}));if(u)a=u;else{var c=o.marks(),f=e.state.schema,d=v.DOMSerializer.fromSchema(f);i=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach((function(e){var t=i.appendChild(document.createElement("p"));e&&t.appendChild(d.serializeNode(f.text(e,c)))}))}}else e.someProp("transformPastedHTML",(function(e){n=e(n)})),i=function(e){var t=/^(\s*]*>)*/.exec(e);t&&(e=e.slice(t[0].length));var n,r=wt().createElement("div"),o=/<([a-z][^>\s]+)/i.exec(e);(n=o&&yt[o[1].toLowerCase()])&&(e=n.map((function(e){return"<"+e+">"})).join("")+e+n.map((function(e){return""})).reverse().join(""));if(r.innerHTML=e,n)for(var i=0;i0&&i.firstChild;m--)i=i.firstChild;if(!a){var g=e.someProp("clipboardParser")||e.someProp("domParser")||v.DOMParser.fromSchema(e.state.schema);a=g.parseSlice(i,{preserveWhitespace:!(!l&&!h),context:o,ruleFromNode:function(e){return"BR"!=e.nodeName||e.nextSibling||!e.parentNode||dt.test(e.parentNode.nodeName)?null:{ignore:!0}}})}if(h)a=function(e,t){if(!e.size)return e;var n,r=e.content.firstChild.type.schema;try{n=JSON.parse(t)}catch(u){return e}for(var o=e.content,i=e.openStart,a=e.openEnd,s=n.length-2;s>=0;s-=2){var l=r.nodes[n[s]];if(!l||l.hasRequiredAttrs())break;o=v.Fragment.from(l.create(n[s+1],o)),i++,a++}return new v.Slice(o,i,a)}(gt(a,+h[1],+h[2]),h[4]);else if(a=v.Slice.maxOpen(function(e,t){if(e.childCount<2)return e;for(var n=function(n){var r=t.node(n).contentMatchAt(t.index(n)),o=void 0,i=[];if(e.forEach((function(e){if(i){var t,n=r.findWrapping(e.type);if(!n)return i=null;if(t=i.length&&o.length&&ht(n,o,e,i[i.length-1],0))i[i.length-1]=t;else{i.length&&(i[i.length-1]=mt(i[i.length-1],o.length));var a=pt(e,n);i.push(a),r=r.matchType(a.type),o=n}}})),i)return{v:v.Fragment.from(i)}},r=t.depth;r>=0;r--){var o=n(r);if("object"===typeof o)return o.v}return e}(a.content,o),!0),a.openStart||a.openEnd){for(var y=0,b=0,w=a.content.firstChild;y2&&void 0!==arguments[2]?arguments[2]:0,r=t.length-1;r>=n;r--)e=t[r].create(null,v.Fragment.from(e));return e}function ht(e,t,n,r,o){if(o=n&&(s=t<0?a.contentMatchAt(0).fillBefore(s,e.childCount>1||i<=o).append(s):s.append(a.contentMatchAt(a.childCount).fillBefore(v.Fragment.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,a.copy(s))}function gt(e,t,n){return ti.depth?t(e,n,i.nodeAfter,i.before(r),o,!0):t(e,n,i.node(r),i.before(r),o,!1)})))return{v:!0}},s=i.depth+1;s>0;s--){var l=a(s);if("object"===typeof l)return l.v}return!1}function Dt(e,t,n){e.focused||e.focus();var r=e.state.tr.setSelection(t);"pointer"==n&&r.setMeta("pointer",!0),e.dispatch(r)}function Mt(e,t,n,r,o){return Et(e,"handleClickOn",t,n,r)||e.someProp("handleClick",(function(n){return n(e,t,r)}))||(o?function(e,t){if(-1==t)return!1;var n,r,o=e.state.selection;o instanceof p.NodeSelection&&(n=o.node);for(var i=e.state.doc.resolve(t),a=i.depth+1;a>0;a--){var s=a>i.depth?i.nodeAfter:i.node(a);if(p.NodeSelection.isSelectable(s)){r=n&&o.$from.depth>0&&a>=o.$from.depth&&i.before(o.$from.depth+1)==o.$from.pos?i.before(o.$from.depth):i.before(a);break}}return null!=r&&(Dt(e,p.NodeSelection.create(e.state.doc,r),"pointer"),!0)}(e,n):function(e,t){if(-1==t)return!1;var n=e.state.doc.resolve(t),r=n.nodeAfter;return!!(r&&r.isAtom&&p.NodeSelection.isSelectable(r))&&(Dt(e,new p.NodeSelection(n),"pointer"),!0)}(e,n))}function Tt(e,t,n,r){return Et(e,"handleDoubleClickOn",t,n,r)||e.someProp("handleDoubleClick",(function(n){return n(e,t,r)}))}function Lt(e,t,n,r){return Et(e,"handleTripleClickOn",t,n,r)||e.someProp("handleTripleClick",(function(n){return n(e,t,r)}))||function(e,t,n){if(0!=n.button)return!1;var r=e.state.doc;if(-1==t)return!!r.inlineContent&&(Dt(e,p.TextSelection.create(r,0,r.content.size),"pointer"),!0);for(var o=r.resolve(t),i=o.depth+1;i>0;i--){var a=i>o.depth?o.nodeAfter:o.node(i),s=o.before(i);if(a.inlineContent)Dt(e,p.TextSelection.create(r,s+1,s+1+a.content.size),"pointer");else{if(!p.NodeSelection.isSelectable(a))continue;Dt(e,p.NodeSelection.create(r,s),"pointer")}return!0}}(e,n,r)}function Pt(e){return _t(e)}xt.keydown=function(e,t){var n=t;if(e.input.shiftKey=16==n.keyCode||n.shiftKey,!Nt(e,n)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!P||!E||13!=n.keyCode))if(229!=n.keyCode&&e.domObserver.forceFlush(),!T||13!=n.keyCode||n.ctrlKey||n.altKey||n.metaKey)e.someProp("handleKeyDown",(function(t){return t(e,n)}))||ut(e,n)?n.preventDefault():Ct(e,"key");else{var r=Date.now();e.input.lastIOSEnter=r,e.input.lastIOSEnterFallbackTimeout=setTimeout((function(){e.input.lastIOSEnter==r&&(e.someProp("handleKeyDown",(function(t){return t(e,K(13,"Enter"))})),e.input.lastIOSEnter=0)}),200)}},xt.keyup=function(e,t){16==t.keyCode&&(e.input.shiftKey=!1)},xt.keypress=function(e,t){var n=t;if(!(Nt(e,n)||!n.charCode||n.ctrlKey&&!n.altKey||L&&n.metaKey))if(e.someProp("handleKeyPress",(function(t){return t(e,n)})))n.preventDefault();else{var r=e.state.selection;if(!(r instanceof p.TextSelection)||!r.$from.sameParent(r.$to)){var o=String.fromCharCode(n.charCode);e.someProp("handleTextInput",(function(t){return t(e,r.$from.pos,r.$to.pos,o)}))||e.dispatch(e.state.tr.insertText(o).scrollIntoView()),n.preventDefault()}}};var Rt=L?"metaKey":"ctrlKey";kt.mousedown=function(e,t){var n=t;e.input.shiftKey=n.shiftKey;var r=Pt(e),o=Date.now(),i="singleClick";o-e.input.lastClick.time<500&&function(e,t){var n=t.x-e.clientX,r=t.y-e.clientY;return n*n+r*r<100}(n,e.input.lastClick)&&!n[Rt]&&("singleClick"==e.input.lastClick.type?i="doubleClick":"doubleClick"==e.input.lastClick.type&&(i="tripleClick")),e.input.lastClick={time:o,x:n.clientX,y:n.clientY,type:i};var a=e.posAtCoords(At(n));a&&("singleClick"==i?(e.input.mouseDown&&e.input.mouseDown.done(),e.input.mouseDown=new Ht(e,a,n,!!r)):("doubleClick"==i?Tt:Lt)(e,a.pos,a.inside,n)?n.preventDefault():Ct(e,"pointer"))};var Ht=function(){function e(t,n,r,o){var i,a,s=this;if(Object(c.a)(this,e),this.view=t,this.pos=n,this.event=r,this.flushed=o,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=t.state.doc,this.selectNode=!!r[Rt],this.allowDefault=r.shiftKey,n.inside>-1)i=t.state.doc.nodeAt(n.inside),a=n.inside;else{var l=t.state.doc.resolve(n.pos);i=l.parent,a=l.depth?l.before():0}var u=o?null:r.target,f=u?t.docView.nearestDesc(u,!0):null;this.target=f?f.dom:null;var d=t.state.selection;(0==r.button&&i.type.spec.draggable&&!1!==i.type.spec.selectable||d instanceof p.NodeSelection&&d.from<=a&&d.to>a)&&(this.mightDrag={node:i,pos:a,addAttr:!(!this.target||this.target.draggable),setUneditable:!(!this.target||!j||this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout((function(){s.view.input.mouseDown==s&&s.target.setAttribute("contentEditable","false")}),20),this.view.domObserver.start()),t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this)),Ct(t,"pointer")}return Object(f.a)(e,[{key:"done",value:function(){var e=this;this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout((function(){return ze(e.view)})),this.view.input.mouseDown=null}},{key:"up",value:function(e){if(this.done(),this.view.dom.contains(e.target)){var t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(At(e))),this.allowDefault||!t?Ct(this.view,"pointer"):Mt(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():0==e.button&&(this.flushed||M&&this.mightDrag&&!this.mightDrag.node.isAtom||E&&!(this.view.state.selection instanceof p.TextSelection)&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Dt(this.view,p.Selection.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):Ct(this.view,"pointer")}}},{key:"move",value:function(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0),Ct(this.view,"pointer"),0==e.buttons&&this.done()}}]),e}();function Nt(e,t){return!!e.composing||!!(M&&Math.abs(t.timeStamp-e.input.compositionEndedAt)<500)&&(e.input.compositionEndedAt=-2e8,!0)}kt.touchdown=function(e){Pt(e),Ct(e,"pointer")},kt.contextmenu=function(e){return Pt(e)};var Ft=P?5e3:-1;function Vt(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout((function(){return _t(e)}),t))}function zt(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=function(){var e=document.createEvent("Event");return e.initEvent("event",!0,!0),e.timeStamp}());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function _t(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!(P&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),zt(e),t||e.docView&&e.docView.dirty){var n=Fe(e);return n&&!n.eq(e.state.selection)?e.dispatch(e.state.tr.setSelection(n)):e.updateState(e.state),!0}return!1}}xt.compositionstart=xt.compositionupdate=function(e){if(!e.composing){e.domObserver.flush();var t=e.state,n=t.selection.$from;if(t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some((function(e){return!1===e.type.spec.inclusive}))))e.markCursor=e.state.storedMarks||n.marks(),_t(e,!0),e.markCursor=null;else if(_t(e),j&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length)for(var r=e.domSelection(),o=r.focusNode,i=r.focusOffset;o&&1==o.nodeType&&0!=i;){var a=i<0?o.lastChild:o.childNodes[i-1];if(!a)break;if(3==a.nodeType){r.collapse(a,a.nodeValue.length);break}o=a,i=-1}e.input.composing=!0}Vt(e,Ft)},xt.compositionend=function(e,t){e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=t.timeStamp,Vt(e,20))};var Bt=C&&S<15||T&&H<604;function It(e,t,n,r){var o=ft(e,t,n,e.input.shiftKey,e.state.selection.$from);if(e.someProp("handlePaste",(function(t){return t(e,r,o||v.Slice.empty)})))return!0;if(!o)return!1;var i=function(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}(o),a=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(o);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}kt.copy=xt.cut=function(e,t){var n=t,r=e.state.selection,o="cut"==n.type;if(!r.empty){var i=Bt?null:n.clipboardData,a=ct(e,r.content()),s=a.dom,l=a.text;i?(n.preventDefault(),i.clearData(),i.setData("text/html",s.innerHTML),i.setData("text/plain",l)):function(e,t){if(e.dom.parentNode){var n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";var r=getSelection(),o=document.createRange();o.selectNodeContents(t),e.dom.blur(),r.removeAllRanges(),r.addRange(o),setTimeout((function(){n.parentNode&&n.parentNode.removeChild(n),e.focus()}),50)}}(e,s),o&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))}},xt.paste=function(e,t){var n=t;if(!e.composing||P){var r=Bt?null:n.clipboardData;r&&It(e,r.getData("text/plain"),r.getData("text/html"),n)?n.preventDefault():function(e,t){if(e.dom.parentNode){var n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,r=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus(),setTimeout((function(){e.focus(),r.parentNode&&r.parentNode.removeChild(r),n?It(e,r.value,null,t):It(e,r.textContent,r.innerHTML,t)}),50)}}(e,n)}};var $t=Object(f.a)((function e(t,n){Object(c.a)(this,e),this.slice=t,this.move=n})),qt=L?"altKey":"ctrlKey";for(var Wt in kt.dragstart=function(e,t){var n=t,r=e.input.mouseDown;if(r&&r.done(),n.dataTransfer){var o=e.state.selection,i=o.empty?null:e.posAtCoords(At(n));if(i&&i.pos>=o.from&&i.pos<=(o instanceof p.NodeSelection?o.to-1:o.to));else if(r&&r.mightDrag)e.dispatch(e.state.tr.setSelection(p.NodeSelection.create(e.state.doc,r.mightDrag.pos)));else if(n.target&&1==n.target.nodeType){var a=e.docView.nearestDesc(n.target,!0);a&&a.node.type.spec.draggable&&a!=e.docView&&e.dispatch(e.state.tr.setSelection(p.NodeSelection.create(e.state.doc,a.posBefore)))}var s=e.state.selection.content(),l=ct(e,s),u=l.dom,c=l.text;n.dataTransfer.clearData(),n.dataTransfer.setData(Bt?"Text":"text/html",u.innerHTML),n.dataTransfer.effectAllowed="copyMove",Bt||n.dataTransfer.setData("text/plain",c),e.dragging=new $t(s,!n[qt])}},kt.dragend=function(e){var t=e.dragging;window.setTimeout((function(){e.dragging==t&&(e.dragging=null)}),50)},xt.dragover=xt.dragenter=function(e,t){return t.preventDefault()},xt.drop=function(e,t){var n=t,r=e.dragging;if(e.dragging=null,n.dataTransfer){var o=e.posAtCoords(At(n));if(o){var i=e.state.doc.resolve(o.pos);if(i){var a=r&&r.slice;a?e.someProp("transformPasted",(function(e){a=e(a)})):a=ft(e,n.dataTransfer.getData(Bt?"Text":"text/plain"),Bt?null:n.dataTransfer.getData("text/html"),!1,i);var s=!(!r||n[qt]);if(e.someProp("handleDrop",(function(t){return t(e,n,a||v.Slice.empty,s)})))n.preventDefault();else if(a){n.preventDefault();var l=a?Object(g.h)(e.state.doc,i.pos,a):i.pos;null==l&&(l=i.pos);var u=e.state.tr;s&&u.deleteSelection();var c=u.mapping.map(l),f=0==a.openStart&&0==a.openEnd&&1==a.content.childCount,d=u.doc;if(f?u.replaceRangeWith(c,c,a.content.firstChild):u.replaceRange(c,c,a),!u.doc.eq(d)){var h=u.doc.resolve(c);if(f&&p.NodeSelection.isSelectable(a.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(a.content.firstChild))u.setSelection(new p.NodeSelection(h));else{var m=u.mapping.map(l);u.mapping.maps[u.mapping.maps.length-1].forEach((function(e,t,n,r){return m=r})),u.setSelection(Ge(e,h,u.doc.resolve(m)))}e.focus(),e.dispatch(u.setMeta("uiEvent","drop"))}}}}}},kt.focus=function(e){e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout((function(){e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelection())&&ze(e)}),20))},kt.blur=function(e,t){var n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)},kt.beforeinput=function(e,t){if(E&&P&&"deleteContentBackward"==t.inputType){e.domObserver.flushSoon();var n=e.input.domChangeCount;setTimeout((function(){if(e.input.domChangeCount==n&&(e.dom.blur(),e.focus(),!e.someProp("handleKeyDown",(function(t){return t(e,K(8,"Backspace"))})))){var t=e.state.selection.$cursor;t&&t.pos>0&&e.dispatch(e.state.tr.delete(t.pos-1,t.pos).scrollIntoView())}}),50)}},xt)kt[Wt]=xt[Wt];function Ut(e,t){if(e==t)return!0;for(var n in e)if(e[n]!==t[n])return!1;for(var r in t)if(!(r in e))return!1;return!0}var Kt=function(){function e(t,n){Object(c.a)(this,e),this.toDOM=t,this.spec=n||Xt,this.side=this.spec.side||0}return Object(f.a)(e,[{key:"map",value:function(e,t,n,r){var o=e.mapResult(t.from+r,this.side<0?-1:1),i=o.pos;return o.deleted?null:new Zt(i-n,i-n,this)}},{key:"valid",value:function(){return!0}},{key:"eq",value:function(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&Ut(this.spec,t.spec))}},{key:"destroy",value:function(e){this.spec.destroy&&this.spec.destroy(e)}}]),e}(),Gt=function(){function e(t,n){Object(c.a)(this,e),this.attrs=t,this.spec=n||Xt}return Object(f.a)(e,[{key:"map",value:function(e,t,n,r){var o=e.map(t.from+r,this.spec.inclusiveStart?-1:1)-n,i=e.map(t.to+r,this.spec.inclusiveEnd?1:-1)-n;return o>=i?null:new Zt(o,i,this)}},{key:"valid",value:function(e,t){return t.from1&&void 0!==arguments[1]?arguments[1]:0;return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}},{key:"map",value:function(e,t,n){return this.type.map(e,this,t,n)}},{key:"spec",get:function(){return this.type.spec}},{key:"inline",get:function(){return this.type instanceof Gt}}],[{key:"widget",value:function(t,n,r){return new e(t,t,new Kt(n,r))}},{key:"inline",value:function(t,n,r,o){return new e(t,n,new Gt(r,o))}},{key:"node",value:function(t,n,r,o){return new e(t,n,new Jt(r,o))}}]),e}(),Yt=[],Xt={},Qt=function(){function e(t,n){Object(c.a)(this,e),this.local=t.length?t:Yt,this.children=n.length?n:Yt}return Object(f.a)(e,[{key:"find",value:function(e,t,n){var r=[];return this.findInner(null==e?0:e,null==t?1e9:t,r,0,n),r}},{key:"findInner",value:function(e,t,n,r,o){for(var i=0;i=e&&(!o||o(a.spec))&&n.push(a.copy(a.from+r,a.to+r))}for(var s=0;se){var l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,n,r+l,o)}}},{key:"map",value:function(e,t,n){return this==en||0==e.maps.length?this:this.mapInner(e,t,0,0,n||Xt)}},{key:"mapInner",value:function(t,n,r,o,i){for(var a,s=0;sl+i)){var c=s[a]+i;t>=c?s[a+1]=e<=c?-2:-1:n>=o&&(u=r-n-(t-e))&&(s[a]+=u,s[a+1]+=u)}}},u=0;u=r.content.size){c=!0;continue}var h=n.map(e[f+1]+i,-1)-o,m=r.content.findIndex(p),v=m.index,g=m.offset,y=r.maybeChild(v);if(y&&g==p&&g+y.nodeSize==h){var b=s[f+2].mapInner(n,y,d+1,e[f]+i+1,a);b!=en?(s[f]=p,s[f+1]=h,s[f+2]=b):(s[f+1]=-2,c=!0)}else c=!0}if(c){var w=function(e,t,n,r,o,i,a){function s(e,t){for(var i=0;il&&a.to=t){this.children[i]==t&&(r=this.children[i+2]);break}for(var a=t+1,s=a+n.content.size,l=0;la&&u.type instanceof Gt){var c=Math.max(a,u.from)-a,f=Math.min(s,u.to)-a;cn&&r.to0;)t++;e.splice(t,0,n)}function cn(e){var t=[];return e.someProp("decorations",(function(n){var r=n(e.state);r&&r!=en&&t.push(r)})),e.cursorWrapper&&t.push(Qt.create(e.state.doc,[e.cursorWrapper.deco])),tn.from(t)}var fn={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dn=C&&S<=11,pn=function(){function e(){Object(c.a)(this,e),this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}return Object(f.a)(e,[{key:"set",value:function(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}},{key:"clear",value:function(){this.anchorNode=this.focusNode=null}},{key:"eq",value:function(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}]),e}(),hn=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new pn,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.observer=window.MutationObserver&&new window.MutationObserver((function(e){for(var t=0;te.target.nodeValue.length}))?r.flushSoon():r.flush()})),dn&&(this.onCharData=function(e){r.queue.push({target:e.target,type:"characterData",oldValue:e.prevValue}),r.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}return Object(f.a)(e,[{key:"flushSoon",value:function(){var e=this;this.flushingSoon<0&&(this.flushingSoon=window.setTimeout((function(){e.flushingSoon=-1,e.flush()}),20))}},{key:"forceFlush",value:function(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}},{key:"start",value:function(){this.observer&&this.observer.observe(this.view.dom,fn),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}},{key:"stop",value:function(){var e=this;if(this.observer){var t=this.observer.takeRecords();if(t.length){for(var n=0;n-1)){var e=this.observer?this.observer.takeRecords():[];this.queue.length&&(e=this.queue.concat(e),this.queue.length=0);var t=this.view.domSelection(),n=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(t)&&Je(this.view)&&!this.ignoreSelectionChange(t),r=-1,o=-1,i=!1,a=[];if(this.view.editable)for(var s=0;s1){var u=a.filter((function(e){return"BR"==e.nodeName}));if(2==u.length){var c=u[0],f=u[1];c.parentNode&&c.parentNode.parentNode==f.parentNode?f.remove():c.remove()}}(r>-1||n)&&(r>-1&&(this.view.docView.markDirty(r,o),function(e){if(mn)return;mn=!0,"normal"==getComputedStyle(e.dom).whiteSpace&&console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package.")}(this.view)),this.handleDOMChange(r,o,i,a),this.view.docView&&this.view.docView.dirty?this.view.updateState(this.view.state):this.currentSelection.eq(t)||ze(this.view),this.currentSelection.set(t))}}},{key:"registerMutation",value:function(e,t){if(t.indexOf(e.target)>-1)return null;var n=this.view.docView.nearestDesc(e.target);if("attributes"==e.type&&(n==this.view.docView||"contenteditable"==e.attributeName||"style"==e.attributeName&&!e.oldValue&&!e.target.getAttribute("style")))return null;if(!n||n.ignoreMutation(e))return null;if("childList"==e.type){for(var r=0;rDate.now()-50?e.input.lastSelectionOrigin:null,a=Fe(e,i);if(a&&!e.state.selection.eq(a)){var s=e.state.tr.setSelection(a);"pointer"==i?s.setMeta("pointer",!0):"key"==i&&s.scrollIntoView(),e.dispatch(s)}}else{var l=e.state.doc.resolve(t),u=l.sharedDepth(n);t=l.before(u+1),n=e.state.doc.resolve(n).after(u+1);var c=e.state.selection,f=function(e,t,n){var r,o=e.docView.parseRange(t,n),i=o.node,a=o.fromOffset,s=o.toOffset,l=o.from,u=o.to,c=e.domSelection(),f=c.anchorNode;if(f&&e.dom.contains(1==f.nodeType?f:f.parentNode)&&(r=[{node:f,offset:c.anchorOffset}],U(c)||r.push({node:c.focusNode,offset:c.focusOffset})),E&&8===e.input.lastKeyCode)for(var d=s;d>a;d--){var p=i.childNodes[d-1],h=p.pmViewDesc;if("BR"==p.nodeName&&!h){s=d;break}if(!h||h.size)break}var m=e.state.doc,g=e.someProp("domParser")||v.DOMParser.fromSchema(e.state.schema),y=m.resolve(l),b=null,w=g.parse(i,{topNode:y.parent,topMatch:y.parent.contentMatchAt(y.index()),topOpen:!0,from:a,to:s,preserveWhitespace:"pre"!=y.parent.type.whitespace||"full",findPositions:r,ruleFromNode:vn,context:y});if(r&&null!=r[0].pos){var k=r[0].pos,x=r[1]&&r[1].pos;null==x&&(x=k),b={anchor:k+l,head:x+l}}return{doc:w,sel:b,from:l,to:u}}(e,t,n);if(E&&e.cursorWrapper&&f.sel&&f.sel.anchor==e.cursorWrapper.deco.from){var d=e.cursorWrapper.deco.type.toDOM.nextSibling,h=d&&d.nodeValue?d.nodeValue.length:1;f.sel={anchor:f.sel.anchor+h,head:f.sel.anchor+h}}var m,g,y=e.state.doc,b=y.slice(f.from,f.to);8===e.input.lastKeyCode&&Date.now()-100=s?i-r:0)+(l-s),s=i}else if(l=l?i-r:0)+(s-l),l=i}return{start:i,endA:s,endB:l}}(b.content,f.doc.content,f.from,m,g);if((T&&e.input.lastIOSEnter>Date.now()-225||P)&&o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName}))&&(!w||w.endA>=w.endB)&&e.someProp("handleKeyDown",(function(t){return t(e,K(13,"Enter"))})))e.input.lastIOSEnter=0;else{if(!w){if(!(r&&c instanceof p.TextSelection&&!c.empty&&c.$head.sameParent(c.$anchor))||e.composing||f.sel&&f.sel.anchor!=f.sel.head){if(f.sel){var k=yn(e,e.state.doc,f.sel);k&&!k.eq(e.state.selection)&&e.dispatch(e.state.tr.setSelection(k))}return}w={start:c.from,endA:c.to,endB:c.to}}e.input.domChangeCount++,e.state.selection.frome.state.selection.from&&w.start<=e.state.selection.from+2&&e.state.selection.from>=f.from?w.start=e.state.selection.from:w.endA=e.state.selection.to-2&&e.state.selection.to<=f.to&&(w.endB+=e.state.selection.to-w.endA,w.endA=e.state.selection.to)),C&&S<=11&&w.endB==w.start+1&&w.endA==w.start&&w.start>f.from&&" \xa0"==f.doc.textBetween(w.start-f.from-1,w.start-f.from+1)&&(w.start--,w.endA--,w.endB--);var x,O=f.doc.resolveNoCache(w.start-f.from),j=f.doc.resolveNoCache(w.endB-f.from),A=y.resolve(w.start),D=O.sameParent(j)&&O.parent.inlineContent&&A.end()>=w.endA;if((T&&e.input.lastIOSEnter>Date.now()-225&&(!D||o.some((function(e){return"DIV"==e.nodeName||"P"==e.nodeName})))||!D&&O.posw.start&&function(e,t,n,r,o){if(!r.parent.isTextblock||n-t<=o.pos-r.pos||bn(r,!0,!1)n||bn(a,!0,!1)t.content.size?null:Ge(e,t.resolve(n.anchor),t.resolve(n.head))}function bn(e,t,n){for(var r=e.depth,o=t?e.end():e.pos;r>0&&(t||e.indexAfter(r)==e.node(r).childCount);)r--,o++,t=!1;if(n)for(var i=e.node(r).maybeChild(e.indexAfter(r));i&&!i.isLeaf;)i=i.firstChild,o++;return o}var wn=ct,kn=function(){function e(t,n){var r=this;Object(c.a)(this,e),this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Ot,this.prevDirectPlugins=[],this.pluginViews=[],this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(jn),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):"function"==typeof t?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=Cn(this),On(this),this.nodeViews=Sn(this),this.docView=ke(this.state.doc,xn(this),cn(this),this.dom,this),this.domObserver=new hn(this,(function(e,t,n,o){return gn(r,e,t,n,o)})),this.domObserver.start(),function(e){var t=function(t){var n=kt[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=function(t){!function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(var n=t.target;n!=e.dom;n=n.parentNode)if(!n||11==n.nodeType||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}(e,t)||jt(e,t)||!e.editable&&t.type in xt||n(e,t)})};for(var n in kt)t(n);M&&e.dom.addEventListener("input",(function(){return null})),St(e)}(this),this.updatePluginViews()}return Object(f.a)(e,[{key:"composing",get:function(){return this.input.composing}},{key:"props",get:function(){if(this._props.state!=this.state){var e=this._props;for(var t in this._props={},e)this._props[t]=e[t];this._props.state=this.state}return this._props}},{key:"update",value:function(e){e.handleDOMEvents!=this._props.handleDOMEvents&&St(this),this._props=e,e.plugins&&(e.plugins.forEach(jn),this.directPlugins=e.plugins),this.updateStateInner(e.state,!0)}},{key:"setProps",value:function(e){var t={};for(var n in this._props)t[n]=this._props[n];for(var r in t.state=this.state,e)t[r]=e[r];this.update(t)}},{key:"updateState",value:function(e){this.updateStateInner(e,this.state.plugins!=e.plugins)}},{key:"updateStateInner",value:function(e,t){var n=this,r=this.state,o=!1,i=!1;if(e.storedMarks&&this.composing&&(zt(this),i=!0),this.state=e,t){var a=Sn(this);(function(e,t){var n=0,r=0;for(var o in e){if(e[o]!=t[o])return!0;n++}for(var i in t)r++;return n!=r})(a,this.nodeViews)&&(this.nodeViews=a,o=!0),St(this)}this.editable=Cn(this),On(this);var s=cn(this),l=xn(this),u=t?"reset":e.scrollToSelection>r.scrollToSelection?"to selection":"preserve",c=o||!this.docView.matchesNode(e.doc,l,s);!c&&e.selection.eq(r.selection)||(i=!0);var f="preserve"==u&&i&&null==this.dom.style.overflowAnchor&&function(e){for(var t,n,r=e.dom.getBoundingClientRect(),o=Math.max(0,r.top),i=(r.left+r.right)/2,a=o+1;a=o-20){t=s,n=l.top;break}}}return{refDOM:t,refTop:n,stack:X(e.dom)}}(this);if(i){this.domObserver.stop();var d=c&&(C||E)&&!this.composing&&!r.selection.empty&&!e.selection.empty&&function(e,t){var n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}(r.selection,e.selection);if(c){var h=E?this.trackWrites=this.domSelection().focusNode:null;!o&&this.docView.update(e.doc,l,s,this)||(this.docView.updateOuterDeco([]),this.docView.destroy(),this.docView=ke(e.doc,l,s,this.dom,this)),h&&!this.trackWrites&&(d=!0)}d||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelection())&&function(e){var t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelection();return _(t.node,t.offset,n.anchorNode,n.anchorOffset)}(this))?ze(this,d):(Ue(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}if(this.updatePluginViews(r),"reset"==u)this.dom.scrollTop=0;else if("to selection"==u){var m=this.domSelection().focusNode;if(this.someProp("handleScrollToSelection",(function(e){return e(n)})));else if(e.selection instanceof p.NodeSelection){var v=this.docView.domAfterPos(e.selection.from);1==v.nodeType&&Y(this,v.getBoundingClientRect(),m)}else Y(this,this.coordsAtPos(e.selection.head,1),m)}else f&&function(e){var t=e.refDOM,n=e.refTop,r=e.stack,o=t?t.getBoundingClientRect().top:0;Q(r,0==o?0:o-n)}(f)}},{key:"destroyPluginViews",value:function(){for(var e;e=this.pluginViews.pop();)e.destroy&&e.destroy()}},{key:"updatePluginViews",value:function(e){if(e&&e.plugins==this.state.plugins&&this.directPlugins==this.prevDirectPlugins)for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:1;return se(this,e,t)}},{key:"domAtPos",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.docView.domFromPos(e,t)}},{key:"nodeDOM",value:function(e){var t=this.docView.descAt(e);return t?t.nodeDOM:null}},{key:"posAtDOM",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,r=this.docView.posFromDOM(e,t,n);if(null==r)throw new RangeError("DOM position not inside the editor");return r}},{key:"endOfTextblock",value:function(e,t){return me(this,t||this.state,e)}},{key:"destroy",value:function(){this.docView&&(!function(e){for(var t in e.domObserver.stop(),e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],cn(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null)}},{key:"isDestroyed",get:function(){return null==this.docView}},{key:"dispatchEvent",value:function(e){return function(e,t){jt(e,t)||!kt[t.type]||!e.editable&&t.type in xt||kt[t.type](e,t)}(this,e)}},{key:"dispatch",value:function(e){var t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}},{key:"domSelection",value:function(){return this.root.getSelection()}}]),e}();function xn(e){var t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),t.translate="no",e.someProp("attributes",(function(n){if("function"==typeof n&&(n=n(e.state)),n)for(var r in n)"class"==r&&(t.class+=" "+n[r]),"style"==r?t.style=(t.style?t.style+";":"")+n[r]:t[r]||"contenteditable"==r||"nodeName"==r||(t[r]=String(n[r]))})),[Zt.node(0,e.state.doc.content.size,t)]}function On(e){if(e.markCursor){var t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:Zt.widget(e.state.selection.head,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function Cn(e){return!e.someProp("editable",(function(t){return!1===t(e.state)}))}function Sn(e){var t=Object.create(null);function n(e){for(var n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function jn(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}for(var An={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",229:"q"},En={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Dn="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Mn="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Tn="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Ln="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Pn="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Rn=Dn&&(Ln||+Dn[1]<57)||Tn&&Ln,Hn=0;Hn<10;Hn++)An[48+Hn]=An[96+Hn]=String(Hn);for(Hn=1;Hn<=24;Hn++)An[Hn+111]="F"+Hn;for(Hn=65;Hn<=90;Hn++)An[Hn]=String.fromCharCode(Hn+32),En[Hn]=String.fromCharCode(Hn);for(var Nn in An)En.hasOwnProperty(Nn)||(En[Nn]=An[Nn]);var Fn="undefined"!=typeof navigator&&/Mac|iP(hone|[oa]d)/.test(navigator.platform);function Vn(e){var t,n,r,o,i=e.split(/-(?!$)/),a=i[i.length-1];"Space"==a&&(a=" ");for(var s=0;s127)&&(r=An[n.keyCode])&&r!=o){var s=t[zn(r,n,!0)];if(s&&s(e.state,e.dispatch,e))return!0}else if(i&&n.shiftKey){var l=t[zn(o,n,!0)];if(l&&l(e.state,e.dispatch,e))return!0}return!1}}var In=function(e,t){return!e.selection.empty&&(t&&t(e.tr.deleteSelection().scrollIntoView()),!0)},$n=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("backward",e):r.parentOffset>0))return!1;var o=Un(r);if(!o){var i=r.blockRange(),a=i&&Object(g.k)(i);return null!=a&&(t&&t(e.tr.lift(i,a).scrollIntoView()),!0)}var s=o.nodeBefore;if(!s.type.spec.isolating&&rr(e,o,t))return!0;if(0==r.parent.content.size&&(qn(s,"end")||p.NodeSelection.isSelectable(s))){var l=Object(g.l)(e.doc,r.before(),r.after(),v.Slice.empty);if(l&&l.slice.size2&&void 0!==arguments[2]&&arguments[2],r=e;r;r="start"==t?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(n&&1!=r.childCount)return!1}return!1}var Wn=function(e,t,n){var r=e.selection,o=r.$head,i=o;if(!r.empty)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;i=Un(o)}var a=i&&i.nodeBefore;return!(!a||!p.NodeSelection.isSelectable(a))&&(t&&t(e.tr.setSelection(p.NodeSelection.create(e.doc,i.pos-a.nodeSize)).scrollIntoView()),!0)};function Un(e){if(!e.parent.type.spec.isolating)for(var t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}var Kn=function(e,t,n){var r=e.selection.$cursor;if(!r||(n?!n.endOfTextblock("forward",e):r.parentOffset=0;t--){var n=e.node(t);if(e.index(t)+11&&n.after()!=n.end(-1)){var r=n.before();if(Object(g.g)(e.doc,r))return t&&t(e.tr.split(r).scrollIntoView()),!0}var o=n.blockRange(),i=o&&Object(g.k)(o);return null!=i&&(t&&t(e.tr.lift(o,i).scrollIntoView()),!0)},nr=function(e,t){var n=e.selection,r=n.$from,o=n.$to;if(e.selection instanceof p.NodeSelection&&e.selection.node.isBlock)return!(!r.parentOffset||!Object(g.g)(e.doc,r.pos))&&(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.parent.isBlock)return!1;if(t){var i=o.parentOffset==o.parent.content.size,a=e.tr;(e.selection instanceof p.TextSelection||e.selection instanceof p.AllSelection)&&a.deleteSelection();var s=0==r.depth?null:Xn(r.node(-1).contentMatchAt(r.indexAfter(-1))),l=i&&s?[{type:s}]:void 0,u=Object(g.g)(a.doc,a.mapping.map(r.pos),1,l);if(l||u||!Object(g.g)(a.doc,a.mapping.map(r.pos),1,s?[{type:s}]:void 0)||(s&&(l=[{type:s}]),u=!0),u&&(a.split(a.mapping.map(r.pos),1,l),!i&&!r.parentOffset&&r.parent.type!=s)){var c=a.mapping.map(r.before()),f=a.doc.resolve(c);s&&r.node(-1).canReplaceWith(f.index(),f.index()+1,s)&&a.setNodeMarkup(a.mapping.map(r.before()),s)}t(a.scrollIntoView())}return!0};function rr(e,t,n){var r,o,i=t.nodeBefore,a=t.nodeAfter;if(i.type.spec.isolating||a.type.spec.isolating)return!1;if(function(e,t,n){var r=t.nodeBefore,o=t.nodeAfter,i=t.index();return!!(r&&o&&r.type.compatibleContent(o.type))&&(!r.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-r.nodeSize,t.pos).scrollIntoView()),!0):!(!t.parent.canReplace(i,i+1)||!o.isTextblock&&!Object(g.f)(e.doc,t.pos))&&(n&&n(e.tr.clearIncompatible(t.pos,r.type,r.contentMatchAt(r.childCount)).join(t.pos).scrollIntoView()),!0))}(e,t,n))return!0;var s=t.parent.canReplace(t.index(),t.index()+1);if(s&&(r=(o=i.contentMatchAt(i.childCount)).findWrapping(a.type))&&o.matchType(r[0]||a.type).validEnd){if(n){for(var l=t.pos+a.nodeSize,u=v.Fragment.empty,c=r.length-1;c>=0;c--)u=v.Fragment.from(r[c].create(null,u));u=v.Fragment.from(i.copy(u));var f=e.tr.step(new g.b(t.pos-1,l,t.pos,l,new v.Slice(u,1,0),r.length,!0)),d=l+2*r.length;Object(g.f)(f.doc,d)&&f.join(d),n(f.scrollIntoView())}return!0}var h=p.Selection.findFrom(t,1),m=h&&h.$from.blockRange(h.$to),y=m&&Object(g.k)(m);if(null!=y&&y>=t.depth)return n&&n(e.tr.lift(m,y).scrollIntoView()),!0;if(s&&qn(a,"start",!0)&&qn(i,"end")){for(var b=i,w=[];w.push(b),!b.isTextblock;)b=b.lastChild;for(var k=a,x=1;!k.isTextblock;k=k.firstChild)x++;if(b.canReplace(b.childCount,b.childCount,k.content)){if(n){for(var O=v.Fragment.empty,C=w.length-1;C>=0;C--)O=v.Fragment.from(w[C].copy(O));n(e.tr.step(new g.b(t.pos-w.length,t.pos+a.nodeSize,t.pos+x,t.pos+a.nodeSize-x,new v.Slice(O,w.length,0),0,!0)).scrollIntoView())}return!0}}return!1}function or(e){return function(t,n){for(var r=t.selection,o=e<0?r.$from:r.$to,i=o.depth;o.node(i).isInline;){if(!i)return!1;i--}return!!o.node(i).isTextblock&&(n&&n(t.tr.setSelection(p.TextSelection.create(t.doc,e<0?o.start(i):o.end(i)))),!0)}}var ir=or(-1),ar=or(1);function sr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),l=s&&Object(g.i)(s,e,t);return!!l&&(r&&r(n.tr.wrap(s,l).scrollIntoView()),!0)}}function lr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.from,a=o.to,s=!1;return n.doc.nodesBetween(i,a,(function(r,o){if(s)return!1;if(r.isTextblock&&!r.hasMarkup(e,t))if(r.type==e)s=!0;else{var i=n.doc.resolve(o),a=i.index();s=i.parent.canReplaceWith(a,a+1,e)}})),!!s&&(r&&r(n.tr.setBlockType(i,a,e,t).scrollIntoView()),!0)}}function ur(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:null;return function(n,r){var o=n.selection,i=o.$from,a=o.$to,s=i.blockRange(a),l=!1,u=s;if(!s)return!1;if(s.depth>=2&&i.node(s.depth-1).type.compatibleContent(e)&&0==s.startIndex){if(0==i.index(s.depth-1))return!1;var c=n.doc.resolve(s.start-2);u=new v.NodeRange(c,c,s.depth),s.endIndex=0;a--)i=v.Fragment.from(n[a].type.create(n[a].attrs,i));e.step(new g.b(t.start-(r?2:0),t.end,t.start,t.end,new v.Slice(i,0,0),n.length,!0));for(var s=0,l=0;l0&&t.firstChild.type==e}));return!!a&&(!n||(o.node(a.depth-1).type==e?function(e,t,n,r){var o=e.tr,i=r.end,a=r.$to.end(r.depth);is;a--)i-=o.child(a).nodeSize,r.delete(i-1,i+1);var l=r.doc.resolve(n.start),u=l.nodeAfter;if(r.mapping.map(n.end)!=n.start+l.nodeAfter.nodeSize)return!1;var c=0==n.startIndex,f=n.endIndex==o.childCount,d=l.node(-1),p=l.index(-1);if(!d.canReplace(p+(c?0:1),p+1,u.content.append(f?v.Fragment.empty:v.Fragment.from(o))))return!1;var h=l.pos,m=h+u.nodeSize;return r.step(new g.b(h-(c?1:0),m+(f?1:0),h+1,m-1,new v.Slice((c?v.Fragment.empty:v.Fragment.from(o.copy(v.Fragment.empty))).append(f?v.Fragment.empty:v.Fragment.from(o.copy(v.Fragment.empty))),c?0:1,f?0:1),c?0:1)),t(r.scrollIntoView()),!0}(t,n,a)))}}function yr(e){var t=e.state,n=e.transaction,r=n.selection,o=n.doc,i=n.storedMarks;return Object(d.a)(Object(d.a)({},t),{},{apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),filterTransaction:t.filterTransaction,plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return r},get doc(){return o},get tr(){return r=n.selection,o=n.doc,i=n.storedMarks,n}})}var br=function(){function e(t){Object(c.a)(this,e),this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}return Object(f.a)(e,[{key:"hasCustomState",get:function(){return!!this.customState}},{key:"state",get:function(){return this.customState||this.editor.state}},{key:"commands",get:function(){var e=this,t=this.rawCommands,n=this.editor,r=this.state,o=n.view,i=r.tr,a=this.buildProps(i);return Object.fromEntries(Object.entries(t).map((function(t){var n=Object(u.a)(t,2),r=n[0],s=n[1];return[r,function(){var t=s.apply(void 0,arguments)(a);return i.getMeta("preventDispatch")||e.hasCustomState||o.dispatch(i),t}]})))}},{key:"chain",get:function(){var e=this;return function(){return e.createChain()}}},{key:"can",get:function(){var e=this;return function(){return e.createCan()}}},{key:"createChain",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view,s=[],l=!!e,c=e||i.tr,f=function(){return l||!n||c.getMeta("preventDispatch")||t.hasCustomState||a.dispatch(c),s.every((function(e){return!0===e}))},p=Object(d.a)(Object(d.a)({},Object.fromEntries(Object.entries(r).map((function(e){var r=Object(u.a)(e,2),o=r[0],i=r[1];return[o,function(){var e=t.buildProps(c,n),r=i.apply(void 0,arguments)(e);return s.push(r),p}]})))),{},{run:f});return p}},{key:"createCan",value:function(e){var t=this,n=this.rawCommands,r=this.state,o=void 0,i=e||r.tr,a=this.buildProps(i,o),s=Object.fromEntries(Object.entries(n).map((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(Object(d.a)(Object(d.a)({},a),{},{dispatch:o}))}]})));return Object(d.a)(Object(d.a)({},s),{},{chain:function(){return t.createChain(i,o)}})}},{key:"buildProps",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.rawCommands,o=this.editor,i=this.state,a=o.view;i.storedMarks&&e.setStoredMarks(i.storedMarks);var s={tr:e,editor:o,view:a,state:yr({state:i,transaction:e}),dispatch:n?function(){}:void 0,chain:function(){return t.createChain(e)},can:function(){return t.createCan(e)},get commands(){return Object.fromEntries(Object.entries(r).map((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];return[n,function(){return r.apply(void 0,arguments)(s)}]})))}};return s}}]),e}(),wr=function(){function e(){Object(c.a)(this,e),this.callbacks={}}return Object(f.a)(e,[{key:"on",value:function(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}},{key:"emit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:void 0;if(Ar(e)){for(var n=arguments.length,r=new Array(n>2?n-2:0),o=2;o0&&void 0!==arguments[0]?arguments[0]:{};return 0===Object.keys(e).length&&e.constructor===Object}(r))&&(null!==r&&void 0!==r)})))}function Tr(e){var t,n=Or(e),r=xr(e),o=r.nodeExtensions,i=r.markExtensions,a=null===(t=o.find((function(e){return kr(e,"topNode")})))||void 0===t?void 0:t.name,s=Object.fromEntries(o.map((function(t){var r=n.filter((function(e){return e.type===t.name})),o={name:t.name,options:t.options,storage:t.storage},i=e.reduce((function(e,n){var r=kr(n,"extendNodeSchema",o);return Object(d.a)(Object(d.a)({},e),r?r(t):{})}),{}),a=Mr(Object(d.a)(Object(d.a)({},i),{},{content:Er(kr(t,"content",o)),marks:Er(kr(t,"marks",o)),group:Er(kr(t,"group",o)),inline:Er(kr(t,"inline",o)),atom:Er(kr(t,"atom",o)),selectable:Er(kr(t,"selectable",o)),draggable:Er(kr(t,"draggable",o)),code:Er(kr(t,"code",o)),defining:Er(kr(t,"defining",o)),isolating:Er(kr(t,"isolating",o)),attrs:Object.fromEntries(r.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),s=Er(kr(t,"parseHTML",o));s&&(a.parseDOM=s.map((function(e){return Dr(e,r)})));var l=kr(t,"renderHTML",o);l&&(a.toDOM=function(e){return l({node:e,HTMLAttributes:jr(e,r)})});var u=kr(t,"renderText",o);return u&&(a.toText=u),[t.name,a]}))),l=Object.fromEntries(i.map((function(t){var r=n.filter((function(e){return e.type===t.name})),o={name:t.name,options:t.options,storage:t.storage},i=e.reduce((function(e,n){var r=kr(n,"extendMarkSchema",o);return Object(d.a)(Object(d.a)({},e),r?r(t):{})}),{}),a=Mr(Object(d.a)(Object(d.a)({},i),{},{inclusive:Er(kr(t,"inclusive",o)),excludes:Er(kr(t,"excludes",o)),group:Er(kr(t,"group",o)),spanning:Er(kr(t,"spanning",o)),code:Er(kr(t,"code",o)),attrs:Object.fromEntries(r.map((function(e){var t;return[e.name,{default:null===(t=null===e||void 0===e?void 0:e.attribute)||void 0===t?void 0:t.default}]})))})),s=Er(kr(t,"parseHTML",o));s&&(a.parseDOM=s.map((function(e){return Dr(e,r)})));var l=kr(t,"renderHTML",o);return l&&(a.toDOM=function(e){return l({mark:e,HTMLAttributes:jr(e,r)})}),[t.name,a]})));return new v.Schema({topNode:a,nodes:s,marks:l})}function Lr(e,t){return t.nodes[e]||t.marks[e]||null}function Pr(e,t){return Array.isArray(t)?t.some((function(t){return("string"===typeof t?t:t.name)===e.name})):t}function Rr(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var Hr=Object(f.a)((function e(t){Object(c.a)(this,e),this.find=t.find,this.handler=t.handler}));function Nr(e){var t,n=e.editor,r=e.from,o=e.to,i=e.text,a=e.rules,s=e.plugin,l=n.view;if(l.composing)return!1;var u=l.state.doc.resolve(r);if(u.parent.type.spec.code||(null===(t=u.nodeBefore||u.nodeAfter)||void 0===t?void 0:t.marks.find((function(e){return e.type.spec.code}))))return!1;var c=!1,f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n="";return e.parent.nodesBetween(Math.max(0,e.parentOffset-t),e.parentOffset,(function(t,r,o,i){var a,s,l;n+=(null===(s=(a=t.type.spec).toText)||void 0===s?void 0:s.call(a,{node:t,pos:r,parent:o,index:i}))||(null===(l=e.nodeBefore)||void 0===l?void 0:l.text)||"%leaf%"})),n}(u)+i;return a.forEach((function(e){if(!c){var t=function(e,t){if(Rr(t))return t.exec(e);var n=t(e);if(!n)return null;var r=[];return r.push(n.text),r.index=n.index,r.input=e,r.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(n.replaceWith)),r}(f,e.find);if(t){var a=l.state.tr,u=yr({state:l.state,transaction:a}),d={from:r-(t[0].length-i.length),to:o},p=new br({editor:n,state:u}),h=p.commands,m=p.chain,v=p.can;null!==e.handler({state:u,range:d,match:t,commands:h,chain:m,can:v})&&a.steps.length&&(a.setMeta(s,{transform:a,from:r,to:o,text:i}),l.dispatch(a),c=!0)}}})),c}function Fr(e){var t=e.editor,n=e.rules,r=new p.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(r);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,o,i,a){return Nr({editor:t,from:o,to:i,text:a,rules:n,plugin:r})},handleDOMEvents:{compositionend:function(e){return setTimeout((function(){var o=e.state.selection.$cursor;o&&Nr({editor:t,from:o.pos,to:o.pos,text:"",rules:n,plugin:r})})),!1}},handleKeyDown:function(e,o){if("Enter"!==o.key)return!1;var i=e.state.selection.$cursor;return!!i&&Nr({editor:t,from:i.pos,to:i.pos,text:"\n",rules:n,plugin:r})}},isInputRules:!0});return r}var Vr=Object(f.a)((function e(t){Object(c.a)(this,e),this.find=t.find,this.handler=t.handler}));function zr(e){var t=e.editor,n=e.state,r=e.from,o=e.to,i=e.rule,a=new br({editor:t,state:n}),s=a.commands,u=a.chain,c=a.can,f=[];return n.doc.nodesBetween(r,o,(function(e,t){if(e.isTextblock&&!e.type.spec.code){var a=Math.max(r,t),d=Math.min(o,t+e.content.size);(function(e,t){if(Rr(t))return Object(l.a)(e.matchAll(t));var n=t(e);return n?n.map((function(t){var n=[];return n.push(t.text),n.index=t.index,n.input=e,n.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),n.push(t.replaceWith)),n})):[]})(e.textBetween(a-t,d-t,void 0,"\ufffc"),i.find).forEach((function(e){if(void 0!==e.index){var t=a+e.index+1,r=t+e[0].length,o={from:n.tr.mapping.map(t),to:n.tr.mapping.map(r)},l=i.handler({state:n,range:o,match:e,commands:s,chain:u,can:c});f.push(l)}}))}})),f.every((function(e){return null!==e}))}var _r=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.splittableMarks=[],this.editor=n,this.extensions=e.resolve(t),this.schema=Tr(this.extensions),this.extensions.forEach((function(e){var t;r.editor.extensionStorage[e.name]=e.storage;var n={name:e.name,options:e.options,storage:e.storage,editor:r.editor,type:Lr(e.name,r.schema)};"mark"===e.type&&((null===(t=Er(kr(e,"keepOnSplit",n)))||void 0===t||t)&&r.splittableMarks.push(e.name));var o=kr(e,"onBeforeCreate",n);o&&r.editor.on("beforeCreate",o);var i=kr(e,"onCreate",n);i&&r.editor.on("create",i);var a=kr(e,"onUpdate",n);a&&r.editor.on("update",a);var s=kr(e,"onSelectionUpdate",n);s&&r.editor.on("selectionUpdate",s);var l=kr(e,"onTransaction",n);l&&r.editor.on("transaction",l);var u=kr(e,"onFocus",n);u&&r.editor.on("focus",u);var c=kr(e,"onBlur",n);c&&r.editor.on("blur",c);var f=kr(e,"onDestroy",n);f&&r.editor.on("destroy",f)}))}return Object(f.a)(e,[{key:"commands",get:function(){var e=this;return this.extensions.reduce((function(t,n){var r=kr(n,"addCommands",{name:n.name,options:n.options,storage:n.storage,editor:e.editor,type:Lr(n.name,e.schema)});return r?Object(d.a)(Object(d.a)({},t),r()):t}),{})}},{key:"plugins",get:function(){var t=this,n=this.editor,r=e.sort(Object(l.a)(this.extensions).reverse()),o=[],i=[],a=r.map((function(e){var r={name:e.name,options:e.options,storage:e.storage,editor:n,type:Lr(e.name,t.schema)},a=[],s=kr(e,"addKeyboardShortcuts",r);if(s){var c=_n(Object.fromEntries(Object.entries(s()).map((function(e){var t=Object(u.a)(e,2),r=t[0],o=t[1];return[r,function(){return o({editor:n})}]}))));a.push(c)}var f=kr(e,"addInputRules",r);Pr(e,n.options.enableInputRules)&&f&&o.push.apply(o,Object(l.a)(f()));var d=kr(e,"addPasteRules",r);Pr(e,n.options.enablePasteRules)&&d&&i.push.apply(i,Object(l.a)(d()));var p=kr(e,"addProseMirrorPlugins",r);if(p){var h=p();a.push.apply(a,Object(l.a)(h))}return a})).flat();return[Fr({editor:n,rules:o})].concat(Object(l.a)(function(e){var t=e.editor,n=e.rules,r=null,o=!1,i=!1;return n.map((function(e){return new p.Plugin({view:function(e){var t=function(t){var n;r=(null===(n=e.dom.parentElement)||void 0===n?void 0:n.contains(t.target))?e.dom.parentElement:null};return window.addEventListener("dragstart",t),{destroy:function(){window.removeEventListener("dragstart",t)}}},props:{handleDOMEvents:{drop:function(e){return i=r===e.dom.parentElement,!1},paste:function(e,t){var n,r=null===(n=t.clipboardData)||void 0===n?void 0:n.getData("text/html");return o=!!(null===r||void 0===r?void 0:r.includes("data-pm-slice")),!1}}},appendTransaction:function(n,r,a){var s=n[0],l="paste"===s.getMeta("uiEvent")&&!o,u="drop"===s.getMeta("uiEvent")&&!i;if(l||u){var c=r.doc.content.findDiffStart(a.doc.content),f=r.doc.content.findDiffEnd(a.doc.content);if("number"===typeof c&&f&&c!==f.b){var d=a.tr,p=yr({state:a,transaction:d});if(zr({editor:t,state:p,from:Math.max(c-1,0),to:f.b,rule:e})&&d.steps.length)return d}}}})}))}({editor:n,rules:i})),Object(l.a)(a))}},{key:"attributes",get:function(){return Or(this.extensions)}},{key:"nodeViews",get:function(){var e=this,t=this.editor,n=xr(this.extensions).nodeExtensions;return Object.fromEntries(n.filter((function(e){return!!kr(e,"addNodeView")})).map((function(n){var r=e.attributes.filter((function(e){return e.type===n.name})),o={name:n.name,options:n.options,storage:n.storage,editor:t,type:Cr(n.name,e.schema)},i=kr(n,"addNodeView",o);if(!i)return[];return[n.name,function(e,o,a,s){var l=jr(e,r);return i()({editor:t,node:e,getPos:a,decorations:s,HTMLAttributes:l,extension:n})}]})))}}],[{key:"resolve",value:function(t){var n=e.sort(e.flatten(t)),r=function(e){var t=e.filter((function(t,n){return e.indexOf(t)!==n}));return Object(l.a)(new Set(t))}(n.map((function(e){return e.name})));return r.length&&console.warn("[tiptap warn]: Duplicate extension names found: [".concat(r.map((function(e){return"'".concat(e,"'")})).join(", "),"]. This can lead to issues.")),n}},{key:"flatten",value:function(e){var t=this;return e.map((function(e){var n=kr(e,"addExtensions",{name:e.name,options:e.options,storage:e.storage});return n?[e].concat(Object(l.a)(t.flatten(n()))):e})).flat(10)}},{key:"sort",value:function(e){return e.sort((function(e,t){var n=kr(e,"priority")||100,r=kr(t,"priority")||100;return n>r?-1:n0&&void 0!==arguments[0]?arguments[0]:{};Object(c.a)(this,e),this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(d.a)(Object(d.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Er(kr(this,"addOptions",{name:this.name}))),this.storage=Er(kr(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(f.a)(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=Ir(this.options,e),t.storage=Er(kr(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Er(kr(n,"addOptions",{name:n.name})),n.storage=Er(kr(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}();function qr(e,t,n){var r=t.from,o=t.to,i=n||{},a=i.blockSeparator,s=void 0===a?"\n\n":a,l=i.textSerializers,u=void 0===l?{}:l,c="",f=!0;return e.nodesBetween(r,o,(function(e,n,i,a){var l,d=null===u||void 0===u?void 0:u[e.type.name];d?(e.isBlock&&!f&&(c+=s,f=!0),i&&(c+=d({node:e,pos:n,parent:i,index:a,range:t}))):e.isText?(c+=null===(l=null===e||void 0===e?void 0:e.text)||void 0===l?void 0:l.slice(Math.max(r,n)-n,o-n),f=!1):e.isBlock&&!f&&(c+=s,f=!0)})),c}function Wr(e){return Object.fromEntries(Object.entries(e.nodes).filter((function(e){return Object(u.a)(e,2)[1].spec.toText})).map((function(e){var t=Object(u.a)(e,2);return[t[0],t[1].spec.toText]})))}var Ur=$r.create({name:"clipboardTextSerializer",addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("clipboardTextSerializer"),props:{clipboardTextSerializer:function(){var t=e.editor,n=t.state,r=t.schema,o=n.doc,i=n.selection.ranges,a=Math.min.apply(Math,Object(l.a)(i.map((function(e){return e.$from.pos})))),s=Math.max.apply(Math,Object(l.a)(i.map((function(e){return e.$to.pos}))));return qr(o,{from:a,to:s},{textSerializers:Wr(r)})}}})]}});function Kr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{strict:!0},r=Object.keys(t);return!r.length||r.every((function(r){return n.strict?t[r]===e[r]:Rr(t[r])?t[r].test(e[r]):t[r]===e[r]}))}function Gr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.find((function(e){return e.type===t&&Kr(e.attrs,n)}))}function Jr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return!!Gr(e,t,n)}function Zr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t){var r=e.parent.childAfter(e.parentOffset);if(e.parentOffset===r.offset&&0!==r.offset&&(r=e.parent.childBefore(e.parentOffset)),r.node){var o=Gr(Object(l.a)(r.node.marks),t,n);if(o){var i=r.index,a=e.start()+r.offset,s=i+1,u=a+r.node.nodeSize;for(Gr(Object(l.a)(r.node.marks),t,n);i>0&&o.isInSet(e.parent.child(i-1).marks);)i-=1,a-=e.parent.child(i).nodeSize;for(;s0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Math.min(Math.max(e,t),n)}function to(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!t)return null;var n=p.Selection.atStart(e),r=p.Selection.atEnd(e);if("start"===t||!0===t)return n;if("end"===t)return r;var o=n.from,i=r.to;return"all"===t?p.TextSelection.create(e,eo(0,o,i),eo(e.content.size,o,i)):p.TextSelection.create(e,eo(t,o,i),eo(t,o,i))}function no(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function ro(e){var t="".concat(e,"");return(new window.DOMParser).parseFromString(t,"text/html").body}function oo(e,t,n){if(n=Object(d.a)({slice:!0,parseOptions:{}},n),"object"===typeof e&&null!==e)try{return Array.isArray(e)?v.Fragment.fromArray(e.map((function(e){return t.nodeFromJSON(e)}))):t.nodeFromJSON(e)}catch(o){return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",o),oo("",t,n)}if("string"===typeof e){var r=v.DOMParser.fromSchema(t);return n.slice?r.parseSlice(ro(e),n.parseOptions).content:r.parse(ro(e),n.parseOptions)}return oo("",t,n)}function io(){return"undefined"!==typeof navigator&&/Mac/.test(navigator.platform)}function ao(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.from,i=r.to,a=r.empty,s=t?Cr(t,e.schema):null,l=[];e.doc.nodesBetween(o,i,(function(e,t){if(!e.isText){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);l.push({node:e,from:n,to:r})}}));var u=i-o,c=l.filter((function(e){return!s||s.name===e.node.type.name})).filter((function(e){return Kr(e.node.attrs,n,{strict:!1})}));if(a)return!!c.length;var f=c.reduce((function(e,t){return e+t.to-t.from}),0);return f>=u}function so(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function lo(e,t){var n="string"===typeof t?[t]:t;return Object.keys(e).reduce((function(t,r){return n.includes(r)||(t[r]=e[r]),t}),{})}function uo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return oo(e,t,{slice:!1,parseOptions:n})}function co(e,t){var n=Yr(t,e.schema),r=e.selection,o=r.from,i=r.to,a=r.empty,s=[];a?(e.storedMarks&&s.push.apply(s,Object(l.a)(e.storedMarks)),s.push.apply(s,Object(l.a)(e.selection.$head.marks()))):e.doc.nodesBetween(o,i,(function(e){s.push.apply(s,Object(l.a)(e.marks))}));var u=s.find((function(e){return e.type.name===n.name}));return u?Object(d.a)({},u.attrs):{}}function fo(e,t,n){return Object.fromEntries(Object.entries(n).filter((function(n){var r=Object(u.a)(n,1)[0],o=e.find((function(e){return e.type===t&&e.name===r}));return!!o&&o.attribute.keepOnSplit})))}function po(e){for(var t=0;t0;n-=1){var r=e.node(n);if(t(r))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:r}}}function vo(e){return function(t){return mo(t.$from,e)}}function go(e,t){var n=xr(t).nodeExtensions.find((function(t){return t.name===e}));if(!n)return!1;var r=Er(kr(n,"group",{name:n.name,options:n.options,storage:n.storage}));return"string"===typeof r&&r.split(" ").includes("list")}var yo=function(e,t){var n=vo((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!Object(g.f)(e.doc,n.pos)||(e.join(n.pos),!0)},bo=function(e,t){var n=vo((function(e){return e.type===t}))(e.selection);if(!n)return!0;var r=e.doc.resolve(n.start).after(n.depth);if(void 0===r)return!0;var o=e.doc.nodeAt(r);return n.node.type!==(null===o||void 0===o?void 0:o.type)||!Object(g.f)(e.doc,r)||(e.join(r),!0)};function wo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.selection,o=r.empty,i=r.ranges,a=t?Yr(t,e.schema):null;if(o)return!!(e.storedMarks||e.selection.$from.marks()).filter((function(e){return!a||a.name===e.type.name})).find((function(e){return Kr(e.attrs,n,{strict:!1})}));var s=0,u=[];if(i.forEach((function(t){var n=t.$from,r=t.$to,o=n.pos,i=r.pos;e.doc.nodesBetween(o,i,(function(e,t){if(e.isText||e.marks.length){var n=Math.max(o,t),r=Math.min(i,t+e.nodeSize);s+=r-n,u.push.apply(u,Object(l.a)(e.marks.map((function(e){return{mark:e,from:n,to:r}}))))}}))})),0===s)return!1;var c=u.filter((function(e){return!a||a.name===e.mark.type.name})).filter((function(e){return Kr(e.mark.attrs,n,{strict:!1})})).reduce((function(e,t){return e+t.to-t.from}),0),f=u.filter((function(e){return!a||e.mark.type!==a&&e.mark.type.excludes(a)})).reduce((function(e,t){return e+t.to-t.from}),0),d=c>0?c+f:c;return d>=s}var ko=Object.freeze({__proto__:null,blur:function(){return function(e){var t=e.editor,n=e.view;return requestAnimationFrame((function(){var e;t.isDestroyed||(n.dom.blur(),null===(e=null===window||void 0===window?void 0:window.getSelection())||void 0===e||e.removeAllRanges())})),!0}},clearContent:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return function(t){return t.commands.setContent("",e)}},clearNodes:function(){return function(e){var t=e.state,n=e.tr,r=e.dispatch,o=n.selection.ranges;return!r||(o.forEach((function(e){var r=e.$from,o=e.$to;t.doc.nodesBetween(r.pos,o.pos,(function(e,t){if(!e.type.isText){var r=n.doc,o=n.mapping,i=r.resolve(o.map(t)),a=r.resolve(o.map(t+e.nodeSize)),s=i.blockRange(a);if(s){var l=Object(g.k)(s);if(e.type.isTextblock){var u=i.parent.contentMatchAt(i.index()).defaultType;n.setNodeMarkup(s.start,u)}(l||0===l)&&n.lift(s,l)}}}))})),!0)}},command:function(e){return function(t){return e(t)}},createParagraphNear:function(){return function(e){var t=e.state,n=e.dispatch;return er(t,n)}},deleteNode:function(e){return function(t){for(var n=t.tr,r=t.state,o=t.dispatch,i=Cr(e,r.schema),a=n.selection.$anchor,s=a.depth;s>0;s-=1){if(a.node(s).type===i){if(o){var l=a.before(s),u=a.after(s);n.delete(l,u).scrollIntoView()}return!0}}return!1}},deleteRange:function(e){return function(t){var n=t.tr,r=t.dispatch,o=e.from,i=e.to;return r&&n.delete(o,i),!0}},deleteSelection:function(){return function(e){var t=e.state,n=e.dispatch;return In(t,n)}},enter:function(){return function(e){return e.commands.keyboardShortcut("Enter")}},exitCode:function(){return function(e){var t=e.state,n=e.dispatch;return Qn(t,n)}},extendMarkRange:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=Yr(e,o.schema),s=r.doc,l=r.selection,u=l.$from,c=l.from,f=l.to;if(i){var d=Zr(u,a,t);if(d&&d.from<=c&&d.to>=f){var h=p.TextSelection.create(s,d.from,d.to);r.setSelection(h)}}return!0}},first:function(e){return function(t){for(var n="function"===typeof e?e(t):e,r=0;r0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.editor,o=n.view,i=n.tr,a=n.dispatch;t=Object(d.a)({scrollIntoView:!0},t);var s=function(){no()&&o.dom.focus(),requestAnimationFrame((function(){r.isDestroyed||(o.focus(),(null===t||void 0===t?void 0:t.scrollIntoView)&&r.commands.scrollIntoView())}))};if(o.hasFocus()&&null===e||!1===e)return!0;if(a&&null===e&&!Qr(r.state.selection))return s(),!0;var l=to(i.doc,e)||r.state.selection,u=r.state.selection.eq(l);return a&&(u||i.setSelection(l),u&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0}},forEach:function(e,t){return function(n){return e.every((function(e,r){return t(e,Object(d.a)(Object(d.a)({},n),{},{index:r}))}))}},insertContent:function(e,t){return function(n){var r=n.tr;return n.commands.insertContentAt({from:r.selection.from,to:r.selection.to},e,t)}},insertContentAt:function(e,t,n){return function(r){var o=r.tr,i=r.dispatch,a=r.editor;if(i){n=Object(d.a)({parseOptions:{},updateSelection:!0},n);var s=oo(t,a.schema,{parseOptions:Object(d.a)({preserveWhitespace:"full"},n.parseOptions)});if("<>"===s.toString())return!0;var l="number"===typeof e?{from:e,to:e}:e,u=l.from,c=l.to,f=!0,h=!0;if((s.toString().startsWith("<")?s:[s]).forEach((function(e){e.check(),f=!!f&&(e.isText&&0===e.marks.length),h=!!h&&e.isBlock})),u===c&&h){var m=o.doc.resolve(u).parent;m.isTextblock&&!m.type.spec.code&&!m.childCount&&(u-=1,c+=1)}f?o.insertText(t,u,c):o.replaceWith(u,c,s),n.updateSelection&&function(e,t,n){var r=e.steps.length-1;if(!(r1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return!!ao(r,Cr(e,r.schema),t)&&Zn(r,o)}},liftEmptyBlock:function(){return function(e){var t=e.state,n=e.dispatch;return tr(t,n)}},liftListItem:function(e){return function(t){var n=t.state,r=t.dispatch;return gr(Cr(e,n.schema))(n,r)}},newlineInCode:function(){return function(e){var t=e.state,n=e.dispatch;return Yn(t,n)}},resetAttributes:function(e,t){return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,l=so("string"===typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(a=Cr(e,o.schema)),"mark"===l&&(s=Yr(e,o.schema)),i&&r.selection.ranges.forEach((function(e){o.doc.nodesBetween(e.$from.pos,e.$to.pos,(function(e,n){a&&a===e.type&&r.setNodeMarkup(n,void 0,lo(e.attrs,t)),s&&e.marks.length&&e.marks.forEach((function(o){s===o.type&&r.addMark(n,n+e.nodeSize,s.create(lo(o.attrs,t)))}))}))})),!0)}},scrollIntoView:function(){return function(e){var t=e.tr;return e.dispatch&&t.scrollIntoView(),!0}},selectAll:function(){return function(e){var t=e.tr;return e.commands.setTextSelection({from:0,to:t.doc.content.size})}},selectNodeBackward:function(){return function(e){var t=e.state,n=e.dispatch;return Wn(t,n)}},selectNodeForward:function(){return function(e){var t=e.state,n=e.dispatch;return Gn(t,n)}},selectParentNode:function(){return function(e){return function(e,t){var n,r=e.selection,o=r.$from,i=r.to,a=o.sharedDepth(i);return 0!=a&&(n=o.before(a),t&&t(e.tr.setSelection(p.NodeSelection.create(e.doc,n))),!0)}(e.state,e.dispatch)}},selectTextblockEnd:function(){return function(e){var t=e.state,n=e.dispatch;return ar(t,n)}},selectTextblockStart:function(){return function(e){var t=e.state,n=e.dispatch;return ir(t,n)}},setContent:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.tr,i=r.editor,a=r.dispatch,s=o.doc,l=uo(e,i.schema,n);return a&&o.replaceWith(0,s.content.size,l).setMeta("preventUpdate",!t),!0}},setMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=r.selection,s=a.empty,l=a.ranges,u=Yr(e,o.schema);if(i)if(s){var c=co(o,u);r.addStoredMark(u.create(Object(d.a)(Object(d.a)({},c),t)))}else l.forEach((function(e){var n=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(n,i,(function(e,o){var a=Math.max(o,n),s=Math.min(o+e.nodeSize,i);e.marks.find((function(e){return e.type===u}))?e.marks.forEach((function(e){u===e.type&&r.addMark(a,s,u.create(Object(d.a)(Object(d.a)({},e.attrs),t)))})):r.addMark(a,s,u.create(t))}))}));return!0}},setMeta:function(e,t){return function(n){return n.tr.setMeta(e,t),!0}},setNode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch,i=n.chain,a=Cr(e,r.schema);return a.isTextblock?i().command((function(e){var n=e.commands;return!!lr(a,t)(r)||n.clearNodes()})).command((function(e){var n=e.state;return lr(a,t)(n,o)})).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)}},setNodeSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o=p.Selection.atStart(r).from,i=p.Selection.atEnd(r).to,a=eo(e,o,i),s=p.NodeSelection.create(r,a);n.setSelection(s)}return!0}},setTextSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=n.doc,o="number"===typeof e?{from:e,to:e}:e,i=o.from,a=o.to,s=p.TextSelection.atStart(r).from,l=p.TextSelection.atEnd(r).to,u=eo(i,s,l),c=eo(a,s,l),f=p.TextSelection.create(r,u,c);n.setSelection(f)}return!0}},sinkListItem:function(e){return function(t){var n,r=t.state,o=t.dispatch,i=Cr(e,r.schema);return(n=i,function(e,t){var r=e.selection,o=r.$from,i=r.$to,a=o.blockRange(i,(function(e){return e.childCount>0&&e.firstChild.type==n}));if(!a)return!1;var s=a.startIndex;if(0==s)return!1;var l=a.parent,u=l.child(s-1);if(u.type!=n)return!1;if(t){var c=u.lastChild&&u.lastChild.type==l.type,f=v.Fragment.from(c?n.create():null),d=new v.Slice(v.Fragment.from(n.create(null,v.Fragment.from(l.type.create(null,f)))),c?3:1,0),p=a.start,h=a.end;t(e.tr.step(new g.b(p-(c?3:1),h,p,h,d,1,!0)).scrollIntoView())}return!0})(r,o)}},splitBlock:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.keepMarks,n=void 0===t||t;return function(e){var t=e.tr,r=e.state,o=e.dispatch,i=e.editor,a=t.selection,s=t.doc,l=a.$from,u=a.$to,c=fo(i.extensionManager.attributes,l.node().type.name,l.node().attrs);if(a instanceof p.NodeSelection&&a.node.isBlock)return!(!l.parentOffset||!Object(g.g)(s,l.pos))&&(o&&(n&&ho(r,i.extensionManager.splittableMarks),t.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;if(o){var f=u.parentOffset===u.parent.content.size;a instanceof p.TextSelection&&t.deleteSelection();var d=0===l.depth?void 0:po(l.node(-1).contentMatchAt(l.indexAfter(-1))),h=f&&d?[{type:d,attrs:c}]:void 0,m=Object(g.g)(t.doc,t.mapping.map(l.pos),1,h);if(h||m||!Object(g.g)(t.doc,t.mapping.map(l.pos),1,d?[{type:d}]:void 0)||(m=!0,h=d?[{type:d,attrs:c}]:void 0),m&&(t.split(t.mapping.map(l.pos),1,h),d&&!f&&!l.parentOffset&&l.parent.type!==d)){var v=t.mapping.map(l.before()),y=t.doc.resolve(v);l.node(-1).canReplaceWith(y.index(),y.index()+1,d)&&t.setNodeMarkup(t.mapping.map(l.before()),d)}n&&ho(r,i.extensionManager.splittableMarks),t.scrollIntoView()}return!0}},splitListItem:function(e){return function(t){var n,r=t.tr,o=t.state,i=t.dispatch,a=t.editor,s=Cr(e,o.schema),l=o.selection,u=l.$from,c=l.$to,f=o.selection.node;if(f&&f.isBlock||u.depth<2||!u.sameParent(c))return!1;var d=u.node(-1);if(d.type!==s)return!1;var h=a.extensionManager.attributes;if(0===u.parent.content.size&&u.node(-1).childCount===u.indexAfter(-1)){if(2===u.depth||u.node(-3).type!==s||u.index(-2)!==u.node(-2).childCount-1)return!1;if(i){for(var m=v.Fragment.empty,y=u.index(-1)?1:u.index(-2)?2:3,b=u.depth-y;b>=u.depth-3;b-=1)m=v.Fragment.from(u.node(b).copy(m));var w=u.indexAfter(-1)-1)return!1;e.isTextblock&&0===e.content.size&&(C=t+1)})),C>-1&&r.setSelection(p.TextSelection.near(r.doc.resolve(C))),r.scrollIntoView()}return!0}var S=c.pos===u.end()?d.contentMatchAt(0).defaultType:null,j=fo(h,d.type.name,d.attrs),A=fo(h,u.node().type.name,u.node().attrs);r.delete(u.pos,c.pos);var E=S?[{type:s,attrs:j},{type:S,attrs:A}]:[{type:s,attrs:j}];return!!Object(g.g)(r.doc,u.pos,2)&&(i&&r.split(u.pos,2,E).scrollIntoView(),!0)}},toggleList:function(e,t){return function(n){var r=n.editor,o=n.tr,i=n.state,a=n.dispatch,s=n.chain,l=n.commands,u=n.can,c=r.extensionManager.extensions,f=Cr(e,i.schema),d=Cr(t,i.schema),p=i.selection,h=p.$from,m=p.$to,v=h.blockRange(m);if(!v)return!1;var g=vo((function(e){return go(e.type.name,c)}))(p);if(v.depth>=1&&g&&v.depth-g.depth<=1){if(g.node.type===f)return l.liftListItem(d);if(go(g.node.type.name,c)&&f.validContent(g.node.content)&&a)return s().command((function(){return o.setNodeMarkup(g.pos,f),!0})).command((function(){return yo(o,f)})).command((function(){return bo(o,f)})).run()}return s().command((function(){return!!u().wrapInList(f)||l.clearNodes()})).wrapInList(f).command((function(){return yo(o,f)})).command((function(){return bo(o,f)})).run()}},toggleMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=n.extendEmptyMarkRange,s=void 0!==a&&a,l=Yr(e,o.schema);return wo(o,l,t)?i.unsetMark(l,{extendEmptyMarkRange:s}):i.setMark(l,t)}},toggleNode:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(r){var o=r.state,i=r.commands,a=Cr(e,o.schema),s=Cr(t,o.schema);return ao(o,a,n)?i.setNode(s):i.setNode(a,n)}},toggleWrap:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.commands,i=Cr(e,r.schema);return ao(r,i,t)?o.lift(i):o.wrapIn(i,t)}},undoInputRule:function(){return function(e){for(var t=e.state,n=e.dispatch,r=t.plugins,o=0;o=0;u-=1)s.step(l.steps[u].invert(l.docs[u]));if(a.text){var c=s.doc.resolve(a.from).marks();s.replaceWith(a.from,a.to,t.schema.text(a.text,c))}else s.delete(a.from,a.to)}return!0}}return!1}},unsetAllMarks:function(){return function(e){var t=e.tr,n=e.dispatch,r=t.selection,o=r.empty,i=r.ranges;return o||n&&i.forEach((function(e){t.removeMark(e.$from.pos,e.$to.pos)})),!0}},unsetMark:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r,o=n.tr,i=n.state,a=n.dispatch,s=t.extendEmptyMarkRange,l=void 0!==s&&s,u=o.selection,c=Yr(e,i.schema),f=u.$from,d=u.empty,p=u.ranges;if(!a)return!0;if(d&&l){var h=u.from,m=u.to,v=null===(r=f.marks().find((function(e){return e.type===c})))||void 0===r?void 0:r.attrs,g=Zr(f,c,v);g&&(h=g.from,m=g.to),o.removeMark(h,m,c)}else p.forEach((function(e){o.removeMark(e.$from.pos,e.$to.pos,c)}));return o.removeStoredMark(c),!0}},updateAttributes:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.tr,o=n.state,i=n.dispatch,a=null,s=null,l=so("string"===typeof e?e:e.name,o.schema);return!!l&&("node"===l&&(a=Cr(e,o.schema)),"mark"===l&&(s=Yr(e,o.schema)),i&&r.selection.ranges.forEach((function(e){var n=e.$from.pos,i=e.$to.pos;o.doc.nodesBetween(n,i,(function(e,o){a&&a===e.type&&r.setNodeMarkup(o,void 0,Object(d.a)(Object(d.a)({},e.attrs),t)),s&&e.marks.length&&e.marks.forEach((function(a){if(s===a.type){var l=Math.max(o,n),u=Math.min(o+e.nodeSize,i);r.addMark(l,u,s.create(Object(d.a)(Object(d.a)({},a.attrs),t)))}}))}))})),!0)}},wrapIn:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return sr(Cr(e,r.schema),t)(r,o)}},wrapInList:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var r=n.state,o=n.dispatch;return mr(Cr(e,r.schema),t)(r,o)}}}),xo=$r.create({name:"commands",addCommands:function(){return Object(d.a)({},ko)}}),Oo=$r.create({name:"editable",addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("editable"),props:{editable:function(){return e.editor.options.editable}}})]}}),Co=$r.create({name:"focusEvents",addProseMirrorPlugins:function(){var e=this.editor;return[new p.Plugin({key:new p.PluginKey("focusEvents"),props:{handleDOMEvents:{focus:function(t,n){e.isFocused=!0;var r=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1},blur:function(t,n){e.isFocused=!1;var r=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(r),!1}}}})]}}),So=$r.create({name:"keymap",addKeyboardShortcuts:function(){var e=this,t=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.undoInputRule()},function(){return t.command((function(e){var n=e.tr,r=n.selection,o=n.doc,i=r.empty,a=r.$anchor,s=a.pos,l=a.parent,u=p.Selection.atStart(o).from===s;return!(!(i&&u&&l.type.isTextblock)||l.textContent.length)&&t.clearNodes()}))},function(){return t.deleteSelection()},function(){return t.joinBackward()},function(){return t.selectNodeBackward()}]}))},n=function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.deleteSelection()},function(){return t.joinForward()},function(){return t.selectNodeForward()}]}))},r={Enter:function(){return e.editor.commands.first((function(e){var t=e.commands;return[function(){return t.newlineInCode()},function(){return t.createParagraphNear()},function(){return t.liftEmptyBlock()},function(){return t.splitBlock()}]}))},"Mod-Enter":function(){return e.editor.commands.exitCode()},Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:n,"Mod-Delete":n,"Mod-a":function(){return e.editor.commands.selectAll()}},o=Object(d.a)({},r),i=Object(d.a)(Object(d.a)({},r),{},{"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":n,"Ctrl-Alt-Backspace":n,"Alt-Delete":n,"Alt-d":n,"Ctrl-a":function(){return e.editor.commands.selectTextblockStart()},"Ctrl-e":function(){return e.editor.commands.selectTextblockEnd()}});return no()||io()?i:o},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("clearDocument"),appendTransaction:function(t,n,r){if(t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc)){var o=n.selection,i=o.empty,a=o.from,s=o.to,l=p.Selection.atStart(n.doc).from,u=p.Selection.atEnd(n.doc).to,c=a===l&&s===u,f=0===r.doc.textBetween(0,r.doc.content.size," "," ").length;if(!i&&c&&f){var d=r.tr,h=yr({state:r,transaction:d});if(new br({editor:e.editor,state:h}).commands.clearNodes(),d.steps.length)return d}}}})]}}),jo=$r.create({name:"tabindex",addProseMirrorPlugins:function(){return[new p.Plugin({key:new p.PluginKey("tabindex"),props:{attributes:this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Ao=Object.freeze({__proto__:null,ClipboardTextSerializer:Ur,Commands:xo,Editable:Oo,FocusEvents:Co,Keymap:So,Tabindex:jo});function Eo(e,t){var n=so("string"===typeof t?t:t.name,e.schema);return"node"===n?function(e,t){var n=Cr(t,e.schema),r=e.selection,o=r.from,i=r.to,a=[];e.doc.nodesBetween(o,i,(function(e){a.push(e)}));var s=a.reverse().find((function(e){return e.type.name===n.name}));return s?Object(d.a)({},s.attrs):{}}(e,t):"mark"===n?co(e,t):{}}function Do(e,t){var n=v.DOMSerializer.fromSchema(t).serializeFragment(e),r=document.implementation.createHTMLDocument().createElement("div");return r.appendChild(n),r.innerHTML}function Mo(e,t){return qr(e,{from:0,to:e.content.size},t)}var To=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(c.a)(this,n),(e=t.call(this)).isFocused=!1,e.extensionStorage={},e.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,onBeforeCreate:function(){return null},onCreate:function(){return null},onUpdate:function(){return null},onSelectionUpdate:function(){return null},onTransaction:function(){return null},onFocus:function(){return null},onBlur:function(){return null},onDestroy:function(){return null}},e.isCapturingTransaction=!1,e.capturedTransaction=null,e.setOptions(r),e.createExtensionManager(),e.createCommandManager(),e.createSchema(),e.on("beforeCreate",e.options.onBeforeCreate),e.emit("beforeCreate",{editor:Object(o.a)(e)}),e.createView(),e.injectCSS(),e.on("create",e.options.onCreate),e.on("update",e.options.onUpdate),e.on("selectionUpdate",e.options.onSelectionUpdate),e.on("transaction",e.options.onTransaction),e.on("focus",e.options.onFocus),e.on("blur",e.options.onBlur),e.on("destroy",e.options.onDestroy),window.setTimeout((function(){e.isDestroyed||(e.commands.focus(e.options.autofocus),e.emit("create",{editor:Object(o.a)(e)}))}),0),e}return Object(f.a)(n,[{key:"storage",get:function(){return this.extensionStorage}},{key:"commands",get:function(){return this.commandManager.commands}},{key:"chain",value:function(){return this.commandManager.chain()}},{key:"can",value:function(){return this.commandManager.can()}},{key:"injectCSS",value:function(){this.options.injectCSS&&document&&(this.css=function(e,t){var n=document.querySelector("style[data-tiptap-style]");if(null!==n)return n;var r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute("data-tiptap-style",""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}('.ProseMirror {\n position: relative;\n}\n\n.ProseMirror {\n word-wrap: break-word;\n white-space: pre-wrap;\n white-space: break-spaces;\n -webkit-font-variant-ligatures: none;\n font-variant-ligatures: none;\n font-feature-settings: "liga" 0; /* the above doesn\'t seem to work in Edge */\n}\n\n.ProseMirror [contenteditable="false"] {\n white-space: normal;\n}\n\n.ProseMirror [contenteditable="false"] [contenteditable="true"] {\n white-space: pre-wrap;\n}\n\n.ProseMirror pre {\n white-space: pre-wrap;\n}\n\nimg.ProseMirror-separator {\n display: inline !important;\n border: none !important;\n margin: 0 !important;\n width: 1px !important;\n height: 1px !important;\n}\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n margin: 0;\n}\n\n.ProseMirror-gapcursor:after {\n content: "";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-hideselection *::selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n}\n\n.ProseMirror-hideselection * {\n caret-color: transparent;\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.tippy-box[data-animation=fade][data-state=hidden] {\n opacity: 0\n}',this.options.injectNonce))}},{key:"setOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=Object(d.a)(Object(d.a)({},this.options),e),this.view&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}},{key:"setEditable",value:function(e){this.setOptions({editable:e})}},{key:"isEditable",get:function(){return this.options.editable&&this.view&&this.view.editable}},{key:"state",get:function(){return this.view.state}},{key:"registerPlugin",value:function(e,t){var n=Ar(t)?t(e,Object(l.a)(this.state.plugins)):[].concat(Object(l.a)(this.state.plugins),[e]),r=this.state.reconfigure({plugins:n});this.view.updateState(r)}},{key:"unregisterPlugin",value:function(e){if(!this.isDestroyed){var t="string"===typeof e?"".concat(e,"$"):e.key,n=this.state.reconfigure({plugins:this.state.plugins.filter((function(e){return!e.key.startsWith(t)}))});this.view.updateState(n)}}},{key:"createExtensionManager",value:function(){var e=this.options.enableCoreExtensions?Object.values(Ao):[],t=[].concat(Object(l.a)(e),Object(l.a)(this.options.extensions)).filter((function(e){return["extension","node","mark"].includes(null===e||void 0===e?void 0:e.type)}));this.extensionManager=new _r(t,this)}},{key:"createCommandManager",value:function(){this.commandManager=new br({editor:this})}},{key:"createSchema",value:function(){this.schema=this.extensionManager.schema}},{key:"createView",value:function(){var e=uo(this.options.content,this.schema,this.options.parseOptions),t=to(e,this.options.autofocus);this.view=new kn(this.options.element,Object(d.a)(Object(d.a)({},this.options.editorProps),{},{dispatchTransaction:this.dispatchTransaction.bind(this),state:p.EditorState.create({doc:e,selection:t||void 0})}));var n=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(n),this.createNodeViews(),this.view.dom.editor=this}},{key:"createNodeViews",value:function(){this.view.setProps({nodeViews:this.extensionManager.nodeViews})}},{key:"captureTransaction",value:function(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;var t=this.capturedTransaction;return this.capturedTransaction=null,t}},{key:"dispatchTransaction",value:function(e){var t=this;if(this.isCapturingTransaction)return this.capturedTransaction?void e.steps.forEach((function(e){var n;return null===(n=t.capturedTransaction)||void 0===n?void 0:n.step(e)})):void(this.capturedTransaction=e);var n=this.state.apply(e),r=!this.state.selection.eq(n.selection);this.view.updateState(n),this.emit("transaction",{editor:this,transaction:e}),r&&this.emit("selectionUpdate",{editor:this,transaction:e});var o=e.getMeta("focus"),i=e.getMeta("blur");o&&this.emit("focus",{editor:this,event:o.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),e.docChanged&&!e.getMeta("preventUpdate")&&this.emit("update",{editor:this,transaction:e})}},{key:"getAttributes",value:function(e){return Eo(this.state,e)}},{key:"isActive",value:function(e,t){var n="string"===typeof e?e:null,r="string"===typeof e?t:e;return function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return ao(e,null,n)||wo(e,null,n);var r=so(t,e.schema);return"node"===r?ao(e,t,n):"mark"===r&&wo(e,t,n)}(this.state,n,r)}},{key:"getJSON",value:function(){return this.state.doc.toJSON()}},{key:"getHTML",value:function(){return Do(this.state.doc.content,this.schema)}},{key:"getText",value:function(e){var t=e||{},n=t.blockSeparator,r=void 0===n?"\n\n":n,o=t.textSerializers,i=void 0===o?{}:o;return Mo(this.state.doc,{blockSeparator:r,textSerializers:Object(d.a)(Object(d.a)({},i),Wr(this.schema))})}},{key:"isEmpty",get:function(){return function(e){var t,n=null===(t=e.type.createAndFill())||void 0===t?void 0:t.toJSON(),r=e.toJSON();return JSON.stringify(n)===JSON.stringify(r)}(this.state.doc)}},{key:"getCharacterCount",value:function(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.content.size-2}},{key:"destroy",value:function(){this.emit("destroy"),this.view&&this.view.destroy(),this.removeAllListeners()}},{key:"isDestroyed",get:function(){var e;return!(null===(e=this.view)||void 0===e?void 0:e.docView)}}]),n}(wr);function Lo(e,t){var n=[];return e.descendants((function(e,r){t(e)&&n.push({node:e,pos:r})})),n}function Po(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,n={};return e.filter((function(e){var r=t(e);return!Object.prototype.hasOwnProperty.call(n,r)&&(n[r]=!0)}))}(e);return 1===t.length?t:t.filter((function(e,n){return!t.filter((function(e,t){return t!==n})).some((function(t){return e.oldRange.from>=t.oldRange.from&&e.oldRange.to<=t.oldRange.to&&e.newRange.from>=t.newRange.from&&e.newRange.to<=t.newRange.to}))}))}function Ro(e,t,n){var r=[];return e===t?n.resolve(e).marks().forEach((function(t){var o=Zr(n.resolve(e-1),t.type);o&&r.push(Object(d.a)({mark:t},o))})):n.nodesBetween(e,t,(function(e,t){r.push.apply(r,Object(l.a)(e.marks.map((function(n){return{from:t,to:t+e.nodeSize,mark:n}}))))})),r}function Ho(e){return new Hr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Er(e.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,s=o[o.length-1],l=o[0],u=r.to;if(s){var c=l.search(/\S/),f=r.from+l.indexOf(s),d=f+s.length;if(Ro(r.from,r.to,n.doc).filter((function(t){return t.mark.type.excluded.find((function(n){return n===e.type&&n!==t.mark.type}))})).filter((function(e){return e.to>f})).length)return null;dr.from&&a.delete(r.from+c,f),u=r.from+c+s.length,a.addMark(r.from+c,u,e.type.create(i||{})),a.removeStoredMark(e.type)}}})}function No(e){return new Hr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Er(e.getAttributes,void 0,o)||{},a=n.tr,s=r.from,l=r.to;if(o[1]){var u=s+o[0].lastIndexOf(o[1]);u>l?u=l:l=u+o[1].length;var c=o[0][o[0].length-1];a.insertText(c,s+o[0].length-1),a.replaceWith(u,l,e.type.create(i))}else o[0]&&a.replaceWith(s,l,e.type.create(i))}})}function Fo(e){return new Hr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=n.doc.resolve(r.from),a=Er(e.getAttributes,void 0,o)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;n.tr.delete(r.from,r.to).setBlockType(r.from,r.from,e.type,a)}})}function Vo(e){return new Hr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Er(e.getAttributes,void 0,o)||{},a=n.tr.delete(r.from,r.to),s=a.doc.resolve(r.from).blockRange(),l=s&&Object(g.i)(s,e.type,i);if(!l)return null;a.wrap(s,l);var u=a.doc.resolve(r.from-1).nodeBefore;u&&u.type===e.type&&Object(g.f)(a.doc,r.from-1)&&(!e.joinPredicate||e.joinPredicate(o,u))&&a.join(r.from-1)}})}var zo=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(c.a)(this,e),this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(d.a)(Object(d.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Er(kr(this,"addOptions",{name:this.name}))),this.storage=Er(kr(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(f.a)(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=Ir(this.options,e),t.storage=Er(kr(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Er(kr(n,"addOptions",{name:n.name})),n.storage=Er(kr(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}(),_o=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(c.a)(this,e),this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config=Object(d.a)(Object(d.a)({},this.config),t),this.name=this.config.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(this.name,'".')),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=Er(kr(this,"addOptions",{name:this.name}))),this.storage=Er(kr(this,"addStorage",{name:this.name,options:this.options}))||{}}return Object(f.a)(e,[{key:"configure",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.extend();return t.options=Ir(this.options,e),t.storage=Er(kr(t,"addStorage",{name:t.name,options:t.options})),t}},{key:"extend",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new e(t);return n.parent=this,this.child=n,n.name=t.name?t.name:n.parent.name,t.defaultOptions&&console.warn('[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "'.concat(n.name,'".')),n.options=Er(kr(n,"addOptions",{name:n.name})),n.storage=Er(kr(n,"addStorage",{name:n.name,options:n.options})),n}}],[{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(t)}}]),e}();function Bo(e){return new Vr({find:e.find,handler:function(t){var n=t.state,r=t.range,o=t.match,i=Er(e.getAttributes,void 0,o);if(!1===i||null===i)return null;var a=n.tr,s=o[o.length-1],l=o[0],u=r.to;if(s){var c=l.search(/\S/),f=r.from+l.indexOf(s),d=f+s.length;if(Ro(r.from,r.to,n.doc).filter((function(t){return t.mark.type.excluded.find((function(n){return n===e.type&&n!==t.mark.type}))})).filter((function(e){return e.to>f})).length)return null;dr.from&&a.delete(r.from+c,f),u=r.from+c+s.length,a.addMark(r.from+c,u,e.type.create(i||{})),a.removeStoredMark(e.type)}}})}var Io=$r.create({name:"characterCount",addOptions:function(){return{limit:null,mode:"textSize"}},addStorage:function(){return{characters:function(){return 0},words:function(){return 0}}},onBeforeCreate:function(){var e=this;this.storage.characters=function(t){var n=(null===t||void 0===t?void 0:t.node)||e.editor.state.doc;return"textSize"===((null===t||void 0===t?void 0:t.mode)||e.options.mode)?n.textBetween(0,n.content.size,void 0," ").length:n.nodeSize},this.storage.words=function(t){var n=(null===t||void 0===t?void 0:t.node)||e.editor.state.doc;return n.textBetween(0,n.content.size," "," ").split(" ").filter((function(e){return""!==e})).length}},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("characterCount"),filterTransaction:function(t,n){var r=e.options.limit;if(!t.docChanged||0===r||null===r||void 0===r)return!0;var o=e.storage.characters({node:n.doc}),i=e.storage.characters({node:t.doc});if(i<=r)return!0;if(o>r&&i>r&&i<=o)return!0;if(o>r&&i>r&&i>o)return!1;if(!t.getMeta("paste"))return!1;var a=t.selection.$head.pos,s=a-(i-r),l=a;return t.deleteRange(s,l),!(e.storage.characters({node:t.doc})>r)}})]}}),$o=$r.create({name:"placeholder",addOptions:function(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({props:{decorations:function(t){var n=t.doc,r=t.selection,o=e.editor.isEditable||!e.options.showOnlyWhenEditable,i=r.anchor,a=[];return o?(n.descendants((function(t,n){var r=i>=n&&i<=n+t.nodeSize,o=!t.isLeaf&&!t.childCount;if((r||!e.options.showOnlyCurrent)&&o){var s=[e.options.emptyNodeClass];e.editor.isEmpty&&s.push(e.options.emptyEditorClass);var l=Zt.node(n,n+t.nodeSize,{class:s.join(" "),"data-placeholder":"function"===typeof e.options.placeholder?e.options.placeholder({editor:e.editor,node:t,pos:n,hasAnchor:r}):e.options.placeholder});a.push(l)}return e.options.includeChildren})),Qt.create(n,a)):null}}})]}}),qo=zo.create({name:"underline",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:function(e){return!!e.includes("underline")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["u",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setUnderline:function(){return function(t){return t.commands.setMark(e.name)}},toggleUnderline:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetUnderline:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-u":function(){return e.editor.commands.toggleUnderline()},"Mod-U":function(){return e.editor.commands.toggleUnderline()}}}}),Wo=/^\s*>\s$/,Uo=_o.create({name:"blockquote",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML:function(){return[{tag:"blockquote"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["blockquote",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBlockquote:function(){return function(t){return t.commands.wrapIn(e.name)}},toggleBlockquote:function(){return function(t){return t.commands.toggleWrap(e.name)}},unsetBlockquote:function(){return function(t){return t.commands.lift(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-b":function(){return e.editor.commands.toggleBlockquote()}}},addInputRules:function(){return[Vo({find:Wo,type:this.type})]}}),Ko=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,Go=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Jo=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Zo=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Yo=zo.create({name:"bold",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"strong"},{tag:"b",getAttrs:function(e){return"normal"!==e.style.fontWeight&&null}},{style:"font-weight",getAttrs:function(e){return/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["strong",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setBold:function(){return function(t){return t.commands.setMark(e.name)}},toggleBold:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetBold:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-b":function(){return e.editor.commands.toggleBold()},"Mod-B":function(){return e.editor.commands.toggleBold()}}},addInputRules:function(){return[Ho({find:Ko,type:this.type}),Ho({find:Jo,type:this.type})]},addPasteRules:function(){return[Bo({find:Go,type:this.type}),Bo({find:Zo,type:this.type})]}}),Xo=/^\s*([-+*])\s$/,Qo=_o.create({name:"bulletList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},parseHTML:function(){return[{tag:"ul"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{toggleBulletList:function(){return function(t){return t.commands.toggleList(e.name,e.options.itemTypeName)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-8":function(){return e.editor.commands.toggleBulletList()}}},addInputRules:function(){return[Vo({find:Xo,type:this.type})]}}),ei=/(?:^|\s)((?:`)((?:[^`]+))(?:`))$/,ti=/(?:^|\s)((?:`)((?:[^`]+))(?:`))/g,ni=zo.create({name:"code",addOptions:function(){return{HTMLAttributes:{}}},excludes:"_",code:!0,parseHTML:function(){return[{tag:"code"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["code",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setCode:function(){return function(t){return t.commands.setMark(e.name)}},toggleCode:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetCode:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-e":function(){return e.editor.commands.toggleCode()}}},addInputRules:function(){return[Ho({find:ei,type:this.type})]},addPasteRules:function(){return[Bo({find:ti,type:this.type})]}}),ri=/^```([a-z]+)?[\s\n]$/,oi=/^~~~([a-z]+)?[\s\n]$/,ii=_o.create({name:"codeBlock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{language:{default:null,parseHTML:function(t){var n,r=e.options.languageClassPrefix,o=Object(l.a)((null===(n=t.firstElementChild)||void 0===n?void 0:n.classList)||[]).filter((function(e){return e.startsWith(r)})).map((function(e){return e.replace(r,"")}))[0];return o||null},rendered:!1}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["pre",Sr(this.options.HTMLAttributes,n),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){return n.commands.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){return n.commands.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},Backspace:function(){var t=e.editor.state.selection,n=t.empty,r=t.$anchor,o=1===r.pos;return!(!n||r.parent.type.name!==e.name)&&(!(!o&&r.parent.textContent.length)&&e.editor.commands.clearNodes())},Enter:function(t){var n=t.editor;if(!e.options.exitOnTripleEnter)return!1;var r=n.state.selection,o=r.$from;if(!r.empty||o.parent.type!==e.type)return!1;var i=o.parentOffset===o.parent.nodeSize-2,a=o.parent.textContent.endsWith("\n\n");return!(!i||!a)&&n.chain().command((function(e){return e.tr.delete(o.pos-2,o.pos),!0})).exitCode().run()},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var r=n.state,o=r.selection,i=r.doc,a=o.$from;if(!o.empty||a.parent.type!==e.type)return!1;if(!(a.parentOffset===a.parent.nodeSize-2))return!1;var s=a.after();return void 0!==s&&(!i.nodeAt(s)&&n.commands.exitCode())}}},addInputRules:function(){return[Fo({find:ri,type:this.type,getAttributes:function(e){return{language:e[1]}}}),Fo({find:oi,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;if(e.editor.isActive(e.type.name))return!1;var r=n.clipboardData.getData("text/plain"),o=n.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,a=null===i||void 0===i?void 0:i.mode;if(!r||!a)return!1;var s=t.state.tr;return s.replaceSelectionWith(e.type.create({language:a})),s.setSelection(p.TextSelection.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.insertText(r.replace(/\r\n?/g,"\n")),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}}),ai=_o.create({name:"doc",topNode:!0,content:"block+"});function si(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new p.Plugin({view:function(t){return new li(t,e)}})}var li=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=n.width||1,this.color=n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var n=function(t){r[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}return Object(f.a)(e,[{key:"destroy",value:function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))}},{key:"update",value:function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0)).getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2),e={left:o.left,right:o.right,top:i-this.width/2,bottom:i+this.width/2}}}if(!e){var a=this.editorView.coordsAtPos(this.cursorPos);e={left:a.left-this.width/2,right:a.left+this.width/2,top:a.top,bottom:a.bottom}}var s,l,u=this.editorView.dom.offsetParent;if(this.element||(this.element=u.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!u||u==document.body&&"static"==getComputedStyle(u).position)s=-pageXOffset,l=-pageYOffset;else{var c=u.getBoundingClientRect();s=c.left-u.scrollLeft,l=c.top-u.scrollTop}this.element.style.left=e.left-s+"px",this.element.style.top=e.top-l+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px"}},{key:"scheduleRemoval",value:function(e){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)}},{key:"dragover",value:function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t):r;if(t&&!o){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice&&null==(i=Object(g.h)(this.editorView.state.doc,i,this.editorView.dragging.slice)))return this.setCursor(null);this.setCursor(i),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}]),e}(),ui=$r.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins:function(){return[si(this.options)]}}),ci=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e){return Object(c.a)(this,n),t.call(this,e,e)}return Object(f.a)(n,[{key:"map",value:function(e,t){var r=e.resolve(t.map(this.head));return n.valid(r)?new n(r):p.Selection.near(r)}},{key:"content",value:function(){return v.Slice.empty}},{key:"eq",value:function(e){return e instanceof n&&e.head==this.head}},{key:"toJSON",value:function(){return{type:"gapcursor",pos:this.head}}},{key:"getBookmark",value:function(){return new fi(this.anchor)}}],[{key:"fromJSON",value:function(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new n(e.resolve(t.pos))}},{key:"valid",value:function(e){var t=e.parent;if(t.isTextblock||!function(e){for(var t=e.depth;t>=0;t--){var n=e.index(t),r=e.node(t);if(0!=n)for(var o=r.child(n-1);;o=o.lastChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(var t=e.depth;t>=0;t--){var n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(var o=r.child(n);;o=o.firstChild){if(0==o.childCount&&!o.inlineContent||o.isAtom||o.type.spec.isolating)return!0;if(o.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;var n=t.type.spec.allowGapCursor;if(null!=n)return n;var r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}},{key:"findGapCursorFrom",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e:for(;;){if(!r&&n.valid(e))return e;for(var o=e.pos,i=null,a=e.depth;;a--){var s=e.node(a);if(t>0?e.indexAfter(a)0){i=s.child(t>0?e.indexAfter(a):e.index(a)-1);break}if(0==a)return null;o+=t;var l=e.doc.resolve(o);if(n.valid(l))return l}for(;;){var u=t>0?i.firstChild:i.lastChild;if(!u){if(i.isAtom&&!i.isText&&!p.NodeSelection.isSelectable(i)){e=e.doc.resolve(o+i.nodeSize*t),r=!1;continue e}break}i=u,o+=t;var c=e.doc.resolve(o);if(n.valid(c))return c}return null}}}]),n}(p.Selection);ci.prototype.visible=!1,ci.findFrom=ci.findGapCursorFrom,p.Selection.jsonID("gapcursor",ci);var fi=function(){function e(t){Object(c.a)(this,e),this.pos=t}return Object(f.a)(e,[{key:"map",value:function(t){return new e(t.map(this.pos))}},{key:"resolve",value:function(e){var t=e.resolve(this.pos);return ci.valid(t)?new ci(t):p.Selection.near(t)}}]),e}();var di=Bn({ArrowLeft:pi("horiz",-1),ArrowRight:pi("horiz",1),ArrowUp:pi("vert",-1),ArrowDown:pi("vert",1)});function pi(e,t){var n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){var i=e.selection,a=t>0?i.$to:i.$from,s=i.empty;if(i instanceof p.TextSelection){if(!o.endOfTextblock(n)||0==a.depth)return!1;s=!1,a=e.doc.resolve(t>0?a.after():a.before())}var l=ci.findGapCursorFrom(a,t,s);return!!l&&(r&&r(e.tr.setSelection(new ci(l))),!0)}}function hi(e,t,n){if(!e||!e.editable)return!1;var r=e.state.doc.resolve(t);if(!ci.valid(r))return!1;var o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&p.NodeSelection.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new ci(r))),!0)}function mi(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof ci))return!1;var n=e.state.selection.$from,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;for(var o=v.Fragment.empty,i=r.length-1;i>=0;i--)o=v.Fragment.from(r[i].createAndFill(null,o));var a=e.state.tr.replace(n.pos,n.pos,new v.Slice(o,0,0));return a.setSelection(p.TextSelection.near(a.doc.resolve(n.pos+1))),e.dispatch(a),!1}function vi(e){if(!(e.selection instanceof ci))return null;var t=document.createElement("div");return t.className="ProseMirror-gapcursor",Qt.create(e.doc,[Zt.widget(e.selection.head,t,{key:"gapcursor"})])}var gi=$r.create({name:"gapCursor",addProseMirrorPlugins:function(){return[new p.Plugin({props:{decorations:vi,createSelectionBetween:function(e,t,n){return t.pos==n.pos&&ci.valid(n)?new ci(n):null},handleClick:hi,handleKeyDown:di,handleDOMEvents:{beforeinput:mi}}})]},extendNodeSchema:function(e){var t;return{allowGapCursor:null!==(t=Er(kr(e,"allowGapCursor",{name:e.name,options:e.options,storage:e.storage})))&&void 0!==t?t:null}}}),yi=_o.create({name:"hardBreak",addOptions:function(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,parseHTML:function(){return[{tag:"br"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["br",Sr(this.options.HTMLAttributes,t)]},renderText:function(){return"\n"},addCommands:function(){var e=this;return{setHardBreak:function(){return function(t){var n=t.commands,r=t.chain,o=t.state,i=t.editor;return n.first([function(){return n.exitCode()},function(){return n.command((function(){var t=o.selection,n=o.storedMarks;if(t.$from.parent.type.spec.isolating)return!1;var a=e.options.keepMarks,s=i.extensionManager.splittableMarks,l=n||t.$to.parentOffset&&t.$from.marks();return r().insertContent({type:e.name}).command((function(e){var t=e.tr;if(e.dispatch&&l&&a){var n=l.filter((function(e){return s.includes(e.type.name)}));t.ensureMarks(n)}return!0})).run()}))}])}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Enter":function(){return e.editor.commands.setHardBreak()},"Shift-Enter":function(){return e.editor.commands.setHardBreak()}}}}),bi=_o.create({name:"heading",addOptions:function(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes:function(){return{level:{default:1,rendered:!1}}},parseHTML:function(){return this.options.levels.map((function(e){return{tag:"h".concat(e),attrs:{level:e}}}))},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes,r=this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0];return["h".concat(r),Sr(this.options.HTMLAttributes,n),0]},addCommands:function(){var e=this;return{setHeading:function(t){return function(n){var r=n.commands;return!!e.options.levels.includes(t.level)&&r.setNode(e.name,t)}},toggleHeading:function(t){return function(n){var r=n.commands;return!!e.options.levels.includes(t.level)&&r.toggleNode(e.name,"paragraph",t)}}}},addKeyboardShortcuts:function(){var e=this;return this.options.levels.reduce((function(t,n){return Object(d.a)(Object(d.a)({},t),Object(s.a)({},"Mod-Alt-".concat(n),(function(){return e.editor.commands.toggleHeading({level:n})})))}),{})},addInputRules:function(){var e=this;return this.options.levels.map((function(t){return Fo({find:new RegExp("^(#{1,".concat(t,"})\\s$")),type:e.type,getAttributes:{level:t}})}))}}),wi=200,ki=function(){};ki.prototype.append=function(e){return e.length?(e=ki.from(e),!this.length&&e||e.length=t?ki.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},ki.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},ki.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length),t<=n?this.forEachInner(e,t,n,0):this.forEachInvertedInner(e,t,n,0)},ki.prototype.map=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=this.length);var r=[];return this.forEach((function(t,n){return r.push(e(t,n))}),t,n),r},ki.from=function(e){return e instanceof ki?e:e&&e.length?new xi(e):ki.empty};var xi=function(e){function t(t){e.call(this),this.values=t}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(e,n){return 0==e&&n==this.length?this:new t(this.values.slice(e,n))},t.prototype.getInner=function(e){return this.values[e]},t.prototype.forEachInner=function(e,t,n,r){for(var o=t;o=n;o--)if(!1===e(this.values[o],r+o))return!1},t.prototype.leafAppend=function(e){if(this.length+e.length<=wi)return new t(this.values.concat(e.flatten()))},t.prototype.leafPrepend=function(e){if(this.length+e.length<=wi)return new t(e.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t}(ki);ki.empty=new xi([]);var Oi=function(e){function t(t,n){e.call(this),this.left=t,this.right=n,this.length=t.length+n.length,this.depth=Math.max(t.depth,n.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(e){return eo&&!1===this.right.forEachInner(e,Math.max(t-o,0),Math.min(this.length,n)-o,r+o))&&void 0)},t.prototype.forEachInvertedInner=function(e,t,n,r){var o=this.left.length;return!(t>o&&!1===this.right.forEachInvertedInner(e,t-o,Math.max(n,o)-o,r+o))&&(!(n=n?this.right.slice(e-n,t-n):this.left.slice(e,n).append(this.right.slice(0,t-n))},t.prototype.leafAppend=function(e){var n=this.right.leafAppend(e);if(n)return new t(this.left,n)},t.prototype.leafPrepend=function(e){var n=this.left.leafPrepend(e);if(n)return new t(n,this.right)},t.prototype.appendInner=function(e){return this.left.depth>=Math.max(this.right.depth,e.depth)+1?new t(this.left,new t(this.right,e)):new t(this,e)},t}(ki),Ci=ki,Si=function(){function e(t,n){Object(c.a)(this,e),this.items=t,this.eventCount=n}return Object(f.a)(e,[{key:"popEvent",value:function(t,n){var r=this;if(0==this.eventCount)return null;for(var o,i,a=this.items.length;;a--){if(this.items.get(a-1).selection){--a;break}}n&&(o=this.remapping(a,this.items.length),i=o.maps.length);var s,l,u=t.tr,c=[],f=[];return this.items.forEach((function(t,n){if(!t.step)return o||(o=r.remapping(a,n+1),i=o.maps.length),i--,void f.push(t);if(o){f.push(new ji(t.map));var d,p=t.step.map(o.slice(i));p&&u.maybeStep(p).doc&&(d=u.mapping.maps[u.mapping.maps.length-1],c.push(new ji(d,void 0,void 0,c.length+f.length))),i--,d&&o.appendMap(d,i)}else u.maybeStep(t.step);return t.selection?(s=o?t.selection.map(o.slice(i)):t.selection,l=new e(r.items.slice(0,a).append(f.reverse().concat(c)),r.eventCount-1),!1):void 0}),this.items.length,0),{remaining:l,transform:u,selection:s}}},{key:"addTransform",value:function(t,n,r,o){for(var i=[],a=this.eventCount,s=this.items,l=!o&&s.length?s.get(s.length-1):null,u=0;uEi&&(s=function(e,t){var n;return e.forEach((function(e,r){if(e.selection&&0==t--)return n=r,!1})),e.slice(n)}(s,p),a-=p),new e(s.append(i),a)}},{key:"remapping",value:function(e,t){var n=new g.a;return this.items.forEach((function(t,r){var o=null!=t.mirrorOffset&&r-t.mirrorOffset>=e?n.maps.length-t.mirrorOffset:void 0;n.appendMap(t.map,o)}),e,t),n}},{key:"addMaps",value:function(t){return 0==this.eventCount?this:new e(this.items.append(t.map((function(e){return new ji(e)}))),this.eventCount)}},{key:"rebased",value:function(t,n){if(!this.eventCount)return this;var r=[],o=Math.max(0,this.items.length-n),i=t.mapping,a=t.steps.length,s=this.eventCount;this.items.forEach((function(e){e.selection&&s--}),o);var l=n;this.items.forEach((function(e){var n=i.getMirror(--l);if(null!=n){a=Math.min(a,n);var o=i.maps[n];if(e.step){var u=t.steps[n].invert(t.docs[n]),c=e.selection&&e.selection.map(i.slice(l+1,n));c&&s++,r.push(new ji(o,u,c))}else r.push(new ji(o))}}),o);for(var u=[],c=n;c500&&(f=f.compress(this.items.length-r.length)),f}},{key:"emptyItemCount",value:function(){var e=0;return this.items.forEach((function(t){t.step||e++})),e}},{key:"compress",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.items.length,n=this.remapping(0,t),r=n.maps.length,o=[],i=0;return this.items.forEach((function(e,a){if(a>=t)o.push(e),e.selection&&i++;else if(e.step){var s=e.step.map(n.slice(r)),l=s&&s.getMap();if(r--,l&&n.appendMap(l,r),s){var u=e.selection&&e.selection.map(n.slice(r));u&&i++;var c,f=new ji(l.invert(),s,u),d=o.length-1;(c=o.length&&o[d].merge(f))?o[d]=c:o.push(f)}}else e.map&&r--}),this.items.length,0),new e(Ci.from(o.reverse()),i)}}]),e}();Si.empty=new Si(Ci.empty,0);var ji=function(){function e(t,n,r,o){Object(c.a)(this,e),this.map=t,this.step=n,this.selection=r,this.mirrorOffset=o}return Object(f.a)(e,[{key:"merge",value:function(t){if(this.step&&t.step&&!t.selection){var n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}}]),e}(),Ai=Object(f.a)((function e(t,n,r,o){Object(c.a)(this,e),this.done=t,this.undone=n,this.prevRanges=r,this.prevTime=o})),Ei=20;function Di(e,t,n,r){var o,i=n.getMeta(Ni);if(i)return i.historyState;n.getMeta(Fi)&&(e=new Ai(e.done,e.undone,null,0));var a=n.getMeta("appendedTransaction");if(0==n.steps.length)return e;if(a&&a.getMeta(Ni))return a.getMeta(Ni).redo?new Ai(e.done.addTransform(n,void 0,r,Hi(t)),e.undone,Mi(n.mapping.maps[n.steps.length-1]),e.prevTime):new Ai(e.done,e.undone.addTransform(n,void 0,r,Hi(t)),null,e.prevTime);if(!1===n.getMeta("addToHistory")||a&&!1===a.getMeta("addToHistory"))return(o=n.getMeta("rebased"))?new Ai(e.done.rebased(n,o),e.undone.rebased(n,o),Ti(e.prevRanges,n.mapping),e.prevTime):new Ai(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Ti(e.prevRanges,n.mapping),e.prevTime);var s=0==e.prevTime||!a&&(e.prevTime<(n.time||0)-r.newGroupDelay||!function(e,t){if(!t)return!1;if(!e.docChanged)return!0;var n=!1;return e.mapping.maps[0].forEach((function(e,r){for(var o=0;o=t[o]&&(n=!0)})),n}(n,e.prevRanges)),l=a?Ti(e.prevRanges,n.mapping):Mi(n.mapping.maps[n.steps.length-1]);return new Ai(e.done.addTransform(n,s?t.selection.getBookmark():void 0,r,Hi(t)),Si.empty,l,n.time)}function Mi(e){var t=[];return e.forEach((function(e,n,r,o){return t.push(r,o)})),t}function Ti(e,t){if(!e)return null;for(var n=[],r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new p.Plugin({key:Ni,state:{init:function(){return new Ai(Si.empty,Si.empty,null,0)},apply:function(t,n,r){return Di(n,r,t,e)}},config:e,props:{handleDOMEvents:{beforeinput:function(e,t){var n=t.inputType,r="historyUndo"==n?zi:"historyRedo"==n?_i:null;return!!r&&(t.preventDefault(),r(e.state,e.dispatch))}}}})}var zi=function(e,t){var n=Ni.getState(e);return!(!n||0==n.done.eventCount)&&(t&&Li(n,e,t,!1),!0)},_i=function(e,t){var n=Ni.getState(e);return!(!n||0==n.undone.eventCount)&&(t&&Li(n,e,t,!0),!0)};var Bi=$r.create({name:"history",addOptions:function(){return{depth:100,newGroupDelay:500}},addCommands:function(){return{undo:function(){return function(e){var t=e.state,n=e.dispatch;return zi(t,n)}},redo:function(){return function(e){var t=e.state,n=e.dispatch;return _i(t,n)}}}},addProseMirrorPlugins:function(){return[Vi(this.options)]},addKeyboardShortcuts:function(){var e=this;return{"Mod-z":function(){return e.editor.commands.undo()},"Mod-y":function(){return e.editor.commands.redo()},"Shift-Mod-z":function(){return e.editor.commands.redo()},"Mod-\u044f":function(){return e.editor.commands.undo()},"Shift-Mod-\u044f":function(){return e.editor.commands.redo()}}}}),Ii=_o.create({name:"horizontalRule",addOptions:function(){return{HTMLAttributes:{}}},group:"block",parseHTML:function(){return[{tag:"hr"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["hr",Sr(this.options.HTMLAttributes,t)]},addCommands:function(){var e=this;return{setHorizontalRule:function(){return function(t){return(0,t.chain)().insertContent({type:e.name}).command((function(e){var t,n=e.tr;if(e.dispatch){var r=n.selection.$to,o=r.end();if(r.nodeAfter)n.setSelection(p.TextSelection.create(n.doc,r.pos));else{var i=null===(t=r.parent.type.contentMatch.defaultType)||void 0===t?void 0:t.create();i&&(n.insert(o,i),n.setSelection(p.TextSelection.create(n.doc,o)))}n.scrollIntoView()}return!0})).run()}}}},addInputRules:function(){return[No({find:/^(?:---|\u2014-|___\s|\*\*\*\s)$/,type:this.type})]}}),$i=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,qi=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))/g,Wi=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,Ui=/(?:^|\s)((?:_)((?:[^_]+))(?:_))/g,Ki=zo.create({name:"italic",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"em"},{tag:"i",getAttrs:function(e){return"normal"!==e.style.fontStyle&&null}},{style:"font-style=italic"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["em",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setItalic:function(){return function(t){return t.commands.setMark(e.name)}},toggleItalic:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetItalic:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-i":function(){return e.editor.commands.toggleItalic()},"Mod-I":function(){return e.editor.commands.toggleItalic()}}},addInputRules:function(){return[Ho({find:$i,type:this.type}),Ho({find:Wi,type:this.type})]},addPasteRules:function(){return[Bo({find:qi,type:this.type}),Bo({find:Ui,type:this.type})]}}),Gi=_o.create({name:"listItem",addOptions:function(){return{HTMLAttributes:{}}},content:"paragraph block*",defining:!0,parseHTML:function(){return[{tag:"li"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Sr(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts:function(){var e=this;return{Enter:function(){return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}}}});function Ji(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Zi=["start"],Yi=/^(\d+)\.\s$/,Xi=_o.create({name:"orderedList",addOptions:function(){return{itemTypeName:"listItem",HTMLAttributes:{}}},group:"block list",content:function(){return"".concat(this.options.itemTypeName,"+")},addAttributes:function(){return{start:{default:1,parseHTML:function(e){return e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1}}}},parseHTML:function(){return[{tag:"ol"}]},renderHTML:function(e){var t=e.HTMLAttributes,n=t.start,r=Ji(t,Zi);return 1===n?["ol",Sr(this.options.HTMLAttributes,r),0]:["ol",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{toggleOrderedList:function(){return function(t){return t.commands.toggleList(e.name,e.options.itemTypeName)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-7":function(){return e.editor.commands.toggleOrderedList()}}},addInputRules:function(){return[Vo({find:Yi,type:this.type,getAttributes:function(e){return{start:+e[1]}},joinPredicate:function(e,t){return t.childCount+t.attrs.start===+e[1]}})]}}),Qi=_o.create({name:"paragraph",priority:1e3,addOptions:function(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML:function(){return[{tag:"p"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["p",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setParagraph:function(){return function(t){return t.commands.setNode(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-0":function(){return e.editor.commands.setParagraph()}}}}),ea=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/,ta=/(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g,na=zo.create({name:"strike",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:function(e){return!!e.includes("line-through")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["s",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setStrike:function(){return function(t){return t.commands.setMark(e.name)}},toggleStrike:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetStrike:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-x":function(){return e.editor.commands.toggleStrike()}}},addInputRules:function(){return[Ho({find:ea,type:this.type})]},addPasteRules:function(){return[Bo({find:ta,type:this.type})]}}),ra=_o.create({name:"text",group:"inline"}),oa=$r.create({name:"starterKit",addExtensions:function(){var e,t,n,r,o,i,a,s,l,u,c,f,d,p,h,m,v,g,y=[];return!1!==this.options.blockquote&&y.push(Uo.configure(null===(e=this.options)||void 0===e?void 0:e.blockquote)),!1!==this.options.bold&&y.push(Yo.configure(null===(t=this.options)||void 0===t?void 0:t.bold)),!1!==this.options.bulletList&&y.push(Qo.configure(null===(n=this.options)||void 0===n?void 0:n.bulletList)),!1!==this.options.code&&y.push(ni.configure(null===(r=this.options)||void 0===r?void 0:r.code)),!1!==this.options.codeBlock&&y.push(ii.configure(null===(o=this.options)||void 0===o?void 0:o.codeBlock)),!1!==this.options.document&&y.push(ai.configure(null===(i=this.options)||void 0===i?void 0:i.document)),!1!==this.options.dropcursor&&y.push(ui.configure(null===(a=this.options)||void 0===a?void 0:a.dropcursor)),!1!==this.options.gapcursor&&y.push(gi.configure(null===(s=this.options)||void 0===s?void 0:s.gapcursor)),!1!==this.options.hardBreak&&y.push(yi.configure(null===(l=this.options)||void 0===l?void 0:l.hardBreak)),!1!==this.options.heading&&y.push(bi.configure(null===(u=this.options)||void 0===u?void 0:u.heading)),!1!==this.options.history&&y.push(Bi.configure(null===(c=this.options)||void 0===c?void 0:c.history)),!1!==this.options.horizontalRule&&y.push(Ii.configure(null===(f=this.options)||void 0===f?void 0:f.horizontalRule)),!1!==this.options.italic&&y.push(Ki.configure(null===(d=this.options)||void 0===d?void 0:d.italic)),!1!==this.options.listItem&&y.push(Gi.configure(null===(p=this.options)||void 0===p?void 0:p.listItem)),!1!==this.options.orderedList&&y.push(Xi.configure(null===(h=this.options)||void 0===h?void 0:h.orderedList)),!1!==this.options.paragraph&&y.push(Qi.configure(null===(m=this.options)||void 0===m?void 0:m.paragraph)),!1!==this.options.strike&&y.push(na.configure(null===(v=this.options)||void 0===v?void 0:v.strike)),!1!==this.options.text&&y.push(ra.configure(null===(g=this.options)||void 0===g?void 0:g.text)),y}}),ia=$r.create({name:"textAlign",addOptions:function(){return{types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}},addGlobalAttributes:function(){var e=this;return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:function(t){return t.style.textAlign||e.options.defaultAlignment},renderHTML:function(t){return t.textAlign===e.options.defaultAlignment?{}:{style:"text-align: ".concat(t.textAlign)}}}}}]},addCommands:function(){var e=this;return{setTextAlign:function(t){return function(n){var r=n.commands;return!!e.options.alignments.includes(t)&&e.options.types.every((function(e){return r.updateAttributes(e,{textAlign:t})}))}},unsetTextAlign:function(){return function(t){var n=t.commands;return e.options.types.every((function(e){return n.resetAttributes(e,"textAlign")}))}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-l":function(){return e.editor.commands.setTextAlign("left")},"Mod-Shift-e":function(){return e.editor.commands.setTextAlign("center")},"Mod-Shift-r":function(){return e.editor.commands.setTextAlign("right")},"Mod-Shift-j":function(){return e.editor.commands.setTextAlign("justify")}}}}),aa=zo.create({name:"subscript",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"sub"},{style:"vertical-align",getAttrs:function(e){return"sub"===e&&null}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["sub",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setSubscript:function(){return function(t){return t.commands.setMark(e.name)}},toggleSubscript:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetSubscript:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-,":function(){return e.editor.commands.toggleSubscript()}}}}),sa=zo.create({name:"superscript",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"sup"},{style:"vertical-align",getAttrs:function(e){return"super"===e&&null}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["sup",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setSuperscript:function(){return function(t){return t.commands.setMark(e.name)}},toggleSuperscript:function(){return function(t){return t.commands.toggleMark(e.name)}},unsetSuperscript:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-.":function(){return e.editor.commands.toggleSuperscript()}}}}),la=zo.create({name:"textStyle",addOptions:function(){return{HTMLAttributes:{}}},parseHTML:function(){return[{tag:"span",getAttrs:function(e){return!!e.hasAttribute("style")&&{}}}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{removeEmptyTextStyle:function(){return function(t){var n=t.state,r=t.commands,o=co(n,e.type);return!!Object.entries(o).some((function(e){return!!Object(u.a)(e,2)[1]}))||r.unsetMark(e.name)}}}}}),ua=$r.create({name:"fontSize",defaultOptions:{types:["textStyle"],defaultFontSize:16},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontSize:{default:"".concat(this.options.defaultFontSize,"px"),parseHTML:function(e){return e.style.fontSize},renderHTML:function(e){return e.fontSize?{style:"font-size: ".concat(e.fontSize)}:{}}}}}]},addCommands:function(){return{setFontSize:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{fontSize:e}).run()}},unsetFontSize:function(){return function(e){return(0,e.chain)().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}}}}),ca=$r.create({name:"textDirection",defaultOptions:{types:["paragraph","heading"],defaultDirection:"ltr"},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{textDirection:{default:this.options.defaultDirection,parseHTML:function(e){return e.dir},renderHTML:function(e){return e.textDirection?{dir:e.textDirection}:{}}}}}]},addCommands:function(){var e=this;return{setTextDirection:function(t){return function(n){var r=n.commands;return e.options.types.every((function(e){return r.updateAttributes(e,{textDirection:t})}))}}}}}),fa=$r.create({name:"fontFamily",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:function(e){var t;return null===(t=e.style.fontFamily)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:function(e){return e.fontFamily?{style:"font-family: ".concat(e.fontFamily)}:{}}}}}]},addCommands:function(){return{setFontFamily:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{fontFamily:e}).run()}},unsetFontFamily:function(){return function(e){return(0,e.chain)().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}}}}}),da=Qo.extend({addAttributes:function(){return{listType:{default:null,parseHTML:function(e){return e.style.listStyleType},renderHTML:function(e){return e.listType?{style:"list-style-type: ".concat(e.listType)}:{}}}}}}),pa=Xi.extend({addAttributes:function(){return{listType:{default:null,parseHTML:function(e){return e.style.listStyleType},renderHTML:function(e){return e.listType?{style:"list-style-type: ".concat(e.listType)}:{}}}}}}),ha=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))$/,ma=/(?:^|\s)((?:==)((?:[^~=]+))(?:==))/g,va=zo.create({name:"highlight",addOptions:function(){return{multicolor:!1,HTMLAttributes:{}}},addAttributes:function(){return this.options.multicolor?{color:{default:null,parseHTML:function(e){return e.getAttribute("data-color")||e.style.backgroundColor},renderHTML:function(e){return e.color?{"data-color":e.color,style:"background-color: ".concat(e.color)}:{}}}}:{}},parseHTML:function(){return[{tag:"mark"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["mark",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setHighlight:function(t){return function(n){return n.commands.setMark(e.name,t)}},toggleHighlight:function(t){return function(n){return n.commands.toggleMark(e.name,t)}},unsetHighlight:function(){return function(t){return t.commands.unsetMark(e.name)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-h":function(){return e.editor.commands.toggleHighlight()}}},addInputRules:function(){return[Ho({find:ha,type:this.type})]},addPasteRules:function(){return[Bo({find:ma,type:this.type})]}}),ga=$r.create({name:"color",addOptions:function(){return{types:["textStyle"]}},addGlobalAttributes:function(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:function(e){var t;return null===(t=e.style.color)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:function(e){return e.color?{style:"color: ".concat(e.color)}:{}}}}}]},addCommands:function(){return{setColor:function(e){return function(t){return(0,t.chain)().setMark("textStyle",{color:e}).run()}},unsetColor:function(){return function(e){return(0,e.chain)().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()}}}}}),ya=_o.create({name:"tableRow",addOptions:function(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:function(){return[{tag:"tr"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["tr",Sr(this.options.HTMLAttributes,t),0]}});function ba(e,t,n){return{default:null,parseHTML:function(t){var r;return n?null===(r=t.style[e])||void 0===r?void 0:r.toString().replace(n,""):t.style[e]},renderHTML:function(r){return r[e]?{style:"".concat(t,": ").concat(r[e]).concat(n||"")}:{}}}}var wa=_o.create({name:"tableCell",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",addAttributes:function(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:function(e){var t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}},tableRole:"cell",isolating:!0,parseHTML:function(){return[{tag:"td"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["td",Sr(this.options.HTMLAttributes,t),0]}}).extend({addAttributes:function(){var e;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{backgroundColor:ba("backgroundColor","background-color"),color:ba("color","color"),borderWidth:ba("borderWidth","border-width","px"),borderStyle:ba("borderStyle","border-style"),borderColor:ba("borderColor","border-color")})}}),ka=_o.create({name:"tableHeader",addOptions:function(){return{HTMLAttributes:{}}},content:"block+",addAttributes:function(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:function(e){var t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}},tableRole:"header_cell",isolating:!0,parseHTML:function(){return[{tag:"th"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["th",Sr(this.options.HTMLAttributes,t),0]}}),xa=n(14),Oa=n(0),Ca=n(1),Sa=n.n(Ca),ja=n(33),Aa=n(45);n(60);function Ea(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}var Da=function(e,t){return"function"===typeof t?t(e):function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return this.options.component?Object(Oa.jsx)(Fa,{children:Object(Oa.jsx)(this.options.component,Object.assign({},t,{editor:this.editor,getPos:this.getPos,node:this.node,forwardRef:n,updateAttributes:function(t,n){return e.updateAttributes(t,e.getPos(),null===n||void 0===n?void 0:n.addToHistory,null===n||void 0===n?void 0:n.preventUpdate)}}))}):null}},{key:"updateAttributes",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];this.editor.commands.command((function(i){var a=i.tr;return a.setNodeMarkup(t,void 0,Object.assign(Object.assign({},n.node.attrs),e)),a.setMeta("addToHistory",r),a.setMeta("preventUpdate",o),!0}))}},{key:"update",value:function(e,t,n){var r=this;return this.node.type===e.type&&(this.viewShouldUpdate(e)?(this.node=e,this.renderReactComponent((function(){return r.render(r.options.props,r.handleRef)})),!0):(this.node=e,!0))}},{key:"onDragStart",value:function(e){var t,n,r,o,i,a,s,l=this.editor.view,u=e.target,c=3===u.nodeType?null===(t=u.parentElement)||void 0===t?void 0:t.closest("[data-drag-handle]"):u.closest("[data-drag-handle]");if(this.dom&&!(null===(n=this.contentDOM)||void 0===n?void 0:n.contains(u))&&c){var f=this.dom.querySelector("[data-drag-image]")||this.dom,d=0,h=0;if(f!==c){var m=f.getBoundingClientRect(),v=c.getBoundingClientRect(),g=null!==(r=e.offsetX)&&void 0!==r?r:null===(o=e.nativeEvent)||void 0===o?void 0:o.offsetX,y=null!==(i=e.offsetY)&&void 0!==i?i:null===(a=e.nativeEvent)||void 0===a?void 0:a.offsetY;d=v.x-m.x+g,h=v.y-m.y+y}var b=p.NodeSelection.create(l.state.doc,this.getPos()),w=l.state.tr.setSelection(b);l.dispatch(w),null===(s=e.dataTransfer)||void 0===s||s.setDragImage(f,d,h),function(e,t){if(!e.dataTransfer)return;var n=t.view,r=n.state.selection.content(),o=wn(n,r),i=o.dom,a=o.text;e.dataTransfer.clearData(),e.dataTransfer.setData("Text",a),e.dataTransfer.setData("text/plain",a),e.dataTransfer.setData("text/html",i.innerHTML),e.dataTransfer.effectAllowed="copyMove",n.dragging={slice:r,move:!0}}(e,this.editor)}}},{key:"stopEvent",value:function(e){var t,n=this;if(!this.dom)return!1;var r=e.target;if(!(this.dom.contains(r)&&!(null===(t=this.contentDOM)||void 0===t?void 0:t.contains(r))))return!1;var o="drop"===e.type;if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(r.tagName)||r.isContentEditable)&&!o)return!0;var i=this.editor.isEditable,a=this.isDragging,s=!!this.node.type.spec.draggable,l=p.NodeSelection.isSelectable(this.node),u="copy"===e.type,c="paste"===e.type,f="cut"===e.type,d="mousedown"===e.type,h=e.type.startsWith("drag");if(!s&&l&&h&&e.preventDefault(),s&&h&&!a)return e.preventDefault(),!1;if(s&&i&&!a&&d){var m=r.closest("[data-drag-handle]");m&&(this.dom===m||this.dom.contains(m))&&(this.isDragging=!0,document.addEventListener("dragend",(function(){n.isDragging=!1}),{once:!0}),document.addEventListener("mouseup",(function(){n.isDragging=!1}),{once:!0}))}return!(a||o||u||c||f||d&&l)}},{key:"ignoreMutation",value:function(e){if(!this.dom||!this.contentDOM)return!0;if(this.node.isLeaf||this.node.isAtom)return!0;if("selection"===e.type)return!1;if(this.dom.contains(e.target)&&"childList"===e.type&&this.editor.isFocused&&[].concat(Object(l.a)(Array.from(e.addedNodes)),Object(l.a)(Array.from(e.removedNodes))).every((function(e){return e.isContentEditable})))return!1;return this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target)}},{key:"viewShouldUpdate",value:function(e){return!this.options.shouldUpdate||this.options.shouldUpdate(this.node,e)}},{key:"setDomAttrs",value:function(e,t){Object.keys(e.attrs||{}).forEach((function(n){t.setAttribute(n,e.attrs[n])}))}},{key:"dom",get:function(){return this.domRef}},{key:"destroy",value:function(){this.domRef&&this.portalProviderAPI&&(this.portalProviderAPI.remove(this.domRef),this.domRef=void 0,this.contentDOM=void 0)}}]),e}();function za(e,t){return function(n){var r=n.node,o=n.getPos,i=n.editor;return new Va(r,i,(function(){return"boolean"===typeof o?-1:o()}),Object.assign(Object.assign({},t),{component:e})).init()}}var _a=n(25),Ba=n.n(_a),Ia=function(){function e(){Object(c.a)(this,e),this.listeners={}}return Object(f.a)(e,[{key:"on",value:function(e,t){this.listeners[e]||(this.listeners[e]=new Set),this.listeners[e].add(t)}},{key:"off",value:function(e,t){this.listeners[e]&&this.listeners[e].has(t)&&this.listeners[e].delete(t)}},{key:"emit",value:function(e,t){this.listeners[e]&&this.listeners[e].forEach((function(e){return e(t)}))}},{key:"destroy",value:function(){this.listeners={}}}]),e}();var $a=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){var e;return Object(c.a)(this,n),(e=t.call(this)).portals=new Map,e.setContext=function(t){e.context=t},e}return Object(f.a)(n,[{key:"render",value:function(e,t){this.portals.set(t,{children:e});var n=e();Object(_a.unstable_renderSubtreeIntoContainer)(this.context,n,t)}},{key:"forceUpdate",value:function(){}},{key:"remove",value:function(e){this.portals.delete(e);try{Object(_a.unmountComponentAtNode)(e)}catch(t){}}}]),n}(Ia),qa=Sa.a.createContext(void 0);function Wa(){return Object(Ca.useContext)(qa)}var Ua=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e){var r;return Object(c.a)(this,n),(r=t.call(this,e)).portalProviderAPI=new $a,r}return Object(f.a)(n,[{key:"render",value:function(){return Object(Oa.jsxs)(qa.Provider,Object.assign({value:this.portalProviderAPI},{children:[this.props.children,Object(Oa.jsx)(Ka,{portalProviderAPI:this.portalProviderAPI})]}))}},{key:"componentDidUpdate",value:function(){this.portalProviderAPI.forceUpdate()}}]),n}(Sa.a.Component);Ua.displayName="PortalProvider";var Ka=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e){var r;return Object(c.a)(this,n),(r=t.call(this,e)).handleUpdate=function(e){return r.setState({portals:e})},e.portalProviderAPI.setContext(Object(o.a)(r)),e.portalProviderAPI.on("update",r.handleUpdate),r.state={portals:new Map},r}return Object(f.a)(n,[{key:"render",value:function(){var e=this.state.portals;return Object(Oa.jsx)(Oa.Fragment,{children:Array.from(e.entries()).map((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];return Object(_a.createPortal)(r,n)}))})}}]),n}(Sa.a.Component),Ga=function(){function e(){Object(c.a)(this,e),this.changeHandlers=[],this.changeHandlers=[]}return Object(f.a)(e,[{key:"subscribe",value:function(e){this.changeHandlers.push(e)}},{key:"unsubscribe",value:function(e){this.changeHandlers=this.changeHandlers.filter((function(t){return t!==e}))}},{key:"notifyNewSelection",value:function(e,t){this.changeHandlers.forEach((function(n){return n(e,t)}))}}]),e}(),Ja=new p.PluginKey("reactNodeView"),Za=new p.Plugin({state:{init:function(){return new Ga},apply:function(e,t){return t}},key:Ja,view:function(e){var t=Ja.getState(e.state);return{update:function(e){var n=e.state.selection,r=n.from,o=n.to;t.notifyNewSelection(r,o)}}}}),Ya=$r.create({name:"node-view-selection-notifier",addProseMirrorPlugins:function(){return[Za]}}),Xa=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(e,r,o,i){var a;return Object(c.a)(this,n),(a=t.call(this,e,r,o,i)).pos=-1,a.isNodeInsideSelection=function(e,t,n,r){var o=a.getPositionsWithDefault(n,r);return n=o.pos,r=o.posEnd,"number"===typeof n&&"number"===typeof r&&(e<=n&&t>=r)},a.isSelectionInsideNode=function(e,t,n,r){var o=a.getPositionsWithDefault(n,r);return n=o.pos,r=o.posEnd,"number"===typeof n&&"number"===typeof r&&(n0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(!this.options.component)return null;var r=this.editor.isEditable&&(this.insideSelection()||this.nodeInsideSelection());return Object(Oa.jsx)(Fa,{children:Object(Oa.jsx)(this.options.component,Object.assign({},t,{editor:this.editor,getPos:this.getPos,node:this.node,forwardRef:n,selected:r,updateAttributes:function(t,n){return e.updateAttributes(t,e.pos,null===n||void 0===n?void 0:n.addToHistory,null===n||void 0===n?void 0:n.preventUpdate)}}))})}},{key:"updatePos",value:function(){"boolean"!==typeof this.getPos&&(this.pos=this.getPos(),this.posEnd=this.pos+this.node.nodeSize)}},{key:"getPositionsWithDefault",value:function(e,t){return{pos:"number"!==typeof e?this.pos:e,posEnd:"number"!==typeof t?this.posEnd:t}}},{key:"viewShouldUpdate",value:function(e){if(Object(h.a)(Object(m.a)(n.prototype),"viewShouldUpdate",this).call(this,e))return!0;var t=this.editor.view.state.selection,r=this.oldSelection;this.oldSelection=t;var o=this.pos,i=this.posEnd;this.updatePos();var a=t.from,s=t.to,l=r.from,u=r.to;if(this.node.type.spec.selectable){var c=t instanceof p.NodeSelection&&t.from===this.pos,f=r instanceof p.NodeSelection&&r.from===this.pos;if(c&&!f||f&&!c)return!0}var d=this.isNodeInsideSelection(a,s)&&!this.isNodeInsideSelection(l,u),v=!this.isNodeInsideSelection(a,s)&&this.isNodeInsideSelection(l,u),g=this.isNodeInsideSelection(a,s,o,i)&&!this.isNodeInsideSelection(a,s);return!!(d||v||g)}},{key:"destroy",value:function(){this.selectionChangeState.unsubscribe(this.onSelectionChange),Object(h.a)(Object(m.a)(n.prototype),"destroy",this).call(this)}}]),n}(Va);function Qa(e,t){return function(n){var r=n.node,o=n.getPos,i=n.editor;return new Xa(r,i,(function(){return"boolean"===typeof o?-1:o()}),Object.assign(Object.assign({},t),{component:e})).init()}}var es=n(23),ts=n.n(es),ns=n(31);function rs(){return rs=Object.assign||function(e){for(var t=1;t0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function As(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o-1||/[A-Z]/.test(e))}var il={};var al=["","X","Y","Z"],sl=["transformPerspective","x","y","z"];function ll(e,t){return sl.indexOf(e)-sl.indexOf(t)}["translate","scale","rotate","skew"].forEach((function(e){return al.forEach((function(t){return sl.push(e+t)}))}));var ul=new Set(sl);function cl(e){return ul.has(e)}var fl=new Set(["originX","originY","originZ"]);function dl(e){return fl.has(e)}function pl(e,t){var n=t.layout,r=t.layoutId;return cl(e)||dl(e)||(n||void 0!==r)&&(!!il[e]||"opacity"===e)}var hl=function(e){return null!==e&&"object"===typeof e&&e.getVelocity},ml={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function vl(e){return e.startsWith("--")}var gl=function(e,t){return t&&"number"===typeof e?t.transform(e):e},yl=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},bl=function(e){return e%1?Number(e.toFixed(5)):e},wl=/(-)?([\d]*\.?[\d])+/g,kl=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,xl=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function Ol(e){return"string"===typeof e}var Cl=function(e){return{test:function(t){return Ol(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},Sl=Cl("deg"),jl=Cl("%"),Al=Cl("px"),El=Cl("vh"),Dl=Cl("vw"),Ml=Cs(Cs({},jl),{parse:function(e){return jl.parse(e)/100},transform:function(e){return jl.transform(100*e)}}),Tl={test:function(e){return"number"===typeof e},parse:parseFloat,transform:function(e){return e}},Ll=Cs(Cs({},Tl),{transform:yl(0,1)}),Pl=Cs(Cs({},Tl),{default:1}),Rl=Cs(Cs({},Tl),{transform:Math.round}),Hl={borderWidth:Al,borderTopWidth:Al,borderRightWidth:Al,borderBottomWidth:Al,borderLeftWidth:Al,borderRadius:Al,radius:Al,borderTopLeftRadius:Al,borderTopRightRadius:Al,borderBottomRightRadius:Al,borderBottomLeftRadius:Al,width:Al,maxWidth:Al,height:Al,maxHeight:Al,size:Al,top:Al,right:Al,bottom:Al,left:Al,padding:Al,paddingTop:Al,paddingRight:Al,paddingBottom:Al,paddingLeft:Al,margin:Al,marginTop:Al,marginRight:Al,marginBottom:Al,marginLeft:Al,rotate:Sl,rotateX:Sl,rotateY:Sl,rotateZ:Sl,scale:Pl,scaleX:Pl,scaleY:Pl,scaleZ:Pl,skew:Sl,skewX:Sl,skewY:Sl,distance:Al,translateX:Al,translateY:Al,translateZ:Al,x:Al,y:Al,z:Al,perspective:Al,transformPerspective:Al,opacity:Ll,originX:Ml,originY:Ml,originZ:Al,zIndex:Rl,fillOpacity:Ll,strokeOpacity:Ll,numOctaves:Rl};function Nl(e,t,n,r,o,i,a,s){var l,u=e.style,c=e.vars,f=e.transform,d=e.transformKeys,p=e.transformOrigin;d.length=0;var h=!1,m=!1,v=!0;for(var g in t){var y=t[g];if(vl(g))c[g]=y;else{var b=Hl[g],w=gl(y,b);if(cl(g)){if(h=!0,f[g]=w,d.push(g),!v)continue;y!==(null!==(l=b.default)&&void 0!==l?l:0)&&(v=!1)}else if(dl(g))p[g]=w,m=!0;else if((null===n||void 0===n?void 0:n.isHydrated)&&(null===r||void 0===r?void 0:r.isHydrated)&&il[g]){var k=il[g].process(y,r,n),x=il[g].applyTo;if(x)for(var O=x.length,C=0;C0?-1:1)*((r-i)*a)/s}):(t=function(e){return Math.exp(-e*o)*((e-l)*o+1)-.001},n=function(e){return Math.exp(-e*o)*(o*o*(l-e))});var d=function(e,t,n){for(var r=n,o=1;o<12;o++)r-=e(r)/t(r);return r}(t,n,5/o);if(o*=1e3,isNaN(d))return{stiffness:100,damping:10,duration:o};var p=Math.pow(d,2)*c;return{stiffness:p,damping:2*f*Math.sqrt(c*p),duration:o}}function Uu(e,t){return e*Math.sqrt(1-t*t)}var Ku=["duration","bounce"],Gu=["stiffness","damping","mass"];function Ju(e,t){return t.some((function(t){return void 0!==e[t]}))}function Zu(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,i=e.restSpeed,a=void 0===i?2:i,s=e.restDelta,l=Ss(e,["from","to","restSpeed","restDelta"]),u={done:!1,value:n},c=function(e){var t=Cs({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!Ju(e,Gu)&&Ju(e,Ku)){var n=Wu(e);(t=Cs(Cs(Cs({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(l),f=c.stiffness,d=c.damping,p=c.mass,h=c.velocity,m=c.duration,v=c.isResolvedFromDuration,g=Yu,y=Yu;function b(){var e=h?-h/1e3:0,t=o-n,r=d/(2*Math.sqrt(f*p)),i=Math.sqrt(f/p)/1e3;if(null!==s&&void 0!==s||(s=Math.abs(o-n)<=1?.01:.4),r<1){var a=Uu(i,r);g=function(n){var s=Math.exp(-r*i*n);return o-s*((e+r*i*t)/a*Math.sin(a*n)+t*Math.cos(a*n))},y=function(n){var o=Math.exp(-r*i*n);return r*i*o*(Math.sin(a*n)*(e+r*i*t)/a+t*Math.cos(a*n))-o*(Math.cos(a*n)*(e+r*i*t)-a*t*Math.sin(a*n))}}else if(1===r)g=function(n){return o-Math.exp(-i*n)*(t+(e+i*t)*n)};else{var l=i*Math.sqrt(r*r-1);g=function(n){var a=Math.exp(-r*i*n),s=Math.min(l*n,300);return o-a*((e+r*i*t)*Math.sinh(s)+l*t*Math.cosh(s))/l}}}return b(),{next:function(e){var t=g(e);if(v)u.done=e>=m;else{var n=1e3*y(e),r=Math.abs(n)<=a,i=Math.abs(o-t)<=s;u.done=r&&i}return u.value=u.done?o:t,u},flipTarget:function(){var e;h=-h,n=(e=[o,n])[0],o=e[1],b()}}}Zu.needsInterpolation=function(e,t){return"string"===typeof e||"string"===typeof t};var Yu=function(e){return 0},Xu=function(e,t,n){var r=t-e;return 0===r?1:(n-e)/r},Qu=function(e,t,n){return-n*e+n*t+e},ec=function(e,t){return function(n){return Boolean(Ol(n)&&xl.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},tc=function(e,t,n){return function(r){var o;if(!Ol(r))return r;var i=r.match(wl),a=i[0],s=i[1],l=i[2],u=i[3];return(o={})[e]=parseFloat(a),o[t]=parseFloat(s),o[n]=parseFloat(l),o.alpha=void 0!==u?parseFloat(u):1,o}},nc=yl(0,255),rc=Cs(Cs({},Tl),{transform:function(e){return Math.round(nc(e))}}),oc={test:ec("rgb","red"),parse:tc("red","green","blue"),transform:function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha,i=void 0===o?1:o;return"rgba("+rc.transform(t)+", "+rc.transform(n)+", "+rc.transform(r)+", "+bl(Ll.transform(i))+")"}};var ic={test:ec("#"),parse:function(e){var t="",n="",r="",o="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),o=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),o=e.substr(4,1),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:oc.transform},ac={test:ec("hsl","hue"),parse:tc("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha,i=void 0===o?1:o;return"hsla("+Math.round(t)+", "+jl.transform(bl(n))+", "+jl.transform(bl(r))+", "+bl(Ll.transform(i))+")"}},sc=function(e,t,n){var r=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-r)+r))},lc=[ic,oc,ac],uc=function(e){return lc.find((function(t){return t.test(e)}))},cc=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},fc=function(e,t){var n=uc(e),r=uc(t);cc(e),cc(t),n.transform,r.transform;var o=n.parse(e),i=r.parse(t),a=Cs({},o),s=n===ac?Qu:sc;return function(e){for(var t in a)"alpha"!==t&&(a[t]=s(o[t],i[t],e));return a.alpha=Qu(o.alpha,i.alpha,e),n.transform(a)}},dc={test:function(e){return oc.test(e)||ic.test(e)||ac.test(e)},parse:function(e){return oc.test(e)?oc.parse(e):ac.test(e)?ac.parse(e):ic.parse(e)},transform:function(e){return Ol(e)?e:e.hasOwnProperty("red")?oc.transform(e):ac.transform(e)}},pc="${c}",hc="${n}";function mc(e){var t=[],n=0,r=e.match(kl);r&&(n=r.length,e=e.replace(kl,pc),t.push.apply(t,r.map(dc.parse)));var o=e.match(wl);return o&&(e=e.replace(wl,hc),t.push.apply(t,o.map(Tl.parse))),{values:t,numColors:n,tokenised:e}}function vc(e){return mc(e).values}function gc(e){var t=mc(e),n=t.values,r=t.numColors,o=t.tokenised,i=n.length;return function(e){for(var t=o,n=0;n0},parse:vc,createTransformer:gc,getAnimatableNone:function(e){var t=vc(e);return gc(e)(t.map(yc))}},wc=function(e){return"number"===typeof e};function kc(e,t){return wc(e)?function(n){return Qu(e,t,n)}:dc.test(e)?fc(e,t):Sc(e,t)}var xc=function(e,t){var n=As([],e),r=n.length,o=e.map((function(e,n){return kc(e,t[n])}));return function(e){for(var t=0;te[l-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var u=Ac(t,a,s),c=2===l?function(e,t){var n=e[0],r=e[1],o=t[0];return function(e){return o(Xu(n,r,e))}}(e,u):function(e,t){var n=e.length,r=n-1;return function(o){var i=0,a=!1;if(o<=e[0]?a=!0:o>=e[r]&&(i=r-1,a=!0),!a){for(var s=1;so||s===r);s++);i=s-1}var l=Xu(e[i],e[i+1],o);return t[i](l)}}(e,u);return i?function(t){return c($u(e[0],e[l-1],t))}:c}var Dc,Mc=function(e){return function(t){return 1-e(1-t)}},Tc=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},Lc=function(e){return function(t){return t*t*((e+1)*t-e)}},Pc=function(e){return e},Rc=(Dc=2,function(e){return Math.pow(e,Dc)}),Hc=Mc(Rc),Nc=Tc(Rc),Fc=function(e){return 1-Math.sin(Math.acos(e))},Vc=Mc(Fc),zc=Tc(Vc),_c=Lc(1.525),Bc=Mc(_c),Ic=Tc(_c),$c=function(e){var t=Lc(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}}(1.525),qc=function(e){if(1===e||0===e)return e;var t=e*e;return e<.36363636363636365?7.5625*t:e<.7272727272727273?9.075*t-9.9*e+3.4:e<.9?12.066481994459833*t-19.63545706371191*e+8.898060941828255:10.8*e*e-20.52*e+10.72},Wc=Mc(qc);function Uc(e,t){return e.map((function(){return t||Nc})).splice(0,e.length-1)}function Kc(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,i=e.ease,a=e.offset,s=e.duration,l=void 0===s?300:s,u={done:!1,value:n},c=Array.isArray(o)?o:[n,o],f=function(e,t){return e.map((function(e){return e*t}))}(a&&a.length===c.length?a:function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(c),l);function d(){return Ec(f,c,{ease:Array.isArray(i)?i:Uc(c,i)})}var p=d();return{next:function(e){return u.value=p(e),u.done=e>=l,u},flipTarget:function(){c.reverse(),p=d()}}}var Gc={keyframes:Kc,spring:Zu,decay:function(e){var t=e.velocity,n=void 0===t?0:t,r=e.from,o=void 0===r?0:r,i=e.power,a=void 0===i?.8:i,s=e.timeConstant,l=void 0===s?350:s,u=e.restDelta,c=void 0===u?.5:u,f=e.modifyTarget,d={done:!1,value:o},p=a*n,h=o+p,m=void 0===f?h:f(h);return m!==h&&(p=m-o),{next:function(e){var t=-p*Math.exp(-e/l);return d.done=!(t>c||t<-c),d.value=d.done?m:m+t,d},flipTarget:function(){}}}};var Jc=1/60*1e3,Zc="undefined"!==typeof performance?function(){return performance.now()}:function(){return Date.now()},Yc="undefined"!==typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout((function(){return e(Zc())}),Jc)};var Xc=!0,Qc=!1,ef=!1,tf={delta:0,timestamp:0},nf=["read","update","preRender","render","postRender"],rf=nf.reduce((function(e,t){return e[t]=function(e){var t=[],n=[],r=0,o=!1,i=new WeakSet,a={schedule:function(e,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&o,u=l?t:n;return a&&i.add(e),-1===u.indexOf(e)&&(u.push(e),l&&o&&(r=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),i.delete(e)},process:function(s){var l;if(o=!0,t=(l=[n,t])[0],(n=l[1]).length=0,r=t.length)for(var u=0;u=t+n:e<=-n}(d,A,y,D)&&L():(r.stop(),k&&k()))}return l&&(null===b||void 0===b||b(),(r=c(P)).start()),{stop:function(){null===w||void 0===w||w(),r.stop()}}}function vf(e,t){return t?e*(1e3/t):0}var gf=function(e){return 1e3*e},yf=function(e,t){return 1-3*t+3*e},bf=function(e,t){return 3*t-6*e},wf=function(e){return 3*e},kf=function(e,t,n){return((yf(t,n)*e+bf(t,n))*e+wf(t))*e},xf=function(e,t,n){return 3*yf(t,n)*e*e+2*bf(t,n)*e+wf(t)};var Of=.1;function Cf(e,t,n,r){if(e===t&&n===r)return Pc;for(var o=new Float32Array(11),i=0;i<11;++i)o[i]=kf(i*Of,e,n);function a(t){for(var r=0,i=1;10!==i&&o[i]<=t;++i)r+=Of;--i;var a=r+(t-o[i])/(o[i+1]-o[i])*Of,s=xf(a,e,n);return s>=.001?function(e,t,n,r){for(var o=0;o<8;++o){var i=xf(t,n,r);if(0===i)return t;t-=(kf(t,n,r)-e)/i}return t}(t,a,e,n):0===s?a:function(e,t,n,r,o){var i,a,s=0;do{(i=kf(a=t+(n-t)/2,r,o)-e)>0?n=a:t=a}while(Math.abs(i)>1e-7&&++s<10);return a}(t,r,r+Of,e,n)}return function(e){return 0===e||1===e?e:kf(a(e),t,r)}}var Sf={linear:Pc,easeIn:Rc,easeInOut:Nc,easeOut:Hc,circIn:Fc,circInOut:zc,circOut:Vc,backIn:_c,backInOut:Ic,backOut:Bc,anticipate:$c,bounceIn:Wc,bounceInOut:function(e){return e<.5?.5*(1-qc(1-2*e)):.5*qc(2*e-1)+.5},bounceOut:qc},jf=function(e){if(Array.isArray(e)){e.length;var t=js(e,4);return Cf(t[0],t[1],t[2],t[3])}return"string"===typeof e?Sf[e]:e},Af=function(e,t){return"zIndex"!==e&&(!("number"!==typeof t&&!Array.isArray(t))||!("string"!==typeof t||!bc.test(t)||t.startsWith("url(")))},Ef=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Df=function(e){return{type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},Mf=function(){return{type:"keyframes",ease:"linear",duration:.3}},Tf=function(e){return{type:"keyframes",duration:.8,values:e}},Lf={x:Ef,y:Ef,z:Ef,rotate:Ef,rotateX:Ef,rotateY:Ef,rotateZ:Ef,scaleX:Df,scaleY:Df,scale:Df,opacity:Mf,backgroundColor:Mf,color:Mf,default:Df},Pf=new Set(["brightness","contrast","saturate","opacity"]);function Rf(e){var t=e.slice(0,-1).split("("),n=t[0],r=t[1];if("drop-shadow"===n)return e;var o=(r.match(wl)||[])[0];if(!o)return e;var i=r.replace(o,""),a=Pf.has(n)?1:0;return o!==r&&(a*=100),n+"("+a+i+")"}var Hf=/([a-z-]*)\(.*?\)/g,Nf=Cs(Cs({},bc),{getAnimatableNone:function(e){var t=e.match(Hf);return t?t.map(Rf).join(" "):e}}),Ff=Cs(Cs({},Hl),{color:dc,backgroundColor:dc,outlineColor:dc,fill:dc,stroke:dc,borderColor:dc,borderTopColor:dc,borderRightColor:dc,borderBottomColor:dc,borderLeftColor:dc,filter:Nf,WebkitFilter:Nf}),Vf=function(e){return Ff[e]};function zf(e,t){var n,r=Vf(e);return r!==Nf&&(r=bc),null===(n=r.getAnimatableNone)||void 0===n?void 0:n.call(r,t)}function _f(e){var t=e.ease,n=e.times,r=e.yoyo,o=e.flip,i=e.loop,a=Ss(e,["ease","times","yoyo","flip","loop"]),s=Cs({},a);return n&&(s.offset=n),a.duration&&(s.duration=gf(a.duration)),a.repeatDelay&&(s.repeatDelay=gf(a.repeatDelay)),t&&(s.ease=function(e){return Array.isArray(e)&&"number"!==typeof e[0]}(t)?t.map(jf):jf(t)),"tween"===a.type&&(s.type="keyframes"),(r||i||o)&&(!0,r?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||r||o||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function Bf(e,t,n){var r;return Array.isArray(t.to)&&(null!==(r=e.duration)&&void 0!==r||(e.duration=.8)),function(e){Array.isArray(e.to)&&null===e.to[0]&&(e.to=As([],js(e.to)),e.to[0]=e.from)}(t),function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection,e.repeat,e.repeatType,e.repeatDelay,e.from;var t=Ss(e,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(t).length}(e)||(e=Cs(Cs({},e),function(e,t){var n;return n=su(t)?Tf:Lf[e]||Lf.default,Cs({to:t},n(t))}(n,t.to))),Cs(Cs({},t),_f(e))}function If(e,t,n,r,o){var i,a=Wf(r,e),s=null!==(i=a.from)&&void 0!==i?i:t.get(),l=Af(e,n);"none"===s&&l&&"string"===typeof n?s=zf(e,n):$f(s)&&"string"===typeof n?s=qf(n):!Array.isArray(n)&&$f(n)&&"string"===typeof s&&(n=qf(s));var u=Af(e,s);return u&&l&&!1!==a.type?function(){var r={from:s,to:n,velocity:t.getVelocity(),onComplete:o,onUpdate:function(e){return t.set(e)}};return"inertia"===a.type||"decay"===a.type?function(e){var t,n=e.from,r=void 0===n?0:n,o=e.velocity,i=void 0===o?0:o,a=e.min,s=e.max,l=e.power,u=void 0===l?.8:l,c=e.timeConstant,f=void 0===c?750:c,d=e.bounceStiffness,p=void 0===d?500:d,h=e.bounceDamping,m=void 0===h?10:h,v=e.restDelta,g=void 0===v?1:v,y=e.modifyTarget,b=e.driver,w=e.onUpdate,k=e.onComplete;function x(e){return void 0!==a&&es}function O(e){return void 0===a?s:void 0===s||Math.abs(a-e)D||-1===M&&e-1&&e.splice(n,1)}var Jf=function(){function e(){this.subscriptions=[]}return e.prototype.add=function(e){var t=this;return Kf(this.subscriptions,e),function(){return Gf(t.subscriptions,e)}},e.prototype.notify=function(e,t,n){var r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(var o=0;oh&&g,k=Array.isArray(v)?v:[v],x=k.reduce(i,{});!1===y&&(x={});var O=m.prevResolvedValues,C=void 0===O?{}:O,S=Cs(Cs({},C),x),j=function(e){w=!0,d.delete(e),m.needsAnimating[e]=!0};for(var A in S){var E=x[A],D=C[A];p.hasOwnProperty(A)||(E!==D?su(E)&&su(D)?Iu(E,D)?m.protectedKeys[A]=!0:j(A):void 0!==E?j(A):d.add(A):void 0!==E&&d.has(A)?j(A):m.protectedKeys[A]=!0)}m.prevProp=v,m.prevResolvedValues=x,m.isActive&&(p=Cs(Cs({},p),x)),o&&e.blockInitialAnimation&&(w=!1),w&&!b&&f.push.apply(f,As([],js(k.map((function(e){return{animation:e,options:Cs({type:r},a)}})))))},v=0;v=3;if(t||n){var o=e.point,i=ff().timestamp;r.history.push(Cs(Cs({},o),{timestamp:i}));var a=r.handlers,s=a.onStart,l=a.onMove;t||(s&&s(r.lastMoveEvent,e),r.startEvent=r.lastMoveEvent),l&&l(r.lastMoveEvent,e)}}},this.handlePointerMove=function(e,t){r.lastMoveEvent=e,r.lastMoveEventInfo=Od(t,r.transformPagePoint),yu(e)&&0===e.buttons?r.handlePointerUp(e,t):df.update(r.updatePoint,!0)},this.handlePointerUp=function(e,t){r.end();var n=r.handlers,o=n.onEnd,i=n.onSessionEnd,a=Sd(Od(t,r.transformPagePoint),r.history);r.startEvent&&o&&o(e,a),i&&i(e,a)},!(bu(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=o;var i=Od(Ou(e),this.transformPagePoint),a=i.point,s=ff().timestamp;this.history=[Cs(Cs({},a),{timestamp:s})];var l=t.onSessionStart;l&&l(e,Sd(i,this.history)),this.removeListeners=zu(Eu(window,"pointermove",this.handlePointerMove),Eu(window,"pointerup",this.handlePointerUp),Eu(window,"pointercancel",this.handlePointerUp))}}return e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),af.update(this.updatePoint)},e}();function Od(e,t){return t?{point:t(e.point)}:e}function Cd(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Sd(e,t){var n=e.point;return{point:n,delta:Cd(n,Ad(t)),offset:Cd(n,jd(t)),velocity:Ed(t,.1)}}function jd(e){return e[0]}function Ad(e){return e[e.length-1]}function Ed(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,r=null,o=Ad(e);n>=0&&(r=e[n],!(o.timestamp-r.timestamp>gf(t)));)n--;if(!r)return{x:0,y:0};var i=(o.timestamp-r.timestamp)/1e3;if(0===i)return{x:0,y:0};var a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Dd(e){return e}function Md(e){var t=e.top;return{x:{min:e.left,max:e.right},y:{min:t,max:e.bottom}}}var Td={translate:0,scale:1,origin:0,originPoint:0};function Ld(){return{x:Cs({},Td),y:Cs({},Td)}}function Pd(e){return[e("x"),e("y")]}function Rd(e,t,n){var r=t.min,o=t.max;return void 0!==r&&eo&&(e=n?Qu(o,e,n.max):Math.min(e,o)),e}function Hd(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Nd(e,t){var n,r=t.min-e.min,o=t.max-e.max;return t.max-t.minr?n=Xu(t.min,t.max-r,e.min):r>o&&(n=Xu(e.min,e.max-o,t.min)),$u(0,1,n)}function $d(e,t,n,r){void 0===r&&(r=.5),e.origin=r,e.originPoint=Qu(t.min,t.max,e.origin),e.scale=Bd(n)/Bd(t),_d(e.scale,1,1e-4)&&(e.scale=1),e.translate=Qu(n.min,n.max,e.origin)-e.originPoint,_d(e.translate)&&(e.translate=0)}function qd(e,t,n,r){$d(e.x,t.x,n.x,Wd(r.originX)),$d(e.y,t.y,n.y,Wd(r.originY))}function Wd(e){return"number"===typeof e?e:.5}function Ud(e,t,n){e.min=n.min+t.min,e.max=e.min+Bd(t)}var Kd=function(e,t){return e.depth-t.depth};function Gd(e){return e.projection.isEnabled||e.shouldResetTransform()}function Jd(e,t){void 0===t&&(t=[]);var n=e.parent;return n&&Jd(n,t),Gd(e)&&t.push(e),t}function Zd(e){if(!e.shouldResetTransform()){var t,n=e.getLayoutState();e.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=e.measureViewportBox(),n.layoutCorrected=(t=n.layout,{x:Cs({},t.x),y:Cs({},t.y)}),e.notifyLayoutMeasure(n.layout,e.prevViewportBox||n.layout),df.update((function(){return e.rebaseProjectionTarget()}))}}function Yd(e,t){return{min:t.min-e.min,max:t.max-e.min}}function Xd(e,t){return{x:Yd(e.x,t.x),y:Yd(e.y,t.y)}}function Qd(e,t){var n=e.getLayoutId(),r=t.getLayoutId();return n!==r||void 0===r&&e!==t}function ep(e){var t=e.getProps(),n=t.drag,r=t._dragX;return n&&!r}function tp(e,t){e.min=t.min,e.max=t.max}function np(e,t,n){return n+t*(e-n)}function rp(e,t,n,r,o){return void 0!==o&&(e=np(e,o,r)),np(e,n,r)+t}function op(e,t,n,r,o){void 0===t&&(t=0),void 0===n&&(n=1),e.min=rp(e.min,t,n,r,o),e.max=rp(e.max,t,n,r,o)}function ip(e,t){var n=t.x,r=t.y;op(e.x,n.translate,n.scale,n.originPoint),op(e.y,r.translate,r.scale,r.originPoint)}function ap(e,t,n,r){var o=js(r,3),i=o[0],a=o[1],s=o[2];e.min=t.min,e.max=t.max;var l=void 0!==n[s]?n[s]:.5,u=Qu(t.min,t.max,l);op(e,n[i],n[a],u,n.scale)}var sp=["x","scaleX","originX"],lp=["y","scaleY","originY"];function up(e,t,n){ap(e.x,t.x,n,sp),ap(e.y,t.y,n,lp)}function cp(e,t,n,r,o){return e=np(e-=t,1/n,r),void 0!==o&&(e=np(e,1/o,r)),e}function fp(e,t,n){var r=js(n,3),o=r[0],i=r[1],a=r[2];!function(e,t,n,r,o){void 0===t&&(t=0),void 0===n&&(n=1),void 0===r&&(r=.5);var i=Qu(e.min,e.max,r)-t;e.min=cp(e.min,t,n,i,o),e.max=cp(e.max,t,n,i,o)}(e,t[o],t[i],t[a],t.scale)}function dp(e,t){fp(e.x,t,sp),fp(e.y,t,lp)}var pp=new Set;function hp(e,t,n){e[n]||(e[n]=[]),e[n].push(t)}function mp(e){return pp.add(e),function(){return pp.delete(e)}}function vp(){if(pp.size){var e=0,t=[[]],n=[],r=function(n){return hp(t,n,e)},o=function(t){hp(n,t,e),e++};pp.forEach((function(t){t(r,o),e=0})),pp.clear();for(var i=n.length,a=0;a<=i;a++)t[a]&&t[a].forEach(yp),n[a]&&n[a].forEach(yp)}}var gp,yp=function(e){return e()},bp=new WeakMap,wp=function(){function e(e){var t=e.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=t,this.visualElement.enableLayoutProjection(),bp.set(t,this)}return e.prototype.start=function(e,t){var n=this,r=void 0===t?{}:t,o=r.snapToCursor,i=void 0!==o&&o,a=r.cursorProgress,s=this.props.transformPagePoint;this.panSession=new xd(e,{onSessionStart:function(e){var t;n.stopMotion();var r=function(e){return Ou(e,"client")}(e).point;null===(t=n.cancelLayout)||void 0===t||t.call(n),n.cancelLayout=mp((function(e,t){var o=Jd(n.visualElement),s=function(e){var t=[];return e.children.forEach((function e(n){Gd(n)&&t.push(n),n.children.forEach(e)})),t.sort(Kd)}(n.visualElement),l=As(As([],js(o)),js(s)),u=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),t((function(){l.forEach((function(e){return e.resetTransform()}))})),e((function(){Zd(n.visualElement),s.forEach(Zd)})),t((function(){l.forEach((function(e){return e.restoreTransform()})),i&&(u=n.snapToCursor(r))})),e((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var e=n.visualElement.projection;Pd((function(t){if(!u){var o=e.target[t],i=o.min,s=o.max;n.cursorProgress[t]=a?a[t]:Xu(i,s,r[t])}var l=n.getAxisMotionValue(t);l&&(n.originPoint[t]=l.get())}))})),t((function(){sf.update(),sf.preRender(),sf.render(),sf.postRender()})),e((function(){return n.resolveDragConstraints()}))}))},onStart:function(e,t){var r,o,i,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Pu(s),n.openGlobalLock))&&(vp(),n.isDragging=!0,n.currentDirection=null,null===(o=(r=n.props).onDragStart)||void 0===o||o.call(r,e,t),null===(i=n.visualElement.animationState)||void 0===i||i.setActive(pu.Drag,!0))},onMove:function(e,t){var r,o,i,a,s=n.props,l=s.dragPropagation,u=s.dragDirectionLock;if(l||n.openGlobalLock){var c=t.offset;if(u&&null===n.currentDirection)return n.currentDirection=function(e,t){void 0===t&&(t=10);var n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(c),void(null!==n.currentDirection&&(null===(o=(r=n.props).onDirectionLock)||void 0===o||o.call(r,n.currentDirection)));n.updateAxis("x",t.point,c),n.updateAxis("y",t.point,c),null===(a=(i=n.props).onDrag)||void 0===a||a.call(i,e,t),gp=e}},onSessionEnd:function(e,t){return n.stop(e,t)}},{transformPagePoint:s})},e.prototype.resolveDragConstraints=function(){var e=this,t=this.props,n=t.dragConstraints,r=t.dragElastic,o=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Us(n)?this.resolveRefConstraints(o,n):function(e,t){var n=t.top,r=t.left,o=t.bottom,i=t.right;return{x:Hd(e.x,r,i),y:Hd(e.y,n,o)}}(o,n)),this.elastic=function(e){return!1===e?e=0:!0===e&&(e=.35),{x:Fd(e,"left","right"),y:Fd(e,"top","bottom")}}(r),this.constraints&&!this.hasMutatedConstraints&&Pd((function(t){e.getAxisMotionValue(t)&&(e.constraints[t]=function(e,t){var n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(o[t],e.constraints[t]))}))},e.prototype.resolveRefConstraints=function(e,t){var n=this.props,r=n.onMeasureDragConstraints,o=n.transformPagePoint,i=t.current;this.constraintsBox=zd(i,o);var a=function(e,t){return{x:Nd(e.x,t.x),y:Nd(e.y,t.y)}}(e,this.constraintsBox);if(r){var s=r(function(e){var t=e.x,n=e.y;return{top:n.min,bottom:n.max,left:t.min,right:t.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=Md(s))}return a},e.prototype.cancelDrag=function(){var e,t;this.visualElement.unlockProjectionTarget(),null===(e=this.cancelLayout)||void 0===e||e.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(t=this.visualElement.animationState)||void 0===t||t.setActive(pu.Drag,!1)},e.prototype.stop=function(e,t){var n,r,o;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var i=this.isDragging;if(this.cancelDrag(),i){var a=t.velocity;this.animateDragEnd(a),null===(o=(r=this.props).onDragEnd)||void 0===o||o.call(r,e,t)}},e.prototype.snapToCursor=function(e){var t=this;return Pd((function(n){if(kp(n,t.props.drag,t.currentDirection)){var r=t.getAxisMotionValue(n);if(!r)return t.cursorProgress[n]=.5,!0;var o=t.visualElement.getLayoutState().layout,i=o[n].max-o[n].min,a=o[n].min+i/2,s=e[n]-a;t.originPoint[n]=e[n],r.set(s)}})).includes(!0)},e.prototype.updateAxis=function(e,t,n){if(kp(e,this.props.drag,this.currentDirection))return this.getAxisMotionValue(e)?this.updateAxisMotionValue(e,n):this.updateVisualElementAxis(e,t)},e.prototype.updateAxisMotionValue=function(e,t){var n=this.getAxisMotionValue(e);if(t&&n){var r=this.originPoint[e]+t[e],o=this.constraints?Rd(r,this.constraints[e],this.elastic[e]):r;n.set(o)}},e.prototype.updateVisualElementAxis=function(e,t){var n,r=this.visualElement.getLayoutState().layout[e],o=r.max-r.min,i=this.cursorProgress[e],a=function(e,t,n,r,o){var i=e-t*n;return r?Rd(i,r,o):i}(t[e],o,i,null===(n=this.constraints)||void 0===n?void 0:n[e],this.elastic[e]);this.visualElement.setProjectionTargetAxis(e,a,a+o)},e.prototype.setProps=function(e){var t=e.drag,n=void 0!==t&&t,r=e.dragDirectionLock,o=void 0!==r&&r,i=e.dragPropagation,a=void 0!==i&&i,s=e.dragConstraints,l=void 0!==s&&s,u=e.dragElastic,c=void 0===u?.35:u,f=e.dragMomentum,d=void 0===f||f,p=Ss(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Cs({drag:n,dragDirectionLock:o,dragPropagation:a,dragConstraints:l,dragElastic:c,dragMomentum:d},p)},e.prototype.getAxisMotionValue=function(e){var t=this.props,n=t.layout,r=t.layoutId,o="_drag"+e.toUpperCase();return this.props[o]?this.props[o]:n||void 0!==r?void 0:this.visualElement.getValue(e,0)},e.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},e.prototype.isExternalDrag=function(){var e=this.props,t=e._dragX,n=e._dragY;return t||n},e.prototype.animateDragEnd=function(e){var t=this,n=this.props,r=n.drag,o=n.dragMomentum,i=n.dragElastic,a=n.dragTransition,s=function(e,t){void 0===t&&(t=!0);var n,r=e.getProjectionParent();return!!r&&(t?dp(n=Xd(r.projection.target,e.projection.target),r.getLatestValues()):n=Xd(r.getLayoutState().layout,e.getLayoutState().layout),Pd((function(t){return e.setProjectionTargetAxis(t,n[t].min,n[t].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var u=this.visualElement.getProjectionParent();if(u){var c=Xd(u.projection.targetFinal,l);Pd((function(e){var t=c[e],n=t.min,r=t.max;l[e]={min:isNaN(n)?void 0:n,max:isNaN(r)?void 0:r}}))}}var f=Pd((function(n){var u;if(kp(n,r,t.currentDirection)){var c=null!==(u=null===l||void 0===l?void 0:l[n])&&void 0!==u?u:{},f=i?200:1e6,d=i?40:1e7,p=Cs(Cs({type:"inertia",velocity:o?e[n]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10},a),c);return t.getAxisMotionValue(n)?t.startAxisValueAnimation(n,p):t.visualElement.startLayoutAnimation(n,p,s)}}));return Promise.all(f).then((function(){var e,n;null===(n=(e=t.props).onDragTransitionEnd)||void 0===n||n.call(e)}))},e.prototype.stopMotion=function(){var e=this;Pd((function(t){var n=e.getAxisMotionValue(t);n?n.stop():e.visualElement.stopLayoutAnimation()}))},e.prototype.startAxisValueAnimation=function(e,t){var n=this.getAxisMotionValue(e);if(n){var r=n.get();return n.set(r),n.set(r),Uf(e,n,0,t)}},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.drag;if(Us(t.dragConstraints)&&this.constraintsBox){this.stopMotion();var r={x:0,y:0};Pd((function(t){r[t]=Id(e.visualElement.projection.target[t],e.constraintsBox[t])})),this.updateConstraints((function(){Pd((function(t){if(kp(t,n,null)){var o=function(e,t,n){var r=e.max-e.min,o=Qu(t.min,t.max-r,n);return{min:o,max:o+r}}(e.visualElement.projection.target[t],e.constraintsBox[t],r[t]),i=o.min,a=o.max;e.visualElement.setProjectionTargetAxis(t,i,a)}}))})),setTimeout(vp,1)}},e.prototype.updateConstraints=function(e){var t=this;this.cancelLayout=mp((function(n,r){var o=Jd(t.visualElement);r((function(){return o.forEach((function(e){return e.resetTransform()}))})),n((function(){return Zd(t.visualElement)})),r((function(){return o.forEach((function(e){return e.restoreTransform()}))})),n((function(){t.resolveDragConstraints()})),e&&r(e)}))},e.prototype.mount=function(e){var t=this,n=Eu(e.getInstance(),"pointerdown",(function(e){var n=t.props,r=n.drag,o=n.dragListener;r&&(void 0===o||o)&&t.start(e)})),r=vu(window,"resize",(function(){t.scalePoint()})),o=e.onLayoutUpdate((function(){t.isDragging&&t.resolveDragConstraints()})),i=e.prevDragCursor;return i&&this.start(gp,{cursorProgress:i}),function(){null===n||void 0===n||n(),null===r||void 0===r||r(),null===o||void 0===o||o(),t.cancelDrag()}},e}();function kp(e,t,n){return(!0===t||t===e)&&(null===n||n===e)}var xp,Op,Cp={pan:_u((function(e){var t=e.onPan,n=e.onPanStart,r=e.onPanEnd,o=e.onPanSessionStart,i=e.visualElement,a=t||n||r||o,s=Object(Ca.useRef)(null),l=Object(Ca.useContext)(Ps).transformPagePoint,u={onSessionStart:o,onStart:n,onMove:t,onEnd:function(e,t){s.current=null,r&&r(e,t)}};Object(Ca.useEffect)((function(){null!==s.current&&s.current.updateHandlers(u)})),Du(i,"pointerdown",a&&function(e){s.current=new xd(e,u,{transformPagePoint:l})}),Fu((function(){return s.current&&s.current.end()}))})),drag:_u((function(e){var t=e.dragControls,n=e.visualElement,r=Object(Ca.useContext)(Ps).transformPagePoint,o=Ns((function(){return new wp({visualElement:n})}));o.setProps(Cs(Cs({},e),{transformPagePoint:r})),Object(Ca.useEffect)((function(){return t&&t.subscribe(o)}),[o]),Object(Ca.useEffect)((function(){return o.mount(n)}),[])}))};function Sp(e){return"string"===typeof e&&e.startsWith("var(--")}!function(e){e[e.Entering=0]="Entering",e[e.Present=1]="Present",e[e.Exiting=2]="Exiting"}(xp||(xp={})),function(e){e[e.Hide=0]="Hide",e[e.Show=1]="Show"}(Op||(Op={}));var jp=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ap(e,t,n){void 0===n&&(n=1);var r=js(function(e){var t=jp.exec(e);if(!t)return[,];var n=js(t,3);return[n[1],n[2]]}(e),2),o=r[0],i=r[1];if(o){var a=window.getComputedStyle(t).getPropertyValue(o);return a?a.trim():Sp(i)?Ap(i,t,n+1):i}}function Ep(e,t){return e/(t.max-t.min)*100}var Dp="_$css";var Mp={process:function(e,t,n){var r=n.target;if("string"===typeof e){if(!Al.test(e))return e;e=parseFloat(e)}return Ep(e,r.x)+"% "+Ep(e,r.y)+"%"}},Tp={borderRadius:Cs(Cs({},Mp),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Mp,borderTopRightRadius:Mp,borderBottomLeftRadius:Mp,borderBottomRightRadius:Mp,boxShadow:{process:function(e,t){var n=t.delta,r=t.treeScale,o=e,i=e.includes("var("),a=[];i&&(e=e.replace(jp,(function(e){return a.push(e),Dp})));var s=bc.parse(e);if(s.length>5)return o;var l=bc.createTransformer(e),u="number"!==typeof s[0]?1:0,c=n.x.scale*r.x,f=n.y.scale*r.y;s[0+u]/=c,s[1+u]/=f;var d=Qu(c,f,.5);"number"===typeof s[2+u]&&(s[2+u]/=d),"number"===typeof s[3+u]&&(s[3+u]/=d);var p=l(s);if(i){var h=0;p=p.replace(Dp,(function(){var e=a[h];return h++,e}))}return p}}},Lp=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},t.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},t.isAnimating={x:!1,y:!1},t.stopAxisAnimation={x:void 0,y:void 0},t.isAnimatingTree=!1,t.animate=function(e,n,r){void 0===r&&(r={});var o=r.originBox,i=r.targetBox,a=r.visibilityAction,s=r.shouldStackAnimate,l=r.onComplete,u=r.prevParent,c=Ss(r,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),f=t.props,d=f.visualElement,p=f.layout;if(!1===s)return t.isAnimatingTree=!1,t.safeToRemove();if(!t.isAnimatingTree||!0===s){s&&(t.isAnimatingTree=!0),n=o||n,e=i||e;var h=!1,m=d.getProjectionParent();if(m){var v=m.prevViewportBox,g=m.getLayoutState().layout;u&&(i&&(g=u.getLayoutState().layout),o&&!Qd(u,m)&&u.prevViewportBox&&(v=u.prevViewportBox)),v&&Vp(u,o,i)&&(h=!0,n=Xd(v,n),e=Xd(g,e))}var y=Pp(n,e),b=Pd((function(r){var o,i;if("position"===p){var s=e[r].max-e[r].min;n[r].max=n[r].min+s}if(!d.projection.isTargetLocked)return void 0===a?y?t.animateAxis(r,e[r],n[r],Cs(Cs({},c),{isRelative:h})):(null===(i=(o=t.stopAxisAnimation)[r])||void 0===i||i.call(o),d.setProjectionTargetAxis(r,e[r].min,e[r].max,h)):void d.setVisibility(a===Op.Show)}));return d.syncRender(),Promise.all(b).then((function(){t.isAnimatingTree=!1,l&&l(),d.notifyLayoutAnimationComplete()}))}},t}return Os(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props.visualElement;t.animateMotionValue=Uf,t.enableLayoutProjection(),this.unsubLayoutReady=t.onLayoutUpdate(this.animate),t.layoutSafeToRemove=function(){return e.safeToRemove()},function(e){for(var t in e)il[t]=e[t]}(Tp)},t.prototype.componentWillUnmount=function(){var e=this;this.unsubLayoutReady(),Pd((function(t){var n,r;return null===(r=(n=e.stopAxisAnimation)[t])||void 0===r?void 0:r.call(n)}))},t.prototype.animateAxis=function(e,t,n,r){var o,i,a=this,s=void 0===r?{}:r,l=s.transition,u=s.isRelative;if(!this.isAnimating[e]||!Np(t,this.currentAnimationTarget[e])){null===(i=(o=this.stopAxisAnimation)[e])||void 0===i||i.call(o),this.isAnimating[e]=!0;var c=this.props.visualElement,f=this.frameTarget[e],d=c.getProjectionAnimationProgress()[e];d.clearListeners(),d.set(0),d.set(0);var p=function(){var r=d.get()/1e3;!function(e,t,n,r){e.min=Qu(t.min,n.min,r),e.max=Qu(t.max,n.max,r)}(f,n,t,r),c.setProjectionTargetAxis(e,f.min,f.max,u)};p();var h=d.onChange(p);this.stopAxisAnimation[e]=function(){a.isAnimating[e]=!1,d.stop(),h()},this.currentAnimationTarget[e]=t;var m=l||c.getDefaultTransition()||Fp;return Uf("x"===e?"layoutX":"layoutY",d,1e3,m&&Wf(m,"layout")).then(this.stopAxisAnimation[e])}},t.prototype.safeToRemove=function(){var e,t;null===(t=(e=this.props).safeToRemove)||void 0===t||t.call(e)},t.prototype.render=function(){return null},t}(Ca.Component);function Pp(e,t){return!Hp(e)&&!Hp(t)&&(!Np(e.x,t.x)||!Np(e.y,t.y))}var Rp={min:0,max:0};function Hp(e){return Np(e.x,Rp)&&Np(e.y,Rp)}function Np(e,t){return e.min===t.min&&e.max===t.max}var Fp={duration:.45,ease:[.4,0,.1,1]};function Vp(e,t,n){return e||!e&&!(t||n)}var zp={layoutReady:function(e){return e.notifyLayoutReady()}};function _p(){var e=new Set;return{add:function(t){return e.add(t)},flush:function(t){var n=void 0===t?zp:t,r=n.layoutReady,o=n.parent;mp((function(t,n){var i=Array.from(e).sort(Kd),a=o?Jd(o):[];n((function(){As(As([],js(a)),js(i)).forEach((function(e){return e.resetTransform()}))})),t((function(){i.forEach(Zd)})),n((function(){a.forEach((function(e){return e.restoreTransform()})),i.forEach(r)})),t((function(){i.forEach((function(e){e.isPresent&&(e.presence=xp.Present)}))})),n((function(){sf.preRender(),sf.render()})),t((function(){df.postRender((function(){return i.forEach(Bp)})),e.clear()}))})),vp()}}}function Bp(e){e.prevViewportBox=e.projection.target}var Ip=Object(Ca.createContext)(_p()),$p=Object(Ca.createContext)(_p());function qp(e){return!!e.forceUpdate}var Wp=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Os(t,e),t.prototype.componentDidMount=function(){var e=this.props,t=e.syncLayout,n=e.framerSyncLayout,r=e.visualElement;qp(t)&&t.register(r),qp(n)&&n.register(r),r.onUnmount((function(){qp(t)&&t.remove(r),qp(n)&&n.remove(r)}))},t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.syncLayout,n=e.visualElement;return qp(t)?t.syncUpdate():(!function(e){e.shouldResetTransform()||(e.prevViewportBox=e.measureViewportBox(!1),e.rebaseProjectionTarget(!1,e.prevViewportBox))}(n),t.add(n)),null},t.prototype.componentDidUpdate=function(){var e=this.props.syncLayout;qp(e)||e.flush()},t.prototype.render=function(){return null},t}(Sa.a.Component);var Up={measureLayout:function(e){var t=Object(Ca.useContext)(Ip),n=Object(Ca.useContext)($p);return Sa.a.createElement(Wp,Cs({},e,{syncLayout:t,framerSyncLayout:n}))},layoutAnimation:function(e){var t=js(Fs(),2)[1];return Ca.createElement(Lp,Cs({},e,{safeToRemove:t}))}};function Kp(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Ld(),deltaFinal:Ld(),deltaTransform:""}}var Gp=Kp();function Jp(e,t,n){var r=e.x,o=e.y,i="translate3d("+r.translate/t.x+"px, "+o.translate/t.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(i+="rotate("+a+") "),s&&(i+="rotateX("+s+") "),l&&(i+="rotateY("+l+") ")}return i+="scale("+r.scale+", "+o.scale+")",n||i!==Yp?i:""}function Zp(e){var t=e.deltaFinal;return 100*t.x.origin+"% "+100*t.y.origin+"% 0"}var Yp=Jp(Gp.delta,Gp.treeScale,{x:1,y:1}),Xp=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Qp(e,t,n,r){var o,i,a=e.delta,s=e.layout,l=e.layoutCorrected,u=e.treeScale,c=t.target;i=s,tp((o=l).x,i.x),tp(o.y,i.y),function(e,t,n){var r=n.length;if(r){var o,i;t.x=t.y=1;for(var a=0;a=0;t--){var n=U.path[t];if(n.projection.isEnabled){e=n;break}}w=e}return w},resolveRelativeTargetBox:function(){var e=U.getProjectionParent();if(E.relativeTarget&&e&&(function(e,t){Ud(e.target.x,e.relativeTarget.x,t.target.x),Ud(e.target.y,e.relativeTarget.y,t.target.y)}(E,e.projection),ep(e))){var t=E.target;up(t,t,e.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(e){D=e.projection,M=e.getLatestValues(),null===k||void 0===k||k(),k=zu(e.onSetAxisTarget(U.scheduleUpdateLayoutProjection),e.onLayoutAnimationComplete((function(){var e;U.isPresent?U.presence=xp.Present:null===(e=U.layoutSafeToRemove)||void 0===e||e.call(U)})))},isPresent:!0,presence:xp.Entering});return U}};function nh(e){e.resolveRelativeTargetBox()}function rh(e){e.updateLayoutProjection()}var oh,ih=As(["initial"],js(dd)),ah=ih.length,sh=new Set(["width","height","top","left","right","bottom","x","y"]),lh=function(e){return sh.has(e)},uh=function(e,t){e.set(t,!1),e.set(t)},ch=function(e){return e===Tl||e===Al};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(oh||(oh={}));var fh=function(e,t){return parseFloat(e.split(", ")[t])},dh=function(e,t){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var i=o.match(/^matrix3d\((.+)\)$/);if(i)return fh(i[1],t);var a=o.match(/^matrix\((.+)\)$/);return a?fh(a[1],e):0}},ph=new Set(["x","y","z"]),hh=sl.filter((function(e){return!ph.has(e)}));var mh={width:function(e){var t=e.x;return t.max-t.min},height:function(e){var t=e.y;return t.max-t.min},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.y,r=t.top;return parseFloat(r)+(n.max-n.min)},right:function(e,t){var n=e.x,r=t.left;return parseFloat(r)+(n.max-n.min)},x:dh(4,13),y:dh(5,14)},vh=function(e,t,n,r){void 0===n&&(n={}),void 0===r&&(r={}),t=Cs({},t),r=Cs({},r);var o=Object.keys(t).filter(lh),i=[],a=!1,s=[];if(o.forEach((function(o){var l=e.getValue(o);if(e.hasValue(o)){var u,c=n[o],f=t[o],d=ed(c);if(su(f))for(var p=f.length,h=null===f[0]?1:0;h=500)null===i||void 0===i||i();else{var n=30*h.current.offsetHeight/100;m.get()>=n?y():g.start({transition:Lh,y:0})}},dragConstraints:{top:0,bottom:0},dragMomentum:!1,dragElastic:!1,sx:{bg:"transparent",alignItems:"center",justifyContent:"center",p:2}},{children:Object(Oa.jsx)(ns.Box,{id:"pill",sx:{backgroundColor:"hover",width:60,height:8,borderRadius:100}})})),Object(Oa.jsx)(Rh,Object.assign({items:o,title:r,onClose:i},{children:d}))]}))})):null}function Rh(e){var t,n=e.title,r=e.items,o=e.onClose,i=e.children,a=function(e){var t=Object(Ca.useState)(e),n=Object(u.a)(t,2),r=n[0],o=n[1],i=Object(Ca.useState)(!1),a=Object(u.a)(i,2),s=a[0],l=a[1],c=Object(Ca.useRef)([e]);return{current:r,goBack:Object(Ca.useCallback)((function(){if(s){var e=c.current.pop();o(e),c.current.length<=1&&l(!1)}}),[s]),navigate:Object(Ca.useCallback)((function(e){console.log("NAVI",e),o((function(t){return t&&c.current.push(t),e})),l(!0)}),[]),canGoBack:s}}({title:n,items:r}),s=a.current,l=a.goBack,c=a.canGoBack,f=a.navigate;return Object(Oa.jsxs)(ns.Flex,Object.assign({sx:{flexDirection:"column"}},{children:[c||(null===s||void 0===s?void 0:s.title)?Object(Oa.jsxs)(ns.Flex,Object.assign({id:"header",sx:{alignItems:"center",mx:0,mb:1}},{children:[c&&Object(Oa.jsx)(as,Object.assign({variant:"icon",sx:{p:1,ml:1},onClick:l},{children:Object(Oa.jsx)(ds,{path:ps.arrowLeft,size:"big"})})),(null===s||void 0===s?void 0:s.title)&&Object(Oa.jsx)(is,Object.assign({variant:"title",sx:{ml:1,fontSize:"title"}},{children:null===s||void 0===s?void 0:s.title}))]})):null,i||(null===(t=null===s||void 0===s?void 0:s.items)||void 0===t?void 0:t.map((function(e){if(e.isHidden)return null;switch(e.type){case"separator":return Object(Oa.jsx)(bs,{},e.key);case"button":return Object(Oa.jsx)(ys,{item:e,onClick:function(t){e.menu?f(e.menu):e.onClick&&(null===o||void 0===o||o(),setTimeout((function(){var t;null===(t=e.onClick)||void 0===t||t.call(e)}),300))}},e.key);case"popup":return Object(Oa.jsx)(Sa.a.Fragment,{children:Object(Oa.jsx)(e.component,{onClick:o})},e.key)}})))]}))}var Hh={x:0,y:0,actualX:0,actualY:0};function Nh(e,t){var n=t||{},r=n.target,o=void 0===r?"mouse":r,i=n.isTargetAbsolute,a=void 0!==i&&i,s=n.location,l=void 0===s?void 0:s,u=n.yOffset,c=void 0===u?0:u,f=n.xOffset,d=void 0===f?0:f,p=n.align,h=void 0===p?"start":p,m=n.parent,v=void 0===m?document.body:m,g=n.yAnchor,y="mouse"===o?Hh:Fh(o,a),b=y.x,w=y.y,k=y.width,x=y.height,O=y.actualX,C=y.actualY,S=e.offsetWidth,j=e.offsetHeight,A=v.clientWidth,E=v.clientHeight,D={top:0,left:0};if(A-OE?E-j:w,x&&("below"===l?D.top+=x:"top"===l&&(D.top=w-j)),k&&"mouse"!==o&&"center"===h&&S>0?D.left-=(S-k)/2:k&&"mouse"!==o&&"end"===h&&S>0&&(D.left-=S-k),j>E-D.top&&(e.style.maxHeight="".concat(E-20,"px")),g){var T=Fh(g,a);D.top=T.y-j}return D.top=a&&D.top<0?0:D.top,D.left=a&&D.left<0?0:D.left,D.top+="below"===l?c:-c,D.left+=d,D}function Fh(e,t){var n=e.getBoundingClientRect(),r={x:e.offsetLeft,y:e.offsetTop,width:n.width,height:n.height,actualY:n.y,actualX:n.x};return t&&(r.x=r.actualX,r.y=r.actualY),r}function Vh(e,t,n){var r=Object(Ca.useState)(-1),o=Object(u.a)(r,2),i=o[0],a=o[1],s=Object(Ca.useState)(!1),l=Object(u.a)(s,2),c=l[0],f=l[1],d=Object(Ca.useCallback)((function(t){var n=e[t];if(n){var r=document.getElementById(n.key);r&&r.scrollIntoView({behavior:"auto"})}}),[e]),p=Object(Ca.useCallback)((function(r){var o=function(t){return e[t]},i=function(t){var n,r;return e&&("separator"===(null===(n=e[t])||void 0===n?void 0:n.type)||(null===(r=o(t))||void 0===r?void 0:r.isDisabled))},s=function(t){return t0?--t:e.length-1},u=function(t){return e&&o(t).menu};a((function(e){var o=e;switch(r.key){case"ArrowUp":if(c)break;for(o=l(e);i(o);)o=l(o);break;case"ArrowDown":if(c)break;for(o=s(e);i(o);)o=s(o);break;case"ArrowRight":u(e)&&f(!0);break;case"ArrowLeft":!function(e){u(e)&&f(!1)}(e);break;case"Enter":t&&t(r);break;case"Escape":n&&n(r)}return o!==e&&d(o),o}))}),[e,c,d,t]);return Object(Ca.useEffect)((function(){return window.addEventListener("keydown",p),function(){window.removeEventListener("keydown",p)}}),[p]),{focusIndex:i,setFocusIndex:a,isSubmenuOpen:c,setIsSubmenuOpen:f}}function zh(){return document.querySelector(".editor-toolbar")||void 0}function _h(){return document.getElementById("popup-container")||void 0}window.addEventListener("mousemove",(function(e){var t=function(e){var t=0,n=0;!e&&window.event&&(e=window.event);e.pageX||e.pageY?(t=e.pageX,n=e.pageY):(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=e.clientY+document.body.scrollTop+document.documentElement.scrollTop);return{x:t,y:n,actualY:n,actualX:t}}(e),n=t.x,r=t.y,o=t.actualX,i=t.actualY;Hh.x=n,Hh.y=r,Hh.actualX=o,Hh.actualY=i}));var Bh=Sa.a.createContext(null),Ih=Sa.a.createContext(null),$h=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){var e;return Object(c.a)(this,n),(e=t.apply(this,arguments)).popupContainer=null,e.state={popups:[]},e.openPopup=function(t,n){n&&e.setState((function(e){return{popups:[].concat(Object(l.a)(e.popups),[{id:t,popup:n}])}}))},e.closePopup=function(t){e.setState((function(e){var n=e.popups.findIndex((function(e){return e.id===t}));if(n<=-1)return e;var r=e.popups.slice();return r.splice(n,1),{popups:r}}))},e}return Object(f.a)(n,[{key:"render",value:function(){return Object(Oa.jsxs)(Bh.Provider,Object.assign({value:this},{children:[this.props.children,Object(Oa.jsxs)(Ih.Provider,Object.assign({value:this.props.editor},{children:[this.state.popups.map((function(e){var t=e.id,n=e.popup;return Object(Oa.jsx)(n,{id:t},t)})),Object(Oa.jsx)("div",{id:"popup-container"})]}))]}))}}]),n}(Sa.a.Component);var qh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0){var a=document.body.clientHeight-20;i+o>a&&(e.style.top=a-o+"px")}t=o}})),f.current.observe(e,{box:"border-box"})}}),[u]);return Object(Oa.jsx)(ks.a,Object.assign({contentRef:function(e){return c.current=e},className:"popup-presenter",role:"menu",isOpen:t,appElement:document.body,shouldCloseOnEsc:!0,shouldReturnFocusAfterClose:!0,shouldCloseOnOverlayClick:!0,shouldFocusAfterRender:s,ariaHideApp:i,preventScroll:i,onRequestClose:r,portalClassName:"popup-presenter-portal",onAfterOpen:function(e){e&&n&&(d(),h(),p())},onAfterClose:function(){var e;return null===(e=f.current)||void 0===e?void 0:e.disconnect()},overlayElement:function(e,t){return Object(Oa.jsx)(ns.Box,Object.assign({},e,{style:Object.assign(Object.assign({},e.style),{position:i?"fixed":"initial",zIndex:1e3,backgroundColor:i?"unset":"transparent"})},{children:t}))},contentElement:function(e,t){return Object(Oa.jsx)(ns.Box,Object.assign({},e,{style:{},sx:{top:0,left:0,right:0,bottom:0,display:"flex",width:"fit-content",height:"fit-content",position:"fixed",backgroundColor:void 0,padding:0,zIndex:0,outline:0,isolation:"isolate"}},{children:t}))},style:{content:{},overlay:{zIndex:999,background:"transparent"}}},{children:l}))}function Uh(e){return e.isOpen?Object(Oa.jsx)(Wh,Object.assign({},e)):null}function Kh(e){var t=e.id,n=(e.group,e.position),r=e.renderPopup,o=(e.isOpen,e.onClosed,e.autoCloseOnUnmount),i=qh(e,["id","group","position","renderPopup","isOpen","onClosed","autoCloseOnUnmount"]),a=Object(Ca.useContext)(Bh),s=Gh(e),l=s.closePopup,u=s.isPopupOpen;return Object(Ca.useEffect)((function(){if(o)return function(){null===a||void 0===a||a.closePopup(t)}}),[o,t,a]),Object(Ca.useEffect)((function(){a&&u&&a.openPopup(t,(function(e){var t=e.id,o=Pa((function(e){return!!e.openedPopups[t]}));return Object(Ca.useEffect)((function(){o||a.closePopup(t)}),[o]),Object(Oa.jsx)(Uh,Object.assign({isOpen:o,onClose:function(){return l(t)},position:n,blocking:!0,focusOnRender:!0},i,{children:Object(Oa.jsx)(ns.Box,Object.assign({sx:{boxShadow:"menu",borderRadius:"default",overflow:"hidden"}},{children:Object(Oa.jsx)(Ih.Consumer,{children:function(){return r((function(){return a.closePopup(t)}))}})}))}),t)}))}),[a,u]),null}function Gh(e){var t=e.group,n=e.isOpen,r=e.id,o=e.onClosed,i=Pa((function(e){return!!e.openedPopups[r]})),a=Pa((function(e){return e.openPopup})),s=Pa((function(e){return e.closePopup})),l=Pa((function(e){return e.closePopupGroup}));return Pa((function(e){return"bottom"===e.toolbarLocation}))&&(t="popup"),Object(Ca.useEffect)((function(){n?a({id:r,group:t}):s(r)}),[n,r,t,a,s]),Object(Ca.useEffect)((function(){i||null===o||void 0===o||o()}),[i]),Object(Ca.useEffect)((function(){i&&l(t,[r])}),[o,i,l,r,t]),Object(Ca.useEffect)((function(){n||s(r)}),[n,r,t,s]),{isPopupOpen:i,closePopup:s}}function Jh(e){var t=e.popup,n=qh(e,["popup"]);function r(){Ba.a.unmountComponentAtNode(_h())}return Ba.a.render(Object(Oa.jsx)(Fa,{children:Object(Oa.jsx)(om,Object.assign({isOpen:!0,position:{target:zh(),isTargetAbsolute:!0,location:"below",align:"end",yOffset:10},blocking:!0,focusOnRender:!0},n,{onClose:function(){var e;r(),null===(e=n.onClose)||void 0===e||e.call(n)}},{children:t(r)}))}),_h()),r}var Zh=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var dm,pm,hm,mm,vm=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),c}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}var ov=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function s(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function iv(e){var t=this,n=e.onInsert,r=e.onClose,o=Object(Ca.useState)(!1),i=Object(u.a)(o,2),a=i[0],s=i[1],l=Object(Ca.useState)(),c=Object(u.a)(l,2),f=c[0],d=c[1],p=Object(Ca.useState)(""),h=Object(u.a)(p,2),m=h[0],v=h[1];return Object(Oa.jsx)(im,Object.assign({title:"Insert image from URL",onClose:r,action:{loading:a,title:"Insert image",disabled:!m,onClick:function(){return ov(t,void 0,void 0,rv().mark((function e(){var t,r,o,i,a;return rv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),d(void 0),e.prev=2,e.next=5,fetch(m);case 5:if((t=e.sent).ok){e.next=8;break}return e.abrupt("return",d("invalid status code ".concat(t.status)));case 8:if(r=t.headers.get("Content-Type"),o=t.headers.get("Content-Length"),r&&o&&"0"!==o&&r.startsWith("image/")){e.next=12;break}return e.abrupt("return",d("not an image"));case 12:return i=parseInt(o),e.t0=av,e.next=16,t.blob();case 16:return e.t1=e.sent,e.next=19,(0,e.t0)(e.t1);case 19:a=e.sent,n({src:a,type:r,size:i}),e.next=26;break;case 23:e.prev=23,e.t2=e.catch(2),e.t2 instanceof Error&&d(e.t2.message);case 26:return e.prev=26,s(!1),e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[2,23,26,29]])})))}}},{children:Object(Oa.jsxs)(ns.Flex,Object.assign({sx:{px:1,flexDirection:"column",width:["auto",350]}},{children:[Object(Oa.jsx)(Sm,{type:"url",autoFocus:!0,placeholder:"Paste Image URL here",value:m,onChange:function(e){v(e.target.value),d(void 0)}}),f?Object(Oa.jsxs)(is,Object.assign({variant:"error",sx:{bg:"errorBg",mt:1,p:1,borderRadius:"default"}},{children:["Failed to download image: ",f.toLowerCase(),"."]})):Object(Oa.jsx)(is,Object.assign({variant:"subBody",sx:{bg:"shade",color:"primary",mt:1,p:1,borderRadius:"default"}},{children:"To protect your privacy, we will download the image & add it to your attachments."}))]}))}))}function av(e){return new Promise((function(t,n){var r=new FileReader;r.onload=function(e){return t(r.result)},r.onerror=function(e){return n(r.error)},r.onabort=function(e){return n(new Error("Read aborted"))},r.readAsDataURL(e)}))}var sv=function(e){return{key:"hr",type:"button",title:"Horizontal rule",icon:"horizontalRule",isChecked:null===e||void 0===e?void 0:e.isActive("horizontalRule"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().setHorizontalRule().run()}}},lv=function(e){return{key:"codeblock",type:"button",title:"Code block",icon:"codeblock",isChecked:null===e||void 0===e?void 0:e.isActive("codeBlock"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleCodeBlock().run()}}},uv=function(e){return{key:"blockquote",type:"button",title:"Quote",icon:"blockquote",isChecked:null===e||void 0===e?void 0:e.isActive("blockQuote"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleBlockquote().run()}}},cv=function(e){return{key:"math",type:"button",title:"Math & formulas",icon:"mathBlock",isChecked:null===e||void 0===e?void 0:e.isActive("mathBlock"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().insertMathBlock().run()}}},fv=function(e,t){return{key:"image",type:"button",title:"Image",icon:"image",menu:{title:"Insert an image",items:[{key:"upload-from-disk",type:"button",title:"Upload from disk",icon:"upload",onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("image").run()}},{key:"camera",type:"button",title:"Take a photo using camera",icon:"camera",isHidden:!t,onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("camera").run()}},t?yv(e):bv(e)]}}},dv=function(e){return{key:"table",type:"button",title:"Table",icon:"table",menu:{title:"Insert a table",items:[{key:"table-size-selector",type:"popup",component:function(t){return Object(Oa.jsx)(Qm,{onInsertTable:function(n){var r,o;null===(r=e.current)||void 0===r||r.chain().focus().insertTable({rows:n.rows,cols:n.columns}).run(),null===(o=t.onClick)||void 0===o||o.call(t)}})}}]}}},pv=function(e){return{key:"embed",type:"button",title:"Embed",icon:"embed",menu:{title:"Insert an embed",items:[{key:"embed-popup",type:"popup",component:function(t){var n=t.onClick;return Object(Oa.jsx)(Ym,{title:"Insert embed",onClose:function(t){var r;if(!t)return null===n||void 0===n?void 0:n();null===(r=e.current)||void 0===r||r.chain().insertEmbed(t).run(),null===n||void 0===n||n()}})}}]}}},hv=function(e){return{key:"embed",type:"button",title:"Embed",icon:"embed",onClick:function(){e&&Jh({popup:function(t){return Object(Oa.jsx)(Ym,{title:"Insert embed",onClose:function(n){var r;if(!n)return t();null===(r=e.current)||void 0===r||r.chain().insertEmbed(n).run(),t()}})}})}}},mv=function(e){return{key:"attachment",type:"button",title:"Attachment",icon:"attachment",isChecked:null===e||void 0===e?void 0:e.isActive("attachment"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().openAttachmentPicker("file").run()}}},vv=function(e){return{key:"tasklist",type:"button",title:"Task list",icon:"checkbox",isChecked:null===e||void 0===e?void 0:e.isActive("taskList"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleTaskList().run()}}},gv=function(e){return{key:"outlinelist",type:"button",title:"Outline list",icon:"outlineList",isChecked:null===e||void 0===e?void 0:e.isActive("outlineList"),onClick:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.chain().focus().toggleOutlineList().run()}}},yv=function(e){return{key:"upload-from-url",type:"button",title:"Attach from URL",icon:"link",menu:{title:"Attach image from URL",items:[{key:"attach-image",type:"popup",component:function(t){var n=t.onClick;return Object(Oa.jsx)(iv,{onInsert:function(t){var r;null===(r=e.requestPermission("insertImage"))||void 0===r||r.chain().focus().insertImage(t).run(),null===n||void 0===n||n()},onClose:function(){null===n||void 0===n||n()}})}}]}}},bv=function(e){return{key:"upload-from-url",type:"button",title:"Attach from URL",icon:"link",onClick:function(){Jh({popup:function(t){return Object(Oa.jsx)(iv,{onInsert:function(n){var r;null===(r=e.requestPermission("insertImage"))||void 0===r||r.chain().focus().insertImage(n).run(),t()},onClose:t})}})}}};function wv(e){var t=e.id,n=e.group,r=e.items,o=e.selectedItem,i=e.buttonRef,a=e.menuWidth,s=Object(Ca.useRef)(),l=Object(Ca.useState)(!1),c=Object(u.a)(l,2),f=c[0],d=c[1],p=Ra(),h=Ha(),m="bottom"===p,v=Gh({group:n,id:t,isOpen:f,onClosed:function(){return d(!1)}}),g=v.closePopup,y=v.isPopupOpen;return Object(Oa.jsxs)(Oa.Fragment,{children:[Object(Oa.jsxs)(ms,Object.assign({ref:function(e){s.current=e,i&&(i.current=e||void 0)},sx:{p:1,m:0,bg:y?"hover":"transparent",mr:1,display:"flex",alignItems:"center",":hover":{bg:"hover"},":last-of-type":{mr:0}},onClick:function(){return d((function(e){return!e}))},onMouseDown:function(e){return e.preventDefault()}},{children:["string"===typeof o?Object(Oa.jsx)(is,Object.assign({sx:{fontSize:"subBody",mr:1,color:"text"}},{children:o})):o,Object(Oa.jsx)(ds,{path:m?ps.chevronUp:ps.chevronDown,size:"small",color:"text"})]})),Object(Oa.jsx)(Qh,{isOpen:y,items:r,onClose:function(){return g(t)},position:{target:m?zh():s.current||"mouse",isTargetAbsolute:!0,location:m?"top":"below",align:"center",yOffset:5},blocking:!h,focusOnRender:!h,sx:{minWidth:a,maxWidth:m?"95vw":"auto",flexDirection:m?"row":"column",overflowX:m?"auto":"hidden",marginRight:m?"10px":0,display:"flex",alignItems:m?"center":"unset",mr:m?0:2}})]})}var kv=Sa.a.memo((function(e){var t=e.title,n=e.onDecrease,r=e.onIncrease,o=e.onReset,i=e.value;return Object(Oa.jsxs)(ns.Flex,Object.assign({sx:{alignItems:"center",mr:1,":last-of-type":{mr:0}}},{children:[Object(Oa.jsx)(gs,{toggled:!1,title:"Decrease ".concat(t),icon:"minus",variant:"small",onClick:n}),Object(Oa.jsx)(ms,Object.assign({sx:{color:"text",bg:"transparent",px:0,fontSize:"subBody",mx:1,textAlign:"center",":hover":{bg:"transparent"}},onClick:o,title:"Reset ".concat(t)},{children:i})),Object(Oa.jsx)(gs,{toggled:!1,title:"Increase ".concat(t),icon:"plus",variant:"small",onClick:r})]}))}),(function(e,t){return e.value===t.value}));function xv(e){var t=Object(Ca.useRef)(e);return Object(Ca.useEffect)((function(){t.current=e}),[e]),t}var Ov={"Sans-serif":"Open Sans",Serif:"serif",Monospace:"monospace"};var Cv=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=0||(o[n]=e[n]);return o}function qv(e){var t=Object(Ca.useRef)(e),n=Object(Ca.useRef)((function(e){t.current&&t.current(e)}));return t.current=e,n.current}var Wv=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e0:e.buttons>0)&&o.current?i(Gv(o.current,e,s.current)):n(!1)},t=function(){return n(!1)};function n(n){var r=l.current,i=Kv(o.current),a=n?i.addEventListener:i.removeEventListener;a(r?"touchmove":"mousemove",e),a(r?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,r=o.current;if(r&&(Jv(t),!function(e,t){return t&&!Uv(e)}(t,l.current)&&r)){if(Uv(t)){l.current=!0;var a=t.changedTouches||[];a.length&&(s.current=a[0].identifier)}r.focus(),i(Gv(r,t,s.current)),n(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),a({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},n]}),[a,i]),c=u[0],f=u[1],d=u[2];return Object(Ca.useEffect)((function(){return d}),[d]),Sa.a.createElement("div",Iv({},r,{onTouchStart:c,onMouseDown:c,className:"react-colorful__interactive",ref:o,onKeyDown:f,tabIndex:0,role:"slider"}))})),Yv=function(e){return e.filter(Boolean).join(" ")},Xv=function(e){var t=e.color,n=e.left,r=e.top,o=void 0===r?.5:r,i=Yv(["react-colorful__pointer",e.className]);return Sa.a.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},Sa.a.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},Qv=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n},eg=(Math.PI,function(e){return"#"===e[0]&&(e=e.substr(1)),e.length<6?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:1}:{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:1}}),tg=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:Qv(e.h),s:Qv(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:Qv(o/2),a:Qv(r,2)}},ng=function(e){var t=tg(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},rg=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),u=i%6;return{r:Qv(255*[r,s,a,a,l,r][u]),g:Qv(255*[l,r,r,s,a,a][u]),b:Qv(255*[a,a,l,r,r,s][u]),a:Qv(o,2)}},og=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},ig=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:Qv(60*(s<0?s+6:s)),s:Qv(i?a/i*100:0),v:Qv(i/255*100),a:o}},ag=Sa.a.memo((function(e){var t=e.hue,n=e.onChange,r=Yv(["react-colorful__hue",e.className]);return Sa.a.createElement("div",{className:r},Sa.a.createElement(Zv,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Wv(t+360*e.left,0,360)})},"aria-label":"Hue","aria-valuetext":Qv(t)},Sa.a.createElement(Xv,{className:"react-colorful__hue-pointer",left:t/360,color:ng({h:t,s:100,v:100,a:1})})))})),sg=Sa.a.memo((function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:ng({h:t.h,s:100,v:100,a:1})};return Sa.a.createElement("div",{className:"react-colorful__saturation",style:r},Sa.a.createElement(Zv,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Wv(t.s+100*e.left,0,100),v:Wv(t.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+Qv(t.s)+"%, Brightness "+Qv(t.v)+"%"},Sa.a.createElement(Xv,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:ng(t)})))})),lg=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function ug(e,t,n){var r=qv(n),o=Object(Ca.useState)((function(){return e.toHsva(t)})),i=o[0],a=o[1],s=Object(Ca.useRef)({color:t,hsva:i});Object(Ca.useEffect)((function(){if(!e.equal(t,s.current.color)){var n=e.toHsva(t);s.current={hsva:n,color:t},a(n)}}),[t,e]),Object(Ca.useEffect)((function(){var t;lg(i,s.current.hsva)||e.equal(t=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:t},r(t))}),[i,e,r]);var l=Object(Ca.useCallback)((function(e){a((function(t){return Object.assign({},t,e)}))}),[]);return[i,l]}var cg,fg="undefined"!=typeof window?Ca.useLayoutEffect:Ca.useEffect,dg=new Map,pg=function(e){fg((function(){var t=e.current?e.current.ownerDocument:document;if(void 0!==t&&!dg.has(t)){var r=t.createElement("style");r.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',dg.set(t,r);var o=cg||n.nc;o&&r.setAttribute("nonce",o),t.head.appendChild(r)}}),[])},hg=function(e){var t=e.className,n=e.colorModel,r=e.color,o=void 0===r?n.defaultColor:r,i=e.onChange,a=$v(e,["className","colorModel","color","onChange"]),s=Object(Ca.useRef)(null);pg(s);var l=ug(n,o,i),u=l[0],c=l[1],f=Yv(["react-colorful",t]);return Sa.a.createElement("div",Iv({},a,{ref:s,className:f}),Sa.a.createElement(sg,{hsva:u,onChange:c}),Sa.a.createElement(ag,{hue:u.h,onChange:c,className:"react-colorful__last-control"}))},mg={defaultColor:"000",toHsva:function(e){return ig(eg(e))},fromHsva:function(e){return n=(t=rg(e)).g,r=t.b,"#"+og(t.r)+og(n)+og(r);var t,n,r},equal:function(e,t){return e.toLowerCase()===t.toLowerCase()||lg(eg(e),eg(t))}},vg=function(e){return Sa.a.createElement(hg,Iv({},e,{colorModel:mg}))};var gg=["#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#f44336"],yg=[35,35,25];function bg(e){var t=e.colors,n=void 0===t?gg:t,r=e.color,o=e.onClear,i=e.onChange,a=e.title,s=e.onClose,l=e.expanded,c=Object(Ca.useRef)(),f=Object(Ca.useState)(l||!1),d=Object(u.a)(f,2),p=d[0],h=d[1],m=Object(Ca.useState)(_v()(r||n[0]).toHexString()),v=Object(u.a)(m,2),g=v[0],y=v[1],b=_v()(g);Object(Ca.useEffect)((function(){c.current&&p&&c.current.focus({preventScroll:!0})}),[p]);var w=Object(Ca.useCallback)(function(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),i=0;ir&&(i+=u.attrs.colspan)}for(var c=0;c1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,a=[],s=0,l=t*n;s=n){(i||(i=[])).push({type:"overlong_rowspan",pos:c,n:v-y});break}for(var b=o+y*t,w=0;w0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function Pg(e){for(var t=e.selection.$head,n=t.depth;n>0;n--)if("row"==t.node(n).type.spec.tableRole)return!0;return!1}function Rg(e){var t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:Lg(t.$head)||function(e){for(var t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){var r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(var o=e.nodeBefore,i=e.pos;o;o=o.lastChild,i--){var a=o.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(i-o.nodeSize)}}(t.$head)}function Hg(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function Ng(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function Fg(e,t,n){var r=e.start(-1),o=Eg.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function Vg(e,t,n){var r={};for(var o in e)r[o]=e[o];return r[t]=n,r}function zg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=Vg(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some((function(e){return e>0}))||(r.colwidth=null)),r}function _g(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=Vg(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:e;Object(c.a)(this,n);var i=e.node(-1),a=Eg.get(i),s=e.start(-1),l=a.rectBetween(e.pos-s,o.pos-s),u=e.node(0),f=a.cellsInRect(l).filter((function(e){return e!=o.pos-s}));f.unshift(o.pos-s);var d=f.map((function(e){var t=i.nodeAt(e),n=e+s+1;return new p.SelectionRange(u.resolve(n),u.resolve(n+t.content.size))}));return(r=t.call(this,d[0].$from,d[0].$to,d)).$anchorCell=e,r.$headCell=o,r}return Object(f.a)(n,[{key:"map",value:function(e,t){var r=e.resolve(t.map(this.$anchorCell.pos)),o=e.resolve(t.map(this.$headCell.pos));if(Hg(r)&&Hg(o)&&Ng(r,o)){var i=this.$anchorCell.node(-1)!=r.node(-1);return i&&this.isRowSelection()?n.rowSelection(r,o):i&&this.isColSelection()?n.colSelection(r,o):new n(r,o)}return p.TextSelection.between(r,o)}},{key:"content",value:function(){for(var e=this.$anchorCell.node(-1),t=Eg.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[],a=r.top;a0||h>0){var m=d.attrs;p>0&&(m=zg(m,0,p)),h>0&&(m=zg(m,m.colspan-h,h)),d=f.leftr.bottom){var g=Vg(d.attrs,"rowspan",Math.min(f.bottom,r.bottom)-Math.max(f.top,r.top));d=f.top1&&void 0!==arguments[1]?arguments[1]:v.Slice.empty,n=e.steps.length,r=this.ranges,o=0;o0)return!1;var n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}},{key:"isRowSelection",value:function(){var e=Eg.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;var o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width}},{key:"eq",value:function(e){return e instanceof n&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}},{key:"toJSON",value:function(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}},{key:"getBookmark",value:function(){return new Ig(this.$anchorCell.pos,this.$headCell.pos)}}],[{key:"colSelection",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=Eg.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(t.pos-o),s=e.node(0);return i.top<=a.top?(i.top>0&&(e=s.resolve(o+r.map[i.left])),a.bottom0&&(t=s.resolve(o+r.map[a.left])),i.bottom1&&void 0!==arguments[1]?arguments[1]:e,r=Eg.get(e.node(-1)),o=e.start(-1),i=r.findCell(e.pos-o),a=r.findCell(t.pos-o),s=e.node(0);return i.left<=a.left?(i.left>0&&(e=s.resolve(o+r.map[i.top*r.width])),a.right0&&(t=s.resolve(o+r.map[a.top*r.width])),i.right2&&void 0!==arguments[2]?arguments[2]:t;return new n(e.resolve(t),e.resolve(r))}}]),n}(p.Selection);Bg.prototype.visible=!1,p.Selection.jsonID("cell",Bg);var Ig=function(){function e(t,n){Object(c.a)(this,e),this.anchor=t,this.head=n}return Object(f.a)(e,[{key:"map",value:function(t){return new e(t.map(this.anchor),t.map(this.head))}},{key:"resolve",value:function(e){var t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()=0&&!(t.after(i+1)=0&&!(n.before(a+1)>n.start(a));a--,o--);return r==o&&/row|table/.test(t.node(i).type.spec.tableRole)}(i)?r=p.TextSelection.create(a,i.from):i instanceof p.TextSelection&&function(e){for(var t,n,r=e.$from,o=e.$to,i=r.depth;i>0;i--){var a=r.node(i);if("cell"===a.type.spec.tableRole||"header_cell"===a.type.spec.tableRole){t=a;break}}for(var s=o.depth;s>0;s--){var l=o.node(s);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){n=l;break}}return t!==n&&0===o.parentOffset}(i)&&(r=p.TextSelection.create(a,i.$from.start(),i.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}function Wg(e){if(!e.size)return null;for(var t=e.content,n=e.openStart,r=e.openEnd;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;var o=t.firstChild,i=o.type.spec.tableRole,a=o.type.schema,s=[];if("row"==i)for(var l=0;l=0;i--)for(var a=o.child(i).attrs,s=a.rowspan,l=a.colspan,u=r;u=t.length&&t.push(v.Fragment.empty),n[d]t.width)for(var c=0,f=0;ct.height){for(var g=[],y=0,b=(t.height-1)*t.width;y=t.width)&&n.nodeAt(t.map[b+y]).type==u.header_cell;g.push(w?l||(l=u.header_cell.createAndFill()):s||(s=u.cell.createAndFill()))}for(var k=u.row.create(null,v.Fragment.from(g)),x=[],O=t.height;Ot&&(p=p.type.create(zg(p.attrs,p.attrs.colspan,f+p.attrs.colspan-t),p.content)),c.push(p),f+=p.attrs.colspan;for(var h=1;hn&&(x=x.type.create(Vg(x.attrs,"rowspan",Math.max(1,n-x.attrs.rowspan)),x.content)),b.push(x)}m.push(v.Fragment.from(b))}i=m,o=n}return{width:r,height:o,rows:i}}(r,s.right-s.left,s.bottom-s.top),Jg(e.state,e.dispatch,a,s,r),!0}if(r){var l=Rg(e.state),u=l.start(-1);return Jg(e.state,e.dispatch,u,Eg.get(l.node(-1)).findCell(l.pos-u),r),!0}return!1}function ry(e,t){if(!t.ctrlKey&&!t.metaKey){var n,r=iy(e,t.target);if(t.shiftKey&&e.state.selection instanceof Bg)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=Lg(e.state.selection.$anchor))&&ay(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",a)}function o(t,n){var r=ay(e,n),o=null==Tg.getState(e.state);if(!r||!Ng(t,r)){if(!o)return;r=t}var i=new Bg(t,r);if(o||!e.state.selection.eq(i)){var a=e.state.tr.setSelection(i);o&&a.setMeta(Tg,t.pos),e.dispatch(a)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",a),null!=Tg.getState(e.state)&&e.dispatch(e.state.tr.setMeta(Tg,-1))}function a(n){var a,s=Tg.getState(e.state);if(null!=s)a=e.state.doc.resolve(s);else if(iy(e,n.target)!=r&&!(a=ay(e,t)))return i();a&&o(a,n)}}function oy(e,t,n){if(!(e.state.selection instanceof p.TextSelection))return null;for(var r=e.state.selection.$head,o=r.depth-1;o>=0;o--){var i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){var a=r.before(o),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?a:null}}return null}function iy(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function ay(e,t){var n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?Lg(e.state.doc.resolve(n.pos)):null}var sy=new p.PluginKey("fix-tables");function ly(e,t,n,r){var o=e.childCount,i=t.childCount;e:for(var a=0,s=0;a0){var k="cell";y.firstChild&&(k=y.firstChild.type.spec.tableRole);for(var x=[],O=0;O0?-1:0;(function(e,t,n){for(var r=Mg(t.type.schema).header_cell,o=0;o0&&n0&&r.map[l-1]==u||n0?-1:0;(function(e,t,n){for(var r=Mg(t.type.schema).header_cell,o=0;o0&&n0&&d==r.map[f-r.width]){var p=o.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(u).map(d+i),null,Vg(p,"rowspan",p.rowspan-1)),c+=p.colspan-1}else if(n0&&o[a]==o[a-1]||t.right0&&o[i]==o[i-n]||t.bottom0;t--){var n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from)))return!1;o=Lg(i.$from).pos}if(1==r.attrs.colspan&&1==r.attrs.rowspan)return!1;if(t){var a=r.attrs,s=[],l=a.colwidth;a.rowspan>1&&(a=Vg(a,"rowspan",1)),a.colspan>1&&(a=Vg(a,"colspan",1));for(var u,c=cy(e),f=e.tr,d=0;d=0;r--){var i=e.node(-1).child(r);if(i.childCount)return o-1-i.lastChild.nodeSize;o-=i.nodeSize}}else{if(e.index()0&&void 0!==arguments[0]?arguments[0]:{},t=e.handleWidth,n=void 0===t?5:t,r=e.cellMinWidth,o=void 0===r?25:r,i=e.View,a=void 0===i?xy:i,s=e.lastColumnResizable,l=void 0===s||s,u=new p.Plugin({key:Cy,state:{init:function(e,t){return this.spec.props.nodeViews[Mg(t.schema).table.name]=function(e,t){return new a(e,o,t)},new jy(-1,!1)},apply:function(e,t){return t.apply(e)}},props:{attributes:function(e){return Cy.getState(e).activeHandle>-1?{class:"resize-cursor"}:null},handleDOMEvents:{mousemove:function(e,t){Ay(e,t,n,o,l)},mouseleave:function(e){Ey(e)},mousedown:function(e,t){Dy(e,t,o)}},decorations:function(e){var t=Cy.getState(e);if(t.activeHandle>-1)return Ry(e,t.activeHandle)},nodeViews:{}}});return u}var jy=function(){function e(t,n){Object(c.a)(this,e),this.activeHandle=t,this.dragging=n}return Object(f.a)(e,[{key:"apply",value:function(t){var n=this,r=t.getMeta(Cy);if(r&&null!=r.setHandle)return new e(r.setHandle,null);if(r&&void 0!==r.setDragging)return new e(n.activeHandle,r.setDragging);if(n.activeHandle>-1&&t.docChanged){var o=t.mapping.map(n.activeHandle,-1);Hg(t.doc.resolve(o))||(o=null),n=new e(o,n.dragging)}return n}}]),e}();function Ay(e,t,n,r,o){var i=Cy.getState(e.state);if(!i.dragging){var a=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(a){var l=a.getBoundingClientRect(),u=l.left,c=l.right;t.clientX-u<=n?s=My(e,t,"left"):c-t.clientX<=n&&(s=My(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){var f=e.state.doc.resolve(s),d=f.node(-1),p=Eg.get(d),h=f.start(-1);if(p.colCount(f.pos-h)+f.nodeAfter.attrs.colspan-1==p.width-1)return}Ly(e,s)}}}function Ey(e){var t=Cy.getState(e.state);t.activeHandle>-1&&!t.dragging&&Ly(e,-1)}function Dy(e,t,n){var r=Cy.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;var o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){var r=n.colspan,o=n.colwidth,i=o&&o[o.length-1];if(i)return i;var a=e.domAtPos(t),s=a.node.childNodes[a.offset].offsetWidth,l=r;if(o)for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},t=e.allowTableNodeSelection,n=void 0!==t&&t;return new p.Plugin({key:Tg,state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(Tg);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;var r=e.mapping.mapResult(t),o=r.deleted,i=r.pos;return o?null:i}},props:{decorations:$g,handleDOMEvents:{mousedown:ry},createSelectionBetween:function(e){if(null!=Tg.getState(e.state))return e.state.selection},handleTripleClick:ty,handleKeyDown:Zg,handlePaste:ny},appendTransaction:function(e,t,r){return qg(r,uy(r,t),n)}})}function Ny(e,t,n,r){return _y(e,t,Fy(t,n),Fy(t,r))}function Fy(e,t){for(var n=e.map,r=e.table,o=[],i=0;i=n.map.length)break;var s=n.map[a],l=r.nodeAt(s);l&&(o.push({cell:l,pos:s}),i+=l.attrs.rowspan)}return o}function Vy(e,t,n,r){return _y(e,t,zy(t,n),zy(t,r))}function zy(e,t){for(var n=e.map,r=e.table,o=[],i=0,a=t*n.width;i=n.map.length);i++,a++){var s=n.map[a],l=r.nodeAt(s);l&&(o.push({cell:l,pos:s}),i+=l.attrs.colspan-1)}return o}function _y(e,t,n,r){if(n.length===r.length){for(var o=e.mapping.maps.length,i=0;i1&&void 0!==arguments[1]?arguments[1]:1;if(0===e)return"0B";var n=1024,r=t<0?0:t,o=["B","K","M","G","T","P","E","Z","Y"],i=Math.floor(Math.log(e)/Math.log(n));return parseFloat((e/Math.pow(n,i)).toFixed(r))+o[i]}var Hb=_o.create({name:"attachment",content:"inline*",marks:"",inline:!0,atom:!0,addOptions:function(){return{HTMLAttributes:{},onDownloadAttachment:function(){return!1},onOpenAttachmentPicker:function(){return!1}}},group:function(){return"inline"},draggable:!0,addAttributes:function(){return{progress:{default:0,rendered:!1},hash:Nb("hash"),filename:Nb("filename"),type:Nb("mime"),size:Nb("size")}},parseHTML:function(){return[{tag:"span[data-hash]"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["span",Sr(this.options.HTMLAttributes,t)]},addNodeView:function(){return Qa(Pb,{shouldUpdate:function(e,t){var n=e.attrs,r=t.attrs;return n.progress!==r.progress}})},addCommands:function(){var e=this;return{insertAttachment:function(t){return function(n){return n.commands.insertContent({type:e.name,attrs:t})}},removeAttachment:function(){return function(e){var t=e.commands;e.tr;return t.deleteSelection()}},downloadAttachment:function(t){return function(n){var r=n.editor;return e.options.onDownloadAttachment(r,t)}},openAttachmentPicker:function(t){return function(n){var r=n.editor;return e.options.onOpenAttachmentPicker(r,t)}},setAttachmentProgress:function(t){return function(n){var r,o=n.state,i=n.tr,a=n.dispatch,s=t.hash,l=t.progress,u=(t.type,Lo(o.doc,(function(t){return(t.type.name===e.name||"image"===t.type.name)&&t.attrs.hash===s}))),c=Object(xa.a)(u);try{for(c.s();!(r=c.n()).done;){var f=r.value;i.setNodeMarkup(f.pos,f.node.type,Object.assign(Object.assign({},f.node.attrs),{progress:100===l?null:l}))}}catch(d){c.e(d)}finally{c.f()}return i.setMeta("preventUpdate",!0),i.setMeta("addToHistory",!1),a&&a(i),!0}}}}});function Nb(e,t){return{default:t,parseHTML:function(t){return t.dataset[e]},renderHTML:function(t){return t[e]?Object(s.a)({},"data-".concat(e),t[e]):{}}}}var Fb=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vb=function(){return Vb=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1)||(0===t.parentOffset||0===t.index(t.depth-1))}(e.state)||!e.can().liftListItem(n))return!1;var a=function(e,t){var n=Object(jb.findParentNodeOfType)(e)(t.selection);return!!n&&!n.node.textContent.length}(n,e.state);if(a){if(bw(n,e.state)){var s=ww(n,e.state);return!!s&&e.commands.deleteNode(s.type)}return e.commands.deleteNode(n)}return bw(n,e.state)?e.commands.liftListItem(n):e.chain().joinBackward().joinBackward().run()}var bw=function(e,t){var n=Object(jb.findParentNodeOfType)(e)(t.selection);if(!n)return!1;var r=n.pos,o=t.doc.resolve(r);return console.log("isFirstOfType",o),!o.nodeBefore},ww=function(e,t){var n,r=Object(jb.findParentNodeOfType)(e)(t.selection);if(r){var o=r.pos,i=t.doc.resolve(o);if(i.parent.type.spec.group&&!((null===(n=i.parent.type.spec.group)||void 0===n?void 0:n.indexOf("list"))<=-1))return i.parent}};var kw=/^\s*(\[([( |x])?\])\s$/;function xw(e){var t=e.editor,n=e.updateAttributes,r=(e.node,e.getPos),o=e.forwardRef,i=e.node.attrs.checked,a=Ha(),s=Object(Ca.useCallback)((function(){var e;if(!t.isEditable)return!1;n({checked:!i});var o=r(),a=null===(e=t.current)||void 0===e?void 0:e.state.doc.nodeAt(o);return!!a&&(t.commands.command((function(e){var t=e.tr;return function(e,t,n,r){var o,i=Lo(e,(function(e){return e.type.name===Ow.name})),a=Object(xa.a)(i);try{for(a.s();!(o=a.n()).done;){var s=o.value.pos+r+1;t.setNodeMarkup(s,void 0,{checked:n})}}catch(l){a.e(l)}finally{a.f()}}(a,t,!i,o),!0})),!0)}),[t,r,i]);return Object(Oa.jsx)(Oa.Fragment,{children:Object(Oa.jsxs)(ns.Flex,Object.assign({"data-drag-image":!0,sx:{bg:"background",borderRadius:"default",":hover > .dragHandle":{opacity:t.isEditable?1:0}}},{children:[Object(Oa.jsx)(ds,{className:"dragHandle",draggable:"true","data-drag-handle":!0,path:ps.dragHandle,sx:{opacity:[1,1,0],alignSelf:"start",mr:2,bg:"transparent",cursor:"grab",".icon:hover path":{fill:"var(--checked) !important"}},size:a?24:20}),Object(Oa.jsx)(ds,{path:i?ps.check:"",stroke:"1px",sx:{border:"2px solid",borderColor:i?"checked":"icon",borderRadius:"default",alignSelf:"start",mr:2,p:"1px",cursor:t.isEditable?"pointer":"unset",":hover":{borderColor:"checked"},":hover .icon path":{fill:"var(--checked) !important"}},onMouseDown:function(e){e.preventDefault(),s()},onTouchEnd:function(e){e.preventDefault(),s()},color:i?"checked":"icon",size:a?16:14}),Object(Oa.jsx)(is,{as:"div",ref:o,sx:{"> .taskitem-content-wrapper > p":{textDecorationLine:i?"line-through":"none",opacity:i?.8:1},flex:1}})]}))})}var Ow=_o.create({name:"taskItem",addOptions:function(){return{nested:!1,HTMLAttributes:{}}},content:function(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:function(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.getAttribute("data-checked")},renderHTML:function(e){return{"data-checked":e.checked}}}}},parseHTML:function(){return[{tag:'li[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML:function(e){var t=e.node,n=e.HTMLAttributes;return["li",Sr(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts:function(){var e=this,t={Enter:function(){return e.editor.commands.splitListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)}};return this.options.nested?Object(d.a)(Object(d.a)({},t),{},{Tab:function(){return e.editor.commands.sinkListItem(e.name)}}):t},addNodeView:function(){var e=this;return function(t){var n=t.node,r=t.HTMLAttributes,o=t.getPos,i=t.editor,a=document.createElement("li"),s=document.createElement("label"),l=document.createElement("span"),c=document.createElement("input"),f=document.createElement("div");return s.contentEditable="false",c.type="checkbox",c.addEventListener("change",(function(t){if(i.isEditable||e.options.onReadOnlyChecked){var r=t.target.checked;i.isEditable&&"function"===typeof o&&i.chain().focus(void 0,{scrollIntoView:!1}).command((function(e){var t=e.tr,n=o(),i=t.doc.nodeAt(n);return t.setNodeMarkup(n,void 0,Object(d.a)(Object(d.a)({},null===i||void 0===i?void 0:i.attrs),{},{checked:r})),!0})).run(),!i.isEditable&&e.options.onReadOnlyChecked&&(e.options.onReadOnlyChecked(n,r)||(c.checked=!c.checked))}else c.checked=!c.checked})),Object.entries(e.options.HTMLAttributes).forEach((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];a.setAttribute(n,r)})),a.dataset.checked=n.attrs.checked,n.attrs.checked&&c.setAttribute("checked","checked"),s.append(c,l),a.append(s,f),Object.entries(r).forEach((function(e){var t=Object(u.a)(e,2),n=t[0],r=t[1];a.setAttribute(n,r)})),{dom:a,contentDOM:f,update:function(t){return t.type===e.type&&(a.dataset.checked=t.attrs.checked,t.attrs.checked?c.setAttribute("checked","checked"):c.removeAttribute("checked"),!0)}}}},addInputRules:function(){return[Vo({find:kw,type:this.type,getAttributes:function(e){return{checked:"x"===e[e.length-1]}}})]}}).extend({draggable:!0,addAttributes:function(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:function(e){return e.classList.contains("checked")},renderHTML:function(e){return{class:e.checked?"checked":""}}}}},renderHTML:function(e){e.node;var t=e.HTMLAttributes;return["li",Sr(this.options.HTMLAttributes,t,{class:"checklist--item"}),0]},parseHTML:function(){return[{tag:"li",getAttrs:function(e){var t;return e instanceof Node&&e instanceof HTMLElement&&(!(!e.classList.contains("checklist--item")&&!(null===(t=e.parentElement)||void 0===t?void 0:t.classList.contains("checklist")))&&null)},priority:51}]},addKeyboardShortcuts:function(){var e,t=this;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{Backspace:function(e){return yw(e.editor,t.name,t.type)}})},addNodeView:function(){return za(xw,{contentDOMFactory:!0,wrapperFactory:function(){return document.createElement("li")},shouldUpdate:function(e,t){var n=e.attrs,r=t.attrs;return n.checked!==r.checked||n.collapsed!==r.collapsed}})}});function Cw(e){var t=Ha(),n=e.editor,r=e.getPos,o=e.node,i=e.updateAttributes,a=e.forwardRef,s=Cr(Ow.name,n.schema),l=o.attrs,c=l.title,f=l.collapsed,d=Object(Ca.useState)({checked:0,total:0,percentage:0}),p=Object(u.a)(d,2),h=p[0],m=p[1],v=Object(Ca.useCallback)((function(){var e=n.state.doc.resolve(r());return Object(jb.findParentNodeOfTypeClosestToPos)(e,s)}),[]),g=Object(Ca.useMemo)((function(){return!!v()}),[v]);return Object(Ca.useEffect)((function(){var e=v();if(e){var t=e.node,r=e.pos,o=function(e,t,n){var r,o=Lo(e,(function(e){return e.type.name===Ow.name})),i=Object(xa.a)(o);try{for(i.s();!(r=i.n()).done;){var a=t+r.value.pos+1,s=n.nodeAt(a);if(!(null===s||void 0===s?void 0:s.attrs.checked))return!1}}catch(l){i.e(l)}finally{i.f()}return!0}(t,r,n.state.doc);t.attrs.checked!==o&&n.commands.command((function(e){return e.tr.setNodeMarkup(r,void 0,{checked:o}),!0}))}}),[o,o.childCount]),Object(Ca.useEffect)((function(){var e=Lo(o,(function(e){return e.type.name===Ow.name})),t=e.filter((function(e){return e.node.attrs.checked})).length,n=e.length,r=Math.round(t/n*100);m({checked:t,total:n,percentage:r})}),[g,o]),Object(Oa.jsxs)(Oa.Fragment,{children:[Object(Oa.jsx)(ns.Flex,Object.assign({sx:{flexDirection:"column",":hover > div > .toggleSublist":{opacity:1}}},{children:g?Object(Oa.jsxs)(ns.Flex,Object.assign({sx:{position:"absolute",top:0,right:0},contentEditable:!1},{children:[f&&Object(Oa.jsxs)(is,Object.assign({variant:"body",sx:{color:"fontTertiary",mr:35}},{children:[h.checked,"/",h.total]})),Object(Oa.jsx)(ds,{className:"toggleSublist",path:f?ps.chevronDown:ps.chevronUp,sx:{opacity:t||f?1:0,position:"absolute",right:0,alignSelf:"start",mr:2,cursor:"pointer",".icon:hover path":{fill:"var(--checked) !important"}},size:t?24:20,onClick:function(){i({collapsed:!f},{addToHistory:!1,preventUpdate:!0})}})]})):Object(Oa.jsxs)(ns.Flex,Object.assign({sx:{position:"relative",bg:"bgSecondary",py:1,borderRadius:"default",mb:2,alignItems:"center",justifyContent:"end",overflow:"hidden"},contentEditable:!1},{children:[Object(Oa.jsx)(ns.Box,{sx:{height:"100%",width:"".concat(h.percentage,"%"),position:"absolute",bg:"border",zIndex:0,left:0,transition:"width 250ms ease-out"}}),Object(Oa.jsx)(Sm,{readOnly:!n.isEditable,value:c||"",variant:"clean",sx:{p:0,px:2,zIndex:1,color:"fontTertiary"},placeholder:"Untitled",onChange:function(e){i({title:e.target.value},{addToHistory:!0,preventUpdate:!1})}}),Object(Oa.jsxs)(ns.Flex,Object.assign({sx:{flexShrink:0,pr:2}},{children:[Object(Oa.jsx)(ds,{path:ps.checkbox,size:15,color:"fontTertiary"}),Object(Oa.jsxs)(is,Object.assign({variant:"body",sx:{ml:1,color:"fontTertiary"}},{children:[h.checked,"/",h.total]}))]}))]}))})),Object(Oa.jsx)(is,{as:"div",ref:a,sx:{ul:{display:f?"none":"block",paddingInlineStart:0,marginBlockStart:g?10:0,marginBlockEnd:0,marginLeft:g?-35:0},li:{listStyleType:"none",position:"relative",marginBottom:[2,"7px"]}}})]})}var Sw=gw.extend({addAttributes:function(){return{collapsed:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.dataset.collapsed},renderHTML:function(e){return{"data-collapsed":!0===e.collapsed}}},title:{default:null,keepOnSplit:!1,parseHTML:function(e){return e.dataset.title},renderHTML:function(e){return!e.title||e.nested?{}:{"data-title":e.title}}}}},parseHTML:function(){return[{tag:"ul",getAttrs:function(e){return e instanceof Node&&e instanceof HTMLElement&&(e.classList.contains("checklist")&&null)},priority:51}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Sr(this.options.HTMLAttributes,t,{class:"checklist"}),0]},addCommands:function(){var e=this;return{toggleTaskList:function(){return function(t){var n=t.editor,r=t.commands,o=t.state,i=t.tr,a=o.selection,s=a.$from,l=a.$to;r.toggleList(e.name,e.options.itemTypeName);var u={from:i.mapping.map(s.pos),to:i.mapping.map(l.pos)};return setTimeout((function(){return n.commands.setTextSelection(u)}),0),!0}}}},addNodeView:function(){var e=this;return za(Cw,{contentDOMFactory:function(){var t=document.createElement("ul");return t.classList.add("".concat(e.name.toLowerCase(),"-content-wrapper")),t.style.whiteSpace="inherit",{dom:t}}})}});function jw(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new p.Plugin({view:function(t){return new Aw(t,e)}})}var Aw=function(){function e(t,n){var r=this;Object(c.a)(this,e),this.editorView=t,this.width=n.width||1,this.color=n.color||"black",this.class=n.class||"",this.cursorPos=null,this.element=null,this.timeout=null,this.handlers=["dragover","dragend","drop","dragleave"].map((function(e){var n=function(t){return r[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}return Object(f.a)(e,[{key:"destroy",value:function(){var e=this;this.handlers.forEach((function(t){var n=t.name,r=t.handler;return e.editorView.dom.removeEventListener(n,r)}))}},{key:"update",value:function(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}},{key:"setCursor",value:function(e){e!=this.cursorPos&&(this.cursorPos=e,null==e&&this.element&&this.element.parentNode?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}},{key:"updateOverlay",value:function(){if(this.cursorPos){var e,t=this.editorView.state.doc.resolve(this.cursorPos);if(!t.parent.inlineContent){var n=t.nodeBefore,r=t.nodeAfter;if(n||r){var o=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(!o)return;var i=o.getBoundingClientRect(),a=n?i.bottom:i.top;if(n&&r){var s=this.editorView.nodeDOM(this.cursorPos);if(!s)return;a=(a+s.getBoundingClientRect().top)/2}e={left:i.left,right:i.right,top:a-this.width/2,bottom:a+this.width/2}}}if(!e){var l=this.editorView.coordsAtPos(this.cursorPos);e={left:l.left-this.width/2,right:l.left+this.width/2,top:l.top,bottom:l.bottom}}var u,c,f=this.editorView.dom.offsetParent;if(!this.element&&f&&(this.element=f.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),!f||f==document.body&&"static"==getComputedStyle(f).position)u=-pageXOffset,c=-pageYOffset;else{var d=f.getBoundingClientRect();u=d.left-f.scrollLeft,c=d.top-f.scrollTop}this.element&&(this.element.style.left=e.left-u+"px",this.element.style.top=e.top-c+"px",this.element.style.width=e.right-e.left+"px",this.element.style.height=e.bottom-e.top+"px")}}},{key:"scheduleRemoval",value:function(e){var t=this;clearTimeout(this.timeout||void 0),this.timeout=setTimeout((function(){return t.setCursor(null)}),e)}},{key:"dragover",value:function(e){if(this.editorView.editable){var t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t):r;if(t&&!o){var i=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){var a=Object(g.h)(this.editorView.state.doc,i,this.editorView.dragging.slice);if(!a)return this.setCursor(null);i=a}this.setCursor(i),this.scheduleRemoval(5e3)}}}},{key:"dragend",value:function(){this.scheduleRemoval(20)}},{key:"drop",value:function(){this.scheduleRemoval(20)}},{key:"dragleave",value:function(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}]),e}(),Ew=$r.create({name:"dropCursor",addOptions:function(){return{color:"currentColor",width:1,class:null}},addProseMirrorPlugins:function(){return[jw(this.options)]}}),Dw=function(e,t){return t(e.tr)};var Mw=$r.create({name:"searchreplace",addOptions:function(){return{searchResultClass:"search-result"}},addCommands:function(){var e=this;return{startSearch:function(){return function(t){var n=t.state;return e.storage.isSearching=!0,n.selection.empty||(e.storage.selectedText=n.doc.textBetween(n.selection.$from.pos,n.selection.$to.pos)),!0}},endSearch:function(){return function(t){var n=t.state,r=t.dispatch;return e.storage.isSearching=!1,e.storage.searchTerm="",Dw(n,r),!0}},search:function(t,n){return function(r){var o=r.state,i=r.dispatch;return e.storage.searchTerm=t,e.storage.enableRegex=(null===n||void 0===n?void 0:n.enableRegex)||!1,e.storage.matchCase=(null===n||void 0===n?void 0:n.matchCase)||!1,e.storage.matchWholeWord=(null===n||void 0===n?void 0:n.matchWholeWord)||!1,e.storage.results=[],Dw(o,i),!0}},moveToNextResult:function(){return function(t){var n=t.chain,r=e.storage,o=r.selectedIndex,i=r.results;if(!i||i.length<=0)return!1;var a=o+1;(isNaN(a)||a>=i.length)&&(a=0);var s=i[a],l=s.from,u=s.to;console.log("[moveToNextResult]",l,u);var c=n().focus(void 0,{scrollIntoView:!0}).setTextSelection({from:l,to:u}).run();return c&&(e.storage.selectedIndex=a),c}},moveToPreviousResult:function(){return function(t){var n=t.chain,r=e.storage,o=r.selectedIndex,i=r.results;if(!i||i.length<=0)return!1;var a=o-1;(isNaN(a)||a<0)&&(a=i.length-1);var s=i[a],l=s.from,u=s.to,c=n().focus(void 0,{scrollIntoView:!0}).setTextSelection({from:l,to:u}).run();return c&&(e.storage.selectedIndex=a),c}},replace:function(t){return function(n){var r=n.commands,o=n.tr,i=n.dispatch,a=e.storage,s=a.selectedIndex,l=a.results;if(!i||!l||l.length<=0)return!1;var u=void 0===s?0:s,c=l[u],f=c.from,d=c.to;if(o.insertText(t,f,d),u+11&&void 0!==arguments[1]?arguments[1]:"div",i=e||"",a={},s=0;s4&&"data"===n.slice(0,4)&&ck.test(t)){if("-"===t.charAt(4)){var i=t.slice(5).replace(fk,hk);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{var a=t.slice(4);if(!fk.test(a)){var s=a.replace(dk,pk);"-"!==s.charAt(0)&&(s="-"+s),t="data"+s}}o=Yw}return new o(r,t)}(e,n),a=-1;if(void 0!==r&&null!==r){if("number"===typeof r){if(Number.isNaN(r))return;o=r}else o="boolean"===typeof r?r:"string"===typeof r?i.spaceSeparated?gk(r):i.commaSeparated?yk(r):i.commaOrSpaceSeparated?gk(yk(r).join(" ")):Ck(i,i.property,r):Array.isArray(r)?r.concat():"style"===i.property?function(e){var t,n=[];for(t in e)wk.call(e,t)&&n.push([t,e[t]].join(": "));return n.join("; ")}(r):String(r);if(Array.isArray(o)){for(var s=[];++a2?l-2:0),c=2;c=48&&t<=57}function Dk(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function Mk(e){return function(e){var t="string"===typeof e?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}(e)||Ek(e)}var Tk={AElig:"\xc6",AMP:"&",Aacute:"\xc1",Abreve:"\u0102",Acirc:"\xc2",Acy:"\u0410",Afr:"\ud835\udd04",Agrave:"\xc0",Alpha:"\u0391",Amacr:"\u0100",And:"\u2a53",Aogon:"\u0104",Aopf:"\ud835\udd38",ApplyFunction:"\u2061",Aring:"\xc5",Ascr:"\ud835\udc9c",Assign:"\u2254",Atilde:"\xc3",Auml:"\xc4",Backslash:"\u2216",Barv:"\u2ae7",Barwed:"\u2306",Bcy:"\u0411",Because:"\u2235",Bernoullis:"\u212c",Beta:"\u0392",Bfr:"\ud835\udd05",Bopf:"\ud835\udd39",Breve:"\u02d8",Bscr:"\u212c",Bumpeq:"\u224e",CHcy:"\u0427",COPY:"\xa9",Cacute:"\u0106",Cap:"\u22d2",CapitalDifferentialD:"\u2145",Cayleys:"\u212d",Ccaron:"\u010c",Ccedil:"\xc7",Ccirc:"\u0108",Cconint:"\u2230",Cdot:"\u010a",Cedilla:"\xb8",CenterDot:"\xb7",Cfr:"\u212d",Chi:"\u03a7",CircleDot:"\u2299",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201d",CloseCurlyQuote:"\u2019",Colon:"\u2237",Colone:"\u2a74",Congruent:"\u2261",Conint:"\u222f",ContourIntegral:"\u222e",Copf:"\u2102",Coproduct:"\u2210",CounterClockwiseContourIntegral:"\u2233",Cross:"\u2a2f",Cscr:"\ud835\udc9e",Cup:"\u22d3",CupCap:"\u224d",DD:"\u2145",DDotrahd:"\u2911",DJcy:"\u0402",DScy:"\u0405",DZcy:"\u040f",Dagger:"\u2021",Darr:"\u21a1",Dashv:"\u2ae4",Dcaron:"\u010e",Dcy:"\u0414",Del:"\u2207",Delta:"\u0394",Dfr:"\ud835\udd07",DiacriticalAcute:"\xb4",DiacriticalDot:"\u02d9",DiacriticalDoubleAcute:"\u02dd",DiacriticalGrave:"`",DiacriticalTilde:"\u02dc",Diamond:"\u22c4",DifferentialD:"\u2146",Dopf:"\ud835\udd3b",Dot:"\xa8",DotDot:"\u20dc",DotEqual:"\u2250",DoubleContourIntegral:"\u222f",DoubleDot:"\xa8",DoubleDownArrow:"\u21d3",DoubleLeftArrow:"\u21d0",DoubleLeftRightArrow:"\u21d4",DoubleLeftTee:"\u2ae4",DoubleLongLeftArrow:"\u27f8",DoubleLongLeftRightArrow:"\u27fa",DoubleLongRightArrow:"\u27f9",DoubleRightArrow:"\u21d2",DoubleRightTee:"\u22a8",DoubleUpArrow:"\u21d1",DoubleUpDownArrow:"\u21d5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21f5",DownBreve:"\u0311",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295e",DownLeftVector:"\u21bd",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295f",DownRightVector:"\u21c1",DownRightVectorBar:"\u2957",DownTee:"\u22a4",DownTeeArrow:"\u21a7",Downarrow:"\u21d3",Dscr:"\ud835\udc9f",Dstrok:"\u0110",ENG:"\u014a",ETH:"\xd0",Eacute:"\xc9",Ecaron:"\u011a",Ecirc:"\xca",Ecy:"\u042d",Edot:"\u0116",Efr:"\ud835\udd08",Egrave:"\xc8",Element:"\u2208",Emacr:"\u0112",EmptySmallSquare:"\u25fb",EmptyVerySmallSquare:"\u25ab",Eogon:"\u0118",Eopf:"\ud835\udd3c",Epsilon:"\u0395",Equal:"\u2a75",EqualTilde:"\u2242",Equilibrium:"\u21cc",Escr:"\u2130",Esim:"\u2a73",Eta:"\u0397",Euml:"\xcb",Exists:"\u2203",ExponentialE:"\u2147",Fcy:"\u0424",Ffr:"\ud835\udd09",FilledSmallSquare:"\u25fc",FilledVerySmallSquare:"\u25aa",Fopf:"\ud835\udd3d",ForAll:"\u2200",Fouriertrf:"\u2131",Fscr:"\u2131",GJcy:"\u0403",GT:">",Gamma:"\u0393",Gammad:"\u03dc",Gbreve:"\u011e",Gcedil:"\u0122",Gcirc:"\u011c",Gcy:"\u0413",Gdot:"\u0120",Gfr:"\ud835\udd0a",Gg:"\u22d9",Gopf:"\ud835\udd3e",GreaterEqual:"\u2265",GreaterEqualLess:"\u22db",GreaterFullEqual:"\u2267",GreaterGreater:"\u2aa2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2a7e",GreaterTilde:"\u2273",Gscr:"\ud835\udca2",Gt:"\u226b",HARDcy:"\u042a",Hacek:"\u02c7",Hat:"^",Hcirc:"\u0124",Hfr:"\u210c",HilbertSpace:"\u210b",Hopf:"\u210d",HorizontalLine:"\u2500",Hscr:"\u210b",Hstrok:"\u0126",HumpDownHump:"\u224e",HumpEqual:"\u224f",IEcy:"\u0415",IJlig:"\u0132",IOcy:"\u0401",Iacute:"\xcd",Icirc:"\xce",Icy:"\u0418",Idot:"\u0130",Ifr:"\u2111",Igrave:"\xcc",Im:"\u2111",Imacr:"\u012a",ImaginaryI:"\u2148",Implies:"\u21d2",Int:"\u222c",Integral:"\u222b",Intersection:"\u22c2",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",Iogon:"\u012e",Iopf:"\ud835\udd40",Iota:"\u0399",Iscr:"\u2110",Itilde:"\u0128",Iukcy:"\u0406",Iuml:"\xcf",Jcirc:"\u0134",Jcy:"\u0419",Jfr:"\ud835\udd0d",Jopf:"\ud835\udd41",Jscr:"\ud835\udca5",Jsercy:"\u0408",Jukcy:"\u0404",KHcy:"\u0425",KJcy:"\u040c",Kappa:"\u039a",Kcedil:"\u0136",Kcy:"\u041a",Kfr:"\ud835\udd0e",Kopf:"\ud835\udd42",Kscr:"\ud835\udca6",LJcy:"\u0409",LT:"<",Lacute:"\u0139",Lambda:"\u039b",Lang:"\u27ea",Laplacetrf:"\u2112",Larr:"\u219e",Lcaron:"\u013d",Lcedil:"\u013b",Lcy:"\u041b",LeftAngleBracket:"\u27e8",LeftArrow:"\u2190",LeftArrowBar:"\u21e4",LeftArrowRightArrow:"\u21c6",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27e6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21c3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230a",LeftRightArrow:"\u2194",LeftRightVector:"\u294e",LeftTee:"\u22a3",LeftTeeArrow:"\u21a4",LeftTeeVector:"\u295a",LeftTriangle:"\u22b2",LeftTriangleBar:"\u29cf",LeftTriangleEqual:"\u22b4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21bf",LeftUpVectorBar:"\u2958",LeftVector:"\u21bc",LeftVectorBar:"\u2952",Leftarrow:"\u21d0",Leftrightarrow:"\u21d4",LessEqualGreater:"\u22da",LessFullEqual:"\u2266",LessGreater:"\u2276",LessLess:"\u2aa1",LessSlantEqual:"\u2a7d",LessTilde:"\u2272",Lfr:"\ud835\udd0f",Ll:"\u22d8",Lleftarrow:"\u21da",Lmidot:"\u013f",LongLeftArrow:"\u27f5",LongLeftRightArrow:"\u27f7",LongRightArrow:"\u27f6",Longleftarrow:"\u27f8",Longleftrightarrow:"\u27fa",Longrightarrow:"\u27f9",Lopf:"\ud835\udd43",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",Lscr:"\u2112",Lsh:"\u21b0",Lstrok:"\u0141",Lt:"\u226a",Map:"\u2905",Mcy:"\u041c",MediumSpace:"\u205f",Mellintrf:"\u2133",Mfr:"\ud835\udd10",MinusPlus:"\u2213",Mopf:"\ud835\udd44",Mscr:"\u2133",Mu:"\u039c",NJcy:"\u040a",Nacute:"\u0143",Ncaron:"\u0147",Ncedil:"\u0145",Ncy:"\u041d",NegativeMediumSpace:"\u200b",NegativeThickSpace:"\u200b",NegativeThinSpace:"\u200b",NegativeVeryThinSpace:"\u200b",NestedGreaterGreater:"\u226b",NestedLessLess:"\u226a",NewLine:"\n",Nfr:"\ud835\udd11",NoBreak:"\u2060",NonBreakingSpace:"\xa0",Nopf:"\u2115",Not:"\u2aec",NotCongruent:"\u2262",NotCupCap:"\u226d",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226f",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226b\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2a7e\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224e\u0338",NotHumpEqual:"\u224f\u0338",NotLeftTriangle:"\u22ea",NotLeftTriangleBar:"\u29cf\u0338",NotLeftTriangleEqual:"\u22ec",NotLess:"\u226e",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226a\u0338",NotLessSlantEqual:"\u2a7d\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2aa2\u0338",NotNestedLessLess:"\u2aa1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2aaf\u0338",NotPrecedesSlantEqual:"\u22e0",NotReverseElement:"\u220c",NotRightTriangle:"\u22eb",NotRightTriangleBar:"\u29d0\u0338",NotRightTriangleEqual:"\u22ed",NotSquareSubset:"\u228f\u0338",NotSquareSubsetEqual:"\u22e2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22e3",NotSubset:"\u2282\u20d2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2ab0\u0338",NotSucceedsSlantEqual:"\u22e1",NotSucceedsTilde:"\u227f\u0338",NotSuperset:"\u2283\u20d2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\ud835\udca9",Ntilde:"\xd1",Nu:"\u039d",OElig:"\u0152",Oacute:"\xd3",Ocirc:"\xd4",Ocy:"\u041e",Odblac:"\u0150",Ofr:"\ud835\udd12",Ograve:"\xd2",Omacr:"\u014c",Omega:"\u03a9",Omicron:"\u039f",Oopf:"\ud835\udd46",OpenCurlyDoubleQuote:"\u201c",OpenCurlyQuote:"\u2018",Or:"\u2a54",Oscr:"\ud835\udcaa",Oslash:"\xd8",Otilde:"\xd5",Otimes:"\u2a37",Ouml:"\xd6",OverBar:"\u203e",OverBrace:"\u23de",OverBracket:"\u23b4",OverParenthesis:"\u23dc",PartialD:"\u2202",Pcy:"\u041f",Pfr:"\ud835\udd13",Phi:"\u03a6",Pi:"\u03a0",PlusMinus:"\xb1",Poincareplane:"\u210c",Popf:"\u2119",Pr:"\u2abb",Precedes:"\u227a",PrecedesEqual:"\u2aaf",PrecedesSlantEqual:"\u227c",PrecedesTilde:"\u227e",Prime:"\u2033",Product:"\u220f",Proportion:"\u2237",Proportional:"\u221d",Pscr:"\ud835\udcab",Psi:"\u03a8",QUOT:'"',Qfr:"\ud835\udd14",Qopf:"\u211a",Qscr:"\ud835\udcac",RBarr:"\u2910",REG:"\xae",Racute:"\u0154",Rang:"\u27eb",Rarr:"\u21a0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211c",ReverseElement:"\u220b",ReverseEquilibrium:"\u21cb",ReverseUpEquilibrium:"\u296f",Rfr:"\u211c",Rho:"\u03a1",RightAngleBracket:"\u27e9",RightArrow:"\u2192",RightArrowBar:"\u21e5",RightArrowLeftArrow:"\u21c4",RightCeiling:"\u2309",RightDoubleBracket:"\u27e7",RightDownTeeVector:"\u295d",RightDownVector:"\u21c2",RightDownVectorBar:"\u2955",RightFloor:"\u230b",RightTee:"\u22a2",RightTeeArrow:"\u21a6",RightTeeVector:"\u295b",RightTriangle:"\u22b3",RightTriangleBar:"\u29d0",RightTriangleEqual:"\u22b5",RightUpDownVector:"\u294f",RightUpTeeVector:"\u295c",RightUpVector:"\u21be",RightUpVectorBar:"\u2954",RightVector:"\u21c0",RightVectorBar:"\u2953",Rightarrow:"\u21d2",Ropf:"\u211d",RoundImplies:"\u2970",Rrightarrow:"\u21db",Rscr:"\u211b",Rsh:"\u21b1",RuleDelayed:"\u29f4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042c",Sacute:"\u015a",Sc:"\u2abc",Scaron:"\u0160",Scedil:"\u015e",Scirc:"\u015c",Scy:"\u0421",Sfr:"\ud835\udd16",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03a3",SmallCircle:"\u2218",Sopf:"\ud835\udd4a",Sqrt:"\u221a",Square:"\u25a1",SquareIntersection:"\u2293",SquareSubset:"\u228f",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\ud835\udcae",Star:"\u22c6",Sub:"\u22d0",Subset:"\u22d0",SubsetEqual:"\u2286",Succeeds:"\u227b",SucceedsEqual:"\u2ab0",SucceedsSlantEqual:"\u227d",SucceedsTilde:"\u227f",SuchThat:"\u220b",Sum:"\u2211",Sup:"\u22d1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22d1",THORN:"\xde",TRADE:"\u2122",TSHcy:"\u040b",TScy:"\u0426",Tab:"\t",Tau:"\u03a4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\ud835\udd17",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205f\u200a",ThinSpace:"\u2009",Tilde:"\u223c",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\ud835\udd4b",TripleDot:"\u20db",Tscr:"\ud835\udcaf",Tstrok:"\u0166",Uacute:"\xda",Uarr:"\u219f",Uarrocir:"\u2949",Ubrcy:"\u040e",Ubreve:"\u016c",Ucirc:"\xdb",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\ud835\udd18",Ugrave:"\xd9",Umacr:"\u016a",UnderBar:"_",UnderBrace:"\u23df",UnderBracket:"\u23b5",UnderParenthesis:"\u23dd",Union:"\u22c3",UnionPlus:"\u228e",Uogon:"\u0172",Uopf:"\ud835\udd4c",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21c5",UpDownArrow:"\u2195",UpEquilibrium:"\u296e",UpTee:"\u22a5",UpTeeArrow:"\u21a5",Uparrow:"\u21d1",Updownarrow:"\u21d5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03d2",Upsilon:"\u03a5",Uring:"\u016e",Uscr:"\ud835\udcb0",Utilde:"\u0168",Uuml:"\xdc",VDash:"\u22ab",Vbar:"\u2aeb",Vcy:"\u0412",Vdash:"\u22a9",Vdashl:"\u2ae6",Vee:"\u22c1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200a",Vfr:"\ud835\udd19",Vopf:"\ud835\udd4d",Vscr:"\ud835\udcb1",Vvdash:"\u22aa",Wcirc:"\u0174",Wedge:"\u22c0",Wfr:"\ud835\udd1a",Wopf:"\ud835\udd4e",Wscr:"\ud835\udcb2",Xfr:"\ud835\udd1b",Xi:"\u039e",Xopf:"\ud835\udd4f",Xscr:"\ud835\udcb3",YAcy:"\u042f",YIcy:"\u0407",YUcy:"\u042e",Yacute:"\xdd",Ycirc:"\u0176",Ycy:"\u042b",Yfr:"\ud835\udd1c",Yopf:"\ud835\udd50",Yscr:"\ud835\udcb4",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017d",Zcy:"\u0417",Zdot:"\u017b",ZeroWidthSpace:"\u200b",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\ud835\udcb5",aacute:"\xe1",abreve:"\u0103",ac:"\u223e",acE:"\u223e\u0333",acd:"\u223f",acirc:"\xe2",acute:"\xb4",acy:"\u0430",aelig:"\xe6",af:"\u2061",afr:"\ud835\udd1e",agrave:"\xe0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03b1",amacr:"\u0101",amalg:"\u2a3f",amp:"&",and:"\u2227",andand:"\u2a55",andd:"\u2a5c",andslope:"\u2a58",andv:"\u2a5a",ang:"\u2220",ange:"\u29a4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29a8",angmsdab:"\u29a9",angmsdac:"\u29aa",angmsdad:"\u29ab",angmsdae:"\u29ac",angmsdaf:"\u29ad",angmsdag:"\u29ae",angmsdah:"\u29af",angrt:"\u221f",angrtvb:"\u22be",angrtvbd:"\u299d",angsph:"\u2222",angst:"\xc5",angzarr:"\u237c",aogon:"\u0105",aopf:"\ud835\udd52",ap:"\u2248",apE:"\u2a70",apacir:"\u2a6f",ape:"\u224a",apid:"\u224b",apos:"'",approx:"\u2248",approxeq:"\u224a",aring:"\xe5",ascr:"\ud835\udcb6",ast:"*",asymp:"\u2248",asympeq:"\u224d",atilde:"\xe3",auml:"\xe4",awconint:"\u2233",awint:"\u2a11",bNot:"\u2aed",backcong:"\u224c",backepsilon:"\u03f6",backprime:"\u2035",backsim:"\u223d",backsimeq:"\u22cd",barvee:"\u22bd",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23b5",bbrktbrk:"\u23b6",bcong:"\u224c",bcy:"\u0431",bdquo:"\u201e",becaus:"\u2235",because:"\u2235",bemptyv:"\u29b0",bepsi:"\u03f6",bernou:"\u212c",beta:"\u03b2",beth:"\u2136",between:"\u226c",bfr:"\ud835\udd1f",bigcap:"\u22c2",bigcirc:"\u25ef",bigcup:"\u22c3",bigodot:"\u2a00",bigoplus:"\u2a01",bigotimes:"\u2a02",bigsqcup:"\u2a06",bigstar:"\u2605",bigtriangledown:"\u25bd",bigtriangleup:"\u25b3",biguplus:"\u2a04",bigvee:"\u22c1",bigwedge:"\u22c0",bkarow:"\u290d",blacklozenge:"\u29eb",blacksquare:"\u25aa",blacktriangle:"\u25b4",blacktriangledown:"\u25be",blacktriangleleft:"\u25c2",blacktriangleright:"\u25b8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20e5",bnequiv:"\u2261\u20e5",bnot:"\u2310",bopf:"\ud835\udd53",bot:"\u22a5",bottom:"\u22a5",bowtie:"\u22c8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255d",boxUR:"\u255a",boxUl:"\u255c",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256c",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256b",boxVl:"\u2562",boxVr:"\u255f",boxbox:"\u29c9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250c",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252c",boxhu:"\u2534",boxminus:"\u229f",boxplus:"\u229e",boxtimes:"\u22a0",boxuL:"\u255b",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256a",boxvL:"\u2561",boxvR:"\u255e",boxvh:"\u253c",boxvl:"\u2524",boxvr:"\u251c",bprime:"\u2035",breve:"\u02d8",brvbar:"\xa6",bscr:"\ud835\udcb7",bsemi:"\u204f",bsim:"\u223d",bsime:"\u22cd",bsol:"\\",bsolb:"\u29c5",bsolhsub:"\u27c8",bull:"\u2022",bullet:"\u2022",bump:"\u224e",bumpE:"\u2aae",bumpe:"\u224f",bumpeq:"\u224f",cacute:"\u0107",cap:"\u2229",capand:"\u2a44",capbrcup:"\u2a49",capcap:"\u2a4b",capcup:"\u2a47",capdot:"\u2a40",caps:"\u2229\ufe00",caret:"\u2041",caron:"\u02c7",ccaps:"\u2a4d",ccaron:"\u010d",ccedil:"\xe7",ccirc:"\u0109",ccups:"\u2a4c",ccupssm:"\u2a50",cdot:"\u010b",cedil:"\xb8",cemptyv:"\u29b2",cent:"\xa2",centerdot:"\xb7",cfr:"\ud835\udd20",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03c7",cir:"\u25cb",cirE:"\u29c3",circ:"\u02c6",circeq:"\u2257",circlearrowleft:"\u21ba",circlearrowright:"\u21bb",circledR:"\xae",circledS:"\u24c8",circledast:"\u229b",circledcirc:"\u229a",circleddash:"\u229d",cire:"\u2257",cirfnint:"\u2a10",cirmid:"\u2aef",cirscir:"\u29c2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2a6d",conint:"\u222e",copf:"\ud835\udd54",coprod:"\u2210",copy:"\xa9",copysr:"\u2117",crarr:"\u21b5",cross:"\u2717",cscr:"\ud835\udcb8",csub:"\u2acf",csube:"\u2ad1",csup:"\u2ad0",csupe:"\u2ad2",ctdot:"\u22ef",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22de",cuesc:"\u22df",cularr:"\u21b6",cularrp:"\u293d",cup:"\u222a",cupbrcap:"\u2a48",cupcap:"\u2a46",cupcup:"\u2a4a",cupdot:"\u228d",cupor:"\u2a45",cups:"\u222a\ufe00",curarr:"\u21b7",curarrm:"\u293c",curlyeqprec:"\u22de",curlyeqsucc:"\u22df",curlyvee:"\u22ce",curlywedge:"\u22cf",curren:"\xa4",curvearrowleft:"\u21b6",curvearrowright:"\u21b7",cuvee:"\u22ce",cuwed:"\u22cf",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232d",dArr:"\u21d3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22a3",dbkarow:"\u290f",dblac:"\u02dd",dcaron:"\u010f",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21ca",ddotseq:"\u2a77",deg:"\xb0",delta:"\u03b4",demptyv:"\u29b1",dfisht:"\u297f",dfr:"\ud835\udd21",dharl:"\u21c3",dharr:"\u21c2",diam:"\u22c4",diamond:"\u22c4",diamondsuit:"\u2666",diams:"\u2666",die:"\xa8",digamma:"\u03dd",disin:"\u22f2",div:"\xf7",divide:"\xf7",divideontimes:"\u22c7",divonx:"\u22c7",djcy:"\u0452",dlcorn:"\u231e",dlcrop:"\u230d",dollar:"$",dopf:"\ud835\udd55",dot:"\u02d9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22a1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21ca",downharpoonleft:"\u21c3",downharpoonright:"\u21c2",drbkarow:"\u2910",drcorn:"\u231f",drcrop:"\u230c",dscr:"\ud835\udcb9",dscy:"\u0455",dsol:"\u29f6",dstrok:"\u0111",dtdot:"\u22f1",dtri:"\u25bf",dtrif:"\u25be",duarr:"\u21f5",duhar:"\u296f",dwangle:"\u29a6",dzcy:"\u045f",dzigrarr:"\u27ff",eDDot:"\u2a77",eDot:"\u2251",eacute:"\xe9",easter:"\u2a6e",ecaron:"\u011b",ecir:"\u2256",ecirc:"\xea",ecolon:"\u2255",ecy:"\u044d",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\ud835\udd22",eg:"\u2a9a",egrave:"\xe8",egs:"\u2a96",egsdot:"\u2a98",el:"\u2a99",elinters:"\u23e7",ell:"\u2113",els:"\u2a95",elsdot:"\u2a97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014b",ensp:"\u2002",eogon:"\u0119",eopf:"\ud835\udd56",epar:"\u22d5",eparsl:"\u29e3",eplus:"\u2a71",epsi:"\u03b5",epsilon:"\u03b5",epsiv:"\u03f5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2a96",eqslantless:"\u2a95",equals:"=",equest:"\u225f",equiv:"\u2261",equivDD:"\u2a78",eqvparsl:"\u29e5",erDot:"\u2253",erarr:"\u2971",escr:"\u212f",esdot:"\u2250",esim:"\u2242",eta:"\u03b7",eth:"\xf0",euml:"\xeb",euro:"\u20ac",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\ufb03",fflig:"\ufb00",ffllig:"\ufb04",ffr:"\ud835\udd23",filig:"\ufb01",fjlig:"fj",flat:"\u266d",fllig:"\ufb02",fltns:"\u25b1",fnof:"\u0192",fopf:"\ud835\udd57",forall:"\u2200",fork:"\u22d4",forkv:"\u2ad9",fpartint:"\u2a0d",frac12:"\xbd",frac13:"\u2153",frac14:"\xbc",frac15:"\u2155",frac16:"\u2159",frac18:"\u215b",frac23:"\u2154",frac25:"\u2156",frac34:"\xbe",frac35:"\u2157",frac38:"\u215c",frac45:"\u2158",frac56:"\u215a",frac58:"\u215d",frac78:"\u215e",frasl:"\u2044",frown:"\u2322",fscr:"\ud835\udcbb",gE:"\u2267",gEl:"\u2a8c",gacute:"\u01f5",gamma:"\u03b3",gammad:"\u03dd",gap:"\u2a86",gbreve:"\u011f",gcirc:"\u011d",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22db",geq:"\u2265",geqq:"\u2267",geqslant:"\u2a7e",ges:"\u2a7e",gescc:"\u2aa9",gesdot:"\u2a80",gesdoto:"\u2a82",gesdotol:"\u2a84",gesl:"\u22db\ufe00",gesles:"\u2a94",gfr:"\ud835\udd24",gg:"\u226b",ggg:"\u22d9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2a92",gla:"\u2aa5",glj:"\u2aa4",gnE:"\u2269",gnap:"\u2a8a",gnapprox:"\u2a8a",gne:"\u2a88",gneq:"\u2a88",gneqq:"\u2269",gnsim:"\u22e7",gopf:"\ud835\udd58",grave:"`",gscr:"\u210a",gsim:"\u2273",gsime:"\u2a8e",gsiml:"\u2a90",gt:">",gtcc:"\u2aa7",gtcir:"\u2a7a",gtdot:"\u22d7",gtlPar:"\u2995",gtquest:"\u2a7c",gtrapprox:"\u2a86",gtrarr:"\u2978",gtrdot:"\u22d7",gtreqless:"\u22db",gtreqqless:"\u2a8c",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\ufe00",gvnE:"\u2269\ufe00",hArr:"\u21d4",hairsp:"\u200a",half:"\xbd",hamilt:"\u210b",hardcy:"\u044a",harr:"\u2194",harrcir:"\u2948",harrw:"\u21ad",hbar:"\u210f",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22b9",hfr:"\ud835\udd25",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21ff",homtht:"\u223b",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",hopf:"\ud835\udd59",horbar:"\u2015",hscr:"\ud835\udcbd",hslash:"\u210f",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xed",ic:"\u2063",icirc:"\xee",icy:"\u0438",iecy:"\u0435",iexcl:"\xa1",iff:"\u21d4",ifr:"\ud835\udd26",igrave:"\xec",ii:"\u2148",iiiint:"\u2a0c",iiint:"\u222d",iinfin:"\u29dc",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012b",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22b7",imped:"\u01b5",in:"\u2208",incare:"\u2105",infin:"\u221e",infintie:"\u29dd",inodot:"\u0131",int:"\u222b",intcal:"\u22ba",integers:"\u2124",intercal:"\u22ba",intlarhk:"\u2a17",intprod:"\u2a3c",iocy:"\u0451",iogon:"\u012f",iopf:"\ud835\udd5a",iota:"\u03b9",iprod:"\u2a3c",iquest:"\xbf",iscr:"\ud835\udcbe",isin:"\u2208",isinE:"\u22f9",isindot:"\u22f5",isins:"\u22f4",isinsv:"\u22f3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xef",jcirc:"\u0135",jcy:"\u0439",jfr:"\ud835\udd27",jmath:"\u0237",jopf:"\ud835\udd5b",jscr:"\ud835\udcbf",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03ba",kappav:"\u03f0",kcedil:"\u0137",kcy:"\u043a",kfr:"\ud835\udd28",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045c",kopf:"\ud835\udd5c",kscr:"\ud835\udcc0",lAarr:"\u21da",lArr:"\u21d0",lAtail:"\u291b",lBarr:"\u290e",lE:"\u2266",lEg:"\u2a8b",lHar:"\u2962",lacute:"\u013a",laemptyv:"\u29b4",lagran:"\u2112",lambda:"\u03bb",lang:"\u27e8",langd:"\u2991",langle:"\u27e8",lap:"\u2a85",laquo:"\xab",larr:"\u2190",larrb:"\u21e4",larrbfs:"\u291f",larrfs:"\u291d",larrhk:"\u21a9",larrlp:"\u21ab",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21a2",lat:"\u2aab",latail:"\u2919",late:"\u2aad",lates:"\u2aad\ufe00",lbarr:"\u290c",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298b",lbrksld:"\u298f",lbrkslu:"\u298d",lcaron:"\u013e",lcedil:"\u013c",lceil:"\u2308",lcub:"{",lcy:"\u043b",ldca:"\u2936",ldquo:"\u201c",ldquor:"\u201e",ldrdhar:"\u2967",ldrushar:"\u294b",ldsh:"\u21b2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21a2",leftharpoondown:"\u21bd",leftharpoonup:"\u21bc",leftleftarrows:"\u21c7",leftrightarrow:"\u2194",leftrightarrows:"\u21c6",leftrightharpoons:"\u21cb",leftrightsquigarrow:"\u21ad",leftthreetimes:"\u22cb",leg:"\u22da",leq:"\u2264",leqq:"\u2266",leqslant:"\u2a7d",les:"\u2a7d",lescc:"\u2aa8",lesdot:"\u2a7f",lesdoto:"\u2a81",lesdotor:"\u2a83",lesg:"\u22da\ufe00",lesges:"\u2a93",lessapprox:"\u2a85",lessdot:"\u22d6",lesseqgtr:"\u22da",lesseqqgtr:"\u2a8b",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297c",lfloor:"\u230a",lfr:"\ud835\udd29",lg:"\u2276",lgE:"\u2a91",lhard:"\u21bd",lharu:"\u21bc",lharul:"\u296a",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226a",llarr:"\u21c7",llcorner:"\u231e",llhard:"\u296b",lltri:"\u25fa",lmidot:"\u0140",lmoust:"\u23b0",lmoustache:"\u23b0",lnE:"\u2268",lnap:"\u2a89",lnapprox:"\u2a89",lne:"\u2a87",lneq:"\u2a87",lneqq:"\u2268",lnsim:"\u22e6",loang:"\u27ec",loarr:"\u21fd",lobrk:"\u27e6",longleftarrow:"\u27f5",longleftrightarrow:"\u27f7",longmapsto:"\u27fc",longrightarrow:"\u27f6",looparrowleft:"\u21ab",looparrowright:"\u21ac",lopar:"\u2985",lopf:"\ud835\udd5d",loplus:"\u2a2d",lotimes:"\u2a34",lowast:"\u2217",lowbar:"_",loz:"\u25ca",lozenge:"\u25ca",lozf:"\u29eb",lpar:"(",lparlt:"\u2993",lrarr:"\u21c6",lrcorner:"\u231f",lrhar:"\u21cb",lrhard:"\u296d",lrm:"\u200e",lrtri:"\u22bf",lsaquo:"\u2039",lscr:"\ud835\udcc1",lsh:"\u21b0",lsim:"\u2272",lsime:"\u2a8d",lsimg:"\u2a8f",lsqb:"[",lsquo:"\u2018",lsquor:"\u201a",lstrok:"\u0142",lt:"<",ltcc:"\u2aa6",ltcir:"\u2a79",ltdot:"\u22d6",lthree:"\u22cb",ltimes:"\u22c9",ltlarr:"\u2976",ltquest:"\u2a7b",ltrPar:"\u2996",ltri:"\u25c3",ltrie:"\u22b4",ltrif:"\u25c2",lurdshar:"\u294a",luruhar:"\u2966",lvertneqq:"\u2268\ufe00",lvnE:"\u2268\ufe00",mDDot:"\u223a",macr:"\xaf",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21a6",mapsto:"\u21a6",mapstodown:"\u21a7",mapstoleft:"\u21a4",mapstoup:"\u21a5",marker:"\u25ae",mcomma:"\u2a29",mcy:"\u043c",mdash:"\u2014",measuredangle:"\u2221",mfr:"\ud835\udd2a",mho:"\u2127",micro:"\xb5",mid:"\u2223",midast:"*",midcir:"\u2af0",middot:"\xb7",minus:"\u2212",minusb:"\u229f",minusd:"\u2238",minusdu:"\u2a2a",mlcp:"\u2adb",mldr:"\u2026",mnplus:"\u2213",models:"\u22a7",mopf:"\ud835\udd5e",mp:"\u2213",mscr:"\ud835\udcc2",mstpos:"\u223e",mu:"\u03bc",multimap:"\u22b8",mumap:"\u22b8",nGg:"\u22d9\u0338",nGt:"\u226b\u20d2",nGtv:"\u226b\u0338",nLeftarrow:"\u21cd",nLeftrightarrow:"\u21ce",nLl:"\u22d8\u0338",nLt:"\u226a\u20d2",nLtv:"\u226a\u0338",nRightarrow:"\u21cf",nVDash:"\u22af",nVdash:"\u22ae",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20d2",nap:"\u2249",napE:"\u2a70\u0338",napid:"\u224b\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266e",natural:"\u266e",naturals:"\u2115",nbsp:"\xa0",nbump:"\u224e\u0338",nbumpe:"\u224f\u0338",ncap:"\u2a43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2a6d\u0338",ncup:"\u2a42",ncy:"\u043d",ndash:"\u2013",ne:"\u2260",neArr:"\u21d7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\ud835\udd2b",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2a7e\u0338",nges:"\u2a7e\u0338",ngsim:"\u2275",ngt:"\u226f",ngtr:"\u226f",nhArr:"\u21ce",nharr:"\u21ae",nhpar:"\u2af2",ni:"\u220b",nis:"\u22fc",nisd:"\u22fa",niv:"\u220b",njcy:"\u045a",nlArr:"\u21cd",nlE:"\u2266\u0338",nlarr:"\u219a",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219a",nleftrightarrow:"\u21ae",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2a7d\u0338",nles:"\u2a7d\u0338",nless:"\u226e",nlsim:"\u2274",nlt:"\u226e",nltri:"\u22ea",nltrie:"\u22ec",nmid:"\u2224",nopf:"\ud835\udd5f",not:"\xac",notin:"\u2209",notinE:"\u22f9\u0338",notindot:"\u22f5\u0338",notinva:"\u2209",notinvb:"\u22f7",notinvc:"\u22f6",notni:"\u220c",notniva:"\u220c",notnivb:"\u22fe",notnivc:"\u22fd",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2afd\u20e5",npart:"\u2202\u0338",npolint:"\u2a14",npr:"\u2280",nprcue:"\u22e0",npre:"\u2aaf\u0338",nprec:"\u2280",npreceq:"\u2aaf\u0338",nrArr:"\u21cf",nrarr:"\u219b",nrarrc:"\u2933\u0338",nrarrw:"\u219d\u0338",nrightarrow:"\u219b",nrtri:"\u22eb",nrtrie:"\u22ed",nsc:"\u2281",nsccue:"\u22e1",nsce:"\u2ab0\u0338",nscr:"\ud835\udcc3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22e2",nsqsupe:"\u22e3",nsub:"\u2284",nsubE:"\u2ac5\u0338",nsube:"\u2288",nsubset:"\u2282\u20d2",nsubseteq:"\u2288",nsubseteqq:"\u2ac5\u0338",nsucc:"\u2281",nsucceq:"\u2ab0\u0338",nsup:"\u2285",nsupE:"\u2ac6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20d2",nsupseteq:"\u2289",nsupseteqq:"\u2ac6\u0338",ntgl:"\u2279",ntilde:"\xf1",ntlg:"\u2278",ntriangleleft:"\u22ea",ntrianglelefteq:"\u22ec",ntriangleright:"\u22eb",ntrianglerighteq:"\u22ed",nu:"\u03bd",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22ad",nvHarr:"\u2904",nvap:"\u224d\u20d2",nvdash:"\u22ac",nvge:"\u2265\u20d2",nvgt:">\u20d2",nvinfin:"\u29de",nvlArr:"\u2902",nvle:"\u2264\u20d2",nvlt:"<\u20d2",nvltrie:"\u22b4\u20d2",nvrArr:"\u2903",nvrtrie:"\u22b5\u20d2",nvsim:"\u223c\u20d2",nwArr:"\u21d6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24c8",oacute:"\xf3",oast:"\u229b",ocir:"\u229a",ocirc:"\xf4",ocy:"\u043e",odash:"\u229d",odblac:"\u0151",odiv:"\u2a38",odot:"\u2299",odsold:"\u29bc",oelig:"\u0153",ofcir:"\u29bf",ofr:"\ud835\udd2c",ogon:"\u02db",ograve:"\xf2",ogt:"\u29c1",ohbar:"\u29b5",ohm:"\u03a9",oint:"\u222e",olarr:"\u21ba",olcir:"\u29be",olcross:"\u29bb",oline:"\u203e",olt:"\u29c0",omacr:"\u014d",omega:"\u03c9",omicron:"\u03bf",omid:"\u29b6",ominus:"\u2296",oopf:"\ud835\udd60",opar:"\u29b7",operp:"\u29b9",oplus:"\u2295",or:"\u2228",orarr:"\u21bb",ord:"\u2a5d",order:"\u2134",orderof:"\u2134",ordf:"\xaa",ordm:"\xba",origof:"\u22b6",oror:"\u2a56",orslope:"\u2a57",orv:"\u2a5b",oscr:"\u2134",oslash:"\xf8",osol:"\u2298",otilde:"\xf5",otimes:"\u2297",otimesas:"\u2a36",ouml:"\xf6",ovbar:"\u233d",par:"\u2225",para:"\xb6",parallel:"\u2225",parsim:"\u2af3",parsl:"\u2afd",part:"\u2202",pcy:"\u043f",percnt:"%",period:".",permil:"\u2030",perp:"\u22a5",pertenk:"\u2031",pfr:"\ud835\udd2d",phi:"\u03c6",phiv:"\u03d5",phmmat:"\u2133",phone:"\u260e",pi:"\u03c0",pitchfork:"\u22d4",piv:"\u03d6",planck:"\u210f",planckh:"\u210e",plankv:"\u210f",plus:"+",plusacir:"\u2a23",plusb:"\u229e",pluscir:"\u2a22",plusdo:"\u2214",plusdu:"\u2a25",pluse:"\u2a72",plusmn:"\xb1",plussim:"\u2a26",plustwo:"\u2a27",pm:"\xb1",pointint:"\u2a15",popf:"\ud835\udd61",pound:"\xa3",pr:"\u227a",prE:"\u2ab3",prap:"\u2ab7",prcue:"\u227c",pre:"\u2aaf",prec:"\u227a",precapprox:"\u2ab7",preccurlyeq:"\u227c",preceq:"\u2aaf",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",precsim:"\u227e",prime:"\u2032",primes:"\u2119",prnE:"\u2ab5",prnap:"\u2ab9",prnsim:"\u22e8",prod:"\u220f",profalar:"\u232e",profline:"\u2312",profsurf:"\u2313",prop:"\u221d",propto:"\u221d",prsim:"\u227e",prurel:"\u22b0",pscr:"\ud835\udcc5",psi:"\u03c8",puncsp:"\u2008",qfr:"\ud835\udd2e",qint:"\u2a0c",qopf:"\ud835\udd62",qprime:"\u2057",qscr:"\ud835\udcc6",quaternions:"\u210d",quatint:"\u2a16",quest:"?",questeq:"\u225f",quot:'"',rAarr:"\u21db",rArr:"\u21d2",rAtail:"\u291c",rBarr:"\u290f",rHar:"\u2964",race:"\u223d\u0331",racute:"\u0155",radic:"\u221a",raemptyv:"\u29b3",rang:"\u27e9",rangd:"\u2992",range:"\u29a5",rangle:"\u27e9",raquo:"\xbb",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21e5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291e",rarrhk:"\u21aa",rarrlp:"\u21ac",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21a3",rarrw:"\u219d",ratail:"\u291a",ratio:"\u2236",rationals:"\u211a",rbarr:"\u290d",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298c",rbrksld:"\u298e",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201d",rdquor:"\u201d",rdsh:"\u21b3",real:"\u211c",realine:"\u211b",realpart:"\u211c",reals:"\u211d",rect:"\u25ad",reg:"\xae",rfisht:"\u297d",rfloor:"\u230b",rfr:"\ud835\udd2f",rhard:"\u21c1",rharu:"\u21c0",rharul:"\u296c",rho:"\u03c1",rhov:"\u03f1",rightarrow:"\u2192",rightarrowtail:"\u21a3",rightharpoondown:"\u21c1",rightharpoonup:"\u21c0",rightleftarrows:"\u21c4",rightleftharpoons:"\u21cc",rightrightarrows:"\u21c9",rightsquigarrow:"\u219d",rightthreetimes:"\u22cc",ring:"\u02da",risingdotseq:"\u2253",rlarr:"\u21c4",rlhar:"\u21cc",rlm:"\u200f",rmoust:"\u23b1",rmoustache:"\u23b1",rnmid:"\u2aee",roang:"\u27ed",roarr:"\u21fe",robrk:"\u27e7",ropar:"\u2986",ropf:"\ud835\udd63",roplus:"\u2a2e",rotimes:"\u2a35",rpar:")",rpargt:"\u2994",rppolint:"\u2a12",rrarr:"\u21c9",rsaquo:"\u203a",rscr:"\ud835\udcc7",rsh:"\u21b1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22cc",rtimes:"\u22ca",rtri:"\u25b9",rtrie:"\u22b5",rtrif:"\u25b8",rtriltri:"\u29ce",ruluhar:"\u2968",rx:"\u211e",sacute:"\u015b",sbquo:"\u201a",sc:"\u227b",scE:"\u2ab4",scap:"\u2ab8",scaron:"\u0161",sccue:"\u227d",sce:"\u2ab0",scedil:"\u015f",scirc:"\u015d",scnE:"\u2ab6",scnap:"\u2aba",scnsim:"\u22e9",scpolint:"\u2a13",scsim:"\u227f",scy:"\u0441",sdot:"\u22c5",sdotb:"\u22a1",sdote:"\u2a66",seArr:"\u21d8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xa7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\ud835\udd30",sfrown:"\u2322",sharp:"\u266f",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xad",sigma:"\u03c3",sigmaf:"\u03c2",sigmav:"\u03c2",sim:"\u223c",simdot:"\u2a6a",sime:"\u2243",simeq:"\u2243",simg:"\u2a9e",simgE:"\u2aa0",siml:"\u2a9d",simlE:"\u2a9f",simne:"\u2246",simplus:"\u2a24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2a33",smeparsl:"\u29e4",smid:"\u2223",smile:"\u2323",smt:"\u2aaa",smte:"\u2aac",smtes:"\u2aac\ufe00",softcy:"\u044c",sol:"/",solb:"\u29c4",solbar:"\u233f",sopf:"\ud835\udd64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\ufe00",sqcup:"\u2294",sqcups:"\u2294\ufe00",sqsub:"\u228f",sqsube:"\u2291",sqsubset:"\u228f",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25a1",square:"\u25a1",squarf:"\u25aa",squf:"\u25aa",srarr:"\u2192",sscr:"\ud835\udcc8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22c6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03f5",straightphi:"\u03d5",strns:"\xaf",sub:"\u2282",subE:"\u2ac5",subdot:"\u2abd",sube:"\u2286",subedot:"\u2ac3",submult:"\u2ac1",subnE:"\u2acb",subne:"\u228a",subplus:"\u2abf",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2ac5",subsetneq:"\u228a",subsetneqq:"\u2acb",subsim:"\u2ac7",subsub:"\u2ad5",subsup:"\u2ad3",succ:"\u227b",succapprox:"\u2ab8",succcurlyeq:"\u227d",succeq:"\u2ab0",succnapprox:"\u2aba",succneqq:"\u2ab6",succnsim:"\u22e9",succsim:"\u227f",sum:"\u2211",sung:"\u266a",sup1:"\xb9",sup2:"\xb2",sup3:"\xb3",sup:"\u2283",supE:"\u2ac6",supdot:"\u2abe",supdsub:"\u2ad8",supe:"\u2287",supedot:"\u2ac4",suphsol:"\u27c9",suphsub:"\u2ad7",suplarr:"\u297b",supmult:"\u2ac2",supnE:"\u2acc",supne:"\u228b",supplus:"\u2ac0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2ac6",supsetneq:"\u228b",supsetneqq:"\u2acc",supsim:"\u2ac8",supsub:"\u2ad4",supsup:"\u2ad6",swArr:"\u21d9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292a",szlig:"\xdf",target:"\u2316",tau:"\u03c4",tbrk:"\u23b4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20db",telrec:"\u2315",tfr:"\ud835\udd31",there4:"\u2234",therefore:"\u2234",theta:"\u03b8",thetasym:"\u03d1",thetav:"\u03d1",thickapprox:"\u2248",thicksim:"\u223c",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223c",thorn:"\xfe",tilde:"\u02dc",times:"\xd7",timesb:"\u22a0",timesbar:"\u2a31",timesd:"\u2a30",tint:"\u222d",toea:"\u2928",top:"\u22a4",topbot:"\u2336",topcir:"\u2af1",topf:"\ud835\udd65",topfork:"\u2ada",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25b5",triangledown:"\u25bf",triangleleft:"\u25c3",trianglelefteq:"\u22b4",triangleq:"\u225c",triangleright:"\u25b9",trianglerighteq:"\u22b5",tridot:"\u25ec",trie:"\u225c",triminus:"\u2a3a",triplus:"\u2a39",trisb:"\u29cd",tritime:"\u2a3b",trpezium:"\u23e2",tscr:"\ud835\udcc9",tscy:"\u0446",tshcy:"\u045b",tstrok:"\u0167",twixt:"\u226c",twoheadleftarrow:"\u219e",twoheadrightarrow:"\u21a0",uArr:"\u21d1",uHar:"\u2963",uacute:"\xfa",uarr:"\u2191",ubrcy:"\u045e",ubreve:"\u016d",ucirc:"\xfb",ucy:"\u0443",udarr:"\u21c5",udblac:"\u0171",udhar:"\u296e",ufisht:"\u297e",ufr:"\ud835\udd32",ugrave:"\xf9",uharl:"\u21bf",uharr:"\u21be",uhblk:"\u2580",ulcorn:"\u231c",ulcorner:"\u231c",ulcrop:"\u230f",ultri:"\u25f8",umacr:"\u016b",uml:"\xa8",uogon:"\u0173",uopf:"\ud835\udd66",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21bf",upharpoonright:"\u21be",uplus:"\u228e",upsi:"\u03c5",upsih:"\u03d2",upsilon:"\u03c5",upuparrows:"\u21c8",urcorn:"\u231d",urcorner:"\u231d",urcrop:"\u230e",uring:"\u016f",urtri:"\u25f9",uscr:"\ud835\udcca",utdot:"\u22f0",utilde:"\u0169",utri:"\u25b5",utrif:"\u25b4",uuarr:"\u21c8",uuml:"\xfc",uwangle:"\u29a7",vArr:"\u21d5",vBar:"\u2ae8",vBarv:"\u2ae9",vDash:"\u22a8",vangrt:"\u299c",varepsilon:"\u03f5",varkappa:"\u03f0",varnothing:"\u2205",varphi:"\u03d5",varpi:"\u03d6",varpropto:"\u221d",varr:"\u2195",varrho:"\u03f1",varsigma:"\u03c2",varsubsetneq:"\u228a\ufe00",varsubsetneqq:"\u2acb\ufe00",varsupsetneq:"\u228b\ufe00",varsupsetneqq:"\u2acc\ufe00",vartheta:"\u03d1",vartriangleleft:"\u22b2",vartriangleright:"\u22b3",vcy:"\u0432",vdash:"\u22a2",vee:"\u2228",veebar:"\u22bb",veeeq:"\u225a",vellip:"\u22ee",verbar:"|",vert:"|",vfr:"\ud835\udd33",vltri:"\u22b2",vnsub:"\u2282\u20d2",vnsup:"\u2283\u20d2",vopf:"\ud835\udd67",vprop:"\u221d",vrtri:"\u22b3",vscr:"\ud835\udccb",vsubnE:"\u2acb\ufe00",vsubne:"\u228a\ufe00",vsupnE:"\u2acc\ufe00",vsupne:"\u228b\ufe00",vzigzag:"\u299a",wcirc:"\u0175",wedbar:"\u2a5f",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\ud835\udd34",wopf:"\ud835\udd68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\ud835\udccc",xcap:"\u22c2",xcirc:"\u25ef",xcup:"\u22c3",xdtri:"\u25bd",xfr:"\ud835\udd35",xhArr:"\u27fa",xharr:"\u27f7",xi:"\u03be",xlArr:"\u27f8",xlarr:"\u27f5",xmap:"\u27fc",xnis:"\u22fb",xodot:"\u2a00",xopf:"\ud835\udd69",xoplus:"\u2a01",xotime:"\u2a02",xrArr:"\u27f9",xrarr:"\u27f6",xscr:"\ud835\udccd",xsqcup:"\u2a06",xuplus:"\u2a04",xutri:"\u25b3",xvee:"\u22c1",xwedge:"\u22c0",yacute:"\xfd",yacy:"\u044f",ycirc:"\u0177",ycy:"\u044b",yen:"\xa5",yfr:"\ud835\udd36",yicy:"\u0457",yopf:"\ud835\udd6a",yscr:"\ud835\udcce",yucy:"\u044e",yuml:"\xff",zacute:"\u017a",zcaron:"\u017e",zcy:"\u0437",zdot:"\u017c",zeetrf:"\u2128",zeta:"\u03b6",zfr:"\ud835\udd37",zhcy:"\u0436",zigrarr:"\u21dd",zopf:"\ud835\udd6b",zscr:"\ud835\udccf",zwj:"\u200d",zwnj:"\u200c"},Lk={}.hasOwnProperty;function Pk(e){return!!Lk.call(Tk,e)&&Tk[e]}var Rk=String.fromCharCode,Hk=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Nk(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o="string"===typeof r.additional?r.additional.charCodeAt(0):r.additional,i=[],a=0,s=-1,l="";r.position&&("start"in r.position||"indent"in r.position?(n=r.position.indent,t=r.position.start):t=r.position);var u,c=(t?t.line:0)||1,f=(t?t.column:0)||1,d=P();for(a--;++a<=e.length;)if(10===u&&(f=(n?n[s]:0)||1),38===(u=e.charCodeAt(a))){var p=e.charCodeAt(a+1);if(9===p||10===p||12===p||32===p||38===p||60===p||Number.isNaN(p)||o&&p===o){l+=Rk(u),f++;continue}var h=a+1,m=h,v=h,g=void 0;if(35===p){v=++m;var y=e.charCodeAt(v);88===y||120===y?(g="hexadecimal",v=++m):g="decimal"}else g="named";var b="",w="",k="",x="named"===g?Mk:"decimal"===g?Ek:Dk;for(v--;++v<=e.length;){var O=e.charCodeAt(v);if(!x(O))break;k+=Rk(O),"named"===g&&jk.includes(k)&&(b=k,w=Pk(k))}var C=59===e.charCodeAt(v);if(C){v++;var S="named"===g&&Pk(k);S&&(b=k,w=S)}var j=1+v-h,A="";if(C||!1!==r.nonTerminated)if(k)if("named"===g){if(C&&!w)R(5,1);else if(b!==k&&(j=1+(v=m+b.length)-m,C=!1),!C){var E=b?1:3;if(r.attribute){var D=e.charCodeAt(v);61===D?(R(E,j),w=""):Mk(D)?w="":R(E,j)}else R(E,j)}A=w}else{C||R(2,j);var M=Number.parseInt(k,"hexadecimal"===g?16:10);if(Fk(M))R(7,j),A=Rk(65533);else if(M in Ak)R(6,j),A=Ak[M];else{var T="";Vk(M)&&R(6,j),M>65535&&(T+=Rk((M-=65536)>>>10|55296),M=56320|1023&M),A=T+Rk(M)}}else"named"!==g&&R(4,j);else;if(A){H(),d=P(),a=v-1,f+=v-h+1,i.push(A);var L=P();L.offset++,r.reference&&r.reference.call(r.referenceContext,A,{start:d,end:L},e.slice(h-1,v)),d=L}else k=e.slice(h-1,v),l+=k,f+=k.length,a=v-1}else 10===u&&(c++,s++,f=0),Number.isNaN(u)?H():(l+=Rk(u),f++);return i.join("");function P(){return{line:c,column:f,offset:a+((t?t.offset:0)||0)}}function R(e,t){var n;r.warning&&((n=P()).column+=t,n.offset+=t,r.warning.call(r.warningContext,Hk[e],n,e))}function H(){l&&(i.push(l),r.text&&r.text.call(r.textContext,l,{start:d,end:P()}),l="")}}function Fk(e){return e>=55296&&e<=57343||e>1114111}function Vk(e){return e>=1&&e<=8||11===e||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||65535===(65535&e)||65534===(65535&e)}var zk=0,_k={},Bk={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++zk}),e.__id},clone:function e(t,n){var r,o;switch(n=n||{},Bk.util.type(t)){case"Object":if(o=Bk.util.objId(t),n[o])return n[o];for(var i in r={},n[o]=r,t)t.hasOwnProperty(i)&&(r[i]=e(t[i],n));return r;case"Array":return o=Bk.util.objId(t),n[o]?n[o]:(r=[],n[o]=r,t.forEach((function(t,o){r[o]=e(t,n)})),r);default:return t}}},languages:{plain:_k,plaintext:_k,text:_k,txt:_k,extend:function(e,t){var n=Bk.util.clone(Bk.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){var o=(r=r||Bk.languages)[e],i={};for(var a in o)if(o.hasOwnProperty(a)){if(a==t)for(var s in n)n.hasOwnProperty(s)&&(i[s]=n[s]);n.hasOwnProperty(a)||(i[a]=o[a])}var l=r[e];return r[e]=i,Bk.languages.DFS(Bk.languages,(function(t,n){n===l&&t!=e&&(this[t]=i)})),i},DFS:function e(t,n,r,o){o=o||{};var i=Bk.util.objId;for(var a in t)if(t.hasOwnProperty(a)){n.call(t,a,t[a],r||a);var s=t[a],l=Bk.util.type(s);"Object"!==l||o[i(s)]?"Array"!==l||o[i(s)]||(o[i(s)]=!0,e(s,n,a,o)):(o[i(s)]=!0,e(s,n,null,o))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Bk.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Bk.tokenize(r.code,r.grammar),Bk.hooks.run("after-tokenize",r),Ik.stringify(Bk.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var o=new Wk;return Uk(o,o.head,e),qk(e,o,t,o.head,0),function(e){var t=[],n=e.head.next;for(;n!==e.tail;)t.push(n.value),n=n.next;return t}(o)},hooks:{all:{},add:function(e,t){var n=Bk.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Bk.hooks.all[e];if(n&&n.length)for(var r,o=0;r=n[o++];)r(t)}},Token:Ik};function Ik(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length}function $k(e,t,n,r){e.lastIndex=t;var o=e.exec(n);if(o&&r&&o[1]){var i=o[1].length;o.index+=i,o[0]=o[0].slice(i)}return o}function qk(e,t,n,r,o,i){for(var a in n)if(n.hasOwnProperty(a)&&n[a]){var s=n[a];s=Array.isArray(s)?s:[s];for(var l=0;l=i.reach);g+=v.value.length,v=v.next){var y=v.value;if(t.length>e.length)return;if(!(y instanceof Ik)){var b,w=1;if(d){if(!(b=$k(m,g,e,f))||b.index>=e.length)break;var k=b.index,x=b.index+b[0].length,O=g;for(O+=v.value.length;k>=O;)O+=(v=v.next).value.length;if(g=O-=v.value.length,v.value instanceof Ik)continue;for(var C=v;C!==t.tail&&(Oi.reach&&(i.reach=E);var D=v.prev;if(j&&(D=Uk(t,D,j),g+=j.length),Kk(t,D,w),v=Uk(t,D,new Ik(a,c?Bk.tokenize(S,c):S,p,S)),A&&Uk(t,v,A),w>1){var M={cause:a+","+l,reach:E};qk(e,t,n,v.prev,g,M),i&&M.reach>i.reach&&(i.reach=M.reach)}}}}}}function Wk(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function Uk(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function Kk(e,t,n){for(var r=t.next,o=0;o-1||(null===(n=e.alias)||void 0===n?void 0:n.some((function(e){return e.toLowerCase().indexOf(t)>-1})))})))}}),Object(Oa.jsx)(ns.Flex,Object.assign({sx:{flexDirection:"column",pt:1,mt:1}},{children:a.map((function(e){return Object(Oa.jsxs)(ms,Object.assign({variant:"menuitem",sx:{textAlign:"left",py:1,display:"flex",justifyContent:"space-between",alignItems:"center"},onClick:function(){return t(e.filename)}},{children:[Object(Oa.jsx)(is,Object.assign({variant:"body"},{children:e.title})),n===e.filename?Object(Oa.jsx)(ds,{path:ps.check,size:"small"}):e.alias?Object(Oa.jsx)(is,Object.assign({variant:"subBody",sx:{fontSize:"10px"}},{children:e.alias.slice(0,3).join(", ")})):null]}),e.title)}))}))]}))}))}function nx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.reduce((function(e,n){if("comment"===n.type||"doctype"===n.type)return e;var r=Object(l.a)(t);return"element"===n.type&&n.properties?r.push.apply(r,Object(l.a)(n.properties.className)):r.push("token","text"),"element"===n.type?e.push.apply(e,Object(l.a)(nx(n.children,r))):e.push({classes:r,text:n.value}),e}),[])}function rx(e,t,n,r){var o=String(n).length,i={class:"line-number ".concat(r?"active":""),"data-line":String(t).padEnd(o," ")},a={line:t,active:r,total:n,from:e};return Zt.inline(e,e+1,i,a)}function ox(e){var t=e.doc,n=e.name,r=e.defaultLanguage,o=e.caretPosition,i=[],a=Yk.listLanguages();return Lo(t,(function(e){return e.type.name===n})).forEach((function(e){var t,n=e.node.textContent,s=wx(n,e.pos),l=Object(xa.a)(s||[]);try{for(l.s();!(t=l.n()).done;){var u=t.value,c=u.index+1,f=c===(null===o||void 0===o?void 0:o.line)&&u.from===(null===o||void 0===o?void 0:o.from),d=rx(u.from,c,(null===s||void 0===s?void 0:s.length)||0,f);i.push(d)}}catch(v){l.e(v)}finally{l.f()}var p=e.node.attrs.language||r,h=a.includes(p)?Yk.highlight(n,p).children||[]:null;if(h){var m=e.pos+1;nx(h).forEach((function(e){var t=m+e.text.length;if(e.classes.length){var n=Zt.inline(m,t,{class:e.classes.join(" ")});i.push(n)}m=t}))}})),Qt.create(t,i)}function ix(e){var t=e.name,n=e.defaultLanguage,r=new p.PluginKey("highlighter");return new p.Plugin({key:r,state:{init:function(e,r){return ox({doc:r.doc,name:t,defaultLanguage:n})},apply:function(e,r,o,i){var a=o.selection.$head.parent.type.name,s=i.selection.$head.parent.type.name,l=Lo(o.doc,(function(e){return e.type.name===t})),u=Lo(i.doc,(function(e){return e.type.name===t})),c=bx(i.selection);return e.docChanged&&([a,s].includes(t)||u.length!==l.length||e.steps.some((function(e){return void 0!==e.from&&void 0!==e.to&&l.some((function(t){return t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to}))})))?ox({doc:e.doc,name:t,defaultLanguage:n,caretPosition:c}):(r=function(e,t,n){var r=t.find(void 0,void 0,(function(e){var t=e.line,r=e.active,o=e.from;return!!n&&(t===n.line&&o===n.from)||r}));if(!r.length)return t;var o=r.slice();t=t.remove(r);var i,a=[],s=Object(xa.a)(o);try{for(s.s();!(i=s.n()).done;){var l=i.value,u=l.from,c=l.spec,f=c.line,d=c.total,p=f===(null===n||void 0===n?void 0:n.line),h=rx(u,f,(null===n||void 0===n?void 0:n.total)||d,p);a.push(h)}}catch(m){s.e(m)}finally{s.f()}return t.add(e,a)}(e.doc,r,c),r.map(e.mapping,e.doc))}},props:{decorations:function(e){return r.getState(e)}},appendTransaction:function(e,n,r){var o=r.tr,i=!1,a=e.some((function(e){return e.docChanged})),s=(r.selection.$from.parent.type.name===t||n.selection.$from.parent.type.name===t)&&n.selection.$from.pos!==r.selection.$from.pos;return Lo(r.doc,(function(e){return e.type.name===t})).forEach((function(e){var t,n=e.node,l=e.pos,u=Object.assign({},n.attrs);if(a||!(null===(t=u.lines)||void 0===t?void 0:t.length)){var c=wx(n.textContent,l);u.lines=c.slice()}if(s){var f=bx(r.selection,a?wx(n.textContent,l):void 0);u.caretPosition=f}(a||s)&&(o.setNodeMarkup(l,n.type,u),i=!0)})),i?o:null}})}var ax=/^(?:( )+|\t+)/,sx="space";function lx(e,t){var n,r,o,i=new Map,a=0,s=Object(xa.a)(e.split(/\n/g));try{for(s.s();!(o=s.n()).done;){var l=o.value;if(l){var u=void 0,c=void 0,f=void 0,d=void 0,p=l.match(ax);if(null===p)a=0,n="";else{if(u=p[0].length,c=p[1]?sx:"tab",t&&c===sx&&1===u)continue;c!==n&&(a=0),n=c,f=0;var h=u-a;if(a=u,0===h)f++;else r=ux(c,h>0?h:-h);d=void 0===(d=i.get(r))?[1,0]:[++d[0],d[1]+f],i.set(r,d)}}}}catch(m){s.e(m)}finally{s.f()}return i}function ux(e,t){return(e===sx?"s":"t")+String(t)}function cx(e){if("string"!==typeof e)throw new TypeError("Expected a string");var t=lx(e,!0);0===t.size&&(t=lx(e,!1));var n,r,o=function(e){var t,n,r=0,o=0,i=Object(xa.a)(e);try{for(i.s();!(n=i.n()).done;){var a=Object(u.a)(n.value,2),s=a[0],l=Object(u.a)(a[1],2),c=l[0],f=l[1];(c>r||c===r&&f>o)&&(r=c,o=f,t=s)}}catch(d){i.e(d)}finally{i.f()}return t}(t),i=0,a="";if(void 0!==o){var s={type:"s"===(r=o)[0]?sx:"tab",amount:Number(r.slice(1))};a=function(e,t){return(e===sx?" ":"\t").repeat(t)}(n=s.type,i=s.amount)}return{amount:i,type:n,indent:a}}var fx=n(62),dx=n.n(fx);function px(e){var t=dx()(e);if(0===t)return e;var n=new RegExp("^[ \\t]{".concat(t,"}"),"gm");return e.replace(n,"")}function hx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.indent,o=void 0===r?" ":r,i=n.includeEmptyLines,a=void 0!==i&&i;if("string"!==typeof e)throw new TypeError("Expected `input` to be a `string`, got `".concat(typeof e,"`"));if("number"!==typeof t)throw new TypeError("Expected `count` to be a `number`, got `".concat(typeof t,"`"));if(t<0)throw new RangeError("Expected `count` to be at least 0, got `".concat(t,"`"));if("string"!==typeof o)throw new TypeError("Expected `options.indent` to be a `string`, got `".concat(typeof o,"`"));if(0===t)return e;var s=a?/^/gm:/^(?!\s*$)/gm;return e.replace(s,o.repeat(t))}function mx(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return hx(px(e),t,n)}var vx=/^```([a-z]+)?[\s\n]$/,gx=/^~~~([a-z]+)?[\s\n]$/,yx=_o.create({name:"codeblock",addOptions:function(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes:function(){var e=this;return{caretPosition:{default:void 0,rendered:!1},lines:{default:[],rendered:!1},indentType:{default:"space",parseHTML:function(e){return e.dataset.indentType},renderHTML:function(e){return e.indentType?{"data-indent-type":e.indentType}:{}}},indentLength:{default:2,parseHTML:function(e){return e.dataset.indentLength},renderHTML:function(e){return e.indentLength?{"data-indent-length":e.indentLength}:{}}},language:{default:null,parseHTML:function(t){var n,r=e.options.languageClassPrefix,o=[].concat(Object(l.a)(t.classList||[]),Object(l.a)((null===(n=null===t||void 0===t?void 0:t.firstElementChild)||void 0===n?void 0:n.classList)||[])).filter((function(e){return e.startsWith(r)})).map((function(e){return e.replace(r,"")}))[0];return o||null},renderHTML:function(e){return e.language?{class:"language-".concat(e.language)}:{}}}}},parseHTML:function(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML:function(e){var t=e.HTMLAttributes;return["pre",Sr(this.options.HTMLAttributes,t),["code",{},0]]},addCommands:function(){var e=this;return{setCodeBlock:function(t){return function(n){return n.commands.setNode(e.name,t)}},toggleCodeBlock:function(t){return function(n){var r=n.commands;return console.log("TOGGLING!"),r.toggleNode(e.name,"paragraph",t)}},changeCodeBlockIndentation:function(t){return function(n){var r=n.editor,o=n.tr,i=n.commands,a=r.state.selection.$from;if(a.parent.type!==e.type)return!1;var s,l=a.parent.attrs.lines,u=Object(xa.a)(l);try{for(u.s();!(s=u.n()).done;){var c=s.value,f=c.text(),d=f.length-f.trimStart().length;if(d){var p=d,h=Cx({type:t.type,amount:p});o.insertText(h,o.mapping.map(c.from),o.mapping.map(c.from+d))}}}catch(m){u.e(m)}finally{u.f()}return i.updateAttributes(e.type,{indentType:t.type,indentLength:t.amount}),!0}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Alt-c":function(){return e.editor.commands.toggleCodeBlock()},"Mod-a":function(t){var n=t.editor,r=e.editor.state.selection.$anchor;if(r.parent.type.name!==e.name)return!1;var o=mo(r,(function(t){return t.type.name===e.type.name}));return!!o&&n.commands.setTextSelection({from:o.pos+1,to:o.pos+o.node.nodeSize-1})},Backspace:function(){var t=e.editor.state.selection,n=t.empty,r=t.$anchor,o=1===r.pos;return!(!n||r.parent.type.name!==e.name)&&(!(!o&&r.parent.textContent.length)&&e.editor.commands.deleteNode(e.type))},Enter:function(t){var n=t.editor,r=n.state.selection,o=r.$from;if(!r.empty||o.parent.type!==e.type)return!1;var i=xx(o.parent);return e.options.exitOnTripleEnter&&function(e,t){var n=t.parentOffset===t.parent.nodeSize-2,r=t.parent.textContent.endsWith("\n\n");if(!n||!r)return!1;return e.chain().command((function(e){return e.tr.delete(t.pos-2,t.pos),!0})).exitCode().run()}(n,o)||function(e,t,n){var r=function(e,t){var n=function(e,t){return e.find((function(e){return t>=e.from&&t<=e.to}))}(e.parent.attrs.lines,e.pos);if(!n)return!1;var r=n.text(),o=r.length-r.trimStart().length;return{newline:"\n",indentation:Cx({amount:o,type:t.type})}}(t,n)||{},o=r.indentation,i=r.newline;return!!i&&e.chain().insertContent("".concat(i).concat(o),{parseOptions:{preserveWhitespace:"full"}}).focus().run()}(n,o,i)},ArrowUp:function(t){var n=t.editor;if(!e.options.exitOnArrowUp)return!1;var r=n.state.selection,o=r.$anchor;return!(!r.empty||o.parent.type!==e.type)&&(!(1!==o.pos)&&n.commands.insertContentAt(0,"

"))},ArrowDown:function(t){var n=t.editor;if(!e.options.exitOnArrowDown)return!1;var r=n.state,o=r.selection,i=r.doc,a=o.$from;if(!o.empty||a.parent.type!==e.type)return!1;if(!(a.parentOffset===a.parent.nodeSize-2))return!1;var s=a.after();return void 0!==s&&(i.nodeAt(s)?(n.commands.setNodeSelection(a.before()),!1):n.commands.exitCode())},"Shift-Tab":function(t){var n=t.editor,r=n.state.selection,o=r.$from;if(o.parent.type!==e.type)return!1;var i=xx(o.parent),a=Cx(i),s=kx(o.parent.attrs.lines,r);return n.chain().command((function(e){return Sx(e.tr,(function(e){var t,n=Object(xa.a)(s);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.text(a.length)===a&&e.delete(e.mapping.map(r.from),e.mapping.map(r.from+i.amount))}}catch(o){n.e(o)}finally{n.f()}}))})).run()},Tab:function(t){var n=t.editor,r=n.state.selection,o=r.$from;if(o.parent.type!==e.type)return!1;var i=kx(o.parent.attrs.lines,r);return n.chain().command((function(e){return Sx(e.tr,(function(e){var t=Cx(xx(o.parent));if(1===i.length)return e.insertText(t,o.pos);var n,r=Object(xa.a)(i);try{for(r.s();!(n=r.n()).done;){var a=n.value;e.insertText(t,e.mapping.map(a.from))}}catch(s){r.e(s)}finally{r.f()}}))})).run()}}},addInputRules:function(){return[Fo({find:vx,type:this.type,getAttributes:function(e){return{language:e[1]}}}),Fo({find:gx,type:this.type,getAttributes:function(e){return{language:e[1]}}})]},addProseMirrorPlugins:function(){var e=this;return[new p.Plugin({key:new p.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:function(t,n){if(!n.clipboardData)return!1;var r=n.clipboardData.getData("text/plain"),o=n.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,a=null===i||void 0===i?void 0:i.mode;if(!r||!a)return!1;var s=function(e,t){var n=t||cx(e),r=n.amount,o=n.type,i=void 0===o?"space":o;return{code:px(mx(e,r,{includeEmptyLines:!1,indent:"space"===i?" ":"\t"})),amount:r,type:i}}(r,xx(t.state.selection.$from.parent)),l=t.state.tr;return e.editor.isActive(e.type.name)||l.replaceSelectionWith(e.type.create({language:a,indentType:s.type,indentLength:s.amount})),l.insertText(s.code.replace(/\r\n?/g,"\n")),l.setMeta("paste",!0),t.dispatch(l),!0}}}),ix({name:this.name,defaultLanguage:"txt"})]},addNodeView:function(){return za(ex,{contentDOMFactory:function(){var e=document.createElement("div");return e.classList.add("node-content-wrapper"),e.style.whiteSpace="inherit",e.style.minWidth="20px",{dom:e}},shouldUpdate:function(e,t){var n=e.attrs,r=t.attrs;return function(e,t){return void 0===t||(null===e||void 0===e?void 0:e.column)!==(null===t||void 0===t?void 0:t.column)||(null===e||void 0===e?void 0:e.line)!==(null===t||void 0===t?void 0:t.line)}(n.caretPosition,r.caretPosition)||n.language!==r.language||n.indentType!==r.indentType}})}});function bx(e,t){var n=e.$from,r=e.$to,o=e.$head;if(n.parent.type.name===yx.name){t=t||(n.parent.attrs.lines||[]);var i,a=Object(xa.a)(t);try{for(a.s();!(i=a.n()).done;){var s=i.value;if(o.pos>=s.from&&o.pos<=s.to){var l=s.length+1;return{line:s.index+1,column:l-(s.to-o.pos),selected:r.pos-n.pos,total:t.length,from:s.from}}}}catch(u){a.e(u)}finally{a.f()}}}function wx(e,t){for(var n=[],r=0,o=t+1,i=0,a=function(){var t=e.indexOf("\n",r);t<=-1&&(t=e.length);var a=t-r,s=o+a,l=r;n.push({index:i,length:a,from:o,to:s,text:function(t){return e.slice(l,t?l+t:l+a)}}),o=s+1,r=t+1,++i};r<=e.length;)a();return n}function kx(e,t){var n=t.$from,r=t.$to;return e.filter((function(e){return Ox(e.from,n.pos,r.pos)||Ox(e.to,n.pos,r.pos)||Ox(n.pos,e.from,e.to)}))}function xx(e){if(e.type.name===yx.name){var t=e.attrs,n=t.indentType,r=t.indentLength;return{type:n,amount:parseInt(r)}}}function Ox(e,t,n){return e>=t&&e<=n}function Cx(e){return("space"===e.type?" ":"\t").repeat(e.amount)}function Sx(e,t){var n=e.selection,r=n.$anchor,o=n.$head;return t(e),e.setSelection(new p.TextSelection(e.doc.resolve(e.mapping.map(r.pos)),e.doc.resolve(e.mapping.map(o.pos)))),!0}var jx=Gi.extend({addKeyboardShortcuts:function(){var e,t=this;return Object.assign(Object.assign({},null===(e=this.parent)||void 0===e?void 0:e.call(this)),{Backspace:function(e){return yw(e.editor,t.name,t.type)}})}});function Ax(e){var t,n,r=e.editor,o=(e.updateAttributes,e.node),i=e.getPos,a=e.forwardRef,s=Ha(),l=(null===(t=o.lastChild)||void 0===t?void 0:t.type.name)===Lx.name,c=l&&(null===(n=o.lastChild)||void 0===n?void 0:n.attrs.collapsed),f=function(){var e=Lo(o,(function(e){return e.type.name===Lx.name})),t=Object(u.a)(e,1)[0];if(t){var n=t.pos;r.commands.toggleOutlineCollapse(n+i()+1,!c)}};return Object(Oa.jsxs)(ns.Flex,{children:[Object(Oa.jsxs)(ns.Flex,Object.assign({className:"outline",sx:{flexDirection:"column",alignItems:"center",mt:s?"0px":"3px"}},{children:[l?Object(Oa.jsx)(ds,{path:c?ps.chevronRight:ps.chevronDown,title:c?"Click to uncollapse list":"Click to collapse list",sx:{cursor:"pointer",transition:"all .2s ease-in-out",":hover":{transform:["unset","scale(1.3)"]},":active":{transform:["scale(1.3)","unset"]},".icon:hover path":{fill:"var(--checked) !important"}},size:s?24:18,onMouseDown:function(e){return e.preventDefault()},onTouchEnd:function(e){e.preventDefault(),f()},onClick:f}):Object(Oa.jsx)(ds,{path:ps.circle,size:s?24:18,sx:{transform:"scale(0.4)"}}),l&&!c&&Object(Oa.jsx)(ns.Box,{sx:{flex:1,width:1,mt:2,backgroundColor:"border",borderRadius:50,flexShrink:0,cursor:"pointer",transition:"all .2s ease-in-out",":hover":{backgroundColor:"fontTertiary",width:4}},contentEditable:!1})]})),Object(Oa.jsx)(is,{ref:a,sx:{pl:1,listStyleType:"none",flex:1}})]})}var Ex=_o.create({name:"outlineListItem",addOptions:function(){return{HTMLAttributes:{}}},content:"heading* paragraph block*",defining:!0,parseHTML:function(){return[{tag:'li[data-type="'.concat(this.name,'"]')}]},renderHTML:function(e){var t=e.HTMLAttributes;return["li",Sr(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addKeyboardShortcuts:function(){var e=this;return{"Mod-Space":function(t){var n=function(e,t){var n,r,o=e.state.selection.$from,i=Object(jb.findParentNodeOfTypeClosestToPos)(o,t);if(!i)return!1;var a=Lo(i.node,(function(e){return e.type.name===Lx.name})),s=Object(u.a)(a,1)[0];if(!s)return!1;var l=(null===(n=null===s||void 0===s?void 0:s.node)||void 0===n?void 0:n.type.name)===Lx.name,c=null===(r=null===s||void 0===s?void 0:s.node)||void 0===r?void 0:r.attrs.collapsed,f=i.pos+s.pos+1;return{isCollapsed:c,isNested:l,subListPos:f}}(t.editor,e.type);if(!n)return!1;var r=n.isCollapsed,o=n.subListPos;return e.editor.commands.toggleOutlineCollapse(o,!r)},Enter:function(t){t.editor;return e.editor.commands.splitListItem(e.name)},Tab:function(){return e.editor.commands.sinkListItem(e.name)},"Shift-Tab":function(){return e.editor.commands.liftListItem(e.name)},Backspace:function(t){return yw(t.editor,e.name,e.type)}}},addCommands:function(){return{toggleOutlineCollapse:function(e,t){return function(n){return n.tr.setNodeMarkup(e,void 0,{collapsed:t}),!0}}}},addNodeView:function(){return za(Ax,{contentDOMFactory:!0,wrapperFactory:function(){return document.createElement("li")}})}});function Dx(e){var t=e.editor,n=e.getPos,r=e.node,o=(e.updateAttributes,e.forwardRef),i=r.attrs.collapsed,a=Object(Ca.useMemo)((function(){var e;return(null===(e=t.state.doc.resolve(n()).parent)||void 0===e?void 0:e.type.name)===Ex.name}),[]);return Object(Oa.jsx)(Oa.Fragment,{children:Object(Oa.jsx)(is,{className:"outline-list",as:"div",ref:o,sx:{ul:{display:i?"none":"block",paddingInlineStart:0,paddingLeft:0,marginBlockStart:a?5:0,marginBlockEnd:0},li:{listStyleType:"none"}}})})}var Mx=/^\s*(-o)\s$/,Tx="outlineListItem",Lx=_o.create({name:"outlineList",addOptions:function(){return{HTMLAttributes:{}}},addAttributes:function(){return{collapsed:{default:!1,keepOnSplit:!1,parseHTML:function(e){return"true"===e.dataset.collapsed},renderHTML:function(e){return{"data-collapsed":!0===e.collapsed}}}}},group:"block list",content:"".concat(Tx,"+"),parseHTML:function(){return[{tag:'ul[data-type="'.concat(this.name,'"]'),priority:52}]},renderHTML:function(e){var t=e.HTMLAttributes;return["ul",Sr(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands:function(){var e=this;return{toggleOutlineList:function(){return function(t){return t.commands.toggleList(e.name,Tx)}}}},addKeyboardShortcuts:function(){var e=this;return{"Mod-Shift-O":function(){return e.editor.commands.toggleOutlineList()}}},addInputRules:function(){return[Vo({find:Mx,type:this.type})]},addNodeView:function(){var e=this;return za(Dx,{contentDOMFactory:function(){var t=document.createElement("ul");return t.classList.add("".concat(e.name.toLowerCase(),"-content-wrapper")),t.style.whiteSpace="inherit",{dom:t}}})}});function Px(e,t,n,r,o,i){for(var a=0,s=!0,l=t.firstChild,u=e.firstChild,c=0,f=0;c0&&void 0!==arguments[0]?arguments[0]:{},t=e.rows,n=void 0===t?3:t,r=e.cols,o=void 0===r?3:r,i=e.withHeaderRow,a=void 0===i||i;return function(e){var t=e.tr,r=e.dispatch,i=Nx(e.editor.schema,n,o,a);if(r){var s=t.selection.anchor+1;t.replaceSelectionWith(i).scrollIntoView().setSelection(p.TextSelection.near(t.doc.resolve(s)))}return!0}},addColumnBefore:function(){return function(e){return function(e,t){if(!Pg(e))return!1;if(t){var n=cy(e);t(fy(e.tr,n,n.left))}return!0}(e.state,e.dispatch)}},addColumnAfter:function(){return function(e){return function(e,t){if(!Pg(e))return!1;if(t){var n=cy(e);t(fy(e.tr,n,n.right))}return!0}(e.state,e.dispatch)}},deleteColumn:function(){return function(e){return function(e,t){if(!Pg(e))return!1;if(t){var n=cy(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(var o=n.right-1;dy(r,n,o),o!=n.left;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Eg.get(n.table);t(r)}return!0}(e.state,e.dispatch)}},addRowBefore:function(){return function(e){return function(e,t){if(!Pg(e))return!1;if(t){var n=cy(e);t(py(e.tr,n,n.top))}return!0}(e.state,e.dispatch)}},addRowAfter:function(){return function(e){return function(e,t){if(!Pg(e))return!1;if(t){var n=cy(e);t(py(e.tr,n,n.bottom))}return!0}(e.state,e.dispatch)}},deleteRow:function(){return function(e){return function(e,t){if(!Pg(e))return!1;if(t){var n=cy(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(var o=n.bottom-1;hy(r,n,o),o!=n.top;o--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Eg.get(n.table);t(r)}return!0}(e.state,e.dispatch)}},deleteTable:function(){return function(e){return function(e,t){for(var n=e.selection.$anchor,r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e.state,e.dispatch)}},mergeCells:function(){return function(e){return vy(e.state,e.dispatch)}},splitCell:function(){return function(e){return gy(e.state,e.dispatch)}},toggleHeaderColumn:function(){return function(e){var t=e.state,n=e.dispatch;return by("column")(t,n)}},toggleHeaderRow:function(){return function(e){var t=e.state,n=e.dispatch;return by("row")(t,n)}},toggleHeaderCell:function(){return function(e){var t=e.state,n=e.dispatch;return wy(t,n)}},mergeOrSplit:function(){return function(e){var t=e.state,n=e.dispatch;return!!vy(t,n)||gy(t,n)}},setCellAttribute:function(e,t){return function(n){var r=n.state,o=n.dispatch;return function(e,t){return function(n,r){if(!Pg(n))return!1;var o=Rg(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){var i=n.tr;n.selection instanceof Bg?n.selection.forEachCell((function(n,r){n.attrs[e]!==t&&i.setNodeMarkup(r,null,Vg(n.attrs,e,t))})):i.setNodeMarkup(o.pos,null,Vg(o.nodeAfter.attrs,e,t)),r(i)}return!0}}(e,t)(r,o)}},goToNextCell:function(){return function(e){var t=e.state,n=e.dispatch;return ky(1)(t,n)}},goToPreviousCell:function(){return function(e){var t=e.state,n=e.dispatch;return ky(-1)(t,n)}},fixTables:function(){return function(e){var t=e.state;return e.dispatch&&uy(t),!0}},setCellSelection:function(e){return function(t){var n=t.tr;if(t.dispatch){var r=Bg.create(n.doc,e.anchorCell,e.headCell);n.setSelection(r)}return!0}}}},addKeyboardShortcuts:function(){var e=this;return{Tab:function(){return!!e.editor.commands.goToNextCell()||!!e.editor.can().addRowAfter()&&e.editor.chain().addRowAfter().goToNextCell().run()},"Shift-Tab":function(){return e.editor.commands.goToPreviousCell()},Backspace:Fx,"Mod-Backspace":Fx,Delete:Fx,"Mod-Delete":Fx}},addProseMirrorPlugins:function(){var e=this.options.resizable&&this.editor.isEditable;return[].concat(Object(l.a)(e?[Sy({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.View,lastColumnResizable:this.options.lastColumnResizable})]:[]),[Hy({allowTableNodeSelection:this.options.allowTableNodeSelection})])},extendNodeSchema:function(e){return{tableRole:Er(kr(e,"tableRole",{name:e.name,options:e.options,storage:e.storage}))}}});function zx(e){var t=e.editor,n=e.node,r=e.forwardRef,o=Object(Ca.useRef)(null),i=Object(Ca.useRef)(),a=t.isActive("table");return Object(Ca.useEffect)((function(){o.current&&i.current&&Oy(n,o.current,i.current,50)}),[n]),Object(Oa.jsxs)(Oa.Fragment,{children:[Object(Oa.jsx)(nm,{children:a&&Object(Oa.jsxs)(Oa.Fragment,{children:[Object(Oa.jsx)(_x,{editor:t,table:i.current}),Object(Oa.jsx)(Bx,{editor:t,table:i.current})]})}),Object(Oa.jsx)("div",Object.assign({className:"tableWrapper"},{children:Object(Oa.jsx)("table",Object.assign({ref:function(e){null===r||void 0===r||r(e),i.current=e||void 0}},{children:Object(Oa.jsx)("colgroup",{ref:o})}))}))]})}function _x(e){var t=e.editor,n=Object(Ca.useRef)(null);return Object(Ca.useEffect)((function(){if(n.current){var e=Dv(t,["tableRow"]);if(e){var r=Nh(n.current,{location:"left",target:e,align:"start",xOffset:-5,yOffset:-3});n.current.style.top="".concat(r.top,"px"),n.current.style.left="".concat(r.left,"px")}}}),[t.state.selection,n.current]),Object(Oa.jsxs)(ns.Flex,Object.assign({ref:n,sx:{zIndex:999,top:0,left:0,position:"absolute",bg:"background",flexWrap:"nowrap",borderRadius:"default",opacity:.3,":hover":{opacity:1}}},{children:[Object(Oa.jsx)(Jy,Object.assign({},qy("rowProperties"),{icon:"more",variant:"small",editor:t})),Object(Oa.jsx)(bb,Object.assign({},qy("insertRowBelow"),{editor:t,variant:"small"}))]}))}function Bx(e){var t=e.editor,n=e.table,r=Object(Ca.useRef)(null);return Object(Ca.useEffect)((function(){if(r.current&&n){var e=Dv(t,["tableCell","tableHeader"]);if(e){var o=Nh(r.current,{location:"top",align:"center",target:e,yAnchor:n,yOffset:2});r.current.style.left="".concat(o.left,"px"),r.current.style.top="".concat(o.top,"px")}}}),[t.state.selection,r.current,n]),Object(Oa.jsxs)(ns.Flex,Object.assign({ref:r,sx:{zIndex:999,top:0,left:0,position:"absolute",bg:"background",flexWrap:"nowrap",borderRadius:"default",opacity:.3,":hover":{opacity:1}}},{children:[Object(Oa.jsx)(Zy,{editor:t,title:"tableProperties",icon:"more",variant:"small"}),Object(Oa.jsx)(db,Object.assign({},qy("insertColumnRight"),{editor:t,variant:"small",icon:"plus"}))]}))}var Ix=Vx.extend({addProseMirrorPlugins:function(){var e,t=this.options.resizable&&this.editor.isEditable;return[].concat(Object(l.a)(t?[Sy({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:(e=this.editor,function(t){Object(i.a)(r,t);var n=Object(a.a)(r);function r(t,i){var a,s;return Object(c.a)(this,r),s=n.call(this,t,e,(function(){return 0}),{component:zx,shouldUpdate:function(e,t){return e.type===t.type},contentDOMFactory:function(){return{dom:document.createElement("tbody")}},wrapperFactory:function(){var e=document.createElement("div");return e.style.position="relative",e}}),Object(h.a)((a=Object(o.a)(s),Object(m.a)(r.prototype)),"init",a).call(a),s}return Object(f.a)(r)}(Xa)),lastColumnResizable:this.options.lastColumnResizable})]:[]),[Hy({allowTableNodeSelection:this.options.allowTableNodeSelection})])}});function $x(e){this.j={},this.jr=[],this.jd=null,this.t=e}$x.prototype={accepts:function(){return!!this.t},tt:function(e,t){if(t&&t.j)return this.j[e]=t,t;var n=t,r=this.j[e];if(r)return n&&(r.t=n),r;r=qx();var o=Gx(this,e);return o?(Object.assign(r.j,o.j),r.jr.append(o.jr),r.jr=o.jd,r.t=n||o.t):r.t=n,this.j[e]=r,r}};var qx=function(){return new $x},Wx=function(e){return new $x(e)},Ux=function(e,t,n){e.j[t]||(e.j[t]=n)},Kx=function(e,t,n){e.jr.push([t,n])},Gx=function(e,t){var n=e.j[t];if(n)return n;for(var r=0;r=a)return[];for(;i0&&void 0!==arguments[0]?arguments[0]:[],t=qx(),n=Wx(tO),r=Wx(Xx),o=qx(),i=Wx(oO),a=[[qO,r],[BO,r],[IO,r],[$O,r]],s=function(){var e=Wx(Xx);return e.j={"-":o},e.jr=[].concat(a),e},l=function(e){var t=s();return t.t=e,t};Zx(t,[["'",Wx(mO)],["{",Wx(aO)],["[",Wx(sO)],["<",Wx(lO)],["(",Wx(uO)],["}",Wx(cO)],["]",Wx(fO)],[">",Wx(dO)],[")",Wx(pO)],["&",Wx(hO)],["*",Wx(vO)],["@",Wx(gO)],["`",Wx(bO)],["^",Wx(wO)],[":",Wx(kO)],[",",Wx(xO)],["$",Wx(OO)],[".",Wx(CO)],["=",Wx(SO)],["!",Wx(jO)],["-",Wx(AO)],["%",Wx(EO)],["|",Wx(DO)],["+",Wx(MO)],["#",Wx(TO)],["?",Wx(LO)],['"',Wx(PO)],["/",Wx(HO)],[";",Wx(RO)],["~",Wx(NO)],["_",Wx(FO)],["\\",Wx(yO)]]),Ux(t,"\n",Wx(iO)),Kx(t,WO,i),Ux(i,"\n",qx()),Kx(i,WO,i);for(var u=0;u<_O.length;u++)Yx(t,_O[u],l(eO),s);var c=s(),f=s(),d=s(),p=s();Yx(t,"file",c,s),Yx(t,"ftp",f,s),Yx(t,"http",d,s),Yx(t,"mailto",p,s);var h=s(),m=Wx(nO),v=Wx(rO);Ux(f,"s",h),Ux(f,":",m),Ux(d,"s",h),Ux(d,":",m),Ux(c,":",m),Ux(h,":",m),Ux(p,":",v);for(var g=s(),y=0;y2&&void 0!==arguments[2]?arguments[2]:{},r=Object.create(e.prototype);for(var o in n)r[o]=n[o];r.constructor=t,t.prototype=r}(YO,n,t),n}YO.prototype={t:"token",isLink:!1,toString:function(){return this.v},toHref:function(){return this.toString()},startIndex:function(){return this.tk[0].s},endIndex:function(){return this.tk[this.tk.length-1].e},toObject:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:GO.defaultProtocol;return{type:this.t,value:this.v,isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}}};var QO=XO("email",{isLink:!0}),eC=XO("email",{isLink:!0,toHref:function(){return"mailto:"+this.toString()}}),tC=XO("text"),nC=XO("nl"),rC=XO("url",{isLink:!0,toHref:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:GO.defaultProtocol,t=this.tk,n=!1,r=!1,o=[],i=0;t[i].t===nO;)n=!0,o.push(t[i].v),i++;for(;t[i].t===HO;)r=!0,o.push(t[i].v),i++;for(;i=0&&d++,o++,c++;if(d<0)for(var p=o-c;p0&&(i.push(aC(tC,t,a)),a=[]),o-=d,c-=d;var h=f.t,m=n.slice(o-c,o);i.push(aC(h,t,m))}}return a.length>0&&i.push(aC(tC,t,a)),i}(lC.parser.start,e,function(e,t){for(var n=function(e){for(var t=[],n=e.length,r=0;r56319||r+1===n||(i=e.charCodeAt(r+1))<56320||i>57343?e[r]:e.slice(r,r+2);t.push(a),r+=a.length}return t}(t.replace(/[A-Z]/g,(function(e){return e.toLowerCase()}))),r=n.length,o=[],i=0,a=0;a=0&&(f+=n[a].length,d++),u+=n[a].length,i+=n[a].length,a++;i-=f,a-=d,u-=f,o.push({t:c.t,v:t.substr(i-u,u),s:i-u,e:i})}return o}(lC.scanner.start,e))}function fC(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=cC(e),r=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:null,n=cC(e);return 1===n.length&&n[0].isLink&&(!t||n[0].t===t)}function pC(e){return new p.Plugin({key:new p.PluginKey("autolink"),appendTransaction:function(t,n,r){var o=t.some((function(e){return e.docChanged}))&&!n.doc.eq(r.doc),i=t.some((function(e){return e.getMeta("preventAutolink")}));if(o&&!i){var a=r.tr,s=function(e,t){var n=new g.e(e);return t.forEach((function(e){e.steps.forEach((function(e){n.step(e)}))})),n}(n.doc,Object(l.a)(t)),u=s.mapping,c=function(e){var t=e.mapping,n=e.steps,r=[];return t.maps.forEach((function(e,o){var i=[];if(e.ranges.length)e.forEach((function(e,t){i.push({from:e,to:t})}));else{var a=n[o],s=a.from,l=a.to;if(void 0===s||void 0===l)return;i.push({from:s,to:l})}i.forEach((function(e){var n=e.from,i=e.to,a=t.slice(o).map(n,-1),s=t.slice(o).map(i),l=t.invert().map(a,-1),u=t.invert().map(s);r.push({oldRange:{from:l,to:u},newRange:{from:a,to:s}})}))})),Po(r)}(s);if(c.forEach((function(t){var o=t.oldRange,i=t.newRange;Ro(o.from,o.to,n.doc).filter((function(t){return t.mark.type===e.type})).forEach((function(t){var o=Ro(u.map(t.from),u.map(t.to),r.doc).filter((function(t){return t.mark.type===e.type}));if(o.length){var i=o[0],s=n.doc.textBetween(t.from,t.to,void 0," "),l=r.doc.textBetween(i.from,i.to,void 0," "),c=dC(s),f=dC(l);c&&!f&&a.removeMark(i.from,i.to,e.type)}})),function(e,t,n){var r=[];return e.nodesBetween(t.from,t.to,(function(e,t){n(e)&&r.push({node:e,pos:t})})),r}(r.doc,i,(function(e){return e.isTextblock})).forEach((function(t){fC(r.doc.textBetween(t.pos,t.pos+t.node.nodeSize,void 0," ")).filter((function(e){return e.isLink})).filter((function(t){return!e.validate||e.validate(t.value)})).map((function(e){return Object(d.a)(Object(d.a)({},e),{},{from:t.pos+e.start+1,to:t.pos+e.end+1})})).filter((function(e){var t=i.from>=e.from&&i.from<=e.to,n=i.to>=e.from&&i.to<=e.to;return t||n})).forEach((function(t){a.addMark(t.from,t.to,e.type.create({href:t.href}))}))}))})),a.steps.length)return a}}})}var hC=zo.create({name:"link",priority:1e3,keepOnSplit:!1,onCreate:function(){this.options.protocols.forEach(uC)},inclusive:function(){return this.options.autolink},addOptions:function(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},validate:void 0}},addAttributes:function(){return{href:{default:null},target:{default:this.options.HTMLAttributes.target},class:{default:this.options.HTMLAttributes.class}}},parseHTML:function(){return[{tag:'a[href]:not([href *= "javascript:" i])'}]},renderHTML:function(e){var t=e.HTMLAttributes;return["a",Sr(this.options.HTMLAttributes,t),0]},addCommands:function(){var e=this;return{setLink:function(t){return function(n){return(0,n.chain)().setMark(e.name,t).setMeta("preventAutolink",!0).run()}},toggleLink:function(t){return function(n){return(0,n.chain)().toggleMark(e.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},unsetLink:function(){return function(t){return(0,t.chain)().unsetMark(e.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}}}},addPasteRules:function(){var e=this;return[Bo({find:function(t){return fC(t).filter((function(t){return!e.options.validate||e.options.validate(t.value)})).filter((function(e){return e.isLink})).map((function(e){return{text:e.value,index:e.start,data:e}}))},type:this.type,getAttributes:function(e){var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins:function(){var e,t=[];return this.options.autolink&&t.push(pC({type:this.type,validate:this.options.validate})),this.options.openOnClick&&t.push((e={type:this.type},new p.Plugin({key:new p.PluginKey("handleClickLink"),props:{handleClick:function(t,n,r){var o,i=Eo(t.state,e.type.name);return!(!(null===(o=r.target)||void 0===o?void 0:o.closest("a"))||!i.href)&&(window.open(i.href,i.target),!0)}}}))),this.options.linkOnPaste&&t.push(function(e){return new p.Plugin({key:new p.PluginKey("handlePasteLink"),props:{handlePaste:function(t,n,r){if(t.state.selection.empty)return!1;var o="";r.content.forEach((function(e){o+=e.textContent}));var i=fC(o).find((function(e){return e.isLink&&e.value===o}));return!(!o||!i)&&(e.editor.commands.setMark(e.type,{href:i.href}),!0)}}})}({editor:this.editor,type:this.type})),t}}),mC=new p.PluginKey("codemark");function vC(e,t){var n,r;return"schema"in e?null!==(n=null===t||void 0===t?void 0:t.markType)&&void 0!==n?n:e.schema.marks.code:null!==(r=null===t||void 0===t?void 0:t.markType)&&void 0!==r?r:e.state.schema.marks.code}function gC(e,t){return e.resolve(Math.min(Math.max(1,t),e.nodeSize-2))}function yC(e,t,n,r){var o,i=e.isInSet(null!==(o=t.state.storedMarks)&&void 0!==o?o:t.state.doc.resolve(n).marks()),a=t.state.doc.rangeHasMark(n,r,e);return!(!i&&!a)}var bC={match:/`((?:[^`\w]|[\w])+)`$/,handler:function(e,t,n,r,o,i,a){if(yC(e,t,o,i))return!1;var s=r[1],l=e.create(),u=o+s.length,c=t.state.tr.delete(o,i).insertText(s).addMark(o,u,l),f=c.setSelection(p.TextSelection.create(c.doc,u)).removeStoredMark(e),d=f.setMeta(a.input,{transform:f,from:o,to:i,text:"`".concat(s).concat(n)});return t.dispatch(d),!0}},wC={match:/^`((?:[^`\w]|[\w])+)`/,handler:function(e,t,n,r,o,i,a){if(yC(e,t,o,i))return!1;var s=e.create(),l=r[1],u=o,c=t.state.tr.delete(o,i).insertText(l).addMark(o,o+l.length,s),f=c.setSelection(p.TextSelection.create(c.doc,u)).addStoredMark(e.create()),d=f.setMeta(a.input,{transform:f,from:o,to:i,text:"`".concat(l).concat(n)});return t.dispatch(d),!0}};function kC(e,t){var n=new p.Plugin({isInputRules:!0,state:{init:function(){return null},apply:function(e,t){var r=e.getMeta(n);return r||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(r,o,i,a){return function(e,t,n,r,o,i){if(t.composing)return!1;var a=t.state.doc.resolve(n);if(a.parent.type.spec.code)return!1;var s=a.parent.textBetween(Math.max(0,a.parentOffset-100),a.parentOffset,void 0,"\ufffc")+o,l=o+a.parent.textBetween(a.parentOffset,Math.min(a.parent.nodeSize-2,a.parentOffset+100),void 0,"\ufffc"),u=bC.match.exec(s),c=wC.match.exec(l);if(u){var f=bC.handler(e,t,o,u,n-u[0].length+o.length,r,i);if(f)return f}return!!c&&wC.handler(e,t,o,c,n,r+c[0].length-o.length,i)}(vC(r,t),r,o,i,a,{input:n,cursor:e})}}});return n}function xC(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"next",r={action:n};return e.dispatch(e.state.tr.setMeta(t,r)),!1}function OC(e,t,n,r){var o=function(e,t,n,r){var o;if(n.metaKey)return xC(e,t);if(n.shiftKey||n.altKey||n.ctrlKey)return!1;var i=e.state,a=i.selection,s=i.doc;if(!a.empty)return!1;var l=t.getState(e.state),u=a.$from,c=!!r.isInSet(u.marks()),f=!!r.isInSet(null!==(o=u.marksAcross(gC(s,a.from+1)))&&void 0!==o?o:[]);return u.pos===e.state.doc.nodeSize-3&&u.parentOffset===u.parent.nodeSize-2&&(null===l||void 0===l?void 0:l.active)?(e.dispatch(e.state.tr.removeStoredMark(r)),!0):(c!==f||0===u.parentOffset)&&(!c||(null===l||void 0===l?void 0:l.active)&&-1!==l.side||0===u.parentOffset?!(!f||-1!==(null===l||void 0===l?void 0:l.side))&&(e.dispatch(e.state.tr.addStoredMark(r.create())),!0):(e.dispatch(e.state.tr.removeStoredMark(r)),!0))}(e,t,n,r);if(o)return!0;var i=e.state.selection,a=i.$from;return!(!i.empty||a.parentOffset!==a.parent.nodeSize-2)&&xC(e,t)}function CC(e,t,n,r){var o=function(e,t,n,r){var o;if(n.metaKey)return xC(e,t);if(n.shiftKey||n.altKey||n.ctrlKey)return!1;var i=e.state,a=i.selection,s=i.doc,l=t.getState(e.state),u=!!r.isInSet(a.$from.marks()),c=!!r.isInSet(null!==(o=gC(s,a.empty?a.from-1:a.from+1).marks())&&void 0!==o?o:[]);if(u&&-1===(null===l||void 0===l?void 0:l.side)&&0===a.$from.parentOffset)return!1;if(0===(null===l||void 0===l?void 0:l.side)&&0===a.$from.parentOffset)return e.dispatch(e.state.tr.removeStoredMark(r)),!0;if(u&&c&&0===(null===l||void 0===l?void 0:l.side))return e.dispatch(e.state.tr.addStoredMark(r.create())),!0;if(u&&!c&&(null===l||void 0===l?void 0:l.active)&&0===a.$from.parentOffset)return e.dispatch(e.state.tr.removeStoredMark(r)),!0;if(!u&&(null===l||void 0===l?void 0:l.active)&&0===(null===l||void 0===l?void 0:l.side))return e.dispatch(e.state.tr.removeStoredMark(r)),!0;if(u===c)return!1;if(c||!a.empty&&u){var f=a.empty?a.from-1:a.from,d=e.state.tr.setSelection(p.TextSelection.create(s,f));return!a.empty&&c?e.dispatch(d.addStoredMark(r.create())):e.dispatch(d.removeStoredMark(r)),!0}if((c||!a.empty&&u)&&!(null===l||void 0===l?void 0:l.active)){var h=a.empty?a.from-1:a.from;return e.dispatch(e.state.tr.setSelection(p.TextSelection.create(s,h)).removeStoredMark(r)),!0}if(u&&!(null===l||void 0===l?void 0:l.active)&&a.$from.parentOffset>0)return e.dispatch(e.state.tr.setSelection(p.TextSelection.create(s,a.from-1)).addStoredMark(r.create())),!0;if(u&&!c&&(null===l||void 0===l?void 0:l.active)&&-1!==l.side)return e.dispatch(e.state.tr.addStoredMark(r.create())),!0;if(u&&!c&&(null===l||void 0===l?void 0:l.active)){var m=a.from-1;return e.dispatch(e.state.tr.setSelection(p.TextSelection.create(s,m)).addStoredMark(r.create())),!0}return!1}(e,t,n,r);if(o)return!0;var i=e.state.selection,a=i.$from,s=t.getState(e.state);return 1===a.pos&&0===a.parentOffset&&-1===(null===s||void 0===s?void 0:s.side)||!(!i.empty||0!==a.parentOffset)&&xC(e,t)}function SC(){var e=document.createElement("span");return e.classList.add("fake-cursor"),e}function jC(e){var t=new p.Plugin({key:mC,appendTransaction:function(n,r,o){var i,a=t.getState(r),s=null===(i=n[0])||void 0===i?void 0:i.getMeta(t);return(null===a||void 0===a?void 0:a.next)||"click"===(null===s||void 0===s?void 0:s.action)?function(e,t){var n,r;if(!e)return null;var o=e.selection,i=e.doc;if(!o.empty)return null;var a=!!t.isInSet(null!==(n=e.storedMarks)&&void 0!==n?n:[]),s=!!t.isInSet(o.$from.marks()),l=!!t.isInSet(null!==(r=gC(i,o.from+1).marks())&&void 0!==r?r:[]),u=0===o.$from.parentOffset;return s!==l||!s&&a!==s||s&&u?e.tr.removeStoredMark(t):null}(o,vC(o,e)):null},state:{init:function(){return null},apply:function(n,r,o,i){var a,s=n.getMeta(t);if("next"===(null===s||void 0===s?void 0:s.action))return{next:!0};var l=vC(i,e),u=l.isInSet(null!==(a=i.storedMarks)&&void 0!==a?a:i.doc.resolve(n.selection.from).marks()),c=l.isInSet(i.doc.resolve(n.selection.from).marks()),f=l.isInSet(gC(i.doc,n.selection.from+1).marks()),d=0===n.selection.$from.parentOffset;return n.selection.empty?u||!f||c&&!d?(!u||c&&!d)&&(u||!c||f)?u&&c&&!f?{active:!0,side:-1}:null:{active:!0,side:0}:{active:!0,side:-1}:null}},props:{attributes:function(e){var n,r=(null!==(n=t.getState(e))&&void 0!==n?n:{}).active,o=void 0!==r&&r;return Object.assign({},o?{class:"no-cursor"}:{})},decorations:function(e){var n,r=null!==(n=t.getState(e))&&void 0!==n?n:{},o=r.active,i=r.side;if(!o)return Qt.empty;var a=Zt.widget(e.selection.from,SC,{side:i});return Qt.create(e.doc,[a])},handleKeyDown:function(n,r){switch(r.key){case"`":return function(e,t,n,r){if(e.state.selection.empty)return!1;if(n.metaKey||n.shiftKey||n.altKey||n.ctrlKey)return!1;var o=e.state.selection,i=o.from,a=o.to;if(a-i>=100||e.state.doc.rangeHasMark(i,a,r))return!1;var s=e.state.tr.addMark(i,a,r.create()),l=s.setSelection(p.TextSelection.create(s.doc,a)).removeStoredMark(r);return e.dispatch(l),!0}(n,0,r,vC(n,e));case"ArrowRight":return OC(n,t,r,vC(n,e));case"ArrowLeft":return CC(n,t,r,vC(n,e));case"Backspace":return function(e,t,n,r){if(n.metaKey||n.shiftKey||n.altKey||n.ctrlKey)return!1;var o=e.state,i=o.selection,a=o.doc,s=gC(a,i.from-1),l=!!r.isInSet(s.marks()),u=0===s.parentOffset,c=!!r.isInSet(gC(a,i.to+1).marks());if((!l||u)&&!c)return xC(e,t);var f=t.getState(e.state);if(i.empty&&-1===(null===f||void 0===f?void 0:f.side)){var d=e.state.tr.delete(i.from-1,i.from);return e.dispatch(d),!0}return!1}(n,t,r,vC(n,e));case"Delete":return function(e,t,n,r){if(n.metaKey||n.shiftKey||n.altKey||n.ctrlKey)return!1;var o=e.state,i=o.selection,a=o.doc,s=!!r.isInSet(i.$from.marks()),l=0===i.$from.parentOffset,u=!!r.isInSet(gC(a,i.to+2).marks());return!(s&&!l||u)&&xC(e,t)}(n,t,r,vC(n,e));case"ArrowUp":case"ArrowDown":case"Home":case"End":return xC(n,t);case"e":case"a":return!!r.ctrlKey&&xC(n,t);default:return!1}},handleClick:function(e){return xC(e,t,"click")}}});return t}var AC=function(e){var t=jC(e);return[t,kC(t,e)]},EC=$r.create({name:"codemarkPlugin",addProseMirrorPlugins:function(){return AC({markType:this.editor.schema.marks.code})}}),DC=Object(f.a)((function e(t,n){var r;Object(c.a)(this,e),this.match=t,this.match=t,this.handler="string"==typeof n?(r=n,function(e,t,n,o){var i=r;if(t[1]){var a=t[0].lastIndexOf(t[1]);i+=t[0].slice(a+t[1].length);var s=(n+=a)-o;s>0&&(i=t[0].slice(a-s,a)+i,n=o)}return e.tr.insertText(i,n,o)}):n}));function MC(e){var t=e.rules,n=new p.Plugin({state:{init:function(){return null},apply:function(e,t){var n=e.getMeta(this);return n||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:function(e,r,o,i){return TC(e,r,o,i,t,n)},handleDOMEvents:{compositionend:function(e){setTimeout((function(){var r=e.state.selection.$cursor;r&&TC(e,r.pos,r.pos,"",t,n)}))}}},isInputRules:!0});return n}function TC(e,t,n,r,o,i){if(e.composing)return!1;var a=e.state,s=a.doc.resolve(t);if(s.parent.type.spec.code)return!1;for(var l=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,null,"\ufffc")+r,u=0;u3&&void 0!==arguments[3])||arguments[3];return function(o,i){var a=e.state,s=a.selection,l=s.to,u=s.from,c=o.selection,f=c.to,d=c.from;if(r&&f!==d)return!1;var h=t>0?f:d;if(n){var m=o.doc.nodeSize-2;if(t>0&&h0)return!1}if(i){var v=t>0?l:u;e.dispatch(a.tr.setSelection(p.TextSelection.create(a.doc,v))),e.focus()}return!0}}var PC=function(){function e(t,n,r,o,i,a){var s=this;Object(c.a)(this,e),this.options=o,this._node=t,this._outerView=n,this._getPos=r,this._mathPluginKey=i,this.cursorSide="start",this._isEditing=!1,this._tagName=o.tagName||this._node.type.name.replace("_","-"),this.dom=document.createElement(this._tagName),o.className&&this.dom.classList.add(o.className),this.dom.classList.add("math-node"),this._mathRenderElt=document.createElement("span"),this._mathRenderElt.textContent="",this._mathRenderElt.classList.add("math-render"),this.dom.appendChild(this._mathRenderElt),this._mathSrcElt=document.createElement("span"),this._mathSrcElt.classList.add("math-src"),this.dom.appendChild(this._mathSrcElt),this.dom.addEventListener("click",(function(){return s.ensureFocus()})),this.renderMath()}return Object(f.a)(e,[{key:"destroy",value:function(){this.closeEditor(!1),this._mathRenderElt&&(this._mathRenderElt.remove(),delete this._mathRenderElt),this._mathSrcElt&&(this._mathSrcElt.remove(),delete this._mathSrcElt),this.dom.remove()}},{key:"ensureFocus",value:function(){this._innerView&&this._outerView.hasFocus()&&this._innerView.focus()}},{key:"update",value:function(e,t,n){if(!e.sameMarkup(this._node))return!1;if(this._node=e,this._innerView){var r=this._innerView.state,o=e.content.findDiffStart(r.doc.content);if(null!=o){var i=e.content.findDiffEnd(r.doc.content);if(i){var a=i.a,s=i.b,l=o-Math.min(a,s);l>0&&(a+=l,s+=l),this._innerView.dispatch(r.tr.replace(o,s,e.slice(o,a)).setMeta("fromOutside",!0))}}}return this._isEditing||this.renderMath(),!0}},{key:"updateCursorPos",value:function(e){var t=this._getPos(),n=this._node.nodeSize;e.selection.from0&&null!==e[0].textContent&&(t=e[0].textContent.trim()),t.length<1)for(this.dom.classList.add("empty-math");this._mathRenderElt.firstChild;)this._mathRenderElt.firstChild.remove();else{this.dom.classList.remove("empty-math");try{this.options.renderer(t,this._mathRenderElt),this._mathRenderElt.classList.remove("parse-error"),this.dom.setAttribute("title","")}catch(n){n instanceof Error&&(console.error(n),this._mathRenderElt.classList.add("parse-error"),this.dom.setAttribute("title",n.toString()))}}}}},{key:"dispatchInner",value:function(e){if(this._innerView){var t=this._innerView.state.applyTransaction(e),n=t.state,r=t.transactions;if(this._innerView.updateState(n),!e.getMeta("fromOutside")){for(var o=this._outerView.state.tr,i=g.d.offset(this._getPos()+1),a=0;a0)&&(t._outerView.dispatch(t._outerView.state.tr.insertText("")),t._outerView.focus(),!0))})),Enter:ur(Yn,LC(this._outerView,1,!1)),"Ctrl-Enter":LC(this._outerView,1,!1),ArrowLeft:LC(this._outerView,-1,!0),ArrowRight:LC(this._outerView,1,!0),ArrowUp:LC(this._outerView,-1,!0),ArrowDown:LC(this._outerView,1,!0)})]}),dispatchTransaction:this.dispatchInner.bind(this)});var n=this._innerView.state;this._innerView.focus();var r=null===(e=this._mathPluginKey.getState(this._outerView.state))||void 0===e?void 0:e.prevCursorPos;null!==r&&void 0!==r||console.error("[prosemirror-math] Error: Unable to fetch math plugin state from key.");var o=(null!==r&&void 0!==r?r:0)<=this._getPos()?0:this._node.nodeSize-2;setTimeout((function(){t._innerView&&(t._innerView.focus(),t._innerView.dispatch(n.tr.setSelection(p.TextSelection.create(n.doc,o))))})),this._isEditing=!0}},{key:"closeEditor",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._innerView&&(this._innerView.destroy(),this._innerView=void 0),e&&this.renderMath(),this._isEditing=!1}}]),e}(),RC=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(t){i(t)}}function s(e){try{l(r.throw(e))}catch(t){i(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))};function HC(){return RC(this,void 0,void 0,rv().mark((function e(){var t,r;return rv().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.e(0).then(n.t.bind(null,128,7));case 2:return t=e.sent,r=t.default,e.next=6,Promise.all([n.e(0),n.e(4)]).then(n.bind(null,129));case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),e)})))}var NC={inline:function(e,t){HC().then((function(n){n.render(e,t,{displayMode:!1,globalGroup:!0,throwOnError:!1})}))},block:function(e,t){HC().then((function(n){n.render(e,t,{displayMode:!0,globalGroup:!0,throwOnError:!1})}))}},FC=new p.PluginKey("prosemirror-math");function VC(e){return function(t,n,r){var o=FC.getState(n.state);if(!o)throw new Error("no math plugin!");var i=o.activeNodeViews,a=new PC(t,n,r,{className:e?"math-inline":"math-block",renderer:e?NC.inline:NC.block,tagName:e?"span":"div"},FC,(function(){i.splice(i.indexOf(a))}));return i.push(a),a}}var zC={key:FC,state:{init:function(e,t){return{macros:{},activeNodeViews:[],prevCursorPos:0}},apply:function(e,t,n,r){var o=r.selection.from,i=n.selection.from;return{activeNodeViews:t.activeNodeViews,macros:t.macros,prevCursorPos:i!==o?i:t.prevCursorPos}}},props:{nodeViews:{mathInline:VC(!0),mathBlock:VC(!1)}}},_C=new p.Plugin(zC);function BC(e,t){return v.Fragment.from(t.text(e))}function IC(e){var t,n=e.querySelector("img.mwe-math-fallback-image-inline[alt]");return null!==(t=null===n||void 0===n?void 0:n.getAttribute("alt"))&&void 0!==t&&t}function $C(e){var t,n=e.querySelector("math[alttext]");return null!==(t=null===n||void 0===n?void 0:n.getAttribute("alttext"))&&void 0!==t&&t}function qC(e){var t,n=e.querySelector("math annotation[encoding='application/x-tex'");return null!==(t=null===n||void 0===n?void 0:n.textContent)&&void 0!==t&&t}function WC(e){var t=function(e,t){var n,r=Object(xa.a)(t);try{for(r.s();!(n=r.n()).done;){var o=(0,n.value)(e);if(!1!==o)return o}}catch(i){r.e(i)}finally{r.f()}return!1}(e,[IC,$C,qC]);return t}var UC=[{tag:"span",getAttrs:function(e){return!!e.classList.contains("mwe-math-element")&&null},getContent:function(e,t){return BC(WC(e)||"\\text{\\color{red}(paste error)}",t)}}],KC=[{tag:"dl",getAttrs:function(e){var t=e;if(1!==t.childElementCount)return!1;var n=t.firstChild;return"DD"===n.tagName&&(1===n.childElementCount&&(!!n.firstChild.classList.contains("mwe-math-element")&&null))},getContent:function(e,t){return BC(WC(e)||"\\text{\\color{red}(paste error)}",t)}}];[{tag:"math-inline"}].concat(Object(l.a)(UC)),[{tag:"math-display"}].concat(Object(l.a)(KC));var GC=/\$\$(.+)\$\$/,JC=(function(){try{new RegExp("(?1&&void 0!==arguments[1]?arguments[1]:"";return function(n,r){var o=n.selection,i=o.$from,a=o.empty,s=i.index();if(!a&&!i.parent.canReplaceWith(s,s,e))return!1;if(r){var l=e.create({},t?n.schema.text(t):null),u=n.tr.replaceSelectionWith(l);r(u=a?u.setSelection(p.TextSelection.create(u.doc,i.pos+1)):u.setSelection(p.NodeSelection.create(u.doc,i.pos)))}return!0}}(e.type)(n,r,o)}}}},addProseMirrorPlugins:function(){var e,t,n;return[MC({rules:[(e=JC,t=this.type,new DC(e,(function(e,r,o,i){var a=e.doc.resolve(o),s=n instanceof Function?n(r):n;if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t))return null;var l=e.tr.delete(o,i).setBlockType(o,o,t,s);return l.setSelection(p.NodeSelection.create(l.doc,l.mapping.map(a.pos-1)))})))]})]}}),eS=void 0,tS=$r.create({name:"keepinview",onCreate:function(){var e=this;eS=function(){nS(e.editor)},window.addEventListener("resize",eS)},onDestroy:function(){eS&&(window.removeEventListener("resize",eS),eS=void 0)},addKeyboardShortcuts:function(){return{Enter:function(e){var t=e.editor;return setTimeout((function(){nS(t)})),!1}}}});function nS(e){var t=e.state.selection.$from,n=function(e,t,n){var r=e.state.doc.content.size,o=eo(t,0,r),i=eo(n,0,r),a=e.coordsAtPos(o),s=e.coordsAtPos(i,-1),l=Math.min(a.top,s.top),u=Math.max(a.bottom,s.bottom),c=Math.min(a.left,s.left),f=Math.max(a.right,s.right),p={top:l,bottom:u,left:c,right:f,width:f-c,height:u-l,x:c,y:l};return Object(d.a)(Object(d.a)({},p),{},{toJSON:function(){return p}})}(e.view,t.pos,t.pos+1),r=n.top;if(window.innerHeight-r<100){var o=e.view.domAtPos(t.pos).node;if(o.nodeType===Node.TEXT_NODE&&o.parentNode&&(o=o.parentNode),o instanceof HTMLElement){var i=rS(o);i?i.scrollBy({top:100,behavior:"smooth"}):o.scrollIntoView({behavior:"smooth",block:"center"})}}}var rS=function(e){if(e){for(var t=e.parentElement;t;){var n=t.style,r=n.overflow,o=n.overflowY;if(oS(r)||oS(o))return t;t=t.parentElement}return document.documentElement}};function oS(e){return e.split(" ").every((function(e){return"auto"===e||"scroll"===e}))}var iS=new p.PluginKey("selection-persist-key"),aS=$r.create({name:"selection-persist",addProseMirrorPlugins:function(){var e=!1;return[new p.Plugin({key:iS,props:{decorations:function(e){return iS.getState(e)}},state:{init:function(){return Qt.empty},apply:function(t,n,r,o){var i=!!t.getMeta("blur");!!t.getMeta("focus")&&(e=!1,!0),i&&(e=!0,!1);var a=r.selection,s=a.from,l=a.to;return e?Qt.create(t.doc,[Zt.inline(s,l,{style:"background-color: var(--dimPrimary)"})]):Qt.empty}}})]}}),sS=function(e){Object(i.a)(n,e);var t=Object(a.a)(n);function n(){return Object(c.a)(this,n),t.apply(this,arguments)}return Object(f.a)(n,[{key:"requestPermission",value:function(e){var t=new CustomEvent("permissionrequest",{detail:{id:e},cancelable:!0});if(window.dispatchEvent(t))return this.current}}]),n}(To);function lS(){var e=Object(Ca.useState)(0),t=Object(u.a)(e,2)[1];return function(){return t((function(e){return e+1}))}}var uS=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=Object(Ca.useState)(null),r=Object(u.a)(n,2),o=r[0],i=r[1],a=lS(),s=Object(Ca.useRef)(o);return Object(Ca.useEffect)((function(){var t=!0,n=new sS(e);return i(n),n.on("transaction",(function(){requestAnimationFrame((function(){requestAnimationFrame((function(){t&&a()}))}))})),function(){n.destroy(),t=!1}}),t),Object(Ca.useEffect)((function(){s.current=o,o&&(o.current||Object.defineProperty(o,"current",{get:function(){return s.current}}))}),[o]),Object(Ca.useEffect)((function(){function e(e){if(null===o||void 0===o?void 0:o.view.dragging)return e.preventDefault(),!0}return null===o||void 0===o||o.view.dom.addEventListener("dragenter",e),function(){null===o||void 0===o||o.view.dom.removeEventListener("dragenter",e)}}),[null===o||void 0===o?void 0:o.view.dom]),o},cS={premium:["insertImage"]};function fS(e){var t=e.claims,n=e.onPermissionDenied;Object(Ca.useEffect)((function(){function e(e){var r=e.detail.id;for(var o in cS){var i=o;if(!(cS[i].indexOf(r)<=-1)&&!t[i]){n(i,r),e.preventDefault();break}}e.preventDefault()}return window.addEventListener("permissionrequest",e),function(){window.removeEventListener("permissionrequest",e)}}),[t,n])}var dS=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.theme,r=e.isMobile,o=e.onDownloadAttachment,i=e.onOpenAttachmentPicker,a=e.onBeforeCreate,s=dS(e,["theme","isMobile","onDownloadAttachment","onOpenAttachmentPicker","onBeforeCreate"]),l=Wa(),u=Pa((function(e){return e.setIsMobile})),c=Pa((function(e){return e.setTheme}));Object(Ca.useEffect)((function(){u(r||!1),c(n)}),[r,n]);var f=Object(Ca.useMemo)((function(){return{extensions:[Ya,Mw,la,oa.configure({dropcursor:!1,codeBlock:!1,listItem:!1,orderedList:!1,bulletList:!1,history:{depth:200,newGroupDelay:1e3}}),Ew.configure({class:"drop-cursor"}),Io,qo,aa,sa,ua,ca,fa,da,pa,Ow.configure({nested:!0}),Sw,hC.configure({openOnClick:!r}),Ix.configure({resizable:!0,allowTableNodeSelection:!0,cellMinWidth:50}),ya,wa,ka,va.configure({multicolor:!0}),yx,ga,ia.configure({types:["heading","paragraph"],alignments:["left","right","center","justify"],defaultAlignment:"left"}),$o.configure({placeholder:"Start writing your note..."}),vw,Lw,Hb.configure({onDownloadAttachment:o,onOpenAttachmentPicker:i}),Ex,Lx,jx,EC,XC,QC,tS,aS],onBeforeCreate:function(e){var t=e.editor;t.storage.portalProviderAPI=l,a&&a({editor:t})},injectCSS:!1}}),[o,i,l,a]),d=uS(Object.assign(Object.assign({},f),s),t);return d}},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(39);function o(e,t){if(e){if("string"===typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";t.a=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}},function(e,t,n){"use strict";n.r(t);var r=n(37),o=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,i=Object(r.a)((function(e){return o.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=i},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)return o(e,t,t);var n=Math.abs(t),r=o(e,n,n);return"string"===typeof r?"-"+r:-1*r},f=["margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","top","bottom","left","right"].reduce((function(e,t){var n;return r({},e,((n={})[t]=c,n))}),{}),d=function(e){return function(t){var n={},r=o(t,"breakpoints",i),a=[null].concat(r.map((function(e){return"@media screen and (min-width: "+e+")"})));for(var s in e){var l="function"===typeof e[s]?e[s](t):e[s];if(null!=l)if(Array.isArray(l))for(var u=0;u=0)&&i(e,!n)}e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resetState=function(){s&&(s.removeAttribute?s.removeAttribute("aria-hidden"):null!=s.length?s.forEach((function(e){return e.removeAttribute("aria-hidden")})):document.querySelectorAll(s).forEach((function(e){return e.removeAttribute("aria-hidden")})));s=null},t.log=function(){0},t.assertNodeList=l,t.setElement=function(e){var t=e;if("string"===typeof t&&a.canUseDOM){var n=document.querySelectorAll(t);l(n,t),t=n}return s=t||s},t.validateElement=u,t.hide=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.setAttribute("aria-hidden","true")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.show=function(e){var t=!0,n=!1,r=void 0;try{for(var o,i=u(e)[Symbol.iterator]();!(t=(o=i.next()).done);t=!0){o.value.removeAttribute("aria-hidden")}}catch(a){n=!0,r=a}finally{try{!t&&i.return&&i.return()}finally{if(n)throw r}}},t.documentNotReadyOrSSRTesting=function(){s=null};var r,o=n(114),i=(r=o)&&r.__esModule?r:{default:r},a=n(51);var s=null;function l(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function u(e){var t=e||s;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,i.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.log=function(){console.log("portalOpenInstances ----------"),console.log(o.openInstances.length),o.openInstances.forEach((function(e){return console.log(e)})),console.log("end portalOpenInstances ----------")},t.resetState=function(){o=new r};var r=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.register=function(e){-1===t.openInstances.indexOf(e)&&(t.openInstances.push(e),t.emit("register"))},this.deregister=function(e){var n=t.openInstances.indexOf(e);-1!==n&&(t.openInstances.splice(n,1),t.emit("deregister"))},this.subscribe=function(e){t.subscribers.push(e)},this.emit=function(e){t.subscribers.forEach((function(n){return n(e,t.openInstances.slice())}))},this.openInstances=[],this.subscribers=[]},o=new r;t.default=o},function(e,t,n){"use strict";n.r(t);var r=n(17),o=n(1),i=n(38),a=n(33),s=n(28),l=n(27),u=i.default,c=function(e){return"theme"!==e&&"innerRef"!==e},f=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?u:c};function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t0&&(S.transform=M.join(" "),S.transformOrigin="center",A&&(L=r.createElement("g",{style:S},T,r.createElement("rect",{width:"24",height:"24",fill:"transparent"}))));var P,R=L,H=!0===O||"number"!=typeof O?2:O,N=!A&&(g||b);if(H<0&&(N=!N),O&&(R=r.createElement("g",{style:{animation:"spin"+(N?"-inverse":"")+" linear "+Math.abs(H)+"s infinite",transformOrigin:"center"}},L,!(g||b||0!==k)&&r.createElement("rect",{width:"24",height:"24",fill:"transparent"}))),A)return R;var F,V="icon_labelledby_"+i,z="icon_describedby_"+i;if(s)P=f?V+" "+z:V;else if(F="presentation",f)throw new Error("title attribute required when description is set");return r.createElement("svg",u({ref:t,viewBox:"0 0 24 24",style:S,role:F,"aria-labelledby":P},E),s&&r.createElement("title",{id:V},s),f&&r.createElement("desc",{id:z},f),!A&&O&&(N?r.createElement("style",null,"@keyframes spin-inverse { to { transform: rotate(-360deg) } }"):r.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg) } }")),R)}));f.displayName="Icon",f.propTypes={path:o.string.isRequired,size:o.oneOfType([o.number,o.string]),color:o.string,horizontal:o.bool,vertical:o.bool,rotate:o.number,spin:o.oneOfType([o.bool,o.number]),style:o.object,inStack:o.bool,className:o.string},f.defaultProps={size:null,color:"currentColor",horizontal:!1,vertical:!1,rotate:0,spin:!1},t.default=f}])},function(e,t,n){"use strict";e.exports=function(e){var t=e.match(/^[ \t]*(?=\S)/gm);return t?t.reduce((function(e,t){return Math.min(e,t.length)}),1/0):0}},,,,function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M19.35,10.04C18.67,6.59 15.64,4 12,4C9.11,4 6.6,5.64 5.35,8.04C2.34,8.36 0,10.91 0,14A6,6 0 0,0 6,20H19A5,5 0 0,0 24,15C24,12.36 21.95,10.22 19.35,10.04M19,18H6A4,4 0 0,1 2,14C2,11.95 3.53,10.24 5.56,10.03L6.63,9.92L7.13,8.97C8.08,7.14 9.94,6 12,6C14.62,6 16.88,7.86 17.39,10.43L17.69,11.93L19.22,12.04C20.78,12.14 22,13.45 22,15A3,3 0 0,1 19,18M8,13H10.55V16H13.45V13H16L12,9L8,13Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M5 16L3 5L8.5 10L12 4L15.5 10L21 5L19 16H5M19 19C19 19.6 18.6 20 18 20H6C5.4 20 5 19.6 5 19V18H19V19Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M20 13.5C20 17.09 17.09 20 13.5 20H6V18H13.5C16 18 18 16 18 13.5S16 9 13.5 9H7.83L10.91 12.09L9.5 13.5L4 8L9.5 2.5L10.92 3.91L7.83 7H13.5C17.09 7 20 9.91 20 13.5Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M10.5 18H18V20H10.5C6.91 20 4 17.09 4 13.5S6.91 7 10.5 7H16.17L13.08 3.91L14.5 2.5L20 8L14.5 13.5L13.09 12.09L16.17 9H10.5C8 9 6 11 6 13.5S8 18 10.5 18Z"}))},s=o.memo?o.memo(a):a;e.exports=s},function(e,t,n){"use strict";var r,o=(r=n(1))&&"object"===typeof r&&"default"in r?r.default:r,i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["color","size","children"])),l="mdi-icon "+(s.className||"");return o.createElement("svg",i({},s,{className:l,width:a,height:a,fill:n,viewBox:"0 0 24 24"}),o.createElement("path",{d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"}))},s=o.memo?o.memo(a):a;e.exports=s},,,,,,function(e,t,n){"use strict";var r=n(18),o=60103,i=60106;t.Fragment=60107,t.StrictMode=60108,t.Profiler=60114;var a=60109,s=60110,l=60112;t.Suspense=60113;var u=60115,c=60116;if("function"===typeof Symbol&&Symbol.for){var f=Symbol.for;o=f("react.element"),i=f("react.portal"),t.Fragment=f("react.fragment"),t.StrictMode=f("react.strict_mode"),t.Profiler=f("react.profiler"),a=f("react.provider"),s=f("react.context"),l=f("react.forward_ref"),t.Suspense=f("react.suspense"),u=f("react.memo"),c=f("react.lazy")}var d="function"===typeof Symbol&&Symbol.iterator;function p(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n