this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Bit of babel magic to make jsoo happy

+9656 -12
+4
babel.config.js
··· 1 + module.exports = { 2 + presets: ["@babel/env"], 3 + plugins: ["@babel/transform-property-mutators"], 4 + };
+9 -9
example/src/dune
··· 1 - ; (executable 2 - ; (name index) 3 - ; (modes js) 4 - ; (js_of_ocaml 5 - ; (javascript_files basic.js)) 6 - ; (libraries code-mirror)) 1 + (executable 2 + (name index) 3 + (modes js) 4 + (js_of_ocaml 5 + (javascript_files basic.js)) 6 + (libraries code-mirror)) 7 7 8 - ; (alias 9 - ; (name default) 10 - ; (deps index.html)) 8 + (alias 9 + (name default) 10 + (deps index.html))
+4638
package-lock.json
··· 17 17 "@codemirror/stream-parser": "0.19.2", 18 18 "@codemirror/theme-one-dark": "0.19.1", 19 19 "@codemirror/view": "0.19.16" 20 + }, 21 + "devDependencies": { 22 + "@babel/cli": "^7.16.8", 23 + "@babel/core": "^7.16.12", 24 + "@babel/plugin-transform-property-mutators": "^7.16.7", 25 + "@babel/preset-env": "^7.16.11" 26 + } 27 + }, 28 + "node_modules/@babel/cli": { 29 + "version": "7.16.8", 30 + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.16.8.tgz", 31 + "integrity": "sha512-FTKBbxyk5TclXOGmwYyqelqP5IF6hMxaeJskd85jbR5jBfYlwqgwAbJwnixi1ZBbTqKfFuAA95mdmUFeSRwyJA==", 32 + "dev": true, 33 + "dependencies": { 34 + "commander": "^4.0.1", 35 + "convert-source-map": "^1.1.0", 36 + "fs-readdir-recursive": "^1.1.0", 37 + "glob": "^7.0.0", 38 + "make-dir": "^2.1.0", 39 + "slash": "^2.0.0", 40 + "source-map": "^0.5.0" 41 + }, 42 + "bin": { 43 + "babel": "bin/babel.js", 44 + "babel-external-helpers": "bin/babel-external-helpers.js" 45 + }, 46 + "engines": { 47 + "node": ">=6.9.0" 48 + }, 49 + "optionalDependencies": { 50 + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", 51 + "chokidar": "^3.4.0" 52 + }, 53 + "peerDependencies": { 54 + "@babel/core": "^7.0.0-0" 55 + } 56 + }, 57 + "node_modules/@babel/cli/node_modules/anymatch": { 58 + "version": "3.1.2", 59 + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", 60 + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", 61 + "dev": true, 62 + "optional": true, 63 + "dependencies": { 64 + "normalize-path": "^3.0.0", 65 + "picomatch": "^2.0.4" 66 + }, 67 + "engines": { 68 + "node": ">= 8" 69 + } 70 + }, 71 + "node_modules/@babel/cli/node_modules/binary-extensions": { 72 + "version": "2.2.0", 73 + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 74 + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 75 + "dev": true, 76 + "optional": true, 77 + "engines": { 78 + "node": ">=8" 79 + } 80 + }, 81 + "node_modules/@babel/cli/node_modules/braces": { 82 + "version": "3.0.2", 83 + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 84 + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 85 + "dev": true, 86 + "optional": true, 87 + "dependencies": { 88 + "fill-range": "^7.0.1" 89 + }, 90 + "engines": { 91 + "node": ">=8" 92 + } 93 + }, 94 + "node_modules/@babel/cli/node_modules/chokidar": { 95 + "version": "3.5.3", 96 + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 97 + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 98 + "dev": true, 99 + "funding": [ 100 + { 101 + "type": "individual", 102 + "url": "https://paulmillr.com/funding/" 103 + } 104 + ], 105 + "optional": true, 106 + "dependencies": { 107 + "anymatch": "~3.1.2", 108 + "braces": "~3.0.2", 109 + "glob-parent": "~5.1.2", 110 + "is-binary-path": "~2.1.0", 111 + "is-glob": "~4.0.1", 112 + "normalize-path": "~3.0.0", 113 + "readdirp": "~3.6.0" 114 + }, 115 + "engines": { 116 + "node": ">= 8.10.0" 117 + }, 118 + "optionalDependencies": { 119 + "fsevents": "~2.3.2" 120 + } 121 + }, 122 + "node_modules/@babel/cli/node_modules/commander": { 123 + "version": "4.1.1", 124 + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", 125 + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", 126 + "dev": true, 127 + "engines": { 128 + "node": ">= 6" 129 + } 130 + }, 131 + "node_modules/@babel/cli/node_modules/fill-range": { 132 + "version": "7.0.1", 133 + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 134 + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 135 + "dev": true, 136 + "optional": true, 137 + "dependencies": { 138 + "to-regex-range": "^5.0.1" 139 + }, 140 + "engines": { 141 + "node": ">=8" 142 + } 143 + }, 144 + "node_modules/@babel/cli/node_modules/fsevents": { 145 + "version": "2.3.2", 146 + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 147 + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 148 + "dev": true, 149 + "hasInstallScript": true, 150 + "optional": true, 151 + "os": [ 152 + "darwin" 153 + ], 154 + "engines": { 155 + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" 156 + } 157 + }, 158 + "node_modules/@babel/cli/node_modules/glob-parent": { 159 + "version": "5.1.2", 160 + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 161 + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 162 + "dev": true, 163 + "optional": true, 164 + "dependencies": { 165 + "is-glob": "^4.0.1" 166 + }, 167 + "engines": { 168 + "node": ">= 6" 169 + } 170 + }, 171 + "node_modules/@babel/cli/node_modules/is-binary-path": { 172 + "version": "2.1.0", 173 + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 174 + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 175 + "dev": true, 176 + "optional": true, 177 + "dependencies": { 178 + "binary-extensions": "^2.0.0" 179 + }, 180 + "engines": { 181 + "node": ">=8" 182 + } 183 + }, 184 + "node_modules/@babel/cli/node_modules/is-extglob": { 185 + "version": "2.1.1", 186 + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 187 + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", 188 + "dev": true, 189 + "optional": true, 190 + "engines": { 191 + "node": ">=0.10.0" 192 + } 193 + }, 194 + "node_modules/@babel/cli/node_modules/is-glob": { 195 + "version": "4.0.3", 196 + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 197 + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 198 + "dev": true, 199 + "optional": true, 200 + "dependencies": { 201 + "is-extglob": "^2.1.1" 202 + }, 203 + "engines": { 204 + "node": ">=0.10.0" 205 + } 206 + }, 207 + "node_modules/@babel/cli/node_modules/is-number": { 208 + "version": "7.0.0", 209 + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 210 + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 211 + "dev": true, 212 + "optional": true, 213 + "engines": { 214 + "node": ">=0.12.0" 215 + } 216 + }, 217 + "node_modules/@babel/cli/node_modules/normalize-path": { 218 + "version": "3.0.0", 219 + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 220 + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 221 + "dev": true, 222 + "optional": true, 223 + "engines": { 224 + "node": ">=0.10.0" 225 + } 226 + }, 227 + "node_modules/@babel/cli/node_modules/readdirp": { 228 + "version": "3.6.0", 229 + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 230 + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 231 + "dev": true, 232 + "optional": true, 233 + "dependencies": { 234 + "picomatch": "^2.2.1" 235 + }, 236 + "engines": { 237 + "node": ">=8.10.0" 238 + } 239 + }, 240 + "node_modules/@babel/cli/node_modules/slash": { 241 + "version": "2.0.0", 242 + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", 243 + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", 244 + "dev": true, 245 + "engines": { 246 + "node": ">=6" 247 + } 248 + }, 249 + "node_modules/@babel/cli/node_modules/to-regex-range": { 250 + "version": "5.0.1", 251 + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 252 + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 253 + "dev": true, 254 + "optional": true, 255 + "dependencies": { 256 + "is-number": "^7.0.0" 257 + }, 258 + "engines": { 259 + "node": ">=8.0" 260 + } 261 + }, 262 + "node_modules/@babel/code-frame": { 263 + "version": "7.16.7", 264 + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", 265 + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", 266 + "dev": true, 267 + "dependencies": { 268 + "@babel/highlight": "^7.16.7" 269 + }, 270 + "engines": { 271 + "node": ">=6.9.0" 272 + } 273 + }, 274 + "node_modules/@babel/compat-data": { 275 + "version": "7.16.8", 276 + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz", 277 + "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==", 278 + "dev": true, 279 + "engines": { 280 + "node": ">=6.9.0" 281 + } 282 + }, 283 + "node_modules/@babel/core": { 284 + "version": "7.16.12", 285 + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", 286 + "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", 287 + "dev": true, 288 + "dependencies": { 289 + "@babel/code-frame": "^7.16.7", 290 + "@babel/generator": "^7.16.8", 291 + "@babel/helper-compilation-targets": "^7.16.7", 292 + "@babel/helper-module-transforms": "^7.16.7", 293 + "@babel/helpers": "^7.16.7", 294 + "@babel/parser": "^7.16.12", 295 + "@babel/template": "^7.16.7", 296 + "@babel/traverse": "^7.16.10", 297 + "@babel/types": "^7.16.8", 298 + "convert-source-map": "^1.7.0", 299 + "debug": "^4.1.0", 300 + "gensync": "^1.0.0-beta.2", 301 + "json5": "^2.1.2", 302 + "semver": "^6.3.0", 303 + "source-map": "^0.5.0" 304 + }, 305 + "engines": { 306 + "node": ">=6.9.0" 307 + }, 308 + "funding": { 309 + "type": "opencollective", 310 + "url": "https://opencollective.com/babel" 311 + } 312 + }, 313 + "node_modules/@babel/core/node_modules/debug": { 314 + "version": "4.3.3", 315 + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", 316 + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", 317 + "dev": true, 318 + "dependencies": { 319 + "ms": "2.1.2" 320 + }, 321 + "engines": { 322 + "node": ">=6.0" 323 + }, 324 + "peerDependenciesMeta": { 325 + "supports-color": { 326 + "optional": true 327 + } 328 + } 329 + }, 330 + "node_modules/@babel/core/node_modules/json5": { 331 + "version": "2.2.0", 332 + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", 333 + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", 334 + "dev": true, 335 + "dependencies": { 336 + "minimist": "^1.2.5" 337 + }, 338 + "bin": { 339 + "json5": "lib/cli.js" 340 + }, 341 + "engines": { 342 + "node": ">=6" 343 + } 344 + }, 345 + "node_modules/@babel/core/node_modules/ms": { 346 + "version": "2.1.2", 347 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 348 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 349 + "dev": true 350 + }, 351 + "node_modules/@babel/core/node_modules/semver": { 352 + "version": "6.3.0", 353 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 354 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 355 + "dev": true, 356 + "bin": { 357 + "semver": "bin/semver.js" 358 + } 359 + }, 360 + "node_modules/@babel/generator": { 361 + "version": "7.16.8", 362 + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", 363 + "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", 364 + "dev": true, 365 + "dependencies": { 366 + "@babel/types": "^7.16.8", 367 + "jsesc": "^2.5.1", 368 + "source-map": "^0.5.0" 369 + }, 370 + "engines": { 371 + "node": ">=6.9.0" 372 + } 373 + }, 374 + "node_modules/@babel/generator/node_modules/jsesc": { 375 + "version": "2.5.2", 376 + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", 377 + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", 378 + "dev": true, 379 + "bin": { 380 + "jsesc": "bin/jsesc" 381 + }, 382 + "engines": { 383 + "node": ">=4" 384 + } 385 + }, 386 + "node_modules/@babel/helper-annotate-as-pure": { 387 + "version": "7.16.7", 388 + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", 389 + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", 390 + "dev": true, 391 + "dependencies": { 392 + "@babel/types": "^7.16.7" 393 + }, 394 + "engines": { 395 + "node": ">=6.9.0" 396 + } 397 + }, 398 + "node_modules/@babel/helper-builder-binary-assignment-operator-visitor": { 399 + "version": "7.16.7", 400 + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz", 401 + "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==", 402 + "dev": true, 403 + "dependencies": { 404 + "@babel/helper-explode-assignable-expression": "^7.16.7", 405 + "@babel/types": "^7.16.7" 406 + }, 407 + "engines": { 408 + "node": ">=6.9.0" 409 + } 410 + }, 411 + "node_modules/@babel/helper-compilation-targets": { 412 + "version": "7.16.7", 413 + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", 414 + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", 415 + "dev": true, 416 + "dependencies": { 417 + "@babel/compat-data": "^7.16.4", 418 + "@babel/helper-validator-option": "^7.16.7", 419 + "browserslist": "^4.17.5", 420 + "semver": "^6.3.0" 421 + }, 422 + "engines": { 423 + "node": ">=6.9.0" 424 + }, 425 + "peerDependencies": { 426 + "@babel/core": "^7.0.0" 427 + } 428 + }, 429 + "node_modules/@babel/helper-compilation-targets/node_modules/browserslist": { 430 + "version": "4.19.1", 431 + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", 432 + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", 433 + "dev": true, 434 + "dependencies": { 435 + "caniuse-lite": "^1.0.30001286", 436 + "electron-to-chromium": "^1.4.17", 437 + "escalade": "^3.1.1", 438 + "node-releases": "^2.0.1", 439 + "picocolors": "^1.0.0" 440 + }, 441 + "bin": { 442 + "browserslist": "cli.js" 443 + }, 444 + "engines": { 445 + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" 446 + }, 447 + "funding": { 448 + "type": "opencollective", 449 + "url": "https://opencollective.com/browserslist" 450 + } 451 + }, 452 + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { 453 + "version": "6.3.0", 454 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 455 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 456 + "dev": true, 457 + "bin": { 458 + "semver": "bin/semver.js" 459 + } 460 + }, 461 + "node_modules/@babel/helper-create-class-features-plugin": { 462 + "version": "7.16.10", 463 + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.10.tgz", 464 + "integrity": "sha512-wDeej0pu3WN/ffTxMNCPW5UCiOav8IcLRxSIyp/9+IF2xJUM9h/OYjg0IJLHaL6F8oU8kqMz9nc1vryXhMsgXg==", 465 + "dev": true, 466 + "dependencies": { 467 + "@babel/helper-annotate-as-pure": "^7.16.7", 468 + "@babel/helper-environment-visitor": "^7.16.7", 469 + "@babel/helper-function-name": "^7.16.7", 470 + "@babel/helper-member-expression-to-functions": "^7.16.7", 471 + "@babel/helper-optimise-call-expression": "^7.16.7", 472 + "@babel/helper-replace-supers": "^7.16.7", 473 + "@babel/helper-split-export-declaration": "^7.16.7" 474 + }, 475 + "engines": { 476 + "node": ">=6.9.0" 477 + }, 478 + "peerDependencies": { 479 + "@babel/core": "^7.0.0" 480 + } 481 + }, 482 + "node_modules/@babel/helper-create-regexp-features-plugin": { 483 + "version": "7.16.7", 484 + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.7.tgz", 485 + "integrity": "sha512-fk5A6ymfp+O5+p2yCkXAu5Kyj6v0xh0RBeNcAkYUMDvvAAoxvSKXn+Jb37t/yWFiQVDFK1ELpUTD8/aLhCPu+g==", 486 + "dev": true, 487 + "dependencies": { 488 + "@babel/helper-annotate-as-pure": "^7.16.7", 489 + "regexpu-core": "^4.7.1" 490 + }, 491 + "engines": { 492 + "node": ">=6.9.0" 493 + }, 494 + "peerDependencies": { 495 + "@babel/core": "^7.0.0" 496 + } 497 + }, 498 + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/regexpu-core": { 499 + "version": "4.8.0", 500 + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", 501 + "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", 502 + "dev": true, 503 + "dependencies": { 504 + "regenerate": "^1.4.2", 505 + "regenerate-unicode-properties": "^9.0.0", 506 + "regjsgen": "^0.5.2", 507 + "regjsparser": "^0.7.0", 508 + "unicode-match-property-ecmascript": "^2.0.0", 509 + "unicode-match-property-value-ecmascript": "^2.0.0" 510 + }, 511 + "engines": { 512 + "node": ">=4" 513 + } 514 + }, 515 + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/regjsgen": { 516 + "version": "0.5.2", 517 + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", 518 + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", 519 + "dev": true 520 + }, 521 + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/regjsparser": { 522 + "version": "0.7.0", 523 + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", 524 + "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", 525 + "dev": true, 526 + "dependencies": { 527 + "jsesc": "~0.5.0" 528 + }, 529 + "bin": { 530 + "regjsparser": "bin/parser" 531 + } 532 + }, 533 + "node_modules/@babel/helper-define-map": { 534 + "version": "7.16.7", 535 + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.16.7.tgz", 536 + "integrity": "sha512-SoIOh18NdeBBQjiLF1H32jpDLkApTbUWwEXmqaxn1KEm7aqry4reaghMdCdkbdloVmMwUxM/uCcTmHWj9zJbxQ==", 537 + "dev": true, 538 + "dependencies": { 539 + "@babel/helper-function-name": "^7.16.7", 540 + "@babel/types": "^7.16.7" 541 + }, 542 + "engines": { 543 + "node": ">=6.9.0" 544 + } 545 + }, 546 + "node_modules/@babel/helper-define-polyfill-provider": { 547 + "version": "0.3.1", 548 + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz", 549 + "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==", 550 + "dev": true, 551 + "dependencies": { 552 + "@babel/helper-compilation-targets": "^7.13.0", 553 + "@babel/helper-module-imports": "^7.12.13", 554 + "@babel/helper-plugin-utils": "^7.13.0", 555 + "@babel/traverse": "^7.13.0", 556 + "debug": "^4.1.1", 557 + "lodash.debounce": "^4.0.8", 558 + "resolve": "^1.14.2", 559 + "semver": "^6.1.2" 560 + }, 561 + "peerDependencies": { 562 + "@babel/core": "^7.4.0-0" 563 + } 564 + }, 565 + "node_modules/@babel/helper-define-polyfill-provider/node_modules/debug": { 566 + "version": "4.3.3", 567 + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", 568 + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", 569 + "dev": true, 570 + "dependencies": { 571 + "ms": "2.1.2" 572 + }, 573 + "engines": { 574 + "node": ">=6.0" 575 + }, 576 + "peerDependenciesMeta": { 577 + "supports-color": { 578 + "optional": true 579 + } 580 + } 581 + }, 582 + "node_modules/@babel/helper-define-polyfill-provider/node_modules/ms": { 583 + "version": "2.1.2", 584 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 585 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 586 + "dev": true 587 + }, 588 + "node_modules/@babel/helper-define-polyfill-provider/node_modules/semver": { 589 + "version": "6.3.0", 590 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 591 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 592 + "dev": true, 593 + "bin": { 594 + "semver": "bin/semver.js" 595 + } 596 + }, 597 + "node_modules/@babel/helper-environment-visitor": { 598 + "version": "7.16.7", 599 + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", 600 + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", 601 + "dev": true, 602 + "dependencies": { 603 + "@babel/types": "^7.16.7" 604 + }, 605 + "engines": { 606 + "node": ">=6.9.0" 607 + } 608 + }, 609 + "node_modules/@babel/helper-explode-assignable-expression": { 610 + "version": "7.16.7", 611 + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz", 612 + "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==", 613 + "dev": true, 614 + "dependencies": { 615 + "@babel/types": "^7.16.7" 616 + }, 617 + "engines": { 618 + "node": ">=6.9.0" 619 + } 620 + }, 621 + "node_modules/@babel/helper-function-name": { 622 + "version": "7.16.7", 623 + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", 624 + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", 625 + "dev": true, 626 + "dependencies": { 627 + "@babel/helper-get-function-arity": "^7.16.7", 628 + "@babel/template": "^7.16.7", 629 + "@babel/types": "^7.16.7" 630 + }, 631 + "engines": { 632 + "node": ">=6.9.0" 633 + } 634 + }, 635 + "node_modules/@babel/helper-get-function-arity": { 636 + "version": "7.16.7", 637 + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", 638 + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", 639 + "dev": true, 640 + "dependencies": { 641 + "@babel/types": "^7.16.7" 642 + }, 643 + "engines": { 644 + "node": ">=6.9.0" 645 + } 646 + }, 647 + "node_modules/@babel/helper-hoist-variables": { 648 + "version": "7.16.7", 649 + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", 650 + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", 651 + "dev": true, 652 + "dependencies": { 653 + "@babel/types": "^7.16.7" 654 + }, 655 + "engines": { 656 + "node": ">=6.9.0" 657 + } 658 + }, 659 + "node_modules/@babel/helper-member-expression-to-functions": { 660 + "version": "7.16.7", 661 + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz", 662 + "integrity": "sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==", 663 + "dev": true, 664 + "dependencies": { 665 + "@babel/types": "^7.16.7" 666 + }, 667 + "engines": { 668 + "node": ">=6.9.0" 669 + } 670 + }, 671 + "node_modules/@babel/helper-module-imports": { 672 + "version": "7.16.7", 673 + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", 674 + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", 675 + "dev": true, 676 + "dependencies": { 677 + "@babel/types": "^7.16.7" 678 + }, 679 + "engines": { 680 + "node": ">=6.9.0" 681 + } 682 + }, 683 + "node_modules/@babel/helper-module-transforms": { 684 + "version": "7.16.7", 685 + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", 686 + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", 687 + "dev": true, 688 + "dependencies": { 689 + "@babel/helper-environment-visitor": "^7.16.7", 690 + "@babel/helper-module-imports": "^7.16.7", 691 + "@babel/helper-simple-access": "^7.16.7", 692 + "@babel/helper-split-export-declaration": "^7.16.7", 693 + "@babel/helper-validator-identifier": "^7.16.7", 694 + "@babel/template": "^7.16.7", 695 + "@babel/traverse": "^7.16.7", 696 + "@babel/types": "^7.16.7" 697 + }, 698 + "engines": { 699 + "node": ">=6.9.0" 700 + } 701 + }, 702 + "node_modules/@babel/helper-optimise-call-expression": { 703 + "version": "7.16.7", 704 + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", 705 + "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", 706 + "dev": true, 707 + "dependencies": { 708 + "@babel/types": "^7.16.7" 709 + }, 710 + "engines": { 711 + "node": ">=6.9.0" 712 + } 713 + }, 714 + "node_modules/@babel/helper-plugin-utils": { 715 + "version": "7.16.7", 716 + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", 717 + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", 718 + "dev": true, 719 + "engines": { 720 + "node": ">=6.9.0" 721 + } 722 + }, 723 + "node_modules/@babel/helper-remap-async-to-generator": { 724 + "version": "7.16.8", 725 + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz", 726 + "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==", 727 + "dev": true, 728 + "dependencies": { 729 + "@babel/helper-annotate-as-pure": "^7.16.7", 730 + "@babel/helper-wrap-function": "^7.16.8", 731 + "@babel/types": "^7.16.8" 732 + }, 733 + "engines": { 734 + "node": ">=6.9.0" 735 + } 736 + }, 737 + "node_modules/@babel/helper-replace-supers": { 738 + "version": "7.16.7", 739 + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", 740 + "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", 741 + "dev": true, 742 + "dependencies": { 743 + "@babel/helper-environment-visitor": "^7.16.7", 744 + "@babel/helper-member-expression-to-functions": "^7.16.7", 745 + "@babel/helper-optimise-call-expression": "^7.16.7", 746 + "@babel/traverse": "^7.16.7", 747 + "@babel/types": "^7.16.7" 748 + }, 749 + "engines": { 750 + "node": ">=6.9.0" 751 + } 752 + }, 753 + "node_modules/@babel/helper-simple-access": { 754 + "version": "7.16.7", 755 + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", 756 + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", 757 + "dev": true, 758 + "dependencies": { 759 + "@babel/types": "^7.16.7" 760 + }, 761 + "engines": { 762 + "node": ">=6.9.0" 763 + } 764 + }, 765 + "node_modules/@babel/helper-skip-transparent-expression-wrappers": { 766 + "version": "7.16.0", 767 + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", 768 + "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", 769 + "dev": true, 770 + "dependencies": { 771 + "@babel/types": "^7.16.0" 772 + }, 773 + "engines": { 774 + "node": ">=6.9.0" 775 + } 776 + }, 777 + "node_modules/@babel/helper-split-export-declaration": { 778 + "version": "7.16.7", 779 + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", 780 + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", 781 + "dev": true, 782 + "dependencies": { 783 + "@babel/types": "^7.16.7" 784 + }, 785 + "engines": { 786 + "node": ">=6.9.0" 787 + } 788 + }, 789 + "node_modules/@babel/helper-validator-identifier": { 790 + "version": "7.16.7", 791 + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", 792 + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", 793 + "dev": true, 794 + "engines": { 795 + "node": ">=6.9.0" 796 + } 797 + }, 798 + "node_modules/@babel/helper-validator-option": { 799 + "version": "7.16.7", 800 + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", 801 + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", 802 + "dev": true, 803 + "engines": { 804 + "node": ">=6.9.0" 805 + } 806 + }, 807 + "node_modules/@babel/helper-wrap-function": { 808 + "version": "7.16.8", 809 + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz", 810 + "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==", 811 + "dev": true, 812 + "dependencies": { 813 + "@babel/helper-function-name": "^7.16.7", 814 + "@babel/template": "^7.16.7", 815 + "@babel/traverse": "^7.16.8", 816 + "@babel/types": "^7.16.8" 817 + }, 818 + "engines": { 819 + "node": ">=6.9.0" 820 + } 821 + }, 822 + "node_modules/@babel/helpers": { 823 + "version": "7.16.7", 824 + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", 825 + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", 826 + "dev": true, 827 + "dependencies": { 828 + "@babel/template": "^7.16.7", 829 + "@babel/traverse": "^7.16.7", 830 + "@babel/types": "^7.16.7" 831 + }, 832 + "engines": { 833 + "node": ">=6.9.0" 834 + } 835 + }, 836 + "node_modules/@babel/highlight": { 837 + "version": "7.16.10", 838 + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", 839 + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", 840 + "dev": true, 841 + "dependencies": { 842 + "@babel/helper-validator-identifier": "^7.16.7", 843 + "chalk": "^2.0.0", 844 + "js-tokens": "^4.0.0" 845 + }, 846 + "engines": { 847 + "node": ">=6.9.0" 848 + } 849 + }, 850 + "node_modules/@babel/highlight/node_modules/ansi-styles": { 851 + "version": "3.2.1", 852 + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 853 + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 854 + "dev": true, 855 + "dependencies": { 856 + "color-convert": "^1.9.0" 857 + }, 858 + "engines": { 859 + "node": ">=4" 860 + } 861 + }, 862 + "node_modules/@babel/highlight/node_modules/chalk": { 863 + "version": "2.4.2", 864 + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 865 + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 866 + "dev": true, 867 + "dependencies": { 868 + "ansi-styles": "^3.2.1", 869 + "escape-string-regexp": "^1.0.5", 870 + "supports-color": "^5.3.0" 871 + }, 872 + "engines": { 873 + "node": ">=4" 874 + } 875 + }, 876 + "node_modules/@babel/highlight/node_modules/js-tokens": { 877 + "version": "4.0.0", 878 + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 879 + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 880 + "dev": true 881 + }, 882 + "node_modules/@babel/highlight/node_modules/supports-color": { 883 + "version": "5.5.0", 884 + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 885 + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 886 + "dev": true, 887 + "dependencies": { 888 + "has-flag": "^3.0.0" 889 + }, 890 + "engines": { 891 + "node": ">=4" 892 + } 893 + }, 894 + "node_modules/@babel/parser": { 895 + "version": "7.16.12", 896 + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", 897 + "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", 898 + "dev": true, 899 + "bin": { 900 + "parser": "bin/babel-parser.js" 901 + }, 902 + "engines": { 903 + "node": ">=6.0.0" 904 + } 905 + }, 906 + "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { 907 + "version": "7.16.7", 908 + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz", 909 + "integrity": "sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg==", 910 + "dev": true, 911 + "dependencies": { 912 + "@babel/helper-plugin-utils": "^7.16.7" 913 + }, 914 + "engines": { 915 + "node": ">=6.9.0" 916 + }, 917 + "peerDependencies": { 918 + "@babel/core": "^7.0.0" 919 + } 920 + }, 921 + "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { 922 + "version": "7.16.7", 923 + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz", 924 + "integrity": "sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw==", 925 + "dev": true, 926 + "dependencies": { 927 + "@babel/helper-plugin-utils": "^7.16.7", 928 + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", 929 + "@babel/plugin-proposal-optional-chaining": "^7.16.7" 930 + }, 931 + "engines": { 932 + "node": ">=6.9.0" 933 + }, 934 + "peerDependencies": { 935 + "@babel/core": "^7.13.0" 936 + } 937 + }, 938 + "node_modules/@babel/plugin-proposal-async-generator-functions": { 939 + "version": "7.16.8", 940 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz", 941 + "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==", 942 + "dev": true, 943 + "dependencies": { 944 + "@babel/helper-plugin-utils": "^7.16.7", 945 + "@babel/helper-remap-async-to-generator": "^7.16.8", 946 + "@babel/plugin-syntax-async-generators": "^7.8.4" 947 + }, 948 + "engines": { 949 + "node": ">=6.9.0" 950 + }, 951 + "peerDependencies": { 952 + "@babel/core": "^7.0.0-0" 953 + } 954 + }, 955 + "node_modules/@babel/plugin-proposal-class-properties": { 956 + "version": "7.16.7", 957 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz", 958 + "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==", 959 + "dev": true, 960 + "dependencies": { 961 + "@babel/helper-create-class-features-plugin": "^7.16.7", 962 + "@babel/helper-plugin-utils": "^7.16.7" 963 + }, 964 + "engines": { 965 + "node": ">=6.9.0" 966 + }, 967 + "peerDependencies": { 968 + "@babel/core": "^7.0.0-0" 969 + } 970 + }, 971 + "node_modules/@babel/plugin-proposal-class-static-block": { 972 + "version": "7.16.7", 973 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.7.tgz", 974 + "integrity": "sha512-dgqJJrcZoG/4CkMopzhPJjGxsIe9A8RlkQLnL/Vhhx8AA9ZuaRwGSlscSh42hazc7WSrya/IK7mTeoF0DP9tEw==", 975 + "dev": true, 976 + "dependencies": { 977 + "@babel/helper-create-class-features-plugin": "^7.16.7", 978 + "@babel/helper-plugin-utils": "^7.16.7", 979 + "@babel/plugin-syntax-class-static-block": "^7.14.5" 980 + }, 981 + "engines": { 982 + "node": ">=6.9.0" 983 + }, 984 + "peerDependencies": { 985 + "@babel/core": "^7.12.0" 986 + } 987 + }, 988 + "node_modules/@babel/plugin-proposal-dynamic-import": { 989 + "version": "7.16.7", 990 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz", 991 + "integrity": "sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg==", 992 + "dev": true, 993 + "dependencies": { 994 + "@babel/helper-plugin-utils": "^7.16.7", 995 + "@babel/plugin-syntax-dynamic-import": "^7.8.3" 996 + }, 997 + "engines": { 998 + "node": ">=6.9.0" 999 + }, 1000 + "peerDependencies": { 1001 + "@babel/core": "^7.0.0-0" 1002 + } 1003 + }, 1004 + "node_modules/@babel/plugin-proposal-export-namespace-from": { 1005 + "version": "7.16.7", 1006 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz", 1007 + "integrity": "sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA==", 1008 + "dev": true, 1009 + "dependencies": { 1010 + "@babel/helper-plugin-utils": "^7.16.7", 1011 + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" 1012 + }, 1013 + "engines": { 1014 + "node": ">=6.9.0" 1015 + }, 1016 + "peerDependencies": { 1017 + "@babel/core": "^7.0.0-0" 1018 + } 1019 + }, 1020 + "node_modules/@babel/plugin-proposal-json-strings": { 1021 + "version": "7.16.7", 1022 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz", 1023 + "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==", 1024 + "dev": true, 1025 + "dependencies": { 1026 + "@babel/helper-plugin-utils": "^7.16.7", 1027 + "@babel/plugin-syntax-json-strings": "^7.8.3" 1028 + }, 1029 + "engines": { 1030 + "node": ">=6.9.0" 1031 + }, 1032 + "peerDependencies": { 1033 + "@babel/core": "^7.0.0-0" 1034 + } 1035 + }, 1036 + "node_modules/@babel/plugin-proposal-logical-assignment-operators": { 1037 + "version": "7.16.7", 1038 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz", 1039 + "integrity": "sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg==", 1040 + "dev": true, 1041 + "dependencies": { 1042 + "@babel/helper-plugin-utils": "^7.16.7", 1043 + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" 1044 + }, 1045 + "engines": { 1046 + "node": ">=6.9.0" 1047 + }, 1048 + "peerDependencies": { 1049 + "@babel/core": "^7.0.0-0" 1050 + } 1051 + }, 1052 + "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { 1053 + "version": "7.16.7", 1054 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz", 1055 + "integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==", 1056 + "dev": true, 1057 + "dependencies": { 1058 + "@babel/helper-plugin-utils": "^7.16.7", 1059 + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" 1060 + }, 1061 + "engines": { 1062 + "node": ">=6.9.0" 1063 + }, 1064 + "peerDependencies": { 1065 + "@babel/core": "^7.0.0-0" 1066 + } 1067 + }, 1068 + "node_modules/@babel/plugin-proposal-numeric-separator": { 1069 + "version": "7.16.7", 1070 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz", 1071 + "integrity": "sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw==", 1072 + "dev": true, 1073 + "dependencies": { 1074 + "@babel/helper-plugin-utils": "^7.16.7", 1075 + "@babel/plugin-syntax-numeric-separator": "^7.10.4" 1076 + }, 1077 + "engines": { 1078 + "node": ">=6.9.0" 1079 + }, 1080 + "peerDependencies": { 1081 + "@babel/core": "^7.0.0-0" 1082 + } 1083 + }, 1084 + "node_modules/@babel/plugin-proposal-object-rest-spread": { 1085 + "version": "7.16.7", 1086 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.7.tgz", 1087 + "integrity": "sha512-3O0Y4+dw94HA86qSg9IHfyPktgR7q3gpNVAeiKQd+8jBKFaU5NQS1Yatgo4wY+UFNuLjvxcSmzcsHqrhgTyBUA==", 1088 + "dev": true, 1089 + "dependencies": { 1090 + "@babel/compat-data": "^7.16.4", 1091 + "@babel/helper-compilation-targets": "^7.16.7", 1092 + "@babel/helper-plugin-utils": "^7.16.7", 1093 + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", 1094 + "@babel/plugin-transform-parameters": "^7.16.7" 1095 + }, 1096 + "engines": { 1097 + "node": ">=6.9.0" 1098 + }, 1099 + "peerDependencies": { 1100 + "@babel/core": "^7.0.0-0" 1101 + } 1102 + }, 1103 + "node_modules/@babel/plugin-proposal-optional-catch-binding": { 1104 + "version": "7.16.7", 1105 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz", 1106 + "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==", 1107 + "dev": true, 1108 + "dependencies": { 1109 + "@babel/helper-plugin-utils": "^7.16.7", 1110 + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" 1111 + }, 1112 + "engines": { 1113 + "node": ">=6.9.0" 1114 + }, 1115 + "peerDependencies": { 1116 + "@babel/core": "^7.0.0-0" 1117 + } 1118 + }, 1119 + "node_modules/@babel/plugin-proposal-optional-chaining": { 1120 + "version": "7.16.7", 1121 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz", 1122 + "integrity": "sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==", 1123 + "dev": true, 1124 + "dependencies": { 1125 + "@babel/helper-plugin-utils": "^7.16.7", 1126 + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", 1127 + "@babel/plugin-syntax-optional-chaining": "^7.8.3" 1128 + }, 1129 + "engines": { 1130 + "node": ">=6.9.0" 1131 + }, 1132 + "peerDependencies": { 1133 + "@babel/core": "^7.0.0-0" 1134 + } 1135 + }, 1136 + "node_modules/@babel/plugin-proposal-private-methods": { 1137 + "version": "7.16.11", 1138 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz", 1139 + "integrity": "sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw==", 1140 + "dev": true, 1141 + "dependencies": { 1142 + "@babel/helper-create-class-features-plugin": "^7.16.10", 1143 + "@babel/helper-plugin-utils": "^7.16.7" 1144 + }, 1145 + "engines": { 1146 + "node": ">=6.9.0" 1147 + }, 1148 + "peerDependencies": { 1149 + "@babel/core": "^7.0.0-0" 1150 + } 1151 + }, 1152 + "node_modules/@babel/plugin-proposal-private-property-in-object": { 1153 + "version": "7.16.7", 1154 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz", 1155 + "integrity": "sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ==", 1156 + "dev": true, 1157 + "dependencies": { 1158 + "@babel/helper-annotate-as-pure": "^7.16.7", 1159 + "@babel/helper-create-class-features-plugin": "^7.16.7", 1160 + "@babel/helper-plugin-utils": "^7.16.7", 1161 + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" 1162 + }, 1163 + "engines": { 1164 + "node": ">=6.9.0" 1165 + }, 1166 + "peerDependencies": { 1167 + "@babel/core": "^7.0.0-0" 1168 + } 1169 + }, 1170 + "node_modules/@babel/plugin-proposal-unicode-property-regex": { 1171 + "version": "7.16.7", 1172 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz", 1173 + "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==", 1174 + "dev": true, 1175 + "dependencies": { 1176 + "@babel/helper-create-regexp-features-plugin": "^7.16.7", 1177 + "@babel/helper-plugin-utils": "^7.16.7" 1178 + }, 1179 + "engines": { 1180 + "node": ">=4" 1181 + }, 1182 + "peerDependencies": { 1183 + "@babel/core": "^7.0.0-0" 1184 + } 1185 + }, 1186 + "node_modules/@babel/plugin-syntax-async-generators": { 1187 + "version": "7.8.4", 1188 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", 1189 + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", 1190 + "dev": true, 1191 + "dependencies": { 1192 + "@babel/helper-plugin-utils": "^7.8.0" 1193 + }, 1194 + "peerDependencies": { 1195 + "@babel/core": "^7.0.0-0" 1196 + } 1197 + }, 1198 + "node_modules/@babel/plugin-syntax-class-properties": { 1199 + "version": "7.12.13", 1200 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", 1201 + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", 1202 + "dev": true, 1203 + "dependencies": { 1204 + "@babel/helper-plugin-utils": "^7.12.13" 1205 + }, 1206 + "peerDependencies": { 1207 + "@babel/core": "^7.0.0-0" 1208 + } 1209 + }, 1210 + "node_modules/@babel/plugin-syntax-class-static-block": { 1211 + "version": "7.14.5", 1212 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", 1213 + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", 1214 + "dev": true, 1215 + "dependencies": { 1216 + "@babel/helper-plugin-utils": "^7.14.5" 1217 + }, 1218 + "engines": { 1219 + "node": ">=6.9.0" 1220 + }, 1221 + "peerDependencies": { 1222 + "@babel/core": "^7.0.0-0" 1223 + } 1224 + }, 1225 + "node_modules/@babel/plugin-syntax-dynamic-import": { 1226 + "version": "7.8.3", 1227 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", 1228 + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", 1229 + "dev": true, 1230 + "dependencies": { 1231 + "@babel/helper-plugin-utils": "^7.8.0" 1232 + }, 1233 + "peerDependencies": { 1234 + "@babel/core": "^7.0.0-0" 1235 + } 1236 + }, 1237 + "node_modules/@babel/plugin-syntax-export-namespace-from": { 1238 + "version": "7.8.3", 1239 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", 1240 + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", 1241 + "dev": true, 1242 + "dependencies": { 1243 + "@babel/helper-plugin-utils": "^7.8.3" 1244 + }, 1245 + "peerDependencies": { 1246 + "@babel/core": "^7.0.0-0" 1247 + } 1248 + }, 1249 + "node_modules/@babel/plugin-syntax-json-strings": { 1250 + "version": "7.8.3", 1251 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", 1252 + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", 1253 + "dev": true, 1254 + "dependencies": { 1255 + "@babel/helper-plugin-utils": "^7.8.0" 1256 + }, 1257 + "peerDependencies": { 1258 + "@babel/core": "^7.0.0-0" 1259 + } 1260 + }, 1261 + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { 1262 + "version": "7.10.4", 1263 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", 1264 + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", 1265 + "dev": true, 1266 + "dependencies": { 1267 + "@babel/helper-plugin-utils": "^7.10.4" 1268 + }, 1269 + "peerDependencies": { 1270 + "@babel/core": "^7.0.0-0" 1271 + } 1272 + }, 1273 + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { 1274 + "version": "7.8.3", 1275 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", 1276 + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", 1277 + "dev": true, 1278 + "dependencies": { 1279 + "@babel/helper-plugin-utils": "^7.8.0" 1280 + }, 1281 + "peerDependencies": { 1282 + "@babel/core": "^7.0.0-0" 1283 + } 1284 + }, 1285 + "node_modules/@babel/plugin-syntax-numeric-separator": { 1286 + "version": "7.10.4", 1287 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", 1288 + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", 1289 + "dev": true, 1290 + "dependencies": { 1291 + "@babel/helper-plugin-utils": "^7.10.4" 1292 + }, 1293 + "peerDependencies": { 1294 + "@babel/core": "^7.0.0-0" 1295 + } 1296 + }, 1297 + "node_modules/@babel/plugin-syntax-object-rest-spread": { 1298 + "version": "7.8.3", 1299 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", 1300 + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", 1301 + "dev": true, 1302 + "dependencies": { 1303 + "@babel/helper-plugin-utils": "^7.8.0" 1304 + }, 1305 + "peerDependencies": { 1306 + "@babel/core": "^7.0.0-0" 1307 + } 1308 + }, 1309 + "node_modules/@babel/plugin-syntax-optional-catch-binding": { 1310 + "version": "7.8.3", 1311 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", 1312 + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", 1313 + "dev": true, 1314 + "dependencies": { 1315 + "@babel/helper-plugin-utils": "^7.8.0" 1316 + }, 1317 + "peerDependencies": { 1318 + "@babel/core": "^7.0.0-0" 1319 + } 1320 + }, 1321 + "node_modules/@babel/plugin-syntax-optional-chaining": { 1322 + "version": "7.8.3", 1323 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", 1324 + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", 1325 + "dev": true, 1326 + "dependencies": { 1327 + "@babel/helper-plugin-utils": "^7.8.0" 1328 + }, 1329 + "peerDependencies": { 1330 + "@babel/core": "^7.0.0-0" 1331 + } 1332 + }, 1333 + "node_modules/@babel/plugin-syntax-private-property-in-object": { 1334 + "version": "7.14.5", 1335 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", 1336 + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", 1337 + "dev": true, 1338 + "dependencies": { 1339 + "@babel/helper-plugin-utils": "^7.14.5" 1340 + }, 1341 + "engines": { 1342 + "node": ">=6.9.0" 1343 + }, 1344 + "peerDependencies": { 1345 + "@babel/core": "^7.0.0-0" 1346 + } 1347 + }, 1348 + "node_modules/@babel/plugin-syntax-top-level-await": { 1349 + "version": "7.14.5", 1350 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", 1351 + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", 1352 + "dev": true, 1353 + "dependencies": { 1354 + "@babel/helper-plugin-utils": "^7.14.5" 1355 + }, 1356 + "engines": { 1357 + "node": ">=6.9.0" 1358 + }, 1359 + "peerDependencies": { 1360 + "@babel/core": "^7.0.0-0" 1361 + } 1362 + }, 1363 + "node_modules/@babel/plugin-transform-arrow-functions": { 1364 + "version": "7.16.7", 1365 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz", 1366 + "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==", 1367 + "dev": true, 1368 + "dependencies": { 1369 + "@babel/helper-plugin-utils": "^7.16.7" 1370 + }, 1371 + "engines": { 1372 + "node": ">=6.9.0" 1373 + }, 1374 + "peerDependencies": { 1375 + "@babel/core": "^7.0.0-0" 1376 + } 1377 + }, 1378 + "node_modules/@babel/plugin-transform-async-to-generator": { 1379 + "version": "7.16.8", 1380 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz", 1381 + "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==", 1382 + "dev": true, 1383 + "dependencies": { 1384 + "@babel/helper-module-imports": "^7.16.7", 1385 + "@babel/helper-plugin-utils": "^7.16.7", 1386 + "@babel/helper-remap-async-to-generator": "^7.16.8" 1387 + }, 1388 + "engines": { 1389 + "node": ">=6.9.0" 1390 + }, 1391 + "peerDependencies": { 1392 + "@babel/core": "^7.0.0-0" 1393 + } 1394 + }, 1395 + "node_modules/@babel/plugin-transform-block-scoped-functions": { 1396 + "version": "7.16.7", 1397 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz", 1398 + "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==", 1399 + "dev": true, 1400 + "dependencies": { 1401 + "@babel/helper-plugin-utils": "^7.16.7" 1402 + }, 1403 + "engines": { 1404 + "node": ">=6.9.0" 1405 + }, 1406 + "peerDependencies": { 1407 + "@babel/core": "^7.0.0-0" 1408 + } 1409 + }, 1410 + "node_modules/@babel/plugin-transform-block-scoping": { 1411 + "version": "7.16.7", 1412 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz", 1413 + "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==", 1414 + "dev": true, 1415 + "dependencies": { 1416 + "@babel/helper-plugin-utils": "^7.16.7" 1417 + }, 1418 + "engines": { 1419 + "node": ">=6.9.0" 1420 + }, 1421 + "peerDependencies": { 1422 + "@babel/core": "^7.0.0-0" 1423 + } 1424 + }, 1425 + "node_modules/@babel/plugin-transform-classes": { 1426 + "version": "7.16.7", 1427 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz", 1428 + "integrity": "sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ==", 1429 + "dev": true, 1430 + "dependencies": { 1431 + "@babel/helper-annotate-as-pure": "^7.16.7", 1432 + "@babel/helper-environment-visitor": "^7.16.7", 1433 + "@babel/helper-function-name": "^7.16.7", 1434 + "@babel/helper-optimise-call-expression": "^7.16.7", 1435 + "@babel/helper-plugin-utils": "^7.16.7", 1436 + "@babel/helper-replace-supers": "^7.16.7", 1437 + "@babel/helper-split-export-declaration": "^7.16.7", 1438 + "globals": "^11.1.0" 1439 + }, 1440 + "engines": { 1441 + "node": ">=6.9.0" 1442 + }, 1443 + "peerDependencies": { 1444 + "@babel/core": "^7.0.0-0" 1445 + } 1446 + }, 1447 + "node_modules/@babel/plugin-transform-classes/node_modules/globals": { 1448 + "version": "11.12.0", 1449 + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", 1450 + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", 1451 + "dev": true, 1452 + "engines": { 1453 + "node": ">=4" 1454 + } 1455 + }, 1456 + "node_modules/@babel/plugin-transform-computed-properties": { 1457 + "version": "7.16.7", 1458 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz", 1459 + "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==", 1460 + "dev": true, 1461 + "dependencies": { 1462 + "@babel/helper-plugin-utils": "^7.16.7" 1463 + }, 1464 + "engines": { 1465 + "node": ">=6.9.0" 1466 + }, 1467 + "peerDependencies": { 1468 + "@babel/core": "^7.0.0-0" 1469 + } 1470 + }, 1471 + "node_modules/@babel/plugin-transform-destructuring": { 1472 + "version": "7.16.7", 1473 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.7.tgz", 1474 + "integrity": "sha512-VqAwhTHBnu5xBVDCvrvqJbtLUa++qZaWC0Fgr2mqokBlulZARGyIvZDoqbPlPaKImQ9dKAcCzbv+ul//uqu70A==", 1475 + "dev": true, 1476 + "dependencies": { 1477 + "@babel/helper-plugin-utils": "^7.16.7" 1478 + }, 1479 + "engines": { 1480 + "node": ">=6.9.0" 1481 + }, 1482 + "peerDependencies": { 1483 + "@babel/core": "^7.0.0-0" 1484 + } 1485 + }, 1486 + "node_modules/@babel/plugin-transform-dotall-regex": { 1487 + "version": "7.16.7", 1488 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz", 1489 + "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==", 1490 + "dev": true, 1491 + "dependencies": { 1492 + "@babel/helper-create-regexp-features-plugin": "^7.16.7", 1493 + "@babel/helper-plugin-utils": "^7.16.7" 1494 + }, 1495 + "engines": { 1496 + "node": ">=6.9.0" 1497 + }, 1498 + "peerDependencies": { 1499 + "@babel/core": "^7.0.0-0" 1500 + } 1501 + }, 1502 + "node_modules/@babel/plugin-transform-duplicate-keys": { 1503 + "version": "7.16.7", 1504 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz", 1505 + "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==", 1506 + "dev": true, 1507 + "dependencies": { 1508 + "@babel/helper-plugin-utils": "^7.16.7" 1509 + }, 1510 + "engines": { 1511 + "node": ">=6.9.0" 1512 + }, 1513 + "peerDependencies": { 1514 + "@babel/core": "^7.0.0-0" 1515 + } 1516 + }, 1517 + "node_modules/@babel/plugin-transform-exponentiation-operator": { 1518 + "version": "7.16.7", 1519 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz", 1520 + "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==", 1521 + "dev": true, 1522 + "dependencies": { 1523 + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7", 1524 + "@babel/helper-plugin-utils": "^7.16.7" 1525 + }, 1526 + "engines": { 1527 + "node": ">=6.9.0" 1528 + }, 1529 + "peerDependencies": { 1530 + "@babel/core": "^7.0.0-0" 1531 + } 1532 + }, 1533 + "node_modules/@babel/plugin-transform-for-of": { 1534 + "version": "7.16.7", 1535 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz", 1536 + "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==", 1537 + "dev": true, 1538 + "dependencies": { 1539 + "@babel/helper-plugin-utils": "^7.16.7" 1540 + }, 1541 + "engines": { 1542 + "node": ">=6.9.0" 1543 + }, 1544 + "peerDependencies": { 1545 + "@babel/core": "^7.0.0-0" 1546 + } 1547 + }, 1548 + "node_modules/@babel/plugin-transform-function-name": { 1549 + "version": "7.16.7", 1550 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz", 1551 + "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==", 1552 + "dev": true, 1553 + "dependencies": { 1554 + "@babel/helper-compilation-targets": "^7.16.7", 1555 + "@babel/helper-function-name": "^7.16.7", 1556 + "@babel/helper-plugin-utils": "^7.16.7" 1557 + }, 1558 + "engines": { 1559 + "node": ">=6.9.0" 1560 + }, 1561 + "peerDependencies": { 1562 + "@babel/core": "^7.0.0-0" 1563 + } 1564 + }, 1565 + "node_modules/@babel/plugin-transform-literals": { 1566 + "version": "7.16.7", 1567 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz", 1568 + "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==", 1569 + "dev": true, 1570 + "dependencies": { 1571 + "@babel/helper-plugin-utils": "^7.16.7" 1572 + }, 1573 + "engines": { 1574 + "node": ">=6.9.0" 1575 + }, 1576 + "peerDependencies": { 1577 + "@babel/core": "^7.0.0-0" 1578 + } 1579 + }, 1580 + "node_modules/@babel/plugin-transform-member-expression-literals": { 1581 + "version": "7.16.7", 1582 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz", 1583 + "integrity": "sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw==", 1584 + "dev": true, 1585 + "dependencies": { 1586 + "@babel/helper-plugin-utils": "^7.16.7" 1587 + }, 1588 + "engines": { 1589 + "node": ">=6.9.0" 1590 + }, 1591 + "peerDependencies": { 1592 + "@babel/core": "^7.0.0-0" 1593 + } 1594 + }, 1595 + "node_modules/@babel/plugin-transform-modules-amd": { 1596 + "version": "7.16.7", 1597 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz", 1598 + "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==", 1599 + "dev": true, 1600 + "dependencies": { 1601 + "@babel/helper-module-transforms": "^7.16.7", 1602 + "@babel/helper-plugin-utils": "^7.16.7", 1603 + "babel-plugin-dynamic-import-node": "^2.3.3" 1604 + }, 1605 + "engines": { 1606 + "node": ">=6.9.0" 1607 + }, 1608 + "peerDependencies": { 1609 + "@babel/core": "^7.0.0-0" 1610 + } 1611 + }, 1612 + "node_modules/@babel/plugin-transform-modules-commonjs": { 1613 + "version": "7.16.8", 1614 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.8.tgz", 1615 + "integrity": "sha512-oflKPvsLT2+uKQopesJt3ApiaIS2HW+hzHFcwRNtyDGieAeC/dIHZX8buJQ2J2X1rxGPy4eRcUijm3qcSPjYcA==", 1616 + "dev": true, 1617 + "dependencies": { 1618 + "@babel/helper-module-transforms": "^7.16.7", 1619 + "@babel/helper-plugin-utils": "^7.16.7", 1620 + "@babel/helper-simple-access": "^7.16.7", 1621 + "babel-plugin-dynamic-import-node": "^2.3.3" 1622 + }, 1623 + "engines": { 1624 + "node": ">=6.9.0" 1625 + }, 1626 + "peerDependencies": { 1627 + "@babel/core": "^7.0.0-0" 1628 + } 1629 + }, 1630 + "node_modules/@babel/plugin-transform-modules-systemjs": { 1631 + "version": "7.16.7", 1632 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.7.tgz", 1633 + "integrity": "sha512-DuK5E3k+QQmnOqBR9UkusByy5WZWGRxfzV529s9nPra1GE7olmxfqO2FHobEOYSPIjPBTr4p66YDcjQnt8cBmw==", 1634 + "dev": true, 1635 + "dependencies": { 1636 + "@babel/helper-hoist-variables": "^7.16.7", 1637 + "@babel/helper-module-transforms": "^7.16.7", 1638 + "@babel/helper-plugin-utils": "^7.16.7", 1639 + "@babel/helper-validator-identifier": "^7.16.7", 1640 + "babel-plugin-dynamic-import-node": "^2.3.3" 1641 + }, 1642 + "engines": { 1643 + "node": ">=6.9.0" 1644 + }, 1645 + "peerDependencies": { 1646 + "@babel/core": "^7.0.0-0" 1647 + } 1648 + }, 1649 + "node_modules/@babel/plugin-transform-modules-umd": { 1650 + "version": "7.16.7", 1651 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz", 1652 + "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==", 1653 + "dev": true, 1654 + "dependencies": { 1655 + "@babel/helper-module-transforms": "^7.16.7", 1656 + "@babel/helper-plugin-utils": "^7.16.7" 1657 + }, 1658 + "engines": { 1659 + "node": ">=6.9.0" 1660 + }, 1661 + "peerDependencies": { 1662 + "@babel/core": "^7.0.0-0" 1663 + } 1664 + }, 1665 + "node_modules/@babel/plugin-transform-named-capturing-groups-regex": { 1666 + "version": "7.16.8", 1667 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz", 1668 + "integrity": "sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw==", 1669 + "dev": true, 1670 + "dependencies": { 1671 + "@babel/helper-create-regexp-features-plugin": "^7.16.7" 1672 + }, 1673 + "engines": { 1674 + "node": ">=6.9.0" 1675 + }, 1676 + "peerDependencies": { 1677 + "@babel/core": "^7.0.0" 1678 + } 1679 + }, 1680 + "node_modules/@babel/plugin-transform-new-target": { 1681 + "version": "7.16.7", 1682 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz", 1683 + "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==", 1684 + "dev": true, 1685 + "dependencies": { 1686 + "@babel/helper-plugin-utils": "^7.16.7" 1687 + }, 1688 + "engines": { 1689 + "node": ">=6.9.0" 1690 + }, 1691 + "peerDependencies": { 1692 + "@babel/core": "^7.0.0-0" 1693 + } 1694 + }, 1695 + "node_modules/@babel/plugin-transform-object-super": { 1696 + "version": "7.16.7", 1697 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz", 1698 + "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==", 1699 + "dev": true, 1700 + "dependencies": { 1701 + "@babel/helper-plugin-utils": "^7.16.7", 1702 + "@babel/helper-replace-supers": "^7.16.7" 1703 + }, 1704 + "engines": { 1705 + "node": ">=6.9.0" 1706 + }, 1707 + "peerDependencies": { 1708 + "@babel/core": "^7.0.0-0" 1709 + } 1710 + }, 1711 + "node_modules/@babel/plugin-transform-parameters": { 1712 + "version": "7.16.7", 1713 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz", 1714 + "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==", 1715 + "dev": true, 1716 + "dependencies": { 1717 + "@babel/helper-plugin-utils": "^7.16.7" 1718 + }, 1719 + "engines": { 1720 + "node": ">=6.9.0" 1721 + }, 1722 + "peerDependencies": { 1723 + "@babel/core": "^7.0.0-0" 1724 + } 1725 + }, 1726 + "node_modules/@babel/plugin-transform-property-literals": { 1727 + "version": "7.16.7", 1728 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz", 1729 + "integrity": "sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw==", 1730 + "dev": true, 1731 + "dependencies": { 1732 + "@babel/helper-plugin-utils": "^7.16.7" 1733 + }, 1734 + "engines": { 1735 + "node": ">=6.9.0" 1736 + }, 1737 + "peerDependencies": { 1738 + "@babel/core": "^7.0.0-0" 1739 + } 1740 + }, 1741 + "node_modules/@babel/plugin-transform-property-mutators": { 1742 + "version": "7.16.7", 1743 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-mutators/-/plugin-transform-property-mutators-7.16.7.tgz", 1744 + "integrity": "sha512-xEYRrOxWyHrTXY6866IAtVGdioUYrQ38NxHMEFWC2VEaeJwtPfJzONmYrFAxO+9ajIi1HEPik3JbLTqsWBTXTQ==", 1745 + "dev": true, 1746 + "dependencies": { 1747 + "@babel/helper-define-map": "^7.16.7", 1748 + "@babel/helper-plugin-utils": "^7.16.7" 1749 + }, 1750 + "engines": { 1751 + "node": ">=6.9.0" 1752 + }, 1753 + "peerDependencies": { 1754 + "@babel/core": "^7.0.0-0" 1755 + } 1756 + }, 1757 + "node_modules/@babel/plugin-transform-regenerator": { 1758 + "version": "7.16.7", 1759 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz", 1760 + "integrity": "sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q==", 1761 + "dev": true, 1762 + "dependencies": { 1763 + "regenerator-transform": "^0.14.2" 1764 + }, 1765 + "engines": { 1766 + "node": ">=6.9.0" 1767 + }, 1768 + "peerDependencies": { 1769 + "@babel/core": "^7.0.0-0" 1770 + } 1771 + }, 1772 + "node_modules/@babel/plugin-transform-regenerator/node_modules/regenerator-transform": { 1773 + "version": "0.14.5", 1774 + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", 1775 + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", 1776 + "dev": true, 1777 + "dependencies": { 1778 + "@babel/runtime": "^7.8.4" 1779 + } 1780 + }, 1781 + "node_modules/@babel/plugin-transform-reserved-words": { 1782 + "version": "7.16.7", 1783 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz", 1784 + "integrity": "sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg==", 1785 + "dev": true, 1786 + "dependencies": { 1787 + "@babel/helper-plugin-utils": "^7.16.7" 1788 + }, 1789 + "engines": { 1790 + "node": ">=6.9.0" 1791 + }, 1792 + "peerDependencies": { 1793 + "@babel/core": "^7.0.0-0" 1794 + } 1795 + }, 1796 + "node_modules/@babel/plugin-transform-shorthand-properties": { 1797 + "version": "7.16.7", 1798 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz", 1799 + "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==", 1800 + "dev": true, 1801 + "dependencies": { 1802 + "@babel/helper-plugin-utils": "^7.16.7" 1803 + }, 1804 + "engines": { 1805 + "node": ">=6.9.0" 1806 + }, 1807 + "peerDependencies": { 1808 + "@babel/core": "^7.0.0-0" 1809 + } 1810 + }, 1811 + "node_modules/@babel/plugin-transform-spread": { 1812 + "version": "7.16.7", 1813 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", 1814 + "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", 1815 + "dev": true, 1816 + "dependencies": { 1817 + "@babel/helper-plugin-utils": "^7.16.7", 1818 + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" 1819 + }, 1820 + "engines": { 1821 + "node": ">=6.9.0" 1822 + }, 1823 + "peerDependencies": { 1824 + "@babel/core": "^7.0.0-0" 1825 + } 1826 + }, 1827 + "node_modules/@babel/plugin-transform-sticky-regex": { 1828 + "version": "7.16.7", 1829 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz", 1830 + "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==", 1831 + "dev": true, 1832 + "dependencies": { 1833 + "@babel/helper-plugin-utils": "^7.16.7" 1834 + }, 1835 + "engines": { 1836 + "node": ">=6.9.0" 1837 + }, 1838 + "peerDependencies": { 1839 + "@babel/core": "^7.0.0-0" 1840 + } 1841 + }, 1842 + "node_modules/@babel/plugin-transform-template-literals": { 1843 + "version": "7.16.7", 1844 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz", 1845 + "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==", 1846 + "dev": true, 1847 + "dependencies": { 1848 + "@babel/helper-plugin-utils": "^7.16.7" 1849 + }, 1850 + "engines": { 1851 + "node": ">=6.9.0" 1852 + }, 1853 + "peerDependencies": { 1854 + "@babel/core": "^7.0.0-0" 1855 + } 1856 + }, 1857 + "node_modules/@babel/plugin-transform-typeof-symbol": { 1858 + "version": "7.16.7", 1859 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz", 1860 + "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==", 1861 + "dev": true, 1862 + "dependencies": { 1863 + "@babel/helper-plugin-utils": "^7.16.7" 1864 + }, 1865 + "engines": { 1866 + "node": ">=6.9.0" 1867 + }, 1868 + "peerDependencies": { 1869 + "@babel/core": "^7.0.0-0" 1870 + } 1871 + }, 1872 + "node_modules/@babel/plugin-transform-unicode-escapes": { 1873 + "version": "7.16.7", 1874 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz", 1875 + "integrity": "sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q==", 1876 + "dev": true, 1877 + "dependencies": { 1878 + "@babel/helper-plugin-utils": "^7.16.7" 1879 + }, 1880 + "engines": { 1881 + "node": ">=6.9.0" 1882 + }, 1883 + "peerDependencies": { 1884 + "@babel/core": "^7.0.0-0" 1885 + } 1886 + }, 1887 + "node_modules/@babel/plugin-transform-unicode-regex": { 1888 + "version": "7.16.7", 1889 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz", 1890 + "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==", 1891 + "dev": true, 1892 + "dependencies": { 1893 + "@babel/helper-create-regexp-features-plugin": "^7.16.7", 1894 + "@babel/helper-plugin-utils": "^7.16.7" 1895 + }, 1896 + "engines": { 1897 + "node": ">=6.9.0" 1898 + }, 1899 + "peerDependencies": { 1900 + "@babel/core": "^7.0.0-0" 1901 + } 1902 + }, 1903 + "node_modules/@babel/preset-env": { 1904 + "version": "7.16.11", 1905 + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.11.tgz", 1906 + "integrity": "sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g==", 1907 + "dev": true, 1908 + "dependencies": { 1909 + "@babel/compat-data": "^7.16.8", 1910 + "@babel/helper-compilation-targets": "^7.16.7", 1911 + "@babel/helper-plugin-utils": "^7.16.7", 1912 + "@babel/helper-validator-option": "^7.16.7", 1913 + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.7", 1914 + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.7", 1915 + "@babel/plugin-proposal-async-generator-functions": "^7.16.8", 1916 + "@babel/plugin-proposal-class-properties": "^7.16.7", 1917 + "@babel/plugin-proposal-class-static-block": "^7.16.7", 1918 + "@babel/plugin-proposal-dynamic-import": "^7.16.7", 1919 + "@babel/plugin-proposal-export-namespace-from": "^7.16.7", 1920 + "@babel/plugin-proposal-json-strings": "^7.16.7", 1921 + "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7", 1922 + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", 1923 + "@babel/plugin-proposal-numeric-separator": "^7.16.7", 1924 + "@babel/plugin-proposal-object-rest-spread": "^7.16.7", 1925 + "@babel/plugin-proposal-optional-catch-binding": "^7.16.7", 1926 + "@babel/plugin-proposal-optional-chaining": "^7.16.7", 1927 + "@babel/plugin-proposal-private-methods": "^7.16.11", 1928 + "@babel/plugin-proposal-private-property-in-object": "^7.16.7", 1929 + "@babel/plugin-proposal-unicode-property-regex": "^7.16.7", 1930 + "@babel/plugin-syntax-async-generators": "^7.8.4", 1931 + "@babel/plugin-syntax-class-properties": "^7.12.13", 1932 + "@babel/plugin-syntax-class-static-block": "^7.14.5", 1933 + "@babel/plugin-syntax-dynamic-import": "^7.8.3", 1934 + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", 1935 + "@babel/plugin-syntax-json-strings": "^7.8.3", 1936 + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", 1937 + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", 1938 + "@babel/plugin-syntax-numeric-separator": "^7.10.4", 1939 + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", 1940 + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", 1941 + "@babel/plugin-syntax-optional-chaining": "^7.8.3", 1942 + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", 1943 + "@babel/plugin-syntax-top-level-await": "^7.14.5", 1944 + "@babel/plugin-transform-arrow-functions": "^7.16.7", 1945 + "@babel/plugin-transform-async-to-generator": "^7.16.8", 1946 + "@babel/plugin-transform-block-scoped-functions": "^7.16.7", 1947 + "@babel/plugin-transform-block-scoping": "^7.16.7", 1948 + "@babel/plugin-transform-classes": "^7.16.7", 1949 + "@babel/plugin-transform-computed-properties": "^7.16.7", 1950 + "@babel/plugin-transform-destructuring": "^7.16.7", 1951 + "@babel/plugin-transform-dotall-regex": "^7.16.7", 1952 + "@babel/plugin-transform-duplicate-keys": "^7.16.7", 1953 + "@babel/plugin-transform-exponentiation-operator": "^7.16.7", 1954 + "@babel/plugin-transform-for-of": "^7.16.7", 1955 + "@babel/plugin-transform-function-name": "^7.16.7", 1956 + "@babel/plugin-transform-literals": "^7.16.7", 1957 + "@babel/plugin-transform-member-expression-literals": "^7.16.7", 1958 + "@babel/plugin-transform-modules-amd": "^7.16.7", 1959 + "@babel/plugin-transform-modules-commonjs": "^7.16.8", 1960 + "@babel/plugin-transform-modules-systemjs": "^7.16.7", 1961 + "@babel/plugin-transform-modules-umd": "^7.16.7", 1962 + "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.8", 1963 + "@babel/plugin-transform-new-target": "^7.16.7", 1964 + "@babel/plugin-transform-object-super": "^7.16.7", 1965 + "@babel/plugin-transform-parameters": "^7.16.7", 1966 + "@babel/plugin-transform-property-literals": "^7.16.7", 1967 + "@babel/plugin-transform-regenerator": "^7.16.7", 1968 + "@babel/plugin-transform-reserved-words": "^7.16.7", 1969 + "@babel/plugin-transform-shorthand-properties": "^7.16.7", 1970 + "@babel/plugin-transform-spread": "^7.16.7", 1971 + "@babel/plugin-transform-sticky-regex": "^7.16.7", 1972 + "@babel/plugin-transform-template-literals": "^7.16.7", 1973 + "@babel/plugin-transform-typeof-symbol": "^7.16.7", 1974 + "@babel/plugin-transform-unicode-escapes": "^7.16.7", 1975 + "@babel/plugin-transform-unicode-regex": "^7.16.7", 1976 + "@babel/preset-modules": "^0.1.5", 1977 + "@babel/types": "^7.16.8", 1978 + "babel-plugin-polyfill-corejs2": "^0.3.0", 1979 + "babel-plugin-polyfill-corejs3": "^0.5.0", 1980 + "babel-plugin-polyfill-regenerator": "^0.3.0", 1981 + "core-js-compat": "^3.20.2", 1982 + "semver": "^6.3.0" 1983 + }, 1984 + "engines": { 1985 + "node": ">=6.9.0" 1986 + }, 1987 + "peerDependencies": { 1988 + "@babel/core": "^7.0.0-0" 1989 + } 1990 + }, 1991 + "node_modules/@babel/preset-env/node_modules/semver": { 1992 + "version": "6.3.0", 1993 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 1994 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 1995 + "dev": true, 1996 + "bin": { 1997 + "semver": "bin/semver.js" 1998 + } 1999 + }, 2000 + "node_modules/@babel/preset-modules": { 2001 + "version": "0.1.5", 2002 + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", 2003 + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", 2004 + "dev": true, 2005 + "dependencies": { 2006 + "@babel/helper-plugin-utils": "^7.0.0", 2007 + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", 2008 + "@babel/plugin-transform-dotall-regex": "^7.4.4", 2009 + "@babel/types": "^7.4.4", 2010 + "esutils": "^2.0.2" 2011 + }, 2012 + "peerDependencies": { 2013 + "@babel/core": "^7.0.0-0" 2014 + } 2015 + }, 2016 + "node_modules/@babel/runtime": { 2017 + "version": "7.16.7", 2018 + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", 2019 + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", 2020 + "dev": true, 2021 + "dependencies": { 2022 + "regenerator-runtime": "^0.13.4" 2023 + }, 2024 + "engines": { 2025 + "node": ">=6.9.0" 2026 + } 2027 + }, 2028 + "node_modules/@babel/runtime/node_modules/regenerator-runtime": { 2029 + "version": "0.13.9", 2030 + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", 2031 + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", 2032 + "dev": true 2033 + }, 2034 + "node_modules/@babel/template": { 2035 + "version": "7.16.7", 2036 + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", 2037 + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", 2038 + "dev": true, 2039 + "dependencies": { 2040 + "@babel/code-frame": "^7.16.7", 2041 + "@babel/parser": "^7.16.7", 2042 + "@babel/types": "^7.16.7" 2043 + }, 2044 + "engines": { 2045 + "node": ">=6.9.0" 2046 + } 2047 + }, 2048 + "node_modules/@babel/traverse": { 2049 + "version": "7.16.10", 2050 + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", 2051 + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", 2052 + "dev": true, 2053 + "dependencies": { 2054 + "@babel/code-frame": "^7.16.7", 2055 + "@babel/generator": "^7.16.8", 2056 + "@babel/helper-environment-visitor": "^7.16.7", 2057 + "@babel/helper-function-name": "^7.16.7", 2058 + "@babel/helper-hoist-variables": "^7.16.7", 2059 + "@babel/helper-split-export-declaration": "^7.16.7", 2060 + "@babel/parser": "^7.16.10", 2061 + "@babel/types": "^7.16.8", 2062 + "debug": "^4.1.0", 2063 + "globals": "^11.1.0" 2064 + }, 2065 + "engines": { 2066 + "node": ">=6.9.0" 2067 + } 2068 + }, 2069 + "node_modules/@babel/traverse/node_modules/debug": { 2070 + "version": "4.3.3", 2071 + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", 2072 + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", 2073 + "dev": true, 2074 + "dependencies": { 2075 + "ms": "2.1.2" 2076 + }, 2077 + "engines": { 2078 + "node": ">=6.0" 2079 + }, 2080 + "peerDependenciesMeta": { 2081 + "supports-color": { 2082 + "optional": true 2083 + } 2084 + } 2085 + }, 2086 + "node_modules/@babel/traverse/node_modules/globals": { 2087 + "version": "11.12.0", 2088 + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", 2089 + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", 2090 + "dev": true, 2091 + "engines": { 2092 + "node": ">=4" 2093 + } 2094 + }, 2095 + "node_modules/@babel/traverse/node_modules/ms": { 2096 + "version": "2.1.2", 2097 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 2098 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 2099 + "dev": true 2100 + }, 2101 + "node_modules/@babel/types": { 2102 + "version": "7.16.8", 2103 + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", 2104 + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", 2105 + "dev": true, 2106 + "dependencies": { 2107 + "@babel/helper-validator-identifier": "^7.16.7", 2108 + "to-fast-properties": "^2.0.0" 2109 + }, 2110 + "engines": { 2111 + "node": ">=6.9.0" 2112 + } 2113 + }, 2114 + "node_modules/@babel/types/node_modules/to-fast-properties": { 2115 + "version": "2.0.0", 2116 + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", 2117 + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", 2118 + "dev": true, 2119 + "engines": { 2120 + "node": ">=4" 20 2121 } 21 2122 }, 22 2123 "node_modules/@codemirror/autocomplete": { ··· 336 2437 "@lezer/common": "^0.15.0" 337 2438 } 338 2439 }, 2440 + "node_modules/@nicolo-ribaudo/chokidar-2": { 2441 + "version": "2.1.8-no-fsevents.3", 2442 + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", 2443 + "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", 2444 + "dev": true, 2445 + "optional": true 2446 + }, 2447 + "node_modules/babel-plugin-dynamic-import-node": { 2448 + "version": "2.3.3", 2449 + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", 2450 + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", 2451 + "dev": true, 2452 + "dependencies": { 2453 + "object.assign": "^4.1.0" 2454 + } 2455 + }, 2456 + "node_modules/babel-plugin-polyfill-corejs2": { 2457 + "version": "0.3.1", 2458 + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz", 2459 + "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==", 2460 + "dev": true, 2461 + "dependencies": { 2462 + "@babel/compat-data": "^7.13.11", 2463 + "@babel/helper-define-polyfill-provider": "^0.3.1", 2464 + "semver": "^6.1.1" 2465 + }, 2466 + "peerDependencies": { 2467 + "@babel/core": "^7.0.0-0" 2468 + } 2469 + }, 2470 + "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { 2471 + "version": "6.3.0", 2472 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 2473 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 2474 + "dev": true, 2475 + "bin": { 2476 + "semver": "bin/semver.js" 2477 + } 2478 + }, 2479 + "node_modules/babel-plugin-polyfill-corejs3": { 2480 + "version": "0.5.2", 2481 + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz", 2482 + "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==", 2483 + "dev": true, 2484 + "dependencies": { 2485 + "@babel/helper-define-polyfill-provider": "^0.3.1", 2486 + "core-js-compat": "^3.21.0" 2487 + }, 2488 + "peerDependencies": { 2489 + "@babel/core": "^7.0.0-0" 2490 + } 2491 + }, 2492 + "node_modules/babel-plugin-polyfill-regenerator": { 2493 + "version": "0.3.1", 2494 + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz", 2495 + "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==", 2496 + "dev": true, 2497 + "dependencies": { 2498 + "@babel/helper-define-polyfill-provider": "^0.3.1" 2499 + }, 2500 + "peerDependencies": { 2501 + "@babel/core": "^7.0.0-0" 2502 + } 2503 + }, 2504 + "node_modules/balanced-match": { 2505 + "version": "1.0.2", 2506 + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 2507 + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 2508 + "dev": true 2509 + }, 2510 + "node_modules/brace-expansion": { 2511 + "version": "1.1.11", 2512 + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 2513 + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 2514 + "dev": true, 2515 + "dependencies": { 2516 + "balanced-match": "^1.0.0", 2517 + "concat-map": "0.0.1" 2518 + } 2519 + }, 2520 + "node_modules/call-bind": { 2521 + "version": "1.0.2", 2522 + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 2523 + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 2524 + "dev": true, 2525 + "dependencies": { 2526 + "function-bind": "^1.1.1", 2527 + "get-intrinsic": "^1.0.2" 2528 + }, 2529 + "funding": { 2530 + "url": "https://github.com/sponsors/ljharb" 2531 + } 2532 + }, 2533 + "node_modules/caniuse-lite": { 2534 + "version": "1.0.30001305", 2535 + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001305.tgz", 2536 + "integrity": "sha512-p7d9YQMji8haf0f+5rbcv9WlQ+N5jMPfRAnUmZRlNxsNeBO3Yr7RYG6M2uTY1h9tCVdlkJg6YNNc4kiAiBLdWA==", 2537 + "dev": true, 2538 + "funding": { 2539 + "type": "opencollective", 2540 + "url": "https://opencollective.com/browserslist" 2541 + } 2542 + }, 2543 + "node_modules/color-convert": { 2544 + "version": "1.9.3", 2545 + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 2546 + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 2547 + "dev": true, 2548 + "dependencies": { 2549 + "color-name": "1.1.3" 2550 + } 2551 + }, 2552 + "node_modules/color-name": { 2553 + "version": "1.1.3", 2554 + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 2555 + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 2556 + "dev": true 2557 + }, 2558 + "node_modules/concat-map": { 2559 + "version": "0.0.1", 2560 + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 2561 + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 2562 + "dev": true 2563 + }, 2564 + "node_modules/convert-source-map": { 2565 + "version": "1.8.0", 2566 + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", 2567 + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", 2568 + "dev": true, 2569 + "dependencies": { 2570 + "safe-buffer": "~5.1.1" 2571 + } 2572 + }, 2573 + "node_modules/core-js-compat": { 2574 + "version": "3.21.0", 2575 + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.21.0.tgz", 2576 + "integrity": "sha512-OSXseNPSK2OPJa6GdtkMz/XxeXx8/CJvfhQWTqd6neuUraujcL4jVsjkLQz1OWnax8xVQJnRPe0V2jqNWORA+A==", 2577 + "dev": true, 2578 + "dependencies": { 2579 + "browserslist": "^4.19.1", 2580 + "semver": "7.0.0" 2581 + }, 2582 + "funding": { 2583 + "type": "opencollective", 2584 + "url": "https://opencollective.com/core-js" 2585 + } 2586 + }, 2587 + "node_modules/core-js-compat/node_modules/browserslist": { 2588 + "version": "4.19.1", 2589 + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", 2590 + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", 2591 + "dev": true, 2592 + "dependencies": { 2593 + "caniuse-lite": "^1.0.30001286", 2594 + "electron-to-chromium": "^1.4.17", 2595 + "escalade": "^3.1.1", 2596 + "node-releases": "^2.0.1", 2597 + "picocolors": "^1.0.0" 2598 + }, 2599 + "bin": { 2600 + "browserslist": "cli.js" 2601 + }, 2602 + "engines": { 2603 + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" 2604 + }, 2605 + "funding": { 2606 + "type": "opencollective", 2607 + "url": "https://opencollective.com/browserslist" 2608 + } 2609 + }, 2610 + "node_modules/core-js-compat/node_modules/semver": { 2611 + "version": "7.0.0", 2612 + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", 2613 + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", 2614 + "dev": true, 2615 + "bin": { 2616 + "semver": "bin/semver.js" 2617 + } 2618 + }, 339 2619 "node_modules/crelt": { 340 2620 "version": "1.0.5", 341 2621 "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz", 342 2622 "integrity": "sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==" 343 2623 }, 2624 + "node_modules/define-properties": { 2625 + "version": "1.1.3", 2626 + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", 2627 + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", 2628 + "dev": true, 2629 + "dependencies": { 2630 + "object-keys": "^1.0.12" 2631 + }, 2632 + "engines": { 2633 + "node": ">= 0.4" 2634 + } 2635 + }, 2636 + "node_modules/electron-to-chromium": { 2637 + "version": "1.4.62", 2638 + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.62.tgz", 2639 + "integrity": "sha512-fWc/zAThqZzl7fbuLzar+x6bqZBWHrsBXQOqv//yrgdTLY/G3JGTPOWhPKIhbhynJJhqE9QNzKzlpCINUmUMoA==", 2640 + "dev": true 2641 + }, 2642 + "node_modules/escalade": { 2643 + "version": "3.1.1", 2644 + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", 2645 + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", 2646 + "dev": true, 2647 + "engines": { 2648 + "node": ">=6" 2649 + } 2650 + }, 2651 + "node_modules/escape-string-regexp": { 2652 + "version": "1.0.5", 2653 + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 2654 + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 2655 + "dev": true, 2656 + "engines": { 2657 + "node": ">=0.8.0" 2658 + } 2659 + }, 2660 + "node_modules/esutils": { 2661 + "version": "2.0.3", 2662 + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 2663 + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 2664 + "dev": true, 2665 + "engines": { 2666 + "node": ">=0.10.0" 2667 + } 2668 + }, 2669 + "node_modules/fs-readdir-recursive": { 2670 + "version": "1.1.0", 2671 + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", 2672 + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", 2673 + "dev": true 2674 + }, 2675 + "node_modules/fs.realpath": { 2676 + "version": "1.0.0", 2677 + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 2678 + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 2679 + "dev": true 2680 + }, 2681 + "node_modules/function-bind": { 2682 + "version": "1.1.1", 2683 + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 2684 + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", 2685 + "dev": true 2686 + }, 2687 + "node_modules/gensync": { 2688 + "version": "1.0.0-beta.2", 2689 + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", 2690 + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", 2691 + "dev": true, 2692 + "engines": { 2693 + "node": ">=6.9.0" 2694 + } 2695 + }, 2696 + "node_modules/get-intrinsic": { 2697 + "version": "1.1.1", 2698 + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", 2699 + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", 2700 + "dev": true, 2701 + "dependencies": { 2702 + "function-bind": "^1.1.1", 2703 + "has": "^1.0.3", 2704 + "has-symbols": "^1.0.1" 2705 + }, 2706 + "funding": { 2707 + "url": "https://github.com/sponsors/ljharb" 2708 + } 2709 + }, 2710 + "node_modules/glob": { 2711 + "version": "7.2.0", 2712 + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", 2713 + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", 2714 + "dev": true, 2715 + "dependencies": { 2716 + "fs.realpath": "^1.0.0", 2717 + "inflight": "^1.0.4", 2718 + "inherits": "2", 2719 + "minimatch": "^3.0.4", 2720 + "once": "^1.3.0", 2721 + "path-is-absolute": "^1.0.0" 2722 + }, 2723 + "engines": { 2724 + "node": "*" 2725 + }, 2726 + "funding": { 2727 + "url": "https://github.com/sponsors/isaacs" 2728 + } 2729 + }, 2730 + "node_modules/has": { 2731 + "version": "1.0.3", 2732 + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 2733 + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 2734 + "dev": true, 2735 + "dependencies": { 2736 + "function-bind": "^1.1.1" 2737 + }, 2738 + "engines": { 2739 + "node": ">= 0.4.0" 2740 + } 2741 + }, 2742 + "node_modules/has-flag": { 2743 + "version": "3.0.0", 2744 + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 2745 + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 2746 + "dev": true, 2747 + "engines": { 2748 + "node": ">=4" 2749 + } 2750 + }, 2751 + "node_modules/has-symbols": { 2752 + "version": "1.0.2", 2753 + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", 2754 + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", 2755 + "dev": true, 2756 + "engines": { 2757 + "node": ">= 0.4" 2758 + }, 2759 + "funding": { 2760 + "url": "https://github.com/sponsors/ljharb" 2761 + } 2762 + }, 2763 + "node_modules/inflight": { 2764 + "version": "1.0.6", 2765 + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 2766 + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 2767 + "dev": true, 2768 + "dependencies": { 2769 + "once": "^1.3.0", 2770 + "wrappy": "1" 2771 + } 2772 + }, 2773 + "node_modules/inherits": { 2774 + "version": "2.0.4", 2775 + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 2776 + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 2777 + "dev": true 2778 + }, 2779 + "node_modules/is-core-module": { 2780 + "version": "2.8.1", 2781 + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", 2782 + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", 2783 + "dev": true, 2784 + "dependencies": { 2785 + "has": "^1.0.3" 2786 + }, 2787 + "funding": { 2788 + "url": "https://github.com/sponsors/ljharb" 2789 + } 2790 + }, 2791 + "node_modules/jsesc": { 2792 + "version": "0.5.0", 2793 + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", 2794 + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", 2795 + "dev": true, 2796 + "bin": { 2797 + "jsesc": "bin/jsesc" 2798 + } 2799 + }, 2800 + "node_modules/lodash.debounce": { 2801 + "version": "4.0.8", 2802 + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", 2803 + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", 2804 + "dev": true 2805 + }, 2806 + "node_modules/make-dir": { 2807 + "version": "2.1.0", 2808 + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", 2809 + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", 2810 + "dev": true, 2811 + "dependencies": { 2812 + "pify": "^4.0.1", 2813 + "semver": "^5.6.0" 2814 + }, 2815 + "engines": { 2816 + "node": ">=6" 2817 + } 2818 + }, 2819 + "node_modules/minimatch": { 2820 + "version": "3.0.4", 2821 + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 2822 + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 2823 + "dev": true, 2824 + "dependencies": { 2825 + "brace-expansion": "^1.1.7" 2826 + }, 2827 + "engines": { 2828 + "node": "*" 2829 + } 2830 + }, 2831 + "node_modules/minimist": { 2832 + "version": "1.2.5", 2833 + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 2834 + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", 2835 + "dev": true 2836 + }, 2837 + "node_modules/node-releases": { 2838 + "version": "2.0.1", 2839 + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", 2840 + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", 2841 + "dev": true 2842 + }, 2843 + "node_modules/object-keys": { 2844 + "version": "1.1.1", 2845 + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", 2846 + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", 2847 + "dev": true, 2848 + "engines": { 2849 + "node": ">= 0.4" 2850 + } 2851 + }, 2852 + "node_modules/object.assign": { 2853 + "version": "4.1.2", 2854 + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", 2855 + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", 2856 + "dev": true, 2857 + "dependencies": { 2858 + "call-bind": "^1.0.0", 2859 + "define-properties": "^1.1.3", 2860 + "has-symbols": "^1.0.1", 2861 + "object-keys": "^1.1.1" 2862 + }, 2863 + "engines": { 2864 + "node": ">= 0.4" 2865 + }, 2866 + "funding": { 2867 + "url": "https://github.com/sponsors/ljharb" 2868 + } 2869 + }, 2870 + "node_modules/once": { 2871 + "version": "1.4.0", 2872 + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 2873 + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 2874 + "dev": true, 2875 + "dependencies": { 2876 + "wrappy": "1" 2877 + } 2878 + }, 2879 + "node_modules/path-is-absolute": { 2880 + "version": "1.0.1", 2881 + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 2882 + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 2883 + "dev": true, 2884 + "engines": { 2885 + "node": ">=0.10.0" 2886 + } 2887 + }, 2888 + "node_modules/path-parse": { 2889 + "version": "1.0.7", 2890 + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 2891 + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", 2892 + "dev": true 2893 + }, 2894 + "node_modules/picocolors": { 2895 + "version": "1.0.0", 2896 + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", 2897 + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", 2898 + "dev": true 2899 + }, 2900 + "node_modules/picomatch": { 2901 + "version": "2.3.1", 2902 + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 2903 + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 2904 + "dev": true, 2905 + "optional": true, 2906 + "engines": { 2907 + "node": ">=8.6" 2908 + }, 2909 + "funding": { 2910 + "url": "https://github.com/sponsors/jonschlinkert" 2911 + } 2912 + }, 2913 + "node_modules/pify": { 2914 + "version": "4.0.1", 2915 + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", 2916 + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", 2917 + "dev": true, 2918 + "engines": { 2919 + "node": ">=6" 2920 + } 2921 + }, 2922 + "node_modules/regenerate": { 2923 + "version": "1.4.2", 2924 + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", 2925 + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", 2926 + "dev": true 2927 + }, 2928 + "node_modules/regenerate-unicode-properties": { 2929 + "version": "9.0.0", 2930 + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", 2931 + "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", 2932 + "dev": true, 2933 + "dependencies": { 2934 + "regenerate": "^1.4.2" 2935 + }, 2936 + "engines": { 2937 + "node": ">=4" 2938 + } 2939 + }, 2940 + "node_modules/resolve": { 2941 + "version": "1.22.0", 2942 + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", 2943 + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", 2944 + "dev": true, 2945 + "dependencies": { 2946 + "is-core-module": "^2.8.1", 2947 + "path-parse": "^1.0.7", 2948 + "supports-preserve-symlinks-flag": "^1.0.0" 2949 + }, 2950 + "bin": { 2951 + "resolve": "bin/resolve" 2952 + }, 2953 + "funding": { 2954 + "url": "https://github.com/sponsors/ljharb" 2955 + } 2956 + }, 2957 + "node_modules/safe-buffer": { 2958 + "version": "5.1.2", 2959 + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 2960 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 2961 + "dev": true 2962 + }, 2963 + "node_modules/semver": { 2964 + "version": "5.7.1", 2965 + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 2966 + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 2967 + "dev": true, 2968 + "bin": { 2969 + "semver": "bin/semver" 2970 + } 2971 + }, 2972 + "node_modules/source-map": { 2973 + "version": "0.5.7", 2974 + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", 2975 + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", 2976 + "dev": true, 2977 + "engines": { 2978 + "node": ">=0.10.0" 2979 + } 2980 + }, 344 2981 "node_modules/style-mod": { 345 2982 "version": "4.0.0", 346 2983 "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.0.tgz", 347 2984 "integrity": "sha512-OPhtyEjyyN9x3nhPsu76f52yUGXiZcgvsrFVtvTkyGRQJ0XK+GPc6ov1z+lRpbeabka+MYEQxOYRnt5nF30aMw==" 348 2985 }, 2986 + "node_modules/supports-preserve-symlinks-flag": { 2987 + "version": "1.0.0", 2988 + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", 2989 + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", 2990 + "dev": true, 2991 + "engines": { 2992 + "node": ">= 0.4" 2993 + }, 2994 + "funding": { 2995 + "url": "https://github.com/sponsors/ljharb" 2996 + } 2997 + }, 2998 + "node_modules/unicode-canonical-property-names-ecmascript": { 2999 + "version": "2.0.0", 3000 + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", 3001 + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", 3002 + "dev": true, 3003 + "engines": { 3004 + "node": ">=4" 3005 + } 3006 + }, 3007 + "node_modules/unicode-match-property-ecmascript": { 3008 + "version": "2.0.0", 3009 + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", 3010 + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", 3011 + "dev": true, 3012 + "dependencies": { 3013 + "unicode-canonical-property-names-ecmascript": "^2.0.0", 3014 + "unicode-property-aliases-ecmascript": "^2.0.0" 3015 + }, 3016 + "engines": { 3017 + "node": ">=4" 3018 + } 3019 + }, 3020 + "node_modules/unicode-match-property-value-ecmascript": { 3021 + "version": "2.0.0", 3022 + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", 3023 + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", 3024 + "dev": true, 3025 + "engines": { 3026 + "node": ">=4" 3027 + } 3028 + }, 3029 + "node_modules/unicode-property-aliases-ecmascript": { 3030 + "version": "2.0.0", 3031 + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", 3032 + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", 3033 + "dev": true, 3034 + "engines": { 3035 + "node": ">=4" 3036 + } 3037 + }, 349 3038 "node_modules/w3c-keyname": { 350 3039 "version": "2.2.4", 351 3040 "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.4.tgz", 352 3041 "integrity": "sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw==" 3042 + }, 3043 + "node_modules/wrappy": { 3044 + "version": "1.0.2", 3045 + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 3046 + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 3047 + "dev": true 353 3048 } 354 3049 }, 355 3050 "dependencies": { 3051 + "@babel/cli": { 3052 + "version": "7.16.8", 3053 + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.16.8.tgz", 3054 + "integrity": "sha512-FTKBbxyk5TclXOGmwYyqelqP5IF6hMxaeJskd85jbR5jBfYlwqgwAbJwnixi1ZBbTqKfFuAA95mdmUFeSRwyJA==", 3055 + "dev": true, 3056 + "requires": { 3057 + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents.3", 3058 + "chokidar": "^3.4.0", 3059 + "commander": "^4.0.1", 3060 + "convert-source-map": "^1.1.0", 3061 + "fs-readdir-recursive": "^1.1.0", 3062 + "glob": "^7.0.0", 3063 + "make-dir": "^2.1.0", 3064 + "slash": "^2.0.0", 3065 + "source-map": "^0.5.0" 3066 + }, 3067 + "dependencies": { 3068 + "anymatch": { 3069 + "version": "3.1.2", 3070 + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", 3071 + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", 3072 + "dev": true, 3073 + "optional": true, 3074 + "requires": { 3075 + "normalize-path": "^3.0.0", 3076 + "picomatch": "^2.0.4" 3077 + } 3078 + }, 3079 + "binary-extensions": { 3080 + "version": "2.2.0", 3081 + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", 3082 + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", 3083 + "dev": true, 3084 + "optional": true 3085 + }, 3086 + "braces": { 3087 + "version": "3.0.2", 3088 + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", 3089 + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", 3090 + "dev": true, 3091 + "optional": true, 3092 + "requires": { 3093 + "fill-range": "^7.0.1" 3094 + } 3095 + }, 3096 + "chokidar": { 3097 + "version": "3.5.3", 3098 + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", 3099 + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", 3100 + "dev": true, 3101 + "optional": true, 3102 + "requires": { 3103 + "anymatch": "~3.1.2", 3104 + "braces": "~3.0.2", 3105 + "fsevents": "~2.3.2", 3106 + "glob-parent": "~5.1.2", 3107 + "is-binary-path": "~2.1.0", 3108 + "is-glob": "~4.0.1", 3109 + "normalize-path": "~3.0.0", 3110 + "readdirp": "~3.6.0" 3111 + } 3112 + }, 3113 + "commander": { 3114 + "version": "4.1.1", 3115 + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", 3116 + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", 3117 + "dev": true 3118 + }, 3119 + "fill-range": { 3120 + "version": "7.0.1", 3121 + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", 3122 + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", 3123 + "dev": true, 3124 + "optional": true, 3125 + "requires": { 3126 + "to-regex-range": "^5.0.1" 3127 + } 3128 + }, 3129 + "fsevents": { 3130 + "version": "2.3.2", 3131 + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", 3132 + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", 3133 + "dev": true, 3134 + "optional": true 3135 + }, 3136 + "glob-parent": { 3137 + "version": "5.1.2", 3138 + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", 3139 + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", 3140 + "dev": true, 3141 + "optional": true, 3142 + "requires": { 3143 + "is-glob": "^4.0.1" 3144 + } 3145 + }, 3146 + "is-binary-path": { 3147 + "version": "2.1.0", 3148 + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", 3149 + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", 3150 + "dev": true, 3151 + "optional": true, 3152 + "requires": { 3153 + "binary-extensions": "^2.0.0" 3154 + } 3155 + }, 3156 + "is-extglob": { 3157 + "version": "2.1.1", 3158 + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 3159 + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", 3160 + "dev": true, 3161 + "optional": true 3162 + }, 3163 + "is-glob": { 3164 + "version": "4.0.3", 3165 + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", 3166 + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", 3167 + "dev": true, 3168 + "optional": true, 3169 + "requires": { 3170 + "is-extglob": "^2.1.1" 3171 + } 3172 + }, 3173 + "is-number": { 3174 + "version": "7.0.0", 3175 + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", 3176 + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", 3177 + "dev": true, 3178 + "optional": true 3179 + }, 3180 + "normalize-path": { 3181 + "version": "3.0.0", 3182 + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", 3183 + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", 3184 + "dev": true, 3185 + "optional": true 3186 + }, 3187 + "readdirp": { 3188 + "version": "3.6.0", 3189 + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", 3190 + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", 3191 + "dev": true, 3192 + "optional": true, 3193 + "requires": { 3194 + "picomatch": "^2.2.1" 3195 + } 3196 + }, 3197 + "slash": { 3198 + "version": "2.0.0", 3199 + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", 3200 + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", 3201 + "dev": true 3202 + }, 3203 + "to-regex-range": { 3204 + "version": "5.0.1", 3205 + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", 3206 + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", 3207 + "dev": true, 3208 + "optional": true, 3209 + "requires": { 3210 + "is-number": "^7.0.0" 3211 + } 3212 + } 3213 + } 3214 + }, 3215 + "@babel/code-frame": { 3216 + "version": "7.16.7", 3217 + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.7.tgz", 3218 + "integrity": "sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg==", 3219 + "dev": true, 3220 + "requires": { 3221 + "@babel/highlight": "^7.16.7" 3222 + } 3223 + }, 3224 + "@babel/compat-data": { 3225 + "version": "7.16.8", 3226 + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.16.8.tgz", 3227 + "integrity": "sha512-m7OkX0IdKLKPpBlJtF561YJal5y/jyI5fNfWbPxh2D/nbzzGI4qRyrD8xO2jB24u7l+5I2a43scCG2IrfjC50Q==", 3228 + "dev": true 3229 + }, 3230 + "@babel/core": { 3231 + "version": "7.16.12", 3232 + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.16.12.tgz", 3233 + "integrity": "sha512-dK5PtG1uiN2ikk++5OzSYsitZKny4wOCD0nrO4TqnW4BVBTQ2NGS3NgilvT/TEyxTST7LNyWV/T4tXDoD3fOgg==", 3234 + "dev": true, 3235 + "requires": { 3236 + "@babel/code-frame": "^7.16.7", 3237 + "@babel/generator": "^7.16.8", 3238 + "@babel/helper-compilation-targets": "^7.16.7", 3239 + "@babel/helper-module-transforms": "^7.16.7", 3240 + "@babel/helpers": "^7.16.7", 3241 + "@babel/parser": "^7.16.12", 3242 + "@babel/template": "^7.16.7", 3243 + "@babel/traverse": "^7.16.10", 3244 + "@babel/types": "^7.16.8", 3245 + "convert-source-map": "^1.7.0", 3246 + "debug": "^4.1.0", 3247 + "gensync": "^1.0.0-beta.2", 3248 + "json5": "^2.1.2", 3249 + "semver": "^6.3.0", 3250 + "source-map": "^0.5.0" 3251 + }, 3252 + "dependencies": { 3253 + "debug": { 3254 + "version": "4.3.3", 3255 + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", 3256 + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", 3257 + "dev": true, 3258 + "requires": { 3259 + "ms": "2.1.2" 3260 + } 3261 + }, 3262 + "json5": { 3263 + "version": "2.2.0", 3264 + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", 3265 + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", 3266 + "dev": true, 3267 + "requires": { 3268 + "minimist": "^1.2.5" 3269 + } 3270 + }, 3271 + "ms": { 3272 + "version": "2.1.2", 3273 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 3274 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 3275 + "dev": true 3276 + }, 3277 + "semver": { 3278 + "version": "6.3.0", 3279 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 3280 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 3281 + "dev": true 3282 + } 3283 + } 3284 + }, 3285 + "@babel/generator": { 3286 + "version": "7.16.8", 3287 + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.16.8.tgz", 3288 + "integrity": "sha512-1ojZwE9+lOXzcWdWmO6TbUzDfqLD39CmEhN8+2cX9XkDo5yW1OpgfejfliysR2AWLpMamTiOiAp/mtroaymhpw==", 3289 + "dev": true, 3290 + "requires": { 3291 + "@babel/types": "^7.16.8", 3292 + "jsesc": "^2.5.1", 3293 + "source-map": "^0.5.0" 3294 + }, 3295 + "dependencies": { 3296 + "jsesc": { 3297 + "version": "2.5.2", 3298 + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", 3299 + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", 3300 + "dev": true 3301 + } 3302 + } 3303 + }, 3304 + "@babel/helper-annotate-as-pure": { 3305 + "version": "7.16.7", 3306 + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz", 3307 + "integrity": "sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw==", 3308 + "dev": true, 3309 + "requires": { 3310 + "@babel/types": "^7.16.7" 3311 + } 3312 + }, 3313 + "@babel/helper-builder-binary-assignment-operator-visitor": { 3314 + "version": "7.16.7", 3315 + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz", 3316 + "integrity": "sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA==", 3317 + "dev": true, 3318 + "requires": { 3319 + "@babel/helper-explode-assignable-expression": "^7.16.7", 3320 + "@babel/types": "^7.16.7" 3321 + } 3322 + }, 3323 + "@babel/helper-compilation-targets": { 3324 + "version": "7.16.7", 3325 + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz", 3326 + "integrity": "sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA==", 3327 + "dev": true, 3328 + "requires": { 3329 + "@babel/compat-data": "^7.16.4", 3330 + "@babel/helper-validator-option": "^7.16.7", 3331 + "browserslist": "^4.17.5", 3332 + "semver": "^6.3.0" 3333 + }, 3334 + "dependencies": { 3335 + "browserslist": { 3336 + "version": "4.19.1", 3337 + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", 3338 + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", 3339 + "dev": true, 3340 + "requires": { 3341 + "caniuse-lite": "^1.0.30001286", 3342 + "electron-to-chromium": "^1.4.17", 3343 + "escalade": "^3.1.1", 3344 + "node-releases": "^2.0.1", 3345 + "picocolors": "^1.0.0" 3346 + } 3347 + }, 3348 + "semver": { 3349 + "version": "6.3.0", 3350 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 3351 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 3352 + "dev": true 3353 + } 3354 + } 3355 + }, 3356 + "@babel/helper-create-class-features-plugin": { 3357 + "version": "7.16.10", 3358 + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.10.tgz", 3359 + "integrity": "sha512-wDeej0pu3WN/ffTxMNCPW5UCiOav8IcLRxSIyp/9+IF2xJUM9h/OYjg0IJLHaL6F8oU8kqMz9nc1vryXhMsgXg==", 3360 + "dev": true, 3361 + "requires": { 3362 + "@babel/helper-annotate-as-pure": "^7.16.7", 3363 + "@babel/helper-environment-visitor": "^7.16.7", 3364 + "@babel/helper-function-name": "^7.16.7", 3365 + "@babel/helper-member-expression-to-functions": "^7.16.7", 3366 + "@babel/helper-optimise-call-expression": "^7.16.7", 3367 + "@babel/helper-replace-supers": "^7.16.7", 3368 + "@babel/helper-split-export-declaration": "^7.16.7" 3369 + } 3370 + }, 3371 + "@babel/helper-create-regexp-features-plugin": { 3372 + "version": "7.16.7", 3373 + "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.7.tgz", 3374 + "integrity": "sha512-fk5A6ymfp+O5+p2yCkXAu5Kyj6v0xh0RBeNcAkYUMDvvAAoxvSKXn+Jb37t/yWFiQVDFK1ELpUTD8/aLhCPu+g==", 3375 + "dev": true, 3376 + "requires": { 3377 + "@babel/helper-annotate-as-pure": "^7.16.7", 3378 + "regexpu-core": "^4.7.1" 3379 + }, 3380 + "dependencies": { 3381 + "regexpu-core": { 3382 + "version": "4.8.0", 3383 + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", 3384 + "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", 3385 + "dev": true, 3386 + "requires": { 3387 + "regenerate": "^1.4.2", 3388 + "regenerate-unicode-properties": "^9.0.0", 3389 + "regjsgen": "^0.5.2", 3390 + "regjsparser": "^0.7.0", 3391 + "unicode-match-property-ecmascript": "^2.0.0", 3392 + "unicode-match-property-value-ecmascript": "^2.0.0" 3393 + } 3394 + }, 3395 + "regjsgen": { 3396 + "version": "0.5.2", 3397 + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", 3398 + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", 3399 + "dev": true 3400 + }, 3401 + "regjsparser": { 3402 + "version": "0.7.0", 3403 + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", 3404 + "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", 3405 + "dev": true, 3406 + "requires": { 3407 + "jsesc": "~0.5.0" 3408 + } 3409 + } 3410 + } 3411 + }, 3412 + "@babel/helper-define-map": { 3413 + "version": "7.16.7", 3414 + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.16.7.tgz", 3415 + "integrity": "sha512-SoIOh18NdeBBQjiLF1H32jpDLkApTbUWwEXmqaxn1KEm7aqry4reaghMdCdkbdloVmMwUxM/uCcTmHWj9zJbxQ==", 3416 + "dev": true, 3417 + "requires": { 3418 + "@babel/helper-function-name": "^7.16.7", 3419 + "@babel/types": "^7.16.7" 3420 + } 3421 + }, 3422 + "@babel/helper-define-polyfill-provider": { 3423 + "version": "0.3.1", 3424 + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz", 3425 + "integrity": "sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA==", 3426 + "dev": true, 3427 + "requires": { 3428 + "@babel/helper-compilation-targets": "^7.13.0", 3429 + "@babel/helper-module-imports": "^7.12.13", 3430 + "@babel/helper-plugin-utils": "^7.13.0", 3431 + "@babel/traverse": "^7.13.0", 3432 + "debug": "^4.1.1", 3433 + "lodash.debounce": "^4.0.8", 3434 + "resolve": "^1.14.2", 3435 + "semver": "^6.1.2" 3436 + }, 3437 + "dependencies": { 3438 + "debug": { 3439 + "version": "4.3.3", 3440 + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", 3441 + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", 3442 + "dev": true, 3443 + "requires": { 3444 + "ms": "2.1.2" 3445 + } 3446 + }, 3447 + "ms": { 3448 + "version": "2.1.2", 3449 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 3450 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 3451 + "dev": true 3452 + }, 3453 + "semver": { 3454 + "version": "6.3.0", 3455 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 3456 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 3457 + "dev": true 3458 + } 3459 + } 3460 + }, 3461 + "@babel/helper-environment-visitor": { 3462 + "version": "7.16.7", 3463 + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz", 3464 + "integrity": "sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag==", 3465 + "dev": true, 3466 + "requires": { 3467 + "@babel/types": "^7.16.7" 3468 + } 3469 + }, 3470 + "@babel/helper-explode-assignable-expression": { 3471 + "version": "7.16.7", 3472 + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz", 3473 + "integrity": "sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ==", 3474 + "dev": true, 3475 + "requires": { 3476 + "@babel/types": "^7.16.7" 3477 + } 3478 + }, 3479 + "@babel/helper-function-name": { 3480 + "version": "7.16.7", 3481 + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz", 3482 + "integrity": "sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA==", 3483 + "dev": true, 3484 + "requires": { 3485 + "@babel/helper-get-function-arity": "^7.16.7", 3486 + "@babel/template": "^7.16.7", 3487 + "@babel/types": "^7.16.7" 3488 + } 3489 + }, 3490 + "@babel/helper-get-function-arity": { 3491 + "version": "7.16.7", 3492 + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz", 3493 + "integrity": "sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw==", 3494 + "dev": true, 3495 + "requires": { 3496 + "@babel/types": "^7.16.7" 3497 + } 3498 + }, 3499 + "@babel/helper-hoist-variables": { 3500 + "version": "7.16.7", 3501 + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz", 3502 + "integrity": "sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg==", 3503 + "dev": true, 3504 + "requires": { 3505 + "@babel/types": "^7.16.7" 3506 + } 3507 + }, 3508 + "@babel/helper-member-expression-to-functions": { 3509 + "version": "7.16.7", 3510 + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.7.tgz", 3511 + "integrity": "sha512-VtJ/65tYiU/6AbMTDwyoXGPKHgTsfRarivm+YbB5uAzKUyuPjgZSgAFeG87FCigc7KNHu2Pegh1XIT3lXjvz3Q==", 3512 + "dev": true, 3513 + "requires": { 3514 + "@babel/types": "^7.16.7" 3515 + } 3516 + }, 3517 + "@babel/helper-module-imports": { 3518 + "version": "7.16.7", 3519 + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz", 3520 + "integrity": "sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg==", 3521 + "dev": true, 3522 + "requires": { 3523 + "@babel/types": "^7.16.7" 3524 + } 3525 + }, 3526 + "@babel/helper-module-transforms": { 3527 + "version": "7.16.7", 3528 + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz", 3529 + "integrity": "sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng==", 3530 + "dev": true, 3531 + "requires": { 3532 + "@babel/helper-environment-visitor": "^7.16.7", 3533 + "@babel/helper-module-imports": "^7.16.7", 3534 + "@babel/helper-simple-access": "^7.16.7", 3535 + "@babel/helper-split-export-declaration": "^7.16.7", 3536 + "@babel/helper-validator-identifier": "^7.16.7", 3537 + "@babel/template": "^7.16.7", 3538 + "@babel/traverse": "^7.16.7", 3539 + "@babel/types": "^7.16.7" 3540 + } 3541 + }, 3542 + "@babel/helper-optimise-call-expression": { 3543 + "version": "7.16.7", 3544 + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz", 3545 + "integrity": "sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w==", 3546 + "dev": true, 3547 + "requires": { 3548 + "@babel/types": "^7.16.7" 3549 + } 3550 + }, 3551 + "@babel/helper-plugin-utils": { 3552 + "version": "7.16.7", 3553 + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz", 3554 + "integrity": "sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA==", 3555 + "dev": true 3556 + }, 3557 + "@babel/helper-remap-async-to-generator": { 3558 + "version": "7.16.8", 3559 + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz", 3560 + "integrity": "sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw==", 3561 + "dev": true, 3562 + "requires": { 3563 + "@babel/helper-annotate-as-pure": "^7.16.7", 3564 + "@babel/helper-wrap-function": "^7.16.8", 3565 + "@babel/types": "^7.16.8" 3566 + } 3567 + }, 3568 + "@babel/helper-replace-supers": { 3569 + "version": "7.16.7", 3570 + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz", 3571 + "integrity": "sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw==", 3572 + "dev": true, 3573 + "requires": { 3574 + "@babel/helper-environment-visitor": "^7.16.7", 3575 + "@babel/helper-member-expression-to-functions": "^7.16.7", 3576 + "@babel/helper-optimise-call-expression": "^7.16.7", 3577 + "@babel/traverse": "^7.16.7", 3578 + "@babel/types": "^7.16.7" 3579 + } 3580 + }, 3581 + "@babel/helper-simple-access": { 3582 + "version": "7.16.7", 3583 + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz", 3584 + "integrity": "sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g==", 3585 + "dev": true, 3586 + "requires": { 3587 + "@babel/types": "^7.16.7" 3588 + } 3589 + }, 3590 + "@babel/helper-skip-transparent-expression-wrappers": { 3591 + "version": "7.16.0", 3592 + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz", 3593 + "integrity": "sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw==", 3594 + "dev": true, 3595 + "requires": { 3596 + "@babel/types": "^7.16.0" 3597 + } 3598 + }, 3599 + "@babel/helper-split-export-declaration": { 3600 + "version": "7.16.7", 3601 + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz", 3602 + "integrity": "sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw==", 3603 + "dev": true, 3604 + "requires": { 3605 + "@babel/types": "^7.16.7" 3606 + } 3607 + }, 3608 + "@babel/helper-validator-identifier": { 3609 + "version": "7.16.7", 3610 + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz", 3611 + "integrity": "sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==", 3612 + "dev": true 3613 + }, 3614 + "@babel/helper-validator-option": { 3615 + "version": "7.16.7", 3616 + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz", 3617 + "integrity": "sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ==", 3618 + "dev": true 3619 + }, 3620 + "@babel/helper-wrap-function": { 3621 + "version": "7.16.8", 3622 + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz", 3623 + "integrity": "sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw==", 3624 + "dev": true, 3625 + "requires": { 3626 + "@babel/helper-function-name": "^7.16.7", 3627 + "@babel/template": "^7.16.7", 3628 + "@babel/traverse": "^7.16.8", 3629 + "@babel/types": "^7.16.8" 3630 + } 3631 + }, 3632 + "@babel/helpers": { 3633 + "version": "7.16.7", 3634 + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.16.7.tgz", 3635 + "integrity": "sha512-9ZDoqtfY7AuEOt3cxchfii6C7GDyyMBffktR5B2jvWv8u2+efwvpnVKXMWzNehqy68tKgAfSwfdw/lWpthS2bw==", 3636 + "dev": true, 3637 + "requires": { 3638 + "@babel/template": "^7.16.7", 3639 + "@babel/traverse": "^7.16.7", 3640 + "@babel/types": "^7.16.7" 3641 + } 3642 + }, 3643 + "@babel/highlight": { 3644 + "version": "7.16.10", 3645 + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.10.tgz", 3646 + "integrity": "sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw==", 3647 + "dev": true, 3648 + "requires": { 3649 + "@babel/helper-validator-identifier": "^7.16.7", 3650 + "chalk": "^2.0.0", 3651 + "js-tokens": "^4.0.0" 3652 + }, 3653 + "dependencies": { 3654 + "ansi-styles": { 3655 + "version": "3.2.1", 3656 + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 3657 + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 3658 + "dev": true, 3659 + "requires": { 3660 + "color-convert": "^1.9.0" 3661 + } 3662 + }, 3663 + "chalk": { 3664 + "version": "2.4.2", 3665 + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 3666 + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 3667 + "dev": true, 3668 + "requires": { 3669 + "ansi-styles": "^3.2.1", 3670 + "escape-string-regexp": "^1.0.5", 3671 + "supports-color": "^5.3.0" 3672 + } 3673 + }, 3674 + "js-tokens": { 3675 + "version": "4.0.0", 3676 + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 3677 + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 3678 + "dev": true 3679 + }, 3680 + "supports-color": { 3681 + "version": "5.5.0", 3682 + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 3683 + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 3684 + "dev": true, 3685 + "requires": { 3686 + "has-flag": "^3.0.0" 3687 + } 3688 + } 3689 + } 3690 + }, 3691 + "@babel/parser": { 3692 + "version": "7.16.12", 3693 + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.16.12.tgz", 3694 + "integrity": "sha512-VfaV15po8RiZssrkPweyvbGVSe4x2y+aciFCgn0n0/SJMR22cwofRV1mtnJQYcSB1wUTaA/X1LnA3es66MCO5A==", 3695 + "dev": true 3696 + }, 3697 + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { 3698 + "version": "7.16.7", 3699 + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz", 3700 + "integrity": "sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg==", 3701 + "dev": true, 3702 + "requires": { 3703 + "@babel/helper-plugin-utils": "^7.16.7" 3704 + } 3705 + }, 3706 + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { 3707 + "version": "7.16.7", 3708 + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz", 3709 + "integrity": "sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw==", 3710 + "dev": true, 3711 + "requires": { 3712 + "@babel/helper-plugin-utils": "^7.16.7", 3713 + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", 3714 + "@babel/plugin-proposal-optional-chaining": "^7.16.7" 3715 + } 3716 + }, 3717 + "@babel/plugin-proposal-async-generator-functions": { 3718 + "version": "7.16.8", 3719 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz", 3720 + "integrity": "sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ==", 3721 + "dev": true, 3722 + "requires": { 3723 + "@babel/helper-plugin-utils": "^7.16.7", 3724 + "@babel/helper-remap-async-to-generator": "^7.16.8", 3725 + "@babel/plugin-syntax-async-generators": "^7.8.4" 3726 + } 3727 + }, 3728 + "@babel/plugin-proposal-class-properties": { 3729 + "version": "7.16.7", 3730 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz", 3731 + "integrity": "sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww==", 3732 + "dev": true, 3733 + "requires": { 3734 + "@babel/helper-create-class-features-plugin": "^7.16.7", 3735 + "@babel/helper-plugin-utils": "^7.16.7" 3736 + } 3737 + }, 3738 + "@babel/plugin-proposal-class-static-block": { 3739 + "version": "7.16.7", 3740 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.7.tgz", 3741 + "integrity": "sha512-dgqJJrcZoG/4CkMopzhPJjGxsIe9A8RlkQLnL/Vhhx8AA9ZuaRwGSlscSh42hazc7WSrya/IK7mTeoF0DP9tEw==", 3742 + "dev": true, 3743 + "requires": { 3744 + "@babel/helper-create-class-features-plugin": "^7.16.7", 3745 + "@babel/helper-plugin-utils": "^7.16.7", 3746 + "@babel/plugin-syntax-class-static-block": "^7.14.5" 3747 + } 3748 + }, 3749 + "@babel/plugin-proposal-dynamic-import": { 3750 + "version": "7.16.7", 3751 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz", 3752 + "integrity": "sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg==", 3753 + "dev": true, 3754 + "requires": { 3755 + "@babel/helper-plugin-utils": "^7.16.7", 3756 + "@babel/plugin-syntax-dynamic-import": "^7.8.3" 3757 + } 3758 + }, 3759 + "@babel/plugin-proposal-export-namespace-from": { 3760 + "version": "7.16.7", 3761 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz", 3762 + "integrity": "sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA==", 3763 + "dev": true, 3764 + "requires": { 3765 + "@babel/helper-plugin-utils": "^7.16.7", 3766 + "@babel/plugin-syntax-export-namespace-from": "^7.8.3" 3767 + } 3768 + }, 3769 + "@babel/plugin-proposal-json-strings": { 3770 + "version": "7.16.7", 3771 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz", 3772 + "integrity": "sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ==", 3773 + "dev": true, 3774 + "requires": { 3775 + "@babel/helper-plugin-utils": "^7.16.7", 3776 + "@babel/plugin-syntax-json-strings": "^7.8.3" 3777 + } 3778 + }, 3779 + "@babel/plugin-proposal-logical-assignment-operators": { 3780 + "version": "7.16.7", 3781 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz", 3782 + "integrity": "sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg==", 3783 + "dev": true, 3784 + "requires": { 3785 + "@babel/helper-plugin-utils": "^7.16.7", 3786 + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4" 3787 + } 3788 + }, 3789 + "@babel/plugin-proposal-nullish-coalescing-operator": { 3790 + "version": "7.16.7", 3791 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz", 3792 + "integrity": "sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ==", 3793 + "dev": true, 3794 + "requires": { 3795 + "@babel/helper-plugin-utils": "^7.16.7", 3796 + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" 3797 + } 3798 + }, 3799 + "@babel/plugin-proposal-numeric-separator": { 3800 + "version": "7.16.7", 3801 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz", 3802 + "integrity": "sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw==", 3803 + "dev": true, 3804 + "requires": { 3805 + "@babel/helper-plugin-utils": "^7.16.7", 3806 + "@babel/plugin-syntax-numeric-separator": "^7.10.4" 3807 + } 3808 + }, 3809 + "@babel/plugin-proposal-object-rest-spread": { 3810 + "version": "7.16.7", 3811 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.7.tgz", 3812 + "integrity": "sha512-3O0Y4+dw94HA86qSg9IHfyPktgR7q3gpNVAeiKQd+8jBKFaU5NQS1Yatgo4wY+UFNuLjvxcSmzcsHqrhgTyBUA==", 3813 + "dev": true, 3814 + "requires": { 3815 + "@babel/compat-data": "^7.16.4", 3816 + "@babel/helper-compilation-targets": "^7.16.7", 3817 + "@babel/helper-plugin-utils": "^7.16.7", 3818 + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", 3819 + "@babel/plugin-transform-parameters": "^7.16.7" 3820 + } 3821 + }, 3822 + "@babel/plugin-proposal-optional-catch-binding": { 3823 + "version": "7.16.7", 3824 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz", 3825 + "integrity": "sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA==", 3826 + "dev": true, 3827 + "requires": { 3828 + "@babel/helper-plugin-utils": "^7.16.7", 3829 + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3" 3830 + } 3831 + }, 3832 + "@babel/plugin-proposal-optional-chaining": { 3833 + "version": "7.16.7", 3834 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz", 3835 + "integrity": "sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA==", 3836 + "dev": true, 3837 + "requires": { 3838 + "@babel/helper-plugin-utils": "^7.16.7", 3839 + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0", 3840 + "@babel/plugin-syntax-optional-chaining": "^7.8.3" 3841 + } 3842 + }, 3843 + "@babel/plugin-proposal-private-methods": { 3844 + "version": "7.16.11", 3845 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz", 3846 + "integrity": "sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw==", 3847 + "dev": true, 3848 + "requires": { 3849 + "@babel/helper-create-class-features-plugin": "^7.16.10", 3850 + "@babel/helper-plugin-utils": "^7.16.7" 3851 + } 3852 + }, 3853 + "@babel/plugin-proposal-private-property-in-object": { 3854 + "version": "7.16.7", 3855 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz", 3856 + "integrity": "sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ==", 3857 + "dev": true, 3858 + "requires": { 3859 + "@babel/helper-annotate-as-pure": "^7.16.7", 3860 + "@babel/helper-create-class-features-plugin": "^7.16.7", 3861 + "@babel/helper-plugin-utils": "^7.16.7", 3862 + "@babel/plugin-syntax-private-property-in-object": "^7.14.5" 3863 + } 3864 + }, 3865 + "@babel/plugin-proposal-unicode-property-regex": { 3866 + "version": "7.16.7", 3867 + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz", 3868 + "integrity": "sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg==", 3869 + "dev": true, 3870 + "requires": { 3871 + "@babel/helper-create-regexp-features-plugin": "^7.16.7", 3872 + "@babel/helper-plugin-utils": "^7.16.7" 3873 + } 3874 + }, 3875 + "@babel/plugin-syntax-async-generators": { 3876 + "version": "7.8.4", 3877 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", 3878 + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", 3879 + "dev": true, 3880 + "requires": { 3881 + "@babel/helper-plugin-utils": "^7.8.0" 3882 + } 3883 + }, 3884 + "@babel/plugin-syntax-class-properties": { 3885 + "version": "7.12.13", 3886 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", 3887 + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", 3888 + "dev": true, 3889 + "requires": { 3890 + "@babel/helper-plugin-utils": "^7.12.13" 3891 + } 3892 + }, 3893 + "@babel/plugin-syntax-class-static-block": { 3894 + "version": "7.14.5", 3895 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", 3896 + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", 3897 + "dev": true, 3898 + "requires": { 3899 + "@babel/helper-plugin-utils": "^7.14.5" 3900 + } 3901 + }, 3902 + "@babel/plugin-syntax-dynamic-import": { 3903 + "version": "7.8.3", 3904 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", 3905 + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", 3906 + "dev": true, 3907 + "requires": { 3908 + "@babel/helper-plugin-utils": "^7.8.0" 3909 + } 3910 + }, 3911 + "@babel/plugin-syntax-export-namespace-from": { 3912 + "version": "7.8.3", 3913 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", 3914 + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", 3915 + "dev": true, 3916 + "requires": { 3917 + "@babel/helper-plugin-utils": "^7.8.3" 3918 + } 3919 + }, 3920 + "@babel/plugin-syntax-json-strings": { 3921 + "version": "7.8.3", 3922 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", 3923 + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", 3924 + "dev": true, 3925 + "requires": { 3926 + "@babel/helper-plugin-utils": "^7.8.0" 3927 + } 3928 + }, 3929 + "@babel/plugin-syntax-logical-assignment-operators": { 3930 + "version": "7.10.4", 3931 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", 3932 + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", 3933 + "dev": true, 3934 + "requires": { 3935 + "@babel/helper-plugin-utils": "^7.10.4" 3936 + } 3937 + }, 3938 + "@babel/plugin-syntax-nullish-coalescing-operator": { 3939 + "version": "7.8.3", 3940 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", 3941 + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", 3942 + "dev": true, 3943 + "requires": { 3944 + "@babel/helper-plugin-utils": "^7.8.0" 3945 + } 3946 + }, 3947 + "@babel/plugin-syntax-numeric-separator": { 3948 + "version": "7.10.4", 3949 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", 3950 + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", 3951 + "dev": true, 3952 + "requires": { 3953 + "@babel/helper-plugin-utils": "^7.10.4" 3954 + } 3955 + }, 3956 + "@babel/plugin-syntax-object-rest-spread": { 3957 + "version": "7.8.3", 3958 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", 3959 + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", 3960 + "dev": true, 3961 + "requires": { 3962 + "@babel/helper-plugin-utils": "^7.8.0" 3963 + } 3964 + }, 3965 + "@babel/plugin-syntax-optional-catch-binding": { 3966 + "version": "7.8.3", 3967 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", 3968 + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", 3969 + "dev": true, 3970 + "requires": { 3971 + "@babel/helper-plugin-utils": "^7.8.0" 3972 + } 3973 + }, 3974 + "@babel/plugin-syntax-optional-chaining": { 3975 + "version": "7.8.3", 3976 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", 3977 + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", 3978 + "dev": true, 3979 + "requires": { 3980 + "@babel/helper-plugin-utils": "^7.8.0" 3981 + } 3982 + }, 3983 + "@babel/plugin-syntax-private-property-in-object": { 3984 + "version": "7.14.5", 3985 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", 3986 + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", 3987 + "dev": true, 3988 + "requires": { 3989 + "@babel/helper-plugin-utils": "^7.14.5" 3990 + } 3991 + }, 3992 + "@babel/plugin-syntax-top-level-await": { 3993 + "version": "7.14.5", 3994 + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", 3995 + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", 3996 + "dev": true, 3997 + "requires": { 3998 + "@babel/helper-plugin-utils": "^7.14.5" 3999 + } 4000 + }, 4001 + "@babel/plugin-transform-arrow-functions": { 4002 + "version": "7.16.7", 4003 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz", 4004 + "integrity": "sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ==", 4005 + "dev": true, 4006 + "requires": { 4007 + "@babel/helper-plugin-utils": "^7.16.7" 4008 + } 4009 + }, 4010 + "@babel/plugin-transform-async-to-generator": { 4011 + "version": "7.16.8", 4012 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz", 4013 + "integrity": "sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg==", 4014 + "dev": true, 4015 + "requires": { 4016 + "@babel/helper-module-imports": "^7.16.7", 4017 + "@babel/helper-plugin-utils": "^7.16.7", 4018 + "@babel/helper-remap-async-to-generator": "^7.16.8" 4019 + } 4020 + }, 4021 + "@babel/plugin-transform-block-scoped-functions": { 4022 + "version": "7.16.7", 4023 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz", 4024 + "integrity": "sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg==", 4025 + "dev": true, 4026 + "requires": { 4027 + "@babel/helper-plugin-utils": "^7.16.7" 4028 + } 4029 + }, 4030 + "@babel/plugin-transform-block-scoping": { 4031 + "version": "7.16.7", 4032 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz", 4033 + "integrity": "sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ==", 4034 + "dev": true, 4035 + "requires": { 4036 + "@babel/helper-plugin-utils": "^7.16.7" 4037 + } 4038 + }, 4039 + "@babel/plugin-transform-classes": { 4040 + "version": "7.16.7", 4041 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz", 4042 + "integrity": "sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ==", 4043 + "dev": true, 4044 + "requires": { 4045 + "@babel/helper-annotate-as-pure": "^7.16.7", 4046 + "@babel/helper-environment-visitor": "^7.16.7", 4047 + "@babel/helper-function-name": "^7.16.7", 4048 + "@babel/helper-optimise-call-expression": "^7.16.7", 4049 + "@babel/helper-plugin-utils": "^7.16.7", 4050 + "@babel/helper-replace-supers": "^7.16.7", 4051 + "@babel/helper-split-export-declaration": "^7.16.7", 4052 + "globals": "^11.1.0" 4053 + }, 4054 + "dependencies": { 4055 + "globals": { 4056 + "version": "11.12.0", 4057 + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", 4058 + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", 4059 + "dev": true 4060 + } 4061 + } 4062 + }, 4063 + "@babel/plugin-transform-computed-properties": { 4064 + "version": "7.16.7", 4065 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz", 4066 + "integrity": "sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw==", 4067 + "dev": true, 4068 + "requires": { 4069 + "@babel/helper-plugin-utils": "^7.16.7" 4070 + } 4071 + }, 4072 + "@babel/plugin-transform-destructuring": { 4073 + "version": "7.16.7", 4074 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.7.tgz", 4075 + "integrity": "sha512-VqAwhTHBnu5xBVDCvrvqJbtLUa++qZaWC0Fgr2mqokBlulZARGyIvZDoqbPlPaKImQ9dKAcCzbv+ul//uqu70A==", 4076 + "dev": true, 4077 + "requires": { 4078 + "@babel/helper-plugin-utils": "^7.16.7" 4079 + } 4080 + }, 4081 + "@babel/plugin-transform-dotall-regex": { 4082 + "version": "7.16.7", 4083 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz", 4084 + "integrity": "sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ==", 4085 + "dev": true, 4086 + "requires": { 4087 + "@babel/helper-create-regexp-features-plugin": "^7.16.7", 4088 + "@babel/helper-plugin-utils": "^7.16.7" 4089 + } 4090 + }, 4091 + "@babel/plugin-transform-duplicate-keys": { 4092 + "version": "7.16.7", 4093 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz", 4094 + "integrity": "sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw==", 4095 + "dev": true, 4096 + "requires": { 4097 + "@babel/helper-plugin-utils": "^7.16.7" 4098 + } 4099 + }, 4100 + "@babel/plugin-transform-exponentiation-operator": { 4101 + "version": "7.16.7", 4102 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz", 4103 + "integrity": "sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA==", 4104 + "dev": true, 4105 + "requires": { 4106 + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.16.7", 4107 + "@babel/helper-plugin-utils": "^7.16.7" 4108 + } 4109 + }, 4110 + "@babel/plugin-transform-for-of": { 4111 + "version": "7.16.7", 4112 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz", 4113 + "integrity": "sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg==", 4114 + "dev": true, 4115 + "requires": { 4116 + "@babel/helper-plugin-utils": "^7.16.7" 4117 + } 4118 + }, 4119 + "@babel/plugin-transform-function-name": { 4120 + "version": "7.16.7", 4121 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz", 4122 + "integrity": "sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA==", 4123 + "dev": true, 4124 + "requires": { 4125 + "@babel/helper-compilation-targets": "^7.16.7", 4126 + "@babel/helper-function-name": "^7.16.7", 4127 + "@babel/helper-plugin-utils": "^7.16.7" 4128 + } 4129 + }, 4130 + "@babel/plugin-transform-literals": { 4131 + "version": "7.16.7", 4132 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz", 4133 + "integrity": "sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ==", 4134 + "dev": true, 4135 + "requires": { 4136 + "@babel/helper-plugin-utils": "^7.16.7" 4137 + } 4138 + }, 4139 + "@babel/plugin-transform-member-expression-literals": { 4140 + "version": "7.16.7", 4141 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz", 4142 + "integrity": "sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw==", 4143 + "dev": true, 4144 + "requires": { 4145 + "@babel/helper-plugin-utils": "^7.16.7" 4146 + } 4147 + }, 4148 + "@babel/plugin-transform-modules-amd": { 4149 + "version": "7.16.7", 4150 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz", 4151 + "integrity": "sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g==", 4152 + "dev": true, 4153 + "requires": { 4154 + "@babel/helper-module-transforms": "^7.16.7", 4155 + "@babel/helper-plugin-utils": "^7.16.7", 4156 + "babel-plugin-dynamic-import-node": "^2.3.3" 4157 + } 4158 + }, 4159 + "@babel/plugin-transform-modules-commonjs": { 4160 + "version": "7.16.8", 4161 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.8.tgz", 4162 + "integrity": "sha512-oflKPvsLT2+uKQopesJt3ApiaIS2HW+hzHFcwRNtyDGieAeC/dIHZX8buJQ2J2X1rxGPy4eRcUijm3qcSPjYcA==", 4163 + "dev": true, 4164 + "requires": { 4165 + "@babel/helper-module-transforms": "^7.16.7", 4166 + "@babel/helper-plugin-utils": "^7.16.7", 4167 + "@babel/helper-simple-access": "^7.16.7", 4168 + "babel-plugin-dynamic-import-node": "^2.3.3" 4169 + } 4170 + }, 4171 + "@babel/plugin-transform-modules-systemjs": { 4172 + "version": "7.16.7", 4173 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.7.tgz", 4174 + "integrity": "sha512-DuK5E3k+QQmnOqBR9UkusByy5WZWGRxfzV529s9nPra1GE7olmxfqO2FHobEOYSPIjPBTr4p66YDcjQnt8cBmw==", 4175 + "dev": true, 4176 + "requires": { 4177 + "@babel/helper-hoist-variables": "^7.16.7", 4178 + "@babel/helper-module-transforms": "^7.16.7", 4179 + "@babel/helper-plugin-utils": "^7.16.7", 4180 + "@babel/helper-validator-identifier": "^7.16.7", 4181 + "babel-plugin-dynamic-import-node": "^2.3.3" 4182 + } 4183 + }, 4184 + "@babel/plugin-transform-modules-umd": { 4185 + "version": "7.16.7", 4186 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz", 4187 + "integrity": "sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ==", 4188 + "dev": true, 4189 + "requires": { 4190 + "@babel/helper-module-transforms": "^7.16.7", 4191 + "@babel/helper-plugin-utils": "^7.16.7" 4192 + } 4193 + }, 4194 + "@babel/plugin-transform-named-capturing-groups-regex": { 4195 + "version": "7.16.8", 4196 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz", 4197 + "integrity": "sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw==", 4198 + "dev": true, 4199 + "requires": { 4200 + "@babel/helper-create-regexp-features-plugin": "^7.16.7" 4201 + } 4202 + }, 4203 + "@babel/plugin-transform-new-target": { 4204 + "version": "7.16.7", 4205 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz", 4206 + "integrity": "sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg==", 4207 + "dev": true, 4208 + "requires": { 4209 + "@babel/helper-plugin-utils": "^7.16.7" 4210 + } 4211 + }, 4212 + "@babel/plugin-transform-object-super": { 4213 + "version": "7.16.7", 4214 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz", 4215 + "integrity": "sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw==", 4216 + "dev": true, 4217 + "requires": { 4218 + "@babel/helper-plugin-utils": "^7.16.7", 4219 + "@babel/helper-replace-supers": "^7.16.7" 4220 + } 4221 + }, 4222 + "@babel/plugin-transform-parameters": { 4223 + "version": "7.16.7", 4224 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz", 4225 + "integrity": "sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw==", 4226 + "dev": true, 4227 + "requires": { 4228 + "@babel/helper-plugin-utils": "^7.16.7" 4229 + } 4230 + }, 4231 + "@babel/plugin-transform-property-literals": { 4232 + "version": "7.16.7", 4233 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz", 4234 + "integrity": "sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw==", 4235 + "dev": true, 4236 + "requires": { 4237 + "@babel/helper-plugin-utils": "^7.16.7" 4238 + } 4239 + }, 4240 + "@babel/plugin-transform-property-mutators": { 4241 + "version": "7.16.7", 4242 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-mutators/-/plugin-transform-property-mutators-7.16.7.tgz", 4243 + "integrity": "sha512-xEYRrOxWyHrTXY6866IAtVGdioUYrQ38NxHMEFWC2VEaeJwtPfJzONmYrFAxO+9ajIi1HEPik3JbLTqsWBTXTQ==", 4244 + "dev": true, 4245 + "requires": { 4246 + "@babel/helper-define-map": "^7.16.7", 4247 + "@babel/helper-plugin-utils": "^7.16.7" 4248 + } 4249 + }, 4250 + "@babel/plugin-transform-regenerator": { 4251 + "version": "7.16.7", 4252 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz", 4253 + "integrity": "sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q==", 4254 + "dev": true, 4255 + "requires": { 4256 + "regenerator-transform": "^0.14.2" 4257 + }, 4258 + "dependencies": { 4259 + "regenerator-transform": { 4260 + "version": "0.14.5", 4261 + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", 4262 + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", 4263 + "dev": true, 4264 + "requires": { 4265 + "@babel/runtime": "^7.8.4" 4266 + } 4267 + } 4268 + } 4269 + }, 4270 + "@babel/plugin-transform-reserved-words": { 4271 + "version": "7.16.7", 4272 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz", 4273 + "integrity": "sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg==", 4274 + "dev": true, 4275 + "requires": { 4276 + "@babel/helper-plugin-utils": "^7.16.7" 4277 + } 4278 + }, 4279 + "@babel/plugin-transform-shorthand-properties": { 4280 + "version": "7.16.7", 4281 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz", 4282 + "integrity": "sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg==", 4283 + "dev": true, 4284 + "requires": { 4285 + "@babel/helper-plugin-utils": "^7.16.7" 4286 + } 4287 + }, 4288 + "@babel/plugin-transform-spread": { 4289 + "version": "7.16.7", 4290 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz", 4291 + "integrity": "sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg==", 4292 + "dev": true, 4293 + "requires": { 4294 + "@babel/helper-plugin-utils": "^7.16.7", 4295 + "@babel/helper-skip-transparent-expression-wrappers": "^7.16.0" 4296 + } 4297 + }, 4298 + "@babel/plugin-transform-sticky-regex": { 4299 + "version": "7.16.7", 4300 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz", 4301 + "integrity": "sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw==", 4302 + "dev": true, 4303 + "requires": { 4304 + "@babel/helper-plugin-utils": "^7.16.7" 4305 + } 4306 + }, 4307 + "@babel/plugin-transform-template-literals": { 4308 + "version": "7.16.7", 4309 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz", 4310 + "integrity": "sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA==", 4311 + "dev": true, 4312 + "requires": { 4313 + "@babel/helper-plugin-utils": "^7.16.7" 4314 + } 4315 + }, 4316 + "@babel/plugin-transform-typeof-symbol": { 4317 + "version": "7.16.7", 4318 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz", 4319 + "integrity": "sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ==", 4320 + "dev": true, 4321 + "requires": { 4322 + "@babel/helper-plugin-utils": "^7.16.7" 4323 + } 4324 + }, 4325 + "@babel/plugin-transform-unicode-escapes": { 4326 + "version": "7.16.7", 4327 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz", 4328 + "integrity": "sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q==", 4329 + "dev": true, 4330 + "requires": { 4331 + "@babel/helper-plugin-utils": "^7.16.7" 4332 + } 4333 + }, 4334 + "@babel/plugin-transform-unicode-regex": { 4335 + "version": "7.16.7", 4336 + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz", 4337 + "integrity": "sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q==", 4338 + "dev": true, 4339 + "requires": { 4340 + "@babel/helper-create-regexp-features-plugin": "^7.16.7", 4341 + "@babel/helper-plugin-utils": "^7.16.7" 4342 + } 4343 + }, 4344 + "@babel/preset-env": { 4345 + "version": "7.16.11", 4346 + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.16.11.tgz", 4347 + "integrity": "sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g==", 4348 + "dev": true, 4349 + "requires": { 4350 + "@babel/compat-data": "^7.16.8", 4351 + "@babel/helper-compilation-targets": "^7.16.7", 4352 + "@babel/helper-plugin-utils": "^7.16.7", 4353 + "@babel/helper-validator-option": "^7.16.7", 4354 + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.16.7", 4355 + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.16.7", 4356 + "@babel/plugin-proposal-async-generator-functions": "^7.16.8", 4357 + "@babel/plugin-proposal-class-properties": "^7.16.7", 4358 + "@babel/plugin-proposal-class-static-block": "^7.16.7", 4359 + "@babel/plugin-proposal-dynamic-import": "^7.16.7", 4360 + "@babel/plugin-proposal-export-namespace-from": "^7.16.7", 4361 + "@babel/plugin-proposal-json-strings": "^7.16.7", 4362 + "@babel/plugin-proposal-logical-assignment-operators": "^7.16.7", 4363 + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7", 4364 + "@babel/plugin-proposal-numeric-separator": "^7.16.7", 4365 + "@babel/plugin-proposal-object-rest-spread": "^7.16.7", 4366 + "@babel/plugin-proposal-optional-catch-binding": "^7.16.7", 4367 + "@babel/plugin-proposal-optional-chaining": "^7.16.7", 4368 + "@babel/plugin-proposal-private-methods": "^7.16.11", 4369 + "@babel/plugin-proposal-private-property-in-object": "^7.16.7", 4370 + "@babel/plugin-proposal-unicode-property-regex": "^7.16.7", 4371 + "@babel/plugin-syntax-async-generators": "^7.8.4", 4372 + "@babel/plugin-syntax-class-properties": "^7.12.13", 4373 + "@babel/plugin-syntax-class-static-block": "^7.14.5", 4374 + "@babel/plugin-syntax-dynamic-import": "^7.8.3", 4375 + "@babel/plugin-syntax-export-namespace-from": "^7.8.3", 4376 + "@babel/plugin-syntax-json-strings": "^7.8.3", 4377 + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", 4378 + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", 4379 + "@babel/plugin-syntax-numeric-separator": "^7.10.4", 4380 + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", 4381 + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", 4382 + "@babel/plugin-syntax-optional-chaining": "^7.8.3", 4383 + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", 4384 + "@babel/plugin-syntax-top-level-await": "^7.14.5", 4385 + "@babel/plugin-transform-arrow-functions": "^7.16.7", 4386 + "@babel/plugin-transform-async-to-generator": "^7.16.8", 4387 + "@babel/plugin-transform-block-scoped-functions": "^7.16.7", 4388 + "@babel/plugin-transform-block-scoping": "^7.16.7", 4389 + "@babel/plugin-transform-classes": "^7.16.7", 4390 + "@babel/plugin-transform-computed-properties": "^7.16.7", 4391 + "@babel/plugin-transform-destructuring": "^7.16.7", 4392 + "@babel/plugin-transform-dotall-regex": "^7.16.7", 4393 + "@babel/plugin-transform-duplicate-keys": "^7.16.7", 4394 + "@babel/plugin-transform-exponentiation-operator": "^7.16.7", 4395 + "@babel/plugin-transform-for-of": "^7.16.7", 4396 + "@babel/plugin-transform-function-name": "^7.16.7", 4397 + "@babel/plugin-transform-literals": "^7.16.7", 4398 + "@babel/plugin-transform-member-expression-literals": "^7.16.7", 4399 + "@babel/plugin-transform-modules-amd": "^7.16.7", 4400 + "@babel/plugin-transform-modules-commonjs": "^7.16.8", 4401 + "@babel/plugin-transform-modules-systemjs": "^7.16.7", 4402 + "@babel/plugin-transform-modules-umd": "^7.16.7", 4403 + "@babel/plugin-transform-named-capturing-groups-regex": "^7.16.8", 4404 + "@babel/plugin-transform-new-target": "^7.16.7", 4405 + "@babel/plugin-transform-object-super": "^7.16.7", 4406 + "@babel/plugin-transform-parameters": "^7.16.7", 4407 + "@babel/plugin-transform-property-literals": "^7.16.7", 4408 + "@babel/plugin-transform-regenerator": "^7.16.7", 4409 + "@babel/plugin-transform-reserved-words": "^7.16.7", 4410 + "@babel/plugin-transform-shorthand-properties": "^7.16.7", 4411 + "@babel/plugin-transform-spread": "^7.16.7", 4412 + "@babel/plugin-transform-sticky-regex": "^7.16.7", 4413 + "@babel/plugin-transform-template-literals": "^7.16.7", 4414 + "@babel/plugin-transform-typeof-symbol": "^7.16.7", 4415 + "@babel/plugin-transform-unicode-escapes": "^7.16.7", 4416 + "@babel/plugin-transform-unicode-regex": "^7.16.7", 4417 + "@babel/preset-modules": "^0.1.5", 4418 + "@babel/types": "^7.16.8", 4419 + "babel-plugin-polyfill-corejs2": "^0.3.0", 4420 + "babel-plugin-polyfill-corejs3": "^0.5.0", 4421 + "babel-plugin-polyfill-regenerator": "^0.3.0", 4422 + "core-js-compat": "^3.20.2", 4423 + "semver": "^6.3.0" 4424 + }, 4425 + "dependencies": { 4426 + "semver": { 4427 + "version": "6.3.0", 4428 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 4429 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 4430 + "dev": true 4431 + } 4432 + } 4433 + }, 4434 + "@babel/preset-modules": { 4435 + "version": "0.1.5", 4436 + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.5.tgz", 4437 + "integrity": "sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA==", 4438 + "dev": true, 4439 + "requires": { 4440 + "@babel/helper-plugin-utils": "^7.0.0", 4441 + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", 4442 + "@babel/plugin-transform-dotall-regex": "^7.4.4", 4443 + "@babel/types": "^7.4.4", 4444 + "esutils": "^2.0.2" 4445 + } 4446 + }, 4447 + "@babel/runtime": { 4448 + "version": "7.16.7", 4449 + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.16.7.tgz", 4450 + "integrity": "sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==", 4451 + "dev": true, 4452 + "requires": { 4453 + "regenerator-runtime": "^0.13.4" 4454 + }, 4455 + "dependencies": { 4456 + "regenerator-runtime": { 4457 + "version": "0.13.9", 4458 + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz", 4459 + "integrity": "sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA==", 4460 + "dev": true 4461 + } 4462 + } 4463 + }, 4464 + "@babel/template": { 4465 + "version": "7.16.7", 4466 + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.16.7.tgz", 4467 + "integrity": "sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w==", 4468 + "dev": true, 4469 + "requires": { 4470 + "@babel/code-frame": "^7.16.7", 4471 + "@babel/parser": "^7.16.7", 4472 + "@babel/types": "^7.16.7" 4473 + } 4474 + }, 4475 + "@babel/traverse": { 4476 + "version": "7.16.10", 4477 + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.16.10.tgz", 4478 + "integrity": "sha512-yzuaYXoRJBGMlBhsMJoUW7G1UmSb/eXr/JHYM/MsOJgavJibLwASijW7oXBdw3NQ6T0bW7Ty5P/VarOs9cHmqw==", 4479 + "dev": true, 4480 + "requires": { 4481 + "@babel/code-frame": "^7.16.7", 4482 + "@babel/generator": "^7.16.8", 4483 + "@babel/helper-environment-visitor": "^7.16.7", 4484 + "@babel/helper-function-name": "^7.16.7", 4485 + "@babel/helper-hoist-variables": "^7.16.7", 4486 + "@babel/helper-split-export-declaration": "^7.16.7", 4487 + "@babel/parser": "^7.16.10", 4488 + "@babel/types": "^7.16.8", 4489 + "debug": "^4.1.0", 4490 + "globals": "^11.1.0" 4491 + }, 4492 + "dependencies": { 4493 + "debug": { 4494 + "version": "4.3.3", 4495 + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", 4496 + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", 4497 + "dev": true, 4498 + "requires": { 4499 + "ms": "2.1.2" 4500 + } 4501 + }, 4502 + "globals": { 4503 + "version": "11.12.0", 4504 + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", 4505 + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", 4506 + "dev": true 4507 + }, 4508 + "ms": { 4509 + "version": "2.1.2", 4510 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 4511 + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 4512 + "dev": true 4513 + } 4514 + } 4515 + }, 4516 + "@babel/types": { 4517 + "version": "7.16.8", 4518 + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.16.8.tgz", 4519 + "integrity": "sha512-smN2DQc5s4M7fntyjGtyIPbRJv6wW4rU/94fmYJ7PKQuZkC0qGMHXJbg6sNGt12JmVr4k5YaptI/XtiLJBnmIg==", 4520 + "dev": true, 4521 + "requires": { 4522 + "@babel/helper-validator-identifier": "^7.16.7", 4523 + "to-fast-properties": "^2.0.0" 4524 + }, 4525 + "dependencies": { 4526 + "to-fast-properties": { 4527 + "version": "2.0.0", 4528 + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", 4529 + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", 4530 + "dev": true 4531 + } 4532 + } 4533 + }, 356 4534 "@codemirror/autocomplete": { 357 4535 "version": "0.19.12", 358 4536 "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-0.19.12.tgz", ··· 678 4856 "@lezer/common": "^0.15.0" 679 4857 } 680 4858 }, 4859 + "@nicolo-ribaudo/chokidar-2": { 4860 + "version": "2.1.8-no-fsevents.3", 4861 + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.3.tgz", 4862 + "integrity": "sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==", 4863 + "dev": true, 4864 + "optional": true 4865 + }, 4866 + "babel-plugin-dynamic-import-node": { 4867 + "version": "2.3.3", 4868 + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", 4869 + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", 4870 + "dev": true, 4871 + "requires": { 4872 + "object.assign": "^4.1.0" 4873 + } 4874 + }, 4875 + "babel-plugin-polyfill-corejs2": { 4876 + "version": "0.3.1", 4877 + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz", 4878 + "integrity": "sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w==", 4879 + "dev": true, 4880 + "requires": { 4881 + "@babel/compat-data": "^7.13.11", 4882 + "@babel/helper-define-polyfill-provider": "^0.3.1", 4883 + "semver": "^6.1.1" 4884 + }, 4885 + "dependencies": { 4886 + "semver": { 4887 + "version": "6.3.0", 4888 + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", 4889 + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", 4890 + "dev": true 4891 + } 4892 + } 4893 + }, 4894 + "babel-plugin-polyfill-corejs3": { 4895 + "version": "0.5.2", 4896 + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz", 4897 + "integrity": "sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ==", 4898 + "dev": true, 4899 + "requires": { 4900 + "@babel/helper-define-polyfill-provider": "^0.3.1", 4901 + "core-js-compat": "^3.21.0" 4902 + } 4903 + }, 4904 + "babel-plugin-polyfill-regenerator": { 4905 + "version": "0.3.1", 4906 + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz", 4907 + "integrity": "sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A==", 4908 + "dev": true, 4909 + "requires": { 4910 + "@babel/helper-define-polyfill-provider": "^0.3.1" 4911 + } 4912 + }, 4913 + "balanced-match": { 4914 + "version": "1.0.2", 4915 + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", 4916 + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", 4917 + "dev": true 4918 + }, 4919 + "brace-expansion": { 4920 + "version": "1.1.11", 4921 + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 4922 + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 4923 + "dev": true, 4924 + "requires": { 4925 + "balanced-match": "^1.0.0", 4926 + "concat-map": "0.0.1" 4927 + } 4928 + }, 4929 + "call-bind": { 4930 + "version": "1.0.2", 4931 + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", 4932 + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", 4933 + "dev": true, 4934 + "requires": { 4935 + "function-bind": "^1.1.1", 4936 + "get-intrinsic": "^1.0.2" 4937 + } 4938 + }, 4939 + "caniuse-lite": { 4940 + "version": "1.0.30001305", 4941 + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001305.tgz", 4942 + "integrity": "sha512-p7d9YQMji8haf0f+5rbcv9WlQ+N5jMPfRAnUmZRlNxsNeBO3Yr7RYG6M2uTY1h9tCVdlkJg6YNNc4kiAiBLdWA==", 4943 + "dev": true 4944 + }, 4945 + "color-convert": { 4946 + "version": "1.9.3", 4947 + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 4948 + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 4949 + "dev": true, 4950 + "requires": { 4951 + "color-name": "1.1.3" 4952 + } 4953 + }, 4954 + "color-name": { 4955 + "version": "1.1.3", 4956 + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 4957 + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 4958 + "dev": true 4959 + }, 4960 + "concat-map": { 4961 + "version": "0.0.1", 4962 + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 4963 + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 4964 + "dev": true 4965 + }, 4966 + "convert-source-map": { 4967 + "version": "1.8.0", 4968 + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.8.0.tgz", 4969 + "integrity": "sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA==", 4970 + "dev": true, 4971 + "requires": { 4972 + "safe-buffer": "~5.1.1" 4973 + } 4974 + }, 4975 + "core-js-compat": { 4976 + "version": "3.21.0", 4977 + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.21.0.tgz", 4978 + "integrity": "sha512-OSXseNPSK2OPJa6GdtkMz/XxeXx8/CJvfhQWTqd6neuUraujcL4jVsjkLQz1OWnax8xVQJnRPe0V2jqNWORA+A==", 4979 + "dev": true, 4980 + "requires": { 4981 + "browserslist": "^4.19.1", 4982 + "semver": "7.0.0" 4983 + }, 4984 + "dependencies": { 4985 + "browserslist": { 4986 + "version": "4.19.1", 4987 + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz", 4988 + "integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==", 4989 + "dev": true, 4990 + "requires": { 4991 + "caniuse-lite": "^1.0.30001286", 4992 + "electron-to-chromium": "^1.4.17", 4993 + "escalade": "^3.1.1", 4994 + "node-releases": "^2.0.1", 4995 + "picocolors": "^1.0.0" 4996 + } 4997 + }, 4998 + "semver": { 4999 + "version": "7.0.0", 5000 + "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", 5001 + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", 5002 + "dev": true 5003 + } 5004 + } 5005 + }, 681 5006 "crelt": { 682 5007 "version": "1.0.5", 683 5008 "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.5.tgz", 684 5009 "integrity": "sha512-+BO9wPPi+DWTDcNYhr/W90myha8ptzftZT+LwcmUbbok0rcP/fequmFYCw8NMoH7pkAZQzU78b3kYrlua5a9eA==" 685 5010 }, 5011 + "define-properties": { 5012 + "version": "1.1.3", 5013 + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", 5014 + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", 5015 + "dev": true, 5016 + "requires": { 5017 + "object-keys": "^1.0.12" 5018 + } 5019 + }, 5020 + "electron-to-chromium": { 5021 + "version": "1.4.62", 5022 + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.62.tgz", 5023 + "integrity": "sha512-fWc/zAThqZzl7fbuLzar+x6bqZBWHrsBXQOqv//yrgdTLY/G3JGTPOWhPKIhbhynJJhqE9QNzKzlpCINUmUMoA==", 5024 + "dev": true 5025 + }, 5026 + "escalade": { 5027 + "version": "3.1.1", 5028 + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", 5029 + "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", 5030 + "dev": true 5031 + }, 5032 + "escape-string-regexp": { 5033 + "version": "1.0.5", 5034 + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 5035 + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 5036 + "dev": true 5037 + }, 5038 + "esutils": { 5039 + "version": "2.0.3", 5040 + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 5041 + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 5042 + "dev": true 5043 + }, 5044 + "fs-readdir-recursive": { 5045 + "version": "1.1.0", 5046 + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", 5047 + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", 5048 + "dev": true 5049 + }, 5050 + "fs.realpath": { 5051 + "version": "1.0.0", 5052 + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 5053 + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 5054 + "dev": true 5055 + }, 5056 + "function-bind": { 5057 + "version": "1.1.1", 5058 + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", 5059 + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", 5060 + "dev": true 5061 + }, 5062 + "gensync": { 5063 + "version": "1.0.0-beta.2", 5064 + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", 5065 + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", 5066 + "dev": true 5067 + }, 5068 + "get-intrinsic": { 5069 + "version": "1.1.1", 5070 + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", 5071 + "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", 5072 + "dev": true, 5073 + "requires": { 5074 + "function-bind": "^1.1.1", 5075 + "has": "^1.0.3", 5076 + "has-symbols": "^1.0.1" 5077 + } 5078 + }, 5079 + "glob": { 5080 + "version": "7.2.0", 5081 + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", 5082 + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", 5083 + "dev": true, 5084 + "requires": { 5085 + "fs.realpath": "^1.0.0", 5086 + "inflight": "^1.0.4", 5087 + "inherits": "2", 5088 + "minimatch": "^3.0.4", 5089 + "once": "^1.3.0", 5090 + "path-is-absolute": "^1.0.0" 5091 + } 5092 + }, 5093 + "has": { 5094 + "version": "1.0.3", 5095 + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", 5096 + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", 5097 + "dev": true, 5098 + "requires": { 5099 + "function-bind": "^1.1.1" 5100 + } 5101 + }, 5102 + "has-flag": { 5103 + "version": "3.0.0", 5104 + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 5105 + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 5106 + "dev": true 5107 + }, 5108 + "has-symbols": { 5109 + "version": "1.0.2", 5110 + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.2.tgz", 5111 + "integrity": "sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw==", 5112 + "dev": true 5113 + }, 5114 + "inflight": { 5115 + "version": "1.0.6", 5116 + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 5117 + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 5118 + "dev": true, 5119 + "requires": { 5120 + "once": "^1.3.0", 5121 + "wrappy": "1" 5122 + } 5123 + }, 5124 + "inherits": { 5125 + "version": "2.0.4", 5126 + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 5127 + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 5128 + "dev": true 5129 + }, 5130 + "is-core-module": { 5131 + "version": "2.8.1", 5132 + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.8.1.tgz", 5133 + "integrity": "sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA==", 5134 + "dev": true, 5135 + "requires": { 5136 + "has": "^1.0.3" 5137 + } 5138 + }, 5139 + "jsesc": { 5140 + "version": "0.5.0", 5141 + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", 5142 + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", 5143 + "dev": true 5144 + }, 5145 + "lodash.debounce": { 5146 + "version": "4.0.8", 5147 + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", 5148 + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=", 5149 + "dev": true 5150 + }, 5151 + "make-dir": { 5152 + "version": "2.1.0", 5153 + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", 5154 + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", 5155 + "dev": true, 5156 + "requires": { 5157 + "pify": "^4.0.1", 5158 + "semver": "^5.6.0" 5159 + } 5160 + }, 5161 + "minimatch": { 5162 + "version": "3.0.4", 5163 + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 5164 + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 5165 + "dev": true, 5166 + "requires": { 5167 + "brace-expansion": "^1.1.7" 5168 + } 5169 + }, 5170 + "minimist": { 5171 + "version": "1.2.5", 5172 + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 5173 + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", 5174 + "dev": true 5175 + }, 5176 + "node-releases": { 5177 + "version": "2.0.1", 5178 + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.1.tgz", 5179 + "integrity": "sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA==", 5180 + "dev": true 5181 + }, 5182 + "object-keys": { 5183 + "version": "1.1.1", 5184 + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", 5185 + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", 5186 + "dev": true 5187 + }, 5188 + "object.assign": { 5189 + "version": "4.1.2", 5190 + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", 5191 + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", 5192 + "dev": true, 5193 + "requires": { 5194 + "call-bind": "^1.0.0", 5195 + "define-properties": "^1.1.3", 5196 + "has-symbols": "^1.0.1", 5197 + "object-keys": "^1.1.1" 5198 + } 5199 + }, 5200 + "once": { 5201 + "version": "1.4.0", 5202 + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 5203 + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 5204 + "dev": true, 5205 + "requires": { 5206 + "wrappy": "1" 5207 + } 5208 + }, 5209 + "path-is-absolute": { 5210 + "version": "1.0.1", 5211 + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 5212 + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 5213 + "dev": true 5214 + }, 5215 + "path-parse": { 5216 + "version": "1.0.7", 5217 + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", 5218 + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", 5219 + "dev": true 5220 + }, 5221 + "picocolors": { 5222 + "version": "1.0.0", 5223 + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", 5224 + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", 5225 + "dev": true 5226 + }, 5227 + "picomatch": { 5228 + "version": "2.3.1", 5229 + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", 5230 + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", 5231 + "dev": true, 5232 + "optional": true 5233 + }, 5234 + "pify": { 5235 + "version": "4.0.1", 5236 + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", 5237 + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", 5238 + "dev": true 5239 + }, 5240 + "regenerate": { 5241 + "version": "1.4.2", 5242 + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", 5243 + "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==", 5244 + "dev": true 5245 + }, 5246 + "regenerate-unicode-properties": { 5247 + "version": "9.0.0", 5248 + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", 5249 + "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", 5250 + "dev": true, 5251 + "requires": { 5252 + "regenerate": "^1.4.2" 5253 + } 5254 + }, 5255 + "resolve": { 5256 + "version": "1.22.0", 5257 + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", 5258 + "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", 5259 + "dev": true, 5260 + "requires": { 5261 + "is-core-module": "^2.8.1", 5262 + "path-parse": "^1.0.7", 5263 + "supports-preserve-symlinks-flag": "^1.0.0" 5264 + } 5265 + }, 5266 + "safe-buffer": { 5267 + "version": "5.1.2", 5268 + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 5269 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 5270 + "dev": true 5271 + }, 5272 + "semver": { 5273 + "version": "5.7.1", 5274 + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 5275 + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 5276 + "dev": true 5277 + }, 5278 + "source-map": { 5279 + "version": "0.5.7", 5280 + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", 5281 + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", 5282 + "dev": true 5283 + }, 686 5284 "style-mod": { 687 5285 "version": "4.0.0", 688 5286 "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.0.0.tgz", 689 5287 "integrity": "sha512-OPhtyEjyyN9x3nhPsu76f52yUGXiZcgvsrFVtvTkyGRQJ0XK+GPc6ov1z+lRpbeabka+MYEQxOYRnt5nF30aMw==" 690 5288 }, 5289 + "supports-preserve-symlinks-flag": { 5290 + "version": "1.0.0", 5291 + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", 5292 + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", 5293 + "dev": true 5294 + }, 5295 + "unicode-canonical-property-names-ecmascript": { 5296 + "version": "2.0.0", 5297 + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", 5298 + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==", 5299 + "dev": true 5300 + }, 5301 + "unicode-match-property-ecmascript": { 5302 + "version": "2.0.0", 5303 + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", 5304 + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", 5305 + "dev": true, 5306 + "requires": { 5307 + "unicode-canonical-property-names-ecmascript": "^2.0.0", 5308 + "unicode-property-aliases-ecmascript": "^2.0.0" 5309 + } 5310 + }, 5311 + "unicode-match-property-value-ecmascript": { 5312 + "version": "2.0.0", 5313 + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", 5314 + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==", 5315 + "dev": true 5316 + }, 5317 + "unicode-property-aliases-ecmascript": { 5318 + "version": "2.0.0", 5319 + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", 5320 + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==", 5321 + "dev": true 5322 + }, 691 5323 "w3c-keyname": { 692 5324 "version": "2.2.4", 693 5325 "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.4.tgz", 694 5326 "integrity": "sha512-tOhfEwEzFLJzf6d1ZPkYfGj+FWhIpBux9ppoP3rlclw3Z0BZv3N7b7030Z1kYth+6rDuAsXUFr+d0VE6Ed1ikw==" 5327 + }, 5328 + "wrappy": { 5329 + "version": "1.0.2", 5330 + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 5331 + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 5332 + "dev": true 695 5333 } 696 5334 } 697 5335 }
+8 -2
package.json
··· 10 10 }, 11 11 "scripts": { 12 12 "bundle": "npx browserify --standalone CodeMirror --no-browser-field ./vendor/code-mirror.js -o ./vendor/code-mirror.compiled.js", 13 - "minify": "npx esbuild --minify ./vendor/code-mirror.compiled.js --outfile=./vendor/code-mirror.min.js" 13 + "translate": "babel vendor --out-dir vendor/out" 14 14 }, 15 15 "dependencies": { 16 - "@codemirror/basic-setup": "0.19.0", 17 16 "@codemirror/autocomplete": "0.19.12", 17 + "@codemirror/basic-setup": "0.19.0", 18 18 "@codemirror/legacy-modes": "0.19.0", 19 19 "@codemirror/lint": "0.19.3", 20 20 "@codemirror/state": "0.19.5", 21 21 "@codemirror/stream-parser": "0.19.2", 22 22 "@codemirror/theme-one-dark": "0.19.1", 23 23 "@codemirror/view": "0.19.16" 24 + }, 25 + "devDependencies": { 26 + "@babel/cli": "^7.16.8", 27 + "@babel/core": "^7.16.12", 28 + "@babel/plugin-transform-property-mutators": "^7.16.7", 29 + "@babel/preset-env": "^7.16.11" 24 30 } 25 31 }
+1 -1
src/dune
··· 1 1 (library 2 2 (name code_mirror) 3 3 (js_of_ocaml 4 - (javascript_files ../vendor/code-mirror.compiled.js)) 4 + (javascript_files ../vendor/out/code-mirror.compiled.js)) 5 5 (public_name code-mirror) 6 6 (libraries brr js_of_ocaml))
+4982
vendor/out/code-mirror.compiled.js
··· 1 + "use strict";function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _get(){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get;}else{_get=function _get(target,property,receiver){var base=_superPropBase(target,property);if(!base)return;var desc=Object.getOwnPropertyDescriptor(base,property);if(desc.get){return desc.get.call(arguments.length<3?target:receiver);}return desc.value;};}return _get.apply(this,arguments);}function _superPropBase(object,property){while(!Object.prototype.hasOwnProperty.call(object,property)){object=_getPrototypeOf(object);if(object===null)break;}return object;}function _inherits(subClass,superClass){if(typeof superClass!=="function"&&superClass!==null){throw new TypeError("Super expression must either be null or a function");}subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:true,configurable:true}});Object.defineProperty(subClass,"prototype",{writable:false});if(superClass)_setPrototypeOf(subClass,superClass);}function _setPrototypeOf(o,p){_setPrototypeOf=Object.setPrototypeOf||function _setPrototypeOf(o,p){o.__proto__=p;return o;};return _setPrototypeOf(o,p);}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function _createSuperInternal(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget);}else{result=Super.apply(this,arguments);}return _possibleConstructorReturn(this,result);};}function _possibleConstructorReturn(self,call){if(call&&(_typeof(call)==="object"||typeof call==="function")){return call;}else if(call!==void 0){throw new TypeError("Derived constructors may only return object or undefined");}return _assertThisInitialized(self);}function _assertThisInitialized(self){if(self===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called");}return self;}function _isNativeReflectConstruct(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));return true;}catch(e){return false;}}function _getPrototypeOf(o){_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function _getPrototypeOf(o){return o.__proto__||Object.getPrototypeOf(o);};return _getPrototypeOf(o);}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread();}function _nonIterableSpread(){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 _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter);}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr);}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest();}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}function _iterableToArrayLimit(arr,i){var _i=arr==null?null:typeof Symbol!=="undefined"&&arr[Symbol.iterator]||arr["@@iterator"];if(_i==null)return;var _arr=[];var _n=true;var _d=false;var _s,_e;try{for(_i=_i.call(arr);!(_n=(_s=_i.next()).done);_n=true){_arr.push(_s.value);if(i&&_arr.length===i)break;}}catch(err){_d=true;_e=err;}finally{try{if(!_n&&_i["return"]!=null)_i["return"]();}finally{if(_d)throw _e;}}return _arr;}function _arrayWithHoles(arr){if(Array.isArray(arr))return arr;}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]};},e:function e(_e3){throw _e3;},f:F};}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 normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o);},n:function n(){var step=it.next();normalCompletion=step.done;return step;},e:function e(_e4){didErr=true;err=_e4;},f:function f(){try{if(!normalCompletion&&it["return"]!=null)it["return"]();}finally{if(didErr)throw err;}}};}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen);}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i<len;i++){arr2[i]=arr[i];}return arr2;}function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError("Cannot call a class as a function");}}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||false;descriptor.configurable=true;if("value"in descriptor)descriptor.writable=true;Object.defineProperty(target,descriptor.key,descriptor);}}function _createClass(Constructor,protoProps,staticProps){if(protoProps)_defineProperties(Constructor.prototype,protoProps);if(staticProps)_defineProperties(Constructor,staticProps);Object.defineProperty(Constructor,"prototype",{writable:false});return Constructor;}function _typeof(obj){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(obj){return typeof obj;}:function(obj){return obj&&"function"==typeof Symbol&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj;},_typeof(obj);}(function(f){if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"&&typeof module!=="undefined"){module.exports=f();}else if(typeof define==="function"&&define.amd){define([],f);}else{var g;if(typeof window!=="undefined"){g=window;}else if(typeof global!=="undefined"){g=global;}else if(typeof self!=="undefined"){g=self;}else{g=this;}g.CodeMirror=f();}})(function(){var define,module,exports;return function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a;}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r);},p,p.exports,r,e,n,t);}return n[i].exports;}for(var u="function"==typeof require&&require,i=0;i<t.length;i++){o(t[i]);}return o;}return r;}()({1:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');var view=require('@codemirror/view');var tooltip=require('@codemirror/tooltip');var language=require('@codemirror/language');var text=require('@codemirror/text');/** 2 + An instance of this is passed to completion source functions. 3 + */var CompletionContext=/*#__PURE__*/function(){/** 4 + Create a new completion context. (Mostly useful for testing 5 + completion sources—in the editor, the extension will create 6 + these for you.) 7 + */function CompletionContext(/** 8 + The editor state that the completion happens in. 9 + */state,/** 10 + The position at which the completion is happening. 11 + */pos,/** 12 + Indicates whether completion was activated explicitly, or 13 + implicitly by typing. The usual way to respond to this is to 14 + only return completions when either there is part of a 15 + completable entity before the cursor, or `explicit` is true. 16 + */explicit){_classCallCheck(this,CompletionContext);this.state=state;this.pos=pos;this.explicit=explicit;/** 17 + @internal 18 + */this.abortListeners=[];}/** 19 + Get the extent, content, and (if there is a token) type of the 20 + token before `this.pos`. 21 + */_createClass(CompletionContext,[{key:"tokenBefore",value:function tokenBefore(types){var token=language.syntaxTree(this.state).resolveInner(this.pos,-1);while(token&&types.indexOf(token.name)<0){token=token.parent;}return token?{from:token.from,to:this.pos,text:this.state.sliceDoc(token.from,this.pos),type:token.type}:null;}/** 22 + Get the match of the given expression directly before the 23 + cursor. 24 + */},{key:"matchBefore",value:function matchBefore(expr){var line=this.state.doc.lineAt(this.pos);var start=Math.max(line.from,this.pos-250);var str=line.text.slice(start-line.from,this.pos-line.from);var found=str.search(ensureAnchor(expr,false));return found<0?null:{from:start+found,to:this.pos,text:str.slice(found)};}/** 25 + Yields true when the query has been aborted. Can be useful in 26 + asynchronous queries to avoid doing work that will be ignored. 27 + */},{key:"aborted",get:function get(){return this.abortListeners==null;}/** 28 + Allows you to register abort handlers, which will be called when 29 + the query is 30 + [aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted). 31 + */},{key:"addEventListener",value:function addEventListener(type,listener){if(type=="abort"&&this.abortListeners)this.abortListeners.push(listener);}}]);return CompletionContext;}();function toSet(chars){var flat=Object.keys(chars).join("");var words=/\w/.test(flat);if(words)flat=flat.replace(/\w/g,"");return"[".concat(words?"\\w":"").concat(flat.replace(/[^\w\s]/g,"\\$&"),"]");}function prefixMatch(options){var first=Object.create(null),rest=Object.create(null);var _iterator=_createForOfIteratorHelper(options),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var label=_step.value.label;first[label[0]]=true;for(var i=1;i<label.length;i++){rest[label[i]]=true;}}}catch(err){_iterator.e(err);}finally{_iterator.f();}var source=toSet(first)+toSet(rest)+"*$";return[new RegExp("^"+source),new RegExp(source)];}/** 32 + Given a a fixed array of options, return an autocompleter that 33 + completes them. 34 + */function completeFromList(list){var options=list.map(function(o){return typeof o=="string"?{label:o}:o;});var _ref=options.every(function(o){return /^\w+$/.test(o.label);})?[/\w*$/,/\w+$/]:prefixMatch(options),_ref2=_slicedToArray(_ref,2),span=_ref2[0],match=_ref2[1];return function(context){var token=context.matchBefore(match);return token||context.explicit?{from:token?token.from:context.pos,options:options,span:span}:null;};}/** 35 + Wrap the given completion source so that it will only fire when the 36 + cursor is in a syntax node with one of the given names. 37 + */function ifIn(nodes,source){return function(context){for(var pos=language.syntaxTree(context.state).resolveInner(context.pos,-1);pos;pos=pos.parent){if(nodes.indexOf(pos.name)>-1)return source(context);}return null;};}/** 38 + Wrap the given completion source so that it will not fire when the 39 + cursor is in a syntax node with one of the given names. 40 + */function ifNotIn(nodes,source){return function(context){for(var pos=language.syntaxTree(context.state).resolveInner(context.pos,-1);pos;pos=pos.parent){if(nodes.indexOf(pos.name)>-1)return null;}return source(context);};}var Option=/*#__PURE__*/_createClass(function Option(completion,source,match){_classCallCheck(this,Option);this.completion=completion;this.source=source;this.match=match;});function cur(state){return state.selection.main.head;}// Make sure the given regexp has a $ at its end and, if `start` is 41 + // true, a ^ at its start. 42 + function ensureAnchor(expr,start){var _a;var source=expr.source;var addStart=start&&source[0]!="^",addEnd=source[source.length-1]!="$";if(!addStart&&!addEnd)return expr;return new RegExp("".concat(addStart?"^":"","(?:").concat(source,")").concat(addEnd?"$":""),(_a=expr.flags)!==null&&_a!==void 0?_a:expr.ignoreCase?"i":"");}/** 43 + This annotation is added to transactions that are produced by 44 + picking a completion. 45 + */var pickedCompletion=state.Annotation.define();function applyCompletion(view,option){var apply=option.completion.apply||option.completion.label;var result=option.source;if(typeof apply=="string"){view.dispatch({changes:{from:result.from,to:result.to,insert:apply},selection:{anchor:result.from+apply.length},userEvent:"input.complete",annotations:pickedCompletion.of(option.completion)});}else{apply(view,option.completion,result.from,result.to);}}var SourceCache=new WeakMap();function asSource(source){if(!Array.isArray(source))return source;var known=SourceCache.get(source);if(!known)SourceCache.set(source,known=completeFromList(source));return known;}// A pattern matcher for fuzzy completion matching. Create an instance 46 + // once for a pattern, and then use that to match any number of 47 + // completions. 48 + var FuzzyMatcher=/*#__PURE__*/function(){function FuzzyMatcher(pattern){_classCallCheck(this,FuzzyMatcher);this.pattern=pattern;this.chars=[];this.folded=[];// Buffers reused by calls to `match` to track matched character 49 + // positions. 50 + this.any=[];this.precise=[];this.byWord=[];for(var p=0;p<pattern.length;){var _char=text.codePointAt(pattern,p),size=text.codePointSize(_char);this.chars.push(_char);var part=pattern.slice(p,p+size),upper=part.toUpperCase();this.folded.push(text.codePointAt(upper==part?part.toLowerCase():upper,0));p+=size;}this.astral=pattern.length!=this.chars.length;}// Matches a given word (completion) against the pattern (input). 51 + // Will return null for no match, and otherwise an array that starts 52 + // with the match score, followed by any number of `from, to` pairs 53 + // indicating the matched parts of `word`. 54 + // 55 + // The score is a number that is more negative the worse the match 56 + // is. See `Penalty` above. 57 + _createClass(FuzzyMatcher,[{key:"match",value:function match(word){if(this.pattern.length==0)return[0];if(word.length<this.pattern.length)return null;var chars=this.chars,folded=this.folded,any=this.any,precise=this.precise,byWord=this.byWord;// For single-character queries, only match when they occur right 58 + // at the start 59 + if(chars.length==1){var first=text.codePointAt(word,0);return first==chars[0]?[0,0,text.codePointSize(first)]:first==folded[0]?[-200/* CaseFold */,0,text.codePointSize(first)]:null;}var direct=word.indexOf(this.pattern);if(direct==0)return[0,0,this.pattern.length];var len=chars.length,anyTo=0;if(direct<0){for(var i=0,e=Math.min(word.length,200);i<e&&anyTo<len;){var next=text.codePointAt(word,i);if(next==chars[anyTo]||next==folded[anyTo])any[anyTo++]=i;i+=text.codePointSize(next);}// No match, exit immediately 60 + if(anyTo<len)return null;}// This tracks the extent of the precise (non-folded, not 61 + // necessarily adjacent) match 62 + var preciseTo=0;// Tracks whether there is a match that hits only characters that 63 + // appear to be starting words. `byWordFolded` is set to true when 64 + // a case folded character is encountered in such a match 65 + var byWordTo=0,byWordFolded=false;// If we've found a partial adjacent match, these track its state 66 + var adjacentTo=0,adjacentStart=-1,adjacentEnd=-1;var hasLower=/[a-z]/.test(word),wordAdjacent=true;// Go over the option's text, scanning for the various kinds of matches 67 + for(var _i2=0,_e2=Math.min(word.length,200),prevType=0/* NonWord */;_i2<_e2&&byWordTo<len;){var _next=text.codePointAt(word,_i2);if(direct<0){if(preciseTo<len&&_next==chars[preciseTo])precise[preciseTo++]=_i2;if(adjacentTo<len){if(_next==chars[adjacentTo]||_next==folded[adjacentTo]){if(adjacentTo==0)adjacentStart=_i2;adjacentEnd=_i2+1;adjacentTo++;}else{adjacentTo=0;}}}var ch=void 0,type=_next<0xff?_next>=48&&_next<=57||_next>=97&&_next<=122?2/* Lower */:_next>=65&&_next<=90?1/* Upper */:0/* NonWord */:(ch=text.fromCodePoint(_next))!=ch.toLowerCase()?1/* Upper */:ch!=ch.toUpperCase()?2/* Lower */:0/* NonWord */;if(!_i2||type==1/* Upper */&&hasLower||prevType==0/* NonWord */&&type!=0/* NonWord */){if(chars[byWordTo]==_next||folded[byWordTo]==_next&&(byWordFolded=true))byWord[byWordTo++]=_i2;else if(byWord.length)wordAdjacent=false;}prevType=type;_i2+=text.codePointSize(_next);}if(byWordTo==len&&byWord[0]==0&&wordAdjacent)return this.result(-100/* ByWord */+(byWordFolded?-200/* CaseFold */:0),byWord,word);if(adjacentTo==len&&adjacentStart==0)return[-200/* CaseFold */-word.length,0,adjacentEnd];if(direct>-1)return[-700/* NotStart */-word.length,direct,direct+this.pattern.length];if(adjacentTo==len)return[-200/* CaseFold */+-700/* NotStart */-word.length,adjacentStart,adjacentEnd];if(byWordTo==len)return this.result(-100/* ByWord */+(byWordFolded?-200/* CaseFold */:0)+-700/* NotStart */+(wordAdjacent?0:-1100/* Gap */),byWord,word);return chars.length==2?null:this.result((any[0]?-700/* NotStart */:0)+-200/* CaseFold */+-1100/* Gap */,any,word);}},{key:"result",value:function result(score,positions,word){var result=[score-word.length],i=1;var _iterator2=_createForOfIteratorHelper(positions),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var pos=_step2.value;var to=pos+(this.astral?text.codePointSize(text.codePointAt(word,pos)):1);if(i>1&&result[i-1]==pos)result[i-1]=to;else{result[i++]=pos;result[i++]=to;}}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}return result;}}]);return FuzzyMatcher;}();var completionConfig=state.Facet.define({combine:function combine(configs){return state.combineConfig(configs,{activateOnTyping:true,override:null,maxRenderedOptions:100,defaultKeymap:true,optionClass:function optionClass(){return"";},aboveCursor:false,icons:true,addToOptions:[]},{defaultKeymap:function defaultKeymap(a,b){return a&&b;},icons:function icons(a,b){return a&&b;},optionClass:function optionClass(a,b){return function(c){return joinClass(a(c),b(c));};},addToOptions:function addToOptions(a,b){return a.concat(b);}});}});function joinClass(a,b){return a?b?a+" "+b:a:b;}function optionContent(config){var content=config.addToOptions.slice();if(config.icons)content.push({render:function render(completion){var _icon$classList;var icon=document.createElement("div");icon.classList.add("cm-completionIcon");if(completion.type)(_icon$classList=icon.classList).add.apply(_icon$classList,_toConsumableArray(completion.type.split(/\s+/g).map(function(cls){return"cm-completionIcon-"+cls;})));icon.setAttribute("aria-hidden","true");return icon;},position:20});content.push({render:function render(completion,_s,match){var labelElt=document.createElement("span");labelElt.className="cm-completionLabel";var label=completion.label,off=0;for(var j=1;j<match.length;){var from=match[j++],to=match[j++];if(from>off)labelElt.appendChild(document.createTextNode(label.slice(off,from)));var span=labelElt.appendChild(document.createElement("span"));span.appendChild(document.createTextNode(label.slice(from,to)));span.className="cm-completionMatchedText";off=to;}if(off<label.length)labelElt.appendChild(document.createTextNode(label.slice(off)));return labelElt;},position:50},{render:function render(completion){if(!completion.detail)return null;var detailElt=document.createElement("span");detailElt.className="cm-completionDetail";detailElt.textContent=completion.detail;return detailElt;},position:80});return content.sort(function(a,b){return a.position-b.position;}).map(function(a){return a.render;});}function createInfoDialog(option,view$1){var dom=document.createElement("div");dom.className="cm-tooltip cm-completionInfo";var info=option.completion.info;if(typeof info=="string"){dom.textContent=info;}else{var content=info(option.completion);if(content.then)content.then(function(node){return dom.appendChild(node);},function(e){return view.logException(view$1.state,e,"completion info");});else dom.appendChild(content);}return dom;}function rangeAroundSelected(total,selected,max){if(total<=max)return{from:0,to:total};if(selected<=total>>1){var _off=Math.floor(selected/max);return{from:_off*max,to:(_off+1)*max};}var off=Math.floor((total-selected)/max);return{from:total-(off+1)*max,to:total-off*max};}var CompletionTooltip=/*#__PURE__*/function(){function CompletionTooltip(view,stateField){var _this=this;_classCallCheck(this,CompletionTooltip);this.view=view;this.stateField=stateField;this.info=null;this.placeInfo={read:function read(){return _this.measureInfo();},write:function write(pos){return _this.positionInfo(pos);},key:this};var cState=view.state.field(stateField);var _cState$open=cState.open,options=_cState$open.options,selected=_cState$open.selected;var config=view.state.facet(completionConfig);this.optionContent=optionContent(config);this.optionClass=config.optionClass;this.range=rangeAroundSelected(options.length,selected,config.maxRenderedOptions);this.dom=document.createElement("div");this.dom.className="cm-tooltip-autocomplete";this.dom.addEventListener("mousedown",function(e){for(var dom=e.target,match;dom&&dom!=_this.dom;dom=dom.parentNode){if(dom.nodeName=="LI"&&(match=/-(\d+)$/.exec(dom.id))&&+match[1]<options.length){applyCompletion(view,options[+match[1]]);e.preventDefault();return;}}});this.list=this.dom.appendChild(this.createListBox(options,cState.id,this.range));this.list.addEventListener("scroll",function(){if(_this.info)_this.view.requestMeasure(_this.placeInfo);});}_createClass(CompletionTooltip,[{key:"mount",value:function mount(){this.updateSel();}},{key:"update",value:function update(_update){if(_update.state.field(this.stateField)!=_update.startState.field(this.stateField))this.updateSel();}},{key:"positioned",value:function positioned(){if(this.info)this.view.requestMeasure(this.placeInfo);}},{key:"updateSel",value:function updateSel(){var _this2=this;var cState=this.view.state.field(this.stateField),open=cState.open;if(open.selected<this.range.from||open.selected>=this.range.to){this.range=rangeAroundSelected(open.options.length,open.selected,this.view.state.facet(completionConfig).maxRenderedOptions);this.list.remove();this.list=this.dom.appendChild(this.createListBox(open.options,cState.id,this.range));this.list.addEventListener("scroll",function(){if(_this2.info)_this2.view.requestMeasure(_this2.placeInfo);});}if(this.updateSelectedOption(open.selected)){if(this.info){this.info.remove();this.info=null;}var option=open.options[open.selected];if(option.completion.info){this.info=this.dom.appendChild(createInfoDialog(option,this.view));this.view.requestMeasure(this.placeInfo);}}}},{key:"updateSelectedOption",value:function updateSelectedOption(selected){var set=null;for(var opt=this.list.firstChild,i=this.range.from;opt;opt=opt.nextSibling,i++){if(i==selected){if(!opt.hasAttribute("aria-selected")){opt.setAttribute("aria-selected","true");set=opt;}}else{if(opt.hasAttribute("aria-selected"))opt.removeAttribute("aria-selected");}}if(set)scrollIntoView(this.list,set);return set;}},{key:"measureInfo",value:function measureInfo(){var sel=this.dom.querySelector("[aria-selected]");if(!sel||!this.info)return null;var listRect=this.dom.getBoundingClientRect();var infoRect=this.info.getBoundingClientRect();var selRect=sel.getBoundingClientRect();if(selRect.top>Math.min(innerHeight,listRect.bottom)-10||selRect.bottom<Math.max(0,listRect.top)+10)return null;var top=Math.max(0,Math.min(selRect.top,innerHeight-infoRect.height))-listRect.top;var left=this.view.textDirection==view.Direction.RTL;var spaceLeft=listRect.left,spaceRight=innerWidth-listRect.right;if(left&&spaceLeft<Math.min(infoRect.width,spaceRight))left=false;else if(!left&&spaceRight<Math.min(infoRect.width,spaceLeft))left=true;return{top:top,left:left};}},{key:"positionInfo",value:function positionInfo(pos){if(this.info){this.info.style.top=(pos?pos.top:-1e6)+"px";if(pos){this.info.classList.toggle("cm-completionInfo-left",pos.left);this.info.classList.toggle("cm-completionInfo-right",!pos.left);}}}},{key:"createListBox",value:function createListBox(options,id,range){var ul=document.createElement("ul");ul.id=id;ul.setAttribute("role","listbox");for(var i=range.from;i<range.to;i++){var _options$i=options[i],completion=_options$i.completion,match=_options$i.match;var li=ul.appendChild(document.createElement("li"));li.id=id+"-"+i;li.setAttribute("role","option");var cls=this.optionClass(completion);if(cls)li.className=cls;var _iterator3=_createForOfIteratorHelper(this.optionContent),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var source=_step3.value;var node=source(completion,this.view.state,match);if(node)li.appendChild(node);}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}}if(range.from)ul.classList.add("cm-completionListIncompleteTop");if(range.to<options.length)ul.classList.add("cm-completionListIncompleteBottom");return ul;}}]);return CompletionTooltip;}();// We allocate a new function instance every time the completion 68 + // changes to force redrawing/repositioning of the tooltip 69 + function completionTooltip(stateField){return function(view){return new CompletionTooltip(view,stateField);};}function scrollIntoView(container,element){var parent=container.getBoundingClientRect();var self=element.getBoundingClientRect();if(self.top<parent.top)container.scrollTop-=parent.top-self.top;else if(self.bottom>parent.bottom)container.scrollTop+=self.bottom-parent.bottom;}var MaxOptions=300;// Used to pick a preferred option when two options with the same 70 + // label occur in the result. 71 + function score(option){return(option.boost||0)*100+(option.apply?10:0)+(option.info?5:0)+(option.type?1:0);}function sortOptions(active,state){var options=[],i=0;var _iterator4=_createForOfIteratorHelper(active),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var a=_step4.value;if(a.hasResult()){if(a.result.filter===false){var _iterator6=_createForOfIteratorHelper(a.result.options),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var option=_step6.value;options.push(new Option(option,a,[1e9-i++]));}}catch(err){_iterator6.e(err);}finally{_iterator6.f();}}else{var matcher=new FuzzyMatcher(state.sliceDoc(a.from,a.to)),match=void 0;var _iterator7=_createForOfIteratorHelper(a.result.options),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _option=_step7.value;if(match=matcher.match(_option.label)){if(_option.boost!=null)match[0]+=_option.boost;options.push(new Option(_option,a,match));}}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}}}}catch(err){_iterator4.e(err);}finally{_iterator4.f();}options.sort(cmpOption);var result=[],prev=null;var _iterator5=_createForOfIteratorHelper(options.sort(cmpOption)),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var opt=_step5.value;if(result.length==MaxOptions)break;if(!prev||prev.label!=opt.completion.label||prev.detail!=opt.completion.detail||prev.type!=opt.completion.type||prev.apply!=opt.completion.apply)result.push(opt);else if(score(opt.completion)>score(prev))result[result.length-1]=opt;prev=opt.completion;}}catch(err){_iterator5.e(err);}finally{_iterator5.f();}return result;}var CompletionDialog=/*#__PURE__*/function(){function CompletionDialog(options,attrs,tooltip,timestamp,selected){_classCallCheck(this,CompletionDialog);this.options=options;this.attrs=attrs;this.tooltip=tooltip;this.timestamp=timestamp;this.selected=selected;}_createClass(CompletionDialog,[{key:"setSelected",value:function setSelected(selected,id){return selected==this.selected||selected>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(id,selected),this.tooltip,this.timestamp,selected);}},{key:"map",value:function map(changes){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:changes.mapPos(this.tooltip.pos)}),this.timestamp,this.selected);}}],[{key:"build",value:function build(active,state,id,prev,conf){var options=sortOptions(active,state);if(!options.length)return null;var selected=0;if(prev&&prev.selected){var selectedValue=prev.options[prev.selected].completion;for(var i=0;i<options.length&&!selected;i++){if(options[i].completion==selectedValue)selected=i;}}return new CompletionDialog(options,makeAttrs(id,selected),{pos:active.reduce(function(a,b){return b.hasResult()?Math.min(a,b.from):a;},1e8),create:completionTooltip(completionState),above:conf.aboveCursor},prev?prev.timestamp:Date.now(),selected);}}]);return CompletionDialog;}();var CompletionState=/*#__PURE__*/function(){function CompletionState(active,id,open){_classCallCheck(this,CompletionState);this.active=active;this.id=id;this.open=open;}_createClass(CompletionState,[{key:"update",value:function update(tr){var _this3=this;var state=tr.state,conf=state.facet(completionConfig);var sources=conf.override||state.languageDataAt("autocomplete",cur(state)).map(asSource);var active=sources.map(function(source){var value=_this3.active.find(function(s){return s.source==source;})||new ActiveSource(source,_this3.active.some(function(a){return a.state!=0;}/* Inactive */)?1/* Pending */:0/* Inactive */);return value.update(tr,conf);});if(active.length==this.active.length&&active.every(function(a,i){return a==_this3.active[i];}))active=this.active;var open=tr.selection||active.some(function(a){return a.hasResult()&&tr.changes.touchesRange(a.from,a.to);})||!sameResults(active,this.active)?CompletionDialog.build(active,state,this.id,this.open,conf):this.open&&tr.docChanged?this.open.map(tr.changes):this.open;if(!open&&active.every(function(a){return a.state!=1;}/* Pending */)&&active.some(function(a){return a.hasResult();}))active=active.map(function(a){return a.hasResult()?new ActiveSource(a.source,0/* Inactive */):a;});var _iterator8=_createForOfIteratorHelper(tr.effects),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var effect=_step8.value;if(effect.is(setSelectedEffect))open=open&&open.setSelected(effect.value,this.id);}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}return active==this.active&&open==this.open?this:new CompletionState(active,this.id,open);}},{key:"tooltip",get:function get(){return this.open?this.open.tooltip:null;}},{key:"attrs",get:function get(){return this.open?this.open.attrs:baseAttrs;}}],[{key:"start",value:function start(){return new CompletionState(none,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null);}}]);return CompletionState;}();function sameResults(a,b){if(a==b)return true;for(var iA=0,iB=0;;){while(iA<a.length&&!a[iA].hasResult){iA++;}while(iB<b.length&&!b[iB].hasResult){iB++;}var endA=iA==a.length,endB=iB==b.length;if(endA||endB)return endA==endB;if(a[iA++].result!=b[iB++].result)return false;}}var baseAttrs={"aria-autocomplete":"list","aria-expanded":"false"};function makeAttrs(id,selected){return{"aria-autocomplete":"list","aria-expanded":"true","aria-activedescendant":id+"-"+selected,"aria-controls":id};}var none=[];function cmpOption(a,b){var dScore=b.match[0]-a.match[0];if(dScore)return dScore;return a.completion.label.localeCompare(b.completion.label);}function getUserEvent(tr){return tr.isUserEvent("input.type")?"input":tr.isUserEvent("delete.backward")?"delete":null;}var ActiveSource=/*#__PURE__*/function(){function ActiveSource(source,state){var explicitPos=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;_classCallCheck(this,ActiveSource);this.source=source;this.state=state;this.explicitPos=explicitPos;}_createClass(ActiveSource,[{key:"hasResult",value:function hasResult(){return false;}},{key:"update",value:function update(tr,conf){var event=getUserEvent(tr),value=this;if(event)value=value.handleUserEvent(tr,event,conf);else if(tr.docChanged)value=value.handleChange(tr);else if(tr.selection&&value.state!=0/* Inactive */)value=new ActiveSource(value.source,0/* Inactive */);var _iterator9=_createForOfIteratorHelper(tr.effects),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var effect=_step9.value;if(effect.is(startCompletionEffect))value=new ActiveSource(value.source,1/* Pending */,effect.value?cur(tr.state):-1);else if(effect.is(closeCompletionEffect))value=new ActiveSource(value.source,0/* Inactive */);else if(effect.is(setActiveEffect)){var _iterator10=_createForOfIteratorHelper(effect.value),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var active=_step10.value;if(active.source==value.source)value=active;}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}}}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}return value;}},{key:"handleUserEvent",value:function handleUserEvent(tr,type,conf){return type=="delete"||!conf.activateOnTyping?this.map(tr.changes):new ActiveSource(this.source,1/* Pending */);}},{key:"handleChange",value:function handleChange(tr){return tr.changes.touchesRange(cur(tr.startState))?new ActiveSource(this.source,0/* Inactive */):this.map(tr.changes);}},{key:"map",value:function map(changes){return changes.empty||this.explicitPos<0?this:new ActiveSource(this.source,this.state,changes.mapPos(this.explicitPos));}}]);return ActiveSource;}();var ActiveResult=/*#__PURE__*/function(_ActiveSource){_inherits(ActiveResult,_ActiveSource);var _super=_createSuper(ActiveResult);function ActiveResult(source,explicitPos,result,from,to,span){var _this4;_classCallCheck(this,ActiveResult);_this4=_super.call(this,source,2/* Result */,explicitPos);_this4.result=result;_this4.from=from;_this4.to=to;_this4.span=span;return _this4;}_createClass(ActiveResult,[{key:"hasResult",value:function hasResult(){return true;}},{key:"handleUserEvent",value:function handleUserEvent(tr,type,conf){var from=tr.changes.mapPos(this.from),to=tr.changes.mapPos(this.to,1);var pos=cur(tr.state);if((this.explicitPos>-1?pos<from:pos<=from)||pos>to)return new ActiveSource(this.source,type=="input"&&conf.activateOnTyping?1/* Pending */:0/* Inactive */);var explicitPos=this.explicitPos<0?-1:tr.changes.mapPos(this.explicitPos);if(this.span&&(from==to||this.span.test(tr.state.sliceDoc(from,to))))return new ActiveResult(this.source,explicitPos,this.result,from,to,this.span);return new ActiveSource(this.source,1/* Pending */,explicitPos);}},{key:"handleChange",value:function handleChange(tr){return tr.changes.touchesRange(this.from,this.to)?new ActiveSource(this.source,0/* Inactive */):this.map(tr.changes);}},{key:"map",value:function map(mapping){return mapping.empty?this:new ActiveResult(this.source,this.explicitPos<0?-1:mapping.mapPos(this.explicitPos),this.result,mapping.mapPos(this.from),mapping.mapPos(this.to,1),this.span);}}]);return ActiveResult;}(ActiveSource);var startCompletionEffect=state.StateEffect.define();var closeCompletionEffect=state.StateEffect.define();var setActiveEffect=state.StateEffect.define({map:function map(sources,mapping){return sources.map(function(s){return s.map(mapping);});}});var setSelectedEffect=state.StateEffect.define();var completionState=state.StateField.define({create:function create(){return CompletionState.start();},update:function update(value,tr){return value.update(tr);},provide:function provide(f){return[tooltip.showTooltip.from(f,function(val){return val.tooltip;}),view.EditorView.contentAttributes.from(f,function(state){return state.attrs;})];}});var CompletionInteractMargin=75;/** 72 + Returns a command that moves the completion selection forward or 73 + backward by the given amount. 74 + */function moveCompletionSelection(forward){var by=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"option";return function(view){var cState=view.state.field(completionState,false);if(!cState||!cState.open||Date.now()-cState.open.timestamp<CompletionInteractMargin)return false;var step=1,tooltip$1;if(by=="page"&&(tooltip$1=tooltip.getTooltip(view,cState.open.tooltip)))step=Math.max(2,Math.floor(tooltip$1.dom.offsetHeight/tooltip$1.dom.querySelector("li").offsetHeight)-1);var selected=cState.open.selected+step*(forward?1:-1),length=cState.open.options.length;if(selected<0)selected=by=="page"?0:length-1;else if(selected>=length)selected=by=="page"?length-1:0;view.dispatch({effects:setSelectedEffect.of(selected)});return true;};}/** 75 + Accept the current completion. 76 + */var acceptCompletion=function acceptCompletion(view){var cState=view.state.field(completionState,false);if(view.state.readOnly||!cState||!cState.open||Date.now()-cState.open.timestamp<CompletionInteractMargin)return false;applyCompletion(view,cState.open.options[cState.open.selected]);return true;};/** 77 + Explicitly start autocompletion. 78 + */var startCompletion=function startCompletion(view){var cState=view.state.field(completionState,false);if(!cState)return false;view.dispatch({effects:startCompletionEffect.of(true)});return true;};/** 79 + Close the currently active completion. 80 + */var closeCompletion=function closeCompletion(view){var cState=view.state.field(completionState,false);if(!cState||!cState.active.some(function(a){return a.state!=0;}/* Inactive */))return false;view.dispatch({effects:closeCompletionEffect.of(null)});return true;};var RunningQuery=/*#__PURE__*/_createClass(function RunningQuery(active,context){_classCallCheck(this,RunningQuery);this.active=active;this.context=context;this.time=Date.now();this.updates=[];// Note that 'undefined' means 'not done yet', whereas 'null' means 81 + // 'query returned null'. 82 + this.done=undefined;});var DebounceTime=50,MaxUpdateCount=50,MinAbortTime=1000;var completionPlugin=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function _class(view){_classCallCheck(this,_class);this.view=view;this.debounceUpdate=-1;this.running=[];this.debounceAccept=-1;this.composing=0/* None */;var _iterator11=_createForOfIteratorHelper(view.state.field(completionState).active),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var active=_step11.value;if(active.state==1/* Pending */)this.startQuery(active);}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}}_createClass(_class,[{key:"update",value:function update(_update2){var _this5=this;var cState=_update2.state.field(completionState);if(!_update2.selectionSet&&!_update2.docChanged&&_update2.startState.field(completionState)==cState)return;var doesReset=_update2.transactions.some(function(tr){return(tr.selection||tr.docChanged)&&!getUserEvent(tr);});for(var i=0;i<this.running.length;i++){var query=this.running[i];if(doesReset||query.updates.length+_update2.transactions.length>MaxUpdateCount&&query.time-Date.now()>MinAbortTime){var _iterator12=_createForOfIteratorHelper(query.context.abortListeners),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var handler=_step12.value;try{handler();}catch(e){view.logException(this.view.state,e);}}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}query.context.abortListeners=null;this.running.splice(i--,1);}else{var _query$updates;(_query$updates=query.updates).push.apply(_query$updates,_toConsumableArray(_update2.transactions));}}if(this.debounceUpdate>-1)clearTimeout(this.debounceUpdate);this.debounceUpdate=cState.active.some(function(a){return a.state==1/* Pending */&&!_this5.running.some(function(q){return q.active.source==a.source;});})?setTimeout(function(){return _this5.startUpdate();},DebounceTime):-1;if(this.composing!=0/* None */){var _iterator13=_createForOfIteratorHelper(_update2.transactions),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var tr=_step13.value;if(getUserEvent(tr)=="input")this.composing=2/* Changed */;else if(this.composing==2/* Changed */&&tr.selection)this.composing=3/* ChangedAndMoved */;}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}}}},{key:"startUpdate",value:function startUpdate(){var _this6=this;this.debounceUpdate=-1;var state=this.view.state,cState=state.field(completionState);var _iterator14=_createForOfIteratorHelper(cState.active),_step14;try{var _loop=function _loop(){var active=_step14.value;if(active.state==1/* Pending */&&!_this6.running.some(function(r){return r.active.source==active.source;}))_this6.startQuery(active);};for(_iterator14.s();!(_step14=_iterator14.n()).done;){_loop();}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}}},{key:"startQuery",value:function startQuery(active){var _this7=this;var state=this.view.state,pos=cur(state);var context=new CompletionContext(state,pos,active.explicitPos==pos);var pending=new RunningQuery(active,context);this.running.push(pending);Promise.resolve(active.source(context)).then(function(result){if(!pending.context.aborted){pending.done=result||null;_this7.scheduleAccept();}},function(err){_this7.view.dispatch({effects:closeCompletionEffect.of(null)});view.logException(_this7.view.state,err);});}},{key:"scheduleAccept",value:function scheduleAccept(){var _this8=this;if(this.running.every(function(q){return q.done!==undefined;}))this.accept();else if(this.debounceAccept<0)this.debounceAccept=setTimeout(function(){return _this8.accept();},DebounceTime);}// For each finished query in this.running, try to create a result 83 + // or, if appropriate, restart the query. 84 + },{key:"accept",value:function accept(){var _this9=this;var _a;if(this.debounceAccept>-1)clearTimeout(this.debounceAccept);this.debounceAccept=-1;var updated=[];var conf=this.view.state.facet(completionConfig);var _loop2=function _loop2(_i3){var query=_this9.running[_i3];if(query.done===undefined){i=_i3;return"continue";}_this9.running.splice(_i3--,1);if(query.done){var active=new ActiveResult(query.active.source,query.active.explicitPos,query.done,query.done.from,(_a=query.done.to)!==null&&_a!==void 0?_a:cur(query.updates.length?query.updates[0].startState:_this9.view.state),query.done.span&&query.done.filter!==false?ensureAnchor(query.done.span,true):null);// Replay the transactions that happened since the start of 85 + // the request and see if that preserves the result 86 + var _iterator15=_createForOfIteratorHelper(query.updates),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var tr=_step15.value;active=active.update(tr,conf);}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}if(active.hasResult()){updated.push(active);i=_i3;return"continue";}}var current=_this9.view.state.field(completionState).active.find(function(a){return a.source==query.active.source;});if(current&&current.state==1/* Pending */){if(query.done==null){// Explicitly failed. Should clear the pending status if it 87 + // hasn't been re-set in the meantime. 88 + var _active=new ActiveSource(query.active.source,0/* Inactive */);var _iterator16=_createForOfIteratorHelper(query.updates),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var _tr=_step16.value;_active=_active.update(_tr,conf);}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}if(_active.state!=1/* Pending */)updated.push(_active);}else{// Cleared by subsequent transactions. Restart. 89 + _this9.startQuery(current);}}i=_i3;};for(var i=0;i<this.running.length;i++){var _ret=_loop2(i);if(_ret==="continue")continue;}if(updated.length)this.view.dispatch({effects:setActiveEffect.of(updated)});}}]);return _class;}(),{eventHandlers:{compositionstart:function compositionstart(){this.composing=1/* Started */;},compositionend:function compositionend(){var _this10=this;if(this.composing==3/* ChangedAndMoved */){// Safari fires compositionend events synchronously, possibly 90 + // from inside an update, so dispatch asynchronously to avoid reentrancy 91 + setTimeout(function(){return _this10.view.dispatch({effects:startCompletionEffect.of(false)});},20);}this.composing=0/* None */;}}});var baseTheme=view.EditorView.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:0.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11\uFE0E'"}// Disable emoji rendering 92 + },".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});var FieldPos=/*#__PURE__*/_createClass(function FieldPos(field,line,from,to){_classCallCheck(this,FieldPos);this.field=field;this.line=line;this.from=from;this.to=to;});var FieldRange=/*#__PURE__*/function(){function FieldRange(field,from,to){_classCallCheck(this,FieldRange);this.field=field;this.from=from;this.to=to;}_createClass(FieldRange,[{key:"map",value:function map(changes){return new FieldRange(this.field,changes.mapPos(this.from,-1),changes.mapPos(this.to,1));}}]);return FieldRange;}();var Snippet=/*#__PURE__*/function(){function Snippet(lines,fieldPositions){_classCallCheck(this,Snippet);this.lines=lines;this.fieldPositions=fieldPositions;}_createClass(Snippet,[{key:"instantiate",value:function instantiate(state,pos){var text=[],lineStart=[pos];var lineObj=state.doc.lineAt(pos),baseIndent=/^\s*/.exec(lineObj.text)[0];var _iterator17=_createForOfIteratorHelper(this.lines),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var line=_step17.value;if(text.length){var indent=baseIndent,tabs=/^\t*/.exec(line)[0].length;for(var _i4=0;_i4<tabs;_i4++){indent+=state.facet(language.indentUnit);}lineStart.push(pos+indent.length-tabs);line=indent+line.slice(tabs);}text.push(line);pos+=line.length+1;}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}var ranges=this.fieldPositions.map(function(pos){return new FieldRange(pos.field,lineStart[pos.line]+pos.from,lineStart[pos.line]+pos.to);});return{text:text,ranges:ranges};}}],[{key:"parse",value:function parse(template){var fields=[];var lines=[],positions=[],m;var _iterator18=_createForOfIteratorHelper(template.split(/\r\n?|\n/)),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var line=_step18.value;while(m=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(line)){var seq=m[1]?+m[1]:null,name=m[2]||m[3]||"",found=-1;for(var _i5=0;_i5<fields.length;_i5++){if(seq!=null?fields[_i5].seq==seq:name?fields[_i5].name==name:false)found=_i5;}if(found<0){var _i6=0;while(_i6<fields.length&&(seq==null||fields[_i6].seq!=null&&fields[_i6].seq<seq)){_i6++;}fields.splice(_i6,0,{seq:seq,name:name});found=_i6;var _iterator19=_createForOfIteratorHelper(positions),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var pos=_step19.value;if(pos.field>=found)pos.field++;}}catch(err){_iterator19.e(err);}finally{_iterator19.f();}}positions.push(new FieldPos(found,lines.length,m.index,m.index+name.length));line=line.slice(0,m.index)+name+line.slice(m.index+m[0].length);}lines.push(line);}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}return new Snippet(lines,positions);}}]);return Snippet;}();var fieldMarker=view.Decoration.widget({widget:new(/*#__PURE__*/function(_view$WidgetType){_inherits(_class2,_view$WidgetType);var _super2=_createSuper(_class2);function _class2(){_classCallCheck(this,_class2);return _super2.apply(this,arguments);}_createClass(_class2,[{key:"toDOM",value:function toDOM(){var span=document.createElement("span");span.className="cm-snippetFieldPosition";return span;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}}]);return _class2;}(view.WidgetType))()});var fieldRange=view.Decoration.mark({"class":"cm-snippetField"});var ActiveSnippet=/*#__PURE__*/function(){function ActiveSnippet(ranges,active){_classCallCheck(this,ActiveSnippet);this.ranges=ranges;this.active=active;this.deco=view.Decoration.set(ranges.map(function(r){return(r.from==r.to?fieldMarker:fieldRange).range(r.from,r.to);}));}_createClass(ActiveSnippet,[{key:"map",value:function map(changes){return new ActiveSnippet(this.ranges.map(function(r){return r.map(changes);}),this.active);}},{key:"selectionInsideField",value:function selectionInsideField(sel){var _this11=this;return sel.ranges.every(function(range){return _this11.ranges.some(function(r){return r.field==_this11.active&&r.from<=range.from&&r.to>=range.to;});});}}]);return ActiveSnippet;}();var setActive=state.StateEffect.define({map:function map(value,changes){return value&&value.map(changes);}});var moveToField=state.StateEffect.define();var snippetState=state.StateField.define({create:function create(){return null;},update:function update(value,tr){var _iterator20=_createForOfIteratorHelper(tr.effects),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var effect=_step20.value;if(effect.is(setActive))return effect.value;if(effect.is(moveToField)&&value)return new ActiveSnippet(value.ranges,effect.value);}}catch(err){_iterator20.e(err);}finally{_iterator20.f();}if(value&&tr.docChanged)value=value.map(tr.changes);if(value&&tr.selection&&!value.selectionInsideField(tr.selection))value=null;return value;},provide:function provide(f){return view.EditorView.decorations.from(f,function(val){return val?val.deco:view.Decoration.none;});}});function fieldSelection(ranges,field){return state.EditorSelection.create(ranges.filter(function(r){return r.field==field;}).map(function(r){return state.EditorSelection.range(r.from,r.to);}));}/** 93 + Convert a snippet template to a function that can apply it. 94 + Snippets are written using syntax like this: 95 + 96 + "for (let ${index} = 0; ${index} < ${end}; ${index}++) {\n\t${}\n}" 97 + 98 + Each `${}` placeholder (you may also use `#{}`) indicates a field 99 + that the user can fill in. Its name, if any, will be the default 100 + content for the field. 101 + 102 + When the snippet is activated by calling the returned function, 103 + the code is inserted at the given position. Newlines in the 104 + template are indented by the indentation of the start line, plus 105 + one [indent unit](https://codemirror.net/6/docs/ref/#language.indentUnit) per tab character after 106 + the newline. 107 + 108 + On activation, (all instances of) the first field are selected. 109 + The user can move between fields with Tab and Shift-Tab as long as 110 + the fields are active. Moving to the last field or moving the 111 + cursor out of the current field deactivates the fields. 112 + 113 + The order of fields defaults to textual order, but you can add 114 + numbers to placeholders (`${1}` or `${1:defaultText}`) to provide 115 + a custom order. 116 + */function snippet(template){var snippet=Snippet.parse(template);return function(editor,_completion,from,to){var _snippet$instantiate=snippet.instantiate(editor.state,from),text=_snippet$instantiate.text,ranges=_snippet$instantiate.ranges;var spec={changes:{from:from,to:to,insert:state.Text.of(text)}};if(ranges.length)spec.selection=fieldSelection(ranges,0);if(ranges.length>1){var active=new ActiveSnippet(ranges,0);var effects=spec.effects=[setActive.of(active)];if(editor.state.field(snippetState,false)===undefined)effects.push(state.StateEffect.appendConfig.of([snippetState,addSnippetKeymap,snippetPointerHandler,baseTheme]));}editor.dispatch(editor.state.update(spec));};}function moveField(dir){return function(_ref3){var state=_ref3.state,dispatch=_ref3.dispatch;var active=state.field(snippetState,false);if(!active||dir<0&&active.active==0)return false;var next=active.active+dir,last=dir>0&&!active.ranges.some(function(r){return r.field==next+dir;});dispatch(state.update({selection:fieldSelection(active.ranges,next),effects:setActive.of(last?null:new ActiveSnippet(active.ranges,next))}));return true;};}/** 117 + A command that clears the active snippet, if any. 118 + */var clearSnippet=function clearSnippet(_ref4){var state=_ref4.state,dispatch=_ref4.dispatch;var active=state.field(snippetState,false);if(!active)return false;dispatch(state.update({effects:setActive.of(null)}));return true;};/** 119 + Move to the next snippet field, if available. 120 + */var nextSnippetField=moveField(1);/** 121 + Move to the previous snippet field, if available. 122 + */var prevSnippetField=moveField(-1);var defaultSnippetKeymap=[{key:"Tab",run:nextSnippetField,shift:prevSnippetField},{key:"Escape",run:clearSnippet}];/** 123 + A facet that can be used to configure the key bindings used by 124 + snippets. The default binds Tab to 125 + [`nextSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.nextSnippetField), Shift-Tab to 126 + [`prevSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.prevSnippetField), and Escape 127 + to [`clearSnippet`](https://codemirror.net/6/docs/ref/#autocomplete.clearSnippet). 128 + */var snippetKeymap=state.Facet.define({combine:function combine(maps){return maps.length?maps[0]:defaultSnippetKeymap;}});var addSnippetKeymap=state.Prec.highest(view.keymap.compute([snippetKeymap],function(state){return state.facet(snippetKeymap);}));/** 129 + Create a completion from a snippet. Returns an object with the 130 + properties from `completion`, plus an `apply` function that 131 + applies the snippet. 132 + */function snippetCompletion(template,completion){return Object.assign(Object.assign({},completion),{apply:snippet(template)});}var snippetPointerHandler=view.EditorView.domEventHandlers({mousedown:function mousedown(event,view){var active=view.state.field(snippetState,false),pos;if(!active||(pos=view.posAtCoords({x:event.clientX,y:event.clientY}))==null)return false;var match=active.ranges.find(function(r){return r.from<=pos&&r.to>=pos;});if(!match||match.field==active.active)return false;view.dispatch({selection:fieldSelection(active.ranges,match.field),effects:setActive.of(active.ranges.some(function(r){return r.field>match.field;})?new ActiveSnippet(active.ranges,match.field):null)});return true;}});function wordRE(wordChars){var escaped=wordChars.replace(/[\\[.+*?(){|^$]/g,"\\$&");try{return new RegExp("[\\p{Alphabetic}\\p{Number}_".concat(escaped,"]+"),"ug");}catch(_a){return new RegExp("[w".concat(escaped,"]"),"g");}}function mapRE(re,f){return new RegExp(f(re.source),re.unicode?"u":"");}var wordCaches=Object.create(null);function wordCache(wordChars){return wordCaches[wordChars]||(wordCaches[wordChars]=new WeakMap());}function storeWords(doc,wordRE,result,seen,ignoreAt){for(var lines=doc.iterLines(),pos=0;!lines.next().done;){var value=lines.value,m=void 0;wordRE.lastIndex=0;while(m=wordRE.exec(value)){if(!seen[m[0]]&&pos+m.index!=ignoreAt){result.push({type:"text",label:m[0]});seen[m[0]]=true;if(result.length>=2000/* MaxList */)return;}}pos+=value.length+1;}}function collectWords(doc,cache,wordRE,to,ignoreAt){var big=doc.length>=1000/* MinCacheLen */;var cached=big&&cache.get(doc);if(cached)return cached;var result=[],seen=Object.create(null);if(doc.children){var pos=0;var _iterator21=_createForOfIteratorHelper(doc.children),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var ch=_step21.value;if(ch.length>=1000/* MinCacheLen */){var _iterator22=_createForOfIteratorHelper(collectWords(ch,cache,wordRE,to-pos,ignoreAt-pos)),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var c=_step22.value;if(!seen[c.label]){seen[c.label]=true;result.push(c);}}}catch(err){_iterator22.e(err);}finally{_iterator22.f();}}else{storeWords(ch,wordRE,result,seen,ignoreAt-pos);}pos+=ch.length+1;}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}}else{storeWords(doc,wordRE,result,seen,ignoreAt);}if(big&&result.length<2000/* MaxList */)cache.set(doc,result);return result;}/** 133 + A completion source that will scan the document for words (using a 134 + [character categorizer](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer)), and 135 + return those as completions. 136 + */var completeAnyWord=function completeAnyWord(context){var wordChars=context.state.languageDataAt("wordChars",context.pos).join("");var re=wordRE(wordChars);var token=context.matchBefore(mapRE(re,function(s){return s+"$";}));if(!token&&!context.explicit)return null;var from=token?token.from:context.pos;var options=collectWords(context.state.doc,wordCache(wordChars),re,50000/* Range */,from);return{from:from,options:options,span:mapRE(re,function(s){return"^"+s;})};};/** 137 + Returns an extension that enables autocompletion. 138 + */function autocompletion(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[completionState,completionConfig.of(config),completionPlugin,completionKeymapExt,baseTheme];}/** 139 + Basic keybindings for autocompletion. 140 + 141 + - Ctrl-Space: [`startCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.startCompletion) 142 + - Escape: [`closeCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.closeCompletion) 143 + - ArrowDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true)` 144 + - ArrowUp: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(false)` 145 + - PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, "page")` 146 + - PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, "page")` 147 + - Enter: [`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion) 148 + */var completionKeymap=[{key:"Ctrl-Space",run:startCompletion},{key:"Escape",run:closeCompletion},{key:"ArrowDown",run:moveCompletionSelection(true)},{key:"ArrowUp",run:moveCompletionSelection(false)},{key:"PageDown",run:moveCompletionSelection(true,"page")},{key:"PageUp",run:moveCompletionSelection(false,"page")},{key:"Enter",run:acceptCompletion}];var completionKeymapExt=state.Prec.highest(view.keymap.computeN([completionConfig],function(state){return state.facet(completionConfig).defaultKeymap?[completionKeymap]:[];}));/** 149 + Get the current completion status. When completions are available, 150 + this will return `"active"`. When completions are pending (in the 151 + process of being queried), this returns `"pending"`. Otherwise, it 152 + returns `null`. 153 + */function completionStatus(state){var cState=state.field(completionState,false);return cState&&cState.active.some(function(a){return a.state==1;}/* Pending */)?"pending":cState&&cState.active.some(function(a){return a.state!=0;}/* Inactive */)?"active":null;}/** 154 + Returns the available completions as an array. 155 + */function currentCompletions(state){var _a;var open=(_a=state.field(completionState,false))===null||_a===void 0?void 0:_a.open;return open?open.options.map(function(o){return o.completion;}):[];}/** 156 + Return the currently selected completion, if any. 157 + */function selectedCompletion(state){var _a;var open=(_a=state.field(completionState,false))===null||_a===void 0?void 0:_a.open;return open?open.options[open.selected].completion:null;}exports.CompletionContext=CompletionContext;exports.acceptCompletion=acceptCompletion;exports.autocompletion=autocompletion;exports.clearSnippet=clearSnippet;exports.closeCompletion=closeCompletion;exports.completeAnyWord=completeAnyWord;exports.completeFromList=completeFromList;exports.completionKeymap=completionKeymap;exports.completionStatus=completionStatus;exports.currentCompletions=currentCompletions;exports.ifIn=ifIn;exports.ifNotIn=ifNotIn;exports.moveCompletionSelection=moveCompletionSelection;exports.nextSnippetField=nextSnippetField;exports.pickedCompletion=pickedCompletion;exports.prevSnippetField=prevSnippetField;exports.selectedCompletion=selectedCompletion;exports.snippet=snippet;exports.snippetCompletion=snippetCompletion;exports.snippetKeymap=snippetKeymap;exports.startCompletion=startCompletion;},{"@codemirror/language":13,"@codemirror/state":22,"@codemirror/text":24,"@codemirror/tooltip":26,"@codemirror/view":27}],2:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var view=require('@codemirror/view');var state=require('@codemirror/state');var history=require('@codemirror/history');var fold=require('@codemirror/fold');var language=require('@codemirror/language');var gutter=require('@codemirror/gutter');var commands=require('@codemirror/commands');var matchbrackets=require('@codemirror/matchbrackets');var closebrackets=require('@codemirror/closebrackets');var search=require('@codemirror/search');var autocomplete=require('@codemirror/autocomplete');var comment=require('@codemirror/comment');var rectangularSelection=require('@codemirror/rectangular-selection');var highlight=require('@codemirror/highlight');var lint=require('@codemirror/lint');/** 158 + This is an extension value that just pulls together a whole lot of 159 + extensions that you might want in a basic editor. It is meant as a 160 + convenient helper to quickly set up CodeMirror without installing 161 + and importing a lot of packages. 162 + 163 + Specifically, it includes... 164 + 165 + - [the default command bindings](https://codemirror.net/6/docs/ref/#commands.defaultKeymap) 166 + - [line numbers](https://codemirror.net/6/docs/ref/#gutter.lineNumbers) 167 + - [special character highlighting](https://codemirror.net/6/docs/ref/#view.highlightSpecialChars) 168 + - [the undo history](https://codemirror.net/6/docs/ref/#history.history) 169 + - [a fold gutter](https://codemirror.net/6/docs/ref/#fold.foldGutter) 170 + - [custom selection drawing](https://codemirror.net/6/docs/ref/#view.drawSelection) 171 + - [multiple selections](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections) 172 + - [reindentation on input](https://codemirror.net/6/docs/ref/#language.indentOnInput) 173 + - [the default highlight style](https://codemirror.net/6/docs/ref/#highlight.defaultHighlightStyle) (as fallback) 174 + - [bracket matching](https://codemirror.net/6/docs/ref/#matchbrackets.bracketMatching) 175 + - [bracket closing](https://codemirror.net/6/docs/ref/#closebrackets.closeBrackets) 176 + - [autocompletion](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion) 177 + - [rectangular selection](https://codemirror.net/6/docs/ref/#rectangular-selection.rectangularSelection) 178 + - [active line highlighting](https://codemirror.net/6/docs/ref/#view.highlightActiveLine) 179 + - [active line gutter highlighting](https://codemirror.net/6/docs/ref/#gutter.highlightActiveLineGutter) 180 + - [selection match highlighting](https://codemirror.net/6/docs/ref/#search.highlightSelectionMatches) 181 + - [search](https://codemirror.net/6/docs/ref/#search.searchKeymap) 182 + - [commenting](https://codemirror.net/6/docs/ref/#comment.commentKeymap) 183 + - [linting](https://codemirror.net/6/docs/ref/#lint.lintKeymap) 184 + 185 + (You'll probably want to add some language package to your setup 186 + too.) 187 + 188 + This package does not allow customization. The idea is that, once 189 + you decide you want to configure your editor more precisely, you 190 + take this package's source (which is just a bunch of imports and 191 + an array literal), copy it into your own code, and adjust it as 192 + desired. 193 + */var basicSetup=[gutter.lineNumbers(),gutter.highlightActiveLineGutter(),view.highlightSpecialChars(),history.history(),fold.foldGutter(),view.drawSelection(),state.EditorState.allowMultipleSelections.of(true),language.indentOnInput(),highlight.defaultHighlightStyle.fallback,matchbrackets.bracketMatching(),closebrackets.closeBrackets(),autocomplete.autocompletion(),rectangularSelection.rectangularSelection(),view.highlightActiveLine(),search.highlightSelectionMatches(),view.keymap.of([].concat(_toConsumableArray(closebrackets.closeBracketsKeymap),_toConsumableArray(commands.defaultKeymap),_toConsumableArray(search.searchKeymap),_toConsumableArray(history.historyKeymap),_toConsumableArray(fold.foldKeymap),_toConsumableArray(comment.commentKeymap),_toConsumableArray(autocomplete.completionKeymap),_toConsumableArray(lint.lintKeymap)))];Object.defineProperty(exports,'EditorView',{enumerable:true,get:function get(){return view.EditorView;}});Object.defineProperty(exports,'EditorState',{enumerable:true,get:function get(){return state.EditorState;}});exports.basicSetup=basicSetup;},{"@codemirror/autocomplete":1,"@codemirror/closebrackets":3,"@codemirror/commands":4,"@codemirror/comment":6,"@codemirror/fold":7,"@codemirror/gutter":9,"@codemirror/highlight":11,"@codemirror/history":12,"@codemirror/language":13,"@codemirror/lint":15,"@codemirror/matchbrackets":16,"@codemirror/rectangular-selection":19,"@codemirror/search":20,"@codemirror/state":22,"@codemirror/view":27}],3:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var view=require('@codemirror/view');var state=require('@codemirror/state');var rangeset=require('@codemirror/rangeset');var text=require('@codemirror/text');var language=require('@codemirror/language');var defaults={brackets:["(","[","{","'",'"'],before:")]}'\":;>"};var closeBracketEffect=state.StateEffect.define({map:function map(value,mapping){var mapped=mapping.mapPos(value,-1,state.MapMode.TrackAfter);return mapped==null?undefined:mapped;}});var skipBracketEffect=state.StateEffect.define({map:function map(value,mapping){return mapping.mapPos(value);}});var closedBracket=new(/*#__PURE__*/function(_rangeset$RangeValue){_inherits(_class3,_rangeset$RangeValue);var _super3=_createSuper(_class3);function _class3(){_classCallCheck(this,_class3);return _super3.apply(this,arguments);}return _createClass(_class3);}(rangeset.RangeValue))();closedBracket.startSide=1;closedBracket.endSide=-1;var bracketState=state.StateField.define({create:function create(){return rangeset.RangeSet.empty;},update:function update(value,tr){if(tr.selection){var lineStart=tr.state.doc.lineAt(tr.selection.main.head).from;var prevLineStart=tr.startState.doc.lineAt(tr.startState.selection.main.head).from;if(lineStart!=tr.changes.mapPos(prevLineStart,-1))value=rangeset.RangeSet.empty;}value=value.map(tr.changes);var _iterator23=_createForOfIteratorHelper(tr.effects),_step23;try{var _loop3=function _loop3(){var effect=_step23.value;if(effect.is(closeBracketEffect))value=value.update({add:[closedBracket.range(effect.value,effect.value+1)]});else if(effect.is(skipBracketEffect))value=value.update({filter:function filter(from){return from!=effect.value;}});};for(_iterator23.s();!(_step23=_iterator23.n()).done;){_loop3();}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return value;}});/** 194 + Extension to enable bracket-closing behavior. When a closeable 195 + bracket is typed, its closing bracket is immediately inserted 196 + after the cursor. When closing a bracket directly in front of a 197 + closing bracket inserted by the extension, the cursor moves over 198 + that bracket. 199 + */function closeBrackets(){return[view.EditorView.inputHandler.of(handleInput),bracketState];}var definedClosing="()[]{}<>";function closing(ch){for(var _i7=0;_i7<definedClosing.length;_i7+=2){if(definedClosing.charCodeAt(_i7)==ch)return definedClosing.charAt(_i7+1);}return text.fromCodePoint(ch<128?ch:ch+1);}function config(state,pos){return state.languageDataAt("closeBrackets",pos)[0]||defaults;}function handleInput(view,from,to,insert){if(view.composing)return false;var sel=view.state.selection.main;if(insert.length>2||insert.length==2&&text.codePointSize(text.codePointAt(insert,0))==1||from!=sel.from||to!=sel.to)return false;var tr=insertBracket(view.state,insert);if(!tr)return false;view.dispatch(tr);return true;}/** 200 + Command that implements deleting a pair of matching brackets when 201 + the cursor is between them. 202 + */var deleteBracketPair=function deleteBracketPair(_ref5){var state$1=_ref5.state,dispatch=_ref5.dispatch;var conf=config(state$1,state$1.selection.main.head);var tokens=conf.brackets||defaults.brackets;var dont=null,changes=state$1.changeByRange(function(range){if(range.empty){var before=prevChar(state$1.doc,range.head);var _iterator24=_createForOfIteratorHelper(tokens),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var token=_step24.value;if(token==before&&nextChar(state$1.doc,range.head)==closing(text.codePointAt(token,0)))return{changes:{from:range.head-token.length,to:range.head+token.length},range:state.EditorSelection.cursor(range.head-token.length),userEvent:"delete.backward"};}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}}return{range:dont=range};});if(!dont)dispatch(state$1.update(changes,{scrollIntoView:true}));return!dont;};/** 203 + Close-brackets related key bindings. Binds Backspace to 204 + [`deleteBracketPair`](https://codemirror.net/6/docs/ref/#closebrackets.deleteBracketPair). 205 + */var closeBracketsKeymap=[{key:"Backspace",run:deleteBracketPair}];/** 206 + Implements the extension's behavior on text insertion. If the 207 + given string counts as a bracket in the language around the 208 + selection, and replacing the selection with it requires custom 209 + behavior (inserting a closing version or skipping past a 210 + previously-closed bracket), this function returns a transaction 211 + representing that custom behavior. (You only need this if you want 212 + to programmatically insert brackets—the 213 + [`closeBrackets`](https://codemirror.net/6/docs/ref/#closebrackets.closeBrackets) extension will 214 + take care of running this for user input.) 215 + */function insertBracket(state,bracket){var conf=config(state,state.selection.main.head);var tokens=conf.brackets||defaults.brackets;var _iterator25=_createForOfIteratorHelper(tokens),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var tok=_step25.value;var closed=closing(text.codePointAt(tok,0));if(bracket==tok)return closed==tok?handleSame(state,tok,tokens.indexOf(tok+tok+tok)>-1):handleOpen(state,tok,closed,conf.before||defaults.before);if(bracket==closed&&closedBracketAt(state,state.selection.main.from))return handleClose(state,tok,closed);}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}return null;}function closedBracketAt(state,pos){var found=false;state.field(bracketState).between(0,state.doc.length,function(from){if(from==pos)found=true;});return found;}function nextChar(doc,pos){var next=doc.sliceString(pos,pos+2);return next.slice(0,text.codePointSize(text.codePointAt(next,0)));}function prevChar(doc,pos){var prev=doc.sliceString(pos-2,pos);return text.codePointSize(text.codePointAt(prev,0))==prev.length?prev:prev.slice(1);}function handleOpen(state$1,open,close,closeBefore){var dont=null,changes=state$1.changeByRange(function(range){if(!range.empty)return{changes:[{insert:open,from:range.from},{insert:close,from:range.to}],effects:closeBracketEffect.of(range.to+open.length),range:state.EditorSelection.range(range.anchor+open.length,range.head+open.length)};var next=nextChar(state$1.doc,range.head);if(!next||/\s/.test(next)||closeBefore.indexOf(next)>-1)return{changes:{insert:open+close,from:range.head},effects:closeBracketEffect.of(range.head+open.length),range:state.EditorSelection.cursor(range.head+open.length)};return{range:dont=range};});return dont?null:state$1.update(changes,{scrollIntoView:true,userEvent:"input.type"});}function handleClose(state$1,_open,close){var dont=null,moved=state$1.selection.ranges.map(function(range){if(range.empty&&nextChar(state$1.doc,range.head)==close)return state.EditorSelection.cursor(range.head+close.length);return dont=range;});return dont?null:state$1.update({selection:state.EditorSelection.create(moved,state$1.selection.mainIndex),scrollIntoView:true,effects:state$1.selection.ranges.map(function(_ref6){var from=_ref6.from;return skipBracketEffect.of(from);})});}// Handles cases where the open and close token are the same, and 216 + // possibly triple quotes (as in `"""abc"""`-style quoting). 217 + function handleSame(state$1,token,allowTriple){var dont=null,changes=state$1.changeByRange(function(range){if(!range.empty)return{changes:[{insert:token,from:range.from},{insert:token,from:range.to}],effects:closeBracketEffect.of(range.to+token.length),range:state.EditorSelection.range(range.anchor+token.length,range.head+token.length)};var pos=range.head,next=nextChar(state$1.doc,pos);if(next==token){if(nodeStart(state$1,pos)){return{changes:{insert:token+token,from:pos},effects:closeBracketEffect.of(pos+token.length),range:state.EditorSelection.cursor(pos+token.length)};}else if(closedBracketAt(state$1,pos)){var isTriple=allowTriple&&state$1.sliceDoc(pos,pos+token.length*3)==token+token+token;return{range:state.EditorSelection.cursor(pos+token.length*(isTriple?3:1)),effects:skipBracketEffect.of(pos)};}}else if(allowTriple&&state$1.sliceDoc(pos-2*token.length,pos)==token+token&&nodeStart(state$1,pos-2*token.length)){return{changes:{insert:token+token+token+token,from:pos},effects:closeBracketEffect.of(pos+token.length),range:state.EditorSelection.cursor(pos+token.length)};}else if(state$1.charCategorizer(pos)(next)!=state.CharCategory.Word){var prev=state$1.sliceDoc(pos-1,pos);if(prev!=token&&state$1.charCategorizer(pos)(prev)!=state.CharCategory.Word)return{changes:{insert:token+token,from:pos},effects:closeBracketEffect.of(pos+token.length),range:state.EditorSelection.cursor(pos+token.length)};}return{range:dont=range};});return dont?null:state$1.update(changes,{scrollIntoView:true,userEvent:"input.type"});}function nodeStart(state,pos){var tree=language.syntaxTree(state).resolveInner(pos+1);return tree.parent&&tree.from==pos;}exports.closeBrackets=closeBrackets;exports.closeBracketsKeymap=closeBracketsKeymap;exports.deleteBracketPair=deleteBracketPair;exports.insertBracket=insertBracket;},{"@codemirror/language":13,"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/text":24,"@codemirror/view":27}],4:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');var text=require('@codemirror/text');var view=require('@codemirror/view');var matchbrackets=require('@codemirror/matchbrackets');var language=require('@codemirror/language');var common=require('@lezer/common');function updateSel(sel,by){return state.EditorSelection.create(sel.ranges.map(by),sel.mainIndex);}function setSel(state,selection){return state.update({selection:selection,scrollIntoView:true,userEvent:"select"});}function moveSel(_ref7,how){var state=_ref7.state,dispatch=_ref7.dispatch;var selection=updateSel(state.selection,how);if(selection.eq(state.selection))return false;dispatch(setSel(state,selection));return true;}function rangeEnd(range,forward){return state.EditorSelection.cursor(forward?range.to:range.from);}function cursorByChar(view,forward){return moveSel(view,function(range){return range.empty?view.moveByChar(range,forward):rangeEnd(range,forward);});}/** 218 + Move the selection one character to the left (which is backward in 219 + left-to-right text, forward in right-to-left text). 220 + */var cursorCharLeft=function cursorCharLeft(view$1){return cursorByChar(view$1,view$1.textDirection!=view.Direction.LTR);};/** 221 + Move the selection one character to the right. 222 + */var cursorCharRight=function cursorCharRight(view$1){return cursorByChar(view$1,view$1.textDirection==view.Direction.LTR);};/** 223 + Move the selection one character forward. 224 + */var cursorCharForward=function cursorCharForward(view){return cursorByChar(view,true);};/** 225 + Move the selection one character backward. 226 + */var cursorCharBackward=function cursorCharBackward(view){return cursorByChar(view,false);};function cursorByGroup(view,forward){return moveSel(view,function(range){return range.empty?view.moveByGroup(range,forward):rangeEnd(range,forward);});}/** 227 + Move the selection to the left across one group of word or 228 + non-word (but also non-space) characters. 229 + */var cursorGroupLeft=function cursorGroupLeft(view$1){return cursorByGroup(view$1,view$1.textDirection!=view.Direction.LTR);};/** 230 + Move the selection one group to the right. 231 + */var cursorGroupRight=function cursorGroupRight(view$1){return cursorByGroup(view$1,view$1.textDirection==view.Direction.LTR);};/** 232 + Move the selection one group forward. 233 + */var cursorGroupForward=function cursorGroupForward(view){return cursorByGroup(view,true);};/** 234 + Move the selection one group backward. 235 + */var cursorGroupBackward=function cursorGroupBackward(view){return cursorByGroup(view,false);};function moveBySubword(view,range,forward){var categorize=view.state.charCategorizer(range.from);return view.moveByChar(range,forward,function(start){var cat=state.CharCategory.Space,pos=range.from;var done=false,sawUpper=false,sawLower=false;var step=function step(next){if(done)return false;pos+=forward?next.length:-next.length;var nextCat=categorize(next),ahead;if(cat==state.CharCategory.Space)cat=nextCat;if(cat!=nextCat)return false;if(cat==state.CharCategory.Word){if(next.toLowerCase()==next){if(!forward&&sawUpper)return false;sawLower=true;}else if(sawLower){if(forward)return false;done=true;}else{if(sawUpper&&forward&&categorize(ahead=view.state.sliceDoc(pos,pos+1))==state.CharCategory.Word&&ahead.toLowerCase()==ahead)return false;sawUpper=true;}}return true;};step(start);return step;});}function cursorBySubword(view,forward){return moveSel(view,function(range){return range.empty?moveBySubword(view,range,forward):rangeEnd(range,forward);});}/** 236 + Move the selection one group or camel-case subword forward. 237 + */var cursorSubwordForward=function cursorSubwordForward(view){return cursorBySubword(view,true);};/** 238 + Move the selection one group or camel-case subword backward. 239 + */var cursorSubwordBackward=function cursorSubwordBackward(view){return cursorBySubword(view,false);};function interestingNode(state,node,bracketProp){if(node.type.prop(bracketProp))return true;var len=node.to-node.from;return len&&(len>2||/[^\s,.;:]/.test(state.sliceDoc(node.from,node.to)))||node.firstChild;}function moveBySyntax(state$1,start,forward){var pos=language.syntaxTree(state$1).resolveInner(start.head);var bracketProp=forward?common.NodeProp.closedBy:common.NodeProp.openedBy;// Scan forward through child nodes to see if there's an interesting 240 + // node ahead. 241 + for(var at=start.head;;){var next=forward?pos.childAfter(at):pos.childBefore(at);if(!next)break;if(interestingNode(state$1,next,bracketProp))pos=next;else at=forward?next.to:next.from;}var bracket=pos.type.prop(bracketProp),match,newPos;if(bracket&&(match=forward?matchbrackets.matchBrackets(state$1,pos.from,1):matchbrackets.matchBrackets(state$1,pos.to,-1))&&match.matched)newPos=forward?match.end.to:match.end.from;else newPos=forward?pos.to:pos.from;return state.EditorSelection.cursor(newPos,forward?-1:1);}/** 242 + Move the cursor over the next syntactic element to the left. 243 + */var cursorSyntaxLeft=function cursorSyntaxLeft(view$1){return moveSel(view$1,function(range){return moveBySyntax(view$1.state,range,view$1.textDirection!=view.Direction.LTR);});};/** 244 + Move the cursor over the next syntactic element to the right. 245 + */var cursorSyntaxRight=function cursorSyntaxRight(view$1){return moveSel(view$1,function(range){return moveBySyntax(view$1.state,range,view$1.textDirection==view.Direction.LTR);});};function cursorByLine(view,forward){return moveSel(view,function(range){if(!range.empty)return rangeEnd(range,forward);var moved=view.moveVertically(range,forward);return moved.head!=range.head?moved:view.moveToLineBoundary(range,forward);});}/** 246 + Move the selection one line up. 247 + */var cursorLineUp=function cursorLineUp(view){return cursorByLine(view,false);};/** 248 + Move the selection one line down. 249 + */var cursorLineDown=function cursorLineDown(view){return cursorByLine(view,true);};function cursorByPage(view$1,forward){var state=view$1.state,selection=updateSel(state.selection,function(range){return range.empty?view$1.moveVertically(range,forward,view$1.dom.clientHeight):rangeEnd(range,forward);});if(selection.eq(state.selection))return false;var startPos=view$1.coordsAtPos(state.selection.main.head);var scrollRect=view$1.scrollDOM.getBoundingClientRect();view$1.dispatch(setSel(state,selection),{effects:startPos&&startPos.top>scrollRect.top&&startPos.bottom<scrollRect.bottom?view.EditorView.scrollIntoView(selection.main.head,{y:"start",yMargin:startPos.top-scrollRect.top}):undefined});return true;}/** 250 + Move the selection one page up. 251 + */var cursorPageUp=function cursorPageUp(view){return cursorByPage(view,false);};/** 252 + Move the selection one page down. 253 + */var cursorPageDown=function cursorPageDown(view){return cursorByPage(view,true);};function moveByLineBoundary(view,start,forward){var line=view.lineBlockAt(start.head),moved=view.moveToLineBoundary(start,forward);if(moved.head==start.head&&moved.head!=(forward?line.to:line.from))moved=view.moveToLineBoundary(start,forward,false);if(!forward&&moved.head==line.from&&line.length){var space=/^\s*/.exec(view.state.sliceDoc(line.from,Math.min(line.from+100,line.to)))[0].length;if(space&&start.head!=line.from+space)moved=state.EditorSelection.cursor(line.from+space);}return moved;}/** 254 + Move the selection to the next line wrap point, or to the end of 255 + the line if there isn't one left on this line. 256 + */var cursorLineBoundaryForward=function cursorLineBoundaryForward(view){return moveSel(view,function(range){return moveByLineBoundary(view,range,true);});};/** 257 + Move the selection to previous line wrap point, or failing that to 258 + the start of the line. If the line is indented, and the cursor 259 + isn't already at the end of the indentation, this will move to the 260 + end of the indentation instead of the start of the line. 261 + */var cursorLineBoundaryBackward=function cursorLineBoundaryBackward(view){return moveSel(view,function(range){return moveByLineBoundary(view,range,false);});};/** 262 + Move the selection to the start of the line. 263 + */var cursorLineStart=function cursorLineStart(view){return moveSel(view,function(range){return state.EditorSelection.cursor(view.lineBlockAt(range.head).from,1);});};/** 264 + Move the selection to the end of the line. 265 + */var cursorLineEnd=function cursorLineEnd(view){return moveSel(view,function(range){return state.EditorSelection.cursor(view.lineBlockAt(range.head).to,-1);});};function toMatchingBracket(state$1,dispatch,extend){var found=false,selection=updateSel(state$1.selection,function(range){var matching=matchbrackets.matchBrackets(state$1,range.head,-1)||matchbrackets.matchBrackets(state$1,range.head,1)||range.head>0&&matchbrackets.matchBrackets(state$1,range.head-1,1)||range.head<state$1.doc.length&&matchbrackets.matchBrackets(state$1,range.head+1,-1);if(!matching||!matching.end)return range;found=true;var head=matching.start.from==range.head?matching.end.to:matching.end.from;return extend?state.EditorSelection.range(range.anchor,head):state.EditorSelection.cursor(head);});if(!found)return false;dispatch(setSel(state$1,selection));return true;}/** 266 + Move the selection to the bracket matching the one it is currently 267 + on, if any. 268 + */var cursorMatchingBracket=function cursorMatchingBracket(_ref8){var state=_ref8.state,dispatch=_ref8.dispatch;return toMatchingBracket(state,dispatch,false);};/** 269 + Extend the selection to the bracket matching the one the selection 270 + head is currently on, if any. 271 + */var selectMatchingBracket=function selectMatchingBracket(_ref9){var state=_ref9.state,dispatch=_ref9.dispatch;return toMatchingBracket(state,dispatch,true);};function extendSel(view,how){var selection=updateSel(view.state.selection,function(range){var head=how(range);return state.EditorSelection.range(range.anchor,head.head,head.goalColumn);});if(selection.eq(view.state.selection))return false;view.dispatch(setSel(view.state,selection));return true;}function selectByChar(view,forward){return extendSel(view,function(range){return view.moveByChar(range,forward);});}/** 272 + Move the selection head one character to the left, while leaving 273 + the anchor in place. 274 + */var selectCharLeft=function selectCharLeft(view$1){return selectByChar(view$1,view$1.textDirection!=view.Direction.LTR);};/** 275 + Move the selection head one character to the right. 276 + */var selectCharRight=function selectCharRight(view$1){return selectByChar(view$1,view$1.textDirection==view.Direction.LTR);};/** 277 + Move the selection head one character forward. 278 + */var selectCharForward=function selectCharForward(view){return selectByChar(view,true);};/** 279 + Move the selection head one character backward. 280 + */var selectCharBackward=function selectCharBackward(view){return selectByChar(view,false);};function selectByGroup(view,forward){return extendSel(view,function(range){return view.moveByGroup(range,forward);});}/** 281 + Move the selection head one [group](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) to 282 + the left. 283 + */var selectGroupLeft=function selectGroupLeft(view$1){return selectByGroup(view$1,view$1.textDirection!=view.Direction.LTR);};/** 284 + Move the selection head one group to the right. 285 + */var selectGroupRight=function selectGroupRight(view$1){return selectByGroup(view$1,view$1.textDirection==view.Direction.LTR);};/** 286 + Move the selection head one group forward. 287 + */var selectGroupForward=function selectGroupForward(view){return selectByGroup(view,true);};/** 288 + Move the selection head one group backward. 289 + */var selectGroupBackward=function selectGroupBackward(view){return selectByGroup(view,false);};function selectBySubword(view,forward){return extendSel(view,function(range){return moveBySubword(view,range,forward);});}/** 290 + Move the selection head one group or camel-case subword forward. 291 + */var selectSubwordForward=function selectSubwordForward(view){return selectBySubword(view,true);};/** 292 + Move the selection head one group or subword backward. 293 + */var selectSubwordBackward=function selectSubwordBackward(view){return selectBySubword(view,false);};/** 294 + Move the selection head over the next syntactic element to the left. 295 + */var selectSyntaxLeft=function selectSyntaxLeft(view$1){return extendSel(view$1,function(range){return moveBySyntax(view$1.state,range,view$1.textDirection!=view.Direction.LTR);});};/** 296 + Move the selection head over the next syntactic element to the right. 297 + */var selectSyntaxRight=function selectSyntaxRight(view$1){return extendSel(view$1,function(range){return moveBySyntax(view$1.state,range,view$1.textDirection==view.Direction.LTR);});};function selectByLine(view,forward){return extendSel(view,function(range){return view.moveVertically(range,forward);});}/** 298 + Move the selection head one line up. 299 + */var selectLineUp=function selectLineUp(view){return selectByLine(view,false);};/** 300 + Move the selection head one line down. 301 + */var selectLineDown=function selectLineDown(view){return selectByLine(view,true);};function selectByPage(view,forward){return extendSel(view,function(range){return view.moveVertically(range,forward,view.dom.clientHeight);});}/** 302 + Move the selection head one page up. 303 + */var selectPageUp=function selectPageUp(view){return selectByPage(view,false);};/** 304 + Move the selection head one page down. 305 + */var selectPageDown=function selectPageDown(view){return selectByPage(view,true);};/** 306 + Move the selection head to the next line boundary. 307 + */var selectLineBoundaryForward=function selectLineBoundaryForward(view){return extendSel(view,function(range){return moveByLineBoundary(view,range,true);});};/** 308 + Move the selection head to the previous line boundary. 309 + */var selectLineBoundaryBackward=function selectLineBoundaryBackward(view){return extendSel(view,function(range){return moveByLineBoundary(view,range,false);});};/** 310 + Move the selection head to the start of the line. 311 + */var selectLineStart=function selectLineStart(view){return extendSel(view,function(range){return state.EditorSelection.cursor(view.lineBlockAt(range.head).from);});};/** 312 + Move the selection head to the end of the line. 313 + */var selectLineEnd=function selectLineEnd(view){return extendSel(view,function(range){return state.EditorSelection.cursor(view.lineBlockAt(range.head).to);});};/** 314 + Move the selection to the start of the document. 315 + */var cursorDocStart=function cursorDocStart(_ref10){var state=_ref10.state,dispatch=_ref10.dispatch;dispatch(setSel(state,{anchor:0}));return true;};/** 316 + Move the selection to the end of the document. 317 + */var cursorDocEnd=function cursorDocEnd(_ref11){var state=_ref11.state,dispatch=_ref11.dispatch;dispatch(setSel(state,{anchor:state.doc.length}));return true;};/** 318 + Move the selection head to the start of the document. 319 + */var selectDocStart=function selectDocStart(_ref12){var state=_ref12.state,dispatch=_ref12.dispatch;dispatch(setSel(state,{anchor:state.selection.main.anchor,head:0}));return true;};/** 320 + Move the selection head to the end of the document. 321 + */var selectDocEnd=function selectDocEnd(_ref13){var state=_ref13.state,dispatch=_ref13.dispatch;dispatch(setSel(state,{anchor:state.selection.main.anchor,head:state.doc.length}));return true;};/** 322 + Select the entire document. 323 + */var selectAll=function selectAll(_ref14){var state=_ref14.state,dispatch=_ref14.dispatch;dispatch(state.update({selection:{anchor:0,head:state.doc.length},userEvent:"select"}));return true;};/** 324 + Expand the selection to cover entire lines. 325 + */var selectLine=function selectLine(_ref15){var state$1=_ref15.state,dispatch=_ref15.dispatch;var ranges=selectedLineBlocks(state$1).map(function(_ref16){var from=_ref16.from,to=_ref16.to;return state.EditorSelection.range(from,Math.min(to+1,state$1.doc.length));});dispatch(state$1.update({selection:state.EditorSelection.create(ranges),userEvent:"select"}));return true;};/** 326 + Select the next syntactic construct that is larger than the 327 + selection. Note that this will only work insofar as the language 328 + [provider](https://codemirror.net/6/docs/ref/#language.language) you use builds up a full 329 + syntax tree. 330 + */var selectParentSyntax=function selectParentSyntax(_ref17){var state$1=_ref17.state,dispatch=_ref17.dispatch;var selection=updateSel(state$1.selection,function(range){var _a;var context=language.syntaxTree(state$1).resolveInner(range.head,1);while(!(context.from<range.from&&context.to>=range.to||context.to>range.to&&context.from<=range.from||!((_a=context.parent)===null||_a===void 0?void 0:_a.parent))){context=context.parent;}return state.EditorSelection.range(context.to,context.from);});dispatch(setSel(state$1,selection));return true;};/** 331 + Simplify the current selection. When multiple ranges are selected, 332 + reduce it to its main range. Otherwise, if the selection is 333 + non-empty, convert it to a cursor selection. 334 + */var simplifySelection=function simplifySelection(_ref18){var state$1=_ref18.state,dispatch=_ref18.dispatch;var cur=state$1.selection,selection=null;if(cur.ranges.length>1)selection=state.EditorSelection.create([cur.main]);else if(!cur.main.empty)selection=state.EditorSelection.create([state.EditorSelection.cursor(cur.main.head)]);if(!selection)return false;dispatch(setSel(state$1,selection));return true;};function deleteBy(_ref19,by){var state$1=_ref19.state,dispatch=_ref19.dispatch;if(state$1.readOnly)return false;var event="delete.selection";var changes=state$1.changeByRange(function(range){var from=range.from,to=range.to;if(from==to){var towards=by(from);if(towards<from)event="delete.backward";else if(towards>from)event="delete.forward";from=Math.min(from,towards);to=Math.max(to,towards);}return from==to?{range:range}:{changes:{from:from,to:to},range:state.EditorSelection.cursor(from)};});if(changes.changes.empty)return false;dispatch(state$1.update(changes,{scrollIntoView:true,userEvent:event}));return true;}function skipAtomic(target,pos,forward){if(target instanceof view.EditorView){var _iterator26=_createForOfIteratorHelper(target.pluginField(view.PluginField.atomicRanges)),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var ranges=_step26.value;ranges.between(pos,pos,function(from,to){if(from<pos&&to>pos)pos=forward?to:from;});}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}}return pos;}var deleteByChar=function deleteByChar(target,forward){return deleteBy(target,function(pos){var state=target.state,line=state.doc.lineAt(pos),before,targetPos;if(!forward&&pos>line.from&&pos<line.from+200&&!/[^ \t]/.test(before=line.text.slice(0,pos-line.from))){if(before[before.length-1]=="\t")return pos-1;var col=text.countColumn(before,state.tabSize),drop=col%language.getIndentUnit(state)||language.getIndentUnit(state);for(var _i8=0;_i8<drop&&before[before.length-1-_i8]==" ";_i8++){pos--;}targetPos=pos;}else{targetPos=text.findClusterBreak(line.text,pos-line.from,forward,forward)+line.from;if(targetPos==pos&&line.number!=(forward?state.doc.lines:1))targetPos+=forward?1:-1;}return skipAtomic(target,targetPos,forward);});};/** 335 + Delete the selection, or, for cursor selections, the character 336 + before the cursor. 337 + */var deleteCharBackward=function deleteCharBackward(view){return deleteByChar(view,false);};/** 338 + Delete the selection or the character after the cursor. 339 + */var deleteCharForward=function deleteCharForward(view){return deleteByChar(view,true);};var deleteByGroup=function deleteByGroup(target,forward){return deleteBy(target,function(start){var pos=start,state=target.state,line=state.doc.lineAt(pos);var categorize=state.charCategorizer(pos);for(var cat=null;;){if(pos==(forward?line.to:line.from)){if(pos==start&&line.number!=(forward?state.doc.lines:1))pos+=forward?1:-1;break;}var next=text.findClusterBreak(line.text,pos-line.from,forward)+line.from;var nextChar=line.text.slice(Math.min(pos,next)-line.from,Math.max(pos,next)-line.from);var nextCat=categorize(nextChar);if(cat!=null&&nextCat!=cat)break;if(nextChar!=" "||pos!=start)cat=nextCat;pos=next;}return skipAtomic(target,pos,forward);});};/** 340 + Delete the selection or backward until the end of the next 341 + [group](https://codemirror.net/6/docs/ref/#view.EditorView.moveByGroup), only skipping groups of 342 + whitespace when they consist of a single space. 343 + */var deleteGroupBackward=function deleteGroupBackward(target){return deleteByGroup(target,false);};/** 344 + Delete the selection or forward until the end of the next group. 345 + */var deleteGroupForward=function deleteGroupForward(target){return deleteByGroup(target,true);};/** 346 + Delete the selection, or, if it is a cursor selection, delete to 347 + the end of the line. If the cursor is directly at the end of the 348 + line, delete the line break after it. 349 + */var deleteToLineEnd=function deleteToLineEnd(view){return deleteBy(view,function(pos){var lineEnd=view.lineBlockAt(pos).to;return skipAtomic(view,pos<lineEnd?lineEnd:Math.min(view.state.doc.length,pos+1),true);});};/** 350 + Delete the selection, or, if it is a cursor selection, delete to 351 + the start of the line. If the cursor is directly at the start of the 352 + line, delete the line break before it. 353 + */var deleteToLineStart=function deleteToLineStart(view){return deleteBy(view,function(pos){var lineStart=view.lineBlockAt(pos).from;return skipAtomic(view,pos>lineStart?lineStart:Math.max(0,pos-1),false);});};/** 354 + Delete all whitespace directly before a line end from the 355 + document. 356 + */var deleteTrailingWhitespace=function deleteTrailingWhitespace(_ref20){var state=_ref20.state,dispatch=_ref20.dispatch;if(state.readOnly)return false;var changes=[];for(var pos=0,prev="",iter=state.doc.iter();;){iter.next();if(iter.lineBreak||iter.done){var trailing=prev.search(/\s+$/);if(trailing>-1)changes.push({from:pos-(prev.length-trailing),to:pos});if(iter.done)break;prev="";}else{prev=iter.value;}pos+=iter.value.length;}if(!changes.length)return false;dispatch(state.update({changes:changes,userEvent:"delete"}));return true;};/** 357 + Replace each selection range with a line break, leaving the cursor 358 + on the line before the break. 359 + */var splitLine=function splitLine(_ref21){var state$1=_ref21.state,dispatch=_ref21.dispatch;if(state$1.readOnly)return false;var changes=state$1.changeByRange(function(range){return{changes:{from:range.from,to:range.to,insert:text.Text.of(["",""])},range:state.EditorSelection.cursor(range.from)};});dispatch(state$1.update(changes,{scrollIntoView:true,userEvent:"input"}));return true;};/** 360 + Flip the characters before and after the cursor(s). 361 + */var transposeChars=function transposeChars(_ref22){var state$1=_ref22.state,dispatch=_ref22.dispatch;if(state$1.readOnly)return false;var changes=state$1.changeByRange(function(range){if(!range.empty||range.from==0||range.from==state$1.doc.length)return{range:range};var pos=range.from,line=state$1.doc.lineAt(pos);var from=pos==line.from?pos-1:text.findClusterBreak(line.text,pos-line.from,false)+line.from;var to=pos==line.to?pos+1:text.findClusterBreak(line.text,pos-line.from,true)+line.from;return{changes:{from:from,to:to,insert:state$1.doc.slice(pos,to).append(state$1.doc.slice(from,pos))},range:state.EditorSelection.cursor(to)};});if(changes.changes.empty)return false;dispatch(state$1.update(changes,{scrollIntoView:true,userEvent:"move.character"}));return true;};function selectedLineBlocks(state){var blocks=[],upto=-1;var _iterator27=_createForOfIteratorHelper(state.selection.ranges),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var range=_step27.value;var startLine=state.doc.lineAt(range.from),endLine=state.doc.lineAt(range.to);if(!range.empty&&range.to==endLine.from)endLine=state.doc.lineAt(range.to-1);if(upto>=startLine.number){var prev=blocks[blocks.length-1];prev.to=endLine.to;prev.ranges.push(range);}else{blocks.push({from:startLine.from,to:endLine.to,ranges:[range]});}upto=endLine.number+1;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return blocks;}function moveLine(state$1,dispatch,forward){if(state$1.readOnly)return false;var changes=[],ranges=[];var _iterator28=_createForOfIteratorHelper(selectedLineBlocks(state$1)),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var block=_step28.value;if(forward?block.to==state$1.doc.length:block.from==0)continue;var nextLine=state$1.doc.lineAt(forward?block.to+1:block.from-1);var size=nextLine.length+1;if(forward){changes.push({from:block.to,to:nextLine.to},{from:block.from,insert:nextLine.text+state$1.lineBreak});var _iterator29=_createForOfIteratorHelper(block.ranges),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var r=_step29.value;ranges.push(state.EditorSelection.range(Math.min(state$1.doc.length,r.anchor+size),Math.min(state$1.doc.length,r.head+size)));}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}}else{changes.push({from:nextLine.from,to:block.from},{from:block.to,insert:state$1.lineBreak+nextLine.text});var _iterator30=_createForOfIteratorHelper(block.ranges),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _r=_step30.value;ranges.push(state.EditorSelection.range(_r.anchor-size,_r.head-size));}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}}}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}if(!changes.length)return false;dispatch(state$1.update({changes:changes,scrollIntoView:true,selection:state.EditorSelection.create(ranges,state$1.selection.mainIndex),userEvent:"move.line"}));return true;}/** 362 + Move the selected lines up one line. 363 + */var moveLineUp=function moveLineUp(_ref23){var state=_ref23.state,dispatch=_ref23.dispatch;return moveLine(state,dispatch,false);};/** 364 + Move the selected lines down one line. 365 + */var moveLineDown=function moveLineDown(_ref24){var state=_ref24.state,dispatch=_ref24.dispatch;return moveLine(state,dispatch,true);};function copyLine(state,dispatch,forward){if(state.readOnly)return false;var changes=[];var _iterator31=_createForOfIteratorHelper(selectedLineBlocks(state)),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var block=_step31.value;if(forward)changes.push({from:block.from,insert:state.doc.slice(block.from,block.to)+state.lineBreak});else changes.push({from:block.to,insert:state.lineBreak+state.doc.slice(block.from,block.to)});}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}dispatch(state.update({changes:changes,scrollIntoView:true,userEvent:"input.copyline"}));return true;}/** 366 + Create a copy of the selected lines. Keep the selection in the top copy. 367 + */var copyLineUp=function copyLineUp(_ref25){var state=_ref25.state,dispatch=_ref25.dispatch;return copyLine(state,dispatch,false);};/** 368 + Create a copy of the selected lines. Keep the selection in the bottom copy. 369 + */var copyLineDown=function copyLineDown(_ref26){var state=_ref26.state,dispatch=_ref26.dispatch;return copyLine(state,dispatch,true);};/** 370 + Delete selected lines. 371 + */var deleteLine=function deleteLine(view){if(view.state.readOnly)return false;var state=view.state,changes=state.changes(selectedLineBlocks(state).map(function(_ref27){var from=_ref27.from,to=_ref27.to;if(from>0)from--;else if(to<state.doc.length)to++;return{from:from,to:to};}));var selection=updateSel(state.selection,function(range){return view.moveVertically(range,true);}).map(changes);view.dispatch({changes:changes,selection:selection,scrollIntoView:true,userEvent:"delete.line"});return true;};/** 372 + Replace the selection with a newline. 373 + */var insertNewline=function insertNewline(_ref28){var state=_ref28.state,dispatch=_ref28.dispatch;dispatch(state.update(state.replaceSelection(state.lineBreak),{scrollIntoView:true,userEvent:"input"}));return true;};function isBetweenBrackets(state,pos){if(/\(\)|\[\]|\{\}/.test(state.sliceDoc(pos-1,pos+1)))return{from:pos,to:pos};var context=language.syntaxTree(state).resolveInner(pos);var before=context.childBefore(pos),after=context.childAfter(pos),closedBy;if(before&&after&&before.to<=pos&&after.from>=pos&&(closedBy=before.type.prop(common.NodeProp.closedBy))&&closedBy.indexOf(after.name)>-1&&state.doc.lineAt(before.to).from==state.doc.lineAt(after.from).from)return{from:before.to,to:after.from};return null;}/** 374 + Replace the selection with a newline and indent the newly created 375 + line(s). If the current line consists only of whitespace, this 376 + will also delete that whitespace. When the cursor is between 377 + matching brackets, an additional newline will be inserted after 378 + the cursor. 379 + */var insertNewlineAndIndent=newlineAndIndent(false);/** 380 + Create a blank, indented line below the current line. 381 + */var insertBlankLine=newlineAndIndent(true);function newlineAndIndent(atEof){return function(_ref29){var state$1=_ref29.state,dispatch=_ref29.dispatch;if(state$1.readOnly)return false;var changes=state$1.changeByRange(function(range){var from=range.from,to=range.to,line=state$1.doc.lineAt(from);var explode=!atEof&&from==to&&isBetweenBrackets(state$1,from);if(atEof)from=to=(to<=line.to?line:state$1.doc.lineAt(to)).to;var cx=new language.IndentContext(state$1,{simulateBreak:from,simulateDoubleBreak:!!explode});var indent=language.getIndentation(cx,from);if(indent==null)indent=/^\s*/.exec(state$1.doc.lineAt(from).text)[0].length;while(to<line.to&&/\s/.test(line.text[to-line.from])){to++;}if(explode){from=explode.from;to=explode.to;}else if(from>line.from&&from<line.from+100&&!/\S/.test(line.text.slice(0,from)))from=line.from;var insert=["",language.indentString(state$1,indent)];if(explode)insert.push(language.indentString(state$1,cx.lineIndent(line.from,-1)));return{changes:{from:from,to:to,insert:text.Text.of(insert)},range:state.EditorSelection.cursor(from+1+insert[1].length)};});dispatch(state$1.update(changes,{scrollIntoView:true,userEvent:"input"}));return true;};}function changeBySelectedLine(state$1,f){var atLine=-1;return state$1.changeByRange(function(range){var changes=[];for(var pos=range.from;pos<=range.to;){var line=state$1.doc.lineAt(pos);if(line.number>atLine&&(range.empty||range.to>line.from)){f(line,changes,range);atLine=line.number;}pos=line.to+1;}var changeSet=state$1.changes(changes);return{changes:changes,range:state.EditorSelection.range(changeSet.mapPos(range.anchor,1),changeSet.mapPos(range.head,1))};});}/** 382 + Auto-indent the selected lines. This uses the [indentation service 383 + facet](https://codemirror.net/6/docs/ref/#language.indentService) as source for auto-indent 384 + information. 385 + */var indentSelection=function indentSelection(_ref30){var state=_ref30.state,dispatch=_ref30.dispatch;if(state.readOnly)return false;var updated=Object.create(null);var context=new language.IndentContext(state,{overrideIndentation:function overrideIndentation(start){var found=updated[start];return found==null?-1:found;}});var changes=changeBySelectedLine(state,function(line,changes,range){var indent=language.getIndentation(context,line.from);if(indent==null)return;if(!/\S/.test(line.text))indent=0;var cur=/^\s*/.exec(line.text)[0];var norm=language.indentString(state,indent);if(cur!=norm||range.from<line.from+cur.length){updated[line.from]=indent;changes.push({from:line.from,to:line.from+cur.length,insert:norm});}});if(!changes.changes.empty)dispatch(state.update(changes,{userEvent:"indent"}));return true;};/** 386 + Add a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation to all selected 387 + lines. 388 + */var indentMore=function indentMore(_ref31){var state=_ref31.state,dispatch=_ref31.dispatch;if(state.readOnly)return false;dispatch(state.update(changeBySelectedLine(state,function(line,changes){changes.push({from:line.from,insert:state.facet(language.indentUnit)});}),{userEvent:"input.indent"}));return true;};/** 389 + Remove a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation from all 390 + selected lines. 391 + */var indentLess=function indentLess(_ref32){var state=_ref32.state,dispatch=_ref32.dispatch;if(state.readOnly)return false;dispatch(state.update(changeBySelectedLine(state,function(line,changes){var space=/^\s*/.exec(line.text)[0];if(!space)return;var col=text.countColumn(space,state.tabSize),keep=0;var insert=language.indentString(state,Math.max(0,col-language.getIndentUnit(state)));while(keep<space.length&&keep<insert.length&&space.charCodeAt(keep)==insert.charCodeAt(keep)){keep++;}changes.push({from:line.from+keep,to:line.from+space.length,insert:insert.slice(keep)});}),{userEvent:"delete.dedent"}));return true;};/** 392 + Insert a tab character at the cursor or, if something is selected, 393 + use [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore) to indent the entire 394 + selection. 395 + */var insertTab=function insertTab(_ref33){var state=_ref33.state,dispatch=_ref33.dispatch;if(state.selection.ranges.some(function(r){return!r.empty;}))return indentMore({state:state,dispatch:dispatch});dispatch(state.update(state.replaceSelection("\t"),{scrollIntoView:true,userEvent:"input"}));return true;};/** 396 + Array of key bindings containing the Emacs-style bindings that are 397 + available on macOS by default. 398 + 399 + - Ctrl-b: [`cursorCharLeft`](https://codemirror.net/6/docs/ref/#commands.cursorCharLeft) ([`selectCharLeft`](https://codemirror.net/6/docs/ref/#commands.selectCharLeft) with Shift) 400 + - Ctrl-f: [`cursorCharRight`](https://codemirror.net/6/docs/ref/#commands.cursorCharRight) ([`selectCharRight`](https://codemirror.net/6/docs/ref/#commands.selectCharRight) with Shift) 401 + - Ctrl-p: [`cursorLineUp`](https://codemirror.net/6/docs/ref/#commands.cursorLineUp) ([`selectLineUp`](https://codemirror.net/6/docs/ref/#commands.selectLineUp) with Shift) 402 + - Ctrl-n: [`cursorLineDown`](https://codemirror.net/6/docs/ref/#commands.cursorLineDown) ([`selectLineDown`](https://codemirror.net/6/docs/ref/#commands.selectLineDown) with Shift) 403 + - Ctrl-a: [`cursorLineStart`](https://codemirror.net/6/docs/ref/#commands.cursorLineStart) ([`selectLineStart`](https://codemirror.net/6/docs/ref/#commands.selectLineStart) with Shift) 404 + - Ctrl-e: [`cursorLineEnd`](https://codemirror.net/6/docs/ref/#commands.cursorLineEnd) ([`selectLineEnd`](https://codemirror.net/6/docs/ref/#commands.selectLineEnd) with Shift) 405 + - Ctrl-d: [`deleteCharForward`](https://codemirror.net/6/docs/ref/#commands.deleteCharForward) 406 + - Ctrl-h: [`deleteCharBackward`](https://codemirror.net/6/docs/ref/#commands.deleteCharBackward) 407 + - Ctrl-k: [`deleteToLineEnd`](https://codemirror.net/6/docs/ref/#commands.deleteToLineEnd) 408 + - Ctrl-Alt-h: [`deleteGroupBackward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupBackward) 409 + - Ctrl-o: [`splitLine`](https://codemirror.net/6/docs/ref/#commands.splitLine) 410 + - Ctrl-t: [`transposeChars`](https://codemirror.net/6/docs/ref/#commands.transposeChars) 411 + - Ctrl-v: [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) 412 + - Alt-v: [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) 413 + */var emacsStyleKeymap=[{key:"Ctrl-b",run:cursorCharLeft,shift:selectCharLeft,preventDefault:true},{key:"Ctrl-f",run:cursorCharRight,shift:selectCharRight},{key:"Ctrl-p",run:cursorLineUp,shift:selectLineUp},{key:"Ctrl-n",run:cursorLineDown,shift:selectLineDown},{key:"Ctrl-a",run:cursorLineStart,shift:selectLineStart},{key:"Ctrl-e",run:cursorLineEnd,shift:selectLineEnd},{key:"Ctrl-d",run:deleteCharForward},{key:"Ctrl-h",run:deleteCharBackward},{key:"Ctrl-k",run:deleteToLineEnd},{key:"Ctrl-Alt-h",run:deleteGroupBackward},{key:"Ctrl-o",run:splitLine},{key:"Ctrl-t",run:transposeChars},{key:"Ctrl-v",run:cursorPageDown}];/** 414 + An array of key bindings closely sticking to platform-standard or 415 + widely used bindings. (This includes the bindings from 416 + [`emacsStyleKeymap`](https://codemirror.net/6/docs/ref/#commands.emacsStyleKeymap), with their `key` 417 + property changed to `mac`.) 418 + 419 + - ArrowLeft: [`cursorCharLeft`](https://codemirror.net/6/docs/ref/#commands.cursorCharLeft) ([`selectCharLeft`](https://codemirror.net/6/docs/ref/#commands.selectCharLeft) with Shift) 420 + - ArrowRight: [`cursorCharRight`](https://codemirror.net/6/docs/ref/#commands.cursorCharRight) ([`selectCharRight`](https://codemirror.net/6/docs/ref/#commands.selectCharRight) with Shift) 421 + - Ctrl-ArrowLeft (Alt-ArrowLeft on macOS): [`cursorGroupLeft`](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) ([`selectGroupLeft`](https://codemirror.net/6/docs/ref/#commands.selectGroupLeft) with Shift) 422 + - Ctrl-ArrowRight (Alt-ArrowRight on macOS): [`cursorGroupRight`](https://codemirror.net/6/docs/ref/#commands.cursorGroupRight) ([`selectGroupRight`](https://codemirror.net/6/docs/ref/#commands.selectGroupRight) with Shift) 423 + - Cmd-ArrowLeft (on macOS): [`cursorLineStart`](https://codemirror.net/6/docs/ref/#commands.cursorLineStart) ([`selectLineStart`](https://codemirror.net/6/docs/ref/#commands.selectLineStart) with Shift) 424 + - Cmd-ArrowRight (on macOS): [`cursorLineEnd`](https://codemirror.net/6/docs/ref/#commands.cursorLineEnd) ([`selectLineEnd`](https://codemirror.net/6/docs/ref/#commands.selectLineEnd) with Shift) 425 + - ArrowUp: [`cursorLineUp`](https://codemirror.net/6/docs/ref/#commands.cursorLineUp) ([`selectLineUp`](https://codemirror.net/6/docs/ref/#commands.selectLineUp) with Shift) 426 + - ArrowDown: [`cursorLineDown`](https://codemirror.net/6/docs/ref/#commands.cursorLineDown) ([`selectLineDown`](https://codemirror.net/6/docs/ref/#commands.selectLineDown) with Shift) 427 + - Cmd-ArrowUp (on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift) 428 + - Cmd-ArrowDown (on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift) 429 + - Ctrl-ArrowUp (on macOS): [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift) 430 + - Ctrl-ArrowDown (on macOS): [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift) 431 + - PageUp: [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift) 432 + - PageDown: [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift) 433 + - Home: [`cursorLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryBackward) ([`selectLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryBackward) with Shift) 434 + - End: [`cursorLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryForward) ([`selectLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryForward) with Shift) 435 + - Ctrl-Home (Cmd-Home on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift) 436 + - Ctrl-End (Cmd-Home on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift) 437 + - Enter: [`insertNewlineAndIndent`](https://codemirror.net/6/docs/ref/#commands.insertNewlineAndIndent) 438 + - Ctrl-a (Cmd-a on macOS): [`selectAll`](https://codemirror.net/6/docs/ref/#commands.selectAll) 439 + - Backspace: [`deleteCharBackward`](https://codemirror.net/6/docs/ref/#commands.deleteCharBackward) 440 + - Delete: [`deleteCharForward`](https://codemirror.net/6/docs/ref/#commands.deleteCharForward) 441 + - Ctrl-Backspace (Alt-Backspace on macOS): [`deleteGroupBackward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupBackward) 442 + - Ctrl-Delete (Alt-Delete on macOS): [`deleteGroupForward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupForward) 443 + - Cmd-Backspace (macOS): [`deleteToLineStart`](https://codemirror.net/6/docs/ref/#commands.deleteToLineStart). 444 + - Cmd-Delete (macOS): [`deleteToLineEnd`](https://codemirror.net/6/docs/ref/#commands.deleteToLineEnd). 445 + */var standardKeymap=[{key:"ArrowLeft",run:cursorCharLeft,shift:selectCharLeft,preventDefault:true},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:cursorGroupLeft,shift:selectGroupLeft},{mac:"Cmd-ArrowLeft",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward},{key:"ArrowRight",run:cursorCharRight,shift:selectCharRight,preventDefault:true},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:cursorGroupRight,shift:selectGroupRight},{mac:"Cmd-ArrowRight",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward},{key:"ArrowUp",run:cursorLineUp,shift:selectLineUp,preventDefault:true},{mac:"Cmd-ArrowUp",run:cursorDocStart,shift:selectDocStart},{mac:"Ctrl-ArrowUp",run:cursorPageUp,shift:selectPageUp},{key:"ArrowDown",run:cursorLineDown,shift:selectLineDown,preventDefault:true},{mac:"Cmd-ArrowDown",run:cursorDocEnd,shift:selectDocEnd},{mac:"Ctrl-ArrowDown",run:cursorPageDown,shift:selectPageDown},{key:"PageUp",run:cursorPageUp,shift:selectPageUp},{key:"PageDown",run:cursorPageDown,shift:selectPageDown},{key:"Home",run:cursorLineBoundaryBackward,shift:selectLineBoundaryBackward},{key:"Mod-Home",run:cursorDocStart,shift:selectDocStart},{key:"End",run:cursorLineBoundaryForward,shift:selectLineBoundaryForward},{key:"Mod-End",run:cursorDocEnd,shift:selectDocEnd},{key:"Enter",run:insertNewlineAndIndent},{key:"Mod-a",run:selectAll},{key:"Backspace",run:deleteCharBackward,shift:deleteCharBackward},{key:"Delete",run:deleteCharForward},{key:"Mod-Backspace",mac:"Alt-Backspace",run:deleteGroupBackward},{key:"Mod-Delete",mac:"Alt-Delete",run:deleteGroupForward},{mac:"Mod-Backspace",run:deleteToLineStart},{mac:"Mod-Delete",run:deleteToLineEnd}].concat(emacsStyleKeymap.map(function(b){return{mac:b.key,run:b.run,shift:b.shift};}));/** 446 + The default keymap. Includes all bindings from 447 + [`standardKeymap`](https://codemirror.net/6/docs/ref/#commands.standardKeymap) plus the following: 448 + 449 + - Alt-ArrowLeft (Ctrl-ArrowLeft on macOS): [`cursorSyntaxLeft`](https://codemirror.net/6/docs/ref/#commands.cursorSyntaxLeft) ([`selectSyntaxLeft`](https://codemirror.net/6/docs/ref/#commands.selectSyntaxLeft) with Shift) 450 + - Alt-ArrowRight (Ctrl-ArrowRight on macOS): [`cursorSyntaxRight`](https://codemirror.net/6/docs/ref/#commands.cursorSyntaxRight) ([`selectSyntaxRight`](https://codemirror.net/6/docs/ref/#commands.selectSyntaxRight) with Shift) 451 + - Alt-ArrowUp: [`moveLineUp`](https://codemirror.net/6/docs/ref/#commands.moveLineUp) 452 + - Alt-ArrowDown: [`moveLineDown`](https://codemirror.net/6/docs/ref/#commands.moveLineDown) 453 + - Shift-Alt-ArrowUp: [`copyLineUp`](https://codemirror.net/6/docs/ref/#commands.copyLineUp) 454 + - Shift-Alt-ArrowDown: [`copyLineDown`](https://codemirror.net/6/docs/ref/#commands.copyLineDown) 455 + - Escape: [`simplifySelection`](https://codemirror.net/6/docs/ref/#commands.simplifySelection) 456 + - Ctrl-Enter (Comd-Enter on macOS): [`insertBlankLine`](https://codemirror.net/6/docs/ref/#commands.insertBlankLine) 457 + - Alt-l (Ctrl-l on macOS): [`selectLine`](https://codemirror.net/6/docs/ref/#commands.selectLine) 458 + - Ctrl-i (Cmd-i on macOS): [`selectParentSyntax`](https://codemirror.net/6/docs/ref/#commands.selectParentSyntax) 459 + - Ctrl-[ (Cmd-[ on macOS): [`indentLess`](https://codemirror.net/6/docs/ref/#commands.indentLess) 460 + - Ctrl-] (Cmd-] on macOS): [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore) 461 + - Ctrl-Alt-\\ (Cmd-Alt-\\ on macOS): [`indentSelection`](https://codemirror.net/6/docs/ref/#commands.indentSelection) 462 + - Shift-Ctrl-k (Shift-Cmd-k on macOS): [`deleteLine`](https://codemirror.net/6/docs/ref/#commands.deleteLine) 463 + - Shift-Ctrl-\\ (Shift-Cmd-\\ on macOS): [`cursorMatchingBracket`](https://codemirror.net/6/docs/ref/#commands.cursorMatchingBracket) 464 + */var defaultKeymap=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:cursorSyntaxLeft,shift:selectSyntaxLeft},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:cursorSyntaxRight,shift:selectSyntaxRight},{key:"Alt-ArrowUp",run:moveLineUp},{key:"Shift-Alt-ArrowUp",run:copyLineUp},{key:"Alt-ArrowDown",run:moveLineDown},{key:"Shift-Alt-ArrowDown",run:copyLineDown},{key:"Escape",run:simplifySelection},{key:"Mod-Enter",run:insertBlankLine},{key:"Alt-l",mac:"Ctrl-l",run:selectLine},{key:"Mod-i",run:selectParentSyntax,preventDefault:true},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Mod-Alt-\\",run:indentSelection},{key:"Shift-Mod-k",run:deleteLine},{key:"Shift-Mod-\\",run:cursorMatchingBracket}].concat(standardKeymap);/** 465 + A binding that binds Tab to [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore) and 466 + Shift-Tab to [`indentLess`](https://codemirror.net/6/docs/ref/#commands.indentLess). 467 + Please see the [Tab example](../../examples/tab/) before using 468 + this. 469 + */var indentWithTab={key:"Tab",run:indentMore,shift:indentLess};exports.copyLineDown=copyLineDown;exports.copyLineUp=copyLineUp;exports.cursorCharBackward=cursorCharBackward;exports.cursorCharForward=cursorCharForward;exports.cursorCharLeft=cursorCharLeft;exports.cursorCharRight=cursorCharRight;exports.cursorDocEnd=cursorDocEnd;exports.cursorDocStart=cursorDocStart;exports.cursorGroupBackward=cursorGroupBackward;exports.cursorGroupForward=cursorGroupForward;exports.cursorGroupLeft=cursorGroupLeft;exports.cursorGroupRight=cursorGroupRight;exports.cursorLineBoundaryBackward=cursorLineBoundaryBackward;exports.cursorLineBoundaryForward=cursorLineBoundaryForward;exports.cursorLineDown=cursorLineDown;exports.cursorLineEnd=cursorLineEnd;exports.cursorLineStart=cursorLineStart;exports.cursorLineUp=cursorLineUp;exports.cursorMatchingBracket=cursorMatchingBracket;exports.cursorPageDown=cursorPageDown;exports.cursorPageUp=cursorPageUp;exports.cursorSubwordBackward=cursorSubwordBackward;exports.cursorSubwordForward=cursorSubwordForward;exports.cursorSyntaxLeft=cursorSyntaxLeft;exports.cursorSyntaxRight=cursorSyntaxRight;exports.defaultKeymap=defaultKeymap;exports.deleteCharBackward=deleteCharBackward;exports.deleteCharForward=deleteCharForward;exports.deleteGroupBackward=deleteGroupBackward;exports.deleteGroupForward=deleteGroupForward;exports.deleteLine=deleteLine;exports.deleteToLineEnd=deleteToLineEnd;exports.deleteToLineStart=deleteToLineStart;exports.deleteTrailingWhitespace=deleteTrailingWhitespace;exports.emacsStyleKeymap=emacsStyleKeymap;exports.indentLess=indentLess;exports.indentMore=indentMore;exports.indentSelection=indentSelection;exports.indentWithTab=indentWithTab;exports.insertBlankLine=insertBlankLine;exports.insertNewline=insertNewline;exports.insertNewlineAndIndent=insertNewlineAndIndent;exports.insertTab=insertTab;exports.moveLineDown=moveLineDown;exports.moveLineUp=moveLineUp;exports.selectAll=selectAll;exports.selectCharBackward=selectCharBackward;exports.selectCharForward=selectCharForward;exports.selectCharLeft=selectCharLeft;exports.selectCharRight=selectCharRight;exports.selectDocEnd=selectDocEnd;exports.selectDocStart=selectDocStart;exports.selectGroupBackward=selectGroupBackward;exports.selectGroupForward=selectGroupForward;exports.selectGroupLeft=selectGroupLeft;exports.selectGroupRight=selectGroupRight;exports.selectLine=selectLine;exports.selectLineBoundaryBackward=selectLineBoundaryBackward;exports.selectLineBoundaryForward=selectLineBoundaryForward;exports.selectLineDown=selectLineDown;exports.selectLineEnd=selectLineEnd;exports.selectLineStart=selectLineStart;exports.selectLineUp=selectLineUp;exports.selectMatchingBracket=selectMatchingBracket;exports.selectPageDown=selectPageDown;exports.selectPageUp=selectPageUp;exports.selectParentSyntax=selectParentSyntax;exports.selectSubwordBackward=selectSubwordBackward;exports.selectSubwordForward=selectSubwordForward;exports.selectSyntaxLeft=selectSyntaxLeft;exports.selectSyntaxRight=selectSyntaxRight;exports.simplifySelection=simplifySelection;exports.splitLine=splitLine;exports.standardKeymap=standardKeymap;exports.transposeChars=transposeChars;},{"@codemirror/language":13,"@codemirror/matchbrackets":16,"@codemirror/state":22,"@codemirror/text":24,"@codemirror/view":5,"@lezer/common":28}],5:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');var styleMod=require('style-mod');var rangeset=require('@codemirror/rangeset');var text=require('@codemirror/text');var w3cKeyname=require('w3c-keyname');function getSelection(root){var target;// Browsers differ on whether shadow roots have a getSelection 470 + // method. If it exists, use that, otherwise, call it on the 471 + // document. 472 + if(root.nodeType==11){// Shadow root 473 + target=root.getSelection?root:root.ownerDocument;}else{target=root;}return target.getSelection();}function contains(dom,node){return node?dom.contains(node.nodeType!=1?node.parentNode:node):false;}function deepActiveElement(){var elt=document.activeElement;while(elt&&elt.shadowRoot){elt=elt.shadowRoot.activeElement;}return elt;}function hasSelection(dom,selection){if(!selection.anchorNode)return false;try{// Firefox will raise 'permission denied' errors when accessing 474 + // properties of `sel.anchorNode` when it's in a generated CSS 475 + // element. 476 + return contains(dom,selection.anchorNode);}catch(_){return false;}}function clientRectsFor(dom){if(dom.nodeType==3)return textRange(dom,0,dom.nodeValue.length).getClientRects();else if(dom.nodeType==1)return dom.getClientRects();else return[];}// Scans forward and backward through DOM positions equivalent to the 477 + // given one to see if the two are in the same place (i.e. after a 478 + // text node vs at the end of that text node) 479 + function isEquivalentPosition(node,off,targetNode,targetOff){return targetNode?scanFor(node,off,targetNode,targetOff,-1)||scanFor(node,off,targetNode,targetOff,1):false;}function domIndex(node){for(var index=0;;index++){node=node.previousSibling;if(!node)return index;}}function scanFor(node,off,targetNode,targetOff,dir){for(;;){if(node==targetNode&&off==targetOff)return true;if(off==(dir<0?0:maxOffset(node))){if(node.nodeName=="DIV")return false;var parent=node.parentNode;if(!parent||parent.nodeType!=1)return false;off=domIndex(node)+(dir<0?0:1);node=parent;}else if(node.nodeType==1){node=node.childNodes[off+(dir<0?-1:0)];if(node.nodeType==1&&node.contentEditable=="false")return false;off=dir<0?maxOffset(node):0;}else{return false;}}}function maxOffset(node){return node.nodeType==3?node.nodeValue.length:node.childNodes.length;}var Rect0={left:0,right:0,top:0,bottom:0};function flattenRect(rect,left){var x=left?rect.left:rect.right;return{left:x,right:x,top:rect.top,bottom:rect.bottom};}function windowRect(win){return{left:0,right:win.innerWidth,top:0,bottom:win.innerHeight};}function scrollRectIntoView(dom,rect,side,x,y,xMargin,yMargin,ltr){var doc=dom.ownerDocument,win=doc.defaultView;for(var cur=dom;cur;){if(cur.nodeType==1){// Element 480 + var bounding=void 0,top=cur==doc.body;if(top){bounding=windowRect(win);}else{if(cur.scrollHeight<=cur.clientHeight&&cur.scrollWidth<=cur.clientWidth){cur=cur.parentNode;continue;}var _rect=cur.getBoundingClientRect();// Make sure scrollbar width isn't included in the rectangle 481 + bounding={left:_rect.left,right:_rect.left+cur.clientWidth,top:_rect.top,bottom:_rect.top+cur.clientHeight};}var moveX=0,moveY=0;if(y=="nearest"){if(rect.top<bounding.top){moveY=-(bounding.top-rect.top+yMargin);if(side>0&&rect.bottom>bounding.bottom+moveY)moveY=rect.bottom-bounding.bottom+moveY+yMargin;}else if(rect.bottom>bounding.bottom){moveY=rect.bottom-bounding.bottom+yMargin;if(side<0&&rect.top-moveY<bounding.top)moveY=-(bounding.top+moveY-rect.top+yMargin);}}else{var rectHeight=rect.bottom-rect.top,boundingHeight=bounding.bottom-bounding.top;var targetTop=y=="center"&&rectHeight<=boundingHeight?rect.top+rectHeight/2-boundingHeight/2:y=="start"||y=="center"&&side<0?rect.top-yMargin:rect.bottom-boundingHeight+yMargin;moveY=targetTop-bounding.top;}if(x=="nearest"){if(rect.left<bounding.left){moveX=-(bounding.left-rect.left+xMargin);if(side>0&&rect.right>bounding.right+moveX)moveX=rect.right-bounding.right+moveX+xMargin;}else if(rect.right>bounding.right){moveX=rect.right-bounding.right+xMargin;if(side<0&&rect.left<bounding.left+moveX)moveX=-(bounding.left+moveX-rect.left+xMargin);}}else{var targetLeft=x=="center"?rect.left+(rect.right-rect.left)/2-(bounding.right-bounding.left)/2:x=="start"==ltr?rect.left-xMargin:rect.right-(bounding.right-bounding.left)+xMargin;moveX=targetLeft-bounding.left;}if(moveX||moveY){if(top){win.scrollBy(moveX,moveY);}else{if(moveY){var start=cur.scrollTop;cur.scrollTop+=moveY;moveY=cur.scrollTop-start;}if(moveX){var _start2=cur.scrollLeft;cur.scrollLeft+=moveX;moveX=cur.scrollLeft-_start2;}rect={left:rect.left-moveX,top:rect.top-moveY,right:rect.right-moveX,bottom:rect.bottom-moveY};}}if(top)break;cur=cur.assignedSlot||cur.parentNode;x=y="nearest";}else if(cur.nodeType==11){// A shadow root 482 + cur=cur.host;}else{break;}}}var DOMSelectionState=/*#__PURE__*/function(){function DOMSelectionState(){_classCallCheck(this,DOMSelectionState);this.anchorNode=null;this.anchorOffset=0;this.focusNode=null;this.focusOffset=0;}_createClass(DOMSelectionState,[{key:"eq",value:function eq(domSel){return this.anchorNode==domSel.anchorNode&&this.anchorOffset==domSel.anchorOffset&&this.focusNode==domSel.focusNode&&this.focusOffset==domSel.focusOffset;}},{key:"setRange",value:function setRange(range){this.set(range.anchorNode,range.anchorOffset,range.focusNode,range.focusOffset);}},{key:"set",value:function set(anchorNode,anchorOffset,focusNode,focusOffset){this.anchorNode=anchorNode;this.anchorOffset=anchorOffset;this.focusNode=focusNode;this.focusOffset=focusOffset;}}]);return DOMSelectionState;}();var preventScrollSupported=null;// Feature-detects support for .focus({preventScroll: true}), and uses 483 + // a fallback kludge when not supported. 484 + function focusPreventScroll(dom){if(dom.setActive)return dom.setActive();// in IE 485 + if(preventScrollSupported)return dom.focus(preventScrollSupported);var stack=[];for(var cur=dom;cur;cur=cur.parentNode){stack.push(cur,cur.scrollTop,cur.scrollLeft);if(cur==cur.ownerDocument)break;}dom.focus(preventScrollSupported==null?Object.defineProperties({},{preventScroll:{get:function get(){preventScrollSupported={preventScroll:true};return true;},configurable:true,enumerable:true}}):undefined);if(!preventScrollSupported){preventScrollSupported=false;for(var _i9=0;_i9<stack.length;){var elt=stack[_i9++],top=stack[_i9++],left=stack[_i9++];if(elt.scrollTop!=top)elt.scrollTop=top;if(elt.scrollLeft!=left)elt.scrollLeft=left;}}}var scratchRange;function textRange(node,from){var to=arguments.length>2&&arguments[2]!==undefined?arguments[2]:from;var range=scratchRange||(scratchRange=document.createRange());range.setEnd(node,to);range.setStart(node,from);return range;}function dispatchKey(elt,name,code){var options={key:name,code:name,keyCode:code,which:code,cancelable:true};var down=new KeyboardEvent("keydown",options);down.synthetic=true;elt.dispatchEvent(down);var up=new KeyboardEvent("keyup",options);up.synthetic=true;elt.dispatchEvent(up);return down.defaultPrevented||up.defaultPrevented;}function getRoot(node){while(node){if(node&&(node.nodeType==9||node.nodeType==11&&node.host))return node;node=node.assignedSlot||node.parentNode;}return null;}function clearAttributes(node){while(node.attributes.length){node.removeAttributeNode(node.attributes[0]);}}var DOMPos=/*#__PURE__*/function(){function DOMPos(node,offset){var precise=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;_classCallCheck(this,DOMPos);this.node=node;this.offset=offset;this.precise=precise;}_createClass(DOMPos,null,[{key:"before",value:function before(dom,precise){return new DOMPos(dom.parentNode,domIndex(dom),precise);}},{key:"after",value:function after(dom,precise){return new DOMPos(dom.parentNode,domIndex(dom)+1,precise);}}]);return DOMPos;}();var noChildren=[];var ContentView=/*#__PURE__*/function(){function ContentView(){_classCallCheck(this,ContentView);this.parent=null;this.dom=null;this.dirty=2/* Node */;}_createClass(ContentView,[{key:"editorView",get:function get(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView;}},{key:"overrideDOMText",get:function get(){return null;}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBefore(this):0;}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.length;}},{key:"posBefore",value:function posBefore(view){var pos=this.posAtStart;var _iterator32=_createForOfIteratorHelper(this.children),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var child=_step32.value;if(child==view)return pos;pos+=child.length+child.breakAfter;}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}throw new RangeError("Invalid child in posBefore");}},{key:"posAfter",value:function posAfter(view){return this.posBefore(view)+view.length;}// Will return a rectangle directly before (when side < 0), after 486 + // (side > 0) or directly on (when the browser supports it) the 487 + // given position. 488 + },{key:"coordsAt",value:function coordsAt(_pos,_side){return null;}},{key:"sync",value:function sync(track){if(this.dirty&2/* Node */){var parent=this.dom;var pos=parent.firstChild;var _iterator33=_createForOfIteratorHelper(this.children),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var child=_step33.value;if(child.dirty){if(!child.dom&&pos){var contentView=ContentView.get(pos);if(!contentView||!contentView.parent&&contentView.constructor==child.constructor)child.reuseDOM(pos);}child.sync(track);child.dirty=0/* Not */;}if(track&&!track.written&&track.node==parent&&pos!=child.dom)track.written=true;if(child.dom.parentNode==parent){while(pos&&pos!=child.dom){pos=rm(pos);}pos=child.dom.nextSibling;}else{parent.insertBefore(child.dom,pos);}}}catch(err){_iterator33.e(err);}finally{_iterator33.f();}if(pos&&track&&track.node==parent)track.written=true;while(pos){pos=rm(pos);}}else if(this.dirty&1/* Child */){var _iterator34=_createForOfIteratorHelper(this.children),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _child=_step34.value;if(_child.dirty){_child.sync(track);_child.dirty=0/* Not */;}}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}}},{key:"reuseDOM",value:function reuseDOM(_dom){}},{key:"localPosFromDOM",value:function localPosFromDOM(node,offset){var after;if(node==this.dom){after=this.dom.childNodes[offset];}else{var bias=maxOffset(node)==0?0:offset==0?-1:1;for(;;){var parent=node.parentNode;if(parent==this.dom)break;if(bias==0&&parent.firstChild!=parent.lastChild){if(node==parent.firstChild)bias=-1;else bias=1;}node=parent;}if(bias<0)after=node;else after=node.nextSibling;}if(after==this.dom.firstChild)return 0;while(after&&!ContentView.get(after)){after=after.nextSibling;}if(!after)return this.length;for(var _i10=0,pos=0;;_i10++){var child=this.children[_i10];if(child.dom==after)return pos;pos+=child.length+child.breakAfter;}}},{key:"domBoundsAround",value:function domBoundsAround(from,to){var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var fromI=-1,fromStart=-1,toI=-1,toEnd=-1;for(var _i11=0,pos=offset,prevEnd=offset;_i11<this.children.length;_i11++){var child=this.children[_i11],end=pos+child.length;if(pos<from&&end>to)return child.domBoundsAround(from,to,pos);if(end>=from&&fromI==-1){fromI=_i11;fromStart=pos;}if(pos>to&&child.dom.parentNode==this.dom){toI=_i11;toEnd=prevEnd;break;}prevEnd=end;pos=end+child.breakAfter;}return{from:fromStart,to:toEnd<0?offset+this.length:toEnd,startDOM:(fromI?this.children[fromI-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:toI<this.children.length&&toI>=0?this.children[toI].dom:null};}},{key:"markDirty",value:function markDirty(){var andParent=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;this.dirty|=2/* Node */;this.markParentsDirty(andParent);}},{key:"markParentsDirty",value:function markParentsDirty(childList){for(var parent=this.parent;parent;parent=parent.parent){if(childList)parent.dirty|=2/* Node */;if(parent.dirty&1/* Child */)return;parent.dirty|=1/* Child */;childList=false;}}},{key:"setParent",value:function setParent(parent){if(this.parent!=parent){this.parent=parent;if(this.dirty)this.markParentsDirty(true);}}},{key:"setDOM",value:function setDOM(dom){if(this.dom)this.dom.cmView=null;this.dom=dom;dom.cmView=this;}},{key:"rootView",get:function get(){for(var v=this;;){var parent=v.parent;if(!parent)return v;v=parent;}}},{key:"replaceChildren",value:function replaceChildren(from,to){var _this$children;var children=arguments.length>2&&arguments[2]!==undefined?arguments[2]:noChildren;this.markDirty();for(var _i12=from;_i12<to;_i12++){var child=this.children[_i12];if(child.parent==this)child.destroy();}(_this$children=this.children).splice.apply(_this$children,[from,to-from].concat(_toConsumableArray(children)));for(var _i13=0;_i13<children.length;_i13++){children[_i13].setParent(this);}}},{key:"ignoreMutation",value:function ignoreMutation(_rec){return false;}},{key:"ignoreEvent",value:function ignoreEvent(_event){return false;}},{key:"childCursor",value:function childCursor(){var pos=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;return new ChildCursor(this.children,pos,this.children.length);}},{key:"childPos",value:function childPos(pos){var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this.childCursor().findPos(pos,bias);}},{key:"toString",value:function toString(){var name=this.constructor.name.replace("View","");return name+(this.children.length?"("+this.children.join()+")":this.length?"["+(name=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"");}},{key:"isEditable",get:function get(){return true;}},{key:"merge",value:function merge(from,to,source,hasStart,openStart,openEnd){return false;}},{key:"become",value:function become(other){return false;}// When this is a zero-length view with a side, this should return a 489 + // number <= 0 to indicate it is before its position, or a 490 + // number > 0 when after its position. 491 + },{key:"getSide",value:function getSide(){return 0;}},{key:"destroy",value:function destroy(){this.parent=null;}}],[{key:"get",value:function get(node){return node.cmView;}}]);return ContentView;}();ContentView.prototype.breakAfter=0;// Remove a DOM node and return its next sibling. 492 + function rm(dom){var next=dom.nextSibling;dom.parentNode.removeChild(dom);return next;}var ChildCursor=/*#__PURE__*/function(){function ChildCursor(children,pos,i){_classCallCheck(this,ChildCursor);this.children=children;this.pos=pos;this.i=i;this.off=0;}_createClass(ChildCursor,[{key:"findPos",value:function findPos(pos){var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;for(;;){if(pos>this.pos||pos==this.pos&&(bias>0||this.i==0||this.children[this.i-1].breakAfter)){this.off=pos-this.pos;return this;}var next=this.children[--this.i];this.pos-=next.length+next.breakAfter;}}}]);return ChildCursor;}();function replaceRange(parent,fromI,fromOff,toI,toOff,insert,breakAtStart,openStart,openEnd){var children=parent.children;var before=children.length?children[fromI]:null;var last=insert.length?insert[insert.length-1]:null;var breakAtEnd=last?last.breakAfter:breakAtStart;// Change within a single child 493 + if(fromI==toI&&before&&!breakAtStart&&!breakAtEnd&&insert.length<2&&before.merge(fromOff,toOff,insert.length?last:null,fromOff==0,openStart,openEnd))return;if(toI<children.length){var after=children[toI];// Make sure the end of the child after the update is preserved in `after` 494 + if(after&&toOff<after.length){// If we're splitting a child, separate part of it to avoid that 495 + // being mangled when updating the child before the update. 496 + if(fromI==toI){after=after.split(toOff);toOff=0;}// If the element after the replacement should be merged with 497 + // the last replacing element, update `content` 498 + if(!breakAtEnd&&last&&after.merge(0,toOff,last,true,0,openEnd)){insert[insert.length-1]=after;}else{// Remove the start of the after element, if necessary, and 499 + // add it to `content`. 500 + if(toOff)after.merge(0,toOff,null,false,0,openEnd);insert.push(after);}}else if(after===null||after===void 0?void 0:after.breakAfter){// The element at `toI` is entirely covered by this range. 501 + // Preserve its line break, if any. 502 + if(last)last.breakAfter=1;else breakAtStart=1;}// Since we've handled the next element from the current elements 503 + // now, make sure `toI` points after that. 504 + toI++;}if(before){before.breakAfter=breakAtStart;if(fromOff>0){if(!breakAtStart&&insert.length&&before.merge(fromOff,before.length,insert[0],false,openStart,0)){before.breakAfter=insert.shift().breakAfter;}else if(fromOff<before.length||before.children.length&&before.children[before.children.length-1].length==0){before.merge(fromOff,before.length,null,false,openStart,0);}fromI++;}}// Try to merge widgets on the boundaries of the replacement 505 + while(fromI<toI&&insert.length){if(children[toI-1].become(insert[insert.length-1])){toI--;insert.pop();openEnd=insert.length?0:openStart;}else if(children[fromI].become(insert[0])){fromI++;insert.shift();openStart=insert.length?0:openEnd;}else{break;}}if(!insert.length&&fromI&&toI<children.length&&!children[fromI-1].breakAfter&&children[toI].merge(0,0,children[fromI-1],false,openStart,openEnd))fromI--;if(fromI<toI||insert.length)parent.replaceChildren(fromI,toI,insert);}function mergeChildrenInto(parent,from,to,insert,openStart,openEnd){var cur=parent.childCursor();var _cur$findPos=cur.findPos(to,1),toI=_cur$findPos.i,toOff=_cur$findPos.off;var _cur$findPos2=cur.findPos(from,-1),fromI=_cur$findPos2.i,fromOff=_cur$findPos2.off;var dLen=from-to;var _iterator35=_createForOfIteratorHelper(insert),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var view=_step35.value;dLen+=view.length;}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}parent.length+=dLen;replaceRange(parent,fromI,fromOff,toI,toOff,insert,0,openStart,openEnd);}var _ref34=typeof navigator!="undefined"?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],_ref35=_slicedToArray(_ref34,2),nav=_ref35[0],doc=_ref35[1];var ie_edge=/Edge\/(\d+)/.exec(nav.userAgent);var ie_upto10=/MSIE \d/.test(nav.userAgent);var ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav.userAgent);var ie=!!(ie_upto10||ie_11up||ie_edge);var gecko=!ie&&/gecko\/(\d+)/i.test(nav.userAgent);var chrome=!ie&&/Chrome\/(\d+)/.exec(nav.userAgent);var webkit=("webkitFontSmoothing"in doc.documentElement.style);var safari=!ie&&/Apple Computer/.test(nav.vendor);var ios=safari&&(/Mobile\/\w+/.test(nav.userAgent)||nav.maxTouchPoints>2);var browser={mac:ios||/Mac/.test(nav.platform),windows:/Win/.test(nav.platform),linux:/Linux|X11/.test(nav.platform),ie:ie,ie_version:ie_upto10?doc.documentMode||6:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko:gecko,gecko_version:gecko?+(/Firefox\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,chrome:!!chrome,chrome_version:chrome?+chrome[1]:0,ios:ios,android:/Android\b/.test(nav.userAgent),webkit:webkit,safari:safari,webkit_version:webkit?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:doc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};var MaxJoinLen=256;var TextView=/*#__PURE__*/function(_ContentView){_inherits(TextView,_ContentView);var _super4=_createSuper(TextView);function TextView(text){var _this12;_classCallCheck(this,TextView);_this12=_super4.call(this);_this12.text=text;return _this12;}_createClass(TextView,[{key:"length",get:function get(){return this.text.length;}},{key:"createDOM",value:function createDOM(textDOM){this.setDOM(textDOM||document.createTextNode(this.text));}},{key:"sync",value:function sync(track){if(!this.dom)this.createDOM();if(this.dom.nodeValue!=this.text){if(track&&track.node==this.dom)track.written=true;this.dom.nodeValue=this.text;}}},{key:"reuseDOM",value:function reuseDOM(dom){if(dom.nodeType==3)this.createDOM(dom);}},{key:"merge",value:function merge(from,to,source){if(source&&(!(source instanceof TextView)||this.length-(to-from)+source.length>MaxJoinLen))return false;this.text=this.text.slice(0,from)+(source?source.text:"")+this.text.slice(to);this.markDirty();return true;}},{key:"split",value:function split(from){var result=new TextView(this.text.slice(from));this.text=this.text.slice(0,from);this.markDirty();return result;}},{key:"localPosFromDOM",value:function localPosFromDOM(node,offset){return node==this.dom?offset:offset?this.text.length:0;}},{key:"domAtPos",value:function domAtPos(pos){return new DOMPos(this.dom,pos);}},{key:"domBoundsAround",value:function domBoundsAround(_from,_to,offset){return{from:offset,to:offset+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling};}},{key:"coordsAt",value:function coordsAt(pos,side){return textCoords(this.dom,pos,side);}}]);return TextView;}(ContentView);var MarkView=/*#__PURE__*/function(_ContentView2){_inherits(MarkView,_ContentView2);var _super5=_createSuper(MarkView);function MarkView(mark){var _this13;var children=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var length=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_classCallCheck(this,MarkView);_this13=_super5.call(this);_this13.mark=mark;_this13.children=children;_this13.length=length;var _iterator36=_createForOfIteratorHelper(children),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var ch=_step36.value;ch.setParent(_assertThisInitialized(_this13));}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}return _this13;}_createClass(MarkView,[{key:"setAttrs",value:function setAttrs(dom){clearAttributes(dom);if(this.mark["class"])dom.className=this.mark["class"];if(this.mark.attrs)for(var name in this.mark.attrs){dom.setAttribute(name,this.mark.attrs[name]);}return dom;}},{key:"reuseDOM",value:function reuseDOM(node){if(node.nodeName==this.mark.tagName.toUpperCase()){this.setDOM(node);this.dirty|=4/* Attrs */|2/* Node */;}}},{key:"sync",value:function sync(track){if(!this.dom)this.setDOM(this.setAttrs(document.createElement(this.mark.tagName)));else if(this.dirty&4/* Attrs */)this.setAttrs(this.dom);_get(_getPrototypeOf(MarkView.prototype),"sync",this).call(this,track);}},{key:"merge",value:function merge(from,to,source,_hasStart,openStart,openEnd){if(source&&(!(source instanceof MarkView&&source.mark.eq(this.mark))||from&&openStart<=0||to<this.length&&openEnd<=0))return false;mergeChildrenInto(this,from,to,source?source.children:[],openStart-1,openEnd-1);this.markDirty();return true;}},{key:"split",value:function split(from){var result=[],off=0,detachFrom=-1,i=0;var _iterator37=_createForOfIteratorHelper(this.children),_step37;try{for(_iterator37.s();!(_step37=_iterator37.n()).done;){var elt=_step37.value;var end=off+elt.length;if(end>from)result.push(off<from?elt.split(from-off):elt);if(detachFrom<0&&off>=from)detachFrom=i;off=end;i++;}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}var length=this.length-from;this.length=from;if(detachFrom>-1){this.children.length=detachFrom;this.markDirty();}return new MarkView(this.mark,result,length);}},{key:"domAtPos",value:function domAtPos(pos){return inlineDOMAtPos(this.dom,this.children,pos);}},{key:"coordsAt",value:function coordsAt(pos,side){return coordsInChildren(this,pos,side);}}]);return MarkView;}(ContentView);function textCoords(text,pos,side){var length=text.nodeValue.length;if(pos>length)pos=length;var from=pos,to=pos,flatten=0;if(pos==0&&side<0||pos==length&&side>=0){if(!(browser.chrome||browser.gecko)){// These browsers reliably return valid rectangles for empty ranges 506 + if(pos){from--;flatten=1;}// FIXME this is wrong in RTL text 507 + else{to++;flatten=-1;}}}else{if(side<0)from--;else to++;}var rects=textRange(text,from,to).getClientRects();if(!rects.length)return Rect0;var rect=rects[(flatten?flatten<0:side>=0)?0:rects.length-1];if(browser.safari&&!flatten&&rect.width==0)rect=Array.prototype.find.call(rects,function(r){return r.width;})||rect;return flatten?flattenRect(rect,flatten<0):rect||null;}// Also used for collapsed ranges that don't have a placeholder widget! 508 + var WidgetView=/*#__PURE__*/function(_ContentView3){_inherits(WidgetView,_ContentView3);var _super6=_createSuper(WidgetView);function WidgetView(widget,length,side){var _this14;_classCallCheck(this,WidgetView);_this14=_super6.call(this);_this14.widget=widget;_this14.length=length;_this14.side=side;return _this14;}_createClass(WidgetView,[{key:"split",value:function split(from){var result=WidgetView.create(this.widget,this.length-from,this.side);this.length-=from;return result;}},{key:"sync",value:function sync(){if(!this.dom||!this.widget.updateDOM(this.dom)){this.setDOM(this.widget.toDOM(this.editorView));this.dom.contentEditable="false";}}},{key:"getSide",value:function getSide(){return this.side;}},{key:"merge",value:function merge(from,to,source,hasStart,openStart,openEnd){if(source&&(!(source instanceof WidgetView)||!this.widget.compare(source.widget)||from>0&&openStart<=0||to<this.length&&openEnd<=0))return false;this.length=from+(source?source.length:0)+(this.length-to);return true;}},{key:"become",value:function become(other){if(other.length==this.length&&other instanceof WidgetView&&other.side==this.side){if(this.widget.constructor==other.widget.constructor){if(!this.widget.eq(other.widget))this.markDirty(true);this.widget=other.widget;return true;}}return false;}},{key:"ignoreMutation",value:function ignoreMutation(){return true;}},{key:"ignoreEvent",value:function ignoreEvent(event){return this.widget.ignoreEvent(event);}},{key:"overrideDOMText",get:function get(){if(this.length==0)return text.Text.empty;var top=this;while(top.parent){top=top.parent;}var view=top.editorView,text$1=view&&view.state.doc,start=this.posAtStart;return text$1?text$1.slice(start,start+this.length):text.Text.empty;}},{key:"domAtPos",value:function domAtPos(pos){return pos==0?DOMPos.before(this.dom):DOMPos.after(this.dom,pos==this.length);}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(pos,side){var rects=this.dom.getClientRects(),rect=null;if(!rects.length)return Rect0;for(var _i14=pos>0?rects.length-1:0;;_i14+=pos>0?-1:1){rect=rects[_i14];if(pos>0?_i14==0:_i14==rects.length-1||rect.top<rect.bottom)break;}return pos==0&&side>0||pos==this.length&&side<=0?rect:flattenRect(rect,pos==0);}},{key:"isEditable",get:function get(){return false;}},{key:"destroy",value:function destroy(){_get(_getPrototypeOf(WidgetView.prototype),"destroy",this).call(this);if(this.dom)this.widget.destroy(this.dom);}}],[{key:"create",value:function create(widget,length,side){return new(widget.customView||WidgetView)(widget,length,side);}}]);return WidgetView;}(ContentView);var CompositionView=/*#__PURE__*/function(_WidgetView){_inherits(CompositionView,_WidgetView);var _super7=_createSuper(CompositionView);function CompositionView(){_classCallCheck(this,CompositionView);return _super7.apply(this,arguments);}_createClass(CompositionView,[{key:"domAtPos",value:function domAtPos(pos){return new DOMPos(this.widget.text,pos);}},{key:"sync",value:function sync(){this.setDOM(this.widget.toDOM());}},{key:"localPosFromDOM",value:function localPosFromDOM(node,offset){return!offset?0:node.nodeType==3?Math.min(offset,this.length):this.length;}},{key:"ignoreMutation",value:function ignoreMutation(){return false;}},{key:"overrideDOMText",get:function get(){return null;}},{key:"coordsAt",value:function coordsAt(pos,side){return textCoords(this.widget.text,pos,side);}},{key:"isEditable",get:function get(){return true;}}]);return CompositionView;}(WidgetView);// Use two characters on Android, to prevent Chrome from closing the 509 + // virtual keyboard when backspacing after a widget (#602). 510 + var ZeroWidthSpace=browser.android?"\u200B\u200B":"\u200B";// These are drawn around uneditable widgets to avoid a number of 511 + // browser bugs that show up when the cursor is directly next to 512 + // uneditable inline content. 513 + var WidgetBufferView=/*#__PURE__*/function(_ContentView4){_inherits(WidgetBufferView,_ContentView4);var _super8=_createSuper(WidgetBufferView);function WidgetBufferView(side){var _this15;_classCallCheck(this,WidgetBufferView);_this15=_super8.call(this);_this15.side=side;return _this15;}_createClass(WidgetBufferView,[{key:"length",get:function get(){return 0;}},{key:"merge",value:function merge(){return false;}},{key:"become",value:function become(other){return other instanceof WidgetBufferView&&other.side==this.side;}},{key:"split",value:function split(){return new WidgetBufferView(this.side);}},{key:"sync",value:function sync(){if(!this.dom)this.setDOM(document.createTextNode(ZeroWidthSpace));else if(this.dirty&&this.dom.nodeValue!=ZeroWidthSpace)this.dom.nodeValue=ZeroWidthSpace;}},{key:"getSide",value:function getSide(){return this.side;}},{key:"domAtPos",value:function domAtPos(pos){return DOMPos.before(this.dom);}},{key:"localPosFromDOM",value:function localPosFromDOM(){return 0;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(pos){var rects=clientRectsFor(this.dom);return rects[rects.length-1]||null;}},{key:"overrideDOMText",get:function get(){return text.Text.of([this.dom.nodeValue.replace(/\u200b/g,"")]);}}]);return WidgetBufferView;}(ContentView);TextView.prototype.children=WidgetView.prototype.children=WidgetBufferView.prototype.children=noChildren;function inlineDOMAtPos(dom,children,pos){var i=0;for(var off=0;i<children.length;i++){var child=children[i],end=off+child.length;if(end==off&&child.getSide()<=0)continue;if(pos>off&&pos<end&&child.dom.parentNode==dom)return child.domAtPos(pos-off);if(pos<=off)break;off=end;}for(;i>0;i--){var before=children[i-1].dom;if(before.parentNode==dom)return DOMPos.after(before);}return new DOMPos(dom,0);}// Assumes `view`, if a mark view, has precisely 1 child. 514 + function joinInlineInto(parent,view,open){var last,children=parent.children;if(open>0&&view instanceof MarkView&&children.length&&(last=children[children.length-1])instanceof MarkView&&last.mark.eq(view.mark)){joinInlineInto(last,view.children[0],open-1);}else{children.push(view);view.setParent(parent);}parent.length+=view.length;}function coordsInChildren(view,pos,side){for(var off=0,_i15=0;_i15<view.children.length;_i15++){var child=view.children[_i15],end=off+child.length,next=void 0;if((side<=0||end==view.length||child.getSide()>0?end>=pos:end>pos)&&(pos<end||_i15+1==view.children.length||(next=view.children[_i15+1]).length||next.getSide()>0)){var flatten=0;if(end==off){if(child.getSide()<=0)continue;flatten=side=-child.getSide();}var rect=child.coordsAt(pos-off,side);return flatten&&rect?flattenRect(rect,side<0):rect;}off=end;}var last=view.dom.lastChild;if(!last)return view.dom.getBoundingClientRect();var rects=clientRectsFor(last);return rects[rects.length-1]||null;}function combineAttrs(source,target){for(var name in source){if(name=="class"&&target["class"])target["class"]+=" "+source["class"];else if(name=="style"&&target.style)target.style+=";"+source.style;else target[name]=source[name];}return target;}function attrsEq(a,b){if(a==b)return true;if(!a||!b)return false;var keysA=Object.keys(a),keysB=Object.keys(b);if(keysA.length!=keysB.length)return false;for(var _i16=0,_keysA=keysA;_i16<_keysA.length;_i16++){var key=_keysA[_i16];if(keysB.indexOf(key)==-1||a[key]!==b[key])return false;}return true;}function _updateAttrs(dom,prev,attrs){if(prev)for(var name in prev){if(!(attrs&&name in attrs))dom.removeAttribute(name);}if(attrs)for(var _name in attrs){if(!(prev&&prev[_name]==attrs[_name]))dom.setAttribute(_name,attrs[_name]);}}/** 515 + Widgets added to the content are described by subclasses of this 516 + class. Using a description object like that makes it possible to 517 + delay creating of the DOM structure for a widget until it is 518 + needed, and to avoid redrawing widgets even when the decorations 519 + that define them are recreated. 520 + */var WidgetType=/*#__PURE__*/function(){function WidgetType(){_classCallCheck(this,WidgetType);}_createClass(WidgetType,[{key:"eq",value:/** 521 + Compare this instance to another instance of the same type. 522 + (TypeScript can't express this, but only instances of the same 523 + specific class will be passed to this method.) This is used to 524 + avoid redrawing widgets when they are replaced by a new 525 + decoration of the same type. The default implementation just 526 + returns `false`, which will cause new instances of the widget to 527 + always be redrawn. 528 + */function eq(_widget){return false;}/** 529 + Update a DOM element created by a widget of the same type (but 530 + different, non-`eq` content) to reflect this widget. May return 531 + true to indicate that it could update, false to indicate it 532 + couldn't (in which case the widget will be redrawn). The default 533 + implementation just returns false. 534 + */},{key:"updateDOM",value:function updateDOM(_dom){return false;}/** 535 + @internal 536 + */},{key:"compare",value:function compare(other){return this==other||this.constructor==other.constructor&&this.eq(other);}/** 537 + The estimated height this widget will have, to be used when 538 + estimating the height of content that hasn't been drawn. May 539 + return -1 to indicate you don't know. The default implementation 540 + returns -1. 541 + */},{key:"estimatedHeight",get:function get(){return-1;}/** 542 + Can be used to configure which kinds of events inside the widget 543 + should be ignored by the editor. The default is to ignore all 544 + events. 545 + */},{key:"ignoreEvent",value:function ignoreEvent(_event){return true;}/** 546 + @internal 547 + */},{key:"customView",get:function get(){return null;}/** 548 + This is called when the an instance of the widget is removed 549 + from the editor view. 550 + */},{key:"destroy",value:function destroy(_dom){}}]);return WidgetType;}();/** 551 + The different types of blocks that can occur in an editor view. 552 + */exports.BlockType=void 0;(function(BlockType){/** 553 + A line of text. 554 + */BlockType[BlockType["Text"]=0]="Text";/** 555 + A block widget associated with the position after it. 556 + */BlockType[BlockType["WidgetBefore"]=1]="WidgetBefore";/** 557 + A block widget associated with the position before it. 558 + */BlockType[BlockType["WidgetAfter"]=2]="WidgetAfter";/** 559 + A block widget [replacing](https://codemirror.net/6/docs/ref/#view.Decoration^replace) a range of content. 560 + */BlockType[BlockType["WidgetRange"]=3]="WidgetRange";})(exports.BlockType||(exports.BlockType={}));/** 561 + A decoration provides information on how to draw or style a piece 562 + of content. You'll usually use it wrapped in a 563 + [`Range`](https://codemirror.net/6/docs/ref/#rangeset.Range), which adds a start and end position. 564 + */var Decoration=/*#__PURE__*/function(_rangeset$RangeValue2){_inherits(Decoration,_rangeset$RangeValue2);var _super9=_createSuper(Decoration);/** 565 + @internal 566 + */function Decoration(/** 567 + @internal 568 + */startSide,/** 569 + @internal 570 + */endSide,/** 571 + @internal 572 + */widget,/** 573 + The config object used to create this decoration. You can 574 + include additional properties in there to store metadata about 575 + your decoration. 576 + */spec){var _this16;_classCallCheck(this,Decoration);_this16=_super9.call(this);_this16.startSide=startSide;_this16.endSide=endSide;_this16.widget=widget;_this16.spec=spec;return _this16;}/** 577 + @internal 578 + */_createClass(Decoration,[{key:"heightRelevant",get:function get(){return false;}/** 579 + Create a mark decoration, which influences the styling of the 580 + content in its range. Nested mark decorations will cause nested 581 + DOM elements to be created. Nesting order is determined by 582 + precedence of the [facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations) or 583 + (below the facet-provided decorations) [view 584 + plugin](https://codemirror.net/6/docs/ref/#view.PluginSpec.decorations). Such elements are split 585 + on line boundaries and on the boundaries of higher-precedence 586 + decorations. 587 + */},{key:"hasHeight",value:/** 588 + @internal 589 + */function hasHeight(){return this.widget?this.widget.estimatedHeight>-1:false;}}],[{key:"mark",value:function mark(spec){return new MarkDecoration(spec);}/** 590 + Create a widget decoration, which adds an element at the given 591 + position. 592 + */},{key:"widget",value:function widget(spec){var side=spec.side||0,block=!!spec.block;side+=block?side>0?300000000/* BlockAfter */:-400000000/* BlockBefore */:side>0?100000000/* InlineAfter */:-100000000/* InlineBefore */;return new PointDecoration(spec,side,side,block,spec.widget||null,false);}/** 593 + Create a replace decoration which replaces the given range with 594 + a widget, or simply hides it. 595 + */},{key:"replace",value:function replace(spec){var block=!!spec.block;var _getInclusive=getInclusive(spec,block),start=_getInclusive.start,end=_getInclusive.end;var startSide=block?start?-300000000/* BlockIncStart */:-1/* InlineIncStart */:400000000/* NonIncStart */;var endSide=block?end?200000000/* BlockIncEnd */:1/* InlineIncEnd */:-500000000/* NonIncEnd */;return new PointDecoration(spec,startSide,endSide,block,spec.widget||null,true);}/** 596 + Create a line decoration, which can add DOM attributes to the 597 + line starting at the given position. 598 + */},{key:"line",value:function line(spec){return new LineDecoration(spec);}/** 599 + Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given 600 + decorated range or ranges. If the ranges aren't already sorted, 601 + pass `true` for `sort` to make the library sort them for you. 602 + */},{key:"set",value:function set(of){var sort=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return rangeset.RangeSet.of(of,sort);}}]);return Decoration;}(rangeset.RangeValue);/** 603 + The empty set of decorations. 604 + */Decoration.none=rangeset.RangeSet.empty;var MarkDecoration=/*#__PURE__*/function(_Decoration){_inherits(MarkDecoration,_Decoration);var _super10=_createSuper(MarkDecoration);function MarkDecoration(spec){var _this17;_classCallCheck(this,MarkDecoration);var _getInclusive2=getInclusive(spec),start=_getInclusive2.start,end=_getInclusive2.end;_this17=_super10.call(this,start?-1/* InlineIncStart */:400000000/* NonIncStart */,end?1/* InlineIncEnd */:-500000000/* NonIncEnd */,null,spec);_this17.tagName=spec.tagName||"span";_this17["class"]=spec["class"]||"";_this17.attrs=spec.attributes||null;return _this17;}_createClass(MarkDecoration,[{key:"eq",value:function eq(other){return this==other||other instanceof MarkDecoration&&this.tagName==other.tagName&&this["class"]==other["class"]&&attrsEq(this.attrs,other.attrs);}},{key:"range",value:function range(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;if(from>=to)throw new RangeError("Mark decorations may not be empty");return _get(_getPrototypeOf(MarkDecoration.prototype),"range",this).call(this,from,to);}}]);return MarkDecoration;}(Decoration);MarkDecoration.prototype.point=false;var LineDecoration=/*#__PURE__*/function(_Decoration2){_inherits(LineDecoration,_Decoration2);var _super11=_createSuper(LineDecoration);function LineDecoration(spec){_classCallCheck(this,LineDecoration);return _super11.call(this,-200000000/* Line */,-200000000/* Line */,null,spec);}_createClass(LineDecoration,[{key:"eq",value:function eq(other){return other instanceof LineDecoration&&attrsEq(this.spec.attributes,other.spec.attributes);}},{key:"range",value:function range(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;if(to!=from)throw new RangeError("Line decoration ranges must be zero-length");return _get(_getPrototypeOf(LineDecoration.prototype),"range",this).call(this,from,to);}}]);return LineDecoration;}(Decoration);LineDecoration.prototype.mapMode=state.MapMode.TrackBefore;LineDecoration.prototype.point=true;var PointDecoration=/*#__PURE__*/function(_Decoration3){_inherits(PointDecoration,_Decoration3);var _super12=_createSuper(PointDecoration);function PointDecoration(spec,startSide,endSide,block,widget,isReplace){var _this18;_classCallCheck(this,PointDecoration);_this18=_super12.call(this,startSide,endSide,widget,spec);_this18.block=block;_this18.isReplace=isReplace;_this18.mapMode=!block?state.MapMode.TrackDel:startSide<=0?state.MapMode.TrackBefore:state.MapMode.TrackAfter;return _this18;}// Only relevant when this.block == true 605 + _createClass(PointDecoration,[{key:"type",get:function get(){return this.startSide<this.endSide?exports.BlockType.WidgetRange:this.startSide<=0?exports.BlockType.WidgetBefore:exports.BlockType.WidgetAfter;}},{key:"heightRelevant",get:function get(){return this.block||!!this.widget&&this.widget.estimatedHeight>=5;}},{key:"eq",value:function eq(other){return other instanceof PointDecoration&&widgetsEq(this.widget,other.widget)&&this.block==other.block&&this.startSide==other.startSide&&this.endSide==other.endSide;}},{key:"range",value:function range(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;if(this.isReplace&&(from>to||from==to&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&to!=from)throw new RangeError("Widget decorations can only have zero-length ranges");return _get(_getPrototypeOf(PointDecoration.prototype),"range",this).call(this,from,to);}}]);return PointDecoration;}(Decoration);PointDecoration.prototype.point=true;function getInclusive(spec){var block=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var start=spec.inclusiveStart,end=spec.inclusiveEnd;if(start==null)start=spec.inclusive;if(end==null)end=spec.inclusive;return{start:start!==null&&start!==void 0?start:block,end:end!==null&&end!==void 0?end:block};}function widgetsEq(a,b){return a==b||!!(a&&b&&a.compare(b));}function addRange(from,to,ranges){var margin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var last=ranges.length-1;if(last>=0&&ranges[last]+margin>=from)ranges[last]=Math.max(ranges[last],to);else ranges.push(from,to);}var LineView=/*#__PURE__*/function(_ContentView5){_inherits(LineView,_ContentView5);var _super13=_createSuper(LineView);function LineView(){var _this19;_classCallCheck(this,LineView);_this19=_super13.apply(this,arguments);_this19.children=[];_this19.length=0;_this19.prevAttrs=undefined;_this19.attrs=null;_this19.breakAfter=0;return _this19;}// Consumes source 606 + _createClass(LineView,[{key:"merge",value:function merge(from,to,source,hasStart,openStart,openEnd){if(source){if(!(source instanceof LineView))return false;if(!this.dom)source.transferDOM(this);// Reuse source.dom when appropriate 607 + }if(hasStart)this.setDeco(source?source.attrs:null);mergeChildrenInto(this,from,to,source?source.children:[],openStart,openEnd);return true;}},{key:"split",value:function split(at){var end=new LineView();end.breakAfter=this.breakAfter;if(this.length==0)return end;var _this$childPos=this.childPos(at),i=_this$childPos.i,off=_this$childPos.off;if(off){end.append(this.children[i].split(off),0);this.children[i].merge(off,this.children[i].length,null,false,0,0);i++;}for(var j=i;j<this.children.length;j++){end.append(this.children[j],0);}while(i>0&&this.children[i-1].length==0){this.children[--i].destroy();}this.children.length=i;this.markDirty();this.length=at;return end;}},{key:"transferDOM",value:function transferDOM(other){if(!this.dom)return;other.setDOM(this.dom);other.prevAttrs=this.prevAttrs===undefined?this.attrs:this.prevAttrs;this.prevAttrs=undefined;this.dom=null;}},{key:"setDeco",value:function setDeco(attrs){if(!attrsEq(this.attrs,attrs)){if(this.dom){this.prevAttrs=this.attrs;this.markDirty();}this.attrs=attrs;}}},{key:"append",value:function append(child,openStart){joinInlineInto(this,child,openStart);}// Only called when building a line view in ContentBuilder 608 + },{key:"addLineDeco",value:function addLineDeco(deco){var attrs=deco.spec.attributes,cls=deco.spec["class"];if(attrs)this.attrs=combineAttrs(attrs,this.attrs||{});if(cls)this.attrs=combineAttrs({"class":cls},this.attrs||{});}},{key:"domAtPos",value:function domAtPos(pos){return inlineDOMAtPos(this.dom,this.children,pos);}},{key:"reuseDOM",value:function reuseDOM(node){if(node.nodeName=="DIV"){this.setDOM(node);this.dirty|=4/* Attrs */|2/* Node */;}}},{key:"sync",value:function sync(track){var _a;if(!this.dom){this.setDOM(document.createElement("div"));this.dom.className="cm-line";this.prevAttrs=this.attrs?null:undefined;}else if(this.dirty&4/* Attrs */){clearAttributes(this.dom);this.dom.className="cm-line";this.prevAttrs=this.attrs?null:undefined;}if(this.prevAttrs!==undefined){_updateAttrs(this.dom,this.prevAttrs,this.attrs);this.dom.classList.add("cm-line");this.prevAttrs=undefined;}_get(_getPrototypeOf(LineView.prototype),"sync",this).call(this,track);var last=this.dom.lastChild;while(last&&ContentView.get(last)instanceof MarkView){last=last.lastChild;}if(!last||last.nodeName!="BR"&&((_a=ContentView.get(last))===null||_a===void 0?void 0:_a.isEditable)==false&&(!browser.ios||!this.children.some(function(ch){return ch instanceof TextView;}))){var hack=document.createElement("BR");hack.cmIgnore=true;this.dom.appendChild(hack);}}},{key:"measureTextSize",value:function measureTextSize(){if(this.children.length==0||this.length>20)return null;var totalWidth=0;var _iterator38=_createForOfIteratorHelper(this.children),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var child=_step38.value;if(!(child instanceof TextView))return null;var rects=clientRectsFor(child.dom);if(rects.length!=1)return null;totalWidth+=rects[0].width;}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:totalWidth/this.length};}},{key:"coordsAt",value:function coordsAt(pos,side){return coordsInChildren(this,pos,side);}},{key:"become",value:function become(_other){return false;}},{key:"type",get:function get(){return exports.BlockType.Text;}}],[{key:"find",value:function find(docView,pos){for(var _i17=0,off=0;_i17<docView.children.length;_i17++){var block=docView.children[_i17],end=off+block.length;if(end>=pos){if(block instanceof LineView)return block;if(end>pos)break;}off=end+block.breakAfter;}return null;}}]);return LineView;}(ContentView);var BlockWidgetView=/*#__PURE__*/function(_ContentView6){_inherits(BlockWidgetView,_ContentView6);var _super14=_createSuper(BlockWidgetView);function BlockWidgetView(widget,length,type){var _this20;_classCallCheck(this,BlockWidgetView);_this20=_super14.call(this);_this20.widget=widget;_this20.length=length;_this20.type=type;_this20.breakAfter=0;return _this20;}_createClass(BlockWidgetView,[{key:"merge",value:function merge(from,to,source,_takeDeco,openStart,openEnd){if(source&&(!(source instanceof BlockWidgetView)||!this.widget.compare(source.widget)||from>0&&openStart<=0||to<this.length&&openEnd<=0))return false;this.length=from+(source?source.length:0)+(this.length-to);return true;}},{key:"domAtPos",value:function domAtPos(pos){return pos==0?DOMPos.before(this.dom):DOMPos.after(this.dom,pos==this.length);}},{key:"split",value:function split(at){var len=this.length-at;this.length=at;var end=new BlockWidgetView(this.widget,len,this.type);end.breakAfter=this.breakAfter;return end;}},{key:"children",get:function get(){return noChildren;}},{key:"sync",value:function sync(){if(!this.dom||!this.widget.updateDOM(this.dom)){this.setDOM(this.widget.toDOM(this.editorView));this.dom.contentEditable="false";}}},{key:"overrideDOMText",get:function get(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):state.Text.empty;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"become",value:function become(other){if(other instanceof BlockWidgetView&&other.type==this.type&&other.widget.constructor==this.widget.constructor){if(!other.widget.eq(this.widget))this.markDirty(true);this.widget=other.widget;this.length=other.length;this.breakAfter=other.breakAfter;return true;}return false;}},{key:"ignoreMutation",value:function ignoreMutation(){return true;}},{key:"ignoreEvent",value:function ignoreEvent(event){return this.widget.ignoreEvent(event);}},{key:"destroy",value:function destroy(){_get(_getPrototypeOf(BlockWidgetView.prototype),"destroy",this).call(this);if(this.dom)this.widget.destroy(this.dom);}}]);return BlockWidgetView;}(ContentView);var ContentBuilder=/*#__PURE__*/function(){function ContentBuilder(doc,pos,end,disallowBlockEffectsBelow){_classCallCheck(this,ContentBuilder);this.doc=doc;this.pos=pos;this.end=end;this.disallowBlockEffectsBelow=disallowBlockEffectsBelow;this.content=[];this.curLine=null;this.breakAtStart=0;this.pendingBuffer=0/* No */;// Set to false directly after a widget that covers the position after it 609 + this.atCursorPos=true;this.openStart=-1;this.openEnd=-1;this.text="";this.textOff=0;this.cursor=doc.iter();this.skip=pos;}_createClass(ContentBuilder,[{key:"posCovered",value:function posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;var last=this.content[this.content.length-1];return!last.breakAfter&&!(last instanceof BlockWidgetView&&last.type==exports.BlockType.WidgetBefore);}},{key:"getLine",value:function getLine(){if(!this.curLine){this.content.push(this.curLine=new LineView());this.atCursorPos=true;}return this.curLine;}},{key:"flushBuffer",value:function flushBuffer(active){if(this.pendingBuffer){this.curLine.append(wrapMarks(new WidgetBufferView(-1),active),active.length);this.pendingBuffer=0/* No */;}}},{key:"addBlockWidget",value:function addBlockWidget(view){this.flushBuffer([]);this.curLine=null;this.content.push(view);}},{key:"finish",value:function finish(openEnd){if(!openEnd)this.flushBuffer([]);else this.pendingBuffer=0/* No */;if(!this.posCovered())this.getLine();}},{key:"buildText",value:function buildText(length,active,openStart){while(length>0){if(this.textOff==this.text.length){var _this$cursor$next=this.cursor.next(this.skip),value=_this$cursor$next.value,lineBreak=_this$cursor$next.lineBreak,done=_this$cursor$next.done;this.skip=0;if(done)throw new Error("Ran out of text content when drawing inline views");if(lineBreak){if(!this.posCovered())this.getLine();if(this.content.length)this.content[this.content.length-1].breakAfter=1;else this.breakAtStart=1;this.flushBuffer([]);this.curLine=null;length--;continue;}else{this.text=value;this.textOff=0;}}var take=Math.min(this.text.length-this.textOff,length,512/* Chunk */);this.flushBuffer(active.slice(0,openStart));this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+take)),active),openStart);this.atCursorPos=true;this.textOff+=take;length-=take;openStart=0;}}},{key:"span",value:function span(from,to,active,openStart){this.buildText(to-from,active,openStart);this.pos=to;if(this.openStart<0)this.openStart=openStart;}},{key:"point",value:function point(from,to,deco,active,openStart){var len=to-from;if(deco instanceof PointDecoration){if(deco.block){var type=deco.type;if(type==exports.BlockType.WidgetAfter&&!this.posCovered())this.getLine();this.addBlockWidget(new BlockWidgetView(deco.widget||new NullWidget("div"),len,type));}else{var view=WidgetView.create(deco.widget||new NullWidget("span"),len,deco.startSide);var cursorBefore=this.atCursorPos&&!view.isEditable&&openStart<=active.length&&(from<to||deco.startSide>0);var cursorAfter=!view.isEditable&&(from<to||deco.startSide<=0);var line=this.getLine();if(this.pendingBuffer==2/* IfCursor */&&!cursorBefore)this.pendingBuffer=0/* No */;this.flushBuffer(active);if(cursorBefore){line.append(wrapMarks(new WidgetBufferView(1),active),openStart);openStart=active.length+Math.max(0,openStart-active.length);}line.append(wrapMarks(view,active),openStart);this.atCursorPos=cursorAfter;this.pendingBuffer=!cursorAfter?0/* No */:from<to?1/* Yes */:2/* IfCursor */;}}else if(this.doc.lineAt(this.pos).from==this.pos){// Line decoration 610 + this.getLine().addLineDeco(deco);}if(len){// Advance the iterator past the replaced content 611 + if(this.textOff+len<=this.text.length){this.textOff+=len;}else{this.skip+=len-(this.text.length-this.textOff);this.text="";this.textOff=0;}this.pos=to;}if(this.openStart<0)this.openStart=openStart;}},{key:"filterPoint",value:function filterPoint(from,to,value,index){if(index>=this.disallowBlockEffectsBelow||!(value instanceof PointDecoration))return true;if(value.block)throw new RangeError("Block decorations may not be specified via plugins");return to<=this.doc.lineAt(this.pos).to;}}],[{key:"build",value:function build(text,from,to,decorations,pluginDecorationLength){var builder=new ContentBuilder(text,from,to,pluginDecorationLength);builder.openEnd=rangeset.RangeSet.spans(decorations,from,to,builder);if(builder.openStart<0)builder.openStart=builder.openEnd;builder.finish(builder.openEnd);return builder;}}]);return ContentBuilder;}();function wrapMarks(view,active){var _iterator39=_createForOfIteratorHelper(active),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var mark=_step39.value;view=new MarkView(mark,[view],view.length);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}return view;}var NullWidget=/*#__PURE__*/function(_WidgetType){_inherits(NullWidget,_WidgetType);var _super15=_createSuper(NullWidget);function NullWidget(tag){var _this21;_classCallCheck(this,NullWidget);_this21=_super15.call(this);_this21.tag=tag;return _this21;}_createClass(NullWidget,[{key:"eq",value:function eq(other){return other.tag==this.tag;}},{key:"toDOM",value:function toDOM(){return document.createElement(this.tag);}},{key:"updateDOM",value:function updateDOM(elt){return elt.nodeName.toLowerCase()==this.tag;}}]);return NullWidget;}(WidgetType);var none=[];var clickAddsSelectionRange=state.Facet.define();var dragMovesSelection$1=state.Facet.define();var mouseSelectionStyle=state.Facet.define();var exceptionSink=state.Facet.define();var updateListener=state.Facet.define();var inputHandler=state.Facet.define();// FIXME remove 612 + var scrollTo=state.StateEffect.define({map:function map(range,changes){return range.map(changes);}});// FIXME remove 613 + var centerOn=state.StateEffect.define({map:function map(range,changes){return range.map(changes);}});var ScrollTarget=/*#__PURE__*/function(){function ScrollTarget(range){var y=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"nearest";var x=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"nearest";var yMargin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:5;var xMargin=arguments.length>4&&arguments[4]!==undefined?arguments[4]:5;_classCallCheck(this,ScrollTarget);this.range=range;this.y=y;this.x=x;this.yMargin=yMargin;this.xMargin=xMargin;}_createClass(ScrollTarget,[{key:"map",value:function map(changes){return changes.empty?this:new ScrollTarget(this.range.map(changes),this.y,this.x,this.yMargin,this.xMargin);}}]);return ScrollTarget;}();var _scrollIntoView2=state.StateEffect.define({map:function map(t,ch){return t.map(ch);}});/** 614 + Log or report an unhandled exception in client code. Should 615 + probably only be used by extension code that allows client code to 616 + provide functions, and calls those functions in a context where an 617 + exception can't be propagated to calling code in a reasonable way 618 + (for example when in an event handler). 619 + 620 + Either calls a handler registered with 621 + [`EditorView.exceptionSink`](https://codemirror.net/6/docs/ref/#view.EditorView^exceptionSink), 622 + `window.onerror`, if defined, or `console.error` (in which case 623 + it'll pass `context`, when given, as first argument). 624 + */function logException(state,exception,context){var handler=state.facet(exceptionSink);if(handler.length)handler[0](exception);else if(window.onerror)window.onerror(String(exception),context,undefined,undefined,exception);else if(context)console.error(context+":",exception);else console.error(exception);}var editable=state.Facet.define({combine:function combine(values){return values.length?values[0]:true;}});/** 625 + Used to [declare](https://codemirror.net/6/docs/ref/#view.PluginSpec.provide) which 626 + [fields](https://codemirror.net/6/docs/ref/#view.PluginValue) a [view plugin](https://codemirror.net/6/docs/ref/#view.ViewPlugin) 627 + provides. 628 + */var PluginFieldProvider=/*#__PURE__*/_createClass(/** 629 + @internal 630 + */function PluginFieldProvider(/** 631 + @internal 632 + */field,/** 633 + @internal 634 + */get){_classCallCheck(this,PluginFieldProvider);this.field=field;this.get=get;});/** 635 + Plugin fields are a mechanism for allowing plugins to provide 636 + values that can be retrieved through the 637 + [`pluginField`](https://codemirror.net/6/docs/ref/#view.EditorView.pluginField) view method. 638 + */var PluginField=/*#__PURE__*/function(){function PluginField(){_classCallCheck(this,PluginField);}_createClass(PluginField,[{key:"from",value:/** 639 + Create a [provider](https://codemirror.net/6/docs/ref/#view.PluginFieldProvider) for this field, 640 + to use with a plugin's [provide](https://codemirror.net/6/docs/ref/#view.PluginSpec.provide) 641 + option. 642 + */function from(get){return new PluginFieldProvider(this,get);}/** 643 + Define a new plugin field. 644 + */}],[{key:"define",value:function define(){return new PluginField();}}]);return PluginField;}();/** 645 + This field can be used by plugins to provide 646 + [decorations](https://codemirror.net/6/docs/ref/#view.Decoration). 647 + 648 + **Note**: For reasons of data flow (plugins are only updated 649 + after the viewport is computed), decorations produced by plugins 650 + are _not_ taken into account when predicting the vertical layout 651 + structure of the editor. They **must not** introduce block 652 + widgets (that will raise an error) or replacing decorations that 653 + cover line breaks (these will be ignored if they occur). Such 654 + decorations, or others that cause a large amount of vertical 655 + size shift compared to the undecorated content, should be 656 + provided through the state-level [`decorations` 657 + facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations) instead. 658 + */PluginField.decorations=PluginField.define();/** 659 + Used to provide ranges that should be treated as atoms as far as 660 + cursor motion is concerned. This causes methods like 661 + [`moveByChar`](https://codemirror.net/6/docs/ref/#view.EditorView.moveByChar) and 662 + [`moveVertically`](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) (and the 663 + commands built on top of them) to skip across such regions when 664 + a selection endpoint would enter them. This does _not_ prevent 665 + direct programmatic [selection 666 + updates](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) from moving into such 667 + regions. 668 + */PluginField.atomicRanges=PluginField.define();/** 669 + Plugins can provide additional scroll margins (space around the 670 + sides of the scrolling element that should be considered 671 + invisible) through this field. This can be useful when the 672 + plugin introduces elements that cover part of that element (for 673 + example a horizontally fixed gutter). 674 + */PluginField.scrollMargins=PluginField.define();var nextPluginID=0;var viewPlugin=state.Facet.define();/** 675 + View plugins associate stateful values with a view. They can 676 + influence the way the content is drawn, and are notified of things 677 + that happen in the view. 678 + */var ViewPlugin=/*#__PURE__*/function(){function ViewPlugin(/** 679 + @internal 680 + */id,/** 681 + @internal 682 + */create,/** 683 + @internal 684 + */fields){_classCallCheck(this,ViewPlugin);this.id=id;this.create=create;this.fields=fields;this.extension=viewPlugin.of(this);}/** 685 + Define a plugin from a constructor function that creates the 686 + plugin's value, given an editor view. 687 + */_createClass(ViewPlugin,null,[{key:"define",value:function define(create,spec){var _ref36=spec||{},eventHandlers=_ref36.eventHandlers,provide=_ref36.provide,decorations=_ref36.decorations;var fields=[];if(provide){var _iterator40=_createForOfIteratorHelper(Array.isArray(provide)?provide:[provide]),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var provider=_step40.value;fields.push(provider);}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}}if(eventHandlers)fields.push(domEventHandlers.from(function(value){return{plugin:value,handlers:eventHandlers};}));if(decorations)fields.push(PluginField.decorations.from(decorations));return new ViewPlugin(nextPluginID++,create,fields);}/** 688 + Create a plugin for a class whose constructor takes a single 689 + editor view as argument. 690 + */},{key:"fromClass",value:function fromClass(cls,spec){return ViewPlugin.define(function(view){return new cls(view);},spec);}}]);return ViewPlugin;}();var domEventHandlers=PluginField.define();var PluginInstance=/*#__PURE__*/function(){function PluginInstance(spec){_classCallCheck(this,PluginInstance);this.spec=spec;// When starting an update, all plugins have this field set to the 691 + // update object, indicating they need to be updated. When finished 692 + // updating, it is set to `false`. Retrieving a plugin that needs to 693 + // be updated with `view.plugin` forces an eager update. 694 + this.mustUpdate=null;// This is null when the plugin is initially created, but 695 + // initialized on the first update. 696 + this.value=null;}_createClass(PluginInstance,[{key:"takeField",value:function takeField(type,target){if(this.spec){var _iterator41=_createForOfIteratorHelper(this.spec.fields),_step41;try{for(_iterator41.s();!(_step41=_iterator41.n()).done;){var _step41$value=_step41.value,field=_step41$value.field,get=_step41$value.get;if(field==type)target.push(get(this.value));}}catch(err){_iterator41.e(err);}finally{_iterator41.f();}}}},{key:"update",value:function update(view){if(!this.value){if(this.spec){try{this.value=this.spec.create(view);}catch(e){logException(view.state,e,"CodeMirror plugin crashed");this.deactivate();}}}else if(this.mustUpdate){var update=this.mustUpdate;this.mustUpdate=null;if(this.value.update){try{this.value.update(update);}catch(e){logException(update.state,e,"CodeMirror plugin crashed");if(this.value.destroy)try{this.value.destroy();}catch(_){}this.deactivate();}}}return this;}},{key:"destroy",value:function destroy(view){var _a;if((_a=this.value)===null||_a===void 0?void 0:_a.destroy){try{this.value.destroy();}catch(e){logException(view.state,e,"CodeMirror plugin crashed");}}}},{key:"deactivate",value:function deactivate(){this.spec=this.value=null;}}]);return PluginInstance;}();var editorAttributes=state.Facet.define();var contentAttributes=state.Facet.define();// Provide decorations 697 + var decorations=state.Facet.define();var styleModule=state.Facet.define();var ChangedRange=/*#__PURE__*/function(){function ChangedRange(fromA,toA,fromB,toB){_classCallCheck(this,ChangedRange);this.fromA=fromA;this.toA=toA;this.fromB=fromB;this.toB=toB;}_createClass(ChangedRange,[{key:"join",value:function join(other){return new ChangedRange(Math.min(this.fromA,other.fromA),Math.max(this.toA,other.toA),Math.min(this.fromB,other.fromB),Math.max(this.toB,other.toB));}},{key:"addToSet",value:function addToSet(set){var i=set.length,me=this;for(;i>0;i--){var range=set[i-1];if(range.fromA>me.toA)continue;if(range.toA<me.fromA)break;me=me.join(range);set.splice(i-1,1);}set.splice(i,0,me);return set;}}],[{key:"extendWithRanges",value:function extendWithRanges(diff,ranges){if(ranges.length==0)return diff;var result=[];for(var dI=0,rI=0,posA=0,posB=0;;dI++){var next=dI==diff.length?null:diff[dI],off=posA-posB;var end=next?next.fromB:1e9;while(rI<ranges.length&&ranges[rI]<end){var from=ranges[rI],to=ranges[rI+1];var fromB=Math.max(posB,from),toB=Math.min(end,to);if(fromB<=toB)new ChangedRange(fromB+off,toB+off,fromB,toB).addToSet(result);if(to>end)break;else rI+=2;}if(!next)return result;new ChangedRange(next.fromA,next.toA,next.fromB,next.toB).addToSet(result);posA=next.toA;posB=next.toB;}}}]);return ChangedRange;}();/** 698 + View [plugins](https://codemirror.net/6/docs/ref/#view.ViewPlugin) are given instances of this 699 + class, which describe what happened, whenever the view is updated. 700 + */var ViewUpdate=/*#__PURE__*/function(){/** 701 + @internal 702 + */function ViewUpdate(/** 703 + The editor view that the update is associated with. 704 + */view,/** 705 + The new editor state. 706 + */state$1){var transactions=arguments.length>2&&arguments[2]!==undefined?arguments[2]:none;_classCallCheck(this,ViewUpdate);this.view=view;this.state=state$1;this.transactions=transactions;/** 707 + @internal 708 + */this.flags=0;this.startState=view.state;this.changes=state.ChangeSet.empty(this.startState.doc.length);var _iterator42=_createForOfIteratorHelper(transactions),_step42;try{for(_iterator42.s();!(_step42=_iterator42.n()).done;){var tr=_step42.value;this.changes=this.changes.compose(tr.changes);}}catch(err){_iterator42.e(err);}finally{_iterator42.f();}var changedRanges=[];this.changes.iterChangedRanges(function(fromA,toA,fromB,toB){return changedRanges.push(new ChangedRange(fromA,toA,fromB,toB));});this.changedRanges=changedRanges;var focus=view.hasFocus;if(focus!=view.inputState.notifiedFocused){view.inputState.notifiedFocused=focus;this.flags|=1/* Focus */;}}/** 709 + Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or 710 + [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this 711 + update. 712 + */_createClass(ViewUpdate,[{key:"viewportChanged",get:function get(){return(this.flags&4/* Viewport */)>0;}/** 713 + Indicates whether the height of an element in the editor changed 714 + in this update. 715 + */},{key:"heightChanged",get:function get(){return(this.flags&2/* Height */)>0;}/** 716 + Returns true when the document was modified or the size of the 717 + editor, or elements within the editor, changed. 718 + */},{key:"geometryChanged",get:function get(){return this.docChanged||(this.flags&(8/* Geometry */|2/* Height */))>0;}/** 719 + True when this update indicates a focus change. 720 + */},{key:"focusChanged",get:function get(){return(this.flags&1/* Focus */)>0;}/** 721 + Whether the document changed in this update. 722 + */},{key:"docChanged",get:function get(){return!this.changes.empty;}/** 723 + Whether the selection was explicitly set in this update. 724 + */},{key:"selectionSet",get:function get(){return this.transactions.some(function(tr){return tr.selection;});}/** 725 + @internal 726 + */},{key:"empty",get:function get(){return this.flags==0&&this.transactions.length==0;}}]);return ViewUpdate;}();/** 727 + Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). 728 + */exports.Direction=void 0;(function(Direction){// (These are chosen to match the base levels, in bidi algorithm 729 + // terms, of spans in that direction.) 730 + /** 731 + Left-to-right. 732 + */Direction[Direction["LTR"]=0]="LTR";/** 733 + Right-to-left. 734 + */Direction[Direction["RTL"]=1]="RTL";})(exports.Direction||(exports.Direction={}));var LTR=exports.Direction.LTR,RTL=exports.Direction.RTL;// Decode a string with each type encoded as log2(type) 735 + function dec(str){var result=[];for(var _i18=0;_i18<str.length;_i18++){result.push(1<<+str[_i18]);}return result;}// Character types for codepoints 0 to 0xf8 736 + var LowTypes=dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");// Character types for codepoints 0x600 to 0x6f9 737 + var ArabicTypes=dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");var Brackets=Object.create(null),BracketStack=[];// There's a lot more in 738 + // https://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt, 739 + // which are left out to keep code size down. 740 + for(var _i19=0,_arr2=["()","[]","{}"];_i19<_arr2.length;_i19++){var p=_arr2[_i19];var l=p.charCodeAt(0),r=p.charCodeAt(1);Brackets[l]=r;Brackets[r]=-l;}function charType(ch){return ch<=0xf7?LowTypes[ch]:0x590<=ch&&ch<=0x5f4?2/* R */:0x600<=ch&&ch<=0x6f9?ArabicTypes[ch-0x600]:0x6ee<=ch&&ch<=0x8ac?4/* AL */:0x2000<=ch&&ch<=0x200b?256/* NI */:ch==0x200c?256/* NI */:1/* L */;}var BidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;/** 741 + Represents a contiguous range of text that has a single direction 742 + (as in left-to-right or right-to-left). 743 + */var BidiSpan=/*#__PURE__*/function(){/** 744 + @internal 745 + */function BidiSpan(/** 746 + The start of the span (relative to the start of the line). 747 + */from,/** 748 + The end of the span. 749 + */to,/** 750 + The ["bidi 751 + level"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm) 752 + of the span (in this context, 0 means 753 + left-to-right, 1 means right-to-left, 2 means left-to-right 754 + number inside right-to-left text). 755 + */level){_classCallCheck(this,BidiSpan);this.from=from;this.to=to;this.level=level;}/** 756 + The direction of this span. 757 + */_createClass(BidiSpan,[{key:"dir",get:function get(){return this.level%2?RTL:LTR;}/** 758 + @internal 759 + */},{key:"side",value:function side(end,dir){return this.dir==dir==end?this.to:this.from;}/** 760 + @internal 761 + */}],[{key:"find",value:function find(order,index,level,assoc){var maybe=-1;for(var _i20=0;_i20<order.length;_i20++){var span=order[_i20];if(span.from<=index&&span.to>=index){if(span.level==level)return _i20;// When multiple spans match, if assoc != 0, take the one that 762 + // covers that side, otherwise take the one with the minimum 763 + // level. 764 + if(maybe<0||(assoc!=0?assoc<0?span.from<index:span.to>index:order[maybe].level>span.level))maybe=_i20;}}if(maybe<0)throw new RangeError("Index out of range");return maybe;}}]);return BidiSpan;}();// Reused array of character types 765 + var types=[];function computeOrder(line,direction){var len=line.length,outerType=direction==LTR?1/* L */:2/* R */,oppositeType=direction==LTR?2/* R */:1/* L */;if(!line||outerType==1/* L */&&!BidiRE.test(line))return trivialOrder(len);// W1. Examine each non-spacing mark (NSM) in the level run, and 766 + // change the type of the NSM to the type of the previous 767 + // character. If the NSM is at the start of the level run, it will 768 + // get the type of sor. 769 + // W2. Search backwards from each instance of a European number 770 + // until the first strong type (R, L, AL, or sor) is found. If an 771 + // AL is found, change the type of the European number to Arabic 772 + // number. 773 + // W3. Change all ALs to R. 774 + // (Left after this: L, R, EN, AN, ET, CS, NI) 775 + for(var _i21=0,prev=outerType,prevStrong=outerType;_i21<len;_i21++){var type=charType(line.charCodeAt(_i21));if(type==512/* NSM */)type=prev;else if(type==8/* EN */&&prevStrong==4/* AL */)type=16/* AN */;types[_i21]=type==4/* AL */?2/* R */:type;if(type&7/* Strong */)prevStrong=type;prev=type;}// W5. A sequence of European terminators adjacent to European 776 + // numbers changes to all European numbers. 777 + // W6. Otherwise, separators and terminators change to Other 778 + // Neutral. 779 + // W7. Search backwards from each instance of a European number 780 + // until the first strong type (R, L, or sor) is found. If an L is 781 + // found, then change the type of the European number to L. 782 + // (Left after this: L, R, EN+AN, NI) 783 + for(var _i22=0,_prev=outerType,_prevStrong=outerType;_i22<len;_i22++){var _type2=types[_i22];if(_type2==128/* CS */){if(_i22<len-1&&_prev==types[_i22+1]&&_prev&24/* Num */)_type2=types[_i22]=_prev;else types[_i22]=256/* NI */;}else if(_type2==64/* ET */){var end=_i22+1;while(end<len&&types[end]==64/* ET */){end++;}var replace=_i22&&_prev==8/* EN */||end<len&&types[end]==8/* EN */?_prevStrong==1/* L */?1/* L */:8/* EN */:256/* NI */;for(var j=_i22;j<end;j++){types[j]=replace;}_i22=end-1;}else if(_type2==8/* EN */&&_prevStrong==1/* L */){types[_i22]=1/* L */;}_prev=_type2;if(_type2&7/* Strong */)_prevStrong=_type2;}// N0. Process bracket pairs in an isolating run sequence 784 + // sequentially in the logical order of the text positions of the 785 + // opening paired brackets using the logic given below. Within this 786 + // scope, bidirectional types EN and AN are treated as R. 787 + for(var _i23=0,sI=0,context=0,ch,br,_type3;_i23<len;_i23++){// Keeps [startIndex, type, strongSeen] triples for each open 788 + // bracket on BracketStack. 789 + if(br=Brackets[ch=line.charCodeAt(_i23)]){if(br<0){// Closing bracket 790 + for(var sJ=sI-3;sJ>=0;sJ-=3){if(BracketStack[sJ+1]==-br){var flags=BracketStack[sJ+2];var _type4=flags&2/* EmbedInside */?outerType:!(flags&4/* OppositeInside */)?0:flags&1/* OppositeBefore */?oppositeType:outerType;if(_type4)types[_i23]=types[BracketStack[sJ]]=_type4;sI=sJ;break;}}}else if(BracketStack.length==189/* MaxDepth */){break;}else{BracketStack[sI++]=_i23;BracketStack[sI++]=ch;BracketStack[sI++]=context;}}else if((_type3=types[_i23])==2/* R */||_type3==1/* L */){var embed=_type3==outerType;context=embed?0:1/* OppositeBefore */;for(var _sJ=sI-3;_sJ>=0;_sJ-=3){var cur=BracketStack[_sJ+2];if(cur&2/* EmbedInside */)break;if(embed){BracketStack[_sJ+2]|=2/* EmbedInside */;}else{if(cur&4/* OppositeInside */)break;BracketStack[_sJ+2]|=4/* OppositeInside */;}}}}// N1. A sequence of neutrals takes the direction of the 791 + // surrounding strong text if the text on both sides has the same 792 + // direction. European and Arabic numbers act as if they were R in 793 + // terms of their influence on neutrals. Start-of-level-run (sor) 794 + // and end-of-level-run (eor) are used at level run boundaries. 795 + // N2. Any remaining neutrals take the embedding direction. 796 + // (Left after this: L, R, EN+AN) 797 + for(var _i24=0;_i24<len;_i24++){if(types[_i24]==256/* NI */){var _end2=_i24+1;while(_end2<len&&types[_end2]==256/* NI */){_end2++;}var beforeL=(_i24?types[_i24-1]:outerType)==1/* L */;var afterL=(_end2<len?types[_end2]:outerType)==1/* L */;var _replace=beforeL==afterL?beforeL?1/* L */:2/* R */:outerType;for(var _j=_i24;_j<_end2;_j++){types[_j]=_replace;}_i24=_end2-1;}}// Here we depart from the documented algorithm, in order to avoid 798 + // building up an actual levels array. Since there are only three 799 + // levels (0, 1, 2) in an implementation that doesn't take 800 + // explicit embedding into account, we can build up the order on 801 + // the fly, without following the level-based algorithm. 802 + var order=[];if(outerType==1/* L */){for(var _i25=0;_i25<len;){var start=_i25,rtl=types[_i25++]!=1/* L */;while(_i25<len&&rtl==(types[_i25]!=1/* L */)){_i25++;}if(rtl){for(var _j2=_i25;_j2>start;){var _end3=_j2,_l=types[--_j2]!=2/* R */;while(_j2>start&&_l==(types[_j2-1]!=2/* R */)){_j2--;}order.push(new BidiSpan(_j2,_end3,_l?2:1));}}else{order.push(new BidiSpan(start,_i25,0));}}}else{for(var _i26=0;_i26<len;){var _start3=_i26,_rtl=types[_i26++]==2/* R */;while(_i26<len&&_rtl==(types[_i26]==2/* R */)){_i26++;}order.push(new BidiSpan(_start3,_i26,_rtl?1:2));}}return order;}function trivialOrder(length){return[new BidiSpan(0,length,0)];}var movedOver="";function moveVisually(line,order,dir,start,forward){var _a;var startIndex=start.head-line.from,spanI=-1;if(startIndex==0){if(!forward||!line.length)return null;if(order[0].level!=dir){startIndex=order[0].side(false,dir);spanI=0;}}else if(startIndex==line.length){if(forward)return null;var last=order[order.length-1];if(last.level!=dir){startIndex=last.side(true,dir);spanI=order.length-1;}}if(spanI<0)spanI=BidiSpan.find(order,startIndex,(_a=start.bidiLevel)!==null&&_a!==void 0?_a:-1,start.assoc);var span=order[spanI];// End of span. (But not end of line--that was checked for above.) 803 + if(startIndex==span.side(forward,dir)){span=order[spanI+=forward?1:-1];startIndex=span.side(!forward,dir);}var indexForward=forward==(span.dir==dir);var nextIndex=text.findClusterBreak(line.text,startIndex,indexForward);movedOver=line.text.slice(Math.min(startIndex,nextIndex),Math.max(startIndex,nextIndex));if(nextIndex!=span.side(forward,dir))return state.EditorSelection.cursor(nextIndex+line.from,indexForward?-1:1,span.level);var nextSpan=spanI==(forward?order.length-1:0)?null:order[spanI+(forward?1:-1)];if(!nextSpan&&span.level!=dir)return state.EditorSelection.cursor(forward?line.to:line.from,forward?-1:1,dir);if(nextSpan&&nextSpan.level<span.level)return state.EditorSelection.cursor(nextSpan.side(!forward,dir)+line.from,forward?1:-1,nextSpan.level);return state.EditorSelection.cursor(nextIndex+line.from,forward?-1:1,span.level);}var DOMReader=/*#__PURE__*/function(){function DOMReader(points,view){_classCallCheck(this,DOMReader);this.points=points;this.view=view;this.text="";this.lineBreak=view.state.lineBreak;}_createClass(DOMReader,[{key:"readRange",value:function readRange(start,end){if(!start)return this;var parent=start.parentNode;for(var cur=start;;){this.findPointBefore(parent,cur);this.readNode(cur);var next=cur.nextSibling;if(next==end)break;var view=ContentView.get(cur),nextView=ContentView.get(next);if(view&&nextView?view.breakAfter:(view?view.breakAfter:isBlockElement(cur))||isBlockElement(next)&&(cur.nodeName!="BR"||cur.cmIgnore))this.text+=this.lineBreak;cur=next;}this.findPointBefore(parent,end);return this;}},{key:"readTextNode",value:function readTextNode(node){var _a,_b;var text=node.nodeValue;if(/^\u200b/.test(text)&&((_a=node.previousSibling)===null||_a===void 0?void 0:_a.contentEditable)=="false")text=text.slice(1);if(/\u200b$/.test(text)&&((_b=node.nextSibling)===null||_b===void 0?void 0:_b.contentEditable)=="false")text=text.slice(0,text.length-1);return text;}},{key:"readNode",value:function readNode(node){if(node.cmIgnore)return;var view=ContentView.get(node);var fromView=view&&view.overrideDOMText;var text;if(fromView!=null)text=fromView.sliceString(0,undefined,this.lineBreak);else if(node.nodeType==3)text=this.readTextNode(node);else if(node.nodeName=="BR")text=node.nextSibling?this.lineBreak:"";else if(node.nodeType==1)this.readRange(node.firstChild,null);if(text!=null){this.findPointIn(node,text.length);this.text+=text;// Chrome inserts two newlines when pressing shift-enter at the 804 + // end of a line. This drops one of those. 805 + if(browser.chrome&&this.view.inputState.lastKeyCode==13&&!node.nextSibling&&/\n\n$/.test(this.text))this.text=this.text.slice(0,-1);}}},{key:"findPointBefore",value:function findPointBefore(node,next){var _iterator43=_createForOfIteratorHelper(this.points),_step43;try{for(_iterator43.s();!(_step43=_iterator43.n()).done;){var point=_step43.value;if(point.node==node&&node.childNodes[point.offset]==next)point.pos=this.text.length;}}catch(err){_iterator43.e(err);}finally{_iterator43.f();}}},{key:"findPointIn",value:function findPointIn(node,maxLen){var _iterator44=_createForOfIteratorHelper(this.points),_step44;try{for(_iterator44.s();!(_step44=_iterator44.n()).done;){var point=_step44.value;if(point.node==node)point.pos=this.text.length+Math.min(point.offset,maxLen);}}catch(err){_iterator44.e(err);}finally{_iterator44.f();}}}]);return DOMReader;}();function isBlockElement(node){return node.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(node.nodeName);}var DOMPoint=/*#__PURE__*/_createClass(function DOMPoint(node,offset){_classCallCheck(this,DOMPoint);this.node=node;this.offset=offset;this.pos=-1;});var DocView=/*#__PURE__*/function(_ContentView7){_inherits(DocView,_ContentView7);var _super16=_createSuper(DocView);function DocView(view){var _this22;_classCallCheck(this,DocView);_this22=_super16.call(this);_this22.view=view;_this22.compositionDeco=Decoration.none;_this22.decorations=[];_this22.pluginDecorationLength=0;// Track a minimum width for the editor. When measuring sizes in 806 + // measureVisibleLineHeights, this is updated to point at the width 807 + // of a given element and its extent in the document. When a change 808 + // happens in that range, these are reset. That way, once we've seen 809 + // a line/element of a given length, we keep the editor wide enough 810 + // to fit at least that element, until it is changed, at which point 811 + // we forget it again. 812 + _this22.minWidth=0;_this22.minWidthFrom=0;_this22.minWidthTo=0;// Track whether the DOM selection was set in a lossy way, so that 813 + // we don't mess it up when reading it back it 814 + _this22.impreciseAnchor=null;_this22.impreciseHead=null;_this22.forceSelection=false;// Used by the resize observer to ignore resizes that we caused 815 + // ourselves 816 + _this22.lastUpdate=Date.now();_this22.setDOM(view.contentDOM);_this22.children=[new LineView()];_this22.children[0].setParent(_assertThisInitialized(_this22));_this22.updateDeco();_this22.updateInner([new ChangedRange(0,0,0,view.state.doc.length)],0);return _this22;}_createClass(DocView,[{key:"root",get:function get(){return this.view.root;}},{key:"editorView",get:function get(){return this.view;}},{key:"length",get:function get(){return this.view.state.doc.length;}// Update the document view to a given state. scrollIntoView can be 817 + // used as a hint to compute a new viewport that includes that 818 + // position, if we know the editor is going to scroll that position 819 + // into view. 820 + },{key:"update",value:function update(_update3){var _this23=this;var changedRanges=_update3.changedRanges;if(this.minWidth>0&&changedRanges.length){if(!changedRanges.every(function(_ref37){var fromA=_ref37.fromA,toA=_ref37.toA;return toA<_this23.minWidthFrom||fromA>_this23.minWidthTo;})){this.minWidth=this.minWidthFrom=this.minWidthTo=0;}else{this.minWidthFrom=_update3.changes.mapPos(this.minWidthFrom,1);this.minWidthTo=_update3.changes.mapPos(this.minWidthTo,1);}}if(this.view.inputState.composing<0)this.compositionDeco=Decoration.none;else if(_update3.transactions.length||this.dirty)this.compositionDeco=computeCompositionDeco(this.view,_update3.changes);// When the DOM nodes around the selection are moved to another 821 + // parent, Chrome sometimes reports a different selection through 822 + // getSelection than the one that it actually shows to the user. 823 + // This forces a selection update when lines are joined to work 824 + // around that. Issue #54 825 + if((browser.ie||browser.chrome)&&!this.compositionDeco.size&&_update3&&_update3.state.doc.lines!=_update3.startState.doc.lines)this.forceSelection=true;var prevDeco=this.decorations,deco=this.updateDeco();var decoDiff=findChangedDeco(prevDeco,deco,_update3.changes);changedRanges=ChangedRange.extendWithRanges(changedRanges,decoDiff);if(this.dirty==0/* Not */&&changedRanges.length==0){return false;}else{this.updateInner(changedRanges,_update3.startState.doc.length);if(_update3.transactions.length)this.lastUpdate=Date.now();return true;}}// Used by update and the constructor do perform the actual DOM 826 + // update 827 + },{key:"updateInner",value:function updateInner(changes,oldLength){var _this24=this;this.view.viewState.mustMeasureContent=true;this.updateChildren(changes,oldLength);var observer=this.view.observer;observer.ignore(function(){// Lock the height during redrawing, since Chrome sometimes 828 + // messes with the scroll position during DOM mutation (though 829 + // no relayout is triggered and I cannot imagine how it can 830 + // recompute the scroll position without a layout) 831 + _this24.dom.style.height=_this24.view.viewState.contentHeight+"px";_this24.dom.style.minWidth=_this24.minWidth?_this24.minWidth+"px":"";// Chrome will sometimes, when DOM mutations occur directly 832 + // around the selection, get confused and report a different 833 + // selection from the one it displays (issue #218). This tries 834 + // to detect that situation. 835 + var track=browser.chrome||browser.ios?{node:observer.selectionRange.focusNode,written:false}:undefined;_this24.sync(track);_this24.dirty=0/* Not */;if(track&&(track.written||observer.selectionRange.focusNode!=track.node))_this24.forceSelection=true;_this24.dom.style.height="";});var gaps=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length){var _iterator45=_createForOfIteratorHelper(this.children),_step45;try{for(_iterator45.s();!(_step45=_iterator45.n()).done;){var child=_step45.value;if(child instanceof BlockWidgetView&&child.widget instanceof BlockGapWidget)gaps.push(child.dom);}}catch(err){_iterator45.e(err);}finally{_iterator45.f();}}observer.updateGaps(gaps);}},{key:"updateChildren",value:function updateChildren(changes,oldLength){var cursor=this.childCursor(oldLength);for(var _i27=changes.length-1;;_i27--){var next=_i27>=0?changes[_i27]:null;if(!next)break;var fromA=next.fromA,toA=next.toA,fromB=next.fromB,toB=next.toB;var _ContentBuilder$build=ContentBuilder.build(this.view.state.doc,fromB,toB,this.decorations,this.pluginDecorationLength),content=_ContentBuilder$build.content,breakAtStart=_ContentBuilder$build.breakAtStart,openStart=_ContentBuilder$build.openStart,openEnd=_ContentBuilder$build.openEnd;var _cursor$findPos=cursor.findPos(toA,1),toI=_cursor$findPos.i,toOff=_cursor$findPos.off;var _cursor$findPos2=cursor.findPos(fromA,-1),fromI=_cursor$findPos2.i,fromOff=_cursor$findPos2.off;replaceRange(this,fromI,fromOff,toI,toOff,content,breakAtStart,openStart,openEnd);}}// Sync the DOM selection to this.state.selection 836 + },{key:"updateSelection",value:function updateSelection(){var _this25=this;var mustRead=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var fromPointer=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(mustRead)this.view.observer.readSelectionRange();if(!(fromPointer||this.mayControlSelection())||browser.ios&&this.view.inputState.rapidCompositionStart)return;var force=this.forceSelection;this.forceSelection=false;var main=this.view.state.selection.main;// FIXME need to handle the case where the selection falls inside a block range 837 + var anchor=this.domAtPos(main.anchor);var head=main.empty?anchor:this.domAtPos(main.head);// Always reset on Firefox when next to an uneditable node to 838 + // avoid invisible cursor bugs (#111) 839 + if(browser.gecko&&main.empty&&betweenUneditable(anchor)){var dummy=document.createTextNode("");this.view.observer.ignore(function(){return anchor.node.insertBefore(dummy,anchor.node.childNodes[anchor.offset]||null);});anchor=head=new DOMPos(dummy,0);force=true;}var domSel=this.view.observer.selectionRange;// If the selection is already here, or in an equivalent position, don't touch it 840 + if(force||!domSel.focusNode||!isEquivalentPosition(anchor.node,anchor.offset,domSel.anchorNode,domSel.anchorOffset)||!isEquivalentPosition(head.node,head.offset,domSel.focusNode,domSel.focusOffset)){this.view.observer.ignore(function(){// Chrome Android will hide the virtual keyboard when tapping 841 + // inside an uneditable node, and not bring it back when we 842 + // move the cursor to its proper position. This tries to 843 + // restore the keyboard by cycling focus. 844 + if(browser.android&&browser.chrome&&_this25.dom.contains(domSel.focusNode)&&inUneditable(domSel.focusNode,_this25.dom)){_this25.dom.blur();_this25.dom.focus({preventScroll:true});}var rawSel=getSelection(_this25.root);if(main.empty){// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=1612076 845 + if(browser.gecko){var nextTo=nextToUneditable(anchor.node,anchor.offset);if(nextTo&&nextTo!=(1/* Before */|2/* After */)){var _text=nearbyTextNode(anchor.node,anchor.offset,nextTo==1/* Before */?1:-1);if(_text)anchor=new DOMPos(_text,nextTo==1/* Before */?0:_text.nodeValue.length);}}rawSel.collapse(anchor.node,anchor.offset);if(main.bidiLevel!=null&&domSel.cursorBidiLevel!=null)domSel.cursorBidiLevel=main.bidiLevel;}else if(rawSel.extend){// Selection.extend can be used to create an 'inverted' selection 846 + // (one where the focus is before the anchor), but not all 847 + // browsers support it yet. 848 + rawSel.collapse(anchor.node,anchor.offset);rawSel.extend(head.node,head.offset);}else{// Primitive (IE) way 849 + var range=document.createRange();if(main.anchor>main.head){var _ref38=[head,anchor];anchor=_ref38[0];head=_ref38[1];}range.setEnd(head.node,head.offset);range.setStart(anchor.node,anchor.offset);rawSel.removeAllRanges();rawSel.addRange(range);}});this.view.observer.setSelectionRange(anchor,head);}this.impreciseAnchor=anchor.precise?null:new DOMPos(domSel.anchorNode,domSel.anchorOffset);this.impreciseHead=head.precise?null:new DOMPos(domSel.focusNode,domSel.focusOffset);}},{key:"enforceCursorAssoc",value:function enforceCursorAssoc(){if(this.compositionDeco.size)return;var cursor=this.view.state.selection.main;var sel=getSelection(this.root);if(!cursor.empty||!cursor.assoc||!sel.modify)return;var line=LineView.find(this,cursor.head);if(!line)return;var lineStart=line.posAtStart;if(cursor.head==lineStart||cursor.head==lineStart+line.length)return;var before=this.coordsAt(cursor.head,-1),after=this.coordsAt(cursor.head,1);if(!before||!after||before.bottom>after.top)return;var dom=this.domAtPos(cursor.head+cursor.assoc);sel.collapse(dom.node,dom.offset);sel.modify("move",cursor.assoc<0?"forward":"backward","lineboundary");}},{key:"mayControlSelection",value:function mayControlSelection(){return this.view.state.facet(editable)?this.root.activeElement==this.dom:hasSelection(this.dom,this.view.observer.selectionRange);}},{key:"nearest",value:function nearest(dom){for(var cur=dom;cur;){var domView=ContentView.get(cur);if(domView&&domView.rootView==this)return domView;cur=cur.parentNode;}return null;}},{key:"posFromDOM",value:function posFromDOM(node,offset){var view=this.nearest(node);if(!view)throw new RangeError("Trying to find position for a DOM position outside of the document");return view.localPosFromDOM(node,offset)+view.posAtStart;}},{key:"domAtPos",value:function domAtPos(pos){var _this$childCursor$fin=this.childCursor().findPos(pos,-1),i=_this$childCursor$fin.i,off=_this$childCursor$fin.off;for(;i<this.children.length-1;){var child=this.children[i];if(off<child.length||child instanceof LineView)break;i++;off=0;}return this.children[i].domAtPos(off);}},{key:"coordsAt",value:function coordsAt(pos,side){for(var off=this.length,_i28=this.children.length-1;;_i28--){var child=this.children[_i28],start=off-child.breakAfter-child.length;if(pos>start||pos==start&&child.type!=exports.BlockType.WidgetBefore&&child.type!=exports.BlockType.WidgetAfter&&(!_i28||side==2||this.children[_i28-1].breakAfter||this.children[_i28-1].type==exports.BlockType.WidgetBefore&&side>-2))return child.coordsAt(pos-start,side);off=start;}}},{key:"measureVisibleLineHeights",value:function measureVisibleLineHeights(){var result=[],_this$view$viewState$=this.view.viewState.viewport,from=_this$view$viewState$.from,to=_this$view$viewState$.to;var contentWidth=this.view.contentDOM.clientWidth;var isWider=contentWidth>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1;var widest=-1;for(var pos=0,_i29=0;_i29<this.children.length;_i29++){var child=this.children[_i29],end=pos+child.length;if(end>to)break;if(pos>=from){var childRect=child.dom.getBoundingClientRect();result.push(childRect.height);if(isWider){var last=child.dom.lastChild;var rects=last?clientRectsFor(last):[];if(rects.length){var rect=rects[rects.length-1];var width=this.view.textDirection==exports.Direction.LTR?rect.right-childRect.left:childRect.right-rect.left;if(width>widest){widest=width;this.minWidth=contentWidth;this.minWidthFrom=pos;this.minWidthTo=end;}}}}pos=end+child.breakAfter;}return result;}},{key:"measureTextSize",value:function measureTextSize(){var _this26=this;var _iterator46=_createForOfIteratorHelper(this.children),_step46;try{for(_iterator46.s();!(_step46=_iterator46.n()).done;){var child=_step46.value;if(child instanceof LineView){var measure=child.measureTextSize();if(measure)return measure;}}// If no workable line exists, force a layout of a measurable element 850 + }catch(err){_iterator46.e(err);}finally{_iterator46.f();}var dummy=document.createElement("div"),lineHeight,charWidth;dummy.className="cm-line";dummy.textContent="abc def ghi jkl mno pqr stu";this.view.observer.ignore(function(){_this26.dom.appendChild(dummy);var rect=clientRectsFor(dummy.firstChild)[0];lineHeight=dummy.getBoundingClientRect().height;charWidth=rect?rect.width/27:7;dummy.remove();});return{lineHeight:lineHeight,charWidth:charWidth};}},{key:"childCursor",value:function childCursor(){var pos=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;// Move back to start of last element when possible, so that 851 + // `ChildCursor.findPos` doesn't have to deal with the edge case 852 + // of being after the last element. 853 + var i=this.children.length;if(i)pos-=this.children[--i].length;return new ChildCursor(this.children,pos,i);}},{key:"computeBlockGapDeco",value:function computeBlockGapDeco(){var deco=[],vs=this.view.viewState;for(var pos=0,_i30=0;;_i30++){var next=_i30==vs.viewports.length?null:vs.viewports[_i30];var end=next?next.from-1:this.length;if(end>pos){var height=vs.lineBlockAt(end).bottom-vs.lineBlockAt(pos).top;deco.push(Decoration.replace({widget:new BlockGapWidget(height),block:true,inclusive:true}).range(pos,end));}if(!next)break;pos=next.to+1;}return Decoration.set(deco);}},{key:"updateDeco",value:function updateDeco(){var pluginDecorations=this.view.pluginField(PluginField.decorations);this.pluginDecorationLength=pluginDecorations.length;return this.decorations=[].concat(_toConsumableArray(pluginDecorations),_toConsumableArray(this.view.state.facet(decorations)),[this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]);}},{key:"scrollIntoView",value:function scrollIntoView(target){var range=target.range;var rect=this.coordsAt(range.head,range.empty?range.assoc:range.head>range.anchor?-1:1),other;if(!rect)return;if(!range.empty&&(other=this.coordsAt(range.anchor,range.anchor>range.head?-1:1)))rect={left:Math.min(rect.left,other.left),top:Math.min(rect.top,other.top),right:Math.max(rect.right,other.right),bottom:Math.max(rect.bottom,other.bottom)};var mLeft=0,mRight=0,mTop=0,mBottom=0;var _iterator47=_createForOfIteratorHelper(this.view.pluginField(PluginField.scrollMargins)),_step47;try{for(_iterator47.s();!(_step47=_iterator47.n()).done;){var margins=_step47.value;if(margins){var left=margins.left,right=margins.right,top=margins.top,bottom=margins.bottom;if(left!=null)mLeft=Math.max(mLeft,left);if(right!=null)mRight=Math.max(mRight,right);if(top!=null)mTop=Math.max(mTop,top);if(bottom!=null)mBottom=Math.max(mBottom,bottom);}}}catch(err){_iterator47.e(err);}finally{_iterator47.f();}var targetRect={left:rect.left-mLeft,top:rect.top-mTop,right:rect.right+mRight,bottom:rect.bottom+mBottom};scrollRectIntoView(this.view.scrollDOM,targetRect,range.head<range.anchor?-1:1,target.x,target.y,target.xMargin,target.yMargin,this.view.textDirection==exports.Direction.LTR);}}]);return DocView;}(ContentView);function betweenUneditable(pos){return pos.node.nodeType==1&&pos.node.firstChild&&(pos.offset==0||pos.node.childNodes[pos.offset-1].contentEditable=="false")&&(pos.offset==pos.node.childNodes.length||pos.node.childNodes[pos.offset].contentEditable=="false");}var BlockGapWidget=/*#__PURE__*/function(_WidgetType2){_inherits(BlockGapWidget,_WidgetType2);var _super17=_createSuper(BlockGapWidget);function BlockGapWidget(height){var _this27;_classCallCheck(this,BlockGapWidget);_this27=_super17.call(this);_this27.height=height;return _this27;}_createClass(BlockGapWidget,[{key:"toDOM",value:function toDOM(){var elt=document.createElement("div");this.updateDOM(elt);return elt;}},{key:"eq",value:function eq(other){return other.height==this.height;}},{key:"updateDOM",value:function updateDOM(elt){elt.style.height=this.height+"px";return true;}},{key:"estimatedHeight",get:function get(){return this.height;}}]);return BlockGapWidget;}(WidgetType);function compositionSurroundingNode(view){var sel=view.observer.selectionRange;var textNode=sel.focusNode&&nearbyTextNode(sel.focusNode,sel.focusOffset,0);if(!textNode)return null;var cView=view.docView.nearest(textNode);if(!cView)return null;if(cView instanceof LineView){var topNode=textNode;while(topNode.parentNode!=cView.dom){topNode=topNode.parentNode;}var prev=topNode.previousSibling;while(prev&&!ContentView.get(prev)){prev=prev.previousSibling;}var pos=prev?ContentView.get(prev).posAtEnd:cView.posAtStart;return{from:pos,to:pos,node:topNode,text:textNode};}else{for(;;){var _cView=cView,parent=_cView.parent;if(!parent)return null;if(parent instanceof LineView)break;cView=parent;}var from=cView.posAtStart;return{from:from,to:from+cView.length,node:cView.dom,text:textNode};}}function computeCompositionDeco(view,changes){var surrounding=compositionSurroundingNode(view);if(!surrounding)return Decoration.none;var from=surrounding.from,to=surrounding.to,node=surrounding.node,textNode=surrounding.text;var newFrom=changes.mapPos(from,1),newTo=Math.max(newFrom,changes.mapPos(to,-1));var state=view.state,text=node.nodeType==3?node.nodeValue:new DOMReader([],view).readRange(node.firstChild,null).text;if(newTo-newFrom<text.length){if(state.sliceDoc(newFrom,Math.min(state.doc.length,newFrom+text.length))==text)newTo=newFrom+text.length;else if(state.sliceDoc(Math.max(0,newTo-text.length),newTo)==text)newFrom=newTo-text.length;else return Decoration.none;}else if(state.sliceDoc(newFrom,newTo)!=text){return Decoration.none;}return Decoration.set(Decoration.replace({widget:new CompositionWidget(node,textNode)}).range(newFrom,newTo));}var CompositionWidget=/*#__PURE__*/function(_WidgetType3){_inherits(CompositionWidget,_WidgetType3);var _super18=_createSuper(CompositionWidget);function CompositionWidget(top,text){var _this28;_classCallCheck(this,CompositionWidget);_this28=_super18.call(this);_this28.top=top;_this28.text=text;return _this28;}_createClass(CompositionWidget,[{key:"eq",value:function eq(other){return this.top==other.top&&this.text==other.text;}},{key:"toDOM",value:function toDOM(){return this.top;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}},{key:"customView",get:function get(){return CompositionView;}}]);return CompositionWidget;}(WidgetType);function nearbyTextNode(node,offset,side){for(;;){if(node.nodeType==3)return node;if(node.nodeType==1&&offset>0&&side<=0){node=node.childNodes[offset-1];offset=maxOffset(node);}else if(node.nodeType==1&&offset<node.childNodes.length&&side>=0){node=node.childNodes[offset];offset=0;}else{return null;}}}function nextToUneditable(node,offset){if(node.nodeType!=1)return 0;return(offset&&node.childNodes[offset-1].contentEditable=="false"?1/* Before */:0)|(offset<node.childNodes.length&&node.childNodes[offset].contentEditable=="false"?2/* After */:0);}var DecorationComparator$1=/*#__PURE__*/function(){function DecorationComparator$1(){_classCallCheck(this,DecorationComparator$1);this.changes=[];}_createClass(DecorationComparator$1,[{key:"compareRange",value:function compareRange(from,to){addRange(from,to,this.changes);}},{key:"comparePoint",value:function comparePoint(from,to){addRange(from,to,this.changes);}}]);return DecorationComparator$1;}();function findChangedDeco(a,b,diff){var comp=new DecorationComparator$1();rangeset.RangeSet.compare(a,b,diff,comp);return comp.changes;}function inUneditable(node,inside){for(var cur=node;cur&&cur!=inside;cur=cur.assignedSlot||cur.parentNode){if(cur.nodeType==1&&cur.contentEditable=='false'){return true;}}return false;}function groupAt(state$1,pos){var bias=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var categorize=state$1.charCategorizer(pos);var line=state$1.doc.lineAt(pos),linePos=pos-line.from;if(line.length==0)return state.EditorSelection.cursor(pos);if(linePos==0)bias=1;else if(linePos==line.length)bias=-1;var from=linePos,to=linePos;if(bias<0)from=text.findClusterBreak(line.text,linePos,false);else to=text.findClusterBreak(line.text,linePos);var cat=categorize(line.text.slice(from,to));while(from>0){var prev=text.findClusterBreak(line.text,from,false);if(categorize(line.text.slice(prev,from))!=cat)break;from=prev;}while(to<line.length){var next=text.findClusterBreak(line.text,to);if(categorize(line.text.slice(to,next))!=cat)break;to=next;}return state.EditorSelection.range(from+line.from,to+line.from);}// Search the DOM for the {node, offset} position closest to the given 854 + // coordinates. Very inefficient and crude, but can usually be avoided 855 + // by calling caret(Position|Range)FromPoint instead. 856 + function getdx(x,rect){return rect.left>x?rect.left-x:Math.max(0,x-rect.right);}function getdy(y,rect){return rect.top>y?rect.top-y:Math.max(0,y-rect.bottom);}function yOverlap(a,b){return a.top<b.bottom-1&&a.bottom>b.top+1;}function upTop(rect,top){return top<rect.top?{top:top,left:rect.left,right:rect.right,bottom:rect.bottom}:rect;}function upBot(rect,bottom){return bottom>rect.bottom?{top:rect.top,left:rect.left,right:rect.right,bottom:bottom}:rect;}function domPosAtCoords(parent,x,y){var closest,closestRect,closestX,closestY;var above,below,aboveRect,belowRect;for(var child=parent.firstChild;child;child=child.nextSibling){var rects=clientRectsFor(child);for(var _i31=0;_i31<rects.length;_i31++){var rect=rects[_i31];if(closestRect&&yOverlap(closestRect,rect))rect=upTop(upBot(rect,closestRect.bottom),closestRect.top);var dx=getdx(x,rect),dy=getdy(y,rect);if(dx==0&&dy==0)return child.nodeType==3?domPosInText(child,x,y):domPosAtCoords(child,x,y);if(!closest||closestY>dy||closestY==dy&&closestX>dx){closest=child;closestRect=rect;closestX=dx;closestY=dy;}if(dx==0){if(y>rect.bottom&&(!aboveRect||aboveRect.bottom<rect.bottom)){above=child;aboveRect=rect;}else if(y<rect.top&&(!belowRect||belowRect.top>rect.top)){below=child;belowRect=rect;}}else if(aboveRect&&yOverlap(aboveRect,rect)){aboveRect=upBot(aboveRect,rect.bottom);}else if(belowRect&&yOverlap(belowRect,rect)){belowRect=upTop(belowRect,rect.top);}}}if(aboveRect&&aboveRect.bottom>=y){closest=above;closestRect=aboveRect;}else if(belowRect&&belowRect.top<=y){closest=below;closestRect=belowRect;}if(!closest)return{node:parent,offset:0};var clipX=Math.max(closestRect.left,Math.min(closestRect.right,x));if(closest.nodeType==3)return domPosInText(closest,clipX,y);if(!closestX&&closest.contentEditable=="true")return domPosAtCoords(closest,clipX,y);var offset=Array.prototype.indexOf.call(parent.childNodes,closest)+(x>=(closestRect.left+closestRect.right)/2?1:0);return{node:parent,offset:offset};}function domPosInText(node,x,y){var len=node.nodeValue.length;var closestOffset=-1,closestDY=1e9,generalSide=0;for(var _i32=0;_i32<len;_i32++){var rects=textRange(node,_i32,_i32+1).getClientRects();for(var j=0;j<rects.length;j++){var rect=rects[j];if(rect.top==rect.bottom)continue;if(!generalSide)generalSide=x-rect.left;var dy=(rect.top>y?rect.top-y:y-rect.bottom)-1;if(rect.left-1<=x&&rect.right+1>=x&&dy<closestDY){var right=x>=(rect.left+rect.right)/2,after=right;if(browser.chrome||browser.gecko){// Check for RTL on browsers that support getting client 857 + // rects for empty ranges. 858 + var rectBefore=textRange(node,_i32).getBoundingClientRect();if(rectBefore.left==rect.right)after=!right;}if(dy<=0)return{node:node,offset:_i32+(after?1:0)};closestOffset=_i32+(after?1:0);closestDY=dy;}}}return{node:node,offset:closestOffset>-1?closestOffset:generalSide>0?node.nodeValue.length:0};}function _posAtCoords(view,_ref39,precise){var x=_ref39.x,y=_ref39.y;var bias=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;var _a;var content=view.contentDOM.getBoundingClientRect(),docTop=content.top+view.viewState.paddingTop;var block,docHeight=view.viewState.docHeight;var yOffset=y-docTop;if(yOffset<0)return 0;if(yOffset>docHeight)return view.state.doc.length;// Scan for a text block near the queried y position 859 + for(var halfLine=view.defaultLineHeight/2,bounced=false;;){block=view.elementAtHeight(yOffset);if(block.type==exports.BlockType.Text)break;for(;;){// Move the y position out of this block 860 + yOffset=bias>0?block.bottom+halfLine:block.top-halfLine;if(yOffset>=0&&yOffset<=docHeight)break;// If the document consists entirely of replaced widgets, we 861 + // won't find a text block, so return 0 862 + if(bounced)return precise?null:0;bounced=true;bias=-bias;}}y=docTop+yOffset;var lineStart=block.from;// If this is outside of the rendered viewport, we can't determine a position 863 + if(lineStart<view.viewport.from)return view.viewport.from==0?0:precise?null:posAtCoordsImprecise(view,content,block,x,y);if(lineStart>view.viewport.to)return view.viewport.to==view.state.doc.length?view.state.doc.length:precise?null:posAtCoordsImprecise(view,content,block,x,y);// Prefer ShadowRootOrDocument.elementFromPoint if present, fall back to document if not 864 + var doc=view.dom.ownerDocument;var root=view.root.elementFromPoint?view.root:doc;var element=root.elementFromPoint(x,y);if(element&&!view.contentDOM.contains(element))element=null;// If the element is unexpected, clip x at the sides of the content area and try again 865 + if(!element){x=Math.max(content.left+1,Math.min(content.right-1,x));element=root.elementFromPoint(x,y);if(element&&!view.contentDOM.contains(element))element=null;}// There's visible editor content under the point, so we can try 866 + // using caret(Position|Range)FromPoint as a shortcut 867 + var node,offset=-1;if(element&&((_a=view.docView.nearest(element))===null||_a===void 0?void 0:_a.isEditable)!=false){if(doc.caretPositionFromPoint){var pos=doc.caretPositionFromPoint(x,y);if(pos){node=pos.offsetNode;offset=pos.offset;}}else if(doc.caretRangeFromPoint){var range=doc.caretRangeFromPoint(x,y);if(range){node=range.startContainer;offset=range.startOffset;if(browser.safari&&isSuspiciousCaretResult(node,offset,x))node=undefined;}}}// No luck, do our own (potentially expensive) search 868 + if(!node||!view.docView.dom.contains(node)){var line=LineView.find(view.docView,lineStart);if(!line)return yOffset>block.top+block.height/2?block.to:block.from;var _domPosAtCoords=domPosAtCoords(line.dom,x,y);node=_domPosAtCoords.node;offset=_domPosAtCoords.offset;}return view.docView.posFromDOM(node,offset);}function posAtCoordsImprecise(view,contentRect,block,x,y){var into=Math.round((x-contentRect.left)*view.defaultCharacterWidth);if(view.lineWrapping&&block.height>view.defaultLineHeight*1.5){var line=Math.floor((y-block.top)/view.defaultLineHeight);into+=line*view.viewState.heightOracle.lineLength;}var content=view.state.sliceDoc(block.from,block.to);return block.from+text.findColumn(content,into,view.state.tabSize);}// In case of a high line height, Safari's caretRangeFromPoint treats 869 + // the space between lines as belonging to the last character of the 870 + // line before. This is used to detect such a result so that it can be 871 + // ignored (issue #401). 872 + function isSuspiciousCaretResult(node,offset,x){var len;if(node.nodeType!=3||offset!=(len=node.nodeValue.length))return false;for(var next=node.nextSibling;next;next=next.nextSibling){if(next.nodeType!=1||next.nodeName!="BR")return false;}return textRange(node,len-1,len).getBoundingClientRect().left>x;}function _moveToLineBoundary(view,start,forward,includeWrap){var line=view.state.doc.lineAt(start.head);var coords=!includeWrap||!view.lineWrapping?null:view.coordsAtPos(start.assoc<0&&start.head>line.from?start.head-1:start.head);if(coords){var editorRect=view.dom.getBoundingClientRect();var pos=view.posAtCoords({x:forward==(view.textDirection==exports.Direction.LTR)?editorRect.right-1:editorRect.left+1,y:(coords.top+coords.bottom)/2});if(pos!=null)return state.EditorSelection.cursor(pos,forward?-1:1);}var lineView=LineView.find(view.docView,start.head);var end=lineView?forward?lineView.posAtEnd:lineView.posAtStart:forward?line.to:line.from;return state.EditorSelection.cursor(end,forward?-1:1);}function _moveByChar(view,start,forward,by){var line=view.state.doc.lineAt(start.head),spans=view.bidiSpans(line);for(var cur=start,check=null;;){var next=moveVisually(line,spans,view.textDirection,cur,forward),_char2=movedOver;if(!next){if(line.number==(forward?view.state.doc.lines:1))return cur;_char2="\n";line=view.state.doc.line(line.number+(forward?1:-1));spans=view.bidiSpans(line);next=state.EditorSelection.cursor(forward?line.from:line.to);}if(!check){if(!by)return next;check=by(_char2);}else if(!check(_char2)){return cur;}cur=next;}}function byGroup(view,pos,start){var categorize=view.state.charCategorizer(pos);var cat=categorize(start);return function(next){var nextCat=categorize(next);if(cat==state.CharCategory.Space)cat=nextCat;return cat==nextCat;};}function _moveVertically(view,start,forward,distance){var startPos=start.head,dir=forward?1:-1;if(startPos==(forward?view.state.doc.length:0))return state.EditorSelection.cursor(startPos,start.assoc);var goal=start.goalColumn,startY;var rect=view.contentDOM.getBoundingClientRect();var startCoords=view.coordsAtPos(startPos),docTop=view.documentTop;if(startCoords){if(goal==null)goal=startCoords.left-rect.left;startY=dir<0?startCoords.top:startCoords.bottom;}else{var line=view.viewState.lineBlockAt(startPos-docTop);if(goal==null)goal=Math.min(rect.right-rect.left,view.defaultCharacterWidth*(startPos-line.from));startY=(dir<0?line.top:line.bottom)+docTop;}var resolvedGoal=rect.left+goal;var dist=distance!==null&&distance!==void 0?distance:view.defaultLineHeight>>1;for(var extra=0;;extra+=10){var curY=startY+(dist+extra)*dir;var pos=_posAtCoords(view,{x:resolvedGoal,y:curY},false,dir);if(curY<rect.top||curY>rect.bottom||(dir<0?pos<startPos:pos>startPos))return state.EditorSelection.cursor(pos,start.assoc,undefined,goal);}}function skipAtoms(view,oldPos,pos){var atoms=view.pluginField(PluginField.atomicRanges);for(;;){var moved=false;var _iterator48=_createForOfIteratorHelper(atoms),_step48;try{for(_iterator48.s();!(_step48=_iterator48.n()).done;){var set=_step48.value;set.between(pos.from-1,pos.from+1,function(from,to,value){if(pos.from>from&&pos.from<to){pos=oldPos.from>pos.from?state.EditorSelection.cursor(from,1):state.EditorSelection.cursor(to,-1);moved=true;}});}}catch(err){_iterator48.e(err);}finally{_iterator48.f();}if(!moved)return pos;}}// This will also be where dragging info and such goes 873 + var InputState=/*#__PURE__*/function(){function InputState(view){var _this29=this;_classCallCheck(this,InputState);this.lastKeyCode=0;this.lastKeyTime=0;// On iOS, some keys need to have their default behavior happen 874 + // (after which we retroactively handle them and reset the DOM) to 875 + // avoid messing up the virtual keyboard state. 876 + this.pendingIOSKey=undefined;this.lastSelectionOrigin=null;this.lastSelectionTime=0;this.lastEscPress=0;this.lastContextMenu=0;this.scrollHandlers=[];this.registeredEvents=[];this.customHandlers=[];// -1 means not in a composition. Otherwise, this counts the number 877 + // of changes made during the composition. The count is used to 878 + // avoid treating the start state of the composition, before any 879 + // changes have been made, as part of the composition. 880 + this.composing=-1;// Tracks whether the next change should be marked as starting the 881 + // composition (null means no composition, true means next is the 882 + // first, false means first has already been marked for this 883 + // composition) 884 + this.compositionFirstChange=null;this.compositionEndedAt=0;this.rapidCompositionStart=false;this.mouseSelection=null;var _loop4=function _loop4(type){var handler=handlers[type];view.contentDOM.addEventListener(type,function(event){if(type=="keydown"&&_this29.keydown(view,event))return;if(!eventBelongsToEditor(view,event)||_this29.ignoreDuringComposition(event))return;if(_this29.mustFlushObserver(event))view.observer.forceFlush();if(_this29.runCustomHandlers(type,view,event))event.preventDefault();else handler(view,event);});_this29.registeredEvents.push(type);};for(var type in handlers){_loop4(type);}this.notifiedFocused=view.hasFocus;this.ensureHandlers(view);// On Safari adding an input event handler somehow prevents an 885 + // issue where the composition vanishes when you press enter. 886 + if(browser.safari)view.contentDOM.addEventListener("input",function(){return null;});}_createClass(InputState,[{key:"setSelectionOrigin",value:function setSelectionOrigin(origin){this.lastSelectionOrigin=origin;this.lastSelectionTime=Date.now();}},{key:"ensureHandlers",value:function ensureHandlers(view){var _this30=this;var handlers=this.customHandlers=view.pluginField(domEventHandlers);var _iterator49=_createForOfIteratorHelper(handlers),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var set=_step49.value;var _loop5=function _loop5(type){if(_this30.registeredEvents.indexOf(type)<0&&type!="scroll"){_this30.registeredEvents.push(type);view.contentDOM.addEventListener(type,function(event){if(!eventBelongsToEditor(view,event))return;if(_this30.runCustomHandlers(type,view,event))event.preventDefault();});}};for(var type in set.handlers){_loop5(type);}}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}},{key:"runCustomHandlers",value:function runCustomHandlers(type,view,event){var _iterator50=_createForOfIteratorHelper(this.customHandlers),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var set=_step50.value;var handler=set.handlers[type];if(handler){try{if(handler.call(set.plugin,event,view)||event.defaultPrevented)return true;}catch(e){logException(view.state,e);}}}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}return false;}},{key:"runScrollHandlers",value:function runScrollHandlers(view,event){var _iterator51=_createForOfIteratorHelper(this.customHandlers),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var set=_step51.value;var handler=set.handlers.scroll;if(handler){try{handler.call(set.plugin,event,view);}catch(e){logException(view.state,e);}}}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}}},{key:"keydown",value:function keydown(view,event){var _this31=this;// Must always run, even if a custom handler handled the event 887 + this.lastKeyCode=event.keyCode;this.lastKeyTime=Date.now();if(this.screenKeyEvent(view,event))return true;// Chrome for Android usually doesn't fire proper key events, but 888 + // occasionally does, usually surrounded by a bunch of complicated 889 + // composition changes. When an enter or backspace key event is 890 + // seen, hold off on handling DOM events for a bit, and then 891 + // dispatch it. 892 + if(browser.android&&browser.chrome&&!event.synthetic&&(event.keyCode==13||event.keyCode==8)){view.observer.delayAndroidKey(event.key,event.keyCode);return true;}// Prevent the default behavior of Enter on iOS makes the 893 + // virtual keyboard get stuck in the wrong (lowercase) 894 + // state. So we let it go through, and then, in 895 + // applyDOMChange, notify key handlers of it and reset to 896 + // the state they produce. 897 + var pending;if(browser.ios&&(pending=PendingKeys.find(function(key){return key.keyCode==event.keyCode;}))&&!(event.ctrlKey||event.altKey||event.metaKey)&&!event.synthetic){this.pendingIOSKey=pending;setTimeout(function(){return _this31.flushIOSKey(view);},250);return true;}return false;}},{key:"flushIOSKey",value:function flushIOSKey(view){var key=this.pendingIOSKey;if(!key)return false;this.pendingIOSKey=undefined;return dispatchKey(view.contentDOM,key.key,key.keyCode);}},{key:"ignoreDuringComposition",value:function ignoreDuringComposition(event){if(!/^key/.test(event.type))return false;if(this.composing>0)return true;// See https://www.stum.de/2016/06/24/handling-ime-events-in-javascript/. 898 + // On some input method editors (IMEs), the Enter key is used to 899 + // confirm character selection. On Safari, when Enter is pressed, 900 + // compositionend and keydown events are sometimes emitted in the 901 + // wrong order. The key event should still be ignored, even when 902 + // it happens after the compositionend event. 903 + if(browser.safari&&Date.now()-this.compositionEndedAt<500){this.compositionEndedAt=0;return true;}return false;}},{key:"screenKeyEvent",value:function screenKeyEvent(view,event){var protectedTab=event.keyCode==9&&Date.now()<this.lastEscPress+2000;if(event.keyCode==27)this.lastEscPress=Date.now();else if(modifierCodes.indexOf(event.keyCode)<0)this.lastEscPress=0;return protectedTab;}},{key:"mustFlushObserver",value:function mustFlushObserver(event){return event.type=="keydown"&&event.keyCode!=229||event.type=="compositionend"&&!browser.ios;}},{key:"startMouseSelection",value:function startMouseSelection(mouseSelection){if(this.mouseSelection)this.mouseSelection.destroy();this.mouseSelection=mouseSelection;}},{key:"update",value:function update(_update4){if(this.mouseSelection)this.mouseSelection.update(_update4);if(_update4.transactions.length)this.lastKeyCode=this.lastSelectionTime=0;}},{key:"destroy",value:function destroy(){if(this.mouseSelection)this.mouseSelection.destroy();}}]);return InputState;}();var PendingKeys=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}];// Key codes for modifier keys 904 + var modifierCodes=[16,17,18,20,91,92,224,225];var MouseSelection=/*#__PURE__*/function(){function MouseSelection(view,startEvent,style,mustSelect){_classCallCheck(this,MouseSelection);this.view=view;this.style=style;this.mustSelect=mustSelect;this.lastEvent=startEvent;var doc=view.contentDOM.ownerDocument;doc.addEventListener("mousemove",this.move=this.move.bind(this));doc.addEventListener("mouseup",this.up=this.up.bind(this));this.extend=startEvent.shiftKey;this.multiple=view.state.facet(state.EditorState.allowMultipleSelections)&&addsSelectionRange(view,startEvent);this.dragMove=dragMovesSelection(view,startEvent);this.dragging=isInPrimarySelection(view,startEvent)&&getClickType(startEvent)==1?null:false;// When clicking outside of the selection, immediately apply the 905 + // effect of starting the selection 906 + if(this.dragging===false){startEvent.preventDefault();this.select(startEvent);}}_createClass(MouseSelection,[{key:"move",value:function move(event){if(event.buttons==0)return this.destroy();if(this.dragging!==false)return;this.select(this.lastEvent=event);}},{key:"up",value:function up(event){if(this.dragging==null)this.select(this.lastEvent);if(!this.dragging)event.preventDefault();this.destroy();}},{key:"destroy",value:function destroy(){var doc=this.view.contentDOM.ownerDocument;doc.removeEventListener("mousemove",this.move);doc.removeEventListener("mouseup",this.up);this.view.inputState.mouseSelection=null;}},{key:"select",value:function select(event){var selection=this.style.get(event,this.extend,this.multiple);if(this.mustSelect||!selection.eq(this.view.state.selection)||selection.main.assoc!=this.view.state.selection.main.assoc)this.view.dispatch({selection:selection,userEvent:"select.pointer",scrollIntoView:true});this.mustSelect=false;}},{key:"update",value:function update(_update5){var _this32=this;if(_update5.docChanged&&this.dragging)this.dragging=this.dragging.map(_update5.changes);if(this.style.update(_update5))setTimeout(function(){return _this32.select(_this32.lastEvent);},20);}}]);return MouseSelection;}();function addsSelectionRange(view,event){var facet=view.state.facet(clickAddsSelectionRange);return facet.length?facet[0](event):browser.mac?event.metaKey:event.ctrlKey;}function dragMovesSelection(view,event){var facet=view.state.facet(dragMovesSelection$1);return facet.length?facet[0](event):browser.mac?!event.altKey:!event.ctrlKey;}function isInPrimarySelection(view,event){var main=view.state.selection.main;if(main.empty)return false;// On boundary clicks, check whether the coordinates are inside the 907 + // selection's client rectangles 908 + var sel=getSelection(view.root);if(sel.rangeCount==0)return true;var rects=sel.getRangeAt(0).getClientRects();for(var _i33=0;_i33<rects.length;_i33++){var rect=rects[_i33];if(rect.left<=event.clientX&&rect.right>=event.clientX&&rect.top<=event.clientY&&rect.bottom>=event.clientY)return true;}return false;}function eventBelongsToEditor(view,event){if(!event.bubbles)return true;if(event.defaultPrevented)return false;for(var node=event.target,cView;node!=view.contentDOM;node=node.parentNode){if(!node||node.nodeType==11||(cView=ContentView.get(node))&&cView.ignoreEvent(event))return false;}return true;}var handlers=Object.create(null);// This is very crude, but unfortunately both these browsers _pretend_ 909 + // that they have a clipboard API—all the objects and methods are 910 + // there, they just don't work, and they are hard to test. 911 + var brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(view){var parent=view.dom.parentNode;if(!parent)return;var target=parent.appendChild(document.createElement("textarea"));target.style.cssText="position: fixed; left: -10000px; top: 10px";target.focus();setTimeout(function(){view.focus();target.remove();doPaste(view,target.value);},50);}function doPaste(view,input){var state$1=view.state,changes,i=1,text=state$1.toText(input);var byLine=text.lines==state$1.selection.ranges.length;var linewise=lastLinewiseCopy!=null&&state$1.selection.ranges.every(function(r){return r.empty;})&&lastLinewiseCopy==text.toString();if(linewise){var lastLine=-1;changes=state$1.changeByRange(function(range){var line=state$1.doc.lineAt(range.from);if(line.from==lastLine)return{range:range};lastLine=line.from;var insert=state$1.toText((byLine?text.line(i++).text:input)+state$1.lineBreak);return{changes:{from:line.from,insert:insert},range:state.EditorSelection.cursor(range.from+insert.length)};});}else if(byLine){changes=state$1.changeByRange(function(range){var line=text.line(i++);return{changes:{from:range.from,to:range.to,insert:line.text},range:state.EditorSelection.cursor(range.from+line.length)};});}else{changes=state$1.replaceSelection(text);}view.dispatch(changes,{userEvent:"input.paste",scrollIntoView:true});}handlers.keydown=function(view,event){view.inputState.setSelectionOrigin("select");};var lastTouch=0;handlers.touchstart=function(view,e){lastTouch=Date.now();view.inputState.setSelectionOrigin("select.pointer");};handlers.touchmove=function(view){view.inputState.setSelectionOrigin("select.pointer");};handlers.mousedown=function(view,event){view.observer.flush();if(lastTouch>Date.now()-2000&&getClickType(event)==1)return;// Ignore touch interaction 912 + var style=null;var _iterator52=_createForOfIteratorHelper(view.state.facet(mouseSelectionStyle)),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var makeStyle=_step52.value;style=makeStyle(view,event);if(style)break;}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}if(!style&&event.button==0)style=basicMouseSelection(view,event);if(style){var mustFocus=view.root.activeElement!=view.contentDOM;if(mustFocus)view.observer.ignore(function(){return focusPreventScroll(view.contentDOM);});view.inputState.startMouseSelection(new MouseSelection(view,event,style,mustFocus));}};function rangeForClick(view,pos,bias,type){if(type==1){// Single click 913 + return state.EditorSelection.cursor(pos,bias);}else if(type==2){// Double click 914 + return groupAt(view.state,pos,bias);}else{// Triple click 915 + var visual=LineView.find(view.docView,pos),line=view.state.doc.lineAt(visual?visual.posAtEnd:pos);var from=visual?visual.posAtStart:line.from,to=visual?visual.posAtEnd:line.to;if(to<view.state.doc.length&&to==line.to)to++;return state.EditorSelection.range(from,to);}}var insideY=function insideY(y,rect){return y>=rect.top&&y<=rect.bottom;};var inside=function inside(x,y,rect){return insideY(y,rect)&&x>=rect.left&&x<=rect.right;};// Try to determine, for the given coordinates, associated with the 916 + // given position, whether they are related to the element before or 917 + // the element after the position. 918 + function findPositionSide(view,pos,x,y){var line=LineView.find(view.docView,pos);if(!line)return 1;var off=pos-line.posAtStart;// Line boundaries point into the line 919 + if(off==0)return 1;if(off==line.length)return-1;// Positions on top of an element point at that element 920 + var before=line.coordsAt(off,-1);if(before&&inside(x,y,before))return-1;var after=line.coordsAt(off,1);if(after&&inside(x,y,after))return 1;// This is probably a line wrap point. Pick before if the point is 921 + // beside it. 922 + return before&&insideY(y,before)?-1:1;}function queryPos(view,event){var pos=view.posAtCoords({x:event.clientX,y:event.clientY},false);return{pos:pos,bias:findPositionSide(view,pos,event.clientX,event.clientY)};}var BadMouseDetail=browser.ie&&browser.ie_version<=11;var lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(event){if(!BadMouseDetail)return event.detail;var last=lastMouseDown,lastTime=lastMouseDownTime;lastMouseDown=event;lastMouseDownTime=Date.now();return lastMouseDownCount=!last||lastTime>Date.now()-400&&Math.abs(last.clientX-event.clientX)<2&&Math.abs(last.clientY-event.clientY)<2?(lastMouseDownCount+1)%3:1;}function basicMouseSelection(view,event){var start=queryPos(view,event),type=getClickType(event);var startSel=view.state.selection;var last=start,lastEvent=event;return{update:function update(_update6){if(_update6.docChanged){if(start)start.pos=_update6.changes.mapPos(start.pos);startSel=startSel.map(_update6.changes);lastEvent=null;}},get:function get(event,extend,multiple){var cur;if(lastEvent&&event.clientX==lastEvent.clientX&&event.clientY==lastEvent.clientY)cur=last;else{cur=last=queryPos(view,event);lastEvent=event;}if(!cur||!start)return startSel;var range=rangeForClick(view,cur.pos,cur.bias,type);if(start.pos!=cur.pos&&!extend){var startRange=rangeForClick(view,start.pos,start.bias,type);var from=Math.min(startRange.from,range.from),to=Math.max(startRange.to,range.to);range=from<range.from?state.EditorSelection.range(from,to):state.EditorSelection.range(to,from);}if(extend)return startSel.replaceRange(startSel.main.extend(range.from,range.to));else if(multiple)return startSel.addRange(range);else return state.EditorSelection.create([range]);}};}handlers.dragstart=function(view,event){var main=view.state.selection.main;var mouseSelection=view.inputState.mouseSelection;if(mouseSelection)mouseSelection.dragging=main;if(event.dataTransfer){event.dataTransfer.setData("Text",view.state.sliceDoc(main.from,main.to));event.dataTransfer.effectAllowed="copyMove";}};function dropText(view,event,text,direct){if(!text)return;var dropPos=view.posAtCoords({x:event.clientX,y:event.clientY},false);event.preventDefault();var mouseSelection=view.inputState.mouseSelection;var del=direct&&mouseSelection&&mouseSelection.dragging&&mouseSelection.dragMove?{from:mouseSelection.dragging.from,to:mouseSelection.dragging.to}:null;var ins={from:dropPos,insert:text};var changes=view.state.changes(del?[del,ins]:ins);view.focus();view.dispatch({changes:changes,selection:{anchor:changes.mapPos(dropPos,-1),head:changes.mapPos(dropPos,1)},userEvent:del?"move.drop":"input.drop"});}handlers.drop=function(view,event){if(!event.dataTransfer)return;if(view.state.readOnly)return event.preventDefault();var files=event.dataTransfer.files;if(files&&files.length){(function(){// For a file drop, read the file's text. 923 + event.preventDefault();var text=Array(files.length),read=0;var finishFile=function finishFile(){if(++read==files.length)dropText(view,event,text.filter(function(s){return s!=null;}).join(view.state.lineBreak),false);};var _loop6=function _loop6(_i34){var reader=new FileReader();reader.onerror=finishFile;reader.onload=function(){if(!/[\x00-\x08\x0e-\x1f]{2}/.test(reader.result))text[_i34]=reader.result;finishFile();};reader.readAsText(files[_i34]);};for(var _i34=0;_i34<files.length;_i34++){_loop6(_i34);}})();}else{dropText(view,event,event.dataTransfer.getData("Text"),true);}};handlers.paste=function(view,event){if(view.state.readOnly)return event.preventDefault();view.observer.flush();var data=brokenClipboardAPI?null:event.clipboardData;if(data){doPaste(view,data.getData("text/plain"));event.preventDefault();}else{capturePaste(view);}};function captureCopy(view,text){// The extra wrapper is somehow necessary on IE/Edge to prevent the 924 + // content from being mangled when it is put onto the clipboard 925 + var parent=view.dom.parentNode;if(!parent)return;var target=parent.appendChild(document.createElement("textarea"));target.style.cssText="position: fixed; left: -10000px; top: 10px";target.value=text;target.focus();target.selectionEnd=text.length;target.selectionStart=0;setTimeout(function(){target.remove();view.focus();},50);}function copiedRange(state){var content=[],ranges=[],linewise=false;var _iterator53=_createForOfIteratorHelper(state.selection.ranges),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var range=_step53.value;if(!range.empty){content.push(state.sliceDoc(range.from,range.to));ranges.push(range);}}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}if(!content.length){// Nothing selected, do a line-wise copy 926 + var upto=-1;var _iterator54=_createForOfIteratorHelper(state.selection.ranges),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var from=_step54.value.from;var line=state.doc.lineAt(from);if(line.number>upto){content.push(line.text);ranges.push({from:line.from,to:Math.min(state.doc.length,line.to+1)});}upto=line.number;}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}linewise=true;}return{text:content.join(state.lineBreak),ranges:ranges,linewise:linewise};}var lastLinewiseCopy=null;handlers.copy=handlers.cut=function(view,event){var _copiedRange=copiedRange(view.state),text=_copiedRange.text,ranges=_copiedRange.ranges,linewise=_copiedRange.linewise;if(!text&&!linewise)return;lastLinewiseCopy=linewise?text:null;var data=brokenClipboardAPI?null:event.clipboardData;if(data){event.preventDefault();data.clearData();data.setData("text/plain",text);}else{captureCopy(view,text);}if(event.type=="cut"&&!view.state.readOnly)view.dispatch({changes:ranges,scrollIntoView:true,userEvent:"delete.cut"});};handlers.focus=handlers.blur=function(view){setTimeout(function(){if(view.hasFocus!=view.inputState.notifiedFocused)view.update([]);},10);};handlers.beforeprint=function(view){view.viewState.printing=true;view.requestMeasure();setTimeout(function(){view.viewState.printing=false;view.requestMeasure();},2000);};function forceClearComposition(view,rapid){if(view.docView.compositionDeco.size){view.inputState.rapidCompositionStart=rapid;try{view.update([]);}finally{view.inputState.rapidCompositionStart=false;}}}handlers.compositionstart=handlers.compositionupdate=function(view){if(view.inputState.compositionFirstChange==null)view.inputState.compositionFirstChange=true;if(view.inputState.composing<0){// FIXME possibly set a timeout to clear it again on Android 927 + view.inputState.composing=0;if(view.docView.compositionDeco.size){view.observer.flush();forceClearComposition(view,true);}}};handlers.compositionend=function(view){view.inputState.composing=-1;view.inputState.compositionEndedAt=Date.now();view.inputState.compositionFirstChange=null;setTimeout(function(){if(view.inputState.composing<0)forceClearComposition(view,false);},50);};handlers.contextmenu=function(view){view.inputState.lastContextMenu=Date.now();};handlers.beforeinput=function(view,event){var _a;// Because Chrome Android doesn't fire useful key events, use 928 + // beforeinput to detect backspace (and possibly enter and delete, 929 + // but those usually don't even seem to fire beforeinput events at 930 + // the moment) and fake a key event for it. 931 + // 932 + // (preventDefault on beforeinput, though supported in the spec, 933 + // seems to do nothing at all on Chrome). 934 + var pending;if(browser.chrome&&browser.android&&(pending=PendingKeys.find(function(key){return key.inputType==event.inputType;}))){view.observer.delayAndroidKey(pending.key,pending.keyCode);if(pending.key=="Backspace"||pending.key=="Delete"){var startViewHeight=((_a=window.visualViewport)===null||_a===void 0?void 0:_a.height)||0;setTimeout(function(){var _a;// Backspacing near uneditable nodes on Chrome Android sometimes 935 + // closes the virtual keyboard. This tries to crudely detect 936 + // that and refocus to get it back. 937 + if((((_a=window.visualViewport)===null||_a===void 0?void 0:_a.height)||0)>startViewHeight+10&&view.hasFocus){view.contentDOM.blur();view.focus();}},100);}}};var wrappingWhiteSpace=["pre-wrap","normal","pre-line","break-spaces"];var HeightOracle=/*#__PURE__*/function(){function HeightOracle(){_classCallCheck(this,HeightOracle);this.doc=text.Text.empty;this.lineWrapping=false;this.direction=exports.Direction.LTR;this.heightSamples={};this.lineHeight=14;this.charWidth=7;this.lineLength=30;// Used to track, during updateHeight, if any actual heights changed 938 + this.heightChanged=false;}_createClass(HeightOracle,[{key:"heightForGap",value:function heightForGap(from,to){var lines=this.doc.lineAt(to).number-this.doc.lineAt(from).number+1;if(this.lineWrapping)lines+=Math.ceil((to-from-lines*this.lineLength*0.5)/this.lineLength);return this.lineHeight*lines;}},{key:"heightForLine",value:function heightForLine(length){if(!this.lineWrapping)return this.lineHeight;var lines=1+Math.max(0,Math.ceil((length-this.lineLength)/(this.lineLength-5)));return lines*this.lineHeight;}},{key:"setDoc",value:function setDoc(doc){this.doc=doc;return this;}},{key:"mustRefreshForStyle",value:function mustRefreshForStyle(whiteSpace,direction){return wrappingWhiteSpace.indexOf(whiteSpace)>-1!=this.lineWrapping||this.direction!=direction;}},{key:"mustRefreshForHeights",value:function mustRefreshForHeights(lineHeights){var newHeight=false;for(var _i35=0;_i35<lineHeights.length;_i35++){var h=lineHeights[_i35];if(h<0){_i35++;}else if(!this.heightSamples[Math.floor(h*10)]){// Round to .1 pixels 939 + newHeight=true;this.heightSamples[Math.floor(h*10)]=true;}}return newHeight;}},{key:"refresh",value:function refresh(whiteSpace,direction,lineHeight,charWidth,lineLength,knownHeights){var lineWrapping=wrappingWhiteSpace.indexOf(whiteSpace)>-1;var changed=Math.round(lineHeight)!=Math.round(this.lineHeight)||this.lineWrapping!=lineWrapping||this.direction!=direction;this.lineWrapping=lineWrapping;this.direction=direction;this.lineHeight=lineHeight;this.charWidth=charWidth;this.lineLength=lineLength;if(changed){this.heightSamples={};for(var _i36=0;_i36<knownHeights.length;_i36++){var h=knownHeights[_i36];if(h<0)_i36++;else this.heightSamples[Math.floor(h*10)]=true;}}return changed;}}]);return HeightOracle;}();// This object is used by `updateHeight` to make DOM measurements 940 + // arrive at the right nides. The `heights` array is a sequence of 941 + // block heights, starting from position `from`. 942 + var MeasuredHeights=/*#__PURE__*/function(){function MeasuredHeights(from,heights){_classCallCheck(this,MeasuredHeights);this.from=from;this.heights=heights;this.index=0;}_createClass(MeasuredHeights,[{key:"more",get:function get(){return this.index<this.heights.length;}}]);return MeasuredHeights;}();/** 943 + Record used to represent information about a block-level element 944 + in the editor view. 945 + */var BlockInfo=/*#__PURE__*/function(){/** 946 + @internal 947 + */function BlockInfo(/** 948 + The start of the element in the document. 949 + */from,/** 950 + The length of the element. 951 + */length,/** 952 + The top position of the element (relative to the top of the 953 + document). 954 + */top,/** 955 + Its height. 956 + */height,/** 957 + The type of element this is. When querying lines, this may be 958 + an array of all the blocks that make up the line. 959 + */type){_classCallCheck(this,BlockInfo);this.from=from;this.length=length;this.top=top;this.height=height;this.type=type;}/** 960 + The end of the element as a document position. 961 + */_createClass(BlockInfo,[{key:"to",get:function get(){return this.from+this.length;}/** 962 + The bottom position of the element. 963 + */},{key:"bottom",get:function get(){return this.top+this.height;}/** 964 + @internal 965 + */},{key:"join",value:function join(other){var detail=(Array.isArray(this.type)?this.type:[this]).concat(Array.isArray(other.type)?other.type:[other]);return new BlockInfo(this.from,this.length+other.length,this.top,this.height+other.height,detail);}/** 966 + FIXME remove on next breaking release @internal 967 + */},{key:"moveY",value:function moveY(offset){return!offset?this:new BlockInfo(this.from,this.length,this.top+offset,this.height,Array.isArray(this.type)?this.type.map(function(b){return b.moveY(offset);}):this.type);}}]);return BlockInfo;}();var QueryType;(function(QueryType){QueryType[QueryType["ByPos"]=0]="ByPos";QueryType[QueryType["ByHeight"]=1]="ByHeight";QueryType[QueryType["ByPosNoHeight"]=2]="ByPosNoHeight";})(QueryType||(QueryType={}));var Epsilon=1e-3;var HeightMap=/*#__PURE__*/function(){function HeightMap(length,// The number of characters covered 968 + height){var flags=arguments.length>2&&arguments[2]!==undefined?arguments[2]:2;_classCallCheck(this,HeightMap);this.length=length;this.height=height;this.flags=flags;}_createClass(HeightMap,[{key:"outdated",get:function get(){return(this.flags&2/* Outdated */)>0;},set:function set(value){this.flags=(value?2/* Outdated */:0)|this.flags&~2/* Outdated */;}},{key:"setHeight",value:function setHeight(oracle,height){if(this.height!=height){if(Math.abs(this.height-height)>Epsilon)oracle.heightChanged=true;this.height=height;}}// Base case is to replace a leaf node, which simply builds a tree 969 + // from the new nodes and returns that (HeightMapBranch and 970 + // HeightMapGap override this to actually use from/to) 971 + },{key:"replace",value:function replace(_from,_to,nodes){return HeightMap.of(nodes);}// Again, these are base cases, and are overridden for branch and gap nodes. 972 + },{key:"decomposeLeft",value:function decomposeLeft(_to,result){result.push(this);}},{key:"decomposeRight",value:function decomposeRight(_from,result){result.push(this);}},{key:"applyChanges",value:function applyChanges(decorations,oldDoc,oracle,changes){var me=this;for(var _i37=changes.length-1;_i37>=0;_i37--){var _changes$_i=changes[_i37],fromA=_changes$_i.fromA,toA=_changes$_i.toA,fromB=_changes$_i.fromB,toB=_changes$_i.toB;var start=me.lineAt(fromA,QueryType.ByPosNoHeight,oldDoc,0,0);var end=start.to>=toA?start:me.lineAt(toA,QueryType.ByPosNoHeight,oldDoc,0,0);toB+=end.to-toA;toA=end.to;while(_i37>0&&start.from<=changes[_i37-1].toA){fromA=changes[_i37-1].fromA;fromB=changes[_i37-1].fromB;_i37--;if(fromA<start.from)start=me.lineAt(fromA,QueryType.ByPosNoHeight,oldDoc,0,0);}fromB+=start.from-fromA;fromA=start.from;var nodes=NodeBuilder.build(oracle,decorations,fromB,toB);me=me.replace(fromA,toA,nodes);}return me.updateHeight(oracle,0);}}],[{key:"empty",value:function empty(){return new HeightMapText(0,0);}// nodes uses null values to indicate the position of line breaks. 973 + // There are never line breaks at the start or end of the array, or 974 + // two line breaks next to each other, and the array isn't allowed 975 + // to be empty (same restrictions as return value from the builder). 976 + },{key:"of",value:function of(nodes){if(nodes.length==1)return nodes[0];var i=0,j=nodes.length,before=0,after=0;for(;;){if(i==j){if(before>after*2){var split=nodes[i-1];if(split["break"])nodes.splice(--i,1,split.left,null,split.right);else nodes.splice(--i,1,split.left,split.right);j+=1+split["break"];before-=split.size;}else if(after>before*2){var _split=nodes[j];if(_split["break"])nodes.splice(j,1,_split.left,null,_split.right);else nodes.splice(j,1,_split.left,_split.right);j+=2+_split["break"];after-=_split.size;}else{break;}}else if(before<after){var next=nodes[i++];if(next)before+=next.size;}else{var _next2=nodes[--j];if(_next2)after+=_next2.size;}}var brk=0;if(nodes[i-1]==null){brk=1;i--;}else if(nodes[i]==null){brk=1;j++;}return new HeightMapBranch(HeightMap.of(nodes.slice(0,i)),brk,HeightMap.of(nodes.slice(j)));}}]);return HeightMap;}();HeightMap.prototype.size=1;var HeightMapBlock=/*#__PURE__*/function(_HeightMap){_inherits(HeightMapBlock,_HeightMap);var _super19=_createSuper(HeightMapBlock);function HeightMapBlock(length,height,type){var _this33;_classCallCheck(this,HeightMapBlock);_this33=_super19.call(this,length,height);_this33.type=type;return _this33;}_createClass(HeightMapBlock,[{key:"blockAt",value:function blockAt(_height,_doc,top,offset){return new BlockInfo(offset,this.length,top,this.height,this.type);}},{key:"lineAt",value:function lineAt(_value,_type,doc,top,offset){return this.blockAt(0,doc,top,offset);}},{key:"forEachLine",value:function forEachLine(_from,_to,doc,top,offset,f){f(this.blockAt(0,doc,top,offset));}},{key:"updateHeight",value:function updateHeight(oracle){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var _force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var measured=arguments.length>3?arguments[3]:undefined;if(measured&&measured.from<=offset&&measured.more)this.setHeight(oracle,measured.heights[measured.index++]);this.outdated=false;return this;}},{key:"toString",value:function toString(){return"block(".concat(this.length,")");}}]);return HeightMapBlock;}(HeightMap);var HeightMapText=/*#__PURE__*/function(_HeightMapBlock){_inherits(HeightMapText,_HeightMapBlock);var _super20=_createSuper(HeightMapText);function HeightMapText(length,height){var _this34;_classCallCheck(this,HeightMapText);_this34=_super20.call(this,length,height,exports.BlockType.Text);_this34.collapsed=0;// Amount of collapsed content in the line 977 + _this34.widgetHeight=0;// Maximum inline widget height 978 + return _this34;}_createClass(HeightMapText,[{key:"replace",value:function replace(_from,_to,nodes){var node=nodes[0];if(nodes.length==1&&(node instanceof HeightMapText||node instanceof HeightMapGap&&node.flags&4/* SingleLine */)&&Math.abs(this.length-node.length)<10){if(node instanceof HeightMapGap)node=new HeightMapText(node.length,this.height);else node.height=this.height;if(!this.outdated)node.outdated=false;return node;}else{return HeightMap.of(nodes);}}},{key:"updateHeight",value:function updateHeight(oracle){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var measured=arguments.length>3?arguments[3]:undefined;if(measured&&measured.from<=offset&&measured.more)this.setHeight(oracle,measured.heights[measured.index++]);else if(force||this.outdated)this.setHeight(oracle,Math.max(this.widgetHeight,oracle.heightForLine(this.length-this.collapsed)));this.outdated=false;return this;}},{key:"toString",value:function toString(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")");}}]);return HeightMapText;}(HeightMapBlock);var HeightMapGap=/*#__PURE__*/function(_HeightMap2){_inherits(HeightMapGap,_HeightMap2);var _super21=_createSuper(HeightMapGap);function HeightMapGap(length){_classCallCheck(this,HeightMapGap);return _super21.call(this,length,0);}_createClass(HeightMapGap,[{key:"lines",value:function lines(doc,offset){var firstLine=doc.lineAt(offset).number,lastLine=doc.lineAt(offset+this.length).number;return{firstLine:firstLine,lastLine:lastLine,lineHeight:this.height/(lastLine-firstLine+1)};}},{key:"blockAt",value:function blockAt(height,doc,top,offset){var _this$lines=this.lines(doc,offset),firstLine=_this$lines.firstLine,lastLine=_this$lines.lastLine,lineHeight=_this$lines.lineHeight;var line=Math.max(0,Math.min(lastLine-firstLine,Math.floor((height-top)/lineHeight)));var _doc$line=doc.line(firstLine+line),from=_doc$line.from,length=_doc$line.length;return new BlockInfo(from,length,top+lineHeight*line,lineHeight,exports.BlockType.Text);}},{key:"lineAt",value:function lineAt(value,type,doc,top,offset){if(type==QueryType.ByHeight)return this.blockAt(value,doc,top,offset);if(type==QueryType.ByPosNoHeight){var _doc$lineAt=doc.lineAt(value),_from2=_doc$lineAt.from,to=_doc$lineAt.to;return new BlockInfo(_from2,to-_from2,0,0,exports.BlockType.Text);}var _this$lines2=this.lines(doc,offset),firstLine=_this$lines2.firstLine,lineHeight=_this$lines2.lineHeight;var _doc$lineAt2=doc.lineAt(value),from=_doc$lineAt2.from,length=_doc$lineAt2.length,number=_doc$lineAt2.number;return new BlockInfo(from,length,top+lineHeight*(number-firstLine),lineHeight,exports.BlockType.Text);}},{key:"forEachLine",value:function forEachLine(from,to,doc,top,offset,f){var _this$lines3=this.lines(doc,offset),firstLine=_this$lines3.firstLine,lineHeight=_this$lines3.lineHeight;for(var pos=Math.max(from,offset),end=Math.min(offset+this.length,to);pos<=end;){var line=doc.lineAt(pos);if(pos==from)top+=lineHeight*(line.number-firstLine);f(new BlockInfo(line.from,line.length,top,lineHeight,exports.BlockType.Text));top+=lineHeight;pos=line.to+1;}}},{key:"replace",value:function replace(from,to,nodes){var after=this.length-to;if(after>0){var last=nodes[nodes.length-1];if(last instanceof HeightMapGap)nodes[nodes.length-1]=new HeightMapGap(last.length+after);else nodes.push(null,new HeightMapGap(after-1));}if(from>0){var first=nodes[0];if(first instanceof HeightMapGap)nodes[0]=new HeightMapGap(from+first.length);else nodes.unshift(new HeightMapGap(from-1),null);}return HeightMap.of(nodes);}},{key:"decomposeLeft",value:function decomposeLeft(to,result){result.push(new HeightMapGap(to-1),null);}},{key:"decomposeRight",value:function decomposeRight(from,result){result.push(null,new HeightMapGap(this.length-from-1));}},{key:"updateHeight",value:function updateHeight(oracle){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var measured=arguments.length>3?arguments[3]:undefined;var end=offset+this.length;if(measured&&measured.from<=offset+this.length&&measured.more){// Fill in part of this gap with measured lines. We know there 979 + // can't be widgets or collapsed ranges in those lines, because 980 + // they would already have been added to the heightmap (gaps 981 + // only contain plain text). 982 + var nodes=[],pos=Math.max(offset,measured.from),singleHeight=-1;var wasChanged=oracle.heightChanged;if(measured.from>offset)nodes.push(new HeightMapGap(measured.from-offset-1).updateHeight(oracle,offset));while(pos<=end&&measured.more){var len=oracle.doc.lineAt(pos).length;if(nodes.length)nodes.push(null);var height=measured.heights[measured.index++];if(singleHeight==-1)singleHeight=height;else if(Math.abs(height-singleHeight)>=Epsilon)singleHeight=-2;var line=new HeightMapText(len,height);line.outdated=false;nodes.push(line);pos+=len+1;}if(pos<=end)nodes.push(null,new HeightMapGap(end-pos).updateHeight(oracle,pos));var result=HeightMap.of(nodes);oracle.heightChanged=wasChanged||singleHeight<0||Math.abs(result.height-this.height)>=Epsilon||Math.abs(singleHeight-this.lines(oracle.doc,offset).lineHeight)>=Epsilon;return result;}else if(force||this.outdated){this.setHeight(oracle,oracle.heightForGap(offset,offset+this.length));this.outdated=false;}return this;}},{key:"toString",value:function toString(){return"gap(".concat(this.length,")");}}]);return HeightMapGap;}(HeightMap);var HeightMapBranch=/*#__PURE__*/function(_HeightMap3){_inherits(HeightMapBranch,_HeightMap3);var _super22=_createSuper(HeightMapBranch);function HeightMapBranch(left,brk,right){var _this35;_classCallCheck(this,HeightMapBranch);_this35=_super22.call(this,left.length+brk+right.length,left.height+right.height,brk|(left.outdated||right.outdated?2/* Outdated */:0));_this35.left=left;_this35.right=right;_this35.size=left.size+right.size;return _this35;}_createClass(HeightMapBranch,[{key:"break",get:function get(){return this.flags&1/* Break */;}},{key:"blockAt",value:function blockAt(height,doc,top,offset){var mid=top+this.left.height;return height<mid?this.left.blockAt(height,doc,top,offset):this.right.blockAt(height,doc,mid,offset+this.left.length+this["break"]);}},{key:"lineAt",value:function lineAt(value,type,doc,top,offset){var rightTop=top+this.left.height,rightOffset=offset+this.left.length+this["break"];var left=type==QueryType.ByHeight?value<rightTop:value<rightOffset;var base=left?this.left.lineAt(value,type,doc,top,offset):this.right.lineAt(value,type,doc,rightTop,rightOffset);if(this["break"]||(left?base.to<rightOffset:base.from>rightOffset))return base;var subQuery=type==QueryType.ByPosNoHeight?QueryType.ByPosNoHeight:QueryType.ByPos;if(left)return base.join(this.right.lineAt(rightOffset,subQuery,doc,rightTop,rightOffset));else return this.left.lineAt(rightOffset,subQuery,doc,top,offset).join(base);}},{key:"forEachLine",value:function forEachLine(from,to,doc,top,offset,f){var rightTop=top+this.left.height,rightOffset=offset+this.left.length+this["break"];if(this["break"]){if(from<rightOffset)this.left.forEachLine(from,to,doc,top,offset,f);if(to>=rightOffset)this.right.forEachLine(from,to,doc,rightTop,rightOffset,f);}else{var mid=this.lineAt(rightOffset,QueryType.ByPos,doc,top,offset);if(from<mid.from)this.left.forEachLine(from,mid.from-1,doc,top,offset,f);if(mid.to>=from&&mid.from<=to)f(mid);if(to>mid.to)this.right.forEachLine(mid.to+1,to,doc,rightTop,rightOffset,f);}}},{key:"replace",value:function replace(from,to,nodes){var rightStart=this.left.length+this["break"];if(to<rightStart)return this.balanced(this.left.replace(from,to,nodes),this.right);if(from>this.left.length)return this.balanced(this.left,this.right.replace(from-rightStart,to-rightStart,nodes));var result=[];if(from>0)this.decomposeLeft(from,result);var left=result.length;var _iterator55=_createForOfIteratorHelper(nodes),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var node=_step55.value;result.push(node);}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}if(from>0)mergeGaps(result,left-1);if(to<this.length){var right=result.length;this.decomposeRight(to,result);mergeGaps(result,right);}return HeightMap.of(result);}},{key:"decomposeLeft",value:function decomposeLeft(to,result){var left=this.left.length;if(to<=left)return this.left.decomposeLeft(to,result);result.push(this.left);if(this["break"]){left++;if(to>=left)result.push(null);}if(to>left)this.right.decomposeLeft(to-left,result);}},{key:"decomposeRight",value:function decomposeRight(from,result){var left=this.left.length,right=left+this["break"];if(from>=right)return this.right.decomposeRight(from-right,result);if(from<left)this.left.decomposeRight(from,result);if(this["break"]&&from<right)result.push(null);result.push(this.right);}},{key:"balanced",value:function balanced(left,right){if(left.size>2*right.size||right.size>2*left.size)return HeightMap.of(this["break"]?[left,null,right]:[left,right]);this.left=left;this.right=right;this.height=left.height+right.height;this.outdated=left.outdated||right.outdated;this.size=left.size+right.size;this.length=left.length+this["break"]+right.length;return this;}},{key:"updateHeight",value:function updateHeight(oracle){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var measured=arguments.length>3?arguments[3]:undefined;var left=this.left,right=this.right,rightStart=offset+left.length+this["break"],rebalance=null;if(measured&&measured.from<=offset+left.length&&measured.more)rebalance=left=left.updateHeight(oracle,offset,force,measured);else left.updateHeight(oracle,offset,force);if(measured&&measured.from<=rightStart+right.length&&measured.more)rebalance=right=right.updateHeight(oracle,rightStart,force,measured);else right.updateHeight(oracle,rightStart,force);if(rebalance)return this.balanced(left,right);this.height=this.left.height+this.right.height;this.outdated=false;return this;}},{key:"toString",value:function toString(){return this.left+(this["break"]?" ":"-")+this.right;}}]);return HeightMapBranch;}(HeightMap);function mergeGaps(nodes,around){var before,after;if(nodes[around]==null&&(before=nodes[around-1])instanceof HeightMapGap&&(after=nodes[around+1])instanceof HeightMapGap)nodes.splice(around-1,3,new HeightMapGap(before.length+1+after.length));}var relevantWidgetHeight=5;var NodeBuilder=/*#__PURE__*/function(){function NodeBuilder(pos,oracle){_classCallCheck(this,NodeBuilder);this.pos=pos;this.oracle=oracle;this.nodes=[];this.lineStart=-1;this.lineEnd=-1;this.covering=null;this.writtenTo=pos;}_createClass(NodeBuilder,[{key:"isCovered",get:function get(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering;}},{key:"span",value:function span(_from,to){if(this.lineStart>-1){var end=Math.min(to,this.lineEnd),last=this.nodes[this.nodes.length-1];if(last instanceof HeightMapText)last.length+=end-this.pos;else if(end>this.pos||!this.isCovered)this.nodes.push(new HeightMapText(end-this.pos,-1));this.writtenTo=end;if(to>end){this.nodes.push(null);this.writtenTo++;this.lineStart=-1;}}this.pos=to;}},{key:"point",value:function point(from,to,deco){if(from<to||deco.heightRelevant){var height=deco.widget?deco.widget.estimatedHeight:0;if(height<0)height=this.oracle.lineHeight;var len=to-from;if(deco.block){this.addBlock(new HeightMapBlock(len,height,deco.type));}else if(len||height>=relevantWidgetHeight){this.addLineDeco(height,len);}}else if(to>from){this.span(from,to);}if(this.lineEnd>-1&&this.lineEnd<this.pos)this.lineEnd=this.oracle.doc.lineAt(this.pos).to;}},{key:"enterLine",value:function enterLine(){if(this.lineStart>-1)return;var _this$oracle$doc$line=this.oracle.doc.lineAt(this.pos),from=_this$oracle$doc$line.from,to=_this$oracle$doc$line.to;this.lineStart=from;this.lineEnd=to;if(this.writtenTo<from){if(this.writtenTo<from-1||this.nodes[this.nodes.length-1]==null)this.nodes.push(this.blankContent(this.writtenTo,from-1));this.nodes.push(null);}if(this.pos>from)this.nodes.push(new HeightMapText(this.pos-from,-1));this.writtenTo=this.pos;}},{key:"blankContent",value:function blankContent(from,to){var gap=new HeightMapGap(to-from);if(this.oracle.doc.lineAt(from).to==to)gap.flags|=4/* SingleLine */;return gap;}},{key:"ensureLine",value:function ensureLine(){this.enterLine();var last=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(last instanceof HeightMapText)return last;var line=new HeightMapText(0,-1);this.nodes.push(line);return line;}},{key:"addBlock",value:function addBlock(block){this.enterLine();if(block.type==exports.BlockType.WidgetAfter&&!this.isCovered)this.ensureLine();this.nodes.push(block);this.writtenTo=this.pos=this.pos+block.length;if(block.type!=exports.BlockType.WidgetBefore)this.covering=block;}},{key:"addLineDeco",value:function addLineDeco(height,length){var line=this.ensureLine();line.length+=length;line.collapsed+=length;line.widgetHeight=Math.max(line.widgetHeight,height);this.writtenTo=this.pos=this.pos+length;}},{key:"finish",value:function finish(from){var last=this.nodes.length==0?null:this.nodes[this.nodes.length-1];if(this.lineStart>-1&&!(last instanceof HeightMapText)&&!this.isCovered)this.nodes.push(new HeightMapText(0,-1));else if(this.writtenTo<this.pos||last==null)this.nodes.push(this.blankContent(this.writtenTo,this.pos));var pos=from;var _iterator56=_createForOfIteratorHelper(this.nodes),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var node=_step56.value;if(node instanceof HeightMapText)node.updateHeight(this.oracle,pos);pos+=node?node.length:1;}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}return this.nodes;}// Always called with a region that on both sides either stretches 983 + // to a line break or the end of the document. 984 + // The returned array uses null to indicate line breaks, but never 985 + // starts or ends in a line break, or has multiple line breaks next 986 + // to each other. 987 + }],[{key:"build",value:function build(oracle,decorations,from,to){var builder=new NodeBuilder(from,oracle);rangeset.RangeSet.spans(decorations,from,to,builder,0);return builder.finish(from);}}]);return NodeBuilder;}();function heightRelevantDecoChanges(a,b,diff){var comp=new DecorationComparator();rangeset.RangeSet.compare(a,b,diff,comp,0);return comp.changes;}var DecorationComparator=/*#__PURE__*/function(){function DecorationComparator(){_classCallCheck(this,DecorationComparator);this.changes=[];}_createClass(DecorationComparator,[{key:"compareRange",value:function compareRange(){}},{key:"comparePoint",value:function comparePoint(from,to,a,b){if(from<to||a&&a.heightRelevant||b&&b.heightRelevant)addRange(from,to,this.changes,5);}}]);return DecorationComparator;}();function visiblePixelRange(dom,paddingTop){var rect=dom.getBoundingClientRect();var left=Math.max(0,rect.left),right=Math.min(innerWidth,rect.right);var top=Math.max(0,rect.top),bottom=Math.min(innerHeight,rect.bottom);var body=dom.ownerDocument.body;for(var parent=dom.parentNode;parent&&parent!=body;){if(parent.nodeType==1){var elt=parent;var style=window.getComputedStyle(elt);if((elt.scrollHeight>elt.clientHeight||elt.scrollWidth>elt.clientWidth)&&style.overflow!="visible"){var parentRect=elt.getBoundingClientRect();left=Math.max(left,parentRect.left);right=Math.min(right,parentRect.right);top=Math.max(top,parentRect.top);bottom=Math.min(bottom,parentRect.bottom);}parent=style.position=="absolute"||style.position=="fixed"?elt.offsetParent:elt.parentNode;}else if(parent.nodeType==11){// Shadow root 988 + parent=parent.host;}else{break;}}return{left:left-rect.left,right:Math.max(left,right)-rect.left,top:top-(rect.top+paddingTop),bottom:Math.max(top,bottom)-(rect.top+paddingTop)};}// Line gaps are placeholder widgets used to hide pieces of overlong 989 + // lines within the viewport, as a kludge to keep the editor 990 + // responsive when a ridiculously long line is loaded into it. 991 + var LineGap=/*#__PURE__*/function(){function LineGap(from,to,size){_classCallCheck(this,LineGap);this.from=from;this.to=to;this.size=size;}_createClass(LineGap,[{key:"draw",value:function draw(wrapping){return Decoration.replace({widget:new LineGapWidget(this.size,wrapping)}).range(this.from,this.to);}}],[{key:"same",value:function same(a,b){if(a.length!=b.length)return false;for(var _i38=0;_i38<a.length;_i38++){var gA=a[_i38],gB=b[_i38];if(gA.from!=gB.from||gA.to!=gB.to||gA.size!=gB.size)return false;}return true;}}]);return LineGap;}();var LineGapWidget=/*#__PURE__*/function(_WidgetType4){_inherits(LineGapWidget,_WidgetType4);var _super23=_createSuper(LineGapWidget);function LineGapWidget(size,vertical){var _this36;_classCallCheck(this,LineGapWidget);_this36=_super23.call(this);_this36.size=size;_this36.vertical=vertical;return _this36;}_createClass(LineGapWidget,[{key:"eq",value:function eq(other){return other.size==this.size&&other.vertical==this.vertical;}},{key:"toDOM",value:function toDOM(){var elt=document.createElement("div");if(this.vertical){elt.style.height=this.size+"px";}else{elt.style.width=this.size+"px";elt.style.height="2px";elt.style.display="inline-block";}return elt;}},{key:"estimatedHeight",get:function get(){return this.vertical?this.size:-1;}}]);return LineGapWidget;}(WidgetType);var ViewState=/*#__PURE__*/function(){function ViewState(state){_classCallCheck(this,ViewState);this.state=state;// These are contentDOM-local coordinates 992 + this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0};this.inView=true;this.paddingTop=0;this.paddingBottom=0;this.contentDOMWidth=0;this.contentDOMHeight=0;this.editorHeight=0;this.editorWidth=0;this.heightOracle=new HeightOracle();// See VP.MaxDOMHeight 993 + this.scaler=IdScaler;this.scrollTarget=null;// Briefly set to true when printing, to disable viewport limiting 994 + this.printing=false;// Flag set when editor content was redrawn, so that the next 995 + // measure stage knows it must read DOM layout 996 + this.mustMeasureContent=true;this.visibleRanges=[];// Cursor 'assoc' is only significant when the cursor is on a line 997 + // wrap point, where it must stick to the character that it is 998 + // associated with. Since browsers don't provide a reasonable 999 + // interface to set or query this, when a selection is set that 1000 + // might cause this to be significant, this flag is set. The next 1001 + // measure phase will check whether the cursor is on a line-wrapping 1002 + // boundary and, if so, reset it to make sure it is positioned in 1003 + // the right place. 1004 + this.mustEnforceCursorAssoc=false;this.heightMap=HeightMap.empty().applyChanges(state.facet(decorations),text.Text.empty,this.heightOracle.setDoc(state.doc),[new ChangedRange(0,0,0,state.doc.length)]);this.viewport=this.getViewport(0,null);this.updateViewportLines();this.updateForViewport();this.lineGaps=this.ensureLineGaps([]);this.lineGapDeco=Decoration.set(this.lineGaps.map(function(gap){return gap.draw(false);}));this.computeVisibleRanges();}_createClass(ViewState,[{key:"updateForViewport",value:function updateForViewport(){var _this37=this;var viewports=[this.viewport],main=this.state.selection.main;var _loop7=function _loop7(_i39){var pos=_i39?main.head:main.anchor;if(!viewports.some(function(_ref40){var from=_ref40.from,to=_ref40.to;return pos>=from&&pos<=to;})){var _this37$lineBlockAt=_this37.lineBlockAt(pos),from=_this37$lineBlockAt.from,to=_this37$lineBlockAt.to;viewports.push(new Viewport(from,to));}};for(var _i39=0;_i39<=1;_i39++){_loop7(_i39);}this.viewports=viewports.sort(function(a,b){return a.from-b.from;});this.scaler=this.heightMap.height<=7000000/* MaxDOMHeight */?IdScaler:new BigScaler(this.heightOracle.doc,this.heightMap,this.viewports);}},{key:"updateViewportLines",value:function updateViewportLines(){var _this38=this;this.viewportLines=[];this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,function(block){_this38.viewportLines.push(_this38.scaler.scale==1?block:scaleBlock(block,_this38.scaler));});}},{key:"update",value:function update(_update7){var scrollTarget=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var prev=this.state;this.state=_update7.state;var newDeco=this.state.facet(decorations);var contentChanges=_update7.changedRanges;var heightChanges=ChangedRange.extendWithRanges(contentChanges,heightRelevantDecoChanges(_update7.startState.facet(decorations),newDeco,_update7?_update7.changes:state.ChangeSet.empty(this.state.doc.length)));var prevHeight=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(newDeco,prev.doc,this.heightOracle.setDoc(this.state.doc),heightChanges);if(this.heightMap.height!=prevHeight)_update7.flags|=2/* Height */;var viewport=heightChanges.length?this.mapViewport(this.viewport,_update7.changes):this.viewport;if(scrollTarget&&(scrollTarget.range.head<viewport.from||scrollTarget.range.head>viewport.to)||!this.viewportIsAppropriate(viewport))viewport=this.getViewport(0,scrollTarget);var updateLines=!_update7.changes.empty||_update7.flags&2/* Height */||viewport.from!=this.viewport.from||viewport.to!=this.viewport.to;this.viewport=viewport;this.updateForViewport();if(updateLines)this.updateViewportLines();if(this.lineGaps.length||this.viewport.to-this.viewport.from>4000/* DoubleMargin */)this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,_update7.changes)));_update7.flags|=this.computeVisibleRanges();if(scrollTarget)this.scrollTarget=scrollTarget;if(!this.mustEnforceCursorAssoc&&_update7.selectionSet&&_update7.view.lineWrapping&&_update7.state.selection.main.empty&&_update7.state.selection.main.assoc)this.mustEnforceCursorAssoc=true;}},{key:"measure",value:function measure(view){var dom=view.contentDOM,style=window.getComputedStyle(dom);var oracle=this.heightOracle;var whiteSpace=style.whiteSpace,direction=style.direction=="rtl"?exports.Direction.RTL:exports.Direction.LTR;var refresh=this.heightOracle.mustRefreshForStyle(whiteSpace,direction);var measureContent=refresh||this.mustMeasureContent||this.contentDOMHeight!=dom.clientHeight;var result=0,bias=0;if(measureContent){this.mustMeasureContent=false;this.contentDOMHeight=dom.clientHeight;// Vertical padding 1005 + var paddingTop=parseInt(style.paddingTop)||0,paddingBottom=parseInt(style.paddingBottom)||0;if(this.paddingTop!=paddingTop||this.paddingBottom!=paddingBottom){result|=8/* Geometry */;this.paddingTop=paddingTop;this.paddingBottom=paddingBottom;}}// Pixel viewport 1006 + var pixelViewport=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:visiblePixelRange(dom,this.paddingTop);var dTop=pixelViewport.top-this.pixelViewport.top,dBottom=pixelViewport.bottom-this.pixelViewport.bottom;this.pixelViewport=pixelViewport;var inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(inView!=this.inView){this.inView=inView;if(inView)measureContent=true;}if(!this.inView)return 0;var contentWidth=dom.clientWidth;if(this.contentDOMWidth!=contentWidth||this.editorHeight!=view.scrollDOM.clientHeight||this.editorWidth!=view.scrollDOM.clientWidth){this.contentDOMWidth=contentWidth;this.editorHeight=view.scrollDOM.clientHeight;this.editorWidth=view.scrollDOM.clientWidth;result|=8/* Geometry */;}if(measureContent){var lineHeights=view.docView.measureVisibleLineHeights();if(oracle.mustRefreshForHeights(lineHeights))refresh=true;if(refresh||oracle.lineWrapping&&Math.abs(contentWidth-this.contentDOMWidth)>oracle.charWidth){var _view$docView$measure=view.docView.measureTextSize(),lineHeight=_view$docView$measure.lineHeight,charWidth=_view$docView$measure.charWidth;refresh=oracle.refresh(whiteSpace,direction,lineHeight,charWidth,contentWidth/charWidth,lineHeights);if(refresh){view.docView.minWidth=0;result|=8/* Geometry */;}}if(dTop>0&&dBottom>0)bias=Math.max(dTop,dBottom);else if(dTop<0&&dBottom<0)bias=Math.min(dTop,dBottom);oracle.heightChanged=false;this.heightMap=this.heightMap.updateHeight(oracle,0,refresh,new MeasuredHeights(this.viewport.from,lineHeights));if(oracle.heightChanged)result|=2/* Height */;}var viewportChange=!this.viewportIsAppropriate(this.viewport,bias)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);if(viewportChange)this.viewport=this.getViewport(bias,this.scrollTarget);this.updateForViewport();if(result&2/* Height */||viewportChange)this.updateViewportLines();if(this.lineGaps.length||this.viewport.to-this.viewport.from>4000/* DoubleMargin */)this.updateLineGaps(this.ensureLineGaps(refresh?[]:this.lineGaps));result|=this.computeVisibleRanges();if(this.mustEnforceCursorAssoc){this.mustEnforceCursorAssoc=false;// This is done in the read stage, because moving the selection 1007 + // to a line end is going to trigger a layout anyway, so it 1008 + // can't be a pure write. It should be rare that it does any 1009 + // writing. 1010 + view.docView.enforceCursorAssoc();}return result;}},{key:"visibleTop",get:function get(){return this.scaler.fromDOM(this.pixelViewport.top);}},{key:"visibleBottom",get:function get(){return this.scaler.fromDOM(this.pixelViewport.bottom);}},{key:"getViewport",value:function getViewport(bias,scrollTarget){// This will divide VP.Margin between the top and the 1011 + // bottom, depending on the bias (the change in viewport position 1012 + // since the last update). It'll hold a number between 0 and 1 1013 + var marginTop=0.5-Math.max(-0.5,Math.min(0.5,bias/1000/* Margin *//2));var map=this.heightMap,doc=this.state.doc,visibleTop=this.visibleTop,visibleBottom=this.visibleBottom;var viewport=new Viewport(map.lineAt(visibleTop-marginTop*1000/* Margin */,QueryType.ByHeight,doc,0,0).from,map.lineAt(visibleBottom+(1-marginTop)*1000/* Margin */,QueryType.ByHeight,doc,0,0).to);// If scrollTarget is given, make sure the viewport includes that position 1014 + if(scrollTarget){var head=scrollTarget.range.head,viewHeight=this.editorHeight;if(head<viewport.from||head>viewport.to){var block=map.lineAt(head,QueryType.ByPos,doc,0,0),topPos;if(scrollTarget.y=="center")topPos=(block.top+block.bottom)/2-viewHeight/2;else if(scrollTarget.y=="start"||scrollTarget.y=="nearest"&&head<viewport.from)topPos=block.top;else topPos=block.bottom-viewHeight;viewport=new Viewport(map.lineAt(topPos-1000/* Margin *//2,QueryType.ByHeight,doc,0,0).from,map.lineAt(topPos+viewHeight+1000/* Margin *//2,QueryType.ByHeight,doc,0,0).to);}}return viewport;}},{key:"mapViewport",value:function mapViewport(viewport,changes){var from=changes.mapPos(viewport.from,-1),to=changes.mapPos(viewport.to,1);return new Viewport(this.heightMap.lineAt(from,QueryType.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(to,QueryType.ByPos,this.state.doc,0,0).to);}// Checks if a given viewport covers the visible part of the 1015 + // document and not too much beyond that. 1016 + },{key:"viewportIsAppropriate",value:function viewportIsAppropriate(_ref41){var from=_ref41.from,to=_ref41.to;var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(!this.inView)return true;var _this$heightMap$lineA=this.heightMap.lineAt(from,QueryType.ByPos,this.state.doc,0,0),top=_this$heightMap$lineA.top;var _this$heightMap$lineA2=this.heightMap.lineAt(to,QueryType.ByPos,this.state.doc,0,0),bottom=_this$heightMap$lineA2.bottom;var visibleTop=this.visibleTop,visibleBottom=this.visibleBottom;return(from==0||top<=visibleTop-Math.max(10/* MinCoverMargin */,Math.min(-bias,250/* MaxCoverMargin */)))&&(to==this.state.doc.length||bottom>=visibleBottom+Math.max(10/* MinCoverMargin */,Math.min(bias,250/* MaxCoverMargin */)))&&top>visibleTop-2*1000/* Margin */&&bottom<visibleBottom+2*1000/* Margin */;}},{key:"mapLineGaps",value:function mapLineGaps(gaps,changes){if(!gaps.length||changes.empty)return gaps;var mapped=[];var _iterator57=_createForOfIteratorHelper(gaps),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var gap=_step57.value;if(!changes.touchesRange(gap.from,gap.to))mapped.push(new LineGap(changes.mapPos(gap.from),changes.mapPos(gap.to),gap.size));}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}return mapped;}// Computes positions in the viewport where the start or end of a 1017 + // line should be hidden, trying to reuse existing line gaps when 1018 + // appropriate to avoid unneccesary redraws. 1019 + // Uses crude character-counting for the positioning and sizing, 1020 + // since actual DOM coordinates aren't always available and 1021 + // predictable. Relies on generous margins (see LG.Margin) to hide 1022 + // the artifacts this might produce from the user. 1023 + },{key:"ensureLineGaps",value:function ensureLineGaps(current){var _this39=this;var gaps=[];// This won't work at all in predominantly right-to-left text. 1024 + if(this.heightOracle.direction!=exports.Direction.LTR)return gaps;var _iterator58=_createForOfIteratorHelper(this.viewportLines),_step58;try{var _loop8=function _loop8(){var line=_step58.value;if(line.length<4000/* DoubleMargin */)return"continue";var structure=lineStructure(line.from,line.to,_this39.state);if(structure.total<4000/* DoubleMargin */)return"continue";var viewFrom=void 0,viewTo=void 0;if(_this39.heightOracle.lineWrapping){var marginHeight=2000/* Margin *//_this39.heightOracle.lineLength*_this39.heightOracle.lineHeight;viewFrom=findPosition(structure,(_this39.visibleTop-line.top-marginHeight)/line.height);viewTo=findPosition(structure,(_this39.visibleBottom-line.top+marginHeight)/line.height);}else{var totalWidth=structure.total*_this39.heightOracle.charWidth;var marginWidth=2000/* Margin */*_this39.heightOracle.charWidth;viewFrom=findPosition(structure,(_this39.pixelViewport.left-marginWidth)/totalWidth);viewTo=findPosition(structure,(_this39.pixelViewport.right+marginWidth)/totalWidth);}var outside=[];if(viewFrom>line.from)outside.push({from:line.from,to:viewFrom});if(viewTo<line.to)outside.push({from:viewTo,to:line.to});var sel=_this39.state.selection.main;// Make sure the gaps don't cover a selection end 1025 + if(sel.from>=line.from&&sel.from<=line.to)cutRange(outside,sel.from-10/* SelectionMargin */,sel.from+10/* SelectionMargin */);if(!sel.empty&&sel.to>=line.from&&sel.to<=line.to)cutRange(outside,sel.to-10/* SelectionMargin */,sel.to+10/* SelectionMargin */);var _loop9=function _loop9(){var _outside$_i=_outside[_i40],from=_outside$_i.from,to=_outside$_i.to;if(to-from>1000/* HalfMargin */){gaps.push(find(current,function(gap){return gap.from>=line.from&&gap.to<=line.to&&Math.abs(gap.from-from)<1000/* HalfMargin */&&Math.abs(gap.to-to)<1000;}/* HalfMargin */)||new LineGap(from,to,_this39.gapSize(line,from,to,structure)));}};for(var _i40=0,_outside=outside;_i40<_outside.length;_i40++){_loop9();}};for(_iterator58.s();!(_step58=_iterator58.n()).done;){var _ret2=_loop8();if(_ret2==="continue")continue;}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}return gaps;}},{key:"gapSize",value:function gapSize(line,from,to,structure){var fraction=findFraction(structure,to)-findFraction(structure,from);if(this.heightOracle.lineWrapping){return line.height*fraction;}else{return structure.total*this.heightOracle.charWidth*fraction;}}},{key:"updateLineGaps",value:function updateLineGaps(gaps){var _this40=this;if(!LineGap.same(gaps,this.lineGaps)){this.lineGaps=gaps;this.lineGapDeco=Decoration.set(gaps.map(function(gap){return gap.draw(_this40.heightOracle.lineWrapping);}));}}},{key:"computeVisibleRanges",value:function computeVisibleRanges(){var deco=this.state.facet(decorations);if(this.lineGaps.length)deco=deco.concat(this.lineGapDeco);var ranges=[];rangeset.RangeSet.spans(deco,this.viewport.from,this.viewport.to,{span:function span(from,to){ranges.push({from:from,to:to});},point:function point(){}},20);var changed=ranges.length!=this.visibleRanges.length||this.visibleRanges.some(function(r,i){return r.from!=ranges[i].from||r.to!=ranges[i].to;});this.visibleRanges=ranges;return changed?4/* Viewport */:0;}},{key:"lineBlockAt",value:function lineBlockAt(pos){return pos>=this.viewport.from&&pos<=this.viewport.to&&this.viewportLines.find(function(b){return b.from<=pos&&b.to>=pos;})||scaleBlock(this.heightMap.lineAt(pos,QueryType.ByPos,this.state.doc,0,0),this.scaler);}},{key:"lineBlockAtHeight",value:function lineBlockAtHeight(height){return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height),QueryType.ByHeight,this.state.doc,0,0),this.scaler);}},{key:"elementAtHeight",value:function elementAtHeight(height){return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height),this.state.doc,0,0),this.scaler);}},{key:"docHeight",get:function get(){return this.scaler.toDOM(this.heightMap.height);}},{key:"contentHeight",get:function get(){return this.docHeight+this.paddingTop+this.paddingBottom;}}]);return ViewState;}();var Viewport=/*#__PURE__*/_createClass(function Viewport(from,to){_classCallCheck(this,Viewport);this.from=from;this.to=to;});function lineStructure(from,to,state){var ranges=[],pos=from,total=0;rangeset.RangeSet.spans(state.facet(decorations),from,to,{span:function span(){},point:function point(from,to){if(from>pos){ranges.push({from:pos,to:from});total+=from-pos;}pos=to;}},20);// We're only interested in collapsed ranges of a significant size 1026 + if(pos<to){ranges.push({from:pos,to:to});total+=to-pos;}return{total:total,ranges:ranges};}function findPosition(_ref42,ratio){var total=_ref42.total,ranges=_ref42.ranges;if(ratio<=0)return ranges[0].from;if(ratio>=1)return ranges[ranges.length-1].to;var dist=Math.floor(total*ratio);for(var _i41=0;;_i41++){var _ranges$_i=ranges[_i41],from=_ranges$_i.from,to=_ranges$_i.to,size=to-from;if(dist<=size)return from+dist;dist-=size;}}function findFraction(structure,pos){var counted=0;var _iterator59=_createForOfIteratorHelper(structure.ranges),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var _step59$value=_step59.value,from=_step59$value.from,to=_step59$value.to;if(pos<=to){counted+=pos-from;break;}counted+=to-from;}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}return counted/structure.total;}function cutRange(ranges,from,to){for(var _i42=0;_i42<ranges.length;_i42++){var _r2=ranges[_i42];if(_r2.from<to&&_r2.to>from){var pieces=[];if(_r2.from<from)pieces.push({from:_r2.from,to:from});if(_r2.to>to)pieces.push({from:to,to:_r2.to});ranges.splice.apply(ranges,[_i42,1].concat(pieces));_i42+=pieces.length-1;}}}function find(array,f){var _iterator60=_createForOfIteratorHelper(array),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var val=_step60.value;if(f(val))return val;}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}return undefined;}// Don't scale when the document height is within the range of what 1027 + // the DOM can handle. 1028 + var IdScaler={toDOM:function toDOM(n){return n;},fromDOM:function fromDOM(n){return n;},scale:1};// When the height is too big (> VP.MaxDOMHeight), scale down the 1029 + // regions outside the viewports so that the total height is 1030 + // VP.MaxDOMHeight. 1031 + var BigScaler=/*#__PURE__*/function(){function BigScaler(doc,heightMap,viewports){_classCallCheck(this,BigScaler);var vpHeight=0,base=0,domBase=0;this.viewports=viewports.map(function(_ref43){var from=_ref43.from,to=_ref43.to;var top=heightMap.lineAt(from,QueryType.ByPos,doc,0,0).top;var bottom=heightMap.lineAt(to,QueryType.ByPos,doc,0,0).bottom;vpHeight+=bottom-top;return{from:from,to:to,top:top,bottom:bottom,domTop:0,domBottom:0};});this.scale=(7000000/* MaxDOMHeight */-vpHeight)/(heightMap.height-vpHeight);var _iterator61=_createForOfIteratorHelper(this.viewports),_step61;try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){var obj=_step61.value;obj.domTop=domBase+(obj.top-base)*this.scale;domBase=obj.domBottom=obj.domTop+(obj.bottom-obj.top);base=obj.bottom;}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}}_createClass(BigScaler,[{key:"toDOM",value:function toDOM(n){for(var _i43=0,base=0,domBase=0;;_i43++){var vp=_i43<this.viewports.length?this.viewports[_i43]:null;if(!vp||n<vp.top)return domBase+(n-base)*this.scale;if(n<=vp.bottom)return vp.domTop+(n-vp.top);base=vp.bottom;domBase=vp.domBottom;}}},{key:"fromDOM",value:function fromDOM(n){for(var _i44=0,base=0,domBase=0;;_i44++){var vp=_i44<this.viewports.length?this.viewports[_i44]:null;if(!vp||n<vp.domTop)return base+(n-domBase)/this.scale;if(n<=vp.domBottom)return vp.top+(n-vp.domTop);base=vp.bottom;domBase=vp.domBottom;}}}]);return BigScaler;}();function scaleBlock(block,scaler){if(scaler.scale==1)return block;var bTop=scaler.toDOM(block.top),bBottom=scaler.toDOM(block.bottom);return new BlockInfo(block.from,block.length,bTop,bBottom-bTop,Array.isArray(block.type)?block.type.map(function(b){return scaleBlock(b,scaler);}):block.type);}var _theme=state.Facet.define({combine:function combine(strs){return strs.join(" ");}});var darkTheme=state.Facet.define({combine:function combine(values){return values.indexOf(true)>-1;}});var baseThemeID=styleMod.StyleModule.newName(),baseLightID=styleMod.StyleModule.newName(),baseDarkID=styleMod.StyleModule.newName();var lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(main,spec,scopes){return new styleMod.StyleModule(spec,{finish:function finish(sel){return /&/.test(sel)?sel.replace(/&\w*/,function(m){if(m=="&")return main;if(!scopes||!scopes[m])throw new RangeError("Unsupported selector: ".concat(m));return scopes[m];}):main+" "+sel;}});}var baseTheme=buildTheme("."+baseThemeID,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{// Provide a simple default outline to make sure a focused 1032 + // editor is visually distinct. Can't leave the default behavior 1033 + // because that will apply to the content element, which is 1034 + // inside the scrollable container and doesn't include the 1035 + // gutters. We also can't use an 'auto' outline, since those 1036 + // are, for some reason, drawn behind the element content, which 1037 + // will cause things like the active line background to cover 1038 + // the outline (#297). 1039 + outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},// Two animations defined so that we can switch between them to 1040 + // restart the animation without forcing another style 1041 + // recomputation. 1042 + "@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor, .cm-dropCursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lightDarkIDs);var observeOptions={childList:true,characterData:true,subtree:true,attributes:true,characterDataOldValue:true};// IE11 has very broken mutation observers, so we also listen to 1043 + // DOMCharacterDataModified there 1044 + var useCharData=browser.ie&&browser.ie_version<=11;var DOMObserver=/*#__PURE__*/function(){function DOMObserver(view,onChange,onScrollChanged){var _this41=this;_classCallCheck(this,DOMObserver);this.view=view;this.onChange=onChange;this.onScrollChanged=onScrollChanged;this.active=false;// The known selection. Kept in our own object, as opposed to just 1045 + // directly accessing the selection because: 1046 + // - Safari doesn't report the right selection in shadow DOM 1047 + // - Reading from the selection forces a DOM layout 1048 + // - This way, we can ignore selectionchange events if we have 1049 + // already seen the 'new' selection 1050 + this.selectionRange=new DOMSelectionState();// Set when a selection change is detected, cleared on flush 1051 + this.selectionChanged=false;this.delayedFlush=-1;this.resizeTimeout=-1;this.queue=[];this.delayedAndroidKey=null;this.scrollTargets=[];this.intersection=null;this.resize=null;this.intersecting=false;this.gapIntersection=null;this.gaps=[];// Timeout for scheduling check of the parents that need scroll handlers 1052 + this.parentCheck=-1;this.dom=view.contentDOM;this.observer=new MutationObserver(function(mutations){var _iterator62=_createForOfIteratorHelper(mutations),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var mut=_step62.value;_this41.queue.push(mut);}// IE11 will sometimes (on typing over a selection or 1053 + // backspacing out a single character text node) call the 1054 + // observer callback before actually updating the DOM. 1055 + // 1056 + // Unrelatedly, iOS Safari will, when ending a composition, 1057 + // sometimes first clear it, deliver the mutations, and then 1058 + // reinsert the finished text. CodeMirror's handling of the 1059 + // deletion will prevent the reinsertion from happening, 1060 + // breaking composition. 1061 + }catch(err){_iterator62.e(err);}finally{_iterator62.f();}if((browser.ie&&browser.ie_version<=11||browser.ios&&view.composing)&&mutations.some(function(m){return m.type=="childList"&&m.removedNodes.length||m.type=="characterData"&&m.oldValue.length>m.target.nodeValue.length;}))_this41.flushSoon();else _this41.flush();});if(useCharData)this.onCharData=function(event){_this41.queue.push({target:event.target,type:"characterData",oldValue:event.prevValue});_this41.flushSoon();};this.onSelectionChange=this.onSelectionChange.bind(this);if(typeof ResizeObserver=="function"){this.resize=new ResizeObserver(function(){if(_this41.view.docView.lastUpdate<Date.now()-75&&_this41.resizeTimeout<0)_this41.resizeTimeout=setTimeout(function(){_this41.resizeTimeout=-1;_this41.view.requestMeasure();},50);});this.resize.observe(view.scrollDOM);}this.start();this.onScroll=this.onScroll.bind(this);window.addEventListener("scroll",this.onScroll);if(typeof IntersectionObserver=="function"){this.intersection=new IntersectionObserver(function(entries){if(_this41.parentCheck<0)_this41.parentCheck=setTimeout(_this41.listenForScroll.bind(_this41),1000);if(entries.length>0&&entries[entries.length-1].intersectionRatio>0!=_this41.intersecting){_this41.intersecting=!_this41.intersecting;if(_this41.intersecting!=_this41.view.inView)_this41.onScrollChanged(document.createEvent("Event"));}},{});this.intersection.observe(this.dom);this.gapIntersection=new IntersectionObserver(function(entries){if(entries.length>0&&entries[entries.length-1].intersectionRatio>0)_this41.onScrollChanged(document.createEvent("Event"));},{});}this.listenForScroll();this.readSelectionRange();this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange);}_createClass(DOMObserver,[{key:"onScroll",value:function onScroll(e){if(this.intersecting)this.flush(false);this.onScrollChanged(e);}},{key:"updateGaps",value:function updateGaps(gaps){if(this.gapIntersection&&(gaps.length!=this.gaps.length||this.gaps.some(function(g,i){return g!=gaps[i];}))){this.gapIntersection.disconnect();var _iterator63=_createForOfIteratorHelper(gaps),_step63;try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){var gap=_step63.value;this.gapIntersection.observe(gap);}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}this.gaps=gaps;}}},{key:"onSelectionChange",value:function onSelectionChange(event){if(!this.readSelectionRange()||this.delayedAndroidKey)return;var view=this.view,sel=this.selectionRange;if(view.state.facet(editable)?view.root.activeElement!=this.dom:!hasSelection(view.dom,sel))return;var context=sel.anchorNode&&view.docView.nearest(sel.anchorNode);if(context&&context.ignoreEvent(event))return;// Deletions on IE11 fire their events in the wrong order, giving 1062 + // us a selection change event before the DOM changes are 1063 + // reported. 1064 + // Chrome Android has a similar issue when backspacing out a 1065 + // selection (#645). 1066 + if((browser.ie&&browser.ie_version<=11||browser.android&&browser.chrome)&&!view.state.selection.main.empty&&// (Selection.isCollapsed isn't reliable on IE) 1067 + sel.focusNode&&isEquivalentPosition(sel.focusNode,sel.focusOffset,sel.anchorNode,sel.anchorOffset))this.flushSoon();else this.flush(false);}},{key:"readSelectionRange",value:function readSelectionRange(){var root=this.view.root,domSel=getSelection(root);// The Selection object is broken in shadow roots in Safari. See 1068 + // https://github.com/codemirror/codemirror.next/issues/414 1069 + var range=browser.safari&&root.nodeType==11&&deepActiveElement()==this.view.contentDOM&&safariSelectionRangeHack(this.view)||domSel;if(this.selectionRange.eq(range))return false;this.selectionRange.setRange(range);return this.selectionChanged=true;}},{key:"setSelectionRange",value:function setSelectionRange(anchor,head){this.selectionRange.set(anchor.node,anchor.offset,head.node,head.offset);this.selectionChanged=false;}},{key:"listenForScroll",value:function listenForScroll(){this.parentCheck=-1;var i=0,changed=null;for(var dom=this.dom;dom;){if(dom.nodeType==1){if(!changed&&i<this.scrollTargets.length&&this.scrollTargets[i]==dom)i++;else if(!changed)changed=this.scrollTargets.slice(0,i);if(changed)changed.push(dom);dom=dom.assignedSlot||dom.parentNode;}else if(dom.nodeType==11){// Shadow root 1070 + dom=dom.host;}else{break;}}if(i<this.scrollTargets.length&&!changed)changed=this.scrollTargets.slice(0,i);if(changed){var _iterator64=_createForOfIteratorHelper(this.scrollTargets),_step64;try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){var _dom2=_step64.value;_dom2.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}var _iterator65=_createForOfIteratorHelper(this.scrollTargets=changed),_step65;try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){var _dom3=_step65.value;_dom3.addEventListener("scroll",this.onScroll);}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}}}},{key:"ignore",value:function ignore(f){if(!this.active)return f();try{this.stop();return f();}finally{this.start();this.clear();}}},{key:"start",value:function start(){if(this.active)return;this.observer.observe(this.dom,observeOptions);if(useCharData)this.dom.addEventListener("DOMCharacterDataModified",this.onCharData);this.active=true;}},{key:"stop",value:function stop(){if(!this.active)return;this.active=false;this.observer.disconnect();if(useCharData)this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData);}// Throw away any pending changes 1071 + },{key:"clear",value:function clear(){this.observer.takeRecords();this.queue.length=0;this.selectionChanged=false;}// Chrome Android, especially in combination with GBoard, not only 1072 + // doesn't reliably fire regular key events, but also often 1073 + // surrounds the effect of enter or backspace with a bunch of 1074 + // composition events that, when interrupted, cause text duplication 1075 + // or other kinds of corruption. This hack makes the editor back off 1076 + // from handling DOM changes for a moment when such a key is 1077 + // detected (via beforeinput or keydown), and then dispatches the 1078 + // key event, throwing away the DOM changes if it gets handled. 1079 + },{key:"delayAndroidKey",value:function delayAndroidKey(key,keyCode){var _this42=this;if(!this.delayedAndroidKey)requestAnimationFrame(function(){var key=_this42.delayedAndroidKey;_this42.delayedAndroidKey=null;var startState=_this42.view.state;if(dispatchKey(_this42.view.contentDOM,key.key,key.keyCode))_this42.processRecords();else _this42.flush();if(_this42.view.state==startState)_this42.view.update([]);});// Since backspace beforeinput is sometimes signalled spuriously, 1080 + // Enter always takes precedence. 1081 + if(!this.delayedAndroidKey||key=="Enter")this.delayedAndroidKey={key:key,keyCode:keyCode};}},{key:"flushSoon",value:function flushSoon(){var _this43=this;if(this.delayedFlush<0)this.delayedFlush=window.setTimeout(function(){_this43.delayedFlush=-1;_this43.flush();},20);}},{key:"forceFlush",value:function forceFlush(){if(this.delayedFlush>=0){window.clearTimeout(this.delayedFlush);this.delayedFlush=-1;this.flush();}}},{key:"processRecords",value:function processRecords(){var records=this.queue;var _iterator66=_createForOfIteratorHelper(this.observer.takeRecords()),_step66;try{for(_iterator66.s();!(_step66=_iterator66.n()).done;){var mut=_step66.value;records.push(mut);}}catch(err){_iterator66.e(err);}finally{_iterator66.f();}if(records.length)this.queue=[];var from=-1,to=-1,typeOver=false;var _iterator67=_createForOfIteratorHelper(records),_step67;try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){var record=_step67.value;var range=this.readMutation(record);if(!range)continue;if(range.typeOver)typeOver=true;if(from==-1){from=range.from;to=range.to;}else{from=Math.min(range.from,from);to=Math.max(range.to,to);}}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}return{from:from,to:to,typeOver:typeOver};}// Apply pending changes, if any 1082 + },{key:"flush",value:function flush(){var readSelection=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;// Completely hold off flushing when pending keys are set—the code 1083 + // managing those will make sure processRecords is called and the 1084 + // view is resynchronized after 1085 + if(this.delayedFlush>=0||this.delayedAndroidKey)return;if(readSelection)this.readSelectionRange();var _this$processRecords=this.processRecords(),from=_this$processRecords.from,to=_this$processRecords.to,typeOver=_this$processRecords.typeOver;var newSel=this.selectionChanged&&hasSelection(this.dom,this.selectionRange);if(from<0&&!newSel)return;this.selectionChanged=false;var startState=this.view.state;this.onChange(from,to,typeOver);// The view wasn't updated 1086 + if(this.view.state==startState)this.view.update([]);}},{key:"readMutation",value:function readMutation(rec){var cView=this.view.docView.nearest(rec.target);if(!cView||cView.ignoreMutation(rec))return null;cView.markDirty(rec.type=="attributes");if(rec.type=="attributes")cView.dirty|=4/* Attrs */;if(rec.type=="childList"){var childBefore=findChild(cView,rec.previousSibling||rec.target.previousSibling,-1);var childAfter=findChild(cView,rec.nextSibling||rec.target.nextSibling,1);return{from:childBefore?cView.posAfter(childBefore):cView.posAtStart,to:childAfter?cView.posBefore(childAfter):cView.posAtEnd,typeOver:false};}else if(rec.type=="characterData"){return{from:cView.posAtStart,to:cView.posAtEnd,typeOver:rec.target.nodeValue==rec.oldValue};}else{return null;}}},{key:"destroy",value:function destroy(){var _a,_b,_c;this.stop();(_a=this.intersection)===null||_a===void 0?void 0:_a.disconnect();(_b=this.gapIntersection)===null||_b===void 0?void 0:_b.disconnect();(_c=this.resize)===null||_c===void 0?void 0:_c.disconnect();var _iterator68=_createForOfIteratorHelper(this.scrollTargets),_step68;try{for(_iterator68.s();!(_step68=_iterator68.n()).done;){var dom=_step68.value;dom.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator68.e(err);}finally{_iterator68.f();}window.removeEventListener("scroll",this.onScroll);this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange);clearTimeout(this.parentCheck);clearTimeout(this.resizeTimeout);}}]);return DOMObserver;}();function findChild(cView,dom,dir){while(dom){var curView=ContentView.get(dom);if(curView&&curView.parent==cView)return curView;var parent=dom.parentNode;dom=parent!=cView.dom?parent:dir>0?dom.nextSibling:dom.previousSibling;}return null;}// Used to work around a Safari Selection/shadow DOM bug (#414) 1087 + function safariSelectionRangeHack(view){var found=null;// Because Safari (at least in 2018-2021) doesn't provide regular 1088 + // access to the selection inside a shadowroot, we have to perform a 1089 + // ridiculous hack to get at it—using `execCommand` to trigger a 1090 + // `beforeInput` event so that we can read the target range from the 1091 + // event. 1092 + function read(event){event.preventDefault();event.stopImmediatePropagation();found=event.getTargetRanges()[0];}view.contentDOM.addEventListener("beforeinput",read,true);document.execCommand("indent");view.contentDOM.removeEventListener("beforeinput",read,true);if(!found)return null;var anchorNode=found.startContainer,anchorOffset=found.startOffset;var focusNode=found.endContainer,focusOffset=found.endOffset;var curAnchor=view.docView.domAtPos(view.state.selection.main.anchor);// Since such a range doesn't distinguish between anchor and head, 1093 + // use a heuristic that flips it around if its end matches the 1094 + // current anchor. 1095 + if(isEquivalentPosition(curAnchor.node,curAnchor.offset,focusNode,focusOffset)){var _ref44=[focusNode,focusOffset,anchorNode,anchorOffset];anchorNode=_ref44[0];anchorOffset=_ref44[1];focusNode=_ref44[2];focusOffset=_ref44[3];}return{anchorNode:anchorNode,anchorOffset:anchorOffset,focusNode:focusNode,focusOffset:focusOffset};}function applyDOMChange(view,start,end,typeOver){var change,newSel;var sel=view.state.selection.main;if(start>-1){var bounds=view.docView.domBoundsAround(start,end,0);if(!bounds||view.state.readOnly)return;var from=bounds.from,to=bounds.to;var selPoints=view.docView.impreciseHead||view.docView.impreciseAnchor?[]:selectionPoints(view);var reader=new DOMReader(selPoints,view);reader.readRange(bounds.startDOM,bounds.endDOM);newSel=selectionFromPoints(selPoints,from);var preferredPos=sel.from,preferredSide=null;// Prefer anchoring to end when Backspace is pressed (or, on 1096 + // Android, when something was deleted) 1097 + if(view.inputState.lastKeyCode===8&&view.inputState.lastKeyTime>Date.now()-100||browser.android&&reader.text.length<to-from){preferredPos=sel.to;preferredSide="end";}var diff=findDiff(view.state.sliceDoc(from,to),reader.text,preferredPos-from,preferredSide);if(diff)change={from:from+diff.from,to:from+diff.toA,insert:view.state.toText(reader.text.slice(diff.from,diff.toB))};}else if(view.hasFocus||!view.state.facet(editable)){var domSel=view.observer.selectionRange;var _view$docView=view.docView,iHead=_view$docView.impreciseHead,iAnchor=_view$docView.impreciseAnchor;var head=iHead&&iHead.node==domSel.focusNode&&iHead.offset==domSel.focusOffset||!contains(view.contentDOM,domSel.focusNode)?view.state.selection.main.head:view.docView.posFromDOM(domSel.focusNode,domSel.focusOffset);var anchor=iAnchor&&iAnchor.node==domSel.anchorNode&&iAnchor.offset==domSel.anchorOffset||!contains(view.contentDOM,domSel.anchorNode)?view.state.selection.main.anchor:view.docView.posFromDOM(domSel.anchorNode,domSel.anchorOffset);if(head!=sel.head||anchor!=sel.anchor)newSel=state.EditorSelection.single(anchor,head);}if(!change&&!newSel)return;// Heuristic to notice typing over a selected character 1098 + if(!change&&typeOver&&!sel.empty&&newSel&&newSel.main.empty)change={from:sel.from,to:sel.to,insert:view.state.doc.slice(sel.from,sel.to)};// If the change is inside the selection and covers most of it, 1099 + // assume it is a selection replace (with identical characters at 1100 + // the start/end not included in the diff) 1101 + else if(change&&change.from>=sel.from&&change.to<=sel.to&&(change.from!=sel.from||change.to!=sel.to)&&sel.to-sel.from-(change.to-change.from)<=4)change={from:sel.from,to:sel.to,insert:view.state.doc.slice(sel.from,change.from).append(change.insert).append(view.state.doc.slice(change.to,sel.to))};if(change){var startState=view.state;if(browser.ios&&view.inputState.flushIOSKey(view))return;// Android browsers don't fire reasonable key events for enter, 1102 + // backspace, or delete. So this detects changes that look like 1103 + // they're caused by those keys, and reinterprets them as key 1104 + // events. (Some of these keys are also handled by beforeinput 1105 + // events and the pendingAndroidKey mechanism, but that's not 1106 + // reliable in all situations.) 1107 + if(browser.android&&(change.from==sel.from&&change.to==sel.to&&change.insert.length==1&&change.insert.lines==2&&dispatchKey(view.contentDOM,"Enter",13)||change.from==sel.from-1&&change.to==sel.to&&change.insert.length==0&&dispatchKey(view.contentDOM,"Backspace",8)||change.from==sel.from&&change.to==sel.to+1&&change.insert.length==0&&dispatchKey(view.contentDOM,"Delete",46)))return;var _text2=change.insert.toString();if(view.state.facet(inputHandler).some(function(h){return h(view,change.from,change.to,_text2);}))return;if(view.inputState.composing>=0)view.inputState.composing++;var tr;if(change.from>=sel.from&&change.to<=sel.to&&change.to-change.from>=(sel.to-sel.from)/3&&(!newSel||newSel.main.empty&&newSel.main.from==change.from+change.insert.length)&&view.inputState.composing<0){var before=sel.from<change.from?startState.sliceDoc(sel.from,change.from):"";var after=sel.to>change.to?startState.sliceDoc(change.to,sel.to):"";tr=startState.replaceSelection(view.state.toText(before+change.insert.sliceString(0,undefined,view.state.lineBreak)+after));}else{var changes=startState.changes(change);var mainSel=newSel&&!startState.selection.main.eq(newSel.main)&&newSel.main.to<=changes.newLength?newSel.main:undefined;// Try to apply a composition change to all cursors 1108 + if(startState.selection.ranges.length>1&&view.inputState.composing>=0&&change.to<=sel.to&&change.to>=sel.to-10){var replaced=view.state.sliceDoc(change.from,change.to);var compositionRange=compositionSurroundingNode(view)||view.state.doc.lineAt(sel.head);var offset=sel.to-change.to,size=sel.to-sel.from;tr=startState.changeByRange(function(range){if(range.from==sel.from&&range.to==sel.to)return{changes:changes,range:mainSel||range.map(changes)};var to=range.to-offset,from=to-replaced.length;if(range.to-range.from!=size||view.state.sliceDoc(from,to)!=replaced||// Unfortunately, there's no way to make multiple 1109 + // changes in the same node work without aborting 1110 + // composition, so cursors in the composition range are 1111 + // ignored. 1112 + compositionRange&&range.to>=compositionRange.from&&range.from<=compositionRange.to)return{range:range};var rangeChanges=startState.changes({from:from,to:to,insert:change.insert}),selOff=range.to-sel.to;return{changes:rangeChanges,range:!mainSel?range.map(rangeChanges):state.EditorSelection.range(Math.max(0,mainSel.anchor+selOff),Math.max(0,mainSel.head+selOff))};});}else{tr={changes:changes,selection:mainSel&&startState.selection.replaceRange(mainSel)};}}var userEvent="input.type";if(view.composing){userEvent+=".compose";if(view.inputState.compositionFirstChange){userEvent+=".start";view.inputState.compositionFirstChange=false;}}view.dispatch(tr,{scrollIntoView:true,userEvent:userEvent});}else if(newSel&&!newSel.main.eq(sel)){var _scrollIntoView=false,_userEvent="select";if(view.inputState.lastSelectionTime>Date.now()-50){if(view.inputState.lastSelectionOrigin=="select")_scrollIntoView=true;_userEvent=view.inputState.lastSelectionOrigin;}view.dispatch({selection:newSel,scrollIntoView:_scrollIntoView,userEvent:_userEvent});}}function findDiff(a,b,preferredPos,preferredSide){var minLen=Math.min(a.length,b.length);var from=0;while(from<minLen&&a.charCodeAt(from)==b.charCodeAt(from)){from++;}if(from==minLen&&a.length==b.length)return null;var toA=a.length,toB=b.length;while(toA>0&&toB>0&&a.charCodeAt(toA-1)==b.charCodeAt(toB-1)){toA--;toB--;}if(preferredSide=="end"){var adjust=Math.max(0,from-Math.min(toA,toB));preferredPos-=toA+adjust-from;}if(toA<from&&a.length<b.length){var move=preferredPos<=from&&preferredPos>=toA?from-preferredPos:0;from-=move;toB=from+(toB-toA);toA=from;}else if(toB<from){var _move=preferredPos<=from&&preferredPos>=toB?from-preferredPos:0;from-=_move;toA=from+(toA-toB);toB=from;}return{from:from,toA:toA,toB:toB};}function selectionPoints(view){var result=[];if(view.root.activeElement!=view.contentDOM)return result;var _view$observer$select=view.observer.selectionRange,anchorNode=_view$observer$select.anchorNode,anchorOffset=_view$observer$select.anchorOffset,focusNode=_view$observer$select.focusNode,focusOffset=_view$observer$select.focusOffset;if(anchorNode){result.push(new DOMPoint(anchorNode,anchorOffset));if(focusNode!=anchorNode||focusOffset!=anchorOffset)result.push(new DOMPoint(focusNode,focusOffset));}return result;}function selectionFromPoints(points,base){if(points.length==0)return null;var anchor=points[0].pos,head=points.length==2?points[1].pos:anchor;return anchor>-1&&head>-1?state.EditorSelection.single(anchor+base,head+base):null;}// The editor's update state machine looks something like this: 1113 + // 1114 + // Idle → Updating ⇆ Idle (unchecked) → Measuring → Idle 1115 + // ↑ ↓ 1116 + // Updating (measure) 1117 + // 1118 + // The difference between 'Idle' and 'Idle (unchecked)' lies in 1119 + // whether a layout check has been scheduled. A regular update through 1120 + // the `update` method updates the DOM in a write-only fashion, and 1121 + // relies on a check (scheduled with `requestAnimationFrame`) to make 1122 + // sure everything is where it should be and the viewport covers the 1123 + // visible code. That check continues to measure and then optionally 1124 + // update until it reaches a coherent state. 1125 + /** 1126 + An editor view represents the editor's user interface. It holds 1127 + the editable DOM surface, and possibly other elements such as the 1128 + line number gutter. It handles events and dispatches state 1129 + transactions for editing actions. 1130 + */var EditorView=/*#__PURE__*/function(){/** 1131 + Construct a new view. You'll usually want to put `view.dom` into 1132 + your document after creating a view, so that the user can see 1133 + it. 1134 + */function EditorView(){var _this44=this;var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,EditorView);this.plugins=[];this.pluginMap=new Map();this.editorAttrs={};this.contentAttrs={};this.bidiCache=[];this.destroyed=false;/** 1135 + @internal 1136 + */this.updateState=2/* Updating */;/** 1137 + @internal 1138 + */this.measureScheduled=-1;/** 1139 + @internal 1140 + */this.measureRequests=[];this.contentDOM=document.createElement("div");this.scrollDOM=document.createElement("div");this.scrollDOM.tabIndex=-1;this.scrollDOM.className="cm-scroller";this.scrollDOM.appendChild(this.contentDOM);this.announceDOM=document.createElement("div");this.announceDOM.style.cssText="position: absolute; top: -10000px";this.announceDOM.setAttribute("aria-live","polite");this.dom=document.createElement("div");this.dom.appendChild(this.announceDOM);this.dom.appendChild(this.scrollDOM);this._dispatch=config.dispatch||function(tr){return _this44.update([tr]);};this.dispatch=this.dispatch.bind(this);this.root=config.root||getRoot(config.parent)||document;this.viewState=new ViewState(config.state||state.EditorState.create());this.plugins=this.state.facet(viewPlugin).map(function(spec){return new PluginInstance(spec);});var _iterator69=_createForOfIteratorHelper(this.plugins),_step69;try{for(_iterator69.s();!(_step69=_iterator69.n()).done;){var _plugin3=_step69.value;_plugin3.update(this);}}catch(err){_iterator69.e(err);}finally{_iterator69.f();}this.observer=new DOMObserver(this,function(from,to,typeOver){applyDOMChange(_this44,from,to,typeOver);},function(event){_this44.inputState.runScrollHandlers(_this44,event);if(_this44.observer.intersecting)_this44.measure();});this.inputState=new InputState(this);this.docView=new DocView(this);this.mountStyles();this.updateAttrs();this.updateState=0/* Idle */;ensureGlobalHandler();this.requestMeasure();if(config.parent)config.parent.appendChild(this.dom);}/** 1141 + The current editor state. 1142 + */_createClass(EditorView,[{key:"state",get:function get(){return this.viewState.state;}/** 1143 + To be able to display large documents without consuming too much 1144 + memory or overloading the browser, CodeMirror only draws the 1145 + code that is visible (plus a margin around it) to the DOM. This 1146 + property tells you the extent of the current drawn viewport, in 1147 + document positions. 1148 + */},{key:"viewport",get:function get(){return this.viewState.viewport;}/** 1149 + When there are, for example, large collapsed ranges in the 1150 + viewport, its size can be a lot bigger than the actual visible 1151 + content. Thus, if you are doing something like styling the 1152 + content in the viewport, it is preferable to only do so for 1153 + these ranges, which are the subset of the viewport that is 1154 + actually drawn. 1155 + */},{key:"visibleRanges",get:function get(){return this.viewState.visibleRanges;}/** 1156 + Returns false when the editor is entirely scrolled out of view 1157 + or otherwise hidden. 1158 + */},{key:"inView",get:function get(){return this.viewState.inView;}/** 1159 + Indicates whether the user is currently composing text via 1160 + [IME](https://en.wikipedia.org/wiki/Input_method). 1161 + */},{key:"composing",get:function get(){return this.inputState.composing>0;}},{key:"dispatch",value:function dispatch(){var _this$state;this._dispatch(arguments.length==1&&(arguments.length<=0?undefined:arguments[0])instanceof state.Transaction?arguments.length<=0?undefined:arguments[0]:(_this$state=this.state).update.apply(_this$state,arguments));}/** 1162 + Update the view for the given array of transactions. This will 1163 + update the visible document and selection to match the state 1164 + produced by the transactions, and notify view plugins of the 1165 + change. You should usually call 1166 + [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this 1167 + as a primitive. 1168 + */},{key:"update",value:function update(transactions){if(this.updateState!=0/* Idle */)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var redrawn=false,update;var state$1=this.state;var _iterator70=_createForOfIteratorHelper(transactions),_step70;try{for(_iterator70.s();!(_step70=_iterator70.n()).done;){var _tr2=_step70.value;if(_tr2.startState!=state$1)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");state$1=_tr2.state;}}catch(err){_iterator70.e(err);}finally{_iterator70.f();}if(this.destroyed){this.viewState.state=state$1;return;}// When the phrases change, redraw the editor 1169 + if(state$1.facet(state.EditorState.phrases)!=this.state.facet(state.EditorState.phrases))return this.setState(state$1);update=new ViewUpdate(this,state$1,transactions);var scrollTarget=this.viewState.scrollTarget;try{this.updateState=2/* Updating */;var _iterator71=_createForOfIteratorHelper(transactions),_step71;try{for(_iterator71.s();!(_step71=_iterator71.n()).done;){var tr=_step71.value;if(scrollTarget)scrollTarget=scrollTarget.map(tr.changes);if(tr.scrollIntoView){var main=tr.state.selection.main;scrollTarget=new ScrollTarget(main.empty?main:state.EditorSelection.cursor(main.head,main.head>main.anchor?-1:1));}var _iterator72=_createForOfIteratorHelper(tr.effects),_step72;try{for(_iterator72.s();!(_step72=_iterator72.n()).done;){var e=_step72.value;if(e.is(scrollTo))scrollTarget=new ScrollTarget(e.value);else if(e.is(centerOn))scrollTarget=new ScrollTarget(e.value,"center");else if(e.is(_scrollIntoView2))scrollTarget=e.value;}}catch(err){_iterator72.e(err);}finally{_iterator72.f();}}}catch(err){_iterator71.e(err);}finally{_iterator71.f();}this.viewState.update(update,scrollTarget);this.bidiCache=CachedOrder.update(this.bidiCache,update.changes);if(!update.empty){this.updatePlugins(update);this.inputState.update(update);}redrawn=this.docView.update(update);if(this.state.facet(styleModule)!=this.styleModules)this.mountStyles();this.updateAttrs();this.showAnnouncements(transactions);this.docView.updateSelection(redrawn,transactions.some(function(tr){return tr.isUserEvent("select.pointer");}));}finally{this.updateState=0/* Idle */;}if(redrawn||scrollTarget||this.viewState.mustEnforceCursorAssoc)this.requestMeasure();if(!update.empty){var _iterator73=_createForOfIteratorHelper(this.state.facet(updateListener)),_step73;try{for(_iterator73.s();!(_step73=_iterator73.n()).done;){var listener=_step73.value;listener(update);}}catch(err){_iterator73.e(err);}finally{_iterator73.f();}}}/** 1170 + Reset the view to the given state. (This will cause the entire 1171 + document to be redrawn and all view plugins to be reinitialized, 1172 + so you should probably only use it when the new state isn't 1173 + derived from the old state. Otherwise, use 1174 + [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.) 1175 + */},{key:"setState",value:function setState(newState){if(this.updateState!=0/* Idle */)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=newState;return;}this.updateState=2/* Updating */;var hadFocus=this.hasFocus;try{var _iterator74=_createForOfIteratorHelper(this.plugins),_step74;try{for(_iterator74.s();!(_step74=_iterator74.n()).done;){var _plugin4=_step74.value;_plugin4.destroy(this);}}catch(err){_iterator74.e(err);}finally{_iterator74.f();}this.viewState=new ViewState(newState);this.plugins=newState.facet(viewPlugin).map(function(spec){return new PluginInstance(spec);});this.pluginMap.clear();var _iterator75=_createForOfIteratorHelper(this.plugins),_step75;try{for(_iterator75.s();!(_step75=_iterator75.n()).done;){var _plugin5=_step75.value;_plugin5.update(this);}}catch(err){_iterator75.e(err);}finally{_iterator75.f();}this.docView=new DocView(this);this.inputState.ensureHandlers(this);this.mountStyles();this.updateAttrs();this.bidiCache=[];}finally{this.updateState=0/* Idle */;}if(hadFocus)this.focus();this.requestMeasure();}},{key:"updatePlugins",value:function updatePlugins(update){var prevSpecs=update.startState.facet(viewPlugin),specs=update.state.facet(viewPlugin);if(prevSpecs!=specs){var newPlugins=[];var _iterator76=_createForOfIteratorHelper(specs),_step76;try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){var spec=_step76.value;var found=prevSpecs.indexOf(spec);if(found<0){newPlugins.push(new PluginInstance(spec));}else{var _plugin6=this.plugins[found];_plugin6.mustUpdate=update;newPlugins.push(_plugin6);}}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}var _iterator77=_createForOfIteratorHelper(this.plugins),_step77;try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){var _plugin7=_step77.value;if(_plugin7.mustUpdate!=update)_plugin7.destroy(this);}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}this.plugins=newPlugins;this.pluginMap.clear();this.inputState.ensureHandlers(this);}else{var _iterator78=_createForOfIteratorHelper(this.plugins),_step78;try{for(_iterator78.s();!(_step78=_iterator78.n()).done;){var _p=_step78.value;_p.mustUpdate=update;}}catch(err){_iterator78.e(err);}finally{_iterator78.f();}}for(var _i45=0;_i45<this.plugins.length;_i45++){this.plugins[_i45].update(this);}}/** 1176 + @internal 1177 + */},{key:"measure",value:function measure(){var _this45=this;var flush=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;if(this.destroyed)return;if(this.measureScheduled>-1)cancelAnimationFrame(this.measureScheduled);this.measureScheduled=0;// Prevent requestMeasure calls from scheduling another animation frame 1178 + if(flush)this.observer.flush();var updated=null;try{for(var _i46=0;;_i46++){this.updateState=1/* Measuring */;var oldViewport=this.viewport;var changed=this.viewState.measure(this);if(!changed&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(_i46>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break;}var measuring=[];// Only run measure requests in this cycle when the viewport didn't change 1179 + if(!(changed&4/* Viewport */)){var _ref45=[measuring,this.measureRequests];this.measureRequests=_ref45[0];measuring=_ref45[1];}var measured=measuring.map(function(m){try{return m.read(_this45);}catch(e){logException(_this45.state,e);return BadMeasure;}});var update=new ViewUpdate(this,this.state),redrawn=false,scrolled=false;update.flags|=changed;if(!updated)updated=update;else updated.flags|=changed;this.updateState=2/* Updating */;if(!update.empty){this.updatePlugins(update);this.inputState.update(update);this.updateAttrs();redrawn=this.docView.update(update);}for(var _i47=0;_i47<measuring.length;_i47++){if(measured[_i47]!=BadMeasure){try{var m=measuring[_i47];if(m.write)m.write(measured[_i47],this);}catch(e){logException(this.state,e);}}}if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget);this.viewState.scrollTarget=null;scrolled=true;}if(redrawn)this.docView.updateSelection(true);if(this.viewport.from==oldViewport.from&&this.viewport.to==oldViewport.to&&!scrolled&&this.measureRequests.length==0)break;}}finally{this.updateState=0/* Idle */;this.measureScheduled=-1;}if(updated&&!updated.empty){var _iterator79=_createForOfIteratorHelper(this.state.facet(updateListener)),_step79;try{for(_iterator79.s();!(_step79=_iterator79.n()).done;){var listener=_step79.value;listener(updated);}}catch(err){_iterator79.e(err);}finally{_iterator79.f();}}}/** 1180 + Get the CSS classes for the currently active editor themes. 1181 + */},{key:"themeClasses",get:function get(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(_theme);}},{key:"updateAttrs",value:function updateAttrs(){var _this46=this;var editorAttrs=attrsFromFacet(this,editorAttributes,{"class":"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses});var contentAttrs={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:!this.state.facet(editable)?"false":"true","class":"cm-content",style:"".concat(browser.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};if(this.state.readOnly)contentAttrs["aria-readonly"]="true";attrsFromFacet(this,contentAttributes,contentAttrs);this.observer.ignore(function(){_updateAttrs(_this46.contentDOM,_this46.contentAttrs,contentAttrs);_updateAttrs(_this46.dom,_this46.editorAttrs,editorAttrs);});this.editorAttrs=editorAttrs;this.contentAttrs=contentAttrs;}},{key:"showAnnouncements",value:function showAnnouncements(trs){var first=true;var _iterator80=_createForOfIteratorHelper(trs),_step80;try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){var tr=_step80.value;var _iterator81=_createForOfIteratorHelper(tr.effects),_step81;try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){var effect=_step81.value;if(effect.is(EditorView.announce)){if(first)this.announceDOM.textContent="";first=false;var div=this.announceDOM.appendChild(document.createElement("div"));div.textContent=effect.value;}}}catch(err){_iterator81.e(err);}finally{_iterator81.f();}}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}}},{key:"mountStyles",value:function mountStyles(){this.styleModules=this.state.facet(styleModule);styleMod.StyleModule.mount(this.root,this.styleModules.concat(baseTheme).reverse());}},{key:"readMeasured",value:function readMeasured(){if(this.updateState==2/* Updating */)throw new Error("Reading the editor layout isn't allowed during an update");if(this.updateState==0/* Idle */&&this.measureScheduled>-1)this.measure(false);}/** 1182 + Schedule a layout measurement, optionally providing callbacks to 1183 + do custom DOM measuring followed by a DOM write phase. Using 1184 + this is preferable reading DOM layout directly from, for 1185 + example, an event handler, because it'll make sure measuring and 1186 + drawing done by other components is synchronized, avoiding 1187 + unnecessary DOM layout computations. 1188 + */},{key:"requestMeasure",value:function requestMeasure(request){var _this47=this;if(this.measureScheduled<0)this.measureScheduled=requestAnimationFrame(function(){return _this47.measure();});if(request){if(request.key!=null)for(var _i48=0;_i48<this.measureRequests.length;_i48++){if(this.measureRequests[_i48].key===request.key){this.measureRequests[_i48]=request;return;}}this.measureRequests.push(request);}}/** 1189 + Collect all values provided by the active plugins for a given 1190 + field. 1191 + */},{key:"pluginField",value:function pluginField(field){var result=[];var _iterator82=_createForOfIteratorHelper(this.plugins),_step82;try{for(_iterator82.s();!(_step82=_iterator82.n()).done;){var _plugin8=_step82.value;_plugin8.update(this).takeField(field,result);}}catch(err){_iterator82.e(err);}finally{_iterator82.f();}return result;}/** 1192 + Get the value of a specific plugin, if present. Note that 1193 + plugins that crash can be dropped from a view, so even when you 1194 + know you registered a given plugin, it is recommended to check 1195 + the return value of this method. 1196 + */},{key:"plugin",value:function plugin(_plugin2){var known=this.pluginMap.get(_plugin2);if(known===undefined||known&&known.spec!=_plugin2)this.pluginMap.set(_plugin2,known=this.plugins.find(function(p){return p.spec==_plugin2;})||null);return known&&known.update(this).value;}/** 1197 + The top position of the document, in screen coordinates. This 1198 + may be negative when the editor is scrolled down. Points 1199 + directly to the top of the first line, not above the padding. 1200 + */},{key:"documentTop",get:function get(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop;}/** 1201 + Reports the padding above and below the document. 1202 + */},{key:"documentPadding",get:function get(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom};}/** 1203 + Find the line or block widget at the given vertical position. 1204 + 1205 + By default, this position is interpreted as a screen position, 1206 + meaning `docTop` is set to the DOM top position of the editor 1207 + content (forcing a layout). You can pass a different `docTop` 1208 + value—for example 0 to interpret `height` as a document-relative 1209 + position, or a precomputed document top 1210 + (`view.contentDOM.getBoundingClientRect().top`) to limit layout 1211 + queries. 1212 + 1213 + *Deprecated: use `elementAtHeight` instead.* 1214 + */},{key:"blockAtHeight",value:function blockAtHeight(height,docTop){var top=ensureTop(docTop,this);return this.elementAtHeight(height-top).moveY(top);}/** 1215 + Find the text line or block widget at the given vertical 1216 + position (which is interpreted as relative to the [top of the 1217 + document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop) 1218 + */},{key:"elementAtHeight",value:function elementAtHeight(height){this.readMeasured();return this.viewState.elementAtHeight(height);}/** 1219 + Find information for the visual line (see 1220 + [`visualLineAt`](https://codemirror.net/6/docs/ref/#view.EditorView.visualLineAt)) at the given 1221 + vertical position. The resulting block info might hold another 1222 + array of block info structs in its `type` field if this line 1223 + consists of more than one block. 1224 + 1225 + Defaults to treating `height` as a screen position. See 1226 + [`blockAtHeight`](https://codemirror.net/6/docs/ref/#view.EditorView.blockAtHeight) for the 1227 + interpretation of the `docTop` parameter. 1228 + 1229 + *Deprecated: use `lineBlockAtHeight` instead.* 1230 + */},{key:"visualLineAtHeight",value:function visualLineAtHeight(height,docTop){var top=ensureTop(docTop,this);return this.lineBlockAtHeight(height-top).moveY(top);}/** 1231 + Find the line block (see 1232 + [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) at the given 1233 + height. 1234 + */},{key:"lineBlockAtHeight",value:function lineBlockAtHeight(height){this.readMeasured();return this.viewState.lineBlockAtHeight(height);}/** 1235 + Iterate over the height information of the visual lines in the 1236 + viewport. The heights of lines are reported relative to the 1237 + given document top, which defaults to the screen position of the 1238 + document (forcing a layout). 1239 + 1240 + *Deprecated: use `viewportLineBlocks` instead.* 1241 + */},{key:"viewportLines",value:function viewportLines(f,docTop){var top=ensureTop(docTop,this);var _iterator83=_createForOfIteratorHelper(this.viewportLineBlocks),_step83;try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){var line=_step83.value;f(line.moveY(top));}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}}/** 1242 + Get the extent and vertical position of all [line 1243 + blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions 1244 + are relative to the [top of the 1245 + document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop); 1246 + */},{key:"viewportLineBlocks",get:function get(){return this.viewState.viewportLines;}/** 1247 + Find the extent and height of the visual line (a range delimited 1248 + on both sides by either non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^range) 1249 + line breaks, or the start/end of the document) at the given position. 1250 + 1251 + Vertical positions are computed relative to the `docTop` 1252 + argument, which defaults to 0 for this method. You can pass 1253 + `view.contentDOM.getBoundingClientRect().top` here to get screen 1254 + coordinates. 1255 + 1256 + *Deprecated: use `lineBlockAt` instead.* 1257 + */},{key:"visualLineAt",value:function visualLineAt(pos){var docTop=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.lineBlockAt(pos).moveY(docTop+this.viewState.paddingTop);}/** 1258 + Find the line block around the given document position. A line 1259 + block is a range delimited on both sides by either a 1260 + non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^range) line breaks, or the 1261 + start/end of the document. It will usually just hold a line of 1262 + text, but may be broken into multiple textblocks by block 1263 + widgets. 1264 + */},{key:"lineBlockAt",value:function lineBlockAt(pos){return this.viewState.lineBlockAt(pos);}/** 1265 + The editor's total content height. 1266 + */},{key:"contentHeight",get:function get(){return this.viewState.contentHeight;}/** 1267 + Move a cursor position by [grapheme 1268 + cluster](https://codemirror.net/6/docs/ref/#text.findClusterBreak). `forward` determines whether 1269 + the motion is away from the line start, or towards it. Motion in 1270 + bidirectional text is in visual order, in the editor's [text 1271 + direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). When the start 1272 + position was the last one on the line, the returned position 1273 + will be across the line break. If there is no further line, the 1274 + original position is returned. 1275 + 1276 + By default, this method moves over a single cluster. The 1277 + optional `by` argument can be used to move across more. It will 1278 + be called with the first cluster as argument, and should return 1279 + a predicate that determines, for each subsequent cluster, 1280 + whether it should also be moved over. 1281 + */},{key:"moveByChar",value:function moveByChar(start,forward,by){return skipAtoms(this,start,_moveByChar(this,start,forward,by));}/** 1282 + Move a cursor position across the next group of either 1283 + [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter 1284 + non-whitespace characters. 1285 + */},{key:"moveByGroup",value:function moveByGroup(start,forward){var _this48=this;return skipAtoms(this,start,_moveByChar(this,start,forward,function(initial){return byGroup(_this48,start.head,initial);}));}/** 1286 + Move to the next line boundary in the given direction. If 1287 + `includeWrap` is true, line wrapping is on, and there is a 1288 + further wrap point on the current line, the wrap point will be 1289 + returned. Otherwise this function will return the start or end 1290 + of the line. 1291 + */},{key:"moveToLineBoundary",value:function moveToLineBoundary(start,forward){var includeWrap=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return _moveToLineBoundary(this,start,forward,includeWrap);}/** 1292 + Move a cursor position vertically. When `distance` isn't given, 1293 + it defaults to moving to the next line (including wrapped 1294 + lines). Otherwise, `distance` should provide a positive distance 1295 + in pixels. 1296 + 1297 + When `start` has a 1298 + [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical 1299 + motion will use that as a target horizontal position. Otherwise, 1300 + the cursor's own horizontal position is used. The returned 1301 + cursor will have its goal column set to whichever column was 1302 + used. 1303 + */},{key:"moveVertically",value:function moveVertically(start,forward,distance){return skipAtoms(this,start,_moveVertically(this,start,forward,distance));}// FIXME remove on next major version 1304 + },{key:"scrollPosIntoView",value:function scrollPosIntoView(pos){this.dispatch({effects:scrollTo.of(state.EditorSelection.cursor(pos))});}/** 1305 + Find the DOM parent node and offset (child offset if `node` is 1306 + an element, character offset when it is a text node) at the 1307 + given document position. 1308 + 1309 + Note that for positions that aren't currently in 1310 + `visibleRanges`, the resulting DOM position isn't necessarily 1311 + meaningful (it may just point before or after a placeholder 1312 + element). 1313 + */},{key:"domAtPos",value:function domAtPos(pos){return this.docView.domAtPos(pos);}/** 1314 + Find the document position at the given DOM node. Can be useful 1315 + for associating positions with DOM events. Will raise an error 1316 + when `node` isn't part of the editor content. 1317 + */},{key:"posAtDOM",value:function posAtDOM(node){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.docView.posFromDOM(node,offset);}},{key:"posAtCoords",value:function posAtCoords(coords){var precise=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;this.readMeasured();return _posAtCoords(this,coords,precise);}/** 1318 + Get the screen coordinates at the given document position. 1319 + `side` determines whether the coordinates are based on the 1320 + element before (-1) or after (1) the position (if no element is 1321 + available on the given side, the method will transparently use 1322 + another strategy to get reasonable coordinates). 1323 + */},{key:"coordsAtPos",value:function coordsAtPos(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;this.readMeasured();var rect=this.docView.coordsAt(pos,side);if(!rect||rect.left==rect.right)return rect;var line=this.state.doc.lineAt(pos),order=this.bidiSpans(line);var span=order[BidiSpan.find(order,pos-line.from,-1,side)];return flattenRect(rect,span.dir==exports.Direction.LTR==side>0);}/** 1324 + The default width of a character in the editor. May not 1325 + accurately reflect the width of all characters (given variable 1326 + width fonts or styling of invididual ranges). 1327 + */},{key:"defaultCharacterWidth",get:function get(){return this.viewState.heightOracle.charWidth;}/** 1328 + The default height of a line in the editor. May not be accurate 1329 + for all lines. 1330 + */},{key:"defaultLineHeight",get:function get(){return this.viewState.heightOracle.lineHeight;}/** 1331 + The text direction 1332 + ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction) 1333 + CSS property) of the editor. 1334 + */},{key:"textDirection",get:function get(){return this.viewState.heightOracle.direction;}/** 1335 + Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping) 1336 + (as determined by the 1337 + [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space) 1338 + CSS property of its content element). 1339 + */},{key:"lineWrapping",get:function get(){return this.viewState.heightOracle.lineWrapping;}/** 1340 + Returns the bidirectional text structure of the given line 1341 + (which should be in the current document) as an array of span 1342 + objects. The order of these spans matches the [text 1343 + direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)—if that is 1344 + left-to-right, the leftmost spans come first, otherwise the 1345 + rightmost spans come first. 1346 + */},{key:"bidiSpans",value:function bidiSpans(line){if(line.length>MaxBidiLine)return trivialOrder(line.length);var dir=this.textDirection;var _iterator84=_createForOfIteratorHelper(this.bidiCache),_step84;try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){var entry=_step84.value;if(entry.from==line.from&&entry.dir==dir)return entry.order;}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}var order=computeOrder(line.text,this.textDirection);this.bidiCache.push(new CachedOrder(line.from,line.to,dir,order));return order;}/** 1347 + Check whether the editor has focus. 1348 + */},{key:"hasFocus",get:function get(){var _a;// Safari return false for hasFocus when the context menu is open 1349 + // or closing, which leads us to ignore selection changes from the 1350 + // context menu because it looks like the editor isn't focused. 1351 + // This kludges around that. 1352 + return(document.hasFocus()||browser.safari&&((_a=this.inputState)===null||_a===void 0?void 0:_a.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM;}/** 1353 + Put focus on the editor. 1354 + */},{key:"focus",value:function focus(){var _this49=this;this.observer.ignore(function(){focusPreventScroll(_this49.contentDOM);_this49.docView.updateSelection();});}/** 1355 + Clean up this editor view, removing its element from the 1356 + document, unregistering event handlers, and notifying 1357 + plugins. The view instance can no longer be used after 1358 + calling this. 1359 + */},{key:"destroy",value:function destroy(){var _iterator85=_createForOfIteratorHelper(this.plugins),_step85;try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){var _plugin9=_step85.value;_plugin9.destroy(this);}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}this.plugins=[];this.inputState.destroy();this.dom.remove();this.observer.destroy();if(this.measureScheduled>-1)cancelAnimationFrame(this.measureScheduled);this.destroyed=true;}/** 1360 + Returns an effect that can be 1361 + [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to 1362 + cause it to scroll the given position or range into view. 1363 + */}],[{key:"scrollIntoView",value:function scrollIntoView(pos){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return _scrollIntoView2.of(new ScrollTarget(typeof pos=="number"?state.EditorSelection.cursor(pos):pos,options.y,options.x,options.yMargin,options.xMargin));}/** 1364 + Facet that can be used to add DOM event handlers. The value 1365 + should be an object mapping event names to handler functions. The 1366 + first such function to return true will be assumed to have handled 1367 + that event, and no other handlers or built-in behavior will be 1368 + activated for it. 1369 + These are registered on the [content 1370 + element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except for `scroll` 1371 + handlers, which will be called any time the editor's [scroll 1372 + element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of its parent nodes 1373 + is scrolled. 1374 + */},{key:"domEventHandlers",value:function domEventHandlers(handlers){return ViewPlugin.define(function(){return{};},{eventHandlers:handlers});}/** 1375 + Create a theme extension. The first argument can be a 1376 + [`style-mod`](https://github.com/marijnh/style-mod#documentation) 1377 + style spec providing the styles for the theme. These will be 1378 + prefixed with a generated class for the style. 1379 + 1380 + Because the selectors will be prefixed with a scope class, rule 1381 + that directly match the editor's [wrapper 1382 + element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)—to which the scope class will be 1383 + added—need to be explicitly differentiated by adding an `&` to 1384 + the selector for that element—for example 1385 + `&.cm-focused`. 1386 + 1387 + When `dark` is set to true, the theme will be marked as dark, 1388 + which will cause the `&dark` rules from [base 1389 + themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to 1390 + `&light` when a light theme is active). 1391 + */},{key:"theme",value:function theme(spec,options){var prefix=styleMod.StyleModule.newName();var result=[_theme.of(prefix),styleModule.of(buildTheme(".".concat(prefix),spec))];if(options&&options.dark)result.push(darkTheme.of(true));return result;}/** 1392 + Create an extension that adds styles to the base theme. Like 1393 + with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the 1394 + place of the editor wrapper element when directly targeting 1395 + that. You can also use `&dark` or `&light` instead to only 1396 + target editors with a dark or light theme. 1397 + */},{key:"baseTheme",value:function baseTheme(spec){return state.Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,spec,lightDarkIDs)));}}]);return EditorView;}();/** 1398 + Effect that can be [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a 1399 + transaction to make it scroll the given range into view. 1400 + 1401 + *Deprecated*. Use [`scrollIntoView`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView) instead. 1402 + */EditorView.scrollTo=scrollTo;/** 1403 + Effect that makes the editor scroll the given range to the 1404 + center of the visible view. 1405 + 1406 + *Deprecated*. Use [`scrollIntoView`](https://codemirror.net/6/docs/ref/#view.EditorView^scrollIntoView) instead. 1407 + */EditorView.centerOn=centerOn;/** 1408 + Facet to add a [style 1409 + module](https://github.com/marijnh/style-mod#documentation) to 1410 + an editor view. The view will ensure that the module is 1411 + mounted in its [document 1412 + root](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.root). 1413 + */EditorView.styleModule=styleModule;/** 1414 + An input handler can override the way changes to the editable 1415 + DOM content are handled. Handlers are passed the document 1416 + positions between which the change was found, and the new 1417 + content. When one returns true, no further input handlers are 1418 + called and the default behavior is prevented. 1419 + */EditorView.inputHandler=inputHandler;/** 1420 + Allows you to provide a function that should be called when the 1421 + library catches an exception from an extension (mostly from view 1422 + plugins, but may be used by other extensions to route exceptions 1423 + from user-code-provided callbacks). This is mostly useful for 1424 + debugging and logging. See [`logException`](https://codemirror.net/6/docs/ref/#view.logException). 1425 + */EditorView.exceptionSink=exceptionSink;/** 1426 + A facet that can be used to register a function to be called 1427 + every time the view updates. 1428 + */EditorView.updateListener=updateListener;/** 1429 + Facet that controls whether the editor content DOM is editable. 1430 + When its highest-precedence value is `false`, the element will 1431 + not longer have its `contenteditable` attribute set. (Note that 1432 + this doesn't affect API calls that change the editor content, 1433 + even when those are bound to keys or buttons. See the 1434 + [`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) facet for that.) 1435 + */EditorView.editable=editable;/** 1436 + Allows you to influence the way mouse selection happens. The 1437 + functions in this facet will be called for a `mousedown` event 1438 + on the editor, and can return an object that overrides the way a 1439 + selection is computed from that mouse click or drag. 1440 + */EditorView.mouseSelectionStyle=mouseSelectionStyle;/** 1441 + Facet used to configure whether a given selection drag event 1442 + should move or copy the selection. The given predicate will be 1443 + called with the `mousedown` event, and can return `true` when 1444 + the drag should move the content. 1445 + */EditorView.dragMovesSelection=dragMovesSelection$1;/** 1446 + Facet used to configure whether a given selecting click adds 1447 + a new range to the existing selection or replaces it entirely. 1448 + */EditorView.clickAddsSelectionRange=clickAddsSelectionRange;/** 1449 + A facet that determines which [decorations](https://codemirror.net/6/docs/ref/#view.Decoration) 1450 + are shown in the view. See also [view 1451 + plugins](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), which have a separate 1452 + mechanism for providing decorations. 1453 + */EditorView.decorations=decorations;/** 1454 + This facet records whether a dark theme is active. The extension 1455 + returned by [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme) automatically 1456 + includes an instance of this when the `dark` option is set to 1457 + true. 1458 + */EditorView.darkTheme=darkTheme;/** 1459 + Facet that provides additional DOM attributes for the editor's 1460 + editable DOM element. 1461 + */EditorView.contentAttributes=contentAttributes;/** 1462 + Facet that provides DOM attributes for the editor's outer 1463 + element. 1464 + */EditorView.editorAttributes=editorAttributes;/** 1465 + An extension that enables line wrapping in the editor (by 1466 + setting CSS `white-space` to `pre-wrap` in the content). 1467 + */EditorView.lineWrapping=EditorView.contentAttributes.of({"class":"cm-lineWrapping"});/** 1468 + State effect used to include screen reader announcements in a 1469 + transaction. These will be added to the DOM in a visually hidden 1470 + element with `aria-live="polite"` set, and should be used to 1471 + describe effects that are visually obvious but may not be 1472 + noticed by screen reader users (such as moving to the next 1473 + search match). 1474 + */EditorView.announce=state.StateEffect.define();// Maximum line length for which we compute accurate bidi info 1475 + var MaxBidiLine=4096;// FIXME remove this and its callers on next breaking release 1476 + function ensureTop(given,view){return(given==null?view.contentDOM.getBoundingClientRect().top:given)+view.viewState.paddingTop;}var resizeDebounce=-1;function ensureGlobalHandler(){window.addEventListener("resize",function(){if(resizeDebounce==-1)resizeDebounce=setTimeout(handleResize,50);});}function handleResize(){resizeDebounce=-1;var found=document.querySelectorAll(".cm-content");for(var _i49=0;_i49<found.length;_i49++){var docView=ContentView.get(found[_i49]);if(docView)docView.editorView.requestMeasure();}}var BadMeasure={};var CachedOrder=/*#__PURE__*/function(){function CachedOrder(from,to,dir,order){_classCallCheck(this,CachedOrder);this.from=from;this.to=to;this.dir=dir;this.order=order;}_createClass(CachedOrder,null,[{key:"update",value:function update(cache,changes){if(changes.empty)return cache;var result=[],lastDir=cache.length?cache[cache.length-1].dir:exports.Direction.LTR;for(var _i50=Math.max(0,cache.length-10);_i50<cache.length;_i50++){var entry=cache[_i50];if(entry.dir==lastDir&&!changes.touchesRange(entry.from,entry.to))result.push(new CachedOrder(changes.mapPos(entry.from,1),changes.mapPos(entry.to,-1),entry.dir,entry.order));}return result;}}]);return CachedOrder;}();function attrsFromFacet(view,facet,base){for(var sources=view.state.facet(facet),_i51=sources.length-1;_i51>=0;_i51--){var source=sources[_i51],value=typeof source=="function"?source(view):source;if(value)combineAttrs(value,base);}return base;}var currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(name,platform){var parts=name.split(/-(?!$)/);var result=parts[parts.length-1];if(result=="Space")result=" ";var alt,ctrl,shift,meta;for(var _i52=0;_i52<parts.length-1;++_i52){var mod=parts[_i52];if(/^(cmd|meta|m)$/i.test(mod))meta=true;else if(/^a(lt)?$/i.test(mod))alt=true;else if(/^(c|ctrl|control)$/i.test(mod))ctrl=true;else if(/^s(hift)?$/i.test(mod))shift=true;else if(/^mod$/i.test(mod)){if(platform=="mac")meta=true;else ctrl=true;}else throw new Error("Unrecognized modifier name: "+mod);}if(alt)result="Alt-"+result;if(ctrl)result="Ctrl-"+result;if(meta)result="Meta-"+result;if(shift)result="Shift-"+result;return result;}function modifiers(name,event,shift){if(event.altKey)name="Alt-"+name;if(event.ctrlKey)name="Ctrl-"+name;if(event.metaKey)name="Meta-"+name;if(shift!==false&&event.shiftKey)name="Shift-"+name;return name;}var handleKeyEvents=EditorView.domEventHandlers({keydown:function keydown(event,view){return runHandlers(getKeymap(view.state),event,view,"editor");}});/** 1477 + Facet used for registering keymaps. 1478 + 1479 + You can add multiple keymaps to an editor. Their priorities 1480 + determine their precedence (the ones specified early or with high 1481 + priority get checked first). When a handler has returned `true` 1482 + for a given key, no further handlers are called. 1483 + */var keymap=state.Facet.define({enables:handleKeyEvents});var Keymaps=new WeakMap();// This is hidden behind an indirection, rather than directly computed 1484 + // by the facet, to keep internal types out of the facet's type. 1485 + function getKeymap(state){var bindings=state.facet(keymap);var map=Keymaps.get(bindings);if(!map)Keymaps.set(bindings,map=buildKeymap(bindings.reduce(function(a,b){return a.concat(b);},[])));return map;}/** 1486 + Run the key handlers registered for a given scope. The event 1487 + object should be `"keydown"` event. Returns true if any of the 1488 + handlers handled it. 1489 + */function runScopeHandlers(view,event,scope){return runHandlers(getKeymap(view.state),event,view,scope);}var storedPrefix=null;var PrefixTimeout=4000;function buildKeymap(bindings){var platform=arguments.length>1&&arguments[1]!==undefined?arguments[1]:currentPlatform;var bound=Object.create(null);var isPrefix=Object.create(null);var checkPrefix=function checkPrefix(name,is){var current=isPrefix[name];if(current==null)isPrefix[name]=is;else if(current!=is)throw new Error("Key binding "+name+" is used both as a regular binding and as a multi-stroke prefix");};var add=function add(scope,key,command,preventDefault){var scopeObj=bound[scope]||(bound[scope]=Object.create(null));var parts=key.split(/ (?!$)/).map(function(k){return normalizeKeyName(k,platform);});var _loop10=function _loop10(_i53){var prefix=parts.slice(0,_i53).join(" ");checkPrefix(prefix,true);if(!scopeObj[prefix])scopeObj[prefix]={preventDefault:true,commands:[function(view){var ourObj=storedPrefix={view:view,prefix:prefix,scope:scope};setTimeout(function(){if(storedPrefix==ourObj)storedPrefix=null;},PrefixTimeout);return true;}]};};for(var _i53=1;_i53<parts.length;_i53++){_loop10(_i53);}var full=parts.join(" ");checkPrefix(full,false);var binding=scopeObj[full]||(scopeObj[full]={preventDefault:false,commands:[]});binding.commands.push(command);if(preventDefault)binding.preventDefault=true;};var _iterator86=_createForOfIteratorHelper(bindings),_step86;try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){var b=_step86.value;var name=b[platform]||b.key;if(!name)continue;var _iterator87=_createForOfIteratorHelper(b.scope?b.scope.split(" "):["editor"]),_step87;try{for(_iterator87.s();!(_step87=_iterator87.n()).done;){var scope=_step87.value;add(scope,name,b.run,b.preventDefault);if(b.shift)add(scope,"Shift-"+name,b.shift,b.preventDefault);}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}return bound;}function runHandlers(map,event,view,scope){var name=w3cKeyname.keyName(event),isChar=name.length==1&&name!=" ";var prefix="",fallthrough=false;if(storedPrefix&&storedPrefix.view==view&&storedPrefix.scope==scope){prefix=storedPrefix.prefix+" ";if(fallthrough=modifierCodes.indexOf(event.keyCode)<0)storedPrefix=null;}var runFor=function runFor(binding){if(binding){var _iterator88=_createForOfIteratorHelper(binding.commands),_step88;try{for(_iterator88.s();!(_step88=_iterator88.n()).done;){var cmd=_step88.value;if(cmd(view))return true;}}catch(err){_iterator88.e(err);}finally{_iterator88.f();}if(binding.preventDefault)fallthrough=true;}return false;};var scopeObj=map[scope],baseName;if(scopeObj){if(runFor(scopeObj[prefix+modifiers(name,event,!isChar)]))return true;if(isChar&&(event.shiftKey||event.altKey||event.metaKey)&&(baseName=w3cKeyname.base[event.keyCode])&&baseName!=name){if(runFor(scopeObj[prefix+modifiers(baseName,event,true)]))return true;}else if(isChar&&event.shiftKey){if(runFor(scopeObj[prefix+modifiers(name,event,true)]))return true;}}return fallthrough;}var CanHidePrimary=!browser.ios;// FIXME test IE 1490 + var selectionConfig=state.Facet.define({combine:function combine(configs){return state.combineConfig(configs,{cursorBlinkRate:1200,drawRangeCursor:true},{cursorBlinkRate:function cursorBlinkRate(a,b){return Math.min(a,b);},drawRangeCursor:function drawRangeCursor(a,b){return a||b;}});}});/** 1491 + Returns an extension that hides the browser's native selection and 1492 + cursor, replacing the selection with a background behind the text 1493 + (with the `cm-selectionBackground` class), and the 1494 + cursors with elements overlaid over the code (using 1495 + `cm-cursor-primary` and `cm-cursor-secondary`). 1496 + 1497 + This allows the editor to display secondary selection ranges, and 1498 + tends to produce a type of selection more in line with that users 1499 + expect in a text editor (the native selection styling will often 1500 + leave gaps between lines and won't fill the horizontal space after 1501 + a line when the selection continues past it). 1502 + 1503 + It does have a performance cost, in that it requires an extra DOM 1504 + layout cycle for many updates (the selection is drawn based on DOM 1505 + layout information that's only available after laying out the 1506 + content). 1507 + */function drawSelection(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[selectionConfig.of(config),drawSelectionPlugin,hideNativeSelection];}var Piece=/*#__PURE__*/function(){function Piece(left,top,width,height,className){_classCallCheck(this,Piece);this.left=left;this.top=top;this.width=width;this.height=height;this.className=className;}_createClass(Piece,[{key:"draw",value:function draw(){var elt=document.createElement("div");elt.className=this.className;this.adjust(elt);return elt;}},{key:"adjust",value:function adjust(elt){elt.style.left=this.left+"px";elt.style.top=this.top+"px";if(this.width>=0)elt.style.width=this.width+"px";elt.style.height=this.height+"px";}},{key:"eq",value:function eq(p){return this.left==p.left&&this.top==p.top&&this.width==p.width&&this.height==p.height&&this.className==p.className;}}]);return Piece;}();var drawSelectionPlugin=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class4(view){_classCallCheck(this,_class4);this.view=view;this.rangePieces=[];this.cursors=[];this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)};this.selectionLayer=view.scrollDOM.appendChild(document.createElement("div"));this.selectionLayer.className="cm-selectionLayer";this.selectionLayer.setAttribute("aria-hidden","true");this.cursorLayer=view.scrollDOM.appendChild(document.createElement("div"));this.cursorLayer.className="cm-cursorLayer";this.cursorLayer.setAttribute("aria-hidden","true");view.requestMeasure(this.measureReq);this.setBlinkRate();}_createClass(_class4,[{key:"setBlinkRate",value:function setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(selectionConfig).cursorBlinkRate+"ms";}},{key:"update",value:function update(_update8){var confChanged=_update8.startState.facet(selectionConfig)!=_update8.state.facet(selectionConfig);if(confChanged||_update8.selectionSet||_update8.geometryChanged||_update8.viewportChanged)this.view.requestMeasure(this.measureReq);if(_update8.transactions.some(function(tr){return tr.scrollIntoView;}))this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink";if(confChanged)this.setBlinkRate();}},{key:"readPos",value:function readPos(){var _this50=this;var state=this.view.state,conf=state.facet(selectionConfig);var rangePieces=state.selection.ranges.map(function(r){return r.empty?[]:measureRange(_this50.view,r);}).reduce(function(a,b){return a.concat(b);});var cursors=[];var _iterator89=_createForOfIteratorHelper(state.selection.ranges),_step89;try{for(_iterator89.s();!(_step89=_iterator89.n()).done;){var _r3=_step89.value;var prim=_r3==state.selection.main;if(_r3.empty?!prim||CanHidePrimary:conf.drawRangeCursor){var piece=measureCursor(this.view,_r3,prim);if(piece)cursors.push(piece);}}}catch(err){_iterator89.e(err);}finally{_iterator89.f();}return{rangePieces:rangePieces,cursors:cursors};}},{key:"drawSel",value:function drawSel(_ref46){var _this51=this;var rangePieces=_ref46.rangePieces,cursors=_ref46.cursors;if(rangePieces.length!=this.rangePieces.length||rangePieces.some(function(p,i){return!p.eq(_this51.rangePieces[i]);})){this.selectionLayer.textContent="";var _iterator90=_createForOfIteratorHelper(rangePieces),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var _p2=_step90.value;this.selectionLayer.appendChild(_p2.draw());}}catch(err){_iterator90.e(err);}finally{_iterator90.f();}this.rangePieces=rangePieces;}if(cursors.length!=this.cursors.length||cursors.some(function(c,i){return!c.eq(_this51.cursors[i]);})){var oldCursors=this.cursorLayer.children;if(oldCursors.length!==cursors.length){this.cursorLayer.textContent="";var _iterator91=_createForOfIteratorHelper(cursors),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var c=_step91.value;this.cursorLayer.appendChild(c.draw());}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}}else{cursors.forEach(function(c,idx){return c.adjust(oldCursors[idx]);});}this.cursors=cursors;}}},{key:"destroy",value:function destroy(){this.selectionLayer.remove();this.cursorLayer.remove();}}]);return _class4;}());var themeSpec={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};if(CanHidePrimary)themeSpec[".cm-line"].caretColor="transparent !important";var hideNativeSelection=state.Prec.highest(EditorView.theme(themeSpec));function getBase(view){var rect=view.scrollDOM.getBoundingClientRect();var left=view.textDirection==exports.Direction.LTR?rect.left:rect.right-view.scrollDOM.clientWidth;return{left:left-view.scrollDOM.scrollLeft,top:rect.top-view.scrollDOM.scrollTop};}function wrappedLine(view,pos,inside){var range=state.EditorSelection.cursor(pos);return{from:Math.max(inside.from,view.moveToLineBoundary(range,false,true).from),to:Math.min(inside.to,view.moveToLineBoundary(range,true,true).from),type:exports.BlockType.Text};}function blockAt(view,pos){var line=view.lineBlockAt(pos);if(Array.isArray(line.type)){var _iterator92=_createForOfIteratorHelper(line.type),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _l2=_step92.value;if(_l2.to>pos||_l2.to==pos&&(_l2.to==line.to||_l2.type==exports.BlockType.Text))return _l2;}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}return line;}function measureRange(view,range){if(range.to<=view.viewport.from||range.from>=view.viewport.to)return[];var from=Math.max(range.from,view.viewport.from),to=Math.min(range.to,view.viewport.to);var ltr=view.textDirection==exports.Direction.LTR;var content=view.contentDOM,contentRect=content.getBoundingClientRect(),base=getBase(view);var lineStyle=window.getComputedStyle(content.firstChild);var leftSide=contentRect.left+parseInt(lineStyle.paddingLeft)+Math.min(0,parseInt(lineStyle.textIndent));var rightSide=contentRect.right-parseInt(lineStyle.paddingRight);var startBlock=blockAt(view,from),endBlock=blockAt(view,to);var visualStart=startBlock.type==exports.BlockType.Text?startBlock:null;var visualEnd=endBlock.type==exports.BlockType.Text?endBlock:null;if(view.lineWrapping){if(visualStart)visualStart=wrappedLine(view,from,visualStart);if(visualEnd)visualEnd=wrappedLine(view,to,visualEnd);}if(visualStart&&visualEnd&&visualStart.from==visualEnd.from){return pieces(drawForLine(range.from,range.to,visualStart));}else{var top=visualStart?drawForLine(range.from,null,visualStart):drawForWidget(startBlock,false);var bottom=visualEnd?drawForLine(null,range.to,visualEnd):drawForWidget(endBlock,true);var between=[];if((visualStart||startBlock).to<(visualEnd||endBlock).from-1)between.push(piece(leftSide,top.bottom,rightSide,bottom.top));else if(top.bottom<bottom.top&&view.elementAtHeight((top.bottom+bottom.top)/2).type==exports.BlockType.Text)top.bottom=bottom.top=(top.bottom+bottom.top)/2;return pieces(top).concat(between).concat(pieces(bottom));}function piece(left,top,right,bottom){return new Piece(left-base.left,top-base.top-0.01/* Epsilon */,right-left,bottom-top+0.01/* Epsilon */,"cm-selectionBackground");}function pieces(_ref47){var top=_ref47.top,bottom=_ref47.bottom,horizontal=_ref47.horizontal;var pieces=[];for(var _i54=0;_i54<horizontal.length;_i54+=2){pieces.push(piece(horizontal[_i54],top,horizontal[_i54+1],bottom));}return pieces;}// Gets passed from/to in line-local positions 1508 + function drawForLine(from,to,line){var top=1e9,bottom=-1e9,horizontal=[];function addSpan(from,fromOpen,to,toOpen,dir){// Passing 2/-2 is a kludge to force the view to return 1509 + // coordinates on the proper side of block widgets, since 1510 + // normalizing the side there, though appropriate for most 1511 + // coordsAtPos queries, would break selection drawing. 1512 + var fromCoords=view.coordsAtPos(from,from==line.to?-2:2);var toCoords=view.coordsAtPos(to,to==line.from?2:-2);top=Math.min(fromCoords.top,toCoords.top,top);bottom=Math.max(fromCoords.bottom,toCoords.bottom,bottom);if(dir==exports.Direction.LTR)horizontal.push(ltr&&fromOpen?leftSide:fromCoords.left,ltr&&toOpen?rightSide:toCoords.right);else horizontal.push(!ltr&&toOpen?leftSide:toCoords.left,!ltr&&fromOpen?rightSide:fromCoords.right);}var start=from!==null&&from!==void 0?from:line.from,end=to!==null&&to!==void 0?to:line.to;// Split the range by visible range and document line 1513 + var _iterator93=_createForOfIteratorHelper(view.visibleRanges),_step93;try{for(_iterator93.s();!(_step93=_iterator93.n()).done;){var _r4=_step93.value;if(_r4.to>start&&_r4.from<end){for(var pos=Math.max(_r4.from,start),endPos=Math.min(_r4.to,end);;){var docLine=view.state.doc.lineAt(pos);var _iterator94=_createForOfIteratorHelper(view.bidiSpans(docLine)),_step94;try{for(_iterator94.s();!(_step94=_iterator94.n()).done;){var span=_step94.value;var spanFrom=span.from+docLine.from,spanTo=span.to+docLine.from;if(spanFrom>=endPos)break;if(spanTo>pos)addSpan(Math.max(spanFrom,pos),from==null&&spanFrom<=start,Math.min(spanTo,endPos),to==null&&spanTo>=end,span.dir);}}catch(err){_iterator94.e(err);}finally{_iterator94.f();}pos=docLine.to+1;if(pos>=endPos)break;}}}}catch(err){_iterator93.e(err);}finally{_iterator93.f();}if(horizontal.length==0)addSpan(start,from==null,end,to==null,view.textDirection);return{top:top,bottom:bottom,horizontal:horizontal};}function drawForWidget(block,top){var y=contentRect.top+(top?block.top:block.bottom);return{top:y,bottom:y,horizontal:[]};}}function measureCursor(view,cursor,primary){var pos=view.coordsAtPos(cursor.head,cursor.assoc||1);if(!pos)return null;var base=getBase(view);return new Piece(pos.left-base.left,pos.top-base.top,-1,pos.bottom-pos.top,primary?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary");}var setDropCursorPos=state.StateEffect.define({map:function map(pos,mapping){return pos==null?null:mapping.mapPos(pos);}});var dropCursorPos=state.StateField.define({create:function create(){return null;},update:function update(pos,tr){if(pos!=null)pos=tr.changes.mapPos(pos);return tr.effects.reduce(function(pos,e){return e.is(setDropCursorPos)?e.value:pos;},pos);}});var drawDropCursor=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class5(view){_classCallCheck(this,_class5);this.view=view;this.cursor=null;this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)};}_createClass(_class5,[{key:"update",value:function update(_update9){var _a;var cursorPos=_update9.state.field(dropCursorPos);if(cursorPos==null){if(this.cursor!=null){(_a=this.cursor)===null||_a===void 0?void 0:_a.remove();this.cursor=null;}}else{if(!this.cursor){this.cursor=this.view.scrollDOM.appendChild(document.createElement("div"));this.cursor.className="cm-dropCursor";}if(_update9.startState.field(dropCursorPos)!=cursorPos||_update9.docChanged||_update9.geometryChanged)this.view.requestMeasure(this.measureReq);}}},{key:"readPos",value:function readPos(){var pos=this.view.state.field(dropCursorPos);var rect=pos!=null&&this.view.coordsAtPos(pos);if(!rect)return null;var outer=this.view.scrollDOM.getBoundingClientRect();return{left:rect.left-outer.left+this.view.scrollDOM.scrollLeft,top:rect.top-outer.top+this.view.scrollDOM.scrollTop,height:rect.bottom-rect.top};}},{key:"drawCursor",value:function drawCursor(pos){if(this.cursor){if(pos){this.cursor.style.left=pos.left+"px";this.cursor.style.top=pos.top+"px";this.cursor.style.height=pos.height+"px";}else{this.cursor.style.left="-100000px";}}}},{key:"destroy",value:function destroy(){if(this.cursor)this.cursor.remove();}},{key:"setDropPos",value:function setDropPos(pos){if(this.view.state.field(dropCursorPos)!=pos)this.view.dispatch({effects:setDropCursorPos.of(pos)});}}]);return _class5;}(),{eventHandlers:{dragover:function dragover(event){this.setDropPos(this.view.posAtCoords({x:event.clientX,y:event.clientY}));},dragleave:function dragleave(event){if(event.target==this.view.contentDOM||!this.view.contentDOM.contains(event.relatedTarget))this.setDropPos(null);},dragend:function dragend(){this.setDropPos(null);},drop:function drop(){this.setDropPos(null);}}});/** 1514 + Draws a cursor at the current drop position when something is 1515 + dragged over the editor. 1516 + */function dropCursor(){return[dropCursorPos,drawDropCursor];}function iterMatches(doc,re,from,to,f){re.lastIndex=0;for(var cursor=doc.iterRange(from,to),pos=from,m;!cursor.next().done;pos+=cursor.value.length){if(!cursor.lineBreak)while(m=re.exec(cursor.value)){f(pos+m.index,pos+m.index+m[0].length,m);}}}function matchRanges(view,maxLength){var visible=view.visibleRanges;if(visible.length==1&&visible[0].from==view.viewport.from&&visible[0].to==view.viewport.to)return visible;var result=[];var _iterator95=_createForOfIteratorHelper(visible),_step95;try{for(_iterator95.s();!(_step95=_iterator95.n()).done;){var _step95$value=_step95.value,from=_step95$value.from,to=_step95$value.to;from=Math.max(view.state.doc.lineAt(from).from,from-maxLength);to=Math.min(view.state.doc.lineAt(to).to,to+maxLength);if(result.length&&result[result.length-1].to>=from)result[result.length-1].to=to;else result.push({from:from,to:to});}}catch(err){_iterator95.e(err);}finally{_iterator95.f();}return result;}/** 1517 + Helper class used to make it easier to maintain decorations on 1518 + visible code that matches a given regular expression. To be used 1519 + in a [view plugin](https://codemirror.net/6/docs/ref/#view.ViewPlugin). Instances of this object 1520 + represent a matching configuration. 1521 + */var MatchDecorator=/*#__PURE__*/function(){/** 1522 + Create a decorator. 1523 + */function MatchDecorator(config){_classCallCheck(this,MatchDecorator);var regexp=config.regexp,decoration=config.decoration,boundary=config.boundary,_config$maxLength=config.maxLength,maxLength=_config$maxLength===void 0?1000:_config$maxLength;if(!regexp.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");this.regexp=regexp;this.getDeco=typeof decoration=="function"?decoration:function(){return decoration;};this.boundary=boundary;this.maxLength=maxLength;}/** 1524 + Compute the full set of decorations for matches in the given 1525 + view's viewport. You'll want to call this when initializing your 1526 + plugin. 1527 + */_createClass(MatchDecorator,[{key:"createDeco",value:function createDeco(view){var _this52=this;var build=new rangeset.RangeSetBuilder();var _iterator96=_createForOfIteratorHelper(matchRanges(view,this.maxLength)),_step96;try{for(_iterator96.s();!(_step96=_iterator96.n()).done;){var _step96$value=_step96.value,from=_step96$value.from,to=_step96$value.to;iterMatches(view.state.doc,this.regexp,from,to,function(a,b,m){return build.add(a,b,_this52.getDeco(m,view,a));});}}catch(err){_iterator96.e(err);}finally{_iterator96.f();}return build.finish();}/** 1528 + Update a set of decorations for a view update. `deco` _must_ be 1529 + the set of decorations produced by _this_ `MatchDecorator` for 1530 + the view state before the update. 1531 + */},{key:"updateDeco",value:function updateDeco(update,deco){var changeFrom=1e9,changeTo=-1;if(update.docChanged)update.changes.iterChanges(function(_f,_t,from,to){if(to>update.view.viewport.from&&from<update.view.viewport.to){changeFrom=Math.min(from,changeFrom);changeTo=Math.max(to,changeTo);}});if(update.viewportChanged||changeTo-changeFrom>1000)return this.createDeco(update.view);if(changeTo>-1)return this.updateRange(update.view,deco.map(update.changes),changeFrom,changeTo);return deco;}},{key:"updateRange",value:function updateRange(view,deco,updateFrom,updateTo){var _this53=this;var _iterator97=_createForOfIteratorHelper(view.visibleRanges),_step97;try{for(_iterator97.s();!(_step97=_iterator97.n()).done;){var _r5=_step97.value;var from=Math.max(_r5.from,updateFrom),to=Math.min(_r5.to,updateTo);if(to>from){(function(){var fromLine=view.state.doc.lineAt(from),toLine=fromLine.to<to?view.state.doc.lineAt(to):fromLine;var start=Math.max(_r5.from,fromLine.from),end=Math.min(_r5.to,toLine.to);if(_this53.boundary){for(;from>fromLine.from;from--){if(_this53.boundary.test(fromLine.text[from-1-fromLine.from])){start=from;break;}}for(;to<toLine.to;to++){if(_this53.boundary.test(toLine.text[to-toLine.from])){end=to;break;}}}var ranges=[],m=void 0;if(fromLine==toLine){_this53.regexp.lastIndex=start-fromLine.from;while((m=_this53.regexp.exec(fromLine.text))&&m.index<end-fromLine.from){var pos=m.index+fromLine.from;ranges.push(_this53.getDeco(m,view,pos).range(pos,pos+m[0].length));}}else{iterMatches(view.state.doc,_this53.regexp,start,end,function(from,to,m){return ranges.push(_this53.getDeco(m,view,from).range(from,to));});}deco=deco.update({filterFrom:start,filterTo:end,filter:function filter(from,to){return from<start||to>end;},add:ranges});})();}}}catch(err){_iterator97.e(err);}finally{_iterator97.f();}return deco;}}]);return MatchDecorator;}();var UnicodeRegexpSupport=/x/.unicode!=null?"gu":"g";var Specials=new RegExp("[\0-\b\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\uFEFF\uFFF9-\uFFFC]",UnicodeRegexpSupport);var Names={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};var _supportsTabSize=null;function supportsTabSize(){var _a;if(_supportsTabSize==null&&typeof document!="undefined"&&document.body){var styles=document.body.style;_supportsTabSize=((_a=styles.tabSize)!==null&&_a!==void 0?_a:styles.MozTabSize)!=null;}return _supportsTabSize||false;}var specialCharConfig=state.Facet.define({combine:function combine(configs){var config=state.combineConfig(configs,{render:null,specialChars:Specials,addSpecialChars:null});if(config.replaceTabs=!supportsTabSize())config.specialChars=new RegExp("\t|"+config.specialChars.source,UnicodeRegexpSupport);if(config.addSpecialChars)config.specialChars=new RegExp(config.specialChars.source+"|"+config.addSpecialChars.source,UnicodeRegexpSupport);return config;}});/** 1532 + Returns an extension that installs highlighting of special 1533 + characters. 1534 + */function highlightSpecialChars(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[specialCharConfig.of(config),specialCharPlugin()];}var _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class6(view){_classCallCheck(this,_class6);this.view=view;this.decorations=Decoration.none;this.decorationCache=Object.create(null);this.decorator=this.makeDecorator(view.state.facet(specialCharConfig));this.decorations=this.decorator.createDeco(view);}_createClass(_class6,[{key:"makeDecorator",value:function makeDecorator(conf){var _this54=this;return new MatchDecorator({regexp:conf.specialChars,decoration:function decoration(m,view,pos){var doc=view.state.doc;var code=text.codePointAt(m[0],0);if(code==9){var line=doc.lineAt(pos);var size=view.state.tabSize,col=text.countColumn(line.text,size,pos-line.from);return Decoration.replace({widget:new TabWidget((size-col%size)*_this54.view.defaultCharacterWidth)});}return _this54.decorationCache[code]||(_this54.decorationCache[code]=Decoration.replace({widget:new SpecialCharWidget(conf,code)}));},boundary:conf.replaceTabs?undefined:/[^]/});}},{key:"update",value:function update(_update10){var conf=_update10.state.facet(specialCharConfig);if(_update10.startState.facet(specialCharConfig)!=conf){this.decorator=this.makeDecorator(conf);this.decorations=this.decorator.createDeco(_update10.view);}else{this.decorations=this.decorator.updateDeco(_update10,this.decorations);}}}]);return _class6;}(),{decorations:function decorations(v){return v.decorations;}}));}var DefaultPlaceholder="\u2022";// Assigns placeholder characters from the Control Pictures block to 1535 + // ASCII control characters 1536 + function placeholder$1(code){if(code>=32)return DefaultPlaceholder;if(code==10)return"\u2424";return String.fromCharCode(9216+code);}var SpecialCharWidget=/*#__PURE__*/function(_WidgetType5){_inherits(SpecialCharWidget,_WidgetType5);var _super24=_createSuper(SpecialCharWidget);function SpecialCharWidget(options,code){var _this55;_classCallCheck(this,SpecialCharWidget);_this55=_super24.call(this);_this55.options=options;_this55.code=code;return _this55;}_createClass(SpecialCharWidget,[{key:"eq",value:function eq(other){return other.code==this.code;}},{key:"toDOM",value:function toDOM(view){var ph=placeholder$1(this.code);var desc=view.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16));var custom=this.options.render&&this.options.render(this.code,desc,ph);if(custom)return custom;var span=document.createElement("span");span.textContent=ph;span.title=desc;span.setAttribute("aria-label",desc);span.className="cm-specialChar";return span;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}}]);return SpecialCharWidget;}(WidgetType);var TabWidget=/*#__PURE__*/function(_WidgetType6){_inherits(TabWidget,_WidgetType6);var _super25=_createSuper(TabWidget);function TabWidget(width){var _this56;_classCallCheck(this,TabWidget);_this56=_super25.call(this);_this56.width=width;return _this56;}_createClass(TabWidget,[{key:"eq",value:function eq(other){return other.width==this.width;}},{key:"toDOM",value:function toDOM(){var span=document.createElement("span");span.textContent="\t";span.className="cm-tab";span.style.width=this.width+"px";return span;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}}]);return TabWidget;}(WidgetType);var plugin=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class7(){_classCallCheck(this,_class7);this.height=1000;this.attrs={style:"padding-bottom: 1000px"};}_createClass(_class7,[{key:"update",value:function update(_update11){var height=_update11.view.viewState.editorHeight-_update11.view.defaultLineHeight;if(height!=this.height){this.height=height;this.attrs={style:"padding-bottom: ".concat(height,"px")};}}}]);return _class7;}());/** 1537 + Returns an extension that makes sure the content has a bottom 1538 + margin equivalent to the height of the editor, minus one line 1539 + height, so that every line in the document can be scrolled to the 1540 + top of the editor. 1541 + 1542 + This is only meaningful when the editor is scrollable, and should 1543 + not be enabled in editors that take the size of their content. 1544 + */function scrollPastEnd(){return[plugin,contentAttributes.of(function(view){var _a;return((_a=view.plugin(plugin))===null||_a===void 0?void 0:_a.attrs)||null;})];}/** 1545 + Mark lines that have a cursor on them with the `"cm-activeLine"` 1546 + DOM class. 1547 + */function highlightActiveLine(){return activeLineHighlighter;}var lineDeco=Decoration.line({"class":"cm-activeLine"});var activeLineHighlighter=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class8(view){_classCallCheck(this,_class8);this.decorations=this.getDeco(view);}_createClass(_class8,[{key:"update",value:function update(_update12){if(_update12.docChanged||_update12.selectionSet)this.decorations=this.getDeco(_update12.view);}},{key:"getDeco",value:function getDeco(view){var lastLineStart=-1,deco=[];var _iterator98=_createForOfIteratorHelper(view.state.selection.ranges),_step98;try{for(_iterator98.s();!(_step98=_iterator98.n()).done;){var _r6=_step98.value;if(!_r6.empty)return Decoration.none;var line=view.lineBlockAt(_r6.head);if(line.from>lastLineStart){deco.push(lineDeco.range(line.from));lastLineStart=line.from;}}}catch(err){_iterator98.e(err);}finally{_iterator98.f();}return Decoration.set(deco);}}]);return _class8;}(),{decorations:function decorations(v){return v.decorations;}});var Placeholder=/*#__PURE__*/function(_WidgetType7){_inherits(Placeholder,_WidgetType7);var _super26=_createSuper(Placeholder);function Placeholder(content){var _this57;_classCallCheck(this,Placeholder);_this57=_super26.call(this);_this57.content=content;return _this57;}_createClass(Placeholder,[{key:"toDOM",value:function toDOM(){var wrap=document.createElement("span");wrap.className="cm-placeholder";wrap.style.pointerEvents="none";wrap.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content);if(typeof this.content=="string")wrap.setAttribute("aria-label","placeholder "+this.content);else wrap.setAttribute("aria-hidden","true");return wrap;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}}]);return Placeholder;}(WidgetType);/** 1548 + Extension that enables a placeholder—a piece of example content 1549 + to show when the editor is empty. 1550 + */function placeholder(content){return ViewPlugin.fromClass(/*#__PURE__*/function(){function _class9(view){_classCallCheck(this,_class9);this.view=view;this.placeholder=Decoration.set([Decoration.widget({widget:new Placeholder(content),side:1}).range(0)]);}_createClass(_class9,[{key:"decorations",get:function get(){return this.view.state.doc.length?Decoration.none:this.placeholder;}}]);return _class9;}(),{decorations:function decorations(v){return v.decorations;}});}/** 1551 + @internal 1552 + */var __test={HeightMap:HeightMap,HeightOracle:HeightOracle,MeasuredHeights:MeasuredHeights,QueryType:QueryType,ChangedRange:ChangedRange,computeOrder:computeOrder,moveVisually:moveVisually};Object.defineProperty(exports,'Range',{enumerable:true,get:function get(){return rangeset.Range;}});exports.BidiSpan=BidiSpan;exports.BlockInfo=BlockInfo;exports.Decoration=Decoration;exports.EditorView=EditorView;exports.MatchDecorator=MatchDecorator;exports.PluginField=PluginField;exports.PluginFieldProvider=PluginFieldProvider;exports.ViewPlugin=ViewPlugin;exports.ViewUpdate=ViewUpdate;exports.WidgetType=WidgetType;exports.__test=__test;exports.drawSelection=drawSelection;exports.dropCursor=dropCursor;exports.highlightActiveLine=highlightActiveLine;exports.highlightSpecialChars=highlightSpecialChars;exports.keymap=keymap;exports.logException=logException;exports.placeholder=placeholder;exports.runScopeHandlers=runScopeHandlers;exports.scrollPastEnd=scrollPastEnd;},{"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/text":24,"style-mod":30,"w3c-keyname":31}],6:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');/** 1553 + Comment or uncomment the current selection. Will use line comments 1554 + if available, otherwise falling back to block comments. 1555 + */var toggleComment=function toggleComment(target){var config=getConfig(target.state);return config.line?toggleLineComment(target):config.block?toggleBlockComment(target):false;};function command(f,option){return function(_ref48){var state=_ref48.state,dispatch=_ref48.dispatch;var tr=f(option,state.selection.ranges,state);if(!tr)return false;dispatch(state.update(tr));return true;};}/** 1556 + Comment or uncomment the current selection using line comments. 1557 + The line comment syntax is taken from the 1558 + [`commentTokens`](https://codemirror.net/6/docs/ref/#comment.CommentTokens) [language 1559 + data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt). 1560 + */var toggleLineComment=command(changeLineComment,0/* Toggle */);/** 1561 + Comment the current selection using line comments. 1562 + */var lineComment=command(changeLineComment,1/* Comment */);/** 1563 + Uncomment the current selection using line comments. 1564 + */var lineUncomment=command(changeLineComment,2/* Uncomment */);/** 1565 + Comment or uncomment the current selection using block comments. 1566 + The block comment syntax is taken from the 1567 + [`commentTokens`](https://codemirror.net/6/docs/ref/#comment.CommentTokens) [language 1568 + data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt). 1569 + */var toggleBlockComment=command(changeBlockComment,0/* Toggle */);/** 1570 + Comment the current selection using block comments. 1571 + */var blockComment=command(changeBlockComment,1/* Comment */);/** 1572 + Uncomment the current selection using block comments. 1573 + */var blockUncomment=command(changeBlockComment,2/* Uncomment */);/** 1574 + Default key bindings for this package. 1575 + 1576 + - Ctrl-/ (Cmd-/ on macOS): [`toggleComment`](https://codemirror.net/6/docs/ref/#comment.toggleComment). 1577 + - Shift-Alt-a: [`toggleBlockComment`](https://codemirror.net/6/docs/ref/#comment.toggleBlockComment). 1578 + */var commentKeymap=[{key:"Mod-/",run:toggleComment},{key:"Alt-A",run:toggleBlockComment}];function getConfig(state){var pos=arguments.length>1&&arguments[1]!==undefined?arguments[1]:state.selection.main.head;var data=state.languageDataAt("commentTokens",pos);return data.length?data[0]:{};}var SearchMargin=50;/** 1579 + Determines if the given range is block-commented in the given 1580 + state. 1581 + */function findBlockComment(state,_ref49,from,to){var open=_ref49.open,close=_ref49.close;var textBefore=state.sliceDoc(from-SearchMargin,from);var textAfter=state.sliceDoc(to,to+SearchMargin);var spaceBefore=/\s*$/.exec(textBefore)[0].length,spaceAfter=/^\s*/.exec(textAfter)[0].length;var beforeOff=textBefore.length-spaceBefore;if(textBefore.slice(beforeOff-open.length,beforeOff)==open&&textAfter.slice(spaceAfter,spaceAfter+close.length)==close){return{open:{pos:from-spaceBefore,margin:spaceBefore&&1},close:{pos:to+spaceAfter,margin:spaceAfter&&1}};}var startText,endText;if(to-from<=2*SearchMargin){startText=endText=state.sliceDoc(from,to);}else{startText=state.sliceDoc(from,from+SearchMargin);endText=state.sliceDoc(to-SearchMargin,to);}var startSpace=/^\s*/.exec(startText)[0].length,endSpace=/\s*$/.exec(endText)[0].length;var endOff=endText.length-endSpace-close.length;if(startText.slice(startSpace,startSpace+open.length)==open&&endText.slice(endOff,endOff+close.length)==close){return{open:{pos:from+startSpace+open.length,margin:/\s/.test(startText.charAt(startSpace+open.length))?1:0},close:{pos:to-endSpace-close.length,margin:/\s/.test(endText.charAt(endOff-1))?1:0}};}return null;}// Performs toggle, comment and uncomment of block comments in 1582 + // languages that support them. 1583 + function changeBlockComment(option,ranges,state$1){var tokens=ranges.map(function(r){return getConfig(state$1,r.from).block;});if(!tokens.every(function(c){return c;}))return null;var comments=ranges.map(function(r,i){return findBlockComment(state$1,tokens[i],r.from,r.to);});if(option!=2/* Uncomment */&&!comments.every(function(c){return c;})){var index=0;return state$1.changeByRange(function(range){var _tokens$index=tokens[index++],open=_tokens$index.open,close=_tokens$index.close;if(comments[index])return{range:range};var shift=open.length+1;return{changes:[{from:range.from,insert:open+" "},{from:range.to,insert:" "+close}],range:state.EditorSelection.range(range.anchor+shift,range.head+shift)};});}else if(option!=1/* Comment */&&comments.some(function(c){return c;})){var changes=[];for(var _i55=0,comment;_i55<comments.length;_i55++){if(comment=comments[_i55]){var token=tokens[_i55],_comment=comment,open=_comment.open,close=_comment.close;changes.push({from:open.pos-token.open.length,to:open.pos+open.margin},{from:close.pos-close.margin,to:close.pos+token.close.length});}}return{changes:changes};}return null;}// Performs toggle, comment and uncomment of line comments. 1584 + function changeLineComment(option,ranges,state){var lines=[];var prevLine=-1;var _iterator99=_createForOfIteratorHelper(ranges),_step99;try{for(_iterator99.s();!(_step99=_iterator99.n()).done;){var _step99$value=_step99.value,_from3=_step99$value.from,_to2=_step99$value.to;var startI=lines.length,minIndent=1e9;for(var pos=_from3;pos<=_to2;){var _line2=state.doc.lineAt(pos);if(_line2.from>prevLine&&(_from3==_to2||_to2>_line2.from)){prevLine=_line2.from;var _token2=getConfig(state,pos).line;if(!_token2)continue;var _indent=/^\s*/.exec(_line2.text)[0].length;var _empty=_indent==_line2.length;var _comment2=_line2.text.slice(_indent,_indent+_token2.length)==_token2?_indent:-1;if(_indent<_line2.text.length&&_indent<minIndent)minIndent=_indent;lines.push({line:_line2,comment:_comment2,token:_token2,indent:_indent,empty:_empty,single:false});}pos=_line2.to+1;}if(minIndent<1e9)for(var _i56=startI;_i56<lines.length;_i56++){if(lines[_i56].indent<lines[_i56].line.text.length)lines[_i56].indent=minIndent;}if(lines.length==startI+1)lines[startI].single=true;}}catch(err){_iterator99.e(err);}finally{_iterator99.f();}if(option!=2/* Uncomment */&&lines.some(function(l){return l.comment<0&&(!l.empty||l.single);})){var changes=[];var _iterator100=_createForOfIteratorHelper(lines),_step100;try{for(_iterator100.s();!(_step100=_iterator100.n()).done;){var _step100$value=_step100.value,line=_step100$value.line,token=_step100$value.token,indent=_step100$value.indent,empty=_step100$value.empty,single=_step100$value.single;if(single||!empty)changes.push({from:line.from+indent,insert:token+" "});}}catch(err){_iterator100.e(err);}finally{_iterator100.f();}var changeSet=state.changes(changes);return{changes:changeSet,selection:state.selection.map(changeSet,1)};}else if(option!=1/* Comment */&&lines.some(function(l){return l.comment>=0;})){var _changes=[];var _iterator101=_createForOfIteratorHelper(lines),_step101;try{for(_iterator101.s();!(_step101=_iterator101.n()).done;){var _step101$value=_step101.value,_line=_step101$value.line,comment=_step101$value.comment,_token=_step101$value.token;if(comment>=0){var from=_line.from+comment,to=from+_token.length;if(_line.text[to-_line.from]==" ")to++;_changes.push({from:from,to:to});}}}catch(err){_iterator101.e(err);}finally{_iterator101.f();}return{changes:_changes};}return null;}exports.blockComment=blockComment;exports.blockUncomment=blockUncomment;exports.commentKeymap=commentKeymap;exports.lineComment=lineComment;exports.lineUncomment=lineUncomment;exports.toggleBlockComment=toggleBlockComment;exports.toggleComment=toggleComment;exports.toggleLineComment=toggleLineComment;},{"@codemirror/state":22}],7:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');var view=require('@codemirror/view');var language=require('@codemirror/language');var gutter=require('@codemirror/gutter');var rangeset=require('@codemirror/rangeset');function mapRange(range,mapping){var from=mapping.mapPos(range.from,1),to=mapping.mapPos(range.to,-1);return from>=to?undefined:{from:from,to:to};}/** 1585 + State effect that can be attached to a transaction to fold the 1586 + given range. (You probably only need this in exceptional 1587 + circumstances—usually you'll just want to let 1588 + [`foldCode`](https://codemirror.net/6/docs/ref/#fold.foldCode) and the [fold 1589 + gutter](https://codemirror.net/6/docs/ref/#fold.foldGutter) create the transactions.) 1590 + */var foldEffect=state.StateEffect.define({map:mapRange});/** 1591 + State effect that unfolds the given range (if it was folded). 1592 + */var unfoldEffect=state.StateEffect.define({map:mapRange});function selectedLines(view){var lines=[];var _iterator102=_createForOfIteratorHelper(view.state.selection.ranges),_step102;try{var _loop11=function _loop11(){var head=_step102.value.head;if(lines.some(function(l){return l.from<=head&&l.to>=head;}))return"continue";lines.push(view.lineBlockAt(head));};for(_iterator102.s();!(_step102=_iterator102.n()).done;){var _ret3=_loop11();if(_ret3==="continue")continue;}}catch(err){_iterator102.e(err);}finally{_iterator102.f();}return lines;}var foldState=state.StateField.define({create:function create(){return view.Decoration.none;},update:function update(folded,tr){folded=folded.map(tr.changes);var _iterator103=_createForOfIteratorHelper(tr.effects),_step103;try{var _loop12=function _loop12(){var e=_step103.value;if(e.is(foldEffect)&&!foldExists(folded,e.value.from,e.value.to))folded=folded.update({add:[foldWidget.range(e.value.from,e.value.to)]});else if(e.is(unfoldEffect))folded=folded.update({filter:function filter(from,to){return e.value.from!=from||e.value.to!=to;},filterFrom:e.value.from,filterTo:e.value.to});};for(_iterator103.s();!(_step103=_iterator103.n()).done;){_loop12();}// Clear folded ranges that cover the selection head 1593 + }catch(err){_iterator103.e(err);}finally{_iterator103.f();}if(tr.selection){var onSelection=false,head=tr.selection.main.head;folded.between(head,head,function(a,b){if(a<head&&b>head)onSelection=true;});if(onSelection)folded=folded.update({filterFrom:head,filterTo:head,filter:function filter(a,b){return b<=head||a>=head;}});}return folded;},provide:function provide(f){return view.EditorView.decorations.from(f);}});/** 1594 + Get a [range set](https://codemirror.net/6/docs/ref/#rangeset.RangeSet) containing the folded ranges 1595 + in the given state. 1596 + */function foldedRanges(state){return state.field(foldState,false)||rangeset.RangeSet.empty;}function foldInside(state,from,to){var _a;var found=null;(_a=state.field(foldState,false))===null||_a===void 0?void 0:_a.between(from,to,function(from,to){if(!found||found.from>from)found={from:from,to:to};});return found;}function foldExists(folded,from,to){var found=false;folded.between(from,from,function(a,b){if(a==from&&b==to)found=true;});return found;}function maybeEnable(state$1,other){return state$1.field(foldState,false)?other:other.concat(state.StateEffect.appendConfig.of(codeFolding()));}/** 1597 + Fold the lines that are selected, if possible. 1598 + */var foldCode=function foldCode(view){var _iterator104=_createForOfIteratorHelper(selectedLines(view)),_step104;try{for(_iterator104.s();!(_step104=_iterator104.n()).done;){var line=_step104.value;var range=language.foldable(view.state,line.from,line.to);if(range){view.dispatch({effects:maybeEnable(view.state,[foldEffect.of(range),announceFold(view,range)])});return true;}}}catch(err){_iterator104.e(err);}finally{_iterator104.f();}return false;};/** 1599 + Unfold folded ranges on selected lines. 1600 + */var unfoldCode=function unfoldCode(view){if(!view.state.field(foldState,false))return false;var effects=[];var _iterator105=_createForOfIteratorHelper(selectedLines(view)),_step105;try{for(_iterator105.s();!(_step105=_iterator105.n()).done;){var line=_step105.value;var folded=foldInside(view.state,line.from,line.to);if(folded)effects.push(unfoldEffect.of(folded),announceFold(view,folded,false));}}catch(err){_iterator105.e(err);}finally{_iterator105.f();}if(effects.length)view.dispatch({effects:effects});return effects.length>0;};function announceFold(view$1,range){var fold=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var lineFrom=view$1.state.doc.lineAt(range.from).number,lineTo=view$1.state.doc.lineAt(range.to).number;return view.EditorView.announce.of("".concat(view$1.state.phrase(fold?"Folded lines":"Unfolded lines")," ").concat(lineFrom," ").concat(view$1.state.phrase("to")," ").concat(lineTo,"."));}/** 1601 + Fold all top-level foldable ranges. 1602 + */var foldAll=function foldAll(view){var state=view.state,effects=[];for(var pos=0;pos<state.doc.length;){var line=view.lineBlockAt(pos),range=language.foldable(state,line.from,line.to);if(range)effects.push(foldEffect.of(range));pos=(range?view.lineBlockAt(range.to):line).to+1;}if(effects.length)view.dispatch({effects:maybeEnable(view.state,effects)});return!!effects.length;};/** 1603 + Unfold all folded code. 1604 + */var unfoldAll=function unfoldAll(view){var field=view.state.field(foldState,false);if(!field||!field.size)return false;var effects=[];field.between(0,view.state.doc.length,function(from,to){effects.push(unfoldEffect.of({from:from,to:to}));});view.dispatch({effects:effects});return true;};/** 1605 + Default fold-related key bindings. 1606 + 1607 + - Ctrl-Shift-[ (Cmd-Alt-[ on macOS): [`foldCode`](https://codemirror.net/6/docs/ref/#fold.foldCode). 1608 + - Ctrl-Shift-] (Cmd-Alt-] on macOS): [`unfoldCode`](https://codemirror.net/6/docs/ref/#fold.unfoldCode). 1609 + - Ctrl-Alt-[: [`foldAll`](https://codemirror.net/6/docs/ref/#fold.foldAll). 1610 + - Ctrl-Alt-]: [`unfoldAll`](https://codemirror.net/6/docs/ref/#fold.unfoldAll). 1611 + */var foldKeymap=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:foldCode},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:unfoldCode},{key:"Ctrl-Alt-[",run:foldAll},{key:"Ctrl-Alt-]",run:unfoldAll}];var defaultConfig={placeholderDOM:null,placeholderText:"…"};var foldConfig=state.Facet.define({combine:function combine(values){return state.combineConfig(values,defaultConfig);}});/** 1612 + Create an extension that configures code folding. 1613 + */function codeFolding(config){var result=[foldState,baseTheme];if(config)result.push(foldConfig.of(config));return result;}var foldWidget=view.Decoration.replace({widget:new(/*#__PURE__*/function(_view$WidgetType2){_inherits(_class10,_view$WidgetType2);var _super27=_createSuper(_class10);function _class10(){_classCallCheck(this,_class10);return _super27.apply(this,arguments);}_createClass(_class10,[{key:"toDOM",value:function toDOM(view){var state=view.state,conf=state.facet(foldConfig);var onclick=function onclick(event){var line=view.lineBlockAt(view.posAtDOM(event.target));var folded=foldInside(view.state,line.from,line.to);if(folded)view.dispatch({effects:unfoldEffect.of(folded)});event.preventDefault();};if(conf.placeholderDOM)return conf.placeholderDOM(view,onclick);var element=document.createElement("span");element.textContent=conf.placeholderText;element.setAttribute("aria-label",state.phrase("folded code"));element.title=state.phrase("unfold");element.className="cm-foldPlaceholder";element.onclick=onclick;return element;}}]);return _class10;}(view.WidgetType))()});var foldGutterDefaults={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{}};var FoldMarker=/*#__PURE__*/function(_gutter$GutterMarker){_inherits(FoldMarker,_gutter$GutterMarker);var _super28=_createSuper(FoldMarker);function FoldMarker(config,open){var _this58;_classCallCheck(this,FoldMarker);_this58=_super28.call(this);_this58.config=config;_this58.open=open;return _this58;}_createClass(FoldMarker,[{key:"eq",value:function eq(other){return this.config==other.config&&this.open==other.open;}},{key:"toDOM",value:function toDOM(view){if(this.config.markerDOM)return this.config.markerDOM(this.open);var span=document.createElement("span");span.textContent=this.open?this.config.openText:this.config.closedText;span.title=view.state.phrase(this.open?"Fold line":"Unfold line");return span;}}]);return FoldMarker;}(gutter.GutterMarker);/** 1614 + Create an extension that registers a fold gutter, which shows a 1615 + fold status indicator before foldable lines (which can be clicked 1616 + to fold or unfold the line). 1617 + */function foldGutter(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var fullConfig=Object.assign(Object.assign({},foldGutterDefaults),config);var canFold=new FoldMarker(fullConfig,true),canUnfold=new FoldMarker(fullConfig,false);var _markers=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function _class11(view){_classCallCheck(this,_class11);this.from=view.viewport.from;this.markers=this.buildMarkers(view);}_createClass(_class11,[{key:"update",value:function update(_update13){if(_update13.docChanged||_update13.viewportChanged||_update13.startState.facet(language.language)!=_update13.state.facet(language.language)||_update13.startState.field(foldState,false)!=_update13.state.field(foldState,false))this.markers=this.buildMarkers(_update13.view);}},{key:"buildMarkers",value:function buildMarkers(view){var builder=new rangeset.RangeSetBuilder();var _iterator106=_createForOfIteratorHelper(view.viewportLineBlocks),_step106;try{for(_iterator106.s();!(_step106=_iterator106.n()).done;){var line=_step106.value;var mark=foldInside(view.state,line.from,line.to)?canUnfold:language.foldable(view.state,line.from,line.to)?canFold:null;if(mark)builder.add(line.from,line.from,mark);}}catch(err){_iterator106.e(err);}finally{_iterator106.f();}return builder.finish();}}]);return _class11;}());var domEventHandlers=fullConfig.domEventHandlers;return[_markers,gutter.gutter({"class":"cm-foldGutter",markers:function markers(view){var _a;return((_a=view.plugin(_markers))===null||_a===void 0?void 0:_a.markers)||rangeset.RangeSet.empty;},initialSpacer:function initialSpacer(){return new FoldMarker(fullConfig,false);},domEventHandlers:Object.assign(Object.assign({},domEventHandlers),{click:function click(view,line,event){if(domEventHandlers.click&&domEventHandlers.click(view,line,event))return true;var folded=foldInside(view.state,line.from,line.to);if(folded){view.dispatch({effects:unfoldEffect.of(folded)});return true;}var range=language.foldable(view.state,line.from,line.to);if(range){view.dispatch({effects:foldEffect.of(range)});return true;}return false;}})}),codeFolding()];}var baseTheme=view.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});exports.codeFolding=codeFolding;exports.foldAll=foldAll;exports.foldCode=foldCode;exports.foldEffect=foldEffect;exports.foldGutter=foldGutter;exports.foldKeymap=foldKeymap;exports.foldedRanges=foldedRanges;exports.unfoldAll=unfoldAll;exports.unfoldCode=unfoldCode;exports.unfoldEffect=unfoldEffect;},{"@codemirror/gutter":9,"@codemirror/language":13,"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/view":8}],8:[function(require,module,exports){arguments[4][5][0].apply(exports,arguments);},{"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/text":24,"dup":5,"style-mod":30,"w3c-keyname":31}],9:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var view=require('@codemirror/view');var rangeset=require('@codemirror/rangeset');var state=require('@codemirror/state');/** 1618 + A gutter marker represents a bit of information attached to a line 1619 + in a specific gutter. Your own custom markers have to extend this 1620 + class. 1621 + */var GutterMarker=/*#__PURE__*/function(_rangeset$RangeValue3){_inherits(GutterMarker,_rangeset$RangeValue3);var _super29=_createSuper(GutterMarker);function GutterMarker(){_classCallCheck(this,GutterMarker);return _super29.apply(this,arguments);}_createClass(GutterMarker,[{key:"compare",value:/** 1622 + @internal 1623 + */function compare(other){return this==other||this.constructor==other.constructor&&this.eq(other);}/** 1624 + Compare this marker to another marker of the same type. 1625 + */},{key:"eq",value:function eq(other){return false;}/** 1626 + Called if the marker has a `toDOM` method and its representation 1627 + was removed from a gutter. 1628 + */},{key:"destroy",value:function destroy(dom){}}]);return GutterMarker;}(rangeset.RangeValue);GutterMarker.prototype.elementClass="";GutterMarker.prototype.toDOM=undefined;GutterMarker.prototype.mapMode=state.MapMode.TrackBefore;GutterMarker.prototype.startSide=GutterMarker.prototype.endSide=-1;GutterMarker.prototype.point=true;/** 1629 + Facet used to add a class to all gutter elements for a given line. 1630 + Markers given to this facet should _only_ define an 1631 + [`elementclass`](https://codemirror.net/6/docs/ref/#gutter.GutterMarker.elementClass), not a 1632 + [`toDOM`](https://codemirror.net/6/docs/ref/#gutter.GutterMarker.toDOM) (or the marker will appear 1633 + in all gutters for the line). 1634 + */var gutterLineClass=state.Facet.define();var defaults={"class":"",renderEmptyElements:false,elementStyle:"",markers:function markers(){return rangeset.RangeSet.empty;},lineMarker:function lineMarker(){return null;},lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}};var activeGutters=state.Facet.define();/** 1635 + Define an editor gutter. The order in which the gutters appear is 1636 + determined by their extension priority. 1637 + */function gutter(config){return[gutters(),activeGutters.of(Object.assign(Object.assign({},defaults),config))];}var baseTheme=view.EditorView.baseTheme({".cm-gutters":{display:"flex",height:"100%",boxSizing:"border-box",left:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#999",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"}});var unfixGutters=state.Facet.define({combine:function combine(values){return values.some(function(x){return x;});}});/** 1638 + The gutter-drawing plugin is automatically enabled when you add a 1639 + gutter, but you can use this function to explicitly configure it. 1640 + 1641 + Unless `fixed` is explicitly set to `false`, the gutters are 1642 + fixed, meaning they don't scroll along with the content 1643 + horizontally (except on Internet Explorer, which doesn't support 1644 + CSS [`position: 1645 + sticky`](https://developer.mozilla.org/en-US/docs/Web/CSS/position#sticky)). 1646 + */function gutters(config){var result=[gutterView,baseTheme];if(config&&config.fixed===false)result.push(unfixGutters.of(true));return result;}var gutterView=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function _class12(view){_classCallCheck(this,_class12);this.view=view;this.prevViewport=view.viewport;this.dom=document.createElement("div");this.dom.className="cm-gutters";this.dom.setAttribute("aria-hidden","true");this.dom.style.minHeight=this.view.contentHeight+"px";this.gutters=view.state.facet(activeGutters).map(function(conf){return new SingleGutterView(view,conf);});var _iterator107=_createForOfIteratorHelper(this.gutters),_step107;try{for(_iterator107.s();!(_step107=_iterator107.n()).done;){var _gutter=_step107.value;this.dom.appendChild(_gutter.dom);}}catch(err){_iterator107.e(err);}finally{_iterator107.f();}this.fixed=!view.state.facet(unfixGutters);if(this.fixed){// FIXME IE11 fallback, which doesn't support position: sticky, 1647 + // by using position: relative + event handlers that realign the 1648 + // gutter (or just force fixed=false on IE11?) 1649 + this.dom.style.position="sticky";}this.syncGutters(false);view.scrollDOM.insertBefore(this.dom,view.contentDOM);}_createClass(_class12,[{key:"update",value:function update(_update14){if(this.updateGutters(_update14)){// Detach during sync when the viewport changed significantly 1650 + // (such as during scrolling), since for large updates that is 1651 + // faster. 1652 + var vpA=this.prevViewport,vpB=_update14.view.viewport;var vpOverlap=Math.min(vpA.to,vpB.to)-Math.max(vpA.from,vpB.from);this.syncGutters(vpOverlap<(vpB.to-vpB.from)*0.8);}if(_update14.geometryChanged)this.dom.style.minHeight=this.view.contentHeight+"px";if(this.view.state.facet(unfixGutters)!=!this.fixed){this.fixed=!this.fixed;this.dom.style.position=this.fixed?"sticky":"";}this.prevViewport=_update14.view.viewport;}},{key:"syncGutters",value:function syncGutters(detach){var _this59=this;var after=this.dom.nextSibling;if(detach)this.dom.remove();var lineClasses=rangeset.RangeSet.iter(this.view.state.facet(gutterLineClass),this.view.viewport.from);var classSet=[];var contexts=this.gutters.map(function(gutter){return new UpdateContext(gutter,_this59.view.viewport,-_this59.view.documentPadding.top);});var _iterator108=_createForOfIteratorHelper(this.view.viewportLineBlocks),_step108;try{for(_iterator108.s();!(_step108=_iterator108.n()).done;){var line=_step108.value;var text=void 0;if(Array.isArray(line.type)){var _iterator110=_createForOfIteratorHelper(line.type),_step110;try{for(_iterator110.s();!(_step110=_iterator110.n()).done;){var b=_step110.value;if(b.type==view.BlockType.Text){text=b;break;}}}catch(err){_iterator110.e(err);}finally{_iterator110.f();}}else{text=line.type==view.BlockType.Text?line:undefined;}if(!text)continue;if(classSet.length)classSet=[];advanceCursor(lineClasses,classSet,line.from);var _iterator111=_createForOfIteratorHelper(contexts),_step111;try{for(_iterator111.s();!(_step111=_iterator111.n()).done;){var cx=_step111.value;cx.line(this.view,text,classSet);}}catch(err){_iterator111.e(err);}finally{_iterator111.f();}}}catch(err){_iterator108.e(err);}finally{_iterator108.f();}var _iterator109=_createForOfIteratorHelper(contexts),_step109;try{for(_iterator109.s();!(_step109=_iterator109.n()).done;){var _cx=_step109.value;_cx.finish();}}catch(err){_iterator109.e(err);}finally{_iterator109.f();}if(detach)this.view.scrollDOM.insertBefore(this.dom,after);}},{key:"updateGutters",value:function updateGutters(update){var prev=update.startState.facet(activeGutters),cur=update.state.facet(activeGutters);var change=update.docChanged||update.heightChanged||update.viewportChanged||!rangeset.RangeSet.eq(update.startState.facet(gutterLineClass),update.state.facet(gutterLineClass),update.view.viewport.from,update.view.viewport.to);if(prev==cur){var _iterator112=_createForOfIteratorHelper(this.gutters),_step112;try{for(_iterator112.s();!(_step112=_iterator112.n()).done;){var _gutter2=_step112.value;if(_gutter2.update(update))change=true;}}catch(err){_iterator112.e(err);}finally{_iterator112.f();}}else{change=true;var _gutters=[];var _iterator113=_createForOfIteratorHelper(cur),_step113;try{for(_iterator113.s();!(_step113=_iterator113.n()).done;){var conf=_step113.value;var known=prev.indexOf(conf);if(known<0){_gutters.push(new SingleGutterView(this.view,conf));}else{this.gutters[known].update(update);_gutters.push(this.gutters[known]);}}}catch(err){_iterator113.e(err);}finally{_iterator113.f();}var _iterator114=_createForOfIteratorHelper(this.gutters),_step114;try{for(_iterator114.s();!(_step114=_iterator114.n()).done;){var _g=_step114.value;_g.dom.remove();if(_gutters.indexOf(_g)<0)_g.destroy();}}catch(err){_iterator114.e(err);}finally{_iterator114.f();}for(var _i57=0,_gutters2=_gutters;_i57<_gutters2.length;_i57++){var g=_gutters2[_i57];this.dom.appendChild(g.dom);}this.gutters=_gutters;}return change;}},{key:"destroy",value:function destroy(){var _iterator115=_createForOfIteratorHelper(this.gutters),_step115;try{for(_iterator115.s();!(_step115=_iterator115.n()).done;){var _view=_step115.value;_view.destroy();}}catch(err){_iterator115.e(err);}finally{_iterator115.f();}this.dom.remove();}}]);return _class12;}(),{provide:view.PluginField.scrollMargins.from(function(value){if(value.gutters.length==0||!value.fixed)return null;return value.view.textDirection==view.Direction.LTR?{left:value.dom.offsetWidth}:{right:value.dom.offsetWidth};})});function asArray(val){return Array.isArray(val)?val:[val];}function advanceCursor(cursor,collect,pos){while(cursor.value&&cursor.from<=pos){if(cursor.from==pos)collect.push(cursor.value);cursor.next();}}var UpdateContext=/*#__PURE__*/function(){function UpdateContext(gutter,viewport,height){_classCallCheck(this,UpdateContext);this.gutter=gutter;this.height=height;this.localMarkers=[];this.i=0;this.cursor=rangeset.RangeSet.iter(gutter.markers,viewport.from);}_createClass(UpdateContext,[{key:"line",value:function line(view,_line3,extraMarkers){if(this.localMarkers.length)this.localMarkers=[];advanceCursor(this.cursor,this.localMarkers,_line3.from);var localMarkers=extraMarkers.length?this.localMarkers.concat(extraMarkers):this.localMarkers;var forLine=this.gutter.config.lineMarker(view,_line3,localMarkers);if(forLine)localMarkers.unshift(forLine);var gutter=this.gutter;if(localMarkers.length==0&&!gutter.config.renderEmptyElements)return;var above=_line3.top-this.height;if(this.i==gutter.elements.length){var newElt=new GutterElement(view,_line3.height,above,localMarkers);gutter.elements.push(newElt);gutter.dom.appendChild(newElt.dom);}else{gutter.elements[this.i].update(view,_line3.height,above,localMarkers);}this.height=_line3.bottom;this.i++;}},{key:"finish",value:function finish(){var gutter=this.gutter;while(gutter.elements.length>this.i){var last=gutter.elements.pop();gutter.dom.removeChild(last.dom);last.destroy();}}}]);return UpdateContext;}();var SingleGutterView=/*#__PURE__*/function(){function SingleGutterView(view,config){var _this60=this;_classCallCheck(this,SingleGutterView);this.view=view;this.config=config;this.elements=[];this.spacer=null;this.dom=document.createElement("div");this.dom.className="cm-gutter"+(this.config["class"]?" "+this.config["class"]:"");var _loop13=function _loop13(prop){_this60.dom.addEventListener(prop,function(event){var line=view.lineBlockAtHeight(event.clientY-view.documentTop);if(config.domEventHandlers[prop](view,line,event))event.preventDefault();});};for(var prop in config.domEventHandlers){_loop13(prop);}this.markers=asArray(config.markers(view));if(config.initialSpacer){this.spacer=new GutterElement(view,0,0,[config.initialSpacer(view)]);this.dom.appendChild(this.spacer.dom);this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none";}}_createClass(SingleGutterView,[{key:"update",value:function update(_update15){var prevMarkers=this.markers;this.markers=asArray(this.config.markers(_update15.view));if(this.spacer&&this.config.updateSpacer){var updated=this.config.updateSpacer(this.spacer.markers[0],_update15);if(updated!=this.spacer.markers[0])this.spacer.update(_update15.view,0,0,[updated]);}var vp=_update15.view.viewport;return!rangeset.RangeSet.eq(this.markers,prevMarkers,vp.from,vp.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(_update15):false);}},{key:"destroy",value:function destroy(){var _iterator116=_createForOfIteratorHelper(this.elements),_step116;try{for(_iterator116.s();!(_step116=_iterator116.n()).done;){var elt=_step116.value;elt.destroy();}}catch(err){_iterator116.e(err);}finally{_iterator116.f();}}}]);return SingleGutterView;}();var GutterElement=/*#__PURE__*/function(){function GutterElement(view,height,above,markers){_classCallCheck(this,GutterElement);this.height=-1;this.above=0;this.markers=[];this.dom=document.createElement("div");this.update(view,height,above,markers);}_createClass(GutterElement,[{key:"update",value:function update(view,height,above,markers){if(this.height!=height)this.dom.style.height=(this.height=height)+"px";if(this.above!=above)this.dom.style.marginTop=(this.above=above)?above+"px":"";if(!sameMarkers(this.markers,markers))this.setMarkers(view,markers);}},{key:"setMarkers",value:function setMarkers(view,markers){var cls="cm-gutterElement",domPos=this.dom.firstChild;for(var iNew=0,iOld=0;;){var skipTo=iOld,marker=iNew<markers.length?markers[iNew++]:null,matched=false;if(marker){var c=marker.elementClass;if(c)cls+=" "+c;for(var _i58=iOld;_i58<this.markers.length;_i58++){if(this.markers[_i58].compare(marker)){skipTo=_i58;matched=true;break;}}}else{skipTo=this.markers.length;}while(iOld<skipTo){var next=this.markers[iOld++];if(next.toDOM){next.destroy(domPos);var after=domPos.nextSibling;domPos.remove();domPos=after;}}if(!marker)break;if(marker.toDOM){if(matched)domPos=domPos.nextSibling;else this.dom.insertBefore(marker.toDOM(view),domPos);}if(matched)iOld++;}this.dom.className=cls;this.markers=markers;}},{key:"destroy",value:function destroy(){this.setMarkers(null,[]);// First argument not used unless creating markers 1653 + }}]);return GutterElement;}();function sameMarkers(a,b){if(a.length!=b.length)return false;for(var _i59=0;_i59<a.length;_i59++){if(!a[_i59].compare(b[_i59]))return false;}return true;}/** 1654 + Facet used to provide markers to the line number gutter. 1655 + */var lineNumberMarkers=state.Facet.define();var lineNumberConfig=state.Facet.define({combine:function combine(values){return state.combineConfig(values,{formatNumber:String,domEventHandlers:{}},{domEventHandlers:function domEventHandlers(a,b){var result=Object.assign({},a);var _loop14=function _loop14(event){var exists=result[event],add=b[event];result[event]=exists?function(view,line,event){return exists(view,line,event)||add(view,line,event);}:add;};for(var event in b){_loop14(event);}return result;}});}});var NumberMarker=/*#__PURE__*/function(_GutterMarker){_inherits(NumberMarker,_GutterMarker);var _super30=_createSuper(NumberMarker);function NumberMarker(number){var _this61;_classCallCheck(this,NumberMarker);_this61=_super30.call(this);_this61.number=number;return _this61;}_createClass(NumberMarker,[{key:"eq",value:function eq(other){return this.number==other.number;}},{key:"toDOM",value:function toDOM(){return document.createTextNode(this.number);}}]);return NumberMarker;}(GutterMarker);function formatNumber(view,number){return view.state.facet(lineNumberConfig).formatNumber(number,view.state);}var lineNumberGutter=activeGutters.compute([lineNumberConfig],function(state){return{"class":"cm-lineNumbers",renderEmptyElements:false,markers:function markers(view){return view.state.facet(lineNumberMarkers);},lineMarker:function lineMarker(view,line,others){if(others.some(function(m){return m.toDOM;}))return null;return new NumberMarker(formatNumber(view,view.state.doc.lineAt(line.from).number));},lineMarkerChange:function lineMarkerChange(update){return update.startState.facet(lineNumberConfig)!=update.state.facet(lineNumberConfig);},initialSpacer:function initialSpacer(view){return new NumberMarker(formatNumber(view,maxLineNumber(view.state.doc.lines)));},updateSpacer:function updateSpacer(spacer,update){var max=formatNumber(update.view,maxLineNumber(update.view.state.doc.lines));return max==spacer.number?spacer:new NumberMarker(max);},domEventHandlers:state.facet(lineNumberConfig).domEventHandlers};});/** 1656 + Create a line number gutter extension. 1657 + */function lineNumbers(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[lineNumberConfig.of(config),gutters(),lineNumberGutter];}function maxLineNumber(lines){var last=9;while(last<lines){last=last*10+9;}return last;}var activeLineGutterMarker=new(/*#__PURE__*/function(_GutterMarker2){_inherits(_class13,_GutterMarker2);var _super31=_createSuper(_class13);function _class13(){var _this62;_classCallCheck(this,_class13);_this62=_super31.apply(this,arguments);_this62.elementClass="cm-activeLineGutter";return _this62;}return _createClass(_class13);}(GutterMarker))();var activeLineGutterHighlighter=gutterLineClass.compute(["selection"],function(state){var marks=[],last=-1;var _iterator117=_createForOfIteratorHelper(state.selection.ranges),_step117;try{for(_iterator117.s();!(_step117=_iterator117.n()).done;){var range=_step117.value;if(range.empty){var linePos=state.doc.lineAt(range.head).from;if(linePos>last){last=linePos;marks.push(activeLineGutterMarker.range(linePos));}}}}catch(err){_iterator117.e(err);}finally{_iterator117.f();}return rangeset.RangeSet.of(marks);});/** 1658 + Returns an extension that adds a `cm-activeLineGutter` class to 1659 + all gutter elements on the [active 1660 + line](https://codemirror.net/6/docs/ref/#view.highlightActiveLine). 1661 + */function highlightActiveLineGutter(){return activeLineGutterHighlighter;}exports.GutterMarker=GutterMarker;exports.gutter=gutter;exports.gutterLineClass=gutterLineClass;exports.gutters=gutters;exports.highlightActiveLineGutter=highlightActiveLineGutter;exports.lineNumberMarkers=lineNumberMarkers;exports.lineNumbers=lineNumbers;},{"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/view":10}],10:[function(require,module,exports){arguments[4][5][0].apply(exports,arguments);},{"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/text":24,"dup":5,"style-mod":30,"w3c-keyname":31}],11:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var common=require('@lezer/common');var styleMod=require('style-mod');var view=require('@codemirror/view');var state=require('@codemirror/state');var language=require('@codemirror/language');var rangeset=require('@codemirror/rangeset');var nextTagID=0;/** 1662 + Highlighting tags are markers that denote a highlighting category. 1663 + They are [associated](https://codemirror.net/6/docs/ref/#highlight.styleTags) with parts of a syntax 1664 + tree by a language mode, and then mapped to an actual CSS style by 1665 + a [highlight style](https://codemirror.net/6/docs/ref/#highlight.HighlightStyle). 1666 + 1667 + Because syntax tree node types and highlight styles have to be 1668 + able to talk the same language, CodeMirror uses a mostly _closed_ 1669 + [vocabulary](https://codemirror.net/6/docs/ref/#highlight.tags) of syntax tags (as opposed to 1670 + traditional open string-based systems, which make it hard for 1671 + highlighting themes to cover all the tokens produced by the 1672 + various languages). 1673 + 1674 + It _is_ possible to [define](https://codemirror.net/6/docs/ref/#highlight.Tag^define) your own 1675 + highlighting tags for system-internal use (where you control both 1676 + the language package and the highlighter), but such tags will not 1677 + be picked up by regular highlighters (though you can derive them 1678 + from standard tags to allow highlighters to fall back to those). 1679 + */var Tag=/*#__PURE__*/function(){/** 1680 + @internal 1681 + */function Tag(/** 1682 + The set of tags that match this tag, starting with this one 1683 + itself, sorted in order of decreasing specificity. @internal 1684 + */set,/** 1685 + The base unmodified tag that this one is based on, if it's 1686 + modified @internal 1687 + */base,/** 1688 + The modifiers applied to this.base @internal 1689 + */modified){_classCallCheck(this,Tag);this.set=set;this.base=base;this.modified=modified;/** 1690 + @internal 1691 + */this.id=nextTagID++;}/** 1692 + Define a new tag. If `parent` is given, the tag is treated as a 1693 + sub-tag of that parent, and [highlight 1694 + styles](https://codemirror.net/6/docs/ref/#highlight.HighlightStyle) that don't mention this tag 1695 + will try to fall back to the parent tag (or grandparent tag, 1696 + etc). 1697 + */_createClass(Tag,null,[{key:"define",value:function define(parent){if(parent===null||parent===void 0?void 0:parent.base)throw new Error("Can not derive from a modified tag");var tag=new Tag([],null,[]);tag.set.push(tag);if(parent){var _iterator118=_createForOfIteratorHelper(parent.set),_step118;try{for(_iterator118.s();!(_step118=_iterator118.n()).done;){var _t2=_step118.value;tag.set.push(_t2);}}catch(err){_iterator118.e(err);}finally{_iterator118.f();}}return tag;}/** 1698 + Define a tag _modifier_, which is a function that, given a tag, 1699 + will return a tag that is a subtag of the original. Applying the 1700 + same modifier to a twice tag will return the same value (`m1(t1) 1701 + == m1(t1)`) and applying multiple modifiers will, regardless or 1702 + order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`). 1703 + 1704 + When multiple modifiers are applied to a given base tag, each 1705 + smaller set of modifiers is registered as a parent, so that for 1706 + example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`, 1707 + `m1(m3(t1)`, and so on. 1708 + */},{key:"defineModifier",value:function defineModifier(){var mod=new Modifier();return function(tag){if(tag.modified.indexOf(mod)>-1)return tag;return Modifier.get(tag.base||tag,tag.modified.concat(mod).sort(function(a,b){return a.id-b.id;}));};}}]);return Tag;}();var nextModifierID=0;var Modifier=/*#__PURE__*/function(){function Modifier(){_classCallCheck(this,Modifier);this.instances=[];this.id=nextModifierID++;}_createClass(Modifier,null,[{key:"get",value:function get(base,mods){if(!mods.length)return base;var exists=mods[0].instances.find(function(t){return t.base==base&&sameArray(mods,t.modified);});if(exists)return exists;var set=[],tag=new Tag(set,base,mods);var _iterator119=_createForOfIteratorHelper(mods),_step119;try{for(_iterator119.s();!(_step119=_iterator119.n()).done;){var m=_step119.value;m.instances.push(tag);}}catch(err){_iterator119.e(err);}finally{_iterator119.f();}var configs=permute(mods);var _iterator120=_createForOfIteratorHelper(base.set),_step120;try{for(_iterator120.s();!(_step120=_iterator120.n()).done;){var parent=_step120.value;var _iterator121=_createForOfIteratorHelper(configs),_step121;try{for(_iterator121.s();!(_step121=_iterator121.n()).done;){var config=_step121.value;set.push(Modifier.get(parent,config));}}catch(err){_iterator121.e(err);}finally{_iterator121.f();}}}catch(err){_iterator120.e(err);}finally{_iterator120.f();}return tag;}}]);return Modifier;}();function sameArray(a,b){return a.length==b.length&&a.every(function(x,i){return x==b[i];});}function permute(array){var result=[array];for(var _i60=0;_i60<array.length;_i60++){var _iterator122=_createForOfIteratorHelper(permute(array.slice(0,_i60).concat(array.slice(_i60+1)))),_step122;try{for(_iterator122.s();!(_step122=_iterator122.n()).done;){var a=_step122.value;result.push(a);}}catch(err){_iterator122.e(err);}finally{_iterator122.f();}}return result;}/** 1709 + This function is used to add a set of tags to a language syntax 1710 + via 1711 + [`LRParser.configure`](https://lezer.codemirror.net/docs/ref#lr.LRParser.configure). 1712 + 1713 + The argument object maps node selectors to [highlighting 1714 + tags](https://codemirror.net/6/docs/ref/#highlight.Tag) or arrays of tags. 1715 + 1716 + Node selectors may hold one or more (space-separated) node paths. 1717 + Such a path can be a [node 1718 + name](https://lezer.codemirror.net/docs/ref#common.NodeType.name), 1719 + or multiple node names (or `*` wildcards) separated by slash 1720 + characters, as in `"Block/Declaration/VariableName"`. Such a path 1721 + matches the final node but only if its direct parent nodes are the 1722 + other nodes mentioned. A `*` in such a path matches any parent, 1723 + but only a single level—wildcards that match multiple parents 1724 + aren't supported, both for efficiency reasons and because Lezer 1725 + trees make it rather hard to reason about what they would match.) 1726 + 1727 + A path can be ended with `/...` to indicate that the tag assigned 1728 + to the node should also apply to all child nodes, even if they 1729 + match their own style (by default, only the innermost style is 1730 + used). 1731 + 1732 + When a path ends in `!`, as in `Attribute!`, no further matching 1733 + happens for the node's child nodes, and the entire node gets the 1734 + given style. 1735 + 1736 + In this notation, node names that contain `/`, `!`, `*`, or `...` 1737 + must be quoted as JSON strings. 1738 + 1739 + For example: 1740 + 1741 + ```javascript 1742 + parser.withProps( 1743 + styleTags({ 1744 + // Style Number and BigNumber nodes 1745 + "Number BigNumber": tags.number, 1746 + // Style Escape nodes whose parent is String 1747 + "String/Escape": tags.escape, 1748 + // Style anything inside Attributes nodes 1749 + "Attributes!": tags.meta, 1750 + // Add a style to all content inside Italic nodes 1751 + "Italic/...": tags.emphasis, 1752 + // Style InvalidString nodes as both `string` and `invalid` 1753 + "InvalidString": [tags.string, tags.invalid], 1754 + // Style the node named "/" as punctuation 1755 + '"/"': tags.punctuation 1756 + }) 1757 + ) 1758 + ``` 1759 + */function styleTags(spec){var byName=Object.create(null);for(var prop in spec){var _tags=spec[prop];if(!Array.isArray(_tags))_tags=[_tags];var _iterator123=_createForOfIteratorHelper(prop.split(" ")),_step123;try{for(_iterator123.s();!(_step123=_iterator123.n()).done;){var part=_step123.value;if(part){var pieces=[],mode=2/* Normal */,rest=part;for(var pos=0;;){if(rest=="..."&&pos>0&&pos+3==part.length){mode=1/* Inherit */;break;}var m=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(rest);if(!m)throw new RangeError("Invalid path: "+part);pieces.push(m[0]=="*"?null:m[0][0]=='"'?JSON.parse(m[0]):m[0]);pos+=m[0].length;if(pos==part.length)break;var next=part[pos++];if(pos==part.length&&next=="!"){mode=0/* Opaque */;break;}if(next!="/")throw new RangeError("Invalid path: "+part);rest=part.slice(pos);}var last=pieces.length-1,inner=pieces[last];if(!inner)throw new RangeError("Invalid path: "+part);var rule=new Rule(_tags,mode,last>0?pieces.slice(0,last):null);byName[inner]=rule.sort(byName[inner]);}}}catch(err){_iterator123.e(err);}finally{_iterator123.f();}}return ruleNodeProp.add(byName);}var ruleNodeProp=new common.NodeProp();var highlightStyle=state.Facet.define({combine:function combine(stylings){return stylings.length?HighlightStyle.combinedMatch(stylings):null;}});var fallbackHighlightStyle=state.Facet.define({combine:function combine(values){return values.length?values[0].match:null;}});function getHighlightStyle(state){return state.facet(highlightStyle)||state.facet(fallbackHighlightStyle);}var Rule=/*#__PURE__*/function(){function Rule(tags,mode,context,next){_classCallCheck(this,Rule);this.tags=tags;this.mode=mode;this.context=context;this.next=next;}_createClass(Rule,[{key:"sort",value:function sort(other){if(!other||other.depth<this.depth){this.next=other;return this;}other.next=this.sort(other.next);return other;}},{key:"depth",get:function get(){return this.context?this.context.length:0;}}]);return Rule;}();/** 1760 + A highlight style associates CSS styles with higlighting 1761 + [tags](https://codemirror.net/6/docs/ref/#highlight.Tag). 1762 + */var HighlightStyle=/*#__PURE__*/function(){function HighlightStyle(spec,options){_classCallCheck(this,HighlightStyle);this.map=Object.create(null);var modSpec;function def(spec){var cls=styleMod.StyleModule.newName();(modSpec||(modSpec=Object.create(null)))["."+cls]=spec;return cls;}this.all=typeof options.all=="string"?options.all:options.all?def(options.all):null;var _iterator124=_createForOfIteratorHelper(spec),_step124;try{for(_iterator124.s();!(_step124=_iterator124.n()).done;){var style=_step124.value;var cls=(style["class"]||def(Object.assign({},style,{tag:null})))+(this.all?" "+this.all:"");var _tags2=style.tag;if(!Array.isArray(_tags2))this.map[_tags2.id]=cls;else{var _iterator125=_createForOfIteratorHelper(_tags2),_step125;try{for(_iterator125.s();!(_step125=_iterator125.n()).done;){var tag=_step125.value;this.map[tag.id]=cls;}}catch(err){_iterator125.e(err);}finally{_iterator125.f();}}}}catch(err){_iterator124.e(err);}finally{_iterator124.f();}this.module=modSpec?new styleMod.StyleModule(modSpec):null;this.scope=options.scope||null;this.match=this.match.bind(this);var ext=[treeHighlighter];if(this.module)ext.push(view.EditorView.styleModule.of(this.module));this.extension=ext.concat(highlightStyle.of(this));this.fallback=ext.concat(fallbackHighlightStyle.of(this));}/** 1763 + Returns the CSS class associated with the given tag, if any. 1764 + This method is bound to the instance by the constructor. 1765 + */_createClass(HighlightStyle,[{key:"match",value:function match(tag,scope){if(this.scope&&scope!=this.scope)return null;var _iterator126=_createForOfIteratorHelper(tag.set),_step126;try{for(_iterator126.s();!(_step126=_iterator126.n()).done;){var _t3=_step126.value;var match=this.map[_t3.id];if(match!==undefined){if(_t3!=tag)this.map[tag.id]=match;return match;}}}catch(err){_iterator126.e(err);}finally{_iterator126.f();}return this.map[tag.id]=this.all;}/** 1766 + Combines an array of highlight styles into a single match 1767 + function that returns all of the classes assigned by the styles 1768 + for a given tag. 1769 + */}],[{key:"combinedMatch",value:function combinedMatch(styles){if(styles.length==1)return styles[0].match;var cache=styles.some(function(s){return s.scope;})?undefined:Object.create(null);return function(tag,scope){var cached=cache&&cache[tag.id];if(cached!==undefined)return cached;var result=null;var _iterator127=_createForOfIteratorHelper(styles),_step127;try{for(_iterator127.s();!(_step127=_iterator127.n()).done;){var style=_step127.value;var value=style.match(tag,scope);if(value)result=result?result+" "+value:value;}}catch(err){_iterator127.e(err);}finally{_iterator127.f();}if(cache)cache[tag.id]=result;return result;};}/** 1770 + Create a highlighter style that associates the given styles to 1771 + the given tags. The spec must be objects that hold a style tag 1772 + or array of tags in their `tag` property, and either a single 1773 + `class` property providing a static CSS class (for highlighters 1774 + like [`classHighlightStyle`](https://codemirror.net/6/docs/ref/#highlight.classHighlightStyle) 1775 + that rely on external styling), or a 1776 + [`style-mod`](https://github.com/marijnh/style-mod#documentation)-style 1777 + set of CSS properties (which define the styling for those tags). 1778 + 1779 + The CSS rules created for a highlighter will be emitted in the 1780 + order of the spec's properties. That means that for elements that 1781 + have multiple tags associated with them, styles defined further 1782 + down in the list will have a higher CSS precedence than styles 1783 + defined earlier. 1784 + */},{key:"define",value:function define(specs,options){return new HighlightStyle(specs,options||{});}/** 1785 + Returns the CSS classes (if any) that the highlight styles 1786 + active in the given state would assign to the given a style 1787 + [tag](https://codemirror.net/6/docs/ref/#highlight.Tag) and (optional) language 1788 + [scope](https://codemirror.net/6/docs/ref/#highlight.HighlightStyle^define^options.scope). 1789 + */},{key:"get",value:function get(state,tag,scope){var style=getHighlightStyle(state);return style&&style(tag,scope||common.NodeType.none);}}]);return HighlightStyle;}();/** 1790 + Run the tree highlighter over the given tree. 1791 + */function highlightTree(tree,/** 1792 + Get the CSS classes used to style a given [tag](https://codemirror.net/6/docs/ref/#highlight.Tag), 1793 + or `null` if it isn't styled. (You'll often want to pass a 1794 + highlight style's [`match`](https://codemirror.net/6/docs/ref/#highlight.HighlightStyle.match) 1795 + method here.) 1796 + */getStyle,/** 1797 + Assign styling to a region of the text. Will be called, in order 1798 + of position, for any ranges where more than zero classes apply. 1799 + `classes` is a space separated string of CSS classes. 1800 + */putStyle){var from=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var to=arguments.length>4&&arguments[4]!==undefined?arguments[4]:tree.length;highlightTreeRange(tree,from,to,getStyle,putStyle);}var TreeHighlighter=/*#__PURE__*/function(){function TreeHighlighter(view){_classCallCheck(this,TreeHighlighter);this.markCache=Object.create(null);this.tree=language.syntaxTree(view.state);this.decorations=this.buildDeco(view,getHighlightStyle(view.state));}_createClass(TreeHighlighter,[{key:"update",value:function update(_update16){var tree=language.syntaxTree(_update16.state),style=getHighlightStyle(_update16.state);var styleChange=style!=_update16.startState.facet(highlightStyle);if(tree.length<_update16.view.viewport.to&&!styleChange&&tree.type==this.tree.type){this.decorations=this.decorations.map(_update16.changes);}else if(tree!=this.tree||_update16.viewportChanged||styleChange){this.tree=tree;this.decorations=this.buildDeco(_update16.view,style);}}},{key:"buildDeco",value:function buildDeco(view$1,match){var _this63=this;if(!match||!this.tree.length)return view.Decoration.none;var builder=new rangeset.RangeSetBuilder();var _iterator128=_createForOfIteratorHelper(view$1.visibleRanges),_step128;try{for(_iterator128.s();!(_step128=_iterator128.n()).done;){var _step128$value=_step128.value,from=_step128$value.from,to=_step128$value.to;highlightTreeRange(this.tree,from,to,match,function(from,to,style){builder.add(from,to,_this63.markCache[style]||(_this63.markCache[style]=view.Decoration.mark({"class":style})));});}}catch(err){_iterator128.e(err);}finally{_iterator128.f();}return builder.finish();}}]);return TreeHighlighter;}();// This extension installs a highlighter that highlights based on the 1801 + // syntax tree and highlight style. 1802 + var treeHighlighter=state.Prec.high(view.ViewPlugin.fromClass(TreeHighlighter,{decorations:function decorations(v){return v.decorations;}}));var nodeStack=[""];var HighlightBuilder=/*#__PURE__*/function(){function HighlightBuilder(at,style,span){_classCallCheck(this,HighlightBuilder);this.at=at;this.style=style;this.span=span;this["class"]="";}_createClass(HighlightBuilder,[{key:"startSpan",value:function startSpan(at,cls){if(cls!=this["class"]){this.flush(at);if(at>this.at)this.at=at;this["class"]=cls;}}},{key:"flush",value:function flush(to){if(to>this.at&&this["class"])this.span(this.at,to,this["class"]);}},{key:"highlightRange",value:function highlightRange(cursor,from,to,inheritedClass,depth,scope){var type=cursor.type,start=cursor.from,end=cursor.to;if(start>=to||end<=from)return;nodeStack[depth]=type.name;if(type.isTop)scope=type;var cls=inheritedClass;var rule=type.prop(ruleNodeProp),opaque=false;while(rule){if(!rule.context||matchContext(rule.context,nodeStack,depth)){var _iterator129=_createForOfIteratorHelper(rule.tags),_step129;try{for(_iterator129.s();!(_step129=_iterator129.n()).done;){var tag=_step129.value;var st=this.style(tag,scope);if(st){if(cls)cls+=" ";cls+=st;if(rule.mode==1/* Inherit */)inheritedClass+=(inheritedClass?" ":"")+st;else if(rule.mode==0/* Opaque */)opaque=true;}}}catch(err){_iterator129.e(err);}finally{_iterator129.f();}break;}rule=rule.next;}this.startSpan(cursor.from,cls);if(opaque)return;var mounted=cursor.tree&&cursor.tree.prop(common.NodeProp.mounted);if(mounted&&mounted.overlay){var inner=cursor.node.enter(mounted.overlay[0].from+start,1);var hasChild=cursor.firstChild();for(var _i61=0,pos=start;;_i61++){var next=_i61<mounted.overlay.length?mounted.overlay[_i61]:null;var nextPos=next?next.from+start:end;var rangeFrom=Math.max(from,pos),rangeTo=Math.min(to,nextPos);if(rangeFrom<rangeTo&&hasChild){while(cursor.from<rangeTo){this.highlightRange(cursor,rangeFrom,rangeTo,inheritedClass,depth+1,scope);this.startSpan(Math.min(to,cursor.to),cls);if(cursor.to>=nextPos||!cursor.nextSibling())break;}}if(!next||nextPos>to)break;pos=next.to+start;if(pos>from){this.highlightRange(inner.cursor,Math.max(from,next.from+start),Math.min(to,pos),inheritedClass,depth,mounted.tree.type);this.startSpan(pos,cls);}}if(hasChild)cursor.parent();}else if(cursor.firstChild()){do{if(cursor.to<=from)continue;if(cursor.from>=to)break;this.highlightRange(cursor,from,to,inheritedClass,depth+1,scope);this.startSpan(Math.min(to,cursor.to),cls);}while(cursor.nextSibling());cursor.parent();}}}]);return HighlightBuilder;}();function highlightTreeRange(tree,from,to,style,span){var builder=new HighlightBuilder(from,style,span);builder.highlightRange(tree.cursor(),from,to,"",0,tree.type);builder.flush(to);}function matchContext(context,stack,depth){if(context.length>depth-1)return false;for(var d=depth-1,_i62=context.length-1;_i62>=0;_i62--,d--){var check=context[_i62];if(check&&check!=stack[d])return false;}return true;}var t=Tag.define;var comment=t(),name=t(),typeName=t(name),propertyName=t(name),literal=t(),string=t(literal),number=t(literal),content=t(),heading=t(content),keyword=t(),operator=t(),punctuation=t(),bracket=t(punctuation),meta=t();/** 1803 + The default set of highlighting [tags](https://codemirror.net/6/docs/ref/#highlight.Tag^define) used 1804 + by regular language packages and themes. 1805 + 1806 + This collection is heavily biased towards programming languages, 1807 + and necessarily incomplete. A full ontology of syntactic 1808 + constructs would fill a stack of books, and be impractical to 1809 + write themes for. So try to make do with this set. If all else 1810 + fails, [open an 1811 + issue](https://github.com/codemirror/codemirror.next) to propose a 1812 + new tag, or [define](https://codemirror.net/6/docs/ref/#highlight.Tag^define) a local custom tag for 1813 + your use case. 1814 + 1815 + Note that it is not obligatory to always attach the most specific 1816 + tag possible to an element—if your grammar can't easily 1817 + distinguish a certain type of element (such as a local variable), 1818 + it is okay to style it as its more general variant (a variable). 1819 + 1820 + For tags that extend some parent tag, the documentation links to 1821 + the parent. 1822 + */var tags={/** 1823 + A comment. 1824 + */comment:comment,/** 1825 + A line [comment](https://codemirror.net/6/docs/ref/#highlight.tags.comment). 1826 + */lineComment:t(comment),/** 1827 + A block [comment](https://codemirror.net/6/docs/ref/#highlight.tags.comment). 1828 + */blockComment:t(comment),/** 1829 + A documentation [comment](https://codemirror.net/6/docs/ref/#highlight.tags.comment). 1830 + */docComment:t(comment),/** 1831 + Any kind of identifier. 1832 + */name:name,/** 1833 + The [name](https://codemirror.net/6/docs/ref/#highlight.tags.name) of a variable. 1834 + */variableName:t(name),/** 1835 + A type [name](https://codemirror.net/6/docs/ref/#highlight.tags.name). 1836 + */typeName:typeName,/** 1837 + A tag name (subtag of [`typeName`](https://codemirror.net/6/docs/ref/#highlight.tags.typeName)). 1838 + */tagName:t(typeName),/** 1839 + A property or field [name](https://codemirror.net/6/docs/ref/#highlight.tags.name). 1840 + */propertyName:propertyName,/** 1841 + An attribute name (subtag of [`propertyName`](https://codemirror.net/6/docs/ref/#highlight.tags.propertyName)). 1842 + */attributeName:t(propertyName),/** 1843 + The [name](https://codemirror.net/6/docs/ref/#highlight.tags.name) of a class. 1844 + */className:t(name),/** 1845 + A label [name](https://codemirror.net/6/docs/ref/#highlight.tags.name). 1846 + */labelName:t(name),/** 1847 + A namespace [name](https://codemirror.net/6/docs/ref/#highlight.tags.name). 1848 + */namespace:t(name),/** 1849 + The [name](https://codemirror.net/6/docs/ref/#highlight.tags.name) of a macro. 1850 + */macroName:t(name),/** 1851 + A literal value. 1852 + */literal:literal,/** 1853 + A string [literal](https://codemirror.net/6/docs/ref/#highlight.tags.literal). 1854 + */string:string,/** 1855 + A documentation [string](https://codemirror.net/6/docs/ref/#highlight.tags.string). 1856 + */docString:t(string),/** 1857 + A character literal (subtag of [string](https://codemirror.net/6/docs/ref/#highlight.tags.string)). 1858 + */character:t(string),/** 1859 + An attribute value (subtag of [string](https://codemirror.net/6/docs/ref/#highlight.tags.string)). 1860 + */attributeValue:t(string),/** 1861 + A number [literal](https://codemirror.net/6/docs/ref/#highlight.tags.literal). 1862 + */number:number,/** 1863 + An integer [number](https://codemirror.net/6/docs/ref/#highlight.tags.number) literal. 1864 + */integer:t(number),/** 1865 + A floating-point [number](https://codemirror.net/6/docs/ref/#highlight.tags.number) literal. 1866 + */"float":t(number),/** 1867 + A boolean [literal](https://codemirror.net/6/docs/ref/#highlight.tags.literal). 1868 + */bool:t(literal),/** 1869 + Regular expression [literal](https://codemirror.net/6/docs/ref/#highlight.tags.literal). 1870 + */regexp:t(literal),/** 1871 + An escape [literal](https://codemirror.net/6/docs/ref/#highlight.tags.literal), for example a 1872 + backslash escape in a string. 1873 + */escape:t(literal),/** 1874 + A color [literal](https://codemirror.net/6/docs/ref/#highlight.tags.literal). 1875 + */color:t(literal),/** 1876 + A URL [literal](https://codemirror.net/6/docs/ref/#highlight.tags.literal). 1877 + */url:t(literal),/** 1878 + A language keyword. 1879 + */keyword:keyword,/** 1880 + The [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) for the self or this 1881 + object. 1882 + */self:t(keyword),/** 1883 + The [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) for null. 1884 + */"null":t(keyword),/** 1885 + A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) denoting some atomic value. 1886 + */atom:t(keyword),/** 1887 + A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that represents a unit. 1888 + */unit:t(keyword),/** 1889 + A modifier [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword). 1890 + */modifier:t(keyword),/** 1891 + A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that acts as an operator. 1892 + */operatorKeyword:t(keyword),/** 1893 + A control-flow related [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword). 1894 + */controlKeyword:t(keyword),/** 1895 + A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) that defines something. 1896 + */definitionKeyword:t(keyword),/** 1897 + A [keyword](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) related to defining or 1898 + interfacing with modules. 1899 + */moduleKeyword:t(keyword),/** 1900 + An operator. 1901 + */operator:operator,/** 1902 + An [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that defines something. 1903 + */derefOperator:t(operator),/** 1904 + Arithmetic-related [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator). 1905 + */arithmeticOperator:t(operator),/** 1906 + Logical [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator). 1907 + */logicOperator:t(operator),/** 1908 + Bit [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator). 1909 + */bitwiseOperator:t(operator),/** 1910 + Comparison [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator). 1911 + */compareOperator:t(operator),/** 1912 + [Operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that updates its operand. 1913 + */updateOperator:t(operator),/** 1914 + [Operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator) that defines something. 1915 + */definitionOperator:t(operator),/** 1916 + Type-related [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator). 1917 + */typeOperator:t(operator),/** 1918 + Control-flow [operator](https://codemirror.net/6/docs/ref/#highlight.tags.operator). 1919 + */controlOperator:t(operator),/** 1920 + Program or markup punctuation. 1921 + */punctuation:punctuation,/** 1922 + [Punctuation](https://codemirror.net/6/docs/ref/#highlight.tags.punctuation) that separates 1923 + things. 1924 + */separator:t(punctuation),/** 1925 + Bracket-style [punctuation](https://codemirror.net/6/docs/ref/#highlight.tags.punctuation). 1926 + */bracket:bracket,/** 1927 + Angle [brackets](https://codemirror.net/6/docs/ref/#highlight.tags.bracket) (usually `<` and `>` 1928 + tokens). 1929 + */angleBracket:t(bracket),/** 1930 + Square [brackets](https://codemirror.net/6/docs/ref/#highlight.tags.bracket) (usually `[` and `]` 1931 + tokens). 1932 + */squareBracket:t(bracket),/** 1933 + Parentheses (usually `(` and `)` tokens). Subtag of 1934 + [bracket](https://codemirror.net/6/docs/ref/#highlight.tags.bracket). 1935 + */paren:t(bracket),/** 1936 + Braces (usually `{` and `}` tokens). Subtag of 1937 + [bracket](https://codemirror.net/6/docs/ref/#highlight.tags.bracket). 1938 + */brace:t(bracket),/** 1939 + Content, for example plain text in XML or markup documents. 1940 + */content:content,/** 1941 + [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a heading. 1942 + */heading:heading,/** 1943 + A level 1 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading). 1944 + */heading1:t(heading),/** 1945 + A level 2 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading). 1946 + */heading2:t(heading),/** 1947 + A level 3 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading). 1948 + */heading3:t(heading),/** 1949 + A level 4 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading). 1950 + */heading4:t(heading),/** 1951 + A level 5 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading). 1952 + */heading5:t(heading),/** 1953 + A level 6 [heading](https://codemirror.net/6/docs/ref/#highlight.tags.heading). 1954 + */heading6:t(heading),/** 1955 + A prose separator (such as a horizontal rule). 1956 + */contentSeparator:t(content),/** 1957 + [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a list. 1958 + */list:t(content),/** 1959 + [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that represents a quote. 1960 + */quote:t(content),/** 1961 + [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is emphasized. 1962 + */emphasis:t(content),/** 1963 + [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is styled strong. 1964 + */strong:t(content),/** 1965 + [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is part of a link. 1966 + */link:t(content),/** 1967 + [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that is styled as code or 1968 + monospace. 1969 + */monospace:t(content),/** 1970 + [Content](https://codemirror.net/6/docs/ref/#highlight.tags.content) that has a strike-through 1971 + style. 1972 + */strikethrough:t(content),/** 1973 + Inserted text in a change-tracking format. 1974 + */inserted:t(),/** 1975 + Deleted text. 1976 + */deleted:t(),/** 1977 + Changed text. 1978 + */changed:t(),/** 1979 + An invalid or unsyntactic element. 1980 + */invalid:t(),/** 1981 + Metadata or meta-instruction. 1982 + */meta:meta,/** 1983 + [Metadata](https://codemirror.net/6/docs/ref/#highlight.tags.meta) that applies to the entire 1984 + document. 1985 + */documentMeta:t(meta),/** 1986 + [Metadata](https://codemirror.net/6/docs/ref/#highlight.tags.meta) that annotates or adds 1987 + attributes to a given syntactic element. 1988 + */annotation:t(meta),/** 1989 + Processing instruction or preprocessor directive. Subtag of 1990 + [meta](https://codemirror.net/6/docs/ref/#highlight.tags.meta). 1991 + */processingInstruction:t(meta),/** 1992 + [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates that a 1993 + given element is being defined. Expected to be used with the 1994 + various [name](https://codemirror.net/6/docs/ref/#highlight.tags.name) tags. 1995 + */definition:Tag.defineModifier(),/** 1996 + [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates that 1997 + something is constant. Mostly expected to be used with 1998 + [variable names](https://codemirror.net/6/docs/ref/#highlight.tags.variableName). 1999 + */constant:Tag.defineModifier(),/** 2000 + [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) used to indicate that 2001 + a [variable](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) or [property 2002 + name](https://codemirror.net/6/docs/ref/#highlight.tags.propertyName) is being called or defined 2003 + as a function. 2004 + */"function":Tag.defineModifier(),/** 2005 + [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that can be applied to 2006 + [names](https://codemirror.net/6/docs/ref/#highlight.tags.name) to indicate that they belong to 2007 + the language's standard environment. 2008 + */standard:Tag.defineModifier(),/** 2009 + [Modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that indicates a given 2010 + [names](https://codemirror.net/6/docs/ref/#highlight.tags.name) is local to some scope. 2011 + */local:Tag.defineModifier(),/** 2012 + A generic variant [modifier](https://codemirror.net/6/docs/ref/#highlight.Tag^defineModifier) that 2013 + can be used to tag language-specific alternative variants of 2014 + some common tag. It is recommended for themes to define special 2015 + forms of at least the [string](https://codemirror.net/6/docs/ref/#highlight.tags.string) and 2016 + [variable name](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) tags, since those 2017 + come up a lot. 2018 + */special:Tag.defineModifier()};/** 2019 + A default highlight style (works well with light themes). 2020 + */var defaultHighlightStyle=HighlightStyle.define([{tag:tags.link,textDecoration:"underline"},{tag:tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:tags.emphasis,fontStyle:"italic"},{tag:tags.strong,fontWeight:"bold"},{tag:tags.strikethrough,textDecoration:"line-through"},{tag:tags.keyword,color:"#708"},{tag:[tags.atom,tags.bool,tags.url,tags.contentSeparator,tags.labelName],color:"#219"},{tag:[tags.literal,tags.inserted],color:"#164"},{tag:[tags.string,tags.deleted],color:"#a11"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],color:"#e40"},{tag:tags.definition(tags.variableName),color:"#00f"},{tag:tags.local(tags.variableName),color:"#30a"},{tag:[tags.typeName,tags.namespace],color:"#085"},{tag:tags.className,color:"#167"},{tag:[tags.special(tags.variableName),tags.macroName],color:"#256"},{tag:tags.definition(tags.propertyName),color:"#00c"},{tag:tags.comment,color:"#940"},{tag:tags.meta,color:"#7a757a"},{tag:tags.invalid,color:"#f00"}]);/** 2021 + This is a highlight style that adds stable, predictable classes to 2022 + tokens, for styling with external CSS. 2023 + 2024 + These tags are mapped to their name prefixed with `"cmt-"` (for 2025 + example `"cmt-comment"`): 2026 + 2027 + * [`link`](https://codemirror.net/6/docs/ref/#highlight.tags.link) 2028 + * [`heading`](https://codemirror.net/6/docs/ref/#highlight.tags.heading) 2029 + * [`emphasis`](https://codemirror.net/6/docs/ref/#highlight.tags.emphasis) 2030 + * [`strong`](https://codemirror.net/6/docs/ref/#highlight.tags.strong) 2031 + * [`keyword`](https://codemirror.net/6/docs/ref/#highlight.tags.keyword) 2032 + * [`atom`](https://codemirror.net/6/docs/ref/#highlight.tags.atom) [`bool`](https://codemirror.net/6/docs/ref/#highlight.tags.bool) 2033 + * [`url`](https://codemirror.net/6/docs/ref/#highlight.tags.url) 2034 + * [`labelName`](https://codemirror.net/6/docs/ref/#highlight.tags.labelName) 2035 + * [`inserted`](https://codemirror.net/6/docs/ref/#highlight.tags.inserted) 2036 + * [`deleted`](https://codemirror.net/6/docs/ref/#highlight.tags.deleted) 2037 + * [`literal`](https://codemirror.net/6/docs/ref/#highlight.tags.literal) 2038 + * [`string`](https://codemirror.net/6/docs/ref/#highlight.tags.string) 2039 + * [`number`](https://codemirror.net/6/docs/ref/#highlight.tags.number) 2040 + * [`variableName`](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) 2041 + * [`typeName`](https://codemirror.net/6/docs/ref/#highlight.tags.typeName) 2042 + * [`namespace`](https://codemirror.net/6/docs/ref/#highlight.tags.namespace) 2043 + * [`className`](https://codemirror.net/6/docs/ref/#highlight.tags.className) 2044 + * [`macroName`](https://codemirror.net/6/docs/ref/#highlight.tags.macroName) 2045 + * [`propertyName`](https://codemirror.net/6/docs/ref/#highlight.tags.propertyName) 2046 + * [`operator`](https://codemirror.net/6/docs/ref/#highlight.tags.operator) 2047 + * [`comment`](https://codemirror.net/6/docs/ref/#highlight.tags.comment) 2048 + * [`meta`](https://codemirror.net/6/docs/ref/#highlight.tags.meta) 2049 + * [`punctuation`](https://codemirror.net/6/docs/ref/#highlight.tags.puncutation) 2050 + * [`invalid`](https://codemirror.net/6/docs/ref/#highlight.tags.invalid) 2051 + 2052 + In addition, these mappings are provided: 2053 + 2054 + * [`regexp`](https://codemirror.net/6/docs/ref/#highlight.tags.regexp), 2055 + [`escape`](https://codemirror.net/6/docs/ref/#highlight.tags.escape), and 2056 + [`special`](https://codemirror.net/6/docs/ref/#highlight.tags.special)[`(string)`](https://codemirror.net/6/docs/ref/#highlight.tags.string) 2057 + are mapped to `"cmt-string2"` 2058 + * [`special`](https://codemirror.net/6/docs/ref/#highlight.tags.special)[`(variableName)`](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) 2059 + to `"cmt-variableName2"` 2060 + * [`local`](https://codemirror.net/6/docs/ref/#highlight.tags.local)[`(variableName)`](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) 2061 + to `"cmt-variableName cmt-local"` 2062 + * [`definition`](https://codemirror.net/6/docs/ref/#highlight.tags.definition)[`(variableName)`](https://codemirror.net/6/docs/ref/#highlight.tags.variableName) 2063 + to `"cmt-variableName cmt-definition"` 2064 + * [`definition`](https://codemirror.net/6/docs/ref/#highlight.tags.definition)[`(propertyName)`](https://codemirror.net/6/docs/ref/#highlight.tags.propertyName) 2065 + to `"cmt-propertyName cmt-definition"` 2066 + */var classHighlightStyle=HighlightStyle.define([{tag:tags.link,"class":"cmt-link"},{tag:tags.heading,"class":"cmt-heading"},{tag:tags.emphasis,"class":"cmt-emphasis"},{tag:tags.strong,"class":"cmt-strong"},{tag:tags.keyword,"class":"cmt-keyword"},{tag:tags.atom,"class":"cmt-atom"},{tag:tags.bool,"class":"cmt-bool"},{tag:tags.url,"class":"cmt-url"},{tag:tags.labelName,"class":"cmt-labelName"},{tag:tags.inserted,"class":"cmt-inserted"},{tag:tags.deleted,"class":"cmt-deleted"},{tag:tags.literal,"class":"cmt-literal"},{tag:tags.string,"class":"cmt-string"},{tag:tags.number,"class":"cmt-number"},{tag:[tags.regexp,tags.escape,tags.special(tags.string)],"class":"cmt-string2"},{tag:tags.variableName,"class":"cmt-variableName"},{tag:tags.local(tags.variableName),"class":"cmt-variableName cmt-local"},{tag:tags.definition(tags.variableName),"class":"cmt-variableName cmt-definition"},{tag:tags.special(tags.variableName),"class":"cmt-variableName2"},{tag:tags.definition(tags.propertyName),"class":"cmt-propertyName cmt-definition"},{tag:tags.typeName,"class":"cmt-typeName"},{tag:tags.namespace,"class":"cmt-namespace"},{tag:tags.className,"class":"cmt-className"},{tag:tags.macroName,"class":"cmt-macroName"},{tag:tags.propertyName,"class":"cmt-propertyName"},{tag:tags.operator,"class":"cmt-operator"},{tag:tags.comment,"class":"cmt-comment"},{tag:tags.meta,"class":"cmt-meta"},{tag:tags.invalid,"class":"cmt-invalid"},{tag:tags.punctuation,"class":"cmt-punctuation"}]);exports.HighlightStyle=HighlightStyle;exports.Tag=Tag;exports.classHighlightStyle=classHighlightStyle;exports.defaultHighlightStyle=defaultHighlightStyle;exports.highlightTree=highlightTree;exports.styleTags=styleTags;exports.tags=tags;},{"@codemirror/language":13,"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/view":27,"@lezer/common":28,"style-mod":30}],12:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');var view=require('@codemirror/view');var fromHistory=state.Annotation.define();/** 2067 + Transaction annotation that will prevent that transaction from 2068 + being combined with other transactions in the undo history. Given 2069 + `"before"`, it'll prevent merging with previous transactions. With 2070 + `"after"`, subsequent transactions won't be combined with this 2071 + one. With `"full"`, the transaction is isolated on both sides. 2072 + */var isolateHistory=state.Annotation.define();/** 2073 + This facet provides a way to register functions that, given a 2074 + transaction, provide a set of effects that the history should 2075 + store when inverting the transaction. This can be used to 2076 + integrate some kinds of effects in the history, so that they can 2077 + be undone (and redone again). 2078 + */var invertedEffects=state.Facet.define();var historyConfig=state.Facet.define({combine:function combine(configs){return state.combineConfig(configs,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min});}});function changeEnd(changes){var end=0;changes.iterChangedRanges(function(_,to){return end=to;});return end;}var historyField_=state.StateField.define({create:function create(){return HistoryState.empty;},update:function update(state$1,tr){var config=tr.state.facet(historyConfig);var fromHist=tr.annotation(fromHistory);if(fromHist){var selection=tr.docChanged?state.EditorSelection.single(changeEnd(tr.changes)):undefined;var item=HistEvent.fromTransaction(tr,selection),from=fromHist.side;var other=from==0/* Done */?state$1.undone:state$1.done;if(item)other=updateBranch(other,other.length,config.minDepth,item);else other=_addSelection(other,tr.startState.selection);return new HistoryState(from==0/* Done */?fromHist.rest:other,from==0/* Done */?other:fromHist.rest);}var isolate=tr.annotation(isolateHistory);if(isolate=="full"||isolate=="before")state$1=state$1.isolate();if(tr.annotation(state.Transaction.addToHistory)===false)return!tr.changes.empty?state$1.addMapping(tr.changes.desc):state$1;var event=HistEvent.fromTransaction(tr);var time=tr.annotation(state.Transaction.time),userEvent=tr.annotation(state.Transaction.userEvent);if(event)state$1=state$1.addChanges(event,time,userEvent,config.newGroupDelay,config.minDepth);else if(tr.selection)state$1=state$1.addSelection(tr.startState.selection,time,userEvent,config.newGroupDelay);if(isolate=="full"||isolate=="after")state$1=state$1.isolate();return state$1;},toJSON:function toJSON(value){return{done:value.done.map(function(e){return e.toJSON();}),undone:value.undone.map(function(e){return e.toJSON();})};},fromJSON:function fromJSON(json){return new HistoryState(json.done.map(HistEvent.fromJSON),json.undone.map(HistEvent.fromJSON));}});/** 2079 + Create a history extension with the given configuration. 2080 + */function history(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[historyField_,historyConfig.of(config),view.EditorView.domEventHandlers({beforeinput:function beforeinput(e,view){var command=e.inputType=="historyUndo"?undo:e.inputType=="historyRedo"?redo:null;if(!command)return false;e.preventDefault();return command(view);}})];}/** 2081 + The state field used to store the history data. Should probably 2082 + only be used when you want to 2083 + [serialize](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) or 2084 + [deserialize](https://codemirror.net/6/docs/ref/#state.EditorState^fromJSON) state objects in a way 2085 + that preserves history. 2086 + */var historyField=historyField_;function cmd(side,selection){return function(_ref50){var state=_ref50.state,dispatch=_ref50.dispatch;if(!selection&&state.readOnly)return false;var historyState=state.field(historyField_,false);if(!historyState)return false;var tr=historyState.pop(side,state,selection);if(!tr)return false;dispatch(tr);return true;};}/** 2087 + Undo a single group of history events. Returns false if no group 2088 + was available. 2089 + */var undo=cmd(0/* Done */,false);/** 2090 + Redo a group of history events. Returns false if no group was 2091 + available. 2092 + */var redo=cmd(1/* Undone */,false);/** 2093 + Undo a selection change. 2094 + */var undoSelection=cmd(0/* Done */,true);/** 2095 + Redo a selection change. 2096 + */var redoSelection=cmd(1/* Undone */,true);function depth(side){return function(state){var histState=state.field(historyField_,false);if(!histState)return 0;var branch=side==0/* Done */?histState.done:histState.undone;return branch.length-(branch.length&&!branch[0].changes?1:0);};}/** 2097 + The amount of undoable change events available in a given state. 2098 + */var undoDepth=depth(0/* Done */);/** 2099 + The amount of redoable change events available in a given state. 2100 + */var redoDepth=depth(1/* Undone */);// History events store groups of changes or effects that need to be 2101 + // undone/redone together. 2102 + var HistEvent=/*#__PURE__*/function(){function HistEvent(// The changes in this event. Normal events hold at least one 2103 + // change or effect. But it may be necessary to store selection 2104 + // events before the first change, in which case a special type of 2105 + // instance is created which doesn't hold any changes, with 2106 + // changes == startSelection == undefined 2107 + changes,// The effects associated with this event 2108 + effects,mapped,// The selection before this event 2109 + startSelection,// Stores selection changes after this event, to be used for 2110 + // selection undo/redo. 2111 + selectionsAfter){_classCallCheck(this,HistEvent);this.changes=changes;this.effects=effects;this.mapped=mapped;this.startSelection=startSelection;this.selectionsAfter=selectionsAfter;}_createClass(HistEvent,[{key:"setSelAfter",value:function setSelAfter(after){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,after);}},{key:"toJSON",value:function toJSON(){var _a,_b,_c;return{changes:(_a=this.changes)===null||_a===void 0?void 0:_a.toJSON(),mapped:(_b=this.mapped)===null||_b===void 0?void 0:_b.toJSON(),startSelection:(_c=this.startSelection)===null||_c===void 0?void 0:_c.toJSON(),selectionsAfter:this.selectionsAfter.map(function(s){return s.toJSON();})};}}],[{key:"fromJSON",value:function fromJSON(json){return new HistEvent(json.changes&&state.ChangeSet.fromJSON(json.changes),[],json.mapped&&state.ChangeDesc.fromJSON(json.mapped),json.startSelection&&state.EditorSelection.fromJSON(json.startSelection),json.selectionsAfter.map(state.EditorSelection.fromJSON));}// This does not check `addToHistory` and such, it assumes the 2112 + // transaction needs to be converted to an item. Returns null when 2113 + // there are no changes or effects in the transaction. 2114 + },{key:"fromTransaction",value:function fromTransaction(tr,selection){var effects=none;var _iterator130=_createForOfIteratorHelper(tr.startState.facet(invertedEffects)),_step130;try{for(_iterator130.s();!(_step130=_iterator130.n()).done;){var invert=_step130.value;var result=invert(tr);if(result.length)effects=effects.concat(result);}}catch(err){_iterator130.e(err);}finally{_iterator130.f();}if(!effects.length&&tr.changes.empty)return null;return new HistEvent(tr.changes.invert(tr.startState.doc),effects,undefined,selection||tr.startState.selection,none);}},{key:"selection",value:function selection(selections){return new HistEvent(undefined,none,undefined,undefined,selections);}}]);return HistEvent;}();function updateBranch(branch,to,maxLen,newEvent){var start=to+1>maxLen+20?to-maxLen-1:0;var newBranch=branch.slice(start,to);newBranch.push(newEvent);return newBranch;}function isAdjacent(a,b){var ranges=[],isAdjacent=false;a.iterChangedRanges(function(f,t){return ranges.push(f,t);});b.iterChangedRanges(function(_f,_t,f,t){for(var _i63=0;_i63<ranges.length;){var from=ranges[_i63++],to=ranges[_i63++];if(t>=from&&f<=to)isAdjacent=true;}});return isAdjacent;}function eqSelectionShape(a,b){return a.ranges.length==b.ranges.length&&a.ranges.filter(function(r,i){return r.empty!=b.ranges[i].empty;}).length===0;}function conc(a,b){return!a.length?b:!b.length?a:a.concat(b);}var none=[];var MaxSelectionsPerEvent=200;function _addSelection(branch,selection){if(!branch.length){return[HistEvent.selection([selection])];}else{var lastEvent=branch[branch.length-1];var sels=lastEvent.selectionsAfter.slice(Math.max(0,lastEvent.selectionsAfter.length-MaxSelectionsPerEvent));if(sels.length&&sels[sels.length-1].eq(selection))return branch;sels.push(selection);return updateBranch(branch,branch.length-1,1e9,lastEvent.setSelAfter(sels));}}// Assumes the top item has one or more selectionAfter values 2115 + function popSelection(branch){var last=branch[branch.length-1];var newBranch=branch.slice();newBranch[branch.length-1]=last.setSelAfter(last.selectionsAfter.slice(0,last.selectionsAfter.length-1));return newBranch;}// Add a mapping to the top event in the given branch. If this maps 2116 + // away all the changes and effects in that item, drop it and 2117 + // propagate the mapping to the next item. 2118 + function addMappingToBranch(branch,mapping){if(!branch.length)return branch;var length=branch.length,selections=none;while(length){var event=mapEvent(branch[length-1],mapping,selections);if(event.changes&&!event.changes.empty||event.effects.length){// Event survived mapping 2119 + var result=branch.slice(0,length);result[length-1]=event;return result;}else{// Drop this event, since there's no changes or effects left 2120 + mapping=event.mapped;length--;selections=event.selectionsAfter;}}return selections.length?[HistEvent.selection(selections)]:none;}function mapEvent(event,mapping,extraSelections){var selections=conc(event.selectionsAfter.length?event.selectionsAfter.map(function(s){return s.map(mapping);}):none,extraSelections);// Change-less events don't store mappings (they are always the last event in a branch) 2121 + if(!event.changes)return HistEvent.selection(selections);var mappedChanges=event.changes.map(mapping),before=mapping.mapDesc(event.changes,true);var fullMapping=event.mapped?event.mapped.composeDesc(before):before;return new HistEvent(mappedChanges,state.StateEffect.mapEffects(event.effects,mapping),fullMapping,event.startSelection.map(before),selections);}var joinableUserEvent=/^(input\.type|delete)($|\.)/;var HistoryState=/*#__PURE__*/function(){function HistoryState(done,undone){var prevTime=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var prevUserEvent=arguments.length>3&&arguments[3]!==undefined?arguments[3]:undefined;_classCallCheck(this,HistoryState);this.done=done;this.undone=undone;this.prevTime=prevTime;this.prevUserEvent=prevUserEvent;}_createClass(HistoryState,[{key:"isolate",value:function isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this;}},{key:"addChanges",value:function addChanges(event,time,userEvent,newGroupDelay,maxLen){var done=this.done,lastEvent=done[done.length-1];if(lastEvent&&lastEvent.changes&&!lastEvent.changes.empty&&event.changes&&(!userEvent||joinableUserEvent.test(userEvent))&&(!lastEvent.selectionsAfter.length&&time-this.prevTime<newGroupDelay&&isAdjacent(lastEvent.changes,event.changes)||// For compose (but not compose.start) events, always join with previous event 2122 + userEvent=="input.type.compose")){done=updateBranch(done,done.length-1,maxLen,new HistEvent(event.changes.compose(lastEvent.changes),conc(event.effects,lastEvent.effects),lastEvent.mapped,lastEvent.startSelection,none));}else{done=updateBranch(done,done.length,maxLen,event);}return new HistoryState(done,none,time,userEvent);}},{key:"addSelection",value:function addSelection(selection,time,userEvent,newGroupDelay){var last=this.done.length?this.done[this.done.length-1].selectionsAfter:none;if(last.length>0&&time-this.prevTime<newGroupDelay&&userEvent==this.prevUserEvent&&userEvent&&/^select($|\.)/.test(userEvent)&&eqSelectionShape(last[last.length-1],selection))return this;return new HistoryState(_addSelection(this.done,selection),this.undone,time,userEvent);}},{key:"addMapping",value:function addMapping(mapping){return new HistoryState(addMappingToBranch(this.done,mapping),addMappingToBranch(this.undone,mapping),this.prevTime,this.prevUserEvent);}},{key:"pop",value:function pop(side,state,selection){var branch=side==0/* Done */?this.done:this.undone;if(branch.length==0)return null;var event=branch[branch.length-1];if(selection&&event.selectionsAfter.length){return state.update({selection:event.selectionsAfter[event.selectionsAfter.length-1],annotations:fromHistory.of({side:side,rest:popSelection(branch)}),userEvent:side==0/* Done */?"select.undo":"select.redo",scrollIntoView:true});}else if(!event.changes){return null;}else{var rest=branch.length==1?none:branch.slice(0,branch.length-1);if(event.mapped)rest=addMappingToBranch(rest,event.mapped);return state.update({changes:event.changes,selection:event.startSelection,effects:event.effects,annotations:fromHistory.of({side:side,rest:rest}),filter:false,userEvent:side==0/* Done */?"undo":"redo",scrollIntoView:true});}}}]);return HistoryState;}();HistoryState.empty=new HistoryState(none,none);/** 2123 + Default key bindings for the undo history. 2124 + 2125 + - Mod-z: [`undo`](https://codemirror.net/6/docs/ref/#history.undo). 2126 + - Mod-y (Mod-Shift-z on macOS): [`redo`](https://codemirror.net/6/docs/ref/#history.redo). 2127 + - Mod-u: [`undoSelection`](https://codemirror.net/6/docs/ref/#history.undoSelection). 2128 + - Alt-u (Mod-Shift-u on macOS): [`redoSelection`](https://codemirror.net/6/docs/ref/#history.redoSelection). 2129 + */var historyKeymap=[{key:"Mod-z",run:undo,preventDefault:true},{key:"Mod-y",mac:"Mod-Shift-z",run:redo,preventDefault:true},{key:"Mod-u",run:undoSelection,preventDefault:true},{key:"Alt-u",mac:"Mod-Shift-u",run:redoSelection,preventDefault:true}];exports.history=history;exports.historyField=historyField;exports.historyKeymap=historyKeymap;exports.invertedEffects=invertedEffects;exports.isolateHistory=isolateHistory;exports.redo=redo;exports.redoDepth=redoDepth;exports.redoSelection=redoSelection;exports.undo=undo;exports.undoDepth=undoDepth;exports.undoSelection=undoSelection;},{"@codemirror/state":22,"@codemirror/view":27}],13:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var common=require('@lezer/common');var state=require('@codemirror/state');var view=require('@codemirror/view');var text=require('@codemirror/text');/** 2130 + Node prop stored in a grammar's top syntax node to provide the 2131 + facet that stores language data for that language. 2132 + */var languageDataProp=new common.NodeProp();/** 2133 + Helper function to define a facet (to be added to the top syntax 2134 + node(s) for a language via 2135 + [`languageDataProp`](https://codemirror.net/6/docs/ref/#language.languageDataProp)), that will be 2136 + used to associate language data with the language. You 2137 + probably only need this when subclassing 2138 + [`Language`](https://codemirror.net/6/docs/ref/#language.Language). 2139 + */function defineLanguageFacet(baseData){return state.Facet.define({combine:baseData?function(values){return values.concat(baseData);}:undefined});}/** 2140 + A language object manages parsing and per-language 2141 + [metadata](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt). Parse data is 2142 + managed as a [Lezer](https://lezer.codemirror.net) tree. You'll 2143 + want to subclass this class for custom parsers, or use the 2144 + [`LRLanguage`](https://codemirror.net/6/docs/ref/#language.LRLanguage) or 2145 + [`StreamLanguage`](https://codemirror.net/6/docs/ref/#stream-parser.StreamLanguage) abstractions for 2146 + [Lezer](https://lezer.codemirror.net/) or stream parsers. 2147 + */var Language=/*#__PURE__*/function(){/** 2148 + Construct a language object. You usually don't need to invoke 2149 + this directly. But when you do, make sure you use 2150 + [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet) to create 2151 + the first argument. 2152 + */function Language(/** 2153 + The [language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) data 2154 + facet used for this language. 2155 + */data,parser,/** 2156 + The node type of the top node of trees produced by this parser. 2157 + */topNode){var extraExtensions=arguments.length>3&&arguments[3]!==undefined?arguments[3]:[];_classCallCheck(this,Language);this.data=data;this.topNode=topNode;// Kludge to define EditorState.tree as a debugging helper, 2158 + // without the EditorState package actually knowing about 2159 + // languages and lezer trees. 2160 + if(!state.EditorState.prototype.hasOwnProperty("tree"))Object.defineProperty(state.EditorState.prototype,"tree",{get:function get(){return syntaxTree(this);}});this.parser=parser;this.extension=[language.of(this),state.EditorState.languageData.of(function(state,pos,side){return state.facet(languageDataFacetAt(state,pos,side));})].concat(extraExtensions);}/** 2161 + Query whether this language is active at the given position. 2162 + */_createClass(Language,[{key:"isActiveAt",value:function isActiveAt(state,pos){var side=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;return languageDataFacetAt(state,pos,side)==this.data;}/** 2163 + Find the document regions that were parsed using this language. 2164 + The returned regions will _include_ any nested languages rooted 2165 + in this language, when those exist. 2166 + */},{key:"findRegions",value:function findRegions(state){var _this64=this;var lang=state.facet(language);if((lang===null||lang===void 0?void 0:lang.data)==this.data)return[{from:0,to:state.doc.length}];if(!lang||!lang.allowsNesting)return[];var result=[];var explore=function explore(tree,from){if(tree.prop(languageDataProp)==_this64.data){result.push({from:from,to:from+tree.length});return;}var mount=tree.prop(common.NodeProp.mounted);if(mount){if(mount.tree.prop(languageDataProp)==_this64.data){if(mount.overlay){var _iterator131=_createForOfIteratorHelper(mount.overlay),_step131;try{for(_iterator131.s();!(_step131=_iterator131.n()).done;){var r=_step131.value;result.push({from:r.from+from,to:r.to+from});}}catch(err){_iterator131.e(err);}finally{_iterator131.f();}}else result.push({from:from,to:from+tree.length});return;}else if(mount.overlay){var size=result.length;explore(mount.tree,mount.overlay[0].from+from);if(result.length>size)return;}}for(var _i64=0;_i64<tree.children.length;_i64++){var ch=tree.children[_i64];if(ch instanceof common.Tree)explore(ch,tree.positions[_i64]+from);}};explore(syntaxTree(state),0);return result;}/** 2167 + Indicates whether this language allows nested languages. The 2168 + default implementation returns true. 2169 + */},{key:"allowsNesting",get:function get(){return true;}}]);return Language;}();/** 2170 + @internal 2171 + */Language.setState=state.StateEffect.define();function languageDataFacetAt(state,pos,side){var topLang=state.facet(language);if(!topLang)return null;var facet=topLang.data;if(topLang.allowsNesting){for(var node=syntaxTree(state).topNode;node;node=node.enter(pos,side,true,false)){facet=node.type.prop(languageDataProp)||facet;}}return facet;}/** 2172 + A subclass of [`Language`](https://codemirror.net/6/docs/ref/#language.Language) for use with Lezer 2173 + [LR parsers](https://lezer.codemirror.net/docs/ref#lr.LRParser) 2174 + parsers. 2175 + */var LRLanguage=/*#__PURE__*/function(_Language){_inherits(LRLanguage,_Language);var _super32=_createSuper(LRLanguage);function LRLanguage(data,parser){var _this65;_classCallCheck(this,LRLanguage);_this65=_super32.call(this,data,parser,parser.topNode);_this65.parser=parser;return _this65;}/** 2176 + Define a language from a parser. 2177 + */_createClass(LRLanguage,[{key:"configure",value:/** 2178 + Create a new instance of this language with a reconfigured 2179 + version of its parser. 2180 + */function configure(options){return new LRLanguage(this.data,this.parser.configure(options));}},{key:"allowsNesting",get:function get(){return this.parser.wrappers.length>0;}// FIXME 2181 + }],[{key:"define",value:function define(spec){var data=defineLanguageFacet(spec.languageData);return new LRLanguage(data,spec.parser.configure({props:[languageDataProp.add(function(type){return type.isTop?data:undefined;})]}));}}]);return LRLanguage;}(Language);/** 2182 + Get the syntax tree for a state, which is the current (possibly 2183 + incomplete) parse tree of active [language](https://codemirror.net/6/docs/ref/#language.Language), 2184 + or the empty tree if there is no language available. 2185 + */function syntaxTree(state){var field=state.field(Language.state,false);return field?field.tree:common.Tree.empty;}/** 2186 + Try to get a parse tree that spans at least up to `upto`. The 2187 + method will do at most `timeout` milliseconds of work to parse 2188 + up to that point if the tree isn't already available. 2189 + */function ensureSyntaxTree(state,upto){var timeout=arguments.length>2&&arguments[2]!==undefined?arguments[2]:50;var _a;var parse=(_a=state.field(Language.state,false))===null||_a===void 0?void 0:_a.context;return!parse?null:parse.isDone(upto)||parse.work(timeout,upto)?parse.tree:null;}/** 2190 + Queries whether there is a full syntax tree available up to the 2191 + given document position. If there isn't, the background parse 2192 + process _might_ still be working and update the tree further, but 2193 + there is no guarantee of that—the parser will [stop 2194 + working](https://codemirror.net/6/docs/ref/#language.syntaxParserStopped) when it has spent a 2195 + certain amount of time or has moved beyond the visible viewport. 2196 + Always returns false if no language has been enabled. 2197 + */function syntaxTreeAvailable(state){var upto=arguments.length>1&&arguments[1]!==undefined?arguments[1]:state.doc.length;var _a;return((_a=state.field(Language.state,false))===null||_a===void 0?void 0:_a.context.isDone(upto))||false;}/** 2198 + Tells you whether the language parser is planning to do more 2199 + parsing work (in a `requestIdleCallback` pseudo-thread) or has 2200 + stopped running, either because it parsed the entire document, 2201 + because it spent too much time and was cut off, or because there 2202 + is no language parser enabled. 2203 + */function syntaxParserRunning(view){var _a;return((_a=view.plugin(parseWorker))===null||_a===void 0?void 0:_a.isWorking())||false;}// Lezer-style Input object for a Text document. 2204 + var DocInput=/*#__PURE__*/function(){function DocInput(doc){var length=arguments.length>1&&arguments[1]!==undefined?arguments[1]:doc.length;_classCallCheck(this,DocInput);this.doc=doc;this.length=length;this.cursorPos=0;this.string="";this.cursor=doc.iter();}_createClass(DocInput,[{key:"syncTo",value:function syncTo(pos){this.string=this.cursor.next(pos-this.cursorPos).value;this.cursorPos=pos+this.string.length;return this.cursorPos-this.string.length;}},{key:"chunk",value:function chunk(pos){this.syncTo(pos);return this.string;}},{key:"lineChunks",get:function get(){return true;}},{key:"read",value:function read(from,to){var stringStart=this.cursorPos-this.string.length;if(from<stringStart||to>=this.cursorPos)return this.doc.sliceString(from,to);else return this.string.slice(from-stringStart,to-stringStart);}}]);return DocInput;}();var currentContext=null;/** 2205 + A parse context provided to parsers working on the editor content. 2206 + */var ParseContext=/*#__PURE__*/function(){/** 2207 + @internal 2208 + */function ParseContext(parser,/** 2209 + The current editor state. 2210 + */state){var fragments=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[];var/** 2211 + @internal 2212 + */tree=arguments.length>3?arguments[3]:undefined;var treeLen=arguments.length>4?arguments[4]:undefined;var/** 2213 + The current editor viewport (or some overapproximation 2214 + thereof). Intended to be used for opportunistically avoiding 2215 + work (in which case 2216 + [`skipUntilInView`](https://codemirror.net/6/docs/ref/#language.ParseContext.skipUntilInView) 2217 + should be called to make sure the parser is restarted when the 2218 + skipped region becomes visible). 2219 + */viewport=arguments.length>5?arguments[5]:undefined;var/** 2220 + @internal 2221 + */skipped=arguments.length>6?arguments[6]:undefined;var/** 2222 + This is where skipping parsers can register a promise that, 2223 + when resolved, will schedule a new parse. It is cleared when 2224 + the parse worker picks up the promise. @internal 2225 + */scheduleOn=arguments.length>7?arguments[7]:undefined;_classCallCheck(this,ParseContext);this.parser=parser;this.state=state;this.fragments=fragments;this.tree=tree;this.treeLen=treeLen;this.viewport=viewport;this.skipped=skipped;this.scheduleOn=scheduleOn;this.parse=null;/** 2226 + @internal 2227 + */this.tempSkipped=[];}_createClass(ParseContext,[{key:"startParse",value:function startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments);}/** 2228 + @internal 2229 + */},{key:"work",value:function work(time,upto){var _this66=this;if(upto!=null&&upto>=this.state.doc.length)upto=undefined;if(this.tree!=common.Tree.empty&&this.isDone(upto!==null&&upto!==void 0?upto:this.state.doc.length)){this.takeTree();return true;}return this.withContext(function(){var _a;var endTime=Date.now()+time;if(!_this66.parse)_this66.parse=_this66.startParse();if(upto!=null&&(_this66.parse.stoppedAt==null||_this66.parse.stoppedAt>upto)&&upto<_this66.state.doc.length)_this66.parse.stopAt(upto);for(;;){var done=_this66.parse.advance();if(done){_this66.fragments=_this66.withoutTempSkipped(common.TreeFragment.addTree(done,_this66.fragments,_this66.parse.stoppedAt!=null));_this66.treeLen=(_a=_this66.parse.stoppedAt)!==null&&_a!==void 0?_a:_this66.state.doc.length;_this66.tree=done;_this66.parse=null;if(_this66.treeLen<(upto!==null&&upto!==void 0?upto:_this66.state.doc.length))_this66.parse=_this66.startParse();else return true;}if(Date.now()>endTime)return false;}});}/** 2230 + @internal 2231 + */},{key:"takeTree",value:function takeTree(){var _this67=this;var pos,tree;if(this.parse&&(pos=this.parse.parsedPos)>=this.treeLen){if(this.parse.stoppedAt==null||this.parse.stoppedAt>pos)this.parse.stopAt(pos);this.withContext(function(){while(!(tree=_this67.parse.advance())){}});this.treeLen=pos;this.tree=tree;this.fragments=this.withoutTempSkipped(common.TreeFragment.addTree(this.tree,this.fragments,true));this.parse=null;}}},{key:"withContext",value:function withContext(f){var prev=currentContext;currentContext=this;try{return f();}finally{currentContext=prev;}}},{key:"withoutTempSkipped",value:function withoutTempSkipped(fragments){for(var r;r=this.tempSkipped.pop();){fragments=cutFragments(fragments,r.from,r.to);}return fragments;}/** 2232 + @internal 2233 + */},{key:"changes",value:function changes(_changes2,newState){var fragments=this.fragments,tree=this.tree,treeLen=this.treeLen,viewport=this.viewport,skipped=this.skipped;this.takeTree();if(!_changes2.empty){var ranges=[];_changes2.iterChangedRanges(function(fromA,toA,fromB,toB){return ranges.push({fromA:fromA,toA:toA,fromB:fromB,toB:toB});});fragments=common.TreeFragment.applyChanges(fragments,ranges);tree=common.Tree.empty;treeLen=0;viewport={from:_changes2.mapPos(viewport.from,-1),to:_changes2.mapPos(viewport.to,1)};if(this.skipped.length){skipped=[];var _iterator132=_createForOfIteratorHelper(this.skipped),_step132;try{for(_iterator132.s();!(_step132=_iterator132.n()).done;){var r=_step132.value;var from=_changes2.mapPos(r.from,1),to=_changes2.mapPos(r.to,-1);if(from<to)skipped.push({from:from,to:to});}}catch(err){_iterator132.e(err);}finally{_iterator132.f();}}}return new ParseContext(this.parser,newState,fragments,tree,treeLen,viewport,skipped,this.scheduleOn);}/** 2234 + @internal 2235 + */},{key:"updateViewport",value:function updateViewport(viewport){if(this.viewport.from==viewport.from&&this.viewport.to==viewport.to)return false;this.viewport=viewport;var startLen=this.skipped.length;for(var _i65=0;_i65<this.skipped.length;_i65++){var _this$skipped$_i=this.skipped[_i65],from=_this$skipped$_i.from,to=_this$skipped$_i.to;if(from<viewport.to&&to>viewport.from){this.fragments=cutFragments(this.fragments,from,to);this.skipped.splice(_i65--,1);}}if(this.skipped.length>=startLen)return false;this.reset();return true;}/** 2236 + @internal 2237 + */},{key:"reset",value:function reset(){if(this.parse){this.takeTree();this.parse=null;}}/** 2238 + Notify the parse scheduler that the given region was skipped 2239 + because it wasn't in view, and the parse should be restarted 2240 + when it comes into view. 2241 + */},{key:"skipUntilInView",value:function skipUntilInView(from,to){this.skipped.push({from:from,to:to});}/** 2242 + Returns a parser intended to be used as placeholder when 2243 + asynchronously loading a nested parser. It'll skip its input and 2244 + mark it as not-really-parsed, so that the next update will parse 2245 + it again. 2246 + 2247 + When `until` is given, a reparse will be scheduled when that 2248 + promise resolves. 2249 + */},{key:"isDone",value:/** 2250 + @internal 2251 + */function isDone(upto){upto=Math.min(upto,this.state.doc.length);var frags=this.fragments;return this.treeLen>=upto&&frags.length&&frags[0].from==0&&frags[0].to>=upto;}/** 2252 + Get the context for the current parse, or `null` if no editor 2253 + parse is in progress. 2254 + */}],[{key:"getSkippingParser",value:function getSkippingParser(until){return new(/*#__PURE__*/function(_common$Parser){_inherits(_class14,_common$Parser);var _super33=_createSuper(_class14);function _class14(){_classCallCheck(this,_class14);return _super33.apply(this,arguments);}_createClass(_class14,[{key:"createParse",value:function createParse(input,fragments,ranges){var from=ranges[0].from,to=ranges[ranges.length-1].to;var parser={parsedPos:from,advance:function advance(){var cx=currentContext;if(cx){var _iterator133=_createForOfIteratorHelper(ranges),_step133;try{for(_iterator133.s();!(_step133=_iterator133.n()).done;){var r=_step133.value;cx.tempSkipped.push(r);}}catch(err){_iterator133.e(err);}finally{_iterator133.f();}if(until)cx.scheduleOn=cx.scheduleOn?Promise.all([cx.scheduleOn,until]):until;}this.parsedPos=to;return new common.Tree(common.NodeType.none,[],[],to-from);},stoppedAt:null,stopAt:function stopAt(){}};return parser;}}]);return _class14;}(common.Parser))();}},{key:"get",value:function get(){return currentContext;}}]);return ParseContext;}();function cutFragments(fragments,from,to){return common.TreeFragment.applyChanges(fragments,[{fromA:from,toA:to,fromB:from,toB:to}]);}var LanguageState=/*#__PURE__*/function(){function LanguageState(// A mutable parse state that is used to preserve work done during 2255 + // the lifetime of a state when moving to the next state. 2256 + context){_classCallCheck(this,LanguageState);this.context=context;this.tree=context.tree;}_createClass(LanguageState,[{key:"apply",value:function apply(tr){if(!tr.docChanged)return this;var newCx=this.context.changes(tr.changes,tr.state);// If the previous parse wasn't done, go forward only up to its 2257 + // end position or the end of the viewport, to avoid slowing down 2258 + // state updates with parse work beyond the viewport. 2259 + var upto=this.context.treeLen==tr.startState.doc.length?undefined:Math.max(tr.changes.mapPos(this.context.treeLen),newCx.viewport.to);if(!newCx.work(20/* Apply */,upto))newCx.takeTree();return new LanguageState(newCx);}}],[{key:"init",value:function init(state){var vpTo=Math.min(3000/* InitViewport */,state.doc.length);var parseState=new ParseContext(state.facet(language).parser,state,[],common.Tree.empty,0,{from:0,to:vpTo},[],null);if(!parseState.work(20/* Apply */,vpTo))parseState.takeTree();return new LanguageState(parseState);}}]);return LanguageState;}();Language.state=state.StateField.define({create:LanguageState.init,update:function update(value,tr){var _iterator134=_createForOfIteratorHelper(tr.effects),_step134;try{for(_iterator134.s();!(_step134=_iterator134.n()).done;){var e=_step134.value;if(e.is(Language.setState))return e.value;}}catch(err){_iterator134.e(err);}finally{_iterator134.f();}if(tr.startState.facet(language)!=tr.state.facet(language))return LanguageState.init(tr.state);return value.apply(tr);}});var requestIdle=function requestIdle(callback){var timeout=setTimeout(function(){return callback();},500/* MaxPause */);return function(){return clearTimeout(timeout);};};if(typeof requestIdleCallback!="undefined")requestIdle=function requestIdle(callback){var idle=-1,timeout=setTimeout(function(){idle=requestIdleCallback(callback,{timeout:500/* MaxPause */-100/* MinPause */});},100/* MinPause */);return function(){return idle<0?clearTimeout(timeout):cancelIdleCallback(idle);};};var parseWorker=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function ParseWorker(view){_classCallCheck(this,ParseWorker);this.view=view;this.working=null;this.workScheduled=0;// End of the current time chunk 2260 + this.chunkEnd=-1;// Milliseconds of budget left for this chunk 2261 + this.chunkBudget=-1;this.work=this.work.bind(this);this.scheduleWork();}_createClass(ParseWorker,[{key:"update",value:function update(_update17){var cx=this.view.state.field(Language.state).context;if(cx.updateViewport(_update17.view.viewport)||this.view.viewport.to>cx.treeLen)this.scheduleWork();if(_update17.docChanged){if(this.view.hasFocus)this.chunkBudget+=50/* ChangeBonus */;this.scheduleWork();}this.checkAsyncSchedule(cx);}},{key:"scheduleWork",value:function scheduleWork(){if(this.working)return;var state=this.view.state,field=state.field(Language.state);if(field.tree!=field.context.tree||!field.context.isDone(state.doc.length))this.working=requestIdle(this.work);}},{key:"work",value:function work(deadline){this.working=null;var now=Date.now();if(this.chunkEnd<now&&(this.chunkEnd<0||this.view.hasFocus)){// Start a new chunk 2262 + this.chunkEnd=now+30000/* ChunkTime */;this.chunkBudget=3000/* ChunkBudget */;}if(this.chunkBudget<=0)return;// No more budget 2263 + var _this$view=this.view,state=_this$view.state,vpTo=_this$view.viewport.to,field=state.field(Language.state);if(field.tree==field.context.tree&&field.context.isDone(vpTo+100000/* MaxParseAhead */))return;var time=Math.min(this.chunkBudget,100/* Slice */,deadline?Math.max(25/* MinSlice */,deadline.timeRemaining()-5):1e9);var viewportFirst=field.context.treeLen<vpTo&&state.doc.length>vpTo+1000;var done=field.context.work(time,vpTo+(viewportFirst?0:100000/* MaxParseAhead */));this.chunkBudget-=Date.now()-now;if(done||this.chunkBudget<=0){field.context.takeTree();this.view.dispatch({effects:Language.setState.of(new LanguageState(field.context))});}if(this.chunkBudget>0&&!(done&&!viewportFirst))this.scheduleWork();this.checkAsyncSchedule(field.context);}},{key:"checkAsyncSchedule",value:function checkAsyncSchedule(cx){var _this68=this;if(cx.scheduleOn){this.workScheduled++;cx.scheduleOn.then(function(){return _this68.scheduleWork();})["catch"](function(err){return view.logException(_this68.view.state,err);}).then(function(){return _this68.workScheduled--;});cx.scheduleOn=null;}}},{key:"destroy",value:function destroy(){if(this.working)this.working();}},{key:"isWorking",value:function isWorking(){return this.working||this.workScheduled>0;}}]);return ParseWorker;}(),{eventHandlers:{focus:function focus(){this.scheduleWork();}}});/** 2264 + The facet used to associate a language with an editor state. 2265 + */var language=state.Facet.define({combine:function combine(languages){return languages.length?languages[0]:null;},enables:[Language.state,parseWorker]});/** 2266 + This class bundles a [language object](https://codemirror.net/6/docs/ref/#language.Language) with an 2267 + optional set of supporting extensions. Language packages are 2268 + encouraged to export a function that optionally takes a 2269 + configuration object and returns a `LanguageSupport` instance, as 2270 + the main way for client code to use the package. 2271 + */var LanguageSupport=/*#__PURE__*/_createClass(/** 2272 + Create a support object. 2273 + */function LanguageSupport(/** 2274 + The language object. 2275 + */language){var support=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];_classCallCheck(this,LanguageSupport);this.language=language;this.support=support;this.extension=[language,support];});/** 2276 + Language descriptions are used to store metadata about languages 2277 + and to dynamically load them. Their main role is finding the 2278 + appropriate language for a filename or dynamically loading nested 2279 + parsers. 2280 + */var LanguageDescription=/*#__PURE__*/function(){function LanguageDescription(/** 2281 + The name of this language. 2282 + */name,/** 2283 + Alternative names for the mode (lowercased, includes `this.name`). 2284 + */alias,/** 2285 + File extensions associated with this language. 2286 + */extensions,/** 2287 + Optional filename pattern that should be associated with this 2288 + language. 2289 + */filename,loadFunc){var support=arguments.length>5&&arguments[5]!==undefined?arguments[5]:undefined;_classCallCheck(this,LanguageDescription);this.name=name;this.alias=alias;this.extensions=extensions;this.filename=filename;this.loadFunc=loadFunc;this.support=support;this.loading=null;}/** 2290 + Start loading the the language. Will return a promise that 2291 + resolves to a [`LanguageSupport`](https://codemirror.net/6/docs/ref/#language.LanguageSupport) 2292 + object when the language successfully loads. 2293 + */_createClass(LanguageDescription,[{key:"load",value:function load(){var _this69=this;return this.loading||(this.loading=this.loadFunc().then(function(support){return _this69.support=support;},function(err){_this69.loading=null;throw err;}));}/** 2294 + Create a language description. 2295 + */}],[{key:"of",value:function of(spec){var load=spec.load,support=spec.support;if(!load){if(!support)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");load=function load(){return Promise.resolve(support);};}return new LanguageDescription(spec.name,(spec.alias||[]).concat(spec.name).map(function(s){return s.toLowerCase();}),spec.extensions||[],spec.filename,load,support);}/** 2296 + Look for a language in the given array of descriptions that 2297 + matches the filename. Will first match 2298 + [`filename`](https://codemirror.net/6/docs/ref/#language.LanguageDescription.filename) patterns, 2299 + and then [extensions](https://codemirror.net/6/docs/ref/#language.LanguageDescription.extensions), 2300 + and return the first language that matches. 2301 + */},{key:"matchFilename",value:function matchFilename(descs,filename){var _iterator135=_createForOfIteratorHelper(descs),_step135;try{for(_iterator135.s();!(_step135=_iterator135.n()).done;){var _d2=_step135.value;if(_d2.filename&&_d2.filename.test(filename))return _d2;}}catch(err){_iterator135.e(err);}finally{_iterator135.f();}var ext=/\.([^.]+)$/.exec(filename);if(ext){var _iterator136=_createForOfIteratorHelper(descs),_step136;try{for(_iterator136.s();!(_step136=_iterator136.n()).done;){var d=_step136.value;if(d.extensions.indexOf(ext[1])>-1)return d;}}catch(err){_iterator136.e(err);}finally{_iterator136.f();}}return null;}/** 2302 + Look for a language whose name or alias matches the the given 2303 + name (case-insensitively). If `fuzzy` is true, and no direct 2304 + matchs is found, this'll also search for a language whose name 2305 + or alias occurs in the string (for names shorter than three 2306 + characters, only when surrounded by non-word characters). 2307 + */},{key:"matchLanguageName",value:function matchLanguageName(descs,name){var fuzzy=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;name=name.toLowerCase();var _iterator137=_createForOfIteratorHelper(descs),_step137;try{for(_iterator137.s();!(_step137=_iterator137.n()).done;){var _d3=_step137.value;if(_d3.alias.some(function(a){return a==name;}))return _d3;}}catch(err){_iterator137.e(err);}finally{_iterator137.f();}if(fuzzy){var _iterator138=_createForOfIteratorHelper(descs),_step138;try{for(_iterator138.s();!(_step138=_iterator138.n()).done;){var d=_step138.value;var _iterator139=_createForOfIteratorHelper(d.alias),_step139;try{for(_iterator139.s();!(_step139=_iterator139.n()).done;){var a=_step139.value;var found=name.indexOf(a);if(found>-1&&(a.length>2||!/\w/.test(name[found-1])&&!/\w/.test(name[found+a.length])))return d;}}catch(err){_iterator139.e(err);}finally{_iterator139.f();}}}catch(err){_iterator138.e(err);}finally{_iterator138.f();}}return null;}}]);return LanguageDescription;}();/** 2308 + Facet that defines a way to provide a function that computes the 2309 + appropriate indentation depth at the start of a given line, or 2310 + `null` to indicate no appropriate indentation could be determined. 2311 + */var indentService=state.Facet.define();/** 2312 + Facet for overriding the unit by which indentation happens. 2313 + Should be a string consisting either entirely of spaces or 2314 + entirely of tabs. When not set, this defaults to 2 spaces. 2315 + */var indentUnit=state.Facet.define({combine:function combine(values){if(!values.length)return" ";if(!/^(?: +|\t+)$/.test(values[0]))throw new Error("Invalid indent unit: "+JSON.stringify(values[0]));return values[0];}});/** 2316 + Return the _column width_ of an indent unit in the state. 2317 + Determined by the [`indentUnit`](https://codemirror.net/6/docs/ref/#language.indentUnit) 2318 + facet, and [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) when that 2319 + contains tabs. 2320 + */function getIndentUnit(state){var unit=state.facet(indentUnit);return unit.charCodeAt(0)==9?state.tabSize*unit.length:unit.length;}/** 2321 + Create an indentation string that covers columns 0 to `cols`. 2322 + Will use tabs for as much of the columns as possible when the 2323 + [`indentUnit`](https://codemirror.net/6/docs/ref/#language.indentUnit) facet contains 2324 + tabs. 2325 + */function indentString(state,cols){var result="",ts=state.tabSize;if(state.facet(indentUnit).charCodeAt(0)==9)while(cols>=ts){result+="\t";cols-=ts;}for(var _i66=0;_i66<cols;_i66++){result+=" ";}return result;}/** 2326 + Get the indentation at the given position. Will first consult any 2327 + [indent services](https://codemirror.net/6/docs/ref/#language.indentService) that are registered, 2328 + and if none of those return an indentation, this will check the 2329 + syntax tree for the [indent node prop](https://codemirror.net/6/docs/ref/#language.indentNodeProp) 2330 + and use that if found. Returns a number when an indentation could 2331 + be determined, and null otherwise. 2332 + */function getIndentation(context,pos){if(context instanceof state.EditorState)context=new IndentContext(context);var _iterator140=_createForOfIteratorHelper(context.state.facet(indentService)),_step140;try{for(_iterator140.s();!(_step140=_iterator140.n()).done;){var service=_step140.value;var result=service(context,pos);if(result!=null)return result;}}catch(err){_iterator140.e(err);}finally{_iterator140.f();}var tree=syntaxTree(context.state);return tree?syntaxIndentation(context,tree,pos):null;}/** 2333 + Indentation contexts are used when calling [indentation 2334 + services](https://codemirror.net/6/docs/ref/#language.indentService). They provide helper utilities 2335 + useful in indentation logic, and can selectively override the 2336 + indentation reported for some lines. 2337 + */var IndentContext=/*#__PURE__*/function(){/** 2338 + Create an indent context. 2339 + */function IndentContext(/** 2340 + The editor state. 2341 + */state){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};_classCallCheck(this,IndentContext);this.state=state;this.options=options;this.unit=getIndentUnit(state);}/** 2342 + Get a description of the line at the given position, taking 2343 + [simulated line 2344 + breaks](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak) 2345 + into account. If there is such a break at `pos`, the `bias` 2346 + argument determines whether the part of the line line before or 2347 + after the break is used. 2348 + */_createClass(IndentContext,[{key:"lineAt",value:function lineAt(pos){var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var line=this.state.doc.lineAt(pos);var simulateBreak=this.options.simulateBreak;if(simulateBreak!=null&&simulateBreak>=line.from&&simulateBreak<=line.to){if(bias<0?simulateBreak<pos:simulateBreak<=pos)return{text:line.text.slice(simulateBreak-line.from),from:simulateBreak};else return{text:line.text.slice(0,simulateBreak-line.from),from:line.from};}return line;}/** 2349 + Get the text directly after `pos`, either the entire line 2350 + or the next 100 characters, whichever is shorter. 2351 + */},{key:"textAfterPos",value:function textAfterPos(pos){var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;if(this.options.simulateDoubleBreak&&pos==this.options.simulateBreak)return"";var _this$lineAt=this.lineAt(pos,bias),text=_this$lineAt.text,from=_this$lineAt.from;return text.slice(pos-from,Math.min(text.length,pos+100-from));}/** 2352 + Find the column for the given position. 2353 + */},{key:"column",value:function column(pos){var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _this$lineAt2=this.lineAt(pos,bias),text=_this$lineAt2.text,from=_this$lineAt2.from;var result=this.countColumn(text,pos-from);var override=this.options.overrideIndentation?this.options.overrideIndentation(from):-1;if(override>-1)result+=override-this.countColumn(text,text.search(/\S|$/));return result;}/** 2354 + Find the column position (taking tabs into account) of the given 2355 + position in the given string. 2356 + */},{key:"countColumn",value:function countColumn(line){var pos=arguments.length>1&&arguments[1]!==undefined?arguments[1]:line.length;return text.countColumn(line,this.state.tabSize,pos);}/** 2357 + Find the indentation column of the line at the given point. 2358 + */},{key:"lineIndent",value:function lineIndent(pos){var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var _this$lineAt3=this.lineAt(pos,bias),text=_this$lineAt3.text,from=_this$lineAt3.from;var override=this.options.overrideIndentation;if(override){var overriden=override(from);if(overriden>-1)return overriden;}return this.countColumn(text,text.search(/\S|$/));}/** 2359 + Returns the [simulated line 2360 + break](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak) 2361 + for this context, if any. 2362 + */},{key:"simulatedBreak",get:function get(){return this.options.simulateBreak||null;}}]);return IndentContext;}();/** 2363 + A syntax tree node prop used to associate indentation strategies 2364 + with node types. Such a strategy is a function from an indentation 2365 + context to a column number or null, where null indicates that no 2366 + definitive indentation can be determined. 2367 + */var indentNodeProp=new common.NodeProp();// Compute the indentation for a given position from the syntax tree. 2368 + function syntaxIndentation(cx,ast,pos){return indentFrom(ast.resolveInner(pos).enterUnfinishedNodesBefore(pos),pos,cx);}function ignoreClosed(cx){return cx.pos==cx.options.simulateBreak&&cx.options.simulateDoubleBreak;}function indentStrategy(tree){var strategy=tree.type.prop(indentNodeProp);if(strategy)return strategy;var first=tree.firstChild,close;if(first&&(close=first.type.prop(common.NodeProp.closedBy))){var last=tree.lastChild,closed=last&&close.indexOf(last.name)>-1;return function(cx){return delimitedStrategy(cx,true,1,undefined,closed&&!ignoreClosed(cx)?last.from:undefined);};}return tree.parent==null?topIndent:null;}function indentFrom(node,pos,base){for(;node;node=node.parent){var strategy=indentStrategy(node);if(strategy)return strategy(new TreeIndentContext(base,pos,node));}return null;}function topIndent(){return 0;}/** 2369 + Objects of this type provide context information and helper 2370 + methods to indentation functions. 2371 + */var TreeIndentContext=/*#__PURE__*/function(_IndentContext){_inherits(TreeIndentContext,_IndentContext);var _super34=_createSuper(TreeIndentContext);/** 2372 + @internal 2373 + */function TreeIndentContext(base,/** 2374 + The position at which indentation is being computed. 2375 + */pos,/** 2376 + The syntax tree node to which the indentation strategy 2377 + applies. 2378 + */node){var _this70;_classCallCheck(this,TreeIndentContext);_this70=_super34.call(this,base.state,base.options);_this70.base=base;_this70.pos=pos;_this70.node=node;return _this70;}/** 2379 + Get the text directly after `this.pos`, either the entire line 2380 + or the next 100 characters, whichever is shorter. 2381 + */_createClass(TreeIndentContext,[{key:"textAfter",get:function get(){return this.textAfterPos(this.pos);}/** 2382 + Get the indentation at the reference line for `this.node`, which 2383 + is the line on which it starts, unless there is a node that is 2384 + _not_ a parent of this node covering the start of that line. If 2385 + so, the line at the start of that node is tried, again skipping 2386 + on if it is covered by another such node. 2387 + */},{key:"baseIndent",get:function get(){var line=this.state.doc.lineAt(this.node.from);// Skip line starts that are covered by a sibling (or cousin, etc) 2388 + for(;;){var atBreak=this.node.resolve(line.from);while(atBreak.parent&&atBreak.parent.from==atBreak.from){atBreak=atBreak.parent;}if(isParent(atBreak,this.node))break;line=this.state.doc.lineAt(atBreak.from);}return this.lineIndent(line.from);}/** 2389 + Continue looking for indentations in the node's parent nodes, 2390 + and return the result of that. 2391 + */},{key:"continue",value:function _continue(){var parent=this.node.parent;return parent?indentFrom(parent,this.pos,this.base):0;}}]);return TreeIndentContext;}(IndentContext);function isParent(parent,of){for(var cur=of;cur;cur=cur.parent){if(parent==cur)return true;}return false;}// Check whether a delimited node is aligned (meaning there are 2392 + // non-skipped nodes on the same line as the opening delimiter). And 2393 + // if so, return the opening token. 2394 + function bracketedAligned(context){var tree=context.node;var openToken=tree.childAfter(tree.from),last=tree.lastChild;if(!openToken)return null;var sim=context.options.simulateBreak;var openLine=context.state.doc.lineAt(openToken.from);var lineEnd=sim==null||sim<=openLine.from?openLine.to:Math.min(openLine.to,sim);for(var pos=openToken.to;;){var next=tree.childAfter(pos);if(!next||next==last)return null;if(!next.type.isSkipped)return next.from<lineEnd?openToken:null;pos=next.to;}}/** 2395 + An indentation strategy for delimited (usually bracketed) nodes. 2396 + Will, by default, indent one unit more than the parent's base 2397 + indent unless the line starts with a closing token. When `align` 2398 + is true and there are non-skipped nodes on the node's opening 2399 + line, the content of the node will be aligned with the end of the 2400 + opening node, like this: 2401 + 2402 + foo(bar, 2403 + baz) 2404 + */function delimitedIndent(_ref51){var closing=_ref51.closing,_ref51$align=_ref51.align,align=_ref51$align===void 0?true:_ref51$align,_ref51$units=_ref51.units,units=_ref51$units===void 0?1:_ref51$units;return function(context){return delimitedStrategy(context,align,units,closing);};}function delimitedStrategy(context,align,units,closing,closedAt){var after=context.textAfter,space=after.match(/^\s*/)[0].length;var closed=closing&&after.slice(space,space+closing.length)==closing||closedAt==context.pos+space;var aligned=align?bracketedAligned(context):null;if(aligned)return closed?context.column(aligned.from):context.column(aligned.to);return context.baseIndent+(closed?0:context.unit*units);}/** 2405 + An indentation strategy that aligns a node's content to its base 2406 + indentation. 2407 + */var flatIndent=function flatIndent(context){return context.baseIndent;};/** 2408 + Creates an indentation strategy that, by default, indents 2409 + continued lines one unit more than the node's base indentation. 2410 + You can provide `except` to prevent indentation of lines that 2411 + match a pattern (for example `/^else\b/` in `if`/`else` 2412 + constructs), and you can change the amount of units used with the 2413 + `units` option. 2414 + */function continuedIndent(){var _ref52=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},except=_ref52.except,_ref52$units=_ref52.units,units=_ref52$units===void 0?1:_ref52$units;return function(context){var matchExcept=except&&except.test(context.textAfter);return context.baseIndent+(matchExcept?0:units*context.unit);};}var DontIndentBeyond=200;/** 2415 + Enables reindentation on input. When a language defines an 2416 + `indentOnInput` field in its [language 2417 + data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt), which must hold a regular 2418 + expression, the line at the cursor will be reindented whenever new 2419 + text is typed and the input from the start of the line up to the 2420 + cursor matches that regexp. 2421 + 2422 + To avoid unneccesary reindents, it is recommended to start the 2423 + regexp with `^` (usually followed by `\s*`), and end it with `$`. 2424 + For example, `/^\s*\}$/` will reindent when a closing brace is 2425 + added at the start of a line. 2426 + */function indentOnInput(){return state.EditorState.transactionFilter.of(function(tr){if(!tr.docChanged||!tr.isUserEvent("input.type"))return tr;var rules=tr.startState.languageDataAt("indentOnInput",tr.startState.selection.main.head);if(!rules.length)return tr;var doc=tr.newDoc,head=tr.newSelection.main.head,line=doc.lineAt(head);if(head>line.from+DontIndentBeyond)return tr;var lineStart=doc.sliceString(line.from,head);if(!rules.some(function(r){return r.test(lineStart);}))return tr;var state=tr.state,last=-1,changes=[];var _iterator141=_createForOfIteratorHelper(state.selection.ranges),_step141;try{for(_iterator141.s();!(_step141=_iterator141.n()).done;){var _head=_step141.value.head;var _line4=state.doc.lineAt(_head);if(_line4.from==last)continue;last=_line4.from;var indent=getIndentation(state,_line4.from);if(indent==null)continue;var cur=/^\s*/.exec(_line4.text)[0];var norm=indentString(state,indent);if(cur!=norm)changes.push({from:_line4.from,to:_line4.from+cur.length,insert:norm});}}catch(err){_iterator141.e(err);}finally{_iterator141.f();}return changes.length?[tr,{changes:changes,sequential:true}]:tr;});}/** 2427 + A facet that registers a code folding service. When called with 2428 + the extent of a line, such a function should return a foldable 2429 + range that starts on that line (but continues beyond it), if one 2430 + can be found. 2431 + */var foldService=state.Facet.define();/** 2432 + This node prop is used to associate folding information with 2433 + syntax node types. Given a syntax node, it should check whether 2434 + that tree is foldable and return the range that can be collapsed 2435 + when it is. 2436 + */var foldNodeProp=new common.NodeProp();/** 2437 + [Fold](https://codemirror.net/6/docs/ref/#language.foldNodeProp) function that folds everything but 2438 + the first and the last child of a syntax node. Useful for nodes 2439 + that start and end with delimiters. 2440 + */function foldInside(node){var first=node.firstChild,last=node.lastChild;return first&&first.to<last.from?{from:first.to,to:last.type.isError?node.to:last.from}:null;}function syntaxFolding(state,start,end){var tree=syntaxTree(state);if(tree.length==0)return null;var inner=tree.resolveInner(end);var found=null;for(var cur=inner;cur;cur=cur.parent){if(cur.to<=end||cur.from>end)continue;if(found&&cur.from<start)break;var prop=cur.type.prop(foldNodeProp);if(prop){var value=prop(cur,state);if(value&&value.from<=end&&value.from>=start&&value.to>end)found=value;}}return found;}/** 2441 + Check whether the given line is foldable. First asks any fold 2442 + services registered through 2443 + [`foldService`](https://codemirror.net/6/docs/ref/#language.foldService), and if none of them return 2444 + a result, tries to query the [fold node 2445 + prop](https://codemirror.net/6/docs/ref/#language.foldNodeProp) of syntax nodes that cover the end 2446 + of the line. 2447 + */function foldable(state,lineStart,lineEnd){var _iterator142=_createForOfIteratorHelper(state.facet(foldService)),_step142;try{for(_iterator142.s();!(_step142=_iterator142.n()).done;){var service=_step142.value;var result=service(state,lineStart,lineEnd);if(result)return result;}}catch(err){_iterator142.e(err);}finally{_iterator142.f();}return syntaxFolding(state,lineStart,lineEnd);}exports.IndentContext=IndentContext;exports.LRLanguage=LRLanguage;exports.Language=Language;exports.LanguageDescription=LanguageDescription;exports.LanguageSupport=LanguageSupport;exports.ParseContext=ParseContext;exports.TreeIndentContext=TreeIndentContext;exports.continuedIndent=continuedIndent;exports.defineLanguageFacet=defineLanguageFacet;exports.delimitedIndent=delimitedIndent;exports.ensureSyntaxTree=ensureSyntaxTree;exports.flatIndent=flatIndent;exports.foldInside=foldInside;exports.foldNodeProp=foldNodeProp;exports.foldService=foldService;exports.foldable=foldable;exports.getIndentUnit=getIndentUnit;exports.getIndentation=getIndentation;exports.indentNodeProp=indentNodeProp;exports.indentOnInput=indentOnInput;exports.indentService=indentService;exports.indentString=indentString;exports.indentUnit=indentUnit;exports.language=language;exports.languageDataProp=languageDataProp;exports.syntaxParserRunning=syntaxParserRunning;exports.syntaxTree=syntaxTree;exports.syntaxTreeAvailable=syntaxTreeAvailable;},{"@codemirror/state":22,"@codemirror/text":24,"@codemirror/view":27,"@lezer/common":28}],14:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});function mlLike(parserConfig){var words={'as':'keyword','do':'keyword','else':'keyword','end':'keyword','exception':'keyword','fun':'keyword','functor':'keyword','if':'keyword','in':'keyword','include':'keyword','let':'keyword','of':'keyword','open':'keyword','rec':'keyword','struct':'keyword','then':'keyword','type':'keyword','val':'keyword','while':'keyword','with':'keyword'};var extraWords=parserConfig.extraWords||{};for(var prop in extraWords){if(extraWords.hasOwnProperty(prop)){words[prop]=parserConfig.extraWords[prop];}}var hintWords=[];for(var k in words){hintWords.push(k);}function tokenBase(stream,state){var ch=stream.next();if(ch==='"'){state.tokenize=tokenString;return state.tokenize(stream,state);}if(ch==='{'){if(stream.eat('|')){state.longString=true;state.tokenize=tokenLongString;return state.tokenize(stream,state);}}if(ch==='('){if(stream.eat('*')){state.commentLevel++;state.tokenize=tokenComment;return state.tokenize(stream,state);}}if(ch==='~'||ch==='?'){stream.eatWhile(/\w/);return'variableName.special';}if(ch==='`'){stream.eatWhile(/\w/);return'quote';}if(ch==='/'&&parserConfig.slashComments&&stream.eat('/')){stream.skipToEnd();return'comment';}if(/\d/.test(ch)){if(ch==='0'&&stream.eat(/[bB]/)){stream.eatWhile(/[01]/);}if(ch==='0'&&stream.eat(/[xX]/)){stream.eatWhile(/[0-9a-fA-F]/);}if(ch==='0'&&stream.eat(/[oO]/)){stream.eatWhile(/[0-7]/);}else{stream.eatWhile(/[\d_]/);if(stream.eat('.')){stream.eatWhile(/[\d]/);}if(stream.eat(/[eE]/)){stream.eatWhile(/[\d\-+]/);}}return'number';}if(/[+\-*&%=<>!?|@\.~:]/.test(ch)){return'operator';}if(/[\w\xa1-\uffff]/.test(ch)){stream.eatWhile(/[\w\xa1-\uffff]/);var cur=stream.current();return words.hasOwnProperty(cur)?words[cur]:'variable';}return null;}function tokenString(stream,state){var next,end=false,escaped=false;while((next=stream.next())!=null){if(next==='"'&&!escaped){end=true;break;}escaped=!escaped&&next==='\\';}if(end&&!escaped){state.tokenize=tokenBase;}return'string';}function tokenComment(stream,state){var prev,next;while(state.commentLevel>0&&(next=stream.next())!=null){if(prev==='('&&next==='*')state.commentLevel++;if(prev==='*'&&next===')')state.commentLevel--;prev=next;}if(state.commentLevel<=0){state.tokenize=tokenBase;}return'comment';}function tokenLongString(stream,state){var prev,next;while(state.longString&&(next=stream.next())!=null){if(prev==='|'&&next==='}')state.longString=false;prev=next;}if(!state.longString){state.tokenize=tokenBase;}return'string';}return{startState:function startState(){return{tokenize:tokenBase,commentLevel:0,longString:false};},token:function token(stream,state){if(stream.eatSpace())return null;return state.tokenize(stream,state);},languageData:{autocomplete:hintWords,commentTokens:{line:parserConfig.slashComments?"//":undefined,block:{open:"(*",close:"*)"}}}};}var oCaml=mlLike({extraWords:{'and':'keyword','assert':'keyword','begin':'keyword','class':'keyword','constraint':'keyword','done':'keyword','downto':'keyword','external':'keyword','function':'keyword','initializer':'keyword','lazy':'keyword','match':'keyword','method':'keyword','module':'keyword','mutable':'keyword','new':'keyword','nonrec':'keyword','object':'keyword','private':'keyword','sig':'keyword','to':'keyword','try':'keyword','value':'keyword','virtual':'keyword','when':'keyword',// builtins 2448 + 'raise':'builtin','failwith':'builtin','true':'builtin','false':'builtin',// Pervasives builtins 2449 + 'asr':'builtin','land':'builtin','lor':'builtin','lsl':'builtin','lsr':'builtin','lxor':'builtin','mod':'builtin','or':'builtin',// More Pervasives 2450 + 'raise_notrace':'builtin','trace':'builtin','exit':'builtin','print_string':'builtin','print_endline':'builtin','int':'type','float':'type','bool':'type','char':'type','string':'type','unit':'type',// Modules 2451 + 'List':'builtin'}});var fSharp=mlLike({extraWords:{'abstract':'keyword','assert':'keyword','base':'keyword','begin':'keyword','class':'keyword','default':'keyword','delegate':'keyword','do!':'keyword','done':'keyword','downcast':'keyword','downto':'keyword','elif':'keyword','extern':'keyword','finally':'keyword','for':'keyword','function':'keyword','global':'keyword','inherit':'keyword','inline':'keyword','interface':'keyword','internal':'keyword','lazy':'keyword','let!':'keyword','match':'keyword','member':'keyword','module':'keyword','mutable':'keyword','namespace':'keyword','new':'keyword','null':'keyword','override':'keyword','private':'keyword','public':'keyword','return!':'keyword','return':'keyword','select':'keyword','static':'keyword','to':'keyword','try':'keyword','upcast':'keyword','use!':'keyword','use':'keyword','void':'keyword','when':'keyword','yield!':'keyword','yield':'keyword',// Reserved words 2452 + 'atomic':'keyword','break':'keyword','checked':'keyword','component':'keyword','const':'keyword','constraint':'keyword','constructor':'keyword','continue':'keyword','eager':'keyword','event':'keyword','external':'keyword','fixed':'keyword','method':'keyword','mixin':'keyword','object':'keyword','parallel':'keyword','process':'keyword','protected':'keyword','pure':'keyword','sealed':'keyword','tailcall':'keyword','trait':'keyword','virtual':'keyword','volatile':'keyword',// builtins 2453 + 'List':'builtin','Seq':'builtin','Map':'builtin','Set':'builtin','Option':'builtin','int':'builtin','string':'builtin','not':'builtin','true':'builtin','false':'builtin','raise':'builtin','failwith':'builtin'},slashComments:true});var sml=mlLike({extraWords:{'abstype':'keyword','and':'keyword','andalso':'keyword','case':'keyword','datatype':'keyword','fn':'keyword','handle':'keyword','infix':'keyword','infixr':'keyword','local':'keyword','nonfix':'keyword','op':'keyword','orelse':'keyword','raise':'keyword','withtype':'keyword','eqtype':'keyword','sharing':'keyword','sig':'keyword','signature':'keyword','structure':'keyword','where':'keyword','true':'keyword','false':'keyword',// types 2454 + 'int':'builtin','real':'builtin','string':'builtin','char':'builtin','bool':'builtin'},slashComments:true});exports.fSharp=fSharp;exports.oCaml=oCaml;exports.sml=sml;},{}],15:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var view=require('@codemirror/view');var state=require('@codemirror/state');var tooltip=require('@codemirror/tooltip');var panel=require('@codemirror/panel');var gutter=require('@codemirror/gutter');var rangeset=require('@codemirror/rangeset');var elt=require('crelt');function _interopDefaultLegacy(e){return e&&_typeof(e)==='object'&&'default'in e?e:{'default':e};}var elt__default=/*#__PURE__*/_interopDefaultLegacy(elt);var SelectedDiagnostic=/*#__PURE__*/_createClass(function SelectedDiagnostic(from,to,diagnostic){_classCallCheck(this,SelectedDiagnostic);this.from=from;this.to=to;this.diagnostic=diagnostic;});var LintState=/*#__PURE__*/function(){function LintState(diagnostics,panel,selected){_classCallCheck(this,LintState);this.diagnostics=diagnostics;this.panel=panel;this.selected=selected;}_createClass(LintState,null,[{key:"init",value:function init(diagnostics,panel,state){var ranges=view.Decoration.set(diagnostics.map(function(d){// For zero-length ranges or ranges covering only a line break, create a widget 2455 + return d.from==d.to||d.from==d.to-1&&state.doc.lineAt(d.from).to==d.from?view.Decoration.widget({widget:new DiagnosticWidget(d),diagnostic:d}).range(d.from):view.Decoration.mark({attributes:{"class":"cm-lintRange cm-lintRange-"+d.severity},diagnostic:d}).range(d.from,d.to);}),true);return new LintState(ranges,panel,findDiagnostic(ranges));}}]);return LintState;}();function findDiagnostic(diagnostics){var diagnostic=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var after=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var found=null;diagnostics.between(after,1e9,function(from,to,_ref53){var spec=_ref53.spec;if(diagnostic&&spec.diagnostic!=diagnostic)return;found=new SelectedDiagnostic(from,to,spec.diagnostic);return false;});return found;}function maybeEnableLint(state$1,effects){return state$1.field(lintState,false)?effects:effects.concat(state.StateEffect.appendConfig.of([lintState,view.EditorView.decorations.compute([lintState],function(state){var _state$field=state.field(lintState),selected=_state$field.selected,panel=_state$field.panel;return!selected||!panel||selected.from==selected.to?view.Decoration.none:view.Decoration.set([activeMark.range(selected.from,selected.to)]);}),tooltip.hoverTooltip(lintTooltip),baseTheme]));}/** 2456 + Returns a transaction spec which updates the current set of 2457 + diagnostics, and enables the lint extension if if wasn't already 2458 + active. 2459 + */function setDiagnostics(state,diagnostics){return{effects:maybeEnableLint(state,[setDiagnosticsEffect.of(diagnostics)])};}/** 2460 + The state effect that updates the set of active diagnostics. Can 2461 + be useful when writing an extension that needs to track these. 2462 + */var setDiagnosticsEffect=state.StateEffect.define();var togglePanel=state.StateEffect.define();var movePanelSelection=state.StateEffect.define();var lintState=state.StateField.define({create:function create(){return new LintState(view.Decoration.none,null,null);},update:function update(value,tr){if(tr.docChanged){var mapped=value.diagnostics.map(tr.changes),selected=null;if(value.selected){var selPos=tr.changes.mapPos(value.selected.from,1);selected=findDiagnostic(mapped,value.selected.diagnostic,selPos)||findDiagnostic(mapped,null,selPos);}value=new LintState(mapped,value.panel,selected);}var _iterator143=_createForOfIteratorHelper(tr.effects),_step143;try{for(_iterator143.s();!(_step143=_iterator143.n()).done;){var effect=_step143.value;if(effect.is(setDiagnosticsEffect)){value=LintState.init(effect.value,value.panel,tr.state);}else if(effect.is(togglePanel)){value=new LintState(value.diagnostics,effect.value?LintPanel.open:null,value.selected);}else if(effect.is(movePanelSelection)){value=new LintState(value.diagnostics,value.panel,effect.value);}}}catch(err){_iterator143.e(err);}finally{_iterator143.f();}return value;},provide:function provide(f){return[panel.showPanel.from(f,function(val){return val.panel;}),view.EditorView.decorations.from(f,function(s){return s.diagnostics;})];}});/** 2463 + Returns the number of active lint diagnostics in the given state. 2464 + */function diagnosticCount(state){var lint=state.field(lintState,false);return lint?lint.diagnostics.size:0;}var activeMark=view.Decoration.mark({"class":"cm-lintRange cm-lintRange-active"});function lintTooltip(view,pos,side){var _view$state$field=view.state.field(lintState),diagnostics=_view$state$field.diagnostics;var found=[],stackStart=2e8,stackEnd=0;diagnostics.between(pos-(side<0?1:0),pos+(side>0?1:0),function(from,to,_ref54){var spec=_ref54.spec;if(pos>=from&&pos<=to&&(from==to||(pos>from||side>0)&&(pos<to||side<0))){found.push(spec.diagnostic);stackStart=Math.min(from,stackStart);stackEnd=Math.max(to,stackEnd);}});if(!found.length)return null;return{pos:stackStart,end:stackEnd,above:view.state.doc.lineAt(stackStart).to<stackEnd,create:function create(){return{dom:diagnosticsTooltip(view,found)};}};}function diagnosticsTooltip(view,diagnostics){return elt__default['default']("ul",{"class":"cm-tooltip-lint"},diagnostics.map(function(d){return renderDiagnostic(view,d,false);}));}/** 2465 + Command to open and focus the lint panel. 2466 + */var openLintPanel=function openLintPanel(view){var field=view.state.field(lintState,false);if(!field||!field.panel)view.dispatch({effects:maybeEnableLint(view.state,[togglePanel.of(true)])});var panel$1=panel.getPanel(view,LintPanel.open);if(panel$1)panel$1.dom.querySelector(".cm-panel-lint ul").focus();return true;};/** 2467 + Command to close the lint panel, when open. 2468 + */var closeLintPanel=function closeLintPanel(view){var field=view.state.field(lintState,false);if(!field||!field.panel)return false;view.dispatch({effects:togglePanel.of(false)});return true;};/** 2469 + Move the selection to the next diagnostic. 2470 + */var nextDiagnostic=function nextDiagnostic(view){var field=view.state.field(lintState,false);if(!field)return false;var sel=view.state.selection.main,next=field.diagnostics.iter(sel.to+1);if(!next.value){next=field.diagnostics.iter(0);if(!next.value||next.from==sel.from&&next.to==sel.to)return false;}view.dispatch({selection:{anchor:next.from,head:next.to},scrollIntoView:true});return true;};/** 2471 + A set of default key bindings for the lint functionality. 2472 + 2473 + - Ctrl-Shift-m (Cmd-Shift-m on macOS): [`openLintPanel`](https://codemirror.net/6/docs/ref/#lint.openLintPanel) 2474 + - F8: [`nextDiagnostic`](https://codemirror.net/6/docs/ref/#lint.nextDiagnostic) 2475 + */var lintKeymap=[{key:"Mod-Shift-m",run:openLintPanel},{key:"F8",run:nextDiagnostic}];var lintPlugin=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function _class15(view){_classCallCheck(this,_class15);this.view=view;this.timeout=-1;this.set=true;var _view$state$facet=view.state.facet(lintSource),delay=_view$state$facet.delay;this.lintTime=Date.now()+delay;this.run=this.run.bind(this);this.timeout=setTimeout(this.run,delay);}_createClass(_class15,[{key:"run",value:function run(){var _this71=this;var now=Date.now();if(now<this.lintTime-10){setTimeout(this.run,this.lintTime-now);}else{this.set=false;var _state2=this.view.state,_state2$facet=_state2.facet(lintSource),sources=_state2$facet.sources;Promise.all(sources.map(function(source){return Promise.resolve(source(_this71.view));})).then(function(annotations){var _a,_b;var all=annotations.reduce(function(a,b){return a.concat(b);});if(_this71.view.state.doc==_state2.doc&&(all.length||((_b=(_a=_this71.view.state.field(lintState,false))===null||_a===void 0?void 0:_a.diagnostics)===null||_b===void 0?void 0:_b.size)))_this71.view.dispatch(setDiagnostics(_this71.view.state,all));},function(error){view.logException(_this71.view.state,error);});}}},{key:"update",value:function update(_update18){var source=_update18.state.facet(lintSource);if(_update18.docChanged||source!=_update18.startState.facet(lintSource)){this.lintTime=Date.now()+source.delay;if(!this.set){this.set=true;this.timeout=setTimeout(this.run,source.delay);}}}},{key:"force",value:function force(){if(this.set){this.lintTime=Date.now();this.run();}}},{key:"destroy",value:function destroy(){clearTimeout(this.timeout);}}]);return _class15;}());var lintSource=state.Facet.define({combine:function combine(input){return{sources:input.map(function(i){return i.source;}),delay:input.length?Math.max.apply(Math,_toConsumableArray(input.map(function(i){return i.delay;}))):750};},enables:lintPlugin});/** 2476 + Given a diagnostic source, this function returns an extension that 2477 + enables linting with that source. It will be called whenever the 2478 + editor is idle (after its content changed). 2479 + */function linter(source){var config=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var _a;return lintSource.of({source:source,delay:(_a=config.delay)!==null&&_a!==void 0?_a:750});}/** 2480 + Forces any linters [configured](https://codemirror.net/6/docs/ref/#lint.linter) to run when the 2481 + editor is idle to run right away. 2482 + */function forceLinting(view){var plugin=view.plugin(lintPlugin);if(plugin)plugin.force();}function assignKeys(actions){var assigned=[];if(actions){var _iterator144=_createForOfIteratorHelper(actions),_step144;try{actions:for(_iterator144.s();!(_step144=_iterator144.n()).done;){var name=_step144.value.name;var _loop15=function _loop15(_i67){var ch=name[_i67];if(/[a-zA-Z]/.test(ch)&&!assigned.some(function(c){return c.toLowerCase()==ch.toLowerCase();})){assigned.push(ch);return"continue|actions";}};for(var _i67=0;_i67<name.length;_i67++){var _ret4=_loop15(_i67);if(_ret4==="continue|actions")continue actions;}assigned.push("");}}catch(err){_iterator144.e(err);}finally{_iterator144.f();}}return assigned;}function renderDiagnostic(view,diagnostic,inPanel){var _a;var keys=inPanel?assignKeys(diagnostic.actions):[];return elt__default['default']("li",{"class":"cm-diagnostic cm-diagnostic-"+diagnostic.severity},elt__default['default']("span",{"class":"cm-diagnosticText"},diagnostic.message),(_a=diagnostic.actions)===null||_a===void 0?void 0:_a.map(function(action,i){var click=function click(e){e.preventDefault();var found=findDiagnostic(view.state.field(lintState).diagnostics,diagnostic);if(found)action.apply(view,found.from,found.to);};var name=action.name,keyIndex=keys[i]?name.indexOf(keys[i]):-1;var nameElt=keyIndex<0?name:[name.slice(0,keyIndex),elt__default['default']("u",name.slice(keyIndex,keyIndex+1)),name.slice(keyIndex+1)];return elt__default['default']("button",{type:"button","class":"cm-diagnosticAction",onclick:click,onmousedown:click,"aria-label":" Action: ".concat(name).concat(keyIndex<0?"":" (access key \"".concat(keys[i],")\""),".")},nameElt);}),diagnostic.source&&elt__default['default']("div",{"class":"cm-diagnosticSource"},diagnostic.source));}var DiagnosticWidget=/*#__PURE__*/function(_view$WidgetType3){_inherits(DiagnosticWidget,_view$WidgetType3);var _super35=_createSuper(DiagnosticWidget);function DiagnosticWidget(diagnostic){var _this72;_classCallCheck(this,DiagnosticWidget);_this72=_super35.call(this);_this72.diagnostic=diagnostic;return _this72;}_createClass(DiagnosticWidget,[{key:"eq",value:function eq(other){return other.diagnostic==this.diagnostic;}},{key:"toDOM",value:function toDOM(){return elt__default['default']("span",{"class":"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity});}}]);return DiagnosticWidget;}(view.WidgetType);var PanelItem=/*#__PURE__*/_createClass(function PanelItem(view,diagnostic){_classCallCheck(this,PanelItem);this.diagnostic=diagnostic;this.id="item_"+Math.floor(Math.random()*0xffffffff).toString(16);this.dom=renderDiagnostic(view,diagnostic,true);this.dom.id=this.id;this.dom.setAttribute("role","option");});var LintPanel=/*#__PURE__*/function(){function LintPanel(view){var _this73=this;_classCallCheck(this,LintPanel);this.view=view;this.items=[];var onkeydown=function onkeydown(event){if(event.keyCode==27){// Escape 2483 + closeLintPanel(_this73.view);_this73.view.focus();}else if(event.keyCode==38||event.keyCode==33){// ArrowUp, PageUp 2484 + _this73.moveSelection((_this73.selectedIndex-1+_this73.items.length)%_this73.items.length);}else if(event.keyCode==40||event.keyCode==34){// ArrowDown, PageDown 2485 + _this73.moveSelection((_this73.selectedIndex+1)%_this73.items.length);}else if(event.keyCode==36){// Home 2486 + _this73.moveSelection(0);}else if(event.keyCode==35){// End 2487 + _this73.moveSelection(_this73.items.length-1);}else if(event.keyCode==13){// Enter 2488 + _this73.view.focus();}else if(event.keyCode>=65&&event.keyCode<=90&&_this73.selectedIndex>=0){// A-Z 2489 + var diagnostic=_this73.items[_this73.selectedIndex].diagnostic,keys=assignKeys(diagnostic.actions);for(var _i68=0;_i68<keys.length;_i68++){if(keys[_i68].toUpperCase().charCodeAt(0)==event.keyCode){var found=findDiagnostic(_this73.view.state.field(lintState).diagnostics,diagnostic);if(found)diagnostic.actions[_i68].apply(view,found.from,found.to);}}}else{return;}event.preventDefault();};var onclick=function onclick(event){for(var _i69=0;_i69<_this73.items.length;_i69++){if(_this73.items[_i69].dom.contains(event.target))_this73.moveSelection(_i69);}};this.list=elt__default['default']("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:onkeydown,onclick:onclick});this.dom=elt__default['default']("div",{"class":"cm-panel-lint"},this.list,elt__default['default']("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:function onclick(){return closeLintPanel(_this73.view);}},"×"));this.update();}_createClass(LintPanel,[{key:"selectedIndex",get:function get(){var selected=this.view.state.field(lintState).selected;if(!selected)return-1;for(var _i70=0;_i70<this.items.length;_i70++){if(this.items[_i70].diagnostic==selected.diagnostic)return _i70;}return-1;}},{key:"update",value:function update(){var _this74=this;var _this$view$state$fiel=this.view.state.field(lintState),diagnostics=_this$view$state$fiel.diagnostics,selected=_this$view$state$fiel.selected;var i=0,needsSync=false,newSelectedItem=null;diagnostics.between(0,this.view.state.doc.length,function(_start,_end,_ref55){var spec=_ref55.spec;var found=-1,item;for(var j=i;j<_this74.items.length;j++){if(_this74.items[j].diagnostic==spec.diagnostic){found=j;break;}}if(found<0){item=new PanelItem(_this74.view,spec.diagnostic);_this74.items.splice(i,0,item);needsSync=true;}else{item=_this74.items[found];if(found>i){_this74.items.splice(i,found-i);needsSync=true;}}if(selected&&item.diagnostic==selected.diagnostic){if(!item.dom.hasAttribute("aria-selected")){item.dom.setAttribute("aria-selected","true");newSelectedItem=item;}}else if(item.dom.hasAttribute("aria-selected")){item.dom.removeAttribute("aria-selected");}i++;});while(i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0)){needsSync=true;this.items.pop();}if(this.items.length==0){this.items.push(new PanelItem(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")}));needsSync=true;}if(newSelectedItem){this.list.setAttribute("aria-activedescendant",newSelectedItem.id);this.view.requestMeasure({key:this,read:function read(){return{sel:newSelectedItem.dom.getBoundingClientRect(),panel:_this74.list.getBoundingClientRect()};},write:function write(_ref56){var sel=_ref56.sel,panel=_ref56.panel;if(sel.top<panel.top)_this74.list.scrollTop-=panel.top-sel.top;else if(sel.bottom>panel.bottom)_this74.list.scrollTop+=sel.bottom-panel.bottom;}});}else if(this.selectedIndex<0){this.list.removeAttribute("aria-activedescendant");}if(needsSync)this.sync();}},{key:"sync",value:function sync(){var domPos=this.list.firstChild;function rm(){var prev=domPos;domPos=prev.nextSibling;prev.remove();}var _iterator145=_createForOfIteratorHelper(this.items),_step145;try{for(_iterator145.s();!(_step145=_iterator145.n()).done;){var item=_step145.value;if(item.dom.parentNode==this.list){while(domPos!=item.dom){rm();}domPos=item.dom.nextSibling;}else{this.list.insertBefore(item.dom,domPos);}}}catch(err){_iterator145.e(err);}finally{_iterator145.f();}while(domPos){rm();}}},{key:"moveSelection",value:function moveSelection(selectedIndex){if(this.selectedIndex<0)return;var field=this.view.state.field(lintState);var selection=findDiagnostic(field.diagnostics,this.items[selectedIndex].diagnostic);if(!selection)return;this.view.dispatch({selection:{anchor:selection.from,head:selection.to},scrollIntoView:true,effects:movePanelSelection.of(selection)});}}],[{key:"open",value:function open(view){return new LintPanel(view);}}]);return LintPanel;}();function svg(content){var attrs=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"viewBox=\"0 0 40 40\"";return"url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" ".concat(attrs,">").concat(encodeURIComponent(content),"</svg>')");}function underline(color){return svg("<path d=\"m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0\" stroke=\"".concat(color,"\" fill=\"none\" stroke-width=\".7\"/>"),"width=\"6\" height=\"3\"");}var baseTheme=view.EditorView.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:underline("#d11")},".cm-lintRange-warning":{backgroundImage:underline("orange")},".cm-lintRange-info":{backgroundImage:underline("#999")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});var LintGutterMarker=/*#__PURE__*/function(_gutter$GutterMarker2){_inherits(LintGutterMarker,_gutter$GutterMarker2);var _super36=_createSuper(LintGutterMarker);function LintGutterMarker(diagnostics){var _this75;_classCallCheck(this,LintGutterMarker);_this75=_super36.call(this);_this75.diagnostics=diagnostics;_this75.severity=diagnostics.reduce(function(max,d){var s=d.severity;return s=="error"||s=="warning"&&max=="info"?s:max;},"info");return _this75;}_createClass(LintGutterMarker,[{key:"toDOM",value:function toDOM(view){var _this76=this;var elt=document.createElement("div");elt.className="cm-lint-marker cm-lint-marker-"+this.severity;elt.onmouseover=function(){return gutterMarkerMouseOver(view,elt,_this76.diagnostics);};return elt;}}]);return LintGutterMarker;}(gutter.GutterMarker);function trackHoverOn(view,marker){var mousemove=function mousemove(event){var rect=marker.getBoundingClientRect();if(event.clientX>rect.left-10/* Margin */&&event.clientX<rect.right+10/* Margin */&&event.clientY>rect.top-10/* Margin */&&event.clientY<rect.bottom+10/* Margin */)return;for(var target=event.target;target;target=target.parentNode){if(target.nodeType==1&&target.classList.contains("cm-tooltip-lint"))return;}window.removeEventListener("mousemove",mousemove);if(view.state.field(lintGutterTooltip))view.dispatch({effects:setLintGutterTooltip.of(null)});};window.addEventListener("mousemove",mousemove);}function gutterMarkerMouseOver(view,marker,diagnostics){function hovered(){var line=view.visualLineAtHeight(marker.getBoundingClientRect().top+5);var linePos=view.coordsAtPos(line.from),markerRect=marker.getBoundingClientRect();if(linePos){view.dispatch({effects:setLintGutterTooltip.of({pos:line.from,above:false,create:function create(){return{dom:diagnosticsTooltip(view,diagnostics),offset:{x:markerRect.left-linePos.left,y:0}};}})});}marker.onmouseout=marker.onmousemove=null;trackHoverOn(view,marker);}var hoverTimeout=setTimeout(hovered,600/* Time */);marker.onmouseout=function(){clearTimeout(hoverTimeout);marker.onmouseout=marker.onmousemove=null;};marker.onmousemove=function(){clearTimeout(hoverTimeout);hoverTimeout=setTimeout(hovered,600/* Time */);};}function markersForDiagnostics(doc,diagnostics){var byLine=Object.create(null);var _iterator146=_createForOfIteratorHelper(diagnostics),_step146;try{for(_iterator146.s();!(_step146=_iterator146.n()).done;){var diagnostic=_step146.value;var _line5=doc.lineAt(diagnostic.from);(byLine[_line5.from]||(byLine[_line5.from]=[])).push(diagnostic);}}catch(err){_iterator146.e(err);}finally{_iterator146.f();}var markers=[];for(var line in byLine){markers.push(new LintGutterMarker(byLine[line]).range(+line));}return rangeset.RangeSet.of(markers,true);}var lintGutterExtension=gutter.gutter({"class":"cm-gutter-lint",markers:function markers(view){return view.state.field(lintGutterMarkers);}});var lintGutterMarkers=state.StateField.define({create:function create(){return rangeset.RangeSet.empty;},update:function update(markers,tr){markers=markers.map(tr.changes);var _iterator147=_createForOfIteratorHelper(tr.effects),_step147;try{for(_iterator147.s();!(_step147=_iterator147.n()).done;){var effect=_step147.value;if(effect.is(setDiagnosticsEffect)){markers=markersForDiagnostics(tr.state.doc,effect.value);}}}catch(err){_iterator147.e(err);}finally{_iterator147.f();}return markers;}});var setLintGutterTooltip=state.StateEffect.define();var lintGutterTooltip=state.StateField.define({create:function create(){return null;},update:function update(tooltip,tr){if(tooltip&&tr.docChanged)tooltip=Object.assign(Object.assign({},tooltip),{pos:tr.changes.mapPos(tooltip.pos)});return tr.effects.reduce(function(t,e){return e.is(setLintGutterTooltip)?e.value:t;},tooltip);},provide:function provide(field){return tooltip.showTooltip.from(field);}});var lintGutterTheme=view.EditorView.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:"0 .2em",display:"flex",flexDirection:"column",justifyContent:"center"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:svg("<path fill=\"#aaf\" stroke=\"#77e\" stroke-width=\"6\" stroke-linejoin=\"round\" d=\"M5 5L35 5L35 35L5 35Z\"/>")},".cm-lint-marker-warning":{content:svg("<path fill=\"#fe8\" stroke=\"#fd7\" stroke-width=\"6\" stroke-linejoin=\"round\" d=\"M20 6L37 35L3 35Z\"/>")},".cm-lint-marker-error:before":{content:svg("<circle cx=\"20\" cy=\"20\" r=\"15\" fill=\"#f87\" stroke=\"#f43\" stroke-width=\"6\"/>")}});/** 2490 + Returns an extension that installs a gutter showing markers for 2491 + each line that has diagnostics, which can be hovered over to see 2492 + the diagnostics. 2493 + */function lintGutter(){return[lintGutterMarkers,lintGutterExtension,lintGutterTheme,lintGutterTooltip];}exports.closeLintPanel=closeLintPanel;exports.diagnosticCount=diagnosticCount;exports.forceLinting=forceLinting;exports.lintGutter=lintGutter;exports.lintKeymap=lintKeymap;exports.linter=linter;exports.nextDiagnostic=nextDiagnostic;exports.openLintPanel=openLintPanel;exports.setDiagnostics=setDiagnostics;exports.setDiagnosticsEffect=setDiagnosticsEffect;},{"@codemirror/gutter":9,"@codemirror/panel":17,"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/tooltip":26,"@codemirror/view":27,"crelt":29}],16:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');var language=require('@codemirror/language');var view=require('@codemirror/view');var common=require('@lezer/common');var baseTheme=view.EditorView.baseTheme({".cm-matchingBracket":{backgroundColor:"#328c8252"},".cm-nonmatchingBracket":{backgroundColor:"#bb555544"}});var DefaultScanDist=10000,DefaultBrackets="()[]{}";var bracketMatchingConfig=state.Facet.define({combine:function combine(configs){return state.combineConfig(configs,{afterCursor:true,brackets:DefaultBrackets,maxScanDistance:DefaultScanDist});}});var matchingMark=view.Decoration.mark({"class":"cm-matchingBracket"}),nonmatchingMark=view.Decoration.mark({"class":"cm-nonmatchingBracket"});var bracketMatchingState=state.StateField.define({create:function create(){return view.Decoration.none;},update:function update(deco,tr){if(!tr.docChanged&&!tr.selection)return deco;var decorations=[];var config=tr.state.facet(bracketMatchingConfig);var _iterator148=_createForOfIteratorHelper(tr.state.selection.ranges),_step148;try{for(_iterator148.s();!(_step148=_iterator148.n()).done;){var range=_step148.value;if(!range.empty)continue;var match=matchBrackets(tr.state,range.head,-1,config)||range.head>0&&matchBrackets(tr.state,range.head-1,1,config)||config.afterCursor&&(matchBrackets(tr.state,range.head,1,config)||range.head<tr.state.doc.length&&matchBrackets(tr.state,range.head+1,-1,config));if(!match)continue;var mark=match.matched?matchingMark:nonmatchingMark;decorations.push(mark.range(match.start.from,match.start.to));if(match.end)decorations.push(mark.range(match.end.from,match.end.to));}}catch(err){_iterator148.e(err);}finally{_iterator148.f();}return view.Decoration.set(decorations,true);},provide:function provide(f){return view.EditorView.decorations.from(f);}});var bracketMatchingUnique=[bracketMatchingState,baseTheme];/** 2494 + Create an extension that enables bracket matching. Whenever the 2495 + cursor is next to a bracket, that bracket and the one it matches 2496 + are highlighted. Or, when no matching bracket is found, another 2497 + highlighting style is used to indicate this. 2498 + */function bracketMatching(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[bracketMatchingConfig.of(config),bracketMatchingUnique];}function matchingNodes(node,dir,brackets){var byProp=node.prop(dir<0?common.NodeProp.openedBy:common.NodeProp.closedBy);if(byProp)return byProp;if(node.name.length==1){var index=brackets.indexOf(node.name);if(index>-1&&index%2==(dir<0?1:0))return[brackets[index+dir]];}return null;}/** 2499 + Find the matching bracket for the token at `pos`, scanning 2500 + direction `dir`. Only the `brackets` and `maxScanDistance` 2501 + properties are used from `config`, if given. Returns null if no 2502 + bracket was found at `pos`, or a match result otherwise. 2503 + */function matchBrackets(state,pos,dir){var config=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var maxScanDistance=config.maxScanDistance||DefaultScanDist,brackets=config.brackets||DefaultBrackets;var tree=language.syntaxTree(state),node=tree.resolveInner(pos,dir);for(var cur=node;cur;cur=cur.parent){var matches=matchingNodes(cur.type,dir,brackets);if(matches&&cur.from<cur.to)return matchMarkedBrackets(state,pos,dir,cur,matches,brackets);}return matchPlainBrackets(state,pos,dir,tree,node.type,maxScanDistance,brackets);}function matchMarkedBrackets(_state,_pos,dir,token,matching,brackets){var parent=token.parent,firstToken={from:token.from,to:token.to};var depth=0,cursor=parent===null||parent===void 0?void 0:parent.cursor;if(cursor&&(dir<0?cursor.childBefore(token.from):cursor.childAfter(token.to)))do{if(dir<0?cursor.to<=token.from:cursor.from>=token.to){if(depth==0&&matching.indexOf(cursor.type.name)>-1&&cursor.from<cursor.to){return{start:firstToken,end:{from:cursor.from,to:cursor.to},matched:true};}else if(matchingNodes(cursor.type,dir,brackets)){depth++;}else if(matchingNodes(cursor.type,-dir,brackets)){depth--;if(depth==0)return{start:firstToken,end:cursor.from==cursor.to?undefined:{from:cursor.from,to:cursor.to},matched:false};}}}while(dir<0?cursor.prevSibling():cursor.nextSibling());return{start:firstToken,matched:false};}function matchPlainBrackets(state,pos,dir,tree,tokenType,maxScanDistance,brackets){var startCh=dir<0?state.sliceDoc(pos-1,pos):state.sliceDoc(pos,pos+1);var bracket=brackets.indexOf(startCh);if(bracket<0||bracket%2==0!=dir>0)return null;var startToken={from:dir<0?pos-1:pos,to:dir>0?pos+1:pos};var iter=state.doc.iterRange(pos,dir>0?state.doc.length:0),depth=0;for(var distance=0;!iter.next().done&&distance<=maxScanDistance;){var text=iter.value;if(dir<0)distance+=text.length;var basePos=pos+distance*dir;for(var _pos2=dir>0?0:text.length-1,end=dir>0?text.length:-1;_pos2!=end;_pos2+=dir){var found=brackets.indexOf(text[_pos2]);if(found<0||tree.resolve(basePos+_pos2,1).type!=tokenType)continue;if(found%2==0==dir>0){depth++;}else if(depth==1){// Closing 2504 + return{start:startToken,end:{from:basePos+_pos2,to:basePos+_pos2+1},matched:found>>1==bracket>>1};}else{depth--;}}if(dir>0)distance+=text.length;}return iter.done?{start:startToken,matched:false}:null;}exports.bracketMatching=bracketMatching;exports.matchBrackets=matchBrackets;},{"@codemirror/language":13,"@codemirror/state":22,"@codemirror/view":27,"@lezer/common":28}],17:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var view=require('@codemirror/view');var state=require('@codemirror/state');var panelConfig=state.Facet.define({combine:function combine(configs){var topContainer,bottomContainer;var _iterator149=_createForOfIteratorHelper(configs),_step149;try{for(_iterator149.s();!(_step149=_iterator149.n()).done;){var c=_step149.value;topContainer=topContainer||c.topContainer;bottomContainer=bottomContainer||c.bottomContainer;}}catch(err){_iterator149.e(err);}finally{_iterator149.f();}return{topContainer:topContainer,bottomContainer:bottomContainer};}});/** 2505 + Configures the panel-managing extension. 2506 + */function panels(config){return config?[panelConfig.of(config)]:[];}/** 2507 + Get the active panel created by the given constructor, if any. 2508 + This can be useful when you need access to your panels' DOM 2509 + structure. 2510 + */function getPanel(view,panel){var plugin=view.plugin(panelPlugin);var index=plugin?plugin.specs.indexOf(panel):-1;return index>-1?plugin.panels[index]:null;}var panelPlugin=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function _class16(view){_classCallCheck(this,_class16);this.input=view.state.facet(showPanel);this.specs=this.input.filter(function(s){return s;});this.panels=this.specs.map(function(spec){return spec(view);});var conf=view.state.facet(panelConfig);this.top=new PanelGroup(view,true,conf.topContainer);this.bottom=new PanelGroup(view,false,conf.bottomContainer);this.top.sync(this.panels.filter(function(p){return p.top;}));this.bottom.sync(this.panels.filter(function(p){return!p.top;}));var _iterator150=_createForOfIteratorHelper(this.panels),_step150;try{for(_iterator150.s();!(_step150=_iterator150.n()).done;){var p=_step150.value;p.dom.classList.add("cm-panel");if(p.mount)p.mount();}}catch(err){_iterator150.e(err);}finally{_iterator150.f();}}_createClass(_class16,[{key:"update",value:function update(_update19){var conf=_update19.state.facet(panelConfig);if(this.top.container!=conf.topContainer){this.top.sync([]);this.top=new PanelGroup(_update19.view,true,conf.topContainer);}if(this.bottom.container!=conf.bottomContainer){this.bottom.sync([]);this.bottom=new PanelGroup(_update19.view,false,conf.bottomContainer);}this.top.syncClasses();this.bottom.syncClasses();var input=_update19.state.facet(showPanel);if(input!=this.input){var specs=input.filter(function(x){return x;});var _panels=[],top=[],bottom=[],mount=[];var _iterator151=_createForOfIteratorHelper(specs),_step151;try{for(_iterator151.s();!(_step151=_iterator151.n()).done;){var spec=_step151.value;var known=this.specs.indexOf(spec),panel=void 0;if(known<0){panel=spec(_update19.view);mount.push(panel);}else{panel=this.panels[known];if(panel.update)panel.update(_update19);}_panels.push(panel);(panel.top?top:bottom).push(panel);}}catch(err){_iterator151.e(err);}finally{_iterator151.f();}this.specs=specs;this.panels=_panels;this.top.sync(top);this.bottom.sync(bottom);for(var _i71=0,_mount=mount;_i71<_mount.length;_i71++){var p=_mount[_i71];p.dom.classList.add("cm-panel");if(p.mount)p.mount();}}else{var _iterator152=_createForOfIteratorHelper(this.panels),_step152;try{for(_iterator152.s();!(_step152=_iterator152.n()).done;){var _p3=_step152.value;if(_p3.update)_p3.update(_update19);}}catch(err){_iterator152.e(err);}finally{_iterator152.f();}}}},{key:"destroy",value:function destroy(){this.top.sync([]);this.bottom.sync([]);}}]);return _class16;}(),{provide:view.PluginField.scrollMargins.from(function(value){return{top:value.top.scrollMargin(),bottom:value.bottom.scrollMargin()};})});var PanelGroup=/*#__PURE__*/function(){function PanelGroup(view,top,container){_classCallCheck(this,PanelGroup);this.view=view;this.top=top;this.container=container;this.dom=undefined;this.classes="";this.panels=[];this.syncClasses();}_createClass(PanelGroup,[{key:"sync",value:function sync(panels){var _iterator153=_createForOfIteratorHelper(this.panels),_step153;try{for(_iterator153.s();!(_step153=_iterator153.n()).done;){var p=_step153.value;if(p.destroy&&panels.indexOf(p)<0)p.destroy();}}catch(err){_iterator153.e(err);}finally{_iterator153.f();}this.panels=panels;this.syncDOM();}},{key:"syncDOM",value:function syncDOM(){if(this.panels.length==0){if(this.dom){this.dom.remove();this.dom=undefined;}return;}if(!this.dom){this.dom=document.createElement("div");this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";this.dom.style[this.top?"top":"bottom"]="0";var parent=this.container||this.view.dom;parent.insertBefore(this.dom,this.top?parent.firstChild:null);}var curDOM=this.dom.firstChild;var _iterator154=_createForOfIteratorHelper(this.panels),_step154;try{for(_iterator154.s();!(_step154=_iterator154.n()).done;){var panel=_step154.value;if(panel.dom.parentNode==this.dom){while(curDOM!=panel.dom){curDOM=rm(curDOM);}curDOM=curDOM.nextSibling;}else{this.dom.insertBefore(panel.dom,curDOM);}}}catch(err){_iterator154.e(err);}finally{_iterator154.f();}while(curDOM){curDOM=rm(curDOM);}}},{key:"scrollMargin",value:function scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top);}},{key:"syncClasses",value:function syncClasses(){if(!this.container||this.classes==this.view.themeClasses)return;var _iterator155=_createForOfIteratorHelper(this.classes.split(" ")),_step155;try{for(_iterator155.s();!(_step155=_iterator155.n()).done;){var cls=_step155.value;if(cls)this.container.classList.remove(cls);}}catch(err){_iterator155.e(err);}finally{_iterator155.f();}var _iterator156=_createForOfIteratorHelper((this.classes=this.view.themeClasses).split(" ")),_step156;try{for(_iterator156.s();!(_step156=_iterator156.n()).done;){var _cls=_step156.value;if(_cls)this.container.classList.add(_cls);}}catch(err){_iterator156.e(err);}finally{_iterator156.f();}}}]);return PanelGroup;}();function rm(node){var next=node.nextSibling;node.remove();return next;}var baseTheme=view.EditorView.baseTheme({".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"}});/** 2511 + Opening a panel is done by providing a constructor function for 2512 + the panel through this facet. (The panel is closed again when its 2513 + constructor is no longer provided.) Values of `null` are ignored. 2514 + */var showPanel=state.Facet.define({enables:[panelPlugin,baseTheme]});exports.getPanel=getPanel;exports.panels=panels;exports.showPanel=showPanel;},{"@codemirror/state":22,"@codemirror/view":27}],18:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');/** 2515 + Each range is associated with a value, which must inherit from 2516 + this class. 2517 + */var RangeValue=/*#__PURE__*/function(){function RangeValue(){_classCallCheck(this,RangeValue);}_createClass(RangeValue,[{key:"eq",value:/** 2518 + Compare this value with another value. The default 2519 + implementation compares by identity. 2520 + */function eq(other){return this==other;}/** 2521 + Create a [range](https://codemirror.net/6/docs/ref/#rangeset.Range) with this value. 2522 + */},{key:"range",value:function range(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;return new Range(from,to,this);}}]);return RangeValue;}();RangeValue.prototype.startSide=RangeValue.prototype.endSide=0;RangeValue.prototype.point=false;RangeValue.prototype.mapMode=state.MapMode.TrackDel;/** 2523 + A range associates a value with a range of positions. 2524 + */var Range=/*#__PURE__*/_createClass(/** 2525 + @internal 2526 + */function Range(/** 2527 + The range's start position. 2528 + */from,/** 2529 + Its end position. 2530 + */to,/** 2531 + The value associated with this range. 2532 + */value){_classCallCheck(this,Range);this.from=from;this.to=to;this.value=value;});function cmpRange(a,b){return a.from-b.from||a.value.startSide-b.value.startSide;}var Chunk=/*#__PURE__*/function(){function Chunk(from,to,value,// Chunks are marked with the largest point that occurs 2533 + // in them (or -1 for no points), so that scans that are 2534 + // only interested in points (such as the 2535 + // heightmap-related logic) can skip range-only chunks. 2536 + maxPoint){_classCallCheck(this,Chunk);this.from=from;this.to=to;this.value=value;this.maxPoint=maxPoint;}_createClass(Chunk,[{key:"length",get:function get(){return this.to[this.to.length-1];}// Find the index of the given position and side. Use the ranges' 2537 + // `from` pos when `end == false`, `to` when `end == true`. 2538 + },{key:"findIndex",value:function findIndex(pos,side,end){var startAt=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var arr=end?this.to:this.from;for(var lo=startAt,hi=arr.length;;){if(lo==hi)return lo;var mid=lo+hi>>1;var diff=arr[mid]-pos||(end?this.value[mid].endSide:this.value[mid].startSide)-side;if(mid==lo)return diff>=0?lo:hi;if(diff>=0)hi=mid;else lo=mid+1;}}},{key:"between",value:function between(offset,from,to,f){for(var _i72=this.findIndex(from,-1000000000/* Far */,true),e=this.findIndex(to,1000000000/* Far */,false,_i72);_i72<e;_i72++){if(f(this.from[_i72]+offset,this.to[_i72]+offset,this.value[_i72])===false)return false;}}},{key:"map",value:function map(offset,changes){var value=[],from=[],to=[],newPos=-1,maxPoint=-1;for(var _i73=0;_i73<this.value.length;_i73++){var val=this.value[_i73],curFrom=this.from[_i73]+offset,curTo=this.to[_i73]+offset,newFrom=void 0,newTo=void 0;if(curFrom==curTo){var mapped=changes.mapPos(curFrom,val.startSide,val.mapMode);if(mapped==null)continue;newFrom=newTo=mapped;if(val.startSide!=val.endSide){newTo=changes.mapPos(curFrom,val.endSide);if(newTo<newFrom)continue;}}else{newFrom=changes.mapPos(curFrom,val.startSide);newTo=changes.mapPos(curTo,val.endSide);if(newFrom>newTo||newFrom==newTo&&val.startSide>0&&val.endSide<=0)continue;}if((newTo-newFrom||val.endSide-val.startSide)<0)continue;if(newPos<0)newPos=newFrom;if(val.point)maxPoint=Math.max(maxPoint,newTo-newFrom);value.push(val);from.push(newFrom-newPos);to.push(newTo-newPos);}return{mapped:value.length?new Chunk(from,to,value,maxPoint):null,pos:newPos};}}]);return Chunk;}();/** 2539 + A range set stores a collection of [ranges](https://codemirror.net/6/docs/ref/#rangeset.Range) in a 2540 + way that makes them efficient to [map](https://codemirror.net/6/docs/ref/#rangeset.RangeSet.map) and 2541 + [update](https://codemirror.net/6/docs/ref/#rangeset.RangeSet.update). This is an immutable data 2542 + structure. 2543 + */var RangeSet=/*#__PURE__*/function(){/** 2544 + @internal 2545 + */function RangeSet(/** 2546 + @internal 2547 + */chunkPos,/** 2548 + @internal 2549 + */chunk){var nextLayer=arguments.length>2&&arguments[2]!==undefined?arguments[2]:RangeSet.empty;var/** 2550 + @internal 2551 + */maxPoint=arguments.length>3?arguments[3]:undefined;_classCallCheck(this,RangeSet);this.chunkPos=chunkPos;this.chunk=chunk;this.nextLayer=nextLayer;this.maxPoint=maxPoint;}/** 2552 + @internal 2553 + */_createClass(RangeSet,[{key:"length",get:function get(){var last=this.chunk.length-1;return last<0?0:Math.max(this.chunkEnd(last),this.nextLayer.length);}/** 2554 + The number of ranges in the set. 2555 + */},{key:"size",get:function get(){if(this.isEmpty)return 0;var size=this.nextLayer.size;var _iterator157=_createForOfIteratorHelper(this.chunk),_step157;try{for(_iterator157.s();!(_step157=_iterator157.n()).done;){var chunk=_step157.value;size+=chunk.value.length;}}catch(err){_iterator157.e(err);}finally{_iterator157.f();}return size;}/** 2556 + @internal 2557 + */},{key:"chunkEnd",value:function chunkEnd(index){return this.chunkPos[index]+this.chunk[index].length;}/** 2558 + Update the range set, optionally adding new ranges or filtering 2559 + out existing ones. 2560 + 2561 + (The extra type parameter is just there as a kludge to work 2562 + around TypeScript variance issues that prevented `RangeSet<X>` 2563 + from being a subtype of `RangeSet<Y>` when `X` is a subtype of 2564 + `Y`.) 2565 + */},{key:"update",value:function update(updateSpec){var _updateSpec$add=updateSpec.add,add=_updateSpec$add===void 0?[]:_updateSpec$add,_updateSpec$sort=updateSpec.sort,sort=_updateSpec$sort===void 0?false:_updateSpec$sort,_updateSpec$filterFro=updateSpec.filterFrom,filterFrom=_updateSpec$filterFro===void 0?0:_updateSpec$filterFro,_updateSpec$filterTo=updateSpec.filterTo,filterTo=_updateSpec$filterTo===void 0?this.length:_updateSpec$filterTo;var filter=updateSpec.filter;if(add.length==0&&!filter)return this;if(sort)add.slice().sort(cmpRange);if(this.isEmpty)return add.length?RangeSet.of(add):this;var cur=new LayerCursor(this,null,-1)["goto"](0),i=0,spill=[];var builder=new RangeSetBuilder();while(cur.value||i<add.length){if(i<add.length&&(cur.from-add[i].from||cur.startSide-add[i].value.startSide)>=0){var range=add[i++];if(!builder.addInner(range.from,range.to,range.value))spill.push(range);}else if(cur.rangeIndex==1&&cur.chunkIndex<this.chunk.length&&(i==add.length||this.chunkEnd(cur.chunkIndex)<add[i].from)&&(!filter||filterFrom>this.chunkEnd(cur.chunkIndex)||filterTo<this.chunkPos[cur.chunkIndex])&&builder.addChunk(this.chunkPos[cur.chunkIndex],this.chunk[cur.chunkIndex])){cur.nextChunk();}else{if(!filter||filterFrom>cur.to||filterTo<cur.from||filter(cur.from,cur.to,cur.value)){if(!builder.addInner(cur.from,cur.to,cur.value))spill.push(new Range(cur.from,cur.to,cur.value));}cur.next();}}return builder.finishInner(this.nextLayer.isEmpty&&!spill.length?RangeSet.empty:this.nextLayer.update({add:spill,filter:filter,filterFrom:filterFrom,filterTo:filterTo}));}/** 2566 + Map this range set through a set of changes, return the new set. 2567 + */},{key:"map",value:function map(changes){if(changes.length==0||this.isEmpty)return this;var chunks=[],chunkPos=[],maxPoint=-1;for(var _i74=0;_i74<this.chunk.length;_i74++){var start=this.chunkPos[_i74],chunk=this.chunk[_i74];var touch=changes.touchesRange(start,start+chunk.length);if(touch===false){maxPoint=Math.max(maxPoint,chunk.maxPoint);chunks.push(chunk);chunkPos.push(changes.mapPos(start));}else if(touch===true){var _chunk$map=chunk.map(start,changes),mapped=_chunk$map.mapped,pos=_chunk$map.pos;if(mapped){maxPoint=Math.max(maxPoint,mapped.maxPoint);chunks.push(mapped);chunkPos.push(pos);}}}var next=this.nextLayer.map(changes);return chunks.length==0?next:new RangeSet(chunkPos,chunks,next,maxPoint);}/** 2568 + Iterate over the ranges that touch the region `from` to `to`, 2569 + calling `f` for each. There is no guarantee that the ranges will 2570 + be reported in any specific order. When the callback returns 2571 + `false`, iteration stops. 2572 + */},{key:"between",value:function between(from,to,f){if(this.isEmpty)return;for(var _i75=0;_i75<this.chunk.length;_i75++){var start=this.chunkPos[_i75],chunk=this.chunk[_i75];if(to>=start&&from<=start+chunk.length&&chunk.between(start,from-start,to-start,f)===false)return;}this.nextLayer.between(from,to,f);}/** 2573 + Iterate over the ranges in this set, in order, including all 2574 + ranges that end at or after `from`. 2575 + */},{key:"iter",value:function iter(){var from=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;return HeapCursor.from([this])["goto"](from);}/** 2576 + @internal 2577 + */},{key:"isEmpty",get:function get(){return this.nextLayer==this;}/** 2578 + Iterate over the ranges in a collection of sets, in order, 2579 + starting from `from`. 2580 + */}],[{key:"iter",value:function iter(sets){var from=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return HeapCursor.from(sets)["goto"](from);}/** 2581 + Iterate over two groups of sets, calling methods on `comparator` 2582 + to notify it of possible differences. 2583 + */},{key:"compare",value:function compare(oldSets,newSets,/** 2584 + This indicates how the underlying data changed between these 2585 + ranges, and is needed to synchronize the iteration. `from` and 2586 + `to` are coordinates in the _new_ space, after these changes. 2587 + */textDiff,comparator){var minPointSize=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;var a=oldSets.filter(function(set){return set.maxPoint>0||!set.isEmpty&&set.maxPoint>=minPointSize;});var b=newSets.filter(function(set){return set.maxPoint>0||!set.isEmpty&&set.maxPoint>=minPointSize;});var sharedChunks=findSharedChunks(a,b,textDiff);var sideA=new SpanCursor(a,sharedChunks,minPointSize);var sideB=new SpanCursor(b,sharedChunks,minPointSize);textDiff.iterGaps(function(fromA,fromB,length){return _compare(sideA,fromA,sideB,fromB,length,comparator);});if(textDiff.empty&&textDiff.length==0)_compare(sideA,0,sideB,0,0,comparator);}/** 2588 + Compare the contents of two groups of range sets, returning true 2589 + if they are equivalent in the given range. 2590 + */},{key:"eq",value:function eq(oldSets,newSets){var from=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var to=arguments.length>3?arguments[3]:undefined;if(to==null)to=1000000000/* Far */;var a=oldSets.filter(function(set){return!set.isEmpty&&newSets.indexOf(set)<0;});var b=newSets.filter(function(set){return!set.isEmpty&&oldSets.indexOf(set)<0;});if(a.length!=b.length)return false;if(!a.length)return true;var sharedChunks=findSharedChunks(a,b);var sideA=new SpanCursor(a,sharedChunks,0)["goto"](from),sideB=new SpanCursor(b,sharedChunks,0)["goto"](from);for(;;){if(sideA.to!=sideB.to||!sameValues(sideA.active,sideB.active)||sideA.point&&(!sideB.point||!sideA.point.eq(sideB.point)))return false;if(sideA.to>to)return true;sideA.next();sideB.next();}}/** 2591 + Iterate over a group of range sets at the same time, notifying 2592 + the iterator about the ranges covering every given piece of 2593 + content. Returns the open count (see 2594 + [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#rangeset.SpanIterator.span)) at the end 2595 + of the iteration. 2596 + */},{key:"spans",value:function spans(sets,from,to,iterator){var minPointSize=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;var _a;var cursor=new SpanCursor(sets,null,minPointSize,(_a=iterator.filterPoint)===null||_a===void 0?void 0:_a.bind(iterator))["goto"](from),pos=from;var open=cursor.openStart;for(;;){var curTo=Math.min(cursor.to,to);if(cursor.point){iterator.point(pos,curTo,cursor.point,cursor.activeForPoint(cursor.to),open);open=cursor.openEnd(curTo)+(cursor.to>curTo?1:0);}else if(curTo>pos){iterator.span(pos,curTo,cursor.active,open);open=cursor.openEnd(curTo);}if(cursor.to>to)break;pos=cursor.to;cursor.next();}return open;}/** 2597 + Create a range set for the given range or array of ranges. By 2598 + default, this expects the ranges to be _sorted_ (by start 2599 + position and, if two start at the same position, 2600 + `value.startSide`). You can pass `true` as second argument to 2601 + cause the method to sort them. 2602 + */},{key:"of",value:function of(ranges){var sort=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var build=new RangeSetBuilder();var _iterator158=_createForOfIteratorHelper(ranges instanceof Range?[ranges]:sort?lazySort(ranges):ranges),_step158;try{for(_iterator158.s();!(_step158=_iterator158.n()).done;){var range=_step158.value;build.add(range.from,range.to,range.value);}}catch(err){_iterator158.e(err);}finally{_iterator158.f();}return build.finish();}}]);return RangeSet;}();/** 2603 + The empty set of ranges. 2604 + */RangeSet.empty=new RangeSet([],[],null,-1);function lazySort(ranges){if(ranges.length>1)for(var prev=ranges[0],_i76=1;_i76<ranges.length;_i76++){var cur=ranges[_i76];if(cmpRange(prev,cur)>0)return ranges.slice().sort(cmpRange);prev=cur;}return ranges;}RangeSet.empty.nextLayer=RangeSet.empty;/** 2605 + A range set builder is a data structure that helps build up a 2606 + [range set](https://codemirror.net/6/docs/ref/#rangeset.RangeSet) directly, without first allocating 2607 + an array of [`Range`](https://codemirror.net/6/docs/ref/#rangeset.Range) objects. 2608 + */var RangeSetBuilder=/*#__PURE__*/function(){/** 2609 + Create an empty builder. 2610 + */function RangeSetBuilder(){_classCallCheck(this,RangeSetBuilder);this.chunks=[];this.chunkPos=[];this.chunkStart=-1;this.last=null;this.lastFrom=-1000000000/* Far */;this.lastTo=-1000000000/* Far */;this.from=[];this.to=[];this.value=[];this.maxPoint=-1;this.setMaxPoint=-1;this.nextLayer=null;}_createClass(RangeSetBuilder,[{key:"finishChunk",value:function finishChunk(newArrays){this.chunks.push(new Chunk(this.from,this.to,this.value,this.maxPoint));this.chunkPos.push(this.chunkStart);this.chunkStart=-1;this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint);this.maxPoint=-1;if(newArrays){this.from=[];this.to=[];this.value=[];}}/** 2611 + Add a range. Ranges should be added in sorted (by `from` and 2612 + `value.startSide`) order. 2613 + */},{key:"add",value:function add(from,to,value){if(!this.addInner(from,to,value))(this.nextLayer||(this.nextLayer=new RangeSetBuilder())).add(from,to,value);}/** 2614 + @internal 2615 + */},{key:"addInner",value:function addInner(from,to,value){var diff=from-this.lastTo||value.startSide-this.last.endSide;if(diff<=0&&(from-this.lastFrom||value.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");if(diff<0)return false;if(this.from.length==250/* ChunkSize */)this.finishChunk(true);if(this.chunkStart<0)this.chunkStart=from;this.from.push(from-this.chunkStart);this.to.push(to-this.chunkStart);this.last=value;this.lastFrom=from;this.lastTo=to;this.value.push(value);if(value.point)this.maxPoint=Math.max(this.maxPoint,to-from);return true;}/** 2616 + @internal 2617 + */},{key:"addChunk",value:function addChunk(from,chunk){if((from-this.lastTo||chunk.value[0].startSide-this.last.endSide)<0)return false;if(this.from.length)this.finishChunk(true);this.setMaxPoint=Math.max(this.setMaxPoint,chunk.maxPoint);this.chunks.push(chunk);this.chunkPos.push(from);var last=chunk.value.length-1;this.last=chunk.value[last];this.lastFrom=chunk.from[last]+from;this.lastTo=chunk.to[last]+from;return true;}/** 2618 + Finish the range set. Returns the new set. The builder can't be 2619 + used anymore after this has been called. 2620 + */},{key:"finish",value:function finish(){return this.finishInner(RangeSet.empty);}/** 2621 + @internal 2622 + */},{key:"finishInner",value:function finishInner(next){if(this.from.length)this.finishChunk(false);if(this.chunks.length==0)return next;var result=new RangeSet(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(next):next,this.setMaxPoint);this.from=null;// Make sure further `add` calls produce errors 2623 + return result;}}]);return RangeSetBuilder;}();function findSharedChunks(a,b,textDiff){var inA=new Map();var _iterator159=_createForOfIteratorHelper(a),_step159;try{for(_iterator159.s();!(_step159=_iterator159.n()).done;){var set=_step159.value;for(var _i77=0;_i77<set.chunk.length;_i77++){if(set.chunk[_i77].maxPoint<=0)inA.set(set.chunk[_i77],set.chunkPos[_i77]);}}}catch(err){_iterator159.e(err);}finally{_iterator159.f();}var shared=new Set();var _iterator160=_createForOfIteratorHelper(b),_step160;try{for(_iterator160.s();!(_step160=_iterator160.n()).done;){var _set=_step160.value;for(var _i78=0;_i78<_set.chunk.length;_i78++){var known=inA.get(_set.chunk[_i78]);if(known!=null&&(textDiff?textDiff.mapPos(known):known)==_set.chunkPos[_i78]&&!(textDiff===null||textDiff===void 0?void 0:textDiff.touchesRange(known,known+_set.chunk[_i78].length)))shared.add(_set.chunk[_i78]);}}}catch(err){_iterator160.e(err);}finally{_iterator160.f();}return shared;}var LayerCursor=/*#__PURE__*/function(){function LayerCursor(layer,skip,minPoint){var rank=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,LayerCursor);this.layer=layer;this.skip=skip;this.minPoint=minPoint;this.rank=rank;}_createClass(LayerCursor,[{key:"startSide",get:function get(){return this.value?this.value.startSide:0;}},{key:"endSide",get:function get(){return this.value?this.value.endSide:0;}},{key:"goto",value:function goto(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1000000000;this.chunkIndex=this.rangeIndex=0;this.gotoInner(pos,side,false);return this;}},{key:"gotoInner",value:function gotoInner(pos,side,forward){while(this.chunkIndex<this.layer.chunk.length){var next=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(next)||this.layer.chunkEnd(this.chunkIndex)<pos||next.maxPoint<this.minPoint))break;this.chunkIndex++;forward=false;}if(this.chunkIndex<this.layer.chunk.length){var rangeIndex=this.layer.chunk[this.chunkIndex].findIndex(pos-this.layer.chunkPos[this.chunkIndex],side,true);if(!forward||this.rangeIndex<rangeIndex)this.setRangeIndex(rangeIndex);}this.next();}},{key:"forward",value:function forward(pos,side){if((this.to-pos||this.endSide-side)<0)this.gotoInner(pos,side,true);}},{key:"next",value:function next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1000000000/* Far */;this.value=null;break;}else{var chunkPos=this.layer.chunkPos[this.chunkIndex],chunk=this.layer.chunk[this.chunkIndex];var from=chunkPos+chunk.from[this.rangeIndex];this.from=from;this.to=chunkPos+chunk.to[this.rangeIndex];this.value=chunk.value[this.rangeIndex];this.setRangeIndex(this.rangeIndex+1);if(this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break;}}}},{key:"setRangeIndex",value:function setRangeIndex(index){if(index==this.layer.chunk[this.chunkIndex].value.length){this.chunkIndex++;if(this.skip){while(this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex])){this.chunkIndex++;}}this.rangeIndex=0;}else{this.rangeIndex=index;}}},{key:"nextChunk",value:function nextChunk(){this.chunkIndex++;this.rangeIndex=0;this.next();}},{key:"compare",value:function compare(other){return this.from-other.from||this.startSide-other.startSide||this.to-other.to||this.endSide-other.endSide;}}]);return LayerCursor;}();var HeapCursor=/*#__PURE__*/function(){function HeapCursor(heap){_classCallCheck(this,HeapCursor);this.heap=heap;}_createClass(HeapCursor,[{key:"startSide",get:function get(){return this.value?this.value.startSide:0;}},{key:"goto",value:function goto(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1000000000;var _iterator161=_createForOfIteratorHelper(this.heap),_step161;try{for(_iterator161.s();!(_step161=_iterator161.n()).done;){var cur=_step161.value;cur["goto"](pos,side);}}catch(err){_iterator161.e(err);}finally{_iterator161.f();}for(var _i79=this.heap.length>>1;_i79>=0;_i79--){heapBubble(this.heap,_i79);}this.next();return this;}},{key:"forward",value:function forward(pos,side){var _iterator162=_createForOfIteratorHelper(this.heap),_step162;try{for(_iterator162.s();!(_step162=_iterator162.n()).done;){var cur=_step162.value;cur.forward(pos,side);}}catch(err){_iterator162.e(err);}finally{_iterator162.f();}for(var _i80=this.heap.length>>1;_i80>=0;_i80--){heapBubble(this.heap,_i80);}if((this.to-pos||this.value.endSide-side)<0)this.next();}},{key:"next",value:function next(){if(this.heap.length==0){this.from=this.to=1000000000/* Far */;this.value=null;this.rank=-1;}else{var top=this.heap[0];this.from=top.from;this.to=top.to;this.value=top.value;this.rank=top.rank;if(top.value)top.next();heapBubble(this.heap,0);}}}],[{key:"from",value:function from(sets){var skip=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var minPoint=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var heap=[];for(var _i81=0;_i81<sets.length;_i81++){for(var cur=sets[_i81];!cur.isEmpty;cur=cur.nextLayer){if(cur.maxPoint>=minPoint)heap.push(new LayerCursor(cur,skip,minPoint,_i81));}}return heap.length==1?heap[0]:new HeapCursor(heap);}}]);return HeapCursor;}();function heapBubble(heap,index){for(var cur=heap[index];;){var childIndex=(index<<1)+1;if(childIndex>=heap.length)break;var child=heap[childIndex];if(childIndex+1<heap.length&&child.compare(heap[childIndex+1])>=0){child=heap[childIndex+1];childIndex++;}if(cur.compare(child)<0)break;heap[childIndex]=cur;heap[index]=child;index=childIndex;}}var SpanCursor=/*#__PURE__*/function(){function SpanCursor(sets,skip,minPoint){var filterPoint=arguments.length>3&&arguments[3]!==undefined?arguments[3]:function(){return true;};_classCallCheck(this,SpanCursor);this.minPoint=minPoint;this.filterPoint=filterPoint;this.active=[];this.activeTo=[];this.activeRank=[];this.minActive=-1;// A currently active point range, if any 2624 + this.point=null;this.pointFrom=0;this.pointRank=0;this.to=-1000000000/* Far */;this.endSide=0;this.openStart=-1;this.cursor=HeapCursor.from(sets,skip,minPoint);}_createClass(SpanCursor,[{key:"goto",value:function goto(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1000000000;this.cursor["goto"](pos,side);this.active.length=this.activeTo.length=this.activeRank.length=0;this.minActive=-1;this.to=pos;this.endSide=side;this.openStart=-1;this.next();return this;}},{key:"forward",value:function forward(pos,side){while(this.minActive>-1&&(this.activeTo[this.minActive]-pos||this.active[this.minActive].endSide-side)<0){this.removeActive(this.minActive);}this.cursor.forward(pos,side);}},{key:"removeActive",value:function removeActive(index){remove(this.active,index);remove(this.activeTo,index);remove(this.activeRank,index);this.minActive=findMinIndex(this.active,this.activeTo);}},{key:"addActive",value:function addActive(trackOpen){var i=0,_this$cursor=this.cursor,value=_this$cursor.value,to=_this$cursor.to,rank=_this$cursor.rank;while(i<this.activeRank.length&&this.activeRank[i]<=rank){i++;}insert(this.active,i,value);insert(this.activeTo,i,to);insert(this.activeRank,i,rank);if(trackOpen)insert(trackOpen,i,this.cursor.from);this.minActive=findMinIndex(this.active,this.activeTo);}// After calling this, if `this.point` != null, the next range is a 2625 + // point. Otherwise, it's a regular range, covered by `this.active`. 2626 + },{key:"next",value:function next(){var from=this.to,wasPoint=this.point;this.point=null;var trackOpen=this.openStart<0?[]:null,trackExtra=0;for(;;){var a=this.minActive;if(a>-1&&(this.activeTo[a]-this.cursor.from||this.active[a].endSide-this.cursor.startSide)<0){if(this.activeTo[a]>from){this.to=this.activeTo[a];this.endSide=this.active[a].endSide;break;}this.removeActive(a);if(trackOpen)remove(trackOpen,a);}else if(!this.cursor.value){this.to=this.endSide=1000000000/* Far */;break;}else if(this.cursor.from>from){this.to=this.cursor.from;this.endSide=this.cursor.startSide;break;}else{var nextVal=this.cursor.value;if(!nextVal.point){// Opening a range 2627 + this.addActive(trackOpen);this.cursor.next();}else if(wasPoint&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to){// Ignore any non-empty points that end precisely at the end of the prev point 2628 + this.cursor.next();}else if(!this.filterPoint(this.cursor.from,this.cursor.to,this.cursor.value,this.cursor.rank)){this.cursor.next();}else{// New point 2629 + this.point=nextVal;this.pointFrom=this.cursor.from;this.pointRank=this.cursor.rank;this.to=this.cursor.to;this.endSide=nextVal.endSide;if(this.cursor.from<from)trackExtra=1;this.cursor.next();if(this.to>from)this.forward(this.to,this.endSide);break;}}}if(trackOpen){var openStart=0;while(openStart<trackOpen.length&&trackOpen[openStart]<from){openStart++;}this.openStart=openStart+trackExtra;}}},{key:"activeForPoint",value:function activeForPoint(to){if(!this.active.length)return this.active;var active=[];for(var _i82=this.active.length-1;_i82>=0;_i82--){if(this.activeRank[_i82]<this.pointRank)break;if(this.activeTo[_i82]>to||this.activeTo[_i82]==to&&this.active[_i82].endSide>=this.point.endSide)active.push(this.active[_i82]);}return active.reverse();}},{key:"openEnd",value:function openEnd(to){var open=0;for(var _i83=this.activeTo.length-1;_i83>=0&&this.activeTo[_i83]>to;_i83--){open++;}return open;}}]);return SpanCursor;}();function _compare(a,startA,b,startB,length,comparator){a["goto"](startA);b["goto"](startB);var endB=startB+length;var pos=startB,dPos=startB-startA;for(;;){var diff=a.to+dPos-b.to||a.endSide-b.endSide;var end=diff<0?a.to+dPos:b.to,clipEnd=Math.min(end,endB);if(a.point||b.point){if(!(a.point&&b.point&&(a.point==b.point||a.point.eq(b.point))&&sameValues(a.activeForPoint(a.to+dPos),b.activeForPoint(b.to))))comparator.comparePoint(pos,clipEnd,a.point,b.point);}else{if(clipEnd>pos&&!sameValues(a.active,b.active))comparator.compareRange(pos,clipEnd,a.active,b.active);}if(end>endB)break;pos=end;if(diff<=0)a.next();if(diff>=0)b.next();}}function sameValues(a,b){if(a.length!=b.length)return false;for(var _i84=0;_i84<a.length;_i84++){if(a[_i84]!=b[_i84]&&!a[_i84].eq(b[_i84]))return false;}return true;}function remove(array,index){for(var _i85=index,e=array.length-1;_i85<e;_i85++){array[_i85]=array[_i85+1];}array.pop();}function insert(array,index,value){for(var _i86=array.length-1;_i86>=index;_i86--){array[_i86+1]=array[_i86];}array[index]=value;}function findMinIndex(value,array){var found=-1,foundPos=1000000000/* Far */;for(var _i87=0;_i87<array.length;_i87++){if((array[_i87]-foundPos||value[_i87].endSide-value[found].endSide)<0){found=_i87;foundPos=array[_i87];}}return found;}exports.Range=Range;exports.RangeSet=RangeSet;exports.RangeSetBuilder=RangeSetBuilder;exports.RangeValue=RangeValue;},{"@codemirror/state":22}],19:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');var view=require('@codemirror/view');var text=require('@codemirror/text');// Don't compute precise column positions for line offsets above this 2630 + // (since it could get expensive). Assume offset==column for them. 2631 + var MaxOff=2000;function rectangleFor(state$1,a,b){var startLine=Math.min(a.line,b.line),endLine=Math.max(a.line,b.line);var ranges=[];if(a.off>MaxOff||b.off>MaxOff||a.col<0||b.col<0){var startOff=Math.min(a.off,b.off),endOff=Math.max(a.off,b.off);for(var _i88=startLine;_i88<=endLine;_i88++){var line=state$1.doc.line(_i88);if(line.length<=endOff)ranges.push(state.EditorSelection.range(line.from+startOff,line.to+endOff));}}else{var startCol=Math.min(a.col,b.col),endCol=Math.max(a.col,b.col);for(var _i89=startLine;_i89<=endLine;_i89++){var _line6=state$1.doc.line(_i89);var start=text.findColumn(_line6.text,startCol,state$1.tabSize,true);if(start>-1){var end=text.findColumn(_line6.text,endCol,state$1.tabSize);ranges.push(state.EditorSelection.range(_line6.from+start,_line6.from+end));}}}return ranges;}function absoluteColumn(view,x){var ref=view.coordsAtPos(view.viewport.from);return ref?Math.round(Math.abs((ref.left-x)/view.defaultCharacterWidth)):-1;}function getPos(view,event){var offset=view.posAtCoords({x:event.clientX,y:event.clientY},false);var line=view.state.doc.lineAt(offset),off=offset-line.from;var col=off>MaxOff?-1:off==line.length?absoluteColumn(view,event.clientX):text.countColumn(line.text,view.state.tabSize,offset-line.from);return{line:line.number,col:col,off:off};}function rectangleSelectionStyle(view,event){var start=getPos(view,event),startSel=view.state.selection;if(!start)return null;return{update:function update(_update20){if(_update20.docChanged){var newStart=_update20.changes.mapPos(_update20.startState.doc.line(start.line).from);var newLine=_update20.state.doc.lineAt(newStart);start={line:newLine.number,col:start.col,off:Math.min(start.off,newLine.length)};startSel=startSel.map(_update20.changes);}},get:function get(event,_extend,multiple){var cur=getPos(view,event);if(!cur)return startSel;var ranges=rectangleFor(view.state,start,cur);if(!ranges.length)return startSel;if(multiple)return state.EditorSelection.create(ranges.concat(startSel.ranges));else return state.EditorSelection.create(ranges);}};}/** 2632 + Create an extension that enables rectangular selections. By 2633 + default, it will react to left mouse drag with the Alt key held 2634 + down. When such a selection occurs, the text within the rectangle 2635 + that was dragged over will be selected, as one selection 2636 + [range](https://codemirror.net/6/docs/ref/#state.SelectionRange) per line. 2637 + */function rectangularSelection(options){var filter=(options===null||options===void 0?void 0:options.eventFilter)||function(e){return e.altKey&&e.button==0;};return view.EditorView.mouseSelectionStyle.of(function(view,event){return filter(event)?rectangleSelectionStyle(view,event):null;});}exports.rectangularSelection=rectangularSelection;},{"@codemirror/state":22,"@codemirror/text":24,"@codemirror/view":27}],20:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var view=require('@codemirror/view');var state=require('@codemirror/state');var panel=require('@codemirror/panel');var rangeset=require('@codemirror/rangeset');var elt=require('crelt');var text=require('@codemirror/text');function _interopDefaultLegacy(e){return e&&_typeof(e)==='object'&&'default'in e?e:{'default':e};}var elt__default=/*#__PURE__*/_interopDefaultLegacy(elt);var basicNormalize=typeof String.prototype.normalize=="function"?function(x){return x.normalize("NFKD");}:function(x){return x;};/** 2638 + A search cursor provides an iterator over text matches in a 2639 + document. 2640 + */var SearchCursor=/*#__PURE__*/function(){/** 2641 + Create a text cursor. The query is the search string, `from` to 2642 + `to` provides the region to search. 2643 + 2644 + When `normalize` is given, it will be called, on both the query 2645 + string and the content it is matched against, before comparing. 2646 + You can, for example, create a case-insensitive search by 2647 + passing `s => s.toLowerCase()`. 2648 + 2649 + Text is always normalized with 2650 + [`.normalize("NFKD")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize) 2651 + (when supported). 2652 + */function SearchCursor(text,query){var from=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var to=arguments.length>3&&arguments[3]!==undefined?arguments[3]:text.length;var normalize=arguments.length>4?arguments[4]:undefined;_classCallCheck(this,SearchCursor);/** 2653 + The current match (only holds a meaningful value after 2654 + [`next`](https://codemirror.net/6/docs/ref/#search.SearchCursor.next) has been called and when 2655 + `done` is false). 2656 + */this.value={from:0,to:0};/** 2657 + Whether the end of the iterated region has been reached. 2658 + */this.done=false;this.matches=[];this.buffer="";this.bufferPos=0;this.iter=text.iterRange(from,to);this.bufferStart=from;this.normalize=normalize?function(x){return normalize(basicNormalize(x));}:basicNormalize;this.query=this.normalize(query);}_createClass(SearchCursor,[{key:"peek",value:function peek(){if(this.bufferPos==this.buffer.length){this.bufferStart+=this.buffer.length;this.iter.next();if(this.iter.done)return-1;this.bufferPos=0;this.buffer=this.iter.value;}return text.codePointAt(this.buffer,this.bufferPos);}/** 2659 + Look for the next match. Updates the iterator's 2660 + [`value`](https://codemirror.net/6/docs/ref/#search.SearchCursor.value) and 2661 + [`done`](https://codemirror.net/6/docs/ref/#search.SearchCursor.done) properties. Should be called 2662 + at least once before using the cursor. 2663 + */},{key:"next",value:function next(){while(this.matches.length){this.matches.pop();}return this.nextOverlapping();}/** 2664 + The `next` method will ignore matches that partially overlap a 2665 + previous match. This method behaves like `next`, but includes 2666 + such matches. 2667 + */},{key:"nextOverlapping",value:function nextOverlapping(){for(;;){var next=this.peek();if(next<0){this.done=true;return this;}var str=text.fromCodePoint(next),start=this.bufferStart+this.bufferPos;this.bufferPos+=text.codePointSize(next);var norm=this.normalize(str);for(var _i90=0,pos=start;;_i90++){var code=norm.charCodeAt(_i90);var match=this.match(code,pos);if(match){this.value=match;return this;}if(_i90==norm.length-1)break;if(pos==start&&_i90<str.length&&str.charCodeAt(_i90)==code)pos++;}}}},{key:"match",value:function match(code,pos){var match=null;for(var _i91=0;_i91<this.matches.length;_i91+=2){var index=this.matches[_i91],keep=false;if(this.query.charCodeAt(index)==code){if(index==this.query.length-1){match={from:this.matches[_i91+1],to:pos+1};}else{this.matches[_i91]++;keep=true;}}if(!keep){this.matches.splice(_i91,2);_i91-=2;}}if(this.query.charCodeAt(0)==code){if(this.query.length==1)match={from:pos,to:pos+1};else this.matches.push(1,pos);}return match;}}]);return SearchCursor;}();if(typeof Symbol!="undefined")SearchCursor.prototype[Symbol.iterator]=function(){return this;};var empty={from:-1,to:-1,match:/.*/.exec("")};var baseFlags="gm"+(/x/.unicode==null?"":"u");/** 2668 + This class is similar to [`SearchCursor`](https://codemirror.net/6/docs/ref/#search.SearchCursor) 2669 + but searches for a regular expression pattern instead of a plain 2670 + string. 2671 + */var RegExpCursor=/*#__PURE__*/function(){/** 2672 + Create a cursor that will search the given range in the given 2673 + document. `query` should be the raw pattern (as you'd pass it to 2674 + `new RegExp`). 2675 + */function RegExpCursor(text,query,options){var from=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var to=arguments.length>4&&arguments[4]!==undefined?arguments[4]:text.length;_classCallCheck(this,RegExpCursor);this.to=to;this.curLine="";/** 2676 + Set to `true` when the cursor has reached the end of the search 2677 + range. 2678 + */this.done=false;/** 2679 + Will contain an object with the extent of the match and the 2680 + match object when [`next`](https://codemirror.net/6/docs/ref/#search.RegExpCursor.next) 2681 + sucessfully finds a match. 2682 + */this.value=empty;if(/\\[sWDnr]|\n|\r|\[\^/.test(query))return new MultilineRegExpCursor(text,query,options,from,to);this.re=new RegExp(query,baseFlags+((options===null||options===void 0?void 0:options.ignoreCase)?"i":""));this.iter=text.iter();var startLine=text.lineAt(from);this.curLineStart=startLine.from;this.matchPos=from;this.getLine(this.curLineStart);}_createClass(RegExpCursor,[{key:"getLine",value:function getLine(skip){this.iter.next(skip);if(this.iter.lineBreak){this.curLine="";}else{this.curLine=this.iter.value;if(this.curLineStart+this.curLine.length>this.to)this.curLine=this.curLine.slice(0,this.to-this.curLineStart);this.iter.next();}}},{key:"nextLine",value:function nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1;if(this.curLineStart>this.to)this.curLine="";else this.getLine(0);}/** 2683 + Move to the next match, if there is one. 2684 + */},{key:"next",value:function next(){for(var off=this.matchPos-this.curLineStart;;){this.re.lastIndex=off;var match=this.matchPos<=this.to&&this.re.exec(this.curLine);if(match){var from=this.curLineStart+match.index,to=from+match[0].length;this.matchPos=to+(from==to?1:0);if(from==this.curLine.length)this.nextLine();if(from<to||from>this.value.to){this.value={from:from,to:to,match:match};return this;}off=this.matchPos-this.curLineStart;}else if(this.curLineStart+this.curLine.length<this.to){this.nextLine();off=0;}else{this.done=true;return this;}}}}]);return RegExpCursor;}();var flattened=new WeakMap();// Reusable (partially) flattened document strings 2685 + var FlattenedDoc=/*#__PURE__*/function(){function FlattenedDoc(from,text){_classCallCheck(this,FlattenedDoc);this.from=from;this.text=text;}_createClass(FlattenedDoc,[{key:"to",get:function get(){return this.from+this.text.length;}}],[{key:"get",value:function get(doc,from,to){var cached=flattened.get(doc);if(!cached||cached.from>=to||cached.to<=from){var flat=new FlattenedDoc(from,doc.sliceString(from,to));flattened.set(doc,flat);return flat;}if(cached.from==from&&cached.to==to)return cached;var text=cached.text,cachedFrom=cached.from;if(cachedFrom>from){text=doc.sliceString(from,cachedFrom)+text;cachedFrom=from;}if(cached.to<to)text+=doc.sliceString(cached.to,to);flattened.set(doc,new FlattenedDoc(cachedFrom,text));return new FlattenedDoc(from,text.slice(from-cachedFrom,to-cachedFrom));}}]);return FlattenedDoc;}();var MultilineRegExpCursor=/*#__PURE__*/function(){function MultilineRegExpCursor(text,query,options,from,to){_classCallCheck(this,MultilineRegExpCursor);this.text=text;this.to=to;this.done=false;this.value=empty;this.matchPos=from;this.re=new RegExp(query,baseFlags+((options===null||options===void 0?void 0:options.ignoreCase)?"i":""));this.flat=FlattenedDoc.get(text,from,this.chunkEnd(from+5000/* Base */));}_createClass(MultilineRegExpCursor,[{key:"chunkEnd",value:function chunkEnd(pos){return pos>=this.to?this.to:this.text.lineAt(pos).to;}},{key:"next",value:function next(){for(;;){var off=this.re.lastIndex=this.matchPos-this.flat.from;var match=this.re.exec(this.flat.text);// Skip empty matches directly after the last match 2686 + if(match&&!match[0]&&match.index==off){this.re.lastIndex=off+1;match=this.re.exec(this.flat.text);}// If a match goes almost to the end of a noncomplete chunk, try 2687 + // again, since it'll likely be able to match more 2688 + if(match&&this.flat.to<this.to&&match.index+match[0].length>this.flat.text.length-10)match=null;if(match){var from=this.flat.from+match.index,to=from+match[0].length;this.value={from:from,to:to,match:match};this.matchPos=to+(from==to?1:0);return this;}else{if(this.flat.to==this.to){this.done=true;return this;}// Grow the flattened doc 2689 + this.flat=FlattenedDoc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2));}}}}]);return MultilineRegExpCursor;}();if(typeof Symbol!="undefined"){RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this;};}function validRegExp(source){try{new RegExp(source,baseFlags);return true;}catch(_a){return false;}}function createLineDialog(view){var input=elt__default["default"]("input",{"class":"cm-textfield",name:"line"});var dom=elt__default["default"]("form",{"class":"cm-gotoLine",onkeydown:function onkeydown(event){if(event.keyCode==27){// Escape 2690 + event.preventDefault();view.dispatch({effects:dialogEffect.of(false)});view.focus();}else if(event.keyCode==13){// Enter 2691 + event.preventDefault();go();}},onsubmit:function onsubmit(event){event.preventDefault();go();}},elt__default["default"]("label",view.state.phrase("Go to line"),": ",input)," ",elt__default["default"]("button",{"class":"cm-button",type:"submit"},view.state.phrase("go")));function go(){var match=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(input.value);if(!match)return;var state$1=view.state,startLine=state$1.doc.lineAt(state$1.selection.main.head);var _match=_slicedToArray(match,5),sign=_match[1],ln=_match[2],cl=_match[3],percent=_match[4];var col=cl?+cl.slice(1):0;var line=ln?+ln:startLine.number;if(ln&&percent){var pc=line/100;if(sign)pc=pc*(sign=="-"?-1:1)+startLine.number/state$1.doc.lines;line=Math.round(state$1.doc.lines*pc);}else if(ln&&sign){line=line*(sign=="-"?-1:1)+startLine.number;}var docLine=state$1.doc.line(Math.max(1,Math.min(state$1.doc.lines,line)));view.dispatch({effects:dialogEffect.of(false),selection:state.EditorSelection.cursor(docLine.from+Math.max(0,Math.min(col,docLine.length))),scrollIntoView:true});view.focus();}return{dom:dom,pos:-10};}var dialogEffect=state.StateEffect.define();var dialogField=state.StateField.define({create:function create(){return true;},update:function update(value,tr){var _iterator163=_createForOfIteratorHelper(tr.effects),_step163;try{for(_iterator163.s();!(_step163=_iterator163.n()).done;){var e=_step163.value;if(e.is(dialogEffect))value=e.value;}}catch(err){_iterator163.e(err);}finally{_iterator163.f();}return value;},provide:function provide(f){return panel.showPanel.from(f,function(val){return val?createLineDialog:null;});}});/** 2692 + Command that shows a dialog asking the user for a line number, and 2693 + when a valid position is provided, moves the cursor to that line. 2694 + 2695 + Supports line numbers, relative line offsets prefixed with `+` or 2696 + `-`, document percentages suffixed with `%`, and an optional 2697 + column position by adding `:` and a second number after the line 2698 + number. 2699 + 2700 + The dialog can be styled with the `panel.gotoLine` theme 2701 + selector. 2702 + */var gotoLine=function gotoLine(view){var panel$1=panel.getPanel(view,createLineDialog);if(!panel$1){var effects=[dialogEffect.of(true)];if(view.state.field(dialogField,false)==null)effects.push(state.StateEffect.appendConfig.of([dialogField,baseTheme$1]));view.dispatch({effects:effects});panel$1=panel.getPanel(view,createLineDialog);}if(panel$1)panel$1.dom.querySelector("input").focus();return true;};var baseTheme$1=view.EditorView.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}});var defaultHighlightOptions={highlightWordAroundCursor:false,minSelectionLength:1,maxMatches:100};var highlightConfig=state.Facet.define({combine:function combine(options){return state.combineConfig(options,defaultHighlightOptions,{highlightWordAroundCursor:function highlightWordAroundCursor(a,b){return a||b;},minSelectionLength:Math.min,maxMatches:Math.min});}});/** 2703 + This extension highlights text that matches the selection. It uses 2704 + the `"cm-selectionMatch"` class for the highlighting. When 2705 + `highlightWordAroundCursor` is enabled, the word at the cursor 2706 + itself will be highlighted with `"cm-selectionMatch-main"`. 2707 + */function highlightSelectionMatches(options){var ext=[defaultTheme,matchHighlighter];if(options)ext.push(highlightConfig.of(options));return ext;}var matchDeco=view.Decoration.mark({"class":"cm-selectionMatch"});var mainMatchDeco=view.Decoration.mark({"class":"cm-selectionMatch cm-selectionMatch-main"});var matchHighlighter=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function _class17(view){_classCallCheck(this,_class17);this.decorations=this.getDeco(view);}_createClass(_class17,[{key:"update",value:function update(_update21){if(_update21.selectionSet||_update21.docChanged||_update21.viewportChanged)this.decorations=this.getDeco(_update21.view);}},{key:"getDeco",value:function getDeco(view$1){var conf=view$1.state.facet(highlightConfig);var state$1=view$1.state,sel=state$1.selection;if(sel.ranges.length>1)return view.Decoration.none;var range=sel.main,query,check=null;if(range.empty){if(!conf.highlightWordAroundCursor)return view.Decoration.none;var word=state$1.wordAt(range.head);if(!word)return view.Decoration.none;check=state$1.charCategorizer(range.head);query=state$1.sliceDoc(word.from,word.to);}else{var len=range.to-range.from;if(len<conf.minSelectionLength||len>200)return view.Decoration.none;query=state$1.sliceDoc(range.from,range.to).trim();if(!query)return view.Decoration.none;}var deco=[];var _iterator164=_createForOfIteratorHelper(view$1.visibleRanges),_step164;try{for(_iterator164.s();!(_step164=_iterator164.n()).done;){var part=_step164.value;var cursor=new SearchCursor(state$1.doc,query,part.from,part.to);while(!cursor.next().done){var _cursor$value=cursor.value,from=_cursor$value.from,to=_cursor$value.to;if(!check||(from==0||check(state$1.sliceDoc(from-1,from))!=state.CharCategory.Word)&&(to==state$1.doc.length||check(state$1.sliceDoc(to,to+1))!=state.CharCategory.Word)){if(check&&from<=range.from&&to>=range.to)deco.push(mainMatchDeco.range(from,to));else if(from>=range.to||to<=range.from)deco.push(matchDeco.range(from,to));if(deco.length>conf.maxMatches)return view.Decoration.none;}}}}catch(err){_iterator164.e(err);}finally{_iterator164.f();}return view.Decoration.set(deco);}}]);return _class17;}(),{decorations:function decorations(v){return v.decorations;}});var defaultTheme=view.EditorView.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}});// Select the words around the cursors. 2708 + var selectWord=function selectWord(_ref57){var state$1=_ref57.state,dispatch=_ref57.dispatch;var selection=state$1.selection;var newSel=state.EditorSelection.create(selection.ranges.map(function(range){return state$1.wordAt(range.head)||state.EditorSelection.cursor(range.head);}),selection.mainIndex);if(newSel.eq(selection))return false;dispatch(state$1.update({selection:newSel}));return true;};// Find next occurrence of query relative to last cursor. Wrap around 2709 + // the document if there are no more matches. 2710 + function findNextOccurrence(state,query){var _state$selection=state.selection,main=_state$selection.main,ranges=_state$selection.ranges;var word=state.wordAt(main.head),fullWord=word&&word.from==main.from&&word.to==main.to;var _loop16=function _loop16(_cycled,_cursor){_cursor.next();if(_cursor.done){if(_cycled){cursor=_cursor;{cycled=_cycled;return{v:null};}}_cursor=new SearchCursor(state.doc,query,0,Math.max(0,ranges[ranges.length-1].from-1));_cycled=true;}else{if(_cycled&&ranges.some(function(r){return r.from==_cursor.value.from;})){cursor=_cursor;{cycled=_cycled;return"continue";}}if(fullWord){var _word=state.wordAt(_cursor.value.from);if(!_word||_word.from!=_cursor.value.from||_word.to!=_cursor.value.to){cursor=_cursor;{cycled=_cycled;return"continue";}}}cycled=_cycled;cursor=_cursor;return{v:_cursor.value};}cycled=_cycled;cursor=_cursor;};for(var cycled=false,cursor=new SearchCursor(state.doc,query,ranges[ranges.length-1].to);;){var _ret5=_loop16(cycled,cursor);if(_ret5==="continue")continue;if(_typeof(_ret5)==="object")return _ret5.v;}}/** 2711 + Select next occurrence of the current selection. 2712 + Expand selection to the word when selection range is empty. 2713 + */var selectNextOccurrence=function selectNextOccurrence(_ref58){var state$1=_ref58.state,dispatch=_ref58.dispatch;var ranges=state$1.selection.ranges;if(ranges.some(function(sel){return sel.from===sel.to;}))return selectWord({state:state$1,dispatch:dispatch});var searchedText=state$1.sliceDoc(ranges[0].from,ranges[0].to);if(state$1.selection.ranges.some(function(r){return state$1.sliceDoc(r.from,r.to)!=searchedText;}))return false;var range=findNextOccurrence(state$1,searchedText);if(!range)return false;dispatch(state$1.update({selection:state$1.selection.addRange(state.EditorSelection.range(range.from,range.to),false),effects:view.EditorView.scrollIntoView(range.to)}));return true;};var searchConfigFacet=state.Facet.define({combine:function combine(configs){var _a;return{top:configs.reduce(function(val,conf){return val!==null&&val!==void 0?val:conf.top;},undefined)||false,caseSensitive:configs.reduce(function(val,conf){return val!==null&&val!==void 0?val:conf.caseSensitive||conf.matchCase;},undefined)||false,createPanel:((_a=configs.find(function(c){return c.createPanel;}))===null||_a===void 0?void 0:_a.createPanel)||function(view){return new SearchPanel(view);}};}});/** 2714 + Configure the behavior of the search extension. 2715 + */function searchConfig(config){return searchConfigFacet.of(config);}/** 2716 + A search query. Part of the editor's search state. 2717 + */var SearchQuery=/*#__PURE__*/function(){/** 2718 + Create a query object. 2719 + */function SearchQuery(config){_classCallCheck(this,SearchQuery);this.search=config.search;this.caseSensitive=!!config.caseSensitive;this.regexp=!!config.regexp;this.replace=config.replace||"";this.valid=!!this.search&&(!this.regexp||validRegExp(this.search));}/** 2720 + Compare this query to another query. 2721 + */_createClass(SearchQuery,[{key:"eq",value:function eq(other){return this.search==other.search&&this.replace==other.replace&&this.caseSensitive==other.caseSensitive&&this.regexp==other.regexp;}/** 2722 + @internal 2723 + */},{key:"create",value:function create(){return this.regexp?new RegExpQuery(this):new StringQuery(this);}}]);return SearchQuery;}();var QueryType=/*#__PURE__*/_createClass(function QueryType(spec){_classCallCheck(this,QueryType);this.spec=spec;});var StringQuery=/*#__PURE__*/function(_QueryType){_inherits(StringQuery,_QueryType);var _super37=_createSuper(StringQuery);function StringQuery(spec){var _this77;_classCallCheck(this,StringQuery);_this77=_super37.call(this,spec);_this77.unquoted=spec.search.replace(/\\([nrt\\])/g,function(_,ch){return ch=="n"?"\n":ch=="r"?"\r":ch=="t"?"\t":"\\";});return _this77;}_createClass(StringQuery,[{key:"cursor",value:function cursor(doc){var from=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var to=arguments.length>2&&arguments[2]!==undefined?arguments[2]:doc.length;return new SearchCursor(doc,this.unquoted,from,to,this.spec.caseSensitive?undefined:function(x){return x.toLowerCase();});}},{key:"nextMatch",value:function nextMatch(doc,curFrom,curTo){var cursor=this.cursor(doc,curTo).nextOverlapping();if(cursor.done)cursor=this.cursor(doc,0,curFrom).nextOverlapping();return cursor.done?null:cursor.value;}// Searching in reverse is, rather than implementing inverted search 2724 + // cursor, done by scanning chunk after chunk forward. 2725 + },{key:"prevMatchInRange",value:function prevMatchInRange(doc,from,to){for(var pos=to;;){var start=Math.max(from,pos-10000/* ChunkSize */-this.unquoted.length);var _cursor2=this.cursor(doc,start,pos),range=null;while(!_cursor2.nextOverlapping().done){range=_cursor2.value;}if(range)return range;if(start==from)return null;pos-=10000/* ChunkSize */;}}},{key:"prevMatch",value:function prevMatch(doc,curFrom,curTo){return this.prevMatchInRange(doc,0,curFrom)||this.prevMatchInRange(doc,curTo,doc.length);}},{key:"getReplacement",value:function getReplacement(_result){return this.spec.replace;}},{key:"matchAll",value:function matchAll(doc,limit){var cursor=this.cursor(doc),ranges=[];while(!cursor.next().done){if(ranges.length>=limit)return null;ranges.push(cursor.value);}return ranges;}},{key:"highlight",value:function highlight(doc,from,to,add){var cursor=this.cursor(doc,Math.max(0,from-this.unquoted.length),Math.min(to+this.unquoted.length,doc.length));while(!cursor.next().done){add(cursor.value.from,cursor.value.to);}}}]);return StringQuery;}(QueryType);var RegExpQuery=/*#__PURE__*/function(_QueryType2){_inherits(RegExpQuery,_QueryType2);var _super38=_createSuper(RegExpQuery);function RegExpQuery(){_classCallCheck(this,RegExpQuery);return _super38.apply(this,arguments);}_createClass(RegExpQuery,[{key:"cursor",value:function cursor(doc){var from=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var to=arguments.length>2&&arguments[2]!==undefined?arguments[2]:doc.length;return new RegExpCursor(doc,this.spec.search,this.spec.caseSensitive?undefined:{ignoreCase:true},from,to);}},{key:"nextMatch",value:function nextMatch(doc,curFrom,curTo){var cursor=this.cursor(doc,curTo).next();if(cursor.done)cursor=this.cursor(doc,0,curFrom).next();return cursor.done?null:cursor.value;}},{key:"prevMatchInRange",value:function prevMatchInRange(doc,from,to){for(var size=1;;size++){var start=Math.max(from,to-size*10000/* ChunkSize */);var _cursor3=this.cursor(doc,start,to),range=null;while(!_cursor3.next().done){range=_cursor3.value;}if(range&&(start==from||range.from>start+10))return range;if(start==from)return null;}}},{key:"prevMatch",value:function prevMatch(doc,curFrom,curTo){return this.prevMatchInRange(doc,0,curFrom)||this.prevMatchInRange(doc,curTo,doc.length);}},{key:"getReplacement",value:function getReplacement(result){return this.spec.replace.replace(/\$([$&\d+])/g,function(m,i){return i=="$"?"$":i=="&"?result.match[0]:i!="0"&&+i<result.match.length?result.match[i]:m;});}},{key:"matchAll",value:function matchAll(doc,limit){var cursor=this.cursor(doc),ranges=[];while(!cursor.next().done){if(ranges.length>=limit)return null;ranges.push(cursor.value);}return ranges;}},{key:"highlight",value:function highlight(doc,from,to,add){var cursor=this.cursor(doc,Math.max(0,from-250/* HighlightMargin */),Math.min(to+250/* HighlightMargin */,doc.length));while(!cursor.next().done){add(cursor.value.from,cursor.value.to);}}}]);return RegExpQuery;}(QueryType);/** 2726 + A state effect that updates the current search query. 2727 + */var setSearchQuery=state.StateEffect.define();var togglePanel=state.StateEffect.define();var searchState=state.StateField.define({create:function create(state){return new SearchState(defaultQuery(state).create(),createSearchPanel);},update:function update(value,tr){var _iterator165=_createForOfIteratorHelper(tr.effects),_step165;try{for(_iterator165.s();!(_step165=_iterator165.n()).done;){var effect=_step165.value;if(effect.is(setSearchQuery))value=new SearchState(effect.value.create(),value.panel);else if(effect.is(togglePanel))value=new SearchState(value.query,effect.value?createSearchPanel:null);}}catch(err){_iterator165.e(err);}finally{_iterator165.f();}return value;},provide:function provide(f){return panel.showPanel.from(f,function(val){return val.panel;});}});/** 2728 + Get the current search query from an editor state. 2729 + */function getSearchQuery(state){var curState=state.field(searchState,false);return curState?curState.query.spec:defaultQuery(state);}var SearchState=/*#__PURE__*/_createClass(function SearchState(query,panel){_classCallCheck(this,SearchState);this.query=query;this.panel=panel;});var matchMark=view.Decoration.mark({"class":"cm-searchMatch"}),selectedMatchMark=view.Decoration.mark({"class":"cm-searchMatch cm-searchMatch-selected"});var searchHighlighter=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function _class18(view){_classCallCheck(this,_class18);this.view=view;this.decorations=this.highlight(view.state.field(searchState));}_createClass(_class18,[{key:"update",value:function update(_update22){var state=_update22.state.field(searchState);if(state!=_update22.startState.field(searchState)||_update22.docChanged||_update22.selectionSet)this.decorations=this.highlight(state);}},{key:"highlight",value:function highlight(_ref59){var query=_ref59.query,panel=_ref59.panel;if(!panel||!query.spec.valid)return view.Decoration.none;var view$1=this.view;var builder=new rangeset.RangeSetBuilder();for(var _i92=0,ranges=view$1.visibleRanges,l=ranges.length;_i92<l;_i92++){var _ranges$_i2=ranges[_i92],from=_ranges$_i2.from,to=_ranges$_i2.to;while(_i92<l-1&&to>ranges[_i92+1].from-2*250/* HighlightMargin */){to=ranges[++_i92].to;}query.highlight(view$1.state.doc,from,to,function(from,to){var selected=view$1.state.selection.ranges.some(function(r){return r.from==from&&r.to==to;});builder.add(from,to,selected?selectedMatchMark:matchMark);});}return builder.finish();}}]);return _class18;}(),{decorations:function decorations(v){return v.decorations;}});function searchCommand(f){return function(view){var state=view.state.field(searchState,false);return state&&state.query.spec.valid?f(view,state):openSearchPanel(view);};}/** 2730 + Open the search panel if it isn't already open, and move the 2731 + selection to the first match after the current main selection. 2732 + Will wrap around to the start of the document when it reaches the 2733 + end. 2734 + */var findNext=searchCommand(function(view,_ref60){var query=_ref60.query;var _view$state$selection=view.state.selection.main,from=_view$state$selection.from,to=_view$state$selection.to;var next=query.nextMatch(view.state.doc,from,to);if(!next||next.from==from&&next.to==to)return false;view.dispatch({selection:{anchor:next.from,head:next.to},scrollIntoView:true,effects:announceMatch(view,next),userEvent:"select.search"});return true;});/** 2735 + Move the selection to the previous instance of the search query, 2736 + before the current main selection. Will wrap past the start 2737 + of the document to start searching at the end again. 2738 + */var findPrevious=searchCommand(function(view,_ref61){var query=_ref61.query;var state=view.state,_state$selection$main=state.selection.main,from=_state$selection$main.from,to=_state$selection$main.to;var range=query.prevMatch(state.doc,from,to);if(!range)return false;view.dispatch({selection:{anchor:range.from,head:range.to},scrollIntoView:true,effects:announceMatch(view,range),userEvent:"select.search"});return true;});/** 2739 + Select all instances of the search query. 2740 + */var selectMatches=searchCommand(function(view,_ref62){var query=_ref62.query;var ranges=query.matchAll(view.state.doc,1000);if(!ranges||!ranges.length)return false;view.dispatch({selection:state.EditorSelection.create(ranges.map(function(r){return state.EditorSelection.range(r.from,r.to);})),userEvent:"select.search.matches"});return true;});/** 2741 + Select all instances of the currently selected text. 2742 + */var selectSelectionMatches=function selectSelectionMatches(_ref63){var state$1=_ref63.state,dispatch=_ref63.dispatch;var sel=state$1.selection;if(sel.ranges.length>1||sel.main.empty)return false;var _sel$main=sel.main,from=_sel$main.from,to=_sel$main.to;var ranges=[],main=0;for(var cur=new SearchCursor(state$1.doc,state$1.sliceDoc(from,to));!cur.next().done;){if(ranges.length>1000)return false;if(cur.value.from==from)main=ranges.length;ranges.push(state.EditorSelection.range(cur.value.from,cur.value.to));}dispatch(state$1.update({selection:state.EditorSelection.create(ranges,main),userEvent:"select.search.matches"}));return true;};/** 2743 + Replace the current match of the search query. 2744 + */var replaceNext=searchCommand(function(view,_ref64){var query=_ref64.query;var state=view.state,_state$selection$main2=state.selection.main,from=_state$selection$main2.from,to=_state$selection$main2.to;if(state.readOnly)return false;var next=query.nextMatch(state.doc,from,from);if(!next)return false;var changes=[],selection,replacement;if(next.from==from&&next.to==to){replacement=state.toText(query.getReplacement(next));changes.push({from:next.from,to:next.to,insert:replacement});next=query.nextMatch(state.doc,next.from,next.to);}if(next){var off=changes.length==0||changes[0].from>=next.to?0:next.to-next.from-replacement.length;selection={anchor:next.from-off,head:next.to-off};}view.dispatch({changes:changes,selection:selection,scrollIntoView:!!selection,effects:next?announceMatch(view,next):undefined,userEvent:"input.replace"});return true;});/** 2745 + Replace all instances of the search query with the given 2746 + replacement. 2747 + */var replaceAll=searchCommand(function(view,_ref65){var query=_ref65.query;if(view.state.readOnly)return false;var changes=query.matchAll(view.state.doc,1e9).map(function(match){var from=match.from,to=match.to;return{from:from,to:to,insert:query.getReplacement(match)};});if(!changes.length)return false;view.dispatch({changes:changes,userEvent:"input.replace.all"});return true;});function createSearchPanel(view){return view.state.facet(searchConfigFacet).createPanel(view);}function defaultQuery(state,fallback){var _a;var sel=state.selection.main;var selText=sel.empty||sel.to>sel.from+100?"":state.sliceDoc(sel.from,sel.to);var caseSensitive=(_a=fallback===null||fallback===void 0?void 0:fallback.caseSensitive)!==null&&_a!==void 0?_a:state.facet(searchConfigFacet).caseSensitive;return fallback&&!selText?fallback:new SearchQuery({search:selText.replace(/\n/g,"\\n"),caseSensitive:caseSensitive});}/** 2748 + Make sure the search panel is open and focused. 2749 + */var openSearchPanel=function openSearchPanel(view){var state$1=view.state.field(searchState,false);if(state$1&&state$1.panel){var panel$1=panel.getPanel(view,createSearchPanel);if(!panel$1)return false;var searchInput=panel$1.dom.querySelector("[name=search]");if(searchInput!=view.root.activeElement){var query=defaultQuery(view.state,state$1.query.spec);if(query.valid)view.dispatch({effects:setSearchQuery.of(query)});searchInput.focus();searchInput.select();}}else{view.dispatch({effects:[togglePanel.of(true),state$1?setSearchQuery.of(defaultQuery(view.state,state$1.query.spec)):state.StateEffect.appendConfig.of(searchExtensions)]});}return true;};/** 2750 + Close the search panel. 2751 + */var closeSearchPanel=function closeSearchPanel(view){var state=view.state.field(searchState,false);if(!state||!state.panel)return false;var panel$1=panel.getPanel(view,createSearchPanel);if(panel$1&&panel$1.dom.contains(view.root.activeElement))view.focus();view.dispatch({effects:togglePanel.of(false)});return true;};/** 2752 + Default search-related key bindings. 2753 + 2754 + - Mod-f: [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) 2755 + - F3, Mod-g: [`findNext`](https://codemirror.net/6/docs/ref/#search.findNext) 2756 + - Shift-F3, Shift-Mod-g: [`findPrevious`](https://codemirror.net/6/docs/ref/#search.findPrevious) 2757 + - Alt-g: [`gotoLine`](https://codemirror.net/6/docs/ref/#search.gotoLine) 2758 + - Mod-d: [`selectNextOccurrence`](https://codemirror.net/6/docs/ref/#search.selectNextOccurrence) 2759 + */var searchKeymap=[{key:"Mod-f",run:openSearchPanel,scope:"editor search-panel"},{key:"F3",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:true},{key:"Mod-g",run:findNext,shift:findPrevious,scope:"editor search-panel",preventDefault:true},{key:"Escape",run:closeSearchPanel,scope:"editor search-panel"},{key:"Mod-Shift-l",run:selectSelectionMatches},{key:"Alt-g",run:gotoLine},{key:"Mod-d",run:selectNextOccurrence,preventDefault:true}];var SearchPanel=/*#__PURE__*/function(){function SearchPanel(view){var _this78=this;_classCallCheck(this,SearchPanel);this.view=view;var query=this.query=view.state.field(searchState).query.spec;this.commit=this.commit.bind(this);this.searchField=elt__default["default"]("input",{value:query.search,placeholder:phrase(view,"Find"),"aria-label":phrase(view,"Find"),"class":"cm-textfield",name:"search",onchange:this.commit,onkeyup:this.commit});this.replaceField=elt__default["default"]("input",{value:query.replace,placeholder:phrase(view,"Replace"),"aria-label":phrase(view,"Replace"),"class":"cm-textfield",name:"replace",onchange:this.commit,onkeyup:this.commit});this.caseField=elt__default["default"]("input",{type:"checkbox",name:"case",checked:query.caseSensitive,onchange:this.commit});this.reField=elt__default["default"]("input",{type:"checkbox",name:"re",checked:query.regexp,onchange:this.commit});function button(name,onclick,content){return elt__default["default"]("button",{"class":"cm-button",name:name,onclick:onclick,type:"button"},content);}this.dom=elt__default["default"]("div",{onkeydown:function onkeydown(e){return _this78.keydown(e);},"class":"cm-search"},[this.searchField,button("next",function(){return findNext(view);},[phrase(view,"next")]),button("prev",function(){return findPrevious(view);},[phrase(view,"previous")]),button("select",function(){return selectMatches(view);},[phrase(view,"all")]),elt__default["default"]("label",null,[this.caseField,phrase(view,"match case")]),elt__default["default"]("label",null,[this.reField,phrase(view,"regexp")])].concat(_toConsumableArray(view.state.readOnly?[]:[elt__default["default"]("br"),this.replaceField,button("replace",function(){return replaceNext(view);},[phrase(view,"replace")]),button("replaceAll",function(){return replaceAll(view);},[phrase(view,"replace all")]),elt__default["default"]("button",{name:"close",onclick:function onclick(){return closeSearchPanel(view);},"aria-label":phrase(view,"close"),type:"button"},["×"])])));}_createClass(SearchPanel,[{key:"commit",value:function commit(){var query=new SearchQuery({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,replace:this.replaceField.value});if(!query.eq(this.query)){this.query=query;this.view.dispatch({effects:setSearchQuery.of(query)});}}},{key:"keydown",value:function keydown(e){if(view.runScopeHandlers(this.view,e,"search-panel")){e.preventDefault();}else if(e.keyCode==13&&e.target==this.searchField){e.preventDefault();(e.shiftKey?findPrevious:findNext)(this.view);}else if(e.keyCode==13&&e.target==this.replaceField){e.preventDefault();replaceNext(this.view);}}},{key:"update",value:function update(_update23){var _iterator166=_createForOfIteratorHelper(_update23.transactions),_step166;try{for(_iterator166.s();!(_step166=_iterator166.n()).done;){var tr=_step166.value;var _iterator167=_createForOfIteratorHelper(tr.effects),_step167;try{for(_iterator167.s();!(_step167=_iterator167.n()).done;){var effect=_step167.value;if(effect.is(setSearchQuery)&&!effect.value.eq(this.query))this.setQuery(effect.value);}}catch(err){_iterator167.e(err);}finally{_iterator167.f();}}}catch(err){_iterator166.e(err);}finally{_iterator166.f();}}},{key:"setQuery",value:function setQuery(query){this.query=query;this.searchField.value=query.search;this.replaceField.value=query.replace;this.caseField.checked=query.caseSensitive;this.reField.checked=query.regexp;}},{key:"mount",value:function mount(){this.searchField.select();}},{key:"pos",get:function get(){return 80;}},{key:"top",get:function get(){return this.view.state.facet(searchConfigFacet).top;}}]);return SearchPanel;}();function phrase(view,phrase){return view.state.phrase(phrase);}var AnnounceMargin=30;var Break=/[\s\.,:;?!]/;function announceMatch(view$1,_ref66){var from=_ref66.from,to=_ref66.to;var lineStart=view$1.state.doc.lineAt(from).from,lineEnd=view$1.state.doc.lineAt(to).to;var start=Math.max(lineStart,from-AnnounceMargin),end=Math.min(lineEnd,to+AnnounceMargin);var text=view$1.state.sliceDoc(start,end);if(start!=lineStart){for(var _i93=0;_i93<AnnounceMargin;_i93++){if(!Break.test(text[_i93+1])&&Break.test(text[_i93])){text=text.slice(_i93);break;}}}if(end!=lineEnd){for(var _i94=text.length-1;_i94>text.length-AnnounceMargin;_i94--){if(!Break.test(text[_i94-1])&&Break.test(text[_i94])){text=text.slice(0,_i94);break;}}}return view.EditorView.announce.of("".concat(view$1.state.phrase("current match"),". ").concat(text," ").concat(view$1.state.phrase("on line")," ").concat(view$1.state.doc.lineAt(from).number));}var baseTheme=view.EditorView.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}});var searchExtensions=[searchState,state.Prec.lowest(searchHighlighter),baseTheme];exports.RegExpCursor=RegExpCursor;exports.SearchCursor=SearchCursor;exports.SearchQuery=SearchQuery;exports.closeSearchPanel=closeSearchPanel;exports.findNext=findNext;exports.findPrevious=findPrevious;exports.getSearchQuery=getSearchQuery;exports.gotoLine=gotoLine;exports.highlightSelectionMatches=highlightSelectionMatches;exports.openSearchPanel=openSearchPanel;exports.replaceAll=replaceAll;exports.replaceNext=replaceNext;exports.searchConfig=searchConfig;exports.searchKeymap=searchKeymap;exports.selectMatches=selectMatches;exports.selectNextOccurrence=selectNextOccurrence;exports.selectSelectionMatches=selectSelectionMatches;exports.setSearchQuery=setSearchQuery;},{"@codemirror/panel":17,"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/text":24,"@codemirror/view":21,"crelt":29}],21:[function(require,module,exports){arguments[4][5][0].apply(exports,arguments);},{"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/text":24,"dup":5,"style-mod":30,"w3c-keyname":31}],22:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var text=require('@codemirror/text');var DefaultSplit=/\r\n?|\n/;/** 2760 + Distinguishes different ways in which positions can be mapped. 2761 + */exports.MapMode=void 0;(function(MapMode){/** 2762 + Map a position to a valid new position, even when its context 2763 + was deleted. 2764 + */MapMode[MapMode["Simple"]=0]="Simple";/** 2765 + Return null if deletion happens across the position. 2766 + */MapMode[MapMode["TrackDel"]=1]="TrackDel";/** 2767 + Return null if the character _before_ the position is deleted. 2768 + */MapMode[MapMode["TrackBefore"]=2]="TrackBefore";/** 2769 + Return null if the character _after_ the position is deleted. 2770 + */MapMode[MapMode["TrackAfter"]=3]="TrackAfter";})(exports.MapMode||(exports.MapMode={}));/** 2771 + A change description is a variant of [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) 2772 + that doesn't store the inserted text. As such, it can't be 2773 + applied, but is cheaper to store and manipulate. 2774 + */var ChangeDesc=/*#__PURE__*/function(){// Sections are encoded as pairs of integers. The first is the 2775 + // length in the current document, and the second is -1 for 2776 + // unaffected sections, and the length of the replacement content 2777 + // otherwise. So an insertion would be (0, n>0), a deletion (n>0, 2778 + // 0), and a replacement two positive numbers. 2779 + /** 2780 + @internal 2781 + */function ChangeDesc(/** 2782 + @internal 2783 + */sections){_classCallCheck(this,ChangeDesc);this.sections=sections;}/** 2784 + The length of the document before the change. 2785 + */_createClass(ChangeDesc,[{key:"length",get:function get(){var result=0;for(var _i95=0;_i95<this.sections.length;_i95+=2){result+=this.sections[_i95];}return result;}/** 2786 + The length of the document after the change. 2787 + */},{key:"newLength",get:function get(){var result=0;for(var _i96=0;_i96<this.sections.length;_i96+=2){var ins=this.sections[_i96+1];result+=ins<0?this.sections[_i96]:ins;}return result;}/** 2788 + False when there are actual changes in this set. 2789 + */},{key:"empty",get:function get(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0;}/** 2790 + Iterate over the unchanged parts left by these changes. 2791 + */},{key:"iterGaps",value:function iterGaps(f){for(var _i97=0,posA=0,posB=0;_i97<this.sections.length;){var len=this.sections[_i97++],ins=this.sections[_i97++];if(ins<0){f(posA,posB,len);posB+=len;}else{posB+=ins;}posA+=len;}}/** 2792 + Iterate over the ranges changed by these changes. (See 2793 + [`ChangeSet.iterChanges`](https://codemirror.net/6/docs/ref/#state.ChangeSet.iterChanges) for a 2794 + variant that also provides you with the inserted text.) 2795 + 2796 + When `individual` is true, adjacent changes (which are kept 2797 + separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are 2798 + reported separately. 2799 + */},{key:"iterChangedRanges",value:function iterChangedRanges(f){var individual=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;_iterChanges(this,f,individual);}/** 2800 + Get a description of the inverted form of these changes. 2801 + */},{key:"invertedDesc",get:function get(){var sections=[];for(var _i98=0;_i98<this.sections.length;){var len=this.sections[_i98++],ins=this.sections[_i98++];if(ins<0)sections.push(len,ins);else sections.push(ins,len);}return new ChangeDesc(sections);}/** 2802 + Compute the combined effect of applying another set of changes 2803 + after this one. The length of the document after this set should 2804 + match the length before `other`. 2805 + */},{key:"composeDesc",value:function composeDesc(other){return this.empty?other:other.empty?this:composeSets(this,other);}/** 2806 + Map this description, which should start with the same document 2807 + as `other`, over another set of changes, so that it can be 2808 + applied after it. When `before` is true, map as if the changes 2809 + in `other` happened before the ones in `this`. 2810 + */},{key:"mapDesc",value:function mapDesc(other){var before=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return other.empty?this:mapSet(this,other,before);}},{key:"mapPos",value:function mapPos(pos){var assoc=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var mode=arguments.length>2&&arguments[2]!==undefined?arguments[2]:exports.MapMode.Simple;var posA=0,posB=0;for(var _i99=0;_i99<this.sections.length;){var len=this.sections[_i99++],ins=this.sections[_i99++],endA=posA+len;if(ins<0){if(endA>pos)return posB+(pos-posA);posB+=len;}else{if(mode!=exports.MapMode.Simple&&endA>=pos&&(mode==exports.MapMode.TrackDel&&posA<pos&&endA>pos||mode==exports.MapMode.TrackBefore&&posA<pos||mode==exports.MapMode.TrackAfter&&endA>pos))return null;if(endA>pos||endA==pos&&assoc<0&&!len)return pos==posA||assoc<0?posB:posB+ins;posB+=ins;}posA=endA;}if(pos>posA)throw new RangeError("Position ".concat(pos," is out of range for changeset of length ").concat(posA));return posB;}/** 2811 + Check whether these changes touch a given range. When one of the 2812 + changes entirely covers the range, the string `"cover"` is 2813 + returned. 2814 + */},{key:"touchesRange",value:function touchesRange(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;for(var _i100=0,pos=0;_i100<this.sections.length&&pos<=to;){var len=this.sections[_i100++],ins=this.sections[_i100++],end=pos+len;if(ins>=0&&pos<=to&&end>=from)return pos<from&&end>to?"cover":true;pos=end;}return false;}/** 2815 + @internal 2816 + */},{key:"toString",value:function toString(){var result="";for(var _i101=0;_i101<this.sections.length;){var len=this.sections[_i101++],ins=this.sections[_i101++];result+=(result?" ":"")+len+(ins>=0?":"+ins:"");}return result;}/** 2817 + Serialize this change desc to a JSON-representable value. 2818 + */},{key:"toJSON",value:function toJSON(){return this.sections;}/** 2819 + Create a change desc from its JSON representation (as produced 2820 + by [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeDesc.toJSON). 2821 + */}],[{key:"fromJSON",value:function fromJSON(json){if(!Array.isArray(json)||json.length%2||json.some(function(a){return typeof a!="number";}))throw new RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(json);}}]);return ChangeDesc;}();/** 2822 + A change set represents a group of modifications to a document. It 2823 + stores the document length, and can only be applied to documents 2824 + with exactly that length. 2825 + */var ChangeSet=/*#__PURE__*/function(_ChangeDesc){_inherits(ChangeSet,_ChangeDesc);var _super39=_createSuper(ChangeSet);/** 2826 + @internal 2827 + */function ChangeSet(sections,/** 2828 + @internal 2829 + */inserted){var _this79;_classCallCheck(this,ChangeSet);_this79=_super39.call(this,sections);_this79.inserted=inserted;return _this79;}/** 2830 + Apply the changes to a document, returning the modified 2831 + document. 2832 + */_createClass(ChangeSet,[{key:"apply",value:function apply(doc){if(this.length!=doc.length)throw new RangeError("Applying change set to a document with the wrong length");_iterChanges(this,function(fromA,toA,fromB,_toB,text){return doc=doc.replace(fromB,fromB+(toA-fromA),text);},false);return doc;}},{key:"mapDesc",value:function mapDesc(other){var before=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return mapSet(this,other,before,true);}/** 2833 + Given the document as it existed _before_ the changes, return a 2834 + change set that represents the inverse of this set, which could 2835 + be used to go from the document created by the changes back to 2836 + the document as it existed before the changes. 2837 + */},{key:"invert",value:function invert(doc){var sections=this.sections.slice(),inserted=[];for(var _i102=0,pos=0;_i102<sections.length;_i102+=2){var len=sections[_i102],ins=sections[_i102+1];if(ins>=0){sections[_i102]=ins;sections[_i102+1]=len;var index=_i102>>1;while(inserted.length<index){inserted.push(text.Text.empty);}inserted.push(len?doc.slice(pos,pos+len):text.Text.empty);}pos+=len;}return new ChangeSet(sections,inserted);}/** 2838 + Combine two subsequent change sets into a single set. `other` 2839 + must start in the document produced by `this`. If `this` goes 2840 + `docA` → `docB` and `other` represents `docB` → `docC`, the 2841 + returned value will represent the change `docA` → `docC`. 2842 + */},{key:"compose",value:function compose(other){return this.empty?other:other.empty?this:composeSets(this,other,true);}/** 2843 + Given another change set starting in the same document, maps this 2844 + change set over the other, producing a new change set that can be 2845 + applied to the document produced by applying `other`. When 2846 + `before` is `true`, order changes as if `this` comes before 2847 + `other`, otherwise (the default) treat `other` as coming first. 2848 + 2849 + Given two changes `A` and `B`, `A.compose(B.map(A))` and 2850 + `B.compose(A.map(B, true))` will produce the same document. This 2851 + provides a basic form of [operational 2852 + transformation](https://en.wikipedia.org/wiki/Operational_transformation), 2853 + and can be used for collaborative editing. 2854 + */},{key:"map",value:function map(other){var before=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return other.empty?this:mapSet(this,other,before,true);}/** 2855 + Iterate over the changed ranges in the document, calling `f` for 2856 + each. 2857 + 2858 + When `individual` is true, adjacent changes are reported 2859 + separately. 2860 + */},{key:"iterChanges",value:function iterChanges(f){var individual=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;_iterChanges(this,f,individual);}/** 2861 + Get a [change description](https://codemirror.net/6/docs/ref/#state.ChangeDesc) for this change 2862 + set. 2863 + */},{key:"desc",get:function get(){return new ChangeDesc(this.sections);}/** 2864 + @internal 2865 + */},{key:"filter",value:function filter(ranges){var resultSections=[],resultInserted=[],filteredSections=[];var iter=new SectionIter(this);done:for(var _i103=0,pos=0;;){var next=_i103==ranges.length?1e9:ranges[_i103++];while(pos<next||pos==next&&iter.len==0){if(iter.done)break done;var len=Math.min(iter.len,next-pos);addSection(filteredSections,len,-1);var ins=iter.ins==-1?-1:iter.off==0?iter.ins:0;addSection(resultSections,len,ins);if(ins>0)addInsert(resultInserted,resultSections,iter.text);iter.forward(len);pos+=len;}var end=ranges[_i103++];while(pos<end){if(iter.done)break done;var _len=Math.min(iter.len,end-pos);addSection(resultSections,_len,-1);addSection(filteredSections,_len,iter.ins==-1?-1:iter.off==0?iter.ins:0);iter.forward(_len);pos+=_len;}}return{changes:new ChangeSet(resultSections,resultInserted),filtered:new ChangeDesc(filteredSections)};}/** 2866 + Serialize this change set to a JSON-representable value. 2867 + */},{key:"toJSON",value:function toJSON(){var parts=[];for(var _i104=0;_i104<this.sections.length;_i104+=2){var len=this.sections[_i104],ins=this.sections[_i104+1];if(ins<0)parts.push(len);else if(ins==0)parts.push([len]);else parts.push([len].concat(this.inserted[_i104>>1].toJSON()));}return parts;}/** 2868 + Create a change set for the given changes, for a document of the 2869 + given length, using `lineSep` as line separator. 2870 + */}],[{key:"of",value:function of(changes,length,lineSep){var sections=[],inserted=[],pos=0;var total=null;function flush(){var force=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;if(!force&&!sections.length)return;if(pos<length)addSection(sections,length-pos,-1);var set=new ChangeSet(sections,inserted);total=total?total.compose(set.map(total)):set;sections=[];inserted=[];pos=0;}function process(spec){if(Array.isArray(spec)){var _iterator168=_createForOfIteratorHelper(spec),_step168;try{for(_iterator168.s();!(_step168=_iterator168.n()).done;){var sub=_step168.value;process(sub);}}catch(err){_iterator168.e(err);}finally{_iterator168.f();}}else if(spec instanceof ChangeSet){if(spec.length!=length)throw new RangeError("Mismatched change set length (got ".concat(spec.length,", expected ").concat(length,")"));flush();total=total?total.compose(spec.map(total)):spec;}else{var from=spec.from,_spec$to=spec.to,to=_spec$to===void 0?from:_spec$to,insert=spec.insert;if(from>to||from<0||to>length)throw new RangeError("Invalid change range ".concat(from," to ").concat(to," (in doc of length ").concat(length,")"));var insText=!insert?text.Text.empty:typeof insert=="string"?text.Text.of(insert.split(lineSep||DefaultSplit)):insert;var insLen=insText.length;if(from==to&&insLen==0)return;if(from<pos)flush();if(from>pos)addSection(sections,from-pos,-1);addSection(sections,to-from,insLen);addInsert(inserted,sections,insText);pos=to;}}process(changes);flush(!total);return total;}/** 2871 + Create an empty changeset of the given length. 2872 + */},{key:"empty",value:function empty(length){return new ChangeSet(length?[length,-1]:[],[]);}/** 2873 + Create a changeset from its JSON representation (as produced by 2874 + [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeSet.toJSON). 2875 + */},{key:"fromJSON",value:function fromJSON(json){if(!Array.isArray(json))throw new RangeError("Invalid JSON representation of ChangeSet");var sections=[],inserted=[];for(var _i105=0;_i105<json.length;_i105++){var part=json[_i105];if(typeof part=="number"){sections.push(part,-1);}else if(!Array.isArray(part)||typeof part[0]!="number"||part.some(function(e,i){return i&&typeof e!="string";})){throw new RangeError("Invalid JSON representation of ChangeSet");}else if(part.length==1){sections.push(part[0],0);}else{while(inserted.length<_i105){inserted.push(text.Text.empty);}inserted[_i105]=text.Text.of(part.slice(1));sections.push(part[0],inserted[_i105].length);}}return new ChangeSet(sections,inserted);}}]);return ChangeSet;}(ChangeDesc);function addSection(sections,len,ins){var forceJoin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(len==0&&ins<=0)return;var last=sections.length-2;if(last>=0&&ins<=0&&ins==sections[last+1])sections[last]+=len;else if(len==0&&sections[last]==0)sections[last+1]+=ins;else if(forceJoin){sections[last]+=len;sections[last+1]+=ins;}else sections.push(len,ins);}function addInsert(values,sections,value){if(value.length==0)return;var index=sections.length-2>>1;if(index<values.length){values[values.length-1]=values[values.length-1].append(value);}else{while(values.length<index){values.push(text.Text.empty);}values.push(value);}}function _iterChanges(desc,f,individual){var inserted=desc.inserted;for(var posA=0,posB=0,_i106=0;_i106<desc.sections.length;){var len=desc.sections[_i106++],ins=desc.sections[_i106++];if(ins<0){posA+=len;posB+=len;}else{var endA=posA,endB=posB,text$1=text.Text.empty;for(;;){endA+=len;endB+=ins;if(ins&&inserted)text$1=text$1.append(inserted[_i106-2>>1]);if(individual||_i106==desc.sections.length||desc.sections[_i106+1]<0)break;len=desc.sections[_i106++];ins=desc.sections[_i106++];}f(posA,endA,posB,endB,text$1);posA=endA;posB=endB;}}}function mapSet(setA,setB,before){var mkSet=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var sections=[],insert=mkSet?[]:null;var a=new SectionIter(setA),b=new SectionIter(setB);for(var posA=0,posB=0;;){if(a.ins==-1){posA+=a.len;a.next();}else if(b.ins==-1&&posB<posA){var skip=Math.min(b.len,posA-posB);b.forward(skip);addSection(sections,skip,-1);posB+=skip;}else if(b.ins>=0&&(a.done||posB<posA||posB==posA&&(b.len<a.len||b.len==a.len&&!before))){addSection(sections,b.ins,-1);while(posA>posB&&!a.done&&posA+a.len<posB+b.len){posA+=a.len;a.next();}posB+=b.len;b.next();}else if(a.ins>=0){var len=0,end=posA+a.len;for(;;){if(b.ins>=0&&posB>posA&&posB+b.len<end){len+=b.ins;posB+=b.len;b.next();}else if(b.ins==-1&&posB<end){var _skip=Math.min(b.len,end-posB);len+=_skip;b.forward(_skip);posB+=_skip;}else{break;}}addSection(sections,len,a.ins);if(insert)addInsert(insert,sections,a.text);posA=end;a.next();}else if(a.done&&b.done){return insert?new ChangeSet(sections,insert):new ChangeDesc(sections);}else{throw new Error("Mismatched change set lengths");}}}function composeSets(setA,setB){var mkSet=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var sections=[];var insert=mkSet?[]:null;var a=new SectionIter(setA),b=new SectionIter(setB);for(var open=false;;){if(a.done&&b.done){return insert?new ChangeSet(sections,insert):new ChangeDesc(sections);}else if(a.ins==0){// Deletion in A 2876 + addSection(sections,a.len,0,open);a.next();}else if(b.len==0&&!b.done){// Insertion in B 2877 + addSection(sections,0,b.ins,open);if(insert)addInsert(insert,sections,b.text);b.next();}else if(a.done||b.done){throw new Error("Mismatched change set lengths");}else{var len=Math.min(a.len2,b.len),sectionLen=sections.length;if(a.ins==-1){var insB=b.ins==-1?-1:b.off?0:b.ins;addSection(sections,len,insB,open);if(insert&&insB)addInsert(insert,sections,b.text);}else if(b.ins==-1){addSection(sections,a.off?0:a.len,len,open);if(insert)addInsert(insert,sections,a.textBit(len));}else{addSection(sections,a.off?0:a.len,b.off?0:b.ins,open);if(insert&&!b.off)addInsert(insert,sections,b.text);}open=(a.ins>len||b.ins>=0&&b.len>len)&&(open||sections.length>sectionLen);a.forward2(len);b.forward(len);}}}var SectionIter=/*#__PURE__*/function(){function SectionIter(set){_classCallCheck(this,SectionIter);this.set=set;this.i=0;this.next();}_createClass(SectionIter,[{key:"next",value:function next(){var sections=this.set.sections;if(this.i<sections.length){this.len=sections[this.i++];this.ins=sections[this.i++];}else{this.len=0;this.ins=-2;}this.off=0;}},{key:"done",get:function get(){return this.ins==-2;}},{key:"len2",get:function get(){return this.ins<0?this.len:this.ins;}},{key:"text",get:function get(){var inserted=this.set.inserted,index=this.i-2>>1;return index>=inserted.length?text.Text.empty:inserted[index];}},{key:"textBit",value:function textBit(len){var inserted=this.set.inserted,index=this.i-2>>1;return index>=inserted.length&&!len?text.Text.empty:inserted[index].slice(this.off,len==null?undefined:this.off+len);}},{key:"forward",value:function forward(len){if(len==this.len)this.next();else{this.len-=len;this.off+=len;}}},{key:"forward2",value:function forward2(len){if(this.ins==-1)this.forward(len);else if(len==this.ins)this.next();else{this.ins-=len;this.off+=len;}}}]);return SectionIter;}();/** 2878 + A single selection range. When 2879 + [`allowMultipleSelections`](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections) 2880 + is enabled, a [selection](https://codemirror.net/6/docs/ref/#state.EditorSelection) may hold 2881 + multiple ranges. By default, selections hold exactly one range. 2882 + */var SelectionRange=/*#__PURE__*/function(){/** 2883 + @internal 2884 + */function SelectionRange(/** 2885 + The lower boundary of the range. 2886 + */from,/** 2887 + The upper boundary of the range. 2888 + */to,flags){_classCallCheck(this,SelectionRange);this.from=from;this.to=to;this.flags=flags;}/** 2889 + The anchor of the range—the side that doesn't move when you 2890 + extend it. 2891 + */_createClass(SelectionRange,[{key:"anchor",get:function get(){return this.flags&16/* Inverted */?this.to:this.from;}/** 2892 + The head of the range, which is moved when the range is 2893 + [extended](https://codemirror.net/6/docs/ref/#state.SelectionRange.extend). 2894 + */},{key:"head",get:function get(){return this.flags&16/* Inverted */?this.from:this.to;}/** 2895 + True when `anchor` and `head` are at the same position. 2896 + */},{key:"empty",get:function get(){return this.from==this.to;}/** 2897 + If this is a cursor that is explicitly associated with the 2898 + character on one of its sides, this returns the side. -1 means 2899 + the character before its position, 1 the character after, and 0 2900 + means no association. 2901 + */},{key:"assoc",get:function get(){return this.flags&4/* AssocBefore */?-1:this.flags&8/* AssocAfter */?1:0;}/** 2902 + The bidirectional text level associated with this cursor, if 2903 + any. 2904 + */},{key:"bidiLevel",get:function get(){var level=this.flags&3/* BidiLevelMask */;return level==3?null:level;}/** 2905 + The goal column (stored vertical offset) associated with a 2906 + cursor. This is used to preserve the vertical position when 2907 + [moving](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) across 2908 + lines of different length. 2909 + */},{key:"goalColumn",get:function get(){var value=this.flags>>5/* GoalColumnOffset */;return value==33554431/* NoGoalColumn */?undefined:value;}/** 2910 + Map this range through a change, producing a valid range in the 2911 + updated document. 2912 + */},{key:"map",value:function map(change){var assoc=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;var from=change.mapPos(this.from,assoc),to=change.mapPos(this.to,assoc);return from==this.from&&to==this.to?this:new SelectionRange(from,to,this.flags);}/** 2913 + Extend this range to cover at least `from` to `to`. 2914 + */},{key:"extend",value:function extend(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;if(from<=this.anchor&&to>=this.anchor)return EditorSelection.range(from,to);var head=Math.abs(from-this.anchor)>Math.abs(to-this.anchor)?from:to;return EditorSelection.range(this.anchor,head);}/** 2915 + Compare this range to another range. 2916 + */},{key:"eq",value:function eq(other){return this.anchor==other.anchor&&this.head==other.head;}/** 2917 + Return a JSON-serializable object representing the range. 2918 + */},{key:"toJSON",value:function toJSON(){return{anchor:this.anchor,head:this.head};}/** 2919 + Convert a JSON representation of a range to a `SelectionRange` 2920 + instance. 2921 + */}],[{key:"fromJSON",value:function fromJSON(json){if(!json||typeof json.anchor!="number"||typeof json.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(json.anchor,json.head);}}]);return SelectionRange;}();/** 2922 + An editor selection holds one or more selection ranges. 2923 + */var EditorSelection=/*#__PURE__*/function(){/** 2924 + @internal 2925 + */function EditorSelection(/** 2926 + The ranges in the selection, sorted by position. Ranges cannot 2927 + overlap (but they may touch, if they aren't empty). 2928 + */ranges){var mainIndex=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;_classCallCheck(this,EditorSelection);this.ranges=ranges;this.mainIndex=mainIndex;}/** 2929 + Map a selection through a change. Used to adjust the selection 2930 + position for changes. 2931 + */_createClass(EditorSelection,[{key:"map",value:function map(change){var assoc=arguments.length>1&&arguments[1]!==undefined?arguments[1]:-1;if(change.empty)return this;return EditorSelection.create(this.ranges.map(function(r){return r.map(change,assoc);}),this.mainIndex);}/** 2932 + Compare this selection to another selection. 2933 + */},{key:"eq",value:function eq(other){if(this.ranges.length!=other.ranges.length||this.mainIndex!=other.mainIndex)return false;for(var _i107=0;_i107<this.ranges.length;_i107++){if(!this.ranges[_i107].eq(other.ranges[_i107]))return false;}return true;}/** 2934 + Get the primary selection range. Usually, you should make sure 2935 + your code applies to _all_ ranges, by using methods like 2936 + [`changeByRange`](https://codemirror.net/6/docs/ref/#state.EditorState.changeByRange). 2937 + */},{key:"main",get:function get(){return this.ranges[this.mainIndex];}/** 2938 + Make sure the selection only has one range. Returns a selection 2939 + holding only the main range from this selection. 2940 + */},{key:"asSingle",value:function asSingle(){return this.ranges.length==1?this:new EditorSelection([this.main]);}/** 2941 + Extend this selection with an extra range. 2942 + */},{key:"addRange",value:function addRange(range){var main=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return EditorSelection.create([range].concat(this.ranges),main?0:this.mainIndex+1);}/** 2943 + Replace a given range with another range, and then normalize the 2944 + selection to merge and sort ranges if necessary. 2945 + */},{key:"replaceRange",value:function replaceRange(range){var which=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.mainIndex;var ranges=this.ranges.slice();ranges[which]=range;return EditorSelection.create(ranges,this.mainIndex);}/** 2946 + Convert this selection to an object that can be serialized to 2947 + JSON. 2948 + */},{key:"toJSON",value:function toJSON(){return{ranges:this.ranges.map(function(r){return r.toJSON();}),main:this.mainIndex};}/** 2949 + Create a selection from a JSON representation. 2950 + */}],[{key:"fromJSON",value:function fromJSON(json){if(!json||!Array.isArray(json.ranges)||typeof json.main!="number"||json.main>=json.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(json.ranges.map(function(r){return SelectionRange.fromJSON(r);}),json.main);}/** 2951 + Create a selection holding a single range. 2952 + */},{key:"single",value:function single(anchor){var head=arguments.length>1&&arguments[1]!==undefined?arguments[1]:anchor;return new EditorSelection([EditorSelection.range(anchor,head)],0);}/** 2953 + Sort and merge the given set of ranges, creating a valid 2954 + selection. 2955 + */},{key:"create",value:function create(ranges){var mainIndex=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;if(ranges.length==0)throw new RangeError("A selection needs at least one range");for(var pos=0,_i108=0;_i108<ranges.length;_i108++){var range=ranges[_i108];if(range.empty?range.from<=pos:range.from<pos)return normalized(ranges.slice(),mainIndex);pos=range.to;}return new EditorSelection(ranges,mainIndex);}/** 2956 + Create a cursor selection range at the given position. You can 2957 + safely ignore the optional arguments in most situations. 2958 + */},{key:"cursor",value:function cursor(pos){var assoc=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var bidiLevel=arguments.length>2?arguments[2]:undefined;var goalColumn=arguments.length>3?arguments[3]:undefined;return new SelectionRange(pos,pos,(assoc==0?0:assoc<0?4/* AssocBefore */:8/* AssocAfter */)|(bidiLevel==null?3:Math.min(2,bidiLevel))|(goalColumn!==null&&goalColumn!==void 0?goalColumn:33554431/* NoGoalColumn */)<<5/* GoalColumnOffset */);}/** 2959 + Create a selection range. 2960 + */},{key:"range",value:function range(anchor,head,goalColumn){var goal=(goalColumn!==null&&goalColumn!==void 0?goalColumn:33554431/* NoGoalColumn */)<<5/* GoalColumnOffset */;return head<anchor?new SelectionRange(head,anchor,16/* Inverted */|goal):new SelectionRange(anchor,head,goal);}}]);return EditorSelection;}();function normalized(ranges){var mainIndex=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var main=ranges[mainIndex];ranges.sort(function(a,b){return a.from-b.from;});mainIndex=ranges.indexOf(main);for(var _i109=1;_i109<ranges.length;_i109++){var range=ranges[_i109],prev=ranges[_i109-1];if(range.empty?range.from<=prev.to:range.from<prev.to){var from=prev.from,to=Math.max(range.to,prev.to);if(_i109<=mainIndex)mainIndex--;ranges.splice(--_i109,2,range.anchor>range.head?EditorSelection.range(to,from):EditorSelection.range(from,to));}}return new EditorSelection(ranges,mainIndex);}function checkSelection(selection,docLength){var _iterator169=_createForOfIteratorHelper(selection.ranges),_step169;try{for(_iterator169.s();!(_step169=_iterator169.n()).done;){var range=_step169.value;if(range.to>docLength)throw new RangeError("Selection points outside of document");}}catch(err){_iterator169.e(err);}finally{_iterator169.f();}}var nextID=0;/** 2961 + A facet is a labeled value that is associated with an editor 2962 + state. It takes inputs from any number of extensions, and combines 2963 + those into a single output value. 2964 + 2965 + Examples of facets are the [theme](https://codemirror.net/6/docs/ref/#view.EditorView^theme) styles 2966 + associated with an editor or the [tab 2967 + size](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) (which is reduced to a single 2968 + value, using the input with the hightest precedence). 2969 + */var Facet=/*#__PURE__*/function(){function Facet(/** 2970 + @internal 2971 + */combine,/** 2972 + @internal 2973 + */compareInput,/** 2974 + @internal 2975 + */compare,isStatic,/** 2976 + @internal 2977 + */extensions){_classCallCheck(this,Facet);this.combine=combine;this.compareInput=compareInput;this.compare=compare;this.isStatic=isStatic;this.extensions=extensions;/** 2978 + @internal 2979 + */this.id=nextID++;this["default"]=combine([]);}/** 2980 + Define a new facet. 2981 + */_createClass(Facet,[{key:"of",value:/** 2982 + Returns an extension that adds the given value for this facet. 2983 + */function of(value){return new FacetProvider([],this,0/* Static */,value);}/** 2984 + Create an extension that computes a value for the facet from a 2985 + state. You must take care to declare the parts of the state that 2986 + this value depends on, since your function is only called again 2987 + for a new state when one of those parts changed. 2988 + 2989 + In most cases, you'll want to use the 2990 + [`provide`](https://codemirror.net/6/docs/ref/#state.StateField^define^config.provide) option when 2991 + defining a field instead. 2992 + */},{key:"compute",value:function compute(deps,get){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(deps,this,1/* Single */,get);}/** 2993 + Create an extension that computes zero or more values for this 2994 + facet from a state. 2995 + */},{key:"computeN",value:function computeN(deps,get){if(this.isStatic)throw new Error("Can't compute a static facet");return new FacetProvider(deps,this,2/* Multi */,get);}},{key:"from",value:function from(field,get){if(!get)get=function get(x){return x;};return this.compute([field],function(state){return get(state.field(field));});}}],[{key:"define",value:function define(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new Facet(config.combine||function(a){return a;},config.compareInput||function(a,b){return a===b;},config.compare||(!config.combine?sameArray:function(a,b){return a===b;}),!!config["static"],config.enables);}}]);return Facet;}();function sameArray(a,b){return a==b||a.length==b.length&&a.every(function(e,i){return e===b[i];});}var FacetProvider=/*#__PURE__*/function(){function FacetProvider(dependencies,facet,type,value){_classCallCheck(this,FacetProvider);this.dependencies=dependencies;this.facet=facet;this.type=type;this.value=value;this.id=nextID++;}_createClass(FacetProvider,[{key:"dynamicSlot",value:function dynamicSlot(addresses){var _a;var getter=this.value;var compare=this.facet.compareInput;var idx=addresses[this.id]>>1,multi=this.type==2/* Multi */;var depDoc=false,depSel=false,depAddrs=[];var _iterator170=_createForOfIteratorHelper(this.dependencies),_step170;try{for(_iterator170.s();!(_step170=_iterator170.n()).done;){var dep=_step170.value;if(dep=="doc")depDoc=true;else if(dep=="selection")depSel=true;else if((((_a=addresses[dep.id])!==null&&_a!==void 0?_a:1)&1)==0)depAddrs.push(addresses[dep.id]);}}catch(err){_iterator170.e(err);}finally{_iterator170.f();}return function(state,tr){var oldVal=state.values[idx];if(oldVal===Uninitialized){state.values[idx]=getter(state);return 1/* Changed */;}if(tr){var depChanged=depDoc&&tr.docChanged||depSel&&(tr.docChanged||tr.selection)||depAddrs.some(function(addr){return(ensureAddr(state,addr)&1/* Changed */)>0;});if(depChanged){var newVal=getter(state);if(multi?!compareArray(newVal,oldVal,compare):!compare(newVal,oldVal)){state.values[idx]=newVal;return 1/* Changed */;}}}return 0;};}}]);return FacetProvider;}();function compareArray(a,b,compare){if(a.length!=b.length)return false;for(var _i110=0;_i110<a.length;_i110++){if(!compare(a[_i110],b[_i110]))return false;}return true;}function dynamicFacetSlot(addresses,facet,providers){var providerAddrs=providers.map(function(p){return addresses[p.id];});var providerTypes=providers.map(function(p){return p.type;});var dynamic=providerAddrs.filter(function(p){return!(p&1);});var idx=addresses[facet.id]>>1;return function(state,tr){var oldVal=state.values[idx],changed=oldVal===Uninitialized||!tr;var _iterator171=_createForOfIteratorHelper(dynamic),_step171;try{for(_iterator171.s();!(_step171=_iterator171.n()).done;){var dynAddr=_step171.value;if(ensureAddr(state,dynAddr)&1/* Changed */)changed=true;}}catch(err){_iterator171.e(err);}finally{_iterator171.f();}if(!changed)return 0;var values=[];for(var _i111=0;_i111<providerAddrs.length;_i111++){var _value2=getAddr(state,providerAddrs[_i111]);if(providerTypes[_i111]==2/* Multi */){var _iterator172=_createForOfIteratorHelper(_value2),_step172;try{for(_iterator172.s();!(_step172=_iterator172.n()).done;){var val=_step172.value;values.push(val);}}catch(err){_iterator172.e(err);}finally{_iterator172.f();}}else values.push(_value2);}var value=facet.combine(values);if(facet.compare(value,oldVal))return 0;state.values[idx]=value;return 1/* Changed */;};}var initField=Facet.define({"static":true});/** 2996 + Fields can store additional information in an editor state, and 2997 + keep it in sync with the rest of the state. 2998 + */var StateField=/*#__PURE__*/function(){function StateField(/** 2999 + @internal 3000 + */id,createF,updateF,compareF,/** 3001 + @internal 3002 + */spec){_classCallCheck(this,StateField);this.id=id;this.createF=createF;this.updateF=updateF;this.compareF=compareF;this.spec=spec;/** 3003 + @internal 3004 + */this.provides=undefined;}/** 3005 + Define a state field. 3006 + */_createClass(StateField,[{key:"create",value:function create(state){var _this80=this;var init=state.facet(initField).find(function(i){return i.field==_this80;});return((init===null||init===void 0?void 0:init.create)||this.createF)(state);}/** 3007 + @internal 3008 + */},{key:"slot",value:function slot(addresses){var _this81=this;var idx=addresses[this.id]>>1;return function(state,tr){var oldVal=state.values[idx];if(oldVal===Uninitialized){state.values[idx]=_this81.create(state);return 1/* Changed */;}if(tr){var value=_this81.updateF(oldVal,tr);if(!_this81.compareF(oldVal,value)){state.values[idx]=value;return 1/* Changed */;}}return 0;};}/** 3009 + Returns an extension that enables this field and overrides the 3010 + way it is initialized. Can be useful when you need to provide a 3011 + non-default starting value for the field. 3012 + */},{key:"init",value:function init(create){return[this,initField.of({field:this,create:create})];}/** 3013 + State field instances can be used as 3014 + [`Extension`](https://codemirror.net/6/docs/ref/#state.Extension) values to enable the field in a 3015 + given state. 3016 + */},{key:"extension",get:function get(){return this;}}],[{key:"define",value:function define(config){var field=new StateField(nextID++,config.create,config.update,config.compare||function(a,b){return a===b;},config);if(config.provide)field.provides=config.provide(field);return field;}}]);return StateField;}();var Prec_={lowest:4,low:3,"default":2,high:1,highest:0};function prec(value){return function(ext){return new PrecExtension(ext,value);};}/** 3017 + By default extensions are registered in the order they are found 3018 + in the flattened form of nested array that was provided. 3019 + Individual extension values can be assigned a precedence to 3020 + override this. Extensions that do not have a precedence set get 3021 + the precedence of the nearest parent with a precedence, or 3022 + [`default`](https://codemirror.net/6/docs/ref/#state.Prec.default) if there is no such parent. The 3023 + final ordering of extensions is determined by first sorting by 3024 + precedence and then by order within each precedence. 3025 + */var Prec={/** 3026 + The lowest precedence level. Meant for things that should end up 3027 + near the end of the extension order. 3028 + */lowest:prec(Prec_.lowest),/** 3029 + A lower-than-default precedence, for extensions. 3030 + */low:prec(Prec_.low),/** 3031 + The default precedence, which is also used for extensions 3032 + without an explicit precedence. 3033 + */"default":prec(Prec_["default"]),/** 3034 + A higher-than-default precedence, for extensions that should 3035 + come before those with default precedence. 3036 + */high:prec(Prec_.high),/** 3037 + The highest precedence level, for extensions that should end up 3038 + near the start of the precedence ordering. 3039 + */highest:prec(Prec_.highest),// FIXME Drop these in some future breaking version 3040 + /** 3041 + Backwards-compatible synonym for `Prec.lowest`. 3042 + */fallback:prec(Prec_.lowest),/** 3043 + Backwards-compatible synonym for `Prec.high`. 3044 + */extend:prec(Prec_.high),/** 3045 + Backwards-compatible synonym for `Prec.highest`. 3046 + */override:prec(Prec_.highest)};var PrecExtension=/*#__PURE__*/_createClass(function PrecExtension(inner,prec){_classCallCheck(this,PrecExtension);this.inner=inner;this.prec=prec;});/** 3047 + Extension compartments can be used to make a configuration 3048 + dynamic. By [wrapping](https://codemirror.net/6/docs/ref/#state.Compartment.of) part of your 3049 + configuration in a compartment, you can later 3050 + [replace](https://codemirror.net/6/docs/ref/#state.Compartment.reconfigure) that part through a 3051 + transaction. 3052 + */var Compartment=/*#__PURE__*/function(){function Compartment(){_classCallCheck(this,Compartment);}_createClass(Compartment,[{key:"of",value:/** 3053 + Create an instance of this compartment to add to your [state 3054 + configuration](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions). 3055 + */function of(ext){return new CompartmentInstance(this,ext);}/** 3056 + Create an [effect](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) that 3057 + reconfigures this compartment. 3058 + */},{key:"reconfigure",value:function reconfigure(content){return Compartment.reconfigure.of({compartment:this,extension:content});}/** 3059 + Get the current content of the compartment in the state, or 3060 + `undefined` if it isn't present. 3061 + */},{key:"get",value:function get(state){return state.config.compartments.get(this);}}]);return Compartment;}();var CompartmentInstance=/*#__PURE__*/_createClass(function CompartmentInstance(compartment,inner){_classCallCheck(this,CompartmentInstance);this.compartment=compartment;this.inner=inner;});var Configuration=/*#__PURE__*/function(){function Configuration(base,compartments,dynamicSlots,address,staticValues){_classCallCheck(this,Configuration);this.base=base;this.compartments=compartments;this.dynamicSlots=dynamicSlots;this.address=address;this.staticValues=staticValues;this.statusTemplate=[];while(this.statusTemplate.length<dynamicSlots.length){this.statusTemplate.push(0/* Unresolved */);}}_createClass(Configuration,[{key:"staticFacet",value:function staticFacet(facet){var addr=this.address[facet.id];return addr==null?facet["default"]:this.staticValues[addr>>1];}}],[{key:"resolve",value:function resolve(base,compartments,oldState){var fields=[];var facets=Object.create(null);var newCompartments=new Map();var _iterator173=_createForOfIteratorHelper(flatten(base,compartments,newCompartments)),_step173;try{for(_iterator173.s();!(_step173=_iterator173.n()).done;){var ext=_step173.value;if(ext instanceof StateField)fields.push(ext);else(facets[ext.facet.id]||(facets[ext.facet.id]=[])).push(ext);}}catch(err){_iterator173.e(err);}finally{_iterator173.f();}var address=Object.create(null);var staticValues=[];var dynamicSlots=[];var _loop17=function _loop17(){var field=_fields[_i112];address[field.id]=dynamicSlots.length<<1;dynamicSlots.push(function(a){return field.slot(a);});};for(var _i112=0,_fields=fields;_i112<_fields.length;_i112++){_loop17();}var _loop18=function _loop18(id){var providers=facets[id],facet=providers[0].facet;if(providers.every(function(p){return p.type==0;}/* Static */)){address[facet.id]=staticValues.length<<1|1;var value=facet.combine(providers.map(function(p){return p.value;}));var oldAddr=oldState?oldState.config.address[facet.id]:null;if(oldAddr!=null){var oldVal=getAddr(oldState,oldAddr);if(facet.compare(value,oldVal))value=oldVal;}staticValues.push(value);}else{var _iterator174=_createForOfIteratorHelper(providers),_step174;try{var _loop19=function _loop19(){var p=_step174.value;if(p.type==0/* Static */){address[p.id]=staticValues.length<<1|1;staticValues.push(p.value);}else{address[p.id]=dynamicSlots.length<<1;dynamicSlots.push(function(a){return p.dynamicSlot(a);});}};for(_iterator174.s();!(_step174=_iterator174.n()).done;){_loop19();}}catch(err){_iterator174.e(err);}finally{_iterator174.f();}address[facet.id]=dynamicSlots.length<<1;dynamicSlots.push(function(a){return dynamicFacetSlot(a,facet,providers);});}};for(var id in facets){_loop18(id);}return new Configuration(base,newCompartments,dynamicSlots.map(function(f){return f(address);}),address,staticValues);}}]);return Configuration;}();function flatten(extension,compartments,newCompartments){var result=[[],[],[],[],[]];var seen=new Map();function inner(ext,prec){var known=seen.get(ext);if(known!=null){if(known>=prec)return;var found=result[known].indexOf(ext);if(found>-1)result[known].splice(found,1);if(ext instanceof CompartmentInstance)newCompartments["delete"](ext.compartment);}seen.set(ext,prec);if(Array.isArray(ext)){var _iterator175=_createForOfIteratorHelper(ext),_step175;try{for(_iterator175.s();!(_step175=_iterator175.n()).done;){var e=_step175.value;inner(e,prec);}}catch(err){_iterator175.e(err);}finally{_iterator175.f();}}else if(ext instanceof CompartmentInstance){if(newCompartments.has(ext.compartment))throw new RangeError("Duplicate use of compartment in extensions");var content=compartments.get(ext.compartment)||ext.inner;newCompartments.set(ext.compartment,content);inner(content,prec);}else if(ext instanceof PrecExtension){inner(ext.inner,ext.prec);}else if(ext instanceof StateField){result[prec].push(ext);if(ext.provides)inner(ext.provides,prec);}else if(ext instanceof FacetProvider){result[prec].push(ext);if(ext.facet.extensions)inner(ext.facet.extensions,prec);}else{var _content=ext.extension;if(!_content)throw new Error("Unrecognized extension value in extension set (".concat(ext,"). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks."));inner(_content,prec);}}inner(extension,Prec_["default"]);return result.reduce(function(a,b){return a.concat(b);});}var Uninitialized={};function ensureAddr(state,addr){if(addr&1)return 2/* Computed */;var idx=addr>>1;var status=state.status[idx];if(status==4/* Computing */)throw new Error("Cyclic dependency between fields and/or facets");if(status&2/* Computed */)return status;state.status[idx]=4/* Computing */;var changed=state.config.dynamicSlots[idx](state,state.applying);return state.status[idx]=2/* Computed */|changed;}function getAddr(state,addr){return addr&1?state.config.staticValues[addr>>1]:state.values[addr>>1];}var languageData=Facet.define();var allowMultipleSelections=Facet.define({combine:function combine(values){return values.some(function(v){return v;});},"static":true});var lineSeparator=Facet.define({combine:function combine(values){return values.length?values[0]:undefined;},"static":true});var changeFilter=Facet.define();var transactionFilter=Facet.define();var transactionExtender=Facet.define();var readOnly=Facet.define({combine:function combine(values){return values.length?values[0]:false;}});/** 3062 + Annotations are tagged values that are used to add metadata to 3063 + transactions in an extensible way. They should be used to model 3064 + things that effect the entire transaction (such as its [time 3065 + stamp](https://codemirror.net/6/docs/ref/#state.Transaction^time) or information about its 3066 + [origin](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent)). For effects that happen 3067 + _alongside_ the other changes made by the transaction, [state 3068 + effects](https://codemirror.net/6/docs/ref/#state.StateEffect) are more appropriate. 3069 + */var Annotation=/*#__PURE__*/function(){/** 3070 + @internal 3071 + */function Annotation(/** 3072 + The annotation type. 3073 + */type,/** 3074 + The value of this annotation. 3075 + */value){_classCallCheck(this,Annotation);this.type=type;this.value=value;}/** 3076 + Define a new type of annotation. 3077 + */_createClass(Annotation,null,[{key:"define",value:function define(){return new AnnotationType();}}]);return Annotation;}();/** 3078 + Marker that identifies a type of [annotation](https://codemirror.net/6/docs/ref/#state.Annotation). 3079 + */var AnnotationType=/*#__PURE__*/function(){function AnnotationType(){_classCallCheck(this,AnnotationType);}_createClass(AnnotationType,[{key:"of",value:/** 3080 + Create an instance of this annotation. 3081 + */function of(value){return new Annotation(this,value);}}]);return AnnotationType;}();/** 3082 + Representation of a type of state effect. Defined with 3083 + [`StateEffect.define`](https://codemirror.net/6/docs/ref/#state.StateEffect^define). 3084 + */var StateEffectType=/*#__PURE__*/function(){/** 3085 + @internal 3086 + */function StateEffectType(// The `any` types in these function types are there to work 3087 + // around TypeScript issue #37631, where the type guard on 3088 + // `StateEffect.is` mysteriously stops working when these properly 3089 + // have type `Value`. 3090 + /** 3091 + @internal 3092 + */map){_classCallCheck(this,StateEffectType);this.map=map;}/** 3093 + Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this 3094 + type. 3095 + */_createClass(StateEffectType,[{key:"of",value:function of(value){return new StateEffect(this,value);}}]);return StateEffectType;}();/** 3096 + State effects can be used to represent additional effects 3097 + associated with a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction.effects). They 3098 + are often useful to model changes to custom [state 3099 + fields](https://codemirror.net/6/docs/ref/#state.StateField), when those changes aren't implicit in 3100 + document or selection changes. 3101 + */var StateEffect=/*#__PURE__*/function(){/** 3102 + @internal 3103 + */function StateEffect(/** 3104 + @internal 3105 + */type,/** 3106 + The value of this effect. 3107 + */value){_classCallCheck(this,StateEffect);this.type=type;this.value=value;}/** 3108 + Map this effect through a position mapping. Will return 3109 + `undefined` when that ends up deleting the effect. 3110 + */_createClass(StateEffect,[{key:"map",value:function map(mapping){var mapped=this.type.map(this.value,mapping);return mapped===undefined?undefined:mapped==this.value?this:new StateEffect(this.type,mapped);}/** 3111 + Tells you whether this effect object is of a given 3112 + [type](https://codemirror.net/6/docs/ref/#state.StateEffectType). 3113 + */},{key:"is",value:function is(type){return this.type==type;}/** 3114 + Define a new effect type. The type parameter indicates the type 3115 + of values that his effect holds. 3116 + */}],[{key:"define",value:function define(){var spec=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return new StateEffectType(spec.map||function(v){return v;});}/** 3117 + Map an array of effects through a change set. 3118 + */},{key:"mapEffects",value:function mapEffects(effects,mapping){if(!effects.length)return effects;var result=[];var _iterator176=_createForOfIteratorHelper(effects),_step176;try{for(_iterator176.s();!(_step176=_iterator176.n()).done;){var effect=_step176.value;var mapped=effect.map(mapping);if(mapped)result.push(mapped);}}catch(err){_iterator176.e(err);}finally{_iterator176.f();}return result;}}]);return StateEffect;}();/** 3119 + This effect can be used to reconfigure the root extensions of 3120 + the editor. Doing this will discard any extensions 3121 + [appended](https://codemirror.net/6/docs/ref/#state.StateEffect^appendConfig), but does not reset 3122 + the content of [reconfigured](https://codemirror.net/6/docs/ref/#state.Compartment.reconfigure) 3123 + compartments. 3124 + */StateEffect.reconfigure=StateEffect.define();/** 3125 + Append extensions to the top-level configuration of the editor. 3126 + */StateEffect.appendConfig=StateEffect.define();/** 3127 + Changes to the editor state are grouped into transactions. 3128 + Typically, a user action creates a single transaction, which may 3129 + contain any number of document changes, may change the selection, 3130 + or have other effects. Create a transaction by calling 3131 + [`EditorState.update`](https://codemirror.net/6/docs/ref/#state.EditorState.update). 3132 + */var Transaction=/*#__PURE__*/function(){/** 3133 + @internal 3134 + */function Transaction(/** 3135 + The state from which the transaction starts. 3136 + */startState,/** 3137 + The document changes made by this transaction. 3138 + */changes,/** 3139 + The selection set by this transaction, or undefined if it 3140 + doesn't explicitly set a selection. 3141 + */selection,/** 3142 + The effects added to the transaction. 3143 + */effects,/** 3144 + @internal 3145 + */annotations,/** 3146 + Whether the selection should be scrolled into view after this 3147 + transaction is dispatched. 3148 + */scrollIntoView){_classCallCheck(this,Transaction);this.startState=startState;this.changes=changes;this.selection=selection;this.effects=effects;this.annotations=annotations;this.scrollIntoView=scrollIntoView;/** 3149 + @internal 3150 + */this._doc=null;/** 3151 + @internal 3152 + */this._state=null;if(selection)checkSelection(selection,changes.newLength);if(!annotations.some(function(a){return a.type==Transaction.time;}))this.annotations=annotations.concat(Transaction.time.of(Date.now()));}/** 3153 + The new document produced by the transaction. Contrary to 3154 + [`.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state)`.doc`, accessing this won't 3155 + force the entire new state to be computed right away, so it is 3156 + recommended that [transaction 3157 + filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) use this getter 3158 + when they need to look at the new document. 3159 + */_createClass(Transaction,[{key:"newDoc",get:function get(){return this._doc||(this._doc=this.changes.apply(this.startState.doc));}/** 3160 + The new selection produced by the transaction. If 3161 + [`this.selection`](https://codemirror.net/6/docs/ref/#state.Transaction.selection) is undefined, 3162 + this will [map](https://codemirror.net/6/docs/ref/#state.EditorSelection.map) the start state's 3163 + current selection through the changes made by the transaction. 3164 + */},{key:"newSelection",get:function get(){return this.selection||this.startState.selection.map(this.changes);}/** 3165 + The new state created by the transaction. Computed on demand 3166 + (but retained for subsequent access), so itis recommended not to 3167 + access it in [transaction 3168 + filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) when possible. 3169 + */},{key:"state",get:function get(){if(!this._state)this.startState.applyTransaction(this);return this._state;}/** 3170 + Get the value of the given annotation type, if any. 3171 + */},{key:"annotation",value:function annotation(type){var _iterator177=_createForOfIteratorHelper(this.annotations),_step177;try{for(_iterator177.s();!(_step177=_iterator177.n()).done;){var ann=_step177.value;if(ann.type==type)return ann.value;}}catch(err){_iterator177.e(err);}finally{_iterator177.f();}return undefined;}/** 3172 + Indicates whether the transaction changed the document. 3173 + */},{key:"docChanged",get:function get(){return!this.changes.empty;}/** 3174 + Indicates whether this transaction reconfigures the state 3175 + (through a [configuration compartment](https://codemirror.net/6/docs/ref/#state.Compartment) or 3176 + with a top-level configuration 3177 + [effect](https://codemirror.net/6/docs/ref/#state.StateEffect^reconfigure). 3178 + */},{key:"reconfigured",get:function get(){return this.startState.config!=this.state.config;}/** 3179 + Returns true if the transaction has a [user 3180 + event](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent) annotation that is equal to 3181 + or more specific than `event`. For example, if the transaction 3182 + has `"select.pointer"` as user event, `"select"` and 3183 + `"select.pointer"` will match it. 3184 + */},{key:"isUserEvent",value:function isUserEvent(event){var e=this.annotation(Transaction.userEvent);return!!(e&&(e==event||e.length>event.length&&e.slice(0,event.length)==event&&e[event.length]=="."));}}]);return Transaction;}();/** 3185 + Annotation used to store transaction timestamps. 3186 + */Transaction.time=Annotation.define();/** 3187 + Annotation used to associate a transaction with a user interface 3188 + event. Holds a string identifying the event, using a 3189 + dot-separated format to support attaching more specific 3190 + information. The events used by the core libraries are: 3191 + 3192 + - `"input"` when content is entered 3193 + - `"input.type"` for typed input 3194 + - `"input.type.compose"` for composition 3195 + - `"input.paste"` for pasted input 3196 + - `"input.drop"` when adding content with drag-and-drop 3197 + - `"input.complete"` when autocompleting 3198 + - `"delete"` when the user deletes content 3199 + - `"delete.selection"` when deleting the selection 3200 + - `"delete.forward"` when deleting forward from the selection 3201 + - `"delete.backward"` when deleting backward from the selection 3202 + - `"delete.cut"` when cutting to the clipboard 3203 + - `"move"` when content is moved 3204 + - `"move.drop"` when content is moved within the editor through drag-and-drop 3205 + - `"select"` when explicitly changing the selection 3206 + - `"select.pointer"` when selecting with a mouse or other pointing device 3207 + - `"undo"` and `"redo"` for history actions 3208 + 3209 + Use [`isUserEvent`](https://codemirror.net/6/docs/ref/#state.Transaction.isUserEvent) to check 3210 + whether the annotation matches a given event. 3211 + */Transaction.userEvent=Annotation.define();/** 3212 + Annotation indicating whether a transaction should be added to 3213 + the undo history or not. 3214 + */Transaction.addToHistory=Annotation.define();/** 3215 + Annotation indicating (when present and true) that a transaction 3216 + represents a change made by some other actor, not the user. This 3217 + is used, for example, to tag other people's changes in 3218 + collaborative editing. 3219 + */Transaction.remote=Annotation.define();function joinRanges(a,b){var result=[];for(var iA=0,iB=0;;){var from=void 0,to=void 0;if(iA<a.length&&(iB==b.length||b[iB]>=a[iA])){from=a[iA++];to=a[iA++];}else if(iB<b.length){from=b[iB++];to=b[iB++];}else return result;if(!result.length||result[result.length-1]<from)result.push(from,to);else if(result[result.length-1]<to)result[result.length-1]=to;}}function mergeTransaction(a,b,sequential){var _a;var mapForA,mapForB,changes;if(sequential){mapForA=b.changes;mapForB=ChangeSet.empty(b.changes.length);changes=a.changes.compose(b.changes);}else{mapForA=b.changes.map(a.changes);mapForB=a.changes.mapDesc(b.changes,true);changes=a.changes.compose(mapForA);}return{changes:changes,selection:b.selection?b.selection.map(mapForB):(_a=a.selection)===null||_a===void 0?void 0:_a.map(mapForA),effects:StateEffect.mapEffects(a.effects,mapForA).concat(StateEffect.mapEffects(b.effects,mapForB)),annotations:a.annotations.length?a.annotations.concat(b.annotations):b.annotations,scrollIntoView:a.scrollIntoView||b.scrollIntoView};}function resolveTransactionInner(state,spec,docSize){var sel=spec.selection,annotations=asArray(spec.annotations);if(spec.userEvent)annotations=annotations.concat(Transaction.userEvent.of(spec.userEvent));return{changes:spec.changes instanceof ChangeSet?spec.changes:ChangeSet.of(spec.changes||[],docSize,state.facet(lineSeparator)),selection:sel&&(sel instanceof EditorSelection?sel:EditorSelection.single(sel.anchor,sel.head)),effects:asArray(spec.effects),annotations:annotations,scrollIntoView:!!spec.scrollIntoView};}function resolveTransaction(state,specs,filter){var s=resolveTransactionInner(state,specs.length?specs[0]:{},state.doc.length);if(specs.length&&specs[0].filter===false)filter=false;for(var _i113=1;_i113<specs.length;_i113++){if(specs[_i113].filter===false)filter=false;var seq=!!specs[_i113].sequential;s=mergeTransaction(s,resolveTransactionInner(state,specs[_i113],seq?s.changes.newLength:state.doc.length),seq);}var tr=new Transaction(state,s.changes,s.selection,s.effects,s.annotations,s.scrollIntoView);return extendTransaction(filter?filterTransaction(tr):tr);}// Finish a transaction by applying filters if necessary. 3220 + function filterTransaction(tr){var state=tr.startState;// Change filters 3221 + var result=true;var _iterator178=_createForOfIteratorHelper(state.facet(changeFilter)),_step178;try{for(_iterator178.s();!(_step178=_iterator178.n()).done;){var filter=_step178.value;var value=filter(tr);if(value===false){result=false;break;}if(Array.isArray(value))result=result===true?value:joinRanges(result,value);}}catch(err){_iterator178.e(err);}finally{_iterator178.f();}if(result!==true){var changes,back;if(result===false){back=tr.changes.invertedDesc;changes=ChangeSet.empty(state.doc.length);}else{var filtered=tr.changes.filter(result);changes=filtered.changes;back=filtered.filtered.invertedDesc;}tr=new Transaction(state,changes,tr.selection&&tr.selection.map(back),StateEffect.mapEffects(tr.effects,back),tr.annotations,tr.scrollIntoView);}// Transaction filters 3222 + var filters=state.facet(transactionFilter);for(var _i114=filters.length-1;_i114>=0;_i114--){var _filtered=filters[_i114](tr);if(_filtered instanceof Transaction)tr=_filtered;else if(Array.isArray(_filtered)&&_filtered.length==1&&_filtered[0]instanceof Transaction)tr=_filtered[0];else tr=resolveTransaction(state,asArray(_filtered),false);}return tr;}function extendTransaction(tr){var state=tr.startState,extenders=state.facet(transactionExtender),spec=tr;for(var _i115=extenders.length-1;_i115>=0;_i115--){var extension=extenders[_i115](tr);if(extension&&Object.keys(extension).length)spec=mergeTransaction(tr,resolveTransactionInner(state,extension,tr.changes.newLength),true);}return spec==tr?tr:new Transaction(state,tr.changes,tr.selection,spec.effects,spec.annotations,spec.scrollIntoView);}var none=[];function asArray(value){return value==null?none:Array.isArray(value)?value:[value];}/** 3223 + The categories produced by a [character 3224 + categorizer](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer). These are used 3225 + do things like selecting by word. 3226 + */exports.CharCategory=void 0;(function(CharCategory){/** 3227 + Word characters. 3228 + */CharCategory[CharCategory["Word"]=0]="Word";/** 3229 + Whitespace. 3230 + */CharCategory[CharCategory["Space"]=1]="Space";/** 3231 + Anything else. 3232 + */CharCategory[CharCategory["Other"]=2]="Other";})(exports.CharCategory||(exports.CharCategory={}));var nonASCIISingleCaseWordChar=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;var wordChar;try{wordChar=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u");}catch(_){}function hasWordChar(str){if(wordChar)return wordChar.test(str);for(var _i116=0;_i116<str.length;_i116++){var ch=str[_i116];if(/\w/.test(ch)||ch>"\x80"&&(ch.toUpperCase()!=ch.toLowerCase()||nonASCIISingleCaseWordChar.test(ch)))return true;}return false;}function makeCategorizer(wordChars){return function(_char3){if(!/\S/.test(_char3))return exports.CharCategory.Space;if(hasWordChar(_char3))return exports.CharCategory.Word;for(var _i117=0;_i117<wordChars.length;_i117++){if(_char3.indexOf(wordChars[_i117])>-1)return exports.CharCategory.Word;}return exports.CharCategory.Other;};}/** 3233 + The editor state class is a persistent (immutable) data structure. 3234 + To update a state, you [create](https://codemirror.net/6/docs/ref/#state.EditorState.update) a 3235 + [transaction](https://codemirror.net/6/docs/ref/#state.Transaction), which produces a _new_ state 3236 + instance, without modifying the original object. 3237 + 3238 + As such, _never_ mutate properties of a state directly. That'll 3239 + just break things. 3240 + */var EditorState=/*#__PURE__*/function(){/** 3241 + @internal 3242 + */function EditorState(/** 3243 + @internal 3244 + */config,/** 3245 + The current document. 3246 + */doc,/** 3247 + The current selection. 3248 + */selection,/** 3249 + @internal 3250 + */values){var tr=arguments.length>4&&arguments[4]!==undefined?arguments[4]:null;_classCallCheck(this,EditorState);this.config=config;this.doc=doc;this.selection=selection;this.values=values;/** 3251 + @internal 3252 + */this.applying=null;this.status=config.statusTemplate.slice();this.applying=tr;// Fill in the computed state immediately, so that further queries 3253 + // for it made during the update return this state 3254 + if(tr)tr._state=this;for(var _i118=0;_i118<this.config.dynamicSlots.length;_i118++){ensureAddr(this,_i118<<1);}this.applying=null;}_createClass(EditorState,[{key:"field",value:function field(_field){var require=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var addr=this.config.address[_field.id];if(addr==null){if(require)throw new RangeError("Field is not present in this state");return undefined;}ensureAddr(this,addr);return getAddr(this,addr);}/** 3255 + Create a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction) that updates this 3256 + state. Any number of [transaction specs](https://codemirror.net/6/docs/ref/#state.TransactionSpec) 3257 + can be passed. Unless 3258 + [`sequential`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.sequential) is set, the 3259 + [changes](https://codemirror.net/6/docs/ref/#state.TransactionSpec.changes) (if any) of each spec 3260 + are assumed to start in the _current_ document (not the document 3261 + produced by previous specs), and its 3262 + [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) and 3263 + [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) are assumed to refer 3264 + to the document created by its _own_ changes. The resulting 3265 + transaction contains the combined effect of all the different 3266 + specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later 3267 + specs take precedence over earlier ones. 3268 + */},{key:"update",value:function update(){for(var _len2=arguments.length,specs=new Array(_len2),_key=0;_key<_len2;_key++){specs[_key]=arguments[_key];}return resolveTransaction(this,specs,true);}/** 3269 + @internal 3270 + */},{key:"applyTransaction",value:function applyTransaction(tr){var conf=this.config,_conf=conf,base=_conf.base,compartments=_conf.compartments;var _iterator179=_createForOfIteratorHelper(tr.effects),_step179;try{for(_iterator179.s();!(_step179=_iterator179.n()).done;){var effect=_step179.value;if(effect.is(Compartment.reconfigure)){if(conf){compartments=new Map();conf.compartments.forEach(function(val,key){return compartments.set(key,val);});conf=null;}compartments.set(effect.value.compartment,effect.value.extension);}else if(effect.is(StateEffect.reconfigure)){conf=null;base=effect.value;}else if(effect.is(StateEffect.appendConfig)){conf=null;base=asArray(base).concat(effect.value);}}}catch(err){_iterator179.e(err);}finally{_iterator179.f();}var startValues;if(!conf){conf=Configuration.resolve(base,compartments,this);var updatedValues=conf.dynamicSlots.map(function(_){return Uninitialized;});// Copy over old values for shared facets/fields 3271 + for(var id in conf.address){var cur=conf.address[id],prev=this.config.address[id];if(prev!=null&&(cur&1)==0)updatedValues[cur>>1]=getAddr(this,prev);}var intermediateState=new EditorState(conf,this.doc,this.selection,updatedValues,null);startValues=intermediateState.values;}else{startValues=tr.startState.values.slice();}new EditorState(conf,tr.newDoc,tr.newSelection,startValues,tr);}/** 3272 + Create a [transaction spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec) that 3273 + replaces every selection range with the given content. 3274 + */},{key:"replaceSelection",value:function replaceSelection(text){if(typeof text=="string")text=this.toText(text);return this.changeByRange(function(range){return{changes:{from:range.from,to:range.to,insert:text},range:EditorSelection.cursor(range.from+text.length)};});}/** 3275 + Create a set of changes and a new selection by running the given 3276 + function for each range in the active selection. The function 3277 + can return an optional set of changes (in the coordinate space 3278 + of the start document), plus an updated range (in the coordinate 3279 + space of the document produced by the call's own changes). This 3280 + method will merge all the changes and ranges into a single 3281 + changeset and selection, and return it as a [transaction 3282 + spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec), which can be passed to 3283 + [`update`](https://codemirror.net/6/docs/ref/#state.EditorState.update). 3284 + */},{key:"changeByRange",value:function changeByRange(f){var sel=this.selection;var result1=f(sel.ranges[0]);var changes=this.changes(result1.changes),ranges=[result1.range];var effects=asArray(result1.effects);for(var _i119=1;_i119<sel.ranges.length;_i119++){var result=f(sel.ranges[_i119]);var newChanges=this.changes(result.changes),newMapped=newChanges.map(changes);for(var j=0;j<_i119;j++){ranges[j]=ranges[j].map(newMapped);}var mapBy=changes.mapDesc(newChanges,true);ranges.push(result.range.map(mapBy));changes=changes.compose(newMapped);effects=StateEffect.mapEffects(effects,newMapped).concat(StateEffect.mapEffects(asArray(result.effects),mapBy));}return{changes:changes,selection:EditorSelection.create(ranges,sel.mainIndex),effects:effects};}/** 3285 + Create a [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) from the given change 3286 + description, taking the state's document length and line 3287 + separator into account. 3288 + */},{key:"changes",value:function changes(){var spec=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];if(spec instanceof ChangeSet)return spec;return ChangeSet.of(spec,this.doc.length,this.facet(EditorState.lineSeparator));}/** 3289 + Using the state's [line 3290 + separator](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator), create a 3291 + [`Text`](https://codemirror.net/6/docs/ref/#text.Text) instance from the given string. 3292 + */},{key:"toText",value:function toText(string){return text.Text.of(string.split(this.facet(EditorState.lineSeparator)||DefaultSplit));}/** 3293 + Return the given range of the document as a string. 3294 + */},{key:"sliceDoc",value:function sliceDoc(){var from=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.doc.length;return this.doc.sliceString(from,to,this.lineBreak);}/** 3295 + Get the value of a state [facet](https://codemirror.net/6/docs/ref/#state.Facet). 3296 + */},{key:"facet",value:function facet(_facet){var addr=this.config.address[_facet.id];if(addr==null)return _facet["default"];ensureAddr(this,addr);return getAddr(this,addr);}/** 3297 + Convert this state to a JSON-serializable object. When custom 3298 + fields should be serialized, you can pass them in as an object 3299 + mapping property names (in the resulting object, which should 3300 + not use `doc` or `selection`) to fields. 3301 + */},{key:"toJSON",value:function toJSON(fields){var result={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(fields)for(var prop in fields){var value=fields[prop];if(value instanceof StateField)result[prop]=value.spec.toJSON(this.field(fields[prop]),this);}return result;}/** 3302 + Deserialize a state from its JSON representation. When custom 3303 + fields should be deserialized, pass the same object you passed 3304 + to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as 3305 + third argument. 3306 + */},{key:"tabSize",get:/** 3307 + The size (in columns) of a tab in the document, determined by 3308 + the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet. 3309 + */function get(){return this.facet(EditorState.tabSize);}/** 3310 + Get the proper [line-break](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator) 3311 + string for this state. 3312 + */},{key:"lineBreak",get:function get(){return this.facet(EditorState.lineSeparator)||"\n";}/** 3313 + Returns true when the editor is 3314 + [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only. 3315 + */},{key:"readOnly",get:function get(){return this.facet(readOnly);}/** 3316 + Look up a translation for the given phrase (via the 3317 + [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the 3318 + original string if no translation is found. 3319 + */},{key:"phrase",value:function phrase(_phrase){var _iterator180=_createForOfIteratorHelper(this.facet(EditorState.phrases)),_step180;try{for(_iterator180.s();!(_step180=_iterator180.n()).done;){var map=_step180.value;if(Object.prototype.hasOwnProperty.call(map,_phrase))return map[_phrase];}}catch(err){_iterator180.e(err);}finally{_iterator180.f();}return _phrase;}/** 3320 + Find the values for a given language data field, provided by the 3321 + the [`languageData`](https://codemirror.net/6/docs/ref/#state.EditorState^languageData) facet. 3322 + */},{key:"languageDataAt",value:function languageDataAt(name,pos){var side=arguments.length>2&&arguments[2]!==undefined?arguments[2]:-1;var values=[];var _iterator181=_createForOfIteratorHelper(this.facet(languageData)),_step181;try{for(_iterator181.s();!(_step181=_iterator181.n()).done;){var provider=_step181.value;var _iterator182=_createForOfIteratorHelper(provider(this,pos,side)),_step182;try{for(_iterator182.s();!(_step182=_iterator182.n()).done;){var result=_step182.value;if(Object.prototype.hasOwnProperty.call(result,name))values.push(result[name]);}}catch(err){_iterator182.e(err);}finally{_iterator182.f();}}}catch(err){_iterator181.e(err);}finally{_iterator181.f();}return values;}/** 3323 + Return a function that can categorize strings (expected to 3324 + represent a single [grapheme cluster](https://codemirror.net/6/docs/ref/#text.findClusterBreak)) 3325 + into one of: 3326 + 3327 + - Word (contains an alphanumeric character or a character 3328 + explicitly listed in the local language's `"wordChars"` 3329 + language data, which should be a string) 3330 + - Space (contains only whitespace) 3331 + - Other (anything else) 3332 + */},{key:"charCategorizer",value:function charCategorizer(at){return makeCategorizer(this.languageDataAt("wordChars",at).join(""));}/** 3333 + Find the word at the given position, meaning the range 3334 + containing all [word](https://codemirror.net/6/docs/ref/#state.CharCategory.Word) characters 3335 + around it. If no word characters are adjacent to the position, 3336 + this returns null. 3337 + */},{key:"wordAt",value:function wordAt(pos){var _this$doc$lineAt=this.doc.lineAt(pos),text$1=_this$doc$lineAt.text,from=_this$doc$lineAt.from,length=_this$doc$lineAt.length;var cat=this.charCategorizer(pos);var start=pos-from,end=pos-from;while(start>0){var prev=text.findClusterBreak(text$1,start,false);if(cat(text$1.slice(prev,start))!=exports.CharCategory.Word)break;start=prev;}while(end<length){var next=text.findClusterBreak(text$1,end);if(cat(text$1.slice(end,next))!=exports.CharCategory.Word)break;end=next;}return start==end?null:EditorSelection.range(start+from,end+from);}}],[{key:"fromJSON",value:function fromJSON(json){var config=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var fields=arguments.length>2?arguments[2]:undefined;if(!json||typeof json.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");var fieldInit=[];if(fields){var _loop20=function _loop20(prop){var field=fields[prop],value=json[prop];fieldInit.push(field.init(function(state){return field.spec.fromJSON(value,state);}));};for(var prop in fields){_loop20(prop);}}return EditorState.create({doc:json.doc,selection:EditorSelection.fromJSON(json.selection),extensions:config.extensions?fieldInit.concat([config.extensions]):fieldInit});}/** 3338 + Create a new state. You'll usually only need this when 3339 + initializing an editor—updated states are created by applying 3340 + transactions. 3341 + */},{key:"create",value:function create(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var configuration=Configuration.resolve(config.extensions||[],new Map());var doc=config.doc instanceof text.Text?config.doc:text.Text.of((config.doc||"").split(configuration.staticFacet(EditorState.lineSeparator)||DefaultSplit));var selection=!config.selection?EditorSelection.single(0):config.selection instanceof EditorSelection?config.selection:EditorSelection.single(config.selection.anchor,config.selection.head);checkSelection(selection,doc.length);if(!configuration.staticFacet(allowMultipleSelections))selection=selection.asSingle();return new EditorState(configuration,doc,selection,configuration.dynamicSlots.map(function(_){return Uninitialized;}));}}]);return EditorState;}();/** 3342 + A facet that, when enabled, causes the editor to allow multiple 3343 + ranges to be selected. Be careful though, because by default the 3344 + editor relies on the native DOM selection, which cannot handle 3345 + multiple selections. An extension like 3346 + [`drawSelection`](https://codemirror.net/6/docs/ref/#view.drawSelection) can be used to make 3347 + secondary selections visible to the user. 3348 + */EditorState.allowMultipleSelections=allowMultipleSelections;/** 3349 + Configures the tab size to use in this state. The first 3350 + (highest-precedence) value of the facet is used. If no value is 3351 + given, this defaults to 4. 3352 + */EditorState.tabSize=Facet.define({combine:function combine(values){return values.length?values[0]:4;}});/** 3353 + The line separator to use. By default, any of `"\n"`, `"\r\n"` 3354 + and `"\r"` is treated as a separator when splitting lines, and 3355 + lines are joined with `"\n"`. 3356 + 3357 + When you configure a value here, only that precise separator 3358 + will be used, allowing you to round-trip documents through the 3359 + editor without normalizing line separators. 3360 + */EditorState.lineSeparator=lineSeparator;/** 3361 + This facet controls the value of the 3362 + [`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) getter, which is 3363 + consulted by commands and extensions that implement editing 3364 + functionality to determine whether they should apply. It 3365 + defaults to false, but when its highest-precedence value is 3366 + `true`, such functionality disables itself. 3367 + 3368 + Not to be confused with 3369 + [`EditorView.editable`](https://codemirror.net/6/docs/ref/#view.EditorView^editable), which 3370 + controls whether the editor's DOM is set to be editable (and 3371 + thus focusable). 3372 + */EditorState.readOnly=readOnly;/** 3373 + Registers translation phrases. The 3374 + [`phrase`](https://codemirror.net/6/docs/ref/#state.EditorState.phrase) method will look through 3375 + all objects registered with this facet to find translations for 3376 + its argument. 3377 + */EditorState.phrases=Facet.define();/** 3378 + A facet used to register [language 3379 + data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) providers. 3380 + */EditorState.languageData=languageData;/** 3381 + Facet used to register change filters, which are called for each 3382 + transaction (unless explicitly 3383 + [disabled](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter)), and can suppress 3384 + part of the transaction's changes. 3385 + 3386 + Such a function can return `true` to indicate that it doesn't 3387 + want to do anything, `false` to completely stop the changes in 3388 + the transaction, or a set of ranges in which changes should be 3389 + suppressed. Such ranges are represented as an array of numbers, 3390 + with each pair of two number indicating the start and end of a 3391 + range. So for example `[10, 20, 100, 110]` suppresses changes 3392 + between 10 and 20, and between 100 and 110. 3393 + */EditorState.changeFilter=changeFilter;/** 3394 + Facet used to register a hook that gets a chance to update or 3395 + replace transaction specs before they are applied. This will 3396 + only be applied for transactions that don't have 3397 + [`filter`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter) set to `false`. You 3398 + can either return a single transaction spec (possibly the input 3399 + transaction), or an array of specs (which will be combined in 3400 + the same way as the arguments to 3401 + [`EditorState.update`](https://codemirror.net/6/docs/ref/#state.EditorState.update)). 3402 + 3403 + When possible, it is recommended to avoid accessing 3404 + [`Transaction.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state) in a filter, 3405 + since it will force creation of a state that will then be 3406 + discarded again, if the transaction is actually filtered. 3407 + 3408 + (This functionality should be used with care. Indiscriminately 3409 + modifying transaction is likely to break something or degrade 3410 + the user experience.) 3411 + */EditorState.transactionFilter=transactionFilter;/** 3412 + This is a more limited form of 3413 + [`transactionFilter`](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter), 3414 + which can only add 3415 + [annotations](https://codemirror.net/6/docs/ref/#state.TransactionSpec.annotations) and 3416 + [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects). _But_, this type 3417 + of filter runs even the transaction has disabled regular 3418 + [filtering](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter), making it suitable 3419 + for effects that don't need to touch the changes or selection, 3420 + but do want to process every transaction. 3421 + 3422 + Extenders run _after_ filters, when both are applied. 3423 + */EditorState.transactionExtender=transactionExtender;Compartment.reconfigure=StateEffect.define();/** 3424 + Utility function for combining behaviors to fill in a config 3425 + object from an array of provided configs. Will, by default, error 3426 + when a field gets two values that aren't `===`-equal, but you can 3427 + provide combine functions per field to do something else. 3428 + */function combineConfig(configs,defaults){var combine=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var result={};var _iterator183=_createForOfIteratorHelper(configs),_step183;try{for(_iterator183.s();!(_step183=_iterator183.n()).done;){var config=_step183.value;for(var _i120=0,_Object$keys=Object.keys(config);_i120<_Object$keys.length;_i120++){var _key2=_Object$keys[_i120];var value=config[_key2],current=result[_key2];if(current===undefined)result[_key2]=value;else if(current===value||value===undefined);// No conflict 3429 + else if(Object.hasOwnProperty.call(combine,_key2))result[_key2]=combine[_key2](current,value);else throw new Error("Config merge conflict for field "+_key2);}}}catch(err){_iterator183.e(err);}finally{_iterator183.f();}for(var key in defaults){if(result[key]===undefined)result[key]=defaults[key];}return result;}Object.defineProperty(exports,'Text',{enumerable:true,get:function get(){return text.Text;}});exports.Annotation=Annotation;exports.AnnotationType=AnnotationType;exports.ChangeDesc=ChangeDesc;exports.ChangeSet=ChangeSet;exports.Compartment=Compartment;exports.EditorSelection=EditorSelection;exports.EditorState=EditorState;exports.Facet=Facet;exports.Prec=Prec;exports.SelectionRange=SelectionRange;exports.StateEffect=StateEffect;exports.StateEffectType=StateEffectType;exports.StateField=StateField;exports.Transaction=Transaction;exports.combineConfig=combineConfig;},{"@codemirror/text":24}],23:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var common=require('@lezer/common');var highlight=require('@codemirror/highlight');var language=require('@codemirror/language');// Counts the column offset in a string, taking tabs into account. 3430 + // Used mostly to find indentation. 3431 + function countCol(string,end,tabSize){var startIndex=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var startValue=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;if(end==null){end=string.search(/[^\s\u00a0]/);if(end==-1)end=string.length;}var n=startValue;for(var _i121=startIndex;_i121<end;_i121++){if(string.charCodeAt(_i121)==9)n+=tabSize-n%tabSize;else n++;}return n;}/** 3432 + Encapsulates a single line of input. Given to stream syntax code, 3433 + which uses it to tokenize the content. 3434 + */var StringStream=/*#__PURE__*/function(){/** 3435 + @internal 3436 + */function StringStream(/** 3437 + The line. 3438 + */string,tabSize,/** 3439 + The current indent unit size. 3440 + */indentUnit){_classCallCheck(this,StringStream);this.string=string;this.tabSize=tabSize;this.indentUnit=indentUnit;/** 3441 + The current position on the line. 3442 + */this.pos=0;/** 3443 + The start position of the current token. 3444 + */this.start=0;this.lastColumnPos=0;this.lastColumnValue=0;}/** 3445 + True if we are at the end of the line. 3446 + */_createClass(StringStream,[{key:"eol",value:function eol(){return this.pos>=this.string.length;}/** 3447 + True if we are at the start of the line. 3448 + */},{key:"sol",value:function sol(){return this.pos==0;}/** 3449 + Get the next code unit after the current position, or undefined 3450 + if we're at the end of the line. 3451 + */},{key:"peek",value:function peek(){return this.string.charAt(this.pos)||undefined;}/** 3452 + Read the next code unit and advance `this.pos`. 3453 + */},{key:"next",value:function next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++);}/** 3454 + Match the next character against the given string, regular 3455 + expression, or predicate. Consume and return it if it matches. 3456 + */},{key:"eat",value:function eat(match){var ch=this.string.charAt(this.pos);var ok;if(typeof match=="string")ok=ch==match;else ok=ch&&(match instanceof RegExp?match.test(ch):match(ch));if(ok){++this.pos;return ch;}}/** 3457 + Continue matching characters that match the given string, 3458 + regular expression, or predicate function. Return true if any 3459 + characters were consumed. 3460 + */},{key:"eatWhile",value:function eatWhile(match){var start=this.pos;while(this.eat(match)){}return this.pos>start;}/** 3461 + Consume whitespace ahead of `this.pos`. Return true if any was 3462 + found. 3463 + */},{key:"eatSpace",value:function eatSpace(){var start=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos;}return this.pos>start;}/** 3464 + Move to the end of the line. 3465 + */},{key:"skipToEnd",value:function skipToEnd(){this.pos=this.string.length;}/** 3466 + Move to directly before the given character, if found on the 3467 + current line. 3468 + */},{key:"skipTo",value:function skipTo(ch){var found=this.string.indexOf(ch,this.pos);if(found>-1){this.pos=found;return true;}}/** 3469 + Move back `n` characters. 3470 + */},{key:"backUp",value:function backUp(n){this.pos-=n;}/** 3471 + Get the column position at `this.pos`. 3472 + */},{key:"column",value:function column(){if(this.lastColumnPos<this.start){this.lastColumnValue=countCol(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start;}return this.lastColumnValue;}/** 3473 + Get the indentation column of the current line. 3474 + */},{key:"indentation",value:function indentation(){return countCol(this.string,null,this.tabSize);}/** 3475 + Match the input against the given string or regular expression 3476 + (which should start with a `^`). Return true or the regexp match 3477 + if it matches. 3478 + 3479 + Unless `consume` is set to `false`, this will move `this.pos` 3480 + past the matched text. 3481 + 3482 + When matching a string `caseInsensitive` can be set to true to 3483 + make the match case-insensitive. 3484 + */},{key:"match",value:function match(pattern,consume,caseInsensitive){if(typeof pattern=="string"){var cased=function cased(str){return caseInsensitive?str.toLowerCase():str;};var substr=this.string.substr(this.pos,pattern.length);if(cased(substr)==cased(pattern)){if(consume!==false)this.pos+=pattern.length;return true;}else return null;}else{var match=this.string.slice(this.pos).match(pattern);if(match&&match.index>0)return null;if(match&&consume!==false)this.pos+=match[0].length;return match;}}/** 3485 + Get the current token. 3486 + */},{key:"current",value:function current(){return this.string.slice(this.start,this.pos);}}]);return StringStream;}();function fullParser(spec){return{token:spec.token,blankLine:spec.blankLine||function(){},startState:spec.startState||function(){return true;},copyState:spec.copyState||defaultCopyState,indent:spec.indent||function(){return null;},languageData:spec.languageData||{}};}function defaultCopyState(state){if(_typeof(state)!="object")return state;var newState={};for(var prop in state){var val=state[prop];newState[prop]=val instanceof Array?val.slice():val;}return newState;}/** 3487 + A [language](https://codemirror.net/6/docs/ref/#language.Language) class based on a streaming 3488 + parser. 3489 + */var StreamLanguage=/*#__PURE__*/function(_language$Language){_inherits(StreamLanguage,_language$Language);var _super40=_createSuper(StreamLanguage);function StreamLanguage(parser){var _this82;_classCallCheck(this,StreamLanguage);var data=language.defineLanguageFacet(parser.languageData);var p=fullParser(parser),self;var impl=new(/*#__PURE__*/function(_common$Parser2){_inherits(_class19,_common$Parser2);var _super41=_createSuper(_class19);function _class19(){_classCallCheck(this,_class19);return _super41.apply(this,arguments);}_createClass(_class19,[{key:"createParse",value:function createParse(input,fragments,ranges){return new Parse(self,input,fragments,ranges);}}]);return _class19;}(common.Parser))();_this82=_super40.call(this,data,impl,docID(data),[language.indentService.of(function(cx,pos){return _this82.getIndent(cx,pos);})]);self=_assertThisInitialized(_this82);_this82.streamParser=p;_this82.stateAfter=new common.NodeProp({perNode:true});return _this82;}_createClass(StreamLanguage,[{key:"getIndent",value:function getIndent(cx,pos){var tree=language.syntaxTree(cx.state),at=tree.resolve(pos);while(at&&at.type!=this.topNode){at=at.parent;}if(!at)return null;var start=findState(this,tree,0,at.from,pos),statePos,state;if(start){state=start.state;statePos=start.pos+1;}else{state=this.streamParser.startState(cx.unit);statePos=0;}if(pos-statePos>10000/* MaxIndentScanDist */)return null;while(statePos<pos){var line=cx.state.doc.lineAt(statePos),end=Math.min(pos,line.to);if(line.length){var stream=new StringStream(line.text,cx.state.tabSize,cx.unit);while(stream.pos<end-line.from){readToken(this.streamParser.token,stream,state);}}else{this.streamParser.blankLine(state,cx.unit);}if(end==pos)break;statePos=line.to+1;}var _cx$state$doc$lineAt=cx.state.doc.lineAt(pos),text=_cx$state$doc$lineAt.text;return this.streamParser.indent(state,/^\s*(.*)/.exec(text)[1],cx);}},{key:"allowsNesting",get:function get(){return false;}}],[{key:"define",value:function define(spec){return new StreamLanguage(spec);}}]);return StreamLanguage;}(language.Language);function findState(lang,tree,off,startPos,before){var state=off>=startPos&&off+tree.length<=before&&tree.prop(lang.stateAfter);if(state)return{state:lang.streamParser.copyState(state),pos:off+tree.length};for(var _i122=tree.children.length-1;_i122>=0;_i122--){var child=tree.children[_i122],pos=off+tree.positions[_i122];var found=child instanceof common.Tree&&pos<before&&findState(lang,child,pos,startPos,before);if(found)return found;}return null;}function cutTree(lang,tree,from,to,inside){if(inside&&from<=0&&to>=tree.length)return tree;if(!inside&&tree.type==lang.topNode)inside=true;for(var _i123=tree.children.length-1;_i123>=0;_i123--){var pos=tree.positions[_i123]+from,child=tree.children[_i123],inner=void 0;if(pos<to&&child instanceof common.Tree){if(!(inner=cutTree(lang,child,from-pos,to-pos,inside)))break;return!inside?inner:new common.Tree(tree.type,tree.children.slice(0,_i123).concat(inner),tree.positions.slice(0,_i123+1),pos+inner.length);}}return null;}function findStartInFragments(lang,fragments,startPos,editorState){var _iterator184=_createForOfIteratorHelper(fragments),_step184;try{for(_iterator184.s();!(_step184=_iterator184.n()).done;){var f=_step184.value;var from=f.from+(f.openStart?25:0),to=f.to-(f.openEnd?25:0);var found=from<=startPos&&to>startPos&&findState(lang,f.tree,0-f.offset,startPos,to),tree=void 0;if(found&&(tree=cutTree(lang,f.tree,startPos+f.offset,found.pos+f.offset,false)))return{state:found.state,tree:tree};}}catch(err){_iterator184.e(err);}finally{_iterator184.f();}return{state:lang.streamParser.startState(editorState?language.getIndentUnit(editorState):4),tree:common.Tree.empty};}var Parse=/*#__PURE__*/function(){function Parse(lang,input,fragments,ranges){_classCallCheck(this,Parse);this.lang=lang;this.input=input;this.fragments=fragments;this.ranges=ranges;this.stoppedAt=null;this.chunks=[];this.chunkPos=[];this.chunk=[];this.chunkReused=undefined;this.rangeIndex=0;this.to=ranges[ranges.length-1].to;var context=language.ParseContext.get(),from=ranges[0].from;var _findStartInFragments=findStartInFragments(lang,fragments,from,context===null||context===void 0?void 0:context.state),state=_findStartInFragments.state,tree=_findStartInFragments.tree;this.state=state;this.parsedPos=this.chunkStart=from+tree.length;if(tree.length){this.chunks.push(tree);this.chunkPos.push(0);}if(context&&this.parsedPos<context.viewport.from-100000/* MaxDistanceBeforeViewport */){this.state=this.lang.streamParser.startState(language.getIndentUnit(context.state));context.skipUntilInView(this.parsedPos,context.viewport.from);this.parsedPos=context.viewport.from;}}_createClass(Parse,[{key:"advance",value:function advance(){var context=language.ParseContext.get();var parseEnd=this.stoppedAt==null?this.to:this.stoppedAt;var end=Math.min(parseEnd,this.chunkStart+2048/* ChunkSize */);if(context)end=Math.min(end,context.viewport.to);while(this.parsedPos<end){this.parseLine(context);}if(this.chunkStart<this.parsedPos)this.finishChunk();if(this.parsedPos>=parseEnd)return this.finish();if(context&&this.parsedPos>context.viewport.to){context.skipUntilInView(this.parsedPos,parseEnd);return this.finish();}return null;}},{key:"stopAt",value:function stopAt(pos){this.stoppedAt=pos;}},{key:"lineAfter",value:function lineAfter(pos){var chunk=this.input.chunk(pos);if(!this.input.lineChunks){var eol=chunk.indexOf("\n");if(eol>-1)chunk=chunk.slice(0,eol);}else if(chunk=="\n"){chunk="";}return pos+chunk.length<=this.to?chunk:chunk.slice(0,this.to-pos);}},{key:"nextLine",value:function nextLine(){var from=this.parsedPos,line=this.lineAfter(from),end=from+line.length;for(var index=this.rangeIndex;;){var rangeEnd=this.ranges[index].to;if(rangeEnd>=end)break;line=line.slice(0,rangeEnd-(end-line.length));index++;if(index==this.ranges.length)break;var rangeStart=this.ranges[index].from;var after=this.lineAfter(rangeStart);line+=after;end=rangeStart+after.length;}return{line:line,end:end};}},{key:"skipGapsTo",value:function skipGapsTo(pos,offset,side){for(;;){var end=this.ranges[this.rangeIndex].to,offPos=pos+offset;if(side>0?end>offPos:end>=offPos)break;var start=this.ranges[++this.rangeIndex].from;offset+=start-end;}return offset;}},{key:"emitToken",value:function emitToken(id,from,to,size,offset){if(this.ranges.length>1){offset=this.skipGapsTo(from,offset,1);from+=offset;var len0=this.chunk.length;offset=this.skipGapsTo(to,offset,-1);to+=offset;size+=this.chunk.length-len0;}this.chunk.push(id,from,to,size);return offset;}},{key:"parseLine",value:function parseLine(context){var _this$nextLine=this.nextLine(),line=_this$nextLine.line,end=_this$nextLine.end,offset=0,streamParser=this.lang.streamParser;var stream=new StringStream(line,context?context.state.tabSize:4,context?language.getIndentUnit(context.state):2);if(stream.eol()){streamParser.blankLine(this.state,stream.indentUnit);}else{while(!stream.eol()){var token=readToken(streamParser.token,stream,this.state);if(token)offset=this.emitToken(tokenID(token),this.parsedPos+stream.start,this.parsedPos+stream.pos,4,offset);}}this.parsedPos=end;if(this.parsedPos<this.to)this.parsedPos++;}},{key:"finishChunk",value:function finishChunk(){var tree=common.Tree.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:nodeSet,topID:0,maxBufferLength:2048/* ChunkSize */,reused:this.chunkReused});tree=new common.Tree(tree.type,tree.children,tree.positions,tree.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]);this.chunks.push(tree);this.chunkPos.push(this.chunkStart-this.ranges[0].from);this.chunk=[];this.chunkReused=undefined;this.chunkStart=this.parsedPos;}},{key:"finish",value:function finish(){return new common.Tree(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance();}}]);return Parse;}();function readToken(token,stream,state){stream.start=stream.pos;for(var _i124=0;_i124<10;_i124++){var result=token(stream,state);if(stream.pos>stream.start)return result;}throw new Error("Stream parser failed to advance stream.");}var tokenTable=Object.create(null);var typeArray=[common.NodeType.none];var nodeSet=new common.NodeSet(typeArray);var warned=[];function tokenID(tag){return!tag?0:tokenTable[tag]||(tokenTable[tag]=createTokenType(tag));}for(var _i125=0,_arr3=[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","typeName"],["attribute","propertyName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]];_i125<_arr3.length;_i125++){var _arr3$_i=_slicedToArray(_arr3[_i125],2),legacyName=_arr3$_i[0],name=_arr3$_i[1];tokenTable[legacyName]=tokenID(name);}function warnForPart(part,msg){if(warned.indexOf(part)>-1)return;warned.push(part);console.warn(msg);}function createTokenType(tagStr){var tag=null;var _iterator185=_createForOfIteratorHelper(tagStr.split(".")),_step185;try{for(_iterator185.s();!(_step185=_iterator185.n()).done;){var part=_step185.value;var value=highlight.tags[part];if(!value){warnForPart(part,"Unknown highlighting tag ".concat(part));}else if(typeof value=="function"){if(!tag)warnForPart(part,"Modifier ".concat(part," used at start of tag"));else tag=value(tag);}else{if(tag)warnForPart(part,"Tag ".concat(part," used as modifier"));else tag=value;}}}catch(err){_iterator185.e(err);}finally{_iterator185.f();}if(!tag)return 0;var name=tagStr.replace(/ /g,"_"),type=common.NodeType.define({id:typeArray.length,name:name,props:[highlight.styleTags(_defineProperty({},name,tag))]});typeArray.push(type);return type.id;}function docID(data){var type=common.NodeType.define({id:typeArray.length,name:"Document",props:[language.languageDataProp.add(function(){return data;})]});typeArray.push(type);return type;}exports.StreamLanguage=StreamLanguage;exports.StringStream=StringStream;},{"@codemirror/highlight":11,"@codemirror/language":13,"@lezer/common":28}],24:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});// Compressed representation of the Grapheme_Cluster_Break=Extend 3490 + // information from 3491 + // http://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakProperty.txt. 3492 + // Each pair of elements represents a range, as an offet from the 3493 + // previous range and a length. Numbers are in base-36, with the empty 3494 + // string being a shorthand for 1. 3495 + var extend="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(function(s){return s?parseInt(s,36):1;});// Convert offsets into absolute values 3496 + for(var _i126=1;_i126<extend.length;_i126++){extend[_i126]+=extend[_i126-1];}function isExtendingChar(code){for(var _i127=1;_i127<extend.length;_i127+=2){if(extend[_i127]>code)return extend[_i127-1]<=code;}return false;}function isRegionalIndicator(code){return code>=0x1F1E6&&code<=0x1F1FF;}var ZWJ=0x200d;/** 3497 + Returns a next grapheme cluster break _after_ (not equal to) 3498 + `pos`, if `forward` is true, or before otherwise. Returns `pos` 3499 + itself if no further cluster break is available in the string. 3500 + Moves across surrogate pairs, extending characters (when 3501 + `includeExtending` is true), characters joined with zero-width 3502 + joiners, and flag emoji. 3503 + */function findClusterBreak(str,pos){var forward=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var includeExtending=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;return(forward?nextClusterBreak:prevClusterBreak)(str,pos,includeExtending);}function nextClusterBreak(str,pos,includeExtending){if(pos==str.length)return pos;// If pos is in the middle of a surrogate pair, move to its start 3504 + if(pos&&surrogateLow(str.charCodeAt(pos))&&surrogateHigh(str.charCodeAt(pos-1)))pos--;var prev=codePointAt(str,pos);pos+=codePointSize(prev);while(pos<str.length){var next=codePointAt(str,pos);if(prev==ZWJ||next==ZWJ||includeExtending&&isExtendingChar(next)){pos+=codePointSize(next);prev=next;}else if(isRegionalIndicator(next)){var countBefore=0,_i128=pos-2;while(_i128>=0&&isRegionalIndicator(codePointAt(str,_i128))){countBefore++;_i128-=2;}if(countBefore%2==0)break;else pos+=2;}else{break;}}return pos;}function prevClusterBreak(str,pos,includeExtending){while(pos>0){var found=nextClusterBreak(str,pos-2,includeExtending);if(found<pos)return found;pos--;}return 0;}function surrogateLow(ch){return ch>=0xDC00&&ch<0xE000;}function surrogateHigh(ch){return ch>=0xD800&&ch<0xDC00;}/** 3505 + Find the code point at the given position in a string (like the 3506 + [`codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) 3507 + string method). 3508 + */function codePointAt(str,pos){var code0=str.charCodeAt(pos);if(!surrogateHigh(code0)||pos+1==str.length)return code0;var code1=str.charCodeAt(pos+1);if(!surrogateLow(code1))return code0;return(code0-0xd800<<10)+(code1-0xdc00)+0x10000;}/** 3509 + Given a Unicode codepoint, return the JavaScript string that 3510 + respresents it (like 3511 + [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)). 3512 + */function fromCodePoint(code){if(code<=0xffff)return String.fromCharCode(code);code-=0x10000;return String.fromCharCode((code>>10)+0xd800,(code&1023)+0xdc00);}/** 3513 + The first character that takes up two positions in a JavaScript 3514 + string. It is often useful to compare with this after calling 3515 + `codePointAt`, to figure out whether your character takes up 1 or 3516 + 2 index positions. 3517 + */function codePointSize(code){return code<0x10000?1:2;}/** 3518 + Count the column position at the given offset into the string, 3519 + taking extending characters and tab size into account. 3520 + */function countColumn(string,tabSize){var to=arguments.length>2&&arguments[2]!==undefined?arguments[2]:string.length;var n=0;for(var _i129=0;_i129<to;){if(string.charCodeAt(_i129)==9){n+=tabSize-n%tabSize;_i129++;}else{n++;_i129=findClusterBreak(string,_i129);}}return n;}/** 3521 + Find the offset that corresponds to the given column position in a 3522 + string, taking extending characters and tab size into account. By 3523 + default, the string length is returned when it is too short to 3524 + reach the column. Pass `strict` true to make it return -1 in that 3525 + situation. 3526 + */function findColumn(string,col,tabSize,strict){for(var _i130=0,n=0;;){if(n>=col)return _i130;if(_i130==string.length)break;n+=string.charCodeAt(_i130)==9?tabSize-n%tabSize:1;_i130=findClusterBreak(string,_i130);}return strict===true?-1:string.length;}/** 3527 + The data structure for documents. 3528 + */var Text=/*#__PURE__*/function(){/** 3529 + @internal 3530 + */function Text(){_classCallCheck(this,Text);}/** 3531 + Get the line description around the given position. 3532 + */_createClass(Text,[{key:"lineAt",value:function lineAt(pos){if(pos<0||pos>this.length)throw new RangeError("Invalid position ".concat(pos," in document of length ").concat(this.length));return this.lineInner(pos,false,1,0);}/** 3533 + Get the description for the given (1-based) line number. 3534 + */},{key:"line",value:function line(n){if(n<1||n>this.lines)throw new RangeError("Invalid line number ".concat(n," in ").concat(this.lines,"-line document"));return this.lineInner(n,true,1,0);}/** 3535 + Replace a range of the text with the given content. 3536 + */},{key:"replace",value:function replace(from,to,text){var parts=[];this.decompose(0,from,parts,2/* To */);if(text.length)text.decompose(0,text.length,parts,1/* From */|2/* To */);this.decompose(to,this.length,parts,1/* From */);return TextNode.from(parts,this.length-(to-from)+text.length);}/** 3537 + Append another document to this one. 3538 + */},{key:"append",value:function append(other){return this.replace(this.length,this.length,other);}/** 3539 + Retrieve the text between the given points. 3540 + */},{key:"slice",value:function slice(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var parts=[];this.decompose(from,to,parts,0);return TextNode.from(parts,to-from);}/** 3541 + Test whether this text is equal to another instance. 3542 + */},{key:"eq",value:function eq(other){if(other==this)return true;if(other.length!=this.length||other.lines!=this.lines)return false;var start=this.scanIdentical(other,1),end=this.length-this.scanIdentical(other,-1);var a=new RawTextCursor(this),b=new RawTextCursor(other);for(var skip=start,pos=start;;){a.next(skip);b.next(skip);skip=0;if(a.lineBreak!=b.lineBreak||a.done!=b.done||a.value!=b.value)return false;pos+=a.value.length;if(a.done||pos>=end)return true;}}/** 3543 + Iterate over the text. When `dir` is `-1`, iteration happens 3544 + from end to start. This will return lines and the breaks between 3545 + them as separate strings, and for long lines, might split lines 3546 + themselves into multiple chunks as well. 3547 + */},{key:"iter",value:function iter(){var dir=arguments.length>0&&arguments[0]!==undefined?arguments[0]:1;return new RawTextCursor(this,dir);}/** 3548 + Iterate over a range of the text. When `from` > `to`, the 3549 + iterator will run in reverse. 3550 + */},{key:"iterRange",value:function iterRange(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;return new PartialTextCursor(this,from,to);}/** 3551 + Return a cursor that iterates over the given range of lines, 3552 + _without_ returning the line breaks between, and yielding empty 3553 + strings for empty lines. 3554 + 3555 + When `from` and `to` are given, they should be 1-based line numbers. 3556 + */},{key:"iterLines",value:function iterLines(from,to){var inner;if(from==null){inner=this.iter();}else{if(to==null)to=this.lines+1;var start=this.line(from).from;inner=this.iterRange(start,Math.max(start,to==this.lines+1?this.length:to<=1?0:this.line(to-1).to));}return new LineCursor(inner);}/** 3557 + @internal 3558 + */},{key:"toString",value:function toString(){return this.sliceString(0);}/** 3559 + Convert the document to an array of lines (which can be 3560 + deserialized again via [`Text.of`](https://codemirror.net/6/docs/ref/#text.Text^of)). 3561 + */},{key:"toJSON",value:function toJSON(){var lines=[];this.flatten(lines);return lines;}/** 3562 + Create a `Text` instance for the given array of lines. 3563 + */}],[{key:"of",value:function of(text){if(text.length==0)throw new RangeError("A document must have at least one line");if(text.length==1&&!text[0])return Text.empty;return text.length<=32/* Branch */?new TextLeaf(text):TextNode.from(TextLeaf.split(text,[]));}}]);return Text;}();// Leaves store an array of line strings. There are always line breaks 3564 + // between these strings. Leaves are limited in size and have to be 3565 + // contained in TextNode instances for bigger documents. 3566 + var TextLeaf=/*#__PURE__*/function(_Text){_inherits(TextLeaf,_Text);var _super42=_createSuper(TextLeaf);function TextLeaf(text){var _this83;var length=arguments.length>1&&arguments[1]!==undefined?arguments[1]:textLength(text);_classCallCheck(this,TextLeaf);_this83=_super42.call(this);_this83.text=text;_this83.length=length;return _this83;}_createClass(TextLeaf,[{key:"lines",get:function get(){return this.text.length;}},{key:"children",get:function get(){return null;}},{key:"lineInner",value:function lineInner(target,isLine,line,offset){for(var _i131=0;;_i131++){var string=this.text[_i131],end=offset+string.length;if((isLine?line:end)>=target)return new Line(offset,end,line,string);offset=end+1;line++;}}},{key:"decompose",value:function decompose(from,to,target,open){var text=from<=0&&to>=this.length?this:new TextLeaf(sliceText(this.text,from,to),Math.min(to,this.length)-Math.max(0,from));if(open&1/* From */){var prev=target.pop();var joined=appendText(text.text,prev.text.slice(),0,text.length);if(joined.length<=32/* Branch */){target.push(new TextLeaf(joined,prev.length+text.length));}else{var mid=joined.length>>1;target.push(new TextLeaf(joined.slice(0,mid)),new TextLeaf(joined.slice(mid)));}}else{target.push(text);}}},{key:"replace",value:function replace(from,to,text){if(!(text instanceof TextLeaf))return _get(_getPrototypeOf(TextLeaf.prototype),"replace",this).call(this,from,to,text);var lines=appendText(this.text,appendText(text.text,sliceText(this.text,0,from)),to);var newLen=this.length+text.length-(to-from);if(lines.length<=32/* Branch */)return new TextLeaf(lines,newLen);return TextNode.from(TextLeaf.split(lines,[]),newLen);}},{key:"sliceString",value:function sliceString(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var lineSep=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\n";var result="";for(var pos=0,_i132=0;pos<=to&&_i132<this.text.length;_i132++){var line=this.text[_i132],end=pos+line.length;if(pos>from&&_i132)result+=lineSep;if(from<end&&to>pos)result+=line.slice(Math.max(0,from-pos),to-pos);pos=end+1;}return result;}},{key:"flatten",value:function flatten(target){var _iterator186=_createForOfIteratorHelper(this.text),_step186;try{for(_iterator186.s();!(_step186=_iterator186.n()).done;){var line=_step186.value;target.push(line);}}catch(err){_iterator186.e(err);}finally{_iterator186.f();}}},{key:"scanIdentical",value:function scanIdentical(){return 0;}}],[{key:"split",value:function split(text,target){var part=[],len=-1;var _iterator187=_createForOfIteratorHelper(text),_step187;try{for(_iterator187.s();!(_step187=_iterator187.n()).done;){var line=_step187.value;part.push(line);len+=line.length+1;if(part.length==32/* Branch */){target.push(new TextLeaf(part,len));part=[];len=-1;}}}catch(err){_iterator187.e(err);}finally{_iterator187.f();}if(len>-1)target.push(new TextLeaf(part,len));return target;}}]);return TextLeaf;}(Text);// Nodes provide the tree structure of the `Text` type. They store a 3567 + // number of other nodes or leaves, taking care to balance themselves 3568 + // on changes. There are implied line breaks _between_ the children of 3569 + // a node (but not before the first or after the last child). 3570 + var TextNode=/*#__PURE__*/function(_Text2){_inherits(TextNode,_Text2);var _super43=_createSuper(TextNode);function TextNode(children,length){var _this84;_classCallCheck(this,TextNode);_this84=_super43.call(this);_this84.children=children;_this84.length=length;_this84.lines=0;var _iterator188=_createForOfIteratorHelper(children),_step188;try{for(_iterator188.s();!(_step188=_iterator188.n()).done;){var child=_step188.value;_this84.lines+=child.lines;}}catch(err){_iterator188.e(err);}finally{_iterator188.f();}return _this84;}_createClass(TextNode,[{key:"lineInner",value:function lineInner(target,isLine,line,offset){for(var _i133=0;;_i133++){var child=this.children[_i133],end=offset+child.length,endLine=line+child.lines-1;if((isLine?endLine:end)>=target)return child.lineInner(target,isLine,line,offset);offset=end+1;line=endLine+1;}}},{key:"decompose",value:function decompose(from,to,target,open){for(var _i134=0,pos=0;pos<=to&&_i134<this.children.length;_i134++){var child=this.children[_i134],end=pos+child.length;if(from<=end&&to>=pos){var childOpen=open&((pos<=from?1/* From */:0)|(end>=to?2/* To */:0));if(pos>=from&&end<=to&&!childOpen)target.push(child);else child.decompose(from-pos,to-pos,target,childOpen);}pos=end+1;}}},{key:"replace",value:function replace(from,to,text){if(text.lines<this.lines)for(var _i135=0,pos=0;_i135<this.children.length;_i135++){var child=this.children[_i135],end=pos+child.length;// Fast path: if the change only affects one child and the 3571 + // child's size remains in the acceptable range, only update 3572 + // that child 3573 + if(from>=pos&&to<=end){var updated=child.replace(from-pos,to-pos,text);var totalLines=this.lines-child.lines+updated.lines;if(updated.lines<totalLines>>5/* BranchShift */-1&&updated.lines>totalLines>>5/* BranchShift */+1){var copy=this.children.slice();copy[_i135]=updated;return new TextNode(copy,this.length-(to-from)+text.length);}return _get(_getPrototypeOf(TextNode.prototype),"replace",this).call(this,pos,end,updated);}pos=end+1;}return _get(_getPrototypeOf(TextNode.prototype),"replace",this).call(this,from,to,text);}},{key:"sliceString",value:function sliceString(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:this.length;var lineSep=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"\n";var result="";for(var _i136=0,pos=0;_i136<this.children.length&&pos<=to;_i136++){var child=this.children[_i136],end=pos+child.length;if(pos>from&&_i136)result+=lineSep;if(from<end&&to>pos)result+=child.sliceString(from-pos,to-pos,lineSep);pos=end+1;}return result;}},{key:"flatten",value:function flatten(target){var _iterator189=_createForOfIteratorHelper(this.children),_step189;try{for(_iterator189.s();!(_step189=_iterator189.n()).done;){var child=_step189.value;child.flatten(target);}}catch(err){_iterator189.e(err);}finally{_iterator189.f();}}},{key:"scanIdentical",value:function scanIdentical(other,dir){if(!(other instanceof TextNode))return 0;var length=0;var _ref67=dir>0?[0,0,this.children.length,other.children.length]:[this.children.length-1,other.children.length-1,-1,-1],_ref68=_slicedToArray(_ref67,4),iA=_ref68[0],iB=_ref68[1],eA=_ref68[2],eB=_ref68[3];for(;;iA+=dir,iB+=dir){if(iA==eA||iB==eB)return length;var chA=this.children[iA],chB=other.children[iB];if(chA!=chB)return length+chA.scanIdentical(chB,dir);length+=chA.length+1;}}}],[{key:"from",value:function from(children){var length=arguments.length>1&&arguments[1]!==undefined?arguments[1]:children.reduce(function(l,ch){return l+ch.length+1;},-1);var lines=0;var _iterator190=_createForOfIteratorHelper(children),_step190;try{for(_iterator190.s();!(_step190=_iterator190.n()).done;){var _ch=_step190.value;lines+=_ch.lines;}}catch(err){_iterator190.e(err);}finally{_iterator190.f();}if(lines<32/* Branch */){var flat=[];var _iterator191=_createForOfIteratorHelper(children),_step191;try{for(_iterator191.s();!(_step191=_iterator191.n()).done;){var ch=_step191.value;ch.flatten(flat);}}catch(err){_iterator191.e(err);}finally{_iterator191.f();}return new TextLeaf(flat,length);}var chunk=Math.max(32/* Branch */,lines>>5/* BranchShift */),maxChunk=chunk<<1,minChunk=chunk>>1;var chunked=[],currentLines=0,currentLen=-1,currentChunk=[];function add(child){var last;if(child.lines>maxChunk&&child instanceof TextNode){var _iterator192=_createForOfIteratorHelper(child.children),_step192;try{for(_iterator192.s();!(_step192=_iterator192.n()).done;){var node=_step192.value;add(node);}}catch(err){_iterator192.e(err);}finally{_iterator192.f();}}else if(child.lines>minChunk&&(currentLines>minChunk||!currentLines)){flush();chunked.push(child);}else if(child instanceof TextLeaf&&currentLines&&(last=currentChunk[currentChunk.length-1])instanceof TextLeaf&&child.lines+last.lines<=32/* Branch */){currentLines+=child.lines;currentLen+=child.length+1;currentChunk[currentChunk.length-1]=new TextLeaf(last.text.concat(child.text),last.length+1+child.length);}else{if(currentLines+child.lines>chunk)flush();currentLines+=child.lines;currentLen+=child.length+1;currentChunk.push(child);}}function flush(){if(currentLines==0)return;chunked.push(currentChunk.length==1?currentChunk[0]:TextNode.from(currentChunk,currentLen));currentLen=-1;currentLines=currentChunk.length=0;}var _iterator193=_createForOfIteratorHelper(children),_step193;try{for(_iterator193.s();!(_step193=_iterator193.n()).done;){var child=_step193.value;add(child);}}catch(err){_iterator193.e(err);}finally{_iterator193.f();}flush();return chunked.length==1?chunked[0]:new TextNode(chunked,length);}}]);return TextNode;}(Text);Text.empty=new TextLeaf([""],0);function textLength(text){var length=-1;var _iterator194=_createForOfIteratorHelper(text),_step194;try{for(_iterator194.s();!(_step194=_iterator194.n()).done;){var line=_step194.value;length+=line.length+1;}}catch(err){_iterator194.e(err);}finally{_iterator194.f();}return length;}function appendText(text,target){var from=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var to=arguments.length>3&&arguments[3]!==undefined?arguments[3]:1e9;for(var pos=0,_i137=0,first=true;_i137<text.length&&pos<=to;_i137++){var line=text[_i137],end=pos+line.length;if(end>=from){if(end>to)line=line.slice(0,to-pos);if(pos<from)line=line.slice(from-pos);if(first){target[target.length-1]+=line;first=false;}else target.push(line);}pos=end+1;}return target;}function sliceText(text,from,to){return appendText(text,[""],from,to);}var RawTextCursor=/*#__PURE__*/function(){function RawTextCursor(text){var dir=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;_classCallCheck(this,RawTextCursor);this.dir=dir;this.done=false;this.lineBreak=false;this.value="";this.nodes=[text];this.offsets=[dir>0?1:(text instanceof TextLeaf?text.text.length:text.children.length)<<1];}_createClass(RawTextCursor,[{key:"nextInner",value:function nextInner(skip,dir){this.done=this.lineBreak=false;for(;;){var last=this.nodes.length-1;var top=this.nodes[last],offsetValue=this.offsets[last],offset=offsetValue>>1;var size=top instanceof TextLeaf?top.text.length:top.children.length;if(offset==(dir>0?size:0)){if(last==0){this.done=true;this.value="";return this;}if(dir>0)this.offsets[last-1]++;this.nodes.pop();this.offsets.pop();}else if((offsetValue&1)==(dir>0?0:1)){this.offsets[last]+=dir;if(skip==0){this.lineBreak=true;this.value="\n";return this;}skip--;}else if(top instanceof TextLeaf){// Move to the next string 3574 + var next=top.text[offset+(dir<0?-1:0)];this.offsets[last]+=dir;if(next.length>Math.max(0,skip)){this.value=skip==0?next:dir>0?next.slice(skip):next.slice(0,next.length-skip);return this;}skip-=next.length;}else{var _next3=top.children[offset+(dir<0?-1:0)];if(skip>_next3.length){skip-=_next3.length;this.offsets[last]+=dir;}else{if(dir<0)this.offsets[last]--;this.nodes.push(_next3);this.offsets.push(dir>0?1:(_next3 instanceof TextLeaf?_next3.text.length:_next3.children.length)<<1);}}}}},{key:"next",value:function next(){var skip=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(skip<0){this.nextInner(-skip,-this.dir);skip=this.value.length;}return this.nextInner(skip,this.dir);}}]);return RawTextCursor;}();var PartialTextCursor=/*#__PURE__*/function(){function PartialTextCursor(text,start,end){_classCallCheck(this,PartialTextCursor);this.value="";this.done=false;this.cursor=new RawTextCursor(text,start>end?-1:1);this.pos=start>end?text.length:0;this.from=Math.min(start,end);this.to=Math.max(start,end);}_createClass(PartialTextCursor,[{key:"nextInner",value:function nextInner(skip,dir){if(dir<0?this.pos<=this.from:this.pos>=this.to){this.value="";this.done=true;return this;}skip+=Math.max(0,dir<0?this.pos-this.to:this.from-this.pos);var limit=dir<0?this.pos-this.from:this.to-this.pos;if(skip>limit)skip=limit;limit-=skip;var _this$cursor$next2=this.cursor.next(skip),value=_this$cursor$next2.value;this.pos+=(value.length+skip)*dir;this.value=value.length<=limit?value:dir<0?value.slice(value.length-limit):value.slice(0,limit);this.done=!this.value;return this;}},{key:"next",value:function next(){var skip=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;if(skip<0)skip=Math.max(skip,this.from-this.pos);else if(skip>0)skip=Math.min(skip,this.to-this.pos);return this.nextInner(skip,this.cursor.dir);}},{key:"lineBreak",get:function get(){return this.cursor.lineBreak&&this.value!="";}}]);return PartialTextCursor;}();var LineCursor=/*#__PURE__*/function(){function LineCursor(inner){_classCallCheck(this,LineCursor);this.inner=inner;this.afterBreak=true;this.value="";this.done=false;}_createClass(LineCursor,[{key:"next",value:function next(){var skip=arguments.length>0&&arguments[0]!==undefined?arguments[0]:0;var _this$inner$next=this.inner.next(skip),done=_this$inner$next.done,lineBreak=_this$inner$next.lineBreak,value=_this$inner$next.value;if(done){this.done=true;this.value="";}else if(lineBreak){if(this.afterBreak){this.value="";}else{this.afterBreak=true;this.next();}}else{this.value=value;this.afterBreak=false;}return this;}},{key:"lineBreak",get:function get(){return false;}}]);return LineCursor;}();if(typeof Symbol!="undefined"){Text.prototype[Symbol.iterator]=function(){return this.iter();};RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this;};}/** 3575 + This type describes a line in the document. It is created 3576 + on-demand when lines are [queried](https://codemirror.net/6/docs/ref/#text.Text.lineAt). 3577 + */var Line=/*#__PURE__*/function(){/** 3578 + @internal 3579 + */function Line(/** 3580 + The position of the start of the line. 3581 + */from,/** 3582 + The position at the end of the line (_before_ the line break, 3583 + or at the end of document for the last line). 3584 + */to,/** 3585 + This line's line number (1-based). 3586 + */number,/** 3587 + The line's content. 3588 + */text){_classCallCheck(this,Line);this.from=from;this.to=to;this.number=number;this.text=text;}/** 3589 + The length of the line (not including any line break after it). 3590 + */_createClass(Line,[{key:"length",get:function get(){return this.to-this.from;}}]);return Line;}();exports.Line=Line;exports.Text=Text;exports.codePointAt=codePointAt;exports.codePointSize=codePointSize;exports.countColumn=countColumn;exports.findClusterBreak=findClusterBreak;exports.findColumn=findColumn;exports.fromCodePoint=fromCodePoint;},{}],25:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var view=require('@codemirror/view');var highlight=require('@codemirror/highlight');// Using https://github.com/one-dark/vscode-one-dark-theme/ as reference for the colors 3591 + var chalky="#e5c07b",coral="#e06c75",cyan="#56b6c2",invalid="#ffffff",ivory="#abb2bf",stone="#7d8799",// Brightened compared to original to increase contrast 3592 + malibu="#61afef",sage="#98c379",whiskey="#d19a66",violet="#c678dd",darkBackground="#21252b",highlightBackground="#2c313a",background="#282c34",tooltipBackground="#353a42",selection="#3E4451",cursor="#528bff";/** 3593 + The editor theme styles for One Dark. 3594 + */var oneDarkTheme=view.EditorView.theme({"&":{color:ivory,backgroundColor:background},".cm-content":{caretColor:cursor},"&.cm-focused .cm-cursor":{borderLeftColor:cursor},"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:selection},".cm-panels":{backgroundColor:darkBackground,color:ivory},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:highlightBackground},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847",outline:"1px solid #515a6b"},".cm-gutters":{backgroundColor:background,color:stone,border:"none"},".cm-activeLineGutter":{backgroundColor:highlightBackground},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:tooltipBackground},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:tooltipBackground,borderBottomColor:tooltipBackground},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:highlightBackground,color:ivory}}},{dark:true});/** 3595 + The highlighting style for code in the One Dark theme. 3596 + */var oneDarkHighlightStyle=highlight.HighlightStyle.define([{tag:highlight.tags.keyword,color:violet},{tag:[highlight.tags.name,highlight.tags.deleted,highlight.tags.character,highlight.tags.propertyName,highlight.tags.macroName],color:coral},{tag:[highlight.tags["function"](highlight.tags.variableName),highlight.tags.labelName],color:malibu},{tag:[highlight.tags.color,highlight.tags.constant(highlight.tags.name),highlight.tags.standard(highlight.tags.name)],color:whiskey},{tag:[highlight.tags.definition(highlight.tags.name),highlight.tags.separator],color:ivory},{tag:[highlight.tags.typeName,highlight.tags.className,highlight.tags.number,highlight.tags.changed,highlight.tags.annotation,highlight.tags.modifier,highlight.tags.self,highlight.tags.namespace],color:chalky},{tag:[highlight.tags.operator,highlight.tags.operatorKeyword,highlight.tags.url,highlight.tags.escape,highlight.tags.regexp,highlight.tags.link,highlight.tags.special(highlight.tags.string)],color:cyan},{tag:[highlight.tags.meta,highlight.tags.comment],color:stone},{tag:highlight.tags.strong,fontWeight:"bold"},{tag:highlight.tags.emphasis,fontStyle:"italic"},{tag:highlight.tags.strikethrough,textDecoration:"line-through"},{tag:highlight.tags.link,color:stone,textDecoration:"underline"},{tag:highlight.tags.heading,fontWeight:"bold",color:coral},{tag:[highlight.tags.atom,highlight.tags.bool,highlight.tags.special(highlight.tags.variableName)],color:whiskey},{tag:[highlight.tags.processingInstruction,highlight.tags.string,highlight.tags.inserted],color:sage},{tag:highlight.tags.invalid,color:invalid}]);/** 3597 + Extension to enable the One Dark theme (both the editor theme and 3598 + the highlight style). 3599 + */var oneDark=[oneDarkTheme,oneDarkHighlightStyle];exports.oneDark=oneDark;exports.oneDarkHighlightStyle=oneDarkHighlightStyle;exports.oneDarkTheme=oneDarkTheme;},{"@codemirror/highlight":11,"@codemirror/view":27}],26:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var view=require('@codemirror/view');var state=require('@codemirror/state');var ios=typeof navigator!="undefined"&&!/Edge\/(\d+)/.exec(navigator.userAgent)&&/Apple Computer/.test(navigator.vendor)&&(/Mobile\/\w+/.test(navigator.userAgent)||navigator.maxTouchPoints>2);var Outside="-10000px";var TooltipViewManager=/*#__PURE__*/function(){function TooltipViewManager(view,facet,createTooltipView){_classCallCheck(this,TooltipViewManager);this.facet=facet;this.createTooltipView=createTooltipView;this.input=view.state.facet(facet);this.tooltips=this.input.filter(function(t){return t;});this.tooltipViews=this.tooltips.map(createTooltipView);}_createClass(TooltipViewManager,[{key:"update",value:function update(_update24){var input=_update24.state.facet(this.facet);var tooltips=input.filter(function(x){return x;});if(input===this.input){var _iterator195=_createForOfIteratorHelper(this.tooltipViews),_step195;try{for(_iterator195.s();!(_step195=_iterator195.n()).done;){var t=_step195.value;if(t.update)t.update(_update24);}}catch(err){_iterator195.e(err);}finally{_iterator195.f();}return false;}var tooltipViews=[];for(var _i138=0;_i138<tooltips.length;_i138++){var tip=tooltips[_i138],known=-1;if(!tip)continue;for(var _i139=0;_i139<this.tooltips.length;_i139++){var other=this.tooltips[_i139];if(other&&other.create==tip.create)known=_i139;}if(known<0){tooltipViews[_i138]=this.createTooltipView(tip);}else{var tooltipView=tooltipViews[_i138]=this.tooltipViews[known];if(tooltipView.update)tooltipView.update(_update24);}}var _iterator196=_createForOfIteratorHelper(this.tooltipViews),_step196;try{for(_iterator196.s();!(_step196=_iterator196.n()).done;){var _t4=_step196.value;if(tooltipViews.indexOf(_t4)<0)_t4.dom.remove();}}catch(err){_iterator196.e(err);}finally{_iterator196.f();}this.input=input;this.tooltips=tooltips;this.tooltipViews=tooltipViews;return true;}}]);return TooltipViewManager;}();/** 3600 + Return an extension that configures tooltip behavior. 3601 + */function tooltips(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return tooltipConfig.of(config);}function windowSpace(){return{top:0,left:0,bottom:innerHeight,right:innerWidth};}var tooltipConfig=state.Facet.define({combine:function combine(values){var _a,_b,_c;return{position:ios?"absolute":((_a=values.find(function(conf){return conf.position;}))===null||_a===void 0?void 0:_a.position)||"fixed",parent:((_b=values.find(function(conf){return conf.parent;}))===null||_b===void 0?void 0:_b.parent)||null,tooltipSpace:((_c=values.find(function(conf){return conf.tooltipSpace;}))===null||_c===void 0?void 0:_c.tooltipSpace)||windowSpace};}});var tooltipPlugin=view.ViewPlugin.fromClass(/*#__PURE__*/function(){function _class20(view){var _this85=this;_classCallCheck(this,_class20);var _a;this.view=view;this.inView=true;this.lastTransaction=0;this.measureTimeout=-1;var config=view.state.facet(tooltipConfig);this.position=config.position;this.parent=config.parent;this.classes=view.themeClasses;this.createContainer();this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this};this.manager=new TooltipViewManager(view,showTooltip,function(t){return _this85.createTooltip(t);});this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(function(entries){if(Date.now()>_this85.lastTransaction-50&&entries.length>0&&entries[entries.length-1].intersectionRatio<1)_this85.measureSoon();},{threshold:[1]}):null;this.observeIntersection();(_a=view.dom.ownerDocument.defaultView)===null||_a===void 0?void 0:_a.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this));this.maybeMeasure();}_createClass(_class20,[{key:"createContainer",value:function createContainer(){if(this.parent){this.container=document.createElement("div");this.container.style.position="relative";this.container.className=this.view.themeClasses;this.parent.appendChild(this.container);}else{this.container=this.view.dom;}}},{key:"observeIntersection",value:function observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();var _iterator197=_createForOfIteratorHelper(this.manager.tooltipViews),_step197;try{for(_iterator197.s();!(_step197=_iterator197.n()).done;){var tooltip=_step197.value;this.intersectionObserver.observe(tooltip.dom);}}catch(err){_iterator197.e(err);}finally{_iterator197.f();}}}},{key:"measureSoon",value:function measureSoon(){var _this86=this;if(this.measureTimeout<0)this.measureTimeout=setTimeout(function(){_this86.measureTimeout=-1;_this86.maybeMeasure();},50);}},{key:"update",value:function update(_update25){if(_update25.transactions.length)this.lastTransaction=Date.now();var updated=this.manager.update(_update25);if(updated)this.observeIntersection();var shouldMeasure=updated||_update25.geometryChanged;var newConfig=_update25.state.facet(tooltipConfig);if(newConfig.position!=this.position){this.position=newConfig.position;var _iterator198=_createForOfIteratorHelper(this.manager.tooltipViews),_step198;try{for(_iterator198.s();!(_step198=_iterator198.n()).done;){var t=_step198.value;t.dom.style.position=this.position;}}catch(err){_iterator198.e(err);}finally{_iterator198.f();}shouldMeasure=true;}if(newConfig.parent!=this.parent){if(this.parent)this.container.remove();this.parent=newConfig.parent;this.createContainer();var _iterator199=_createForOfIteratorHelper(this.manager.tooltipViews),_step199;try{for(_iterator199.s();!(_step199=_iterator199.n()).done;){var _t5=_step199.value;this.container.appendChild(_t5.dom);}}catch(err){_iterator199.e(err);}finally{_iterator199.f();}shouldMeasure=true;}else if(this.parent&&this.view.themeClasses!=this.classes){this.classes=this.container.className=this.view.themeClasses;}if(shouldMeasure)this.maybeMeasure();}},{key:"createTooltip",value:function createTooltip(tooltip){var tooltipView=tooltip.create(this.view);tooltipView.dom.classList.add("cm-tooltip");if(tooltip.arrow&&!tooltipView.dom.querySelector("cm-tooltip > cm-tooltip-arrow")){var arrow=document.createElement("div");arrow.className="cm-tooltip-arrow";tooltipView.dom.appendChild(arrow);}tooltipView.dom.style.position=this.position;tooltipView.dom.style.top=Outside;this.container.appendChild(tooltipView.dom);if(tooltipView.mount)tooltipView.mount(this.view);return tooltipView;}},{key:"destroy",value:function destroy(){var _a,_b;(_a=this.view.dom.ownerDocument.defaultView)===null||_a===void 0?void 0:_a.removeEventListener("resize",this.measureSoon);var _iterator200=_createForOfIteratorHelper(this.manager.tooltipViews),_step200;try{for(_iterator200.s();!(_step200=_iterator200.n()).done;){var dom=_step200.value.dom;dom.remove();}}catch(err){_iterator200.e(err);}finally{_iterator200.f();}(_b=this.intersectionObserver)===null||_b===void 0?void 0:_b.disconnect();clearTimeout(this.measureTimeout);}},{key:"readMeasure",value:function readMeasure(){var _this87=this;var editor=this.view.dom.getBoundingClientRect();return{editor:editor,parent:this.parent?this.container.getBoundingClientRect():editor,pos:this.manager.tooltips.map(function(t){return _this87.view.coordsAtPos(t.pos);}),size:this.manager.tooltipViews.map(function(_ref69){var dom=_ref69.dom;return dom.getBoundingClientRect();}),space:this.view.state.facet(tooltipConfig).tooltipSpace(this.view)};}},{key:"writeMeasure",value:function writeMeasure(measured){var editor=measured.editor,space=measured.space;var others=[];for(var _i140=0;_i140<this.manager.tooltips.length;_i140++){var tooltip=this.manager.tooltips[_i140],tView=this.manager.tooltipViews[_i140],dom=tView.dom;var pos=measured.pos[_i140],size=measured.size[_i140];// Hide tooltips that are outside of the editor. 3602 + if(!pos||pos.bottom<=Math.max(editor.top,space.top)||pos.top>=Math.min(editor.bottom,space.bottom)||pos.right<=Math.max(editor.left,space.left)||pos.left>=Math.min(editor.right,space.right)){dom.style.top=Outside;continue;}var arrow=tooltip.arrow?tView.dom.querySelector(".cm-tooltip-arrow"):null;var arrowHeight=arrow?7/* Size */:0;var width=size.right-size.left,height=size.bottom-size.top;var offset=tView.offset||noOffset,ltr=this.view.textDirection==view.Direction.LTR;var left=size.width>space.right-space.left?ltr?space.left:space.right-size.width:ltr?Math.min(pos.left-(arrow?14/* Offset */:0)+offset.x,space.right-width):Math.max(space.left,pos.left-width+(arrow?14/* Offset */:0)-offset.x);var above=!!tooltip.above;if(!tooltip.strictSide&&(above?pos.top-(size.bottom-size.top)-offset.y<space.top:pos.bottom+(size.bottom-size.top)+offset.y>space.bottom)&&above==space.bottom-pos.bottom>pos.top-space.top)above=!above;var top=above?pos.top-height-arrowHeight-offset.y:pos.bottom+arrowHeight+offset.y;var right=left+width;if(tView.overlap!==true){var _iterator201=_createForOfIteratorHelper(others),_step201;try{for(_iterator201.s();!(_step201=_iterator201.n()).done;){var r=_step201.value;if(r.left<right&&r.right>left&&r.top<top+height&&r.bottom>top)top=above?r.top-height-2-arrowHeight:r.bottom+arrowHeight+2;}}catch(err){_iterator201.e(err);}finally{_iterator201.f();}}if(this.position=="absolute"){dom.style.top=top-measured.parent.top+"px";dom.style.left=left-measured.parent.left+"px";}else{dom.style.top=top+"px";dom.style.left=left+"px";}if(arrow)arrow.style.left="".concat(pos.left+(ltr?offset.x:-offset.x)-(left+14/* Offset */-7/* Size */),"px");if(tView.overlap!==true)others.push({left:left,top:top,right:right,bottom:top+height});dom.classList.toggle("cm-tooltip-above",above);dom.classList.toggle("cm-tooltip-below",!above);if(tView.positioned)tView.positioned();}}},{key:"maybeMeasure",value:function maybeMeasure(){if(this.manager.tooltips.length){if(this.view.inView)this.view.requestMeasure(this.measureReq);if(this.inView!=this.view.inView){this.inView=this.view.inView;if(!this.inView){var _iterator202=_createForOfIteratorHelper(this.manager.tooltipViews),_step202;try{for(_iterator202.s();!(_step202=_iterator202.n()).done;){var tv=_step202.value;tv.dom.style.top=Outside;}}catch(err){_iterator202.e(err);}finally{_iterator202.f();}}}}}}]);return _class20;}(),{eventHandlers:{scroll:function scroll(){this.maybeMeasure();}}});var baseTheme=view.EditorView.baseTheme({".cm-tooltip":{zIndex:100},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"".concat(7/* Size */,"px"),width:"".concat(7/* Size */*2,"px"),position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"".concat(7/* Size */,"px solid transparent"),borderRight:"".concat(7/* Size */,"px solid transparent")},".cm-tooltip-above &":{bottom:"-".concat(7/* Size */,"px"),"&:before":{borderTop:"".concat(7/* Size */,"px solid #bbb")},"&:after":{borderTop:"".concat(7/* Size */,"px solid #f5f5f5"),bottom:"1px"}},".cm-tooltip-below &":{top:"-".concat(7/* Size */,"px"),"&:before":{borderBottom:"".concat(7/* Size */,"px solid #bbb")},"&:after":{borderBottom:"".concat(7/* Size */,"px solid #f5f5f5"),top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}});var noOffset={x:0,y:0};/** 3603 + Behavior by which an extension can provide a tooltip to be shown. 3604 + */var showTooltip=state.Facet.define({enables:[tooltipPlugin,baseTheme]});var showHoverTooltip=state.Facet.define();var HoverTooltipHost=/*#__PURE__*/function(){function HoverTooltipHost(view){var _this88=this;_classCallCheck(this,HoverTooltipHost);this.view=view;this.mounted=false;this.dom=document.createElement("div");this.dom.classList.add("cm-tooltip-hover");this.manager=new TooltipViewManager(view,showHoverTooltip,function(t){return _this88.createHostedView(t);});}// Needs to be static so that host tooltip instances always match 3605 + _createClass(HoverTooltipHost,[{key:"createHostedView",value:function createHostedView(tooltip){var hostedView=tooltip.create(this.view);hostedView.dom.classList.add("cm-tooltip-section");this.dom.appendChild(hostedView.dom);if(this.mounted&&hostedView.mount)hostedView.mount(this.view);return hostedView;}},{key:"mount",value:function mount(view){var _iterator203=_createForOfIteratorHelper(this.manager.tooltipViews),_step203;try{for(_iterator203.s();!(_step203=_iterator203.n()).done;){var hostedView=_step203.value;if(hostedView.mount)hostedView.mount(view);}}catch(err){_iterator203.e(err);}finally{_iterator203.f();}this.mounted=true;}},{key:"positioned",value:function positioned(){var _iterator204=_createForOfIteratorHelper(this.manager.tooltipViews),_step204;try{for(_iterator204.s();!(_step204=_iterator204.n()).done;){var hostedView=_step204.value;if(hostedView.positioned)hostedView.positioned();}}catch(err){_iterator204.e(err);}finally{_iterator204.f();}}},{key:"update",value:function update(_update26){this.manager.update(_update26);}}],[{key:"create",value:function create(view){return new HoverTooltipHost(view);}}]);return HoverTooltipHost;}();var showHoverTooltipHost=showTooltip.compute([showHoverTooltip],function(state){var tooltips=state.facet(showHoverTooltip).filter(function(t){return t;});if(tooltips.length===0)return null;return{pos:Math.min.apply(Math,_toConsumableArray(tooltips.map(function(t){return t.pos;}))),end:Math.max.apply(Math,_toConsumableArray(tooltips.filter(function(t){return t.end!=null;}).map(function(t){return t.end;}))),create:HoverTooltipHost.create,above:tooltips[0].above,arrow:tooltips.some(function(t){return t.arrow;})};});var HoverPlugin=/*#__PURE__*/function(){function HoverPlugin(view,source,field,setHover,hoverTime){_classCallCheck(this,HoverPlugin);this.view=view;this.source=source;this.field=field;this.setHover=setHover;this.hoverTime=hoverTime;this.hoverTimeout=-1;this.restartTimeout=-1;this.pending=null;this.lastMove={x:0,y:0,target:view.dom,time:0};this.checkHover=this.checkHover.bind(this);view.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this));view.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this));}_createClass(HoverPlugin,[{key:"update",value:function update(){var _this89=this;if(this.pending){this.pending=null;clearTimeout(this.restartTimeout);this.restartTimeout=setTimeout(function(){return _this89.startHover();},20);}}},{key:"active",get:function get(){return this.view.state.field(this.field);}},{key:"checkHover",value:function checkHover(){this.hoverTimeout=-1;if(this.active)return;var hovered=Date.now()-this.lastMove.time;if(hovered<this.hoverTime)this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-hovered);else this.startHover();}},{key:"startHover",value:function startHover(){var _this90=this;var _a;clearTimeout(this.restartTimeout);var lastMove=this.lastMove;var pos=this.view.contentDOM.contains(lastMove.target)?this.view.posAtCoords(lastMove):null;if(pos==null)return;var posCoords=this.view.coordsAtPos(pos);if(posCoords==null||lastMove.y<posCoords.top||lastMove.y>posCoords.bottom||lastMove.x<posCoords.left-this.view.defaultCharacterWidth||lastMove.x>posCoords.right+this.view.defaultCharacterWidth)return;var bidi=this.view.bidiSpans(this.view.state.doc.lineAt(pos)).find(function(s){return s.from<=pos&&s.to>=pos;});var rtl=bidi&&bidi.dir==view.Direction.RTL?-1:1;var open=this.source(this.view,pos,lastMove.x<posCoords.left?-rtl:rtl);if((_a=open)===null||_a===void 0?void 0:_a.then){var pending=this.pending={pos:pos};open.then(function(result){if(_this90.pending==pending){_this90.pending=null;if(result)_this90.view.dispatch({effects:_this90.setHover.of(result)});}},function(e){return view.logException(_this90.view.state,e,"hover tooltip");});}else if(open){this.view.dispatch({effects:this.setHover.of(open)});}}},{key:"mousemove",value:function mousemove(event){var _a;this.lastMove={x:event.clientX,y:event.clientY,target:event.target,time:Date.now()};if(this.hoverTimeout<0)this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime);var tooltip=this.active;if(tooltip&&!isInTooltip(this.lastMove.target)||this.pending){var _ref70=tooltip||this.pending,pos=_ref70.pos,end=(_a=tooltip===null||tooltip===void 0?void 0:tooltip.end)!==null&&_a!==void 0?_a:pos;if(pos==end?this.view.posAtCoords(this.lastMove)!=pos:!isOverRange(this.view,pos,end,event.clientX,event.clientY,6/* MaxDist */)){this.view.dispatch({effects:this.setHover.of(null)});this.pending=null;}}}},{key:"mouseleave",value:function mouseleave(){clearTimeout(this.hoverTimeout);this.hoverTimeout=-1;if(this.active)this.view.dispatch({effects:this.setHover.of(null)});}},{key:"destroy",value:function destroy(){clearTimeout(this.hoverTimeout);this.view.dom.removeEventListener("mouseleave",this.mouseleave);this.view.dom.removeEventListener("mousemove",this.mousemove);}}]);return HoverPlugin;}();function isInTooltip(elt){for(var cur=elt;cur;cur=cur.parentNode){if(cur.nodeType==1&&cur.classList.contains("cm-tooltip"))return true;}return false;}function isOverRange(view,from,to,x,y,margin){var range=document.createRange();var fromDOM=view.domAtPos(from),toDOM=view.domAtPos(to);range.setEnd(toDOM.node,toDOM.offset);range.setStart(fromDOM.node,fromDOM.offset);var rects=range.getClientRects();range.detach();for(var _i141=0;_i141<rects.length;_i141++){var rect=rects[_i141];var dist=Math.max(rect.top-y,y-rect.bottom,rect.left-x,x-rect.right);if(dist<=margin)return true;}return false;}/** 3606 + Enable a hover tooltip, which shows up when the pointer hovers 3607 + over ranges of text. The callback is called when the mouse hovers 3608 + over the document text. It should, if there is a tooltip 3609 + associated with position `pos` return the tooltip description 3610 + (either directly or in a promise). The `side` argument indicates 3611 + on which side of the position the pointer is—it will be -1 if the 3612 + pointer is before the position, 1 if after the position. 3613 + 3614 + Note that all hover tooltips are hosted within a single tooltip 3615 + container element. This allows multiple tooltips over the same 3616 + range to be "merged" together without overlapping. 3617 + */function hoverTooltip(source){var options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var setHover=state.StateEffect.define();var hoverState=state.StateField.define({create:function create(){return null;},update:function update(value,tr){if(value&&options.hideOnChange&&(tr.docChanged||tr.selection))return null;var _iterator205=_createForOfIteratorHelper(tr.effects),_step205;try{for(_iterator205.s();!(_step205=_iterator205.n()).done;){var effect=_step205.value;if(effect.is(setHover))return effect.value;if(effect.is(closeHoverTooltipEffect))return null;}}catch(err){_iterator205.e(err);}finally{_iterator205.f();}if(value&&tr.docChanged){var newPos=tr.changes.mapPos(value.pos,-1,state.MapMode.TrackDel);if(newPos==null)return null;var copy=Object.assign(Object.create(null),value);copy.pos=newPos;if(value.end!=null)copy.end=tr.changes.mapPos(value.end);return copy;}return value;},provide:function provide(f){return showHoverTooltip.from(f);}});var hoverTime=options.hoverTime||600/* Time */;return[hoverState,view.ViewPlugin.define(function(view){return new HoverPlugin(view,source,hoverState,setHover,hoverTime);}),showHoverTooltipHost];}/** 3618 + Get the active tooltip view for a given tooltip, if available. 3619 + */function getTooltip(view,tooltip){var plugin=view.plugin(tooltipPlugin);if(!plugin)return null;var found=plugin.manager.tooltips.indexOf(tooltip);return found<0?null:plugin.manager.tooltipViews[found];}/** 3620 + Returns true if any hover tooltips are currently active. 3621 + */function hasHoverTooltips(state){return state.facet(showHoverTooltip).some(function(x){return x;});}var closeHoverTooltipEffect=state.StateEffect.define();/** 3622 + Transaction effect that closes all hover tooltips. 3623 + */var closeHoverTooltips=closeHoverTooltipEffect.of(null);/** 3624 + Tell the tooltip extension to recompute the position of the active 3625 + tooltips. This can be useful when something happens (such as a 3626 + re-positioning or CSS change affecting the editor) that could 3627 + invalidate the existing tooltip positions. 3628 + */function repositionTooltips(view){var _a;(_a=view.plugin(tooltipPlugin))===null||_a===void 0?void 0:_a.maybeMeasure();}exports.closeHoverTooltips=closeHoverTooltips;exports.getTooltip=getTooltip;exports.hasHoverTooltips=hasHoverTooltips;exports.hoverTooltip=hoverTooltip;exports.repositionTooltips=repositionTooltips;exports.showTooltip=showTooltip;exports.tooltips=tooltips;},{"@codemirror/state":22,"@codemirror/view":27}],27:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var state=require('@codemirror/state');var styleMod=require('style-mod');var rangeset=require('@codemirror/rangeset');var text=require('@codemirror/text');var w3cKeyname=require('w3c-keyname');function getSelection(root){var target;// Browsers differ on whether shadow roots have a getSelection 3629 + // method. If it exists, use that, otherwise, call it on the 3630 + // document. 3631 + if(root.nodeType==11){// Shadow root 3632 + target=root.getSelection?root:root.ownerDocument;}else{target=root;}return target.getSelection();}function contains(dom,node){return node?dom.contains(node.nodeType!=1?node.parentNode:node):false;}function deepActiveElement(){var elt=document.activeElement;while(elt&&elt.shadowRoot){elt=elt.shadowRoot.activeElement;}return elt;}function hasSelection(dom,selection){if(!selection.anchorNode)return false;try{// Firefox will raise 'permission denied' errors when accessing 3633 + // properties of `sel.anchorNode` when it's in a generated CSS 3634 + // element. 3635 + return contains(dom,selection.anchorNode);}catch(_){return false;}}function clientRectsFor(dom){if(dom.nodeType==3)return textRange(dom,0,dom.nodeValue.length).getClientRects();else if(dom.nodeType==1)return dom.getClientRects();else return[];}// Scans forward and backward through DOM positions equivalent to the 3636 + // given one to see if the two are in the same place (i.e. after a 3637 + // text node vs at the end of that text node) 3638 + function isEquivalentPosition(node,off,targetNode,targetOff){return targetNode?scanFor(node,off,targetNode,targetOff,-1)||scanFor(node,off,targetNode,targetOff,1):false;}function domIndex(node){for(var index=0;;index++){node=node.previousSibling;if(!node)return index;}}function scanFor(node,off,targetNode,targetOff,dir){for(;;){if(node==targetNode&&off==targetOff)return true;if(off==(dir<0?0:maxOffset(node))){if(node.nodeName=="DIV")return false;var parent=node.parentNode;if(!parent||parent.nodeType!=1)return false;off=domIndex(node)+(dir<0?0:1);node=parent;}else if(node.nodeType==1){node=node.childNodes[off+(dir<0?-1:0)];if(node.nodeType==1&&node.contentEditable=="false")return false;off=dir<0?maxOffset(node):0;}else{return false;}}}function maxOffset(node){return node.nodeType==3?node.nodeValue.length:node.childNodes.length;}var Rect0={left:0,right:0,top:0,bottom:0};function flattenRect(rect,left){var x=left?rect.left:rect.right;return{left:x,right:x,top:rect.top,bottom:rect.bottom};}function windowRect(win){return{left:0,right:win.innerWidth,top:0,bottom:win.innerHeight};}var ScrollSpace=5;function scrollRectIntoView(dom,rect,side,center){var doc=dom.ownerDocument,win=doc.defaultView;for(var cur=dom;cur;){if(cur.nodeType==1){// Element 3639 + var bounding=void 0,top=cur==doc.body;if(top){bounding=windowRect(win);}else{if(cur.scrollHeight<=cur.clientHeight&&cur.scrollWidth<=cur.clientWidth){cur=cur.parentNode;continue;}var _rect2=cur.getBoundingClientRect();// Make sure scrollbar width isn't included in the rectangle 3640 + bounding={left:_rect2.left,right:_rect2.left+cur.clientWidth,top:_rect2.top,bottom:_rect2.top+cur.clientHeight};}var moveX=0,moveY=0;if(center){var rectHeight=rect.bottom-rect.top,boundingHeight=bounding.bottom-bounding.top;var targetTop=void 0;if(rectHeight<=boundingHeight)targetTop=rect.top+rectHeight/2-boundingHeight/2;else if(side<0)targetTop=rect.top-ScrollSpace;else targetTop=rect.bottom+ScrollSpace-boundingHeight;moveY=targetTop-bounding.top;if(Math.abs(moveY)<=1)moveY=0;}else if(rect.top<bounding.top){moveY=-(bounding.top-rect.top+ScrollSpace);if(side>0&&rect.bottom>bounding.bottom+moveY)moveY=rect.bottom-bounding.bottom+moveY+ScrollSpace;}else if(rect.bottom>bounding.bottom){moveY=rect.bottom-bounding.bottom+ScrollSpace;if(side<0&&rect.top-moveY<bounding.top)moveY=-(bounding.top+moveY-rect.top+ScrollSpace);}if(rect.left<bounding.left){moveX=-(bounding.left-rect.left+ScrollSpace);if(side>0&&rect.right>bounding.right+moveX)moveX=rect.right-bounding.right+moveX+ScrollSpace;}else if(rect.right>bounding.right){moveX=rect.right-bounding.right+ScrollSpace;if(side<0&&rect.left<bounding.left+moveX)moveX=-(bounding.left+moveX-rect.left+ScrollSpace);}if(moveX||moveY){if(top){win.scrollBy(moveX,moveY);}else{if(moveY){var start=cur.scrollTop;cur.scrollTop+=moveY;moveY=cur.scrollTop-start;}if(moveX){var _start4=cur.scrollLeft;cur.scrollLeft+=moveX;moveX=cur.scrollLeft-_start4;}rect={left:rect.left-moveX,top:rect.top-moveY,right:rect.right-moveX,bottom:rect.bottom-moveY};}}if(top)break;cur=cur.assignedSlot||cur.parentNode;center=false;}else if(cur.nodeType==11){// A shadow root 3641 + cur=cur.host;}else{break;}}}var DOMSelection=/*#__PURE__*/function(){function DOMSelection(){_classCallCheck(this,DOMSelection);this.anchorNode=null;this.anchorOffset=0;this.focusNode=null;this.focusOffset=0;}_createClass(DOMSelection,[{key:"eq",value:function eq(domSel){return this.anchorNode==domSel.anchorNode&&this.anchorOffset==domSel.anchorOffset&&this.focusNode==domSel.focusNode&&this.focusOffset==domSel.focusOffset;}},{key:"set",value:function set(domSel){this.anchorNode=domSel.anchorNode;this.anchorOffset=domSel.anchorOffset;this.focusNode=domSel.focusNode;this.focusOffset=domSel.focusOffset;}}]);return DOMSelection;}();var preventScrollSupported=null;// Feature-detects support for .focus({preventScroll: true}), and uses 3642 + // a fallback kludge when not supported. 3643 + function focusPreventScroll(dom){if(dom.setActive)return dom.setActive();// in IE 3644 + if(preventScrollSupported)return dom.focus(preventScrollSupported);var stack=[];for(var cur=dom;cur;cur=cur.parentNode){stack.push(cur,cur.scrollTop,cur.scrollLeft);if(cur==cur.ownerDocument)break;}dom.focus(preventScrollSupported==null?Object.defineProperties({},{preventScroll:{get:function get(){preventScrollSupported={preventScroll:true};return true;},configurable:true,enumerable:true}}):undefined);if(!preventScrollSupported){preventScrollSupported=false;for(var _i142=0;_i142<stack.length;){var elt=stack[_i142++],top=stack[_i142++],left=stack[_i142++];if(elt.scrollTop!=top)elt.scrollTop=top;if(elt.scrollLeft!=left)elt.scrollLeft=left;}}}var scratchRange;function textRange(node,from){var to=arguments.length>2&&arguments[2]!==undefined?arguments[2]:from;var range=scratchRange||(scratchRange=document.createRange());range.setEnd(node,to);range.setStart(node,from);return range;}function dispatchKey(elt,name,code){var options={key:name,code:name,keyCode:code,which:code,cancelable:true};var down=new KeyboardEvent("keydown",options);down.synthetic=true;elt.dispatchEvent(down);var up=new KeyboardEvent("keyup",options);up.synthetic=true;elt.dispatchEvent(up);return down.defaultPrevented||up.defaultPrevented;}function getRoot(node){while(node){if(node&&(node.nodeType==9||node.nodeType==11&&node.host))return node;node=node.assignedSlot||node.parentNode;}return null;}var DOMPos=/*#__PURE__*/function(){function DOMPos(node,offset){var precise=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;_classCallCheck(this,DOMPos);this.node=node;this.offset=offset;this.precise=precise;}_createClass(DOMPos,null,[{key:"before",value:function before(dom,precise){return new DOMPos(dom.parentNode,domIndex(dom),precise);}},{key:"after",value:function after(dom,precise){return new DOMPos(dom.parentNode,domIndex(dom)+1,precise);}}]);return DOMPos;}();var none$3=[];var ContentView=/*#__PURE__*/function(){function ContentView(){_classCallCheck(this,ContentView);this.parent=null;this.dom=null;this.dirty=2/* Node */;}_createClass(ContentView,[{key:"editorView",get:function get(){if(!this.parent)throw new Error("Accessing view in orphan content view");return this.parent.editorView;}},{key:"overrideDOMText",get:function get(){return null;}},{key:"posAtStart",get:function get(){return this.parent?this.parent.posBefore(this):0;}},{key:"posAtEnd",get:function get(){return this.posAtStart+this.length;}},{key:"posBefore",value:function posBefore(view){var pos=this.posAtStart;var _iterator206=_createForOfIteratorHelper(this.children),_step206;try{for(_iterator206.s();!(_step206=_iterator206.n()).done;){var child=_step206.value;if(child==view)return pos;pos+=child.length+child.breakAfter;}}catch(err){_iterator206.e(err);}finally{_iterator206.f();}throw new RangeError("Invalid child in posBefore");}},{key:"posAfter",value:function posAfter(view){return this.posBefore(view)+view.length;}// Will return a rectangle directly before (when side < 0), after 3645 + // (side > 0) or directly on (when the browser supports it) the 3646 + // given position. 3647 + },{key:"coordsAt",value:function coordsAt(_pos,_side){return null;}},{key:"sync",value:function sync(track){var _a;if(this.dirty&2/* Node */){var parent=this.dom;var pos=parent.firstChild;var _iterator207=_createForOfIteratorHelper(this.children),_step207;try{for(_iterator207.s();!(_step207=_iterator207.n()).done;){var child=_step207.value;if(child.dirty){if(!child.dom&&pos&&!((_a=ContentView.get(pos))===null||_a===void 0?void 0:_a.parent))child.reuseDOM(pos);child.sync(track);child.dirty=0/* Not */;}if(track&&!track.written&&track.node==parent&&pos!=child.dom)track.written=true;if(child.dom.parentNode==parent){while(pos&&pos!=child.dom){pos=rm(pos);}pos=child.dom.nextSibling;}else{parent.insertBefore(child.dom,pos);}}}catch(err){_iterator207.e(err);}finally{_iterator207.f();}if(pos&&track&&track.node==parent)track.written=true;while(pos){pos=rm(pos);}}else if(this.dirty&1/* Child */){var _iterator208=_createForOfIteratorHelper(this.children),_step208;try{for(_iterator208.s();!(_step208=_iterator208.n()).done;){var _child2=_step208.value;if(_child2.dirty){_child2.sync(track);_child2.dirty=0/* Not */;}}}catch(err){_iterator208.e(err);}finally{_iterator208.f();}}}},{key:"reuseDOM",value:function reuseDOM(_dom){return false;}},{key:"localPosFromDOM",value:function localPosFromDOM(node,offset){var after;if(node==this.dom){after=this.dom.childNodes[offset];}else{var bias=maxOffset(node)==0?0:offset==0?-1:1;for(;;){var parent=node.parentNode;if(parent==this.dom)break;if(bias==0&&parent.firstChild!=parent.lastChild){if(node==parent.firstChild)bias=-1;else bias=1;}node=parent;}if(bias<0)after=node;else after=node.nextSibling;}if(after==this.dom.firstChild)return 0;while(after&&!ContentView.get(after)){after=after.nextSibling;}if(!after)return this.length;for(var _i143=0,pos=0;;_i143++){var child=this.children[_i143];if(child.dom==after)return pos;pos+=child.length+child.breakAfter;}}},{key:"domBoundsAround",value:function domBoundsAround(from,to){var offset=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var fromI=-1,fromStart=-1,toI=-1,toEnd=-1;for(var _i144=0,pos=offset,prevEnd=offset;_i144<this.children.length;_i144++){var child=this.children[_i144],end=pos+child.length;if(pos<from&&end>to)return child.domBoundsAround(from,to,pos);if(end>=from&&fromI==-1){fromI=_i144;fromStart=pos;}if(pos>to&&child.dom.parentNode==this.dom){toI=_i144;toEnd=prevEnd;break;}prevEnd=end;pos=end+child.breakAfter;}return{from:fromStart,to:toEnd<0?offset+this.length:toEnd,startDOM:(fromI?this.children[fromI-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:toI<this.children.length&&toI>=0?this.children[toI].dom:null};}},{key:"markDirty",value:function markDirty(){var andParent=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;this.dirty|=2/* Node */;this.markParentsDirty(andParent);}},{key:"markParentsDirty",value:function markParentsDirty(childList){for(var parent=this.parent;parent;parent=parent.parent){if(childList)parent.dirty|=2/* Node */;if(parent.dirty&1/* Child */)return;parent.dirty|=1/* Child */;childList=false;}}},{key:"setParent",value:function setParent(parent){if(this.parent!=parent){this.parent=parent;if(this.dirty)this.markParentsDirty(true);}}},{key:"setDOM",value:function setDOM(dom){if(this.dom)this.dom.cmView=null;this.dom=dom;dom.cmView=this;}},{key:"rootView",get:function get(){for(var v=this;;){var parent=v.parent;if(!parent)return v;v=parent;}}},{key:"replaceChildren",value:function replaceChildren(from,to){var _this$children2;var children=arguments.length>2&&arguments[2]!==undefined?arguments[2]:none$3;this.markDirty();for(var _i145=from;_i145<to;_i145++){var child=this.children[_i145];if(child.parent==this)child.parent=null;}(_this$children2=this.children).splice.apply(_this$children2,[from,to-from].concat(_toConsumableArray(children)));for(var _i146=0;_i146<children.length;_i146++){children[_i146].setParent(this);}}},{key:"ignoreMutation",value:function ignoreMutation(_rec){return false;}},{key:"ignoreEvent",value:function ignoreEvent(_event){return false;}},{key:"childCursor",value:function childCursor(){var pos=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;return new ChildCursor(this.children,pos,this.children.length);}},{key:"childPos",value:function childPos(pos){var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;return this.childCursor().findPos(pos,bias);}},{key:"toString",value:function toString(){var name=this.constructor.name.replace("View","");return name+(this.children.length?"("+this.children.join()+")":this.length?"["+(name=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"");}},{key:"isEditable",get:function get(){return true;}}],[{key:"get",value:function get(node){return node.cmView;}}]);return ContentView;}();ContentView.prototype.breakAfter=0;// Remove a DOM node and return its next sibling. 3648 + function rm(dom){var next=dom.nextSibling;dom.parentNode.removeChild(dom);return next;}var ChildCursor=/*#__PURE__*/function(){function ChildCursor(children,pos,i){_classCallCheck(this,ChildCursor);this.children=children;this.pos=pos;this.i=i;this.off=0;}_createClass(ChildCursor,[{key:"findPos",value:function findPos(pos){var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;for(;;){if(pos>this.pos||pos==this.pos&&(bias>0||this.i==0||this.children[this.i-1].breakAfter)){this.off=pos-this.pos;return this;}var next=this.children[--this.i];this.pos-=next.length+next.breakAfter;}}}]);return ChildCursor;}();var _ref71=typeof navigator!="undefined"?[navigator,document]:[{userAgent:"",vendor:"",platform:""},{documentElement:{style:{}}}],_ref72=_slicedToArray(_ref71,2),nav=_ref72[0],doc=_ref72[1];var ie_edge=/Edge\/(\d+)/.exec(nav.userAgent);var ie_upto10=/MSIE \d/.test(nav.userAgent);var ie_11up=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(nav.userAgent);var ie=!!(ie_upto10||ie_11up||ie_edge);var gecko=!ie&&/gecko\/(\d+)/i.test(nav.userAgent);var chrome=!ie&&/Chrome\/(\d+)/.exec(nav.userAgent);var webkit=("webkitFontSmoothing"in doc.documentElement.style);var safari=!ie&&/Apple Computer/.test(nav.vendor);var ios=safari&&(/Mobile\/\w+/.test(nav.userAgent)||nav.maxTouchPoints>2);var browser={mac:ios||/Mac/.test(nav.platform),windows:/Win/.test(nav.platform),linux:/Linux|X11/.test(nav.platform),ie:ie,ie_version:ie_upto10?doc.documentMode||6:ie_11up?+ie_11up[1]:ie_edge?+ie_edge[1]:0,gecko:gecko,gecko_version:gecko?+(/Firefox\/(\d+)/.exec(nav.userAgent)||[0,0])[1]:0,chrome:!!chrome,chrome_version:chrome?+chrome[1]:0,ios:ios,android:/Android\b/.test(nav.userAgent),webkit:webkit,safari:safari,webkit_version:webkit?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:doc.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};var none$2=[];var InlineView=/*#__PURE__*/function(_ContentView8){_inherits(InlineView,_ContentView8);var _super44=_createSuper(InlineView);function InlineView(){_classCallCheck(this,InlineView);return _super44.apply(this,arguments);}_createClass(InlineView,[{key:"become",value:/** 3649 + Return true when this view is equivalent to `other` and can take 3650 + on its role. 3651 + */function become(_other){return false;}// When this is a zero-length view with a side, this should return a 3652 + // negative number to indicate it is before its position, or a 3653 + // positive number when after its position. 3654 + },{key:"getSide",value:function getSide(){return 0;}}]);return InlineView;}(ContentView);InlineView.prototype.children=none$2;var MaxJoinLen=256;var TextView=/*#__PURE__*/function(_InlineView){_inherits(TextView,_InlineView);var _super45=_createSuper(TextView);function TextView(text){var _this91;_classCallCheck(this,TextView);_this91=_super45.call(this);_this91.text=text;return _this91;}_createClass(TextView,[{key:"length",get:function get(){return this.text.length;}},{key:"createDOM",value:function createDOM(textDOM){this.setDOM(textDOM||document.createTextNode(this.text));}},{key:"sync",value:function sync(track){if(!this.dom)this.createDOM();if(this.dom.nodeValue!=this.text){if(track&&track.node==this.dom)track.written=true;this.dom.nodeValue=this.text;}}},{key:"reuseDOM",value:function reuseDOM(dom){if(dom.nodeType!=3)return false;this.createDOM(dom);return true;}},{key:"merge",value:function merge(from,to,source){if(source&&(!(source instanceof TextView)||this.length-(to-from)+source.length>MaxJoinLen))return false;this.text=this.text.slice(0,from)+(source?source.text:"")+this.text.slice(to);this.markDirty();return true;}},{key:"slice",value:function slice(from){var result=new TextView(this.text.slice(from));this.text=this.text.slice(0,from);return result;}},{key:"localPosFromDOM",value:function localPosFromDOM(node,offset){return node==this.dom?offset:offset?this.text.length:0;}},{key:"domAtPos",value:function domAtPos(pos){return new DOMPos(this.dom,pos);}},{key:"domBoundsAround",value:function domBoundsAround(_from,_to,offset){return{from:offset,to:offset+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling};}},{key:"coordsAt",value:function coordsAt(pos,side){return textCoords(this.dom,pos,side);}}]);return TextView;}(InlineView);var MarkView=/*#__PURE__*/function(_InlineView2){_inherits(MarkView,_InlineView2);var _super46=_createSuper(MarkView);function MarkView(mark){var _this92;var children=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var length=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;_classCallCheck(this,MarkView);_this92=_super46.call(this);_this92.mark=mark;_this92.children=children;_this92.length=length;var _iterator209=_createForOfIteratorHelper(children),_step209;try{for(_iterator209.s();!(_step209=_iterator209.n()).done;){var ch=_step209.value;ch.setParent(_assertThisInitialized(_this92));}}catch(err){_iterator209.e(err);}finally{_iterator209.f();}return _this92;}_createClass(MarkView,[{key:"createDOM",value:function createDOM(){var dom=document.createElement(this.mark.tagName);if(this.mark["class"])dom.className=this.mark["class"];if(this.mark.attrs)for(var name in this.mark.attrs){dom.setAttribute(name,this.mark.attrs[name]);}this.setDOM(dom);}},{key:"sync",value:function sync(track){if(!this.dom||this.dirty&4/* Attrs */)this.createDOM();_get(_getPrototypeOf(MarkView.prototype),"sync",this).call(this,track);}},{key:"merge",value:function merge(from,to,source,openStart,openEnd){if(source&&(!(source instanceof MarkView&&source.mark.eq(this.mark))||from&&openStart<=0||to<this.length&&openEnd<=0))return false;mergeInlineChildren(this,from,to,source?source.children:none$2,openStart-1,openEnd-1);this.markDirty();return true;}},{key:"slice",value:function slice(from){var result=[],off=0,detachFrom=-1,i=0;var _iterator210=_createForOfIteratorHelper(this.children),_step210;try{for(_iterator210.s();!(_step210=_iterator210.n()).done;){var elt=_step210.value;var end=off+elt.length;if(end>from)result.push(off<from?elt.slice(from-off):elt);if(detachFrom<0&&off>=from)detachFrom=i;off=end;i++;}}catch(err){_iterator210.e(err);}finally{_iterator210.f();}var length=this.length-from;this.length=from;if(detachFrom>-1)this.replaceChildren(detachFrom,this.children.length);return new MarkView(this.mark,result,length);}},{key:"domAtPos",value:function domAtPos(pos){return inlineDOMAtPos(this.dom,this.children,pos);}},{key:"coordsAt",value:function coordsAt(pos,side){return coordsInChildren(this,pos,side);}}]);return MarkView;}(InlineView);function textCoords(text,pos,side){var length=text.nodeValue.length;if(pos>length)pos=length;var from=pos,to=pos,flatten=0;if(pos==0&&side<0||pos==length&&side>=0){if(!(browser.chrome||browser.gecko)){// These browsers reliably return valid rectangles for empty ranges 3655 + if(pos){from--;flatten=1;}// FIXME this is wrong in RTL text 3656 + else{to++;flatten=-1;}}}else{if(side<0)from--;else to++;}var rects=textRange(text,from,to).getClientRects();if(!rects.length)return Rect0;var rect=rects[(flatten?flatten<0:side>=0)?0:rects.length-1];if(browser.safari&&!flatten&&rect.width==0)rect=Array.prototype.find.call(rects,function(r){return r.width;})||rect;return flatten?flattenRect(rect,flatten<0):rect;}// Also used for collapsed ranges that don't have a placeholder widget! 3657 + var WidgetView=/*#__PURE__*/function(_InlineView3){_inherits(WidgetView,_InlineView3);var _super47=_createSuper(WidgetView);function WidgetView(widget,length,side){var _this93;_classCallCheck(this,WidgetView);_this93=_super47.call(this);_this93.widget=widget;_this93.length=length;_this93.side=side;return _this93;}_createClass(WidgetView,[{key:"slice",value:function slice(from){var result=WidgetView.create(this.widget,this.length-from,this.side);this.length-=from;return result;}},{key:"sync",value:function sync(){if(!this.dom||!this.widget.updateDOM(this.dom)){this.setDOM(this.widget.toDOM(this.editorView));this.dom.contentEditable="false";}}},{key:"getSide",value:function getSide(){return this.side;}},{key:"merge",value:function merge(from,to,source,openStart,openEnd){if(source&&(!(source instanceof WidgetView)||!this.widget.compare(source.widget)||from>0&&openStart<=0||to<this.length&&openEnd<=0))return false;this.length=from+(source?source.length:0)+(this.length-to);return true;}},{key:"become",value:function become(other){if(other.length==this.length&&other instanceof WidgetView&&other.side==this.side){if(this.widget.constructor==other.widget.constructor){if(!this.widget.eq(other.widget))this.markDirty(true);this.widget=other.widget;return true;}}return false;}},{key:"ignoreMutation",value:function ignoreMutation(){return true;}},{key:"ignoreEvent",value:function ignoreEvent(event){return this.widget.ignoreEvent(event);}},{key:"overrideDOMText",get:function get(){if(this.length==0)return text.Text.empty;var top=this;while(top.parent){top=top.parent;}var view=top.editorView,text$1=view&&view.state.doc,start=this.posAtStart;return text$1?text$1.slice(start,start+this.length):text.Text.empty;}},{key:"domAtPos",value:function domAtPos(pos){return pos==0?DOMPos.before(this.dom):DOMPos.after(this.dom,pos==this.length);}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(pos,side){var rects=this.dom.getClientRects(),rect=null;if(!rects.length)return Rect0;for(var _i147=pos>0?rects.length-1:0;;_i147+=pos>0?-1:1){rect=rects[_i147];if(pos>0?_i147==0:_i147==rects.length-1||rect.top<rect.bottom)break;}return pos==0&&side>0||pos==this.length&&side<=0?rect:flattenRect(rect,pos==0);}},{key:"isEditable",get:function get(){return false;}}],[{key:"create",value:function create(widget,length,side){return new(widget.customView||WidgetView)(widget,length,side);}}]);return WidgetView;}(InlineView);var CompositionView=/*#__PURE__*/function(_WidgetView2){_inherits(CompositionView,_WidgetView2);var _super48=_createSuper(CompositionView);function CompositionView(){_classCallCheck(this,CompositionView);return _super48.apply(this,arguments);}_createClass(CompositionView,[{key:"domAtPos",value:function domAtPos(pos){return new DOMPos(this.widget.text,pos);}},{key:"sync",value:function sync(){if(!this.dom)this.setDOM(this.widget.toDOM());}},{key:"localPosFromDOM",value:function localPosFromDOM(node,offset){return!offset?0:node.nodeType==3?Math.min(offset,this.length):this.length;}},{key:"ignoreMutation",value:function ignoreMutation(){return false;}},{key:"overrideDOMText",get:function get(){return null;}},{key:"coordsAt",value:function coordsAt(pos,side){return textCoords(this.widget.text,pos,side);}},{key:"isEditable",get:function get(){return true;}}]);return CompositionView;}(WidgetView);// These are drawn around uneditable widgets to avoid a number of 3658 + // browser bugs that show up when the cursor is directly next to 3659 + // uneditable inline content. 3660 + var WidgetBufferView=/*#__PURE__*/function(_InlineView4){_inherits(WidgetBufferView,_InlineView4);var _super49=_createSuper(WidgetBufferView);function WidgetBufferView(side){var _this94;_classCallCheck(this,WidgetBufferView);_this94=_super49.call(this);_this94.side=side;return _this94;}_createClass(WidgetBufferView,[{key:"length",get:function get(){return 0;}},{key:"merge",value:function merge(){return false;}},{key:"become",value:function become(other){return other instanceof WidgetBufferView&&other.side==this.side;}},{key:"slice",value:function slice(){return new WidgetBufferView(this.side);}},{key:"sync",value:function sync(){if(!this.dom)this.setDOM(document.createTextNode("\u200B"));else if(this.dirty&&this.dom.nodeValue!="\u200B")this.dom.nodeValue="\u200B";}},{key:"getSide",value:function getSide(){return this.side;}},{key:"domAtPos",value:function domAtPos(pos){return DOMPos.before(this.dom);}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"coordsAt",value:function coordsAt(pos){var rects=clientRectsFor(this.dom);return rects[rects.length-1];}},{key:"overrideDOMText",get:function get(){return text.Text.of([this.dom.nodeValue.replace(/\u200b/g,"")]);}}]);return WidgetBufferView;}(InlineView);function mergeInlineChildren(parent,from,to,elts,openStart,openEnd){var cur=parent.childCursor();var _cur$findPos3=cur.findPos(to,1),toI=_cur$findPos3.i,toOff=_cur$findPos3.off;var _cur$findPos4=cur.findPos(from,-1),fromI=_cur$findPos4.i,fromOff=_cur$findPos4.off;var dLen=from-to;var _iterator211=_createForOfIteratorHelper(elts),_step211;try{for(_iterator211.s();!(_step211=_iterator211.n()).done;){var view=_step211.value;dLen+=view.length;}}catch(err){_iterator211.e(err);}finally{_iterator211.f();}parent.length+=dLen;var children=parent.children;// Both from and to point into the same child view 3661 + if(fromI==toI&&fromOff){var start=children[fromI];// Maybe just update that view and be done 3662 + if(elts.length==1&&start.merge(fromOff,toOff,elts[0],openStart,openEnd))return;if(elts.length==0){start.merge(fromOff,toOff,null,openStart,openEnd);return;}// Otherwise split it, so that we don't have to worry about aliasing front/end afterwards 3663 + var after=start.slice(toOff);if(after.merge(0,0,elts[elts.length-1],0,openEnd))elts[elts.length-1]=after;else elts.push(after);toI++;openEnd=toOff=0;}// Make sure start and end positions fall on node boundaries 3664 + // (fromOff/toOff are no longer used after this), and that if the 3665 + // start or end of the elts can be merged with adjacent nodes, 3666 + // this is done 3667 + if(toOff){var end=children[toI];if(elts.length&&end.merge(0,toOff,elts[elts.length-1],0,openEnd)){elts.pop();openEnd=elts.length?0:openStart;}else{end.merge(0,toOff,null,0,0);}}else if(toI<children.length&&elts.length&&children[toI].merge(0,0,elts[elts.length-1],0,openEnd)){elts.pop();openEnd=elts.length?0:openStart;}if(fromOff){var _start5=children[fromI];if(elts.length&&_start5.merge(fromOff,_start5.length,elts[0],openStart,0)){elts.shift();openStart=elts.length?0:openEnd;}else{_start5.merge(fromOff,_start5.length,null,0,0);}fromI++;}else if(fromI&&elts.length){var _end4=children[fromI-1];if(_end4.merge(_end4.length,_end4.length,elts[0],openStart,0)){elts.shift();openStart=elts.length?0:openEnd;}}// Then try to merge any mergeable nodes at the start and end of 3668 + // the changed range 3669 + while(fromI<toI&&elts.length&&children[toI-1].become(elts[elts.length-1])){elts.pop();toI--;openEnd=elts.length?0:openStart;}while(fromI<toI&&elts.length&&children[fromI].become(elts[0])){elts.shift();fromI++;openStart=elts.length?0:openEnd;}if(!elts.length&&fromI&&toI<children.length&&children[toI].merge(0,0,children[fromI-1],openStart,openEnd))fromI--;// And if anything remains, splice the child array to insert the new elts 3670 + if(elts.length||fromI!=toI)parent.replaceChildren(fromI,toI,elts);}function inlineDOMAtPos(dom,children,pos){var i=0;for(var off=0;i<children.length;i++){var child=children[i],end=off+child.length;if(end==off&&child.getSide()<=0)continue;if(pos>off&&pos<end&&child.dom.parentNode==dom)return child.domAtPos(pos-off);if(pos<=off)break;off=end;}for(;i>0;i--){var before=children[i-1].dom;if(before.parentNode==dom)return DOMPos.after(before);}return new DOMPos(dom,0);}// Assumes `view`, if a mark view, has precisely 1 child. 3671 + function joinInlineInto(parent,view,open){var last,children=parent.children;if(open>0&&view instanceof MarkView&&children.length&&(last=children[children.length-1])instanceof MarkView&&last.mark.eq(view.mark)){joinInlineInto(last,view.children[0],open-1);}else{children.push(view);view.setParent(parent);}parent.length+=view.length;}function coordsInChildren(view,pos,side){for(var off=0,_i148=0;_i148<view.children.length;_i148++){var child=view.children[_i148],end=off+child.length,next=void 0;if((side<=0||end==view.length||child.getSide()>0?end>=pos:end>pos)&&(pos<end||_i148+1==view.children.length||(next=view.children[_i148+1]).length||next.getSide()>0)){var flatten=0;if(end==off){if(child.getSide()<=0)continue;flatten=side=-child.getSide();}var rect=child.coordsAt(pos-off,side);return flatten&&rect?flattenRect(rect,side<0):rect;}off=end;}var last=view.dom.lastChild;if(!last)return view.dom.getBoundingClientRect();var rects=clientRectsFor(last);return rects[rects.length-1];}function combineAttrs(source,target){for(var name in source){if(name=="class"&&target["class"])target["class"]+=" "+source["class"];else if(name=="style"&&target.style)target.style+=";"+source.style;else target[name]=source[name];}return target;}function attrsEq(a,b){if(a==b)return true;if(!a||!b)return false;var keysA=Object.keys(a),keysB=Object.keys(b);if(keysA.length!=keysB.length)return false;for(var _i149=0,_keysA2=keysA;_i149<_keysA2.length;_i149++){var key=_keysA2[_i149];if(keysB.indexOf(key)==-1||a[key]!==b[key])return false;}return true;}function _updateAttrs2(dom,prev,attrs){if(prev)for(var name in prev){if(!(attrs&&name in attrs))dom.removeAttribute(name);}if(attrs)for(var _name2 in attrs){if(!(prev&&prev[_name2]==attrs[_name2]))dom.setAttribute(_name2,attrs[_name2]);}}/** 3672 + Widgets added to the content are described by subclasses of this 3673 + class. Using a description object like that makes it possible to 3674 + delay creating of the DOM structure for a widget until it is 3675 + needed, and to avoid redrawing widgets even when the decorations 3676 + that define them are recreated. 3677 + */var WidgetType=/*#__PURE__*/function(){function WidgetType(){_classCallCheck(this,WidgetType);}_createClass(WidgetType,[{key:"eq",value:/** 3678 + Compare this instance to another instance of the same type. 3679 + (TypeScript can't express this, but only instances of the same 3680 + specific class will be passed to this method.) This is used to 3681 + avoid redrawing widgets when they are replaced by a new 3682 + decoration of the same type. The default implementation just 3683 + returns `false`, which will cause new instances of the widget to 3684 + always be redrawn. 3685 + */function eq(_widget){return false;}/** 3686 + Update a DOM element created by a widget of the same type (but 3687 + different, non-`eq` content) to reflect this widget. May return 3688 + true to indicate that it could update, false to indicate it 3689 + couldn't (in which case the widget will be redrawn). The default 3690 + implementation just returns false. 3691 + */},{key:"updateDOM",value:function updateDOM(_dom){return false;}/** 3692 + @internal 3693 + */},{key:"compare",value:function compare(other){return this==other||this.constructor==other.constructor&&this.eq(other);}/** 3694 + The estimated height this widget will have, to be used when 3695 + estimating the height of content that hasn't been drawn. May 3696 + return -1 to indicate you don't know. The default implementation 3697 + returns -1. 3698 + */},{key:"estimatedHeight",get:function get(){return-1;}/** 3699 + Can be used to configure which kinds of events inside the widget 3700 + should be ignored by the editor. The default is to ignore all 3701 + events. 3702 + */},{key:"ignoreEvent",value:function ignoreEvent(_event){return true;}/** 3703 + @internal 3704 + */},{key:"customView",get:function get(){return null;}}]);return WidgetType;}();/** 3705 + The different types of blocks that can occur in an editor view. 3706 + */exports.BlockType=void 0;(function(BlockType){/** 3707 + A line of text. 3708 + */BlockType[BlockType["Text"]=0]="Text";/** 3709 + A block widget associated with the position after it. 3710 + */BlockType[BlockType["WidgetBefore"]=1]="WidgetBefore";/** 3711 + A block widget associated with the position before it. 3712 + */BlockType[BlockType["WidgetAfter"]=2]="WidgetAfter";/** 3713 + A block widget [replacing](https://codemirror.net/6/docs/ref/#view.Decoration^replace) a range of content. 3714 + */BlockType[BlockType["WidgetRange"]=3]="WidgetRange";})(exports.BlockType||(exports.BlockType={}));/** 3715 + A decoration provides information on how to draw or style a piece 3716 + of content. You'll usually use it wrapped in a 3717 + [`Range`](https://codemirror.net/6/docs/ref/#rangeset.Range), which adds a start and end position. 3718 + */var Decoration=/*#__PURE__*/function(_rangeset$RangeValue4){_inherits(Decoration,_rangeset$RangeValue4);var _super50=_createSuper(Decoration);/** 3719 + @internal 3720 + */function Decoration(/** 3721 + @internal 3722 + */startSide,/** 3723 + @internal 3724 + */endSide,/** 3725 + @internal 3726 + */widget,/** 3727 + The config object used to create this decoration. You can 3728 + include additional properties in there to store metadata about 3729 + your decoration. 3730 + */spec){var _this95;_classCallCheck(this,Decoration);_this95=_super50.call(this);_this95.startSide=startSide;_this95.endSide=endSide;_this95.widget=widget;_this95.spec=spec;return _this95;}/** 3731 + @internal 3732 + */_createClass(Decoration,[{key:"heightRelevant",get:function get(){return false;}/** 3733 + Create a mark decoration, which influences the styling of the 3734 + content in its range. Nested mark decorations will cause nested 3735 + DOM elements to be created. Nesting order is determined by 3736 + precedence of the [facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations) or 3737 + (below the facet-provided decorations) [view 3738 + plugin](https://codemirror.net/6/docs/ref/#view.PluginSpec.decorations). Such elements are split 3739 + on line boundaries and on the boundaries of higher-precedence 3740 + decorations. 3741 + */},{key:"hasHeight",value:/** 3742 + @internal 3743 + */function hasHeight(){return this.widget?this.widget.estimatedHeight>-1:false;}}],[{key:"mark",value:function mark(spec){return new MarkDecoration(spec);}/** 3744 + Create a widget decoration, which adds an element at the given 3745 + position. 3746 + */},{key:"widget",value:function widget(spec){var side=spec.side||0;return new PointDecoration(spec,side,side,!!spec.block,spec.widget||null,false);}/** 3747 + Create a replace decoration which replaces the given range with 3748 + a widget, or simply hides it. 3749 + */},{key:"replace",value:function replace(spec){var block=!!spec.block;var _getInclusive3=getInclusive(spec,block),start=_getInclusive3.start,end=_getInclusive3.end;var startSide=100000000/* Big */*(start?-1:1)*(block?2:1);var endSide=100000000/* Big */*(end?1:-1)*(block?2:1);return new PointDecoration(spec,startSide,endSide,block,spec.widget||null,true);}/** 3750 + Create a line decoration, which can add DOM attributes to the 3751 + line starting at the given position. 3752 + */},{key:"line",value:function line(spec){return new LineDecoration(spec);}/** 3753 + Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given 3754 + decorated range or ranges. If the ranges aren't already sorted, 3755 + pass `true` for `sort` to make the library sort them for you. 3756 + */},{key:"set",value:function set(of){var sort=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;return rangeset.RangeSet.of(of,sort);}}]);return Decoration;}(rangeset.RangeValue);/** 3757 + The empty set of decorations. 3758 + */Decoration.none=rangeset.RangeSet.empty;var MarkDecoration=/*#__PURE__*/function(_Decoration4){_inherits(MarkDecoration,_Decoration4);var _super51=_createSuper(MarkDecoration);function MarkDecoration(spec){var _this96;_classCallCheck(this,MarkDecoration);var _getInclusive4=getInclusive(spec),start=_getInclusive4.start,end=_getInclusive4.end;_this96=_super51.call(this,100000000/* Big */*(start?-1:1),100000000/* Big */*(end?1:-1),null,spec);_this96.tagName=spec.tagName||"span";_this96["class"]=spec["class"]||"";_this96.attrs=spec.attributes||null;return _this96;}_createClass(MarkDecoration,[{key:"eq",value:function eq(other){return this==other||other instanceof MarkDecoration&&this.tagName==other.tagName&&this["class"]==other["class"]&&attrsEq(this.attrs,other.attrs);}},{key:"range",value:function range(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;if(from>=to)throw new RangeError("Mark decorations may not be empty");return _get(_getPrototypeOf(MarkDecoration.prototype),"range",this).call(this,from,to);}}]);return MarkDecoration;}(Decoration);MarkDecoration.prototype.point=false;var LineDecoration=/*#__PURE__*/function(_Decoration5){_inherits(LineDecoration,_Decoration5);var _super52=_createSuper(LineDecoration);function LineDecoration(spec){_classCallCheck(this,LineDecoration);return _super52.call(this,-100000000/* Big */,-100000000/* Big */,null,spec);}_createClass(LineDecoration,[{key:"eq",value:function eq(other){return other instanceof LineDecoration&&attrsEq(this.spec.attributes,other.spec.attributes);}},{key:"range",value:function range(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;if(to!=from)throw new RangeError("Line decoration ranges must be zero-length");return _get(_getPrototypeOf(LineDecoration.prototype),"range",this).call(this,from,to);}}]);return LineDecoration;}(Decoration);LineDecoration.prototype.mapMode=state.MapMode.TrackBefore;LineDecoration.prototype.point=true;var PointDecoration=/*#__PURE__*/function(_Decoration6){_inherits(PointDecoration,_Decoration6);var _super53=_createSuper(PointDecoration);function PointDecoration(spec,startSide,endSide,block,widget,isReplace){var _this97;_classCallCheck(this,PointDecoration);_this97=_super53.call(this,startSide,endSide,widget,spec);_this97.block=block;_this97.isReplace=isReplace;_this97.mapMode=!block?state.MapMode.TrackDel:startSide<0?state.MapMode.TrackBefore:state.MapMode.TrackAfter;return _this97;}// Only relevant when this.block == true 3759 + _createClass(PointDecoration,[{key:"type",get:function get(){return this.startSide<this.endSide?exports.BlockType.WidgetRange:this.startSide<0?exports.BlockType.WidgetBefore:exports.BlockType.WidgetAfter;}},{key:"heightRelevant",get:function get(){return this.block||!!this.widget&&this.widget.estimatedHeight>=5;}},{key:"eq",value:function eq(other){return other instanceof PointDecoration&&widgetsEq(this.widget,other.widget)&&this.block==other.block&&this.startSide==other.startSide&&this.endSide==other.endSide;}},{key:"range",value:function range(from){var to=arguments.length>1&&arguments[1]!==undefined?arguments[1]:from;if(this.isReplace&&(from>to||from==to&&this.startSide>0&&this.endSide<0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&to!=from)throw new RangeError("Widget decorations can only have zero-length ranges");return _get(_getPrototypeOf(PointDecoration.prototype),"range",this).call(this,from,to);}}]);return PointDecoration;}(Decoration);PointDecoration.prototype.point=true;function getInclusive(spec){var block=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var start=spec.inclusiveStart,end=spec.inclusiveEnd;if(start==null)start=spec.inclusive;if(end==null)end=spec.inclusive;return{start:start!==null&&start!==void 0?start:block,end:end!==null&&end!==void 0?end:block};}function widgetsEq(a,b){return a==b||!!(a&&b&&a.compare(b));}function addRange(from,to,ranges){var margin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;var last=ranges.length-1;if(last>=0&&ranges[last]+margin>from)ranges[last]=Math.max(ranges[last],to);else ranges.push(from,to);}var LineView=/*#__PURE__*/function(_ContentView9){_inherits(LineView,_ContentView9);var _super54=_createSuper(LineView);function LineView(){var _this98;_classCallCheck(this,LineView);_this98=_super54.apply(this,arguments);_this98.children=[];_this98.length=0;_this98.prevAttrs=undefined;_this98.attrs=null;_this98.breakAfter=0;return _this98;}// Consumes source 3760 + _createClass(LineView,[{key:"merge",value:function merge(from,to,source,takeDeco,openStart,openEnd){if(source){if(!(source instanceof LineView))return false;if(!this.dom)source.transferDOM(this);// Reuse source.dom when appropriate 3761 + }if(takeDeco)this.setDeco(source?source.attrs:null);mergeInlineChildren(this,from,to,source?source.children:none$1,openStart,openEnd);return true;}},{key:"split",value:function split(at){var end=new LineView();end.breakAfter=this.breakAfter;if(this.length==0)return end;var _this$childPos2=this.childPos(at),i=_this$childPos2.i,off=_this$childPos2.off;if(off){end.append(this.children[i].slice(off),0);this.children[i].merge(off,this.children[i].length,null,0,0);i++;}for(var j=i;j<this.children.length;j++){end.append(this.children[j],0);}while(i>0&&this.children[i-1].length==0){this.children[i-1].parent=null;i--;}this.children.length=i;this.markDirty();this.length=at;return end;}},{key:"transferDOM",value:function transferDOM(other){if(!this.dom)return;other.setDOM(this.dom);other.prevAttrs=this.prevAttrs===undefined?this.attrs:this.prevAttrs;this.prevAttrs=undefined;this.dom=null;}},{key:"setDeco",value:function setDeco(attrs){if(!attrsEq(this.attrs,attrs)){if(this.dom){this.prevAttrs=this.attrs;this.markDirty();}this.attrs=attrs;}}// Only called when building a line view in ContentBuilder 3762 + },{key:"append",value:function append(child,openStart){joinInlineInto(this,child,openStart);}// Only called when building a line view in ContentBuilder 3763 + },{key:"addLineDeco",value:function addLineDeco(deco){var attrs=deco.spec.attributes,cls=deco.spec["class"];if(attrs)this.attrs=combineAttrs(attrs,this.attrs||{});if(cls)this.attrs=combineAttrs(attrs,{"class":cls});}},{key:"domAtPos",value:function domAtPos(pos){return inlineDOMAtPos(this.dom,this.children,pos);}},{key:"sync",value:function sync(track){var _a;if(!this.dom||this.dirty&4/* Attrs */){this.setDOM(document.createElement("div"));this.dom.className="cm-line";this.prevAttrs=this.attrs?null:undefined;}if(this.prevAttrs!==undefined){_updateAttrs2(this.dom,this.prevAttrs,this.attrs);this.dom.classList.add("cm-line");this.prevAttrs=undefined;}_get(_getPrototypeOf(LineView.prototype),"sync",this).call(this,track);var last=this.dom.lastChild;while(last&&ContentView.get(last)instanceof MarkView){last=last.lastChild;}if(!last||last.nodeName!="BR"&&((_a=ContentView.get(last))===null||_a===void 0?void 0:_a.isEditable)==false&&(!browser.ios||!this.children.some(function(ch){return ch instanceof TextView;}))){var hack=document.createElement("BR");hack.cmIgnore=true;this.dom.appendChild(hack);}}},{key:"measureTextSize",value:function measureTextSize(){if(this.children.length==0||this.length>20)return null;var totalWidth=0;var _iterator212=_createForOfIteratorHelper(this.children),_step212;try{for(_iterator212.s();!(_step212=_iterator212.n()).done;){var child=_step212.value;if(!(child instanceof TextView))return null;var rects=clientRectsFor(child.dom);if(rects.length!=1)return null;totalWidth+=rects[0].width;}}catch(err){_iterator212.e(err);}finally{_iterator212.f();}return{lineHeight:this.dom.getBoundingClientRect().height,charWidth:totalWidth/this.length};}},{key:"coordsAt",value:function coordsAt(pos,side){return coordsInChildren(this,pos,side);}},{key:"match",value:function match(_other){return false;}},{key:"type",get:function get(){return exports.BlockType.Text;}}],[{key:"find",value:function find(docView,pos){for(var _i150=0,off=0;;_i150++){var block=docView.children[_i150],end=off+block.length;if(end>=pos){if(block instanceof LineView)return block;if(block.length)return null;}off=end+block.breakAfter;}}}]);return LineView;}(ContentView);var none$1=[];var BlockWidgetView=/*#__PURE__*/function(_ContentView10){_inherits(BlockWidgetView,_ContentView10);var _super55=_createSuper(BlockWidgetView);function BlockWidgetView(widget,length,type){var _this99;_classCallCheck(this,BlockWidgetView);_this99=_super55.call(this);_this99.widget=widget;_this99.length=length;_this99.type=type;_this99.breakAfter=0;return _this99;}_createClass(BlockWidgetView,[{key:"merge",value:function merge(from,to,source,_takeDeco,openStart,openEnd){if(source&&(!(source instanceof BlockWidgetView)||!this.widget.compare(source.widget)||from>0&&openStart<=0||to<this.length&&openEnd<=0))return false;this.length=from+(source?source.length:0)+(this.length-to);return true;}},{key:"domAtPos",value:function domAtPos(pos){return pos==0?DOMPos.before(this.dom):DOMPos.after(this.dom,pos==this.length);}},{key:"split",value:function split(at){var len=this.length-at;this.length=at;var end=new BlockWidgetView(this.widget,len,this.type);end.breakAfter=this.breakAfter;return end;}},{key:"children",get:function get(){return none$1;}},{key:"sync",value:function sync(){if(!this.dom||!this.widget.updateDOM(this.dom)){this.setDOM(this.widget.toDOM(this.editorView));this.dom.contentEditable="false";}}},{key:"overrideDOMText",get:function get(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):state.Text.empty;}},{key:"domBoundsAround",value:function domBoundsAround(){return null;}},{key:"match",value:function match(other){if(other instanceof BlockWidgetView&&other.type==this.type&&other.widget.constructor==this.widget.constructor){if(!other.widget.eq(this.widget))this.markDirty(true);this.widget=other.widget;this.length=other.length;this.breakAfter=other.breakAfter;return true;}return false;}},{key:"ignoreMutation",value:function ignoreMutation(){return true;}},{key:"ignoreEvent",value:function ignoreEvent(event){return this.widget.ignoreEvent(event);}}]);return BlockWidgetView;}(ContentView);var ContentBuilder=/*#__PURE__*/function(){function ContentBuilder(doc,pos,end){_classCallCheck(this,ContentBuilder);this.doc=doc;this.pos=pos;this.end=end;this.content=[];this.curLine=null;this.breakAtStart=0;this.pendingBuffer=0/* No */;// Set to false directly after a widget that covers the position after it 3764 + this.atCursorPos=true;this.openStart=-1;this.openEnd=-1;this.text="";this.textOff=0;this.cursor=doc.iter();this.skip=pos;}_createClass(ContentBuilder,[{key:"posCovered",value:function posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;var last=this.content[this.content.length-1];return!last.breakAfter&&!(last instanceof BlockWidgetView&&last.type==exports.BlockType.WidgetBefore);}},{key:"getLine",value:function getLine(){if(!this.curLine){this.content.push(this.curLine=new LineView());this.atCursorPos=true;}return this.curLine;}},{key:"flushBuffer",value:function flushBuffer(active){if(this.pendingBuffer){this.curLine.append(wrapMarks(new WidgetBufferView(-1),active),active.length);this.pendingBuffer=0/* No */;}}},{key:"addBlockWidget",value:function addBlockWidget(view){this.flushBuffer([]);this.curLine=null;this.content.push(view);}},{key:"finish",value:function finish(openEnd){if(!openEnd)this.flushBuffer([]);else this.pendingBuffer=0/* No */;if(!this.posCovered())this.getLine();}},{key:"buildText",value:function buildText(length,active,openStart){while(length>0){if(this.textOff==this.text.length){var _this$cursor$next3=this.cursor.next(this.skip),value=_this$cursor$next3.value,lineBreak=_this$cursor$next3.lineBreak,done=_this$cursor$next3.done;this.skip=0;if(done)throw new Error("Ran out of text content when drawing inline views");if(lineBreak){if(!this.posCovered())this.getLine();if(this.content.length)this.content[this.content.length-1].breakAfter=1;else this.breakAtStart=1;this.flushBuffer([]);this.curLine=null;length--;continue;}else{this.text=value;this.textOff=0;}}var take=Math.min(this.text.length-this.textOff,length,512/* Chunk */);this.flushBuffer(active);this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff,this.textOff+take)),active),openStart);this.atCursorPos=true;this.textOff+=take;length-=take;openStart=0;}}},{key:"span",value:function span(from,to,active,openStart){this.buildText(to-from,active,openStart);this.pos=to;if(this.openStart<0)this.openStart=openStart;}},{key:"point",value:function point(from,to,deco,active,openStart){var len=to-from;if(deco instanceof PointDecoration){if(deco.block){var type=deco.type;if(type==exports.BlockType.WidgetAfter&&!this.posCovered())this.getLine();this.addBlockWidget(new BlockWidgetView(deco.widget||new NullWidget("div"),len,type));}else{var view=WidgetView.create(deco.widget||new NullWidget("span"),len,deco.startSide);var cursorBefore=this.atCursorPos&&!view.isEditable&&openStart<=active.length&&(from<to||deco.startSide>0);var cursorAfter=!view.isEditable&&(from<to||deco.startSide<=0);var line=this.getLine();if(this.pendingBuffer==2/* IfCursor */&&!cursorBefore)this.pendingBuffer=0/* No */;this.flushBuffer(active);if(cursorBefore){line.append(wrapMarks(new WidgetBufferView(1),active),openStart);openStart=active.length+Math.max(0,openStart-active.length);}line.append(wrapMarks(view,active),openStart);this.atCursorPos=cursorAfter;this.pendingBuffer=!cursorAfter?0/* No */:from<to?1/* Yes */:2/* IfCursor */;}}else if(this.doc.lineAt(this.pos).from==this.pos){// Line decoration 3765 + this.getLine().addLineDeco(deco);}if(len){// Advance the iterator past the replaced content 3766 + if(this.textOff+len<=this.text.length){this.textOff+=len;}else{this.skip+=len-(this.text.length-this.textOff);this.text="";this.textOff=0;}this.pos=to;}if(this.openStart<0)this.openStart=openStart;}}],[{key:"build",value:function build(text,from,to,decorations){var builder=new ContentBuilder(text,from,to);builder.openEnd=rangeset.RangeSet.spans(decorations,from,to,builder);if(builder.openStart<0)builder.openStart=builder.openEnd;builder.finish(builder.openEnd);return builder;}}]);return ContentBuilder;}();function wrapMarks(view,active){var _iterator213=_createForOfIteratorHelper(active),_step213;try{for(_iterator213.s();!(_step213=_iterator213.n()).done;){var mark=_step213.value;view=new MarkView(mark,[view],view.length);}}catch(err){_iterator213.e(err);}finally{_iterator213.f();}return view;}var NullWidget=/*#__PURE__*/function(_WidgetType8){_inherits(NullWidget,_WidgetType8);var _super56=_createSuper(NullWidget);function NullWidget(tag){var _this100;_classCallCheck(this,NullWidget);_this100=_super56.call(this);_this100.tag=tag;return _this100;}_createClass(NullWidget,[{key:"eq",value:function eq(other){return other.tag==this.tag;}},{key:"toDOM",value:function toDOM(){return document.createElement(this.tag);}},{key:"updateDOM",value:function updateDOM(elt){return elt.nodeName.toLowerCase()==this.tag;}}]);return NullWidget;}(WidgetType);var none=[];var clickAddsSelectionRange=state.Facet.define();var dragMovesSelection$1=state.Facet.define();var mouseSelectionStyle=state.Facet.define();var exceptionSink=state.Facet.define();var updateListener=state.Facet.define();var inputHandler=state.Facet.define();var scrollTo=state.StateEffect.define({map:function map(range,changes){return range.map(changes);}});var centerOn=state.StateEffect.define({map:function map(range,changes){return range.map(changes);}});/** 3767 + Log or report an unhandled exception in client code. Should 3768 + probably only be used by extension code that allows client code to 3769 + provide functions, and calls those functions in a context where an 3770 + exception can't be propagated to calling code in a reasonable way 3771 + (for example when in an event handler). 3772 + 3773 + Either calls a handler registered with 3774 + [`EditorView.exceptionSink`](https://codemirror.net/6/docs/ref/#view.EditorView^exceptionSink), 3775 + `window.onerror`, if defined, or `console.error` (in which case 3776 + it'll pass `context`, when given, as first argument). 3777 + */function logException(state,exception,context){var handler=state.facet(exceptionSink);if(handler.length)handler[0](exception);else if(window.onerror)window.onerror(String(exception),context,undefined,undefined,exception);else if(context)console.error(context+":",exception);else console.error(exception);}var editable=state.Facet.define({combine:function combine(values){return values.length?values[0]:true;}});/** 3778 + Used to [declare](https://codemirror.net/6/docs/ref/#view.PluginSpec.provide) which 3779 + [fields](https://codemirror.net/6/docs/ref/#view.PluginValue) a [view plugin](https://codemirror.net/6/docs/ref/#view.ViewPlugin) 3780 + provides. 3781 + */var PluginFieldProvider=/*#__PURE__*/_createClass(/** 3782 + @internal 3783 + */function PluginFieldProvider(/** 3784 + @internal 3785 + */field,/** 3786 + @internal 3787 + */get){_classCallCheck(this,PluginFieldProvider);this.field=field;this.get=get;});/** 3788 + Plugin fields are a mechanism for allowing plugins to provide 3789 + values that can be retrieved through the 3790 + [`pluginField`](https://codemirror.net/6/docs/ref/#view.EditorView.pluginField) view method. 3791 + */var PluginField=/*#__PURE__*/function(){function PluginField(){_classCallCheck(this,PluginField);}_createClass(PluginField,[{key:"from",value:/** 3792 + Create a [provider](https://codemirror.net/6/docs/ref/#view.PluginFieldProvider) for this field, 3793 + to use with a plugin's [provide](https://codemirror.net/6/docs/ref/#view.PluginSpec.provide) 3794 + option. 3795 + */function from(get){return new PluginFieldProvider(this,get);}/** 3796 + Define a new plugin field. 3797 + */}],[{key:"define",value:function define(){return new PluginField();}}]);return PluginField;}();/** 3798 + This field can be used by plugins to provide 3799 + [decorations](https://codemirror.net/6/docs/ref/#view.Decoration). 3800 + 3801 + **Note**: For reasons of data flow (plugins are only updated 3802 + after the viewport is computed), decorations produced by plugins 3803 + are _not_ taken into account when predicting the vertical layout 3804 + structure of the editor. Thus, things like large widgets or big 3805 + replacements (i.e. code folding) should be provided through the 3806 + state-level [`decorations` facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), 3807 + not this plugin field. Specifically, replacing decorations that 3808 + cross line boundaries will break if provided through a plugin. 3809 + */PluginField.decorations=PluginField.define();/** 3810 + Used to provide ranges that should be treated as atoms as far as 3811 + cursor motion is concerned. This causes methods like 3812 + [`moveByChar`](https://codemirror.net/6/docs/ref/#view.EditorView.moveByChar) and 3813 + [`moveVertically`](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) (and the 3814 + commands built on top of them) to skip across such regions when 3815 + a selection endpoint would enter them. This does _not_ prevent 3816 + direct programmatic [selection 3817 + updates](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) from moving into such 3818 + regions. 3819 + */PluginField.atomicRanges=PluginField.define();/** 3820 + Plugins can provide additional scroll margins (space around the 3821 + sides of the scrolling element that should be considered 3822 + invisible) through this field. This can be useful when the 3823 + plugin introduces elements that cover part of that element (for 3824 + example a horizontally fixed gutter). 3825 + */PluginField.scrollMargins=PluginField.define();var nextPluginID=0;var viewPlugin=state.Facet.define();/** 3826 + View plugins associate stateful values with a view. They can 3827 + influence the way the content is drawn, and are notified of things 3828 + that happen in the view. 3829 + */var ViewPlugin=/*#__PURE__*/function(){function ViewPlugin(/** 3830 + @internal 3831 + */id,/** 3832 + @internal 3833 + */create,/** 3834 + @internal 3835 + */fields){_classCallCheck(this,ViewPlugin);this.id=id;this.create=create;this.fields=fields;this.extension=viewPlugin.of(this);}/** 3836 + Define a plugin from a constructor function that creates the 3837 + plugin's value, given an editor view. 3838 + */_createClass(ViewPlugin,null,[{key:"define",value:function define(create,spec){var _ref73=spec||{},eventHandlers=_ref73.eventHandlers,provide=_ref73.provide,decorations=_ref73.decorations;var fields=[];if(provide){var _iterator214=_createForOfIteratorHelper(Array.isArray(provide)?provide:[provide]),_step214;try{for(_iterator214.s();!(_step214=_iterator214.n()).done;){var provider=_step214.value;fields.push(provider);}}catch(err){_iterator214.e(err);}finally{_iterator214.f();}}if(eventHandlers)fields.push(domEventHandlers.from(function(value){return{plugin:value,handlers:eventHandlers};}));if(decorations)fields.push(PluginField.decorations.from(decorations));return new ViewPlugin(nextPluginID++,create,fields);}/** 3839 + Create a plugin for a class whose constructor takes a single 3840 + editor view as argument. 3841 + */},{key:"fromClass",value:function fromClass(cls,spec){return ViewPlugin.define(function(view){return new cls(view);},spec);}}]);return ViewPlugin;}();var domEventHandlers=PluginField.define();var PluginInstance=/*#__PURE__*/function(){function PluginInstance(spec){_classCallCheck(this,PluginInstance);this.spec=spec;// When starting an update, all plugins have this field set to the 3842 + // update object, indicating they need to be updated. When finished 3843 + // updating, it is set to `false`. Retrieving a plugin that needs to 3844 + // be updated with `view.plugin` forces an eager update. 3845 + this.mustUpdate=null;// This is null when the plugin is initially created, but 3846 + // initialized on the first update. 3847 + this.value=null;}_createClass(PluginInstance,[{key:"takeField",value:function takeField(type,target){var _iterator215=_createForOfIteratorHelper(this.spec.fields),_step215;try{for(_iterator215.s();!(_step215=_iterator215.n()).done;){var _step215$value=_step215.value,field=_step215$value.field,get=_step215$value.get;if(field==type)target.push(get(this.value));}}catch(err){_iterator215.e(err);}finally{_iterator215.f();}}},{key:"update",value:function update(view){if(!this.value){try{this.value=this.spec.create(view);}catch(e){logException(view.state,e,"CodeMirror plugin crashed");return PluginInstance.dummy;}}else if(this.mustUpdate){var update=this.mustUpdate;this.mustUpdate=null;if(!this.value.update)return this;try{this.value.update(update);}catch(e){logException(update.state,e,"CodeMirror plugin crashed");if(this.value.destroy)try{this.value.destroy();}catch(_){}return PluginInstance.dummy;}}return this;}},{key:"destroy",value:function destroy(view){var _a;if((_a=this.value)===null||_a===void 0?void 0:_a.destroy){try{this.value.destroy();}catch(e){logException(view.state,e,"CodeMirror plugin crashed");}}}}]);return PluginInstance;}();PluginInstance.dummy=new PluginInstance(ViewPlugin.define(function(){return{};}));var editorAttributes=state.Facet.define({combine:function combine(values){return values.reduce(function(a,b){return combineAttrs(b,a);},{});}});var contentAttributes=state.Facet.define({combine:function combine(values){return values.reduce(function(a,b){return combineAttrs(b,a);},{});}});// Provide decorations 3848 + var decorations=state.Facet.define();var styleModule=state.Facet.define();var ChangedRange=/*#__PURE__*/function(){function ChangedRange(fromA,toA,fromB,toB){_classCallCheck(this,ChangedRange);this.fromA=fromA;this.toA=toA;this.fromB=fromB;this.toB=toB;}_createClass(ChangedRange,[{key:"join",value:function join(other){return new ChangedRange(Math.min(this.fromA,other.fromA),Math.max(this.toA,other.toA),Math.min(this.fromB,other.fromB),Math.max(this.toB,other.toB));}},{key:"addToSet",value:function addToSet(set){var i=set.length,me=this;for(;i>0;i--){var range=set[i-1];if(range.fromA>me.toA)continue;if(range.toA<me.fromA)break;me=me.join(range);set.splice(i-1,1);}set.splice(i,0,me);return set;}}],[{key:"extendWithRanges",value:function extendWithRanges(diff,ranges){if(ranges.length==0)return diff;var result=[];for(var dI=0,rI=0,posA=0,posB=0;;dI++){var next=dI==diff.length?null:diff[dI],off=posA-posB;var end=next?next.fromB:1e9;while(rI<ranges.length&&ranges[rI]<end){var from=ranges[rI],to=ranges[rI+1];var fromB=Math.max(posB,from),toB=Math.min(end,to);if(fromB<=toB)new ChangedRange(fromB+off,toB+off,fromB,toB).addToSet(result);if(to>end)break;else rI+=2;}if(!next)return result;new ChangedRange(next.fromA,next.toA,next.fromB,next.toB).addToSet(result);posA=next.toA;posB=next.toB;}}}]);return ChangedRange;}();/** 3849 + View [plugins](https://codemirror.net/6/docs/ref/#view.ViewPlugin) are given instances of this 3850 + class, which describe what happened, whenever the view is updated. 3851 + */var ViewUpdate=/*#__PURE__*/function(){/** 3852 + @internal 3853 + */function ViewUpdate(/** 3854 + The editor view that the update is associated with. 3855 + */view,/** 3856 + The new editor state. 3857 + */state$1){var transactions=arguments.length>2&&arguments[2]!==undefined?arguments[2]:none;_classCallCheck(this,ViewUpdate);this.view=view;this.state=state$1;this.transactions=transactions;/** 3858 + @internal 3859 + */this.flags=0;this.startState=view.state;this.changes=state.ChangeSet.empty(this.startState.doc.length);var _iterator216=_createForOfIteratorHelper(transactions),_step216;try{for(_iterator216.s();!(_step216=_iterator216.n()).done;){var tr=_step216.value;this.changes=this.changes.compose(tr.changes);}}catch(err){_iterator216.e(err);}finally{_iterator216.f();}var changedRanges=[];this.changes.iterChangedRanges(function(fromA,toA,fromB,toB){return changedRanges.push(new ChangedRange(fromA,toA,fromB,toB));});this.changedRanges=changedRanges;var focus=view.hasFocus;if(focus!=view.inputState.notifiedFocused){view.inputState.notifiedFocused=focus;this.flags|=1/* Focus */;}if(this.docChanged)this.flags|=2/* Height */;}/** 3860 + Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or 3861 + [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this 3862 + update. 3863 + */_createClass(ViewUpdate,[{key:"viewportChanged",get:function get(){return(this.flags&4/* Viewport */)>0;}/** 3864 + Indicates whether the line height in the editor changed in this update. 3865 + */},{key:"heightChanged",get:function get(){return(this.flags&2/* Height */)>0;}/** 3866 + Returns true when the document changed or the size of the editor 3867 + or the lines or characters within it has changed. 3868 + */},{key:"geometryChanged",get:function get(){return this.docChanged||(this.flags&(8/* Geometry */|2/* Height */))>0;}/** 3869 + True when this update indicates a focus change. 3870 + */},{key:"focusChanged",get:function get(){return(this.flags&1/* Focus */)>0;}/** 3871 + Whether the document changed in this update. 3872 + */},{key:"docChanged",get:function get(){return this.transactions.some(function(tr){return tr.docChanged;});}/** 3873 + Whether the selection was explicitly set in this update. 3874 + */},{key:"selectionSet",get:function get(){return this.transactions.some(function(tr){return tr.selection;});}/** 3875 + @internal 3876 + */},{key:"empty",get:function get(){return this.flags==0&&this.transactions.length==0;}}]);return ViewUpdate;}();var DocView=/*#__PURE__*/function(_ContentView11){_inherits(DocView,_ContentView11);var _super57=_createSuper(DocView);function DocView(view){var _this101;_classCallCheck(this,DocView);_this101=_super57.call(this);_this101.view=view;_this101.compositionDeco=Decoration.none;_this101.decorations=[];// Track a minimum width for the editor. When measuring sizes in 3877 + // checkLayout, this is updated to point at the width of a given 3878 + // element and its extent in the document. When a change happens in 3879 + // that range, these are reset. That way, once we've seen a 3880 + // line/element of a given length, we keep the editor wide enough to 3881 + // fit at least that element, until it is changed, at which point we 3882 + // forget it again. 3883 + _this101.minWidth=0;_this101.minWidthFrom=0;_this101.minWidthTo=0;// Track whether the DOM selection was set in a lossy way, so that 3884 + // we don't mess it up when reading it back it 3885 + _this101.impreciseAnchor=null;_this101.impreciseHead=null;_this101.setDOM(view.contentDOM);_this101.children=[new LineView()];_this101.children[0].setParent(_assertThisInitialized(_this101));_this101.updateInner([new ChangedRange(0,0,0,view.state.doc.length)],_this101.updateDeco(),0);return _this101;}_createClass(DocView,[{key:"root",get:function get(){return this.view.root;}},{key:"editorView",get:function get(){return this.view;}},{key:"length",get:function get(){return this.view.state.doc.length;}// Update the document view to a given state. scrollIntoView can be 3886 + // used as a hint to compute a new viewport that includes that 3887 + // position, if we know the editor is going to scroll that position 3888 + // into view. 3889 + },{key:"update",value:function update(_update27){var _this102=this;var changedRanges=_update27.changedRanges;if(this.minWidth>0&&changedRanges.length){if(!changedRanges.every(function(_ref74){var fromA=_ref74.fromA,toA=_ref74.toA;return toA<_this102.minWidthFrom||fromA>_this102.minWidthTo;})){this.minWidth=0;}else{this.minWidthFrom=_update27.changes.mapPos(this.minWidthFrom,1);this.minWidthTo=_update27.changes.mapPos(this.minWidthTo,1);}}if(this.view.inputState.composing<0)this.compositionDeco=Decoration.none;else if(_update27.transactions.length)this.compositionDeco=computeCompositionDeco(this.view,_update27.changes);// When the DOM nodes around the selection are moved to another 3890 + // parent, Chrome sometimes reports a different selection through 3891 + // getSelection than the one that it actually shows to the user. 3892 + // This forces a selection update when lines are joined to work 3893 + // around that. Issue #54 3894 + var forceSelection=(browser.ie||browser.chrome)&&!this.compositionDeco.size&&_update27&&_update27.state.doc.lines!=_update27.startState.doc.lines;var prevDeco=this.decorations,deco=this.updateDeco();var decoDiff=findChangedDeco(prevDeco,deco,_update27.changes);changedRanges=ChangedRange.extendWithRanges(changedRanges,decoDiff);var pointerSel=_update27.transactions.some(function(tr){return tr.isUserEvent("select.pointer");});if(this.dirty==0/* Not */&&changedRanges.length==0&&!(_update27.flags&4/* Viewport */)&&_update27.state.selection.main.from>=this.view.viewport.from&&_update27.state.selection.main.to<=this.view.viewport.to){this.updateSelection(forceSelection,pointerSel);return false;}else{this.updateInner(changedRanges,deco,_update27.startState.doc.length,forceSelection,pointerSel);return true;}}},{key:"reset",value:function reset(sel){var _this103=this;if(this.dirty){this.view.observer.ignore(function(){return _this103.view.docView.sync();});this.dirty=0/* Not */;}if(sel)this.updateSelection();}// Used both by update and checkLayout do perform the actual DOM 3895 + // update 3896 + },{key:"updateInner",value:function updateInner(changes,deco,oldLength){var _this104=this;var forceSelection=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;var pointerSel=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;this.updateChildren(changes,deco,oldLength);var observer=this.view.observer;observer.ignore(function(){// Lock the height during redrawing, since Chrome sometimes 3897 + // messes with the scroll position during DOM mutation (though 3898 + // no relayout is triggered and I cannot imagine how it can 3899 + // recompute the scroll position without a layout) 3900 + _this104.dom.style.height=_this104.view.viewState.domHeight+"px";_this104.dom.style.minWidth=_this104.minWidth?_this104.minWidth+"px":"";// Chrome will sometimes, when DOM mutations occur directly 3901 + // around the selection, get confused and report a different 3902 + // selection from the one it displays (issue #218). This tries 3903 + // to detect that situation. 3904 + var track=browser.chrome||browser.ios?{node:observer.selectionRange.focusNode,written:false}:undefined;_this104.sync(track);_this104.dirty=0/* Not */;if(track&&(track.written||observer.selectionRange.focusNode!=track.node))forceSelection=true;_this104.updateSelection(forceSelection,pointerSel);_this104.dom.style.height="";});var gaps=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length){var _iterator217=_createForOfIteratorHelper(this.children),_step217;try{for(_iterator217.s();!(_step217=_iterator217.n()).done;){var child=_step217.value;if(child instanceof BlockWidgetView&&child.widget instanceof BlockGapWidget)gaps.push(child.dom);}}catch(err){_iterator217.e(err);}finally{_iterator217.f();}}observer.updateGaps(gaps);}},{key:"updateChildren",value:function updateChildren(changes,deco,oldLength){var cursor=this.childCursor(oldLength);for(var _i151=changes.length-1;;_i151--){var next=_i151>=0?changes[_i151]:null;if(!next)break;var fromA=next.fromA,toA=next.toA,fromB=next.fromB,toB=next.toB;var _ContentBuilder$build2=ContentBuilder.build(this.view.state.doc,fromB,toB,deco),content=_ContentBuilder$build2.content,breakAtStart=_ContentBuilder$build2.breakAtStart,openStart=_ContentBuilder$build2.openStart,openEnd=_ContentBuilder$build2.openEnd;var _cursor$findPos3=cursor.findPos(toA,1),toI=_cursor$findPos3.i,toOff=_cursor$findPos3.off;var _cursor$findPos4=cursor.findPos(fromA,-1),fromI=_cursor$findPos4.i,fromOff=_cursor$findPos4.off;this.replaceRange(fromI,fromOff,toI,toOff,content,breakAtStart,openStart,openEnd);}}},{key:"replaceRange",value:function replaceRange(fromI,fromOff,toI,toOff,content,breakAtStart,openStart,openEnd){var before=this.children[fromI],last=content.length?content[content.length-1]:null;var breakAtEnd=last?last.breakAfter:breakAtStart;// Change within a single line 3905 + if(fromI==toI&&!breakAtStart&&!breakAtEnd&&content.length<2&&before.merge(fromOff,toOff,content.length?last:null,fromOff==0,openStart,openEnd))return;var after=this.children[toI];// Make sure the end of the line after the update is preserved in `after` 3906 + if(toOff<after.length){// If we're splitting a line, separate part of the start line to 3907 + // avoid that being mangled when updating the start line. 3908 + if(fromI==toI){after=after.split(toOff);toOff=0;}// If the element after the replacement should be merged with 3909 + // the last replacing element, update `content` 3910 + if(!breakAtEnd&&last&&after.merge(0,toOff,last,true,0,openEnd)){content[content.length-1]=after;}else{// Remove the start of the after element, if necessary, and 3911 + // add it to `content`. 3912 + if(toOff)after.merge(0,toOff,null,false,0,openEnd);content.push(after);}}else if(after.breakAfter){// The element at `toI` is entirely covered by this range. 3913 + // Preserve its line break, if any. 3914 + if(last)last.breakAfter=1;else breakAtStart=1;}// Since we've handled the next element from the current elements 3915 + // now, make sure `toI` points after that. 3916 + toI++;before.breakAfter=breakAtStart;if(fromOff>0){if(!breakAtStart&&content.length&&before.merge(fromOff,before.length,content[0],false,openStart,0)){before.breakAfter=content.shift().breakAfter;}else if(fromOff<before.length||before.children.length&&before.children[before.children.length-1].length==0){before.merge(fromOff,before.length,null,false,openStart,0);}fromI++;}// Try to merge widgets on the boundaries of the replacement 3917 + while(fromI<toI&&content.length){if(this.children[toI-1].match(content[content.length-1]))toI--,content.pop();else if(this.children[fromI].match(content[0]))fromI++,content.shift();else break;}if(fromI<toI||content.length)this.replaceChildren(fromI,toI,content);}// Sync the DOM selection to this.state.selection 3918 + },{key:"updateSelection",value:function updateSelection(){var _this105=this;var force=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var fromPointer=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!(fromPointer||this.mayControlSelection())||browser.ios&&this.view.inputState.rapidCompositionStart)return;var main=this.view.state.selection.main;// FIXME need to handle the case where the selection falls inside a block range 3919 + var anchor=this.domAtPos(main.anchor);var head=main.empty?anchor:this.domAtPos(main.head);// Always reset on Firefox when next to an uneditable node to 3920 + // avoid invisible cursor bugs (#111) 3921 + if(browser.gecko&&main.empty&&betweenUneditable(anchor)){var dummy=document.createTextNode("");this.view.observer.ignore(function(){return anchor.node.insertBefore(dummy,anchor.node.childNodes[anchor.offset]||null);});anchor=head=new DOMPos(dummy,0);force=true;}var domSel=this.view.observer.selectionRange;// If the selection is already here, or in an equivalent position, don't touch it 3922 + if(force||!domSel.focusNode||!isEquivalentPosition(anchor.node,anchor.offset,domSel.anchorNode,domSel.anchorOffset)||!isEquivalentPosition(head.node,head.offset,domSel.focusNode,domSel.focusOffset)){this.view.observer.ignore(function(){// Chrome Android will hide the virtual keyboard when tapping 3923 + // inside an uneditable node, and not bring it back when we 3924 + // move the cursor to its proper position. This tries to 3925 + // restore the keyboard by cycling focus. 3926 + if(browser.android&&browser.chrome&&_this105.dom.contains(domSel.focusNode)&&inUneditable(domSel.focusNode,_this105.dom)){_this105.dom.blur();_this105.dom.focus({preventScroll:true});}var rawSel=getSelection(_this105.root);if(main.empty){// Work around https://bugzilla.mozilla.org/show_bug.cgi?id=1612076 3927 + if(browser.gecko){var nextTo=nextToUneditable(anchor.node,anchor.offset);if(nextTo&&nextTo!=(1/* Before */|2/* After */)){var _text3=nearbyTextNode(anchor.node,anchor.offset,nextTo==1/* Before */?1:-1);if(_text3)anchor=new DOMPos(_text3,nextTo==1/* Before */?0:_text3.nodeValue.length);}}rawSel.collapse(anchor.node,anchor.offset);if(main.bidiLevel!=null&&domSel.cursorBidiLevel!=null)domSel.cursorBidiLevel=main.bidiLevel;}else if(rawSel.extend){// Selection.extend can be used to create an 'inverted' selection 3928 + // (one where the focus is before the anchor), but not all 3929 + // browsers support it yet. 3930 + rawSel.collapse(anchor.node,anchor.offset);rawSel.extend(head.node,head.offset);}else{// Primitive (IE) way 3931 + var range=document.createRange();if(main.anchor>main.head){var _ref75=[head,anchor];anchor=_ref75[0];head=_ref75[1];}range.setEnd(head.node,head.offset);range.setStart(anchor.node,anchor.offset);rawSel.removeAllRanges();rawSel.addRange(range);}});this.view.observer.setSelectionRange(anchor,head);}this.impreciseAnchor=anchor.precise?null:new DOMPos(domSel.anchorNode,domSel.anchorOffset);this.impreciseHead=head.precise?null:new DOMPos(domSel.focusNode,domSel.focusOffset);}},{key:"enforceCursorAssoc",value:function enforceCursorAssoc(){if(this.view.composing)return;var cursor=this.view.state.selection.main;var sel=getSelection(this.root);if(!cursor.empty||!cursor.assoc||!sel.modify)return;var line=LineView.find(this,cursor.head);if(!line)return;var lineStart=line.posAtStart;if(cursor.head==lineStart||cursor.head==lineStart+line.length)return;var before=this.coordsAt(cursor.head,-1),after=this.coordsAt(cursor.head,1);if(!before||!after||before.bottom>after.top)return;var dom=this.domAtPos(cursor.head+cursor.assoc);sel.collapse(dom.node,dom.offset);sel.modify("move",cursor.assoc<0?"forward":"backward","lineboundary");}},{key:"mayControlSelection",value:function mayControlSelection(){return this.view.state.facet(editable)?this.root.activeElement==this.dom:hasSelection(this.dom,this.view.observer.selectionRange);}},{key:"nearest",value:function nearest(dom){for(var cur=dom;cur;){var domView=ContentView.get(cur);if(domView&&domView.rootView==this)return domView;cur=cur.parentNode;}return null;}},{key:"posFromDOM",value:function posFromDOM(node,offset){var view=this.nearest(node);if(!view)throw new RangeError("Trying to find position for a DOM position outside of the document");return view.localPosFromDOM(node,offset)+view.posAtStart;}},{key:"domAtPos",value:function domAtPos(pos){var _this$childCursor$fin2=this.childCursor().findPos(pos,-1),i=_this$childCursor$fin2.i,off=_this$childCursor$fin2.off;for(;i<this.children.length-1;){var child=this.children[i];if(off<child.length||child instanceof LineView)break;i++;off=0;}return this.children[i].domAtPos(off);}},{key:"coordsAt",value:function coordsAt(pos,side){for(var off=this.length,_i152=this.children.length-1;;_i152--){var child=this.children[_i152],start=off-child.breakAfter-child.length;if(pos>start||pos==start&&child.type!=exports.BlockType.WidgetBefore&&child.type!=exports.BlockType.WidgetAfter&&(!_i152||side==2||this.children[_i152-1].breakAfter||this.children[_i152-1].type==exports.BlockType.WidgetBefore&&side>-2))return child.coordsAt(pos-start,side);off=start;}}},{key:"measureVisibleLineHeights",value:function measureVisibleLineHeights(){var result=[],_this$view$viewState$2=this.view.viewState.viewport,from=_this$view$viewState$2.from,to=_this$view$viewState$2.to;var minWidth=Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1;for(var pos=0,_i153=0;_i153<this.children.length;_i153++){var child=this.children[_i153],end=pos+child.length;if(end>to)break;if(pos>=from){result.push(child.dom.getBoundingClientRect().height);var width=child.dom.scrollWidth;if(width>minWidth){this.minWidth=minWidth=width;this.minWidthFrom=pos;this.minWidthTo=end;}}pos=end+child.breakAfter;}return result;}},{key:"measureTextSize",value:function measureTextSize(){var _this106=this;var _iterator218=_createForOfIteratorHelper(this.children),_step218;try{for(_iterator218.s();!(_step218=_iterator218.n()).done;){var child=_step218.value;if(child instanceof LineView){var measure=child.measureTextSize();if(measure)return measure;}}// If no workable line exists, force a layout of a measurable element 3932 + }catch(err){_iterator218.e(err);}finally{_iterator218.f();}var dummy=document.createElement("div"),lineHeight,charWidth;dummy.className="cm-line";dummy.textContent="abc def ghi jkl mno pqr stu";this.view.observer.ignore(function(){_this106.dom.appendChild(dummy);var rect=clientRectsFor(dummy.firstChild)[0];lineHeight=dummy.getBoundingClientRect().height;charWidth=rect?rect.width/27:7;dummy.remove();});return{lineHeight:lineHeight,charWidth:charWidth};}},{key:"childCursor",value:function childCursor(){var pos=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.length;// Move back to start of last element when possible, so that 3933 + // `ChildCursor.findPos` doesn't have to deal with the edge case 3934 + // of being after the last element. 3935 + var i=this.children.length;if(i)pos-=this.children[--i].length;return new ChildCursor(this.children,pos,i);}},{key:"computeBlockGapDeco",value:function computeBlockGapDeco(){var deco=[],vs=this.view.viewState;for(var pos=0,_i154=0;;_i154++){var next=_i154==vs.viewports.length?null:vs.viewports[_i154];var end=next?next.from-1:this.length;if(end>pos){var height=vs.lineAt(end,0).bottom-vs.lineAt(pos,0).top;deco.push(Decoration.replace({widget:new BlockGapWidget(height),block:true,inclusive:true}).range(pos,end));}if(!next)break;pos=next.to+1;}return Decoration.set(deco);}},{key:"updateDeco",value:function updateDeco(){return this.decorations=[].concat(_toConsumableArray(this.view.pluginField(PluginField.decorations)),_toConsumableArray(this.view.state.facet(decorations)),[this.compositionDeco,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]);}},{key:"scrollIntoView",value:function scrollIntoView(_ref76){var range=_ref76.range,center=_ref76.center;var rect=this.coordsAt(range.head,range.empty?range.assoc:range.head>range.anchor?-1:1),other;if(!rect)return;if(!range.empty&&(other=this.coordsAt(range.anchor,range.anchor>range.head?-1:1)))rect={left:Math.min(rect.left,other.left),top:Math.min(rect.top,other.top),right:Math.max(rect.right,other.right),bottom:Math.max(rect.bottom,other.bottom)};var mLeft=0,mRight=0,mTop=0,mBottom=0;var _iterator219=_createForOfIteratorHelper(this.view.pluginField(PluginField.scrollMargins)),_step219;try{for(_iterator219.s();!(_step219=_iterator219.n()).done;){var margins=_step219.value;if(margins){var left=margins.left,right=margins.right,top=margins.top,bottom=margins.bottom;if(left!=null)mLeft=Math.max(mLeft,left);if(right!=null)mRight=Math.max(mRight,right);if(top!=null)mTop=Math.max(mTop,top);if(bottom!=null)mBottom=Math.max(mBottom,bottom);}}}catch(err){_iterator219.e(err);}finally{_iterator219.f();}scrollRectIntoView(this.view.scrollDOM,{left:rect.left-mLeft,top:rect.top-mTop,right:rect.right+mRight,bottom:rect.bottom+mBottom},range.head<range.anchor?-1:1,center);}}]);return DocView;}(ContentView);function betweenUneditable(pos){return pos.node.nodeType==1&&pos.node.firstChild&&(pos.offset==0||pos.node.childNodes[pos.offset-1].contentEditable=="false")&&(pos.offset==pos.node.childNodes.length||pos.node.childNodes[pos.offset].contentEditable=="false");}var BlockGapWidget=/*#__PURE__*/function(_WidgetType9){_inherits(BlockGapWidget,_WidgetType9);var _super58=_createSuper(BlockGapWidget);function BlockGapWidget(height){var _this107;_classCallCheck(this,BlockGapWidget);_this107=_super58.call(this);_this107.height=height;return _this107;}_createClass(BlockGapWidget,[{key:"toDOM",value:function toDOM(){var elt=document.createElement("div");this.updateDOM(elt);return elt;}},{key:"eq",value:function eq(other){return other.height==this.height;}},{key:"updateDOM",value:function updateDOM(elt){elt.style.height=this.height+"px";return true;}},{key:"estimatedHeight",get:function get(){return this.height;}}]);return BlockGapWidget;}(WidgetType);function computeCompositionDeco(view,changes){var sel=view.observer.selectionRange;var textNode=sel.focusNode&&nearbyTextNode(sel.focusNode,sel.focusOffset,0);if(!textNode)return Decoration.none;var cView=view.docView.nearest(textNode);var from,to,topNode=textNode;if(cView instanceof InlineView){while(cView.parent instanceof InlineView){cView=cView.parent;}from=cView.posAtStart;to=from+cView.length;topNode=cView.dom;}else if(cView instanceof LineView){while(topNode.parentNode!=cView.dom){topNode=topNode.parentNode;}var prev=topNode.previousSibling;while(prev&&!ContentView.get(prev)){prev=prev.previousSibling;}from=to=prev?ContentView.get(prev).posAtEnd:cView.posAtStart;}else{return Decoration.none;}var newFrom=changes.mapPos(from,1),newTo=Math.max(newFrom,changes.mapPos(to,-1));var text=textNode.nodeValue,state=view.state;if(newTo-newFrom<text.length){if(state.sliceDoc(newFrom,Math.min(state.doc.length,newFrom+text.length))==text)newTo=newFrom+text.length;else if(state.sliceDoc(Math.max(0,newTo-text.length),newTo)==text)newFrom=newTo-text.length;else return Decoration.none;}else if(state.sliceDoc(newFrom,newTo)!=text){return Decoration.none;}return Decoration.set(Decoration.replace({widget:new CompositionWidget(topNode,textNode)}).range(newFrom,newTo));}var CompositionWidget=/*#__PURE__*/function(_WidgetType10){_inherits(CompositionWidget,_WidgetType10);var _super59=_createSuper(CompositionWidget);function CompositionWidget(top,text){var _this108;_classCallCheck(this,CompositionWidget);_this108=_super59.call(this);_this108.top=top;_this108.text=text;return _this108;}_createClass(CompositionWidget,[{key:"eq",value:function eq(other){return this.top==other.top&&this.text==other.text;}},{key:"toDOM",value:function toDOM(){return this.top;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}},{key:"customView",get:function get(){return CompositionView;}}]);return CompositionWidget;}(WidgetType);function nearbyTextNode(node,offset,side){for(;;){if(node.nodeType==3)return node;if(node.nodeType==1&&offset>0&&side<=0){node=node.childNodes[offset-1];offset=maxOffset(node);}else if(node.nodeType==1&&offset<node.childNodes.length&&side>=0){node=node.childNodes[offset];offset=0;}else{return null;}}}function nextToUneditable(node,offset){if(node.nodeType!=1)return 0;return(offset&&node.childNodes[offset-1].contentEditable=="false"?1/* Before */:0)|(offset<node.childNodes.length&&node.childNodes[offset].contentEditable=="false"?2/* After */:0);}var DecorationComparator$1=/*#__PURE__*/function(){function DecorationComparator$1(){_classCallCheck(this,DecorationComparator$1);this.changes=[];}_createClass(DecorationComparator$1,[{key:"compareRange",value:function compareRange(from,to){addRange(from,to,this.changes);}},{key:"comparePoint",value:function comparePoint(from,to){addRange(from,to,this.changes);}}]);return DecorationComparator$1;}();function findChangedDeco(a,b,diff){var comp=new DecorationComparator$1();rangeset.RangeSet.compare(a,b,diff,comp);return comp.changes;}function inUneditable(node,inside){for(var cur=node;cur&&cur!=inside;cur=cur.assignedSlot||cur.parentNode){if(cur.nodeType==1&&cur.contentEditable=='false'){return true;}}return false;}/** 3936 + Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). 3937 + */exports.Direction=void 0;(function(Direction){// (These are chosen to match the base levels, in bidi algorithm 3938 + // terms, of spans in that direction.) 3939 + /** 3940 + Left-to-right. 3941 + */Direction[Direction["LTR"]=0]="LTR";/** 3942 + Right-to-left. 3943 + */Direction[Direction["RTL"]=1]="RTL";})(exports.Direction||(exports.Direction={}));var LTR=exports.Direction.LTR,RTL=exports.Direction.RTL;// Decode a string with each type encoded as log2(type) 3944 + function dec(str){var result=[];for(var _i155=0;_i155<str.length;_i155++){result.push(1<<+str[_i155]);}return result;}// Character types for codepoints 0 to 0xf8 3945 + var LowTypes=dec("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008");// Character types for codepoints 0x600 to 0x6f9 3946 + var ArabicTypes=dec("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333");var Brackets=Object.create(null),BracketStack=[];// There's a lot more in 3947 + // https://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt, 3948 + // which are left out to keep code size down. 3949 + for(var _i156=0,_arr4=["()","[]","{}"];_i156<_arr4.length;_i156++){var p=_arr4[_i156];var l=p.charCodeAt(0),r=p.charCodeAt(1);Brackets[l]=r;Brackets[r]=-l;}function charType(ch){return ch<=0xf7?LowTypes[ch]:0x590<=ch&&ch<=0x5f4?2/* R */:0x600<=ch&&ch<=0x6f9?ArabicTypes[ch-0x600]:0x6ee<=ch&&ch<=0x8ac?4/* AL */:0x2000<=ch&&ch<=0x200b?256/* NI */:ch==0x200c?256/* NI */:1/* L */;}var BidiRE=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;/** 3950 + Represents a contiguous range of text that has a single direction 3951 + (as in left-to-right or right-to-left). 3952 + */var BidiSpan=/*#__PURE__*/function(){/** 3953 + @internal 3954 + */function BidiSpan(/** 3955 + The start of the span (relative to the start of the line). 3956 + */from,/** 3957 + The end of the span. 3958 + */to,/** 3959 + The ["bidi 3960 + level"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm) 3961 + of the span (in this context, 0 means 3962 + left-to-right, 1 means right-to-left, 2 means left-to-right 3963 + number inside right-to-left text). 3964 + */level){_classCallCheck(this,BidiSpan);this.from=from;this.to=to;this.level=level;}/** 3965 + The direction of this span. 3966 + */_createClass(BidiSpan,[{key:"dir",get:function get(){return this.level%2?RTL:LTR;}/** 3967 + @internal 3968 + */},{key:"side",value:function side(end,dir){return this.dir==dir==end?this.to:this.from;}/** 3969 + @internal 3970 + */}],[{key:"find",value:function find(order,index,level,assoc){var maybe=-1;for(var _i157=0;_i157<order.length;_i157++){var span=order[_i157];if(span.from<=index&&span.to>=index){if(span.level==level)return _i157;// When multiple spans match, if assoc != 0, take the one that 3971 + // covers that side, otherwise take the one with the minimum 3972 + // level. 3973 + if(maybe<0||(assoc!=0?assoc<0?span.from<index:span.to>index:order[maybe].level>span.level))maybe=_i157;}}if(maybe<0)throw new RangeError("Index out of range");return maybe;}}]);return BidiSpan;}();// Reused array of character types 3974 + var types=[];function computeOrder(line,direction){var len=line.length,outerType=direction==LTR?1/* L */:2/* R */,oppositeType=direction==LTR?2/* R */:1/* L */;if(!line||outerType==1/* L */&&!BidiRE.test(line))return trivialOrder(len);// W1. Examine each non-spacing mark (NSM) in the level run, and 3975 + // change the type of the NSM to the type of the previous 3976 + // character. If the NSM is at the start of the level run, it will 3977 + // get the type of sor. 3978 + // W2. Search backwards from each instance of a European number 3979 + // until the first strong type (R, L, AL, or sor) is found. If an 3980 + // AL is found, change the type of the European number to Arabic 3981 + // number. 3982 + // W3. Change all ALs to R. 3983 + // (Left after this: L, R, EN, AN, ET, CS, NI) 3984 + for(var _i158=0,prev=outerType,prevStrong=outerType;_i158<len;_i158++){var type=charType(line.charCodeAt(_i158));if(type==512/* NSM */)type=prev;else if(type==8/* EN */&&prevStrong==4/* AL */)type=16/* AN */;types[_i158]=type==4/* AL */?2/* R */:type;if(type&7/* Strong */)prevStrong=type;prev=type;}// W5. A sequence of European terminators adjacent to European 3985 + // numbers changes to all European numbers. 3986 + // W6. Otherwise, separators and terminators change to Other 3987 + // Neutral. 3988 + // W7. Search backwards from each instance of a European number 3989 + // until the first strong type (R, L, or sor) is found. If an L is 3990 + // found, then change the type of the European number to L. 3991 + // (Left after this: L, R, EN+AN, NI) 3992 + for(var _i159=0,_prev2=outerType,_prevStrong2=outerType;_i159<len;_i159++){var _type5=types[_i159];if(_type5==128/* CS */){if(_i159<len-1&&_prev2==types[_i159+1]&&_prev2&24/* Num */)_type5=types[_i159]=_prev2;else types[_i159]=256/* NI */;}else if(_type5==64/* ET */){var end=_i159+1;while(end<len&&types[end]==64/* ET */){end++;}var replace=_i159&&_prev2==8/* EN */||end<len&&types[end]==8/* EN */?_prevStrong2==1/* L */?1/* L */:8/* EN */:256/* NI */;for(var j=_i159;j<end;j++){types[j]=replace;}_i159=end-1;}else if(_type5==8/* EN */&&_prevStrong2==1/* L */){types[_i159]=1/* L */;}_prev2=_type5;if(_type5&7/* Strong */)_prevStrong2=_type5;}// N0. Process bracket pairs in an isolating run sequence 3993 + // sequentially in the logical order of the text positions of the 3994 + // opening paired brackets using the logic given below. Within this 3995 + // scope, bidirectional types EN and AN are treated as R. 3996 + for(var _i160=0,sI=0,context=0,ch,br,_type6;_i160<len;_i160++){// Keeps [startIndex, type, strongSeen] triples for each open 3997 + // bracket on BracketStack. 3998 + if(br=Brackets[ch=line.charCodeAt(_i160)]){if(br<0){// Closing bracket 3999 + for(var sJ=sI-3;sJ>=0;sJ-=3){if(BracketStack[sJ+1]==-br){var flags=BracketStack[sJ+2];var _type7=flags&2/* EmbedInside */?outerType:!(flags&4/* OppositeInside */)?0:flags&1/* OppositeBefore */?oppositeType:outerType;if(_type7)types[_i160]=types[BracketStack[sJ]]=_type7;sI=sJ;break;}}}else if(BracketStack.length==189/* MaxDepth */){break;}else{BracketStack[sI++]=_i160;BracketStack[sI++]=ch;BracketStack[sI++]=context;}}else if((_type6=types[_i160])==2/* R */||_type6==1/* L */){var embed=_type6==outerType;context=embed?0:1/* OppositeBefore */;for(var _sJ2=sI-3;_sJ2>=0;_sJ2-=3){var cur=BracketStack[_sJ2+2];if(cur&2/* EmbedInside */)break;if(embed){BracketStack[_sJ2+2]|=2/* EmbedInside */;}else{if(cur&4/* OppositeInside */)break;BracketStack[_sJ2+2]|=4/* OppositeInside */;}}}}// N1. A sequence of neutrals takes the direction of the 4000 + // surrounding strong text if the text on both sides has the same 4001 + // direction. European and Arabic numbers act as if they were R in 4002 + // terms of their influence on neutrals. Start-of-level-run (sor) 4003 + // and end-of-level-run (eor) are used at level run boundaries. 4004 + // N2. Any remaining neutrals take the embedding direction. 4005 + // (Left after this: L, R, EN+AN) 4006 + for(var _i161=0;_i161<len;_i161++){if(types[_i161]==256/* NI */){var _end5=_i161+1;while(_end5<len&&types[_end5]==256/* NI */){_end5++;}var beforeL=(_i161?types[_i161-1]:outerType)==1/* L */;var afterL=(_end5<len?types[_end5]:outerType)==1/* L */;var _replace2=beforeL==afterL?beforeL?1/* L */:2/* R */:outerType;for(var _j3=_i161;_j3<_end5;_j3++){types[_j3]=_replace2;}_i161=_end5-1;}}// Here we depart from the documented algorithm, in order to avoid 4007 + // building up an actual levels array. Since there are only three 4008 + // levels (0, 1, 2) in an implementation that doesn't take 4009 + // explicit embedding into account, we can build up the order on 4010 + // the fly, without following the level-based algorithm. 4011 + var order=[];if(outerType==1/* L */){for(var _i162=0;_i162<len;){var start=_i162,rtl=types[_i162++]!=1/* L */;while(_i162<len&&rtl==(types[_i162]!=1/* L */)){_i162++;}if(rtl){for(var _j4=_i162;_j4>start;){var _end6=_j4,_l3=types[--_j4]!=2/* R */;while(_j4>start&&_l3==(types[_j4-1]!=2/* R */)){_j4--;}order.push(new BidiSpan(_j4,_end6,_l3?2:1));}}else{order.push(new BidiSpan(start,_i162,0));}}}else{for(var _i163=0;_i163<len;){var _start6=_i163,_rtl2=types[_i163++]==2/* R */;while(_i163<len&&_rtl2==(types[_i163]==2/* R */)){_i163++;}order.push(new BidiSpan(_start6,_i163,_rtl2?1:2));}}return order;}function trivialOrder(length){return[new BidiSpan(0,length,0)];}var movedOver="";function moveVisually(line,order,dir,start,forward){var _a;var startIndex=start.head-line.from,spanI=-1;if(startIndex==0){if(!forward||!line.length)return null;if(order[0].level!=dir){startIndex=order[0].side(false,dir);spanI=0;}}else if(startIndex==line.length){if(forward)return null;var last=order[order.length-1];if(last.level!=dir){startIndex=last.side(true,dir);spanI=order.length-1;}}if(spanI<0)spanI=BidiSpan.find(order,startIndex,(_a=start.bidiLevel)!==null&&_a!==void 0?_a:-1,start.assoc);var span=order[spanI];// End of span. (But not end of line--that was checked for above.) 4012 + if(startIndex==span.side(forward,dir)){span=order[spanI+=forward?1:-1];startIndex=span.side(!forward,dir);}var indexForward=forward==(span.dir==dir);var nextIndex=text.findClusterBreak(line.text,startIndex,indexForward);movedOver=line.text.slice(Math.min(startIndex,nextIndex),Math.max(startIndex,nextIndex));if(nextIndex!=span.side(forward,dir))return state.EditorSelection.cursor(nextIndex+line.from,indexForward?-1:1,span.level);var nextSpan=spanI==(forward?order.length-1:0)?null:order[spanI+(forward?1:-1)];if(!nextSpan&&span.level!=dir)return state.EditorSelection.cursor(forward?line.to:line.from,forward?-1:1,dir);if(nextSpan&&nextSpan.level<span.level)return state.EditorSelection.cursor(nextSpan.side(!forward,dir)+line.from,forward?1:-1,nextSpan.level);return state.EditorSelection.cursor(nextIndex+line.from,forward?-1:1,span.level);}function groupAt(state$1,pos){var bias=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;var categorize=state$1.charCategorizer(pos);var line=state$1.doc.lineAt(pos),linePos=pos-line.from;if(line.length==0)return state.EditorSelection.cursor(pos);if(linePos==0)bias=1;else if(linePos==line.length)bias=-1;var from=linePos,to=linePos;if(bias<0)from=text.findClusterBreak(line.text,linePos,false);else to=text.findClusterBreak(line.text,linePos);var cat=categorize(line.text.slice(from,to));while(from>0){var prev=text.findClusterBreak(line.text,from,false);if(categorize(line.text.slice(prev,from))!=cat)break;from=prev;}while(to<line.length){var next=text.findClusterBreak(line.text,to);if(categorize(line.text.slice(to,next))!=cat)break;to=next;}return state.EditorSelection.range(from+line.from,to+line.from);}// Search the DOM for the {node, offset} position closest to the given 4013 + // coordinates. Very inefficient and crude, but can usually be avoided 4014 + // by calling caret(Position|Range)FromPoint instead. 4015 + function getdx(x,rect){return rect.left>x?rect.left-x:Math.max(0,x-rect.right);}function getdy(y,rect){return rect.top>y?rect.top-y:Math.max(0,y-rect.bottom);}function yOverlap(a,b){return a.top<b.bottom-1&&a.bottom>b.top+1;}function upTop(rect,top){return top<rect.top?{top:top,left:rect.left,right:rect.right,bottom:rect.bottom}:rect;}function upBot(rect,bottom){return bottom>rect.bottom?{top:rect.top,left:rect.left,right:rect.right,bottom:bottom}:rect;}function domPosAtCoords(parent,x,y){var closest,closestRect,closestX,closestY;var above,below,aboveRect,belowRect;for(var child=parent.firstChild;child;child=child.nextSibling){var rects=clientRectsFor(child);for(var _i164=0;_i164<rects.length;_i164++){var rect=rects[_i164];if(closestRect&&yOverlap(closestRect,rect))rect=upTop(upBot(rect,closestRect.bottom),closestRect.top);var dx=getdx(x,rect),dy=getdy(y,rect);if(dx==0&&dy==0)return child.nodeType==3?domPosInText(child,x,y):domPosAtCoords(child,x,y);if(!closest||closestY>dy||closestY==dy&&closestX>dx){closest=child;closestRect=rect;closestX=dx;closestY=dy;}if(dx==0){if(y>rect.bottom&&(!aboveRect||aboveRect.bottom<rect.bottom)){above=child;aboveRect=rect;}else if(y<rect.top&&(!belowRect||belowRect.top>rect.top)){below=child;belowRect=rect;}}else if(aboveRect&&yOverlap(aboveRect,rect)){aboveRect=upBot(aboveRect,rect.bottom);}else if(belowRect&&yOverlap(belowRect,rect)){belowRect=upTop(belowRect,rect.top);}}}if(aboveRect&&aboveRect.bottom>=y){closest=above;closestRect=aboveRect;}else if(belowRect&&belowRect.top<=y){closest=below;closestRect=belowRect;}if(!closest)return{node:parent,offset:0};var clipX=Math.max(closestRect.left,Math.min(closestRect.right,x));if(closest.nodeType==3)return domPosInText(closest,clipX,y);if(!closestX&&closest.contentEditable=="true")return domPosAtCoords(closest,clipX,y);var offset=Array.prototype.indexOf.call(parent.childNodes,closest)+(x>=(closestRect.left+closestRect.right)/2?1:0);return{node:parent,offset:offset};}function domPosInText(node,x,y){var len=node.nodeValue.length;var closestOffset=-1,closestDY=1e9,generalSide=0;for(var _i165=0;_i165<len;_i165++){var rects=textRange(node,_i165,_i165+1).getClientRects();for(var j=0;j<rects.length;j++){var rect=rects[j];if(rect.top==rect.bottom)continue;if(!generalSide)generalSide=x-rect.left;var dy=(rect.top>y?rect.top-y:y-rect.bottom)-1;if(rect.left-1<=x&&rect.right+1>=x&&dy<closestDY){var right=x>=(rect.left+rect.right)/2,after=right;if(browser.chrome||browser.gecko){// Check for RTL on browsers that support getting client 4016 + // rects for empty ranges. 4017 + var rectBefore=textRange(node,_i165).getBoundingClientRect();if(rectBefore.left==rect.right)after=!right;}if(dy<=0)return{node:node,offset:_i165+(after?1:0)};closestOffset=_i165+(after?1:0);closestDY=dy;}}}return{node:node,offset:closestOffset>-1?closestOffset:generalSide>0?node.nodeValue.length:0};}function _posAtCoords2(view,_ref77,precise){var x=_ref77.x,y=_ref77.y;var bias=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;var _a;var content=view.contentDOM.getBoundingClientRect(),block;var halfLine=view.defaultLineHeight/2;for(var bounced=false;;){block=view.blockAtHeight(y,content.top);if(block.top>y||block.bottom<y){bias=block.top>y?-1:1;y=Math.min(block.bottom-halfLine,Math.max(block.top+halfLine,y));if(bounced)return precise?null:0;else bounced=true;}if(block.type==exports.BlockType.Text)break;y=bias>0?block.bottom+halfLine:block.top-halfLine;}var lineStart=block.from;// Clip x to the viewport sides 4018 + x=Math.max(content.left+1,Math.min(content.right-1,x));// If this is outside of the rendered viewport, we can't determine a position 4019 + if(lineStart<view.viewport.from)return view.viewport.from==0?0:posAtCoordsImprecise(view,content,block,x,y);if(lineStart>view.viewport.to)return view.viewport.to==view.state.doc.length?view.state.doc.length:posAtCoordsImprecise(view,content,block,x,y);// Prefer ShadowRootOrDocument.elementFromPoint if present, fall back to document if not 4020 + var doc=view.dom.ownerDocument;var element=(view.root.elementFromPoint?view.root:doc).elementFromPoint(x,y);// There's visible editor content under the point, so we can try 4021 + // using caret(Position|Range)FromPoint as a shortcut 4022 + var node,offset=-1;if(element&&view.contentDOM.contains(element)&&((_a=view.docView.nearest(element))===null||_a===void 0?void 0:_a.isEditable)!=false){if(doc.caretPositionFromPoint){var pos=doc.caretPositionFromPoint(x,y);if(pos){node=pos.offsetNode;offset=pos.offset;}}else if(doc.caretRangeFromPoint){var range=doc.caretRangeFromPoint(x,y);if(range){node=range.startContainer;offset=range.startOffset;if(browser.safari&&isSuspiciousCaretResult(node,offset,x))node=undefined;}}}// No luck, do our own (potentially expensive) search 4023 + if(!node||!view.docView.dom.contains(node)){var line=LineView.find(view.docView,lineStart);var _domPosAtCoords2=domPosAtCoords(line.dom,x,y);node=_domPosAtCoords2.node;offset=_domPosAtCoords2.offset;}return view.docView.posFromDOM(node,offset);}function posAtCoordsImprecise(view,contentRect,block,x,y){var into=Math.round((x-contentRect.left)*view.defaultCharacterWidth);if(view.lineWrapping&&block.height>view.defaultLineHeight*1.5){var line=Math.floor((y-block.top)/view.defaultLineHeight);into+=line*view.viewState.heightOracle.lineLength;}var content=view.state.sliceDoc(block.from,block.to);return block.from+text.findColumn(content,into,view.state.tabSize);}// In case of a high line height, Safari's caretRangeFromPoint treats 4024 + // the space between lines as belonging to the last character of the 4025 + // line before. This is used to detect such a result so that it can be 4026 + // ignored (issue #401). 4027 + function isSuspiciousCaretResult(node,offset,x){var len;if(node.nodeType!=3||offset!=(len=node.nodeValue.length))return false;for(var next=node.nextSibling;next;next=next.nextSibling){if(next.nodeType!=1||next.nodeName!="BR")return false;}return textRange(node,len-1,len).getBoundingClientRect().left>x;}function _moveToLineBoundary2(view,start,forward,includeWrap){var line=view.state.doc.lineAt(start.head);var coords=!includeWrap||!view.lineWrapping?null:view.coordsAtPos(start.assoc<0&&start.head>line.from?start.head-1:start.head);if(coords){var editorRect=view.dom.getBoundingClientRect();var pos=view.posAtCoords({x:forward==(view.textDirection==exports.Direction.LTR)?editorRect.right-1:editorRect.left+1,y:(coords.top+coords.bottom)/2});if(pos!=null)return state.EditorSelection.cursor(pos,forward?-1:1);}var lineView=LineView.find(view.docView,start.head);var end=lineView?forward?lineView.posAtEnd:lineView.posAtStart:forward?line.to:line.from;return state.EditorSelection.cursor(end,forward?-1:1);}function _moveByChar2(view,start,forward,by){var line=view.state.doc.lineAt(start.head),spans=view.bidiSpans(line);for(var cur=start,check=null;;){var next=moveVisually(line,spans,view.textDirection,cur,forward),_char4=movedOver;if(!next){if(line.number==(forward?view.state.doc.lines:1))return cur;_char4="\n";line=view.state.doc.line(line.number+(forward?1:-1));spans=view.bidiSpans(line);next=state.EditorSelection.cursor(forward?line.from:line.to);}if(!check){if(!by)return next;check=by(_char4);}else if(!check(_char4)){return cur;}cur=next;}}function byGroup(view,pos,start){var categorize=view.state.charCategorizer(pos);var cat=categorize(start);return function(next){var nextCat=categorize(next);if(cat==state.CharCategory.Space)cat=nextCat;return cat==nextCat;};}function _moveVertically2(view,start,forward,distance){var startPos=start.head,dir=forward?1:-1;if(startPos==(forward?view.state.doc.length:0))return state.EditorSelection.cursor(startPos);var goal=start.goalColumn,startY;var rect=view.contentDOM.getBoundingClientRect();var startCoords=view.coordsAtPos(startPos);if(startCoords){if(goal==null)goal=startCoords.left-rect.left;startY=dir<0?startCoords.top:startCoords.bottom;}else{var line=view.viewState.lineAt(startPos,view.dom.getBoundingClientRect().top);if(goal==null)goal=Math.min(rect.right-rect.left,view.defaultCharacterWidth*(startPos-line.from));startY=dir<0?line.top:line.bottom;}var resolvedGoal=rect.left+goal;var dist=distance!==null&&distance!==void 0?distance:view.defaultLineHeight>>1;for(var extra=0;;extra+=10){var curY=startY+(dist+extra)*dir;var pos=_posAtCoords2(view,{x:resolvedGoal,y:curY},false,dir);if(curY<rect.top||curY>rect.bottom||(dir<0?pos<startPos:pos>startPos))return state.EditorSelection.cursor(pos,undefined,undefined,goal);}}function skipAtoms(view,oldPos,pos){var atoms=view.pluginField(PluginField.atomicRanges);for(;;){var moved=false;var _iterator220=_createForOfIteratorHelper(atoms),_step220;try{for(_iterator220.s();!(_step220=_iterator220.n()).done;){var set=_step220.value;set.between(pos.from-1,pos.from+1,function(from,to,value){if(pos.from>from&&pos.from<to){pos=oldPos.from>pos.from?state.EditorSelection.cursor(from,1):state.EditorSelection.cursor(to,-1);moved=true;}});}}catch(err){_iterator220.e(err);}finally{_iterator220.f();}if(!moved)return pos;}}// This will also be where dragging info and such goes 4028 + var InputState=/*#__PURE__*/function(){function InputState(view){var _this109=this;_classCallCheck(this,InputState);this.lastKeyCode=0;this.lastKeyTime=0;// On Chrome Android, backspace near widgets is just completely 4029 + // broken, and there are no key events, so we need to handle the 4030 + // beforeinput event. Deleting stuff will often create a flurry of 4031 + // events, and interrupting it before it is done just makes 4032 + // subsequent events even more broken, so again, we hold off doing 4033 + // anything until the browser is finished with whatever it is trying 4034 + // to do. 4035 + this.pendingAndroidKey=undefined;// On iOS, some keys need to have their default behavior happen 4036 + // (after which we retroactively handle them and reset the DOM) to 4037 + // avoid messing up the virtual keyboard state. 4038 + this.pendingIOSKey=undefined;this.lastSelectionOrigin=null;this.lastSelectionTime=0;this.lastEscPress=0;this.lastContextMenu=0;this.scrollHandlers=[];this.registeredEvents=[];this.customHandlers=[];// -1 means not in a composition. Otherwise, this counts the number 4039 + // of changes made during the composition. The count is used to 4040 + // avoid treating the start state of the composition, before any 4041 + // changes have been made, as part of the composition. 4042 + this.composing=-1;// Tracks whether the next change should be marked as starting the 4043 + // composition (null means no composition, true means next is the 4044 + // first, false means first has already been marked for this 4045 + // composition) 4046 + this.compositionFirstChange=null;this.compositionEndedAt=0;this.rapidCompositionStart=false;this.mouseSelection=null;var _loop21=function _loop21(type){var handler=handlers[type];view.contentDOM.addEventListener(type,function(event){if(type=="keydown"&&_this109.keydown(view,event))return;if(!eventBelongsToEditor(view,event)||_this109.ignoreDuringComposition(event))return;if(_this109.mustFlushObserver(event))view.observer.forceFlush();if(_this109.runCustomHandlers(type,view,event))event.preventDefault();else handler(view,event);});_this109.registeredEvents.push(type);};for(var type in handlers){_loop21(type);}this.notifiedFocused=view.hasFocus;this.ensureHandlers(view);// On Safari adding an input event handler somehow prevents an 4047 + // issue where the composition vanishes when you press enter. 4048 + if(browser.safari)view.contentDOM.addEventListener("input",function(){return null;});}_createClass(InputState,[{key:"setSelectionOrigin",value:function setSelectionOrigin(origin){this.lastSelectionOrigin=origin;this.lastSelectionTime=Date.now();}},{key:"ensureHandlers",value:function ensureHandlers(view){var _this110=this;var handlers=this.customHandlers=view.pluginField(domEventHandlers);var _iterator221=_createForOfIteratorHelper(handlers),_step221;try{for(_iterator221.s();!(_step221=_iterator221.n()).done;){var set=_step221.value;var _loop22=function _loop22(type){if(_this110.registeredEvents.indexOf(type)<0&&type!="scroll"){_this110.registeredEvents.push(type);view.contentDOM.addEventListener(type,function(event){if(!eventBelongsToEditor(view,event))return;if(_this110.runCustomHandlers(type,view,event))event.preventDefault();});}};for(var type in set.handlers){_loop22(type);}}}catch(err){_iterator221.e(err);}finally{_iterator221.f();}}},{key:"runCustomHandlers",value:function runCustomHandlers(type,view,event){var _iterator222=_createForOfIteratorHelper(this.customHandlers),_step222;try{for(_iterator222.s();!(_step222=_iterator222.n()).done;){var set=_step222.value;var handler=set.handlers[type],handled=false;if(handler){try{handled=handler.call(set.plugin,event,view);}catch(e){logException(view.state,e);}if(handled||event.defaultPrevented){// Chrome for Android often applies a bunch of nonsensical 4049 + // DOM changes after an enter press, even when 4050 + // preventDefault-ed. This tries to ignore those. 4051 + if(browser.android&&type=="keydown"&&event.keyCode==13)view.observer.flushSoon();return true;}}}}catch(err){_iterator222.e(err);}finally{_iterator222.f();}return false;}},{key:"runScrollHandlers",value:function runScrollHandlers(view,event){var _iterator223=_createForOfIteratorHelper(this.customHandlers),_step223;try{for(_iterator223.s();!(_step223=_iterator223.n()).done;){var set=_step223.value;var handler=set.handlers.scroll;if(handler){try{handler.call(set.plugin,event,view);}catch(e){logException(view.state,e);}}}}catch(err){_iterator223.e(err);}finally{_iterator223.f();}}},{key:"keydown",value:function keydown(view,event){var _this111=this;// Must always run, even if a custom handler handled the event 4052 + this.lastKeyCode=event.keyCode;this.lastKeyTime=Date.now();if(this.screenKeyEvent(view,event))return true;// Prevent the default behavior of Enter on iOS makes the 4053 + // virtual keyboard get stuck in the wrong (lowercase) 4054 + // state. So we let it go through, and then, in 4055 + // applyDOMChange, notify key handlers of it and reset to 4056 + // the state they produce. 4057 + var pending;if(browser.ios&&(pending=PendingKeys.find(function(key){return key.keyCode==event.keyCode;}))&&!(event.ctrlKey||event.altKey||event.metaKey)&&!event.synthetic){this.pendingIOSKey=pending;setTimeout(function(){return _this111.flushIOSKey(view);},250);return true;}return false;}},{key:"flushIOSKey",value:function flushIOSKey(view){var key=this.pendingIOSKey;if(!key)return false;this.pendingIOSKey=undefined;return dispatchKey(view.contentDOM,key.key,key.keyCode);}// This causes the DOM observer to pause for a bit, and sets an 4058 + // animation frame (which seems the most reliable way to detect 4059 + // 'Chrome is done flailing about messing with the DOM') to fire a 4060 + // fake key event and re-sync the view again. 4061 + },{key:"setPendingAndroidKey",value:function setPendingAndroidKey(view,pending){var _this112=this;this.pendingAndroidKey=pending;requestAnimationFrame(function(){var key=_this112.pendingAndroidKey;if(!key)return;_this112.pendingAndroidKey=undefined;view.observer.processRecords();var startState=view.state;dispatchKey(view.contentDOM,key.key,key.keyCode);if(view.state==startState)view.docView.reset(true);});}},{key:"ignoreDuringComposition",value:function ignoreDuringComposition(event){if(!/^key/.test(event.type))return false;if(this.composing>0)return true;// See https://www.stum.de/2016/06/24/handling-ime-events-in-javascript/. 4062 + // On some input method editors (IMEs), the Enter key is used to 4063 + // confirm character selection. On Safari, when Enter is pressed, 4064 + // compositionend and keydown events are sometimes emitted in the 4065 + // wrong order. The key event should still be ignored, even when 4066 + // it happens after the compositionend event. 4067 + if(browser.safari&&Date.now()-this.compositionEndedAt<500){this.compositionEndedAt=0;return true;}return false;}},{key:"screenKeyEvent",value:function screenKeyEvent(view,event){var protectedTab=event.keyCode==9&&Date.now()<this.lastEscPress+2000;if(event.keyCode==27)this.lastEscPress=Date.now();else if(modifierCodes.indexOf(event.keyCode)<0)this.lastEscPress=0;return protectedTab;}},{key:"mustFlushObserver",value:function mustFlushObserver(event){return event.type=="keydown"&&event.keyCode!=229||event.type=="compositionend"&&!browser.ios;}},{key:"startMouseSelection",value:function startMouseSelection(view,event,style){if(this.mouseSelection)this.mouseSelection.destroy();this.mouseSelection=new MouseSelection(this,view,event,style);}},{key:"update",value:function update(_update28){if(this.mouseSelection)this.mouseSelection.update(_update28);if(_update28.transactions.length)this.lastKeyCode=this.lastSelectionTime=0;}},{key:"destroy",value:function destroy(){if(this.mouseSelection)this.mouseSelection.destroy();}}]);return InputState;}();var PendingKeys=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}];// Key codes for modifier keys 4068 + var modifierCodes=[16,17,18,20,91,92,224,225];var MouseSelection=/*#__PURE__*/function(){function MouseSelection(inputState,view,startEvent,style){_classCallCheck(this,MouseSelection);this.inputState=inputState;this.view=view;this.style=style;this.lastEvent=startEvent;var doc=view.contentDOM.ownerDocument;doc.addEventListener("mousemove",this.move=this.move.bind(this));doc.addEventListener("mouseup",this.up=this.up.bind(this));this.extend=startEvent.shiftKey;this.multiple=view.state.facet(state.EditorState.allowMultipleSelections)&&addsSelectionRange(view,startEvent);this.dragMove=dragMovesSelection(view,startEvent);this.dragging=isInPrimarySelection(view,startEvent)?null:false;// When clicking outside of the selection, immediately apply the 4069 + // effect of starting the selection 4070 + if(this.dragging===false){startEvent.preventDefault();this.select(startEvent);}}_createClass(MouseSelection,[{key:"move",value:function move(event){if(event.buttons==0)return this.destroy();if(this.dragging!==false)return;this.select(this.lastEvent=event);}},{key:"up",value:function up(event){if(this.dragging==null)this.select(this.lastEvent);if(!this.dragging)event.preventDefault();this.destroy();}},{key:"destroy",value:function destroy(){var doc=this.view.contentDOM.ownerDocument;doc.removeEventListener("mousemove",this.move);doc.removeEventListener("mouseup",this.up);this.inputState.mouseSelection=null;}},{key:"select",value:function select(event){var selection=this.style.get(event,this.extend,this.multiple);if(!selection.eq(this.view.state.selection)||selection.main.assoc!=this.view.state.selection.main.assoc)this.view.dispatch({selection:selection,userEvent:"select.pointer",scrollIntoView:true});}},{key:"update",value:function update(_update29){var _this113=this;if(_update29.docChanged&&this.dragging)this.dragging=this.dragging.map(_update29.changes);if(this.style.update(_update29))setTimeout(function(){return _this113.select(_this113.lastEvent);},20);}}]);return MouseSelection;}();function addsSelectionRange(view,event){var facet=view.state.facet(clickAddsSelectionRange);return facet.length?facet[0](event):browser.mac?event.metaKey:event.ctrlKey;}function dragMovesSelection(view,event){var facet=view.state.facet(dragMovesSelection$1);return facet.length?facet[0](event):browser.mac?!event.altKey:!event.ctrlKey;}function isInPrimarySelection(view,event){var main=view.state.selection.main;if(main.empty)return false;// On boundary clicks, check whether the coordinates are inside the 4071 + // selection's client rectangles 4072 + var sel=getSelection(view.root);if(sel.rangeCount==0)return true;var rects=sel.getRangeAt(0).getClientRects();for(var _i166=0;_i166<rects.length;_i166++){var rect=rects[_i166];if(rect.left<=event.clientX&&rect.right>=event.clientX&&rect.top<=event.clientY&&rect.bottom>=event.clientY)return true;}return false;}function eventBelongsToEditor(view,event){if(!event.bubbles)return true;if(event.defaultPrevented)return false;for(var node=event.target,cView;node!=view.contentDOM;node=node.parentNode){if(!node||node.nodeType==11||(cView=ContentView.get(node))&&cView.ignoreEvent(event))return false;}return true;}var handlers=Object.create(null);// This is very crude, but unfortunately both these browsers _pretend_ 4073 + // that they have a clipboard API—all the objects and methods are 4074 + // there, they just don't work, and they are hard to test. 4075 + var brokenClipboardAPI=browser.ie&&browser.ie_version<15||browser.ios&&browser.webkit_version<604;function capturePaste(view){var parent=view.dom.parentNode;if(!parent)return;var target=parent.appendChild(document.createElement("textarea"));target.style.cssText="position: fixed; left: -10000px; top: 10px";target.focus();setTimeout(function(){view.focus();target.remove();doPaste(view,target.value);},50);}function doPaste(view,input){var state$1=view.state,changes,i=1,text=state$1.toText(input);var byLine=text.lines==state$1.selection.ranges.length;var linewise=lastLinewiseCopy!=null&&state$1.selection.ranges.every(function(r){return r.empty;})&&lastLinewiseCopy==text.toString();if(linewise){var lastLine=-1;changes=state$1.changeByRange(function(range){var line=state$1.doc.lineAt(range.from);if(line.from==lastLine)return{range:range};lastLine=line.from;var insert=state$1.toText((byLine?text.line(i++).text:input)+state$1.lineBreak);return{changes:{from:line.from,insert:insert},range:state.EditorSelection.cursor(range.from+insert.length)};});}else if(byLine){changes=state$1.changeByRange(function(range){var line=text.line(i++);return{changes:{from:range.from,to:range.to,insert:line.text},range:state.EditorSelection.cursor(range.from+line.length)};});}else{changes=state$1.replaceSelection(text);}view.dispatch(changes,{userEvent:"input.paste",scrollIntoView:true});}handlers.keydown=function(view,event){view.inputState.setSelectionOrigin("select");};var lastTouch=0;handlers.touchstart=function(view,e){lastTouch=Date.now();view.inputState.setSelectionOrigin("select.pointer");};handlers.touchmove=function(view){view.inputState.setSelectionOrigin("select.pointer");};handlers.mousedown=function(view,event){view.observer.flush();if(lastTouch>Date.now()-2000)return;// Ignore touch interaction 4076 + var style=null;var _iterator224=_createForOfIteratorHelper(view.state.facet(mouseSelectionStyle)),_step224;try{for(_iterator224.s();!(_step224=_iterator224.n()).done;){var makeStyle=_step224.value;style=makeStyle(view,event);if(style)break;}}catch(err){_iterator224.e(err);}finally{_iterator224.f();}if(!style&&event.button==0)style=basicMouseSelection(view,event);if(style){if(view.root.activeElement!=view.contentDOM)view.observer.ignore(function(){return focusPreventScroll(view.contentDOM);});view.inputState.startMouseSelection(view,event,style);}};function rangeForClick(view,pos,bias,type){if(type==1){// Single click 4077 + return state.EditorSelection.cursor(pos,bias);}else if(type==2){// Double click 4078 + return groupAt(view.state,pos,bias);}else{// Triple click 4079 + var visual=LineView.find(view.docView,pos),line=view.state.doc.lineAt(visual?visual.posAtEnd:pos);var from=visual?visual.posAtStart:line.from,to=visual?visual.posAtEnd:line.to;if(to<view.state.doc.length&&to==line.to)to++;return state.EditorSelection.range(from,to);}}var insideY=function insideY(y,rect){return y>=rect.top&&y<=rect.bottom;};var inside=function inside(x,y,rect){return insideY(y,rect)&&x>=rect.left&&x<=rect.right;};// Try to determine, for the given coordinates, associated with the 4080 + // given position, whether they are related to the element before or 4081 + // the element after the position. 4082 + function findPositionSide(view,pos,x,y){var line=LineView.find(view.docView,pos);if(!line)return 1;var off=pos-line.posAtStart;// Line boundaries point into the line 4083 + if(off==0)return 1;if(off==line.length)return-1;// Positions on top of an element point at that element 4084 + var before=line.coordsAt(off,-1);if(before&&inside(x,y,before))return-1;var after=line.coordsAt(off,1);if(after&&inside(x,y,after))return 1;// This is probably a line wrap point. Pick before if the point is 4085 + // beside it. 4086 + return before&&insideY(y,before)?-1:1;}function queryPos(view,event){var pos=view.posAtCoords({x:event.clientX,y:event.clientY},false);return{pos:pos,bias:findPositionSide(view,pos,event.clientX,event.clientY)};}var BadMouseDetail=browser.ie&&browser.ie_version<=11;var lastMouseDown=null,lastMouseDownCount=0,lastMouseDownTime=0;function getClickType(event){if(!BadMouseDetail)return event.detail;var last=lastMouseDown,lastTime=lastMouseDownTime;lastMouseDown=event;lastMouseDownTime=Date.now();return lastMouseDownCount=!last||lastTime>Date.now()-400&&Math.abs(last.clientX-event.clientX)<2&&Math.abs(last.clientY-event.clientY)<2?(lastMouseDownCount+1)%3:1;}function basicMouseSelection(view,event){var start=queryPos(view,event),type=getClickType(event);var startSel=view.state.selection;var last=start,lastEvent=event;return{update:function update(_update30){if(_update30.changes){if(start)start.pos=_update30.changes.mapPos(start.pos);startSel=startSel.map(_update30.changes);lastEvent=null;}},get:function get(event,extend,multiple){var cur;if(lastEvent&&event.clientX==lastEvent.clientX&&event.clientY==lastEvent.clientY)cur=last;else{cur=last=queryPos(view,event);lastEvent=event;}if(!cur||!start)return startSel;var range=rangeForClick(view,cur.pos,cur.bias,type);if(start.pos!=cur.pos&&!extend){var startRange=rangeForClick(view,start.pos,start.bias,type);var from=Math.min(startRange.from,range.from),to=Math.max(startRange.to,range.to);range=from<range.from?state.EditorSelection.range(from,to):state.EditorSelection.range(to,from);}if(extend)return startSel.replaceRange(startSel.main.extend(range.from,range.to));else if(multiple)return startSel.addRange(range);else return state.EditorSelection.create([range]);}};}handlers.dragstart=function(view,event){var main=view.state.selection.main;var mouseSelection=view.inputState.mouseSelection;if(mouseSelection)mouseSelection.dragging=main;if(event.dataTransfer){event.dataTransfer.setData("Text",view.state.sliceDoc(main.from,main.to));event.dataTransfer.effectAllowed="copyMove";}};function dropText(view,event,text,direct){var dropPos=view.posAtCoords({x:event.clientX,y:event.clientY});if(dropPos==null||!text)return;event.preventDefault();var mouseSelection=view.inputState.mouseSelection;var del=direct&&mouseSelection&&mouseSelection.dragging&&mouseSelection.dragMove?{from:mouseSelection.dragging.from,to:mouseSelection.dragging.to}:null;var ins={from:dropPos,insert:text};var changes=view.state.changes(del?[del,ins]:ins);view.focus();view.dispatch({changes:changes,selection:{anchor:changes.mapPos(dropPos,-1),head:changes.mapPos(dropPos,1)},userEvent:del?"move.drop":"input.drop"});}handlers.drop=function(view,event){if(!event.dataTransfer)return;if(view.state.readOnly)return event.preventDefault();var files=event.dataTransfer.files;if(files&&files.length){(function(){// For a file drop, read the file's text. 4087 + event.preventDefault();var text=Array(files.length),read=0;var finishFile=function finishFile(){if(++read==files.length)dropText(view,event,text.filter(function(s){return s!=null;}).join(view.state.lineBreak),false);};var _loop23=function _loop23(_i167){var reader=new FileReader();reader.onerror=finishFile;reader.onload=function(){if(!/[\x00-\x08\x0e-\x1f]{2}/.test(reader.result))text[_i167]=reader.result;finishFile();};reader.readAsText(files[_i167]);};for(var _i167=0;_i167<files.length;_i167++){_loop23(_i167);}})();}else{dropText(view,event,event.dataTransfer.getData("Text"),true);}};handlers.paste=function(view,event){if(view.state.readOnly)return event.preventDefault();view.observer.flush();var data=brokenClipboardAPI?null:event.clipboardData;if(data){doPaste(view,data.getData("text/plain"));event.preventDefault();}else{capturePaste(view);}};function captureCopy(view,text){// The extra wrapper is somehow necessary on IE/Edge to prevent the 4088 + // content from being mangled when it is put onto the clipboard 4089 + var parent=view.dom.parentNode;if(!parent)return;var target=parent.appendChild(document.createElement("textarea"));target.style.cssText="position: fixed; left: -10000px; top: 10px";target.value=text;target.focus();target.selectionEnd=text.length;target.selectionStart=0;setTimeout(function(){target.remove();view.focus();},50);}function copiedRange(state){var content=[],ranges=[],linewise=false;var _iterator225=_createForOfIteratorHelper(state.selection.ranges),_step225;try{for(_iterator225.s();!(_step225=_iterator225.n()).done;){var range=_step225.value;if(!range.empty){content.push(state.sliceDoc(range.from,range.to));ranges.push(range);}}}catch(err){_iterator225.e(err);}finally{_iterator225.f();}if(!content.length){// Nothing selected, do a line-wise copy 4090 + var upto=-1;var _iterator226=_createForOfIteratorHelper(state.selection.ranges),_step226;try{for(_iterator226.s();!(_step226=_iterator226.n()).done;){var from=_step226.value.from;var line=state.doc.lineAt(from);if(line.number>upto){content.push(line.text);ranges.push({from:line.from,to:Math.min(state.doc.length,line.to+1)});}upto=line.number;}}catch(err){_iterator226.e(err);}finally{_iterator226.f();}linewise=true;}return{text:content.join(state.lineBreak),ranges:ranges,linewise:linewise};}var lastLinewiseCopy=null;handlers.copy=handlers.cut=function(view,event){var _copiedRange2=copiedRange(view.state),text=_copiedRange2.text,ranges=_copiedRange2.ranges,linewise=_copiedRange2.linewise;if(!text&&!linewise)return;lastLinewiseCopy=linewise?text:null;var data=brokenClipboardAPI?null:event.clipboardData;if(data){event.preventDefault();data.clearData();data.setData("text/plain",text);}else{captureCopy(view,text);}if(event.type=="cut"&&!view.state.readOnly)view.dispatch({changes:ranges,scrollIntoView:true,userEvent:"delete.cut"});};handlers.focus=handlers.blur=function(view){setTimeout(function(){if(view.hasFocus!=view.inputState.notifiedFocused)view.update([]);},10);};handlers.beforeprint=function(view){view.viewState.printing=true;view.requestMeasure();setTimeout(function(){view.viewState.printing=false;view.requestMeasure();},2000);};function forceClearComposition(view,rapid){if(view.docView.compositionDeco.size){view.inputState.rapidCompositionStart=rapid;try{view.update([]);}finally{view.inputState.rapidCompositionStart=false;}}}handlers.compositionstart=handlers.compositionupdate=function(view){if(view.inputState.compositionFirstChange==null)view.inputState.compositionFirstChange=true;if(view.inputState.composing<0){if(view.docView.compositionDeco.size){view.observer.flush();forceClearComposition(view,true);}// FIXME possibly set a timeout to clear it again on Android 4091 + view.inputState.composing=0;}};handlers.compositionend=function(view){view.inputState.composing=-1;view.inputState.compositionEndedAt=Date.now();view.inputState.compositionFirstChange=null;setTimeout(function(){if(view.inputState.composing<0)forceClearComposition(view,false);},50);};handlers.contextmenu=function(view){view.inputState.lastContextMenu=Date.now();};handlers.beforeinput=function(view,event){var _a;// Because Chrome Android doesn't fire useful key events, use 4092 + // beforeinput to detect backspace (and possibly enter and delete, 4093 + // but those usually don't even seem to fire beforeinput events at 4094 + // the moment) and fake a key event for it. 4095 + // 4096 + // (preventDefault on beforeinput, though supported in the spec, 4097 + // seems to do nothing at all on Chrome). 4098 + var pending;if(browser.chrome&&browser.android&&(pending=PendingKeys.find(function(key){return key.inputType==event.inputType;}))){view.inputState.setPendingAndroidKey(view,pending);if(pending.key=="Backspace"||pending.key=="Delete"){var startViewHeight=((_a=window.visualViewport)===null||_a===void 0?void 0:_a.height)||0;setTimeout(function(){var _a;// Backspacing near uneditable nodes on Chrome Android sometimes 4099 + // closes the virtual keyboard. This tries to crudely detect 4100 + // that and refocus to get it back. 4101 + if((((_a=window.visualViewport)===null||_a===void 0?void 0:_a.height)||0)>startViewHeight+10&&view.hasFocus){view.contentDOM.blur();view.focus();}},100);}}};var wrappingWhiteSpace=["pre-wrap","normal","pre-line"];var HeightOracle=/*#__PURE__*/function(){function HeightOracle(){_classCallCheck(this,HeightOracle);this.doc=text.Text.empty;this.lineWrapping=false;this.direction=exports.Direction.LTR;this.heightSamples={};this.lineHeight=14;this.charWidth=7;this.lineLength=30;// Used to track, during updateHeight, if any actual heights changed 4102 + this.heightChanged=false;}_createClass(HeightOracle,[{key:"heightForGap",value:function heightForGap(from,to){var lines=this.doc.lineAt(to).number-this.doc.lineAt(from).number+1;if(this.lineWrapping)lines+=Math.ceil((to-from-lines*this.lineLength*0.5)/this.lineLength);return this.lineHeight*lines;}},{key:"heightForLine",value:function heightForLine(length){if(!this.lineWrapping)return this.lineHeight;var lines=1+Math.max(0,Math.ceil((length-this.lineLength)/(this.lineLength-5)));return lines*this.lineHeight;}},{key:"setDoc",value:function setDoc(doc){this.doc=doc;return this;}},{key:"mustRefresh",value:function mustRefresh(lineHeights,whiteSpace,direction){var newHeight=false;for(var _i168=0;_i168<lineHeights.length;_i168++){var h=lineHeights[_i168];if(h<0){_i168++;}else if(!this.heightSamples[Math.floor(h*10)]){// Round to .1 pixels 4103 + newHeight=true;this.heightSamples[Math.floor(h*10)]=true;}}return newHeight||wrappingWhiteSpace.indexOf(whiteSpace)>-1!=this.lineWrapping||this.direction!=direction;}},{key:"refresh",value:function refresh(whiteSpace,direction,lineHeight,charWidth,lineLength,knownHeights){var lineWrapping=wrappingWhiteSpace.indexOf(whiteSpace)>-1;var changed=Math.round(lineHeight)!=Math.round(this.lineHeight)||this.lineWrapping!=lineWrapping||this.direction!=direction;this.lineWrapping=lineWrapping;this.direction=direction;this.lineHeight=lineHeight;this.charWidth=charWidth;this.lineLength=lineLength;if(changed){this.heightSamples={};for(var _i169=0;_i169<knownHeights.length;_i169++){var h=knownHeights[_i169];if(h<0)_i169++;else this.heightSamples[Math.floor(h*10)]=true;}}return changed;}}]);return HeightOracle;}();// This object is used by `updateHeight` to make DOM measurements 4104 + // arrive at the right nides. The `heights` array is a sequence of 4105 + // block heights, starting from position `from`. 4106 + var MeasuredHeights=/*#__PURE__*/function(){function MeasuredHeights(from,heights){_classCallCheck(this,MeasuredHeights);this.from=from;this.heights=heights;this.index=0;}_createClass(MeasuredHeights,[{key:"more",get:function get(){return this.index<this.heights.length;}}]);return MeasuredHeights;}();/** 4107 + Record used to represent information about a block-level element 4108 + in the editor view. 4109 + */var BlockInfo=/*#__PURE__*/function(){/** 4110 + @internal 4111 + */function BlockInfo(/** 4112 + The start of the element in the document. 4113 + */from,/** 4114 + The length of the element. 4115 + */length,/** 4116 + The top position of the element. 4117 + */top,/** 4118 + Its height. 4119 + */height,/** 4120 + The type of element this is. When querying lines, this may be 4121 + an array of all the blocks that make up the line. 4122 + */type){_classCallCheck(this,BlockInfo);this.from=from;this.length=length;this.top=top;this.height=height;this.type=type;}/** 4123 + The end of the element as a document position. 4124 + */_createClass(BlockInfo,[{key:"to",get:function get(){return this.from+this.length;}/** 4125 + The bottom position of the element. 4126 + */},{key:"bottom",get:function get(){return this.top+this.height;}/** 4127 + @internal 4128 + */},{key:"join",value:function join(other){var detail=(Array.isArray(this.type)?this.type:[this]).concat(Array.isArray(other.type)?other.type:[other]);return new BlockInfo(this.from,this.length+other.length,this.top,this.height+other.height,detail);}}]);return BlockInfo;}();var QueryType;(function(QueryType){QueryType[QueryType["ByPos"]=0]="ByPos";QueryType[QueryType["ByHeight"]=1]="ByHeight";QueryType[QueryType["ByPosNoHeight"]=2]="ByPosNoHeight";})(QueryType||(QueryType={}));var Epsilon=1e-4;var HeightMap=/*#__PURE__*/function(){function HeightMap(length,// The number of characters covered 4129 + height){var flags=arguments.length>2&&arguments[2]!==undefined?arguments[2]:2;_classCallCheck(this,HeightMap);this.length=length;this.height=height;this.flags=flags;}_createClass(HeightMap,[{key:"outdated",get:function get(){return(this.flags&2/* Outdated */)>0;},set:function set(value){this.flags=(value?2/* Outdated */:0)|this.flags&~2/* Outdated */;}},{key:"setHeight",value:function setHeight(oracle,height){if(this.height!=height){if(Math.abs(this.height-height)>Epsilon)oracle.heightChanged=true;this.height=height;}}// Base case is to replace a leaf node, which simply builds a tree 4130 + // from the new nodes and returns that (HeightMapBranch and 4131 + // HeightMapGap override this to actually use from/to) 4132 + },{key:"replace",value:function replace(_from,_to,nodes){return HeightMap.of(nodes);}// Again, these are base cases, and are overridden for branch and gap nodes. 4133 + },{key:"decomposeLeft",value:function decomposeLeft(_to,result){result.push(this);}},{key:"decomposeRight",value:function decomposeRight(_from,result){result.push(this);}},{key:"applyChanges",value:function applyChanges(decorations,oldDoc,oracle,changes){var me=this;for(var _i170=changes.length-1;_i170>=0;_i170--){var _changes$_i2=changes[_i170],fromA=_changes$_i2.fromA,toA=_changes$_i2.toA,fromB=_changes$_i2.fromB,toB=_changes$_i2.toB;var start=me.lineAt(fromA,QueryType.ByPosNoHeight,oldDoc,0,0);var end=start.to>=toA?start:me.lineAt(toA,QueryType.ByPosNoHeight,oldDoc,0,0);toB+=end.to-toA;toA=end.to;while(_i170>0&&start.from<=changes[_i170-1].toA){fromA=changes[_i170-1].fromA;fromB=changes[_i170-1].fromB;_i170--;if(fromA<start.from)start=me.lineAt(fromA,QueryType.ByPosNoHeight,oldDoc,0,0);}fromB+=start.from-fromA;fromA=start.from;var nodes=NodeBuilder.build(oracle,decorations,fromB,toB);me=me.replace(fromA,toA,nodes);}return me.updateHeight(oracle,0);}}],[{key:"empty",value:function empty(){return new HeightMapText(0,0);}// nodes uses null values to indicate the position of line breaks. 4134 + // There are never line breaks at the start or end of the array, or 4135 + // two line breaks next to each other, and the array isn't allowed 4136 + // to be empty (same restrictions as return value from the builder). 4137 + },{key:"of",value:function of(nodes){if(nodes.length==1)return nodes[0];var i=0,j=nodes.length,before=0,after=0;for(;;){if(i==j){if(before>after*2){var split=nodes[i-1];if(split["break"])nodes.splice(--i,1,split.left,null,split.right);else nodes.splice(--i,1,split.left,split.right);j+=1+split["break"];before-=split.size;}else if(after>before*2){var _split2=nodes[j];if(_split2["break"])nodes.splice(j,1,_split2.left,null,_split2.right);else nodes.splice(j,1,_split2.left,_split2.right);j+=2+_split2["break"];after-=_split2.size;}else{break;}}else if(before<after){var next=nodes[i++];if(next)before+=next.size;}else{var _next4=nodes[--j];if(_next4)after+=_next4.size;}}var brk=0;if(nodes[i-1]==null){brk=1;i--;}else if(nodes[i]==null){brk=1;j++;}return new HeightMapBranch(HeightMap.of(nodes.slice(0,i)),brk,HeightMap.of(nodes.slice(j)));}}]);return HeightMap;}();HeightMap.prototype.size=1;var HeightMapBlock=/*#__PURE__*/function(_HeightMap4){_inherits(HeightMapBlock,_HeightMap4);var _super60=_createSuper(HeightMapBlock);function HeightMapBlock(length,height,type){var _this114;_classCallCheck(this,HeightMapBlock);_this114=_super60.call(this,length,height);_this114.type=type;return _this114;}_createClass(HeightMapBlock,[{key:"blockAt",value:function blockAt(_height,_doc,top,offset){return new BlockInfo(offset,this.length,top,this.height,this.type);}},{key:"lineAt",value:function lineAt(_value,_type,doc,top,offset){return this.blockAt(0,doc,top,offset);}},{key:"forEachLine",value:function forEachLine(_from,_to,doc,top,offset,f){f(this.blockAt(0,doc,top,offset));}},{key:"updateHeight",value:function updateHeight(oracle){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var _force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var measured=arguments.length>3?arguments[3]:undefined;if(measured&&measured.from<=offset&&measured.more)this.setHeight(oracle,measured.heights[measured.index++]);this.outdated=false;return this;}},{key:"toString",value:function toString(){return"block(".concat(this.length,")");}}]);return HeightMapBlock;}(HeightMap);var HeightMapText=/*#__PURE__*/function(_HeightMapBlock2){_inherits(HeightMapText,_HeightMapBlock2);var _super61=_createSuper(HeightMapText);function HeightMapText(length,height){var _this115;_classCallCheck(this,HeightMapText);_this115=_super61.call(this,length,height,exports.BlockType.Text);_this115.collapsed=0;// Amount of collapsed content in the line 4138 + _this115.widgetHeight=0;// Maximum inline widget height 4139 + return _this115;}_createClass(HeightMapText,[{key:"replace",value:function replace(_from,_to,nodes){var node=nodes[0];if(nodes.length==1&&(node instanceof HeightMapText||node instanceof HeightMapGap&&node.flags&4/* SingleLine */)&&Math.abs(this.length-node.length)<10){if(node instanceof HeightMapGap)node=new HeightMapText(node.length,this.height);else node.height=this.height;if(!this.outdated)node.outdated=false;return node;}else{return HeightMap.of(nodes);}}},{key:"updateHeight",value:function updateHeight(oracle){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var measured=arguments.length>3?arguments[3]:undefined;if(measured&&measured.from<=offset&&measured.more)this.setHeight(oracle,measured.heights[measured.index++]);else if(force||this.outdated)this.setHeight(oracle,Math.max(this.widgetHeight,oracle.heightForLine(this.length-this.collapsed)));this.outdated=false;return this;}},{key:"toString",value:function toString(){return"line(".concat(this.length).concat(this.collapsed?-this.collapsed:"").concat(this.widgetHeight?":"+this.widgetHeight:"",")");}}]);return HeightMapText;}(HeightMapBlock);var HeightMapGap=/*#__PURE__*/function(_HeightMap5){_inherits(HeightMapGap,_HeightMap5);var _super62=_createSuper(HeightMapGap);function HeightMapGap(length){_classCallCheck(this,HeightMapGap);return _super62.call(this,length,0);}_createClass(HeightMapGap,[{key:"lines",value:function lines(doc,offset){var firstLine=doc.lineAt(offset).number,lastLine=doc.lineAt(offset+this.length).number;return{firstLine:firstLine,lastLine:lastLine,lineHeight:this.height/(lastLine-firstLine+1)};}},{key:"blockAt",value:function blockAt(height,doc,top,offset){var _this$lines4=this.lines(doc,offset),firstLine=_this$lines4.firstLine,lastLine=_this$lines4.lastLine,lineHeight=_this$lines4.lineHeight;var line=Math.max(0,Math.min(lastLine-firstLine,Math.floor((height-top)/lineHeight)));var _doc$line2=doc.line(firstLine+line),from=_doc$line2.from,length=_doc$line2.length;return new BlockInfo(from,length,top+lineHeight*line,lineHeight,exports.BlockType.Text);}},{key:"lineAt",value:function lineAt(value,type,doc,top,offset){if(type==QueryType.ByHeight)return this.blockAt(value,doc,top,offset);if(type==QueryType.ByPosNoHeight){var _doc$lineAt3=doc.lineAt(value),_from4=_doc$lineAt3.from,to=_doc$lineAt3.to;return new BlockInfo(_from4,to-_from4,0,0,exports.BlockType.Text);}var _this$lines5=this.lines(doc,offset),firstLine=_this$lines5.firstLine,lineHeight=_this$lines5.lineHeight;var _doc$lineAt4=doc.lineAt(value),from=_doc$lineAt4.from,length=_doc$lineAt4.length,number=_doc$lineAt4.number;return new BlockInfo(from,length,top+lineHeight*(number-firstLine),lineHeight,exports.BlockType.Text);}},{key:"forEachLine",value:function forEachLine(from,to,doc,top,offset,f){var _this$lines6=this.lines(doc,offset),firstLine=_this$lines6.firstLine,lineHeight=_this$lines6.lineHeight;for(var pos=Math.max(from,offset),end=Math.min(offset+this.length,to);pos<=end;){var line=doc.lineAt(pos);if(pos==from)top+=lineHeight*(line.number-firstLine);f(new BlockInfo(line.from,line.length,top,lineHeight,exports.BlockType.Text));top+=lineHeight;pos=line.to+1;}}},{key:"replace",value:function replace(from,to,nodes){var after=this.length-to;if(after>0){var last=nodes[nodes.length-1];if(last instanceof HeightMapGap)nodes[nodes.length-1]=new HeightMapGap(last.length+after);else nodes.push(null,new HeightMapGap(after-1));}if(from>0){var first=nodes[0];if(first instanceof HeightMapGap)nodes[0]=new HeightMapGap(from+first.length);else nodes.unshift(new HeightMapGap(from-1),null);}return HeightMap.of(nodes);}},{key:"decomposeLeft",value:function decomposeLeft(to,result){result.push(new HeightMapGap(to-1),null);}},{key:"decomposeRight",value:function decomposeRight(from,result){result.push(null,new HeightMapGap(this.length-from-1));}},{key:"updateHeight",value:function updateHeight(oracle){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var measured=arguments.length>3?arguments[3]:undefined;var end=offset+this.length;if(measured&&measured.from<=offset+this.length&&measured.more){// Fill in part of this gap with measured lines. We know there 4140 + // can't be widgets or collapsed ranges in those lines, because 4141 + // they would already have been added to the heightmap (gaps 4142 + // only contain plain text). 4143 + var nodes=[],pos=Math.max(offset,measured.from);if(measured.from>offset)nodes.push(new HeightMapGap(measured.from-offset-1).updateHeight(oracle,offset));while(pos<=end&&measured.more){var len=oracle.doc.lineAt(pos).length;if(nodes.length)nodes.push(null);var line=new HeightMapText(len,measured.heights[measured.index++]);line.outdated=false;nodes.push(line);pos+=len+1;}if(pos<=end)nodes.push(null,new HeightMapGap(end-pos).updateHeight(oracle,pos));oracle.heightChanged=true;return HeightMap.of(nodes);}else if(force||this.outdated){this.setHeight(oracle,oracle.heightForGap(offset,offset+this.length));this.outdated=false;}return this;}},{key:"toString",value:function toString(){return"gap(".concat(this.length,")");}}]);return HeightMapGap;}(HeightMap);var HeightMapBranch=/*#__PURE__*/function(_HeightMap6){_inherits(HeightMapBranch,_HeightMap6);var _super63=_createSuper(HeightMapBranch);function HeightMapBranch(left,brk,right){var _this116;_classCallCheck(this,HeightMapBranch);_this116=_super63.call(this,left.length+brk+right.length,left.height+right.height,brk|(left.outdated||right.outdated?2/* Outdated */:0));_this116.left=left;_this116.right=right;_this116.size=left.size+right.size;return _this116;}_createClass(HeightMapBranch,[{key:"break",get:function get(){return this.flags&1/* Break */;}},{key:"blockAt",value:function blockAt(height,doc,top,offset){var mid=top+this.left.height;return height<mid||this.right.height==0?this.left.blockAt(height,doc,top,offset):this.right.blockAt(height,doc,mid,offset+this.left.length+this["break"]);}},{key:"lineAt",value:function lineAt(value,type,doc,top,offset){var rightTop=top+this.left.height,rightOffset=offset+this.left.length+this["break"];var left=type==QueryType.ByHeight?value<rightTop||this.right.height==0:value<rightOffset;var base=left?this.left.lineAt(value,type,doc,top,offset):this.right.lineAt(value,type,doc,rightTop,rightOffset);if(this["break"]||(left?base.to<rightOffset:base.from>rightOffset))return base;var subQuery=type==QueryType.ByPosNoHeight?QueryType.ByPosNoHeight:QueryType.ByPos;if(left)return base.join(this.right.lineAt(rightOffset,subQuery,doc,rightTop,rightOffset));else return this.left.lineAt(rightOffset,subQuery,doc,top,offset).join(base);}},{key:"forEachLine",value:function forEachLine(from,to,doc,top,offset,f){var rightTop=top+this.left.height,rightOffset=offset+this.left.length+this["break"];if(this["break"]){if(from<rightOffset)this.left.forEachLine(from,to,doc,top,offset,f);if(to>=rightOffset)this.right.forEachLine(from,to,doc,rightTop,rightOffset,f);}else{var mid=this.lineAt(rightOffset,QueryType.ByPos,doc,top,offset);if(from<mid.from)this.left.forEachLine(from,mid.from-1,doc,top,offset,f);if(mid.to>=from&&mid.from<=to)f(mid);if(to>mid.to)this.right.forEachLine(mid.to+1,to,doc,rightTop,rightOffset,f);}}},{key:"replace",value:function replace(from,to,nodes){var rightStart=this.left.length+this["break"];if(to<rightStart)return this.balanced(this.left.replace(from,to,nodes),this.right);if(from>this.left.length)return this.balanced(this.left,this.right.replace(from-rightStart,to-rightStart,nodes));var result=[];if(from>0)this.decomposeLeft(from,result);var left=result.length;var _iterator227=_createForOfIteratorHelper(nodes),_step227;try{for(_iterator227.s();!(_step227=_iterator227.n()).done;){var node=_step227.value;result.push(node);}}catch(err){_iterator227.e(err);}finally{_iterator227.f();}if(from>0)mergeGaps(result,left-1);if(to<this.length){var right=result.length;this.decomposeRight(to,result);mergeGaps(result,right);}return HeightMap.of(result);}},{key:"decomposeLeft",value:function decomposeLeft(to,result){var left=this.left.length;if(to<=left)return this.left.decomposeLeft(to,result);result.push(this.left);if(this["break"]){left++;if(to>=left)result.push(null);}if(to>left)this.right.decomposeLeft(to-left,result);}},{key:"decomposeRight",value:function decomposeRight(from,result){var left=this.left.length,right=left+this["break"];if(from>=right)return this.right.decomposeRight(from-right,result);if(from<left)this.left.decomposeRight(from,result);if(this["break"]&&from<right)result.push(null);result.push(this.right);}},{key:"balanced",value:function balanced(left,right){if(left.size>2*right.size||right.size>2*left.size)return HeightMap.of(this["break"]?[left,null,right]:[left,right]);this.left=left;this.right=right;this.height=left.height+right.height;this.outdated=left.outdated||right.outdated;this.size=left.size+right.size;this.length=left.length+this["break"]+right.length;return this;}},{key:"updateHeight",value:function updateHeight(oracle){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var force=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var measured=arguments.length>3?arguments[3]:undefined;var left=this.left,right=this.right,rightStart=offset+left.length+this["break"],rebalance=null;if(measured&&measured.from<=offset+left.length&&measured.more)rebalance=left=left.updateHeight(oracle,offset,force,measured);else left.updateHeight(oracle,offset,force);if(measured&&measured.from<=rightStart+right.length&&measured.more)rebalance=right=right.updateHeight(oracle,rightStart,force,measured);else right.updateHeight(oracle,rightStart,force);if(rebalance)return this.balanced(left,right);this.height=this.left.height+this.right.height;this.outdated=false;return this;}},{key:"toString",value:function toString(){return this.left+(this["break"]?" ":"-")+this.right;}}]);return HeightMapBranch;}(HeightMap);function mergeGaps(nodes,around){var before,after;if(nodes[around]==null&&(before=nodes[around-1])instanceof HeightMapGap&&(after=nodes[around+1])instanceof HeightMapGap)nodes.splice(around-1,3,new HeightMapGap(before.length+1+after.length));}var relevantWidgetHeight=5;var NodeBuilder=/*#__PURE__*/function(){function NodeBuilder(pos,oracle){_classCallCheck(this,NodeBuilder);this.pos=pos;this.oracle=oracle;this.nodes=[];this.lineStart=-1;this.lineEnd=-1;this.covering=null;this.writtenTo=pos;}_createClass(NodeBuilder,[{key:"isCovered",get:function get(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering;}},{key:"span",value:function span(_from,to){if(this.lineStart>-1){var end=Math.min(to,this.lineEnd),last=this.nodes[this.nodes.length-1];if(last instanceof HeightMapText)last.length+=end-this.pos;else if(end>this.pos||!this.isCovered)this.nodes.push(new HeightMapText(end-this.pos,-1));this.writtenTo=end;if(to>end){this.nodes.push(null);this.writtenTo++;this.lineStart=-1;}}this.pos=to;}},{key:"point",value:function point(from,to,deco){if(from<to||deco.heightRelevant){var height=deco.widget?Math.max(0,deco.widget.estimatedHeight):0;var len=to-from;if(deco.block){this.addBlock(new HeightMapBlock(len,height,deco.type));}else if(len||height>=relevantWidgetHeight){this.addLineDeco(height,len);}}else if(to>from){this.span(from,to);}if(this.lineEnd>-1&&this.lineEnd<this.pos)this.lineEnd=this.oracle.doc.lineAt(this.pos).to;}},{key:"enterLine",value:function enterLine(){if(this.lineStart>-1)return;var _this$oracle$doc$line2=this.oracle.doc.lineAt(this.pos),from=_this$oracle$doc$line2.from,to=_this$oracle$doc$line2.to;this.lineStart=from;this.lineEnd=to;if(this.writtenTo<from){if(this.writtenTo<from-1||this.nodes[this.nodes.length-1]==null)this.nodes.push(this.blankContent(this.writtenTo,from-1));this.nodes.push(null);}if(this.pos>from)this.nodes.push(new HeightMapText(this.pos-from,-1));this.writtenTo=this.pos;}},{key:"blankContent",value:function blankContent(from,to){var gap=new HeightMapGap(to-from);if(this.oracle.doc.lineAt(from).to==to)gap.flags|=4/* SingleLine */;return gap;}},{key:"ensureLine",value:function ensureLine(){this.enterLine();var last=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(last instanceof HeightMapText)return last;var line=new HeightMapText(0,-1);this.nodes.push(line);return line;}},{key:"addBlock",value:function addBlock(block){this.enterLine();if(block.type==exports.BlockType.WidgetAfter&&!this.isCovered)this.ensureLine();this.nodes.push(block);this.writtenTo=this.pos=this.pos+block.length;if(block.type!=exports.BlockType.WidgetBefore)this.covering=block;}},{key:"addLineDeco",value:function addLineDeco(height,length){var line=this.ensureLine();line.length+=length;line.collapsed+=length;line.widgetHeight=Math.max(line.widgetHeight,height);this.writtenTo=this.pos=this.pos+length;}},{key:"finish",value:function finish(from){var last=this.nodes.length==0?null:this.nodes[this.nodes.length-1];if(this.lineStart>-1&&!(last instanceof HeightMapText)&&!this.isCovered)this.nodes.push(new HeightMapText(0,-1));else if(this.writtenTo<this.pos||last==null)this.nodes.push(this.blankContent(this.writtenTo,this.pos));var pos=from;var _iterator228=_createForOfIteratorHelper(this.nodes),_step228;try{for(_iterator228.s();!(_step228=_iterator228.n()).done;){var node=_step228.value;if(node instanceof HeightMapText)node.updateHeight(this.oracle,pos);pos+=node?node.length:1;}}catch(err){_iterator228.e(err);}finally{_iterator228.f();}return this.nodes;}// Always called with a region that on both sides either stretches 4144 + // to a line break or the end of the document. 4145 + // The returned array uses null to indicate line breaks, but never 4146 + // starts or ends in a line break, or has multiple line breaks next 4147 + // to each other. 4148 + }],[{key:"build",value:function build(oracle,decorations,from,to){var builder=new NodeBuilder(from,oracle);rangeset.RangeSet.spans(decorations,from,to,builder,0);return builder.finish(from);}}]);return NodeBuilder;}();function heightRelevantDecoChanges(a,b,diff){var comp=new DecorationComparator();rangeset.RangeSet.compare(a,b,diff,comp,0);return comp.changes;}var DecorationComparator=/*#__PURE__*/function(){function DecorationComparator(){_classCallCheck(this,DecorationComparator);this.changes=[];}_createClass(DecorationComparator,[{key:"compareRange",value:function compareRange(){}},{key:"comparePoint",value:function comparePoint(from,to,a,b){if(from<to||a&&a.heightRelevant||b&&b.heightRelevant)addRange(from,to,this.changes,5);}}]);return DecorationComparator;}();function visiblePixelRange(dom,paddingTop){var rect=dom.getBoundingClientRect();var left=Math.max(0,rect.left),right=Math.min(innerWidth,rect.right);var top=Math.max(0,rect.top),bottom=Math.min(innerHeight,rect.bottom);var body=dom.ownerDocument.body;for(var parent=dom.parentNode;parent&&parent!=body;){if(parent.nodeType==1){var elt=parent;var style=window.getComputedStyle(elt);if((elt.scrollHeight>elt.clientHeight||elt.scrollWidth>elt.clientWidth)&&style.overflow!="visible"){var parentRect=elt.getBoundingClientRect();left=Math.max(left,parentRect.left);right=Math.min(right,parentRect.right);top=Math.max(top,parentRect.top);bottom=Math.min(bottom,parentRect.bottom);}parent=style.position=="absolute"||style.position=="fixed"?elt.offsetParent:elt.parentNode;}else if(parent.nodeType==11){// Shadow root 4149 + parent=parent.host;}else{break;}}return{left:left-rect.left,right:right-rect.left,top:top-(rect.top+paddingTop),bottom:bottom-(rect.top+paddingTop)};}// Line gaps are placeholder widgets used to hide pieces of overlong 4150 + // lines within the viewport, as a kludge to keep the editor 4151 + // responsive when a ridiculously long line is loaded into it. 4152 + var LineGap=/*#__PURE__*/function(){function LineGap(from,to,size){_classCallCheck(this,LineGap);this.from=from;this.to=to;this.size=size;}_createClass(LineGap,[{key:"draw",value:function draw(wrapping){return Decoration.replace({widget:new LineGapWidget(this.size,wrapping)}).range(this.from,this.to);}}],[{key:"same",value:function same(a,b){if(a.length!=b.length)return false;for(var _i171=0;_i171<a.length;_i171++){var gA=a[_i171],gB=b[_i171];if(gA.from!=gB.from||gA.to!=gB.to||gA.size!=gB.size)return false;}return true;}}]);return LineGap;}();var LineGapWidget=/*#__PURE__*/function(_WidgetType11){_inherits(LineGapWidget,_WidgetType11);var _super64=_createSuper(LineGapWidget);function LineGapWidget(size,vertical){var _this117;_classCallCheck(this,LineGapWidget);_this117=_super64.call(this);_this117.size=size;_this117.vertical=vertical;return _this117;}_createClass(LineGapWidget,[{key:"eq",value:function eq(other){return other.size==this.size&&other.vertical==this.vertical;}},{key:"toDOM",value:function toDOM(){var elt=document.createElement("div");if(this.vertical){elt.style.height=this.size+"px";}else{elt.style.width=this.size+"px";elt.style.height="2px";elt.style.display="inline-block";}return elt;}},{key:"estimatedHeight",get:function get(){return this.vertical?this.size:-1;}}]);return LineGapWidget;}(WidgetType);var ScrollTarget=/*#__PURE__*/function(){function ScrollTarget(range){var center=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;_classCallCheck(this,ScrollTarget);this.range=range;this.center=center;}_createClass(ScrollTarget,[{key:"map",value:function map(changes){return changes.empty?this:new ScrollTarget(this.range.map(changes),this.center);}}]);return ScrollTarget;}();var ViewState=/*#__PURE__*/function(){function ViewState(state){_classCallCheck(this,ViewState);this.state=state;// These are contentDOM-local coordinates 4153 + this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0};this.inView=true;this.paddingTop=0;this.paddingBottom=0;this.contentWidth=0;this.heightOracle=new HeightOracle();// See VP.MaxDOMHeight 4154 + this.scaler=IdScaler;this.scrollTarget=null;// Briefly set to true when printing, to disable viewport limiting 4155 + this.printing=false;this.visibleRanges=[];// Cursor 'assoc' is only significant when the cursor is on a line 4156 + // wrap point, where it must stick to the character that it is 4157 + // associated with. Since browsers don't provide a reasonable 4158 + // interface to set or query this, when a selection is set that 4159 + // might cause this to be significant, this flag is set. The next 4160 + // measure phase will check whether the cursor is on a line-wrapping 4161 + // boundary and, if so, reset it to make sure it is positioned in 4162 + // the right place. 4163 + this.mustEnforceCursorAssoc=false;this.heightMap=HeightMap.empty().applyChanges(state.facet(decorations),text.Text.empty,this.heightOracle.setDoc(state.doc),[new ChangedRange(0,0,0,state.doc.length)]);this.viewport=this.getViewport(0,null);this.updateForViewport();this.lineGaps=this.ensureLineGaps([]);this.lineGapDeco=Decoration.set(this.lineGaps.map(function(gap){return gap.draw(false);}));this.computeVisibleRanges();}_createClass(ViewState,[{key:"updateForViewport",value:function updateForViewport(){var _this118=this;var viewports=[this.viewport],main=this.state.selection.main;var _loop24=function _loop24(_i172){var pos=_i172?main.head:main.anchor;if(!viewports.some(function(_ref78){var from=_ref78.from,to=_ref78.to;return pos>=from&&pos<=to;})){var _this118$lineAt=_this118.lineAt(pos,0),from=_this118$lineAt.from,to=_this118$lineAt.to;viewports.push(new Viewport(from,to));}};for(var _i172=0;_i172<=1;_i172++){_loop24(_i172);}this.viewports=viewports.sort(function(a,b){return a.from-b.from;});this.scaler=this.heightMap.height<=7000000/* MaxDOMHeight */?IdScaler:new BigScaler(this.heightOracle.doc,this.heightMap,this.viewports);}},{key:"update",value:function update(_update31){var scrollTarget=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var prev=this.state;this.state=_update31.state;var newDeco=this.state.facet(decorations);var contentChanges=_update31.changedRanges;var heightChanges=ChangedRange.extendWithRanges(contentChanges,heightRelevantDecoChanges(_update31.startState.facet(decorations),newDeco,_update31?_update31.changes:state.ChangeSet.empty(this.state.doc.length)));var prevHeight=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(newDeco,prev.doc,this.heightOracle.setDoc(this.state.doc),heightChanges);if(this.heightMap.height!=prevHeight)_update31.flags|=2/* Height */;var viewport=heightChanges.length?this.mapViewport(this.viewport,_update31.changes):this.viewport;if(scrollTarget&&(scrollTarget.range.head<viewport.from||scrollTarget.range.head>viewport.to)||!this.viewportIsAppropriate(viewport))viewport=this.getViewport(0,scrollTarget);this.viewport=viewport;this.updateForViewport();if(this.lineGaps.length||this.viewport.to-this.viewport.from>4000/* DoubleMargin */)this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,_update31.changes)));_update31.flags|=this.computeVisibleRanges();if(scrollTarget)this.scrollTarget=scrollTarget;if(!this.mustEnforceCursorAssoc&&_update31.selectionSet&&_update31.view.lineWrapping&&_update31.state.selection.main.empty&&_update31.state.selection.main.assoc)this.mustEnforceCursorAssoc=true;}},{key:"measure",value:function measure(docView,repeated){var dom=docView.dom,whiteSpace="",direction=exports.Direction.LTR;var result=0;if(!repeated){// Vertical padding 4164 + var style=window.getComputedStyle(dom);whiteSpace=style.whiteSpace,direction=style.direction=="rtl"?exports.Direction.RTL:exports.Direction.LTR;var paddingTop=parseInt(style.paddingTop)||0,paddingBottom=parseInt(style.paddingBottom)||0;if(this.paddingTop!=paddingTop||this.paddingBottom!=paddingBottom){result|=8/* Geometry */;this.paddingTop=paddingTop;this.paddingBottom=paddingBottom;}}// Pixel viewport 4165 + var pixelViewport=this.printing?{top:-1e8,bottom:1e8,left:-1e8,right:1e8}:visiblePixelRange(dom,this.paddingTop);var dTop=pixelViewport.top-this.pixelViewport.top,dBottom=pixelViewport.bottom-this.pixelViewport.bottom;this.pixelViewport=pixelViewport;this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(!this.inView)return 0;var lineHeights=docView.measureVisibleLineHeights();var refresh=false,bias=0,oracle=this.heightOracle;if(!repeated){var contentWidth=docView.dom.clientWidth;if(oracle.mustRefresh(lineHeights,whiteSpace,direction)||oracle.lineWrapping&&Math.abs(contentWidth-this.contentWidth)>oracle.charWidth){var _docView$measureTextS=docView.measureTextSize(),lineHeight=_docView$measureTextS.lineHeight,charWidth=_docView$measureTextS.charWidth;refresh=oracle.refresh(whiteSpace,direction,lineHeight,charWidth,contentWidth/charWidth,lineHeights);if(refresh){docView.minWidth=0;result|=8/* Geometry */;}}if(this.contentWidth!=contentWidth){this.contentWidth=contentWidth;result|=8/* Geometry */;}if(dTop>0&&dBottom>0)bias=Math.max(dTop,dBottom);else if(dTop<0&&dBottom<0)bias=Math.min(dTop,dBottom);}oracle.heightChanged=false;this.heightMap=this.heightMap.updateHeight(oracle,0,refresh,new MeasuredHeights(this.viewport.from,lineHeights));if(oracle.heightChanged)result|=2/* Height */;if(!this.viewportIsAppropriate(this.viewport,bias)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to))this.viewport=this.getViewport(bias,this.scrollTarget);this.updateForViewport();if(this.lineGaps.length||this.viewport.to-this.viewport.from>4000/* DoubleMargin */)this.updateLineGaps(this.ensureLineGaps(refresh?[]:this.lineGaps));result|=this.computeVisibleRanges();if(this.mustEnforceCursorAssoc){this.mustEnforceCursorAssoc=false;// This is done in the read stage, because moving the selection 4166 + // to a line end is going to trigger a layout anyway, so it 4167 + // can't be a pure write. It should be rare that it does any 4168 + // writing. 4169 + docView.enforceCursorAssoc();}return result;}},{key:"visibleTop",get:function get(){return this.scaler.fromDOM(this.pixelViewport.top,0);}},{key:"visibleBottom",get:function get(){return this.scaler.fromDOM(this.pixelViewport.bottom,0);}},{key:"getViewport",value:function getViewport(bias,scrollTarget){// This will divide VP.Margin between the top and the 4170 + // bottom, depending on the bias (the change in viewport position 4171 + // since the last update). It'll hold a number between 0 and 1 4172 + var marginTop=0.5-Math.max(-0.5,Math.min(0.5,bias/1000/* Margin *//2));var map=this.heightMap,doc=this.state.doc,visibleTop=this.visibleTop,visibleBottom=this.visibleBottom;var viewport=new Viewport(map.lineAt(visibleTop-marginTop*1000/* Margin */,QueryType.ByHeight,doc,0,0).from,map.lineAt(visibleBottom+(1-marginTop)*1000/* Margin */,QueryType.ByHeight,doc,0,0).to);// If scrollTarget is given, make sure the viewport includes that position 4173 + if(scrollTarget){var head=scrollTarget.range.head,viewHeight=visibleBottom-visibleTop;if(head<viewport.from||head>viewport.to){var block=map.lineAt(head,QueryType.ByPos,doc,0,0),topPos;if(scrollTarget.center)topPos=(block.top+block.bottom)/2-viewHeight/2;else if(head<viewport.from)topPos=block.top;else topPos=block.bottom-viewHeight;viewport=new Viewport(map.lineAt(topPos-1000/* Margin *//2,QueryType.ByHeight,doc,0,0).from,map.lineAt(topPos+viewHeight+1000/* Margin *//2,QueryType.ByHeight,doc,0,0).to);}}return viewport;}},{key:"mapViewport",value:function mapViewport(viewport,changes){var from=changes.mapPos(viewport.from,-1),to=changes.mapPos(viewport.to,1);return new Viewport(this.heightMap.lineAt(from,QueryType.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(to,QueryType.ByPos,this.state.doc,0,0).to);}// Checks if a given viewport covers the visible part of the 4174 + // document and not too much beyond that. 4175 + },{key:"viewportIsAppropriate",value:function viewportIsAppropriate(_ref79){var from=_ref79.from,to=_ref79.to;var bias=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var _this$heightMap$lineA3=this.heightMap.lineAt(from,QueryType.ByPos,this.state.doc,0,0),top=_this$heightMap$lineA3.top;var _this$heightMap$lineA4=this.heightMap.lineAt(to,QueryType.ByPos,this.state.doc,0,0),bottom=_this$heightMap$lineA4.bottom;var visibleTop=this.visibleTop,visibleBottom=this.visibleBottom;return(from==0||top<=visibleTop-Math.max(10/* MinCoverMargin */,Math.min(-bias,250/* MaxCoverMargin */)))&&(to==this.state.doc.length||bottom>=visibleBottom+Math.max(10/* MinCoverMargin */,Math.min(bias,250/* MaxCoverMargin */)))&&top>visibleTop-2*1000/* Margin */&&bottom<visibleBottom+2*1000/* Margin */;}},{key:"mapLineGaps",value:function mapLineGaps(gaps,changes){if(!gaps.length||changes.empty)return gaps;var mapped=[];var _iterator229=_createForOfIteratorHelper(gaps),_step229;try{for(_iterator229.s();!(_step229=_iterator229.n()).done;){var gap=_step229.value;if(!changes.touchesRange(gap.from,gap.to))mapped.push(new LineGap(changes.mapPos(gap.from),changes.mapPos(gap.to),gap.size));}}catch(err){_iterator229.e(err);}finally{_iterator229.f();}return mapped;}// Computes positions in the viewport where the start or end of a 4176 + // line should be hidden, trying to reuse existing line gaps when 4177 + // appropriate to avoid unneccesary redraws. 4178 + // Uses crude character-counting for the positioning and sizing, 4179 + // since actual DOM coordinates aren't always available and 4180 + // predictable. Relies on generous margins (see LG.Margin) to hide 4181 + // the artifacts this might produce from the user. 4182 + },{key:"ensureLineGaps",value:function ensureLineGaps(current){var _this119=this;var gaps=[];// This won't work at all in predominantly right-to-left text. 4183 + if(this.heightOracle.direction!=exports.Direction.LTR)return gaps;this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.state.doc,0,0,function(line){if(line.length<4000/* DoubleMargin */)return;var structure=lineStructure(line.from,line.to,_this119.state);if(structure.total<4000/* DoubleMargin */)return;var viewFrom,viewTo;if(_this119.heightOracle.lineWrapping){var marginHeight=2000/* Margin *//_this119.heightOracle.lineLength*_this119.heightOracle.lineHeight;viewFrom=findPosition(structure,(_this119.visibleTop-line.top-marginHeight)/line.height);viewTo=findPosition(structure,(_this119.visibleBottom-line.top+marginHeight)/line.height);}else{var totalWidth=structure.total*_this119.heightOracle.charWidth;var marginWidth=2000/* Margin */*_this119.heightOracle.charWidth;viewFrom=findPosition(structure,(_this119.pixelViewport.left-marginWidth)/totalWidth);viewTo=findPosition(structure,(_this119.pixelViewport.right+marginWidth)/totalWidth);}var outside=[];if(viewFrom>line.from)outside.push({from:line.from,to:viewFrom});if(viewTo<line.to)outside.push({from:viewTo,to:line.to});var sel=_this119.state.selection.main;// Make sure the gaps don't cover a selection end 4184 + if(sel.from>=line.from&&sel.from<=line.to)cutRange(outside,sel.from-10/* SelectionMargin */,sel.from+10/* SelectionMargin */);if(!sel.empty&&sel.to>=line.from&&sel.to<=line.to)cutRange(outside,sel.to-10/* SelectionMargin */,sel.to+10/* SelectionMargin */);var _loop25=function _loop25(){var _outside2$_i=_outside2[_i173],from=_outside2$_i.from,to=_outside2$_i.to;if(to-from>1000/* HalfMargin */){gaps.push(find(current,function(gap){return gap.from>=line.from&&gap.to<=line.to&&Math.abs(gap.from-from)<1000/* HalfMargin */&&Math.abs(gap.to-to)<1000;}/* HalfMargin */)||new LineGap(from,to,_this119.gapSize(line,from,to,structure)));}};for(var _i173=0,_outside2=outside;_i173<_outside2.length;_i173++){_loop25();}});return gaps;}},{key:"gapSize",value:function gapSize(line,from,to,structure){var fraction=findFraction(structure,to)-findFraction(structure,from);if(this.heightOracle.lineWrapping){return line.height*fraction;}else{return structure.total*this.heightOracle.charWidth*fraction;}}},{key:"updateLineGaps",value:function updateLineGaps(gaps){var _this120=this;if(!LineGap.same(gaps,this.lineGaps)){this.lineGaps=gaps;this.lineGapDeco=Decoration.set(gaps.map(function(gap){return gap.draw(_this120.heightOracle.lineWrapping);}));}}},{key:"computeVisibleRanges",value:function computeVisibleRanges(){var deco=this.state.facet(decorations);if(this.lineGaps.length)deco=deco.concat(this.lineGapDeco);var ranges=[];rangeset.RangeSet.spans(deco,this.viewport.from,this.viewport.to,{span:function span(from,to){ranges.push({from:from,to:to});},point:function point(){}},20);var changed=ranges.length!=this.visibleRanges.length||this.visibleRanges.some(function(r,i){return r.from!=ranges[i].from||r.to!=ranges[i].to;});this.visibleRanges=ranges;return changed?4/* Viewport */:0;}},{key:"lineAt",value:function lineAt(pos,editorTop){editorTop+=this.paddingTop;return scaleBlock(this.heightMap.lineAt(pos,QueryType.ByPos,this.state.doc,editorTop,0),this.scaler,editorTop);}},{key:"lineAtHeight",value:function lineAtHeight(height,editorTop){editorTop+=this.paddingTop;return scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height,editorTop),QueryType.ByHeight,this.state.doc,editorTop,0),this.scaler,editorTop);}},{key:"blockAtHeight",value:function blockAtHeight(height,editorTop){editorTop+=this.paddingTop;return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height,editorTop),this.state.doc,editorTop,0),this.scaler,editorTop);}},{key:"forEachLine",value:function forEachLine(from,to,f,editorTop){var _this121=this;editorTop+=this.paddingTop;return this.heightMap.forEachLine(from,to,this.state.doc,editorTop,0,this.scaler.scale==1?f:function(b){return f(scaleBlock(b,_this121.scaler,editorTop));});}},{key:"contentHeight",get:function get(){return this.domHeight+this.paddingTop+this.paddingBottom;}},{key:"domHeight",get:function get(){return this.scaler.toDOM(this.heightMap.height,this.paddingTop);}}]);return ViewState;}();var Viewport=/*#__PURE__*/_createClass(function Viewport(from,to){_classCallCheck(this,Viewport);this.from=from;this.to=to;});function lineStructure(from,to,state){var ranges=[],pos=from,total=0;rangeset.RangeSet.spans(state.facet(decorations),from,to,{span:function span(){},point:function point(from,to){if(from>pos){ranges.push({from:pos,to:from});total+=from-pos;}pos=to;}},20);// We're only interested in collapsed ranges of a significant size 4185 + if(pos<to){ranges.push({from:pos,to:to});total+=to-pos;}return{total:total,ranges:ranges};}function findPosition(_ref80,ratio){var total=_ref80.total,ranges=_ref80.ranges;if(ratio<=0)return ranges[0].from;if(ratio>=1)return ranges[ranges.length-1].to;var dist=Math.floor(total*ratio);for(var _i174=0;;_i174++){var _ranges$_i3=ranges[_i174],from=_ranges$_i3.from,to=_ranges$_i3.to,size=to-from;if(dist<=size)return from+dist;dist-=size;}}function findFraction(structure,pos){var counted=0;var _iterator230=_createForOfIteratorHelper(structure.ranges),_step230;try{for(_iterator230.s();!(_step230=_iterator230.n()).done;){var _step230$value=_step230.value,from=_step230$value.from,to=_step230$value.to;if(pos<=to){counted+=pos-from;break;}counted+=to-from;}}catch(err){_iterator230.e(err);}finally{_iterator230.f();}return counted/structure.total;}function cutRange(ranges,from,to){for(var _i175=0;_i175<ranges.length;_i175++){var _r7=ranges[_i175];if(_r7.from<to&&_r7.to>from){var pieces=[];if(_r7.from<from)pieces.push({from:_r7.from,to:from});if(_r7.to>to)pieces.push({from:to,to:_r7.to});ranges.splice.apply(ranges,[_i175,1].concat(pieces));_i175+=pieces.length-1;}}}function find(array,f){var _iterator231=_createForOfIteratorHelper(array),_step231;try{for(_iterator231.s();!(_step231=_iterator231.n()).done;){var val=_step231.value;if(f(val))return val;}}catch(err){_iterator231.e(err);}finally{_iterator231.f();}return undefined;}// Don't scale when the document height is within the range of what 4186 + // the DOM can handle. 4187 + var IdScaler={toDOM:function toDOM(n){return n;},fromDOM:function fromDOM(n){return n;},scale:1};// When the height is too big (> VP.MaxDOMHeight), scale down the 4188 + // regions outside the viewports so that the total height is 4189 + // VP.MaxDOMHeight. 4190 + var BigScaler=/*#__PURE__*/function(){function BigScaler(doc,heightMap,viewports){_classCallCheck(this,BigScaler);var vpHeight=0,base=0,domBase=0;this.viewports=viewports.map(function(_ref81){var from=_ref81.from,to=_ref81.to;var top=heightMap.lineAt(from,QueryType.ByPos,doc,0,0).top;var bottom=heightMap.lineAt(to,QueryType.ByPos,doc,0,0).bottom;vpHeight+=bottom-top;return{from:from,to:to,top:top,bottom:bottom,domTop:0,domBottom:0};});this.scale=(7000000/* MaxDOMHeight */-vpHeight)/(heightMap.height-vpHeight);var _iterator232=_createForOfIteratorHelper(this.viewports),_step232;try{for(_iterator232.s();!(_step232=_iterator232.n()).done;){var obj=_step232.value;obj.domTop=domBase+(obj.top-base)*this.scale;domBase=obj.domBottom=obj.domTop+(obj.bottom-obj.top);base=obj.bottom;}}catch(err){_iterator232.e(err);}finally{_iterator232.f();}}_createClass(BigScaler,[{key:"toDOM",value:function toDOM(n,top){n-=top;for(var _i176=0,base=0,domBase=0;;_i176++){var vp=_i176<this.viewports.length?this.viewports[_i176]:null;if(!vp||n<vp.top)return domBase+(n-base)*this.scale+top;if(n<=vp.bottom)return vp.domTop+(n-vp.top)+top;base=vp.bottom;domBase=vp.domBottom;}}},{key:"fromDOM",value:function fromDOM(n,top){n-=top;for(var _i177=0,base=0,domBase=0;;_i177++){var vp=_i177<this.viewports.length?this.viewports[_i177]:null;if(!vp||n<vp.domTop)return base+(n-domBase)/this.scale+top;if(n<=vp.domBottom)return vp.top+(n-vp.domTop)+top;base=vp.bottom;domBase=vp.domBottom;}}}]);return BigScaler;}();function scaleBlock(block,scaler,top){if(scaler.scale==1)return block;var bTop=scaler.toDOM(block.top,top),bBottom=scaler.toDOM(block.bottom,top);return new BlockInfo(block.from,block.length,bTop,bBottom-bTop,Array.isArray(block.type)?block.type.map(function(b){return scaleBlock(b,scaler,top);}):block.type);}var _theme2=state.Facet.define({combine:function combine(strs){return strs.join(" ");}});var darkTheme=state.Facet.define({combine:function combine(values){return values.indexOf(true)>-1;}});var baseThemeID=styleMod.StyleModule.newName(),baseLightID=styleMod.StyleModule.newName(),baseDarkID=styleMod.StyleModule.newName();var lightDarkIDs={"&light":"."+baseLightID,"&dark":"."+baseDarkID};function buildTheme(main,spec,scopes){return new styleMod.StyleModule(spec,{finish:function finish(sel){return /&/.test(sel)?sel.replace(/&\w*/,function(m){if(m=="&")return main;if(!scopes||!scopes[m])throw new RangeError("Unsupported selector: ".concat(m));return scopes[m];}):main+" "+sel;}});}var baseTheme=buildTheme("."+baseThemeID,{"&.cm-editor":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{// Provide a simple default outline to make sure a focused 4191 + // editor is visually distinct. Can't leave the default behavior 4192 + // because that will apply to the content element, which is 4193 + // inside the scrollable container and doesn't include the 4194 + // gutters. We also can't use an 'auto' outline, since those 4195 + // are, for some reason, drawn behind the element content, which 4196 + // will cause things like the active line background to cover 4197 + // the outline (#297). 4198 + outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace:"pre-wrap",wordBreak:"break-word",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},// Two animations defined so that we can switch between them to 4199 + // restart the animation without forcing another style 4200 + // recomputation. 4201 + "@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},lightDarkIDs);var observeOptions={childList:true,characterData:true,subtree:true,attributes:true,characterDataOldValue:true};// IE11 has very broken mutation observers, so we also listen to 4202 + // DOMCharacterDataModified there 4203 + var useCharData=browser.ie&&browser.ie_version<=11;var DOMObserver=/*#__PURE__*/function(){function DOMObserver(view,onChange,onScrollChanged){var _this122=this;_classCallCheck(this,DOMObserver);this.view=view;this.onChange=onChange;this.onScrollChanged=onScrollChanged;this.active=false;this.ignoreSelection=new DOMSelection();this.delayedFlush=-1;this.queue=[];this.lastFlush=0;this.scrollTargets=[];this.intersection=null;this.intersecting=false;this.gapIntersection=null;this.gaps=[];// Used to work around a Safari Selection/shadow DOM bug (#414) 4204 + this._selectionRange=null;// Timeout for scheduling check of the parents that need scroll handlers 4205 + this.parentCheck=-1;this.dom=view.contentDOM;this.observer=new MutationObserver(function(mutations){var _iterator233=_createForOfIteratorHelper(mutations),_step233;try{for(_iterator233.s();!(_step233=_iterator233.n()).done;){var mut=_step233.value;_this122.queue.push(mut);}}catch(err){_iterator233.e(err);}finally{_iterator233.f();}_this122._selectionRange=null;// IE11 will sometimes (on typing over a selection or 4206 + // backspacing out a single character text node) call the 4207 + // observer callback before actually updating the DOM. 4208 + // 4209 + // Unrelatedly, iOS Safari will, when ending a composition, 4210 + // sometimes first clear it, deliver the mutations, and then 4211 + // reinsert the finished text. CodeMirror's handling of the 4212 + // deletion will prevent the reinsertion from happening, 4213 + // breaking composition. 4214 + if((browser.ie&&browser.ie_version<=11||browser.ios&&view.composing)&&mutations.some(function(m){return m.type=="childList"&&m.removedNodes.length||m.type=="characterData"&&m.oldValue.length>m.target.nodeValue.length;}))_this122.flushSoon();else _this122.flush();});if(useCharData)this.onCharData=function(event){_this122.queue.push({target:event.target,type:"characterData",oldValue:event.prevValue});_this122.flushSoon();};this.onSelectionChange=this.onSelectionChange.bind(this);this.start();this.onScroll=this.onScroll.bind(this);window.addEventListener("scroll",this.onScroll);if(typeof IntersectionObserver=="function"){this.intersection=new IntersectionObserver(function(entries){if(_this122.parentCheck<0)_this122.parentCheck=setTimeout(_this122.listenForScroll.bind(_this122),1000);if(entries.length>0&&entries[entries.length-1].intersectionRatio>0!=_this122.intersecting){_this122.intersecting=!_this122.intersecting;if(_this122.intersecting!=_this122.view.inView)_this122.onScrollChanged(document.createEvent("Event"));}},{});this.intersection.observe(this.dom);this.gapIntersection=new IntersectionObserver(function(entries){if(entries.length>0&&entries[entries.length-1].intersectionRatio>0)_this122.onScrollChanged(document.createEvent("Event"));},{});}this.listenForScroll();}_createClass(DOMObserver,[{key:"onScroll",value:function onScroll(e){if(this.intersecting)this.flush();this.onScrollChanged(e);}},{key:"updateGaps",value:function updateGaps(gaps){if(this.gapIntersection&&(gaps.length!=this.gaps.length||this.gaps.some(function(g,i){return g!=gaps[i];}))){this.gapIntersection.disconnect();var _iterator234=_createForOfIteratorHelper(gaps),_step234;try{for(_iterator234.s();!(_step234=_iterator234.n()).done;){var gap=_step234.value;this.gapIntersection.observe(gap);}}catch(err){_iterator234.e(err);}finally{_iterator234.f();}this.gaps=gaps;}}},{key:"onSelectionChange",value:function onSelectionChange(event){if(this.lastFlush<Date.now()-50)this._selectionRange=null;var view=this.view,sel=this.selectionRange;if(view.state.facet(editable)?view.root.activeElement!=this.dom:!hasSelection(view.dom,sel))return;var context=sel.anchorNode&&view.docView.nearest(sel.anchorNode);if(context&&context.ignoreEvent(event))return;// Deletions on IE11 fire their events in the wrong order, giving 4215 + // us a selection change event before the DOM changes are 4216 + // reported. 4217 + // (Selection.isCollapsed isn't reliable on IE) 4218 + if(browser.ie&&browser.ie_version<=11&&!view.state.selection.main.empty&&sel.focusNode&&isEquivalentPosition(sel.focusNode,sel.focusOffset,sel.anchorNode,sel.anchorOffset))this.flushSoon();else this.flush();}},{key:"selectionRange",get:function get(){if(!this._selectionRange){var root=this.view.root,sel=getSelection(root);// The Selection object is broken in shadow roots in Safari. See 4219 + // https://github.com/codemirror/codemirror.next/issues/414 4220 + if(browser.safari&&root.nodeType==11&&deepActiveElement()==this.view.contentDOM)sel=safariSelectionRangeHack(this.view)||sel;this._selectionRange=sel;}return this._selectionRange;}},{key:"setSelectionRange",value:function setSelectionRange(anchor,head){var _a;if(!((_a=this._selectionRange)===null||_a===void 0?void 0:_a.type))this._selectionRange={anchorNode:anchor.node,anchorOffset:anchor.offset,focusNode:head.node,focusOffset:head.offset};}},{key:"listenForScroll",value:function listenForScroll(){this.parentCheck=-1;var i=0,changed=null;for(var dom=this.dom;dom;){if(dom.nodeType==1){if(!changed&&i<this.scrollTargets.length&&this.scrollTargets[i]==dom)i++;else if(!changed)changed=this.scrollTargets.slice(0,i);if(changed)changed.push(dom);dom=dom.assignedSlot||dom.parentNode;}else if(dom.nodeType==11){// Shadow root 4221 + dom=dom.host;}else{break;}}if(i<this.scrollTargets.length&&!changed)changed=this.scrollTargets.slice(0,i);if(changed){var _iterator235=_createForOfIteratorHelper(this.scrollTargets),_step235;try{for(_iterator235.s();!(_step235=_iterator235.n()).done;){var _dom4=_step235.value;_dom4.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator235.e(err);}finally{_iterator235.f();}var _iterator236=_createForOfIteratorHelper(this.scrollTargets=changed),_step236;try{for(_iterator236.s();!(_step236=_iterator236.n()).done;){var _dom5=_step236.value;_dom5.addEventListener("scroll",this.onScroll);}}catch(err){_iterator236.e(err);}finally{_iterator236.f();}}}},{key:"ignore",value:function ignore(f){if(!this.active)return f();try{this.stop();return f();}finally{this.start();this.clear();}}},{key:"start",value:function start(){if(this.active)return;this.observer.observe(this.dom,observeOptions);this.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange);if(useCharData)this.dom.addEventListener("DOMCharacterDataModified",this.onCharData);this.active=true;}},{key:"stop",value:function stop(){if(!this.active)return;this.active=false;this.observer.disconnect();this.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange);if(useCharData)this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData);}},{key:"clearSelection",value:function clearSelection(){this.ignoreSelection.set(this.selectionRange);}// Throw away any pending changes 4222 + },{key:"clear",value:function clear(){this.observer.takeRecords();this.queue.length=0;this.clearSelection();}},{key:"flushSoon",value:function flushSoon(){var _this123=this;if(this.delayedFlush<0)this.delayedFlush=window.setTimeout(function(){_this123.delayedFlush=-1;_this123.flush();},20);}},{key:"forceFlush",value:function forceFlush(){if(this.delayedFlush>=0){window.clearTimeout(this.delayedFlush);this.delayedFlush=-1;this.flush();}}},{key:"processRecords",value:function processRecords(){var records=this.queue;var _iterator237=_createForOfIteratorHelper(this.observer.takeRecords()),_step237;try{for(_iterator237.s();!(_step237=_iterator237.n()).done;){var mut=_step237.value;records.push(mut);}}catch(err){_iterator237.e(err);}finally{_iterator237.f();}if(records.length)this.queue=[];var from=-1,to=-1,typeOver=false;var _iterator238=_createForOfIteratorHelper(records),_step238;try{for(_iterator238.s();!(_step238=_iterator238.n()).done;){var record=_step238.value;var range=this.readMutation(record);if(!range)continue;if(range.typeOver)typeOver=true;if(from==-1){from=range.from;to=range.to;}else{from=Math.min(range.from,from);to=Math.max(range.to,to);}}}catch(err){_iterator238.e(err);}finally{_iterator238.f();}return{from:from,to:to,typeOver:typeOver};}// Apply pending changes, if any 4223 + },{key:"flush",value:function flush(){// Completely hold off flushing when pending keys are set—the code 4224 + // managing those will make sure processRecords is called and the 4225 + // view is resynchronized after 4226 + if(this.delayedFlush>=0||this.view.inputState.pendingAndroidKey)return;this.lastFlush=Date.now();var _this$processRecords2=this.processRecords(),from=_this$processRecords2.from,to=_this$processRecords2.to,typeOver=_this$processRecords2.typeOver;var selection=this.selectionRange;var newSel=!this.ignoreSelection.eq(selection)&&hasSelection(this.dom,selection);if(from<0&&!newSel)return;var startState=this.view.state;this.onChange(from,to,typeOver);// The view wasn't updated 4227 + if(this.view.state==startState)this.view.docView.reset(newSel);this.clearSelection();}},{key:"readMutation",value:function readMutation(rec){var cView=this.view.docView.nearest(rec.target);if(!cView||cView.ignoreMutation(rec))return null;cView.markDirty(rec.type=="attributes");if(rec.type=="attributes")cView.dirty|=4/* Attrs */;if(rec.type=="childList"){var childBefore=findChild(cView,rec.previousSibling||rec.target.previousSibling,-1);var childAfter=findChild(cView,rec.nextSibling||rec.target.nextSibling,1);return{from:childBefore?cView.posAfter(childBefore):cView.posAtStart,to:childAfter?cView.posBefore(childAfter):cView.posAtEnd,typeOver:false};}else if(rec.type=="characterData"){return{from:cView.posAtStart,to:cView.posAtEnd,typeOver:rec.target.nodeValue==rec.oldValue};}else{return null;}}},{key:"destroy",value:function destroy(){this.stop();if(this.intersection)this.intersection.disconnect();if(this.gapIntersection)this.gapIntersection.disconnect();var _iterator239=_createForOfIteratorHelper(this.scrollTargets),_step239;try{for(_iterator239.s();!(_step239=_iterator239.n()).done;){var dom=_step239.value;dom.removeEventListener("scroll",this.onScroll);}}catch(err){_iterator239.e(err);}finally{_iterator239.f();}window.removeEventListener("scroll",this.onScroll);clearTimeout(this.parentCheck);}}]);return DOMObserver;}();function findChild(cView,dom,dir){while(dom){var curView=ContentView.get(dom);if(curView&&curView.parent==cView)return curView;var parent=dom.parentNode;dom=parent!=cView.dom?parent:dir>0?dom.nextSibling:dom.previousSibling;}return null;}function safariSelectionRangeHack(view){var found=null;// Because Safari (at least in 2018-2021) doesn't provide regular 4228 + // access to the selection inside a shadowroot, we have to perform a 4229 + // ridiculous hack to get at it—using `execCommand` to trigger a 4230 + // `beforeInput` event so that we can read the target range from the 4231 + // event. 4232 + function read(event){event.preventDefault();event.stopImmediatePropagation();found=event.getTargetRanges()[0];}view.contentDOM.addEventListener("beforeinput",read,true);document.execCommand("indent");view.contentDOM.removeEventListener("beforeinput",read,true);if(!found)return null;var anchorNode=found.startContainer,anchorOffset=found.startOffset;var focusNode=found.endContainer,focusOffset=found.endOffset;var curAnchor=view.docView.domAtPos(view.state.selection.main.anchor);// Since such a range doesn't distinguish between anchor and head, 4233 + // use a heuristic that flips it around if its end matches the 4234 + // current anchor. 4235 + if(isEquivalentPosition(curAnchor.node,curAnchor.offset,focusNode,focusOffset)){var _ref82=[focusNode,focusOffset,anchorNode,anchorOffset];anchorNode=_ref82[0];anchorOffset=_ref82[1];focusNode=_ref82[2];focusOffset=_ref82[3];}return{anchorNode:anchorNode,anchorOffset:anchorOffset,focusNode:focusNode,focusOffset:focusOffset};}function applyDOMChange(view,start,end,typeOver){var change,newSel;var sel=view.state.selection.main;if(start>-1){var bounds=view.docView.domBoundsAround(start,end,0);if(!bounds||view.state.readOnly)return;var from=bounds.from,to=bounds.to;var selPoints=view.docView.impreciseHead||view.docView.impreciseAnchor?[]:selectionPoints(view);var reader=new DOMReader(selPoints,view);reader.readRange(bounds.startDOM,bounds.endDOM);newSel=selectionFromPoints(selPoints,from);var preferredPos=sel.from,preferredSide=null;// Prefer anchoring to end when Backspace is pressed (or, on 4236 + // Android, when something was deleted) 4237 + if(view.inputState.lastKeyCode===8&&view.inputState.lastKeyTime>Date.now()-100||browser.android&&reader.text.length<to-from){preferredPos=sel.to;preferredSide="end";}var diff=findDiff(view.state.sliceDoc(from,to),reader.text,preferredPos-from,preferredSide);if(diff)change={from:from+diff.from,to:from+diff.toA,insert:view.state.toText(reader.text.slice(diff.from,diff.toB))};}else if(view.hasFocus||!view.state.facet(editable)){var domSel=view.observer.selectionRange;var _view$docView2=view.docView,iHead=_view$docView2.impreciseHead,iAnchor=_view$docView2.impreciseAnchor;var head=iHead&&iHead.node==domSel.focusNode&&iHead.offset==domSel.focusOffset||!contains(view.contentDOM,domSel.focusNode)?view.state.selection.main.head:view.docView.posFromDOM(domSel.focusNode,domSel.focusOffset);var anchor=iAnchor&&iAnchor.node==domSel.anchorNode&&iAnchor.offset==domSel.anchorOffset||!contains(view.contentDOM,domSel.anchorNode)?view.state.selection.main.anchor:view.docView.posFromDOM(domSel.anchorNode,domSel.anchorOffset);if(head!=sel.head||anchor!=sel.anchor)newSel=state.EditorSelection.single(anchor,head);}if(!change&&!newSel)return;// Heuristic to notice typing over a selected character 4238 + if(!change&&typeOver&&!sel.empty&&newSel&&newSel.main.empty)change={from:sel.from,to:sel.to,insert:view.state.doc.slice(sel.from,sel.to)};// If the change is inside the selection and covers most of it, 4239 + // assume it is a selection replace (with identical characters at 4240 + // the start/end not included in the diff) 4241 + else if(change&&change.from>=sel.from&&change.to<=sel.to&&(change.from!=sel.from||change.to!=sel.to)&&sel.to-sel.from-(change.to-change.from)<=4)change={from:sel.from,to:sel.to,insert:view.state.doc.slice(sel.from,change.from).append(change.insert).append(view.state.doc.slice(change.to,sel.to))};if(change){var startState=view.state;// Android browsers don't fire reasonable key events for enter, 4242 + // backspace, or delete. So this detects changes that look like 4243 + // they're caused by those keys, and reinterprets them as key 4244 + // events. 4245 + if(browser.ios&&view.inputState.flushIOSKey(view))return;var _text4=change.insert.toString();if(view.state.facet(inputHandler).some(function(h){return h(view,change.from,change.to,_text4);}))return;if(view.inputState.composing>=0)view.inputState.composing++;var tr;if(change.from>=sel.from&&change.to<=sel.to&&change.to-change.from>=(sel.to-sel.from)/3&&(!newSel||newSel.main.empty&&newSel.main.from==change.from+change.insert.length)){var before=sel.from<change.from?startState.sliceDoc(sel.from,change.from):"";var after=sel.to>change.to?startState.sliceDoc(change.to,sel.to):"";tr=startState.replaceSelection(view.state.toText(before+change.insert.sliceString(0,undefined,view.state.lineBreak)+after));}else{var changes=startState.changes(change);tr={changes:changes,selection:newSel&&!startState.selection.main.eq(newSel.main)&&newSel.main.to<=changes.newLength?startState.selection.replaceRange(newSel.main):undefined};}var userEvent="input.type";if(view.composing){userEvent+=".compose";if(view.inputState.compositionFirstChange){userEvent+=".start";view.inputState.compositionFirstChange=false;}}view.dispatch(tr,{scrollIntoView:true,userEvent:userEvent});}else if(newSel&&!newSel.main.eq(sel)){var scrollIntoView=false,_userEvent2="select";if(view.inputState.lastSelectionTime>Date.now()-50){if(view.inputState.lastSelectionOrigin=="select")scrollIntoView=true;_userEvent2=view.inputState.lastSelectionOrigin;}view.dispatch({selection:newSel,scrollIntoView:scrollIntoView,userEvent:_userEvent2});}}function findDiff(a,b,preferredPos,preferredSide){var minLen=Math.min(a.length,b.length);var from=0;while(from<minLen&&a.charCodeAt(from)==b.charCodeAt(from)){from++;}if(from==minLen&&a.length==b.length)return null;var toA=a.length,toB=b.length;while(toA>0&&toB>0&&a.charCodeAt(toA-1)==b.charCodeAt(toB-1)){toA--;toB--;}if(preferredSide=="end"){var adjust=Math.max(0,from-Math.min(toA,toB));preferredPos-=toA+adjust-from;}if(toA<from&&a.length<b.length){var move=preferredPos<=from&&preferredPos>=toA?from-preferredPos:0;from-=move;toB=from+(toB-toA);toA=from;}else if(toB<from){var _move2=preferredPos<=from&&preferredPos>=toB?from-preferredPos:0;from-=_move2;toA=from+(toA-toB);toB=from;}return{from:from,toA:toA,toB:toB};}var DOMReader=/*#__PURE__*/function(){function DOMReader(points,view){_classCallCheck(this,DOMReader);this.points=points;this.view=view;this.text="";this.lineBreak=view.state.lineBreak;}_createClass(DOMReader,[{key:"readRange",value:function readRange(start,end){if(!start)return;var parent=start.parentNode;for(var cur=start;;){this.findPointBefore(parent,cur);this.readNode(cur);var next=cur.nextSibling;if(next==end)break;var view=ContentView.get(cur),nextView=ContentView.get(next);if(view&&nextView?view.breakAfter:(view?view.breakAfter:isBlockElement(cur))||isBlockElement(next)&&(cur.nodeName!="BR"||cur.cmIgnore))this.text+=this.lineBreak;cur=next;}this.findPointBefore(parent,end);}},{key:"readNode",value:function readNode(node){if(node.cmIgnore)return;var view=ContentView.get(node);var fromView=view&&view.overrideDOMText;var text;if(fromView!=null)text=fromView.sliceString(0,undefined,this.lineBreak);else if(node.nodeType==3)text=node.nodeValue;else if(node.nodeName=="BR")text=node.nextSibling?this.lineBreak:"";else if(node.nodeType==1)this.readRange(node.firstChild,null);if(text!=null){this.findPointIn(node,text.length);this.text+=text;// Chrome inserts two newlines when pressing shift-enter at the 4246 + // end of a line. This drops one of those. 4247 + if(browser.chrome&&this.view.inputState.lastKeyCode==13&&!node.nextSibling&&/\n\n$/.test(this.text))this.text=this.text.slice(0,-1);}}},{key:"findPointBefore",value:function findPointBefore(node,next){var _iterator240=_createForOfIteratorHelper(this.points),_step240;try{for(_iterator240.s();!(_step240=_iterator240.n()).done;){var point=_step240.value;if(point.node==node&&node.childNodes[point.offset]==next)point.pos=this.text.length;}}catch(err){_iterator240.e(err);}finally{_iterator240.f();}}},{key:"findPointIn",value:function findPointIn(node,maxLen){var _iterator241=_createForOfIteratorHelper(this.points),_step241;try{for(_iterator241.s();!(_step241=_iterator241.n()).done;){var point=_step241.value;if(point.node==node)point.pos=this.text.length+Math.min(point.offset,maxLen);}}catch(err){_iterator241.e(err);}finally{_iterator241.f();}}}]);return DOMReader;}();function isBlockElement(node){return node.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(node.nodeName);}var DOMPoint=/*#__PURE__*/_createClass(function DOMPoint(node,offset){_classCallCheck(this,DOMPoint);this.node=node;this.offset=offset;this.pos=-1;});function selectionPoints(view){var result=[];if(view.root.activeElement!=view.contentDOM)return result;var _view$observer$select2=view.observer.selectionRange,anchorNode=_view$observer$select2.anchorNode,anchorOffset=_view$observer$select2.anchorOffset,focusNode=_view$observer$select2.focusNode,focusOffset=_view$observer$select2.focusOffset;if(anchorNode){result.push(new DOMPoint(anchorNode,anchorOffset));if(focusNode!=anchorNode||focusOffset!=anchorOffset)result.push(new DOMPoint(focusNode,focusOffset));}return result;}function selectionFromPoints(points,base){if(points.length==0)return null;var anchor=points[0].pos,head=points.length==2?points[1].pos:anchor;return anchor>-1&&head>-1?state.EditorSelection.single(anchor+base,head+base):null;}// The editor's update state machine looks something like this: 4248 + // 4249 + // Idle → Updating ⇆ Idle (unchecked) → Measuring → Idle 4250 + // ↑ ↓ 4251 + // Updating (measure) 4252 + // 4253 + // The difference between 'Idle' and 'Idle (unchecked)' lies in 4254 + // whether a layout check has been scheduled. A regular update through 4255 + // the `update` method updates the DOM in a write-only fashion, and 4256 + // relies on a check (scheduled with `requestAnimationFrame`) to make 4257 + // sure everything is where it should be and the viewport covers the 4258 + // visible code. That check continues to measure and then optionally 4259 + // update until it reaches a coherent state. 4260 + /** 4261 + An editor view represents the editor's user interface. It holds 4262 + the editable DOM surface, and possibly other elements such as the 4263 + line number gutter. It handles events and dispatches state 4264 + transactions for editing actions. 4265 + */var EditorView=/*#__PURE__*/function(){/** 4266 + Construct a new view. You'll usually want to put `view.dom` into 4267 + your document after creating a view, so that the user can see 4268 + it. 4269 + */function EditorView(){var _this124=this;var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,EditorView);this.plugins=[];this.editorAttrs={};this.contentAttrs={};this.bidiCache=[];this.destroyed=false;/** 4270 + @internal 4271 + */this.updateState=2/* Updating */;/** 4272 + @internal 4273 + */this.measureScheduled=-1;/** 4274 + @internal 4275 + */this.measureRequests=[];this.contentDOM=document.createElement("div");this.scrollDOM=document.createElement("div");this.scrollDOM.tabIndex=-1;this.scrollDOM.className="cm-scroller";this.scrollDOM.appendChild(this.contentDOM);this.announceDOM=document.createElement("div");this.announceDOM.style.cssText="position: absolute; top: -10000px";this.announceDOM.setAttribute("aria-live","polite");this.dom=document.createElement("div");this.dom.appendChild(this.announceDOM);this.dom.appendChild(this.scrollDOM);this._dispatch=config.dispatch||function(tr){return _this124.update([tr]);};this.dispatch=this.dispatch.bind(this);this.root=config.root||getRoot(config.parent)||document;this.viewState=new ViewState(config.state||state.EditorState.create());this.plugins=this.state.facet(viewPlugin).map(function(spec){return new PluginInstance(spec).update(_this124);});this.observer=new DOMObserver(this,function(from,to,typeOver){applyDOMChange(_this124,from,to,typeOver);},function(event){_this124.inputState.runScrollHandlers(_this124,event);if(_this124.observer.intersecting)_this124.measure();});this.inputState=new InputState(this);this.docView=new DocView(this);this.mountStyles();this.updateAttrs();this.updateState=0/* Idle */;ensureGlobalHandler();this.requestMeasure();if(config.parent)config.parent.appendChild(this.dom);}/** 4276 + The current editor state. 4277 + */_createClass(EditorView,[{key:"state",get:function get(){return this.viewState.state;}/** 4278 + To be able to display large documents without consuming too much 4279 + memory or overloading the browser, CodeMirror only draws the 4280 + code that is visible (plus a margin around it) to the DOM. This 4281 + property tells you the extent of the current drawn viewport, in 4282 + document positions. 4283 + */},{key:"viewport",get:function get(){return this.viewState.viewport;}/** 4284 + When there are, for example, large collapsed ranges in the 4285 + viewport, its size can be a lot bigger than the actual visible 4286 + content. Thus, if you are doing something like styling the 4287 + content in the viewport, it is preferable to only do so for 4288 + these ranges, which are the subset of the viewport that is 4289 + actually drawn. 4290 + */},{key:"visibleRanges",get:function get(){return this.viewState.visibleRanges;}/** 4291 + Returns false when the editor is entirely scrolled out of view 4292 + or otherwise hidden. 4293 + */},{key:"inView",get:function get(){return this.viewState.inView;}/** 4294 + Indicates whether the user is currently composing text via 4295 + [IME](https://en.wikipedia.org/wiki/Input_method). 4296 + */},{key:"composing",get:function get(){return this.inputState.composing>0;}},{key:"dispatch",value:function dispatch(){var _this$state2;this._dispatch(arguments.length==1&&(arguments.length<=0?undefined:arguments[0])instanceof state.Transaction?arguments.length<=0?undefined:arguments[0]:(_this$state2=this.state).update.apply(_this$state2,arguments));}/** 4297 + Update the view for the given array of transactions. This will 4298 + update the visible document and selection to match the state 4299 + produced by the transactions, and notify view plugins of the 4300 + change. You should usually call 4301 + [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this 4302 + as a primitive. 4303 + */},{key:"update",value:function update(transactions){if(this.updateState!=0/* Idle */)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");var redrawn=false,update;var state$1=this.state;var _iterator242=_createForOfIteratorHelper(transactions),_step242;try{for(_iterator242.s();!(_step242=_iterator242.n()).done;){var _tr3=_step242.value;if(_tr3.startState!=state$1)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");state$1=_tr3.state;}}catch(err){_iterator242.e(err);}finally{_iterator242.f();}if(this.destroyed){this.viewState.state=state$1;return;}// When the phrases change, redraw the editor 4304 + if(state$1.facet(state.EditorState.phrases)!=this.state.facet(state.EditorState.phrases))return this.setState(state$1);update=new ViewUpdate(this,state$1,transactions);var scrollTarget=null;try{this.updateState=2/* Updating */;var _iterator243=_createForOfIteratorHelper(transactions),_step243;try{for(_iterator243.s();!(_step243=_iterator243.n()).done;){var tr=_step243.value;if(scrollTarget)scrollTarget=scrollTarget.map(tr.changes);if(tr.scrollIntoView){var main=tr.state.selection.main;scrollTarget=new ScrollTarget(main.empty?main:state.EditorSelection.cursor(main.head,main.head>main.anchor?-1:1));}var _iterator244=_createForOfIteratorHelper(tr.effects),_step244;try{for(_iterator244.s();!(_step244=_iterator244.n()).done;){var e=_step244.value;if(e.is(scrollTo))scrollTarget=new ScrollTarget(e.value);else if(e.is(centerOn))scrollTarget=new ScrollTarget(e.value,true);}}catch(err){_iterator244.e(err);}finally{_iterator244.f();}}}catch(err){_iterator243.e(err);}finally{_iterator243.f();}this.viewState.update(update,scrollTarget);this.bidiCache=CachedOrder.update(this.bidiCache,update.changes);if(!update.empty){this.updatePlugins(update);this.inputState.update(update);}redrawn=this.docView.update(update);if(this.state.facet(styleModule)!=this.styleModules)this.mountStyles();this.updateAttrs();this.showAnnouncements(transactions);}finally{this.updateState=0/* Idle */;}if(redrawn||scrollTarget||this.viewState.mustEnforceCursorAssoc)this.requestMeasure();if(!update.empty){var _iterator245=_createForOfIteratorHelper(this.state.facet(updateListener)),_step245;try{for(_iterator245.s();!(_step245=_iterator245.n()).done;){var listener=_step245.value;listener(update);}}catch(err){_iterator245.e(err);}finally{_iterator245.f();}}}/** 4305 + Reset the view to the given state. (This will cause the entire 4306 + document to be redrawn and all view plugins to be reinitialized, 4307 + so you should probably only use it when the new state isn't 4308 + derived from the old state. Otherwise, use 4309 + [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.) 4310 + */},{key:"setState",value:function setState(newState){var _this125=this;if(this.updateState!=0/* Idle */)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=newState;return;}this.updateState=2/* Updating */;try{var _iterator246=_createForOfIteratorHelper(this.plugins),_step246;try{for(_iterator246.s();!(_step246=_iterator246.n()).done;){var _plugin11=_step246.value;_plugin11.destroy(this);}}catch(err){_iterator246.e(err);}finally{_iterator246.f();}this.viewState=new ViewState(newState);this.plugins=newState.facet(viewPlugin).map(function(spec){return new PluginInstance(spec).update(_this125);});this.docView=new DocView(this);this.inputState.ensureHandlers(this);this.mountStyles();this.updateAttrs();this.bidiCache=[];}finally{this.updateState=0/* Idle */;}this.requestMeasure();}},{key:"updatePlugins",value:function updatePlugins(update){var prevSpecs=update.startState.facet(viewPlugin),specs=update.state.facet(viewPlugin);if(prevSpecs!=specs){var newPlugins=[];var _iterator247=_createForOfIteratorHelper(specs),_step247;try{for(_iterator247.s();!(_step247=_iterator247.n()).done;){var spec=_step247.value;var found=prevSpecs.indexOf(spec);if(found<0){newPlugins.push(new PluginInstance(spec));}else{var _plugin12=this.plugins[found];_plugin12.mustUpdate=update;newPlugins.push(_plugin12);}}}catch(err){_iterator247.e(err);}finally{_iterator247.f();}var _iterator248=_createForOfIteratorHelper(this.plugins),_step248;try{for(_iterator248.s();!(_step248=_iterator248.n()).done;){var _plugin13=_step248.value;if(_plugin13.mustUpdate!=update)_plugin13.destroy(this);}}catch(err){_iterator248.e(err);}finally{_iterator248.f();}this.plugins=newPlugins;this.inputState.ensureHandlers(this);}else{var _iterator249=_createForOfIteratorHelper(this.plugins),_step249;try{for(_iterator249.s();!(_step249=_iterator249.n()).done;){var _p4=_step249.value;_p4.mustUpdate=update;}}catch(err){_iterator249.e(err);}finally{_iterator249.f();}}for(var _i178=0;_i178<this.plugins.length;_i178++){this.plugins[_i178]=this.plugins[_i178].update(this);}}/** 4311 + @internal 4312 + */},{key:"measure",value:function measure(){var _this126=this;var flush=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;if(this.destroyed)return;if(this.measureScheduled>-1)cancelAnimationFrame(this.measureScheduled);this.measureScheduled=-1;// Prevent requestMeasure calls from scheduling another animation frame 4313 + if(flush)this.observer.flush();var updated=null;try{for(var _i179=0;;_i179++){this.updateState=1/* Measuring */;var oldViewport=this.viewport;var changed=this.viewState.measure(this.docView,_i179>0);if(!changed&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(_i179>5){console.warn("Viewport failed to stabilize");break;}var measuring=[];// Only run measure requests in this cycle when the viewport didn't change 4314 + if(!(changed&4/* Viewport */)){var _ref83=[measuring,this.measureRequests];this.measureRequests=_ref83[0];measuring=_ref83[1];}var measured=measuring.map(function(m){try{return m.read(_this126);}catch(e){logException(_this126.state,e);return BadMeasure;}});var update=new ViewUpdate(this,this.state);update.flags|=changed;if(!updated)updated=update;else updated.flags|=changed;this.updateState=2/* Updating */;if(!update.empty){this.updatePlugins(update);this.inputState.update(update);}this.updateAttrs();if(changed)this.docView.update(update);for(var _i180=0;_i180<measuring.length;_i180++){if(measured[_i180]!=BadMeasure){try{measuring[_i180].write(measured[_i180],this);}catch(e){logException(this.state,e);}}}if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget);this.viewState.scrollTarget=null;}if(this.viewport.from==oldViewport.from&&this.viewport.to==oldViewport.to&&this.measureRequests.length==0)break;}}finally{this.updateState=0/* Idle */;}this.measureScheduled=-1;if(updated&&!updated.empty){var _iterator250=_createForOfIteratorHelper(this.state.facet(updateListener)),_step250;try{for(_iterator250.s();!(_step250=_iterator250.n()).done;){var listener=_step250.value;listener(updated);}}catch(err){_iterator250.e(err);}finally{_iterator250.f();}}}/** 4315 + Get the CSS classes for the currently active editor themes. 4316 + */},{key:"themeClasses",get:function get(){return baseThemeID+" "+(this.state.facet(darkTheme)?baseDarkID:baseLightID)+" "+this.state.facet(_theme2);}},{key:"updateAttrs",value:function updateAttrs(){var editorAttrs=combineAttrs(this.state.facet(editorAttributes),{"class":"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses});_updateAttrs2(this.dom,this.editorAttrs,editorAttrs);this.editorAttrs=editorAttrs;var contentAttrs={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:!this.state.facet(editable)?"false":"true","class":"cm-content",style:"".concat(browser.tabSize,": ").concat(this.state.tabSize),role:"textbox","aria-multiline":"true"};if(this.state.readOnly)contentAttrs["aria-readonly"]="true";combineAttrs(this.state.facet(contentAttributes),contentAttrs);_updateAttrs2(this.contentDOM,this.contentAttrs,contentAttrs);this.contentAttrs=contentAttrs;}},{key:"showAnnouncements",value:function showAnnouncements(trs){var first=true;var _iterator251=_createForOfIteratorHelper(trs),_step251;try{for(_iterator251.s();!(_step251=_iterator251.n()).done;){var tr=_step251.value;var _iterator252=_createForOfIteratorHelper(tr.effects),_step252;try{for(_iterator252.s();!(_step252=_iterator252.n()).done;){var effect=_step252.value;if(effect.is(EditorView.announce)){if(first)this.announceDOM.textContent="";first=false;var div=this.announceDOM.appendChild(document.createElement("div"));div.textContent=effect.value;}}}catch(err){_iterator252.e(err);}finally{_iterator252.f();}}}catch(err){_iterator251.e(err);}finally{_iterator251.f();}}},{key:"mountStyles",value:function mountStyles(){this.styleModules=this.state.facet(styleModule);styleMod.StyleModule.mount(this.root,this.styleModules.concat(baseTheme).reverse());}},{key:"readMeasured",value:function readMeasured(){if(this.updateState==2/* Updating */)throw new Error("Reading the editor layout isn't allowed during an update");if(this.updateState==0/* Idle */&&this.measureScheduled>-1)this.measure(false);}/** 4317 + Schedule a layout measurement, optionally providing callbacks to 4318 + do custom DOM measuring followed by a DOM write phase. Using 4319 + this is preferable reading DOM layout directly from, for 4320 + example, an event handler, because it'll make sure measuring and 4321 + drawing done by other components is synchronized, avoiding 4322 + unnecessary DOM layout computations. 4323 + */},{key:"requestMeasure",value:function requestMeasure(request){var _this127=this;if(this.measureScheduled<0)this.measureScheduled=requestAnimationFrame(function(){return _this127.measure();});if(request){if(request.key!=null)for(var _i181=0;_i181<this.measureRequests.length;_i181++){if(this.measureRequests[_i181].key===request.key){this.measureRequests[_i181]=request;return;}}this.measureRequests.push(request);}}/** 4324 + Collect all values provided by the active plugins for a given 4325 + field. 4326 + */},{key:"pluginField",value:function pluginField(field){var result=[];var _iterator253=_createForOfIteratorHelper(this.plugins),_step253;try{for(_iterator253.s();!(_step253=_iterator253.n()).done;){var _plugin14=_step253.value;_plugin14.update(this).takeField(field,result);}}catch(err){_iterator253.e(err);}finally{_iterator253.f();}return result;}/** 4327 + Get the value of a specific plugin, if present. Note that 4328 + plugins that crash can be dropped from a view, so even when you 4329 + know you registered a given plugin, it is recommended to check 4330 + the return value of this method. 4331 + */},{key:"plugin",value:function plugin(_plugin10){var _iterator254=_createForOfIteratorHelper(this.plugins),_step254;try{for(_iterator254.s();!(_step254=_iterator254.n()).done;){var inst=_step254.value;if(inst.spec==_plugin10)return inst.update(this).value;}}catch(err){_iterator254.e(err);}finally{_iterator254.f();}return null;}/** 4332 + Find the line or block widget at the given vertical position. 4333 + 4334 + By default, this position is interpreted as a screen position, 4335 + meaning `docTop` is set to the DOM top position of the editor 4336 + content (forcing a layout). You can pass a different `docTop` 4337 + value—for example 0 to interpret `height` as a document-relative 4338 + position, or a precomputed document top 4339 + (`view.contentDOM.getBoundingClientRect().top`) to limit layout 4340 + queries. 4341 + */},{key:"blockAtHeight",value:function blockAtHeight(height,docTop){this.readMeasured();return this.viewState.blockAtHeight(height,ensureTop(docTop,this.contentDOM));}/** 4342 + Find information for the visual line (see 4343 + [`visualLineAt`](https://codemirror.net/6/docs/ref/#view.EditorView.visualLineAt)) at the given 4344 + vertical position. The resulting block info might hold another 4345 + array of block info structs in its `type` field if this line 4346 + consists of more than one block. 4347 + 4348 + Defaults to treating `height` as a screen position. See 4349 + [`blockAtHeight`](https://codemirror.net/6/docs/ref/#view.EditorView.blockAtHeight) for the 4350 + interpretation of the `docTop` parameter. 4351 + */},{key:"visualLineAtHeight",value:function visualLineAtHeight(height,docTop){this.readMeasured();return this.viewState.lineAtHeight(height,ensureTop(docTop,this.contentDOM));}/** 4352 + Iterate over the height information of the visual lines in the 4353 + viewport. The heights of lines are reported relative to the 4354 + given document top, which defaults to the screen position of the 4355 + document (forcing a layout). 4356 + */},{key:"viewportLines",value:function viewportLines(f,docTop){var _this$viewport=this.viewport,from=_this$viewport.from,to=_this$viewport.to;this.viewState.forEachLine(from,to,f,ensureTop(docTop,this.contentDOM));}/** 4357 + Find the extent and height of the visual line (a range delimited 4358 + on both sides by either non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^range) 4359 + line breaks, or the start/end of the document) at the given position. 4360 + 4361 + Vertical positions are computed relative to the `docTop` 4362 + argument, which defaults to 0 for this method. You can pass 4363 + `view.contentDOM.getBoundingClientRect().top` here to get screen 4364 + coordinates. 4365 + */},{key:"visualLineAt",value:function visualLineAt(pos){var docTop=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.viewState.lineAt(pos,docTop);}/** 4366 + The editor's total content height. 4367 + */},{key:"contentHeight",get:function get(){return this.viewState.contentHeight;}/** 4368 + Move a cursor position by [grapheme 4369 + cluster](https://codemirror.net/6/docs/ref/#text.findClusterBreak). `forward` determines whether 4370 + the motion is away from the line start, or towards it. Motion in 4371 + bidirectional text is in visual order, in the editor's [text 4372 + direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). When the start 4373 + position was the last one on the line, the returned position 4374 + will be across the line break. If there is no further line, the 4375 + original position is returned. 4376 + 4377 + By default, this method moves over a single cluster. The 4378 + optional `by` argument can be used to move across more. It will 4379 + be called with the first cluster as argument, and should return 4380 + a predicate that determines, for each subsequent cluster, 4381 + whether it should also be moved over. 4382 + */},{key:"moveByChar",value:function moveByChar(start,forward,by){return skipAtoms(this,start,_moveByChar2(this,start,forward,by));}/** 4383 + Move a cursor position across the next group of either 4384 + [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter 4385 + non-whitespace characters. 4386 + */},{key:"moveByGroup",value:function moveByGroup(start,forward){var _this128=this;return skipAtoms(this,start,_moveByChar2(this,start,forward,function(initial){return byGroup(_this128,start.head,initial);}));}/** 4387 + Move to the next line boundary in the given direction. If 4388 + `includeWrap` is true, line wrapping is on, and there is a 4389 + further wrap point on the current line, the wrap point will be 4390 + returned. Otherwise this function will return the start or end 4391 + of the line. 4392 + */},{key:"moveToLineBoundary",value:function moveToLineBoundary(start,forward){var includeWrap=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;return _moveToLineBoundary2(this,start,forward,includeWrap);}/** 4393 + Move a cursor position vertically. When `distance` isn't given, 4394 + it defaults to moving to the next line (including wrapped 4395 + lines). Otherwise, `distance` should provide a positive distance 4396 + in pixels. 4397 + 4398 + When `start` has a 4399 + [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical 4400 + motion will use that as a target horizontal position. Otherwise, 4401 + the cursor's own horizontal position is used. The returned 4402 + cursor will have its goal column set to whichever column was 4403 + used. 4404 + */},{key:"moveVertically",value:function moveVertically(start,forward,distance){return skipAtoms(this,start,_moveVertically2(this,start,forward,distance));}// FIXME remove on next major version 4405 + },{key:"scrollPosIntoView",value:function scrollPosIntoView(pos){this.dispatch({effects:scrollTo.of(state.EditorSelection.cursor(pos))});}/** 4406 + Find the DOM parent node and offset (child offset if `node` is 4407 + an element, character offset when it is a text node) at the 4408 + given document position. 4409 + */},{key:"domAtPos",value:function domAtPos(pos){return this.docView.domAtPos(pos);}/** 4410 + Find the document position at the given DOM node. Can be useful 4411 + for associating positions with DOM events. Will raise an error 4412 + when `node` isn't part of the editor content. 4413 + */},{key:"posAtDOM",value:function posAtDOM(node){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return this.docView.posFromDOM(node,offset);}},{key:"posAtCoords",value:function posAtCoords(coords){var precise=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;this.readMeasured();return _posAtCoords2(this,coords,precise);}/** 4414 + Get the screen coordinates at the given document position. 4415 + `side` determines whether the coordinates are based on the 4416 + element before (-1) or after (1) the position (if no element is 4417 + available on the given side, the method will transparently use 4418 + another strategy to get reasonable coordinates). 4419 + */},{key:"coordsAtPos",value:function coordsAtPos(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;this.readMeasured();var rect=this.docView.coordsAt(pos,side);if(!rect||rect.left==rect.right)return rect;var line=this.state.doc.lineAt(pos),order=this.bidiSpans(line);var span=order[BidiSpan.find(order,pos-line.from,-1,side)];return flattenRect(rect,span.dir==exports.Direction.LTR==side>0);}/** 4420 + The default width of a character in the editor. May not 4421 + accurately reflect the width of all characters (given variable 4422 + width fonts or styling of invididual ranges). 4423 + */},{key:"defaultCharacterWidth",get:function get(){return this.viewState.heightOracle.charWidth;}/** 4424 + The default height of a line in the editor. May not be accurate 4425 + for all lines. 4426 + */},{key:"defaultLineHeight",get:function get(){return this.viewState.heightOracle.lineHeight;}/** 4427 + The text direction 4428 + ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction) 4429 + CSS property) of the editor. 4430 + */},{key:"textDirection",get:function get(){return this.viewState.heightOracle.direction;}/** 4431 + Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping) 4432 + (as determined by the 4433 + [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space) 4434 + CSS property of its content element). 4435 + */},{key:"lineWrapping",get:function get(){return this.viewState.heightOracle.lineWrapping;}/** 4436 + Returns the bidirectional text structure of the given line 4437 + (which should be in the current document) as an array of span 4438 + objects. The order of these spans matches the [text 4439 + direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)—if that is 4440 + left-to-right, the leftmost spans come first, otherwise the 4441 + rightmost spans come first. 4442 + */},{key:"bidiSpans",value:function bidiSpans(line){if(line.length>MaxBidiLine)return trivialOrder(line.length);var dir=this.textDirection;var _iterator255=_createForOfIteratorHelper(this.bidiCache),_step255;try{for(_iterator255.s();!(_step255=_iterator255.n()).done;){var entry=_step255.value;if(entry.from==line.from&&entry.dir==dir)return entry.order;}}catch(err){_iterator255.e(err);}finally{_iterator255.f();}var order=computeOrder(line.text,this.textDirection);this.bidiCache.push(new CachedOrder(line.from,line.to,dir,order));return order;}/** 4443 + Check whether the editor has focus. 4444 + */},{key:"hasFocus",get:function get(){var _a;// Safari return false for hasFocus when the context menu is open 4445 + // or closing, which leads us to ignore selection changes from the 4446 + // context menu because it looks like the editor isn't focused. 4447 + // This kludges around that. 4448 + return(document.hasFocus()||browser.safari&&((_a=this.inputState)===null||_a===void 0?void 0:_a.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM;}/** 4449 + Put focus on the editor. 4450 + */},{key:"focus",value:function focus(){var _this129=this;this.observer.ignore(function(){focusPreventScroll(_this129.contentDOM);_this129.docView.updateSelection();});}/** 4451 + Clean up this editor view, removing its element from the 4452 + document, unregistering event handlers, and notifying 4453 + plugins. The view instance can no longer be used after 4454 + calling this. 4455 + */},{key:"destroy",value:function destroy(){var _iterator256=_createForOfIteratorHelper(this.plugins),_step256;try{for(_iterator256.s();!(_step256=_iterator256.n()).done;){var _plugin15=_step256.value;_plugin15.destroy(this);}}catch(err){_iterator256.e(err);}finally{_iterator256.f();}this.plugins=[];this.inputState.destroy();this.dom.remove();this.observer.destroy();if(this.measureScheduled>-1)cancelAnimationFrame(this.measureScheduled);this.destroyed=true;}/** 4456 + Facet that can be used to add DOM event handlers. The value 4457 + should be an object mapping event names to handler functions. The 4458 + first such function to return true will be assumed to have handled 4459 + that event, and no other handlers or built-in behavior will be 4460 + activated for it. 4461 + These are registered on the [content 4462 + element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except for `scroll` 4463 + handlers, which will be called any time the editor's [scroll 4464 + element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of its parent nodes 4465 + is scrolled. 4466 + */}],[{key:"domEventHandlers",value:function domEventHandlers(handlers){return ViewPlugin.define(function(){return{};},{eventHandlers:handlers});}/** 4467 + Create a theme extension. The first argument can be a 4468 + [`style-mod`](https://github.com/marijnh/style-mod#documentation) 4469 + style spec providing the styles for the theme. These will be 4470 + prefixed with a generated class for the style. 4471 + 4472 + Because the selectors will be prefixed with a scope class, rule 4473 + that directly match the editor's [wrapper 4474 + element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)—to which the scope class will be 4475 + added—need to be explicitly differentiated by adding an `&` to 4476 + the selector for that element—for example 4477 + `&.cm-focused`. 4478 + 4479 + When `dark` is set to true, the theme will be marked as dark, 4480 + which will cause the `&dark` rules from [base 4481 + themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to 4482 + `&light` when a light theme is active). 4483 + */},{key:"theme",value:function theme(spec,options){var prefix=styleMod.StyleModule.newName();var result=[_theme2.of(prefix),styleModule.of(buildTheme(".".concat(prefix),spec))];if(options&&options.dark)result.push(darkTheme.of(true));return result;}/** 4484 + Create an extension that adds styles to the base theme. Like 4485 + with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the 4486 + place of the editor wrapper element when directly targeting 4487 + that. You can also use `&dark` or `&light` instead to only 4488 + target editors with a dark or light theme. 4489 + */},{key:"baseTheme",value:function baseTheme(spec){return state.Prec.lowest(styleModule.of(buildTheme("."+baseThemeID,spec,lightDarkIDs)));}}]);return EditorView;}();/** 4490 + Effect that can be [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a 4491 + transaction to make it scroll the given range into view. 4492 + */EditorView.scrollTo=scrollTo;/** 4493 + Effect that makes the editor scroll the given range to the 4494 + center of the visible view. 4495 + */EditorView.centerOn=centerOn;/** 4496 + Facet to add a [style 4497 + module](https://github.com/marijnh/style-mod#documentation) to 4498 + an editor view. The view will ensure that the module is 4499 + mounted in its [document 4500 + root](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.root). 4501 + */EditorView.styleModule=styleModule;/** 4502 + An input handler can override the way changes to the editable 4503 + DOM content are handled. Handlers are passed the document 4504 + positions between which the change was found, and the new 4505 + content. When one returns true, no further input handlers are 4506 + called and the default behavior is prevented. 4507 + */EditorView.inputHandler=inputHandler;/** 4508 + Allows you to provide a function that should be called when the 4509 + library catches an exception from an extension (mostly from view 4510 + plugins, but may be used by other extensions to route exceptions 4511 + from user-code-provided callbacks). This is mostly useful for 4512 + debugging and logging. See [`logException`](https://codemirror.net/6/docs/ref/#view.logException). 4513 + */EditorView.exceptionSink=exceptionSink;/** 4514 + A facet that can be used to register a function to be called 4515 + every time the view updates. 4516 + */EditorView.updateListener=updateListener;/** 4517 + Facet that controls whether the editor content DOM is editable. 4518 + When its highest-precedence value is `false`, the element will 4519 + not longer have its `contenteditable` attribute set. (Note that 4520 + this doesn't affect API calls that change the editor content, 4521 + even when those are bound to keys or buttons. See the 4522 + [`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) facet for that.) 4523 + */EditorView.editable=editable;/** 4524 + Allows you to influence the way mouse selection happens. The 4525 + functions in this facet will be called for a `mousedown` event 4526 + on the editor, and can return an object that overrides the way a 4527 + selection is computed from that mouse click or drag. 4528 + */EditorView.mouseSelectionStyle=mouseSelectionStyle;/** 4529 + Facet used to configure whether a given selection drag event 4530 + should move or copy the selection. The given predicate will be 4531 + called with the `mousedown` event, and can return `true` when 4532 + the drag should move the content. 4533 + */EditorView.dragMovesSelection=dragMovesSelection$1;/** 4534 + Facet used to configure whether a given selecting click adds 4535 + a new range to the existing selection or replaces it entirely. 4536 + */EditorView.clickAddsSelectionRange=clickAddsSelectionRange;/** 4537 + A facet that determines which [decorations](https://codemirror.net/6/docs/ref/#view.Decoration) 4538 + are shown in the view. See also [view 4539 + plugins](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), which have a separate 4540 + mechanism for providing decorations. 4541 + */EditorView.decorations=decorations;/** 4542 + Facet that provides additional DOM attributes for the editor's 4543 + editable DOM element. 4544 + */EditorView.contentAttributes=contentAttributes;/** 4545 + Facet that provides DOM attributes for the editor's outer 4546 + element. 4547 + */EditorView.editorAttributes=editorAttributes;/** 4548 + An extension that enables line wrapping in the editor (by 4549 + setting CSS `white-space` to `pre-wrap` in the content). 4550 + */EditorView.lineWrapping=EditorView.contentAttributes.of({"class":"cm-lineWrapping"});/** 4551 + State effect used to include screen reader announcements in a 4552 + transaction. These will be added to the DOM in a visually hidden 4553 + element with `aria-live="polite"` set, and should be used to 4554 + describe effects that are visually obvious but may not be 4555 + noticed by screen reader users (such as moving to the next 4556 + search match). 4557 + */EditorView.announce=state.StateEffect.define();// Maximum line length for which we compute accurate bidi info 4558 + var MaxBidiLine=4096;function ensureTop(given,dom){return given==null?dom.getBoundingClientRect().top:given;}var resizeDebounce=-1;function ensureGlobalHandler(){window.addEventListener("resize",function(){if(resizeDebounce==-1)resizeDebounce=setTimeout(handleResize,50);});}function handleResize(){resizeDebounce=-1;var found=document.querySelectorAll(".cm-content");for(var _i182=0;_i182<found.length;_i182++){var docView=ContentView.get(found[_i182]);if(docView)docView.editorView.requestMeasure();}}var BadMeasure={};var CachedOrder=/*#__PURE__*/function(){function CachedOrder(from,to,dir,order){_classCallCheck(this,CachedOrder);this.from=from;this.to=to;this.dir=dir;this.order=order;}_createClass(CachedOrder,null,[{key:"update",value:function update(cache,changes){if(changes.empty)return cache;var result=[],lastDir=cache.length?cache[cache.length-1].dir:exports.Direction.LTR;for(var _i183=Math.max(0,cache.length-10);_i183<cache.length;_i183++){var entry=cache[_i183];if(entry.dir==lastDir&&!changes.touchesRange(entry.from,entry.to))result.push(new CachedOrder(changes.mapPos(entry.from,1),changes.mapPos(entry.to,-1),entry.dir,entry.order));}return result;}}]);return CachedOrder;}();var currentPlatform=browser.mac?"mac":browser.windows?"win":browser.linux?"linux":"key";function normalizeKeyName(name,platform){var parts=name.split(/-(?!$)/);var result=parts[parts.length-1];if(result=="Space")result=" ";var alt,ctrl,shift,meta;for(var _i184=0;_i184<parts.length-1;++_i184){var mod=parts[_i184];if(/^(cmd|meta|m)$/i.test(mod))meta=true;else if(/^a(lt)?$/i.test(mod))alt=true;else if(/^(c|ctrl|control)$/i.test(mod))ctrl=true;else if(/^s(hift)?$/i.test(mod))shift=true;else if(/^mod$/i.test(mod)){if(platform=="mac")meta=true;else ctrl=true;}else throw new Error("Unrecognized modifier name: "+mod);}if(alt)result="Alt-"+result;if(ctrl)result="Ctrl-"+result;if(meta)result="Meta-"+result;if(shift)result="Shift-"+result;return result;}function modifiers(name,event,shift){if(event.altKey)name="Alt-"+name;if(event.ctrlKey)name="Ctrl-"+name;if(event.metaKey)name="Meta-"+name;if(shift!==false&&event.shiftKey)name="Shift-"+name;return name;}var handleKeyEvents=EditorView.domEventHandlers({keydown:function keydown(event,view){return runHandlers(getKeymap(view.state),event,view,"editor");}});/** 4559 + Facet used for registering keymaps. 4560 + 4561 + You can add multiple keymaps to an editor. Their priorities 4562 + determine their precedence (the ones specified early or with high 4563 + priority get checked first). When a handler has returned `true` 4564 + for a given key, no further handlers are called. 4565 + */var keymap=state.Facet.define({enables:handleKeyEvents});var Keymaps=new WeakMap();// This is hidden behind an indirection, rather than directly computed 4566 + // by the facet, to keep internal types out of the facet's type. 4567 + function getKeymap(state){var bindings=state.facet(keymap);var map=Keymaps.get(bindings);if(!map)Keymaps.set(bindings,map=buildKeymap(bindings.reduce(function(a,b){return a.concat(b);},[])));return map;}/** 4568 + Run the key handlers registered for a given scope. The event 4569 + object should be `"keydown"` event. Returns true if any of the 4570 + handlers handled it. 4571 + */function runScopeHandlers(view,event,scope){return runHandlers(getKeymap(view.state),event,view,scope);}var storedPrefix=null;var PrefixTimeout=4000;function buildKeymap(bindings){var platform=arguments.length>1&&arguments[1]!==undefined?arguments[1]:currentPlatform;var bound=Object.create(null);var isPrefix=Object.create(null);var checkPrefix=function checkPrefix(name,is){var current=isPrefix[name];if(current==null)isPrefix[name]=is;else if(current!=is)throw new Error("Key binding "+name+" is used both as a regular binding and as a multi-stroke prefix");};var add=function add(scope,key,command,preventDefault){var scopeObj=bound[scope]||(bound[scope]=Object.create(null));var parts=key.split(/ (?!$)/).map(function(k){return normalizeKeyName(k,platform);});var _loop26=function _loop26(_i185){var prefix=parts.slice(0,_i185).join(" ");checkPrefix(prefix,true);if(!scopeObj[prefix])scopeObj[prefix]={preventDefault:true,commands:[function(view){var ourObj=storedPrefix={view:view,prefix:prefix,scope:scope};setTimeout(function(){if(storedPrefix==ourObj)storedPrefix=null;},PrefixTimeout);return true;}]};};for(var _i185=1;_i185<parts.length;_i185++){_loop26(_i185);}var full=parts.join(" ");checkPrefix(full,false);var binding=scopeObj[full]||(scopeObj[full]={preventDefault:false,commands:[]});binding.commands.push(command);if(preventDefault)binding.preventDefault=true;};var _iterator257=_createForOfIteratorHelper(bindings),_step257;try{for(_iterator257.s();!(_step257=_iterator257.n()).done;){var b=_step257.value;var name=b[platform]||b.key;if(!name)continue;var _iterator258=_createForOfIteratorHelper(b.scope?b.scope.split(" "):["editor"]),_step258;try{for(_iterator258.s();!(_step258=_iterator258.n()).done;){var scope=_step258.value;add(scope,name,b.run,b.preventDefault);if(b.shift)add(scope,"Shift-"+name,b.shift,b.preventDefault);}}catch(err){_iterator258.e(err);}finally{_iterator258.f();}}}catch(err){_iterator257.e(err);}finally{_iterator257.f();}return bound;}function runHandlers(map,event,view,scope){var name=w3cKeyname.keyName(event),isChar=name.length==1&&name!=" ";var prefix="",fallthrough=false;if(storedPrefix&&storedPrefix.view==view&&storedPrefix.scope==scope){prefix=storedPrefix.prefix+" ";if(fallthrough=modifierCodes.indexOf(event.keyCode)<0)storedPrefix=null;}var runFor=function runFor(binding){if(binding){var _iterator259=_createForOfIteratorHelper(binding.commands),_step259;try{for(_iterator259.s();!(_step259=_iterator259.n()).done;){var cmd=_step259.value;if(cmd(view))return true;}}catch(err){_iterator259.e(err);}finally{_iterator259.f();}if(binding.preventDefault)fallthrough=true;}return false;};var scopeObj=map[scope],baseName;if(scopeObj){if(runFor(scopeObj[prefix+modifiers(name,event,!isChar)]))return true;if(isChar&&(event.shiftKey||event.altKey||event.metaKey)&&(baseName=w3cKeyname.base[event.keyCode])&&baseName!=name){if(runFor(scopeObj[prefix+modifiers(baseName,event,true)]))return true;}else if(isChar&&event.shiftKey){if(runFor(scopeObj[prefix+modifiers(name,event,true)]))return true;}}return fallthrough;}var CanHidePrimary=!browser.ios;// FIXME test IE 4572 + var selectionConfig=state.Facet.define({combine:function combine(configs){return state.combineConfig(configs,{cursorBlinkRate:1200,drawRangeCursor:true},{cursorBlinkRate:function cursorBlinkRate(a,b){return Math.min(a,b);},drawRangeCursor:function drawRangeCursor(a,b){return a||b;}});}});/** 4573 + Returns an extension that hides the browser's native selection and 4574 + cursor, replacing the selection with a background behind the text 4575 + (with the `cm-selectionBackground` class), and the 4576 + cursors with elements overlaid over the code (using 4577 + `cm-cursor-primary` and `cm-cursor-secondary`). 4578 + 4579 + This allows the editor to display secondary selection ranges, and 4580 + tends to produce a type of selection more in line with that users 4581 + expect in a text editor (the native selection styling will often 4582 + leave gaps between lines and won't fill the horizontal space after 4583 + a line when the selection continues past it). 4584 + 4585 + It does have a performance cost, in that it requires an extra DOM 4586 + layout cycle for many updates (the selection is drawn based on DOM 4587 + layout information that's only available after laying out the 4588 + content). 4589 + */function drawSelection(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[selectionConfig.of(config),drawSelectionPlugin,hideNativeSelection];}var Piece=/*#__PURE__*/function(){function Piece(left,top,width,height,className){_classCallCheck(this,Piece);this.left=left;this.top=top;this.width=width;this.height=height;this.className=className;}_createClass(Piece,[{key:"draw",value:function draw(){var elt=document.createElement("div");elt.className=this.className;this.adjust(elt);return elt;}},{key:"adjust",value:function adjust(elt){elt.style.left=this.left+"px";elt.style.top=this.top+"px";if(this.width>=0)elt.style.width=this.width+"px";elt.style.height=this.height+"px";}},{key:"eq",value:function eq(p){return this.left==p.left&&this.top==p.top&&this.width==p.width&&this.height==p.height&&this.className==p.className;}}]);return Piece;}();var drawSelectionPlugin=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class21(view){_classCallCheck(this,_class21);this.view=view;this.rangePieces=[];this.cursors=[];this.measureReq={read:this.readPos.bind(this),write:this.drawSel.bind(this)};this.selectionLayer=view.scrollDOM.appendChild(document.createElement("div"));this.selectionLayer.className="cm-selectionLayer";this.selectionLayer.setAttribute("aria-hidden","true");this.cursorLayer=view.scrollDOM.appendChild(document.createElement("div"));this.cursorLayer.className="cm-cursorLayer";this.cursorLayer.setAttribute("aria-hidden","true");view.requestMeasure(this.measureReq);this.setBlinkRate();}_createClass(_class21,[{key:"setBlinkRate",value:function setBlinkRate(){this.cursorLayer.style.animationDuration=this.view.state.facet(selectionConfig).cursorBlinkRate+"ms";}},{key:"update",value:function update(_update32){var confChanged=_update32.startState.facet(selectionConfig)!=_update32.state.facet(selectionConfig);if(confChanged||_update32.selectionSet||_update32.geometryChanged||_update32.viewportChanged)this.view.requestMeasure(this.measureReq);if(_update32.transactions.some(function(tr){return tr.scrollIntoView;}))this.cursorLayer.style.animationName=this.cursorLayer.style.animationName=="cm-blink"?"cm-blink2":"cm-blink";if(confChanged)this.setBlinkRate();}},{key:"readPos",value:function readPos(){var _this130=this;var state=this.view.state,conf=state.facet(selectionConfig);var rangePieces=state.selection.ranges.map(function(r){return r.empty?[]:measureRange(_this130.view,r);}).reduce(function(a,b){return a.concat(b);});var cursors=[];var _iterator260=_createForOfIteratorHelper(state.selection.ranges),_step260;try{for(_iterator260.s();!(_step260=_iterator260.n()).done;){var _r8=_step260.value;var prim=_r8==state.selection.main;if(_r8.empty?!prim||CanHidePrimary:conf.drawRangeCursor){var piece=measureCursor(this.view,_r8,prim);if(piece)cursors.push(piece);}}}catch(err){_iterator260.e(err);}finally{_iterator260.f();}return{rangePieces:rangePieces,cursors:cursors};}},{key:"drawSel",value:function drawSel(_ref84){var _this131=this;var rangePieces=_ref84.rangePieces,cursors=_ref84.cursors;if(rangePieces.length!=this.rangePieces.length||rangePieces.some(function(p,i){return!p.eq(_this131.rangePieces[i]);})){this.selectionLayer.textContent="";var _iterator261=_createForOfIteratorHelper(rangePieces),_step261;try{for(_iterator261.s();!(_step261=_iterator261.n()).done;){var _p5=_step261.value;this.selectionLayer.appendChild(_p5.draw());}}catch(err){_iterator261.e(err);}finally{_iterator261.f();}this.rangePieces=rangePieces;}if(cursors.length!=this.cursors.length||cursors.some(function(c,i){return!c.eq(_this131.cursors[i]);})){var oldCursors=this.cursorLayer.children;if(oldCursors.length!==cursors.length){this.cursorLayer.textContent="";var _iterator262=_createForOfIteratorHelper(cursors),_step262;try{for(_iterator262.s();!(_step262=_iterator262.n()).done;){var c=_step262.value;this.cursorLayer.appendChild(c.draw());}}catch(err){_iterator262.e(err);}finally{_iterator262.f();}}else{cursors.forEach(function(c,idx){return c.adjust(oldCursors[idx]);});}this.cursors=cursors;}}},{key:"destroy",value:function destroy(){this.selectionLayer.remove();this.cursorLayer.remove();}}]);return _class21;}());var themeSpec={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};if(CanHidePrimary)themeSpec[".cm-line"].caretColor="transparent !important";var hideNativeSelection=state.Prec.highest(EditorView.theme(themeSpec));function getBase(view){var rect=view.scrollDOM.getBoundingClientRect();var left=view.textDirection==exports.Direction.LTR?rect.left:rect.right-view.scrollDOM.clientWidth;return{left:left-view.scrollDOM.scrollLeft,top:rect.top-view.scrollDOM.scrollTop};}function wrappedLine(view,pos,inside){var range=state.EditorSelection.cursor(pos);return{from:Math.max(inside.from,view.moveToLineBoundary(range,false,true).from),to:Math.min(inside.to,view.moveToLineBoundary(range,true,true).from),type:exports.BlockType.Text};}function blockAt(view,pos){var line=view.visualLineAt(pos);if(Array.isArray(line.type)){var _iterator263=_createForOfIteratorHelper(line.type),_step263;try{for(_iterator263.s();!(_step263=_iterator263.n()).done;){var _l4=_step263.value;if(_l4.to>pos||_l4.to==pos&&(_l4.to==line.to||_l4.type==exports.BlockType.Text))return _l4;}}catch(err){_iterator263.e(err);}finally{_iterator263.f();}}return line;}function measureRange(view,range){if(range.to<=view.viewport.from||range.from>=view.viewport.to)return[];var from=Math.max(range.from,view.viewport.from),to=Math.min(range.to,view.viewport.to);var ltr=view.textDirection==exports.Direction.LTR;var content=view.contentDOM,contentRect=content.getBoundingClientRect(),base=getBase(view);var lineStyle=window.getComputedStyle(content.firstChild);var leftSide=contentRect.left+parseInt(lineStyle.paddingLeft);var rightSide=contentRect.right-parseInt(lineStyle.paddingRight);var startBlock=blockAt(view,from),endBlock=blockAt(view,to);var visualStart=startBlock.type==exports.BlockType.Text?startBlock:null;var visualEnd=endBlock.type==exports.BlockType.Text?endBlock:null;if(view.lineWrapping){if(visualStart)visualStart=wrappedLine(view,from,visualStart);if(visualEnd)visualEnd=wrappedLine(view,to,visualEnd);}if(visualStart&&visualEnd&&visualStart.from==visualEnd.from){return pieces(drawForLine(range.from,range.to,visualStart));}else{var top=visualStart?drawForLine(range.from,null,visualStart):drawForWidget(startBlock,false);var bottom=visualEnd?drawForLine(null,range.to,visualEnd):drawForWidget(endBlock,true);var between=[];if((visualStart||startBlock).to<(visualEnd||endBlock).from-1)between.push(piece(leftSide,top.bottom,rightSide,bottom.top));else if(top.bottom<bottom.top&&blockAt(view,(top.bottom+bottom.top)/2).type==exports.BlockType.Text)top.bottom=bottom.top=(top.bottom+bottom.top)/2;return pieces(top).concat(between).concat(pieces(bottom));}function piece(left,top,right,bottom){return new Piece(left-base.left,top-base.top,right-left,bottom-top,"cm-selectionBackground");}function pieces(_ref85){var top=_ref85.top,bottom=_ref85.bottom,horizontal=_ref85.horizontal;var pieces=[];for(var _i186=0;_i186<horizontal.length;_i186+=2){pieces.push(piece(horizontal[_i186],top,horizontal[_i186+1],bottom));}return pieces;}// Gets passed from/to in line-local positions 4590 + function drawForLine(from,to,line){var top=1e9,bottom=-1e9,horizontal=[];function addSpan(from,fromOpen,to,toOpen,dir){// Passing 2/-2 is a kludge to force the view to return 4591 + // coordinates on the proper side of block widgets, since 4592 + // normalizing the side there, though appropriate for most 4593 + // coordsAtPos queries, would break selection drawing. 4594 + var fromCoords=view.coordsAtPos(from,from==line.to?-2:2);var toCoords=view.coordsAtPos(to,to==line.from?2:-2);top=Math.min(fromCoords.top,toCoords.top,top);bottom=Math.max(fromCoords.bottom,toCoords.bottom,bottom);if(dir==exports.Direction.LTR)horizontal.push(ltr&&fromOpen?leftSide:fromCoords.left,ltr&&toOpen?rightSide:toCoords.right);else horizontal.push(!ltr&&toOpen?leftSide:toCoords.left,!ltr&&fromOpen?rightSide:fromCoords.right);}var start=from!==null&&from!==void 0?from:line.from,end=to!==null&&to!==void 0?to:line.to;// Split the range by visible range and document line 4595 + var _iterator264=_createForOfIteratorHelper(view.visibleRanges),_step264;try{for(_iterator264.s();!(_step264=_iterator264.n()).done;){var _r9=_step264.value;if(_r9.to>start&&_r9.from<end){for(var pos=Math.max(_r9.from,start),endPos=Math.min(_r9.to,end);;){var docLine=view.state.doc.lineAt(pos);var _iterator265=_createForOfIteratorHelper(view.bidiSpans(docLine)),_step265;try{for(_iterator265.s();!(_step265=_iterator265.n()).done;){var span=_step265.value;var spanFrom=span.from+docLine.from,spanTo=span.to+docLine.from;if(spanFrom>=endPos)break;if(spanTo>pos)addSpan(Math.max(spanFrom,pos),from==null&&spanFrom<=start,Math.min(spanTo,endPos),to==null&&spanTo>=end,span.dir);}}catch(err){_iterator265.e(err);}finally{_iterator265.f();}pos=docLine.to+1;if(pos>=endPos)break;}}}}catch(err){_iterator264.e(err);}finally{_iterator264.f();}if(horizontal.length==0)addSpan(start,from==null,end,to==null,view.textDirection);return{top:top,bottom:bottom,horizontal:horizontal};}function drawForWidget(block,top){var y=contentRect.top+(top?block.top:block.bottom);return{top:y,bottom:y,horizontal:[]};}}function measureCursor(view,cursor,primary){var pos=view.coordsAtPos(cursor.head,cursor.assoc||1);if(!pos)return null;var base=getBase(view);return new Piece(pos.left-base.left,pos.top-base.top,-1,pos.bottom-pos.top,primary?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary");}function iterMatches(doc,re,from,to,f){re.lastIndex=0;for(var _cursor4=doc.iterRange(from,to),pos=from,m;!_cursor4.next().done;pos+=_cursor4.value.length){if(!_cursor4.lineBreak)while(m=re.exec(_cursor4.value)){f(pos+m.index,pos+m.index+m[0].length,m);}}}/** 4596 + Helper class used to make it easier to maintain decorations on 4597 + visible code that matches a given regular expression. To be used 4598 + in a [view plugin](https://codemirror.net/6/docs/ref/#view.ViewPlugin). Instances of this object 4599 + represent a matching configuration. 4600 + */var MatchDecorator=/*#__PURE__*/function(){/** 4601 + Create a decorator. 4602 + */function MatchDecorator(config){_classCallCheck(this,MatchDecorator);var regexp=config.regexp,decoration=config.decoration,boundary=config.boundary;if(!regexp.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");this.regexp=regexp;this.getDeco=typeof decoration=="function"?decoration:function(){return decoration;};this.boundary=boundary;}/** 4603 + Compute the full set of decorations for matches in the given 4604 + view's viewport. You'll want to call this when initializing your 4605 + plugin. 4606 + */_createClass(MatchDecorator,[{key:"createDeco",value:function createDeco(view){var _this132=this;var build=new rangeset.RangeSetBuilder();var _iterator266=_createForOfIteratorHelper(view.visibleRanges),_step266;try{for(_iterator266.s();!(_step266=_iterator266.n()).done;){var _step266$value=_step266.value,from=_step266$value.from,to=_step266$value.to;iterMatches(view.state.doc,this.regexp,from,to,function(a,b,m){return build.add(a,b,_this132.getDeco(m,view,a));});}}catch(err){_iterator266.e(err);}finally{_iterator266.f();}return build.finish();}/** 4607 + Update a set of decorations for a view update. `deco` _must_ be 4608 + the set of decorations produced by _this_ `MatchDecorator` for 4609 + the view state before the update. 4610 + */},{key:"updateDeco",value:function updateDeco(update,deco){var changeFrom=1e9,changeTo=-1;if(update.docChanged)update.changes.iterChanges(function(_f,_t,from,to){if(to>update.view.viewport.from&&from<update.view.viewport.to){changeFrom=Math.min(from,changeFrom);changeTo=Math.max(to,changeTo);}});if(update.viewportChanged||changeTo-changeFrom>1000)return this.createDeco(update.view);if(changeTo>-1)return this.updateRange(update.view,deco.map(update.changes),changeFrom,changeTo);return deco;}},{key:"updateRange",value:function updateRange(view,deco,updateFrom,updateTo){var _this133=this;var _iterator267=_createForOfIteratorHelper(view.visibleRanges),_step267;try{for(_iterator267.s();!(_step267=_iterator267.n()).done;){var _r10=_step267.value;var from=Math.max(_r10.from,updateFrom),to=Math.min(_r10.to,updateTo);if(to>from){(function(){var fromLine=view.state.doc.lineAt(from),toLine=fromLine.to<to?view.state.doc.lineAt(to):fromLine;var start=Math.max(_r10.from,fromLine.from),end=Math.min(_r10.to,toLine.to);if(_this133.boundary){for(;from>fromLine.from;from--){if(_this133.boundary.test(fromLine.text[from-1-fromLine.from])){start=from;break;}}for(;to<toLine.to;to++){if(_this133.boundary.test(toLine.text[to-toLine.from])){end=to;break;}}}var ranges=[],m=void 0;if(fromLine==toLine){_this133.regexp.lastIndex=start-fromLine.from;while((m=_this133.regexp.exec(fromLine.text))&&m.index<end-fromLine.from){var pos=m.index+fromLine.from;ranges.push(_this133.getDeco(m,view,pos).range(pos,pos+m[0].length));}}else{iterMatches(view.state.doc,_this133.regexp,start,end,function(from,to,m){return ranges.push(_this133.getDeco(m,view,from).range(from,to));});}deco=deco.update({filterFrom:start,filterTo:end,filter:function filter(from,to){return from<start||to>end;},add:ranges});})();}}}catch(err){_iterator267.e(err);}finally{_iterator267.f();}return deco;}}]);return MatchDecorator;}();var UnicodeRegexpSupport=/x/.unicode!=null?"gu":"g";var Specials=new RegExp("[\0-\b\n-\x1F\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\uFEFF\uFFF9-\uFFFC]",UnicodeRegexpSupport);var Names={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};var _supportsTabSize=null;function supportsTabSize(){var _a;if(_supportsTabSize==null&&typeof document!="undefined"&&document.body){var styles=document.body.style;_supportsTabSize=((_a=styles.tabSize)!==null&&_a!==void 0?_a:styles.MozTabSize)!=null;}return _supportsTabSize||false;}var specialCharConfig=state.Facet.define({combine:function combine(configs){var config=state.combineConfig(configs,{render:null,specialChars:Specials,addSpecialChars:null});if(config.replaceTabs=!supportsTabSize())config.specialChars=new RegExp("\t|"+config.specialChars.source,UnicodeRegexpSupport);if(config.addSpecialChars)config.specialChars=new RegExp(config.specialChars.source+"|"+config.addSpecialChars.source,UnicodeRegexpSupport);return config;}});/** 4611 + Returns an extension that installs highlighting of special 4612 + characters. 4613 + */function highlightSpecialChars(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return[specialCharConfig.of(config),specialCharPlugin()];}var _plugin=null;function specialCharPlugin(){return _plugin||(_plugin=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class22(view){_classCallCheck(this,_class22);this.view=view;this.decorations=Decoration.none;this.decorationCache=Object.create(null);this.decorator=this.makeDecorator(view.state.facet(specialCharConfig));this.decorations=this.decorator.createDeco(view);}_createClass(_class22,[{key:"makeDecorator",value:function makeDecorator(conf){var _this134=this;return new MatchDecorator({regexp:conf.specialChars,decoration:function decoration(m,view,pos){var doc=view.state.doc;var code=text.codePointAt(m[0],0);if(code==9){var line=doc.lineAt(pos);var size=view.state.tabSize,col=text.countColumn(line.text,size,pos-line.from);return Decoration.replace({widget:new TabWidget((size-col%size)*_this134.view.defaultCharacterWidth)});}return _this134.decorationCache[code]||(_this134.decorationCache[code]=Decoration.replace({widget:new SpecialCharWidget(conf,code)}));},boundary:conf.replaceTabs?undefined:/[^]/});}},{key:"update",value:function update(_update33){var conf=_update33.state.facet(specialCharConfig);if(_update33.startState.facet(specialCharConfig)!=conf){this.decorator=this.makeDecorator(conf);this.decorations=this.decorator.createDeco(_update33.view);}else{this.decorations=this.decorator.updateDeco(_update33,this.decorations);}}}]);return _class22;}(),{decorations:function decorations(v){return v.decorations;}}));}var DefaultPlaceholder="\u2022";// Assigns placeholder characters from the Control Pictures block to 4614 + // ASCII control characters 4615 + function placeholder$1(code){if(code>=32)return DefaultPlaceholder;if(code==10)return"\u2424";return String.fromCharCode(9216+code);}var SpecialCharWidget=/*#__PURE__*/function(_WidgetType12){_inherits(SpecialCharWidget,_WidgetType12);var _super65=_createSuper(SpecialCharWidget);function SpecialCharWidget(options,code){var _this135;_classCallCheck(this,SpecialCharWidget);_this135=_super65.call(this);_this135.options=options;_this135.code=code;return _this135;}_createClass(SpecialCharWidget,[{key:"eq",value:function eq(other){return other.code==this.code;}},{key:"toDOM",value:function toDOM(view){var ph=placeholder$1(this.code);var desc=view.state.phrase("Control character")+" "+(Names[this.code]||"0x"+this.code.toString(16));var custom=this.options.render&&this.options.render(this.code,desc,ph);if(custom)return custom;var span=document.createElement("span");span.textContent=ph;span.title=desc;span.setAttribute("aria-label",desc);span.className="cm-specialChar";return span;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}}]);return SpecialCharWidget;}(WidgetType);var TabWidget=/*#__PURE__*/function(_WidgetType13){_inherits(TabWidget,_WidgetType13);var _super66=_createSuper(TabWidget);function TabWidget(width){var _this136;_classCallCheck(this,TabWidget);_this136=_super66.call(this);_this136.width=width;return _this136;}_createClass(TabWidget,[{key:"eq",value:function eq(other){return other.width==this.width;}},{key:"toDOM",value:function toDOM(){var span=document.createElement("span");span.textContent="\t";span.className="cm-tab";span.style.width=this.width+"px";return span;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}}]);return TabWidget;}(WidgetType);var plugin=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class23(view){var _this137=this;_classCallCheck(this,_class23);this.height=-1;this.measure={read:function read(view){return Math.max(0,view.scrollDOM.clientHeight-view.defaultLineHeight);},write:function write(value,view){if(Math.abs(value-_this137.height)>1){_this137.height=value;view.contentDOM.style.paddingBottom=value+"px";}}};view.requestMeasure(this.measure);}_createClass(_class23,[{key:"update",value:function update(_update34){if(_update34.geometryChanged)_update34.view.requestMeasure(this.measure);}}]);return _class23;}());/** 4616 + Returns a plugin that makes sure the content has a bottom margin 4617 + equivalent to the height of the editor, minus one line height, so 4618 + that every line in the document can be scrolled to the top of the 4619 + editor. 4620 + 4621 + This is only meaningful when the editor is scrollable, and should 4622 + not be enabled in editors that take the size of their content. 4623 + */function scrollPastEnd(){return plugin;}/** 4624 + Mark lines that have a cursor on them with the `"cm-activeLine"` 4625 + DOM class. 4626 + */function highlightActiveLine(){return activeLineHighlighter;}var lineDeco=Decoration.line({"class":"cm-activeLine"});var activeLineHighlighter=ViewPlugin.fromClass(/*#__PURE__*/function(){function _class24(view){_classCallCheck(this,_class24);this.decorations=this.getDeco(view);}_createClass(_class24,[{key:"update",value:function update(_update35){if(_update35.docChanged||_update35.selectionSet)this.decorations=this.getDeco(_update35.view);}},{key:"getDeco",value:function getDeco(view){var lastLineStart=-1,deco=[];var _iterator268=_createForOfIteratorHelper(view.state.selection.ranges),_step268;try{for(_iterator268.s();!(_step268=_iterator268.n()).done;){var _r11=_step268.value;if(!_r11.empty)return Decoration.none;var line=view.visualLineAt(_r11.head);if(line.from>lastLineStart){deco.push(lineDeco.range(line.from));lastLineStart=line.from;}}}catch(err){_iterator268.e(err);}finally{_iterator268.f();}return Decoration.set(deco);}}]);return _class24;}(),{decorations:function decorations(v){return v.decorations;}});var Placeholder=/*#__PURE__*/function(_WidgetType14){_inherits(Placeholder,_WidgetType14);var _super67=_createSuper(Placeholder);function Placeholder(content){var _this138;_classCallCheck(this,Placeholder);_this138=_super67.call(this);_this138.content=content;return _this138;}_createClass(Placeholder,[{key:"toDOM",value:function toDOM(){var wrap=document.createElement("span");wrap.className="cm-placeholder";wrap.style.pointerEvents="none";wrap.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content);if(typeof this.content=="string")wrap.setAttribute("aria-label","placeholder "+this.content);else wrap.setAttribute("aria-hidden","true");return wrap;}},{key:"ignoreEvent",value:function ignoreEvent(){return false;}}]);return Placeholder;}(WidgetType);/** 4627 + Extension that enables a placeholder—a piece of example content 4628 + to show when the editor is empty. 4629 + */function placeholder(content){return ViewPlugin.fromClass(/*#__PURE__*/function(){function _class25(view){_classCallCheck(this,_class25);this.view=view;this.placeholder=Decoration.set([Decoration.widget({widget:new Placeholder(content),side:1}).range(0)]);}_createClass(_class25,[{key:"decorations",get:function get(){return this.view.state.doc.length?Decoration.none:this.placeholder;}}]);return _class25;}(),{decorations:function decorations(v){return v.decorations;}});}/** 4630 + @internal 4631 + */var __test={HeightMap:HeightMap,HeightOracle:HeightOracle,MeasuredHeights:MeasuredHeights,QueryType:QueryType,ChangedRange:ChangedRange,computeOrder:computeOrder,moveVisually:moveVisually};Object.defineProperty(exports,'Range',{enumerable:true,get:function get(){return rangeset.Range;}});exports.BidiSpan=BidiSpan;exports.BlockInfo=BlockInfo;exports.Decoration=Decoration;exports.EditorView=EditorView;exports.MatchDecorator=MatchDecorator;exports.PluginField=PluginField;exports.PluginFieldProvider=PluginFieldProvider;exports.ViewPlugin=ViewPlugin;exports.ViewUpdate=ViewUpdate;exports.WidgetType=WidgetType;exports.__test=__test;exports.drawSelection=drawSelection;exports.highlightActiveLine=highlightActiveLine;exports.highlightSpecialChars=highlightSpecialChars;exports.keymap=keymap;exports.logException=logException;exports.placeholder=placeholder;exports.runScopeHandlers=runScopeHandlers;exports.scrollPastEnd=scrollPastEnd;},{"@codemirror/rangeset":18,"@codemirror/state":22,"@codemirror/text":24,"style-mod":30,"w3c-keyname":31}],28:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});// FIXME profile adding a per-Tree TreeNode cache, validating it by 4632 + // parent pointer 4633 + /// The default maximum length of a `TreeBuffer` node (1024). 4634 + var DefaultBufferLength=1024;var nextPropID=0;var Range=/*#__PURE__*/_createClass(function Range(from,to){_classCallCheck(this,Range);this.from=from;this.to=to;});/// Each [node type](#common.NodeType) or [individual tree](#common.Tree) 4635 + /// can have metadata associated with it in props. Instances of this 4636 + /// class represent prop names. 4637 + var NodeProp=/*#__PURE__*/function(){/// Create a new node prop type. 4638 + function NodeProp(){var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,NodeProp);this.id=nextPropID++;this.perNode=!!config.perNode;this.deserialize=config.deserialize||function(){throw new Error("This node type doesn't define a deserialize function");};}/// This is meant to be used with 4639 + /// [`NodeSet.extend`](#common.NodeSet.extend) or 4640 + /// [`LRParser.configure`](#lr.ParserConfig.props) to compute 4641 + /// prop values for each node type in the set. Takes a [match 4642 + /// object](#common.NodeType^match) or function that returns undefined 4643 + /// if the node type doesn't get this prop, and the prop's value if 4644 + /// it does. 4645 + _createClass(NodeProp,[{key:"add",value:function add(match){var _this139=this;if(this.perNode)throw new RangeError("Can't add per-node props to node types");if(typeof match!="function")match=NodeType.match(match);return function(type){var result=match(type);return result===undefined?null:[_this139,result];};}}]);return NodeProp;}();/// Prop that is used to describe matching delimiters. For opening 4646 + /// delimiters, this holds an array of node names (written as a 4647 + /// space-separated string when declaring this prop in a grammar) 4648 + /// for the node types of closing delimiters that match it. 4649 + NodeProp.closedBy=new NodeProp({deserialize:function deserialize(str){return str.split(" ");}});/// The inverse of [`closedBy`](#common.NodeProp^closedBy). This is 4650 + /// attached to closing delimiters, holding an array of node names 4651 + /// of types of matching opening delimiters. 4652 + NodeProp.openedBy=new NodeProp({deserialize:function deserialize(str){return str.split(" ");}});/// Used to assign node types to groups (for example, all node 4653 + /// types that represent an expression could be tagged with an 4654 + /// `"Expression"` group). 4655 + NodeProp.group=new NodeProp({deserialize:function deserialize(str){return str.split(" ");}});/// The hash of the [context](#lr.ContextTracker.constructor) 4656 + /// that the node was parsed in, if any. Used to limit reuse of 4657 + /// contextual nodes. 4658 + NodeProp.contextHash=new NodeProp({perNode:true});/// The distance beyond the end of the node that the tokenizer 4659 + /// looked ahead for any of the tokens inside the node. (The LR 4660 + /// parser only stores this when it is larger than 25, for 4661 + /// efficiency reasons.) 4662 + NodeProp.lookAhead=new NodeProp({perNode:true});/// This per-node prop is used to replace a given node, or part of a 4663 + /// node, with another tree. This is useful to include trees from 4664 + /// different languages. 4665 + NodeProp.mounted=new NodeProp({perNode:true});/// A mounted tree, which can be [stored](#common.NodeProp^mounted) on 4666 + /// a tree node to indicate that parts of its content are 4667 + /// represented by another tree. 4668 + var MountedTree=/*#__PURE__*/_createClass(function MountedTree(/// The inner tree. 4669 + tree,/// If this is null, this tree replaces the entire node (it will 4670 + /// be included in the regular iteration instead of its host 4671 + /// node). If not, only the given ranges are considered to be 4672 + /// covered by this tree. This is used for trees that are mixed in 4673 + /// a way that isn't strictly hierarchical. Such mounted trees are 4674 + /// only entered by [`resolveInner`](#common.Tree.resolveInner) 4675 + /// and [`enter`](#common.SyntaxNode.enter). 4676 + overlay,/// The parser used to create this subtree. 4677 + parser){_classCallCheck(this,MountedTree);this.tree=tree;this.overlay=overlay;this.parser=parser;});var noProps=Object.create(null);/// Each node in a syntax tree has a node type associated with it. 4678 + var NodeType=/*#__PURE__*/function(){/// @internal 4679 + function NodeType(/// The name of the node type. Not necessarily unique, but if the 4680 + /// grammar was written properly, different node types with the 4681 + /// same name within a node set should play the same semantic 4682 + /// role. 4683 + name,/// @internal 4684 + props,/// The id of this node in its set. Corresponds to the term ids 4685 + /// used in the parser. 4686 + id){var flags=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0;_classCallCheck(this,NodeType);this.name=name;this.props=props;this.id=id;this.flags=flags;}_createClass(NodeType,[{key:"prop",value:/// Retrieves a node prop for this type. Will return `undefined` if 4687 + /// the prop isn't present on this node. 4688 + function prop(_prop){return this.props[_prop.id];}/// True when this is the top node of a grammar. 4689 + },{key:"isTop",get:function get(){return(this.flags&1/* Top */)>0;}/// True when this node is produced by a skip rule. 4690 + },{key:"isSkipped",get:function get(){return(this.flags&2/* Skipped */)>0;}/// Indicates whether this is an error node. 4691 + },{key:"isError",get:function get(){return(this.flags&4/* Error */)>0;}/// When true, this node type doesn't correspond to a user-declared 4692 + /// named node, for example because it is used to cache repetition. 4693 + },{key:"isAnonymous",get:function get(){return(this.flags&8/* Anonymous */)>0;}/// Returns true when this node's name or one of its 4694 + /// [groups](#common.NodeProp^group) matches the given string. 4695 + },{key:"is",value:function is(name){if(typeof name=='string'){if(this.name==name)return true;var group=this.prop(NodeProp.group);return group?group.indexOf(name)>-1:false;}return this.id==name;}/// Create a function from node types to arbitrary values by 4696 + /// specifying an object whose property names are node or 4697 + /// [group](#common.NodeProp^group) names. Often useful with 4698 + /// [`NodeProp.add`](#common.NodeProp.add). You can put multiple 4699 + /// names, separated by spaces, in a single property name to map 4700 + /// multiple node names to a single value. 4701 + }],[{key:"define",value:function define(spec){var props=spec.props&&spec.props.length?Object.create(null):noProps;var flags=(spec.top?1/* Top */:0)|(spec.skipped?2/* Skipped */:0)|(spec.error?4/* Error */:0)|(spec.name==null?8/* Anonymous */:0);var type=new NodeType(spec.name||"",props,spec.id,flags);if(spec.props){var _iterator269=_createForOfIteratorHelper(spec.props),_step269;try{for(_iterator269.s();!(_step269=_iterator269.n()).done;){var src=_step269.value;if(!Array.isArray(src))src=src(type);if(src){if(src[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");props[src[0].id]=src[1];}}}catch(err){_iterator269.e(err);}finally{_iterator269.f();}}return type;}},{key:"match",value:function match(map){var direct=Object.create(null);for(var prop in map){var _iterator270=_createForOfIteratorHelper(prop.split(" ")),_step270;try{for(_iterator270.s();!(_step270=_iterator270.n()).done;){var name=_step270.value;direct[name]=map[prop];}}catch(err){_iterator270.e(err);}finally{_iterator270.f();}}return function(node){for(var groups=node.prop(NodeProp.group),_i187=-1;_i187<(groups?groups.length:0);_i187++){var found=direct[_i187<0?node.name:groups[_i187]];if(found)return found;}};}}]);return NodeType;}();/// An empty dummy node type to use when no actual type is available. 4702 + NodeType.none=new NodeType("",Object.create(null),0,8/* Anonymous */);/// A node set holds a collection of node types. It is used to 4703 + /// compactly represent trees by storing their type ids, rather than a 4704 + /// full pointer to the type object, in a numeric array. Each parser 4705 + /// [has](#lr.LRParser.nodeSet) a node set, and [tree 4706 + /// buffers](#common.TreeBuffer) can only store collections of nodes 4707 + /// from the same set. A set can have a maximum of 2**16 (65536) node 4708 + /// types in it, so that the ids fit into 16-bit typed array slots. 4709 + var NodeSet=/*#__PURE__*/function(){/// Create a set with the given types. The `id` property of each 4710 + /// type should correspond to its position within the array. 4711 + function NodeSet(/// The node types in this set, by id. 4712 + types){_classCallCheck(this,NodeSet);this.types=types;for(var _i188=0;_i188<types.length;_i188++){if(types[_i188].id!=_i188)throw new RangeError("Node type ids should correspond to array positions when creating a node set");}}/// Create a copy of this set with some node properties added. The 4713 + /// arguments to this method should be created with 4714 + /// [`NodeProp.add`](#common.NodeProp.add). 4715 + _createClass(NodeSet,[{key:"extend",value:function extend(){var newTypes=[];for(var _len3=arguments.length,props=new Array(_len3),_key3=0;_key3<_len3;_key3++){props[_key3]=arguments[_key3];}var _iterator271=_createForOfIteratorHelper(this.types),_step271;try{for(_iterator271.s();!(_step271=_iterator271.n()).done;){var type=_step271.value;var newProps=null;var _iterator272=_createForOfIteratorHelper(props),_step272;try{for(_iterator272.s();!(_step272=_iterator272.n()).done;){var source=_step272.value;var add=source(type);if(add){if(!newProps)newProps=Object.assign({},type.props);newProps[add[0].id]=add[1];}}}catch(err){_iterator272.e(err);}finally{_iterator272.f();}newTypes.push(newProps?new NodeType(type.name,newProps,type.id,type.flags):type);}}catch(err){_iterator271.e(err);}finally{_iterator271.f();}return new NodeSet(newTypes);}}]);return NodeSet;}();var CachedNode=new WeakMap(),CachedInnerNode=new WeakMap();/// A piece of syntax tree. There are two ways to approach these 4716 + /// trees: the way they are actually stored in memory, and the 4717 + /// convenient way. 4718 + /// 4719 + /// Syntax trees are stored as a tree of `Tree` and `TreeBuffer` 4720 + /// objects. By packing detail information into `TreeBuffer` leaf 4721 + /// nodes, the representation is made a lot more memory-efficient. 4722 + /// 4723 + /// However, when you want to actually work with tree nodes, this 4724 + /// representation is very awkward, so most client code will want to 4725 + /// use the [`TreeCursor`](#common.TreeCursor) or 4726 + /// [`SyntaxNode`](#common.SyntaxNode) interface instead, which provides 4727 + /// a view on some part of this data structure, and can be used to 4728 + /// move around to adjacent nodes. 4729 + var Tree=/*#__PURE__*/function(){/// Construct a new tree. See also [`Tree.build`](#common.Tree^build). 4730 + function Tree(/// The type of the top node. 4731 + type,/// This node's child nodes. 4732 + children,/// The positions (offsets relative to the start of this tree) of 4733 + /// the children. 4734 + positions,/// The total length of this tree 4735 + length,/// Per-node [node props](#common.NodeProp) to associate with this node. 4736 + props){_classCallCheck(this,Tree);this.type=type;this.children=children;this.positions=positions;this.length=length;/// @internal 4737 + this.props=null;if(props&&props.length){this.props=Object.create(null);var _iterator273=_createForOfIteratorHelper(props),_step273;try{for(_iterator273.s();!(_step273=_iterator273.n()).done;){var _step273$value=_slicedToArray(_step273.value,2),prop=_step273$value[0],value=_step273$value[1];this.props[typeof prop=="number"?prop:prop.id]=value;}}catch(err){_iterator273.e(err);}finally{_iterator273.f();}}}/// @internal 4738 + _createClass(Tree,[{key:"toString",value:function toString(){var mounted=this.prop(NodeProp.mounted);if(mounted&&!mounted.overlay)return mounted.tree.toString();var children="";var _iterator274=_createForOfIteratorHelper(this.children),_step274;try{for(_iterator274.s();!(_step274=_iterator274.n()).done;){var ch=_step274.value;var str=ch.toString();if(str){if(children)children+=",";children+=str;}}}catch(err){_iterator274.e(err);}finally{_iterator274.f();}return!this.type.name?children:(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(children.length?"("+children+")":"");}/// Get a [tree cursor](#common.TreeCursor) rooted at this tree. When 4739 + /// `pos` is given, the cursor is [moved](#common.TreeCursor.moveTo) 4740 + /// to the given position and side. 4741 + },{key:"cursor",value:function cursor(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var scope=pos!=null&&CachedNode.get(this)||this.topNode;var cursor=new TreeCursor(scope);if(pos!=null){cursor.moveTo(pos,side);CachedNode.set(this,cursor._tree);}return cursor;}/// Get a [tree cursor](#common.TreeCursor) that, unlike regular 4742 + /// cursors, doesn't skip through 4743 + /// [anonymous](#common.NodeType.isAnonymous) nodes and doesn't 4744 + /// automatically enter mounted nodes. 4745 + },{key:"fullCursor",value:function fullCursor(){return new TreeCursor(this.topNode,1/* Full */);}/// Get a [syntax node](#common.SyntaxNode) object for the top of the 4746 + /// tree. 4747 + },{key:"topNode",get:function get(){return new TreeNode(this,0,0,null);}/// Get the [syntax node](#common.SyntaxNode) at the given position. 4748 + /// If `side` is -1, this will move into nodes that end at the 4749 + /// position. If 1, it'll move into nodes that start at the 4750 + /// position. With 0, it'll only enter nodes that cover the position 4751 + /// from both sides. 4752 + },{key:"resolve",value:function resolve(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var node=resolveNode(CachedNode.get(this)||this.topNode,pos,side,false);CachedNode.set(this,node);return node;}/// Like [`resolve`](#common.Tree.resolve), but will enter 4753 + /// [overlaid](#common.MountedTree.overlay) nodes, producing a syntax node 4754 + /// pointing into the innermost overlaid tree at the given position 4755 + /// (with parent links going through all parent structure, including 4756 + /// the host trees). 4757 + },{key:"resolveInner",value:function resolveInner(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var node=resolveNode(CachedInnerNode.get(this)||this.topNode,pos,side,true);CachedInnerNode.set(this,node);return node;}/// Iterate over the tree and its children, calling `enter` for any 4758 + /// node that touches the `from`/`to` region (if given) before 4759 + /// running over such a node's children, and `leave` (if given) when 4760 + /// leaving the node. When `enter` returns `false`, that node will 4761 + /// not have its children iterated over (or `leave` called). 4762 + },{key:"iterate",value:function iterate(spec){var enter=spec.enter,leave=spec.leave,_spec$from=spec.from,from=_spec$from===void 0?0:_spec$from,_spec$to2=spec.to,to=_spec$to2===void 0?this.length:_spec$to2;for(var c=this.cursor(),get=function get(){return c.node;};;){var mustLeave=false;if(c.from<=to&&c.to>=from&&(c.type.isAnonymous||enter(c.type,c.from,c.to,get)!==false)){if(c.firstChild())continue;if(!c.type.isAnonymous)mustLeave=true;}for(;;){if(mustLeave&&leave)leave(c.type,c.from,c.to,get);mustLeave=c.type.isAnonymous;if(c.nextSibling())break;if(!c.parent())return;mustLeave=true;}}}/// Get the value of the given [node prop](#common.NodeProp) for this 4763 + /// node. Works with both per-node and per-type props. 4764 + },{key:"prop",value:function prop(_prop2){return!_prop2.perNode?this.type.prop(_prop2):this.props?this.props[_prop2.id]:undefined;}/// Returns the node's [per-node props](#common.NodeProp.perNode) in a 4765 + /// format that can be passed to the [`Tree`](#common.Tree) 4766 + /// constructor. 4767 + },{key:"propValues",get:function get(){var result=[];if(this.props)for(var id in this.props){result.push([+id,this.props[id]]);}return result;}/// Balance the direct children of this tree, producing a copy of 4768 + /// which may have children grouped into subtrees with type 4769 + /// [`NodeType.none`](#common.NodeType^none). 4770 + },{key:"balance",value:function balance(){var _this140=this;var config=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return this.children.length<=8/* BranchFactor */?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,function(children,positions,length){return new Tree(_this140.type,children,positions,length,_this140.propValues);},config.makeTree||function(children,positions,length){return new Tree(NodeType.none,children,positions,length);});}/// Build a tree from a postfix-ordered buffer of node information, 4771 + /// or a cursor over such a buffer. 4772 + }],[{key:"build",value:function build(data){return buildTree(data);}}]);return Tree;}();/// The empty tree 4773 + Tree.empty=new Tree(NodeType.none,[],[],0);var FlatBufferCursor=/*#__PURE__*/function(){function FlatBufferCursor(buffer,index){_classCallCheck(this,FlatBufferCursor);this.buffer=buffer;this.index=index;}_createClass(FlatBufferCursor,[{key:"id",get:function get(){return this.buffer[this.index-4];}},{key:"start",get:function get(){return this.buffer[this.index-3];}},{key:"end",get:function get(){return this.buffer[this.index-2];}},{key:"size",get:function get(){return this.buffer[this.index-1];}},{key:"pos",get:function get(){return this.index;}},{key:"next",value:function next(){this.index-=4;}},{key:"fork",value:function fork(){return new FlatBufferCursor(this.buffer,this.index);}}]);return FlatBufferCursor;}();/// Tree buffers contain (type, start, end, endIndex) quads for each 4774 + /// node. In such a buffer, nodes are stored in prefix order (parents 4775 + /// before children, with the endIndex of the parent indicating which 4776 + /// children belong to it) 4777 + var TreeBuffer=/*#__PURE__*/function(){/// Create a tree buffer. 4778 + function TreeBuffer(/// The buffer's content. 4779 + buffer,/// The total length of the group of nodes in the buffer. 4780 + length,/// The node set used in this buffer. 4781 + set){_classCallCheck(this,TreeBuffer);this.buffer=buffer;this.length=length;this.set=set;}/// @internal 4782 + _createClass(TreeBuffer,[{key:"type",get:function get(){return NodeType.none;}/// @internal 4783 + },{key:"toString",value:function toString(){var result=[];for(var index=0;index<this.buffer.length;){result.push(this.childString(index));index=this.buffer[index+3];}return result.join(",");}/// @internal 4784 + },{key:"childString",value:function childString(index){var id=this.buffer[index],endIndex=this.buffer[index+3];var type=this.set.types[id],result=type.name;if(/\W/.test(result)&&!type.isError)result=JSON.stringify(result);index+=4;if(endIndex==index)return result;var children=[];while(index<endIndex){children.push(this.childString(index));index=this.buffer[index+3];}return result+"("+children.join(",")+")";}/// @internal 4785 + },{key:"findChild",value:function findChild(startIndex,endIndex,dir,pos,side){var buffer=this.buffer,pick=-1;for(var _i189=startIndex;_i189!=endIndex;_i189=buffer[_i189+3]){if(checkSide(side,pos,buffer[_i189+1],buffer[_i189+2])){pick=_i189;if(dir>0)break;}}return pick;}/// @internal 4786 + },{key:"slice",value:function slice(startI,endI,from,to){var b=this.buffer;var copy=new Uint16Array(endI-startI);for(var _i190=startI,j=0;_i190<endI;){copy[j++]=b[_i190++];copy[j++]=b[_i190++]-from;copy[j++]=b[_i190++]-from;copy[j++]=b[_i190++]-startI;}return new TreeBuffer(copy,to-from,this.set);}}]);return TreeBuffer;}();function checkSide(side,pos,from,to){switch(side){case-2/* Before */:return from<pos;case-1/* AtOrBefore */:return to>=pos&&from<pos;case 0/* Around */:return from<pos&&to>pos;case 1/* AtOrAfter */:return from<=pos&&to>pos;case 2/* After */:return to>pos;case 4/* DontCare */:return true;}}function _enterUnfinishedNodesBefore(node,pos){var scan=node.childBefore(pos);while(scan){var last=scan.lastChild;if(!last||last.to!=scan.to)break;if(last.type.isError&&last.from==last.to){node=scan;scan=last.prevSibling;}else{scan=last;}}return node;}function resolveNode(node,pos,side,overlays){var _a;// Move up to a node that actually holds the position, if possible 4787 + while(node.from==node.to||(side<1?node.from>=pos:node.from>pos)||(side>-1?node.to<=pos:node.to<pos)){var parent=!overlays&&node instanceof TreeNode&&node.index<0?null:node.parent;if(!parent)return node;node=parent;}// Must go up out of overlays when those do not overlap with pos 4788 + if(overlays)for(var scan=node,_parent2=scan.parent;_parent2;scan=_parent2,_parent2=scan.parent){if(scan instanceof TreeNode&&scan.index<0&&((_a=_parent2.enter(pos,side,true))===null||_a===void 0?void 0:_a.from)!=scan.from)node=_parent2;}for(;;){var inner=node.enter(pos,side,overlays);if(!inner)return node;node=inner;}}var TreeNode=/*#__PURE__*/function(){function TreeNode(node,_from,// Index in parent node, set to -1 if the node is not a direct child of _parent.node (overlay) 4789 + index,_parent){_classCallCheck(this,TreeNode);this.node=node;this._from=_from;this.index=index;this._parent=_parent;}_createClass(TreeNode,[{key:"type",get:function get(){return this.node.type;}},{key:"name",get:function get(){return this.node.type.name;}},{key:"from",get:function get(){return this._from;}},{key:"to",get:function get(){return this._from+this.node.length;}},{key:"nextChild",value:function nextChild(i,dir,pos,side){var mode=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;for(var parent=this;;){for(var _parent$node=parent.node,children=_parent$node.children,positions=_parent$node.positions,e=dir>0?children.length:-1;i!=e;i+=dir){var next=children[i],start=positions[i]+parent._from;if(!checkSide(side,pos,start,start+next.length))continue;if(next instanceof TreeBuffer){if(mode&2/* NoEnterBuffer */)continue;var index=next.findChild(0,next.buffer.length,dir,pos-start,side);if(index>-1)return new BufferNode(new BufferContext(parent,next,i,start),null,index);}else if(mode&1/* Full */||!next.type.isAnonymous||hasChild(next)){var mounted=void 0;if(!(mode&1/* Full */)&&next.props&&(mounted=next.prop(NodeProp.mounted))&&!mounted.overlay)return new TreeNode(mounted.tree,start,i,parent);var inner=new TreeNode(next,start,i,parent);return mode&1/* Full */||!inner.type.isAnonymous?inner:inner.nextChild(dir<0?next.children.length-1:0,dir,pos,side);}}if(mode&1/* Full */||!parent.type.isAnonymous)return null;if(parent.index>=0)i=parent.index+dir;else i=dir<0?-1:parent._parent.node.children.length;parent=parent._parent;if(!parent)return null;}}},{key:"firstChild",get:function get(){return this.nextChild(0,1,0,4/* DontCare */);}},{key:"lastChild",get:function get(){return this.nextChild(this.node.children.length-1,-1,0,4/* DontCare */);}},{key:"childAfter",value:function childAfter(pos){return this.nextChild(0,1,pos,2/* After */);}},{key:"childBefore",value:function childBefore(pos){return this.nextChild(this.node.children.length-1,-1,pos,-2/* Before */);}},{key:"enter",value:function enter(pos,side){var overlays=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var buffers=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var mounted;if(overlays&&(mounted=this.node.prop(NodeProp.mounted))&&mounted.overlay){var rPos=pos-this.from;var _iterator275=_createForOfIteratorHelper(mounted.overlay),_step275;try{for(_iterator275.s();!(_step275=_iterator275.n()).done;){var _step275$value=_step275.value,from=_step275$value.from,to=_step275$value.to;if((side>0?from<=rPos:from<rPos)&&(side<0?to>=rPos:to>rPos))return new TreeNode(mounted.tree,mounted.overlay[0].from+this.from,-1,this);}}catch(err){_iterator275.e(err);}finally{_iterator275.f();}}return this.nextChild(0,1,pos,side,buffers?0:2/* NoEnterBuffer */);}},{key:"nextSignificantParent",value:function nextSignificantParent(){var val=this;while(val.type.isAnonymous&&val._parent){val=val._parent;}return val;}},{key:"parent",get:function get(){return this._parent?this._parent.nextSignificantParent():null;}},{key:"nextSibling",get:function get(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4/* DontCare */):null;}},{key:"prevSibling",get:function get(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4/* DontCare */):null;}},{key:"cursor",get:function get(){return new TreeCursor(this);}},{key:"tree",get:function get(){return this.node;}},{key:"toTree",value:function toTree(){return this.node;}},{key:"resolve",value:function resolve(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return resolveNode(this,pos,side,false);}},{key:"resolveInner",value:function resolveInner(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return resolveNode(this,pos,side,true);}},{key:"enterUnfinishedNodesBefore",value:function enterUnfinishedNodesBefore(pos){return _enterUnfinishedNodesBefore(this,pos);}},{key:"getChild",value:function getChild(type){var before=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var after=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var r=_getChildren(this,type,before,after);return r.length?r[0]:null;}},{key:"getChildren",value:function getChildren(type){var before=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var after=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return _getChildren(this,type,before,after);}/// @internal 4790 + },{key:"toString",value:function toString(){return this.node.toString();}}]);return TreeNode;}();function _getChildren(node,type,before,after){var cur=node.cursor,result=[];if(!cur.firstChild())return result;if(before!=null)while(!cur.type.is(before)){if(!cur.nextSibling())return result;}for(;;){if(after!=null&&cur.type.is(after))return result;if(cur.type.is(type))result.push(cur.node);if(!cur.nextSibling())return after==null?result:[];}}var BufferContext=/*#__PURE__*/_createClass(function BufferContext(parent,buffer,index,start){_classCallCheck(this,BufferContext);this.parent=parent;this.buffer=buffer;this.index=index;this.start=start;});var BufferNode=/*#__PURE__*/function(){function BufferNode(context,_parent,index){_classCallCheck(this,BufferNode);this.context=context;this._parent=_parent;this.index=index;this.type=context.buffer.set.types[context.buffer.buffer[index]];}_createClass(BufferNode,[{key:"name",get:function get(){return this.type.name;}},{key:"from",get:function get(){return this.context.start+this.context.buffer.buffer[this.index+1];}},{key:"to",get:function get(){return this.context.start+this.context.buffer.buffer[this.index+2];}},{key:"child",value:function child(dir,pos,side){var buffer=this.context.buffer;var index=buffer.findChild(this.index+4,buffer.buffer[this.index+3],dir,pos-this.context.start,side);return index<0?null:new BufferNode(this.context,this,index);}},{key:"firstChild",get:function get(){return this.child(1,0,4/* DontCare */);}},{key:"lastChild",get:function get(){return this.child(-1,0,4/* DontCare */);}},{key:"childAfter",value:function childAfter(pos){return this.child(1,pos,2/* After */);}},{key:"childBefore",value:function childBefore(pos){return this.child(-1,pos,-2/* Before */);}},{key:"enter",value:function enter(pos,side,overlays){var buffers=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;if(!buffers)return null;var buffer=this.context.buffer;var index=buffer.findChild(this.index+4,buffer.buffer[this.index+3],side>0?1:-1,pos-this.context.start,side);return index<0?null:new BufferNode(this.context,this,index);}},{key:"parent",get:function get(){return this._parent||this.context.parent.nextSignificantParent();}},{key:"externalSibling",value:function externalSibling(dir){return this._parent?null:this.context.parent.nextChild(this.context.index+dir,dir,0,4/* DontCare */);}},{key:"nextSibling",get:function get(){var buffer=this.context.buffer;var after=buffer.buffer[this.index+3];if(after<(this._parent?buffer.buffer[this._parent.index+3]:buffer.buffer.length))return new BufferNode(this.context,this._parent,after);return this.externalSibling(1);}},{key:"prevSibling",get:function get(){var buffer=this.context.buffer;var parentStart=this._parent?this._parent.index+4:0;if(this.index==parentStart)return this.externalSibling(-1);return new BufferNode(this.context,this._parent,buffer.findChild(parentStart,this.index,-1,0,4/* DontCare */));}},{key:"cursor",get:function get(){return new TreeCursor(this);}},{key:"tree",get:function get(){return null;}},{key:"toTree",value:function toTree(){var children=[],positions=[];var buffer=this.context.buffer;var startI=this.index+4,endI=buffer.buffer[this.index+3];if(endI>startI){var from=buffer.buffer[this.index+1],to=buffer.buffer[this.index+2];children.push(buffer.slice(startI,endI,from,to));positions.push(0);}return new Tree(this.type,children,positions,this.to-this.from);}},{key:"resolve",value:function resolve(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return resolveNode(this,pos,side,false);}},{key:"resolveInner",value:function resolveInner(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;return resolveNode(this,pos,side,true);}},{key:"enterUnfinishedNodesBefore",value:function enterUnfinishedNodesBefore(pos){return _enterUnfinishedNodesBefore(this,pos);}/// @internal 4791 + },{key:"toString",value:function toString(){return this.context.buffer.childString(this.index);}},{key:"getChild",value:function getChild(type){var before=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var after=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var r=_getChildren(this,type,before,after);return r.length?r[0]:null;}},{key:"getChildren",value:function getChildren(type){var before=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var after=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;return _getChildren(this,type,before,after);}}]);return BufferNode;}();/// A tree cursor object focuses on a given node in a syntax tree, and 4792 + /// allows you to move to adjacent nodes. 4793 + var TreeCursor=/*#__PURE__*/function(){/// @internal 4794 + function TreeCursor(node){var mode=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;_classCallCheck(this,TreeCursor);this.mode=mode;this.buffer=null;this.stack=[];this.index=0;this.bufferNode=null;if(node instanceof TreeNode){this.yieldNode(node);}else{this._tree=node.context.parent;this.buffer=node.context;for(var n=node._parent;n;n=n._parent){this.stack.unshift(n.index);}this.bufferNode=node;this.yieldBuf(node.index);}}/// Shorthand for `.type.name`. 4795 + _createClass(TreeCursor,[{key:"name",get:function get(){return this.type.name;}},{key:"yieldNode",value:function yieldNode(node){if(!node)return false;this._tree=node;this.type=node.type;this.from=node.from;this.to=node.to;return true;}},{key:"yieldBuf",value:function yieldBuf(index,type){this.index=index;var _this$buffer=this.buffer,start=_this$buffer.start,buffer=_this$buffer.buffer;this.type=type||buffer.set.types[buffer.buffer[index]];this.from=start+buffer.buffer[index+1];this.to=start+buffer.buffer[index+2];return true;}},{key:"yield",value:function _yield(node){if(!node)return false;if(node instanceof TreeNode){this.buffer=null;return this.yieldNode(node);}this.buffer=node.context;return this.yieldBuf(node.index,node.type);}/// @internal 4796 + },{key:"toString",value:function toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString();}/// @internal 4797 + },{key:"enterChild",value:function enterChild(dir,pos,side){if(!this.buffer)return this["yield"](this._tree.nextChild(dir<0?this._tree.node.children.length-1:0,dir,pos,side,this.mode));var buffer=this.buffer.buffer;var index=buffer.findChild(this.index+4,buffer.buffer[this.index+3],dir,pos-this.buffer.start,side);if(index<0)return false;this.stack.push(this.index);return this.yieldBuf(index);}/// Move the cursor to this node's first child. When this returns 4798 + /// false, the node has no child, and the cursor has not been moved. 4799 + },{key:"firstChild",value:function firstChild(){return this.enterChild(1,0,4/* DontCare */);}/// Move the cursor to this node's last child. 4800 + },{key:"lastChild",value:function lastChild(){return this.enterChild(-1,0,4/* DontCare */);}/// Move the cursor to the first child that ends after `pos`. 4801 + },{key:"childAfter",value:function childAfter(pos){return this.enterChild(1,pos,2/* After */);}/// Move to the last child that starts before `pos`. 4802 + },{key:"childBefore",value:function childBefore(pos){return this.enterChild(-1,pos,-2/* Before */);}/// Move the cursor to the child around `pos`. If side is -1 the 4803 + /// child may end at that position, when 1 it may start there. This 4804 + /// will also enter [overlaid](#common.MountedTree.overlay) 4805 + /// [mounted](#common.NodeProp^mounted) trees unless `overlays` is 4806 + /// set to false. 4807 + },{key:"enter",value:function enter(pos,side){var overlays=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;var buffers=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;if(!this.buffer)return this["yield"](this._tree.enter(pos,side,overlays&&!(this.mode&1/* Full */),buffers));return buffers?this.enterChild(1,pos,side):false;}/// Move to the node's parent node, if this isn't the top node. 4808 + },{key:"parent",value:function parent(){if(!this.buffer)return this.yieldNode(this.mode&1/* Full */?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());var parent=this.mode&1/* Full */?this.buffer.parent:this.buffer.parent.nextSignificantParent();this.buffer=null;return this.yieldNode(parent);}/// @internal 4809 + },{key:"sibling",value:function sibling(dir){if(!this.buffer)return!this._tree._parent?false:this["yield"](this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+dir,dir,0,4/* DontCare */,this.mode));var buffer=this.buffer.buffer,d=this.stack.length-1;if(dir<0){var parentStart=d<0?0:this.stack[d]+4;if(this.index!=parentStart)return this.yieldBuf(buffer.findChild(parentStart,this.index,-1,0,4/* DontCare */));}else{var after=buffer.buffer[this.index+3];if(after<(d<0?buffer.buffer.length:buffer.buffer[this.stack[d]+3]))return this.yieldBuf(after);}return d<0?this["yield"](this.buffer.parent.nextChild(this.buffer.index+dir,dir,0,4/* DontCare */,this.mode)):false;}/// Move to this node's next sibling, if any. 4810 + },{key:"nextSibling",value:function nextSibling(){return this.sibling(1);}/// Move to this node's previous sibling, if any. 4811 + },{key:"prevSibling",value:function prevSibling(){return this.sibling(-1);}},{key:"atLastNode",value:function atLastNode(dir){var index,parent,buffer=this.buffer;if(buffer){if(dir>0){if(this.index<buffer.buffer.buffer.length)return false;}else{for(var _i191=0;_i191<this.index;_i191++){if(buffer.buffer.buffer[_i191+3]<this.index)return false;}}index=buffer.index;parent=buffer.parent;}else{var _this$_tree=this._tree;index=_this$_tree.index;parent=_this$_tree._parent;}for(;parent;_parent3=parent,index=_parent3.index,parent=_parent3._parent,_parent3){var _parent3;if(index>-1)for(var _i192=index+dir,e=dir<0?-1:parent.node.children.length;_i192!=e;_i192+=dir){var child=parent.node.children[_i192];if(this.mode&1/* Full */||child instanceof TreeBuffer||!child.type.isAnonymous||hasChild(child))return false;}}return true;}},{key:"move",value:function move(dir,enter){if(enter&&this.enterChild(dir,0,4/* DontCare */))return true;for(;;){if(this.sibling(dir))return true;if(this.atLastNode(dir)||!this.parent())return false;}}/// Move to the next node in a 4812 + /// [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order_(NLR)) 4813 + /// traversal, going from a node to its first child or, if the 4814 + /// current node is empty or `enter` is false, its next sibling or 4815 + /// the next sibling of the first parent node that has one. 4816 + },{key:"next",value:function next(){var enter=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;return this.move(1,enter);}/// Move to the next node in a last-to-first pre-order traveral. A 4817 + /// node is followed by its last child or, if it has none, its 4818 + /// previous sibling or the previous sibling of the first parent 4819 + /// node that has one. 4820 + },{key:"prev",value:function prev(){var enter=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;return this.move(-1,enter);}/// Move the cursor to the innermost node that covers `pos`. If 4821 + /// `side` is -1, it will enter nodes that end at `pos`. If it is 1, 4822 + /// it will enter nodes that start at `pos`. 4823 + },{key:"moveTo",value:function moveTo(pos){var side=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;// Move up to a node that actually holds the position, if possible 4824 + while(this.from==this.to||(side<1?this.from>=pos:this.from>pos)||(side>-1?this.to<=pos:this.to<pos)){if(!this.parent())break;}// Then scan down into child nodes as far as possible 4825 + while(this.enterChild(1,pos,side)){}return this;}/// Get a [syntax node](#common.SyntaxNode) at the cursor's current 4826 + /// position. 4827 + },{key:"node",get:function get(){if(!this.buffer)return this._tree;var cache=this.bufferNode,result=null,depth=0;if(cache&&cache.context==this.buffer){scan:for(var index=this.index,d=this.stack.length;d>=0;){for(var c=cache;c;c=c._parent){if(c.index==index){if(index==this.index)return c;result=c;depth=d+1;break scan;}}index=this.stack[--d];}}for(var _i193=depth;_i193<this.stack.length;_i193++){result=new BufferNode(this.buffer,result,this.stack[_i193]);}return this.bufferNode=new BufferNode(this.buffer,result,this.index);}/// Get the [tree](#common.Tree) that represents the current node, if 4828 + /// any. Will return null when the node is in a [tree 4829 + /// buffer](#common.TreeBuffer). 4830 + },{key:"tree",get:function get(){return this.buffer?null:this._tree.node;}}]);return TreeCursor;}();function hasChild(tree){return tree.children.some(function(ch){return ch instanceof TreeBuffer||!ch.type.isAnonymous||hasChild(ch);});}function buildTree(data){var _a;var buffer=data.buffer,nodeSet=data.nodeSet,_data$maxBufferLength=data.maxBufferLength,maxBufferLength=_data$maxBufferLength===void 0?DefaultBufferLength:_data$maxBufferLength,_data$reused=data.reused,reused=_data$reused===void 0?[]:_data$reused,_data$minRepeatType=data.minRepeatType,minRepeatType=_data$minRepeatType===void 0?nodeSet.types.length:_data$minRepeatType;var cursor=Array.isArray(buffer)?new FlatBufferCursor(buffer,buffer.length):buffer;var types=nodeSet.types;var contextHash=0,lookAhead=0;function takeNode(parentStart,minPos,children,positions,inRepeat){var id=cursor.id,start=cursor.start,end=cursor.end,size=cursor.size;var lookAheadAtStart=lookAhead;while(size<0){cursor.next();if(size==-1/* Reuse */){var _node=reused[id];children.push(_node);positions.push(start-parentStart);return;}else if(size==-3/* ContextChange */){// Context change 4831 + contextHash=id;return;}else if(size==-4/* LookAhead */){lookAhead=id;return;}else{throw new RangeError("Unrecognized record size: ".concat(size));}}var type=types[id],node,buffer;var startPos=start-parentStart;if(end-start<=maxBufferLength&&(buffer=findBufferSize(cursor.pos-minPos,inRepeat))){// Small enough for a buffer, and no reused nodes inside 4832 + var _data=new Uint16Array(buffer.size-buffer.skip);var endPos=cursor.pos-buffer.size,index=_data.length;while(cursor.pos>endPos){index=copyToBuffer(buffer.start,_data,index);}node=new TreeBuffer(_data,end-buffer.start,nodeSet);startPos=buffer.start-parentStart;}else{// Make it a node 4833 + var _endPos=cursor.pos-size;cursor.next();var localChildren=[],localPositions=[];var localInRepeat=id>=minRepeatType?id:-1;var lastGroup=0,lastEnd=end;while(cursor.pos>_endPos){if(localInRepeat>=0&&cursor.id==localInRepeat&&cursor.size>=0){if(cursor.end<=lastEnd-maxBufferLength){makeRepeatLeaf(localChildren,localPositions,start,lastGroup,cursor.end,lastEnd,localInRepeat,lookAheadAtStart);lastGroup=localChildren.length;lastEnd=cursor.end;}cursor.next();}else{takeNode(start,_endPos,localChildren,localPositions,localInRepeat);}}if(localInRepeat>=0&&lastGroup>0&&lastGroup<localChildren.length)makeRepeatLeaf(localChildren,localPositions,start,lastGroup,start,lastEnd,localInRepeat,lookAheadAtStart);localChildren.reverse();localPositions.reverse();if(localInRepeat>-1&&lastGroup>0){var make=makeBalanced(type);node=balanceRange(type,localChildren,localPositions,0,localChildren.length,0,end-start,make,make);}else{node=makeTree(type,localChildren,localPositions,end-start,lookAheadAtStart-end);}}children.push(node);positions.push(startPos);}function makeBalanced(type){return function(children,positions,length){var lookAhead=0,lastI=children.length-1,last,lookAheadProp;if(lastI>=0&&(last=children[lastI])instanceof Tree){if(!lastI&&last.type==type&&last.length==length)return last;if(lookAheadProp=last.prop(NodeProp.lookAhead))lookAhead=positions[lastI]+last.length+lookAheadProp;}return makeTree(type,children,positions,length,lookAhead);};}function makeRepeatLeaf(children,positions,base,i,from,to,type,lookAhead){var localChildren=[],localPositions=[];while(children.length>i){localChildren.push(children.pop());localPositions.push(positions.pop()+base-from);}children.push(makeTree(nodeSet.types[type],localChildren,localPositions,to-from,lookAhead-to));positions.push(from-base);}function makeTree(type,children,positions,length){var lookAhead=arguments.length>4&&arguments[4]!==undefined?arguments[4]:0;var props=arguments.length>5?arguments[5]:undefined;if(contextHash){var pair=[NodeProp.contextHash,contextHash];props=props?[pair].concat(props):[pair];}if(lookAhead>25){var _pair=[NodeProp.lookAhead,lookAhead];props=props?[_pair].concat(props):[_pair];}return new Tree(type,children,positions,length,props);}function findBufferSize(maxSize,inRepeat){// Scan through the buffer to find previous siblings that fit 4834 + // together in a TreeBuffer, and don't contain any reused nodes 4835 + // (which can't be stored in a buffer). 4836 + // If `inRepeat` is > -1, ignore node boundaries of that type for 4837 + // nesting, but make sure the end falls either at the start 4838 + // (`maxSize`) or before such a node. 4839 + var fork=cursor.fork();var size=0,start=0,skip=0,minStart=fork.end-maxBufferLength;var result={size:0,start:0,skip:0};scan:for(var minPos=fork.pos-maxSize;fork.pos>minPos;){var _nodeSize=fork.size;// Pretend nested repeat nodes of the same type don't exist 4840 + if(fork.id==inRepeat&&_nodeSize>=0){// Except that we store the current state as a valid return 4841 + // value. 4842 + result.size=size;result.start=start;result.skip=skip;skip+=4;size+=4;fork.next();continue;}var startPos=fork.pos-_nodeSize;if(_nodeSize<0||startPos<minPos||fork.start<minStart)break;var localSkipped=fork.id>=minRepeatType?4:0;var nodeStart=fork.start;fork.next();while(fork.pos>startPos){if(fork.size<0){if(fork.size==-3/* ContextChange */)localSkipped+=4;else break scan;}else if(fork.id>=minRepeatType){localSkipped+=4;}fork.next();}start=nodeStart;size+=_nodeSize;skip+=localSkipped;}if(inRepeat<0||size==maxSize){result.size=size;result.start=start;result.skip=skip;}return result.size>4?result:undefined;}function copyToBuffer(bufferStart,buffer,index){var id=cursor.id,start=cursor.start,end=cursor.end,size=cursor.size;cursor.next();if(size>=0&&id<minRepeatType){var startIndex=index;if(size>4){var endPos=cursor.pos-(size-4);while(cursor.pos>endPos){index=copyToBuffer(bufferStart,buffer,index);}}buffer[--index]=startIndex;buffer[--index]=end-bufferStart;buffer[--index]=start-bufferStart;buffer[--index]=id;}else if(size==-3/* ContextChange */){contextHash=id;}else if(size==-4/* LookAhead */){lookAhead=id;}return index;}var children=[],positions=[];while(cursor.pos>0){takeNode(data.start||0,data.bufferStart||0,children,positions,-1);}var length=(_a=data.length)!==null&&_a!==void 0?_a:children.length?positions[0]+children[0].length:0;return new Tree(types[data.topID],children.reverse(),positions.reverse(),length);}var nodeSizeCache=new WeakMap();function nodeSize(balanceType,node){if(!balanceType.isAnonymous||node instanceof TreeBuffer||node.type!=balanceType)return 1;var size=nodeSizeCache.get(node);if(size==null){size=1;var _iterator276=_createForOfIteratorHelper(node.children),_step276;try{for(_iterator276.s();!(_step276=_iterator276.n()).done;){var child=_step276.value;if(child.type!=balanceType||!(child instanceof Tree)){size=1;break;}size+=nodeSize(balanceType,child);}}catch(err){_iterator276.e(err);}finally{_iterator276.f();}nodeSizeCache.set(node,size);}return size;}function balanceRange(// The type the balanced tree's inner nodes. 4843 + balanceType,// The direct children and their positions 4844 + children,positions,// The index range in children/positions to use 4845 + from,to,// The start position of the nodes, relative to their parent. 4846 + start,// Length of the outer node 4847 + length,// Function to build the top node of the balanced tree 4848 + mkTop,// Function to build internal nodes for the balanced tree 4849 + mkTree){var total=0;for(var _i194=from;_i194<to;_i194++){total+=nodeSize(balanceType,children[_i194]);}var maxChild=Math.ceil(total*1.5/8/* BranchFactor */);var localChildren=[],localPositions=[];function divide(children,positions,from,to,offset){for(var _i195=from;_i195<to;){var groupFrom=_i195,groupStart=positions[_i195],groupSize=nodeSize(balanceType,children[_i195]);_i195++;for(;_i195<to;_i195++){var nextSize=nodeSize(balanceType,children[_i195]);if(groupSize+nextSize>=maxChild)break;groupSize+=nextSize;}if(_i195==groupFrom+1){if(groupSize>maxChild){var only=children[groupFrom];// Only trees can have a size > 1 4850 + divide(only.children,only.positions,0,only.children.length,positions[groupFrom]+offset);continue;}localChildren.push(children[groupFrom]);}else{var _length=positions[_i195-1]+children[_i195-1].length-groupStart;localChildren.push(balanceRange(balanceType,children,positions,groupFrom,_i195,groupStart,_length,null,mkTree));}localPositions.push(groupStart+offset-start);}}divide(children,positions,from,to,0);return(mkTop||mkTree)(localChildren,localPositions,length);}/// Tree fragments are used during [incremental 4851 + /// parsing](#common.Parser.startParse) to track parts of old trees 4852 + /// that can be reused in a new parse. An array of fragments is used 4853 + /// to track regions of an old tree whose nodes might be reused in new 4854 + /// parses. Use the static 4855 + /// [`applyChanges`](#common.TreeFragment^applyChanges) method to 4856 + /// update fragments for document changes. 4857 + var TreeFragment=/*#__PURE__*/function(){/// Construct a tree fragment. 4858 + function TreeFragment(/// The start of the unchanged range pointed to by this fragment. 4859 + /// This refers to an offset in the _updated_ document (as opposed 4860 + /// to the original tree). 4861 + from,/// The end of the unchanged range. 4862 + to,/// The tree that this fragment is based on. 4863 + tree,/// The offset between the fragment's tree and the document that 4864 + /// this fragment can be used against. Add this when going from 4865 + /// document to tree positions, subtract it to go from tree to 4866 + /// document positions. 4867 + offset){var openStart=arguments.length>4&&arguments[4]!==undefined?arguments[4]:false;var openEnd=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;_classCallCheck(this,TreeFragment);this.from=from;this.to=to;this.tree=tree;this.offset=offset;this.open=(openStart?1/* Start */:0)|(openEnd?2/* End */:0);}/// Whether the start of the fragment represents the start of a 4868 + /// parse, or the end of a change. (In the second case, it may not 4869 + /// be safe to reuse some nodes at the start, depending on the 4870 + /// parsing algorithm.) 4871 + _createClass(TreeFragment,[{key:"openStart",get:function get(){return(this.open&1/* Start */)>0;}/// Whether the end of the fragment represents the end of a 4872 + /// full-document parse, or the start of a change. 4873 + },{key:"openEnd",get:function get(){return(this.open&2/* End */)>0;}/// Create a set of fragments from a freshly parsed tree, or update 4874 + /// an existing set of fragments by replacing the ones that overlap 4875 + /// with a tree with content from the new tree. When `partial` is 4876 + /// true, the parse is treated as incomplete, and the resulting 4877 + /// fragment has [`openEnd`](#common.TreeFragment.openEnd) set to 4878 + /// true. 4879 + }],[{key:"addTree",value:function addTree(tree){var fragments=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var partial=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var result=[new TreeFragment(0,tree.length,tree,0,false,partial)];var _iterator277=_createForOfIteratorHelper(fragments),_step277;try{for(_iterator277.s();!(_step277=_iterator277.n()).done;){var f=_step277.value;if(f.to>tree.length)result.push(f);}}catch(err){_iterator277.e(err);}finally{_iterator277.f();}return result;}/// Apply a set of edits to an array of fragments, removing or 4880 + /// splitting fragments as necessary to remove edited ranges, and 4881 + /// adjusting offsets for fragments that moved. 4882 + },{key:"applyChanges",value:function applyChanges(fragments,changes){var minGap=arguments.length>2&&arguments[2]!==undefined?arguments[2]:128;if(!changes.length)return fragments;var result=[];var fI=1,nextF=fragments.length?fragments[0]:null;for(var cI=0,pos=0,off=0;;cI++){var nextC=cI<changes.length?changes[cI]:null;var nextPos=nextC?nextC.fromA:1e9;if(nextPos-pos>=minGap)while(nextF&&nextF.from<nextPos){var cut=nextF;if(pos>=cut.from||nextPos<=cut.to||off){var fFrom=Math.max(cut.from,pos)-off,fTo=Math.min(cut.to,nextPos)-off;cut=fFrom>=fTo?null:new TreeFragment(fFrom,fTo,cut.tree,cut.offset+off,cI>0,!!nextC);}if(cut)result.push(cut);if(nextF.to>nextPos)break;nextF=fI<fragments.length?fragments[fI++]:null;}if(!nextC)break;pos=nextC.toA;off=nextC.toA-nextC.toB;}return result;}}]);return TreeFragment;}();/// A superclass that parsers should extend. 4883 + var Parser=/*#__PURE__*/function(){function Parser(){_classCallCheck(this,Parser);}_createClass(Parser,[{key:"startParse",value:/// Start a parse, returning a [partial parse](#common.PartialParse) 4884 + /// object. [`fragments`](#common.TreeFragment) can be passed in to 4885 + /// make the parse incremental. 4886 + /// 4887 + /// By default, the entire input is parsed. You can pass `ranges`, 4888 + /// which should be a sorted array of non-empty, non-overlapping 4889 + /// ranges, to parse only those ranges. The tree returned in that 4890 + /// case will start at `ranges[0].from`. 4891 + function startParse(input,fragments,ranges){if(typeof input=="string")input=new StringInput(input);ranges=!ranges?[new Range(0,input.length)]:ranges.length?ranges.map(function(r){return new Range(r.from,r.to);}):[new Range(0,0)];return this.createParse(input,fragments||[],ranges);}/// Run a full parse, returning the resulting tree. 4892 + },{key:"parse",value:function parse(input,fragments,ranges){var parse=this.startParse(input,fragments,ranges);for(;;){var done=parse.advance();if(done)return done;}}}]);return Parser;}();var StringInput=/*#__PURE__*/function(){function StringInput(string){_classCallCheck(this,StringInput);this.string=string;}_createClass(StringInput,[{key:"length",get:function get(){return this.string.length;}},{key:"chunk",value:function chunk(from){return this.string.slice(from);}},{key:"lineChunks",get:function get(){return false;}},{key:"read",value:function read(from,to){return this.string.slice(from,to);}}]);return StringInput;}();/// Create a parse wrapper that, after the inner parse completes, 4893 + /// scans its tree for mixed language regions with the `nest` 4894 + /// function, runs the resulting [inner parses](#common.NestedParse), 4895 + /// and then [mounts](#common.NodeProp^mounted) their results onto the 4896 + /// tree. 4897 + /// 4898 + /// The nesting function is passed a cursor to provide context for a 4899 + /// node, but _should not_ move that cursor, only inspect its 4900 + /// properties and optionally access its 4901 + /// [node object](#common.TreeCursor.node). 4902 + function parseMixed(nest){return function(parse,input,fragments,ranges){return new MixedParse(parse,nest,input,fragments,ranges);};}var InnerParse=/*#__PURE__*/_createClass(function InnerParse(parser,parse,overlay,target,ranges){_classCallCheck(this,InnerParse);this.parser=parser;this.parse=parse;this.overlay=overlay;this.target=target;this.ranges=ranges;});var ActiveOverlay=/*#__PURE__*/_createClass(function ActiveOverlay(parser,predicate,mounts,index,start,target,prev){_classCallCheck(this,ActiveOverlay);this.parser=parser;this.predicate=predicate;this.mounts=mounts;this.index=index;this.start=start;this.target=target;this.prev=prev;this.depth=0;this.ranges=[];});var stoppedInner=new NodeProp({perNode:true});var MixedParse=/*#__PURE__*/function(){function MixedParse(base,nest,input,fragments,ranges){_classCallCheck(this,MixedParse);this.nest=nest;this.input=input;this.fragments=fragments;this.ranges=ranges;this.inner=[];this.innerDone=0;this.baseTree=null;this.stoppedAt=null;this.baseParse=base;}_createClass(MixedParse,[{key:"advance",value:function advance(){if(this.baseParse){var _done=this.baseParse.advance();if(!_done)return null;this.baseParse=null;this.baseTree=_done;this.startInner();if(this.stoppedAt!=null){var _iterator278=_createForOfIteratorHelper(this.inner),_step278;try{for(_iterator278.s();!(_step278=_iterator278.n()).done;){var _inner=_step278.value;_inner.parse.stopAt(this.stoppedAt);}}catch(err){_iterator278.e(err);}finally{_iterator278.f();}}}if(this.innerDone==this.inner.length){var result=this.baseTree;if(this.stoppedAt!=null)result=new Tree(result.type,result.children,result.positions,result.length,result.propValues.concat([[stoppedInner,this.stoppedAt]]));return result;}var inner=this.inner[this.innerDone],done=inner.parse.advance();if(done){this.innerDone++;// This is a somewhat dodgy but super helpful hack where we 4903 + // patch up nodes created by the inner parse (and thus 4904 + // presumably not aliased anywhere else) to hold the information 4905 + // about the inner parse. 4906 + var props=Object.assign(Object.create(null),inner.target.props);props[NodeProp.mounted.id]=new MountedTree(done,inner.overlay,inner.parser);inner.target.props=props;}return null;}},{key:"parsedPos",get:function get(){if(this.baseParse)return 0;var pos=this.input.length;for(var _i196=this.innerDone;_i196<this.inner.length;_i196++){if(this.inner[_i196].ranges[0].from<pos)pos=Math.min(pos,this.inner[_i196].parse.parsedPos);}return pos;}},{key:"stopAt",value:function stopAt(pos){this.stoppedAt=pos;if(this.baseParse)this.baseParse.stopAt(pos);else for(var _i197=this.innerDone;_i197<this.inner.length;_i197++){this.inner[_i197].parse.stopAt(pos);}}},{key:"startInner",value:function startInner(){var fragmentCursor=new FragmentCursor(this.fragments);var overlay=null;var covered=null;var cursor=new TreeCursor(new TreeNode(this.baseTree,this.ranges[0].from,0,null),1/* Full */);scan:for(var nest,isCovered;this.stoppedAt==null||cursor.from<this.stoppedAt;){var enter=true,range=void 0;if(fragmentCursor.hasNode(cursor)){if(overlay){var match=overlay.mounts.find(function(m){return m.frag.from<=cursor.from&&m.frag.to>=cursor.to&&m.mount.overlay;});if(match){var _iterator279=_createForOfIteratorHelper(match.mount.overlay),_step279;try{for(_iterator279.s();!(_step279=_iterator279.n()).done;){var r=_step279.value;var from=r.from+match.pos,to=r.to+match.pos;if(from>=cursor.from&&to<=cursor.to)overlay.ranges.push({from:from,to:to});}}catch(err){_iterator279.e(err);}finally{_iterator279.f();}}}enter=false;}else if(covered&&(isCovered=checkCover(covered.ranges,cursor.from,cursor.to))){enter=isCovered!=2/* Full */;}else if(!cursor.type.isAnonymous&&cursor.from<cursor.to&&(nest=this.nest(cursor,this.input))){if(!cursor.tree)materialize(cursor);var oldMounts=fragmentCursor.findMounts(cursor.from,nest.parser);if(typeof nest.overlay=="function"){overlay=new ActiveOverlay(nest.parser,nest.overlay,oldMounts,this.inner.length,cursor.from,cursor.tree,overlay);}else{var ranges=punchRanges(this.ranges,nest.overlay||[new Range(cursor.from,cursor.to)]);if(ranges.length)this.inner.push(new InnerParse(nest.parser,nest.parser.startParse(this.input,enterFragments(oldMounts,ranges),ranges),nest.overlay?nest.overlay.map(function(r){return new Range(r.from-cursor.from,r.to-cursor.from);}):null,cursor.tree,ranges));if(!nest.overlay)enter=false;else if(ranges.length)covered={ranges:ranges,depth:0,prev:covered};}}else if(overlay&&(range=overlay.predicate(cursor))){if(range===true)range=new Range(cursor.from,cursor.to);if(range.from<range.to)overlay.ranges.push(range);}if(enter&&cursor.firstChild()){if(overlay)overlay.depth++;if(covered)covered.depth++;}else{for(;;){if(cursor.nextSibling())break;if(!cursor.parent())break scan;if(overlay&&! --overlay.depth){var _ranges=punchRanges(this.ranges,overlay.ranges);if(_ranges.length)this.inner.splice(overlay.index,0,new InnerParse(overlay.parser,overlay.parser.startParse(this.input,enterFragments(overlay.mounts,_ranges),_ranges),overlay.ranges.map(function(r){return new Range(r.from-overlay.start,r.to-overlay.start);}),overlay.target,_ranges));overlay=overlay.prev;}if(covered&&! --covered.depth)covered=covered.prev;}}}}}]);return MixedParse;}();function checkCover(covered,from,to){var _iterator280=_createForOfIteratorHelper(covered),_step280;try{for(_iterator280.s();!(_step280=_iterator280.n()).done;){var range=_step280.value;if(range.from>=to)break;if(range.to>from)return range.from<=from&&range.to>=to?2/* Full */:1/* Partial */;}}catch(err){_iterator280.e(err);}finally{_iterator280.f();}return 0/* None */;}// Take a piece of buffer and convert it into a stand-alone 4907 + // TreeBuffer. 4908 + function sliceBuf(buf,startI,endI,nodes,positions,off){if(startI<endI){var from=buf.buffer[startI+1],to=buf.buffer[endI-2];nodes.push(buf.slice(startI,endI,from,to));positions.push(from-off);}}// This function takes a node that's in a buffer, and converts it, and 4909 + // its parent buffer nodes, into a Tree. This is again acting on the 4910 + // assumption that the trees and buffers have been constructed by the 4911 + // parse that was ran via the mix parser, and thus aren't shared with 4912 + // any other code, making violations of the immutability safe. 4913 + function materialize(cursor){var node=cursor.node,depth=0;// Scan up to the nearest tree 4914 + do{cursor.parent();depth++;}while(!cursor.tree);// Find the index of the buffer in that tree 4915 + var i=0,base=cursor.tree,off=0;for(;;i++){off=base.positions[i]+cursor.from;if(off<=node.from&&off+base.children[i].length>=node.to)break;}var buf=base.children[i],b=buf.buffer;// Split a level in the buffer, putting the nodes before and after 4916 + // the child that contains `node` into new buffers. 4917 + function split(startI,endI,type,innerOffset,length){var i=startI;while(b[i+2]+off<=node.from){i=b[i+3];}var children=[],positions=[];sliceBuf(buf,startI,i,children,positions,innerOffset);var from=b[i+1],to=b[i+2];var isTarget=from+off==node.from&&to+off==node.to&&b[i]==node.type.id;children.push(isTarget?node.toTree():split(i+4,b[i+3],buf.set.types[b[i]],from,to-from));positions.push(from-innerOffset);sliceBuf(buf,b[i+3],endI,children,positions,innerOffset);return new Tree(type,children,positions,length);}base.children[i]=split(0,b.length,NodeType.none,0,buf.length);// Move the cursor back to the target node 4918 + for(var d=0;d<=depth;d++){cursor.childAfter(node.from);}}var StructureCursor=/*#__PURE__*/function(){function StructureCursor(root,offset){_classCallCheck(this,StructureCursor);this.offset=offset;this.done=false;this.cursor=root.fullCursor();}// Move to the first node (in pre-order) that starts at or after `pos`. 4919 + _createClass(StructureCursor,[{key:"moveTo",value:function moveTo(pos){var cursor=this.cursor,p=pos-this.offset;while(!this.done&&cursor.from<p){if(cursor.to>=pos&&cursor.enter(p,1,false,false));else if(!cursor.next(false))this.done=true;}}},{key:"hasNode",value:function hasNode(cursor){this.moveTo(cursor.from);if(!this.done&&this.cursor.from+this.offset==cursor.from&&this.cursor.tree){for(var tree=this.cursor.tree;;){if(tree==cursor.tree)return true;if(tree.children.length&&tree.positions[0]==0&&tree.children[0]instanceof Tree)tree=tree.children[0];else break;}}return false;}}]);return StructureCursor;}();var FragmentCursor=/*#__PURE__*/function(){function FragmentCursor(fragments){_classCallCheck(this,FragmentCursor);var _a;this.fragments=fragments;this.curTo=0;this.fragI=0;if(fragments.length){var first=this.curFrag=fragments[0];this.curTo=(_a=first.tree.prop(stoppedInner))!==null&&_a!==void 0?_a:first.to;this.inner=new StructureCursor(first.tree,-first.offset);}else{this.curFrag=this.inner=null;}}_createClass(FragmentCursor,[{key:"hasNode",value:function hasNode(node){while(this.curFrag&&node.from>=this.curTo){this.nextFrag();}return this.curFrag&&this.curFrag.from<=node.from&&this.curTo>=node.to&&this.inner.hasNode(node);}},{key:"nextFrag",value:function nextFrag(){var _a;this.fragI++;if(this.fragI==this.fragments.length){this.curFrag=this.inner=null;}else{var frag=this.curFrag=this.fragments[this.fragI];this.curTo=(_a=frag.tree.prop(stoppedInner))!==null&&_a!==void 0?_a:frag.to;this.inner=new StructureCursor(frag.tree,-frag.offset);}}},{key:"findMounts",value:function findMounts(pos,parser){var _a;var result=[];if(this.inner){this.inner.cursor.moveTo(pos,1);for(var _pos3=this.inner.cursor.node;_pos3;_pos3=_pos3.parent){var mount=(_a=_pos3.tree)===null||_a===void 0?void 0:_a.prop(NodeProp.mounted);if(mount&&mount.parser==parser){for(var _i198=this.fragI;_i198<this.fragments.length;_i198++){var frag=this.fragments[_i198];if(frag.from>=_pos3.to)break;if(frag.tree==this.curFrag.tree)result.push({frag:frag,pos:_pos3.from-frag.offset,mount:mount});}}}}return result;}}]);return FragmentCursor;}();function punchRanges(outer,ranges){var copy=null,current=ranges;for(var _i199=1,j=0;_i199<outer.length;_i199++){var gapFrom=outer[_i199-1].to,gapTo=outer[_i199].from;for(;j<current.length;j++){var r=current[j];if(r.from>=gapTo)break;if(r.to<=gapFrom)continue;if(!copy)current=copy=ranges.slice();if(r.from<gapFrom){copy[j]=new Range(r.from,gapFrom);if(r.to>gapTo)copy.splice(j+1,0,new Range(gapTo,r.to));}else if(r.to>gapTo){copy[j--]=new Range(gapTo,r.to);}else{copy.splice(j--,1);}}}return current;}function findCoverChanges(a,b,from,to){var iA=0,iB=0,inA=false,inB=false,pos=-1e9;var result=[];for(;;){var nextA=iA==a.length?1e9:inA?a[iA].to:a[iA].from;var nextB=iB==b.length?1e9:inB?b[iB].to:b[iB].from;if(inA!=inB){var start=Math.max(pos,from),end=Math.min(nextA,nextB,to);if(start<end)result.push(new Range(start,end));}pos=Math.min(nextA,nextB);if(pos==1e9)break;if(nextA==pos){if(!inA)inA=true;else{inA=false;iA++;}}if(nextB==pos){if(!inB)inB=true;else{inB=false;iB++;}}}return result;}// Given a number of fragments for the outer tree, and a set of ranges 4920 + // to parse, find fragments for inner trees mounted around those 4921 + // ranges, if any. 4922 + function enterFragments(mounts,ranges){var result=[];var _iterator281=_createForOfIteratorHelper(mounts),_step281;try{var _loop27=function _loop27(){var _step281$value=_step281.value,pos=_step281$value.pos,mount=_step281$value.mount,frag=_step281$value.frag;var startPos=pos+(mount.overlay?mount.overlay[0].from:0),endPos=startPos+mount.tree.length;var from=Math.max(frag.from,startPos),to=Math.min(frag.to,endPos);if(mount.overlay){var overlay=mount.overlay.map(function(r){return new Range(r.from+pos,r.to+pos);});var changes=findCoverChanges(ranges,overlay,from,to);for(var _i200=0,_pos4=from;;_i200++){var last=_i200==changes.length,end=last?to:changes[_i200].from;if(end>_pos4)result.push(new TreeFragment(_pos4,end,mount.tree,-startPos,frag.from>=_pos4,frag.to<=end));if(last)break;_pos4=changes[_i200].to;}}else{result.push(new TreeFragment(from,to,mount.tree,-startPos,frag.from>=startPos,frag.to<=endPos));}};for(_iterator281.s();!(_step281=_iterator281.n()).done;){_loop27();}}catch(err){_iterator281.e(err);}finally{_iterator281.f();}return result;}exports.DefaultBufferLength=DefaultBufferLength;exports.MountedTree=MountedTree;exports.NodeProp=NodeProp;exports.NodeSet=NodeSet;exports.NodeType=NodeType;exports.Parser=Parser;exports.Tree=Tree;exports.TreeBuffer=TreeBuffer;exports.TreeCursor=TreeCursor;exports.TreeFragment=TreeFragment;exports.parseMixed=parseMixed;},{}],29:[function(require,module,exports){'use strict';function crelt(){var elt=arguments[0];if(typeof elt=="string")elt=document.createElement(elt);var i=1,next=arguments[1];if(next&&_typeof(next)=="object"&&next.nodeType==null&&!Array.isArray(next)){for(var name in next){if(Object.prototype.hasOwnProperty.call(next,name)){var value=next[name];if(typeof value=="string")elt.setAttribute(name,value);else if(value!=null)elt[name]=value;}}i++;}for(;i<arguments.length;i++){add(elt,arguments[i]);}return elt;}function add(elt,child){if(typeof child=="string"){elt.appendChild(document.createTextNode(child));}else if(child==null);else if(child.nodeType!=null){elt.appendChild(child);}else if(Array.isArray(child)){for(var i=0;i<child.length;i++){add(elt,child[i]);}}else{throw new RangeError("Unsupported child node: "+child);}}module.exports=crelt;},{}],30:[function(require,module,exports){var C="\u037C";var COUNT=typeof Symbol=="undefined"?"__"+C:Symbol["for"](C);var SET=typeof Symbol=="undefined"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet");var top=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:{};// :: - Style modules encapsulate a set of CSS rules defined from 4923 + // JavaScript. Their definitions are only available in a given DOM 4924 + // root after it has been _mounted_ there with `StyleModule.mount`. 4925 + // 4926 + // Style modules should be created once and stored somewhere, as 4927 + // opposed to re-creating them every time you need them. The amount of 4928 + // CSS rules generated for a given DOM root is bounded by the amount 4929 + // of style modules that were used. So to avoid leaking rules, don't 4930 + // create these dynamically, but treat them as one-time allocations. 4931 + var StyleModule=exports.StyleModule=function StyleModule(spec,options){this.rules=[];var ref=options||{};var finish=ref.finish;function splitSelector(selector){return /^@/.test(selector)?[selector]:selector.split(/,\s*/);}function render(selectors,spec,target,isKeyframes){var local=[],isAt=/^@(\w+)\b/.exec(selectors[0]),keyframes=isAt&&isAt[1]=="keyframes";if(isAt&&spec==null){return target.push(selectors[0]+";");}for(var prop in spec){var value=spec[prop];if(/&/.test(prop)){render(prop.split(/,\s*/).map(function(part){return selectors.map(function(sel){return part.replace(/&/,sel);});}).reduce(function(a,b){return a.concat(b);}),value,target);}else if(value&&_typeof(value)=="object"){if(!isAt){throw new RangeError("The value of a property ("+prop+") should be a primitive value.");}render(splitSelector(prop),value,local,keyframes);}else if(value!=null){local.push(prop.replace(/_.*/,"").replace(/[A-Z]/g,function(l){return"-"+l.toLowerCase();})+": "+value+";");}}if(local.length||keyframes){target.push((finish&&!isAt&&!isKeyframes?selectors.map(finish):selectors).join(", ")+" {"+local.join(" ")+"}");}}for(var prop in spec){render(splitSelector(prop),spec[prop],this.rules);}};// :: () → string 4932 + // Returns a string containing the module's CSS rules. 4933 + StyleModule.prototype.getRules=function getRules(){return this.rules.join("\n");};// :: () → string 4934 + // Generate a new unique CSS class name. 4935 + StyleModule.newName=function newName(){var id=top[COUNT]||1;top[COUNT]=id+1;return C+id.toString(36);};// :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>) 4936 + // 4937 + // Mount the given set of modules in the given DOM root, which ensures 4938 + // that the CSS rules defined by the module are available in that 4939 + // context. 4940 + // 4941 + // Rules are only added to the document once per root. 4942 + // 4943 + // Rule order will follow the order of the modules, so that rules from 4944 + // modules later in the array take precedence of those from earlier 4945 + // modules. If you call this function multiple times for the same root 4946 + // in a way that changes the order of already mounted modules, the old 4947 + // order will be changed. 4948 + StyleModule.mount=function mount(root,modules){(root[SET]||new StyleSet(root)).mount(Array.isArray(modules)?modules:[modules]);};var adoptedSet=null;var StyleSet=function StyleSet(root){if(!root.head&&root.adoptedStyleSheets&&typeof CSSStyleSheet!="undefined"){if(adoptedSet){root.adoptedStyleSheets=[adoptedSet.sheet].concat(root.adoptedStyleSheets);return root[SET]=adoptedSet;}this.sheet=new CSSStyleSheet();root.adoptedStyleSheets=[this.sheet].concat(root.adoptedStyleSheets);adoptedSet=this;}else{this.styleTag=(root.ownerDocument||root).createElement("style");var target=root.head||root;target.insertBefore(this.styleTag,target.firstChild);}this.modules=[];root[SET]=this;};StyleSet.prototype.mount=function mount(modules){var sheet=this.sheet;var pos=0/* Current rule offset */,j=0;/* Index into this.modules */for(var i=0;i<modules.length;i++){var mod=modules[i],index=this.modules.indexOf(mod);if(index<j&&index>-1){// Ordering conflict 4949 + this.modules.splice(index,1);j--;index=-1;}if(index==-1){this.modules.splice(j++,0,mod);if(sheet){for(var k=0;k<mod.rules.length;k++){sheet.insertRule(mod.rules[k],pos++);}}}else{while(j<index){pos+=this.modules[j++].rules.length;}pos+=mod.rules.length;j++;}}if(!sheet){var text="";for(var i$1=0;i$1<this.modules.length;i$1++){text+=this.modules[i$1].getRules()+"\n";}this.styleTag.textContent=text;}};// Style::Object<union<Style,string>> 4950 + // 4951 + // A style is an object that, in the simple case, maps CSS property 4952 + // names to strings holding their values, as in `{color: "red", 4953 + // fontWeight: "bold"}`. The property names can be given in 4954 + // camel-case—the library will insert a dash before capital letters 4955 + // when converting them to CSS. 4956 + // 4957 + // If you include an underscore in a property name, it and everything 4958 + // after it will be removed from the output, which can be useful when 4959 + // providing a property multiple times, for browser compatibility 4960 + // reasons. 4961 + // 4962 + // A property in a style object can also be a sub-selector, which 4963 + // extends the current context to add a pseudo-selector or a child 4964 + // selector. Such a property should contain a `&` character, which 4965 + // will be replaced by the current selector. For example `{"&:before": 4966 + // {content: '"hi"'}}`. Sub-selectors and regular properties can 4967 + // freely be mixed in a given object. Any property containing a `&` is 4968 + // assumed to be a sub-selector. 4969 + // 4970 + // Finally, a property can specify an @-block to be wrapped around the 4971 + // styles defined inside the object that's the property's value. For 4972 + // example to create a media query you can do `{"@media screen and 4973 + // (min-width: 400px)": {...}}`. 4974 + },{}],31:[function(require,module,exports){'use strict';Object.defineProperty(exports,'__esModule',{value:true});var base={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"};var shift={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"};var chrome=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent);var safari=typeof navigator!="undefined"&&/Apple Computer/.test(navigator.vendor);var gecko=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent);var mac=typeof navigator!="undefined"&&/Mac/.test(navigator.platform);var ie=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);var brokenModifierNames=chrome&&(mac||+chrome[1]<57)||gecko&&mac;// Fill in the digit keys 4975 + for(var i=0;i<10;i++){base[48+i]=base[96+i]=String(i);}// The function keys 4976 + for(var i=1;i<=24;i++){base[i+111]="F"+i;}// And the alphabetic keys 4977 + for(var i=65;i<=90;i++){base[i]=String.fromCharCode(i+32);shift[i]=String.fromCharCode(i);}// For each code that doesn't have a shift-equivalent, copy the base name 4978 + for(var code in base){if(!shift.hasOwnProperty(code))shift[code]=base[code];}function keyName(event){// Don't trust event.key in Chrome when there are modifiers until 4979 + // they fix https://bugs.chromium.org/p/chromium/issues/detail?id=633838 4980 + var ignoreKey=brokenModifierNames&&(event.ctrlKey||event.altKey||event.metaKey)||(safari||ie)&&event.shiftKey&&event.key&&event.key.length==1;var name=!ignoreKey&&event.key||(event.shiftKey?shift:base)[event.keyCode]||event.key||"Unidentified";// Edge sometimes produces wrong names (Issue #3) 4981 + if(name=="Esc")name="Escape";if(name=="Del")name="Delete";// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/ 4982 + if(name=="Left")name="ArrowLeft";if(name=="Up")name="ArrowUp";if(name=="Right")name="ArrowRight";if(name=="Down")name="ArrowDown";return name;}exports.base=base;exports.keyName=keyName;exports.shift=shift;},{}],32:[function(require,module,exports){(function(global){(function(){var cm={View:require('@codemirror/basic-setup').EditorView,State:require('@codemirror/basic-setup').EditorState,lint:require('@codemirror/lint'),autocomplete:require('@codemirror/autocomplete'),basicSetup:require('@codemirror/basic-setup').basicSetup,dark:require('@codemirror/theme-one-dark'),streamParser:require('@codemirror/stream-parser'),OCaml:require('@codemirror/legacy-modes/mode/mllike.cjs').oCaml};global.CodeMirror=cm;module.exports=cm;}).call(this);}).call(this,typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{});},{"@codemirror/autocomplete":1,"@codemirror/basic-setup":2,"@codemirror/legacy-modes/mode/mllike.cjs":14,"@codemirror/lint":15,"@codemirror/stream-parser":23,"@codemirror/theme-one-dark":25}]},{},[32])(32);});
+14
vendor/out/code-mirror.js
··· 1 + "use strict"; 2 + 3 + var cm = { 4 + View: require('@codemirror/basic-setup').EditorView, 5 + State: require('@codemirror/basic-setup').EditorState, 6 + lint: require('@codemirror/lint'), 7 + autocomplete: require('@codemirror/autocomplete'), 8 + basicSetup: require('@codemirror/basic-setup').basicSetup, 9 + dark: require('@codemirror/theme-one-dark'), 10 + streamParser: require('@codemirror/stream-parser'), 11 + OCaml: require('@codemirror/legacy-modes/mode/mllike.cjs').oCaml 12 + }; 13 + global.CodeMirror = cm; 14 + module.exports = cm;