From fad2c873bf2275d785c44e2cb768d7922ff6038b Mon Sep 17 00:00:00 2001 From: Didier Date: Sat, 25 Nov 2023 11:20:45 +0100 Subject: [PATCH] markdown editor --- app/Http/Controllers/HomeController.php | 9 + composer.json | 1 + package-lock.json | 1387 ++++--- package.json | 2 + public/css/all.css | 17 + public/js/all.js | 13 +- public/vendors/ckeditor/LICENSE.md | 21 - public/vendors/ckeditor/README.md | 9 - public/vendors/ckeditor/ckeditor.js | 6 - public/vendors/ckeditor/ckeditor.js.map | 1 - public/vendors/ckeditor/index.html | 122 - public/vendors/ckeditor/sample/css/sample.css | 356 -- public/vendors/ckeditor/sample/img/bg.png | Bin 6777 -> 0 bytes public/vendors/ckeditor/sample/img/github.svg | 4 - public/vendors/ckeditor/sample/img/logo.svg | 10 - .../vendors/ckeditor/sample/img/umbrellas.jpg | Bin 51250 -> 0 bytes public/vendors/ckeditor/translations/ar.js | 1 - public/vendors/ckeditor/translations/ast.js | 1 - public/vendors/ckeditor/translations/az.js | 1 - public/vendors/ckeditor/translations/bg.js | 1 - public/vendors/ckeditor/translations/ca.js | 1 - public/vendors/ckeditor/translations/cs.js | 1 - public/vendors/ckeditor/translations/da.js | 1 - public/vendors/ckeditor/translations/de-ch.js | 1 - public/vendors/ckeditor/translations/de.js | 1 - public/vendors/ckeditor/translations/el.js | 1 - public/vendors/ckeditor/translations/en-au.js | 1 - public/vendors/ckeditor/translations/eo.js | 1 - public/vendors/ckeditor/translations/es.js | 1 - public/vendors/ckeditor/translations/et.js | 1 - public/vendors/ckeditor/translations/eu.js | 1 - public/vendors/ckeditor/translations/fa.js | 1 - public/vendors/ckeditor/translations/fi.js | 1 - public/vendors/ckeditor/translations/fr.js | 1 - public/vendors/ckeditor/translations/gl.js | 1 - public/vendors/ckeditor/translations/gu.js | 1 - public/vendors/ckeditor/translations/he.js | 1 - public/vendors/ckeditor/translations/hr.js | 1 - public/vendors/ckeditor/translations/hu.js | 1 - public/vendors/ckeditor/translations/id.js | 1 - public/vendors/ckeditor/translations/it.js | 1 - public/vendors/ckeditor/translations/ja.js | 1 - public/vendors/ckeditor/translations/km.js | 1 - public/vendors/ckeditor/translations/kn.js | 1 - public/vendors/ckeditor/translations/ko.js | 1 - public/vendors/ckeditor/translations/ku.js | 1 - public/vendors/ckeditor/translations/lv.js | 1 - public/vendors/ckeditor/translations/nb.js | 1 - public/vendors/ckeditor/translations/ne.js | 1 - public/vendors/ckeditor/translations/nl.js | 1 - public/vendors/ckeditor/translations/no.js | 1 - public/vendors/ckeditor/translations/oc.js | 1 - public/vendors/ckeditor/translations/pl.js | 1 - public/vendors/ckeditor/translations/pt-br.js | 1 - public/vendors/ckeditor/translations/pt.js | 1 - public/vendors/ckeditor/translations/ro.js | 1 - public/vendors/ckeditor/translations/ru.js | 1 - public/vendors/ckeditor/translations/si.js | 1 - public/vendors/ckeditor/translations/sk.js | 1 - public/vendors/ckeditor/translations/sq.js | 1 - .../vendors/ckeditor/translations/sr-latn.js | 1 - public/vendors/ckeditor/translations/sr.js | 1 - public/vendors/ckeditor/translations/sv.js | 1 - public/vendors/ckeditor/translations/tr.js | 1 - public/vendors/ckeditor/translations/tt.js | 1 - public/vendors/ckeditor/translations/ug.js | 1 - public/vendors/ckeditor/translations/uk.js | 1 - public/vendors/ckeditor/translations/vi.js | 1 - public/vendors/ckeditor/translations/zh-cn.js | 1 - public/vendors/ckeditor/translations/zh.js | 1 - public/vendors/jsbarcode/JsBarcode.all.js | 3646 ----------------- public/vendors/jsbarcode/JsBarcode.all.min.js | 2 - .../barcodes/JsBarcode.codabar.min.js | 2 - .../barcodes/JsBarcode.code128.min.js | 2 - .../barcodes/JsBarcode.code39.min.js | 2 - .../barcodes/JsBarcode.ean-upc.min.js | 2 - .../jsbarcode/barcodes/JsBarcode.itf.min.js | 2 - .../jsbarcode/barcodes/JsBarcode.msi.min.js | 2 - .../barcodes/JsBarcode.pharmacode.min.js | 2 - public/vendors/qrcode/LICENSE | 14 - public/vendors/qrcode/README.md | 46 - public/vendors/qrcode/qrcode.js | 614 --- public/vendors/qrcode/qrcode.min.js | 1 - resources/views/controls/edit.blade.php | 10 +- resources/views/controls/make.blade.php | 2 +- resources/views/controls/show.blade.php | 2 +- resources/views/layout.blade.php | 20 + resources/views/measures/create.blade.php | 30 +- resources/views/measures/edit.blade.php | 11 +- resources/views/measures/show.blade.php | 2 +- routes/web.php | 3 + webpack.mix.js | 10 +- 92 files changed, 919 insertions(+), 5520 deletions(-) delete mode 100644 public/vendors/ckeditor/LICENSE.md delete mode 100644 public/vendors/ckeditor/README.md delete mode 100644 public/vendors/ckeditor/ckeditor.js delete mode 100644 public/vendors/ckeditor/ckeditor.js.map delete mode 100644 public/vendors/ckeditor/index.html delete mode 100644 public/vendors/ckeditor/sample/css/sample.css delete mode 100644 public/vendors/ckeditor/sample/img/bg.png delete mode 100644 public/vendors/ckeditor/sample/img/github.svg delete mode 100644 public/vendors/ckeditor/sample/img/logo.svg delete mode 100644 public/vendors/ckeditor/sample/img/umbrellas.jpg delete mode 100644 public/vendors/ckeditor/translations/ar.js delete mode 100644 public/vendors/ckeditor/translations/ast.js delete mode 100644 public/vendors/ckeditor/translations/az.js delete mode 100644 public/vendors/ckeditor/translations/bg.js delete mode 100644 public/vendors/ckeditor/translations/ca.js delete mode 100644 public/vendors/ckeditor/translations/cs.js delete mode 100644 public/vendors/ckeditor/translations/da.js delete mode 100644 public/vendors/ckeditor/translations/de-ch.js delete mode 100644 public/vendors/ckeditor/translations/de.js delete mode 100644 public/vendors/ckeditor/translations/el.js delete mode 100644 public/vendors/ckeditor/translations/en-au.js delete mode 100644 public/vendors/ckeditor/translations/eo.js delete mode 100644 public/vendors/ckeditor/translations/es.js delete mode 100644 public/vendors/ckeditor/translations/et.js delete mode 100644 public/vendors/ckeditor/translations/eu.js delete mode 100644 public/vendors/ckeditor/translations/fa.js delete mode 100644 public/vendors/ckeditor/translations/fi.js delete mode 100644 public/vendors/ckeditor/translations/fr.js delete mode 100644 public/vendors/ckeditor/translations/gl.js delete mode 100644 public/vendors/ckeditor/translations/gu.js delete mode 100644 public/vendors/ckeditor/translations/he.js delete mode 100644 public/vendors/ckeditor/translations/hr.js delete mode 100644 public/vendors/ckeditor/translations/hu.js delete mode 100644 public/vendors/ckeditor/translations/id.js delete mode 100644 public/vendors/ckeditor/translations/it.js delete mode 100644 public/vendors/ckeditor/translations/ja.js delete mode 100644 public/vendors/ckeditor/translations/km.js delete mode 100644 public/vendors/ckeditor/translations/kn.js delete mode 100644 public/vendors/ckeditor/translations/ko.js delete mode 100644 public/vendors/ckeditor/translations/ku.js delete mode 100644 public/vendors/ckeditor/translations/lv.js delete mode 100644 public/vendors/ckeditor/translations/nb.js delete mode 100644 public/vendors/ckeditor/translations/ne.js delete mode 100644 public/vendors/ckeditor/translations/nl.js delete mode 100644 public/vendors/ckeditor/translations/no.js delete mode 100644 public/vendors/ckeditor/translations/oc.js delete mode 100644 public/vendors/ckeditor/translations/pl.js delete mode 100644 public/vendors/ckeditor/translations/pt-br.js delete mode 100644 public/vendors/ckeditor/translations/pt.js delete mode 100644 public/vendors/ckeditor/translations/ro.js delete mode 100644 public/vendors/ckeditor/translations/ru.js delete mode 100644 public/vendors/ckeditor/translations/si.js delete mode 100644 public/vendors/ckeditor/translations/sk.js delete mode 100644 public/vendors/ckeditor/translations/sq.js delete mode 100644 public/vendors/ckeditor/translations/sr-latn.js delete mode 100644 public/vendors/ckeditor/translations/sr.js delete mode 100644 public/vendors/ckeditor/translations/sv.js delete mode 100644 public/vendors/ckeditor/translations/tr.js delete mode 100644 public/vendors/ckeditor/translations/tt.js delete mode 100644 public/vendors/ckeditor/translations/ug.js delete mode 100644 public/vendors/ckeditor/translations/uk.js delete mode 100644 public/vendors/ckeditor/translations/vi.js delete mode 100644 public/vendors/ckeditor/translations/zh-cn.js delete mode 100644 public/vendors/ckeditor/translations/zh.js delete mode 100644 public/vendors/jsbarcode/JsBarcode.all.js delete mode 100644 public/vendors/jsbarcode/JsBarcode.all.min.js delete mode 100644 public/vendors/jsbarcode/barcodes/JsBarcode.codabar.min.js delete mode 100644 public/vendors/jsbarcode/barcodes/JsBarcode.code128.min.js delete mode 100644 public/vendors/jsbarcode/barcodes/JsBarcode.code39.min.js delete mode 100644 public/vendors/jsbarcode/barcodes/JsBarcode.ean-upc.min.js delete mode 100644 public/vendors/jsbarcode/barcodes/JsBarcode.itf.min.js delete mode 100644 public/vendors/jsbarcode/barcodes/JsBarcode.msi.min.js delete mode 100644 public/vendors/jsbarcode/barcodes/JsBarcode.pharmacode.min.js delete mode 100644 public/vendors/qrcode/LICENSE delete mode 100644 public/vendors/qrcode/README.md delete mode 100644 public/vendors/qrcode/qrcode.js delete mode 100644 public/vendors/qrcode/qrcode.min.js diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 291670ff..2fb594ae 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -162,4 +162,13 @@ public function index(Request $request) ->with('controls', $controls) ; } + + public function test(Request $request) { + + $domain = DB::table('domains')->first(); + + return view('test') + ->with('domain',$domain); + } + } diff --git a/composer.json b/composer.json index 91a71cc7..5c6ffc5c 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "laravel/tinker": "^2.8", "laravel/ui": "^4.2", "maatwebsite/excel": "^3.1", + "michelf/php-markdown": "^2.0", "phpoffice/phpword": "^1.1.0" }, "require-dev": { diff --git a/package-lock.json b/package-lock.json index d3111328..0c085520 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@fortawesome/fontawesome-free": "^6.4.2", "accepts": "^1.3.8", "acorn": "^8.8.2", "acorn-import-assertions": "^1.8.0", @@ -434,6 +435,7 @@ "shellwords": "^0.1.1", "side-channel": "^1.0.4", "signal-exit": "^3.0.7", + "simplemde": "^1.11.2", "slash": "^3.0.0", "sockjs": "^0.3.24", "source-list-map": "^2.0.1", @@ -534,11 +536,11 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.4.tgz", + "integrity": "sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA==", "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -546,29 +548,29 @@ } }, "node_modules/@babel/compat-data": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", - "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.3.tgz", + "integrity": "sha512-BmR4bWbDIoFJmJ9z2cZ8Gmm2MXgEDgjdWgpKmKWUt54UGFJdlj31ECtbaDvCG/qVdG3AQ1SfpZEs01lUFbzLOQ==", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/core": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.20.tgz", - "integrity": "sha512-Y6jd1ahLubuYweD/zJH+vvOY141v4f9igNQAQ+MBgq9JlHS2iTsZKn1aMsb3vGccZsXI16VzTBw52Xx0DWmtnA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.3.tgz", + "integrity": "sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", + "@babel/generator": "^7.23.3", "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-module-transforms": "^7.22.20", - "@babel/helpers": "^7.22.15", - "@babel/parser": "^7.22.16", + "@babel/helper-module-transforms": "^7.23.3", + "@babel/helpers": "^7.23.2", + "@babel/parser": "^7.23.3", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.22.20", - "@babel/types": "^7.22.19", - "convert-source-map": "^1.7.0", + "@babel/traverse": "^7.23.3", + "@babel/types": "^7.23.3", + "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", @@ -582,6 +584,11 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + }, "node_modules/@babel/core/node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -604,11 +611,11 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/@babel/generator": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", - "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.4.tgz", + "integrity": "sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ==", "dependencies": { - "@babel/types": "^7.22.15", + "@babel/types": "^7.23.4", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -742,12 +749,12 @@ } }, "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -765,12 +772,12 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.22.15.tgz", - "integrity": "sha512-qLNsZbgrNh0fDQBCPocSL8guki1hcPvltGDv/NxvUoABwFq7GkKSu1nRXeJkVZc+wJvne2E0RKQz+2SQrz6eAA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.23.0.tgz", + "integrity": "sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==", "dev": true, "dependencies": { - "@babel/types": "^7.22.15" + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -788,9 +795,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.20.tgz", - "integrity": "sha512-dLT7JVWIUUxKOs1UnJUBR3S70YK+pKX6AbJgB2vMIvEkZkrfJDbYDJesnPshtKV4LhDOR3Oc5YULeDizRek+5A==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -894,9 +901,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "engines": { "node": ">=6.9.0" } @@ -932,22 +939,22 @@ } }, "node_modules/@babel/helpers": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.15.tgz", - "integrity": "sha512-7pAjK0aSdxOwR+CcYAqgWOGy5dcfvzsTIfFTb2odQqW47MDfv14UaJDY6eng8ylM2EaeKXdxaSWESbkmaQHTmw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.4.tgz", + "integrity": "sha512-HfcMizYz10cr3h29VqyfGL6ZWIjTwWfvYBMsBVGwpcbhNGe3wQ1ZXZRPzZoAHhd9OqHadHqjQ89iVKINXnbzuw==", "dependencies": { "@babel/template": "^7.22.15", - "@babel/traverse": "^7.22.15", - "@babel/types": "^7.22.15" + "@babel/traverse": "^7.23.4", + "@babel/types": "^7.23.4" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", - "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", @@ -958,9 +965,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.16", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.16.tgz", - "integrity": "sha512-+gPfKv8UWeKKeJTUxe59+OobVcrYHETCsORl61EmSkmgymguYk/X5bp7GuUIXaFsc6y++v8ZxPsLSSuujqDphA==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.4.tgz", + "integrity": "sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==", "bin": { "parser": "bin/babel-parser.js" }, @@ -969,9 +976,9 @@ } }, "node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": { - "version": "7.22.15", - "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.22.15.tgz", - "integrity": "sha512-FB9iYlz7rURmRJyXRKEnalYPPdn87H5no108cyuQQyMwlpJ2SJtpIUBI27kdTin956pz+LPypkPVPUTlxOmrsg==", + "version": "7.23.3", + "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.23.3.tgz", + "integrity": "sha512-iRkKcCqb7iGnq9+3G6rZ+Ciz5VywC4XNRHe57lKM+jOeYAoR0lVqdeeDRfh0tQcTfw/+vBhHn926FmQhLtlFLQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -984,14 +991,14 @@ } }, "node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.22.15.tgz", - "integrity": "sha512-Hyph9LseGvAeeXzikV88bczhsrLrIZqDPxO+sSmAunMPaGrBGhfMWzCPYTtiW9t+HzSE2wtV8e5cc5P6r1xMDQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.23.3.tgz", + "integrity": "sha512-WwlxbfMNdVEpQjZmK5mhm7oSwD3dS6eU+Iwsi4Knl9wAletWem7kaRsGOG+8UEbRyqxY4SS5zvtfXwX+jMxUwQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", "@babel/helper-skip-transparent-expression-wrappers": "^7.22.5", - "@babel/plugin-transform-optional-chaining": "^7.22.15" + "@babel/plugin-transform-optional-chaining": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -1000,6 +1007,22 @@ "@babel/core": "^7.13.0" } }, + "node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": { + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/-/plugin-bugfix-v8-static-class-fields-redefine-readonly-7.23.3.tgz", + "integrity": "sha512-XaJak1qcityzrX0/IU5nKHb34VaibwP3saKqG6a/tppelgllOH13LUann4ZCIBcVOeE6H18K4Vx9QKkVww3z/w==", + "dev": true, + "dependencies": { + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-plugin-utils": "^7.22.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/@babel/plugin-proposal-object-rest-spread": { "version": "7.20.7", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", @@ -1096,9 +1119,9 @@ } }, "node_modules/@babel/plugin-syntax-import-assertions": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz", - "integrity": "sha512-rdV97N7KqsRzeNGoWUOK6yUsWarLjE5Su/Snk9IYPU9CwkWHs4t+rTGOvffTR8XGkJMTAdLfO0xVnXm8wugIJg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.23.3.tgz", + "integrity": "sha512-lPgDSU+SJLK3xmFDTV2ZRQAiM7UuUjGidwBywFavObCiZc1BeAAcMtHJKUya92hPHO+at63JJPLygilZard8jw==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1111,9 +1134,9 @@ } }, "node_modules/@babel/plugin-syntax-import-attributes": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.22.5.tgz", - "integrity": "sha512-KwvoWDeNKPETmozyFE0P2rOLqh39EoQHNjqizrI5B8Vt0ZNS7M56s7dAiAqbYfiAYOuIzIh96z3iR2ktgu3tEg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.23.3.tgz", + "integrity": "sha512-pawnE0P9g10xgoP7yKr6CK63K2FMsTE+FZidZO/1PwRdzmAPVs+HS1mAURUsgaoxammTJvULUdIkEK0gOcU2tA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1268,9 +1291,9 @@ } }, "node_modules/@babel/plugin-transform-arrow-functions": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.22.5.tgz", - "integrity": "sha512-26lTNXoVRdAnsaDXPpvCNUq+OVWEVC6bx7Vvz9rC53F2bagUWW4u4ii2+h8Fejfh7RYqPxn+libeFBBck9muEw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.23.3.tgz", + "integrity": "sha512-NzQcQrzaQPkaEwoTm4Mhyl8jI1huEL/WWIEvudjTCMJ9aBZNpsJbMASx7EQECtQQPS/DcnFpo0FIh3LvEO9cxQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1283,14 +1306,14 @@ } }, "node_modules/@babel/plugin-transform-async-generator-functions": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.22.15.tgz", - "integrity": "sha512-jBm1Es25Y+tVoTi5rfd5t1KLmL8ogLKpXszboWOTTtGFGz2RKnQe2yn7HbZ+kb/B8N0FVSGQo874NSlOU1T4+w==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.23.4.tgz", + "integrity": "sha512-efdkfPhHYTtn0G6n2ddrESE91fgXxjlqLsnUtPWnJs4a4mZIbUaK7ffqKIIUKXSHwcDvaCVX6GXkaJJFqtX7jw==", "dev": true, "dependencies": { - "@babel/helper-environment-visitor": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-remap-async-to-generator": "^7.22.9", + "@babel/helper-remap-async-to-generator": "^7.22.20", "@babel/plugin-syntax-async-generators": "^7.8.4" }, "engines": { @@ -1301,14 +1324,14 @@ } }, "node_modules/@babel/plugin-transform-async-to-generator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.22.5.tgz", - "integrity": "sha512-b1A8D8ZzE/VhNDoV1MSJTnpKkCG5bJo+19R4o4oy03zM7ws8yEMK755j61Dc3EyvdysbqH5BOOTquJ7ZX9C6vQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.23.3.tgz", + "integrity": "sha512-A7LFsKi4U4fomjqXJlZg/u0ft/n8/7n7lpffUP/ZULx/DtV9SGlNKZolHH6PE8Xl1ngCc0M11OaeZptXVkfKSw==", "dev": true, "dependencies": { - "@babel/helper-module-imports": "^7.22.5", + "@babel/helper-module-imports": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-remap-async-to-generator": "^7.22.5" + "@babel/helper-remap-async-to-generator": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -1318,9 +1341,9 @@ } }, "node_modules/@babel/plugin-transform-block-scoped-functions": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.22.5.tgz", - "integrity": "sha512-tdXZ2UdknEKQWKJP1KMNmuF5Lx3MymtMN/pvA+p/VEkhK8jVcQ1fzSy8KM9qRYhAf2/lV33hoMPKI/xaI9sADA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.23.3.tgz", + "integrity": "sha512-vI+0sIaPIO6CNuM9Kk5VmXcMVRiOpDh7w2zZt9GXzmE/9KD70CUEVhvPR/etAeNK/FAEkhxQtXOzVF3EuRL41A==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1333,9 +1356,9 @@ } }, "node_modules/@babel/plugin-transform-block-scoping": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.22.15.tgz", - "integrity": "sha512-G1czpdJBZCtngoK1sJgloLiOHUnkb/bLZwqVZD8kXmq0ZnVfTTWUcs9OWtp0mBtYJ+4LQY1fllqBkOIPhXmFmw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.23.4.tgz", + "integrity": "sha512-0QqbP6B6HOh7/8iNR4CQU2Th/bbRtBp4KS9vcaZd1fZ0wSh5Fyssg0UCIHwxh+ka+pNDREbVLQnHCMHKZfPwfw==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1348,12 +1371,12 @@ } }, "node_modules/@babel/plugin-transform-class-properties": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.22.5.tgz", - "integrity": "sha512-nDkQ0NfkOhPTq8YCLiWNxp1+f9fCobEjCb0n8WdbNUBc4IB5V7P1QnX9IjpSoquKrXF5SKojHleVNs2vGeHCHQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-properties/-/plugin-transform-class-properties-7.23.3.tgz", + "integrity": "sha512-uM+AN8yCIjDPccsKGlw271xjJtGii+xQIF/uMPS8H15L12jZTsLfF4o5vNO7d/oUguOyfdikHGc/yi9ge4SGIg==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -1364,12 +1387,12 @@ } }, "node_modules/@babel/plugin-transform-class-static-block": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.22.11.tgz", - "integrity": "sha512-GMM8gGmqI7guS/llMFk1bJDkKfn3v3C4KHK9Yg1ey5qcHcOlKb0QvcMrgzvxo+T03/4szNh5lghY+fEC98Kq9g==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-class-static-block/-/plugin-transform-class-static-block-7.23.4.tgz", + "integrity": "sha512-nsWu/1M+ggti1SOALj3hfx5FXzAY06fwPJsUZD4/A5e1bWi46VUIWtD+kOX6/IdhXGsXBWllLFDSnqSCdUNydQ==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.11", + "@babel/helper-create-class-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-class-static-block": "^7.14.5" }, @@ -1381,18 +1404,18 @@ } }, "node_modules/@babel/plugin-transform-classes": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.22.15.tgz", - "integrity": "sha512-VbbC3PGjBdE0wAWDdHM9G8Gm977pnYI0XpqMd6LrKISj8/DJXEsWqgRuTYaNE9Bv0JGhTZUzHDlMk18IpOuoqw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.23.3.tgz", + "integrity": "sha512-FGEQmugvAEu2QtgtU0uTASXevfLMFfBeVCIIdcQhn/uBQsMTjBajdnAtanQlOcuihWh10PZ7+HWvc7NtBwP74w==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-optimise-call-expression": "^7.22.5", "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.9", + "@babel/helper-replace-supers": "^7.22.20", "@babel/helper-split-export-declaration": "^7.22.6", "globals": "^11.1.0" }, @@ -1404,13 +1427,13 @@ } }, "node_modules/@babel/plugin-transform-computed-properties": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.22.5.tgz", - "integrity": "sha512-4GHWBgRf0krxPX+AaPtgBAlTgTeZmqDynokHOX7aqqAB4tHs3U2Y02zH6ETFdLZGcg9UQSD1WCmkVrE9ErHeOg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.23.3.tgz", + "integrity": "sha512-dTj83UVTLw/+nbiHqQSFdwO9CbTtwq1DsDqm3CUEtDrZNET5rT5E6bIdTlOftDTDLMYxvxHNEYO4B9SLl8SLZw==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", - "@babel/template": "^7.22.5" + "@babel/template": "^7.22.15" }, "engines": { "node": ">=6.9.0" @@ -1420,9 +1443,9 @@ } }, "node_modules/@babel/plugin-transform-destructuring": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.22.15.tgz", - "integrity": "sha512-HzG8sFl1ZVGTme74Nw+X01XsUTqERVQ6/RLHo3XjGRzm7XD6QTtfS3NJotVgCGy8BzkDqRjRBD8dAyJn5TuvSQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.23.3.tgz", + "integrity": "sha512-n225npDqjDIr967cMScVKHXJs7rout1q+tt50inyBCPkyZ8KxeI6d+GIbSBTT/w/9WdlWDOej3V9HE5Lgk57gw==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1435,12 +1458,12 @@ } }, "node_modules/@babel/plugin-transform-dotall-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.22.5.tgz", - "integrity": "sha512-5/Yk9QxCQCl+sOIB1WelKnVRxTJDSAIxtJLL2/pqL14ZVlbH0fUQUZa/T5/UnQtBNgghR7mfB8ERBKyKPCi7Vw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.23.3.tgz", + "integrity": "sha512-vgnFYDHAKzFaTVp+mneDsIEbnJ2Np/9ng9iviHw3P/KVcgONxpNULEW/51Z/BaFojG2GI2GwwXck5uV1+1NOYQ==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-create-regexp-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -1451,9 +1474,9 @@ } }, "node_modules/@babel/plugin-transform-duplicate-keys": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.22.5.tgz", - "integrity": "sha512-dEnYD+9BBgld5VBXHnF/DbYGp3fqGMsyxKbtD1mDyIA7AkTSpKXFhCVuj/oQVOoALfBs77DudA0BE4d5mcpmqw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.23.3.tgz", + "integrity": "sha512-RrqQ+BQmU3Oyav3J+7/myfvRCq7Tbz+kKLLshUmMwNlDHExbGL7ARhajvoBJEvc+fCguPPu887N+3RRXBVKZUA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1466,9 +1489,9 @@ } }, "node_modules/@babel/plugin-transform-dynamic-import": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.22.11.tgz", - "integrity": "sha512-g/21plo58sfteWjaO0ZNVb+uEOkJNjAaHhbejrnBmu011l/eNDScmkbjCC3l4FKb10ViaGU4aOkFznSu2zRHgA==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dynamic-import/-/plugin-transform-dynamic-import-7.23.4.tgz", + "integrity": "sha512-V6jIbLhdJK86MaLh4Jpghi8ho5fGzt3imHOBu/x0jlBaPYqDoWz4RDXjmMOfnh+JWNaQleEAByZLV0QzBT4YQQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1482,12 +1505,12 @@ } }, "node_modules/@babel/plugin-transform-exponentiation-operator": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.22.5.tgz", - "integrity": "sha512-vIpJFNM/FjZ4rh1myqIya9jXwrwwgFRHPjT3DkUA9ZLHuzox8jiXkOLvwm1H+PQIP3CqfC++WPKeuDi0Sjdj1g==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.23.3.tgz", + "integrity": "sha512-5fhCsl1odX96u7ILKHBj4/Y8vipoqwsJMh4csSA8qFfxrZDEA4Ssku2DyNvMJSmZNOEBT750LfFPbtrnTP90BQ==", "dev": true, "dependencies": { - "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.5", + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -1498,9 +1521,9 @@ } }, "node_modules/@babel/plugin-transform-export-namespace-from": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.22.11.tgz", - "integrity": "sha512-xa7aad7q7OiT8oNZ1mU7NrISjlSkVdMbNxn9IuLZyL9AJEhs1Apba3I+u5riX1dIkdptP5EKDG5XDPByWxtehw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-export-namespace-from/-/plugin-transform-export-namespace-from-7.23.4.tgz", + "integrity": "sha512-GzuSBcKkx62dGzZI1WVgTWvkkz84FZO5TC5T8dl/Tht/rAla6Dg/Mz9Yhypg+ezVACf/rgDuQt3kbWEv7LdUDQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1514,9 +1537,9 @@ } }, "node_modules/@babel/plugin-transform-for-of": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.15.tgz", - "integrity": "sha512-me6VGeHsx30+xh9fbDLLPi0J1HzmeIIyenoOQHuw2D4m2SAU3NrspX5XxJLBpqn5yrLzrlw2Iy3RA//Bx27iOA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.23.3.tgz", + "integrity": "sha512-X8jSm8X1CMwxmK878qsUGJRmbysKNbdpTv/O1/v0LuY/ZkZrng5WYiekYSdg9m09OTmDDUWeEDsTE+17WYbAZw==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1529,13 +1552,13 @@ } }, "node_modules/@babel/plugin-transform-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.22.5.tgz", - "integrity": "sha512-UIzQNMS0p0HHiQm3oelztj+ECwFnj+ZRV4KnguvlsD2of1whUeM6o7wGNj6oLwcDoAXQ8gEqfgC24D+VdIcevg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.23.3.tgz", + "integrity": "sha512-I1QXp1LxIvt8yLaib49dRW5Okt7Q4oaxao6tFVKS/anCdEOMtYwWVKoiOA1p34GOWIZjUK0E+zCp7+l1pfQyiw==", "dev": true, "dependencies": { - "@babel/helper-compilation-targets": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "@babel/helper-compilation-targets": "^7.22.15", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -1546,9 +1569,9 @@ } }, "node_modules/@babel/plugin-transform-json-strings": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.22.11.tgz", - "integrity": "sha512-CxT5tCqpA9/jXFlme9xIBCc5RPtdDq3JpkkhgHQqtDdiTnTI0jtZ0QzXhr5DILeYifDPp2wvY2ad+7+hLMW5Pw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-json-strings/-/plugin-transform-json-strings-7.23.4.tgz", + "integrity": "sha512-81nTOqM1dMwZ/aRXQ59zVubN9wHGqk6UtqRK+/q+ciXmRy8fSolhGVvG09HHRGo4l6fr/c4ZhXUQH0uFW7PZbg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1562,9 +1585,9 @@ } }, "node_modules/@babel/plugin-transform-literals": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.22.5.tgz", - "integrity": "sha512-fTLj4D79M+mepcw3dgFBTIDYpbcB9Sm0bpm4ppXPaO+U+PKFFyV9MGRvS0gvGw62sd10kT5lRMKXAADb9pWy8g==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.23.3.tgz", + "integrity": "sha512-wZ0PIXRxnwZvl9AYpqNUxpZ5BiTGrYt7kueGQ+N5FiQ7RCOD4cm8iShd6S6ggfVIWaJf2EMk8eRzAh52RfP4rQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1577,9 +1600,9 @@ } }, "node_modules/@babel/plugin-transform-logical-assignment-operators": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.22.11.tgz", - "integrity": "sha512-qQwRTP4+6xFCDV5k7gZBF3C31K34ut0tbEcTKxlX/0KXxm9GLcO14p570aWxFvVzx6QAfPgq7gaeIHXJC8LswQ==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-logical-assignment-operators/-/plugin-transform-logical-assignment-operators-7.23.4.tgz", + "integrity": "sha512-Mc/ALf1rmZTP4JKKEhUwiORU+vcfarFVLfcFiolKUo6sewoxSEgl36ak5t+4WamRsNr6nzjZXQjM35WsU+9vbg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1593,9 +1616,9 @@ } }, "node_modules/@babel/plugin-transform-member-expression-literals": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.22.5.tgz", - "integrity": "sha512-RZEdkNtzzYCFl9SE9ATaUMTj2hqMb4StarOJLrZRbqqU4HSBE7UlBw9WBWQiDzrJZJdUWiMTVDI6Gv/8DPvfew==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.23.3.tgz", + "integrity": "sha512-sC3LdDBDi5x96LA+Ytekz2ZPk8i/Ck+DEuDbRAll5rknJ5XRTSaPKEYwomLcs1AA8wg9b3KjIQRsnApj+q51Ag==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1608,12 +1631,12 @@ } }, "node_modules/@babel/plugin-transform-modules-amd": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.22.5.tgz", - "integrity": "sha512-R+PTfLTcYEmb1+kK7FNkhQ1gP4KgjpSO6HfH9+f8/yfp2Nt3ggBjiVpRwmwTlfqZLafYKJACy36yDXlEmI9HjQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.23.3.tgz", + "integrity": "sha512-vJYQGxeKM4t8hYCKVBlZX/gtIY2I7mRGFNcm85sgXGMTBcoV3QdVtdpbcWEbzbfUIUZKwvgFT82mRvaQIebZzw==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-module-transforms": "^7.23.3", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -1624,12 +1647,12 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.22.15.tgz", - "integrity": "sha512-jWL4eh90w0HQOTKP2MoXXUpVxilxsB2Vl4ji69rSjS3EcZ/v4sBmn+A3NpepuJzBhOaEBbR7udonlHHn5DWidg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz", + "integrity": "sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.22.15", + "@babel/helper-module-transforms": "^7.23.3", "@babel/helper-plugin-utils": "^7.22.5", "@babel/helper-simple-access": "^7.22.5" }, @@ -1641,15 +1664,15 @@ } }, "node_modules/@babel/plugin-transform-modules-systemjs": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.22.11.tgz", - "integrity": "sha512-rIqHmHoMEOhI3VkVf5jQ15l539KrwhzqcBO6wdCNWPWc/JWt9ILNYNUssbRpeq0qWns8svuw8LnMNCvWBIJ8wA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.23.3.tgz", + "integrity": "sha512-ZxyKGTkF9xT9YJuKQRo19ewf3pXpopuYQd8cDXqNzc3mUNbOME0RKMoZxviQk74hwzfQsEe66dE92MaZbdHKNQ==", "dev": true, "dependencies": { "@babel/helper-hoist-variables": "^7.22.5", - "@babel/helper-module-transforms": "^7.22.9", + "@babel/helper-module-transforms": "^7.23.3", "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.5" + "@babel/helper-validator-identifier": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -1659,12 +1682,12 @@ } }, "node_modules/@babel/plugin-transform-modules-umd": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.22.5.tgz", - "integrity": "sha512-+S6kzefN/E1vkSsKx8kmQuqeQsvCKCd1fraCM7zXm4SFoggI099Tr4G8U81+5gtMdUeMQ4ipdQffbKLX0/7dBQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.23.3.tgz", + "integrity": "sha512-zHsy9iXX2nIsCBFPud3jKn1IRPWg3Ing1qOZgeKV39m1ZgIdpJqvlWVeiHBZC6ITRG0MfskhYe9cLgntfSFPIg==", "dev": true, "dependencies": { - "@babel/helper-module-transforms": "^7.22.5", + "@babel/helper-module-transforms": "^7.23.3", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -1691,9 +1714,9 @@ } }, "node_modules/@babel/plugin-transform-new-target": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.22.5.tgz", - "integrity": "sha512-AsF7K0Fx/cNKVyk3a+DW0JLo+Ua598/NxMRvxDnkpCIGFh43+h/v2xyhRUYf6oD8gE4QtL83C7zZVghMjHd+iw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.23.3.tgz", + "integrity": "sha512-YJ3xKqtJMAT5/TIZnpAR3I+K+WaDowYbN3xyxI8zxx/Gsypwf9B9h0VB+1Nh6ACAAPRS5NSRje0uVv5i79HYGQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1706,9 +1729,9 @@ } }, "node_modules/@babel/plugin-transform-nullish-coalescing-operator": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.11.tgz", - "integrity": "sha512-YZWOw4HxXrotb5xsjMJUDlLgcDXSfO9eCmdl1bgW4+/lAGdkjaEvOnQ4p5WKKdUgSzO39dgPl0pTnfxm0OAXcg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz", + "integrity": "sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1722,9 +1745,9 @@ } }, "node_modules/@babel/plugin-transform-numeric-separator": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.22.11.tgz", - "integrity": "sha512-3dzU4QGPsILdJbASKhF/V2TVP+gJya1PsueQCxIPCEcerqF21oEcrob4mzjsp2Py/1nLfF5m+xYNMDpmA8vffg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-numeric-separator/-/plugin-transform-numeric-separator-7.23.4.tgz", + "integrity": "sha512-mps6auzgwjRrwKEZA05cOwuDc9FAzoyFS4ZsG/8F43bTLf/TgkJg7QXOrPO1JO599iA3qgK9MXdMGOEC8O1h6Q==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1738,16 +1761,16 @@ } }, "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz", - "integrity": "sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.23.4.tgz", + "integrity": "sha512-9x9K1YyeQVw0iOXJlIzwm8ltobIIv7j2iLyP2jIhEbqPRQ7ScNgwQufU2I0Gq11VjyG4gI4yMXt2VFags+1N3g==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.22.9", + "@babel/compat-data": "^7.23.3", "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.22.15" + "@babel/plugin-transform-parameters": "^7.23.3" }, "engines": { "node": ">=6.9.0" @@ -1757,13 +1780,13 @@ } }, "node_modules/@babel/plugin-transform-object-super": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.22.5.tgz", - "integrity": "sha512-klXqyaT9trSjIUrcsYIfETAzmOEZL3cBYqOYLJxBHfMFFggmXOv+NYSX/Jbs9mzMVESw/WycLFPRx8ba/b2Ipw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.23.3.tgz", + "integrity": "sha512-BwQ8q0x2JG+3lxCVFohg+KbQM7plfpBwThdW9A6TMtWwLsbDA01Ek2Zb/AgDN39BiZsExm4qrXxjk+P1/fzGrA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", - "@babel/helper-replace-supers": "^7.22.5" + "@babel/helper-replace-supers": "^7.22.20" }, "engines": { "node": ">=6.9.0" @@ -1773,9 +1796,9 @@ } }, "node_modules/@babel/plugin-transform-optional-catch-binding": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.22.11.tgz", - "integrity": "sha512-rli0WxesXUeCJnMYhzAglEjLWVDF6ahb45HuprcmQuLidBJFWjNnOzssk2kuc6e33FlLaiZhG/kUIzUMWdBKaQ==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-catch-binding/-/plugin-transform-optional-catch-binding-7.23.4.tgz", + "integrity": "sha512-XIq8t0rJPHf6Wvmbn9nFxU6ao4c7WhghTR5WyV8SrJfUFzyxhCm4nhC+iAp3HFhbAKLfYpgzhJ6t4XCtVwqO5A==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1789,9 +1812,9 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.15.tgz", - "integrity": "sha512-ngQ2tBhq5vvSJw2Q2Z9i7ealNkpDMU0rGWnHPKqRZO0tzZ5tlaoz4hDvhXioOoaE0X2vfNss1djwg0DXlfu30A==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz", + "integrity": "sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1806,9 +1829,9 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz", - "integrity": "sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.23.3.tgz", + "integrity": "sha512-09lMt6UsUb3/34BbECKVbVwrT9bO6lILWln237z7sLaWnMsTi7Yc9fhX5DLpkJzAGfaReXI22wP41SZmnAA3Vw==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1821,12 +1844,12 @@ } }, "node_modules/@babel/plugin-transform-private-methods": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.22.5.tgz", - "integrity": "sha512-PPjh4gyrQnGe97JTalgRGMuU4icsZFnWkzicB/fUtzlKUqvsWBKEpPPfr5a2JiyirZkHxnAqkQMO5Z5B2kK3fA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-methods/-/plugin-transform-private-methods-7.23.3.tgz", + "integrity": "sha512-UzqRcRtWsDMTLrRWFvUBDwmw06tCQH9Rl1uAjfh6ijMSmGYQ+fpdB+cnqRC8EMh5tuuxSv0/TejGL+7vyj+50g==", "dev": true, "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.22.5", + "@babel/helper-create-class-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -1837,13 +1860,13 @@ } }, "node_modules/@babel/plugin-transform-private-property-in-object": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.22.11.tgz", - "integrity": "sha512-sSCbqZDBKHetvjSwpyWzhuHkmW5RummxJBVbYLkGkaiTOWGxml7SXt0iWa03bzxFIx7wOj3g/ILRd0RcJKBeSQ==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-private-property-in-object/-/plugin-transform-private-property-in-object-7.23.4.tgz", + "integrity": "sha512-9G3K1YqTq3F4Vt88Djx1UZ79PDyj+yKRnUy7cZGSMe+a7jkwD259uKKuUzQlPkGam7R+8RJwh5z4xO27fA1o2A==", "dev": true, "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", - "@babel/helper-create-class-features-plugin": "^7.22.11", + "@babel/helper-create-class-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" }, @@ -1855,9 +1878,9 @@ } }, "node_modules/@babel/plugin-transform-property-literals": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.22.5.tgz", - "integrity": "sha512-TiOArgddK3mK/x1Qwf5hay2pxI6wCZnvQqrFSqbtg1GLl2JcNMitVH/YnqjP+M31pLUeTfzY1HAXFDnUBV30rQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.23.3.tgz", + "integrity": "sha512-jR3Jn3y7cZp4oEWPFAlRsSWjxKe4PZILGBSd4nis1TsC5qeSpb+nrtihJuDhNI7QHiVbUaiXa0X2RZY3/TI6Nw==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1870,9 +1893,9 @@ } }, "node_modules/@babel/plugin-transform-regenerator": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.22.10.tgz", - "integrity": "sha512-F28b1mDt8KcT5bUyJc/U9nwzw6cV+UmTeRlXYIl2TNqMMJif0Jeey9/RQ3C4NOd2zp0/TRsDns9ttj2L523rsw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.23.3.tgz", + "integrity": "sha512-KP+75h0KghBMcVpuKisx3XTu9Ncut8Q8TuvGO4IhY+9D5DFEckQefOuIsB/gQ2tG71lCke4NMrtIPS8pOj18BQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1886,9 +1909,9 @@ } }, "node_modules/@babel/plugin-transform-reserved-words": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.22.5.tgz", - "integrity": "sha512-DTtGKFRQUDm8svigJzZHzb/2xatPc6TzNvAIJ5GqOKDsGFYgAskjRulbR/vGsPKq3OPqtexnz327qYpP57RFyA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.23.3.tgz", + "integrity": "sha512-QnNTazY54YqgGxwIexMZva9gqbPa15t/x9VS+0fsEFWplwVpXYZivtgl43Z1vMpc1bdPP2PP8siFeVcnFvA3Cg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -1901,16 +1924,16 @@ } }, "node_modules/@babel/plugin-transform-runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.22.15.tgz", - "integrity": "sha512-tEVLhk8NRZSmwQ0DJtxxhTrCht1HVo8VaMzYT4w6lwyKBuHsgoioAUA7/6eT2fRfc5/23fuGdlwIxXhRVgWr4g==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.23.4.tgz", + "integrity": "sha512-ITwqpb6V4btwUG0YJR82o2QvmWrLgDnx/p2A3CTPYGaRgULkDiC0DRA2C4jlRB9uXGUEfaSS/IGHfVW+ohzYDw==", "dev": true, "dependencies": { "@babel/helper-module-imports": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", - "babel-plugin-polyfill-corejs2": "^0.4.5", - "babel-plugin-polyfill-corejs3": "^0.8.3", - "babel-plugin-polyfill-regenerator": "^0.5.2", + "babel-plugin-polyfill-corejs2": "^0.4.6", + "babel-plugin-polyfill-corejs3": "^0.8.5", + "babel-plugin-polyfill-regenerator": "^0.5.3", "semver": "^6.3.1" }, "engines": { @@ -1921,9 +1944,9 @@ } }, "node_modules/@babel/plugin-transform-runtime/node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz", - "integrity": "sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.3.tgz", + "integrity": "sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug==", "dev": true, "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", @@ -1937,13 +1960,13 @@ } }, "node_modules/@babel/plugin-transform-runtime/node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz", - "integrity": "sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.6.tgz", + "integrity": "sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q==", "dev": true, "dependencies": { "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.4.2", + "@babel/helper-define-polyfill-provider": "^0.4.3", "semver": "^6.3.1" }, "peerDependencies": { @@ -1951,25 +1974,25 @@ } }, "node_modules/@babel/plugin-transform-runtime/node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.3.tgz", - "integrity": "sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA==", + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.6.tgz", + "integrity": "sha512-leDIc4l4tUgU7str5BWLS2h8q2N4Nf6lGZP6UrNDxdtfF2g69eJ5L0H7S8A5Ln/arfFAfHor5InAdZuIOwZdgQ==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.2", - "core-js-compat": "^3.31.0" + "@babel/helper-define-polyfill-provider": "^0.4.3", + "core-js-compat": "^3.33.1" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/@babel/plugin-transform-runtime/node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz", - "integrity": "sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.3.tgz", + "integrity": "sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.2" + "@babel/helper-define-polyfill-provider": "^0.4.3" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -1999,9 +2022,9 @@ "dev": true }, "node_modules/@babel/plugin-transform-shorthand-properties": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.22.5.tgz", - "integrity": "sha512-vM4fq9IXHscXVKzDv5itkO1X52SmdFBFcMIBZ2FRn2nqVYqw6dBexUgMvAjHW+KXpPPViD/Yo3GrDEBaRC0QYA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.23.3.tgz", + "integrity": "sha512-ED2fgqZLmexWiN+YNFX26fx4gh5qHDhn1O2gvEhreLW2iI63Sqm4llRLCXALKrCnbN4Jy0VcMQZl/SAzqug/jg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -2014,9 +2037,9 @@ } }, "node_modules/@babel/plugin-transform-spread": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.22.5.tgz", - "integrity": "sha512-5ZzDQIGyvN4w8+dMmpohL6MBo+l2G7tfC/O2Dg7/hjpgeWvUx8FzfeOKxGog9IimPa4YekaQ9PlDqTLOljkcxg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.23.3.tgz", + "integrity": "sha512-VvfVYlrlBVu+77xVTOAoxQ6mZbnIq5FM0aGBSFEcIh03qHf+zNqA4DC/3XMUozTg7bZV3e3mZQ0i13VB6v5yUg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -2030,9 +2053,9 @@ } }, "node_modules/@babel/plugin-transform-sticky-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.22.5.tgz", - "integrity": "sha512-zf7LuNpHG0iEeiyCNwX4j3gDg1jgt1k3ZdXBKbZSoA3BbGQGvMiSvfbZRR3Dr3aeJe3ooWFZxOOG3IRStYp2Bw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.23.3.tgz", + "integrity": "sha512-HZOyN9g+rtvnOU3Yh7kSxXrKbzgrm5X4GncPY1QOquu7epga5MxKHVpYu2hvQnry/H+JjckSYRb93iNfsioAGg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -2045,9 +2068,9 @@ } }, "node_modules/@babel/plugin-transform-template-literals": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.22.5.tgz", - "integrity": "sha512-5ciOehRNf+EyUeewo8NkbQiUs4d6ZxiHo6BcBcnFlgiJfu16q0bQUw9Jvo0b0gBKFG1SMhDSjeKXSYuJLeFSMA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.23.3.tgz", + "integrity": "sha512-Flok06AYNp7GV2oJPZZcP9vZdszev6vPBkHLwxwSpaIqx75wn6mUd3UFWsSsA0l8nXAKkyCmL/sR02m8RYGeHg==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -2060,9 +2083,9 @@ } }, "node_modules/@babel/plugin-transform-typeof-symbol": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.22.5.tgz", - "integrity": "sha512-bYkI5lMzL4kPii4HHEEChkD0rkc+nvnlR6+o/qdqR6zrm0Sv/nodmyLhlq2DO0YKLUNd2VePmPRjJXSBh9OIdA==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.23.3.tgz", + "integrity": "sha512-4t15ViVnaFdrPC74be1gXBSMzXk3B4Us9lP7uLRQHTFpV5Dvt33pn+2MyyNxmN3VTTm3oTrZVMUmuw3oBnQ2oQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -2075,9 +2098,9 @@ } }, "node_modules/@babel/plugin-transform-unicode-escapes": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.22.10.tgz", - "integrity": "sha512-lRfaRKGZCBqDlRU3UIFovdp9c9mEvlylmpod0/OatICsSfuQ9YFthRo1tpTkGsklEefZdqlEFdY4A2dwTb6ohg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.23.3.tgz", + "integrity": "sha512-OMCUx/bU6ChE3r4+ZdylEqAjaQgHAgipgW8nsCfu5pGqDcFytVd91AwRvUJSBZDz0exPGgnjoqhgRYLRjFZc9Q==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -2090,12 +2113,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-property-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.22.5.tgz", - "integrity": "sha512-HCCIb+CbJIAE6sXn5CjFQXMwkCClcOfPCzTlilJ8cUatfzwHlWQkbtV0zD338u9dZskwvuOYTuuaMaA8J5EI5A==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-property-regex/-/plugin-transform-unicode-property-regex-7.23.3.tgz", + "integrity": "sha512-KcLIm+pDZkWZQAFJ9pdfmh89EwVfmNovFBcXko8szpBeF8z68kWIPeKlmSOkT9BXJxs2C0uk+5LxoxIv62MROA==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-create-regexp-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -2106,12 +2129,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.22.5.tgz", - "integrity": "sha512-028laaOKptN5vHJf9/Arr/HiJekMd41hOEZYvNsrsXqJ7YPYuX2bQxh31fkZzGmq3YqHRJzYFFAVYvKfMPKqyg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.23.3.tgz", + "integrity": "sha512-wMHpNA4x2cIA32b/ci3AfwNgheiva2W0WUKWTK7vBHBhDKfPsc5cFGNWm69WBqpwd86u1qwZ9PWevKqm1A3yAw==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-create-regexp-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -2122,12 +2145,12 @@ } }, "node_modules/@babel/plugin-transform-unicode-sets-regex": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.22.5.tgz", - "integrity": "sha512-lhMfi4FC15j13eKrh3DnYHjpGj6UKQHtNKTbtc1igvAhRy4+kLhV07OpLcsN0VgDEw/MjAvJO4BdMJsHwMhzCg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-sets-regex/-/plugin-transform-unicode-sets-regex-7.23.3.tgz", + "integrity": "sha512-W7lliA/v9bNR83Qc3q1ip9CQMZ09CcHDbHfbLRDNuAhn1Mvkr1ZNF7hPmztMQvtTGVLJ9m8IZqWsTkXOml8dbw==", "dev": true, "dependencies": { - "@babel/helper-create-regexp-features-plugin": "^7.22.5", + "@babel/helper-create-regexp-features-plugin": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5" }, "engines": { @@ -2138,25 +2161,26 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.22.20.tgz", - "integrity": "sha512-11MY04gGC4kSzlPHRfvVkNAZhUxOvm7DCJ37hPDnUENwe06npjIRAfInEMTGSb4LZK5ZgDFkv5hw0lGebHeTyg==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.23.3.tgz", + "integrity": "sha512-ovzGc2uuyNfNAs/jyjIGxS8arOHS5FENZaNn4rtE7UdKMMkqHCvboHfcuhWLZNX5cB44QfcGNWjaevxMzzMf+Q==", "dev": true, "dependencies": { - "@babel/compat-data": "^7.22.20", + "@babel/compat-data": "^7.23.3", "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", "@babel/helper-validator-option": "^7.22.15", - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.22.15", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.22.15", + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": "^7.23.3", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.23.3", + "@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly": "^7.23.3", "@babel/plugin-proposal-private-property-in-object": "7.21.0-placeholder-for-preset-env.2", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", "@babel/plugin-syntax-class-static-block": "^7.14.5", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-syntax-export-namespace-from": "^7.8.3", - "@babel/plugin-syntax-import-assertions": "^7.22.5", - "@babel/plugin-syntax-import-attributes": "^7.22.5", + "@babel/plugin-syntax-import-assertions": "^7.23.3", + "@babel/plugin-syntax-import-attributes": "^7.23.3", "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/plugin-syntax-json-strings": "^7.8.3", "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", @@ -2168,59 +2192,58 @@ "@babel/plugin-syntax-private-property-in-object": "^7.14.5", "@babel/plugin-syntax-top-level-await": "^7.14.5", "@babel/plugin-syntax-unicode-sets-regex": "^7.18.6", - "@babel/plugin-transform-arrow-functions": "^7.22.5", - "@babel/plugin-transform-async-generator-functions": "^7.22.15", - "@babel/plugin-transform-async-to-generator": "^7.22.5", - "@babel/plugin-transform-block-scoped-functions": "^7.22.5", - "@babel/plugin-transform-block-scoping": "^7.22.15", - "@babel/plugin-transform-class-properties": "^7.22.5", - "@babel/plugin-transform-class-static-block": "^7.22.11", - "@babel/plugin-transform-classes": "^7.22.15", - "@babel/plugin-transform-computed-properties": "^7.22.5", - "@babel/plugin-transform-destructuring": "^7.22.15", - "@babel/plugin-transform-dotall-regex": "^7.22.5", - "@babel/plugin-transform-duplicate-keys": "^7.22.5", - "@babel/plugin-transform-dynamic-import": "^7.22.11", - "@babel/plugin-transform-exponentiation-operator": "^7.22.5", - "@babel/plugin-transform-export-namespace-from": "^7.22.11", - "@babel/plugin-transform-for-of": "^7.22.15", - "@babel/plugin-transform-function-name": "^7.22.5", - "@babel/plugin-transform-json-strings": "^7.22.11", - "@babel/plugin-transform-literals": "^7.22.5", - "@babel/plugin-transform-logical-assignment-operators": "^7.22.11", - "@babel/plugin-transform-member-expression-literals": "^7.22.5", - "@babel/plugin-transform-modules-amd": "^7.22.5", - "@babel/plugin-transform-modules-commonjs": "^7.22.15", - "@babel/plugin-transform-modules-systemjs": "^7.22.11", - "@babel/plugin-transform-modules-umd": "^7.22.5", + "@babel/plugin-transform-arrow-functions": "^7.23.3", + "@babel/plugin-transform-async-generator-functions": "^7.23.3", + "@babel/plugin-transform-async-to-generator": "^7.23.3", + "@babel/plugin-transform-block-scoped-functions": "^7.23.3", + "@babel/plugin-transform-block-scoping": "^7.23.3", + "@babel/plugin-transform-class-properties": "^7.23.3", + "@babel/plugin-transform-class-static-block": "^7.23.3", + "@babel/plugin-transform-classes": "^7.23.3", + "@babel/plugin-transform-computed-properties": "^7.23.3", + "@babel/plugin-transform-destructuring": "^7.23.3", + "@babel/plugin-transform-dotall-regex": "^7.23.3", + "@babel/plugin-transform-duplicate-keys": "^7.23.3", + "@babel/plugin-transform-dynamic-import": "^7.23.3", + "@babel/plugin-transform-exponentiation-operator": "^7.23.3", + "@babel/plugin-transform-export-namespace-from": "^7.23.3", + "@babel/plugin-transform-for-of": "^7.23.3", + "@babel/plugin-transform-function-name": "^7.23.3", + "@babel/plugin-transform-json-strings": "^7.23.3", + "@babel/plugin-transform-literals": "^7.23.3", + "@babel/plugin-transform-logical-assignment-operators": "^7.23.3", + "@babel/plugin-transform-member-expression-literals": "^7.23.3", + "@babel/plugin-transform-modules-amd": "^7.23.3", + "@babel/plugin-transform-modules-commonjs": "^7.23.3", + "@babel/plugin-transform-modules-systemjs": "^7.23.3", + "@babel/plugin-transform-modules-umd": "^7.23.3", "@babel/plugin-transform-named-capturing-groups-regex": "^7.22.5", - "@babel/plugin-transform-new-target": "^7.22.5", - "@babel/plugin-transform-nullish-coalescing-operator": "^7.22.11", - "@babel/plugin-transform-numeric-separator": "^7.22.11", - "@babel/plugin-transform-object-rest-spread": "^7.22.15", - "@babel/plugin-transform-object-super": "^7.22.5", - "@babel/plugin-transform-optional-catch-binding": "^7.22.11", - "@babel/plugin-transform-optional-chaining": "^7.22.15", - "@babel/plugin-transform-parameters": "^7.22.15", - "@babel/plugin-transform-private-methods": "^7.22.5", - "@babel/plugin-transform-private-property-in-object": "^7.22.11", - "@babel/plugin-transform-property-literals": "^7.22.5", - "@babel/plugin-transform-regenerator": "^7.22.10", - "@babel/plugin-transform-reserved-words": "^7.22.5", - "@babel/plugin-transform-shorthand-properties": "^7.22.5", - "@babel/plugin-transform-spread": "^7.22.5", - "@babel/plugin-transform-sticky-regex": "^7.22.5", - "@babel/plugin-transform-template-literals": "^7.22.5", - "@babel/plugin-transform-typeof-symbol": "^7.22.5", - "@babel/plugin-transform-unicode-escapes": "^7.22.10", - "@babel/plugin-transform-unicode-property-regex": "^7.22.5", - "@babel/plugin-transform-unicode-regex": "^7.22.5", - "@babel/plugin-transform-unicode-sets-regex": "^7.22.5", + "@babel/plugin-transform-new-target": "^7.23.3", + "@babel/plugin-transform-nullish-coalescing-operator": "^7.23.3", + "@babel/plugin-transform-numeric-separator": "^7.23.3", + "@babel/plugin-transform-object-rest-spread": "^7.23.3", + "@babel/plugin-transform-object-super": "^7.23.3", + "@babel/plugin-transform-optional-catch-binding": "^7.23.3", + "@babel/plugin-transform-optional-chaining": "^7.23.3", + "@babel/plugin-transform-parameters": "^7.23.3", + "@babel/plugin-transform-private-methods": "^7.23.3", + "@babel/plugin-transform-private-property-in-object": "^7.23.3", + "@babel/plugin-transform-property-literals": "^7.23.3", + "@babel/plugin-transform-regenerator": "^7.23.3", + "@babel/plugin-transform-reserved-words": "^7.23.3", + "@babel/plugin-transform-shorthand-properties": "^7.23.3", + "@babel/plugin-transform-spread": "^7.23.3", + "@babel/plugin-transform-sticky-regex": "^7.23.3", + "@babel/plugin-transform-template-literals": "^7.23.3", + "@babel/plugin-transform-typeof-symbol": "^7.23.3", + "@babel/plugin-transform-unicode-escapes": "^7.23.3", + "@babel/plugin-transform-unicode-property-regex": "^7.23.3", + "@babel/plugin-transform-unicode-regex": "^7.23.3", + "@babel/plugin-transform-unicode-sets-regex": "^7.23.3", "@babel/preset-modules": "0.1.6-no-external-plugins", - "@babel/types": "^7.22.19", - "babel-plugin-polyfill-corejs2": "^0.4.5", - "babel-plugin-polyfill-corejs3": "^0.8.3", - "babel-plugin-polyfill-regenerator": "^0.5.2", + "babel-plugin-polyfill-corejs2": "^0.4.6", + "babel-plugin-polyfill-corejs3": "^0.8.5", + "babel-plugin-polyfill-regenerator": "^0.5.3", "core-js-compat": "^3.31.0", "semver": "^6.3.1" }, @@ -2232,9 +2255,9 @@ } }, "node_modules/@babel/preset-env/node_modules/@babel/helper-define-polyfill-provider": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.2.tgz", - "integrity": "sha512-k0qnnOqHn5dK9pZpfD5XXZ9SojAITdCKRn2Lp6rnDGzIbaP0rHyMPk/4wsSxVBVz4RfN0q6VpXWP2pDGIoQ7hw==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.3.tgz", + "integrity": "sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug==", "dev": true, "dependencies": { "@babel/helper-compilation-targets": "^7.22.6", @@ -2248,13 +2271,13 @@ } }, "node_modules/@babel/preset-env/node_modules/babel-plugin-polyfill-corejs2": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.5.tgz", - "integrity": "sha512-19hwUH5FKl49JEsvyTcoHakh6BE0wgXLLptIyKZ3PijHc/Ci521wygORCUCCred+E/twuqRyAkE02BAWPmsHOg==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.4.6.tgz", + "integrity": "sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q==", "dev": true, "dependencies": { "@babel/compat-data": "^7.22.6", - "@babel/helper-define-polyfill-provider": "^0.4.2", + "@babel/helper-define-polyfill-provider": "^0.4.3", "semver": "^6.3.1" }, "peerDependencies": { @@ -2262,25 +2285,25 @@ } }, "node_modules/@babel/preset-env/node_modules/babel-plugin-polyfill-corejs3": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.3.tgz", - "integrity": "sha512-z41XaniZL26WLrvjy7soabMXrfPWARN25PZoriDEiLMxAp50AUW3t35BGQUMg5xK3UrpVTtagIDklxYa+MhiNA==", + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.6.tgz", + "integrity": "sha512-leDIc4l4tUgU7str5BWLS2h8q2N4Nf6lGZP6UrNDxdtfF2g69eJ5L0H7S8A5Ln/arfFAfHor5InAdZuIOwZdgQ==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.2", - "core-js-compat": "^3.31.0" + "@babel/helper-define-polyfill-provider": "^0.4.3", + "core-js-compat": "^3.33.1" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, "node_modules/@babel/preset-env/node_modules/babel-plugin-polyfill-regenerator": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.2.tgz", - "integrity": "sha512-tAlOptU0Xj34V1Y2PNTL4Y0FOJMDB6bZmoW39FeCQIhigGLkqu3Fj6uiXpxIf6Ij274ENdYx64y6Au+ZKlb1IA==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.5.3.tgz", + "integrity": "sha512-8sHeDOmXC8csczMrYEOf0UTNa4yE2SxV5JGeT/LP1n0OYVDUUFPxG9vdk2AlDlIit4t+Kf0xCtpgXPBwnn/9pw==", "dev": true, "dependencies": { - "@babel/helper-define-polyfill-provider": "^0.4.2" + "@babel/helper-define-polyfill-provider": "^0.4.3" }, "peerDependencies": { "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" @@ -2329,9 +2352,9 @@ "integrity": "sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA==" }, "node_modules/@babel/runtime": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.15.tgz", - "integrity": "sha512-T0O+aa+4w0u06iNmapipJXMV4HoUir03hpx3/YqXXhu9xim3w+dVphjFWl1OH8NbZHw5Lbm9k45drDkgq2VNNA==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.4.tgz", + "integrity": "sha512-2Yv65nlWnWlSpe3fXEyX5i7fx5kIKo4Qbcj+hMO0odwaneFjfXw5fdum+4yL20O0QiaHpia0cYQ9xpNMqrBwHg==", "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -2358,18 +2381,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.20.tgz", - "integrity": "sha512-eU260mPZbU7mZ0N+X10pxXhQFMGTeLb9eFS0mxehS8HZp9o1uSnFeWQuG1UPrlxgA7QoUzFhOnilHDp0AXCyHw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.4.tgz", + "integrity": "sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg==", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", + "@babel/code-frame": "^7.23.4", + "@babel/generator": "^7.23.4", "@babel/helper-environment-visitor": "^7.22.20", - "@babel/helper-function-name": "^7.22.5", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.16", - "@babel/types": "^7.22.19", + "@babel/parser": "^7.23.4", + "@babel/types": "^7.23.4", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -2399,18 +2422,94 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/@babel/types": { - "version": "7.22.19", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.19.tgz", - "integrity": "sha512-P7LAw/LbojPzkgp5oznjE6tQEIWbp4PkkfrZDINTro9zgBRtI324/EYsiSI7lhPbpIQ+DCeR2NNmMWANGGfZsg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.4.tgz", + "integrity": "sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==", "dependencies": { - "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.19", + "@babel/helper-string-parser": "^7.23.4", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { "node": ">=6.9.0" } }, + "node_modules/@codemirror/autocomplete": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/@codemirror/autocomplete/-/autocomplete-6.11.0.tgz", + "integrity": "sha512-LCPH3W+hl5vcO7OzEQgX6NpKuKVyiKFLGAy7FXROF6nUpsWUdQEgUb3fe/g7B0E1KZCRFfgzdKASt6Wly2UOBg==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.17.0", + "@lezer/common": "^1.0.0" + }, + "peerDependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@codemirror/commands": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/@codemirror/commands/-/commands-6.3.0.tgz", + "integrity": "sha512-tFfcxRIlOWiQDFhjBSWJ10MxcvbCIsRr6V64SgrcaY0MwNk32cUOcCuNlWo8VjV4qRQCgNgUAnIeo0svkk4R5Q==", + "dependencies": { + "@codemirror/language": "^6.0.0", + "@codemirror/state": "^6.2.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.1.0" + } + }, + "node_modules/@codemirror/language": { + "version": "6.9.2", + "resolved": "https://registry.npmjs.org/@codemirror/language/-/language-6.9.2.tgz", + "integrity": "sha512-QGTQXSpAKDIzaSE96zNK1UfIUhPgkT1CLjh1N5qVzZuxgsEOhz5RqaN8QCIdyOQklGLx3MgHd9YrE3X3+Pl1ow==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "@lezer/common": "^1.1.0", + "@lezer/highlight": "^1.0.0", + "@lezer/lr": "^1.0.0", + "style-mod": "^4.0.0" + } + }, + "node_modules/@codemirror/lint": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@codemirror/lint/-/lint-6.4.2.tgz", + "integrity": "sha512-wzRkluWb1ptPKdzlsrbwwjYCPLgzU6N88YBAmlZi8WFyuiEduSd05MnJYNogzyc8rPK7pj6m95ptUApc8sHKVA==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/search": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/@codemirror/search/-/search-6.5.4.tgz", + "integrity": "sha512-YoTrvjv9e8EbPs58opjZKyJ3ewFrVSUzQ/4WXlULQLSDDr1nGPJ67mMXFNNVYwdFhybzhrzrtqgHmtpJwIF+8g==", + "dependencies": { + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0", + "crelt": "^1.0.5" + } + }, + "node_modules/@codemirror/state": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/@codemirror/state/-/state-6.3.1.tgz", + "integrity": "sha512-88e4HhMtKJyw6fKprGaN/yZfiaoGYOi2nM45YCUC6R/kex9sxFWBDGatS1vk4lMgnWmdIIB9tk8Gj1LmL8YfvA==" + }, + "node_modules/@codemirror/view": { + "version": "6.22.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.22.0.tgz", + "integrity": "sha512-6zLj4YIoIpfTGKrDMTbeZRpa8ih4EymMCKmddEDcJWrCdp/N1D46B38YEz4creTb4T177AVS9EyXkLeC/HL2jA==", + "dependencies": { + "@codemirror/state": "^6.1.4", + "style-mod": "^4.1.0", + "w3c-keyname": "^2.2.4" + } + }, "node_modules/@colors/colors": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", @@ -2428,6 +2527,15 @@ "node": ">=10.0.0" } }, + "node_modules/@fortawesome/fontawesome-free": { + "version": "6.4.2", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.4.2.tgz", + "integrity": "sha512-m5cPn3e2+FDCOgi1mz0RexTUvvQibBebOUlUlW0+YrMjDTPkiJ6VTKukA1GRsvRw+12KyJndNjj0O4AgTxm2Pg==", + "hasInstallScript": true, + "engines": { + "node": ">=6" + } + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -2472,9 +2580,9 @@ "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", - "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "version": "0.3.20", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz", + "integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==", "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -2485,6 +2593,27 @@ "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz", "integrity": "sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==" }, + "node_modules/@lezer/common": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.1.tgz", + "integrity": "sha512-aAPB9YbvZHqAW+bIwiuuTDGB4DG0sYNRObGLxud8cW7osw1ZQxfDuTZ8KQiqfZ0QJGcR34CvpTMDXEyo/+Htgg==" + }, + "node_modules/@lezer/highlight": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@lezer/highlight/-/highlight-1.2.0.tgz", + "integrity": "sha512-WrS5Mw51sGrpqjlh3d4/fOwpEV2Hd3YOkp9DBt4k8XZQcoTHZFB7sx030A6OcahF4J1nDQAa3jXlTVVYH50IFA==", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, + "node_modules/@lezer/lr": { + "version": "1.3.14", + "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.14.tgz", + "integrity": "sha512-z5mY4LStlA3yL7aHT/rqgG614cfcvklS+8oFRFBYrs4YaWLJyKKM4+nN6KopToX0o9Hj6zmH6M5kinOYuy06ug==", + "dependencies": { + "@lezer/common": "^1.0.0" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -2526,9 +2655,9 @@ } }, "node_modules/@types/babel__core": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz", - "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -2539,18 +2668,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.5", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz", - "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==", + "version": "7.6.7", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.7.tgz", + "integrity": "sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz", - "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -2558,35 +2687,35 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz", - "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==", + "version": "7.20.4", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.4.tgz", + "integrity": "sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==", "dev": true, "dependencies": { "@babel/types": "^7.20.7" } }, "node_modules/@types/body-parser": { - "version": "1.19.3", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.3.tgz", - "integrity": "sha512-oyl4jvAfTGX9Bt6Or4H9ni1Z447/tQuxnZsytsCaExKlmJiU8sFgnIBRzJUpKwB5eWn9HuBYlUlVA74q/yN0eQ==", + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "node_modules/@types/bonjour": { - "version": "3.5.11", - "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.11.tgz", - "integrity": "sha512-isGhjmBtLIxdHBDl2xGwUzEM8AOyOvWsADWq7rqirdi/ZQoHnLWErHvsThcEzTX8juDRiZtzp2Qkv5bgNh6mAg==", + "version": "3.5.13", + "resolved": "https://registry.npmjs.org/@types/bonjour/-/bonjour-3.5.13.tgz", + "integrity": "sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==", "dependencies": { "@types/node": "*" } }, "node_modules/@types/clean-css": { - "version": "4.2.7", - "resolved": "https://registry.npmjs.org/@types/clean-css/-/clean-css-4.2.7.tgz", - "integrity": "sha512-lcoZHjUAANLTACLGi+O/0pN+oKQAQ8zAMWJSxiBRNLxqZG/WE8hfXJUs1eYwJOvOnDJrvxU1kR77UiVJ3+9N0Q==", + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/@types/clean-css/-/clean-css-4.2.11.tgz", + "integrity": "sha512-Y8n81lQVTAfP2TOdtJJEsCoYl1AnOkqDqMvXb9/7pfgZZ7r8YrEyurrAvAoAjHOGXKRybay+5CsExqIH6liccw==", "dev": true, "dependencies": { "@types/node": "*", @@ -2594,49 +2723,49 @@ } }, "node_modules/@types/connect": { - "version": "3.4.36", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.36.tgz", - "integrity": "sha512-P63Zd/JUGq+PdrM1lv0Wv5SBYeA2+CORvbrXbngriYY0jzLUWfQMQQxOhjONEz/wlHOAxOdY7CY65rgQdTjq2w==", + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", "dependencies": { "@types/node": "*" } }, "node_modules/@types/connect-history-api-fallback": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.1.tgz", - "integrity": "sha512-iaQslNbARe8fctL5Lk+DsmgWOM83lM+7FzP0eQUJs1jd3kBE8NWqBTIT2S8SqQOJjxvt2eyIjpOuYeRXq2AdMw==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/connect-history-api-fallback/-/connect-history-api-fallback-1.5.4.tgz", + "integrity": "sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==", "dependencies": { "@types/express-serve-static-core": "*", "@types/node": "*" } }, "node_modules/@types/eslint": { - "version": "8.44.2", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.2.tgz", - "integrity": "sha512-sdPRb9K6iL5XZOmBubg8yiFp5yS/JdUDQsq5e6h95km91MCYMuvp7mh1fjPEYUhvHepKpZOjnEaMBR4PxjWDzg==", + "version": "8.44.7", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.7.tgz", + "integrity": "sha512-f5ORu2hcBbKei97U73mf+l9t4zTGl74IqZ0GQk4oVea/VS8tQZYkUveSYojk+frraAVYId0V2WC9O4PTNru2FQ==", "dependencies": { "@types/estree": "*", "@types/json-schema": "*" } }, "node_modules/@types/eslint-scope": { - "version": "3.7.4", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", - "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", + "version": "3.7.7", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", + "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", "dependencies": { "@types/eslint": "*", "@types/estree": "*" } }, "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==" }, "node_modules/@types/express": { - "version": "4.17.17", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.17.tgz", - "integrity": "sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==", + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", @@ -2645,9 +2774,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.17.36", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.36.tgz", - "integrity": "sha512-zbivROJ0ZqLAtMzgzIUC4oNqDG9iF0lSsAqpOD9kbs5xcIM3dTiyuHvBc7R8MtWBp3AAWGaovJa+wzWPjLYW7Q==", + "version": "4.17.41", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", + "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2665,49 +2794,49 @@ } }, "node_modules/@types/http-errors": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.2.tgz", - "integrity": "sha512-lPG6KlZs88gef6aD85z3HNkztpj7w2R7HmR3gygjfXCQmsLloWNARFkMuzKiiY8FGdh1XDpgBdrSf4aKDiA7Kg==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" }, "node_modules/@types/http-proxy": { - "version": "1.17.12", - "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.12.tgz", - "integrity": "sha512-kQtujO08dVtQ2wXAuSFfk9ASy3sug4+ogFR8Kd8UgP8PEuc1/G/8yjYRmp//PcDNJEUKOza/MrQu15bouEUCiw==", + "version": "1.17.14", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.14.tgz", + "integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==", "dependencies": { "@types/node": "*" } }, "node_modules/@types/imagemin": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin/-/imagemin-8.0.1.tgz", - "integrity": "sha512-DSpM//dRPzme7doePGkmR1uoquHi0h0ElaA5qFnxHECfFcB8z/jhMI8eqmxWNpHn9ZG18p4PC918sZLhR0cr5A==", + "version": "8.0.5", + "resolved": "https://registry.npmjs.org/@types/imagemin/-/imagemin-8.0.5.tgz", + "integrity": "sha512-tah3dm+5sG+fEDAz6CrQ5evuEaPX9K6DF3E5a01MPOKhA2oGBoC+oA5EJzSugB905sN4DE19EDzldT2Cld2g6Q==", "dev": true, "dependencies": { "@types/node": "*" } }, "node_modules/@types/imagemin-gifsicle": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-gifsicle/-/imagemin-gifsicle-7.0.1.tgz", - "integrity": "sha512-kUz6sUh0P95JOS0RGEaaemWUrASuw+dLsWIveK2UZJx74id/B9epgblMkCk/r5MjUWbZ83wFvacG5Rb/f97gyA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/@types/imagemin-gifsicle/-/imagemin-gifsicle-7.0.4.tgz", + "integrity": "sha512-ZghMBd/Jgqg5utTJNPmvf6DkuHzMhscJ8vgf/7MUGCpO+G+cLrhYltL+5d+h3A1B4W73S2SrmJZ1jS5LACpX+A==", "dev": true, "dependencies": { "@types/imagemin": "*" } }, "node_modules/@types/imagemin-mozjpeg": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-mozjpeg/-/imagemin-mozjpeg-8.0.1.tgz", - "integrity": "sha512-kMQWEoKxxhlnH4POI3qfW9DjXlQfi80ux3l2b3j5R3eudSCoUIzKQLkfMjNJ6eMYnMWBcB+rfQOWqIzdIwFGKw==", + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/@types/imagemin-mozjpeg/-/imagemin-mozjpeg-8.0.4.tgz", + "integrity": "sha512-ZCAxV8SYJB8ehwHpnbRpHjg5Wc4HcyuAMiDhXbkgC7gujDoOTyHO3dhDkUtZ1oK1DLBRZapqG9etdLVhUml7yQ==", "dev": true, "dependencies": { "@types/imagemin": "*" } }, "node_modules/@types/imagemin-optipng": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/@types/imagemin-optipng/-/imagemin-optipng-5.2.1.tgz", - "integrity": "sha512-XCM/3q+HUL7v4zOqMI+dJ5dTxT+MUukY9KU49DSnYb/4yWtSMHJyADP+WHSMVzTR63J2ZvfUOzSilzBNEQW78g==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@types/imagemin-optipng/-/imagemin-optipng-5.2.4.tgz", + "integrity": "sha512-mvKnDMC8eCYZetAQudjs1DbgpR84WhsTx1wgvdiXnpuUEti3oJ+MaMYBRWPY0JlQ4+y4TXKOfa7+LOuT8daegQ==", "dev": true, "dependencies": { "@types/imagemin": "*" @@ -2724,14 +2853,14 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.13", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.13.tgz", - "integrity": "sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ==" + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" }, "node_modules/@types/mime": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", - "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==" + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, "node_modules/@types/minimatch": { "version": "5.1.2", @@ -2739,24 +2868,35 @@ "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==" }, "node_modules/@types/node": { - "version": "20.6.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.3.tgz", - "integrity": "sha512-HksnYH4Ljr4VQgEy2lTStbCKv/P590tmPe5HqOnv9Gprffgv5WXAY+Y5Gqniu0GGqeTCUdBnzC3QSrzPkBkAMA==" + "version": "20.10.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.10.0.tgz", + "integrity": "sha512-D0WfRmU9TQ8I9PFx9Yc+EBHw+vSpIub4IDvQivcp26PtPrdMGAq5SDcpXEo/epqa/DXotVpekHiLNTg3iaKXBQ==", + "dependencies": { + "undici-types": "~5.26.4" + } + }, + "node_modules/@types/node-forge": { + "version": "1.3.10", + "resolved": "https://registry.npmjs.org/@types/node-forge/-/node-forge-1.3.10.tgz", + "integrity": "sha512-y6PJDYN4xYBxwd22l+OVH35N+1fCYWiuC3aiP2SlXVE6Lo7SS+rSx9r89hLxrP4pn6n1lBGhHJ12pj3F3Mpttw==", + "dependencies": { + "@types/node": "*" + } }, "node_modules/@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.2.tgz", + "integrity": "sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==" }, "node_modules/@types/qs": { - "version": "6.9.8", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.8.tgz", - "integrity": "sha512-u95svzDlTysU5xecFNTgfFG5RUWu1A9P0VzgpcIiGZA9iraHOdSzcxMxQ55DyeRaGCSxQi7LxXDI4rzq/MYfdg==" + "version": "6.9.10", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==" }, "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==" + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "node_modules/@types/retry": { "version": "0.12.0", @@ -2764,26 +2904,26 @@ "integrity": "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==" }, "node_modules/@types/send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.1.tgz", - "integrity": "sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==", + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", "dependencies": { "@types/mime": "^1", "@types/node": "*" } }, "node_modules/@types/serve-index": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.1.tgz", - "integrity": "sha512-d/Hs3nWDxNL2xAczmOVZNj92YZCS6RGxfBPjKzuu/XirCgXdpKEb88dYNbrYGint6IVWLNP+yonwVAuRC0T2Dg==", + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/@types/serve-index/-/serve-index-1.9.4.tgz", + "integrity": "sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==", "dependencies": { "@types/express": "*" } }, "node_modules/@types/serve-static": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.2.tgz", - "integrity": "sha512-J2LqtvFYCzaj8pVYKw8klQXrLLk7TBZmQ4ShlcdkELFKGwGMfevMLneMMRkMgZxotOD9wg497LpC7O8PcvAmfw==", + "version": "1.15.5", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", + "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", "dependencies": { "@types/http-errors": "*", "@types/mime": "*", @@ -2791,9 +2931,9 @@ } }, "node_modules/@types/sockjs": { - "version": "0.3.33", - "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.33.tgz", - "integrity": "sha512-f0KEEe05NvUnat+boPTZ0dgaLZ4SfSouXUgv5noUiefG2ajgKjmETo9ZJyuqsl7dfl2aHlLJUiki6B4ZYldiiw==", + "version": "0.3.36", + "resolved": "https://registry.npmjs.org/@types/sockjs/-/sockjs-0.3.36.tgz", + "integrity": "sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==", "dependencies": { "@types/node": "*" } @@ -2805,9 +2945,9 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.5.5", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", - "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", + "version": "8.5.10", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", + "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", "dependencies": { "@types/node": "*" } @@ -2999,9 +3139,9 @@ } }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz", + "integrity": "sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==", "bin": { "acorn": "bin/acorn" }, @@ -3239,9 +3379,9 @@ } }, "node_modules/axios": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.5.0.tgz", - "integrity": "sha512-D4DdjDo5CY50Qms0qGQTTw6Q44jl7zRwY7bthds06pUGfChBCTcQs+N743eFWGEd6pRTMd6A+I87aWyFV5wiZQ==", + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.2.tgz", + "integrity": "sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==", "dev": true, "dependencies": { "follow-redirects": "^1.15.0", @@ -3475,19 +3615,22 @@ } }, "node_modules/browserify-sign": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz", - "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.2.tgz", + "integrity": "sha512-1rudGyeYY42Dk6texmv7c4VcQ0EsvVbLwZkA+AQB7SxvXxmcD93jcHie8bzecJ+ChDlmAm2Qyu0+Ccg5uhZXCg==", "dependencies": { - "bn.js": "^5.1.1", - "browserify-rsa": "^4.0.1", + "bn.js": "^5.2.1", + "browserify-rsa": "^4.1.0", "create-hash": "^1.2.0", "create-hmac": "^1.1.7", - "elliptic": "^6.5.3", + "elliptic": "^6.5.4", "inherits": "^2.0.4", - "parse-asn1": "^5.1.5", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" + "parse-asn1": "^5.1.6", + "readable-stream": "^3.6.2", + "safe-buffer": "^5.2.1" + }, + "engines": { + "node": ">= 4" } }, "node_modules/browserify-sign/node_modules/readable-stream": { @@ -3512,9 +3655,9 @@ } }, "node_modules/browserslist": { - "version": "4.21.10", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz", - "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==", + "version": "4.22.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", + "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", "funding": [ { "type": "opencollective", @@ -3530,10 +3673,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001517", - "electron-to-chromium": "^1.4.477", + "caniuse-lite": "^1.0.30001541", + "electron-to-chromium": "^1.4.535", "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.11" + "update-browserslist-db": "^1.0.13" }, "bin": { "browserslist": "cli.js" @@ -3576,12 +3719,13 @@ } }, "node_modules/call-bind": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", - "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", + "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", "dependencies": { - "function-bind": "^1.1.1", - "get-intrinsic": "^1.0.2" + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.1", + "set-function-length": "^1.1.1" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -3624,9 +3768,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001538", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001538.tgz", - "integrity": "sha512-HWJnhnID+0YMtGlzcp3T9drmBJUVDchPJ08tpUGFLs9CYlwWPH2uLgpHn8fND5pCgXVtnGS3H4QR9XLMHVNkHw==", + "version": "1.0.30001564", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001564.tgz", + "integrity": "sha512-DqAOf+rhof+6GVx1y+xzbFPeOumfQnhYzVnZD6LAXijR77yPtm9mfOcqOnT3mpnJiZVT+kwLAFnRlZcIz+c6bg==", "funding": [ { "type": "opencollective", @@ -3757,6 +3901,28 @@ "node": ">=6" } }, + "node_modules/codemirror": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-6.0.1.tgz", + "integrity": "sha512-J8j+nZ+CdWmIeFIGXEFbFPtpiYacFMDR8GlHK3IyHQJMCaVRfGx9NT+Hxivv1ckLWPvNdZqndbr/7lVhrf/Svg==", + "dependencies": { + "@codemirror/autocomplete": "^6.0.0", + "@codemirror/commands": "^6.0.0", + "@codemirror/language": "^6.0.0", + "@codemirror/lint": "^6.0.0", + "@codemirror/search": "^6.0.0", + "@codemirror/state": "^6.0.0", + "@codemirror/view": "^6.0.0" + } + }, + "node_modules/codemirror-spell-checker": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/codemirror-spell-checker/-/codemirror-spell-checker-1.1.2.tgz", + "integrity": "sha512-2Tl6n0v+GJRsC9K3MLCdLaMOmvWL0uukajNJseorZJsslaxZyZMgENocPU8R0DyoTAiKsyqiemSOZo7kjGV0LQ==", + "dependencies": { + "typo-js": "*" + } + }, "node_modules/collect.js": { "version": "4.36.1", "resolved": "https://registry.npmjs.org/collect.js/-/collect.js-4.36.1.tgz", @@ -3943,11 +4109,11 @@ } }, "node_modules/core-js-compat": { - "version": "3.32.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.32.2.tgz", - "integrity": "sha512-+GjlguTDINOijtVRUxrQOv3kfu9rl+qPNdX2LTbJ/ZyVTuxK+ksVSAGX1nHstu4hrv1En/uPTtWgq2gI5wt4AQ==", + "version": "3.33.3", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.33.3.tgz", + "integrity": "sha512-cNzGqFsh3Ot+529GIXacjTJ7kegdt5fPXxCBVS1G0iaZpuo/tBz399ymceLJveQhFFZ8qThHiP3fzuoQjKN2ow==", "dependencies": { - "browserslist": "^4.21.10" + "browserslist": "^4.22.1" }, "funding": { "type": "opencollective", @@ -4013,6 +4179,11 @@ "sha.js": "^2.4.8" } }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==" + }, "node_modules/cross-env": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", @@ -4363,9 +4534,9 @@ } }, "node_modules/define-data-property": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.0.tgz", - "integrity": "sha512-UzGwzcjyv3OtAvolTj1GoyNYzfFR+iqbGjcnBEENZVCpM4/Ng1yhGNvS3lR/xDS74Tb2wGG9WzNSNIOS9UVb2g==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", + "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", "dependencies": { "get-intrinsic": "^1.2.1", "gopd": "^1.0.1", @@ -4596,9 +4767,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/electron-to-chromium": { - "version": "1.4.526", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.526.tgz", - "integrity": "sha512-tjjTMjmZAx1g6COrintLTa2/jcafYKxKoiEkdQOrVdbLaHh2wCt2nsAF8ZHweezkrP+dl/VG9T5nabcYoo0U5Q==" + "version": "1.4.593", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.593.tgz", + "integrity": "sha512-c7+Hhj87zWmdpmjDONbvNKNo24tvmD4mjal1+qqTYTrlF0/sNpAcDlU0Ki84ftA/5yj3BF2QhSGEC0Rky6larg==" }, "node_modules/elliptic": { "version": "6.5.4", @@ -4661,9 +4832,9 @@ } }, "node_modules/envinfo": { - "version": "7.10.0", - "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.10.0.tgz", - "integrity": "sha512-ZtUjZO6l5mwTHvc1L9+1q5p/R3wTopcfqMW8r5t8SJSKqeVI/LtajORwRFEKpEFuekjD0VBjwu1HMxL4UalIRw==", + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.11.0.tgz", + "integrity": "sha512-G9/6xF1FPbIw0TtalAMaVPpiq2aDEuKLXM314jPVAO9r2fo2a4BLqMNkmRS7O/xPPZ+COAhGIz3ETvHEV3eUcg==", "bin": { "envinfo": "dist/cli.js" }, @@ -4680,9 +4851,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.3.1.tgz", - "integrity": "sha512-JUFAyicQV9mXc3YRxPnDlrfBKpqt6hUYzz9/boprUJHs4e4KVr3XwOF70doO6gwXUor6EWZJAyWAfKki84t20Q==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", + "integrity": "sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==" }, "node_modules/es5-ext": { "version": "0.10.62", @@ -4911,6 +5082,11 @@ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" }, + "node_modules/express/node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + }, "node_modules/express/node_modules/qs": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", @@ -4958,9 +5134,9 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -5104,6 +5280,14 @@ "node": ">=8" } }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "bin": { + "flat": "cli.js" + } + }, "node_modules/follow-redirects": { "version": "1.15.3", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.3.tgz", @@ -5145,9 +5329,9 @@ } }, "node_modules/fraction.js": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.6.tgz", - "integrity": "sha512-n2aZ9tNfYDwaHhvFTkhFErqOMIb8uyzSQ+vGJBjZyanAKZVbGUQ1sngfk9FdkBw7G26O7AgNjLcecLffD1c7eg==", + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.3.7.tgz", + "integrity": "sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==", "engines": { "node": "*" }, @@ -5178,9 +5362,9 @@ } }, "node_modules/fs-monkey": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.4.tgz", - "integrity": "sha512-INM/fWAxMICjttnD0DX1rBvinKskj5G1w+oy/pnm9u/tSlnBrzFonJMcalKJ30P8RRsPzKcCG7Q8l0jx5Fh9YQ==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/fs-monkey/-/fs-monkey-1.0.5.tgz", + "integrity": "sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew==" }, "node_modules/fs.realpath": { "version": "1.0.0", @@ -5201,9 +5385,12 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/gensync": { "version": "1.0.0-beta.2", @@ -5222,14 +5409,14 @@ } }, "node_modules/get-intrinsic": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", - "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", + "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "dependencies": { - "function-bind": "^1.1.1", - "has": "^1.0.3", + "function-bind": "^1.1.2", "has-proto": "^1.0.1", - "has-symbols": "^1.0.3" + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5334,12 +5521,9 @@ "integrity": "sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==" }, "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dependencies": { - "function-bind": "^1.1.1" - }, + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.4.tgz", + "integrity": "sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==", "engines": { "node": ">= 0.4.0" } @@ -5353,11 +5537,11 @@ } }, "node_modules/has-property-descriptors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", - "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", + "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", "dependencies": { - "get-intrinsic": "^1.1.1" + "get-intrinsic": "^1.2.2" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -5425,6 +5609,17 @@ "minimalistic-assert": "^1.0.1" } }, + "node_modules/hasown": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", + "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -5694,9 +5889,9 @@ ] }, "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", + "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", "engines": { "node": ">= 4" } @@ -5846,11 +6041,11 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -6261,12 +6456,12 @@ "dev": true }, "node_modules/launch-editor": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.0.tgz", - "integrity": "sha512-JpDCcQnyAAzZZaZ7vEiSqL690w7dAEyLao+KC96zBplnYbJS7TYNjvM3M7y3dGz+v7aIsJk3hllWuc0kWAjyRQ==", + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.6.1.tgz", + "integrity": "sha512-eB/uXmFVpY4zezmGp5XtU21kwo7GBbKB+EQ+UZeWtGb9yAM5xt/Evk+lYH3eRNAtId+ej4u7TYPFZ07w4s7rRw==", "dependencies": { "picocolors": "^1.0.0", - "shell-quote": "^1.7.3" + "shell-quote": "^1.8.1" } }, "node_modules/lilconfig": { @@ -6365,6 +6560,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/marked": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-10.0.0.tgz", + "integrity": "sha512-YiGcYcWj50YrwBgNzFoYhQ1hT6GmQbFG8SksnYJX1z4BXTHSOrz1GB5/Jm2yQvMg4nN1FHP4M6r03R10KrVUiA==", + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 18" + } + }, "node_modules/md5": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", @@ -6386,9 +6592,9 @@ } }, "node_modules/mdn-data": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.1.0.tgz", - "integrity": "sha512-dbAWH6A+2NGuVJlQFrTKHJc07Vqn5frnhyTOGz+7BsK7V2hHdoBcwoiyV3QVhLHYpM/zqe2OSUn5ZWbVXLBB8A==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.3.0.tgz", + "integrity": "sha512-BhLaX4PxsBIBRqqmO3EIVpwUL0dma/evS8RjGwIVomw61jRikAMpeivHEMqH+VBZWQhuL+DWiImGbEIcDqu8/Q==" }, "node_modules/media-typer": { "version": "0.3.0", @@ -6410,9 +6616,12 @@ } }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge-stream": { "version": "2.0.0", @@ -6594,9 +6803,9 @@ } }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "funding": [ { "type": "github", @@ -6786,9 +6995,9 @@ } }, "node_modules/object-inspect": { - "version": "1.12.3", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", - "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", + "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -7102,9 +7311,9 @@ } }, "node_modules/postcss": { - "version": "8.4.30", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.30.tgz", - "integrity": "sha512-7ZEao1g4kd68l97aWG/etQKPKq07us0ieSZ2TnFDk11i0ZfDW2AwKHYU8qv4MZKqN2fdBfg+7q0ES06UA73C1g==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "funding": [ { "type": "opencollective", @@ -7722,9 +7931,9 @@ "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "engines": { "node": ">=6" } @@ -7974,9 +8183,9 @@ "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==" }, "node_modules/resolve": { - "version": "1.22.6", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.6.tgz", - "integrity": "sha512-njhxM7mV12JfufShqGy3Rz8j11RPdLy4xi15UurGJeoHLfJpVXKdh3ueuOqbYUcDZnffr6X739JBo5LzyahEsw==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dependencies": { "is-core-module": "^2.13.0", "path-parse": "^1.0.7", @@ -8220,9 +8429,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/sass": { - "version": "1.68.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.68.0.tgz", - "integrity": "sha512-Lmj9lM/fef0nQswm1J2HJcEsBUba4wgNx2fea6yJHODREoMFnwRpZydBnX/RjyXw2REIwdkbqE4hrTo4qfDBUA==", + "version": "1.69.5", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.69.5.tgz", + "integrity": "sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -8327,10 +8536,11 @@ "integrity": "sha512-Hr9TdhyHCZUtwznEH2CBf7967mEM0idtJ5nMtjvk3Up5tPukOLXbHUNmh10oRfeNIhj+3GD3niu+g6sVK+gK0A==" }, "node_modules/selfsigned": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.1.1.tgz", - "integrity": "sha512-GSL3aowiF7wa/WtSFwnUrludWFoNhftq8bUkH9pkzjpN2XSPOAYEgg6e0sS9s0rZwgJzJiQRPU18A6clnoW5wQ==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-2.4.1.tgz", + "integrity": "sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==", "dependencies": { + "@types/node-forge": "^1.3.0", "node-forge": "^1" }, "engines": { @@ -8447,6 +8657,20 @@ "node": ">= 0.8.0" } }, + "node_modules/set-function-length": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", + "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", + "dependencies": { + "define-data-property": "^1.1.1", + "get-intrinsic": "^1.2.1", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/setimmediate": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", @@ -8530,6 +8754,16 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/simplemde": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/simplemde/-/simplemde-1.11.2.tgz", + "integrity": "sha512-AUXuHJ/tEEDEcN/MTitHIw3AuBcheizJt7SVwtyn00B0UK5RKZ3GB+JndmRcJ5wfYGCIL0O2yJm/uz0sJOFSLg==", + "dependencies": { + "codemirror": "*", + "codemirror-spell-checker": "*", + "marked": "*" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -8695,9 +8929,9 @@ } }, "node_modules/std-env": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz", - "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.5.0.tgz", + "integrity": "sha512-JGUEaALvL0Mf6JCfYnJOTcobY+Nc7sG/TemDRBqCA0wEr4DER7zDchaaixTlmOxAjG1uRJmX82EQcxwTQTkqVA==" }, "node_modules/stream-browserify": { "version": "2.0.2", @@ -8796,6 +9030,11 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/style-mod": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/style-mod/-/style-mod-4.1.0.tgz", + "integrity": "sha512-Ca5ib8HrFn+f+0n4N4ScTIA9iTOQ7MaGS1ylHcoVqW9J7w2w8PzN6g9gKmTYgGEBH8e120+RCmhpje6jC5uGWA==" + }, "node_modules/stylehacks": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/stylehacks/-/stylehacks-5.1.1.tgz", @@ -8870,9 +9109,9 @@ } }, "node_modules/terser": { - "version": "5.20.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.20.0.tgz", - "integrity": "sha512-e56ETryaQDyebBwJIWYB2TT6f2EZ0fL0sW/JRXNMN26zZdKi2u/E/5my5lG6jNxym6qsrVXfFRmOdV42zlAgLQ==", + "version": "5.24.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.24.0.tgz", + "integrity": "sha512-ZpGR4Hy3+wBEzVEnHvstMvqpD/nABNelQn/z2r0fjVWGQsN3bpOLzQlqDxmb4CDZnXq5lpjnQ+mHQLAOpfM5iw==", "dependencies": { "@jridgewell/source-map": "^0.3.3", "acorn": "^8.8.2", @@ -9011,6 +9250,16 @@ "node": ">= 0.6" } }, + "node_modules/typo-js": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/typo-js/-/typo-js-1.2.3.tgz", + "integrity": "sha512-67Hyl94beZX8gmTap7IDPrG5hy2cHftgsCAcGvE1tzuxGT+kRB+zSBin0wIMwysYw8RUCBCvv9UfQl8TNM75dA==" + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" + }, "node_modules/unicode-canonical-property-names-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", @@ -9048,9 +9297,9 @@ } }, "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "engines": { "node": ">= 10.0.0" } @@ -9064,9 +9313,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.12.tgz", - "integrity": "sha512-tE1smlR58jxbFMtrMpFNRmsrOXlpNXss965T1CrpwuZUzUAg/TBQc94SpyhDLSzrqrJS9xTRBthnZAGcE1oaxg==", + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", + "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", "funding": [ { "type": "opencollective", @@ -9200,6 +9449,11 @@ "node": ">=4.0.0" } }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==" + }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -9221,9 +9475,9 @@ } }, "node_modules/webpack": { - "version": "5.88.2", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz", - "integrity": "sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ==", + "version": "5.89.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz", + "integrity": "sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw==", "dependencies": { "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.0", @@ -9499,11 +9753,12 @@ } }, "node_modules/webpack-merge": { - "version": "5.9.0", - "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.9.0.tgz", - "integrity": "sha512-6NbRQw4+Sy50vYNTw7EyOn41OZItPiXB8GNv3INSoe3PSFaHJEz3SHTrYVaRm2LilNGnFUzh0FAwqPEmU/CwDg==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", + "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", "dependencies": { "clone-deep": "^4.0.1", + "flat": "^5.0.2", "wildcard": "^2.0.0" }, "engines": { diff --git a/package.json b/package.json index 8f987932..94a13e70 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "doc": "docs" }, "dependencies": { + "@fortawesome/fontawesome-free": "^6.4.2", "accepts": "^1.3.8", "acorn": "^8.8.2", "acorn-import-assertions": "^1.8.0", @@ -451,6 +452,7 @@ "shellwords": "^0.1.1", "side-channel": "^1.0.4", "signal-exit": "^3.0.7", + "simplemde": "^1.11.2", "slash": "^3.0.0", "sockjs": "^0.3.24", "source-list-map": "^2.0.1", diff --git a/public/css/all.css b/public/css/all.css index 848b5127..98e80760 100644 --- a/public/css/all.css +++ b/public/css/all.css @@ -50781,3 +50781,20 @@ form { background-color: #f1f2f3; cursor: inherit; } + +/** + * simplemde v1.11.2 + * Copyright Next Step Webs, Inc. + * @link https://github.com/NextStepWebs/simplemde-markdown-editor + * @license MIT + */ +.CodeMirror{color:#000}.CodeMirror-lines{padding:4px 0}.CodeMirror pre{padding:0 4px}.CodeMirror-gutter-filler,.CodeMirror-scrollbar-filler{background-color:#fff}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:#000}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid #000;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0!important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-animate-fat-cursor{width:auto;border:0;-webkit-animation:blink 1.06s steps(1) infinite;-moz-animation:blink 1.06s steps(1) infinite;animation:blink 1.06s steps(1) infinite;background-color:#7e7}@-moz-keyframes blink{50%{background-color:transparent}}@-webkit-keyframes blink{50%{background-color:transparent}}@keyframes blink{50%{background-color:transparent}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-ruler{border-left:1px solid #ccc;position:absolute}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:700}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta,.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-invalidchar,.cm-s-default .cm-error{color:red}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-matchingtag{background:rgba(255,150,0,.3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:#fff}.CodeMirror-scroll{overflow:scroll!important;margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;height:100%;outline:0;position:relative}.CodeMirror-sizer{position:relative;border-right:30px solid transparent}.CodeMirror-gutter-filler,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-vscrollbar{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-30px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:0 0!important;border:none!important;-webkit-user-select:none;-moz-user-select:none;user-select:none}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text;min-height:1px}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:0 0;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:none;font-variant-ligatures:none}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-code{outline:0}.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber,.CodeMirror-scroll,.CodeMirror-sizer{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}.CodeMirror-focused div.CodeMirror-cursors,div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected,.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,.4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:0 0}.CodeMirror{height:auto;min-height:300px;border:1px solid #ddd;border-bottom-left-radius:4px;border-bottom-right-radius:4px;padding:10px;font:inherit;z-index:1}.CodeMirror-scroll{min-height:300px}.CodeMirror-fullscreen{background:#fff;position:fixed!important;top:50px;left:0;right:0;bottom:0;height:auto;z-index:9}.CodeMirror-sided{width:50%!important}.editor-toolbar{position:relative;opacity:.6;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;padding:0 10px;border-top:1px solid #bbb;border-left:1px solid #bbb;border-right:1px solid #bbb;border-top-left-radius:4px;border-top-right-radius:4px}.editor-toolbar:after,.editor-toolbar:before{display:block;content:' ';height:1px}.editor-toolbar:before{margin-bottom:8px}.editor-toolbar:after{margin-top:8px}.editor-toolbar:hover,.editor-wrapper input.title:focus,.editor-wrapper input.title:hover{opacity:.8}.editor-toolbar.fullscreen{width:100%;height:50px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;padding-top:10px;padding-bottom:10px;box-sizing:border-box;background:#fff;border:0;position:fixed;top:0;left:0;opacity:1;z-index:9}.editor-toolbar.fullscreen::before{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,1)),color-stop(100%,rgba(255,255,255,0)));background:-webkit-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-o-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);background:linear-gradient(to right,rgba(255,255,255,1) 0,rgba(255,255,255,0) 100%);position:fixed;top:0;left:0;margin:0;padding:0}.editor-toolbar.fullscreen::after{width:20px;height:50px;background:-moz-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,right top,color-stop(0,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(left,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to right,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);position:fixed;top:0;right:0;margin:0;padding:0}.editor-toolbar a{display:inline-block;text-align:center;text-decoration:none!important;color:#2c3e50!important;width:30px;height:30px;margin:0;border:1px solid transparent;border-radius:3px;cursor:pointer}.editor-toolbar a.active,.editor-toolbar a:hover{background:#fcfcfc;border-color:#95a5a6}.editor-toolbar a:before{line-height:30px}.editor-toolbar i.separator{display:inline-block;width:0;border-left:1px solid #d9d9d9;border-right:1px solid #fff;color:transparent;text-indent:-10px;margin:0 6px}.editor-toolbar a.fa-header-x:after{font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:65%;vertical-align:text-bottom;position:relative;top:2px}.editor-toolbar a.fa-header-1:after{content:"1"}.editor-toolbar a.fa-header-2:after{content:"2"}.editor-toolbar a.fa-header-3:after{content:"3"}.editor-toolbar a.fa-header-bigger:after{content:"▲"}.editor-toolbar a.fa-header-smaller:after{content:"▼"}.editor-toolbar.disabled-for-preview a:not(.no-disable){pointer-events:none;background:#fff;border-color:transparent;text-shadow:inherit}@media only screen and (max-width:700px){.editor-toolbar a.no-mobile{display:none}}.editor-statusbar{padding:8px 10px;font-size:12px;color:#959694;text-align:right}.editor-statusbar span{display:inline-block;min-width:4em;margin-left:1em}.editor-preview,.editor-preview-side{padding:10px;background:#fafafa;overflow:auto;display:none;box-sizing:border-box}.editor-statusbar .lines:before{content:'lines: '}.editor-statusbar .words:before{content:'words: '}.editor-statusbar .characters:before{content:'characters: '}.editor-preview{position:absolute;width:100%;height:100%;top:0;left:0;z-index:7}.editor-preview-side{position:fixed;bottom:0;width:50%;top:50px;right:0;z-index:9;border:1px solid #ddd}.editor-preview-active,.editor-preview-active-side{display:block}.editor-preview-side>p,.editor-preview>p{margin-top:0}.editor-preview pre,.editor-preview-side pre{background:#eee;margin-bottom:10px}.editor-preview table td,.editor-preview table th,.editor-preview-side table td,.editor-preview-side table th{border:1px solid #ddd;padding:5px}.CodeMirror .CodeMirror-code .cm-tag{color:#63a35c}.CodeMirror .CodeMirror-code .cm-attribute{color:#795da3}.CodeMirror .CodeMirror-code .cm-string{color:#183691}.CodeMirror .CodeMirror-selected{background:#d9d9d9}.CodeMirror .CodeMirror-code .cm-header-1{font-size:200%;line-height:200%}.CodeMirror .CodeMirror-code .cm-header-2{font-size:160%;line-height:160%}.CodeMirror .CodeMirror-code .cm-header-3{font-size:125%;line-height:125%}.CodeMirror .CodeMirror-code .cm-header-4{font-size:110%;line-height:110%}.CodeMirror .CodeMirror-code .cm-comment{background:rgba(0,0,0,.05);border-radius:2px}.CodeMirror .CodeMirror-code .cm-link{color:#7f8c8d}.CodeMirror .CodeMirror-code .cm-url{color:#aab2b3}.CodeMirror .CodeMirror-code .cm-strikethrough{text-decoration:line-through}.CodeMirror .CodeMirror-placeholder{opacity:.5}.CodeMirror .cm-spell-error:not(.cm-url):not(.cm-comment):not(.cm-tag):not(.cm-word){background:rgba(255,0,0,.15)} +/*! + * Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com + * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) + * Copyright 2023 Fonticons, Inc. + */ +.fa{font-family:var(--fa-style-family,"Font Awesome 6 Free");font-weight:var(--fa-style,900)}.fa,.fa-brands,.fa-classic,.fa-regular,.fa-sharp,.fa-solid,.fab,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:var(--fa-display,inline-block);font-style:normal;font-variant:normal;line-height:1;text-rendering:auto}.fa-classic,.fa-regular,.fa-solid,.far,.fas{font-family:"Font Awesome 6 Free"}.fa-brands,.fab{font-family:"Font Awesome 6 Brands"}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-2xs{font-size:.625em;line-height:.1em;vertical-align:.225em}.fa-xs{font-size:.75em;line-height:.08333em;vertical-align:.125em}.fa-sm{font-size:.875em;line-height:.07143em;vertical-align:.05357em}.fa-lg{font-size:1.25em;line-height:.05em;vertical-align:-.075em}.fa-xl{font-size:1.5em;line-height:.04167em;vertical-align:-.125em}.fa-2xl{font-size:2em;line-height:.03125em;vertical-align:-.1875em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:var(--fa-li-margin,2.5em);padding-left:0}.fa-ul>li{position:relative}.fa-li{left:calc(var(--fa-li-width, 2em)*-1);position:absolute;text-align:center;width:var(--fa-li-width,2em);line-height:inherit}.fa-border{border-radius:var(--fa-border-radius,.1em);border:var(--fa-border-width,.08em) var(--fa-border-style,solid) var(--fa-border-color,#eee);padding:var(--fa-border-padding,.2em .25em .15em)}.fa-pull-left{float:left;margin-right:var(--fa-pull-margin,.3em)}.fa-pull-right{float:right;margin-left:var(--fa-pull-margin,.3em)}.fa-beat{-webkit-animation-name:fa-beat;animation-name:fa-beat;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-bounce{-webkit-animation-name:fa-bounce;animation-name:fa-bounce;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.28,.84,.42,1))}.fa-fade{-webkit-animation-name:fa-fade;animation-name:fa-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-beat-fade,.fa-fade{-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s)}.fa-beat-fade{-webkit-animation-name:fa-beat-fade;animation-name:fa-beat-fade;-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1));animation-timing-function:var(--fa-animation-timing,cubic-bezier(.4,0,.6,1))}.fa-flip{-webkit-animation-name:fa-flip;animation-name:fa-flip;-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,ease-in-out);animation-timing-function:var(--fa-animation-timing,ease-in-out)}.fa-shake{-webkit-animation-name:fa-shake;animation-name:fa-shake;-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-shake,.fa-spin{-webkit-animation-delay:var(--fa-animation-delay,0s);animation-delay:var(--fa-animation-delay,0s);-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal)}.fa-spin{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-duration:var(--fa-animation-duration,2s);animation-duration:var(--fa-animation-duration,2s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,linear);animation-timing-function:var(--fa-animation-timing,linear)}.fa-spin-reverse{--fa-animation-direction:reverse}.fa-pulse,.fa-spin-pulse{-webkit-animation-name:fa-spin;animation-name:fa-spin;-webkit-animation-direction:var(--fa-animation-direction,normal);animation-direction:var(--fa-animation-direction,normal);-webkit-animation-duration:var(--fa-animation-duration,1s);animation-duration:var(--fa-animation-duration,1s);-webkit-animation-iteration-count:var(--fa-animation-iteration-count,infinite);animation-iteration-count:var(--fa-animation-iteration-count,infinite);-webkit-animation-timing-function:var(--fa-animation-timing,steps(8));animation-timing-function:var(--fa-animation-timing,steps(8))}@media (prefers-reduced-motion:reduce){.fa-beat,.fa-beat-fade,.fa-bounce,.fa-fade,.fa-flip,.fa-pulse,.fa-shake,.fa-spin,.fa-spin-pulse{-webkit-animation-delay:-1ms;animation-delay:-1ms;-webkit-animation-duration:1ms;animation-duration:1ms;-webkit-animation-iteration-count:1;animation-iteration-count:1;-webkit-transition-delay:0s;transition-delay:0s;-webkit-transition-duration:0s;transition-duration:0s}}@-webkit-keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@keyframes fa-beat{0%,90%{-webkit-transform:scale(1);transform:scale(1)}45%{-webkit-transform:scale(var(--fa-beat-scale,1.25));transform:scale(var(--fa-beat-scale,1.25))}}@-webkit-keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@keyframes fa-bounce{0%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}10%{-webkit-transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0);transform:scale(var(--fa-bounce-start-scale-x,1.1),var(--fa-bounce-start-scale-y,.9)) translateY(0)}30%{-webkit-transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em));transform:scale(var(--fa-bounce-jump-scale-x,.9),var(--fa-bounce-jump-scale-y,1.1)) translateY(var(--fa-bounce-height,-.5em))}50%{-webkit-transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0);transform:scale(var(--fa-bounce-land-scale-x,1.05),var(--fa-bounce-land-scale-y,.95)) translateY(0)}57%{-webkit-transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em));transform:scale(1) translateY(var(--fa-bounce-rebound,-.125em))}64%{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}to{-webkit-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}}@-webkit-keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@keyframes fa-fade{50%{opacity:var(--fa-fade-opacity,.4)}}@-webkit-keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@keyframes fa-beat-fade{0%,to{opacity:var(--fa-beat-fade-opacity,.4);-webkit-transform:scale(1);transform:scale(1)}50%{opacity:1;-webkit-transform:scale(var(--fa-beat-fade-scale,1.125));transform:scale(var(--fa-beat-fade-scale,1.125))}}@-webkit-keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@keyframes fa-flip{50%{-webkit-transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg));transform:rotate3d(var(--fa-flip-x,0),var(--fa-flip-y,1),var(--fa-flip-z,0),var(--fa-flip-angle,-180deg))}}@-webkit-keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@keyframes fa-shake{0%{-webkit-transform:rotate(-15deg);transform:rotate(-15deg)}4%{-webkit-transform:rotate(15deg);transform:rotate(15deg)}8%,24%{-webkit-transform:rotate(-18deg);transform:rotate(-18deg)}12%,28%{-webkit-transform:rotate(18deg);transform:rotate(18deg)}16%{-webkit-transform:rotate(-22deg);transform:rotate(-22deg)}20%{-webkit-transform:rotate(22deg);transform:rotate(22deg)}32%{-webkit-transform:rotate(-12deg);transform:rotate(-12deg)}36%{-webkit-transform:rotate(12deg);transform:rotate(12deg)}40%,to{-webkit-transform:rotate(0deg);transform:rotate(0deg)}}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-webkit-transform:scaleY(-1);transform:scaleY(-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1);transform:scale(-1)}.fa-rotate-by{-webkit-transform:rotate(var(--fa-rotate-angle,none));transform:rotate(var(--fa-rotate-angle,none))}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%;z-index:var(--fa-stack-z-index,auto)}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:var(--fa-inverse,#fff)} + +.fa-0:before{content:"\30"}.fa-1:before{content:"\31"}.fa-2:before{content:"\32"}.fa-3:before{content:"\33"}.fa-4:before{content:"\34"}.fa-5:before{content:"\35"}.fa-6:before{content:"\36"}.fa-7:before{content:"\37"}.fa-8:before{content:"\38"}.fa-9:before{content:"\39"}.fa-fill-drip:before{content:"\f576"}.fa-arrows-to-circle:before{content:"\e4bd"}.fa-chevron-circle-right:before,.fa-circle-chevron-right:before{content:"\f138"}.fa-at:before{content:"\40"}.fa-trash-alt:before,.fa-trash-can:before{content:"\f2ed"}.fa-text-height:before{content:"\f034"}.fa-user-times:before,.fa-user-xmark:before{content:"\f235"}.fa-stethoscope:before{content:"\f0f1"}.fa-comment-alt:before,.fa-message:before{content:"\f27a"}.fa-info:before{content:"\f129"}.fa-compress-alt:before,.fa-down-left-and-up-right-to-center:before{content:"\f422"}.fa-explosion:before{content:"\e4e9"}.fa-file-alt:before,.fa-file-lines:before,.fa-file-text:before{content:"\f15c"}.fa-wave-square:before{content:"\f83e"}.fa-ring:before{content:"\f70b"}.fa-building-un:before{content:"\e4d9"}.fa-dice-three:before{content:"\f527"}.fa-calendar-alt:before,.fa-calendar-days:before{content:"\f073"}.fa-anchor-circle-check:before{content:"\e4aa"}.fa-building-circle-arrow-right:before{content:"\e4d1"}.fa-volleyball-ball:before,.fa-volleyball:before{content:"\f45f"}.fa-arrows-up-to-line:before{content:"\e4c2"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-circle-minus:before,.fa-minus-circle:before{content:"\f056"}.fa-door-open:before{content:"\f52b"}.fa-right-from-bracket:before,.fa-sign-out-alt:before{content:"\f2f5"}.fa-atom:before{content:"\f5d2"}.fa-soap:before{content:"\e06e"}.fa-heart-music-camera-bolt:before,.fa-icons:before{content:"\f86d"}.fa-microphone-alt-slash:before,.fa-microphone-lines-slash:before{content:"\f539"}.fa-bridge-circle-check:before{content:"\e4c9"}.fa-pump-medical:before{content:"\e06a"}.fa-fingerprint:before{content:"\f577"}.fa-hand-point-right:before{content:"\f0a4"}.fa-magnifying-glass-location:before,.fa-search-location:before{content:"\f689"}.fa-forward-step:before,.fa-step-forward:before{content:"\f051"}.fa-face-smile-beam:before,.fa-smile-beam:before{content:"\f5b8"}.fa-flag-checkered:before{content:"\f11e"}.fa-football-ball:before,.fa-football:before{content:"\f44e"}.fa-school-circle-exclamation:before{content:"\e56c"}.fa-crop:before{content:"\f125"}.fa-angle-double-down:before,.fa-angles-down:before{content:"\f103"}.fa-users-rectangle:before{content:"\e594"}.fa-people-roof:before{content:"\e537"}.fa-people-line:before{content:"\e534"}.fa-beer-mug-empty:before,.fa-beer:before{content:"\f0fc"}.fa-diagram-predecessor:before{content:"\e477"}.fa-arrow-up-long:before,.fa-long-arrow-up:before{content:"\f176"}.fa-burn:before,.fa-fire-flame-simple:before{content:"\f46a"}.fa-male:before,.fa-person:before{content:"\f183"}.fa-laptop:before{content:"\f109"}.fa-file-csv:before{content:"\f6dd"}.fa-menorah:before{content:"\f676"}.fa-truck-plane:before{content:"\e58f"}.fa-record-vinyl:before{content:"\f8d9"}.fa-face-grin-stars:before,.fa-grin-stars:before{content:"\f587"}.fa-bong:before{content:"\f55c"}.fa-pastafarianism:before,.fa-spaghetti-monster-flying:before{content:"\f67b"}.fa-arrow-down-up-across-line:before{content:"\e4af"}.fa-spoon:before,.fa-utensil-spoon:before{content:"\f2e5"}.fa-jar-wheat:before{content:"\e517"}.fa-envelopes-bulk:before,.fa-mail-bulk:before{content:"\f674"}.fa-file-circle-exclamation:before{content:"\e4eb"}.fa-circle-h:before,.fa-hospital-symbol:before{content:"\f47e"}.fa-pager:before{content:"\f815"}.fa-address-book:before,.fa-contact-book:before{content:"\f2b9"}.fa-strikethrough:before{content:"\f0cc"}.fa-k:before{content:"\4b"}.fa-landmark-flag:before{content:"\e51c"}.fa-pencil-alt:before,.fa-pencil:before{content:"\f303"}.fa-backward:before{content:"\f04a"}.fa-caret-right:before{content:"\f0da"}.fa-comments:before{content:"\f086"}.fa-file-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-code-pull-request:before{content:"\e13c"}.fa-clipboard-list:before{content:"\f46d"}.fa-truck-loading:before,.fa-truck-ramp-box:before{content:"\f4de"}.fa-user-check:before{content:"\f4fc"}.fa-vial-virus:before{content:"\e597"}.fa-sheet-plastic:before{content:"\e571"}.fa-blog:before{content:"\f781"}.fa-user-ninja:before{content:"\f504"}.fa-person-arrow-up-from-line:before{content:"\e539"}.fa-scroll-torah:before,.fa-torah:before{content:"\f6a0"}.fa-broom-ball:before,.fa-quidditch-broom-ball:before,.fa-quidditch:before{content:"\f458"}.fa-toggle-off:before{content:"\f204"}.fa-archive:before,.fa-box-archive:before{content:"\f187"}.fa-person-drowning:before{content:"\e545"}.fa-arrow-down-9-1:before,.fa-sort-numeric-desc:before,.fa-sort-numeric-down-alt:before{content:"\f886"}.fa-face-grin-tongue-squint:before,.fa-grin-tongue-squint:before{content:"\f58a"}.fa-spray-can:before{content:"\f5bd"}.fa-truck-monster:before{content:"\f63b"}.fa-w:before{content:"\57"}.fa-earth-africa:before,.fa-globe-africa:before{content:"\f57c"}.fa-rainbow:before{content:"\f75b"}.fa-circle-notch:before{content:"\f1ce"}.fa-tablet-alt:before,.fa-tablet-screen-button:before{content:"\f3fa"}.fa-paw:before{content:"\f1b0"}.fa-cloud:before{content:"\f0c2"}.fa-trowel-bricks:before{content:"\e58a"}.fa-face-flushed:before,.fa-flushed:before{content:"\f579"}.fa-hospital-user:before{content:"\f80d"}.fa-tent-arrow-left-right:before{content:"\e57f"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-binoculars:before{content:"\f1e5"}.fa-microphone-slash:before{content:"\f131"}.fa-box-tissue:before{content:"\e05b"}.fa-motorcycle:before{content:"\f21c"}.fa-bell-concierge:before,.fa-concierge-bell:before{content:"\f562"}.fa-pen-ruler:before,.fa-pencil-ruler:before{content:"\f5ae"}.fa-people-arrows-left-right:before,.fa-people-arrows:before{content:"\e068"}.fa-mars-and-venus-burst:before{content:"\e523"}.fa-caret-square-right:before,.fa-square-caret-right:before{content:"\f152"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-sun-plant-wilt:before{content:"\e57a"}.fa-toilets-portable:before{content:"\e584"}.fa-hockey-puck:before{content:"\f453"}.fa-table:before{content:"\f0ce"}.fa-magnifying-glass-arrow-right:before{content:"\e521"}.fa-digital-tachograph:before,.fa-tachograph-digital:before{content:"\f566"}.fa-users-slash:before{content:"\e073"}.fa-clover:before{content:"\e139"}.fa-mail-reply:before,.fa-reply:before{content:"\f3e5"}.fa-star-and-crescent:before{content:"\f699"}.fa-house-fire:before{content:"\e50c"}.fa-minus-square:before,.fa-square-minus:before{content:"\f146"}.fa-helicopter:before{content:"\f533"}.fa-compass:before{content:"\f14e"}.fa-caret-square-down:before,.fa-square-caret-down:before{content:"\f150"}.fa-file-circle-question:before{content:"\e4ef"}.fa-laptop-code:before{content:"\f5fc"}.fa-swatchbook:before{content:"\f5c3"}.fa-prescription-bottle:before{content:"\f485"}.fa-bars:before,.fa-navicon:before{content:"\f0c9"}.fa-people-group:before{content:"\e533"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-heart-broken:before,.fa-heart-crack:before{content:"\f7a9"}.fa-external-link-square-alt:before,.fa-square-up-right:before{content:"\f360"}.fa-face-kiss-beam:before,.fa-kiss-beam:before{content:"\f597"}.fa-film:before{content:"\f008"}.fa-ruler-horizontal:before{content:"\f547"}.fa-people-robbery:before{content:"\e536"}.fa-lightbulb:before{content:"\f0eb"}.fa-caret-left:before{content:"\f0d9"}.fa-circle-exclamation:before,.fa-exclamation-circle:before{content:"\f06a"}.fa-school-circle-xmark:before{content:"\e56d"}.fa-arrow-right-from-bracket:before,.fa-sign-out:before{content:"\f08b"}.fa-chevron-circle-down:before,.fa-circle-chevron-down:before{content:"\f13a"}.fa-unlock-alt:before,.fa-unlock-keyhole:before{content:"\f13e"}.fa-cloud-showers-heavy:before{content:"\f740"}.fa-headphones-alt:before,.fa-headphones-simple:before{content:"\f58f"}.fa-sitemap:before{content:"\f0e8"}.fa-circle-dollar-to-slot:before,.fa-donate:before{content:"\f4b9"}.fa-memory:before{content:"\f538"}.fa-road-spikes:before{content:"\e568"}.fa-fire-burner:before{content:"\e4f1"}.fa-flag:before{content:"\f024"}.fa-hanukiah:before{content:"\f6e6"}.fa-feather:before{content:"\f52d"}.fa-volume-down:before,.fa-volume-low:before{content:"\f027"}.fa-comment-slash:before{content:"\f4b3"}.fa-cloud-sun-rain:before{content:"\f743"}.fa-compress:before{content:"\f066"}.fa-wheat-alt:before,.fa-wheat-awn:before{content:"\e2cd"}.fa-ankh:before{content:"\f644"}.fa-hands-holding-child:before{content:"\e4fa"}.fa-asterisk:before{content:"\2a"}.fa-check-square:before,.fa-square-check:before{content:"\f14a"}.fa-peseta-sign:before{content:"\e221"}.fa-header:before,.fa-heading:before{content:"\f1dc"}.fa-ghost:before{content:"\f6e2"}.fa-list-squares:before,.fa-list:before{content:"\f03a"}.fa-phone-square-alt:before,.fa-square-phone-flip:before{content:"\f87b"}.fa-cart-plus:before{content:"\f217"}.fa-gamepad:before{content:"\f11b"}.fa-circle-dot:before,.fa-dot-circle:before{content:"\f192"}.fa-dizzy:before,.fa-face-dizzy:before{content:"\f567"}.fa-egg:before{content:"\f7fb"}.fa-house-medical-circle-xmark:before{content:"\e513"}.fa-campground:before{content:"\f6bb"}.fa-folder-plus:before{content:"\f65e"}.fa-futbol-ball:before,.fa-futbol:before,.fa-soccer-ball:before{content:"\f1e3"}.fa-paint-brush:before,.fa-paintbrush:before{content:"\f1fc"}.fa-lock:before{content:"\f023"}.fa-gas-pump:before{content:"\f52f"}.fa-hot-tub-person:before,.fa-hot-tub:before{content:"\f593"}.fa-map-location:before,.fa-map-marked:before{content:"\f59f"}.fa-house-flood-water:before{content:"\e50e"}.fa-tree:before{content:"\f1bb"}.fa-bridge-lock:before{content:"\e4cc"}.fa-sack-dollar:before{content:"\f81d"}.fa-edit:before,.fa-pen-to-square:before{content:"\f044"}.fa-car-side:before{content:"\f5e4"}.fa-share-alt:before,.fa-share-nodes:before{content:"\f1e0"}.fa-heart-circle-minus:before{content:"\e4ff"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-microscope:before{content:"\f610"}.fa-sink:before{content:"\e06d"}.fa-bag-shopping:before,.fa-shopping-bag:before{content:"\f290"}.fa-arrow-down-z-a:before,.fa-sort-alpha-desc:before,.fa-sort-alpha-down-alt:before{content:"\f881"}.fa-mitten:before{content:"\f7b5"}.fa-person-rays:before{content:"\e54d"}.fa-users:before{content:"\f0c0"}.fa-eye-slash:before{content:"\f070"}.fa-flask-vial:before{content:"\e4f3"}.fa-hand-paper:before,.fa-hand:before{content:"\f256"}.fa-om:before{content:"\f679"}.fa-worm:before{content:"\e599"}.fa-house-circle-xmark:before{content:"\e50b"}.fa-plug:before{content:"\f1e6"}.fa-chevron-up:before{content:"\f077"}.fa-hand-spock:before{content:"\f259"}.fa-stopwatch:before{content:"\f2f2"}.fa-face-kiss:before,.fa-kiss:before{content:"\f596"}.fa-bridge-circle-xmark:before{content:"\e4cb"}.fa-face-grin-tongue:before,.fa-grin-tongue:before{content:"\f589"}.fa-chess-bishop:before{content:"\f43a"}.fa-face-grin-wink:before,.fa-grin-wink:before{content:"\f58c"}.fa-deaf:before,.fa-deafness:before,.fa-ear-deaf:before,.fa-hard-of-hearing:before{content:"\f2a4"}.fa-road-circle-check:before{content:"\e564"}.fa-dice-five:before{content:"\f523"}.fa-rss-square:before,.fa-square-rss:before{content:"\f143"}.fa-land-mine-on:before{content:"\e51b"}.fa-i-cursor:before{content:"\f246"}.fa-stamp:before{content:"\f5bf"}.fa-stairs:before{content:"\e289"}.fa-i:before{content:"\49"}.fa-hryvnia-sign:before,.fa-hryvnia:before{content:"\f6f2"}.fa-pills:before{content:"\f484"}.fa-face-grin-wide:before,.fa-grin-alt:before{content:"\f581"}.fa-tooth:before{content:"\f5c9"}.fa-v:before{content:"\56"}.fa-bangladeshi-taka-sign:before{content:"\e2e6"}.fa-bicycle:before{content:"\f206"}.fa-rod-asclepius:before,.fa-rod-snake:before,.fa-staff-aesculapius:before,.fa-staff-snake:before{content:"\e579"}.fa-head-side-cough-slash:before{content:"\e062"}.fa-ambulance:before,.fa-truck-medical:before{content:"\f0f9"}.fa-wheat-awn-circle-exclamation:before{content:"\e598"}.fa-snowman:before{content:"\f7d0"}.fa-mortar-pestle:before{content:"\f5a7"}.fa-road-barrier:before{content:"\e562"}.fa-school:before{content:"\f549"}.fa-igloo:before{content:"\f7ae"}.fa-joint:before{content:"\f595"}.fa-angle-right:before{content:"\f105"}.fa-horse:before{content:"\f6f0"}.fa-q:before{content:"\51"}.fa-g:before{content:"\47"}.fa-notes-medical:before{content:"\f481"}.fa-temperature-2:before,.fa-temperature-half:before,.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-dong-sign:before{content:"\e169"}.fa-capsules:before{content:"\f46b"}.fa-poo-bolt:before,.fa-poo-storm:before{content:"\f75a"}.fa-face-frown-open:before,.fa-frown-open:before{content:"\f57a"}.fa-hand-point-up:before{content:"\f0a6"}.fa-money-bill:before{content:"\f0d6"}.fa-bookmark:before{content:"\f02e"}.fa-align-justify:before{content:"\f039"}.fa-umbrella-beach:before{content:"\f5ca"}.fa-helmet-un:before{content:"\e503"}.fa-bullseye:before{content:"\f140"}.fa-bacon:before{content:"\f7e5"}.fa-hand-point-down:before{content:"\f0a7"}.fa-arrow-up-from-bracket:before{content:"\e09a"}.fa-folder-blank:before,.fa-folder:before{content:"\f07b"}.fa-file-medical-alt:before,.fa-file-waveform:before{content:"\f478"}.fa-radiation:before{content:"\f7b9"}.fa-chart-simple:before{content:"\e473"}.fa-mars-stroke:before{content:"\f229"}.fa-vial:before{content:"\f492"}.fa-dashboard:before,.fa-gauge-med:before,.fa-gauge:before,.fa-tachometer-alt-average:before{content:"\f624"}.fa-magic-wand-sparkles:before,.fa-wand-magic-sparkles:before{content:"\e2ca"}.fa-e:before{content:"\45"}.fa-pen-alt:before,.fa-pen-clip:before{content:"\f305"}.fa-bridge-circle-exclamation:before{content:"\e4ca"}.fa-user:before{content:"\f007"}.fa-school-circle-check:before{content:"\e56b"}.fa-dumpster:before{content:"\f793"}.fa-shuttle-van:before,.fa-van-shuttle:before{content:"\f5b6"}.fa-building-user:before{content:"\e4da"}.fa-caret-square-left:before,.fa-square-caret-left:before{content:"\f191"}.fa-highlighter:before{content:"\f591"}.fa-key:before{content:"\f084"}.fa-bullhorn:before{content:"\f0a1"}.fa-globe:before{content:"\f0ac"}.fa-synagogue:before{content:"\f69b"}.fa-person-half-dress:before{content:"\e548"}.fa-road-bridge:before{content:"\e563"}.fa-location-arrow:before{content:"\f124"}.fa-c:before{content:"\43"}.fa-tablet-button:before{content:"\f10a"}.fa-building-lock:before{content:"\e4d6"}.fa-pizza-slice:before{content:"\f818"}.fa-money-bill-wave:before{content:"\f53a"}.fa-area-chart:before,.fa-chart-area:before{content:"\f1fe"}.fa-house-flag:before{content:"\e50d"}.fa-person-circle-minus:before{content:"\e540"}.fa-ban:before,.fa-cancel:before{content:"\f05e"}.fa-camera-rotate:before{content:"\e0d8"}.fa-air-freshener:before,.fa-spray-can-sparkles:before{content:"\f5d0"}.fa-star:before{content:"\f005"}.fa-repeat:before{content:"\f363"}.fa-cross:before{content:"\f654"}.fa-box:before{content:"\f466"}.fa-venus-mars:before{content:"\f228"}.fa-arrow-pointer:before,.fa-mouse-pointer:before{content:"\f245"}.fa-expand-arrows-alt:before,.fa-maximize:before{content:"\f31e"}.fa-charging-station:before{content:"\f5e7"}.fa-shapes:before,.fa-triangle-circle-square:before{content:"\f61f"}.fa-random:before,.fa-shuffle:before{content:"\f074"}.fa-person-running:before,.fa-running:before{content:"\f70c"}.fa-mobile-retro:before{content:"\e527"}.fa-grip-lines-vertical:before{content:"\f7a5"}.fa-spider:before{content:"\f717"}.fa-hands-bound:before{content:"\e4f9"}.fa-file-invoice-dollar:before{content:"\f571"}.fa-plane-circle-exclamation:before{content:"\e556"}.fa-x-ray:before{content:"\f497"}.fa-spell-check:before{content:"\f891"}.fa-slash:before{content:"\f715"}.fa-computer-mouse:before,.fa-mouse:before{content:"\f8cc"}.fa-arrow-right-to-bracket:before,.fa-sign-in:before{content:"\f090"}.fa-shop-slash:before,.fa-store-alt-slash:before{content:"\e070"}.fa-server:before{content:"\f233"}.fa-virus-covid-slash:before{content:"\e4a9"}.fa-shop-lock:before{content:"\e4a5"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-blender-phone:before{content:"\f6b6"}.fa-building-wheat:before{content:"\e4db"}.fa-person-breastfeeding:before{content:"\e53a"}.fa-right-to-bracket:before,.fa-sign-in-alt:before{content:"\f2f6"}.fa-venus:before{content:"\f221"}.fa-passport:before{content:"\f5ab"}.fa-heart-pulse:before,.fa-heartbeat:before{content:"\f21e"}.fa-people-carry-box:before,.fa-people-carry:before{content:"\f4ce"}.fa-temperature-high:before{content:"\f769"}.fa-microchip:before{content:"\f2db"}.fa-crown:before{content:"\f521"}.fa-weight-hanging:before{content:"\f5cd"}.fa-xmarks-lines:before{content:"\e59a"}.fa-file-prescription:before{content:"\f572"}.fa-weight-scale:before,.fa-weight:before{content:"\f496"}.fa-user-friends:before,.fa-user-group:before{content:"\f500"}.fa-arrow-up-a-z:before,.fa-sort-alpha-up:before{content:"\f15e"}.fa-chess-knight:before{content:"\f441"}.fa-face-laugh-squint:before,.fa-laugh-squint:before{content:"\f59b"}.fa-wheelchair:before{content:"\f193"}.fa-arrow-circle-up:before,.fa-circle-arrow-up:before{content:"\f0aa"}.fa-toggle-on:before{content:"\f205"}.fa-person-walking:before,.fa-walking:before{content:"\f554"}.fa-l:before{content:"\4c"}.fa-fire:before{content:"\f06d"}.fa-bed-pulse:before,.fa-procedures:before{content:"\f487"}.fa-shuttle-space:before,.fa-space-shuttle:before{content:"\f197"}.fa-face-laugh:before,.fa-laugh:before{content:"\f599"}.fa-folder-open:before{content:"\f07c"}.fa-heart-circle-plus:before{content:"\e500"}.fa-code-fork:before{content:"\e13b"}.fa-city:before{content:"\f64f"}.fa-microphone-alt:before,.fa-microphone-lines:before{content:"\f3c9"}.fa-pepper-hot:before{content:"\f816"}.fa-unlock:before{content:"\f09c"}.fa-colon-sign:before{content:"\e140"}.fa-headset:before{content:"\f590"}.fa-store-slash:before{content:"\e071"}.fa-road-circle-xmark:before{content:"\e566"}.fa-user-minus:before{content:"\f503"}.fa-mars-stroke-up:before,.fa-mars-stroke-v:before{content:"\f22a"}.fa-champagne-glasses:before,.fa-glass-cheers:before{content:"\f79f"}.fa-clipboard:before{content:"\f328"}.fa-house-circle-exclamation:before{content:"\e50a"}.fa-file-arrow-up:before,.fa-file-upload:before{content:"\f574"}.fa-wifi-3:before,.fa-wifi-strong:before,.fa-wifi:before{content:"\f1eb"}.fa-bath:before,.fa-bathtub:before{content:"\f2cd"}.fa-underline:before{content:"\f0cd"}.fa-user-edit:before,.fa-user-pen:before{content:"\f4ff"}.fa-signature:before{content:"\f5b7"}.fa-stroopwafel:before{content:"\f551"}.fa-bold:before{content:"\f032"}.fa-anchor-lock:before{content:"\e4ad"}.fa-building-ngo:before{content:"\e4d7"}.fa-manat-sign:before{content:"\e1d5"}.fa-not-equal:before{content:"\f53e"}.fa-border-style:before,.fa-border-top-left:before{content:"\f853"}.fa-map-location-dot:before,.fa-map-marked-alt:before{content:"\f5a0"}.fa-jedi:before{content:"\f669"}.fa-poll:before,.fa-square-poll-vertical:before{content:"\f681"}.fa-mug-hot:before{content:"\f7b6"}.fa-battery-car:before,.fa-car-battery:before{content:"\f5df"}.fa-gift:before{content:"\f06b"}.fa-dice-two:before{content:"\f528"}.fa-chess-queen:before{content:"\f445"}.fa-glasses:before{content:"\f530"}.fa-chess-board:before{content:"\f43c"}.fa-building-circle-check:before{content:"\e4d2"}.fa-person-chalkboard:before{content:"\e53d"}.fa-mars-stroke-h:before,.fa-mars-stroke-right:before{content:"\f22b"}.fa-hand-back-fist:before,.fa-hand-rock:before{content:"\f255"}.fa-caret-square-up:before,.fa-square-caret-up:before{content:"\f151"}.fa-cloud-showers-water:before{content:"\e4e4"}.fa-bar-chart:before,.fa-chart-bar:before{content:"\f080"}.fa-hands-bubbles:before,.fa-hands-wash:before{content:"\e05e"}.fa-less-than-equal:before{content:"\f537"}.fa-train:before{content:"\f238"}.fa-eye-low-vision:before,.fa-low-vision:before{content:"\f2a8"}.fa-crow:before{content:"\f520"}.fa-sailboat:before{content:"\e445"}.fa-window-restore:before{content:"\f2d2"}.fa-plus-square:before,.fa-square-plus:before{content:"\f0fe"}.fa-torii-gate:before{content:"\f6a1"}.fa-frog:before{content:"\f52e"}.fa-bucket:before{content:"\e4cf"}.fa-image:before{content:"\f03e"}.fa-microphone:before{content:"\f130"}.fa-cow:before{content:"\f6c8"}.fa-caret-up:before{content:"\f0d8"}.fa-screwdriver:before{content:"\f54a"}.fa-folder-closed:before{content:"\e185"}.fa-house-tsunami:before{content:"\e515"}.fa-square-nfi:before{content:"\e576"}.fa-arrow-up-from-ground-water:before{content:"\e4b5"}.fa-glass-martini-alt:before,.fa-martini-glass:before{content:"\f57b"}.fa-rotate-back:before,.fa-rotate-backward:before,.fa-rotate-left:before,.fa-undo-alt:before{content:"\f2ea"}.fa-columns:before,.fa-table-columns:before{content:"\f0db"}.fa-lemon:before{content:"\f094"}.fa-head-side-mask:before{content:"\e063"}.fa-handshake:before{content:"\f2b5"}.fa-gem:before{content:"\f3a5"}.fa-dolly-box:before,.fa-dolly:before{content:"\f472"}.fa-smoking:before{content:"\f48d"}.fa-compress-arrows-alt:before,.fa-minimize:before{content:"\f78c"}.fa-monument:before{content:"\f5a6"}.fa-snowplow:before{content:"\f7d2"}.fa-angle-double-right:before,.fa-angles-right:before{content:"\f101"}.fa-cannabis:before{content:"\f55f"}.fa-circle-play:before,.fa-play-circle:before{content:"\f144"}.fa-tablets:before{content:"\f490"}.fa-ethernet:before{content:"\f796"}.fa-eur:before,.fa-euro-sign:before,.fa-euro:before{content:"\f153"}.fa-chair:before{content:"\f6c0"}.fa-check-circle:before,.fa-circle-check:before{content:"\f058"}.fa-circle-stop:before,.fa-stop-circle:before{content:"\f28d"}.fa-compass-drafting:before,.fa-drafting-compass:before{content:"\f568"}.fa-plate-wheat:before{content:"\e55a"}.fa-icicles:before{content:"\f7ad"}.fa-person-shelter:before{content:"\e54f"}.fa-neuter:before{content:"\f22c"}.fa-id-badge:before{content:"\f2c1"}.fa-marker:before{content:"\f5a1"}.fa-face-laugh-beam:before,.fa-laugh-beam:before{content:"\f59a"}.fa-helicopter-symbol:before{content:"\e502"}.fa-universal-access:before{content:"\f29a"}.fa-chevron-circle-up:before,.fa-circle-chevron-up:before{content:"\f139"}.fa-lari-sign:before{content:"\e1c8"}.fa-volcano:before{content:"\f770"}.fa-person-walking-dashed-line-arrow-right:before{content:"\e553"}.fa-gbp:before,.fa-pound-sign:before,.fa-sterling-sign:before{content:"\f154"}.fa-viruses:before{content:"\e076"}.fa-square-person-confined:before{content:"\e577"}.fa-user-tie:before{content:"\f508"}.fa-arrow-down-long:before,.fa-long-arrow-down:before{content:"\f175"}.fa-tent-arrow-down-to-line:before{content:"\e57e"}.fa-certificate:before{content:"\f0a3"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-suitcase:before{content:"\f0f2"}.fa-person-skating:before,.fa-skating:before{content:"\f7c5"}.fa-filter-circle-dollar:before,.fa-funnel-dollar:before{content:"\f662"}.fa-camera-retro:before{content:"\f083"}.fa-arrow-circle-down:before,.fa-circle-arrow-down:before{content:"\f0ab"}.fa-arrow-right-to-file:before,.fa-file-import:before{content:"\f56f"}.fa-external-link-square:before,.fa-square-arrow-up-right:before{content:"\f14c"}.fa-box-open:before{content:"\f49e"}.fa-scroll:before{content:"\f70e"}.fa-spa:before{content:"\f5bb"}.fa-location-pin-lock:before{content:"\e51f"}.fa-pause:before{content:"\f04c"}.fa-hill-avalanche:before{content:"\e507"}.fa-temperature-0:before,.fa-temperature-empty:before,.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-bomb:before{content:"\f1e2"}.fa-registered:before{content:"\f25d"}.fa-address-card:before,.fa-contact-card:before,.fa-vcard:before{content:"\f2bb"}.fa-balance-scale-right:before,.fa-scale-unbalanced-flip:before{content:"\f516"}.fa-subscript:before{content:"\f12c"}.fa-diamond-turn-right:before,.fa-directions:before{content:"\f5eb"}.fa-burst:before{content:"\e4dc"}.fa-house-laptop:before,.fa-laptop-house:before{content:"\e066"}.fa-face-tired:before,.fa-tired:before{content:"\f5c8"}.fa-money-bills:before{content:"\e1f3"}.fa-smog:before{content:"\f75f"}.fa-crutch:before{content:"\f7f7"}.fa-cloud-arrow-up:before,.fa-cloud-upload-alt:before,.fa-cloud-upload:before{content:"\f0ee"}.fa-palette:before{content:"\f53f"}.fa-arrows-turn-right:before{content:"\e4c0"}.fa-vest:before{content:"\e085"}.fa-ferry:before{content:"\e4ea"}.fa-arrows-down-to-people:before{content:"\e4b9"}.fa-seedling:before,.fa-sprout:before{content:"\f4d8"}.fa-arrows-alt-h:before,.fa-left-right:before{content:"\f337"}.fa-boxes-packing:before{content:"\e4c7"}.fa-arrow-circle-left:before,.fa-circle-arrow-left:before{content:"\f0a8"}.fa-group-arrows-rotate:before{content:"\e4f6"}.fa-bowl-food:before{content:"\e4c6"}.fa-candy-cane:before{content:"\f786"}.fa-arrow-down-wide-short:before,.fa-sort-amount-asc:before,.fa-sort-amount-down:before{content:"\f160"}.fa-cloud-bolt:before,.fa-thunderstorm:before{content:"\f76c"}.fa-remove-format:before,.fa-text-slash:before{content:"\f87d"}.fa-face-smile-wink:before,.fa-smile-wink:before{content:"\f4da"}.fa-file-word:before{content:"\f1c2"}.fa-file-powerpoint:before{content:"\f1c4"}.fa-arrows-h:before,.fa-arrows-left-right:before{content:"\f07e"}.fa-house-lock:before{content:"\e510"}.fa-cloud-arrow-down:before,.fa-cloud-download-alt:before,.fa-cloud-download:before{content:"\f0ed"}.fa-children:before{content:"\e4e1"}.fa-blackboard:before,.fa-chalkboard:before{content:"\f51b"}.fa-user-alt-slash:before,.fa-user-large-slash:before{content:"\f4fa"}.fa-envelope-open:before{content:"\f2b6"}.fa-handshake-alt-slash:before,.fa-handshake-simple-slash:before{content:"\e05f"}.fa-mattress-pillow:before{content:"\e525"}.fa-guarani-sign:before{content:"\e19a"}.fa-arrows-rotate:before,.fa-refresh:before,.fa-sync:before{content:"\f021"}.fa-fire-extinguisher:before{content:"\f134"}.fa-cruzeiro-sign:before{content:"\e152"}.fa-greater-than-equal:before{content:"\f532"}.fa-shield-alt:before,.fa-shield-halved:before{content:"\f3ed"}.fa-atlas:before,.fa-book-atlas:before{content:"\f558"}.fa-virus:before{content:"\e074"}.fa-envelope-circle-check:before{content:"\e4e8"}.fa-layer-group:before{content:"\f5fd"}.fa-arrows-to-dot:before{content:"\e4be"}.fa-archway:before{content:"\f557"}.fa-heart-circle-check:before{content:"\e4fd"}.fa-house-chimney-crack:before,.fa-house-damage:before{content:"\f6f1"}.fa-file-archive:before,.fa-file-zipper:before{content:"\f1c6"}.fa-square:before{content:"\f0c8"}.fa-glass-martini:before,.fa-martini-glass-empty:before{content:"\f000"}.fa-couch:before{content:"\f4b8"}.fa-cedi-sign:before{content:"\e0df"}.fa-italic:before{content:"\f033"}.fa-church:before{content:"\f51d"}.fa-comments-dollar:before{content:"\f653"}.fa-democrat:before{content:"\f747"}.fa-z:before{content:"\5a"}.fa-person-skiing:before,.fa-skiing:before{content:"\f7c9"}.fa-road-lock:before{content:"\e567"}.fa-a:before{content:"\41"}.fa-temperature-arrow-down:before,.fa-temperature-down:before{content:"\e03f"}.fa-feather-alt:before,.fa-feather-pointed:before{content:"\f56b"}.fa-p:before{content:"\50"}.fa-snowflake:before{content:"\f2dc"}.fa-newspaper:before{content:"\f1ea"}.fa-ad:before,.fa-rectangle-ad:before{content:"\f641"}.fa-arrow-circle-right:before,.fa-circle-arrow-right:before{content:"\f0a9"}.fa-filter-circle-xmark:before{content:"\e17b"}.fa-locust:before{content:"\e520"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-list-1-2:before,.fa-list-numeric:before,.fa-list-ol:before{content:"\f0cb"}.fa-person-dress-burst:before{content:"\e544"}.fa-money-check-alt:before,.fa-money-check-dollar:before{content:"\f53d"}.fa-vector-square:before{content:"\f5cb"}.fa-bread-slice:before{content:"\f7ec"}.fa-language:before{content:"\f1ab"}.fa-face-kiss-wink-heart:before,.fa-kiss-wink-heart:before{content:"\f598"}.fa-filter:before{content:"\f0b0"}.fa-question:before{content:"\3f"}.fa-file-signature:before{content:"\f573"}.fa-arrows-alt:before,.fa-up-down-left-right:before{content:"\f0b2"}.fa-house-chimney-user:before{content:"\e065"}.fa-hand-holding-heart:before{content:"\f4be"}.fa-puzzle-piece:before{content:"\f12e"}.fa-money-check:before{content:"\f53c"}.fa-star-half-alt:before,.fa-star-half-stroke:before{content:"\f5c0"}.fa-code:before{content:"\f121"}.fa-glass-whiskey:before,.fa-whiskey-glass:before{content:"\f7a0"}.fa-building-circle-exclamation:before{content:"\e4d3"}.fa-magnifying-glass-chart:before{content:"\e522"}.fa-arrow-up-right-from-square:before,.fa-external-link:before{content:"\f08e"}.fa-cubes-stacked:before{content:"\e4e6"}.fa-krw:before,.fa-won-sign:before,.fa-won:before{content:"\f159"}.fa-virus-covid:before{content:"\e4a8"}.fa-austral-sign:before{content:"\e0a9"}.fa-f:before{content:"\46"}.fa-leaf:before{content:"\f06c"}.fa-road:before{content:"\f018"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-person-circle-plus:before{content:"\e541"}.fa-chart-pie:before,.fa-pie-chart:before{content:"\f200"}.fa-bolt-lightning:before{content:"\e0b7"}.fa-sack-xmark:before{content:"\e56a"}.fa-file-excel:before{content:"\f1c3"}.fa-file-contract:before{content:"\f56c"}.fa-fish-fins:before{content:"\e4f2"}.fa-building-flag:before{content:"\e4d5"}.fa-face-grin-beam:before,.fa-grin-beam:before{content:"\f582"}.fa-object-ungroup:before{content:"\f248"}.fa-poop:before{content:"\f619"}.fa-location-pin:before,.fa-map-marker:before{content:"\f041"}.fa-kaaba:before{content:"\f66b"}.fa-toilet-paper:before{content:"\f71e"}.fa-hard-hat:before,.fa-hat-hard:before,.fa-helmet-safety:before{content:"\f807"}.fa-eject:before{content:"\f052"}.fa-arrow-alt-circle-right:before,.fa-circle-right:before{content:"\f35a"}.fa-plane-circle-check:before{content:"\e555"}.fa-face-rolling-eyes:before,.fa-meh-rolling-eyes:before{content:"\f5a5"}.fa-object-group:before{content:"\f247"}.fa-chart-line:before,.fa-line-chart:before{content:"\f201"}.fa-mask-ventilator:before{content:"\e524"}.fa-arrow-right:before{content:"\f061"}.fa-map-signs:before,.fa-signs-post:before{content:"\f277"}.fa-cash-register:before{content:"\f788"}.fa-person-circle-question:before{content:"\e542"}.fa-h:before{content:"\48"}.fa-tarp:before{content:"\e57b"}.fa-screwdriver-wrench:before,.fa-tools:before{content:"\f7d9"}.fa-arrows-to-eye:before{content:"\e4bf"}.fa-plug-circle-bolt:before{content:"\e55b"}.fa-heart:before{content:"\f004"}.fa-mars-and-venus:before{content:"\f224"}.fa-home-user:before,.fa-house-user:before{content:"\e1b0"}.fa-dumpster-fire:before{content:"\f794"}.fa-house-crack:before{content:"\e3b1"}.fa-cocktail:before,.fa-martini-glass-citrus:before{content:"\f561"}.fa-face-surprise:before,.fa-surprise:before{content:"\f5c2"}.fa-bottle-water:before{content:"\e4c5"}.fa-circle-pause:before,.fa-pause-circle:before{content:"\f28b"}.fa-toilet-paper-slash:before{content:"\e072"}.fa-apple-alt:before,.fa-apple-whole:before{content:"\f5d1"}.fa-kitchen-set:before{content:"\e51a"}.fa-r:before{content:"\52"}.fa-temperature-1:before,.fa-temperature-quarter:before,.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-cube:before{content:"\f1b2"}.fa-bitcoin-sign:before{content:"\e0b4"}.fa-shield-dog:before{content:"\e573"}.fa-solar-panel:before{content:"\f5ba"}.fa-lock-open:before{content:"\f3c1"}.fa-elevator:before{content:"\e16d"}.fa-money-bill-transfer:before{content:"\e528"}.fa-money-bill-trend-up:before{content:"\e529"}.fa-house-flood-water-circle-arrow-right:before{content:"\e50f"}.fa-poll-h:before,.fa-square-poll-horizontal:before{content:"\f682"}.fa-circle:before{content:"\f111"}.fa-backward-fast:before,.fa-fast-backward:before{content:"\f049"}.fa-recycle:before{content:"\f1b8"}.fa-user-astronaut:before{content:"\f4fb"}.fa-plane-slash:before{content:"\e069"}.fa-trademark:before{content:"\f25c"}.fa-basketball-ball:before,.fa-basketball:before{content:"\f434"}.fa-satellite-dish:before{content:"\f7c0"}.fa-arrow-alt-circle-up:before,.fa-circle-up:before{content:"\f35b"}.fa-mobile-alt:before,.fa-mobile-screen-button:before{content:"\f3cd"}.fa-volume-high:before,.fa-volume-up:before{content:"\f028"}.fa-users-rays:before{content:"\e593"}.fa-wallet:before{content:"\f555"}.fa-clipboard-check:before{content:"\f46c"}.fa-file-audio:before{content:"\f1c7"}.fa-burger:before,.fa-hamburger:before{content:"\f805"}.fa-wrench:before{content:"\f0ad"}.fa-bugs:before{content:"\e4d0"}.fa-rupee-sign:before,.fa-rupee:before{content:"\f156"}.fa-file-image:before{content:"\f1c5"}.fa-circle-question:before,.fa-question-circle:before{content:"\f059"}.fa-plane-departure:before{content:"\f5b0"}.fa-handshake-slash:before{content:"\e060"}.fa-book-bookmark:before{content:"\e0bb"}.fa-code-branch:before{content:"\f126"}.fa-hat-cowboy:before{content:"\f8c0"}.fa-bridge:before{content:"\e4c8"}.fa-phone-alt:before,.fa-phone-flip:before{content:"\f879"}.fa-truck-front:before{content:"\e2b7"}.fa-cat:before{content:"\f6be"}.fa-anchor-circle-exclamation:before{content:"\e4ab"}.fa-truck-field:before{content:"\e58d"}.fa-route:before{content:"\f4d7"}.fa-clipboard-question:before{content:"\e4e3"}.fa-panorama:before{content:"\e209"}.fa-comment-medical:before{content:"\f7f5"}.fa-teeth-open:before{content:"\f62f"}.fa-file-circle-minus:before{content:"\e4ed"}.fa-tags:before{content:"\f02c"}.fa-wine-glass:before{content:"\f4e3"}.fa-fast-forward:before,.fa-forward-fast:before{content:"\f050"}.fa-face-meh-blank:before,.fa-meh-blank:before{content:"\f5a4"}.fa-parking:before,.fa-square-parking:before{content:"\f540"}.fa-house-signal:before{content:"\e012"}.fa-bars-progress:before,.fa-tasks-alt:before{content:"\f828"}.fa-faucet-drip:before{content:"\e006"}.fa-cart-flatbed:before,.fa-dolly-flatbed:before{content:"\f474"}.fa-ban-smoking:before,.fa-smoking-ban:before{content:"\f54d"}.fa-terminal:before{content:"\f120"}.fa-mobile-button:before{content:"\f10b"}.fa-house-medical-flag:before{content:"\e514"}.fa-basket-shopping:before,.fa-shopping-basket:before{content:"\f291"}.fa-tape:before{content:"\f4db"}.fa-bus-alt:before,.fa-bus-simple:before{content:"\f55e"}.fa-eye:before{content:"\f06e"}.fa-face-sad-cry:before,.fa-sad-cry:before{content:"\f5b3"}.fa-audio-description:before{content:"\f29e"}.fa-person-military-to-person:before{content:"\e54c"}.fa-file-shield:before{content:"\e4f0"}.fa-user-slash:before{content:"\f506"}.fa-pen:before{content:"\f304"}.fa-tower-observation:before{content:"\e586"}.fa-file-code:before{content:"\f1c9"}.fa-signal-5:before,.fa-signal-perfect:before,.fa-signal:before{content:"\f012"}.fa-bus:before{content:"\f207"}.fa-heart-circle-xmark:before{content:"\e501"}.fa-home-lg:before,.fa-house-chimney:before{content:"\e3af"}.fa-window-maximize:before{content:"\f2d0"}.fa-face-frown:before,.fa-frown:before{content:"\f119"}.fa-prescription:before{content:"\f5b1"}.fa-shop:before,.fa-store-alt:before{content:"\f54f"}.fa-floppy-disk:before,.fa-save:before{content:"\f0c7"}.fa-vihara:before{content:"\f6a7"}.fa-balance-scale-left:before,.fa-scale-unbalanced:before{content:"\f515"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-comment-dots:before,.fa-commenting:before{content:"\f4ad"}.fa-plant-wilt:before{content:"\e5aa"}.fa-diamond:before{content:"\f219"}.fa-face-grin-squint:before,.fa-grin-squint:before{content:"\f585"}.fa-hand-holding-dollar:before,.fa-hand-holding-usd:before{content:"\f4c0"}.fa-bacterium:before{content:"\e05a"}.fa-hand-pointer:before{content:"\f25a"}.fa-drum-steelpan:before{content:"\f56a"}.fa-hand-scissors:before{content:"\f257"}.fa-hands-praying:before,.fa-praying-hands:before{content:"\f684"}.fa-arrow-right-rotate:before,.fa-arrow-rotate-forward:before,.fa-arrow-rotate-right:before,.fa-redo:before{content:"\f01e"}.fa-biohazard:before{content:"\f780"}.fa-location-crosshairs:before,.fa-location:before{content:"\f601"}.fa-mars-double:before{content:"\f227"}.fa-child-dress:before{content:"\e59c"}.fa-users-between-lines:before{content:"\e591"}.fa-lungs-virus:before{content:"\e067"}.fa-face-grin-tears:before,.fa-grin-tears:before{content:"\f588"}.fa-phone:before{content:"\f095"}.fa-calendar-times:before,.fa-calendar-xmark:before{content:"\f273"}.fa-child-reaching:before{content:"\e59d"}.fa-head-side-virus:before{content:"\e064"}.fa-user-cog:before,.fa-user-gear:before{content:"\f4fe"}.fa-arrow-up-1-9:before,.fa-sort-numeric-up:before{content:"\f163"}.fa-door-closed:before{content:"\f52a"}.fa-shield-virus:before{content:"\e06c"}.fa-dice-six:before{content:"\f526"}.fa-mosquito-net:before{content:"\e52c"}.fa-bridge-water:before{content:"\e4ce"}.fa-person-booth:before{content:"\f756"}.fa-text-width:before{content:"\f035"}.fa-hat-wizard:before{content:"\f6e8"}.fa-pen-fancy:before{content:"\f5ac"}.fa-digging:before,.fa-person-digging:before{content:"\f85e"}.fa-trash:before{content:"\f1f8"}.fa-gauge-simple-med:before,.fa-gauge-simple:before,.fa-tachometer-average:before{content:"\f629"}.fa-book-medical:before{content:"\f7e6"}.fa-poo:before{content:"\f2fe"}.fa-quote-right-alt:before,.fa-quote-right:before{content:"\f10e"}.fa-shirt:before,.fa-t-shirt:before,.fa-tshirt:before{content:"\f553"}.fa-cubes:before{content:"\f1b3"}.fa-divide:before{content:"\f529"}.fa-tenge-sign:before,.fa-tenge:before{content:"\f7d7"}.fa-headphones:before{content:"\f025"}.fa-hands-holding:before{content:"\f4c2"}.fa-hands-clapping:before{content:"\e1a8"}.fa-republican:before{content:"\f75e"}.fa-arrow-left:before{content:"\f060"}.fa-person-circle-xmark:before{content:"\e543"}.fa-ruler:before{content:"\f545"}.fa-align-left:before{content:"\f036"}.fa-dice-d6:before{content:"\f6d1"}.fa-restroom:before{content:"\f7bd"}.fa-j:before{content:"\4a"}.fa-users-viewfinder:before{content:"\e595"}.fa-file-video:before{content:"\f1c8"}.fa-external-link-alt:before,.fa-up-right-from-square:before{content:"\f35d"}.fa-table-cells:before,.fa-th:before{content:"\f00a"}.fa-file-pdf:before{content:"\f1c1"}.fa-bible:before,.fa-book-bible:before{content:"\f647"}.fa-o:before{content:"\4f"}.fa-medkit:before,.fa-suitcase-medical:before{content:"\f0fa"}.fa-user-secret:before{content:"\f21b"}.fa-otter:before{content:"\f700"}.fa-female:before,.fa-person-dress:before{content:"\f182"}.fa-comment-dollar:before{content:"\f651"}.fa-briefcase-clock:before,.fa-business-time:before{content:"\f64a"}.fa-table-cells-large:before,.fa-th-large:before{content:"\f009"}.fa-book-tanakh:before,.fa-tanakh:before{content:"\f827"}.fa-phone-volume:before,.fa-volume-control-phone:before{content:"\f2a0"}.fa-hat-cowboy-side:before{content:"\f8c1"}.fa-clipboard-user:before{content:"\f7f3"}.fa-child:before{content:"\f1ae"}.fa-lira-sign:before{content:"\f195"}.fa-satellite:before{content:"\f7bf"}.fa-plane-lock:before{content:"\e558"}.fa-tag:before{content:"\f02b"}.fa-comment:before{content:"\f075"}.fa-birthday-cake:before,.fa-cake-candles:before,.fa-cake:before{content:"\f1fd"}.fa-envelope:before{content:"\f0e0"}.fa-angle-double-up:before,.fa-angles-up:before{content:"\f102"}.fa-paperclip:before{content:"\f0c6"}.fa-arrow-right-to-city:before{content:"\e4b3"}.fa-ribbon:before{content:"\f4d6"}.fa-lungs:before{content:"\f604"}.fa-arrow-up-9-1:before,.fa-sort-numeric-up-alt:before{content:"\f887"}.fa-litecoin-sign:before{content:"\e1d3"}.fa-border-none:before{content:"\f850"}.fa-circle-nodes:before{content:"\e4e2"}.fa-parachute-box:before{content:"\f4cd"}.fa-indent:before{content:"\f03c"}.fa-truck-field-un:before{content:"\e58e"}.fa-hourglass-empty:before,.fa-hourglass:before{content:"\f254"}.fa-mountain:before{content:"\f6fc"}.fa-user-doctor:before,.fa-user-md:before{content:"\f0f0"}.fa-circle-info:before,.fa-info-circle:before{content:"\f05a"}.fa-cloud-meatball:before{content:"\f73b"}.fa-camera-alt:before,.fa-camera:before{content:"\f030"}.fa-square-virus:before{content:"\e578"}.fa-meteor:before{content:"\f753"}.fa-car-on:before{content:"\e4dd"}.fa-sleigh:before{content:"\f7cc"}.fa-arrow-down-1-9:before,.fa-sort-numeric-asc:before,.fa-sort-numeric-down:before{content:"\f162"}.fa-hand-holding-droplet:before,.fa-hand-holding-water:before{content:"\f4c1"}.fa-water:before{content:"\f773"}.fa-calendar-check:before{content:"\f274"}.fa-braille:before{content:"\f2a1"}.fa-prescription-bottle-alt:before,.fa-prescription-bottle-medical:before{content:"\f486"}.fa-landmark:before{content:"\f66f"}.fa-truck:before{content:"\f0d1"}.fa-crosshairs:before{content:"\f05b"}.fa-person-cane:before{content:"\e53c"}.fa-tent:before{content:"\e57d"}.fa-vest-patches:before{content:"\e086"}.fa-check-double:before{content:"\f560"}.fa-arrow-down-a-z:before,.fa-sort-alpha-asc:before,.fa-sort-alpha-down:before{content:"\f15d"}.fa-money-bill-wheat:before{content:"\e52a"}.fa-cookie:before{content:"\f563"}.fa-arrow-left-rotate:before,.fa-arrow-rotate-back:before,.fa-arrow-rotate-backward:before,.fa-arrow-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-hard-drive:before,.fa-hdd:before{content:"\f0a0"}.fa-face-grin-squint-tears:before,.fa-grin-squint-tears:before{content:"\f586"}.fa-dumbbell:before{content:"\f44b"}.fa-list-alt:before,.fa-rectangle-list:before{content:"\f022"}.fa-tarp-droplet:before{content:"\e57c"}.fa-house-medical-circle-check:before{content:"\e511"}.fa-person-skiing-nordic:before,.fa-skiing-nordic:before{content:"\f7ca"}.fa-calendar-plus:before{content:"\f271"}.fa-plane-arrival:before{content:"\f5af"}.fa-arrow-alt-circle-left:before,.fa-circle-left:before{content:"\f359"}.fa-subway:before,.fa-train-subway:before{content:"\f239"}.fa-chart-gantt:before{content:"\e0e4"}.fa-indian-rupee-sign:before,.fa-indian-rupee:before,.fa-inr:before{content:"\e1bc"}.fa-crop-alt:before,.fa-crop-simple:before{content:"\f565"}.fa-money-bill-1:before,.fa-money-bill-alt:before{content:"\f3d1"}.fa-left-long:before,.fa-long-arrow-alt-left:before{content:"\f30a"}.fa-dna:before{content:"\f471"}.fa-virus-slash:before{content:"\e075"}.fa-minus:before,.fa-subtract:before{content:"\f068"}.fa-chess:before{content:"\f439"}.fa-arrow-left-long:before,.fa-long-arrow-left:before{content:"\f177"}.fa-plug-circle-check:before{content:"\e55c"}.fa-street-view:before{content:"\f21d"}.fa-franc-sign:before{content:"\e18f"}.fa-volume-off:before{content:"\f026"}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before,.fa-hands-american-sign-language-interpreting:before,.fa-hands-asl-interpreting:before{content:"\f2a3"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-droplet-slash:before,.fa-tint-slash:before{content:"\f5c7"}.fa-mosque:before{content:"\f678"}.fa-mosquito:before{content:"\e52b"}.fa-star-of-david:before{content:"\f69a"}.fa-person-military-rifle:before{content:"\e54b"}.fa-cart-shopping:before,.fa-shopping-cart:before{content:"\f07a"}.fa-vials:before{content:"\f493"}.fa-plug-circle-plus:before{content:"\e55f"}.fa-place-of-worship:before{content:"\f67f"}.fa-grip-vertical:before{content:"\f58e"}.fa-arrow-turn-up:before,.fa-level-up:before{content:"\f148"}.fa-u:before{content:"\55"}.fa-square-root-alt:before,.fa-square-root-variable:before{content:"\f698"}.fa-clock-four:before,.fa-clock:before{content:"\f017"}.fa-backward-step:before,.fa-step-backward:before{content:"\f048"}.fa-pallet:before{content:"\f482"}.fa-faucet:before{content:"\e005"}.fa-baseball-bat-ball:before{content:"\f432"}.fa-s:before{content:"\53"}.fa-timeline:before{content:"\e29c"}.fa-keyboard:before{content:"\f11c"}.fa-caret-down:before{content:"\f0d7"}.fa-clinic-medical:before,.fa-house-chimney-medical:before{content:"\f7f2"}.fa-temperature-3:before,.fa-temperature-three-quarters:before,.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-mobile-android-alt:before,.fa-mobile-screen:before{content:"\f3cf"}.fa-plane-up:before{content:"\e22d"}.fa-piggy-bank:before{content:"\f4d3"}.fa-battery-3:before,.fa-battery-half:before{content:"\f242"}.fa-mountain-city:before{content:"\e52e"}.fa-coins:before{content:"\f51e"}.fa-khanda:before{content:"\f66d"}.fa-sliders-h:before,.fa-sliders:before{content:"\f1de"}.fa-folder-tree:before{content:"\f802"}.fa-network-wired:before{content:"\f6ff"}.fa-map-pin:before{content:"\f276"}.fa-hamsa:before{content:"\f665"}.fa-cent-sign:before{content:"\e3f5"}.fa-flask:before{content:"\f0c3"}.fa-person-pregnant:before{content:"\e31e"}.fa-wand-sparkles:before{content:"\f72b"}.fa-ellipsis-v:before,.fa-ellipsis-vertical:before{content:"\f142"}.fa-ticket:before{content:"\f145"}.fa-power-off:before{content:"\f011"}.fa-long-arrow-alt-right:before,.fa-right-long:before{content:"\f30b"}.fa-flag-usa:before{content:"\f74d"}.fa-laptop-file:before{content:"\e51d"}.fa-teletype:before,.fa-tty:before{content:"\f1e4"}.fa-diagram-next:before{content:"\e476"}.fa-person-rifle:before{content:"\e54e"}.fa-house-medical-circle-exclamation:before{content:"\e512"}.fa-closed-captioning:before{content:"\f20a"}.fa-hiking:before,.fa-person-hiking:before{content:"\f6ec"}.fa-venus-double:before{content:"\f226"}.fa-images:before{content:"\f302"}.fa-calculator:before{content:"\f1ec"}.fa-people-pulling:before{content:"\e535"}.fa-n:before{content:"\4e"}.fa-cable-car:before,.fa-tram:before{content:"\f7da"}.fa-cloud-rain:before{content:"\f73d"}.fa-building-circle-xmark:before{content:"\e4d4"}.fa-ship:before{content:"\f21a"}.fa-arrows-down-to-line:before{content:"\e4b8"}.fa-download:before{content:"\f019"}.fa-face-grin:before,.fa-grin:before{content:"\f580"}.fa-backspace:before,.fa-delete-left:before{content:"\f55a"}.fa-eye-dropper-empty:before,.fa-eye-dropper:before,.fa-eyedropper:before{content:"\f1fb"}.fa-file-circle-check:before{content:"\e5a0"}.fa-forward:before{content:"\f04e"}.fa-mobile-android:before,.fa-mobile-phone:before,.fa-mobile:before{content:"\f3ce"}.fa-face-meh:before,.fa-meh:before{content:"\f11a"}.fa-align-center:before{content:"\f037"}.fa-book-dead:before,.fa-book-skull:before{content:"\f6b7"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-heart-circle-exclamation:before{content:"\e4fe"}.fa-home-alt:before,.fa-home-lg-alt:before,.fa-home:before,.fa-house:before{content:"\f015"}.fa-calendar-week:before{content:"\f784"}.fa-laptop-medical:before{content:"\f812"}.fa-b:before{content:"\42"}.fa-file-medical:before{content:"\f477"}.fa-dice-one:before{content:"\f525"}.fa-kiwi-bird:before{content:"\f535"}.fa-arrow-right-arrow-left:before,.fa-exchange:before{content:"\f0ec"}.fa-redo-alt:before,.fa-rotate-forward:before,.fa-rotate-right:before{content:"\f2f9"}.fa-cutlery:before,.fa-utensils:before{content:"\f2e7"}.fa-arrow-up-wide-short:before,.fa-sort-amount-up:before{content:"\f161"}.fa-mill-sign:before{content:"\e1ed"}.fa-bowl-rice:before{content:"\e2eb"}.fa-skull:before{content:"\f54c"}.fa-broadcast-tower:before,.fa-tower-broadcast:before{content:"\f519"}.fa-truck-pickup:before{content:"\f63c"}.fa-long-arrow-alt-up:before,.fa-up-long:before{content:"\f30c"}.fa-stop:before{content:"\f04d"}.fa-code-merge:before{content:"\f387"}.fa-upload:before{content:"\f093"}.fa-hurricane:before{content:"\f751"}.fa-mound:before{content:"\e52d"}.fa-toilet-portable:before{content:"\e583"}.fa-compact-disc:before{content:"\f51f"}.fa-file-arrow-down:before,.fa-file-download:before{content:"\f56d"}.fa-caravan:before{content:"\f8ff"}.fa-shield-cat:before{content:"\e572"}.fa-bolt:before,.fa-zap:before{content:"\f0e7"}.fa-glass-water:before{content:"\e4f4"}.fa-oil-well:before{content:"\e532"}.fa-vault:before{content:"\e2c5"}.fa-mars:before{content:"\f222"}.fa-toilet:before{content:"\f7d8"}.fa-plane-circle-xmark:before{content:"\e557"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen-sign:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble-sign:before,.fa-ruble:before{content:"\f158"}.fa-sun:before{content:"\f185"}.fa-guitar:before{content:"\f7a6"}.fa-face-laugh-wink:before,.fa-laugh-wink:before{content:"\f59c"}.fa-horse-head:before{content:"\f7ab"}.fa-bore-hole:before{content:"\e4c3"}.fa-industry:before{content:"\f275"}.fa-arrow-alt-circle-down:before,.fa-circle-down:before{content:"\f358"}.fa-arrows-turn-to-dots:before{content:"\e4c1"}.fa-florin-sign:before{content:"\e184"}.fa-arrow-down-short-wide:before,.fa-sort-amount-desc:before,.fa-sort-amount-down-alt:before{content:"\f884"}.fa-less-than:before{content:"\3c"}.fa-angle-down:before{content:"\f107"}.fa-car-tunnel:before{content:"\e4de"}.fa-head-side-cough:before{content:"\e061"}.fa-grip-lines:before{content:"\f7a4"}.fa-thumbs-down:before{content:"\f165"}.fa-user-lock:before{content:"\f502"}.fa-arrow-right-long:before,.fa-long-arrow-right:before{content:"\f178"}.fa-anchor-circle-xmark:before{content:"\e4ac"}.fa-ellipsis-h:before,.fa-ellipsis:before{content:"\f141"}.fa-chess-pawn:before{content:"\f443"}.fa-first-aid:before,.fa-kit-medical:before{content:"\f479"}.fa-person-through-window:before{content:"\e5a9"}.fa-toolbox:before{content:"\f552"}.fa-hands-holding-circle:before{content:"\e4fb"}.fa-bug:before{content:"\f188"}.fa-credit-card-alt:before,.fa-credit-card:before{content:"\f09d"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-hand-holding-hand:before{content:"\e4f7"}.fa-book-open-reader:before,.fa-book-reader:before{content:"\f5da"}.fa-mountain-sun:before{content:"\e52f"}.fa-arrows-left-right-to-line:before{content:"\e4ba"}.fa-dice-d20:before{content:"\f6cf"}.fa-truck-droplet:before{content:"\e58c"}.fa-file-circle-xmark:before{content:"\e5a1"}.fa-temperature-arrow-up:before,.fa-temperature-up:before{content:"\e040"}.fa-medal:before{content:"\f5a2"}.fa-bed:before{content:"\f236"}.fa-h-square:before,.fa-square-h:before{content:"\f0fd"}.fa-podcast:before{content:"\f2ce"}.fa-temperature-4:before,.fa-temperature-full:before,.fa-thermometer-4:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-bell:before{content:"\f0f3"}.fa-superscript:before{content:"\f12b"}.fa-plug-circle-xmark:before{content:"\e560"}.fa-star-of-life:before{content:"\f621"}.fa-phone-slash:before{content:"\f3dd"}.fa-paint-roller:before{content:"\f5aa"}.fa-hands-helping:before,.fa-handshake-angle:before{content:"\f4c4"}.fa-location-dot:before,.fa-map-marker-alt:before{content:"\f3c5"}.fa-file:before{content:"\f15b"}.fa-greater-than:before{content:"\3e"}.fa-person-swimming:before,.fa-swimmer:before{content:"\f5c4"}.fa-arrow-down:before{content:"\f063"}.fa-droplet:before,.fa-tint:before{content:"\f043"}.fa-eraser:before{content:"\f12d"}.fa-earth-america:before,.fa-earth-americas:before,.fa-earth:before,.fa-globe-americas:before{content:"\f57d"}.fa-person-burst:before{content:"\e53b"}.fa-dove:before{content:"\f4ba"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-socks:before{content:"\f696"}.fa-inbox:before{content:"\f01c"}.fa-section:before{content:"\e447"}.fa-gauge-high:before,.fa-tachometer-alt-fast:before,.fa-tachometer-alt:before{content:"\f625"}.fa-envelope-open-text:before{content:"\f658"}.fa-hospital-alt:before,.fa-hospital-wide:before,.fa-hospital:before{content:"\f0f8"}.fa-wine-bottle:before{content:"\f72f"}.fa-chess-rook:before{content:"\f447"}.fa-bars-staggered:before,.fa-reorder:before,.fa-stream:before{content:"\f550"}.fa-dharmachakra:before{content:"\f655"}.fa-hotdog:before{content:"\f80f"}.fa-blind:before,.fa-person-walking-with-cane:before{content:"\f29d"}.fa-drum:before{content:"\f569"}.fa-ice-cream:before{content:"\f810"}.fa-heart-circle-bolt:before{content:"\e4fc"}.fa-fax:before{content:"\f1ac"}.fa-paragraph:before{content:"\f1dd"}.fa-check-to-slot:before,.fa-vote-yea:before{content:"\f772"}.fa-star-half:before{content:"\f089"}.fa-boxes-alt:before,.fa-boxes-stacked:before,.fa-boxes:before{content:"\f468"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-assistive-listening-systems:before,.fa-ear-listen:before{content:"\f2a2"}.fa-tree-city:before{content:"\e587"}.fa-play:before{content:"\f04b"}.fa-font:before{content:"\f031"}.fa-rupiah-sign:before{content:"\e23d"}.fa-magnifying-glass:before,.fa-search:before{content:"\f002"}.fa-ping-pong-paddle-ball:before,.fa-table-tennis-paddle-ball:before,.fa-table-tennis:before{content:"\f45d"}.fa-diagnoses:before,.fa-person-dots-from-line:before{content:"\f470"}.fa-trash-can-arrow-up:before,.fa-trash-restore-alt:before{content:"\f82a"}.fa-naira-sign:before{content:"\e1f6"}.fa-cart-arrow-down:before{content:"\f218"}.fa-walkie-talkie:before{content:"\f8ef"}.fa-file-edit:before,.fa-file-pen:before{content:"\f31c"}.fa-receipt:before{content:"\f543"}.fa-pen-square:before,.fa-pencil-square:before,.fa-square-pen:before{content:"\f14b"}.fa-suitcase-rolling:before{content:"\f5c1"}.fa-person-circle-exclamation:before{content:"\e53f"}.fa-chevron-down:before{content:"\f078"}.fa-battery-5:before,.fa-battery-full:before,.fa-battery:before{content:"\f240"}.fa-skull-crossbones:before{content:"\f714"}.fa-code-compare:before{content:"\e13a"}.fa-list-dots:before,.fa-list-ul:before{content:"\f0ca"}.fa-school-lock:before{content:"\e56f"}.fa-tower-cell:before{content:"\e585"}.fa-down-long:before,.fa-long-arrow-alt-down:before{content:"\f309"}.fa-ranking-star:before{content:"\e561"}.fa-chess-king:before{content:"\f43f"}.fa-person-harassing:before{content:"\e549"}.fa-brazilian-real-sign:before{content:"\e46c"}.fa-landmark-alt:before,.fa-landmark-dome:before{content:"\f752"}.fa-arrow-up:before{content:"\f062"}.fa-television:before,.fa-tv-alt:before,.fa-tv:before{content:"\f26c"}.fa-shrimp:before{content:"\e448"}.fa-list-check:before,.fa-tasks:before{content:"\f0ae"}.fa-jug-detergent:before{content:"\e519"}.fa-circle-user:before,.fa-user-circle:before{content:"\f2bd"}.fa-user-shield:before{content:"\f505"}.fa-wind:before{content:"\f72e"}.fa-car-burst:before,.fa-car-crash:before{content:"\f5e1"}.fa-y:before{content:"\59"}.fa-person-snowboarding:before,.fa-snowboarding:before{content:"\f7ce"}.fa-shipping-fast:before,.fa-truck-fast:before{content:"\f48b"}.fa-fish:before{content:"\f578"}.fa-user-graduate:before{content:"\f501"}.fa-adjust:before,.fa-circle-half-stroke:before{content:"\f042"}.fa-clapperboard:before{content:"\e131"}.fa-circle-radiation:before,.fa-radiation-alt:before{content:"\f7ba"}.fa-baseball-ball:before,.fa-baseball:before{content:"\f433"}.fa-jet-fighter-up:before{content:"\e518"}.fa-diagram-project:before,.fa-project-diagram:before{content:"\f542"}.fa-copy:before{content:"\f0c5"}.fa-volume-mute:before,.fa-volume-times:before,.fa-volume-xmark:before{content:"\f6a9"}.fa-hand-sparkles:before{content:"\e05d"}.fa-grip-horizontal:before,.fa-grip:before{content:"\f58d"}.fa-share-from-square:before,.fa-share-square:before{content:"\f14d"}.fa-child-combatant:before,.fa-child-rifle:before{content:"\e4e0"}.fa-gun:before{content:"\e19b"}.fa-phone-square:before,.fa-square-phone:before{content:"\f098"}.fa-add:before,.fa-plus:before{content:"\2b"}.fa-expand:before{content:"\f065"}.fa-computer:before{content:"\e4e5"}.fa-close:before,.fa-multiply:before,.fa-remove:before,.fa-times:before,.fa-xmark:before{content:"\f00d"}.fa-arrows-up-down-left-right:before,.fa-arrows:before{content:"\f047"}.fa-chalkboard-teacher:before,.fa-chalkboard-user:before{content:"\f51c"}.fa-peso-sign:before{content:"\e222"}.fa-building-shield:before{content:"\e4d8"}.fa-baby:before{content:"\f77c"}.fa-users-line:before{content:"\e592"}.fa-quote-left-alt:before,.fa-quote-left:before{content:"\f10d"}.fa-tractor:before{content:"\f722"}.fa-trash-arrow-up:before,.fa-trash-restore:before{content:"\f829"}.fa-arrow-down-up-lock:before{content:"\e4b0"}.fa-lines-leaning:before{content:"\e51e"}.fa-ruler-combined:before{content:"\f546"}.fa-copyright:before{content:"\f1f9"}.fa-equals:before{content:"\3d"}.fa-blender:before{content:"\f517"}.fa-teeth:before{content:"\f62e"}.fa-ils:before,.fa-shekel-sign:before,.fa-shekel:before,.fa-sheqel-sign:before,.fa-sheqel:before{content:"\f20b"}.fa-map:before{content:"\f279"}.fa-rocket:before{content:"\f135"}.fa-photo-film:before,.fa-photo-video:before{content:"\f87c"}.fa-folder-minus:before{content:"\f65d"}.fa-store:before{content:"\f54e"}.fa-arrow-trend-up:before{content:"\e098"}.fa-plug-circle-minus:before{content:"\e55e"}.fa-sign-hanging:before,.fa-sign:before{content:"\f4d9"}.fa-bezier-curve:before{content:"\f55b"}.fa-bell-slash:before{content:"\f1f6"}.fa-tablet-android:before,.fa-tablet:before{content:"\f3fb"}.fa-school-flag:before{content:"\e56e"}.fa-fill:before{content:"\f575"}.fa-angle-up:before{content:"\f106"}.fa-drumstick-bite:before{content:"\f6d7"}.fa-holly-berry:before{content:"\f7aa"}.fa-chevron-left:before{content:"\f053"}.fa-bacteria:before{content:"\e059"}.fa-hand-lizard:before{content:"\f258"}.fa-notdef:before{content:"\e1fe"}.fa-disease:before{content:"\f7fa"}.fa-briefcase-medical:before{content:"\f469"}.fa-genderless:before{content:"\f22d"}.fa-chevron-right:before{content:"\f054"}.fa-retweet:before{content:"\f079"}.fa-car-alt:before,.fa-car-rear:before{content:"\f5de"}.fa-pump-soap:before{content:"\e06b"}.fa-video-slash:before{content:"\f4e2"}.fa-battery-2:before,.fa-battery-quarter:before{content:"\f243"}.fa-radio:before{content:"\f8d7"}.fa-baby-carriage:before,.fa-carriage-baby:before{content:"\f77d"}.fa-traffic-light:before{content:"\f637"}.fa-thermometer:before{content:"\f491"}.fa-vr-cardboard:before{content:"\f729"}.fa-hand-middle-finger:before{content:"\f806"}.fa-percent:before,.fa-percentage:before{content:"\25"}.fa-truck-moving:before{content:"\f4df"}.fa-glass-water-droplet:before{content:"\e4f5"}.fa-display:before{content:"\e163"}.fa-face-smile:before,.fa-smile:before{content:"\f118"}.fa-thumb-tack:before,.fa-thumbtack:before{content:"\f08d"}.fa-trophy:before{content:"\f091"}.fa-person-praying:before,.fa-pray:before{content:"\f683"}.fa-hammer:before{content:"\f6e3"}.fa-hand-peace:before{content:"\f25b"}.fa-rotate:before,.fa-sync-alt:before{content:"\f2f1"}.fa-spinner:before{content:"\f110"}.fa-robot:before{content:"\f544"}.fa-peace:before{content:"\f67c"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-warehouse:before{content:"\f494"}.fa-arrow-up-right-dots:before{content:"\e4b7"}.fa-splotch:before{content:"\f5bc"}.fa-face-grin-hearts:before,.fa-grin-hearts:before{content:"\f584"}.fa-dice-four:before{content:"\f524"}.fa-sim-card:before{content:"\f7c4"}.fa-transgender-alt:before,.fa-transgender:before{content:"\f225"}.fa-mercury:before{content:"\f223"}.fa-arrow-turn-down:before,.fa-level-down:before{content:"\f149"}.fa-person-falling-burst:before{content:"\e547"}.fa-award:before{content:"\f559"}.fa-ticket-alt:before,.fa-ticket-simple:before{content:"\f3ff"}.fa-building:before{content:"\f1ad"}.fa-angle-double-left:before,.fa-angles-left:before{content:"\f100"}.fa-qrcode:before{content:"\f029"}.fa-clock-rotate-left:before,.fa-history:before{content:"\f1da"}.fa-face-grin-beam-sweat:before,.fa-grin-beam-sweat:before{content:"\f583"}.fa-arrow-right-from-file:before,.fa-file-export:before{content:"\f56e"}.fa-shield-blank:before,.fa-shield:before{content:"\f132"}.fa-arrow-up-short-wide:before,.fa-sort-amount-up-alt:before{content:"\f885"}.fa-house-medical:before{content:"\e3b2"}.fa-golf-ball-tee:before,.fa-golf-ball:before{content:"\f450"}.fa-chevron-circle-left:before,.fa-circle-chevron-left:before{content:"\f137"}.fa-house-chimney-window:before{content:"\e00d"}.fa-pen-nib:before{content:"\f5ad"}.fa-tent-arrow-turn-left:before{content:"\e580"}.fa-tents:before{content:"\e582"}.fa-magic:before,.fa-wand-magic:before{content:"\f0d0"}.fa-dog:before{content:"\f6d3"}.fa-carrot:before{content:"\f787"}.fa-moon:before{content:"\f186"}.fa-wine-glass-alt:before,.fa-wine-glass-empty:before{content:"\f5ce"}.fa-cheese:before{content:"\f7ef"}.fa-yin-yang:before{content:"\f6ad"}.fa-music:before{content:"\f001"}.fa-code-commit:before{content:"\f386"}.fa-temperature-low:before{content:"\f76b"}.fa-biking:before,.fa-person-biking:before{content:"\f84a"}.fa-broom:before{content:"\f51a"}.fa-shield-heart:before{content:"\e574"}.fa-gopuram:before{content:"\f664"}.fa-earth-oceania:before,.fa-globe-oceania:before{content:"\e47b"}.fa-square-xmark:before,.fa-times-square:before,.fa-xmark-square:before{content:"\f2d3"}.fa-hashtag:before{content:"\23"}.fa-expand-alt:before,.fa-up-right-and-down-left-from-center:before{content:"\f424"}.fa-oil-can:before{content:"\f613"}.fa-t:before{content:"\54"}.fa-hippo:before{content:"\f6ed"}.fa-chart-column:before{content:"\e0e3"}.fa-infinity:before{content:"\f534"}.fa-vial-circle-check:before{content:"\e596"}.fa-person-arrow-down-to-line:before{content:"\e538"}.fa-voicemail:before{content:"\f897"}.fa-fan:before{content:"\f863"}.fa-person-walking-luggage:before{content:"\e554"}.fa-arrows-alt-v:before,.fa-up-down:before{content:"\f338"}.fa-cloud-moon-rain:before{content:"\f73c"}.fa-calendar:before{content:"\f133"}.fa-trailer:before{content:"\e041"}.fa-bahai:before,.fa-haykal:before{content:"\f666"}.fa-sd-card:before{content:"\f7c2"}.fa-dragon:before{content:"\f6d5"}.fa-shoe-prints:before{content:"\f54b"}.fa-circle-plus:before,.fa-plus-circle:before{content:"\f055"}.fa-face-grin-tongue-wink:before,.fa-grin-tongue-wink:before{content:"\f58b"}.fa-hand-holding:before{content:"\f4bd"}.fa-plug-circle-exclamation:before{content:"\e55d"}.fa-chain-broken:before,.fa-chain-slash:before,.fa-link-slash:before,.fa-unlink:before{content:"\f127"}.fa-clone:before{content:"\f24d"}.fa-person-walking-arrow-loop-left:before{content:"\e551"}.fa-arrow-up-z-a:before,.fa-sort-alpha-up-alt:before{content:"\f882"}.fa-fire-alt:before,.fa-fire-flame-curved:before{content:"\f7e4"}.fa-tornado:before{content:"\f76f"}.fa-file-circle-plus:before{content:"\e494"}.fa-book-quran:before,.fa-quran:before{content:"\f687"}.fa-anchor:before{content:"\f13d"}.fa-border-all:before{content:"\f84c"}.fa-angry:before,.fa-face-angry:before{content:"\f556"}.fa-cookie-bite:before{content:"\f564"}.fa-arrow-trend-down:before{content:"\e097"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-draw-polygon:before{content:"\f5ee"}.fa-balance-scale:before,.fa-scale-balanced:before{content:"\f24e"}.fa-gauge-simple-high:before,.fa-tachometer-fast:before,.fa-tachometer:before{content:"\f62a"}.fa-shower:before{content:"\f2cc"}.fa-desktop-alt:before,.fa-desktop:before{content:"\f390"}.fa-m:before{content:"\4d"}.fa-table-list:before,.fa-th-list:before{content:"\f00b"}.fa-comment-sms:before,.fa-sms:before{content:"\f7cd"}.fa-book:before{content:"\f02d"}.fa-user-plus:before{content:"\f234"}.fa-check:before{content:"\f00c"}.fa-battery-4:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-house-circle-check:before{content:"\e509"}.fa-angle-left:before{content:"\f104"}.fa-diagram-successor:before{content:"\e47a"}.fa-truck-arrow-right:before{content:"\e58b"}.fa-arrows-split-up-and-left:before{content:"\e4bc"}.fa-fist-raised:before,.fa-hand-fist:before{content:"\f6de"}.fa-cloud-moon:before{content:"\f6c3"}.fa-briefcase:before{content:"\f0b1"}.fa-person-falling:before{content:"\e546"}.fa-image-portrait:before,.fa-portrait:before{content:"\f3e0"}.fa-user-tag:before{content:"\f507"}.fa-rug:before{content:"\e569"}.fa-earth-europe:before,.fa-globe-europe:before{content:"\f7a2"}.fa-cart-flatbed-suitcase:before,.fa-luggage-cart:before{content:"\f59d"}.fa-rectangle-times:before,.fa-rectangle-xmark:before,.fa-times-rectangle:before,.fa-window-close:before{content:"\f410"}.fa-baht-sign:before{content:"\e0ac"}.fa-book-open:before{content:"\f518"}.fa-book-journal-whills:before,.fa-journal-whills:before{content:"\f66a"}.fa-handcuffs:before{content:"\e4f8"}.fa-exclamation-triangle:before,.fa-triangle-exclamation:before,.fa-warning:before{content:"\f071"}.fa-database:before{content:"\f1c0"}.fa-arrow-turn-right:before,.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-bottle-droplet:before{content:"\e4c4"}.fa-mask-face:before{content:"\e1d7"}.fa-hill-rockslide:before{content:"\e508"}.fa-exchange-alt:before,.fa-right-left:before{content:"\f362"}.fa-paper-plane:before{content:"\f1d8"}.fa-road-circle-exclamation:before{content:"\e565"}.fa-dungeon:before{content:"\f6d9"}.fa-align-right:before{content:"\f038"}.fa-money-bill-1-wave:before,.fa-money-bill-wave-alt:before{content:"\f53b"}.fa-life-ring:before{content:"\f1cd"}.fa-hands:before,.fa-sign-language:before,.fa-signing:before{content:"\f2a7"}.fa-calendar-day:before{content:"\f783"}.fa-ladder-water:before,.fa-swimming-pool:before,.fa-water-ladder:before{content:"\f5c5"}.fa-arrows-up-down:before,.fa-arrows-v:before{content:"\f07d"}.fa-face-grimace:before,.fa-grimace:before{content:"\f57f"}.fa-wheelchair-alt:before,.fa-wheelchair-move:before{content:"\e2ce"}.fa-level-down-alt:before,.fa-turn-down:before{content:"\f3be"}.fa-person-walking-arrow-right:before{content:"\e552"}.fa-envelope-square:before,.fa-square-envelope:before{content:"\f199"}.fa-dice:before{content:"\f522"}.fa-bowling-ball:before{content:"\f436"}.fa-brain:before{content:"\f5dc"}.fa-band-aid:before,.fa-bandage:before{content:"\f462"}.fa-calendar-minus:before{content:"\f272"}.fa-circle-xmark:before,.fa-times-circle:before,.fa-xmark-circle:before{content:"\f057"}.fa-gifts:before{content:"\f79c"}.fa-hotel:before{content:"\f594"}.fa-earth-asia:before,.fa-globe-asia:before{content:"\f57e"}.fa-id-card-alt:before,.fa-id-card-clip:before{content:"\f47f"}.fa-magnifying-glass-plus:before,.fa-search-plus:before{content:"\f00e"}.fa-thumbs-up:before{content:"\f164"}.fa-user-clock:before{content:"\f4fd"}.fa-allergies:before,.fa-hand-dots:before{content:"\f461"}.fa-file-invoice:before{content:"\f570"}.fa-window-minimize:before{content:"\f2d1"}.fa-coffee:before,.fa-mug-saucer:before{content:"\f0f4"}.fa-brush:before{content:"\f55d"}.fa-mask:before{content:"\f6fa"}.fa-magnifying-glass-minus:before,.fa-search-minus:before{content:"\f010"}.fa-ruler-vertical:before{content:"\f548"}.fa-user-alt:before,.fa-user-large:before{content:"\f406"}.fa-train-tram:before{content:"\e5b4"}.fa-user-nurse:before{content:"\f82f"}.fa-syringe:before{content:"\f48e"}.fa-cloud-sun:before{content:"\f6c4"}.fa-stopwatch-20:before{content:"\e06f"}.fa-square-full:before{content:"\f45c"}.fa-magnet:before{content:"\f076"}.fa-jar:before{content:"\e516"}.fa-note-sticky:before,.fa-sticky-note:before{content:"\f249"}.fa-bug-slash:before{content:"\e490"}.fa-arrow-up-from-water-pump:before{content:"\e4b6"}.fa-bone:before{content:"\f5d7"}.fa-user-injured:before{content:"\f728"}.fa-face-sad-tear:before,.fa-sad-tear:before{content:"\f5b4"}.fa-plane:before{content:"\f072"}.fa-tent-arrows-down:before{content:"\e581"}.fa-exclamation:before{content:"\21"}.fa-arrows-spin:before{content:"\e4bb"}.fa-print:before{content:"\f02f"}.fa-try:before,.fa-turkish-lira-sign:before,.fa-turkish-lira:before{content:"\e2bb"}.fa-dollar-sign:before,.fa-dollar:before,.fa-usd:before{content:"\24"}.fa-x:before{content:"\58"}.fa-magnifying-glass-dollar:before,.fa-search-dollar:before{content:"\f688"}.fa-users-cog:before,.fa-users-gear:before{content:"\f509"}.fa-person-military-pointing:before{content:"\e54a"}.fa-bank:before,.fa-building-columns:before,.fa-institution:before,.fa-museum:before,.fa-university:before{content:"\f19c"}.fa-umbrella:before{content:"\f0e9"}.fa-trowel:before{content:"\e589"}.fa-d:before{content:"\44"}.fa-stapler:before{content:"\e5af"}.fa-masks-theater:before,.fa-theater-masks:before{content:"\f630"}.fa-kip-sign:before{content:"\e1c4"}.fa-hand-point-left:before{content:"\f0a5"}.fa-handshake-alt:before,.fa-handshake-simple:before{content:"\f4c6"}.fa-fighter-jet:before,.fa-jet-fighter:before{content:"\f0fb"}.fa-share-alt-square:before,.fa-square-share-nodes:before{content:"\f1e1"}.fa-barcode:before{content:"\f02a"}.fa-plus-minus:before{content:"\e43c"}.fa-video-camera:before,.fa-video:before{content:"\f03d"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-hand-holding-medical:before{content:"\e05c"}.fa-person-circle-check:before{content:"\e53e"}.fa-level-up-alt:before,.fa-turn-up:before{content:"\f3bf"} +.fa-sr-only,.fa-sr-only-focusable:not(:focus),.sr-only,.sr-only-focusable:not(:focus){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0} \ No newline at end of file diff --git a/public/js/all.js b/public/js/all.js index 7ca34276..e71c8f3a 100644 --- a/public/js/all.js +++ b/public/js/all.js @@ -19,16 +19,6 @@ eval("var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _ /***/ }), -/***/ "./public/vendors/ckeditor/ckeditor.js": -/*!*********************************************!*\ - !*** ./public/vendors/ckeditor/ckeditor.js ***! - \*********************************************/ -/***/ ((module, exports, __webpack_require__) => { - -eval("/* module decorator */ module = __webpack_require__.nmd(module);\nvar __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;function _defineProperty(obj,key,value){key=_toPropertyKey(key);if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}function _regeneratorRuntime(){\"use strict\";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_regeneratorRuntime=function _regeneratorRuntime(){return e;};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value;},i=\"function\"==typeof Symbol?Symbol:{},a=i.iterator||\"@@iterator\",c=i.asyncIterator||\"@@asyncIterator\",u=i.toStringTag||\"@@toStringTag\";function define(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e];}try{define({},\"\");}catch(t){define=function define(t,e,r){return t[e]=r;};}function wrap(t,e,r,n){var i=e&&e.prototype instanceof Generator?e:Generator,a=Object.create(i.prototype),c=new Context(n||[]);return o(a,\"_invoke\",{value:makeInvokeMethod(t,r,c)}),a;}function tryCatch(t,e,r){try{return{type:\"normal\",arg:t.call(e,r)};}catch(t){return{type:\"throw\",arg:t};}}e.wrap=wrap;var h=\"suspendedStart\",l=\"suspendedYield\",f=\"executing\",s=\"completed\",y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var p={};define(p,a,function(){return this;});var d=Object.getPrototypeOf,v=d&&d(d(values([])));v&&v!==r&&n.call(v,a)&&(p=v);var g=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(p);function defineIteratorMethods(t){[\"next\",\"throw\",\"return\"].forEach(function(e){define(t,e,function(t){return this._invoke(e,t);});});}function AsyncIterator(t,e){function invoke(r,o,i,a){var c=tryCatch(t[r],t,o);if(\"throw\"!==c.type){var u=c.arg,h=u.value;return h&&\"object\"==_typeof(h)&&n.call(h,\"__await\")?e.resolve(h.__await).then(function(t){invoke(\"next\",t,i,a);},function(t){invoke(\"throw\",t,i,a);}):e.resolve(h).then(function(t){u.value=t,i(u);},function(t){return invoke(\"throw\",t,i,a);});}a(c.arg);}var r;o(this,\"_invoke\",{value:function value(t,n){function callInvokeWithMethodAndArg(){return new e(function(e,r){invoke(t,n,e,r);});}return r=r?r.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg();}});}function makeInvokeMethod(e,r,n){var o=h;return function(i,a){if(o===f)throw new Error(\"Generator is already running\");if(o===s){if(\"throw\"===i)throw a;return{value:t,done:!0};}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=maybeInvokeDelegate(c,n);if(u){if(u===y)continue;return u;}}if(\"next\"===n.method)n.sent=n._sent=n.arg;else if(\"throw\"===n.method){if(o===h)throw o=s,n.arg;n.dispatchException(n.arg);}else\"return\"===n.method&&n.abrupt(\"return\",n.arg);o=f;var p=tryCatch(e,r,n);if(\"normal\"===p.type){if(o=n.done?s:l,p.arg===y)continue;return{value:p.arg,done:n.done};}\"throw\"===p.type&&(o=s,n.method=\"throw\",n.arg=p.arg);}};}function maybeInvokeDelegate(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,\"throw\"===n&&e.iterator[\"return\"]&&(r.method=\"return\",r.arg=t,maybeInvokeDelegate(e,r),\"throw\"===r.method)||\"return\"!==n&&(r.method=\"throw\",r.arg=new TypeError(\"The iterator does not provide a '\"+n+\"' method\")),y;var i=tryCatch(o,e.iterator,r.arg);if(\"throw\"===i.type)return r.method=\"throw\",r.arg=i.arg,r.delegate=null,y;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,\"return\"!==r.method&&(r.method=\"next\",r.arg=t),r.delegate=null,y):a:(r.method=\"throw\",r.arg=new TypeError(\"iterator result is not an object\"),r.delegate=null,y);}function pushTryEntry(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e);}function resetTryEntry(t){var e=t.completion||{};e.type=\"normal\",delete e.arg,t.completion=e;}function Context(t){this.tryEntries=[{tryLoc:\"root\"}],t.forEach(pushTryEntry,this),this.reset(!0);}function values(e){if(e||\"\"===e){var r=e[a];if(r)return r.call(e);if(\"function\"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function next(){for(;++o=0;--o){var i=this.tryEntries[o],a=i.completion;if(\"root\"===i.tryLoc)return handle(\"end\");if(i.tryLoc<=this.prev){var c=n.call(i,\"catchLoc\"),u=n.call(i,\"finallyLoc\");if(c&&u){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,\"finallyLoc\")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),resetTryEntry(r),y;}},\"catch\":function _catch(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if(\"throw\"===n.type){var o=n.arg;resetTryEntry(r);}return o;}}throw new Error(\"illegal catch attempt\");},delegateYield:function delegateYield(e,r,n){return this.delegate={iterator:values(e),resultName:r,nextLoc:n},\"next\"===this.method&&(this.arg=t),y;}},e;}function _get(){if(typeof Reflect!==\"undefined\"&&Reflect.get){_get=Reflect.get.bind();}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 _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(r,l){var t=null==r?null:\"undefined\"!=typeof Symbol&&r[Symbol.iterator]||r[\"@@iterator\"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1;}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r;}finally{try{if(!f&&null!=t[\"return\"]&&(u=t[\"return\"](),Object(u)!==u))return;}finally{if(o)throw n;}}return a;}}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(_e270){throw _e270;},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(_e271){didErr=true;err=_e271;},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=0&&c.splice(e,1);}function m(t){var e=document.createElement(\"style\");if(void 0===t.attrs.type&&(t.attrs.type=\"text/css\"),void 0===t.attrs.nonce){var i=function(){0;return n.nc;}();i&&(t.attrs.nonce=i);}return p(e,t.attrs),h(t,e),e;}function p(t,e){Object.keys(e).forEach(function(n){t.setAttribute(n,e[n]);});}function g(t,e){var n,i,o,r;if(e.transform&&t.css){if(!(r=\"function\"==typeof e.transform?e.transform(t.css):e.transform[\"default\"](t.css)))return function(){};t.css=r;}if(e.singleton){var c=a++;n=s||(s=m(e)),i=w.bind(null,n,c,!1),o=w.bind(null,n,c,!0);}else t.sourceMap&&\"function\"==typeof URL&&\"function\"==typeof URL.createObjectURL&&\"function\"==typeof URL.revokeObjectURL&&\"function\"==typeof Blob&&\"function\"==typeof btoa?(n=function(t){var e=document.createElement(\"link\");return void 0===t.attrs.type&&(t.attrs.type=\"text/css\"),t.attrs.rel=\"stylesheet\",p(e,t.attrs),h(t,e),e;}(e),i=function(t,e,n){var i=n.css,o=n.sourceMap,r=void 0===e.convertToAbsoluteUrls&&o;(e.convertToAbsoluteUrls||r)&&(i=l(i));o&&(i+=\"\\n/*# sourceMappingURL=data:application/json;base64,\"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+\" */\");var s=new Blob([i],{type:\"text/css\"}),a=t.href;t.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a);}.bind(null,n,e),o=function o(){f(n),n.href&&URL.revokeObjectURL(n.href);}):(n=m(e),i=function(t,e){var n=e.css,i=e.media;i&&t.setAttribute(\"media\",i);if(t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n));}}.bind(null,n),o=function o(){f(n);});return i(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;i(t=e);}else o();};}t.exports=function(t,e){if(\"undefined\"!=typeof DEBUG&&DEBUG&&\"object\"!=(typeof document===\"undefined\"?\"undefined\":_typeof(document)))throw new Error(\"The style-loader cannot be used in a non-browser environment\");(e=e||{}).attrs=\"object\"==_typeof(e.attrs)?e.attrs:{},e.singleton||\"boolean\"==typeof e.singleton||(e.singleton=o()),e.insertInto||(e.insertInto=\"head\"),e.insertAt||(e.insertAt=\"bottom\");var n=u(t,e);return d(n,e),function(t){for(var o=[],r=0;r';},function(t,e){t.exports='';},function(t,e,n){\"use strict\";(function(t){var n=\"object\"==_typeof(t)&&t&&t.Object===Object&&t;e.a=n;}).call(this,n(16));},function(t,e){t.exports='';},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,\"loaded\",{enumerable:!0,get:function get(){return e.l;}}),Object.defineProperty(e,\"id\",{enumerable:!0,get:function get(){return e.i;}}),Object.defineProperty(e,\"exports\",{enumerable:!0}),e.webpackPolyfill=1;}return e;};},function(t){t.exports={a:\"12.0.0\"};},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){var n;n=function(){return this;}();try{n=n||Function(\"return this\")()||(0,eval)(\"this\");}catch(t){\"object\"==(typeof window===\"undefined\"?\"undefined\":_typeof(window))&&(n=window);}t.exports=n;},function(t,e,n){var i=n(94);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e,n){\"use strict\";e.a=function(){return!1;};},function(t,e,n){\"use strict\";(function(t){var i=n(4),o=\"object\"==( false?0:_typeof(exports))&&exports&&!exports.nodeType&&exports,r=o&&\"object\"==_typeof(t)&&t&&!t.nodeType&&t,s=r&&r.exports===o?i.a.Buffer:void 0,a=s?s.allocUnsafe:void 0;e.a=function(t,e){if(e)return t.slice();var n=t.length,i=a?a(n):new t.constructor(n);return t.copy(i),i;};}).call(this,n(11)(t));},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='\\n';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='\\n';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e){t.exports='';},function(t,e,n){\"use strict\";(function(t){var e=n(1),i=n(12);var o=\"object\"==(typeof window===\"undefined\"?\"undefined\":_typeof(window))?window:t;o.CKEDITOR_VERSION?e.a.error(\"ckeditor-version-collision: The global CKEDITOR_VERSION constant has already been set.\",{collidingVersion:o.CKEDITOR_VERSION,version:i.a}):o.CKEDITOR_VERSION=i.a;}).call(this,n(16));},function(t,e,n){var i=n(44);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-placeholder:before,.ck .ck-placeholder:before{content:attr(data-placeholder);pointer-events:none;cursor:text;color:var(--ck-color-engine-placeholder-text)}\";},function(t,e){t.exports=function(t){var e=\"undefined\"!=typeof window&&window.location;if(!e)throw new Error(\"fixUrls requires window.location\");if(!t||\"string\"!=typeof t)return t;var n=e.protocol+\"//\"+e.host,i=n+e.pathname.replace(/\\/[^\\/]*$/,\"/\");return t.replace(/url\\s*\\(((?:[^)(]|\\((?:[^)(]+|\\([^)(]*\\))*\\))*)\\)/gi,function(t,e){var o,r=e.trim().replace(/^\"(.*)\"$/,function(t,e){return e;}).replace(/^'(.*)'$/,function(t,e){return e;});return /^(#|data:|http:\\/\\/|https:\\/\\/|file:\\/\\/\\/|\\s*$)/i.test(r)?t:(o=0===r.indexOf(\"//\")?r:0===r.indexOf(\"/\")?n+r:i+r.replace(/^\\.\\//,\"\"),\"url(\"+JSON.stringify(o)+\")\");});};},function(t,e,n){var i=n(47);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck-hidden{display:none!important}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{box-sizing:border-box;width:auto;height:auto;position:static}:root{--ck-z-default:1;--ck-z-modal:calc(var(--ck-z-default) + 999);--ck-color-base-foreground:#fafafa;--ck-color-base-background:#fff;--ck-color-base-border:#c4c4c4;--ck-color-base-action:#61b045;--ck-color-base-focus:#6cb5f9;--ck-color-base-text:#333;--ck-color-base-active:#198cf0;--ck-color-base-active-focus:#0e7fe1;--ck-color-base-error:#db3700;--ck-color-focus-border:#47a4f5;--ck-color-focus-shadow:rgba(119,186,248,0.5);--ck-color-focus-disabled-shadow:rgba(119,186,248,0.3);--ck-color-focus-error-shadow:rgba(255,64,31,0.3);--ck-color-text:var(--ck-color-base-text);--ck-color-shadow-drop:rgba(0,0,0,0.15);--ck-color-shadow-drop-active:rgba(0,0,0,0.2);--ck-color-shadow-inner:rgba(0,0,0,0.1);--ck-color-button-default-background:transparent;--ck-color-button-default-hover-background:#e6e6e6;--ck-color-button-default-active-background:#d9d9d9;--ck-color-button-default-active-shadow:#bfbfbf;--ck-color-button-default-disabled-background:transparent;--ck-color-button-on-background:#dedede;--ck-color-button-on-hover-background:#c4c4c4;--ck-color-button-on-active-background:#bababa;--ck-color-button-on-active-shadow:#a1a1a1;--ck-color-button-on-disabled-background:#dedede;--ck-color-button-action-background:var(--ck-color-base-action);--ck-color-button-action-hover-background:#579e3d;--ck-color-button-action-active-background:#53973b;--ck-color-button-action-active-shadow:#498433;--ck-color-button-action-disabled-background:#7ec365;--ck-color-button-action-text:var(--ck-color-base-background);--ck-color-button-save:#008a00;--ck-color-button-cancel:#db3700;--ck-color-switch-button-off-background:#b0b0b0;--ck-color-switch-button-on-background:var(--ck-color-button-action-background);--ck-color-switch-button-inner-background:var(--ck-color-base-background);--ck-color-dropdown-panel-background:var(--ck-color-base-background);--ck-color-dropdown-panel-border:var(--ck-color-base-border);--ck-color-input-background:var(--ck-color-base-background);--ck-color-input-border:#c7c7c7;--ck-color-input-error-border:var(--ck-color-base-error);--ck-color-input-text:var(--ck-color-base-text);--ck-color-input-disabled-background:#f2f2f2;--ck-color-input-disabled-border:#c7c7c7;--ck-color-input-disabled-text:#5c5c5c;--ck-color-list-background:var(--ck-color-base-background);--ck-color-list-button-hover-background:var(--ck-color-button-default-hover-background);--ck-color-list-button-on-background:var(--ck-color-base-active);--ck-color-list-button-on-background-focus:var(--ck-color-base-active-focus);--ck-color-list-button-on-text:var(--ck-color-base-background);--ck-color-panel-background:var(--ck-color-base-background);--ck-color-panel-border:var(--ck-color-base-border);--ck-color-toolbar-background:var(--ck-color-base-foreground);--ck-color-toolbar-border:var(--ck-color-base-border);--ck-color-tooltip-background:var(--ck-color-base-text);--ck-color-tooltip-text:var(--ck-color-base-background);--ck-color-engine-placeholder-text:#707070;--ck-color-upload-bar-background:#6cb5f9;--ck-color-upload-infinite-background:rgba(0,0,0,0.1);--ck-color-link-default:#0000f0;--ck-color-link-selected-background:rgba(31,177,255,0.1);--ck-disabled-opacity:.5;--ck-focus-outer-shadow-geometry:0 0 0 3px;--ck-focus-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-shadow);--ck-focus-disabled-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-disabled-shadow);--ck-focus-error-outer-shadow:var(--ck-focus-outer-shadow-geometry) var(--ck-color-focus-error-shadow);--ck-focus-ring:1px solid var(--ck-color-focus-border);--ck-font-size-base:13px;--ck-line-height-base:1.84615;--ck-font-face:Helvetica,Arial,Tahoma,Verdana,Sans-Serif;--ck-font-size-tiny:0.7em;--ck-font-size-small:0.75em;--ck-font-size-normal:1em;--ck-font-size-big:1.4em;--ck-font-size-large:1.8em;--ck-ui-component-min-height:2.3em}.ck.ck-reset,.ck.ck-reset_all,.ck.ck-reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;vertical-align:middle;transition:none;word-wrap:break-word}.ck.ck-reset_all,.ck.ck-reset_all *{border-collapse:collapse;font:normal normal normal var(--ck-font-size-base)/var(--ck-line-height-base) var(--ck-font-face);color:var(--ck-color-text);text-align:left;white-space:nowrap;cursor:auto;float:none}.ck.ck-reset_all .ck-rtl *{text-align:right}.ck.ck-reset_all iframe{vertical-align:inherit}.ck.ck-reset_all textarea{white-space:pre-wrap}.ck.ck-reset_all input[type=password],.ck.ck-reset_all input[type=text],.ck.ck-reset_all textarea{cursor:text}.ck.ck-reset_all input[type=password][disabled],.ck.ck-reset_all input[type=text][disabled],.ck.ck-reset_all textarea[disabled]{cursor:default}.ck.ck-reset_all fieldset{padding:10px;border:2px groove #dfdee3}.ck.ck-reset_all button::-moz-focus-inner{padding:0;border:0}:root{--ck-border-radius:2px;--ck-inner-shadow:2px 2px 3px var(--ck-color-shadow-inner) inset;--ck-drop-shadow:0 1px 2px 1px var(--ck-color-shadow-drop);--ck-drop-shadow-active:0 3px 6px 1px var(--ck-color-shadow-drop-active);--ck-spacing-unit:0.6em;--ck-spacing-large:calc(var(--ck-spacing-unit)*1.5);--ck-spacing-standard:var(--ck-spacing-unit);--ck-spacing-medium:calc(var(--ck-spacing-unit)*0.8);--ck-spacing-small:calc(var(--ck-spacing-unit)*0.5);--ck-spacing-tiny:calc(var(--ck-spacing-unit)*0.3);--ck-spacing-extra-tiny:calc(var(--ck-spacing-unit)*0.16)}\";},function(t,e,n){var i=n(49);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-editor__editable:not(.ck-editor__nested-editable){border-radius:0}.ck-rounded-corners .ck.ck-editor__editable:not(.ck-editor__nested-editable),.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-editor__editable:not(.ck-editor__nested-editable).ck-focused{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0}.ck.ck-editor__editable_inline{overflow:auto;padding:0 var(--ck-spacing-standard);border:1px solid transparent}.ck.ck-editor__editable_inline>:first-child{margin-top:var(--ck-spacing-large)}.ck.ck-editor__editable_inline>:last-child{margin-bottom:var(--ck-spacing-large)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_n]:after{border-bottom-color:var(--ck-color-base-foreground)}.ck.ck-balloon-panel.ck-toolbar-container[class*=arrow_s]:after{border-top-color:var(--ck-color-base-foreground)}\";},function(t,e,n){var i=n(51);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-label{display:block}.ck.ck-voice-label{display:none}.ck.ck-label{font-weight:700}\";},function(t,e,n){var i=n(53);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-sticky-panel .ck-sticky-panel__content_sticky{z-index:var(--ck-z-modal);position:fixed;top:0}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky_bottom-limit{top:auto;position:absolute}.ck.ck-sticky-panel .ck-sticky-panel__content_sticky{box-shadow:var(--ck-drop-shadow),0 0;border-width:0 1px 1px;border-top-left-radius:0;border-top-right-radius:0}\";},function(t,e,n){var i=n(55);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-toolbar{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-flow:row wrap;align-items:center}.ck.ck-toolbar.ck-toolbar_vertical{flex-direction:column}.ck.ck-toolbar.ck-toolbar_floating{flex-wrap:nowrap}.ck.ck-toolbar__separator{display:inline-block}.ck.ck-toolbar__newline{display:block;width:100%}.ck.ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-toolbar,.ck.ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-toolbar{background:var(--ck-color-toolbar-background);padding:0 var(--ck-spacing-small);border:1px solid var(--ck-color-toolbar-border)}.ck.ck-toolbar>*{margin-right:var(--ck-spacing-small);margin-top:var(--ck-spacing-small);margin-bottom:var(--ck-spacing-small)}.ck.ck-toolbar.ck-toolbar_vertical{padding:0}.ck.ck-toolbar.ck-toolbar_vertical>*{width:100%;margin:0;border-radius:0;border:0}.ck.ck-toolbar>:last-child{margin-right:0}.ck-toolbar-container .ck.ck-toolbar{border:0}.ck.ck-toolbar__separator{align-self:stretch;width:1px;margin-top:0;margin-bottom:0;background:var(--ck-color-toolbar-border)}.ck.ck-toolbar__newline{margin:0}\";},function(t,e,n){var i=n(57);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-editor{position:relative}.ck.ck-editor .ck-editor__top .ck-sticky-panel .ck-toolbar{z-index:var(--ck-z-modal)}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-editor__top .ck-sticky-panel .ck-toolbar{border-bottom-width:0}.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar{border-bottom-width:1px;border-radius:0}.ck-rounded-corners .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar,.ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content_sticky .ck-toolbar.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:0}.ck.ck-editor__main>.ck-editor__editable{background:var(--ck-color-base-background);border-radius:0}.ck-rounded-corners .ck.ck-editor__main>.ck-editor__editable,.ck.ck-editor__main>.ck-editor__editable.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}.ck.ck-editor__main>.ck-editor__editable:not(.ck-focused){border-color:var(--ck-color-base-border)}\";},function(t,e,n){var i=n(59);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-icon{vertical-align:middle}:root{--ck-icon-size:calc(var(--ck-line-height-base)*var(--ck-font-size-normal))}.ck.ck-icon{width:var(--ck-icon-size);height:var(--ck-icon-size);font-size:.8333350694em;will-change:transform}.ck.ck-icon,.ck.ck-icon *{color:inherit;cursor:inherit}.ck.ck-icon :not([fill]){fill:currentColor}\";},function(t,e,n){var i=n(61);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports='.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{position:absolute;pointer-events:none;-webkit-backface-visibility:hidden}.ck-tooltip{visibility:hidden;opacity:0;display:none;z-index:var(--ck-z-modal)}.ck-tooltip .ck-tooltip__text{display:inline-block}.ck-tooltip .ck-tooltip__text:after{content:\"\";width:0;height:0}:root{--ck-tooltip-arrow-size:5px}.ck.ck-tooltip{left:50%}.ck.ck-tooltip.ck-tooltip_s{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(100%)}.ck.ck-tooltip.ck-tooltip_s .ck-tooltip__text:after{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:var(--ck-color-tooltip-background);border-right-color:transparent;border-top-color:transparent;border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:var(--ck-tooltip-arrow-size);border-right-width:var(--ck-tooltip-arrow-size);border-top-width:0}.ck.ck-tooltip.ck-tooltip_n{top:calc(-1*var(--ck-tooltip-arrow-size));transform:translateY(-100%)}.ck.ck-tooltip.ck-tooltip_n .ck-tooltip__text:after{bottom:calc(-1*var(--ck-tooltip-arrow-size));transform:translateX(-50%);border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent;border-top-color:var(--ck-color-tooltip-background);border-left-width:var(--ck-tooltip-arrow-size);border-bottom-width:0;border-right-width:var(--ck-tooltip-arrow-size);border-top-width:var(--ck-tooltip-arrow-size)}.ck.ck-tooltip .ck-tooltip__text{border-radius:0}.ck-rounded-corners .ck.ck-tooltip .ck-tooltip__text,.ck.ck-tooltip .ck-tooltip__text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-tooltip .ck-tooltip__text{font-size:.9em;line-height:1.5;color:var(--ck-color-tooltip-text);padding:var(--ck-spacing-small) var(--ck-spacing-medium);background:var(--ck-color-tooltip-background);position:relative;left:-50%}.ck.ck-tooltip .ck-tooltip__text:after{border-style:solid;left:50%}.ck.ck-tooltip,.ck.ck-tooltip .ck-tooltip__text:after{transition:opacity .2s ease-in-out .2s}';},function(t,e,n){var i=n(63);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-button,a.ck.ck-button{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:block}@media (hover:none){.ck.ck-button .ck-tooltip,a.ck.ck-button .ck-tooltip{display:none}}.ck.ck-button,a.ck.ck-button{position:relative;display:inline-flex;align-items:center;justify-content:left}.ck.ck-button.ck-button_with-text .ck-button__label,a.ck.ck-button.ck-button_with-text .ck-button__label{display:inline-block}.ck.ck-button:not(.ck-button_with-text),a.ck.ck-button:not(.ck-button_with-text){justify-content:center}.ck.ck-button:hover .ck-tooltip,a.ck.ck-button:hover .ck-tooltip{visibility:visible;opacity:1}.ck.ck-button .ck-button__label,.ck.ck-button:focus:not(:hover) .ck-tooltip,a.ck.ck-button .ck-button__label,a.ck.ck-button:focus:not(:hover) .ck-tooltip{display:none}.ck.ck-button,a.ck.ck-button{background:var(--ck-color-button-default-background)}.ck.ck-button:not(.ck-disabled):hover,a.ck.ck-button:not(.ck-disabled):hover{background:var(--ck-color-button-default-hover-background)}.ck.ck-button:not(.ck-disabled):active,a.ck.ck-button:not(.ck-disabled):active{background:var(--ck-color-button-default-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-default-active-shadow)}.ck.ck-button.ck-disabled,a.ck.ck-button.ck-disabled{background:var(--ck-color-button-default-disabled-background)}.ck.ck-button,a.ck.ck-button{border-radius:0}.ck-rounded-corners .ck.ck-button,.ck-rounded-corners a.ck.ck-button,.ck.ck-button.ck-rounded-corners,a.ck.ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button,a.ck.ck-button{white-space:nowrap;cursor:default;vertical-align:middle;padding:var(--ck-spacing-tiny);text-align:center;min-width:var(--ck-ui-component-min-height);min-height:var(--ck-ui-component-min-height);line-height:1;font-size:inherit;border:1px solid transparent;transition:box-shadow .2s ease-in-out;-webkit-appearance:none}.ck.ck-button:active,.ck.ck-button:focus,a.ck.ck-button:active,a.ck.ck-button:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),0 0;border-color:transparent}.ck.ck-button.ck-disabled:active,.ck.ck-button.ck-disabled:focus,a.ck.ck-button.ck-disabled:active,a.ck.ck-button.ck-disabled:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),0 0}.ck.ck-button.ck-disabled .ck-button__icon,a.ck.ck-button.ck-disabled .ck-button__icon{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-disabled .ck-button__label,a.ck.ck-button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-button_with-text,a.ck.ck-button.ck-button_with-text{padding:var(--ck-spacing-tiny) var(--ck-spacing-standard)}.ck.ck-button.ck-button_with-text .ck-button__icon,a.ck.ck-button.ck-button_with-text .ck-button__icon{margin-left:calc(-1*var(--ck-spacing-small));margin-right:var(--ck-spacing-small)}.ck.ck-button.ck-on,a.ck.ck-button.ck-on{background:var(--ck-color-button-on-background)}.ck.ck-button.ck-on:not(.ck-disabled):hover,a.ck.ck-button.ck-on:not(.ck-disabled):hover{background:var(--ck-color-button-on-hover-background)}.ck.ck-button.ck-on:not(.ck-disabled):active,a.ck.ck-button.ck-on:not(.ck-disabled):active{background:var(--ck-color-button-on-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-on-active-shadow)}.ck.ck-button.ck-on.ck-disabled,a.ck.ck-button.ck-on.ck-disabled{background:var(--ck-color-button-on-disabled-background)}.ck.ck-button.ck-button-save,a.ck.ck-button.ck-button-save{color:var(--ck-color-button-save)}.ck.ck-button.ck-button-cancel,a.ck.ck-button.ck-button-cancel{color:var(--ck-color-button-cancel)}.ck.ck-button .ck-button__icon use,.ck.ck-button .ck-button__icon use *,a.ck.ck-button .ck-button__icon use,a.ck.ck-button .ck-button__icon use *{color:inherit}.ck.ck-button .ck-button__label,a.ck.ck-button .ck-button__label{font-size:inherit;font-weight:inherit;color:inherit;cursor:inherit;vertical-align:middle}.ck.ck-button-action,a.ck.ck-button-action{background:var(--ck-color-button-action-background)}.ck.ck-button-action:not(.ck-disabled):hover,a.ck.ck-button-action:not(.ck-disabled):hover{background:var(--ck-color-button-action-hover-background)}.ck.ck-button-action:not(.ck-disabled):active,a.ck.ck-button-action:not(.ck-disabled):active{background:var(--ck-color-button-action-active-background);box-shadow:inset 0 2px 2px var(--ck-color-button-action-active-shadow)}.ck.ck-button-action.ck-disabled,a.ck.ck-button-action.ck-disabled{background:var(--ck-color-button-action-disabled-background)}.ck.ck-button-action,a.ck.ck-button-action{color:var(--ck-color-button-action-text)}.ck.ck-button-bold,a.ck.ck-button-bold{font-weight:700}\";},function(t,e,n){var i=n(65);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck-content blockquote{overflow:hidden;padding-right:1.5em;padding-left:1.5em;margin-left:0;font-style:italic;border-left:5px solid #ccc}\";},function(t,e,n){var i=n(67);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck .ck-widget.ck-widget_with-selection-handler{position:relative}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler{visibility:hidden;position:absolute}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon{display:block}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_with-selection-handler:hover .ck-widget__selection-handler{visibility:visible}:root{--ck-widget-outline-thickness:3px;--ck-widget-handler-icon-size:16px;--ck-widget-handler-animation-duration:200ms;--ck-widget-handler-animation-curve:ease;--ck-color-widget-blurred-border:#dedede;--ck-color-widget-hover-border:#ffc83d;--ck-color-widget-editable-focus-background:var(--ck-color-base-background);--ck-color-widget-drag-handler-icon-color:var(--ck-color-base-background)}.ck .ck-widget{outline-width:var(--ck-widget-outline-thickness);outline-style:solid;outline-color:transparent;transition:outline-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_selected,.ck .ck-widget.ck-widget_selected:hover{outline:var(--ck-widget-outline-thickness) solid var(--ck-color-focus-border)}.ck .ck-widget:hover{outline-color:var(--ck-color-widget-hover-border)}.ck .ck-editor__nested-editable{border:1px solid transparent}.ck .ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck .ck-editor__nested-editable:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-inner-shadow),0 0;background-color:var(--ck-color-widget-editable-focus-background)}.ck-editor__editable>.ck-widget.ck-widget_with-selection-handler:first-child,.ck-editor__editable blockquote>.ck-widget.ck-widget_with-selection-handler:first-child{margin-top:calc(1em + var(--ck-widget-handler-icon-size))}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler{padding:4px;box-sizing:border-box;background-color:transparent;opacity:0;transition:background-color var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),visibility var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve),opacity var(--ck-widget-handler-animation-duration) var(--ck-widget-handler-animation-curve);border-radius:var(--ck-border-radius) var(--ck-border-radius) 0 0;transform:translateY(-100%);left:calc(0px - var(--ck-widget-outline-thickness))}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler:hover .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon{width:var(--ck-widget-handler-icon-size);height:var(--ck-widget-handler-icon-size);color:var(--ck-color-widget-drag-handler-icon-color)}.ck .ck-widget.ck-widget_with-selection-handler .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:0;transition:opacity .3s var(--ck-widget-handler-animation-curve)}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler,.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-focus-border)}.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator,.ck .ck-widget.ck-widget_with-selection-handler.ck-widget_selected:hover .ck-widget__selection-handler .ck-icon .ck-icon__selected-indicator{opacity:1}.ck .ck-widget.ck-widget_with-selection-handler:hover .ck-widget__selection-handler{opacity:1;background-color:var(--ck-color-widget-hover-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover{outline-color:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected .ck-widget__selection-handler,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected .ck-widget__selection-handler:hover,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover .ck-widget__selection-handler,.ck-editor__editable.ck-blurred .ck-widget.ck-widget_selected:hover .ck-widget__selection-handler:hover{background:var(--ck-color-widget-blurred-border)}.ck-editor__editable.ck-read-only .ck-widget{--ck-widget-outline-thickness:0}\";},function(t,e,n){var i=n(69);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-labeled-input .ck-labeled-input__status{font-size:var(--ck-font-size-small);margin-top:var(--ck-spacing-small);white-space:normal}.ck.ck-labeled-input .ck-labeled-input__status_error{color:var(--ck-color-base-error)}\";},function(t,e,n){var i=n(71);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\":root{--ck-input-text-width:18em}.ck.ck-input-text{border-radius:0}.ck-rounded-corners .ck.ck-input-text,.ck.ck-input-text.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-input-text{box-shadow:var(--ck-inner-shadow),0 0;background:var(--ck-color-input-background);border:1px solid var(--ck-color-input-border);padding:var(--ck-spacing-extra-tiny) var(--ck-spacing-medium);min-width:var(--ck-input-text-width);min-height:var(--ck-ui-component-min-height);transition-property:box-shadow,border;transition:.2s ease-in-out}.ck.ck-input-text:focus{outline:none;border:var(--ck-focus-ring);box-shadow:var(--ck-focus-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text[readonly]{border:1px solid var(--ck-color-input-disabled-border);background:var(--ck-color-input-disabled-background);color:var(--ck-color-input-disabled-text)}.ck.ck-input-text[readonly]:focus{box-shadow:var(--ck-focus-disabled-outer-shadow),var(--ck-inner-shadow)}.ck.ck-input-text.ck-error{border-color:var(--ck-color-input-error-border);animation:ck-text-input-shake .3s ease both}.ck.ck-input-text.ck-error:focus{box-shadow:var(--ck-focus-error-outer-shadow),var(--ck-inner-shadow)}@keyframes ck-text-input-shake{20%{transform:translateX(-2px)}40%{transform:translateX(2px)}60%{transform:translateX(-1px)}80%{transform:translateX(1px)}}\";},function(t,e,n){var i=n(73);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-text-alternative-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-text-alternative-form .ck-labeled-input{display:inline-block}.ck.ck-text-alternative-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-text-alternative-form{flex-wrap:wrap}.ck.ck-text-alternative-form .ck-labeled-input{flex-basis:100%}.ck.ck-text-alternative-form .ck-button{flex-basis:50%}}.ck.ck-text-alternative-form{padding:var(--ck-spacing-standard)}.ck.ck-text-alternative-form:focus{outline:none}.ck.ck-text-alternative-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-text-alternative-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-text-alternative-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-text-alternative-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-text-alternative-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);margin-left:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}.ck.ck-text-alternative-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}}\";},function(t,e,n){var i=n(75);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=':root{--ck-balloon-panel-arrow-z-index:calc(var(--ck-z-default) - 3)}.ck.ck-balloon-panel{display:none;position:absolute;z-index:var(--ck-z-modal)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{content:\"\";position:absolute}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_n]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_n]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel[class*=arrow_s]:before{z-index:var(--ck-balloon-panel-arrow-z-index)}.ck.ck-balloon-panel[class*=arrow_s]:after{z-index:calc(var(--ck-balloon-panel-arrow-z-index) + 1)}.ck.ck-balloon-panel.ck-balloon-panel_visible{display:block}:root{--ck-balloon-arrow-offset:2px;--ck-balloon-arrow-height:10px;--ck-balloon-arrow-half-width:8px}.ck.ck-balloon-panel{border-radius:0}.ck-rounded-corners .ck.ck-balloon-panel,.ck.ck-balloon-panel.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-balloon-panel{box-shadow:var(--ck-drop-shadow),0 0;min-height:15px;background:var(--ck-color-panel-background);border:1px solid var(--ck-color-panel-border)}.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:after,.ck.ck-balloon-panel.ck-balloon-panel_with-arrow:before{width:0;height:0;border-style:solid}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:var(--ck-balloon-arrow-height);border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:0}.ck.ck-balloon-panel[class*=arrow_n]:before{border-bottom-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_n]:after,.ck.ck-balloon-panel[class*=arrow_n]:before{border-left-color:transparent;border-right-color:transparent;border-top-color:transparent}.ck.ck-balloon-panel[class*=arrow_n]:after{border-bottom-color:var(--ck-color-panel-background);margin-top:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-width:var(--ck-balloon-arrow-half-width);border-bottom-width:0;border-right-width:var(--ck-balloon-arrow-half-width);border-top-width:var(--ck-balloon-arrow-height)}.ck.ck-balloon-panel[class*=arrow_s]:before{border-top-color:var(--ck-color-panel-border)}.ck.ck-balloon-panel[class*=arrow_s]:after,.ck.ck-balloon-panel[class*=arrow_s]:before{border-left-color:transparent;border-bottom-color:transparent;border-right-color:transparent}.ck.ck-balloon-panel[class*=arrow_s]:after{border-top-color:var(--ck-color-panel-background);margin-bottom:var(--ck-balloon-arrow-offset)}.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_n:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_nw:before{left:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_ne:before{right:calc(2*var(--ck-balloon-arrow-half-width));top:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_s:before{left:50%;margin-left:calc(-1*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_sw:before{left:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:after,.ck.ck-balloon-panel.ck-balloon-panel_arrow_se:before{right:calc(2*var(--ck-balloon-arrow-half-width));bottom:calc(-1*var(--ck-balloon-arrow-height))}';},function(t,e,n){var i=n(77);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck-content .image{clear:both;text-align:center;margin:1em 0}.ck-content .image>img{display:block;margin:0 auto;max-width:100%}\";},function(t,e,n){var i=n(79);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck-content .image{position:relative;overflow:hidden}.ck-content .image .ck-progress-bar{position:absolute;top:0;left:0}:root{--ck-image-upload-progress-line-width:30px}.ck-content .image.ck-appear{animation:fadeIn .7s}.ck-content .image .ck-progress-bar{height:2px;width:0;background:var(--ck-color-upload-bar-background);transition:width .1s}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}\";},function(t,e,n){var i=n(81);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports='.ck-image-upload-complete-icon{display:block;position:absolute;top:10px;right:10px;border-radius:50%}.ck-image-upload-complete-icon:after{content:\"\";position:absolute}:root{--ck-color-image-upload-icon:#fff;--ck-color-image-upload-icon-background:#008a00;--ck-image-upload-icon-size:20px;--ck-image-upload-icon-width:2px}.ck-image-upload-complete-icon{width:var(--ck-image-upload-icon-size);height:var(--ck-image-upload-icon-size);opacity:0;background:var(--ck-color-image-upload-icon-background);animation-name:ck-upload-complete-icon-show,ck-upload-complete-icon-hide;animation-fill-mode:forwards,forwards;animation-duration:.5s,.5s;font-size:var(--ck-image-upload-icon-size);animation-delay:0ms,3s}.ck-image-upload-complete-icon:after{left:25%;top:50%;opacity:0;height:0;width:0;transform:scaleX(-1) rotate(135deg);transform-origin:left top;border-top:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);border-right:var(--ck-image-upload-icon-width) solid var(--ck-color-image-upload-icon);animation-name:ck-upload-complete-icon-check;animation-duration:.5s;animation-delay:.5s;animation-fill-mode:forwards;box-sizing:border-box}@keyframes ck-upload-complete-icon-show{0%{opacity:0}to{opacity:1}}@keyframes ck-upload-complete-icon-hide{0%{opacity:1}to{opacity:0}}@keyframes ck-upload-complete-icon-check{0%{opacity:1;width:0;height:0}33%{width:.3em;height:0}to{opacity:1;width:.3em;height:.45em}}';},function(t,e,n){var i=n(83);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports='.ck .ck-upload-placeholder-loader{position:absolute;display:flex;align-items:center;justify-content:center;top:0;left:0}.ck .ck-upload-placeholder-loader:before{content:\"\";position:relative}:root{--ck-color-upload-placeholder-loader:#b3b3b3;--ck-upload-placeholder-loader-size:32px}.ck .ck-image-upload-placeholder{width:100%;margin:0}.ck .ck-upload-placeholder-loader{width:100%;height:100%}.ck .ck-upload-placeholder-loader:before{width:var(--ck-upload-placeholder-loader-size);height:var(--ck-upload-placeholder-loader-size);border-radius:50%;border-top:3px solid var(--ck-color-upload-placeholder-loader);border-right:2px solid transparent;animation:ck-upload-placeholder-loader 1s linear infinite}@keyframes ck-upload-placeholder-loader{to{transform:rotate(1turn)}}';},function(t,e,n){var i=n(85);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-dropdown{display:inline-block;position:relative}.ck.ck-dropdown .ck-dropdown__arrow{pointer-events:none;z-index:var(--ck-z-default)}.ck.ck-dropdown .ck-button.ck-dropdown__button{width:100%}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on .ck-tooltip{display:none}.ck.ck-dropdown .ck-dropdown__panel{-webkit-backface-visibility:hidden;display:none;z-index:var(--ck-z-modal);position:absolute}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel-visible{display:inline-block;will-change:transform}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw{bottom:100%}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{transform:translate3d(0,100%,0)}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_ne,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_se{left:0}.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_nw,.ck.ck-dropdown .ck-dropdown__panel.ck-dropdown__panel_sw{right:0}:root{--ck-dropdown-arrow-size:calc(0.5*var(--ck-icon-size))}.ck.ck-dropdown{font-size:inherit}.ck.ck-dropdown .ck-dropdown__arrow{right:var(--ck-spacing-standard);width:var(--ck-dropdown-arrow-size);margin-left:var(--ck-spacing-small)}.ck.ck-dropdown.ck-disabled .ck-dropdown__arrow{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button:not(.ck-button_with-text){padding-left:var(--ck-spacing-small)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-disabled .ck-button__label{opacity:var(--ck-disabled-opacity)}.ck.ck-dropdown .ck-button.ck-dropdown__button.ck-on{border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-button.ck-dropdown__button .ck-button__label{width:7em;overflow:hidden;text-overflow:ellipsis}.ck.ck-dropdown__panel{box-shadow:var(--ck-drop-shadow),0 0;border-radius:0}.ck-rounded-corners .ck.ck-dropdown__panel,.ck.ck-dropdown__panel.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown__panel{background:var(--ck-color-dropdown-panel-background);border:1px solid var(--ck-color-dropdown-panel-border);bottom:0;min-width:100%}\";},function(t,e,n){var i=n(87);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-list{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;display:flex;flex-direction:column}.ck.ck-list .ck-list__item,.ck.ck-list .ck-list__separator{display:block}.ck.ck-list .ck-list__item>:focus{position:relative;z-index:var(--ck-z-default)}.ck.ck-list{border-radius:0}.ck-rounded-corners .ck.ck-list,.ck.ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-list{list-style-type:none;background:var(--ck-color-list-background)}.ck.ck-list__item{cursor:default;min-width:12em}.ck.ck-list__item .ck-button{min-height:unset;width:100%;text-align:left;border-radius:0;border:0;padding:calc(0.2*var(--ck-line-height-base)*var(--ck-font-size-base)) calc(0.4*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button .ck-button__label{line-height:calc(1.2*var(--ck-line-height-base)*var(--ck-font-size-base))}.ck.ck-list__item .ck-button:active{box-shadow:none}.ck.ck-list__item .ck-button.ck-on{background:var(--ck-color-list-button-on-background);color:var(--ck-color-list-button-on-text)}.ck.ck-list__item .ck-button.ck-on:hover:not(ck-disabled){background:var(--ck-color-list-button-on-background-focus)}.ck.ck-list__item .ck-button.ck-on:active{box-shadow:none}.ck.ck-list__item .ck-button:hover:not(.ck-disabled){background:var(--ck-color-list-button-hover-background)}.ck.ck-list__item .ck-switchbutton.ck-on{background:var(--ck-color-list-background);color:inherit}.ck.ck-list__item .ck-switchbutton.ck-on:hover:not(ck-disabled){background:var(--ck-color-list-button-hover-background);color:inherit}.ck.ck-list__separator{height:1px;width:100%;background:var(--ck-color-base-border)}\";},function(t,e,n){var i=n(89);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{display:block}:root{--ck-switch-button-toggle-width:2.6153846154em;--ck-switch-button-toggle-inner-size:1.0769230769em;--ck-switch-button-toggle-spacing:1px}.ck.ck-button.ck-switchbutton .ck-button__label{margin-right:calc(2*var(--ck-spacing-large))}.ck.ck-button.ck-switchbutton.ck-disabled .ck-button__toggle{opacity:var(--ck-disabled-opacity)}.ck.ck-button.ck-switchbutton .ck-button__toggle{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle,.ck.ck-button.ck-switchbutton .ck-button__toggle.ck-rounded-corners{border-radius:var(--ck-border-radius)}.ck.ck-button.ck-switchbutton .ck-button__toggle{margin-left:auto;transition:background .4s ease;width:var(--ck-switch-button-toggle-width);background:var(--ck-color-switch-button-off-background)}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{border-radius:0}.ck-rounded-corners .ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner,.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner.ck-rounded-corners{border-radius:var(--ck-border-radius);border-radius:calc(0.5*var(--ck-border-radius))}.ck.ck-button.ck-switchbutton .ck-button__toggle .ck-button__toggle__inner{margin:var(--ck-switch-button-toggle-spacing);width:var(--ck-switch-button-toggle-inner-size);height:var(--ck-switch-button-toggle-inner-size);background:var(--ck-color-switch-button-inner-background);transition:transform .3s ease}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle{background:var(--ck-color-switch-button-on-background)}.ck.ck-button.ck-switchbutton.ck-on .ck-button__toggle .ck-button__toggle__inner{transform:translateX(1.3846153847em)}\";},function(t,e,n){var i=n(91);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-toolbar-dropdown .ck-toolbar{flex-wrap:nowrap}.ck.ck-toolbar-dropdown .ck-dropdown__panel .ck-button:focus{z-index:calc(var(--ck-z-default) + 1)}.ck.ck-toolbar-dropdown .ck-toolbar{border:0}\";},function(t,e,n){var i=n(93);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-dropdown .ck-dropdown__panel .ck-list{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list,.ck.ck-dropdown .ck-dropdown__panel .ck-list.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:first-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button{border-radius:0}.ck-rounded-corners .ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button,.ck.ck-dropdown .ck-dropdown__panel .ck-list .ck-list__item:last-child .ck-button.ck-rounded-corners{border-radius:var(--ck-border-radius);border-top-left-radius:0;border-top-right-radius:0}\";},function(t,e){t.exports=\".ck.ck-heading_heading1{font-size:20px}.ck.ck-heading_heading2{font-size:17px}.ck.ck-heading_heading3{font-size:14px}.ck[class*=ck-heading_heading]{font-weight:700}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__button .ck-button__label{width:8em}.ck.ck-dropdown.ck-heading-dropdown .ck-dropdown__panel .ck-list__item{min-width:18em}\";},function(t,e,n){var i=n(96);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck-content .image>figcaption{color:#333;background-color:#f7f7f7;padding:.6em;font-size:.75em;outline-offset:-1px}\";},function(t,e,n){var i=n(98);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\":root{--ck-image-style-spacing:1.5em}.ck-content .image-style-align-center,.ck-content .image-style-align-left,.ck-content .image-style-align-right,.ck-content .image-style-side{max-width:50%}.ck-content .image-style-side{float:right;margin-left:var(--ck-image-style-spacing)}.ck-content .image-style-align-left{float:left;margin-right:var(--ck-image-style-spacing)}.ck-content .image-style-align-center{margin-left:auto;margin-right:auto}.ck-content .image-style-align-right{float:right;margin-left:var(--ck-image-style-spacing)}\";},function(t,e,n){var i=n(100);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck .ck-link_selected{background:var(--ck-color-link-selected-background)}\";},function(t,e,n){var i=n(102);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-link-form{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-link-form{flex-wrap:wrap}.ck.ck-link-form .ck-labeled-input{flex-basis:100%}.ck.ck-link-form .ck-button{flex-basis:50%}}.ck.ck-link-form{padding:var(--ck-spacing-standard)}.ck.ck-link-form:focus{outline:none}.ck.ck-link-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-link-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);margin-left:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}.ck.ck-link-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}}\";},function(t,e,n){var i=n(104);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-link-actions{display:flex;flex-direction:row;flex-wrap:nowrap}.ck.ck-link-actions .ck-link-actions__preview{display:inline-block}.ck.ck-link-actions .ck-link-actions__preview .ck-button__label{overflow:hidden}@media screen and (max-width:600px){.ck.ck-link-actions{flex-wrap:wrap}.ck.ck-link-actions .ck-link-actions__preview{flex-basis:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){flex-basis:50%}}.ck.ck-link-actions{padding:var(--ck-spacing-standard)}.ck.ck-link-actions .ck-button.ck-link-actions__preview{padding-left:0;padding-right:0}.ck.ck-link-actions .ck-button.ck-link-actions__preview,.ck.ck-link-actions .ck-button.ck-link-actions__preview:active,.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus,.ck.ck-link-actions .ck-button.ck-link-actions__preview:hover{background:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:active{box-shadow:none}.ck.ck-link-actions .ck-button.ck-link-actions__preview:focus .ck-button__label{text-decoration:underline}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{padding:0 var(--ck-spacing-medium);color:var(--ck-color-link-default);text-overflow:ellipsis;cursor:pointer;max-width:var(--ck-input-text-width);min-width:3em;text-align:center}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label:hover{text-decoration:underline}.ck.ck-link-actions:focus{outline:none}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-link-actions{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-link-actions .ck-button.ck-link-actions__preview{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-link-actions .ck-button.ck-link-actions__preview .ck-button__label{min-width:0;max-width:100%}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview){padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);margin-left:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}.ck.ck-link-actions .ck-button:not(.ck-link-actions__preview):first-of-type{border-right:1px solid var(--ck-color-base-border)}}\";},function(t,e,n){var i=n(106);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports='.ck-media__wrapper .ck-media__placeholder{display:flex;flex-direction:column;align-items:center}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:block}@media (hover:none){.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-tooltip{display:none}}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url{max-width:100%;position:relative}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url:hover .ck-tooltip{visibility:visible;opacity:1}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{overflow:hidden;display:block}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\"google.com/maps\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder__icon *,.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck-media__placeholder__icon *{display:none}.ck-editor__editable:not(.ck-read-only) .ck-media__wrapper>:not(.ck-media__placeholder){pointer-events:none}:root{--ck-media-embed-placeholder-icon-size:3em;--ck-color-media-embed-placeholder-url-text:#757575;--ck-color-media-embed-placeholder-url-text-hover:var(--ck-color-base-text)}.ck-media__wrapper{margin:0 auto}.ck-media__wrapper .ck-media__placeholder{padding:calc(3*var(--ck-spacing-standard));background:var(--ck-color-base-foreground)}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon{min-width:var(--ck-media-embed-placeholder-icon-size);height:var(--ck-media-embed-placeholder-icon-size);margin-bottom:var(--ck-spacing-large);background-position:50%;background-size:cover}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__icon .ck-icon{width:100%;height:100%}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text{color:var(--ck-color-media-embed-placeholder-url-text);white-space:nowrap;text-align:center;font-style:italic;text-overflow:ellipsis}.ck-media__wrapper .ck-media__placeholder .ck-media__placeholder__url .ck-media__placeholder__url__text:hover{color:var(--ck-color-media-embed-placeholder-url-text-hover);cursor:pointer;text-decoration:underline}.ck-media__wrapper[data-oembed-url*=\"open.spotify.com\"]{max-width:300px;max-height:380px}.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck.ck-media__placeholder{background:linear-gradient(90deg,#71c6f4,#0d70a5)}.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck.ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBkPSJNNDAwIDIwMGMwIDExMC41LTg5LjUgMjAwLTIwMCAyMDBTMCAzMTAuNSAwIDIwMCA4OS41IDAgMjAwIDBzMjAwIDg5LjUgMjAwIDIwMHpNMTYzLjQgMzA1LjVjODguNyAwIDEzNy4yLTczLjUgMTM3LjItMTM3LjIgMC0yLjEgMC00LjItLjEtNi4yIDkuNC02LjggMTcuNi0xNS4zIDI0LjEtMjUtOC42IDMuOC0xNy45IDYuNC0yNy43IDcuNiAxMC02IDE3LjYtMTUuNCAyMS4yLTI2LjctOS4zIDUuNS0xOS42IDkuNS0zMC42IDExLjctOC44LTkuNC0yMS4zLTE1LjItMzUuMi0xNS4yLTI2LjYgMC00OC4yIDIxLjYtNDguMiA0OC4yIDAgMy44LjQgNy41IDEuMyAxMS00MC4xLTItNzUuNi0yMS4yLTk5LjQtNTAuNC00LjEgNy4xLTYuNSAxNS40LTYuNSAyNC4yIDAgMTYuNyA4LjUgMzEuNSAyMS41IDQwLjEtNy45LS4yLTE1LjMtMi40LTIxLjgtNnYuNmMwIDIzLjQgMTYuNiA0Mi44IDM4LjcgNDcuMy00IDEuMS04LjMgMS43LTEyLjcgMS43LTMuMSAwLTYuMS0uMy05LjEtLjkgNi4xIDE5LjIgMjMuOSAzMy4xIDQ1IDMzLjUtMTYuNSAxMi45LTM3LjMgMjAuNi01OS45IDIwLjYtMy45IDAtNy43LS4yLTExLjUtLjcgMjEuMSAxMy44IDQ2LjUgMjEuOCA3My43IDIxLjgiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck.ck-media__placeholder .ck-media__placeholder__url__text{color:#b8e6ff}.ck-media__wrapper[data-oembed-url*=\"twitter.com\"] .ck.ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*=\"google.com/maps\"] .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAuMzc4IiBoZWlnaHQ9IjI1NC4xNjciIHZpZXdCb3g9IjAgMCA2Ni4yNDYgNjcuMjQ4Ij48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTcyLjUzMSAtMjE4LjQ1NSkgc2NhbGUoLjk4MDEyKSI+PHJlY3Qgcnk9IjUuMjM4IiByeD0iNS4yMzgiIHk9IjIzMS4zOTkiIHg9IjE3Ni4wMzEiIGhlaWdodD0iNjAuMDk5IiB3aWR0aD0iNjAuMDk5IiBmaWxsPSIjMzRhNjY4IiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxwYXRoIGQ9Ik0yMDYuNDc3IDI2MC45bC0yOC45ODcgMjguOTg3YTUuMjE4IDUuMjE4IDAgMCAwIDMuNzggMS42MWg0OS42MjFjMS42OTQgMCAzLjE5LS43OTggNC4xNDYtMi4wMzd6IiBmaWxsPSIjNWM4OGM1Ii8+PHBhdGggZD0iTTIyNi43NDIgMjIyLjk4OGMtOS4yNjYgMC0xNi43NzcgNy4xNy0xNi43NzcgMTYuMDE0LjAwNyAyLjc2Mi42NjMgNS40NzQgMi4wOTMgNy44NzUuNDMuNzAzLjgzIDEuNDA4IDEuMTkgMi4xMDcuMzMzLjUwMi42NSAxLjAwNS45NSAxLjUwOC4zNDMuNDc3LjY3My45NTcuOTg4IDEuNDQgMS4zMSAxLjc2OSAyLjUgMy41MDIgMy42MzcgNS4xNjguNzkzIDEuMjc1IDEuNjgzIDIuNjQgMi40NjYgMy45OSAyLjM2MyA0LjA5NCA0LjAwNyA4LjA5MiA0LjYgMTMuOTE0di4wMTJjLjE4Mi40MTIuNTE2LjY2Ni44NzkuNjY3LjQwMy0uMDAxLjc2OC0uMzE0LjkzLS43OTkuNjAzLTUuNzU2IDIuMjM4LTkuNzI5IDQuNTg1LTEzLjc5NC43ODItMS4zNSAxLjY3My0yLjcxNSAyLjQ2NS0zLjk5IDEuMTM3LTEuNjY2IDIuMzI4LTMuNCAzLjYzOC01LjE2OS4zMTUtLjQ4Mi42NDUtLjk2Mi45ODgtMS40MzkuMy0uNTAzLjYxNy0xLjAwNi45NS0xLjUwOC4zNTktLjcuNzYtMS40MDQgMS4xOS0yLjEwNyAxLjQyNi0yLjQwMiAyLTUuMTE0IDIuMDA0LTcuODc1IDAtOC44NDQtNy41MTEtMTYuMDE0LTE2Ljc3Ni0xNi4wMTR6IiBmaWxsPSIjZGQ0YjNlIiBwYWludC1vcmRlcj0ibWFya2VycyBzdHJva2UgZmlsbCIvPjxlbGxpcHNlIHJ5PSI1LjU2NCIgcng9IjUuODI4IiBjeT0iMjM5LjAwMiIgY3g9IjIyNi43NDIiIGZpbGw9IiM4MDJkMjciIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTE5MC4zMDEgMjM3LjI4M2MtNC42NyAwLTguNDU3IDMuODUzLTguNDU3IDguNjA2czMuNzg2IDguNjA3IDguNDU3IDguNjA3YzMuMDQzIDAgNC44MDYtLjk1OCA2LjMzNy0yLjUxNiAxLjUzLTEuNTU3IDIuMDg3LTMuOTEzIDIuMDg3LTYuMjkgMC0uMzYyLS4wMjMtLjcyMi0uMDY0LTEuMDc5aC04LjI1N3YzLjA0M2g0Ljg1Yy0uMTk3Ljc1OS0uNTMxIDEuNDUtMS4wNTggMS45ODYtLjk0Mi45NTgtMi4wMjggMS41NDgtMy45MDEgMS41NDgtMi44NzYgMC01LjIwOC0yLjM3Mi01LjIwOC01LjI5OSAwLTIuOTI2IDIuMzMyLTUuMjk5IDUuMjA4LTUuMjk5IDEuMzk5IDAgMi42MTguNDA3IDMuNTg0IDEuMjkzbDIuMzgxLTIuMzhjMC0uMDAyLS4wMDMtLjAwNC0uMDA0LS4wMDUtMS41ODgtMS41MjQtMy42Mi0yLjIxNS01Ljk1NS0yLjIxNXptNC40MyA1LjY2bC4wMDMuMDA2di0uMDAzeiIgZmlsbD0iI2ZmZiIgcGFpbnQtb3JkZXI9Im1hcmtlcnMgc3Ryb2tlIGZpbGwiLz48cGF0aCBkPSJNMjE1LjE4NCAyNTEuOTI5bC03Ljk4IDcuOTc5IDI4LjQ3NyAyOC40NzVhNS4yMzMgNS4yMzMgMCAwIDAgLjQ0OS0yLjEyM3YtMzEuMTY1Yy0uNDY5LjY3NS0uOTM0IDEuMzQ5LTEuMzgyIDIuMDA1LS43OTIgMS4yNzUtMS42ODIgMi42NC0yLjQ2NSAzLjk5LTIuMzQ3IDQuMDY1LTMuOTgyIDguMDM4LTQuNTg1IDEzLjc5NC0uMTYyLjQ4NS0uNTI3Ljc5OC0uOTMuNzk5LS4zNjMtLjAwMS0uNjk3LS4yNTUtLjg3OS0uNjY3di0uMDEyYy0uNTkzLTUuODIyLTIuMjM3LTkuODItNC42LTEzLjkxNC0uNzgzLTEuMzUtMS42NzMtMi43MTUtMi40NjYtMy45OS0xLjEzNy0xLjY2Ni0yLjMyNy0zLjQtMy42MzctNS4xNjlsLS4wMDItLjAwM3oiIGZpbGw9IiNjM2MzYzMiLz48cGF0aCBkPSJNMjEyLjk4MyAyNDguNDk1bC0zNi45NTIgMzYuOTUzdi44MTJhNS4yMjcgNS4yMjcgMCAwIDAgNS4yMzggNS4yMzhoMS4wMTVsMzUuNjY2LTM1LjY2NmExMzYuMjc1IDEzNi4yNzUgMCAwIDAtMi43NjQtMy45IDM3LjU3NSAzNy41NzUgMCAwIDAtLjk4OS0xLjQ0IDM1LjEyNyAzNS4xMjcgMCAwIDAtLjk1LTEuNTA4Yy0uMDgzLS4xNjItLjE3Ni0uMzI2LS4yNjQtLjQ4OXoiIGZpbGw9IiNmZGRjNGYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PHBhdGggZD0iTTIxMS45OTggMjYxLjA4M2wtNi4xNTIgNi4xNTEgMjQuMjY0IDI0LjI2NGguNzgxYTUuMjI3IDUuMjI3IDAgMCAwIDUuMjM5LTUuMjM4di0xLjA0NXoiIGZpbGw9IiNmZmYiIHBhaW50LW9yZGVyPSJtYXJrZXJzIHN0cm9rZSBmaWxsIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder{background:#4268b3}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAyNCIgaGVpZ2h0PSIxMDI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxwYXRoIGQ9Ik05NjcuNDg0IDBINTYuNTE3QzI1LjMwNCAwIDAgMjUuMzA0IDAgNTYuNTE3djkxMC45NjZDMCA5OTguNjk0IDI1LjI5NyAxMDI0IDU2LjUyMiAxMDI0SDU0N1Y2MjhINDE0VjQ3M2gxMzNWMzU5LjAyOWMwLTEzMi4yNjIgODAuNzczLTIwNC4yODIgMTk4Ljc1Ni0yMDQuMjgyIDU2LjUxMyAwIDEwNS4wODYgNC4yMDggMTE5LjI0NCA2LjA4OVYyOTlsLTgxLjYxNi4wMzdjLTYzLjk5MyAwLTc2LjM4NCAzMC40OTItNzYuMzg0IDc1LjIzNlY0NzNoMTUzLjQ4N2wtMTkuOTg2IDE1NUg3MDd2Mzk2aDI2MC40ODRjMzEuMjEzIDAgNTYuNTE2LTI1LjMwMyA1Ni41MTYtNTYuNTE2VjU2LjUxNUMxMDI0IDI1LjMwMyA5OTguNjk3IDAgOTY3LjQ4NCAwIiBmaWxsPSIjRkZGRkZFIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#cdf}.ck-media__wrapper[data-oembed-url*=\"facebook.com\"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder{background:linear-gradient(-135deg,#1400c8,#b900b4,#f50000)}.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder .ck-media__placeholder__icon{background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTA0IiBoZWlnaHQ9IjUwNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PHBhdGggaWQ9ImEiIGQ9Ik0wIC4xNTloNTAzLjg0MVY1MDMuOTRIMHoiLz48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48bWFzayBpZD0iYiIgZmlsbD0iI2ZmZiI+PHVzZSB4bGluazpocmVmPSIjYSIvPjwvbWFzaz48cGF0aCBkPSJNMjUxLjkyMS4xNTljLTY4LjQxOCAwLTc2Ljk5Ny4yOS0xMDMuODY3IDEuNTE2LTI2LjgxNCAxLjIyMy00NS4xMjcgNS40ODItNjEuMTUxIDExLjcxLTE2LjU2NiA2LjQzNy0zMC42MTUgMTUuMDUxLTQ0LjYyMSAyOS4wNTYtMTQuMDA1IDE0LjAwNi0yMi42MTkgMjguMDU1LTI5LjA1NiA0NC42MjEtNi4yMjggMTYuMDI0LTEwLjQ4NyAzNC4zMzctMTEuNzEgNjEuMTUxQy4yOSAxNzUuMDgzIDAgMTgzLjY2MiAwIDI1Mi4wOGMwIDY4LjQxNy4yOSA3Ni45OTYgMS41MTYgMTAzLjg2NiAxLjIyMyAyNi44MTQgNS40ODIgNDUuMTI3IDExLjcxIDYxLjE1MSA2LjQzNyAxNi41NjYgMTUuMDUxIDMwLjYxNSAyOS4wNTYgNDQuNjIxIDE0LjAwNiAxNC4wMDUgMjguMDU1IDIyLjYxOSA0NC42MjEgMjkuMDU3IDE2LjAyNCA2LjIyNyAzNC4zMzcgMTAuNDg2IDYxLjE1MSAxMS43MDkgMjYuODcgMS4yMjYgMzUuNDQ5IDEuNTE2IDEwMy44NjcgMS41MTYgNjguNDE3IDAgNzYuOTk2LS4yOSAxMDMuODY2LTEuNTE2IDI2LjgxNC0xLjIyMyA0NS4xMjctNS40ODIgNjEuMTUxLTExLjcwOSAxNi41NjYtNi40MzggMzAuNjE1LTE1LjA1MiA0NC42MjEtMjkuMDU3IDE0LjAwNS0xNC4wMDYgMjIuNjE5LTI4LjA1NSAyOS4wNTctNDQuNjIxIDYuMjI3LTE2LjAyNCAxMC40ODYtMzQuMzM3IDExLjcwOS02MS4xNTEgMS4yMjYtMjYuODcgMS41MTYtMzUuNDQ5IDEuNTE2LTEwMy44NjYgMC02OC40MTgtLjI5LTc2Ljk5Ny0xLjUxNi0xMDMuODY3LTEuMjIzLTI2LjgxNC01LjQ4Mi00NS4xMjctMTEuNzA5LTYxLjE1MS02LjQzOC0xNi41NjYtMTUuMDUyLTMwLjYxNS0yOS4wNTctNDQuNjIxLTE0LjAwNi0xNC4wMDUtMjguMDU1LTIyLjYxOS00NC42MjEtMjkuMDU2LTE2LjAyNC02LjIyOC0zNC4zMzctMTAuNDg3LTYxLjE1MS0xMS43MUMzMjguOTE3LjQ0OSAzMjAuMzM4LjE1OSAyNTEuOTIxLjE1OXptMCA0NS4zOTFjNjcuMjY1IDAgNzUuMjMzLjI1NyAxMDEuNzk3IDEuNDY5IDI0LjU2MiAxLjEyIDM3LjkwMSA1LjIyNCA0Ni43NzggOC42NzQgMTEuNzU5IDQuNTcgMjAuMTUxIDEwLjAyOSAyOC45NjYgMTguODQ1IDguODE2IDguODE1IDE0LjI3NSAxNy4yMDcgMTguODQ1IDI4Ljk2NiAzLjQ1IDguODc3IDcuNTU0IDIyLjIxNiA4LjY3NCA0Ni43NzggMS4yMTIgMjYuNTY0IDEuNDY5IDM0LjUzMiAxLjQ2OSAxMDEuNzk4IDAgNjcuMjY1LS4yNTcgNzUuMjMzLTEuNDY5IDEwMS43OTctMS4xMiAyNC41NjItNS4yMjQgMzcuOTAxLTguNjc0IDQ2Ljc3OC00LjU3IDExLjc1OS0xMC4wMjkgMjAuMTUxLTE4Ljg0NSAyOC45NjYtOC44MTUgOC44MTYtMTcuMjA3IDE0LjI3NS0yOC45NjYgMTguODQ1LTguODc3IDMuNDUtMjIuMjE2IDcuNTU0LTQ2Ljc3OCA4LjY3NC0yNi41NiAxLjIxMi0zNC41MjcgMS40NjktMTAxLjc5NyAxLjQ2OS02Ny4yNzEgMC03NS4yMzctLjI1Ny0xMDEuNzk4LTEuNDY5LTI0LjU2Mi0xLjEyLTM3LjkwMS01LjIyNC00Ni43NzgtOC42NzQtMTEuNzU5LTQuNTctMjAuMTUxLTEwLjAyOS0yOC45NjYtMTguODQ1LTguODE1LTguODE1LTE0LjI3NS0xNy4yMDctMTguODQ1LTI4Ljk2Ni0zLjQ1LTguODc3LTcuNTU0LTIyLjIxNi04LjY3NC00Ni43NzgtMS4yMTItMjYuNTY0LTEuNDY5LTM0LjUzMi0xLjQ2OS0xMDEuNzk3IDAtNjcuMjY2LjI1Ny03NS4yMzQgMS40NjktMTAxLjc5OCAxLjEyLTI0LjU2MiA1LjIyNC0zNy45MDEgOC42NzQtNDYuNzc4IDQuNTctMTEuNzU5IDEwLjAyOS0yMC4xNTEgMTguODQ1LTI4Ljk2NiA4LjgxNS04LjgxNiAxNy4yMDctMTQuMjc1IDI4Ljk2Ni0xOC44NDUgOC44NzctMy40NSAyMi4yMTYtNy41NTQgNDYuNzc4LTguNjc0IDI2LjU2NC0xLjIxMiAzNC41MzItMS40NjkgMTAxLjc5OC0xLjQ2OXoiIGZpbGw9IiNGRkYiIG1hc2s9InVybCgjYikiLz48cGF0aCBkPSJNMjUxLjkyMSAzMzYuMDUzYy00Ni4zNzggMC04My45NzQtMzcuNTk2LTgzLjk3NC04My45NzMgMC00Ni4zNzggMzcuNTk2LTgzLjk3NCA4My45NzQtODMuOTc0IDQ2LjM3NyAwIDgzLjk3MyAzNy41OTYgODMuOTczIDgzLjk3NCAwIDQ2LjM3Ny0zNy41OTYgODMuOTczLTgzLjk3MyA4My45NzN6bTAtMjEzLjMzOGMtNzEuNDQ3IDAtMTI5LjM2NSA1Ny45MTgtMTI5LjM2NSAxMjkuMzY1IDAgNzEuNDQ2IDU3LjkxOCAxMjkuMzY0IDEyOS4zNjUgMTI5LjM2NCA3MS40NDYgMCAxMjkuMzY0LTU3LjkxOCAxMjkuMzY0LTEyOS4zNjQgMC03MS40NDctNTcuOTE4LTEyOS4zNjUtMTI5LjM2NC0xMjkuMzY1ek00MTYuNjI3IDExNy42MDRjMCAxNi42OTYtMTMuNTM1IDMwLjIzLTMwLjIzMSAzMC4yMy0xNi42OTUgMC0zMC4yMy0xMy41MzQtMzAuMjMtMzAuMjMgMC0xNi42OTYgMTMuNTM1LTMwLjIzMSAzMC4yMy0zMC4yMzEgMTYuNjk2IDAgMzAuMjMxIDEzLjUzNSAzMC4yMzEgMzAuMjMxIiBmaWxsPSIjRkZGIi8+PC9nPjwvc3ZnPg==)}.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder .ck-media__placeholder__url__text{color:#ffe0fe}.ck-media__wrapper[data-oembed-url*=\"instagram.com\"] .ck-media__placeholder .ck-media__placeholder__url__text:hover{color:#fff}';},function(t,e,n){var i=n(108);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck.ck-media-form{display:flex;align-items:flex-start;flex-direction:row;flex-wrap:nowrap}.ck.ck-media-form .ck-labeled-input{display:inline-block}.ck.ck-media-form .ck-label{display:none}@media screen and (max-width:600px){.ck.ck-media-form{flex-wrap:wrap}.ck.ck-media-form .ck-labeled-input{flex-basis:100%}.ck.ck-media-form .ck-button{flex-basis:50%}}.ck.ck-media-form{padding:var(--ck-spacing-standard)}.ck.ck-media-form:focus{outline:none}.ck.ck-media-form>:not(:first-child){margin-left:var(--ck-spacing-standard)}@media screen and (max-width:600px){.ck.ck-media-form{padding:0;width:calc(0.8*var(--ck-input-text-width))}.ck.ck-media-form .ck-labeled-input{margin:var(--ck-spacing-standard) var(--ck-spacing-standard) 0}.ck.ck-media-form .ck-labeled-input .ck-input-text{min-width:0;width:100%}.ck.ck-media-form .ck-labeled-input .ck-labeled-input__error{white-space:normal}.ck.ck-media-form .ck-button{padding:var(--ck-spacing-standard);margin-top:var(--ck-spacing-standard);margin-left:0;border-radius:0;border:0;border-top:1px solid var(--ck-color-base-border)}.ck.ck-media-form .ck-button:first-of-type{border-right:1px solid var(--ck-color-base-border)}}\";},function(t,e,n){var i=n(110);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck-content .media{clear:both;margin:1em 0;display:block;min-width:15em}\";},function(t,e,n){var i=n(112);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\":root{--ck-color-table-focused-cell-background:#f5fafe}.ck-widget.table td.ck-editor__nested-editable.ck-editor__nested-editable_focused,.ck-widget.table th.ck-editor__nested-editable.ck-editor__nested-editable_focused{background:var(--ck-color-table-focused-cell-background);border-style:none;outline:1px solid var(--ck-color-focus-border);outline-offset:-1px}\";},function(t,e,n){var i=n(114);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\":root{--ck-insert-table-dropdown-padding:10px;--ck-insert-table-dropdown-box-height:11px;--ck-insert-table-dropdown-box-width:12px;--ck-insert-table-dropdown-box-margin:1px;--ck-insert-table-dropdown-box-border-color:#bfbfbf;--ck-insert-table-dropdown-box-border-active-color:#53a0e4;--ck-insert-table-dropdown-box-active-background:#c7e5ff}.ck .ck-insert-table-dropdown__grid{display:flex;flex-direction:row;flex-wrap:wrap;width:calc(var(--ck-insert-table-dropdown-box-width)*10 + var(--ck-insert-table-dropdown-box-margin)*20 + var(--ck-insert-table-dropdown-padding)*2);padding:var(--ck-insert-table-dropdown-padding) var(--ck-insert-table-dropdown-padding) 0}.ck .ck-insert-table-dropdown__label{text-align:center}.ck .ck-insert-table-dropdown-grid-box{width:var(--ck-insert-table-dropdown-box-width);height:var(--ck-insert-table-dropdown-box-height);margin:var(--ck-insert-table-dropdown-box-margin);border:1px solid var(--ck-insert-table-dropdown-box-border-color);border-radius:1px}.ck .ck-insert-table-dropdown-grid-box.ck-on{border-color:var(--ck-insert-table-dropdown-box-border-active-color);background:var(--ck-insert-table-dropdown-box-active-background)}\";},function(t,e,n){var i=n(116);\"string\"==typeof i&&(i=[[t.i,i,\"\"]]);var o={singleton:!0,hmr:!0,transform:void 0,insertInto:void 0};n(2)(i,o);i.locals&&(t.exports=i.locals);},function(t,e){t.exports=\".ck-content .table{margin:1em auto;display:table}.ck-content .table table{border-collapse:collapse;border-spacing:0;border:1px double #b3b3b3}.ck-content .table table td,.ck-content .table table th{min-width:2em;padding:.4em;border-color:#d9d9d9}.ck-content .table table th{font-weight:700;background:#fafafa}\";},function(t,e,n){\"use strict\";var _marked=/*#__PURE__*/_regeneratorRuntime().mark(Ya),_marked2=/*#__PURE__*/_regeneratorRuntime().mark($a);n.r(e);var i=n(4),o=i.a.Symbol,r=Object.prototype,s=r.hasOwnProperty,a=r.toString,c=o?o.toStringTag:void 0;var l=function l(t){var e=s.call(t,c),n=t[c];try{t[c]=void 0;var i=!0;}catch(t){}var o=a.call(t);return i&&(e?t[c]=n:delete t[c]),o;},d=Object.prototype.toString;var u=function u(t){return d.call(t);},h=\"[object Null]\",f=\"[object Undefined]\",m=o?o.toStringTag:void 0;var p=function p(t){return null==t?void 0===t?f:h:m&&m in Object(t)?l(t):u(t);};var g=function g(t,e){return function(n){return t(e(n));};},b=g(Object.getPrototypeOf,Object);var w=function w(t){return null!=t&&\"object\"==_typeof(t);},_=\"[object Object]\",k=Function.prototype,v=Object.prototype,y=k.toString,x=v.hasOwnProperty,A=y.call(Object);var C=function C(t){if(!w(t)||p(t)!=_)return!1;var e=b(t);if(null===e)return!0;var n=x.call(e,\"constructor\")&&e.constructor;return\"function\"==typeof n&&n instanceof n&&y.call(n)==A;};var T=function T(){this.__data__=[],this.size=0;};var P=function P(t,e){return t===e||t!=t&&e!=e;};var M=function M(t,e){for(var n=t.length;n--;)if(P(t[n][0],e))return n;return-1;},E=Array.prototype.splice;var S=function S(t){var e=this.__data__,n=M(e,t);return!(n<0||(n==e.length-1?e.pop():E.call(e,n,1),--this.size,0));};var I=function I(t){var e=this.__data__,n=M(e,t);return n<0?void 0:e[n][1];};var N=function N(t){return M(this.__data__,t)>-1;};var O=function O(t,e){var n=this.__data__,i=M(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this;};function R(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=Jt;},Zt={};Zt[\"[object Float32Array]\"]=Zt[\"[object Float64Array]\"]=Zt[\"[object Int8Array]\"]=Zt[\"[object Int16Array]\"]=Zt[\"[object Int32Array]\"]=Zt[\"[object Uint8Array]\"]=Zt[\"[object Uint8ClampedArray]\"]=Zt[\"[object Uint16Array]\"]=Zt[\"[object Uint32Array]\"]=!0,Zt[\"[object Arguments]\"]=Zt[\"[object Array]\"]=Zt[\"[object ArrayBuffer]\"]=Zt[\"[object Boolean]\"]=Zt[\"[object DataView]\"]=Zt[\"[object Date]\"]=Zt[\"[object Error]\"]=Zt[\"[object Function]\"]=Zt[\"[object Map]\"]=Zt[\"[object Number]\"]=Zt[\"[object Object]\"]=Zt[\"[object RegExp]\"]=Zt[\"[object Set]\"]=Zt[\"[object String]\"]=Zt[\"[object WeakMap]\"]=!1;var Xt=function Xt(t){return w(t)&&Kt(t.length)&&!!Zt[p(t)];};var te=function te(t){return function(e){return t(e);};},ee=n(5),ne=ee.a&&ee.a.isTypedArray,ie=ne?te(ne):Xt,oe=Object.prototype.hasOwnProperty;var re=function re(t,e){var n=Wt(t),i=!n&&qt(t),o=!n&&!i&&Object(Yt.a)(t),r=!n&&!i&&!o&&ie(t),s=n||i||o||r,a=s?Vt(t.length,String):[],c=a.length;for(var l in t)!e&&!oe.call(t,l)||s&&(\"length\"==l||o&&(\"offset\"==l||\"parent\"==l)||r&&(\"buffer\"==l||\"byteLength\"==l||\"byteOffset\"==l)||Qt(l,c))||a.push(l);return a;},se=Object.prototype;var ae=function ae(t){var e=t&&t.constructor;return t===(\"function\"==typeof e&&e.prototype||se);},ce=g(Object.keys,Object),le=Object.prototype.hasOwnProperty;var de=function de(t){if(!ae(t))return ce(t);var e=[];for(var n in Object(t))le.call(t,n)&&\"constructor\"!=n&&e.push(n);return e;};var ue=function ue(t){return null!=t&&Kt(t.length)&&!W(t);};var he=function he(t){return ue(t)?re(t):de(t);};var fe=function fe(t,e){return t&&jt(e,he(e),t);};var me=function me(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e;},pe=Object.prototype.hasOwnProperty;var ge=function ge(t){if(!z(t))return me(t);var e=ae(t),n=[];for(var i in t)(\"constructor\"!=i||!e&&pe.call(t,i))&&n.push(i);return n;};var be=function be(t){return ue(t)?re(t,!0):ge(t);};var we=function we(t,e){return t&&jt(e,be(e),t);},_e=n(19);var ke=function ke(t,e){var n=-1,i=t.length;for(e||(e=Array(i));++n3&&arguments[3]!==undefined?arguments[3]:!1;if(C(e))return void this._setObjectToTarget(t,e,i);var o=e.split(\".\");e=o.pop();var _iterator=_createForOfIteratorHelper(o),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var _e2=_step.value;C(t[_e2])||(t[_e2]={}),t=t[_e2];}}catch(err){_iterator.e(err);}finally{_iterator.f();}if(C(n))return C(t[e])||(t[e]={}),t=t[e],void this._setObjectToTarget(t,n,i);i&&void 0!==t[e]||(t[e]=n);}},{key:\"_getFromSource\",value:function _getFromSource(t,e){var n=e.split(\".\");e=n.pop();var _iterator2=_createForOfIteratorHelper(n),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _e3=_step2.value;if(!C(t[_e3])){t=null;break;}t=t[_e3];}}catch(err){_iterator2.e(err);}finally{_iterator2.f();}return t?function(t){return qn(t,$n);}(t[e]):void 0;}},{key:\"_setObjectToTarget\",value:function _setObjectToTarget(t,e,n){var _this2=this;Object.keys(e).forEach(function(i){_this2._setToTarget(t,i,e[i],n);});}}]);return Yn;}();function $n(t){return Wn(t)?t:void 0;}var Gn=n(0);var Qn=function Qn(){return function t(){t.called=!0;};};var Jn=/*#__PURE__*/_createClass(function Jn(t,e){_classCallCheck(this,Jn);this.source=t,this.name=e,this.path=[],this.stop=Qn(),this.off=Qn();});function Kn(){var t=\"e\";for(var _e4=0;_e4<8;_e4++)t+=Math.floor(65536*(1+Math.random())).toString(16).substring(1);return t;}var Zn={get:function get(t){return\"number\"!=typeof t?this[t]||this.normal:t;},highest:1e5,high:1e3,normal:0,low:-1e3,lowest:-1e5};var Xn=Symbol(\"listeningTo\"),ti=Symbol(\"emitterId\");var ei={on:function on(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};this.listenTo(this,t,e,n);},once:function once(t,e,n){var i=!1;this.listenTo(this,t,function(t){for(var _len=arguments.length,n=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){n[_key-1]=arguments[_key];}i||(i=!0,t.off(),e.call.apply(e,[this,t].concat(n)));},n);},off:function off(t,e){this.stopListening(this,t,e);},listenTo:function listenTo(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var o,r;this[Xn]||(this[Xn]={});var s=this[Xn];ii(t)||ni(t);var a=ii(t);(o=s[a])||(o=s[a]={emitter:t,callbacks:{}}),(r=o.callbacks[e])||(r=o.callbacks[e]=[]),r.push(n),function(t,e){var n=oi(t);if(n[e])return;var i=e,o=null;var r=[];for(;\"\"!==i&&!n[i];)n[i]={callbacks:[],childEvents:[]},r.push(n[i]),o&&n[i].childEvents.push(o),o=i,i=i.substr(0,i.lastIndexOf(\":\"));if(\"\"!==i){var _iterator3=_createForOfIteratorHelper(r),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _t2=_step3.value;_t2.callbacks=n[i].callbacks.slice();}}catch(err){_iterator3.e(err);}finally{_iterator3.f();}n[i].childEvents.push(o);}}(t,e);var c=ri(t,e),l=Zn.get(i.priority),d={callback:n,priority:l};var _iterator4=_createForOfIteratorHelper(c),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var _t3=_step4.value;var _e5=!1;for(var _n2=0;_n2<_t3.length;_n2++)if(_t3[_n2].priority-1?t(e,n.substr(0,n.lastIndexOf(\":\"))):null;return i.callbacks;}(this,i);for(var _len2=arguments.length,e=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){e[_key2-1]=arguments[_key2];}if(n.path.push(this),o){var _t4=[n].concat(e);o=Array.from(o);for(var _e6=0;_e61?_len4-1:0),_key4=1;_key4<_len4;_key4++){e[_key4-1]=arguments[_key4];}e.forEach(function(e){Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)).forEach(function(n){if(n in t.prototype)return;var i=Object.getOwnPropertyDescriptor(e,n);i.enumerable=!1,Object.defineProperty(t.prototype,n,i);});});}function li(t,e){var n=Math.min(t.length,e.length);for(var _i3=0;_i30&&arguments[0]!==undefined?arguments[0]:{includeSelf:!1,parentFirst:!1};var e=[];var n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?\"push\":\"unshift\"](n),n=n.parent;return e;}},{key:\"getCommonAncestor\",value:function getCommonAncestor(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=this.getAncestors(e),i=t.getAncestors(e);var o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1];}},{key:\"isBefore\",value:function isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;var e=this.getPath(),n=t.getPath(),i=li(e,n);switch(i){case\"prefix\":return!0;case\"extension\":return!1;default:return e[i]t.data.length)throw new Gn.b(\"view-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\");if(n<0||e+n>t.data.length)throw new Gn.b(\"view-textproxy-wrong-length: Given length value is incorrect.\");this.data=t.data.substring(e,e+n),this.offsetInText=e;}_createClass(mi,[{key:\"offsetSize\",get:function get(){return this.data.length;}},{key:\"isPartial\",get:function get(){return this.data.length!==this.textNode.data.length;}},{key:\"parent\",get:function get(){return this.textNode.parent;}},{key:\"root\",get:function get(){return this.textNode.root;}},{key:\"document\",get:function get(){return this.textNode.document;}},{key:\"is\",value:function is(t){return\"textProxy\"==t;}},{key:\"getAncestors\",value:function getAncestors(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{includeSelf:!1,parentFirst:!1};var e=[];var n=t.includeSelf?this.textNode:this.parent;for(;null!==n;)e[t.parentFirst?\"push\":\"unshift\"](n),n=n.parent;return e;}}]);return mi;}();function pi(t){var e=new Map();for(var _n4 in t)e.set(_n4,t[_n4]);return e;}function gi(t){return!(!t||!t[Symbol.iterator]);}var bi=/*#__PURE__*/function(){function bi(){_classCallCheck(this,bi);this._patterns=[],this.add.apply(this,arguments);}_createClass(bi,[{key:\"add\",value:function add(){for(var _len5=arguments.length,t=new Array(_len5),_key5=0;_key5<_len5;_key5++){t[_key5]=arguments[_key5];}for(var _i4=0,_t8=t;_i4<_t8.length;_i4++){var _e9=_t8[_i4];(\"string\"==typeof _e9||_e9 instanceof RegExp)&&(_e9={name:_e9}),_e9.classes&&(\"string\"==typeof _e9.classes||_e9.classes instanceof RegExp)&&(_e9.classes=[_e9.classes]),this._patterns.push(_e9);}}},{key:\"match\",value:function match(){for(var _len6=arguments.length,t=new Array(_len6),_key6=0;_key6<_len6;_key6++){t[_key6]=arguments[_key6];}for(var _i5=0,_t9=t;_i5<_t9.length;_i5++){var _e10=_t9[_i5];var _iterator7=_createForOfIteratorHelper(this._patterns),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _t10=_step7.value;var _n5=wi(_e10,_t10);if(_n5)return{element:_e10,pattern:_t10,match:_n5};}}catch(err){_iterator7.e(err);}finally{_iterator7.f();}}return null;}},{key:\"matchAll\",value:function matchAll(){var e=[];for(var _len7=arguments.length,t=new Array(_len7),_key7=0;_key7<_len7;_key7++){t[_key7]=arguments[_key7];}for(var _i6=0,_t11=t;_i6<_t11.length;_i6++){var _n6=_t11[_i6];var _iterator8=_createForOfIteratorHelper(this._patterns),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _t12=_step8.value;var _i7=wi(_n6,_t12);_i7&&e.push({element:_n6,pattern:_t12,match:_i7});}}catch(err){_iterator8.e(err);}finally{_iterator8.f();}}return e.length>0?e:null;}},{key:\"getElementName\",value:function getElementName(){if(1!==this._patterns.length)return null;var t=this._patterns[0],e=t.name;return\"function\"==typeof t||!e||e instanceof RegExp?null:e;}}]);return bi;}();function wi(t,e){if(\"function\"==typeof e)return e(t);var n={};return e.name&&(n.name=function(t,e){if(t instanceof RegExp)return t.test(e);return t===e;}(e.name,t.name),!n.name)?null:e.attributes&&(n.attributes=function(t,e){var n=[];for(var _i8 in t){var _o5=t[_i8];if(!e.hasAttribute(_i8))return null;{var _t13=e.getAttribute(_i8);if(!0===_o5)n.push(_i8);else if(_o5 instanceof RegExp){if(!_o5.test(_t13))return null;n.push(_i8);}else{if(_t13!==_o5)return null;n.push(_i8);}}}return n;}(e.attributes,t),!n.attributes)?null:!(e.classes&&(n.classes=function(t,e){var n=[];var _iterator9=_createForOfIteratorHelper(t),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _i9=_step9.value;if(_i9 instanceof RegExp){var _t14=e.getClassNames();var _iterator10=_createForOfIteratorHelper(_t14),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _e11=_step10.value;_i9.test(_e11)&&n.push(_e11);}}catch(err){_iterator10.e(err);}finally{_iterator10.f();}if(0===n.length)return null;}else{if(!e.hasClass(_i9))return null;n.push(_i9);}}}catch(err){_iterator9.e(err);}finally{_iterator9.f();}return n;}(e.classes,t),!n.classes))&&!(e.styles&&(n.styles=function(t,e){var n=[];for(var _i10 in t){var _o6=t[_i10];if(!e.hasStyle(_i10))return null;{var _t15=e.getStyle(_i10);if(_o6 instanceof RegExp){if(!_o6.test(_t15))return null;n.push(_i10);}else{if(_t15!==_o6)return null;n.push(_i10);}}}return n;}(e.styles,t),!n.styles))&&n;}var _i=/*#__PURE__*/function(_hi2){_inherits(_i,_hi2);var _super3=_createSuper(_i);function _i(t,e,n){var _this5;_classCallCheck(this,_i);if(_this5=_super3.call(this),_this5.name=t,_this5._attrs=function(t){t=C(t)?pi(t):new Map(t);var _iterator11=_createForOfIteratorHelper(t),_step11;try{for(_iterator11.s();!(_step11=_iterator11.n()).done;){var _step11$value=_slicedToArray(_step11.value,2),_e12=_step11$value[0],_n7=_step11$value[1];null===_n7?t[\"delete\"](_e12):\"string\"!=typeof _n7&&t.set(_e12,String(_n7));}}catch(err){_iterator11.e(err);}finally{_iterator11.f();}return t;}(e),_this5._children=[],n&&_this5._insertChild(0,n),_this5._classes=new Set(),_this5._attrs.has(\"class\")){var _t16=_this5._attrs.get(\"class\");vi(_this5._classes,_t16),_this5._attrs[\"delete\"](\"class\");}_this5._styles=new Map(),_this5._attrs.has(\"style\")&&(ki(_this5._styles,_this5._attrs.get(\"style\")),_this5._attrs[\"delete\"](\"style\")),_this5._customProperties=new Map();return _possibleConstructorReturn(_this5);}_createClass(_i,[{key:\"childCount\",get:function get(){return this._children.length;}},{key:\"isEmpty\",get:function get(){return 0===this._children.length;}},{key:\"is\",value:function is(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return e?\"element\"==t&&e==this.name:\"element\"==t||t==this.name||_get(_getPrototypeOf(_i.prototype),\"is\",this).call(this,t);}},{key:\"getChild\",value:function getChild(t){return this._children[t];}},{key:\"getChildIndex\",value:function getChildIndex(t){return this._children.indexOf(t);}},{key:\"getChildren\",value:function getChildren(){return this._children[Symbol.iterator]();}},{key:\"getAttributeKeys\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getAttributeKeys(){return _regeneratorRuntime().wrap(function getAttributeKeys$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.t0=this._classes.size>0;if(!_context.t0){_context.next=4;break;}_context.next=4;return\"class\";case 4:_context.t1=this._styles.size>0;if(!_context.t1){_context.next=8;break;}_context.next=8;return\"style\";case 8:return _context.delegateYield(this._attrs.keys(),\"t2\",9);case 9:case\"end\":return _context.stop();}},getAttributeKeys,this);})},{key:\"getAttributes\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getAttributes(){return _regeneratorRuntime().wrap(function getAttributes$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:return _context2.delegateYield(this._attrs.entries(),\"t0\",1);case 1:_context2.t1=this._classes.size>0;if(!_context2.t1){_context2.next=5;break;}_context2.next=5;return[\"class\",this.getAttribute(\"class\")];case 5:_context2.t2=this._styles.size>0;if(!_context2.t2){_context2.next=9;break;}_context2.next=9;return[\"style\",this.getAttribute(\"style\")];case 9:case\"end\":return _context2.stop();}},getAttributes,this);})},{key:\"getAttribute\",value:function getAttribute(t){if(\"class\"==t)return this._classes.size>0?_toConsumableArray(this._classes).join(\" \"):void 0;if(\"style\"!=t)return this._attrs.get(t);if(this._styles.size>0){var _t17=\"\";var _iterator12=_createForOfIteratorHelper(this._styles),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var _step12$value=_slicedToArray(_step12.value,2),_e13=_step12$value[0],_n8=_step12$value[1];_t17+=\"\".concat(_e13,\":\").concat(_n8,\";\");}}catch(err){_iterator12.e(err);}finally{_iterator12.f();}return _t17;}}},{key:\"hasAttribute\",value:function hasAttribute(t){return\"class\"==t?this._classes.size>0:\"style\"==t?this._styles.size>0:this._attrs.has(t);}},{key:\"isSimilar\",value:function isSimilar(t){if(!(t instanceof _i))return!1;if(this===t)return!0;if(this.name!=t.name)return!1;if(this._attrs.size!==t._attrs.size||this._classes.size!==t._classes.size||this._styles.size!==t._styles.size)return!1;var _iterator13=_createForOfIteratorHelper(this._attrs),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var _step13$value=_slicedToArray(_step13.value,2),_e14=_step13$value[0],_n9=_step13$value[1];if(!t._attrs.has(_e14)||t._attrs.get(_e14)!==_n9)return!1;}}catch(err){_iterator13.e(err);}finally{_iterator13.f();}var _iterator14=_createForOfIteratorHelper(this._classes),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var _e15=_step14.value;if(!t._classes.has(_e15))return!1;}}catch(err){_iterator14.e(err);}finally{_iterator14.f();}var _iterator15=_createForOfIteratorHelper(this._styles),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var _step15$value=_slicedToArray(_step15.value,2),_e16=_step15$value[0],_n10=_step15$value[1];if(!t._styles.has(_e16)||t._styles.get(_e16)!==_n10)return!1;}}catch(err){_iterator15.e(err);}finally{_iterator15.f();}return!0;}},{key:\"hasClass\",value:function hasClass(){for(var _len8=arguments.length,t=new Array(_len8),_key8=0;_key8<_len8;_key8++){t[_key8]=arguments[_key8];}for(var _i11=0,_t18=t;_i11<_t18.length;_i11++){var _e17=_t18[_i11];if(!this._classes.has(_e17))return!1;}return!0;}},{key:\"getClassNames\",value:function getClassNames(){return this._classes.keys();}},{key:\"getStyle\",value:function getStyle(t){return this._styles.get(t);}},{key:\"getStyleNames\",value:function getStyleNames(){return this._styles.keys();}},{key:\"hasStyle\",value:function hasStyle(){for(var _len9=arguments.length,t=new Array(_len9),_key9=0;_key9<_len9;_key9++){t[_key9]=arguments[_key9];}for(var _i12=0,_t19=t;_i12<_t19.length;_i12++){var _e18=_t19[_i12];if(!this._styles.has(_e18))return!1;}return!0;}},{key:\"findAncestor\",value:function findAncestor(){for(var _len10=arguments.length,t=new Array(_len10),_key10=0;_key10<_len10;_key10++){t[_key10]=arguments[_key10];}var e=_construct(bi,t);var n=this.parent;for(;n;){if(e.match(n))return n;n=n.parent;}return null;}},{key:\"getCustomProperty\",value:function getCustomProperty(t){return this._customProperties.get(t);}},{key:\"getCustomProperties\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getCustomProperties(){return _regeneratorRuntime().wrap(function getCustomProperties$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:return _context3.delegateYield(this._customProperties.entries(),\"t0\",1);case 1:case\"end\":return _context3.stop();}},getCustomProperties,this);})},{key:\"getIdentity\",value:function getIdentity(){var t=Array.from(this._classes).sort().join(\",\"),e=Array.from(this._styles).map(function(t){return\"\".concat(t[0],\":\").concat(t[1]);}).sort().join(\";\"),n=Array.from(this._attrs).map(function(t){return\"\".concat(t[0],\"=\\\"\").concat(t[1],\"\\\"\");}).sort().join(\" \");return this.name+(\"\"==t?\"\":\" class=\\\"\".concat(t,\"\\\"\"))+(\"\"==e?\"\":\" style=\\\"\".concat(e,\"\\\"\"))+(\"\"==n?\"\":\" \".concat(n));}},{key:\"_clone\",value:function _clone(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var e=[];if(t){var _iterator16=_createForOfIteratorHelper(this.getChildren()),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var _n11=_step16.value;e.push(_n11._clone(t));}}catch(err){_iterator16.e(err);}finally{_iterator16.f();}}var n=new this.constructor(this.name,this._attrs,e);return n._classes=new Set(this._classes),n._styles=new Map(this._styles),n._customProperties=new Map(this._customProperties),n.getFillerOffset=this.getFillerOffset,n;}},{key:\"_appendChild\",value:function _appendChild(t){return this._insertChild(this.childCount,t);}},{key:\"_insertChild\",value:function _insertChild(t,e){this._fireChange(\"children\",this);var n=0;var i=function(t){if(\"string\"==typeof t)return[new fi(t)];gi(t)||(t=[t]);return Array.from(t).map(function(t){return\"string\"==typeof t?new fi(t):t instanceof mi?new fi(t.data):t;});}(e);var _iterator17=_createForOfIteratorHelper(i),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _e19=_step17.value;null!==_e19.parent&&_e19._remove(),_e19.parent=this,this._children.splice(t,0,_e19),t++,n++;}}catch(err){_iterator17.e(err);}finally{_iterator17.f();}return n;}},{key:\"_removeChildren\",value:function _removeChildren(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;this._fireChange(\"children\",this);for(var _n12=t;_n120&&(this._classes.clear(),!0):\"style\"==t?this._styles.size>0&&(this._styles.clear(),!0):this._attrs[\"delete\"](t);}},{key:\"_addClass\",value:function _addClass(t){var _this6=this;this._fireChange(\"attributes\",this),(t=Array.isArray(t)?t:[t]).forEach(function(t){return _this6._classes.add(t);});}},{key:\"_removeClass\",value:function _removeClass(t){var _this7=this;this._fireChange(\"attributes\",this),(t=Array.isArray(t)?t:[t]).forEach(function(t){return _this7._classes[\"delete\"](t);});}},{key:\"_setStyle\",value:function _setStyle(t,e){if(this._fireChange(\"attributes\",this),C(t)){var _e20=Object.keys(t);for(var _i13=0,_e21=_e20;_i13<_e21.length;_i13++){var _n13=_e21[_i13];this._styles.set(_n13,t[_n13]);}}else this._styles.set(t,e);}},{key:\"_removeStyle\",value:function _removeStyle(t){var _this8=this;this._fireChange(\"attributes\",this),(t=Array.isArray(t)?t:[t]).forEach(function(t){return _this8._styles[\"delete\"](t);});}},{key:\"_setCustomProperty\",value:function _setCustomProperty(t,e){this._customProperties.set(t,e);}},{key:\"_removeCustomProperty\",value:function _removeCustomProperty(t){return this._customProperties[\"delete\"](t);}}]);return _i;}(hi);function ki(t,e){var n=null,i=0,o=0,r=null;if(t.clear(),\"\"!==e){\";\"!=e.charAt(e.length-1)&&(e+=\";\");for(var _s2=0;_s21&&arguments[1]!==undefined?arguments[1]:null;return e?\"containerElement\"==t&&e==this.name||_get(_getPrototypeOf(yi.prototype),\"is\",this).call(this,t,e):\"containerElement\"==t||_get(_getPrototypeOf(yi.prototype),\"is\",this).call(this,t);}}]);return yi;}(_i);function xi(){var t=_toConsumableArray(this.getChildren()),e=t[this.childCount-1];if(e&&e.is(\"element\",\"br\"))return this.childCount;var _iterator18=_createForOfIteratorHelper(t),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var _e22=_step18.value;if(!_e22.is(\"uiElement\"))return null;}}catch(err){_iterator18.e(err);}finally{_iterator18.f();}return this.childCount;}var Ai=function Ai(t){return t;};var Ci=function Ci(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2]);}return t.apply(e,n);},Ti=Math.max;var Pi=function Pi(t,e,n){return e=Ti(void 0===e?t.length-1:e,0),function(){for(var i=arguments,o=-1,r=Ti(i.length-e,0),s=Array(r);++o0){if(++e>=Si)return arguments[0];}else e=0;return t.apply(void 0,arguments);};}(Ei);var Ri=function Ri(t,e){return Oi(Pi(t,e,Ai),t+\"\");};var Di=function Di(t,e,n){if(!z(n))return!1;var i=_typeof(e);return!!(\"number\"==i?ue(n)&&Qt(e,n.length):\"string\"==i&&e in n)&&P(n[e],t);};var Li=function(t){return Ri(function(e,n){var i=-1,o=n.length,r=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(r=t.length>3&&\"function\"==typeof r?(o--,r):void 0,s&&Di(n[0],n[1],s)&&(r=o<3?void 0:r,o=1),e=Object(e);++i1)throw new Gn.b(\"observable-bind-to-no-callback: Binding multiple observables only possible with callback.\");if(i>1&&e.callback)throw new Gn.b(\"observable-bind-to-extra-callback: Cannot bind multiple properties and use a callback in one binding.\");e.to.forEach(function(t){if(t.properties.length&&t.properties.length!==i)throw new Gn.b(\"observable-bind-to-properties-length: The number of properties must match.\");t.properties.length||(t.properties=_this13._bindProperties);}),this._to=e.to,e.callback&&(this._bindings.get(n[0]).callback=e.callback),function(t,e){e.forEach(function(e){var n=t[Vi];var i;n.get(e.observable)||t.listenTo(e.observable,\"change\",function(o,r){(i=n.get(e.observable)[r])&&i.forEach(function(e){Yi(t,e.property);});});});}(this._observable,this._to),function(t){var e;t._bindings.forEach(function(n,i){t._to.forEach(function(o){e=o.properties[n.callback?0:t._bindProperties.indexOf(i)],n.to.push([o.observable,e]),function(t,e,n,i){var o=t[Vi],r=o.get(n),s=r||{};s[i]||(s[i]=new Set());s[i].add(e),r||o.set(n,s);}(t._observable,n,o.observable,e);});});}(this),this._bindProperties.forEach(function(t){Yi(_this13._observable,t);});}function qi(t,e,n){if(this._bindings.size>1)throw new Gn.b(\"observable-bind-to-many-not-one-binding: Cannot bind multiple properties with toMany().\");this.to.apply(this,_toConsumableArray(function(t,e){var n=t.map(function(t){return[t,e];});return Array.prototype.concat.apply([],n);}(t,e)).concat([n]));}function Wi(t){return t.every(function(t){return\"string\"==typeof t;});}function Yi(t,e){var n=t[Bi].get(e);var i;i=n.callback?n.callback.apply(t,n.to.map(function(t){return t[0][t[1]];})):(i=n.to[0])[0][i[1]],t.hasOwnProperty(e)?t[e]=i:t.set(e,i);}var $i=Symbol(\"document\");var Gi=/*#__PURE__*/function(_yi){_inherits(Gi,_yi);var _super5=_createSuper(Gi);function Gi(t,e,n){var _this14;_classCallCheck(this,Gi);_this14=_super5.call(this,t,e,n),_this14.set(\"isReadOnly\",!1),_this14.set(\"isFocused\",!1);return _this14;}_createClass(Gi,[{key:\"is\",value:function is(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return e?\"editableElement\"==t&&e==this.name||_get(_getPrototypeOf(Gi.prototype),\"is\",this).call(this,t,e):\"editableElement\"==t||_get(_getPrototypeOf(Gi.prototype),\"is\",this).call(this,t);}},{key:\"destroy\",value:function destroy(){this.stopListening();}},{key:\"document\",get:function get(){return this.getCustomProperty($i);}},{key:\"_document\",set:function set(t){var _this15=this;if(this.getCustomProperty($i))throw new Gn.b(\"view-editableelement-document-already-set: View document is already set.\");this._setCustomProperty($i,t),this.bind(\"isReadOnly\").to(t),this.bind(\"isFocused\").to(t,\"isFocused\",function(e){return e&&t.selection.editableElement==_this15;}),this.listenTo(t.selection,\"change\",function(){_this15.isFocused=t.isFocused&&t.selection.editableElement==_this15;});}}]);return Gi;}(yi);ci(Gi,Fi);var Qi=Symbol(\"rootName\");var Ji=/*#__PURE__*/function(_Gi){_inherits(Ji,_Gi);var _super6=_createSuper(Ji);function Ji(t){var _this16;_classCallCheck(this,Ji);_this16=_super6.call(this,t),_this16.rootName=\"main\";return _this16;}_createClass(Ji,[{key:\"is\",value:function is(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return e?\"rootElement\"==t&&e==this.name||_get(_getPrototypeOf(Ji.prototype),\"is\",this).call(this,t,e):\"rootElement\"==t||_get(_getPrototypeOf(Ji.prototype),\"is\",this).call(this,t);}},{key:\"rootName\",get:function get(){return this.getCustomProperty(Qi);},set:function set(t){this._setCustomProperty(Qi,t);}},{key:\"_name\",set:function set(t){this.name=t;}}]);return Ji;}(Gi);var Ki=/*#__PURE__*/function(_Symbol$iterator){function Ki(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Ki);if(!t.boundaries&&!t.startPosition)throw new Gn.b(\"view-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.\");if(t.direction&&\"forward\"!=t.direction&&\"backward\"!=t.direction)throw new Gn.b(\"view-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.\",{direction:t.direction});this.boundaries=t.boundaries||null,t.startPosition?this.position=Zi._createAt(t.startPosition):this.position=Zi._createAt(t.boundaries[\"backward\"==t.direction?\"end\":\"start\"]),this.direction=t.direction||\"forward\",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null;}_createClass(Ki,[{key:_Symbol$iterator,value:function value(){return this;}},{key:\"skip\",value:function skip(t){var e,n,i;do{var _this$next;i=this.position,(_this$next=this.next(),e=_this$next.done,n=_this$next.value);}while(!e&&t(n));e||(this.position=i);}},{key:\"next\",value:function next(){return\"forward\"==this.direction?this._next():this._previous();}},{key:\"_next\",value:function _next(){var t=this.position.clone();var e=this.position,n=t.parent;if(null===n.parent&&t.offset===n.childCount)return{done:!0};if(n===this._boundaryEndParent&&t.offset==this.boundaries.end.offset)return{done:!0};var i;if(n instanceof fi){if(t.isAtEnd)return this.position=Zi._createAfter(n),this._next();i=n.data[t.offset];}else i=n.getChild(t.offset);if(i instanceof _i)return this.shallow?t.offset++:t=new Zi(i,0),this.position=t,this._formatReturnValue(\"elementStart\",i,e,t,1);if(i instanceof fi){if(this.singleCharacters)return t=new Zi(i,0),this.position=t,this._next();{var _n15,_o7=i.data.length;return i==this._boundaryEndParent?(_o7=this.boundaries.end.offset,_n15=new mi(i,0,_o7),t=Zi._createAfter(_n15)):(_n15=new mi(i,0,i.data.length),t.offset++),this.position=t,this._formatReturnValue(\"text\",_n15,e,t,_o7);}}if(\"string\"==typeof i){var _i15;if(this.singleCharacters)_i15=1;else{_i15=(n===this._boundaryEndParent?this.boundaries.end.offset:n.data.length)-t.offset;}var _o8=new mi(n,t.offset,_i15);return t.offset+=_i15,this.position=t,this._formatReturnValue(\"text\",_o8,e,t,_i15);}return t=Zi._createAfter(n),this.position=t,this.ignoreElementEnd?this._next():this._formatReturnValue(\"elementEnd\",n,e,t);}},{key:\"_previous\",value:function _previous(){var t=this.position.clone();var e=this.position,n=t.parent;if(null===n.parent&&0===t.offset)return{done:!0};if(n==this._boundaryStartParent&&t.offset==this.boundaries.start.offset)return{done:!0};var i;if(n instanceof fi){if(t.isAtStart)return this.position=Zi._createBefore(n),this._previous();i=n.data[t.offset-1];}else i=n.getChild(t.offset-1);if(i instanceof _i)return this.shallow?(t.offset--,this.position=t,this._formatReturnValue(\"elementStart\",i,e,t,1)):(t=new Zi(i,i.childCount),this.position=t,this.ignoreElementEnd?this._previous():this._formatReturnValue(\"elementEnd\",i,e,t));if(i instanceof fi){if(this.singleCharacters)return t=new Zi(i,i.data.length),this.position=t,this._previous();{var _n16,_o9=i.data.length;if(i==this._boundaryStartParent){var _e23=this.boundaries.start.offset;_o9=(_n16=new mi(i,_e23,i.data.length-_e23)).data.length,t=Zi._createBefore(_n16);}else _n16=new mi(i,0,i.data.length),t.offset--;return this.position=t,this._formatReturnValue(\"text\",_n16,e,t,_o9);}}if(\"string\"==typeof i){var _i16;if(this.singleCharacters)_i16=1;else{var _e24=n===this._boundaryStartParent?this.boundaries.start.offset:0;_i16=t.offset-_e24;}t.offset-=_i16;var _o10=new mi(n,t.offset,_i16);return this.position=t,this._formatReturnValue(\"text\",_o10,e,t,_i16);}return t=Zi._createBefore(n),this.position=t,this._formatReturnValue(\"elementStart\",n,e,t,1);}},{key:\"_formatReturnValue\",value:function _formatReturnValue(t,e,n,i,o){return e instanceof mi&&(e.offsetInText+e.data.length==e.textNode.data.length&&(\"forward\"!=this.direction||this.boundaries&&this.boundaries.end.isEqual(this.position)?n=Zi._createAfter(e.textNode):(i=Zi._createAfter(e.textNode),this.position=i)),0===e.offsetInText&&(\"backward\"!=this.direction||this.boundaries&&this.boundaries.start.isEqual(this.position)?n=Zi._createBefore(e.textNode):(i=Zi._createBefore(e.textNode),this.position=i))),{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:o}};}}]);return Ki;}(Symbol.iterator);var Zi=/*#__PURE__*/function(){function Zi(t,e){_classCallCheck(this,Zi);this.parent=t,this.offset=e;}_createClass(Zi,[{key:\"nodeAfter\",get:function get(){return this.parent.is(\"text\")?null:this.parent.getChild(this.offset)||null;}},{key:\"nodeBefore\",get:function get(){return this.parent.is(\"text\")?null:this.parent.getChild(this.offset-1)||null;}},{key:\"isAtStart\",get:function get(){return 0===this.offset;}},{key:\"isAtEnd\",get:function get(){var t=this.parent.is(\"text\")?this.parent.data.length:this.parent.childCount;return this.offset===t;}},{key:\"root\",get:function get(){return this.parent.root;}},{key:\"editableElement\",get:function get(){var t=this.parent;for(;!(t instanceof Gi);){if(!t.parent)return null;t=t.parent;}return t;}},{key:\"getShiftedBy\",value:function getShiftedBy(t){var e=Zi._createAt(this),n=e.offset+t;return e.offset=n<0?0:n,e;}},{key:\"getLastMatchingPosition\",value:function getLastMatchingPosition(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};e.startPosition=this;var n=new Ki(e);return n.skip(t),n.position;}},{key:\"getAncestors\",value:function getAncestors(){return this.parent.is(\"documentFragment\")?[this.parent]:this.parent.getAncestors({includeSelf:!0});}},{key:\"getCommonAncestor\",value:function getCommonAncestor(t){var e=this.getAncestors(),n=t.getAncestors();var i=0;for(;e[i]==n[i]&&e[i];)i++;return 0===i?null:e[i-1];}},{key:\"isEqual\",value:function isEqual(t){return this.parent==t.parent&&this.offset==t.offset;}},{key:\"isBefore\",value:function isBefore(t){return\"before\"==this.compareWith(t);}},{key:\"isAfter\",value:function isAfter(t){return\"after\"==this.compareWith(t);}},{key:\"compareWith\",value:function compareWith(t){if(this.root!==t.root)return\"different\";if(this.isEqual(t))return\"same\";var e=this.parent.is(\"node\")?this.parent.getPath():[],n=t.parent.is(\"node\")?t.parent.getPath():[];e.push(this.offset),n.push(t.offset);var i=li(e,n);switch(i){case\"prefix\":return\"before\";case\"extension\":return\"after\";default:return e[i]0&&arguments[0]!==undefined?arguments[0]:{};return t.startPosition=this,new Ki(t);}},{key:\"clone\",value:function clone(){return new Zi(this.parent,this.offset);}}],[{key:\"_createAt\",value:function _createAt(t,e){if(t instanceof Zi)return new this(t.parent,t.offset);{var _n17=t;if(\"end\"==e)e=_n17.is(\"text\")?_n17.data.length:_n17.childCount;else{if(\"before\"==e)return this._createBefore(_n17);if(\"after\"==e)return this._createAfter(_n17);if(0!==e&&!e)throw new Gn.b(\"view-createPositionAt-offset-required: View#createPositionAt() requires the offset when the first parameter is a view item.\");}return new Zi(_n17,e);}}},{key:\"_createAfter\",value:function _createAfter(t){if(t.is(\"textProxy\"))return new Zi(t.textNode,t.offsetInText+t.data.length);if(!t.parent)throw new Gn.b(\"view-position-after-root: You can not make position after root.\",{root:t});return new Zi(t.parent,t.index+1);}},{key:\"_createBefore\",value:function _createBefore(t){if(t.is(\"textProxy\"))return new Zi(t.textNode,t.offsetInText);if(!t.parent)throw new Gn.b(\"view-position-before-root: You can not make position before root.\",{root:t});return new Zi(t.parent,t.index);}}]);return Zi;}();var Xi=/*#__PURE__*/function(_Symbol$iterator2){function Xi(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,Xi);this.start=t.clone(),this.end=e?e.clone():t.clone();}_createClass(Xi,[{key:_Symbol$iterator2,value:/*#__PURE__*/_regeneratorRuntime().mark(function value(){return _regeneratorRuntime().wrap(function value$(_context4){while(1)switch(_context4.prev=_context4.next){case 0:return _context4.delegateYield(new Ki({boundaries:this,ignoreElementEnd:!0}),\"t0\",1);case 1:case\"end\":return _context4.stop();}},value,this);})},{key:\"isCollapsed\",get:function get(){return this.start.isEqual(this.end);}},{key:\"isFlat\",get:function get(){return this.start.parent===this.end.parent;}},{key:\"root\",get:function get(){return this.start.root;}},{key:\"getEnlarged\",value:function getEnlarged(){var t=this.start.getLastMatchingPosition(to,{direction:\"backward\"}),e=this.end.getLastMatchingPosition(to);return t.parent.is(\"text\")&&t.isAtStart&&(t=Zi._createBefore(t.parent)),e.parent.is(\"text\")&&e.isAtEnd&&(e=Zi._createAfter(e.parent)),new Xi(t,e);}},{key:\"getTrimmed\",value:function getTrimmed(){var t=this.start.getLastMatchingPosition(to);if(t.isAfter(this.end)||t.isEqual(this.end))return new Xi(t,t);var e=this.end.getLastMatchingPosition(to,{direction:\"backward\"});var n=t.nodeAfter,i=e.nodeBefore;return n&&n.is(\"text\")&&(t=new Zi(n,0)),i&&i.is(\"text\")&&(e=new Zi(i,i.data.length)),new Xi(t,e);}},{key:\"isEqual\",value:function isEqual(t){return this==t||this.start.isEqual(t.start)&&this.end.isEqual(t.end);}},{key:\"containsPosition\",value:function containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end);}},{key:\"containsRange\",value:function containsRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;t.isCollapsed&&(e=!1);var n=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),i=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return n&&i;}},{key:\"getDifference\",value:function getDifference(t){var e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new Xi(this.start,t.start)),this.containsPosition(t.end)&&e.push(new Xi(t.end,this.end))):e.push(this.clone()),e;}},{key:\"getIntersection\",value:function getIntersection(t){if(this.isIntersecting(t)){var _e25=this.start,_n18=this.end;return this.containsPosition(t.start)&&(_e25=t.start),this.containsPosition(t.end)&&(_n18=t.end),new Xi(_e25,_n18);}return null;}},{key:\"getWalker\",value:function getWalker(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return t.boundaries=this,new Ki(t);}},{key:\"getCommonAncestor\",value:function getCommonAncestor(){return this.start.getCommonAncestor(this.end);}},{key:\"clone\",value:function clone(){return new Xi(this.start,this.end);}},{key:\"getItems\",value:function getItems(){var _this17=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var e,_iterator19,_step19,_t20;return _regeneratorRuntime().wrap(function _callee$(_context5){while(1)switch(_context5.prev=_context5.next){case 0:t.boundaries=_this17,t.ignoreElementEnd=!0;e=new Ki(t);_iterator19=_createForOfIteratorHelper(e);_context5.prev=3;_iterator19.s();case 5:if((_step19=_iterator19.n()).done){_context5.next=11;break;}_t20=_step19.value;_context5.next=9;return _t20.item;case 9:_context5.next=5;break;case 11:_context5.next=16;break;case 13:_context5.prev=13;_context5.t0=_context5[\"catch\"](3);_iterator19.e(_context5.t0);case 16:_context5.prev=16;_iterator19.f();return _context5.finish(16);case 19:case\"end\":return _context5.stop();}},_callee,null,[[3,13,16,19]]);})();}},{key:\"getPositions\",value:function getPositions(){var _this18=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var e,_iterator20,_step20,_t21;return _regeneratorRuntime().wrap(function _callee2$(_context6){while(1)switch(_context6.prev=_context6.next){case 0:t.boundaries=_this18;e=new Ki(t);_context6.next=4;return e.position;case 4:_iterator20=_createForOfIteratorHelper(e);_context6.prev=5;_iterator20.s();case 7:if((_step20=_iterator20.n()).done){_context6.next=13;break;}_t21=_step20.value;_context6.next=11;return _t21.nextPosition;case 11:_context6.next=7;break;case 13:_context6.next=18;break;case 15:_context6.prev=15;_context6.t0=_context6[\"catch\"](5);_iterator20.e(_context6.t0);case 18:_context6.prev=18;_iterator20.f();return _context6.finish(18);case 21:case\"end\":return _context6.stop();}},_callee2,null,[[5,15,18,21]]);})();}},{key:\"isIntersecting\",value:function isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start);}}],[{key:\"_createFromParentsAndOffsets\",value:function _createFromParentsAndOffsets(t,e,n,i){return new this(new Zi(t,e),new Zi(n,i));}},{key:\"_createFromPositionAndShift\",value:function _createFromPositionAndShift(t,e){var n=t,i=t.getShiftedBy(e);return e>0?new this(n,i):new this(i,n);}},{key:\"_createIn\",value:function _createIn(t){return this._createFromParentsAndOffsets(t,0,t,t.childCount);}},{key:\"_createOn\",value:function _createOn(t){var e=t.is(\"textProxy\")?t.offsetSize:1;return this._createFromPositionAndShift(Zi._createBefore(t),e);}}]);return Xi;}(Symbol.iterator);function to(t){return!(!t.item.is(\"attributeElement\")&&!t.item.is(\"uiElement\"));}function eo(t){var e=0;var _iterator21=_createForOfIteratorHelper(t),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var _n19=_step21.value;e++;}}catch(err){_iterator21.e(err);}finally{_iterator21.f();}return e;}var no=/*#__PURE__*/function(){function no(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var e=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;_classCallCheck(this,no);this._ranges=[],this._lastRangeBackward=!1,this._isFake=!1,this._fakeSelectionLabel=\"\",this.setTo(t,e,n);}_createClass(no,[{key:\"isFake\",get:function get(){return this._isFake;}},{key:\"fakeSelectionLabel\",get:function get(){return this._fakeSelectionLabel;}},{key:\"anchor\",get:function get(){if(!this._ranges.length)return null;var t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.end:t.start).clone();}},{key:\"focus\",get:function get(){if(!this._ranges.length)return null;var t=this._ranges[this._ranges.length-1];return(this._lastRangeBackward?t.start:t.end).clone();}},{key:\"isCollapsed\",get:function get(){return 1===this.rangeCount&&this._ranges[0].isCollapsed;}},{key:\"rangeCount\",get:function get(){return this._ranges.length;}},{key:\"isBackward\",get:function get(){return!this.isCollapsed&&this._lastRangeBackward;}},{key:\"editableElement\",get:function get(){return this.anchor?this.anchor.editableElement:null;}},{key:\"getRanges\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getRanges(){var _iterator22,_step22,_t22;return _regeneratorRuntime().wrap(function getRanges$(_context7){while(1)switch(_context7.prev=_context7.next){case 0:_iterator22=_createForOfIteratorHelper(this._ranges);_context7.prev=1;_iterator22.s();case 3:if((_step22=_iterator22.n()).done){_context7.next=9;break;}_t22=_step22.value;_context7.next=7;return _t22.clone();case 7:_context7.next=3;break;case 9:_context7.next=14;break;case 11:_context7.prev=11;_context7.t0=_context7[\"catch\"](1);_iterator22.e(_context7.t0);case 14:_context7.prev=14;_iterator22.f();return _context7.finish(14);case 17:case\"end\":return _context7.stop();}},getRanges,this,[[1,11,14,17]]);})},{key:\"getFirstRange\",value:function getFirstRange(){var t=null;var _iterator23=_createForOfIteratorHelper(this._ranges),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _e26=_step23.value;t&&!_e26.start.isBefore(t.start)||(t=_e26);}}catch(err){_iterator23.e(err);}finally{_iterator23.f();}return t?t.clone():null;}},{key:\"getLastRange\",value:function getLastRange(){var t=null;var _iterator24=_createForOfIteratorHelper(this._ranges),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _e27=_step24.value;t&&!_e27.end.isAfter(t.end)||(t=_e27);}}catch(err){_iterator24.e(err);}finally{_iterator24.f();}return t?t.clone():null;}},{key:\"getFirstPosition\",value:function getFirstPosition(){var t=this.getFirstRange();return t?t.start.clone():null;}},{key:\"getLastPosition\",value:function getLastPosition(){var t=this.getLastRange();return t?t.end.clone():null;}},{key:\"isEqual\",value:function isEqual(t){if(this.isFake!=t.isFake)return!1;if(this.isFake&&this.fakeSelectionLabel!=t.fakeSelectionLabel)return!1;if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;var _iterator25=_createForOfIteratorHelper(this._ranges),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _e28=_step25.value;var _n20=!1;var _iterator26=_createForOfIteratorHelper(t._ranges),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var _i17=_step26.value;if(_e28.isEqual(_i17)){_n20=!0;break;}}}catch(err){_iterator26.e(err);}finally{_iterator26.f();}if(!_n20)return!1;}}catch(err){_iterator25.e(err);}finally{_iterator25.f();}return!0;}},{key:\"isSimilar\",value:function isSimilar(t){if(this.isBackward!=t.isBackward)return!1;var e=eo(this.getRanges());if(e!=eo(t.getRanges()))return!1;if(0==e)return!0;var _iterator27=_createForOfIteratorHelper(this.getRanges()),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var _e29=_step27.value;_e29=_e29.getTrimmed();var _n21=!1;var _iterator28=_createForOfIteratorHelper(t.getRanges()),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var _i18=_step28.value;if(_i18=_i18.getTrimmed(),_e29.start.isEqual(_i18.start)&&_e29.end.isEqual(_i18.end)){_n21=!0;break;}}}catch(err){_iterator28.e(err);}finally{_iterator28.f();}if(!_n21)return!1;}}catch(err){_iterator27.e(err);}finally{_iterator27.f();}return!0;}},{key:\"getSelectedElement\",value:function getSelectedElement(){if(1!==this.rangeCount)return null;var t=this.getFirstRange();var e=t.start.nodeAfter,n=t.end.nodeBefore;return t.start.parent.is(\"text\")&&t.start.isAtEnd&&t.start.parent.nextSibling&&(e=t.start.parent.nextSibling),t.end.parent.is(\"text\")&&t.end.isAtStart&&t.end.parent.previousSibling&&(n=t.end.parent.previousSibling),e instanceof _i&&e==n?e:null;}},{key:\"setTo\",value:function setTo(t,e,n){if(null===t)this._setRanges([]),this._setFakeOptions(e);else if(t instanceof no||t instanceof io)this._setRanges(t.getRanges(),t.isBackward),this._setFakeOptions({fake:t.isFake,label:t.fakeSelectionLabel});else if(t instanceof Xi)this._setRanges([t],e&&e.backward),this._setFakeOptions(e);else if(t instanceof Zi)this._setRanges([new Xi(t)]),this._setFakeOptions(e);else if(t instanceof hi){var _i19=!!n&&!!n.backward;var _o11;if(void 0===e)throw new Gn.b(\"view-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.\");_o11=\"in\"==e?Xi._createIn(t):\"on\"==e?Xi._createOn(t):new Xi(Zi._createAt(t,e)),this._setRanges([_o11],_i19),this._setFakeOptions(n);}else{if(!gi(t))throw new Gn.b(\"view-selection-setTo-not-selectable: Cannot set selection to given place.\");this._setRanges(t,e&&e.backward),this._setFakeOptions(e);}this.fire(\"change\");}},{key:\"setFocus\",value:function setFocus(t,e){if(null===this.anchor)throw new Gn.b(\"view-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\");var n=Zi._createAt(t,e);if(\"same\"==n.compareWith(this.focus))return;var i=this.anchor;this._ranges.pop(),\"before\"==n.compareWith(i)?this._addRange(new Xi(n,i),!0):this._addRange(new Xi(i,n)),this.fire(\"change\");}},{key:\"is\",value:function is(t){return\"selection\"==t;}},{key:\"_setRanges\",value:function _setRanges(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;t=Array.from(t),this._ranges=[];var _iterator29=_createForOfIteratorHelper(t),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _e30=_step29.value;this._addRange(_e30);}}catch(err){_iterator29.e(err);}finally{_iterator29.f();}this._lastRangeBackward=!!e;}},{key:\"_setFakeOptions\",value:function _setFakeOptions(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};this._isFake=!!t.fake,this._fakeSelectionLabel=t.fake&&t.label||\"\";}},{key:\"_addRange\",value:function _addRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;if(!(t instanceof Xi))throw new Gn.b(\"view-selection-add-range-not-range: Selection range set to an object that is not an instance of view.Range\");this._pushRange(t),this._lastRangeBackward=!!e;}},{key:\"_pushRange\",value:function _pushRange(t){var _iterator30=_createForOfIteratorHelper(this._ranges),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _e31=_step30.value;if(t.isIntersecting(_e31))throw new Gn.b(\"view-selection-range-intersects: Trying to add a range that intersects with another range from selection.\",{addedRange:t,intersectingRange:_e31});}}catch(err){_iterator30.e(err);}finally{_iterator30.f();}this._ranges.push(new Xi(t.start,t.end));}}]);return no;}();ci(no,ei);var io=/*#__PURE__*/function(){function io(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:null;var e=arguments.length>1?arguments[1]:undefined;var n=arguments.length>2?arguments[2]:undefined;_classCallCheck(this,io);this._selection=new no(),this._selection.delegate(\"change\").to(this),this._selection.setTo(t,e,n);}_createClass(io,[{key:\"isFake\",get:function get(){return this._selection.isFake;}},{key:\"fakeSelectionLabel\",get:function get(){return this._selection.fakeSelectionLabel;}},{key:\"anchor\",get:function get(){return this._selection.anchor;}},{key:\"focus\",get:function get(){return this._selection.focus;}},{key:\"isCollapsed\",get:function get(){return this._selection.isCollapsed;}},{key:\"rangeCount\",get:function get(){return this._selection.rangeCount;}},{key:\"isBackward\",get:function get(){return this._selection.isBackward;}},{key:\"editableElement\",get:function get(){return this._selection.editableElement;}},{key:\"_ranges\",get:function get(){return this._selection._ranges;}},{key:\"getRanges\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getRanges(){return _regeneratorRuntime().wrap(function getRanges$(_context8){while(1)switch(_context8.prev=_context8.next){case 0:return _context8.delegateYield(this._selection.getRanges(),\"t0\",1);case 1:case\"end\":return _context8.stop();}},getRanges,this);})},{key:\"getFirstRange\",value:function getFirstRange(){return this._selection.getFirstRange();}},{key:\"getLastRange\",value:function getLastRange(){return this._selection.getLastRange();}},{key:\"getFirstPosition\",value:function getFirstPosition(){return this._selection.getFirstPosition();}},{key:\"getLastPosition\",value:function getLastPosition(){return this._selection.getLastPosition();}},{key:\"getSelectedElement\",value:function getSelectedElement(){return this._selection.getSelectedElement();}},{key:\"isEqual\",value:function isEqual(t){return this._selection.isEqual(t);}},{key:\"isSimilar\",value:function isSimilar(t){return this._selection.isSimilar(t);}},{key:\"is\",value:function is(t){return\"selection\"==t||\"documentSelection\"==t;}},{key:\"_setTo\",value:function _setTo(t,e,n){this._selection.setTo(t,e,n);}},{key:\"_setFocus\",value:function _setFocus(t,e){this._selection.setFocus(t,e);}}]);return io;}();ci(io,ei);var oo=/*#__PURE__*/function(_Symbol$iterator3){function oo(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,oo);this._items=[],this._itemMap=new Map(),this._idProperty=t.idProperty||\"id\",this._bindToExternalToInternalMap=new WeakMap(),this._bindToInternalToExternalMap=new WeakMap(),this._skippedIndexesFromExternal=[];}_createClass(oo,[{key:\"length\",get:function get(){return this._items.length;}},{key:\"first\",get:function get(){return this._items[0]||null;}},{key:\"last\",get:function get(){return this._items[this.length-1]||null;}},{key:\"add\",value:function add(t,e){var n;var i=this._idProperty;if(i in t){if(\"string\"!=typeof(n=t[i]))throw new Gn.b(\"collection-add-invalid-id\");if(this.get(n))throw new Gn.b(\"collection-add-item-already-exists\");}else t[i]=n=Kn();if(void 0===e)e=this._items.length;else if(e>this._items.length||e<0)throw new Gn.b(\"collection-add-item-invalid-index\");return this._items.splice(e,0,t),this._itemMap.set(n,t),this.fire(\"add\",t,e),this;}},{key:\"get\",value:function get(t){var e;if(\"string\"==typeof t)e=this._itemMap.get(t);else{if(\"number\"!=typeof t)throw new Gn.b(\"collection-get-invalid-arg: Index or id must be given.\");e=this._items[t];}return e||null;}},{key:\"has\",value:function has(t){if(\"string\"==typeof t)return this._itemMap.has(t);{var _e32=t[this._idProperty];return this._itemMap.has(_e32);}}},{key:\"getIndex\",value:function getIndex(t){var e;return e=\"string\"==typeof t?this._itemMap.get(t):t,this._items.indexOf(e);}},{key:\"remove\",value:function remove(t){var e,n,i,o=!1;var r=this._idProperty;if(\"string\"==typeof t?(n=t,o=!(i=this._itemMap.get(n)),i&&(e=this._items.indexOf(i))):\"number\"==typeof t?(e=t,o=!(i=this._items[e]),i&&(n=i[r])):(n=(i=t)[r],o=-1==(e=this._items.indexOf(i))||!this._itemMap.get(n)),o)throw new Gn.b(\"collection-remove-404: Item not found.\");this._items.splice(e,1),this._itemMap[\"delete\"](n);var s=this._bindToInternalToExternalMap.get(i);return this._bindToInternalToExternalMap[\"delete\"](i),this._bindToExternalToInternalMap[\"delete\"](s),this.fire(\"remove\",i,e),i;}},{key:\"map\",value:function map(t,e){return this._items.map(t,e);}},{key:\"find\",value:function find(t,e){return this._items.find(t,e);}},{key:\"filter\",value:function filter(t,e){return this._items.filter(t,e);}},{key:\"clear\",value:function clear(){for(this._bindToCollection&&(this.stopListening(this._bindToCollection),this._bindToCollection=null);this.length;)this.remove(0);}},{key:\"bindTo\",value:function bindTo(t){var _this19=this;if(this._bindToCollection)throw new Gn.b(\"collection-bind-to-rebind: The collection cannot be bound more than once.\");return this._bindToCollection=t,{as:function as(t){_this19._setUpBindToBinding(function(e){return new t(e);});},using:function using(t){\"function\"==typeof t?_this19._setUpBindToBinding(function(e){return t(e);}):_this19._setUpBindToBinding(function(e){return e[t];});}};}},{key:\"_setUpBindToBinding\",value:function _setUpBindToBinding(t){var _this20=this;var e=this._bindToCollection,n=function n(_n23,i,o){var r=e._bindToCollection==_this20,s=e._bindToInternalToExternalMap.get(i);if(r&&s)_this20._bindToExternalToInternalMap.set(i,s),_this20._bindToInternalToExternalMap.set(s,i);else{var _n22=t(i);if(!_n22)return void _this20._skippedIndexesFromExternal.push(o);var _r2=o;var _iterator31=_createForOfIteratorHelper(_this20._skippedIndexesFromExternal),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _t24=_step31.value;o>_t24&&_r2--;}}catch(err){_iterator31.e(err);}finally{_iterator31.f();}var _iterator32=_createForOfIteratorHelper(e._skippedIndexesFromExternal),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var _t25=_step32.value;_r2>=_t25&&_r2++;}}catch(err){_iterator32.e(err);}finally{_iterator32.f();}_this20._bindToExternalToInternalMap.set(i,_n22),_this20._bindToInternalToExternalMap.set(_n22,i),_this20.add(_n22,_r2);for(var _t23=0;_t23e&&t.push(e),t;},[]);});}},{key:_Symbol$iterator3,value:function value(){return this._items[Symbol.iterator]();}}]);return oo;}(Symbol.iterator);ci(oo,ei);var ro=/*#__PURE__*/function(){function ro(){_classCallCheck(this,ro);this.selection=new io(),this.roots=new oo({idProperty:\"rootName\"}),this.set(\"isReadOnly\",!1),this.set(\"isFocused\",!1),this.set(\"isComposing\",!1),this._postFixers=new Set();}_createClass(ro,[{key:\"getRoot\",value:function getRoot(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:\"main\";return this.roots.get(t);}},{key:\"registerPostFixer\",value:function registerPostFixer(t){this._postFixers.add(t);}},{key:\"destroy\",value:function destroy(){this.roots.map(function(t){return t.destroy();}),this.stopListening();}},{key:\"_callPostFixers\",value:function _callPostFixers(t){var e=!1;do{var _iterator34=_createForOfIteratorHelper(this._postFixers),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _n24=_step34.value;if(e=_n24(t))break;}}catch(err){_iterator34.e(err);}finally{_iterator34.f();}}while(e);}}]);return ro;}();ci(ro,Fi);var so=10;var ao=/*#__PURE__*/function(_i20){_inherits(ao,_i20);var _super7=_createSuper(ao);function ao(t,e,n){var _this21;_classCallCheck(this,ao);_this21=_super7.call(this,t,e,n),_this21.getFillerOffset=co,_this21._priority=so,_this21._id=null,_this21._clonesGroup=null;return _this21;}_createClass(ao,[{key:\"priority\",get:function get(){return this._priority;}},{key:\"id\",get:function get(){return this._id;}},{key:\"getElementsWithSameId\",value:function getElementsWithSameId(){if(null===this.id)throw new Gn.b(\"attribute-element-get-elements-with-same-id-no-id: Cannot get elements with the same id for an attribute element without id.\");return new Set(this._clonesGroup);}},{key:\"is\",value:function is(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return e?\"attributeElement\"==t&&e==this.name||_get(_getPrototypeOf(ao.prototype),\"is\",this).call(this,t,e):\"attributeElement\"==t||_get(_getPrototypeOf(ao.prototype),\"is\",this).call(this,t);}},{key:\"isSimilar\",value:function isSimilar(t){return null!==this.id||null!==t.id?this.id===t.id:_get(_getPrototypeOf(ao.prototype),\"isSimilar\",this).call(this,t)&&this.priority==t.priority;}},{key:\"_clone\",value:function _clone(t){var e=_get(_getPrototypeOf(ao.prototype),\"_clone\",this).call(this,t);return e._priority=this._priority,e._id=this._id,e;}}]);return ao;}(_i);function co(){if(lo(this))return null;var t=this.parent;for(;t&&t.is(\"attributeElement\");){if(lo(t)>1)return null;t=t.parent;}return!t||lo(t)>1?null:this.childCount;}function lo(t){return Array.from(t.getChildren()).filter(function(t){return!t.is(\"uiElement\");}).length;}ao.DEFAULT_PRIORITY=so;var uo=/*#__PURE__*/function(_i21){_inherits(uo,_i21);var _super8=_createSuper(uo);function uo(t,e,n){var _this22;_classCallCheck(this,uo);_this22=_super8.call(this,t,e,n),_this22.getFillerOffset=ho;return _this22;}_createClass(uo,[{key:\"is\",value:function is(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return e?\"emptyElement\"==t&&e==this.name||_get(_getPrototypeOf(uo.prototype),\"is\",this).call(this,t,e):\"emptyElement\"==t||_get(_getPrototypeOf(uo.prototype),\"is\",this).call(this,t);}},{key:\"_insertChild\",value:function _insertChild(t,e){if(e&&(e instanceof hi||Array.from(e).length>0))throw new Gn.b(\"view-emptyelement-cannot-add: Cannot add child nodes to EmptyElement instance.\");}}]);return uo;}(_i);function ho(){return null;}var fo=navigator.userAgent.toLowerCase();var mo={isMac:function(t){return t.indexOf(\"macintosh\")>-1;}(fo),isEdge:function(t){return!!t.match(/edge\\/(\\d+.?\\d*)/);}(fo),isGecko:function(t){return!!t.match(/gecko\\/\\d+/);}(fo)};var po={\"⌘\":\"ctrl\",\"⇧\":\"shift\",\"⌥\":\"alt\"},go={ctrl:\"⌘\",shift:\"⇧\",alt:\"⌥\"},bo=function(){var t={arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,backspace:8,\"delete\":46,enter:13,space:32,esc:27,tab:9,ctrl:1114112,cmd:1114112,shift:2228224,alt:4456448};for(var _e33=65;_e33<=90;_e33++){var _n25=String.fromCharCode(_e33);t[_n25.toLowerCase()]=_e33;}for(var _e34=48;_e34<=57;_e34++)t[_e34-48]=_e34;for(var _e35=112;_e35<=123;_e35++)t[\"f\"+(_e35-111)]=_e35;return t;}();function wo(t){var e;if(\"string\"==typeof t){if(!(e=bo[t.toLowerCase()]))throw new Gn.b(\"keyboard-unknown-key: Unknown key name.\",{key:t});}else e=t.keyCode+(t.altKey?bo.alt:0)+(t.ctrlKey?bo.ctrl:0)+(t.shiftKey?bo.shift:0);return e;}function _o(t){return\"string\"==typeof t&&(t=ko(t)),t.map(function(t){return\"string\"==typeof t?wo(t):t;}).reduce(function(t,e){return e+t;},0);}function ko(t){return t.split(/\\s*\\+\\s*/);}var vo=/*#__PURE__*/function(_i22){_inherits(vo,_i22);var _super9=_createSuper(vo);function vo(t,e,n){var _this23;_classCallCheck(this,vo);_this23=_super9.call(this,t,e,n),_this23.getFillerOffset=xo;return _this23;}_createClass(vo,[{key:\"is\",value:function is(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return e?\"uiElement\"==t&&e==this.name||_get(_getPrototypeOf(vo.prototype),\"is\",this).call(this,t,e):\"uiElement\"==t||_get(_getPrototypeOf(vo.prototype),\"is\",this).call(this,t);}},{key:\"_insertChild\",value:function _insertChild(t,e){if(e&&(e instanceof hi||Array.from(e).length>0))throw new Gn.b(\"view-uielement-cannot-add: Cannot add child nodes to UIElement instance.\");}},{key:\"render\",value:function render(t){return this.toDomElement(t);}},{key:\"toDomElement\",value:function toDomElement(t){var e=t.createElement(this.name);var _iterator35=_createForOfIteratorHelper(this.getAttributeKeys()),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _t27=_step35.value;e.setAttribute(_t27,this.getAttribute(_t27));}}catch(err){_iterator35.e(err);}finally{_iterator35.f();}return e;}}]);return vo;}(_i);function yo(t){t.document.on(\"keydown\",function(e,n){return function(t,e,n){if(e.keyCode==bo.arrowright){var _t28=e.domTarget.ownerDocument.defaultView.getSelection(),_i23=1==_t28.rangeCount&&_t28.getRangeAt(0).collapsed;if(_i23||e.shiftKey){var _e36=_t28.focusNode,_o12=_t28.focusOffset,_r3=n.domPositionToView(_e36,_o12);if(null===_r3)return;var _s3=!1;var _a3=_r3.getLastMatchingPosition(function(t){return t.item.is(\"uiElement\")&&(_s3=!0),!(!t.item.is(\"uiElement\")&&!t.item.is(\"attributeElement\"));});if(_s3){var _e37=n.viewPositionToDom(_a3);_i23?_t28.collapse(_e37.parent,_e37.offset):_t28.extend(_e37.parent,_e37.offset);}}}}(0,n,t.domConverter);});}function xo(){return null;}var Ao=/*#__PURE__*/function(_Symbol$iterator4){function Ao(t){_classCallCheck(this,Ao);this._children=[],t&&this._insertChild(0,t);}_createClass(Ao,[{key:_Symbol$iterator4,value:function value(){return this._children[Symbol.iterator]();}},{key:\"childCount\",get:function get(){return this._children.length;}},{key:\"isEmpty\",get:function get(){return 0===this.childCount;}},{key:\"root\",get:function get(){return this;}},{key:\"parent\",get:function get(){return null;}},{key:\"is\",value:function is(t){return\"documentFragment\"==t;}},{key:\"_appendChild\",value:function _appendChild(t){return this._insertChild(this.childCount,t);}},{key:\"getChild\",value:function getChild(t){return this._children[t];}},{key:\"getChildIndex\",value:function getChildIndex(t){return this._children.indexOf(t);}},{key:\"getChildren\",value:function getChildren(){return this._children[Symbol.iterator]();}},{key:\"_insertChild\",value:function _insertChild(t,e){this._fireChange(\"children\",this);var n=0;var i=function(t){if(\"string\"==typeof t)return[new fi(t)];gi(t)||(t=[t]);return Array.from(t).map(function(t){return\"string\"==typeof t?new fi(t):t instanceof mi?new fi(t.data):t;});}(e);var _iterator36=_createForOfIteratorHelper(i),_step36;try{for(_iterator36.s();!(_step36=_iterator36.n()).done;){var _e38=_step36.value;null!==_e38.parent&&_e38._remove(),_e38.parent=this,this._children.splice(t,0,_e38),t++,n++;}}catch(err){_iterator36.e(err);}finally{_iterator36.f();}return n;}},{key:\"_removeChildren\",value:function _removeChildren(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;this._fireChange(\"children\",this);for(var _n26=t;_n262&&arguments[2]!==undefined?arguments[2]:{};var i=new ao(t,e);return n.priority&&(i._priority=n.priority),n.id&&(i._id=n.id),i;}},{key:\"createContainerElement\",value:function createContainerElement(t,e){return new yi(t,e);}},{key:\"createEditableElement\",value:function createEditableElement(t,e){var n=new Gi(t,e);return n._document=this.document,n;}},{key:\"createEmptyElement\",value:function createEmptyElement(t,e){return new uo(t,e);}},{key:\"createUIElement\",value:function createUIElement(t,e,n){var i=new vo(t,e);return n&&(i.render=n),i;}},{key:\"setAttribute\",value:function setAttribute(t,e,n){n._setAttribute(t,e);}},{key:\"removeAttribute\",value:function removeAttribute(t,e){e._removeAttribute(t);}},{key:\"addClass\",value:function addClass(t,e){e._addClass(t);}},{key:\"removeClass\",value:function removeClass(t,e){e._removeClass(t);}},{key:\"setStyle\",value:function setStyle(t,e,n){C(t)&&void 0===n&&(n=e),n._setStyle(t,e);}},{key:\"removeStyle\",value:function removeStyle(t,e){e._removeStyle(t);}},{key:\"setCustomProperty\",value:function setCustomProperty(t,e,n){n._setCustomProperty(t,e);}},{key:\"removeCustomProperty\",value:function removeCustomProperty(t,e){return e._removeCustomProperty(t);}},{key:\"breakAttributes\",value:function breakAttributes(t){return t instanceof Zi?this._breakAttributes(t):this._breakAttributesRange(t);}},{key:\"breakContainer\",value:function breakContainer(t){var e=t.parent;if(!e.is(\"containerElement\"))throw new Gn.b(\"view-writer-break-non-container-element: Trying to break an element which is not a container element.\");if(!e.parent)throw new Gn.b(\"view-writer-break-root: Trying to break root element.\");if(t.isAtStart)return Zi._createBefore(e);if(!t.isAtEnd){var _n27=e._clone(!1);this.insert(Zi._createAfter(e),_n27);var _i24=new Xi(t,Zi._createAt(e,\"end\")),_o13=new Zi(_n27,0);this.move(_i24,_o13);}return Zi._createAfter(e);}},{key:\"mergeAttributes\",value:function mergeAttributes(t){var e=t.offset,n=t.parent;if(n.is(\"text\"))return t;if(n.is(\"attributeElement\")&&0===n.childCount){var _t29=n.parent,_e39=n.index;return n._remove(),this._removeFromClonedElementsGroup(n),this.mergeAttributes(new Zi(_t29,_e39));}var i=n.getChild(e-1),o=n.getChild(e);if(!i||!o)return t;if(i.is(\"text\")&&o.is(\"text\"))return So(i,o);if(i.is(\"attributeElement\")&&o.is(\"attributeElement\")&&i.isSimilar(o)){var _t30=i.childCount;return i._appendChild(o.getChildren()),o._remove(),this._removeFromClonedElementsGroup(o),this.mergeAttributes(new Zi(i,_t30));}return t;}},{key:\"mergeContainers\",value:function mergeContainers(t){var e=t.nodeBefore,n=t.nodeAfter;if(!(e&&n&&e.is(\"containerElement\")&&n.is(\"containerElement\")))throw new Gn.b(\"view-writer-merge-containers-invalid-position: Element before and after given position cannot be merged.\");var i=e.getChild(e.childCount-1),o=i instanceof fi?Zi._createAt(i,\"end\"):Zi._createAt(e,\"end\");return this.move(Xi._createIn(n),Zi._createAt(e,\"end\")),this.remove(Xi._createOn(n)),o;}},{key:\"insert\",value:function insert(t,e){(function t(e){var _iterator37=_createForOfIteratorHelper(e),_step37;try{var _loop=function _loop(){var n=_step37.value;if(!Io.some(function(t){return n instanceof t;}))throw new Gn.b(\"view-writer-insert-invalid-node\");n.is(\"text\")||t(n.getChildren());};for(_iterator37.s();!(_step37=_iterator37.n()).done;){_loop();}}catch(err){_iterator37.e(err);}finally{_iterator37.f();}})(e=gi(e)?_toConsumableArray(e):[e]);var n=To(t);if(!n)throw new Gn.b(\"view-writer-invalid-position-container\");var i=this._breakAttributes(t,!0),o=n._insertChild(i.offset,e);var _iterator38=_createForOfIteratorHelper(e),_step38;try{for(_iterator38.s();!(_step38=_iterator38.n()).done;){var _t32=_step38.value;this._addToClonedElementsGroup(_t32);}}catch(err){_iterator38.e(err);}finally{_iterator38.f();}var r=i.getShiftedBy(o),s=this.mergeAttributes(i);if(0===o)return new Xi(s,s);{s.isEqual(i)||r.offset--;var _t31=this.mergeAttributes(r);return new Xi(s,_t31);}}},{key:\"remove\",value:function remove(t){var e=t instanceof Xi?t:Xi._createOn(t);if(Oo(e),e.isCollapsed)return new Ao();var _this$_breakAttribute=this._breakAttributesRange(e,!0),n=_this$_breakAttribute.start,i=_this$_breakAttribute.end,o=n.parent,r=i.offset-n.offset,s=o._removeChildren(n.offset,r);var _iterator39=_createForOfIteratorHelper(s),_step39;try{for(_iterator39.s();!(_step39=_iterator39.n()).done;){var _t33=_step39.value;this._removeFromClonedElementsGroup(_t33);}}catch(err){_iterator39.e(err);}finally{_iterator39.f();}var a=this.mergeAttributes(n);return e.start=a,e.end=a.clone(),new Ao(s);}},{key:\"clear\",value:function clear(t,e){Oo(t);var n=t.getWalker({direction:\"backward\",ignoreElementEnd:!0});var _iterator40=_createForOfIteratorHelper(n),_step40;try{for(_iterator40.s();!(_step40=_iterator40.n()).done;){var _i25=_step40.value;var _n28=_i25.item;var _o14=void 0;if(_n28.is(\"element\")&&e.isSimilar(_n28))_o14=Xi._createOn(_n28);else if(!_i25.nextPosition.isAfter(t.start)&&_n28.is(\"textProxy\")){var _t34=_n28.getAncestors().find(function(t){return t.is(\"element\")&&e.isSimilar(t);});_t34&&(_o14=Xi._createIn(_t34));}_o14&&(_o14.end.isAfter(t.end)&&(_o14.end=t.end),_o14.start.isBefore(t.start)&&(_o14.start=t.start),this.remove(_o14));}}catch(err){_iterator40.e(err);}finally{_iterator40.f();}}},{key:\"move\",value:function move(t,e){var n;if(e.isAfter(t.end)){var _i26=(e=this._breakAttributes(e,!0)).parent,_o15=_i26.childCount;t=this._breakAttributesRange(t,!0),n=this.remove(t),e.offset+=_i26.childCount-_o15;}else n=this.remove(t);return this.insert(e,n);}},{key:\"wrap\",value:function wrap(t,e){if(!(e instanceof ao))throw new Gn.b(\"view-writer-wrap-invalid-attribute\");if(Oo(t),t.isCollapsed){var _n29=t.start;_n29.parent.is(\"element\")&&!function(t){return Array.from(t.getChildren()).some(function(t){return!t.is(\"uiElement\");});}(_n29.parent)&&(_n29=_n29.getLastMatchingPosition(function(t){return t.item.is(\"uiElement\");})),_n29=this._wrapPosition(_n29,e);var _i27=this.document.selection;return _i27.isCollapsed&&_i27.getFirstPosition().isEqual(t.start)&&this.setSelection(_n29),new Xi(_n29);}return this._wrapRange(t,e);}},{key:\"unwrap\",value:function unwrap(t,e){if(!(e instanceof ao))throw new Gn.b(\"view-writer-unwrap-invalid-attribute\");if(Oo(t),t.isCollapsed)return t;var _this$_breakAttribute2=this._breakAttributesRange(t,!0),n=_this$_breakAttribute2.start,i=_this$_breakAttribute2.end;if(i.isEqual(n.getShiftedBy(1))){var _t35=n.nodeAfter;if(!e.isSimilar(_t35)&&_t35 instanceof ao&&this._unwrapAttributeElement(e,_t35)){var _t36=this.mergeAttributes(n);_t36.isEqual(n)||i.offset--;var _e40=this.mergeAttributes(i);return new Xi(_t36,_e40);}}var o=n.parent,r=this._unwrapChildren(o,n.offset,i.offset,e),s=this.mergeAttributes(r.start);s.isEqual(r.start)||r.end.offset--;var a=this.mergeAttributes(r.end);return new Xi(s,a);}},{key:\"rename\",value:function rename(t,e){var n=new yi(t,e.getAttributes());return this.insert(Zi._createAfter(e),n),this.move(Xi._createIn(e),Zi._createAt(n,0)),this.remove(Xi._createOn(e)),n;}},{key:\"clearClonedElementsGroup\",value:function clearClonedElementsGroup(t){this._cloneGroups[\"delete\"](t);}},{key:\"createPositionAt\",value:function createPositionAt(t,e){return Zi._createAt(t,e);}},{key:\"createPositionAfter\",value:function createPositionAfter(t){return Zi._createAfter(t);}},{key:\"createPositionBefore\",value:function createPositionBefore(t){return Zi._createBefore(t);}},{key:\"createRange\",value:function createRange(t,e){return new Xi(t,e);}},{key:\"createRangeOn\",value:function createRangeOn(t){return Xi._createOn(t);}},{key:\"createRangeIn\",value:function createRangeIn(t){return Xi._createIn(t);}},{key:\"createSelection\",value:function createSelection(t,e,n){return new no(t,e,n);}},{key:\"_wrapChildren\",value:function _wrapChildren(t,e,n,i){var o=e;var r=[];for(;o1&&arguments[1]!==undefined?arguments[1]:!1;var n=t.start,i=t.end;if(Oo(t),t.isCollapsed){var _n41=this._breakAttributes(t.start,e);return new Xi(_n41,_n41);}var o=this._breakAttributes(i,e),r=o.parent.childCount,s=this._breakAttributes(n,e);return o.offset+=o.parent.childCount-r,new Xi(s,o);}},{key:\"_breakAttributes\",value:function _breakAttributes(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=t.offset,i=t.parent;if(t.parent.is(\"emptyElement\"))throw new Gn.b(\"view-writer-cannot-break-empty-element\");if(t.parent.is(\"uiElement\"))throw new Gn.b(\"view-writer-cannot-break-ui-element\");if(!e&&i.is(\"text\")&&No(i.parent))return t.clone();if(No(i))return t.clone();if(i.is(\"text\"))return this._breakAttributes(Eo(t),e);if(n==i.childCount){var _t41=new Zi(i.parent,i.index+1);return this._breakAttributes(_t41,e);}if(0===n){var _t42=new Zi(i.parent,i.index);return this._breakAttributes(_t42,e);}{var _t43=i.index+1,_o16=i._clone();i.parent._insertChild(_t43,_o16),this._addToClonedElementsGroup(_o16);var _r6=i.childCount-n,_s6=i._removeChildren(n,_r6);_o16._appendChild(_s6);var _a5=new Zi(i.parent,_t43);return this._breakAttributes(_a5,e);}}},{key:\"_addToClonedElementsGroup\",value:function _addToClonedElementsGroup(t){if(!t.root.is(\"rootElement\"))return;if(t.is(\"element\")){var _iterator49=_createForOfIteratorHelper(t.getChildren()),_step49;try{for(_iterator49.s();!(_step49=_iterator49.n()).done;){var _e45=_step49.value;this._addToClonedElementsGroup(_e45);}}catch(err){_iterator49.e(err);}finally{_iterator49.f();}}var e=t.id;if(!e)return;var n=this._cloneGroups.get(e);n||(n=new Set(),this._cloneGroups.set(e,n)),n.add(t),t._clonesGroup=n;}},{key:\"_removeFromClonedElementsGroup\",value:function _removeFromClonedElementsGroup(t){if(t.is(\"element\")){var _iterator50=_createForOfIteratorHelper(t.getChildren()),_step50;try{for(_iterator50.s();!(_step50=_iterator50.n()).done;){var _e46=_step50.value;this._removeFromClonedElementsGroup(_e46);}}catch(err){_iterator50.e(err);}finally{_iterator50.f();}}var e=t.id;if(!e)return;var n=this._cloneGroups.get(e);n&&n[\"delete\"](t);}}]);return Co;}();function To(t){var e=t.parent;for(;!No(e);){if(!e)return;e=e.parent;}return e;}function Po(t,e){return t.prioritye.priority)&&t.getIdentity()3&&arguments[3]!==undefined?arguments[3]:!1;n=n||function(t,e){return t===e;},Array.isArray(t)||(t=Array.from(t)),Array.isArray(e)||(e=Array.from(e));var o=function(t,e,n){var i=$o(t,e,n);if(-1===i)return{firstIndex:-1,lastIndexOld:-1,lastIndexNew:-1};var o=Go(t,i),r=Go(e,i),s=$o(o,r,n),a=t.length-s,c=e.length-s;return{firstIndex:i,lastIndexOld:a,lastIndexNew:c};}(t,e,n);return i?function(t,e){var n=t.firstIndex,i=t.lastIndexOld,o=t.lastIndexNew;if(-1===n)return Array(e).fill(\"equal\");var r=[];n>0&&(r=r.concat(Array(n).fill(\"equal\")));o-n>0&&(r=r.concat(Array(o-n).fill(\"insert\")));i-n>0&&(r=r.concat(Array(i-n).fill(\"delete\")));o0&&n.push({index:i,type:\"insert\",values:t.slice(i,r)});o-i>0&&n.push({index:i+(r-i),type:\"delete\",howMany:o-i});return n;}(e,o);}function $o(t,e,n){for(var _i32=0;_i32200||o>200||i+o>300)return Qo.fastDiff(t,e,n,!0);var r,s;if(ol?-1:1;d[i+h]&&(d[i]=d[i+h].slice(0)),d[i]||(d[i]=[]),d[i].push(o>l?r:s);var f=Math.max(o,l),m=f-i;for(;ml;f--)u[f]=h(f);u[l]=h(l),m++;}while(u[l]!==c);return d[l].slice(1);}function Jo(t,e,n){t.insertBefore(n,t.childNodes[e]||null);}function Ko(t){var e=t.parentNode;e&&e.removeChild(t);}function Zo(t){if(t){if(t.defaultView)return t instanceof t.defaultView.Document;if(t.ownerDocument&&t.ownerDocument.defaultView)return t instanceof t.ownerDocument.defaultView.Node;}return!1;}Qo.fastDiff=Yo;var Xo=/*#__PURE__*/function(){function Xo(t,e){_classCallCheck(this,Xo);this.domDocuments=new Set(),this.domConverter=t,this.markedAttributes=new Set(),this.markedChildren=new Set(),this.markedTexts=new Set(),this.selection=e,this.isFocused=!1,this._inlineFiller=null,this._fakeSelectionContainer=null;}_createClass(Xo,[{key:\"markToSync\",value:function markToSync(t,e){if(\"text\"===t)this.domConverter.mapViewToDom(e.parent)&&this.markedTexts.add(e);else{if(!this.domConverter.mapViewToDom(e))return;if(\"attributes\"===t)this.markedAttributes.add(e);else{if(\"children\"!==t)throw new Gn.b(\"view-renderer-unknown-type: Unknown type passed to Renderer.markToSync.\");this.markedChildren.add(e);}}}},{key:\"render\",value:function render(){var t;var _iterator51=_createForOfIteratorHelper(this.markedChildren),_step51;try{for(_iterator51.s();!(_step51=_iterator51.n()).done;){var _t46=_step51.value;this._updateChildrenMappings(_t46);}}catch(err){_iterator51.e(err);}finally{_iterator51.f();}this._inlineFiller&&!this._isSelectionInInlineFiller()&&this._removeInlineFiller(),this._inlineFiller?t=this._getInlineFillerPosition():this._needsInlineFillerAtSelection()&&(t=this.selection.getFirstPosition(),this.markedChildren.add(t.parent));var _iterator52=_createForOfIteratorHelper(this.markedAttributes),_step52;try{for(_iterator52.s();!(_step52=_iterator52.n()).done;){var _t47=_step52.value;this._updateAttrs(_t47);}}catch(err){_iterator52.e(err);}finally{_iterator52.f();}var _iterator53=_createForOfIteratorHelper(this.markedChildren),_step53;try{for(_iterator53.s();!(_step53=_iterator53.n()).done;){var _e49=_step53.value;this._updateChildren(_e49,{inlineFillerPosition:t});}}catch(err){_iterator53.e(err);}finally{_iterator53.f();}var _iterator54=_createForOfIteratorHelper(this.markedTexts),_step54;try{for(_iterator54.s();!(_step54=_iterator54.n()).done;){var _e50=_step54.value;!this.markedChildren.has(_e50.parent)&&this.domConverter.mapViewToDom(_e50.parent)&&this._updateText(_e50,{inlineFillerPosition:t});}}catch(err){_iterator54.e(err);}finally{_iterator54.f();}if(t){var _e48=this.domConverter.viewPositionToDom(t),_n44=_e48.parent.ownerDocument;zo(_e48.parent)?this._inlineFiller=_e48.parent:this._inlineFiller=tr(_n44,_e48.parent,_e48.offset);}else this._inlineFiller=null;this._updateSelection(),this._updateFocus(),this.markedTexts.clear(),this.markedAttributes.clear(),this.markedChildren.clear();}},{key:\"_updateChildrenMappings\",value:function _updateChildrenMappings(t){var e=this.domConverter.mapViewToDom(t);if(!e)return;var n=this.domConverter.mapViewToDom(t).childNodes,i=Array.from(this.domConverter.viewChildrenToDom(t,e.ownerDocument,{withChildren:!1})),o=this._diffNodeLists(n,i),r=this._findReplaceActions(o,n,i);if(-1!==r.indexOf(\"replace\")){var _e51={equal:0,insert:0,\"delete\":0};var _iterator55=_createForOfIteratorHelper(r),_step55;try{for(_iterator55.s();!(_step55=_iterator55.n()).done;){var _o17=_step55.value;if(\"replace\"===_o17){var _o18=_e51.equal+_e51.insert,_r7=_e51.equal+_e51[\"delete\"],_s7=t.getChild(_o18);_s7&&!_s7.is(\"uiElement\")&&this._updateElementMappings(_s7,n[_r7]),Ko(i[_o18]),_e51.equal++;}else _e51[_o17]++;}}catch(err){_iterator55.e(err);}finally{_iterator55.f();}}}},{key:\"_updateElementMappings\",value:function _updateElementMappings(t,e){this.domConverter.unbindDomElement(e),this.domConverter.bindElements(e,t),this.markedChildren.add(t),this.markedAttributes.add(t);}},{key:\"_getInlineFillerPosition\",value:function _getInlineFillerPosition(){var t=this.selection.getFirstPosition();return t.parent.is(\"text\")?Zi._createBefore(this.selection.getFirstPosition().parent):t;}},{key:\"_isSelectionInInlineFiller\",value:function _isSelectionInInlineFiller(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;var t=this.selection.getFirstPosition(),e=this.domConverter.viewPositionToDom(t);return!!(e&&Do(e.parent)&&zo(e.parent));}},{key:\"_removeInlineFiller\",value:function _removeInlineFiller(){var t=this._inlineFiller;if(!zo(t))throw new Gn.b(\"view-renderer-filler-was-lost: The inline filler node was lost.\");Fo(t)?t.parentNode.removeChild(t):t.data=t.data.substr(Vo),this._inlineFiller=null;}},{key:\"_needsInlineFillerAtSelection\",value:function _needsInlineFillerAtSelection(){if(1!=this.selection.rangeCount||!this.selection.isCollapsed)return!1;var t=this.selection.getFirstPosition(),e=t.parent,n=t.offset;if(!this.domConverter.mapViewToDom(e.root))return!1;if(!e.is(\"element\"))return!1;if(!function(t){if(\"false\"==t.getAttribute(\"contenteditable\"))return!1;var e=t.findAncestor(function(t){return t.hasAttribute(\"contenteditable\");});return!e||\"true\"==e.getAttribute(\"contenteditable\");}(e))return!1;if(n===e.getFillerOffset())return!1;var i=t.nodeBefore,o=t.nodeAfter;return!(i instanceof fi||o instanceof fi);}},{key:\"_updateText\",value:function _updateText(t,e){var n=this.domConverter.findCorrespondingDomText(t),i=this.domConverter.viewToDom(t,n.ownerDocument),o=n.data;var r=i.data;var s=e.inlineFillerPosition;if(s&&s.parent==t.parent&&s.offset==t.index&&(r=Bo+r),o!=r){var _t48=Yo(o,r);var _iterator56=_createForOfIteratorHelper(_t48),_step56;try{for(_iterator56.s();!(_step56=_iterator56.n()).done;){var _e52=_step56.value;\"insert\"===_e52.type?n.insertData(_e52.index,_e52.values.join(\"\")):n.deleteData(_e52.index,_e52.howMany);}}catch(err){_iterator56.e(err);}finally{_iterator56.f();}}}},{key:\"_updateAttrs\",value:function _updateAttrs(t){var e=this.domConverter.mapViewToDom(t);if(!e)return;var n=Array.from(e.attributes).map(function(t){return t.name;}),i=t.getAttributeKeys();var _iterator57=_createForOfIteratorHelper(i),_step57;try{for(_iterator57.s();!(_step57=_iterator57.n()).done;){var _n45=_step57.value;e.setAttribute(_n45,t.getAttribute(_n45));}}catch(err){_iterator57.e(err);}finally{_iterator57.f();}var _iterator58=_createForOfIteratorHelper(n),_step58;try{for(_iterator58.s();!(_step58=_iterator58.n()).done;){var _i33=_step58.value;t.hasAttribute(_i33)||e.removeAttribute(_i33);}}catch(err){_iterator58.e(err);}finally{_iterator58.f();}}},{key:\"_updateChildren\",value:function _updateChildren(t,e){var n=this.domConverter.mapViewToDom(t);if(!n)return;var i=e.inlineFillerPosition,o=this.domConverter.mapViewToDom(t).childNodes,r=Array.from(this.domConverter.viewChildrenToDom(t,n.ownerDocument,{bind:!0,inlineFillerPosition:i}));i&&i.parent===t&&tr(n.ownerDocument,r,i.offset);var s=this._diffNodeLists(o,r);var a=0;var c=new Set();var _iterator59=_createForOfIteratorHelper(s),_step59;try{for(_iterator59.s();!(_step59=_iterator59.n()).done;){var _t49=_step59.value;\"insert\"===_t49?(Jo(n,a,r[a]),a++):\"delete\"===_t49?(c.add(o[a]),Ko(o[a])):(this._markDescendantTextToSync(this.domConverter.domToView(r[a])),a++);}}catch(err){_iterator59.e(err);}finally{_iterator59.f();}var _iterator60=_createForOfIteratorHelper(c),_step60;try{for(_iterator60.s();!(_step60=_iterator60.n()).done;){var _t50=_step60.value;_t50.parentNode||this.domConverter.unbindDomElement(_t50);}}catch(err){_iterator60.e(err);}finally{_iterator60.f();}}},{key:\"_diffNodeLists\",value:function _diffNodeLists(t,e){return Qo(t=function(t,e){var n=Array.from(t);if(0==n.length||!e)return n;n[n.length-1]==e&&n.pop();return n;}(t,this._fakeSelectionContainer),e,function(t,e,n){if(e===n)return!0;if(Do(e)&&Do(n))return e.data===n.data;if(qo(e,t)&&qo(n,t))return!0;return!1;}.bind(null,this.domConverter.blockFiller));}},{key:\"_findReplaceActions\",value:function _findReplaceActions(t,e,n){if(-1===t.indexOf(\"insert\")||-1===t.indexOf(\"delete\"))return t;var i=[],o=[],r=[];var s={equal:0,insert:0,\"delete\":0};var _iterator61=_createForOfIteratorHelper(t),_step61;try{for(_iterator61.s();!(_step61=_iterator61.n()).done;){var _a6=_step61.value;\"insert\"===_a6?r.push(n[s.equal+s.insert]):\"delete\"===_a6?o.push(e[s.equal+s[\"delete\"]]):((i=i.concat(Qo(o,r,er).map(function(t){return\"equal\"===t?\"replace\":t;}))).push(\"equal\"),o=[],r=[]),s[_a6]++;}}catch(err){_iterator61.e(err);}finally{_iterator61.f();}return i.concat(Qo(o,r,er).map(function(t){return\"equal\"===t?\"replace\":t;}));}},{key:\"_markDescendantTextToSync\",value:function _markDescendantTextToSync(t){if(t)if(t.is(\"text\"))this.markedTexts.add(t);else if(t.is(\"element\")){var _iterator62=_createForOfIteratorHelper(t.getChildren()),_step62;try{for(_iterator62.s();!(_step62=_iterator62.n()).done;){var _e53=_step62.value;this._markDescendantTextToSync(_e53);}}catch(err){_iterator62.e(err);}finally{_iterator62.f();}}}},{key:\"_updateSelection\",value:function _updateSelection(){if(0===this.selection.rangeCount)return this._removeDomSelection(),void this._removeFakeSelection();var t=this.domConverter.mapViewToDom(this.selection.editableElement);this.isFocused&&t&&(this.selection.isFake?this._updateFakeSelection(t):(this._removeFakeSelection(),this._updateDomSelection(t)));}},{key:\"_updateFakeSelection\",value:function _updateFakeSelection(t){var e=t.ownerDocument;var n=this._fakeSelectionContainer;n||(this._fakeSelectionContainer=n=e.createElement(\"div\"),Object.assign(n.style,{position:\"fixed\",top:0,left:\"-9999px\",width:\"42px\"}),n.appendChild(e.createTextNode(\" \"))),n.parentElement&&n.parentElement==t||t.appendChild(n),n.firstChild.data=this.selection.fakeSelectionLabel||\" \";var i=e.getSelection(),o=e.createRange();i.removeAllRanges(),o.selectNodeContents(n),i.addRange(o),this.domConverter.bindFakeSelection(n,this.selection);}},{key:\"_updateDomSelection\",value:function _updateDomSelection(t){var e=t.ownerDocument.defaultView.getSelection();if(!this._domSelectionNeedsUpdate(e))return;var n=this.domConverter.viewPositionToDom(this.selection.anchor),i=this.domConverter.viewPositionToDom(this.selection.focus);t.focus(),e.collapse(n.parent,n.offset),e.extend(i.parent,i.offset),mo.isGecko&&function(t,e){var n=t.parent;if(n.nodeType!=Node.ELEMENT_NODE||t.offset!=n.childNodes.length-1)return;var i=n.childNodes[t.offset];i&&\"BR\"==i.tagName&&e.addRange(e.getRangeAt(0));}(i,e);}},{key:\"_domSelectionNeedsUpdate\",value:function _domSelectionNeedsUpdate(t){if(!this.domConverter.isDomSelectionCorrect(t))return!0;var e=t&&this.domConverter.domSelectionToView(t);return(!e||!this.selection.isEqual(e))&&!(!this.selection.isCollapsed&&this.selection.isSimilar(e));}},{key:\"_removeDomSelection\",value:function _removeDomSelection(){var _iterator63=_createForOfIteratorHelper(this.domDocuments),_step63;try{for(_iterator63.s();!(_step63=_iterator63.n()).done;){var _t51=_step63.value;if(_t51.getSelection().rangeCount){var _e54=_t51.activeElement,_n46=this.domConverter.mapDomToView(_e54);_e54&&_n46&&_t51.getSelection().removeAllRanges();}}}catch(err){_iterator63.e(err);}finally{_iterator63.f();}}},{key:\"_removeFakeSelection\",value:function _removeFakeSelection(){var t=this._fakeSelectionContainer;t&&t.remove();}},{key:\"_updateFocus\",value:function _updateFocus(){if(this.isFocused){var _t52=this.selection.editableElement;_t52&&this.domConverter.focus(_t52);}}}]);return Xo;}();function tr(t,e,n){var i=e instanceof Array?e:e.childNodes,o=i[n];if(Do(o))return o.data=Bo+o.data,o;{var _o19=t.createTextNode(Bo);return Array.isArray(e)?i.splice(n,0,_o19):Jo(e,n,_o19),_o19;}}function er(t,e){return Zo(t)&&Zo(e)&&!Do(t)&&!Do(e)&&t.tagName.toLowerCase()===e.tagName.toLowerCase();}ci(Xo,Fi);var nr={window:window,document:document};function ir(t){var e=0;for(;t.previousSibling;)t=t.previousSibling,e++;return e;}function or(t){var e=[];for(;t&&t.nodeType!=Node.DOCUMENT_NODE;)e.unshift(t),t=t.parentNode;return e;}var rr=/*#__PURE__*/function(){function rr(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,rr);this.blockFiller=t.blockFiller||Lo,this.preElements=[\"pre\"],this.blockElements=[\"p\",\"div\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],this._domToViewMapping=new WeakMap(),this._viewToDomMapping=new WeakMap(),this._fakeSelectionMapping=new WeakMap();}_createClass(rr,[{key:\"bindFakeSelection\",value:function bindFakeSelection(t,e){this._fakeSelectionMapping.set(t,new no(e));}},{key:\"fakeSelectionToView\",value:function fakeSelectionToView(t){return this._fakeSelectionMapping.get(t);}},{key:\"bindElements\",value:function bindElements(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t);}},{key:\"unbindDomElement\",value:function unbindDomElement(t){var e=this._domToViewMapping.get(t);if(e){this._domToViewMapping[\"delete\"](t),this._viewToDomMapping[\"delete\"](e);for(var _i34=0,_Array$from=Array.from(t.childNodes);_i34<_Array$from.length;_i34++){var _e55=_Array$from[_i34];this.unbindDomElement(_e55);}}}},{key:\"bindDocumentFragments\",value:function bindDocumentFragments(t,e){this._domToViewMapping.set(t,e),this._viewToDomMapping.set(e,t);}},{key:\"viewToDom\",value:function viewToDom(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(t.is(\"text\")){var _n47=this._processDataFromViewText(t);return e.createTextNode(_n47);}{if(this.mapViewToDom(t))return this.mapViewToDom(t);var _i35;if(t.is(\"documentFragment\"))_i35=e.createDocumentFragment(),n.bind&&this.bindDocumentFragments(_i35,t);else{if(t.is(\"uiElement\"))return _i35=t.render(e),n.bind&&this.bindElements(_i35,t),_i35;_i35=e.createElement(t.name),n.bind&&this.bindElements(_i35,t);var _iterator64=_createForOfIteratorHelper(t.getAttributeKeys()),_step64;try{for(_iterator64.s();!(_step64=_iterator64.n()).done;){var _e56=_step64.value;_i35.setAttribute(_e56,t.getAttribute(_e56));}}catch(err){_iterator64.e(err);}finally{_iterator64.f();}}if(n.withChildren||void 0===n.withChildren){var _iterator65=_createForOfIteratorHelper(this.viewChildrenToDom(t,e,n)),_step65;try{for(_iterator65.s();!(_step65=_iterator65.n()).done;){var _o20=_step65.value;_i35.appendChild(_o20);}}catch(err){_iterator65.e(err);}finally{_iterator65.f();}}return _i35;}}},{key:\"viewChildrenToDom\",value:function viewChildrenToDom(t,e){var _this24=this;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var i,o,_iterator66,_step66,_r8;return _regeneratorRuntime().wrap(function _callee3$(_context9){while(1)switch(_context9.prev=_context9.next){case 0:i=t.getFillerOffset&&t.getFillerOffset();o=0;_iterator66=_createForOfIteratorHelper(t.getChildren());_context9.prev=3;_iterator66.s();case 5:if((_step66=_iterator66.n()).done){_context9.next=16;break;}_r8=_step66.value;_context9.t0=i===o;if(!_context9.t0){_context9.next=11;break;}_context9.next=11;return _this24.blockFiller(e);case 11:_context9.next=13;return _this24.viewToDom(_r8,e,n);case 13:o++;case 14:_context9.next=5;break;case 16:_context9.next=21;break;case 18:_context9.prev=18;_context9.t1=_context9[\"catch\"](3);_iterator66.e(_context9.t1);case 21:_context9.prev=21;_iterator66.f();return _context9.finish(21);case 24:_context9.t2=i===o;if(!_context9.t2){_context9.next=28;break;}_context9.next=28;return _this24.blockFiller(e);case 28:case\"end\":return _context9.stop();}},_callee3,null,[[3,18,21,24]]);})();}},{key:\"viewRangeToDom\",value:function viewRangeToDom(t){var e=this.viewPositionToDom(t.start),n=this.viewPositionToDom(t.end),i=document.createRange();return i.setStart(e.parent,e.offset),i.setEnd(n.parent,n.offset),i;}},{key:\"viewPositionToDom\",value:function viewPositionToDom(t){var e=t.parent;if(e.is(\"text\")){var _n48=this.findCorrespondingDomText(e);if(!_n48)return null;var _i36=t.offset;return zo(_n48)&&(_i36+=Vo),{parent:_n48,offset:_i36};}{var _n49,_i37,_o21;if(0===t.offset){if(!(_n49=this.mapViewToDom(e)))return null;_o21=_n49.childNodes[0];}else{var _e57=t.nodeBefore;if(!(_i37=_e57.is(\"text\")?this.findCorrespondingDomText(_e57):this.mapViewToDom(t.nodeBefore)))return null;_n49=_i37.parentNode,_o21=_i37.nextSibling;}if(Do(_o21)&&zo(_o21))return{parent:_o21,offset:Vo};return{parent:_n49,offset:_i37?ir(_i37)+1:0};}}},{key:\"domToView\",value:function domToView(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};if(qo(t,this.blockFiller))return null;var n=this.getParentUIElement(t,this._domToViewMapping);if(n)return n;if(Do(t)){if(Fo(t))return null;{var _e58=this._processDataFromDomText(t);return\"\"===_e58?null:new fi(_e58);}}if(this.isComment(t))return null;{if(this.mapDomToView(t))return this.mapDomToView(t);var _n50;if(this.isDocumentFragment(t))_n50=new Ao(),e.bind&&this.bindDocumentFragments(t,_n50);else{var _i38=e.keepOriginalCase?t.tagName:t.tagName.toLowerCase();_n50=new _i(_i38),e.bind&&this.bindElements(t,_n50);var _o22=t.attributes;for(var _t53=_o22.length-1;_t53>=0;_t53--)_n50._setAttribute(_o22[_t53].name,_o22[_t53].value);}if(e.withChildren||void 0===e.withChildren){var _iterator67=_createForOfIteratorHelper(this.domChildrenToView(t,e)),_step67;try{for(_iterator67.s();!(_step67=_iterator67.n()).done;){var _i39=_step67.value;_n50._appendChild(_i39);}}catch(err){_iterator67.e(err);}finally{_iterator67.f();}}return _n50;}}},{key:\"domChildrenToView\",value:function domChildrenToView(t){var _this25=this;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return/*#__PURE__*/_regeneratorRuntime().mark(function _callee4(){var _n51,_i40,_o23;return _regeneratorRuntime().wrap(function _callee4$(_context10){while(1)switch(_context10.prev=_context10.next){case 0:_n51=0;case 1:if(!(_n511?_len15-1:0),_key15=1;_key15<_len15;_key15++){e[_key15-1]=arguments[_key15];}if(Zo(t)||cr(t)){var _n58=this._getProxyEmitter(t)||new dr(t);_n58.attach.apply(_n58,e),t=_n58;}(_ei$listenTo=ei.listenTo).call.apply(_ei$listenTo,[this,t].concat(e));},stopListening:function stopListening(t,e,n){if(Zo(t)||cr(t)){var _e64=this._getProxyEmitter(t);if(!_e64)return;t=_e64;}ei.stopListening.call(this,t,e,n),t instanceof dr&&t.detach(e);},_getProxyEmitter:function _getProxyEmitter(t){return function(t,e){return t[Xn]&&t[Xn][e]?t[Xn][e].emitter:null;}(this,ur(t));}});var dr=/*#__PURE__*/_createClass(function dr(t){_classCallCheck(this,dr);ni(this,ur(t)),this._domNode=t;});function ur(t){return t[\"data-ck-expando\"]||(t[\"data-ck-expando\"]=Kn());}Li(dr.prototype,ei,{attach:function attach(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(this._domListeners&&this._domListeners[t])return;var i=this._createDomListener(t,!!n.useCapture);this._domNode.addEventListener(t,i,!!n.useCapture),this._domListeners||(this._domListeners={}),this._domListeners[t]=i;},detach:function detach(t){var e;!this._domListeners[t]||(e=this._events[t])&&e.callbacks.length||this._domListeners[t].removeListener();},_createDomListener:function _createDomListener(t,e){var _this28=this;var n=function n(e){_this28.fire(t,e);};return n.removeListener=function(){_this28._domNode.removeEventListener(t,n,e),delete _this28._domListeners[t];},n;}});var hr=/*#__PURE__*/function(){function hr(t){_classCallCheck(this,hr);this.view=t,this.document=t.document,this.isEnabled=!1;}_createClass(hr,[{key:\"enable\",value:function enable(){this.isEnabled=!0;}},{key:\"disable\",value:function disable(){this.isEnabled=!1;}},{key:\"destroy\",value:function destroy(){this.disable(),this.stopListening();}}]);return hr;}();ci(hr,lr);var fr=\"__lodash_hash_undefined__\";var mr=function mr(t){return this.__data__.set(t,fr),this;};var pr=function pr(t){return this.__data__.has(t);};function gr(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new Pt();++ea))return!1;var l=r.get(t);if(l&&r.get(e))return l==e;var d=-1,u=!0,h=n&vr?new br():void 0;for(r.set(t,e),r.set(e,t);++d=e||n<0||u&&t-l>=r;}function p(){var t=ns();if(m(t))return g(t);a=setTimeout(p,function(t){var n=e-(t-c);return u?ms(n,r-(t-l)):n;}(t));}function g(t){return a=void 0,h&&i?f(t):(i=o=void 0,s);}function b(){var t=ns(),n=m(t);if(i=arguments,o=this,c=t,n){if(void 0===a)return function(t){return l=t,a=setTimeout(p,e),d?f(t):s;}(c);if(u)return a=setTimeout(p,e),f(c);}return void 0===a&&(a=setTimeout(p,e)),s;}return e=us(e)||0,z(n)&&(d=!!n.leading,r=(u=\"maxWait\"in n)?fs(us(n.maxWait)||0,e):r,h=\"trailing\"in n?!!n.trailing:h),b.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=c=o=a=void 0;},b.flush=function(){return void 0===a?s:g(ns());},b;};var gs=/*#__PURE__*/function(_hr3){_inherits(gs,_hr3);var _super13=_createSuper(gs);function gs(t){var _this33;_classCallCheck(this,gs);_this33=_super13.call(this,t),_this33._fireSelectionChangeDoneDebounced=ps(function(t){return _this33.document.fire(\"selectionChangeDone\",t);},200);return _this33;}_createClass(gs,[{key:\"observe\",value:function observe(){var _this34=this;var t=this.document;t.on(\"keydown\",function(e,n){t.selection.isFake&&function(t){return t==bo.arrowright||t==bo.arrowleft||t==bo.arrowup||t==bo.arrowdown;}(n.keyCode)&&_this34.isEnabled&&(n.preventDefault(),_this34._handleSelectionMove(n.keyCode));},{priority:\"lowest\"});}},{key:\"destroy\",value:function destroy(){_get(_getPrototypeOf(gs.prototype),\"destroy\",this).call(this),this._fireSelectionChangeDoneDebounced.cancel();}},{key:\"_handleSelectionMove\",value:function _handleSelectionMove(t){var e=this.document.selection,n=new no(e.getRanges(),{backward:e.isBackward,fake:!1});t!=bo.arrowleft&&t!=bo.arrowup||n.setTo(n.getFirstPosition()),t!=bo.arrowright&&t!=bo.arrowdown||n.setTo(n.getLastPosition());var i={oldSelection:e,newSelection:n,domSelection:null};this.document.fire(\"selectionChange\",i),this._fireSelectionChangeDoneDebounced(i);}}]);return gs;}(hr);var bs=n(1);var ws=/*#__PURE__*/function(_hr4){_inherits(ws,_hr4);var _super14=_createSuper(ws);function ws(t){var _this35;_classCallCheck(this,ws);_this35=_super14.call(this,t),_this35.mutationObserver=t.getObserver(Zr),_this35.selection=_this35.document.selection,_this35.domConverter=t.domConverter,_this35._documents=new WeakSet(),_this35._fireSelectionChangeDoneDebounced=ps(function(t){return _this35.document.fire(\"selectionChangeDone\",t);},200),_this35._clearInfiniteLoopInterval=setInterval(function(){return _this35._clearInfiniteLoop();},1e3),_this35._loopbackCounter=0;return _this35;}_createClass(ws,[{key:\"observe\",value:function observe(t){var _this36=this;var e=t.ownerDocument;this._documents.has(e)||(this.listenTo(e,\"selectionchange\",function(){_this36._handleSelectionChange(e);}),this._documents.add(e));}},{key:\"destroy\",value:function destroy(){_get(_getPrototypeOf(ws.prototype),\"destroy\",this).call(this),clearInterval(this._clearInfiniteLoopInterval),this._fireSelectionChangeDoneDebounced.cancel();}},{key:\"_handleSelectionChange\",value:function _handleSelectionChange(t){if(!this.isEnabled||!this.document.isFocused&&!this.document.isReadOnly)return;this.mutationObserver.flush();var e=t.defaultView.getSelection(),n=this.domConverter.domSelectionToView(e);if(!this.selection.isEqual(n)||!this.domConverter.isDomSelectionCorrect(e))if(++this._loopbackCounter>60)bs.a.warn(\"selectionchange-infinite-loop: Selection change observer detected an infinite rendering loop.\");else if(this.selection.isSimilar(n))this.view.forceRender();else{var _t66={oldSelection:this.selection,newSelection:n,domSelection:e};this.document.fire(\"selectionChange\",_t66),this._fireSelectionChangeDoneDebounced(_t66);}}},{key:\"_clearInfiniteLoop\",value:function _clearInfiniteLoop(){this._loopbackCounter=0;}}]);return ws;}(hr);var _s=/*#__PURE__*/function(_ts2){_inherits(_s,_ts2);var _super15=_createSuper(_s);function _s(t){var _this37;_classCallCheck(this,_s);_this37=_super15.call(this,t),_this37.domEventType=[\"focus\",\"blur\"],_this37.useCapture=!0;var e=_this37.document;e.on(\"focus\",function(){e.isFocused=!0,_this37._renderTimeoutId=setTimeout(function(){return t.forceRender();},50);}),e.on(\"blur\",function(n,i){var o=e.selection.editableElement;null!==o&&o!==i.target||(e.isFocused=!1,t.forceRender());});return _this37;}_createClass(_s,[{key:\"onDomEvent\",value:function onDomEvent(t){this.fire(t.type,t);}},{key:\"destroy\",value:function destroy(){this._renderTimeoutId&&clearTimeout(this._renderTimeoutId),_get(_getPrototypeOf(_s.prototype),\"destroy\",this).call(this);}}]);return _s;}(ts);var ks=/*#__PURE__*/function(_ts3){_inherits(ks,_ts3);var _super16=_createSuper(ks);function ks(t){var _this38;_classCallCheck(this,ks);_this38=_super16.call(this,t),_this38.domEventType=[\"compositionstart\",\"compositionupdate\",\"compositionend\"];var e=_this38.document;e.on(\"compositionstart\",function(){e.isComposing=!0;}),e.on(\"compositionend\",function(){e.isComposing=!1;});return _this38;}_createClass(ks,[{key:\"onDomEvent\",value:function onDomEvent(t){this.fire(t.type,t);}}]);return ks;}(ts);function vs(t){return\"[object Range]\"==Object.prototype.toString.apply(t);}function ys(t){var e=t.ownerDocument.defaultView.getComputedStyle(t);return{top:parseInt(e.borderTopWidth,10),right:parseInt(e.borderRightWidth,10),bottom:parseInt(e.borderBottomWidth,10),left:parseInt(e.borderLeftWidth,10)};}var xs=[\"top\",\"right\",\"bottom\",\"left\",\"width\",\"height\"];var As=/*#__PURE__*/function(){function As(t){_classCallCheck(this,As);var e=vs(t);if(Object.defineProperty(this,\"_source\",{value:t._source||t,writable:!0,enumerable:!1}),Wn(t)||e){var _n62=e?t.startContainer:t;_n62.ownerDocument&&_n62.ownerDocument.body.contains(_n62)||bs.a.warn(\"rect-source-not-in-dom: The source of this rect does not belong to any rendered DOM tree.\",{source:t}),Cs(this,e?As.getDomRangeRects(t)[0]:t.getBoundingClientRect());}else if(cr(t)){var _e65=t.innerWidth,_n63=t.innerHeight;Cs(this,{top:0,right:_e65,bottom:_n63,left:0,width:_e65,height:_n63});}else Cs(this,t);}_createClass(As,[{key:\"clone\",value:function clone(){return new As(this);}},{key:\"moveTo\",value:function moveTo(t,e){return this.top=e,this.right=t+this.width,this.bottom=e+this.height,this.left=t,this;}},{key:\"moveBy\",value:function moveBy(t,e){return this.top+=e,this.right+=t,this.left+=t,this.bottom+=e,this;}},{key:\"getIntersection\",value:function getIntersection(t){var e={top:Math.max(this.top,t.top),right:Math.min(this.right,t.right),bottom:Math.min(this.bottom,t.bottom),left:Math.max(this.left,t.left)};return e.width=e.right-e.left,e.height=e.bottom-e.top,e.width<0||e.height<0?null:new As(e);}},{key:\"getIntersectionArea\",value:function getIntersectionArea(t){var e=this.getIntersection(t);return e?e.getArea():0;}},{key:\"getArea\",value:function getArea(){return this.width*this.height;}},{key:\"getVisible\",value:function getVisible(){var t=this._source;var e=this.clone();if(!Ts(t)){var _n64=t.parentNode||t.commonAncestorContainer;for(;_n64&&!Ts(_n64);){var _t67=new As(_n64),_i46=e.getIntersection(_t67);if(!_i46)return null;_i46.getArea()e.bottom;}function Is(t,e){return t.tope.right;}function Rs(t){return vs(t)?t.startContainer.ownerDocument.defaultView:t.ownerDocument.defaultView;}function Ds(t){if(vs(t)){var _e67=t.commonAncestorContainer;return Do(_e67)&&(_e67=_e67.parentNode),_e67;}return t.parentNode;}function Ls(t,e){var n=Rs(t),i=new As(t);if(n===e)return i;{var _t69=n;for(;_t69!=e;){var _e68=_t69.frameElement,_n67=new As(_e68).excludeScrollbarsAndBorders();i.moveBy(_n67.left,_n67.top),_t69=_t69.parent;}}return i;}Object.assign({},{scrollViewportToShowTarget:Ps,scrollAncestorsToShowTarget:function scrollAncestorsToShowTarget(t){Es(Ds(t),function(){return new As(t);});}});var js=/*#__PURE__*/function(){function js(){var _this39=this;_classCallCheck(this,js);this.document=new ro(),this.domConverter=new rr(),this.domRoots=new Map(),this.set(\"isRenderingInProgress\",!1),this._renderer=new Xo(this.domConverter,this.document.selection),this._renderer.bind(\"isFocused\").to(this.document),this._initialDomRootAttributes=new WeakMap(),this._observers=new Map(),this._ongoingChange=!1,this._postFixersInProgress=!1,this._renderingDisabled=!1,this._hasChangedSinceTheLastRendering=!1,this._writer=new Co(this.document),this.addObserver(Zr),this.addObserver(ws),this.addObserver(_s),this.addObserver(es),this.addObserver(gs),this.addObserver(ks),function(t){t.document.on(\"keydown\",Wo);}(this),yo(this),this.on(\"render\",function(){_this39._render(),_this39.document.fire(\"layoutChanged\"),_this39._hasChangedSinceTheLastRendering=!1;}),this.listenTo(this.document.selection,\"change\",function(){_this39._hasChangedSinceTheLastRendering=!0;});}_createClass(js,[{key:\"attachDomRoot\",value:function attachDomRoot(t){var _this40=this;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:\"main\";var n=this.document.getRoot(e);n._name=t.tagName.toLowerCase();var i={};for(var _i50=0,_Array$from2=Array.from(t.attributes);_i50<_Array$from2.length;_i50++){var _Array$from2$_i=_Array$from2[_i50],_e69=_Array$from2$_i.name,_o26=_Array$from2$_i.value;i[_e69]=_o26,\"class\"===_e69?this._writer.addClass(_o26.split(\" \"),n):this._writer.setAttribute(_e69,_o26,n);}this._initialDomRootAttributes.set(t,i);var o=function o(){_this40._writer.setAttribute(\"contenteditable\",!n.isReadOnly,n),n.isReadOnly?_this40._writer.addClass(\"ck-read-only\",n):_this40._writer.removeClass(\"ck-read-only\",n);};o(),this.domRoots.set(e,t),this.domConverter.bindElements(t,n),this._renderer.markToSync(\"children\",n),this._renderer.markToSync(\"attributes\",n),this._renderer.domDocuments.add(t.ownerDocument),n.on(\"change:children\",function(t,e){return _this40._renderer.markToSync(\"children\",e);}),n.on(\"change:attributes\",function(t,e){return _this40._renderer.markToSync(\"attributes\",e);}),n.on(\"change:text\",function(t,e){return _this40._renderer.markToSync(\"text\",e);}),n.on(\"change:isReadOnly\",function(){return _this40.change(o);}),n.on(\"change\",function(){_this40._hasChangedSinceTheLastRendering=!0;});var _iterator76=_createForOfIteratorHelper(this._observers.values()),_step76;try{for(_iterator76.s();!(_step76=_iterator76.n()).done;){var _n68=_step76.value;_n68.observe(t,e);}}catch(err){_iterator76.e(err);}finally{_iterator76.f();}}},{key:\"detachDomRoot\",value:function detachDomRoot(t){var e=this.domRoots.get(t);Array.from(e.attributes).forEach(function(_ref2){var t=_ref2.name;return e.removeAttribute(t);});var n=this._initialDomRootAttributes.get(e);for(var _t70 in n)e.setAttribute(_t70,n[_t70]);this.domRoots[\"delete\"](t),this.domConverter.unbindDomElement(e);}},{key:\"getDomRoot\",value:function getDomRoot(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:\"main\";return this.domRoots.get(t);}},{key:\"addObserver\",value:function addObserver(t){var e=this._observers.get(t);if(e)return e;e=new t(this),this._observers.set(t,e);var _iterator77=_createForOfIteratorHelper(this.domRoots),_step77;try{for(_iterator77.s();!(_step77=_iterator77.n()).done;){var _step77$value=_slicedToArray(_step77.value,2),_t71=_step77$value[0],_n69=_step77$value[1];e.observe(_n69,_t71);}}catch(err){_iterator77.e(err);}finally{_iterator77.f();}return e.enable(),e;}},{key:\"getObserver\",value:function getObserver(t){return this._observers.get(t);}},{key:\"disableObservers\",value:function disableObservers(){var _iterator78=_createForOfIteratorHelper(this._observers.values()),_step78;try{for(_iterator78.s();!(_step78=_iterator78.n()).done;){var _t72=_step78.value;_t72.disable();}}catch(err){_iterator78.e(err);}finally{_iterator78.f();}}},{key:\"enableObservers\",value:function enableObservers(){var _iterator79=_createForOfIteratorHelper(this._observers.values()),_step79;try{for(_iterator79.s();!(_step79=_iterator79.n()).done;){var _t73=_step79.value;_t73.enable();}}catch(err){_iterator79.e(err);}finally{_iterator79.f();}}},{key:\"scrollToTheSelection\",value:function scrollToTheSelection(){var t=this.document.selection.getFirstRange();t&&Ps({target:this.domConverter.viewRangeToDom(t),viewportOffset:20});}},{key:\"focus\",value:function focus(){if(!this.document.isFocused){var _t74=this.document.selection.editableElement;_t74?(this.domConverter.focus(_t74),this.forceRender()):bs.a.warn(\"view-focus-no-selection: There is no selection in any editable to focus.\");}}},{key:\"change\",value:function change(t){if(this.isRenderingInProgress||this._postFixersInProgress)throw new Gn.b(\"cannot-change-view-tree: Attempting to make changes to the view when it is in an incorrect state: rendering or post-fixers are in progress. This may cause some unexpected behavior and inconsistency between the DOM and the view.\");if(this._ongoingChange)return t(this._writer);this._ongoingChange=!0;var e=t(this._writer);return this._ongoingChange=!1,!this._renderingDisabled&&this._hasChangedSinceTheLastRendering&&(this._postFixersInProgress=!0,this.document._callPostFixers(this._writer),this._postFixersInProgress=!1,this.fire(\"render\")),e;}},{key:\"forceRender\",value:function forceRender(){this._hasChangedSinceTheLastRendering=!0,this.change(function(){});}},{key:\"destroy\",value:function destroy(){var _iterator80=_createForOfIteratorHelper(this._observers.values()),_step80;try{for(_iterator80.s();!(_step80=_iterator80.n()).done;){var _t75=_step80.value;_t75.destroy();}}catch(err){_iterator80.e(err);}finally{_iterator80.f();}this.document.destroy(),this.stopListening();}},{key:\"createPositionAt\",value:function createPositionAt(t,e){return Zi._createAt(t,e);}},{key:\"createPositionAfter\",value:function createPositionAfter(t){return Zi._createAfter(t);}},{key:\"createPositionBefore\",value:function createPositionBefore(t){return Zi._createBefore(t);}},{key:\"createRange\",value:function createRange(t,e){return new Xi(t,e);}},{key:\"createRangeOn\",value:function createRangeOn(t){return Xi._createOn(t);}},{key:\"createRangeIn\",value:function createRangeIn(t){return Xi._createIn(t);}},{key:\"createSelection\",value:function createSelection(t,e,n){return new no(t,e,n);}},{key:\"_disableRendering\",value:function _disableRendering(t){this._renderingDisabled=t,0==t&&this.change(function(){});}},{key:\"_render\",value:function _render(){this.isRenderingInProgress=!0,this.disableObservers(),this._renderer.render(),this.enableObservers(),this.isRenderingInProgress=!1;}}]);return js;}();function Vs(t){return C(t)?pi(t):new Map(t);}ci(js,Fi);var Bs=/*#__PURE__*/function(){function Bs(t){_classCallCheck(this,Bs);this.parent=null,this._attrs=Vs(t);}_createClass(Bs,[{key:\"index\",get:function get(){var t;if(!this.parent)return null;if(null===(t=this.parent.getChildIndex(this)))throw new Gn.b(\"model-node-not-found-in-parent: The node's parent does not contain this node.\");return t;}},{key:\"startOffset\",get:function get(){var t;if(!this.parent)return null;if(null===(t=this.parent.getChildStartOffset(this)))throw new Gn.b(\"model-node-not-found-in-parent: The node's parent does not contain this node.\");return t;}},{key:\"offsetSize\",get:function get(){return 1;}},{key:\"endOffset\",get:function get(){return this.parent?this.startOffset+this.offsetSize:null;}},{key:\"nextSibling\",get:function get(){var t=this.index;return null!==t&&this.parent.getChild(t+1)||null;}},{key:\"previousSibling\",get:function get(){var t=this.index;return null!==t&&this.parent.getChild(t-1)||null;}},{key:\"root\",get:function get(){var t=this;for(;t.parent;)t=t.parent;return t;}},{key:\"document\",get:function get(){return this.root==this?null:this.root.document||null;}},{key:\"getPath\",value:function getPath(){var t=[];var e=this;for(;e.parent;)t.unshift(e.startOffset),e=e.parent;return t;}},{key:\"getAncestors\",value:function getAncestors(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{includeSelf:!1,parentFirst:!1};var e=[];var n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?\"push\":\"unshift\"](n),n=n.parent;return e;}},{key:\"getCommonAncestor\",value:function getCommonAncestor(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var n=this.getAncestors(e),i=t.getAncestors(e);var o=0;for(;n[o]==i[o]&&n[o];)o++;return 0===o?null:n[o-1];}},{key:\"isBefore\",value:function isBefore(t){if(this==t)return!1;if(this.root!==t.root)return!1;var e=this.getPath(),n=t.getPath(),i=li(e,n);switch(i){case\"prefix\":return!0;case\"extension\":return!1;default:return e[i]t.offsetSize)throw new Gn.b(\"model-textproxy-wrong-offsetintext: Given offsetInText value is incorrect.\");if(n<0||e+n>t.offsetSize)throw new Gn.b(\"model-textproxy-wrong-length: Given length value is incorrect.\");this.data=t.data.substring(e,e+n),this.offsetInText=e;}_createClass(Fs,[{key:\"startOffset\",get:function get(){return null!==this.textNode.startOffset?this.textNode.startOffset+this.offsetInText:null;}},{key:\"offsetSize\",get:function get(){return this.data.length;}},{key:\"endOffset\",get:function get(){return null!==this.startOffset?this.startOffset+this.offsetSize:null;}},{key:\"isPartial\",get:function get(){return this.offsetSize!==this.textNode.offsetSize;}},{key:\"parent\",get:function get(){return this.textNode.parent;}},{key:\"root\",get:function get(){return this.textNode.root;}},{key:\"document\",get:function get(){return this.textNode.document;}},{key:\"is\",value:function is(t){return\"textProxy\"==t;}},{key:\"getPath\",value:function getPath(){var t=this.textNode.getPath();return t.length>0&&(t[t.length-1]+=this.offsetInText),t;}},{key:\"getAncestors\",value:function getAncestors(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{includeSelf:!1,parentFirst:!1};var e=[];var n=t.includeSelf?this:this.parent;for(;n;)e[t.parentFirst?\"push\":\"unshift\"](n),n=n.parent;return e;}},{key:\"hasAttribute\",value:function hasAttribute(t){return this.textNode.hasAttribute(t);}},{key:\"getAttribute\",value:function getAttribute(t){return this.textNode.getAttribute(t);}},{key:\"getAttributes\",value:function getAttributes(){return this.textNode.getAttributes();}},{key:\"getAttributeKeys\",value:function getAttributeKeys(){return this.textNode.getAttributeKeys();}}]);return Fs;}();var Us=/*#__PURE__*/function(_Symbol$iterator5){function Us(t){_classCallCheck(this,Us);this._nodes=[],t&&this._insertNodes(0,t);}_createClass(Us,[{key:_Symbol$iterator5,value:function value(){return this._nodes[Symbol.iterator]();}},{key:\"length\",get:function get(){return this._nodes.length;}},{key:\"maxOffset\",get:function get(){return this._nodes.reduce(function(t,e){return t+e.offsetSize;},0);}},{key:\"getNode\",value:function getNode(t){return this._nodes[t]||null;}},{key:\"getNodeIndex\",value:function getNodeIndex(t){var e=this._nodes.indexOf(t);return-1==e?null:e;}},{key:\"getNodeStartOffset\",value:function getNodeStartOffset(t){var e=this.getNodeIndex(t);return null===e?null:this._nodes.slice(0,e).reduce(function(t,e){return t+e.offsetSize;},0);}},{key:\"indexToOffset\",value:function indexToOffset(t){if(t==this._nodes.length)return this.maxOffset;var e=this._nodes[t];if(!e)throw new Gn.b(\"model-nodelist-index-out-of-bounds: Given index cannot be found in the node list.\");return this.getNodeStartOffset(e);}},{key:\"offsetToIndex\",value:function offsetToIndex(t){var e=0;var _iterator81=_createForOfIteratorHelper(this._nodes),_step81;try{for(_iterator81.s();!(_step81=_iterator81.n()).done;){var _n70=_step81.value;if(t>=e&&t1&&arguments[1]!==undefined?arguments[1]:1;return this._nodes.splice(t,e);}},{key:\"toJSON\",value:function toJSON(){return this._nodes.map(function(t){return t.toJSON();});}}]);return Us;}(Symbol.iterator);var Hs=/*#__PURE__*/function(_Bs2){_inherits(Hs,_Bs2);var _super18=_createSuper(Hs);function Hs(t,e,n){var _this42;_classCallCheck(this,Hs);_this42=_super18.call(this,e),_this42.name=t,_this42._children=new Us(),n&&_this42._insertChild(0,n);return _this42;}_createClass(Hs,[{key:\"childCount\",get:function get(){return this._children.length;}},{key:\"maxOffset\",get:function get(){return this._children.maxOffset;}},{key:\"isEmpty\",get:function get(){return 0===this.childCount;}},{key:\"is\",value:function is(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;return e?\"element\"==t&&e==this.name:\"element\"==t||t==this.name||_get(_getPrototypeOf(Hs.prototype),\"is\",this).call(this,t);}},{key:\"getChild\",value:function getChild(t){return this._children.getNode(t);}},{key:\"getChildren\",value:function getChildren(){return this._children[Symbol.iterator]();}},{key:\"getChildIndex\",value:function getChildIndex(t){return this._children.getNodeIndex(t);}},{key:\"getChildStartOffset\",value:function getChildStartOffset(t){return this._children.getNodeStartOffset(t);}},{key:\"offsetToIndex\",value:function offsetToIndex(t){return this._children.offsetToIndex(t);}},{key:\"getNodeByPath\",value:function getNodeByPath(t){var e=this;var _iterator83=_createForOfIteratorHelper(t),_step83;try{for(_iterator83.s();!(_step83=_iterator83.n()).done;){var _n71=_step83.value;e=e.getChild(e.offsetToIndex(_n71));}}catch(err){_iterator83.e(err);}finally{_iterator83.f();}return e;}},{key:\"toJSON\",value:function toJSON(){var t=_get(_getPrototypeOf(Hs.prototype),\"toJSON\",this).call(this);if(t.name=this.name,this._children.length>0){t.children=[];var _iterator84=_createForOfIteratorHelper(this._children),_step84;try{for(_iterator84.s();!(_step84=_iterator84.n()).done;){var _e70=_step84.value;t.children.push(_e70.toJSON());}}catch(err){_iterator84.e(err);}finally{_iterator84.f();}}return t;}},{key:\"_clone\",value:function _clone(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:!1;var e=t?Array.from(this._children).map(function(t){return t._clone(!0);}):null;return new Hs(this.name,this.getAttributes(),e);}},{key:\"_appendChild\",value:function _appendChild(t){this._insertChild(this.childCount,t);}},{key:\"_insertChild\",value:function _insertChild(t,e){var n=function(t){if(\"string\"==typeof t)return[new zs(t)];gi(t)||(t=[t]);return Array.from(t).map(function(t){return\"string\"==typeof t?new zs(t):t instanceof Fs?new zs(t.data,t.getAttributes()):t;});}(e);var _iterator85=_createForOfIteratorHelper(n),_step85;try{for(_iterator85.s();!(_step85=_iterator85.n()).done;){var _t77=_step85.value;null!==_t77.parent&&_t77._remove(),_t77.parent=this;}}catch(err){_iterator85.e(err);}finally{_iterator85.f();}this._children._insertNodes(t,n);}},{key:\"_removeChildren\",value:function _removeChildren(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var n=this._children._removeNodes(t,e);var _iterator86=_createForOfIteratorHelper(n),_step86;try{for(_iterator86.s();!(_step86=_iterator86.n()).done;){var _t78=_step86.value;_t78.parent=null;}}catch(err){_iterator86.e(err);}finally{_iterator86.f();}return n;}}],[{key:\"fromJSON\",value:function fromJSON(t){var e=null;if(t.children){e=[];var _iterator87=_createForOfIteratorHelper(t.children),_step87;try{for(_iterator87.s();!(_step87=_iterator87.n()).done;){var _n72=_step87.value;_n72.name?e.push(Hs.fromJSON(_n72)):e.push(zs.fromJSON(_n72));}}catch(err){_iterator87.e(err);}finally{_iterator87.f();}}return new Hs(t.name,t.attributes,e);}}]);return Hs;}(Bs);var qs=/*#__PURE__*/function(_Symbol$iterator6){function qs(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,qs);if(!t.boundaries&&!t.startPosition)throw new Gn.b(\"model-tree-walker-no-start-position: Neither boundaries nor starting position have been defined.\");var e=t.direction||\"forward\";if(\"forward\"!=e&&\"backward\"!=e)throw new Gn.b(\"model-tree-walker-unknown-direction: Only `backward` and `forward` direction allowed.\",{direction:e});this.direction=e,this.boundaries=t.boundaries||null,t.startPosition?this.position=t.startPosition.clone():this.position=$s._createAt(this.boundaries[\"backward\"==this.direction?\"end\":\"start\"]),this.position.stickiness=\"toNone\",this.singleCharacters=!!t.singleCharacters,this.shallow=!!t.shallow,this.ignoreElementEnd=!!t.ignoreElementEnd,this._boundaryStartParent=this.boundaries?this.boundaries.start.parent:null,this._boundaryEndParent=this.boundaries?this.boundaries.end.parent:null,this._visitedParent=this.position.parent;}_createClass(qs,[{key:_Symbol$iterator6,value:function value(){return this;}},{key:\"skip\",value:function skip(t){var e,n,i,o;do{var _this$next2;i=this.position,o=this._visitedParent,(_this$next2=this.next(),e=_this$next2.done,n=_this$next2.value);}while(!e&&t(n));e||(this.position=i,this._visitedParent=o);}},{key:\"next\",value:function next(){return\"forward\"==this.direction?this._next():this._previous();}},{key:\"_next\",value:function _next(){var t=this.position,e=this.position.clone(),n=this._visitedParent;if(null===n.parent&&e.offset===n.maxOffset)return{done:!0};if(n===this._boundaryEndParent&&e.offset==this.boundaries.end.offset)return{done:!0};var i=e.textNode?e.textNode:e.nodeAfter;if(i instanceof Hs)return this.shallow?e.offset++:(e.path.push(0),this._visitedParent=i),this.position=e,Ws(\"elementStart\",i,t,e,1);if(i instanceof zs){var _o27;if(this.singleCharacters)_o27=1;else{var _t79=i.endOffset;this._boundaryEndParent==n&&this.boundaries.end.offset<_t79&&(_t79=this.boundaries.end.offset),_o27=_t79-e.offset;}var _r11=e.offset-i.startOffset,_s10=new Fs(i,_r11,_o27);return e.offset+=_o27,this.position=e,Ws(\"text\",_s10,t,e,_o27);}return e.path.pop(),e.offset++,this.position=e,this._visitedParent=n.parent,this.ignoreElementEnd?this._next():Ws(\"elementEnd\",n,t,e);}},{key:\"_previous\",value:function _previous(){var t=this.position,e=this.position.clone(),n=this._visitedParent;if(null===n.parent&&0===e.offset)return{done:!0};if(n==this._boundaryStartParent&&e.offset==this.boundaries.start.offset)return{done:!0};var i=e.textNode?e.textNode:e.nodeBefore;if(i instanceof Hs)return e.offset--,this.shallow?(this.position=e,Ws(\"elementStart\",i,t,e,1)):(e.path.push(i.maxOffset),this.position=e,this._visitedParent=i,this.ignoreElementEnd?this._previous():Ws(\"elementEnd\",i,t,e));if(i instanceof zs){var _o28;if(this.singleCharacters)_o28=1;else{var _t80=i.startOffset;this._boundaryStartParent==n&&this.boundaries.start.offset>_t80&&(_t80=this.boundaries.start.offset),_o28=e.offset-_t80;}var _r12=e.offset-i.startOffset,_s11=new Fs(i,_r12-_o28,_o28);return e.offset-=_o28,this.position=e,Ws(\"text\",_s11,t,e,_o28);}return e.path.pop(),this.position=e,this._visitedParent=n.parent,Ws(\"elementStart\",n,t,e,1);}}]);return qs;}(Symbol.iterator);function Ws(t,e,n,i,o){return{done:!1,value:{type:t,item:e,previousPosition:n,nextPosition:i,length:o}};}var Ys=function Ys(t){var e=null==t?0:t.length;return e?t[e-1]:void 0;};var $s=/*#__PURE__*/function(){function $s(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:\"toNone\";_classCallCheck(this,$s);if(!t.is(\"element\")&&!t.is(\"documentFragment\"))throw new Gn.b(\"model-position-root-invalid: Position root invalid.\");if(!(e instanceof Array)||0===e.length)throw new Gn.b(\"model-position-path-incorrect: Position path must be an array with at least one item.\",{path:e});e=t.getPath().concat(e),t=t.root,this.root=t,this.path=e,this.stickiness=n;}_createClass($s,[{key:\"offset\",get:function get(){return Ys(this.path);},set:function set(t){this.path[this.path.length-1]=t;}},{key:\"parent\",get:function get(){var t=this.root;for(var _e71=0;_e711&&arguments[1]!==undefined?arguments[1]:{};e.startPosition=this;var n=new qs(e);return n.skip(t),n.position;}},{key:\"getParentPath\",value:function getParentPath(){return this.path.slice(0,-1);}},{key:\"getAncestors\",value:function getAncestors(){return this.parent.is(\"documentFragment\")?[this.parent]:this.parent.getAncestors({includeSelf:!0});}},{key:\"getCommonPath\",value:function getCommonPath(t){if(this.root!=t.root)return[];var e=li(this.path,t.path),n=\"string\"==typeof e?Math.min(this.path.length,t.path.length):e;return this.path.slice(0,n);}},{key:\"getCommonAncestor\",value:function getCommonAncestor(t){var e=this.getAncestors(),n=t.getAncestors();var i=0;for(;e[i]==n[i]&&e[i];)i++;return 0===i?null:e[i-1];}},{key:\"getShiftedBy\",value:function getShiftedBy(t){var e=this.clone(),n=e.offset+t;return e.offset=n<0?0:n,e;}},{key:\"isAfter\",value:function isAfter(t){return\"after\"==this.compareWith(t);}},{key:\"isBefore\",value:function isBefore(t){return\"before\"==this.compareWith(t);}},{key:\"isEqual\",value:function isEqual(t){return\"same\"==this.compareWith(t);}},{key:\"isTouching\",value:function isTouching(t){var e=null,n=null;switch(this.compareWith(t)){case\"same\":return!0;case\"before\":e=$s._createAt(this),n=$s._createAt(t);break;case\"after\":e=$s._createAt(t),n=$s._createAt(this);break;default:return!1;}var i=e.parent;for(;e.path.length+n.path.length;){if(e.isEqual(n))return!0;if(e.path.length>n.path.length){if(e.offset!==i.maxOffset)return!1;e.path=e.path.slice(0,-1),i=i.parent,e.offset++;}else{if(0!==n.offset)return!1;n.path=n.path.slice(0,-1);}}}},{key:\"hasSameParentAs\",value:function hasSameParentAs(t){if(this.root!==t.root)return!1;return\"same\"==li(this.getParentPath(),t.getParentPath());}},{key:\"getTransformedByOperation\",value:function getTransformedByOperation(t){var e;switch(t.type){case\"insert\":e=this._getTransformedByInsertOperation(t);break;case\"move\":case\"remove\":case\"reinsert\":e=this._getTransformedByMoveOperation(t);break;case\"split\":e=this._getTransformedBySplitOperation(t);break;case\"merge\":e=this._getTransformedByMergeOperation(t);break;default:e=$s._createAt(this);}return e;}},{key:\"_getTransformedByInsertOperation\",value:function _getTransformedByInsertOperation(t){return this._getTransformedByInsertion(t.position,t.howMany);}},{key:\"_getTransformedByMoveOperation\",value:function _getTransformedByMoveOperation(t){return this._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany);}},{key:\"_getTransformedBySplitOperation\",value:function _getTransformedBySplitOperation(t){var e=t.movedRange;return e.containsPosition(this)||e.start.isEqual(this)&&\"toNext\"==this.stickiness?this._getCombined(t.splitPosition,t.moveTargetPosition):t.graveyardPosition?this._getTransformedByMove(t.graveyardPosition,t.insertionPosition,1):this._getTransformedByInsertion(t.insertionPosition,1);}},{key:\"_getTransformedByMergeOperation\",value:function _getTransformedByMergeOperation(t){var e=t.movedRange;var n;return e.containsPosition(this)||e.start.isEqual(this)?(n=this._getCombined(t.sourcePosition,t.targetPosition),t.sourcePosition.isBefore(t.targetPosition)&&(n=n._getTransformedByDeletion(t.deletionPosition,1))):n=this.isEqual(t.deletionPosition)?$s._createAt(t.deletionPosition):this._getTransformedByMove(t.deletionPosition,t.graveyardPosition,1),n;}},{key:\"_getTransformedByDeletion\",value:function _getTransformedByDeletion(t,e){var n=$s._createAt(this);if(this.root!=t.root)return n;if(\"same\"==li(t.getParentPath(),this.getParentPath())){if(t.offsetthis.offset)return null;n.offset-=e;}}else if(\"prefix\"==li(t.getParentPath(),this.getParentPath())){var _i51=t.path.length-1;if(t.offset<=this.path[_i51]){if(t.offset+e>this.path[_i51])return null;n.path[_i51]-=e;}}return n;}},{key:\"_getTransformedByInsertion\",value:function _getTransformedByInsertion(t,e){var n=$s._createAt(this);if(this.root!=t.root)return n;if(\"same\"==li(t.getParentPath(),this.getParentPath()))(t.offset1&&arguments[1]!==undefined?arguments[1]:null;_classCallCheck(this,Gs);this.start=$s._createAt(t),this.end=e?$s._createAt(e):$s._createAt(t),this.start.stickiness=this.isCollapsed?\"toNone\":\"toNext\",this.end.stickiness=this.isCollapsed?\"toNone\":\"toPrevious\";}_createClass(Gs,[{key:_Symbol$iterator7,value:/*#__PURE__*/_regeneratorRuntime().mark(function value(){return _regeneratorRuntime().wrap(function value$(_context11){while(1)switch(_context11.prev=_context11.next){case 0:return _context11.delegateYield(new qs({boundaries:this,ignoreElementEnd:!0}),\"t0\",1);case 1:case\"end\":return _context11.stop();}},value,this);})},{key:\"isCollapsed\",get:function get(){return this.start.isEqual(this.end);}},{key:\"isFlat\",get:function get(){return\"same\"==li(this.start.getParentPath(),this.end.getParentPath());}},{key:\"root\",get:function get(){return this.start.root;}},{key:\"containsPosition\",value:function containsPosition(t){return t.isAfter(this.start)&&t.isBefore(this.end);}},{key:\"containsRange\",value:function containsRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;t.isCollapsed&&(e=!1);var n=this.containsPosition(t.start)||e&&this.start.isEqual(t.start),i=this.containsPosition(t.end)||e&&this.end.isEqual(t.end);return n&&i;}},{key:\"containsItem\",value:function containsItem(t){var e=$s._createBefore(t);return this.containsPosition(e)||this.start.isEqual(e);}},{key:\"isEqual\",value:function isEqual(t){return this.start.isEqual(t.start)&&this.end.isEqual(t.end);}},{key:\"isIntersecting\",value:function isIntersecting(t){return this.start.isBefore(t.end)&&this.end.isAfter(t.start);}},{key:\"getDifference\",value:function getDifference(t){var e=[];return this.isIntersecting(t)?(this.containsPosition(t.start)&&e.push(new Gs(this.start,t.start)),this.containsPosition(t.end)&&e.push(new Gs(t.end,this.end))):e.push(new Gs(this.start,this.end)),e;}},{key:\"getIntersection\",value:function getIntersection(t){if(this.isIntersecting(t)){var _e72=this.start,_n75=this.end;return this.containsPosition(t.start)&&(_e72=t.start),this.containsPosition(t.end)&&(_n75=t.end),new Gs(_e72,_n75);}return null;}},{key:\"getMinimalFlatRanges\",value:function getMinimalFlatRanges(){var t=[],e=this.start.getCommonPath(this.end).length,n=$s._createAt(this.start);var i=n.parent;for(;n.path.length>e+1;){var _e73=i.maxOffset-n.offset;0!==_e73&&t.push(new Gs(n,n.getShiftedBy(_e73))),n.path=n.path.slice(0,-1),n.offset++,i=i.parent;}for(;n.path.length<=this.end.path.length;){var _e74=this.end.path[n.path.length-1],_i54=_e74-n.offset;0!==_i54&&t.push(new Gs(n,n.getShiftedBy(_i54))),n.offset=_e74,n.path.push(0);}return t;}},{key:\"getWalker\",value:function getWalker(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return t.boundaries=this,new qs(t);}},{key:\"getItems\",value:function getItems(){var _this43=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return/*#__PURE__*/_regeneratorRuntime().mark(function _callee5(){var e,_iterator88,_step88,_t81;return _regeneratorRuntime().wrap(function _callee5$(_context12){while(1)switch(_context12.prev=_context12.next){case 0:t.boundaries=_this43,t.ignoreElementEnd=!0;e=new qs(t);_iterator88=_createForOfIteratorHelper(e);_context12.prev=3;_iterator88.s();case 5:if((_step88=_iterator88.n()).done){_context12.next=11;break;}_t81=_step88.value;_context12.next=9;return _t81.item;case 9:_context12.next=5;break;case 11:_context12.next=16;break;case 13:_context12.prev=13;_context12.t0=_context12[\"catch\"](3);_iterator88.e(_context12.t0);case 16:_context12.prev=16;_iterator88.f();return _context12.finish(16);case 19:case\"end\":return _context12.stop();}},_callee5,null,[[3,13,16,19]]);})();}},{key:\"getPositions\",value:function getPositions(){var _this44=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};return/*#__PURE__*/_regeneratorRuntime().mark(function _callee6(){var e,_iterator89,_step89,_t82;return _regeneratorRuntime().wrap(function _callee6$(_context13){while(1)switch(_context13.prev=_context13.next){case 0:t.boundaries=_this44;e=new qs(t);_context13.next=4;return e.position;case 4:_iterator89=_createForOfIteratorHelper(e);_context13.prev=5;_iterator89.s();case 7:if((_step89=_iterator89.n()).done){_context13.next=13;break;}_t82=_step89.value;_context13.next=11;return _t82.nextPosition;case 11:_context13.next=7;break;case 13:_context13.next=18;break;case 15:_context13.prev=15;_context13.t0=_context13[\"catch\"](5);_iterator89.e(_context13.t0);case 18:_context13.prev=18;_iterator89.f();return _context13.finish(18);case 21:case\"end\":return _context13.stop();}},_callee6,null,[[5,15,18,21]]);})();}},{key:\"getTransformedByOperation\",value:function getTransformedByOperation(t){switch(t.type){case\"insert\":return this._getTransformedByInsertOperation(t);case\"move\":case\"remove\":case\"reinsert\":return this._getTransformedByMoveOperation(t);case\"split\":return[this._getTransformedBySplitOperation(t)];case\"merge\":return[this._getTransformedByMergeOperation(t)];}return[new Gs(this.start,this.end)];}},{key:\"getTransformedByOperations\",value:function getTransformedByOperations(t){var e=[new Gs(this.start,this.end)];var _iterator90=_createForOfIteratorHelper(t),_step90;try{for(_iterator90.s();!(_step90=_iterator90.n()).done;){var _n77=_step90.value;for(var _t85=0;_t851&&arguments[1]!==undefined?arguments[1]:!1;return this._getTransformedByInsertion(t.position,t.howMany,e);}},{key:\"_getTransformedByMoveOperation\",value:function _getTransformedByMoveOperation(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=t.sourcePosition,i=t.howMany,o=t.targetPosition;return this._getTransformedByMove(n,o,i,e);}},{key:\"_getTransformedBySplitOperation\",value:function _getTransformedBySplitOperation(t){var e=this.start._getTransformedBySplitOperation(t);var n=this.end._getTransformedBySplitOperation(t);return this.end.isEqual(t.insertionPosition)&&(n=this.end.getShiftedBy(1)),e.root!=n.root&&(n=this.end.getShiftedBy(-1)),new Gs(e,n);}},{key:\"_getTransformedByMergeOperation\",value:function _getTransformedByMergeOperation(t){if(this.start.isEqual(t.targetPosition)&&this.end.isEqual(t.deletionPosition))return new Gs(this.start);var e=this.start._getTransformedByMergeOperation(t),n=this.end._getTransformedByMergeOperation(t);return e.root!=n.root&&(n=this.end.getShiftedBy(-1)),e.isAfter(n)?(t.sourcePosition.isBefore(t.targetPosition)?(e=$s._createAt(n)).offset=0:(t.deletionPosition.isEqual(e)||(n=t.deletionPosition),e=t.targetPosition),new Gs(e,n)):new Gs(e,n);}},{key:\"_getTransformedByInsertion\",value:function _getTransformedByInsertion(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;if(n&&this.containsPosition(t))return[new Gs(this.start,t),new Gs(t.getShiftedBy(e),this.end._getTransformedByInsertion(t,e))];{var _n78=new Gs(this.start,this.end);return _n78.start=_n78.start._getTransformedByInsertion(t,e),_n78.end=_n78.end._getTransformedByInsertion(t,e),[_n78];}}},{key:\"_getTransformedByMove\",value:function _getTransformedByMove(t,e,n){var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;if(this.isCollapsed){var _i57=this.start._getTransformedByMove(t,e,n);return[new Gs(_i57)];}var o=Gs._createFromPositionAndShift(t,n),r=e._getTransformedByDeletion(t,n);if(this.containsPosition(e)&&!i&&(o.containsPosition(this.start)||o.containsPosition(this.end))){var _i58=this.start._getTransformedByMove(t,e,n),_o29=this.end._getTransformedByMove(t,e,n);return[new Gs(_i58,_o29)];}var s;var a=this.getDifference(o);var c=null;var l=this.getIntersection(o);if(1==a.length?c=new Gs(a[0].start._getTransformedByDeletion(t,n),a[0].end._getTransformedByDeletion(t,n)):2==a.length&&(c=new Gs(this.start,this.end._getTransformedByDeletion(t,n))),s=c?c._getTransformedByInsertion(r,n,null!==l||i):[],l){var _t86=new Gs(l.start._getCombined(o.start,r),l.end._getCombined(o.start,r));2==s.length?s.splice(1,0,_t86):s.push(_t86);}return s;}},{key:\"_getTransformedByDeletion\",value:function _getTransformedByDeletion(t,e){var n=this.start._getTransformedByDeletion(t,e),i=this.end._getTransformedByDeletion(t,e);return null==n&&null==i?null:(null==n&&(n=t),null==i&&(i=t),new Gs(n,i));}}],[{key:\"_createFromPositionAndShift\",value:function _createFromPositionAndShift(t,e){var n=t,i=t.getShiftedBy(e);return e>0?new this(n,i):new this(i,n);}},{key:\"_createIn\",value:function _createIn(t){return new this($s._createAt(t,0),$s._createAt(t,t.maxOffset));}},{key:\"_createOn\",value:function _createOn(t){return this._createFromPositionAndShift($s._createBefore(t),t.offsetSize);}},{key:\"_createFromRanges\",value:function _createFromRanges(t){if(0===t.length)throw new Gn.b(\"range-create-from-ranges-empty-array: At least one range has to be passed.\");if(1==t.length)return t[0].clone();var e=t[0];t.sort(function(t,e){return t.start.isAfter(e.start)?1:-1;});var n=t.indexOf(e),i=new this(e.start,e.end);if(n>0)for(var _e75=n-1;t[_e75].end.isEqual(i.start);_e75++)i.start=$s._createAt(t[_e75].start);for(var _e76=n+1;_e761&&arguments[1]!==undefined?arguments[1]:{isPhantom:!1};var n={modelPosition:t,mapper:this,isPhantom:e.isPhantom};return this.fire(\"modelToViewPosition\",n),n.viewPosition;}},{key:\"markerNameToElements\",value:function markerNameToElements(t){var e=this._markerNameToElements.get(t);if(!e)return null;var n=new Set();var _iterator91=_createForOfIteratorHelper(e),_step91;try{for(_iterator91.s();!(_step91=_iterator91.n()).done;){var _t87=_step91.value;if(_t87.is(\"attributeElement\")){var _iterator92=_createForOfIteratorHelper(_t87.getElementsWithSameId()),_step92;try{for(_iterator92.s();!(_step92=_iterator92.n()).done;){var _e77=_step92.value;n.add(_e77);}}catch(err){_iterator92.e(err);}finally{_iterator92.f();}}else n.add(_t87);}}catch(err){_iterator91.e(err);}finally{_iterator91.f();}return n;}},{key:\"registerViewToModelLength\",value:function registerViewToModelLength(t,e){this._viewToModelLengthCallbacks.set(t,e);}},{key:\"findMappedViewAncestor\",value:function findMappedViewAncestor(t){var e=t.parent;for(;!this._viewToModelMapping.has(e);)e=e.parent;return e;}},{key:\"_toModelOffset\",value:function _toModelOffset(t,e,n){if(n!=t){return this._toModelOffset(t.parent,t.index,n)+this._toModelOffset(t,e,t);}if(t.is(\"text\"))return e;var i=0;for(var _n79=0;_n791?e[0]+\":\"+e[1]:e[0];}var Zs=/*#__PURE__*/function(){function Zs(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Zs);this.conversionApi=Li({dispatcher:this},t);}_createClass(Zs,[{key:\"convertChanges\",value:function convertChanges(t,e){var _iterator94=_createForOfIteratorHelper(t.getMarkersToRemove()),_step94;try{for(_iterator94.s();!(_step94=_iterator94.n()).done;){var _n81=_step94.value;this.convertMarkerRemove(_n81.name,_n81.range,e);}}catch(err){_iterator94.e(err);}finally{_iterator94.f();}var _iterator95=_createForOfIteratorHelper(t.getChanges()),_step95;try{for(_iterator95.s();!(_step95=_iterator95.n()).done;){var _n82=_step95.value;\"insert\"==_n82.type?this.convertInsert(Gs._createFromPositionAndShift(_n82.position,_n82.length),e):\"remove\"==_n82.type?this.convertRemove(_n82.position,_n82.length,_n82.name,e):this.convertAttribute(_n82.range,_n82.attributeKey,_n82.attributeOldValue,_n82.attributeNewValue,e);}}catch(err){_iterator95.e(err);}finally{_iterator95.f();}var _iterator96=_createForOfIteratorHelper(t.getMarkersToAdd()),_step96;try{for(_iterator96.s();!(_step96=_iterator96.n()).done;){var _n83=_step96.value;this.convertMarkerAdd(_n83.name,_n83.range,e);}}catch(err){_iterator96.e(err);}finally{_iterator96.f();}}},{key:\"convertInsert\",value:function convertInsert(t,e){this.conversionApi.writer=e,this.conversionApi.consumable=this._createInsertConsumable(t);var _iterator97=_createForOfIteratorHelper(t),_step97;try{for(_iterator97.s();!(_step97=_iterator97.n()).done;){var _e79=_step97.value;var _t88=_e79.item,_n84={item:_t88,range:Gs._createFromPositionAndShift(_e79.previousPosition,_e79.length)};this._testAndFire(\"insert\",_n84);var _iterator98=_createForOfIteratorHelper(_t88.getAttributeKeys()),_step98;try{for(_iterator98.s();!(_step98=_iterator98.n()).done;){var _e80=_step98.value;_n84.attributeKey=_e80,_n84.attributeOldValue=null,_n84.attributeNewValue=_t88.getAttribute(_e80),this._testAndFire(\"attribute:\".concat(_e80),_n84);}}catch(err){_iterator98.e(err);}finally{_iterator98.f();}}}catch(err){_iterator97.e(err);}finally{_iterator97.f();}this._clearConversionApi();}},{key:\"convertRemove\",value:function convertRemove(t,e,n,i){this.conversionApi.writer=i,this.fire(\"remove:\"+n,{position:t,length:e},this.conversionApi),this._clearConversionApi();}},{key:\"convertAttribute\",value:function convertAttribute(t,e,n,i,o){this.conversionApi.writer=o,this.conversionApi.consumable=this._createConsumableForRange(t,\"attribute:\".concat(e));var _iterator99=_createForOfIteratorHelper(t),_step99;try{for(_iterator99.s();!(_step99=_iterator99.n()).done;){var _o30=_step99.value;var _t89={item:_o30.item,range:Gs._createFromPositionAndShift(_o30.previousPosition,_o30.length),attributeKey:e,attributeOldValue:n,attributeNewValue:i};this._testAndFire(\"attribute:\".concat(e),_t89);}}catch(err){_iterator99.e(err);}finally{_iterator99.f();}this._clearConversionApi();}},{key:\"convertSelection\",value:function convertSelection(t,e,n){var i=Array.from(e.getMarkersAtPosition(t.getFirstPosition()));if(this.conversionApi.writer=n,this.conversionApi.consumable=this._createSelectionConsumable(t,i),this.fire(\"selection\",{selection:t},this.conversionApi),t.isCollapsed){var _iterator100=_createForOfIteratorHelper(i),_step100;try{for(_iterator100.s();!(_step100=_iterator100.n()).done;){var _e81=_step100.value;var _n85=_e81.getRange();if(!Xs(t.getFirstPosition(),_e81,this.conversionApi.mapper))continue;var _i60={item:t,markerName:_e81.name,markerRange:_n85};this.conversionApi.consumable.test(t,\"addMarker:\"+_e81.name)&&this.fire(\"addMarker:\"+_e81.name,_i60,this.conversionApi);}}catch(err){_iterator100.e(err);}finally{_iterator100.f();}var _iterator101=_createForOfIteratorHelper(t.getAttributeKeys()),_step101;try{for(_iterator101.s();!(_step101=_iterator101.n()).done;){var _e82=_step101.value;var _n86={item:t,range:t.getFirstRange(),attributeKey:_e82,attributeOldValue:null,attributeNewValue:t.getAttribute(_e82)};this.conversionApi.consumable.test(t,\"attribute:\"+_n86.attributeKey)&&this.fire(\"attribute:\"+_n86.attributeKey+\":$text\",_n86,this.conversionApi);}}catch(err){_iterator101.e(err);}finally{_iterator101.f();}this._clearConversionApi();}}},{key:\"convertMarkerAdd\",value:function convertMarkerAdd(t,e,n){if(!e.root.document||\"$graveyard\"==e.root.rootName)return;this.conversionApi.writer=n;var i=\"addMarker:\"+t,o=new Js();if(o.add(e,i),this.conversionApi.consumable=o,this.fire(i,{markerName:t,markerRange:e},this.conversionApi),o.test(e,i)){this.conversionApi.consumable=this._createConsumableForRange(e,i);var _iterator102=_createForOfIteratorHelper(e.getItems()),_step102;try{for(_iterator102.s();!(_step102=_iterator102.n()).done;){var _n87=_step102.value;if(!this.conversionApi.consumable.test(_n87,i))continue;var _o31={item:_n87,range:Gs._createOn(_n87),markerName:t,markerRange:e};this.fire(i,_o31,this.conversionApi);}}catch(err){_iterator102.e(err);}finally{_iterator102.f();}this._clearConversionApi();}}},{key:\"convertMarkerRemove\",value:function convertMarkerRemove(t,e,n){e.root.document&&\"$graveyard\"!=e.root.rootName&&(this.conversionApi.writer=n,this.fire(\"removeMarker:\"+t,{markerName:t,markerRange:e},this.conversionApi),this._clearConversionApi());}},{key:\"_createInsertConsumable\",value:function _createInsertConsumable(t){var e=new Js();var _iterator103=_createForOfIteratorHelper(t),_step103;try{for(_iterator103.s();!(_step103=_iterator103.n()).done;){var _n88=_step103.value;var _t90=_n88.item;e.add(_t90,\"insert\");var _iterator104=_createForOfIteratorHelper(_t90.getAttributeKeys()),_step104;try{for(_iterator104.s();!(_step104=_iterator104.n()).done;){var _n89=_step104.value;e.add(_t90,\"attribute:\"+_n89);}}catch(err){_iterator104.e(err);}finally{_iterator104.f();}}}catch(err){_iterator103.e(err);}finally{_iterator103.f();}return e;}},{key:\"_createConsumableForRange\",value:function _createConsumableForRange(t,e){var n=new Js();var _iterator105=_createForOfIteratorHelper(t.getItems()),_step105;try{for(_iterator105.s();!(_step105=_iterator105.n()).done;){var _i61=_step105.value;n.add(_i61,e);}}catch(err){_iterator105.e(err);}finally{_iterator105.f();}return n;}},{key:\"_createSelectionConsumable\",value:function _createSelectionConsumable(t,e){var n=new Js();n.add(t,\"selection\");var _iterator106=_createForOfIteratorHelper(e),_step106;try{for(_iterator106.s();!(_step106=_iterator106.n()).done;){var _i62=_step106.value;n.add(t,\"addMarker:\"+_i62.name);}}catch(err){_iterator106.e(err);}finally{_iterator106.f();}var _iterator107=_createForOfIteratorHelper(t.getAttributeKeys()),_step107;try{for(_iterator107.s();!(_step107=_iterator107.n()).done;){var _e83=_step107.value;n.add(t,\"attribute:\"+_e83);}}catch(err){_iterator107.e(err);}finally{_iterator107.f();}return n;}},{key:\"_testAndFire\",value:function _testAndFire(t,e){if(!this.conversionApi.consumable.test(e.item,t))return;var n=e.item.name||\"$text\";this.fire(t+\":\"+n,e,this.conversionApi);}},{key:\"_clearConversionApi\",value:function _clearConversionApi(){delete this.conversionApi.writer,delete this.conversionApi.consumable;}}]);return Zs;}();function Xs(t,e,n){var i=e.getRange(),o=Array.from(t.getAncestors());return o.shift(),o.reverse(),!o.some(function(t){if(i.containsItem(t)){return!!n.toViewElement(t).getCustomProperty(\"addHighlight\");}});}ci(Zs,ei);var ta=/*#__PURE__*/function(){function ta(t,e,n){_classCallCheck(this,ta);this._lastRangeBackward=!1,this._ranges=[],this._attrs=new Map(),t&&this.setTo(t,e,n);}_createClass(ta,[{key:\"anchor\",get:function get(){if(this._ranges.length>0){var _t91=this._ranges[this._ranges.length-1];return this._lastRangeBackward?_t91.end:_t91.start;}return null;}},{key:\"focus\",get:function get(){if(this._ranges.length>0){var _t92=this._ranges[this._ranges.length-1];return this._lastRangeBackward?_t92.start:_t92.end;}return null;}},{key:\"isCollapsed\",get:function get(){return 1===this._ranges.length&&this._ranges[0].isCollapsed;}},{key:\"rangeCount\",get:function get(){return this._ranges.length;}},{key:\"isBackward\",get:function get(){return!this.isCollapsed&&this._lastRangeBackward;}},{key:\"isEqual\",value:function isEqual(t){if(this.rangeCount!=t.rangeCount)return!1;if(0===this.rangeCount)return!0;if(!this.anchor.isEqual(t.anchor)||!this.focus.isEqual(t.focus))return!1;var _iterator108=_createForOfIteratorHelper(this._ranges),_step108;try{for(_iterator108.s();!(_step108=_iterator108.n()).done;){var _e84=_step108.value;var _n90=!1;var _iterator109=_createForOfIteratorHelper(t._ranges),_step109;try{for(_iterator109.s();!(_step109=_iterator109.n()).done;){var _i63=_step109.value;if(_e84.isEqual(_i63)){_n90=!0;break;}}}catch(err){_iterator109.e(err);}finally{_iterator109.f();}if(!_n90)return!1;}}catch(err){_iterator108.e(err);}finally{_iterator108.f();}return!0;}},{key:\"getRanges\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getRanges(){var _iterator110,_step110,_t93;return _regeneratorRuntime().wrap(function getRanges$(_context14){while(1)switch(_context14.prev=_context14.next){case 0:_iterator110=_createForOfIteratorHelper(this._ranges);_context14.prev=1;_iterator110.s();case 3:if((_step110=_iterator110.n()).done){_context14.next=9;break;}_t93=_step110.value;_context14.next=7;return new Gs(_t93.start,_t93.end);case 7:_context14.next=3;break;case 9:_context14.next=14;break;case 11:_context14.prev=11;_context14.t0=_context14[\"catch\"](1);_iterator110.e(_context14.t0);case 14:_context14.prev=14;_iterator110.f();return _context14.finish(14);case 17:case\"end\":return _context14.stop();}},getRanges,this,[[1,11,14,17]]);})},{key:\"getFirstRange\",value:function getFirstRange(){var t=null;var _iterator111=_createForOfIteratorHelper(this._ranges),_step111;try{for(_iterator111.s();!(_step111=_iterator111.n()).done;){var _e85=_step111.value;t&&!_e85.start.isBefore(t.start)||(t=_e85);}}catch(err){_iterator111.e(err);}finally{_iterator111.f();}return t?new Gs(t.start,t.end):null;}},{key:\"getLastRange\",value:function getLastRange(){var t=null;var _iterator112=_createForOfIteratorHelper(this._ranges),_step112;try{for(_iterator112.s();!(_step112=_iterator112.n()).done;){var _e86=_step112.value;t&&!_e86.end.isAfter(t.end)||(t=_e86);}}catch(err){_iterator112.e(err);}finally{_iterator112.f();}return t?new Gs(t.start,t.end):null;}},{key:\"getFirstPosition\",value:function getFirstPosition(){var t=this.getFirstRange();return t?t.start.clone():null;}},{key:\"getLastPosition\",value:function getLastPosition(){var t=this.getLastRange();return t?t.end.clone():null;}},{key:\"setTo\",value:function setTo(t,e,n){if(null===t)this._setRanges([]);else if(t instanceof ta)this._setRanges(t.getRanges(),t.isBackward);else if(t&&\"function\"==typeof t.getRanges)this._setRanges(t.getRanges(),t.isBackward);else if(t instanceof Gs)this._setRanges([t],!!e&&!!e.backward);else if(t instanceof $s)this._setRanges([new Gs(t)]);else if(t instanceof Bs){var _i64=!!n&&!!n.backward;var _o32;if(\"in\"==e)_o32=Gs._createIn(t);else if(\"on\"==e)_o32=Gs._createOn(t);else{if(void 0===e)throw new Gn.b(\"model-selection-setTo-required-second-parameter: selection.setTo requires the second parameter when the first parameter is a node.\");_o32=new Gs($s._createAt(t,e));}this._setRanges([_o32],_i64);}else{if(!gi(t))throw new Gn.b(\"model-selection-setTo-not-selectable: Cannot set selection to given place.\");this._setRanges(t,e&&!!e.backward);}}},{key:\"_setRanges\",value:function _setRanges(t){var _this46=this;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;var n=(t=Array.from(t)).some(function(t){if(!(t instanceof Gs))throw new Gn.b(\"model-selection-set-ranges-not-range: Selection range set to an object that is not an instance of model.Range.\");return _this46._ranges.every(function(e){return!e.isEqual(t);});});if(t.length!==this._ranges.length||n){this._removeAllRanges();var _iterator113=_createForOfIteratorHelper(t),_step113;try{for(_iterator113.s();!(_step113=_iterator113.n()).done;){var _e87=_step113.value;this._pushRange(_e87);}}catch(err){_iterator113.e(err);}finally{_iterator113.f();}this._lastRangeBackward=!!e,this.fire(\"change:range\",{directChange:!0});}}},{key:\"setFocus\",value:function setFocus(t,e){if(null===this.anchor)throw new Gn.b(\"model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.\");var n=$s._createAt(t,e);if(\"same\"==n.compareWith(this.focus))return;var i=this.anchor;this._ranges.length&&this._popRange(),\"before\"==n.compareWith(i)?(this._pushRange(new Gs(n,i)),this._lastRangeBackward=!0):(this._pushRange(new Gs(i,n)),this._lastRangeBackward=!1),this.fire(\"change:range\",{directChange:!0});}},{key:\"getAttribute\",value:function getAttribute(t){return this._attrs.get(t);}},{key:\"getAttributes\",value:function getAttributes(){return this._attrs.entries();}},{key:\"getAttributeKeys\",value:function getAttributeKeys(){return this._attrs.keys();}},{key:\"hasAttribute\",value:function hasAttribute(t){return this._attrs.has(t);}},{key:\"removeAttribute\",value:function removeAttribute(t){this.hasAttribute(t)&&(this._attrs[\"delete\"](t),this.fire(\"change:attribute\",{attributeKeys:[t],directChange:!0}));}},{key:\"setAttribute\",value:function setAttribute(t,e){this.getAttribute(t)!==e&&(this._attrs.set(t,e),this.fire(\"change:attribute\",{attributeKeys:[t],directChange:!0}));}},{key:\"getSelectedElement\",value:function getSelectedElement(){if(1!==this.rangeCount)return null;var t=this.getFirstRange(),e=t.start.nodeAfter,n=t.end.nodeBefore;return e instanceof Hs&&e==n?e:null;}},{key:\"is\",value:function is(t){return\"selection\"==t;}},{key:\"getSelectedBlocks\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getSelectedBlocks(){var t,_iterator114,_step114,_e88,_n91,_iterator115,_step115,_n92,_i65;return _regeneratorRuntime().wrap(function getSelectedBlocks$(_context15){while(1)switch(_context15.prev=_context15.next){case 0:t=new WeakSet();_iterator114=_createForOfIteratorHelper(this.getRanges());_context15.prev=2;_iterator114.s();case 4:if((_step114=_iterator114.n()).done){_context15.next=37;break;}_e88=_step114.value;_n91=na(_e88.start,t);_context15.t0=_n91;if(!_context15.t0){_context15.next=11;break;}_context15.next=11;return _n91;case 11:_iterator115=_createForOfIteratorHelper(_e88.getWalker());_context15.prev=12;_iterator115.s();case 14:if((_step115=_iterator115.n()).done){_context15.next=22;break;}_n92=_step115.value;_context15.t1=\"elementEnd\"==_n92.type&&ea(_n92.item,t);if(!_context15.t1){_context15.next=20;break;}_context15.next=20;return _n92.item;case 20:_context15.next=14;break;case 22:_context15.next=27;break;case 24:_context15.prev=24;_context15.t2=_context15[\"catch\"](12);_iterator115.e(_context15.t2);case 27:_context15.prev=27;_iterator115.f();return _context15.finish(27);case 30:_i65=na(_e88.end,t);_context15.t3=_i65&&!_e88.end.isTouching($s._createAt(_i65,0));if(!_context15.t3){_context15.next=35;break;}_context15.next=35;return _i65;case 35:_context15.next=4;break;case 37:_context15.next=42;break;case 39:_context15.prev=39;_context15.t4=_context15[\"catch\"](2);_iterator114.e(_context15.t4);case 42:_context15.prev=42;_iterator114.f();return _context15.finish(42);case 45:case\"end\":return _context15.stop();}},getSelectedBlocks,this,[[2,39,42,45],[12,24,27,30]]);})},{key:\"getTopMostBlocks\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getTopMostBlocks(){var t,_i66,_t94,_e89,_n93;return _regeneratorRuntime().wrap(function getTopMostBlocks$(_context16){while(1)switch(_context16.prev=_context16.next){case 0:t=Array.from(this.getSelectedBlocks());_i66=0,_t94=t;case 2:if(!(_i66<_t94.length)){_context16.next=12;break;}_e89=_t94[_i66];_n93=ia(_e89);_context16.t0=_n93&&t.includes(_n93);if(_context16.t0){_context16.next=9;break;}_context16.next=9;return _e89;case 9:_i66++;_context16.next=2;break;case 12:case\"end\":return _context16.stop();}},getTopMostBlocks,this);})},{key:\"containsEntireContent\",value:function containsEntireContent(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.anchor.root;var e=$s._createAt(t,0),n=$s._createAt(t,\"end\");return e.isTouching(this.getFirstPosition())&&n.isTouching(this.getLastPosition());}},{key:\"_pushRange\",value:function _pushRange(t){this._checkRange(t),this._ranges.push(new Gs(t.start,t.end));}},{key:\"_checkRange\",value:function _checkRange(t){for(var _e90=0;_e900;)this._popRange();}},{key:\"_popRange\",value:function _popRange(){this._ranges.pop();}}]);return ta;}();function ea(t,e){return!e.has(t)&&(e.add(t),t.document.model.schema.isBlock(t)&&t.parent);}function na(t,e){var n=t.parent.document.model.schema,i=t.parent.getAncestors({parentFirst:!0,includeSelf:!0});var o=!1;var r=i.find(function(t){return!o&&!(o=n.isLimit(t))&&ea(t,e);});return i.forEach(function(t){return e.add(t);}),r;}function ia(t){var e=t.document.model.schema;var n=t.parent;for(;n;){if(e.isBlock(n))return n;n=n.parent;}}ci(ta,ei);var oa=/*#__PURE__*/function(_Gs){_inherits(oa,_Gs);var _super19=_createSuper(oa);function oa(t,e){var _this47;_classCallCheck(this,oa);_this47=_super19.call(this,t,e),function(){var _this48=this;this.listenTo(this.root.document.model,\"applyOperation\",function(t,e){var n=e[0];n.isDocumentOperation&&function(t){var e=this.getTransformedByOperation(t),n=Gs._createFromRanges(e),i=!n.isEqual(this),o=function(t,e){switch(e.type){case\"insert\":return t.containsPosition(e.position);case\"move\":case\"remove\":case\"reinsert\":case\"merge\":return t.containsPosition(e.sourcePosition)||t.start.isEqual(e.sourcePosition)||t.containsPosition(e.targetPosition);case\"split\":return t.containsPosition(e.splitPosition)||t.containsPosition(e.insertionPosition);}return!1;}(this,t);var r=null;if(i){\"$graveyard\"==n.root.rootName&&(r=\"remove\"==t.type?t.sourcePosition:t.deletionPosition);var _e91=this.toRange();this.start=n.start,this.end=n.end,this.fire(\"change:range\",_e91,{deletionPosition:r});}else o&&this.fire(\"change:content\",this.toRange(),{deletionPosition:r});}.call(_this48,n);},{priority:\"low\"});}.call(_assertThisInitialized(_this47));return _this47;}_createClass(oa,[{key:\"detach\",value:function detach(){this.stopListening();}},{key:\"toRange\",value:function toRange(){return new Gs(this.start,this.end);}}],[{key:\"fromRange\",value:function fromRange(t){return new oa(t.start,t.end);}}]);return oa;}(Gs);ci(oa,ei);var ra=\"selection:\";var sa=/*#__PURE__*/function(){function sa(t){_classCallCheck(this,sa);this._selection=new aa(t),this._selection.delegate(\"change:range\").to(this),this._selection.delegate(\"change:attribute\").to(this);}_createClass(sa,[{key:\"isCollapsed\",get:function get(){return this._selection.isCollapsed;}},{key:\"anchor\",get:function get(){return this._selection.anchor;}},{key:\"focus\",get:function get(){return this._selection.focus;}},{key:\"rangeCount\",get:function get(){return this._selection.rangeCount;}},{key:\"hasOwnRange\",get:function get(){return this._selection.hasOwnRange;}},{key:\"isBackward\",get:function get(){return this._selection.isBackward;}},{key:\"isGravityOverridden\",get:function get(){return this._selection.isGravityOverridden;}},{key:\"markers\",get:function get(){return this._selection.markers;}},{key:\"_ranges\",get:function get(){return this._selection._ranges;}},{key:\"getRanges\",value:function getRanges(){return this._selection.getRanges();}},{key:\"getFirstPosition\",value:function getFirstPosition(){return this._selection.getFirstPosition();}},{key:\"getLastPosition\",value:function getLastPosition(){return this._selection.getLastPosition();}},{key:\"getFirstRange\",value:function getFirstRange(){return this._selection.getFirstRange();}},{key:\"getLastRange\",value:function getLastRange(){return this._selection.getLastRange();}},{key:\"getSelectedBlocks\",value:function getSelectedBlocks(){return this._selection.getSelectedBlocks();}},{key:\"getTopMostBlocks\",value:function getTopMostBlocks(){return this._selection.getTopMostBlocks();}},{key:\"getSelectedElement\",value:function getSelectedElement(){return this._selection.getSelectedElement();}},{key:\"containsEntireContent\",value:function containsEntireContent(t){return this._selection.containsEntireContent(t);}},{key:\"destroy\",value:function destroy(){this._selection.destroy();}},{key:\"getAttributeKeys\",value:function getAttributeKeys(){return this._selection.getAttributeKeys();}},{key:\"getAttributes\",value:function getAttributes(){return this._selection.getAttributes();}},{key:\"getAttribute\",value:function getAttribute(t){return this._selection.getAttribute(t);}},{key:\"hasAttribute\",value:function hasAttribute(t){return this._selection.hasAttribute(t);}},{key:\"is\",value:function is(t){return\"selection\"==t||\"documentSelection\"==t;}},{key:\"_setFocus\",value:function _setFocus(t,e){this._selection.setFocus(t,e);}},{key:\"_setTo\",value:function _setTo(t,e,n){this._selection.setTo(t,e,n);}},{key:\"_setAttribute\",value:function _setAttribute(t,e){this._selection.setAttribute(t,e);}},{key:\"_removeAttribute\",value:function _removeAttribute(t){this._selection.removeAttribute(t);}},{key:\"_getStoredAttributes\",value:function _getStoredAttributes(){return this._selection._getStoredAttributes();}},{key:\"_overrideGravity\",value:function _overrideGravity(){return this._selection.overrideGravity();}},{key:\"_restoreGravity\",value:function _restoreGravity(t){this._selection.restoreGravity(t);}}],[{key:\"_getStoreAttributeKey\",value:function _getStoreAttributeKey(t){return ra+t;}},{key:\"_isStoreAttributeKey\",value:function _isStoreAttributeKey(t){return t.startsWith(ra);}}]);return sa;}();ci(sa,ei);var aa=/*#__PURE__*/function(_ta){_inherits(aa,_ta);var _super20=_createSuper(aa);function aa(t){var _this49;_classCallCheck(this,aa);_this49=_super20.call(this),_this49.markers=new oo({idProperty:\"name\"}),_this49._model=t.model,_this49._document=t,_this49._attributePriority=new Map(),_this49._fixGraveyardRangesData=[],_this49._hasChangedRange=!1,_this49._overriddenGravityRegister=new Set(),_this49.on(\"change:range\",function(){var _iterator116=_createForOfIteratorHelper(_this49.getRanges()),_step116;try{for(_iterator116.s();!(_step116=_iterator116.n()).done;){var _t95=_step116.value;if(!_this49._document._validateSelectionRange(_t95))throw new Gn.b(\"document-selection-wrong-position: Range from document selection starts or ends at incorrect position.\",{range:_t95});}}catch(err){_iterator116.e(err);}finally{_iterator116.f();}_this49._updateMarkers(),_this49._updateAttributes(!1);}),_this49.listenTo(_this49._model.markers,\"update\",function(){return _this49._updateMarkers();}),_this49.listenTo(_this49._model,\"applyOperation\",function(t,e){var n=e[0];if(n.isDocumentOperation&&\"marker\"!=n.type&&\"rename\"!=n.type&&\"noop\"!=n.type){for(;_this49._fixGraveyardRangesData.length;){var _this49$_fixGraveyard=_this49._fixGraveyardRangesData.shift(),_t96=_this49$_fixGraveyard.liveRange,_e92=_this49$_fixGraveyard.sourcePosition;_this49._fixGraveyardSelection(_t96,_e92);}_this49._hasChangedRange&&(_this49._hasChangedRange=!1,_this49.fire(\"change:range\",{directChange:!1})),_this49._updateMarkers(),_this49._updateAttributes(!1);}},{priority:\"lowest\"}),_this49.listenTo(_this49._document,\"change\",function(t,e){!function(t,e){var n=t.document.differ;var _iterator117=_createForOfIteratorHelper(n.getChanges()),_step117;try{var _loop2=function _loop2(){var i=_step117.value;if(\"insert\"!=i.type)return 1;// continue\nvar n=i.position.parent,o=i.length===n.maxOffset;o&&t.enqueueChange(e,function(t){var e=Array.from(n.getAttributeKeys()).filter(function(t){return t.startsWith(ra);});var _iterator118=_createForOfIteratorHelper(e),_step118;try{for(_iterator118.s();!(_step118=_iterator118.n()).done;){var _i67=_step118.value;t.removeAttribute(_i67,n);}}catch(err){_iterator118.e(err);}finally{_iterator118.f();}});};for(_iterator117.s();!(_step117=_iterator117.n()).done;){if(_loop2())continue;}}catch(err){_iterator117.e(err);}finally{_iterator117.f();}}(_this49._model,e);});return _this49;}_createClass(aa,[{key:\"isCollapsed\",get:function get(){return 0===this._ranges.length?this._document._getDefaultRange().isCollapsed:_get(_getPrototypeOf(aa.prototype),\"isCollapsed\",this);}},{key:\"anchor\",get:function get(){return _get(_getPrototypeOf(aa.prototype),\"anchor\",this)||this._document._getDefaultRange().start;}},{key:\"focus\",get:function get(){return _get(_getPrototypeOf(aa.prototype),\"focus\",this)||this._document._getDefaultRange().end;}},{key:\"rangeCount\",get:function get(){return this._ranges.length?this._ranges.length:1;}},{key:\"hasOwnRange\",get:function get(){return this._ranges.length>0;}},{key:\"isGravityOverridden\",get:function get(){return!!this._overriddenGravityRegister.size;}},{key:\"destroy\",value:function destroy(){for(var _t97=0;_t970&&this.fire(\"change:attribute\",{attributeKeys:i,directChange:!1});}},{key:\"_setAttribute\",value:function _setAttribute(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!0;var i=n?\"normal\":\"low\";return(\"low\"!=i||\"normal\"!=this._attributePriority.get(t))&&_get(_getPrototypeOf(aa.prototype),\"getAttribute\",this).call(this,t)!==e&&(this._attrs.set(t,e),this._attributePriority.set(t,i),!0);}},{key:\"_removeAttribute\",value:function _removeAttribute(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;var n=e?\"normal\":\"low\";return(\"low\"!=n||\"normal\"!=this._attributePriority.get(t))&&(this._attributePriority.set(t,n),!!_get(_getPrototypeOf(aa.prototype),\"hasAttribute\",this).call(this,t)&&(this._attrs[\"delete\"](t),!0));}},{key:\"_setAttributesTo\",value:function _setAttributesTo(t){var e=new Set();var _iterator124=_createForOfIteratorHelper(this.getAttributes()),_step124;try{for(_iterator124.s();!(_step124=_iterator124.n()).done;){var _step124$value=_slicedToArray(_step124.value,2),_e100=_step124$value[0],_n95=_step124$value[1];t.get(_e100)!==_n95&&this._removeAttribute(_e100,!1);}}catch(err){_iterator124.e(err);}finally{_iterator124.f();}var _iterator125=_createForOfIteratorHelper(t),_step125;try{for(_iterator125.s();!(_step125=_iterator125.n()).done;){var _step125$value=_slicedToArray(_step125.value,2),_n96=_step125$value[0],_i71=_step125$value[1];this._setAttribute(_n96,_i71,!1)&&e.add(_n96);}}catch(err){_iterator125.e(err);}finally{_iterator125.f();}return e;}},{key:\"_getStoredAttributes\",value:/*#__PURE__*/_regeneratorRuntime().mark(function _getStoredAttributes(){var t,_iterator126,_step126,_e101;return _regeneratorRuntime().wrap(function _getStoredAttributes$(_context18){while(1)switch(_context18.prev=_context18.next){case 0:t=this.getFirstPosition().parent;if(!(this.isCollapsed&&t.isEmpty)){_context18.next=20;break;}_iterator126=_createForOfIteratorHelper(t.getAttributeKeys());_context18.prev=3;_iterator126.s();case 5:if((_step126=_iterator126.n()).done){_context18.next=12;break;}_e101=_step126.value;if(!_e101.startsWith(ra)){_context18.next=10;break;}_context18.next=10;return[_e101.substr(ra.length),t.getAttribute(_e101)];case 10:_context18.next=5;break;case 12:_context18.next=17;break;case 14:_context18.prev=14;_context18.t0=_context18[\"catch\"](3);_iterator126.e(_context18.t0);case 17:_context18.prev=17;_iterator126.f();return _context18.finish(17);case 20:case\"end\":return _context18.stop();}},_getStoredAttributes,this,[[3,14,17,20]]);})},{key:\"_getSurroundingAttributes\",value:function _getSurroundingAttributes(){var t=this.getFirstPosition(),e=this._model.schema;var n=null;if(this.isCollapsed){var _e102=t.textNode?t.textNode:t.nodeBefore,_i72=t.textNode?t.textNode:t.nodeAfter;if(this.isGravityOverridden||(n=ca(_e102)),n||(n=ca(_i72)),!this.isGravityOverridden&&!n){var _t102=_e102;for(;_t102&&!n;)n=ca(_t102=_t102.previousSibling);}if(!n){var _t103=_i72;for(;_t103&&!n;)n=ca(_t103=_t103.nextSibling);}n||(n=this._getStoredAttributes());}else{var _t104=this.getFirstRange();var _iterator127=_createForOfIteratorHelper(_t104),_step127;try{for(_iterator127.s();!(_step127=_iterator127.n()).done;){var _i73=_step127.value;if(_i73.item.is(\"element\")&&e.isObject(_i73.item))break;if(\"text\"==_i73.type){n=_i73.item.getAttributes();break;}}}catch(err){_iterator127.e(err);}finally{_iterator127.f();}}return n;}},{key:\"_fixGraveyardSelection\",value:function _fixGraveyardSelection(t,e){var n=e.clone(),i=this._model.schema.getNearestSelectionRange(n),o=this._ranges.indexOf(t);if(this._ranges.splice(o,1),t.detach(),i){var _t105=this._prepareRange(i);this._ranges.splice(o,0,_t105);}}}]);return aa;}(ta);function ca(t){return t instanceof Fs||t instanceof zs?t.getAttributes():null;}var la=/*#__PURE__*/function(){function la(t){_classCallCheck(this,la);this._dispatchers=t;}_createClass(la,[{key:\"add\",value:function add(t){var _iterator128=_createForOfIteratorHelper(this._dispatchers),_step128;try{for(_iterator128.s();!(_step128=_iterator128.n()).done;){var _e103=_step128.value;t(_e103);}}catch(err){_iterator128.e(err);}finally{_iterator128.f();}return this;}}]);return la;}();var da=1,ua=4;var ha=function ha(t){return Fn(t,da|ua);};var fa=/*#__PURE__*/function(_la){_inherits(fa,_la);var _super21=_createSuper(fa);function fa(){_classCallCheck(this,fa);return _super21.apply(this,arguments);}_createClass(fa,[{key:\"elementToElement\",value:function elementToElement(t){return this.add(function(t){return(t=ha(t)).view=pa(t.view,\"container\"),function(e){e.on(\"insert:\"+t.model,function(t){return function(e,n,i){var o=t(n.item,i.writer);if(!o)return;if(!i.consumable.consume(n.item,\"insert\"))return;var r=i.mapper.toViewPosition(n.range.start);i.mapper.bindElements(n.item,o),i.writer.insert(r,o);};}(t.view),{priority:t.converterPriority||\"normal\"});};}(t));}},{key:\"attributeToElement\",value:function attributeToElement(t){return this.add(function(t){var e=\"attribute:\"+((t=ha(t)).model.key?t.model.key:t.model);t.model.name&&(e+=\":\"+t.model.name);if(t.model.values){var _iterator129=_createForOfIteratorHelper(t.model.values),_step129;try{for(_iterator129.s();!(_step129=_iterator129.n()).done;){var _e104=_step129.value;t.view[_e104]=pa(t.view[_e104],\"attribute\");}}catch(err){_iterator129.e(err);}finally{_iterator129.f();}}else t.view=pa(t.view,\"attribute\");var n=ga(t);return function(i){i.on(e,function(t){return function(e,n,i){var o=t(n.attributeOldValue,i.writer),r=t(n.attributeNewValue,i.writer);if(!o&&!r)return;if(!i.consumable.consume(n.item,e.name))return;var s=i.writer,a=s.document.selection;if(n.item instanceof ta||n.item instanceof sa)s.wrap(a.getFirstRange(),r);else{var _t106=i.mapper.toViewRange(n.range);null!==n.attributeOldValue&&o&&(_t106=s.unwrap(_t106,o)),null!==n.attributeNewValue&&r&&s.wrap(_t106,r);}};}(n),{priority:t.converterPriority||\"normal\"});};}(t));}},{key:\"attributeToAttribute\",value:function attributeToAttribute(t){return this.add(function(t){var e=\"attribute:\"+((t=ha(t)).model.key?t.model.key:t.model);t.model.name&&(e+=\":\"+t.model.name);if(t.model.values){var _iterator130=_createForOfIteratorHelper(t.model.values),_step130;try{for(_iterator130.s();!(_step130=_iterator130.n()).done;){var _e105=_step130.value;t.view[_e105]=ba(t.view[_e105]);}}catch(err){_iterator130.e(err);}finally{_iterator130.f();}}else t.view=ba(t.view);var n=ga(t);return function(i){i.on(e,function(t){return function(e,n,i){var o=t(n.attributeOldValue,n),r=t(n.attributeNewValue,n);if(!o&&!r)return;if(!i.consumable.consume(n.item,e.name))return;var s=i.mapper.toViewElement(n.item),a=i.writer;if(s){if(null!==n.attributeOldValue&&o)if(\"class\"==o.key){var _t107=Array.isArray(o.value)?o.value:[o.value];var _iterator131=_createForOfIteratorHelper(_t107),_step131;try{for(_iterator131.s();!(_step131=_iterator131.n()).done;){var _e106=_step131.value;a.removeClass(_e106,s);}}catch(err){_iterator131.e(err);}finally{_iterator131.f();}}else if(\"style\"==o.key){var _t108=Object.keys(o.value);for(var _i74=0,_t109=_t108;_i74<_t109.length;_i74++){var _e107=_t109[_i74];a.removeStyle(_e107,s);}}else a.removeAttribute(o.key,s);if(null!==n.attributeNewValue&&r)if(\"class\"==r.key){var _t110=Array.isArray(r.value)?r.value:[r.value];var _iterator132=_createForOfIteratorHelper(_t110),_step132;try{for(_iterator132.s();!(_step132=_iterator132.n()).done;){var _e108=_step132.value;a.addClass(_e108,s);}}catch(err){_iterator132.e(err);}finally{_iterator132.f();}}else if(\"style\"==r.key){var _t111=Object.keys(r.value);for(var _i75=0,_t112=_t111;_i75<_t112.length;_i75++){var _e109=_t112[_i75];a.setStyle(_e109,r.value[_e109],s);}}else a.setAttribute(r.key,r.value,s);}else bs.a.warn(\"conversion-attribute-to-attribute-on-text: Trying to convert text node's attribute with attribute-to-attribute converter.\");};}(n),{priority:t.converterPriority||\"normal\"});};}(t));}},{key:\"markerToElement\",value:function markerToElement(t){return this.add(function(t){return(t=ha(t)).view=pa(t.view,\"ui\"),function(e){e.on(\"addMarker:\"+t.model,function(t){return function(e,n,i){n.isOpening=!0;var o=t(n,i.writer);n.isOpening=!1;var r=t(n,i.writer);if(!o||!r)return;var s=n.markerRange;if(s.isCollapsed&&!i.consumable.consume(s,e.name))return;var _iterator133=_createForOfIteratorHelper(s),_step133;try{for(_iterator133.s();!(_step133=_iterator133.n()).done;){var _t113=_step133.value;if(!i.consumable.consume(_t113.item,e.name))return;}}catch(err){_iterator133.e(err);}finally{_iterator133.f();}var a=i.mapper,c=i.writer;c.insert(a.toViewPosition(s.start),o),i.mapper.bindElementToMarker(o,n.markerName),s.isCollapsed||(c.insert(a.toViewPosition(s.end),r),i.mapper.bindElementToMarker(r,n.markerName)),e.stop();};}(t.view),{priority:t.converterPriority||\"normal\"}),e.on(\"removeMarker:\"+t.model,(t.view,function(t,e,n){var i=n.mapper.markerNameToElements(e.markerName);if(i){n.mapper.unbindElementsFromMarkerName(e.markerName);var _iterator134=_createForOfIteratorHelper(i),_step134;try{for(_iterator134.s();!(_step134=_iterator134.n()).done;){var _t114=_step134.value;n.writer.clear(n.writer.createRangeOn(_t114),_t114);}}catch(err){_iterator134.e(err);}finally{_iterator134.f();}n.writer.clearClonedElementsGroup(e.markerName),t.stop();}}),{priority:t.converterPriority||\"normal\"});};}(t));}},{key:\"markerToHighlight\",value:function markerToHighlight(t){return this.add(function(t){return function(e){e.on(\"addMarker:\"+t.model,function(t){return function(e,n,i){if(!n.item)return;if(!(n.item instanceof ta||n.item instanceof sa||n.item.is(\"textProxy\")))return;var o=wa(t,n,i);if(!o)return;if(!i.consumable.consume(n.item,e.name))return;var r=ma(o),s=i.writer,a=s.document.selection;if(n.item instanceof ta||n.item instanceof sa)s.wrap(a.getFirstRange(),r,a);else{var _t115=i.mapper.toViewRange(n.range),_e110=s.wrap(_t115,r);var _iterator135=_createForOfIteratorHelper(_e110.getItems()),_step135;try{for(_iterator135.s();!(_step135=_iterator135.n()).done;){var _t116=_step135.value;if(_t116.is(\"attributeElement\")&&_t116.isSimilar(r)){i.mapper.bindElementToMarker(_t116,n.markerName);break;}}}catch(err){_iterator135.e(err);}finally{_iterator135.f();}}};}(t.view),{priority:t.converterPriority||\"normal\"}),e.on(\"addMarker:\"+t.model,function(t){return function(e,n,i){if(!n.item)return;if(!(n.item instanceof Hs))return;var o=wa(t,n,i);if(!o)return;if(!i.consumable.test(n.item,e.name))return;var r=i.mapper.toViewElement(n.item);if(r&&r.getCustomProperty(\"addHighlight\")){i.consumable.consume(n.item,e.name);var _iterator136=_createForOfIteratorHelper(Gs._createIn(n.item)),_step136;try{for(_iterator136.s();!(_step136=_iterator136.n()).done;){var _t117=_step136.value;i.consumable.consume(_t117.item,e.name);}}catch(err){_iterator136.e(err);}finally{_iterator136.f();}r.getCustomProperty(\"addHighlight\")(r,o,i.writer),i.mapper.bindElementToMarker(r,n.markerName);}};}(t.view),{priority:t.converterPriority||\"normal\"}),e.on(\"removeMarker:\"+t.model,function(t){return function(e,n,i){if(n.markerRange.isCollapsed)return;var o=wa(t,n,i);if(!o)return;var r=ma(o),s=i.mapper.markerNameToElements(n.markerName);if(s){i.mapper.unbindElementsFromMarkerName(n.markerName);var _iterator137=_createForOfIteratorHelper(s),_step137;try{for(_iterator137.s();!(_step137=_iterator137.n()).done;){var _t118=_step137.value;_t118.is(\"attributeElement\")?i.writer.unwrap(i.writer.createRangeOn(_t118),r):_t118.getCustomProperty(\"removeHighlight\")(_t118,o.id,i.writer);}}catch(err){_iterator137.e(err);}finally{_iterator137.f();}i.writer.clearClonedElementsGroup(n.markerName),e.stop();}};}(t.view),{priority:t.converterPriority||\"normal\"});};}(t));}}]);return fa;}(la);function ma(t){var e=new ao(\"span\",t.attributes);return t.classes&&e._addClass(t.classes),t.priority&&(e._priority=t.priority),e._id=t.id,e;}function pa(t,e){return\"function\"==typeof t?t:function(n,i){return function(t,e,n){\"string\"==typeof t&&(t={name:t});var i;var o=Object.assign({},t.attributes);if(\"container\"==n)i=e.createContainerElement(t.name,o);else if(\"attribute\"==n){var _n97={priority:t.priority||ao.DEFAULT_PRIORITY};i=e.createAttributeElement(t.name,o,_n97);}else i=e.createUIElement(t.name,o);if(t.styles){var _n98=Object.keys(t.styles);for(var _i76=0,_n99=_n98;_i76<_n99.length;_i76++){var _o33=_n99[_i76];e.setStyle(_o33,t.styles[_o33],i);}}if(t.classes){var _n100=t.classes;if(\"string\"==typeof _n100)e.addClass(_n100,i);else{var _iterator138=_createForOfIteratorHelper(_n100),_step138;try{for(_iterator138.s();!(_step138=_iterator138.n()).done;){var _t119=_step138.value;e.addClass(_t119,i);}}catch(err){_iterator138.e(err);}finally{_iterator138.f();}}}return i;}(t,i,e);};}function ga(t){return t.model.values?function(e,n){var i=t.view[e];return i?i(e,n):null;}:t.view;}function ba(t){return\"string\"==typeof t?function(e){return{key:t,value:e};}:\"object\"==_typeof(t)?t.value?function(){return t;}:function(e){return{key:t.key,value:e};}:t;}function wa(t,e,n){var i=\"function\"==typeof t?t(e,n):t;return i?(i.priority||(i.priority=10),i.id||(i.id=e.markerName),i):null;}var _a=/*#__PURE__*/function(_la2){_inherits(_a,_la2);var _super22=_createSuper(_a);function _a(){_classCallCheck(this,_a);return _super22.apply(this,arguments);}_createClass(_a,[{key:\"elementToElement\",value:function elementToElement(t){return this.add(ka(t));}},{key:\"elementToAttribute\",value:function elementToAttribute(t){return this.add(function(t){ya(t=ha(t));var e=xa(t,!1),n=va(t),i=n?\"element:\"+n:\"element\";return function(n){n.on(i,e,{priority:t.converterPriority||\"low\"});};}(t));}},{key:\"attributeToAttribute\",value:function attributeToAttribute(t){return this.add(function(t){var e=null;(\"string\"==typeof(t=ha(t)).view||t.view.key)&&(e=function(t){\"string\"==typeof t.view&&(t.view={key:t.view});var e=t.view.key;var n;if(\"class\"==e||\"style\"==e){var _i77=\"class\"==e?\"classes\":\"styles\";n=_defineProperty({},_i77,t.view.value);}else{var _i78=void 0===t.view.value?/[\\s\\S]*/:t.view.value;n={attributes:_defineProperty({},e,_i78)};}t.view.name&&(n.name=t.view.name);return t.view=n,e;}(t));ya(t,e);var n=xa(t,!0);return function(e){e.on(\"element\",n,{priority:t.converterPriority||\"low\"});};}(t));}},{key:\"elementToMarker\",value:function elementToMarker(t){return this.add(function(t){return function(t){var e=t.model;t.model=function(t,n){var i=\"string\"==typeof e?e:e(t);return n.createElement(\"$marker\",{\"data-name\":i});};}(t=ha(t)),ka(t);}(t));}}]);return _a;}(la);function ka(t){var e=function(t){var e=new bi(t.view);return function(n,i,o){var r=e.match(i.viewItem);if(!r)return;r.match.name=!0;var s=function(t,e,n){return t instanceof Function?t(e,n):n.createElement(t);}(t.model,i.viewItem,o.writer);if(!s)return;if(!o.consumable.test(i.viewItem,r.match))return;var a=o.splitToAllowedParent(s,i.modelCursor);if(!a)return;o.writer.insert(s,a.position);var c=o.convertChildren(i.viewItem,o.writer.createPositionAt(s,0));o.consumable.consume(i.viewItem,r.match),i.modelRange=new Gs(o.writer.createPositionBefore(s),o.writer.createPositionAfter(c.modelCursor.parent)),a.cursorParent?i.modelCursor=o.writer.createPositionAt(a.cursorParent,0):i.modelCursor=i.modelRange.end;};}(t=ha(t)),n=va(t),i=n?\"element:\"+n:\"element\";return function(n){n.on(i,e,{priority:t.converterPriority||\"normal\"});};}function va(t){return\"string\"==typeof t.view?t.view:\"object\"==_typeof(t.view)&&\"string\"==typeof t.view.name?t.view.name:null;}function ya(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var n=null===e||function(t){return t.getAttribute(e);},i=\"object\"!=_typeof(t.model)?t.model:t.model.key,o=\"object\"!=_typeof(t.model)||void 0===t.model.value?n:t.model.value;t.model={key:i,value:o};}function xa(t,e){var n=new bi(t.view);return function(i,o,r){var s=n.match(o.viewItem);if(!s)return;var a=t.model.key,c=\"function\"==typeof t.model.value?t.model.value(o.viewItem):t.model.value;null!==c&&(!function(t){if(\"object\"==_typeof(t.view)&&!va(t))return!1;return!t.view.classes&&!t.view.attributes&&!t.view.styles;}(t)?delete s.match.name:s.match.name=!0,r.consumable.test(o.viewItem,s.match)&&(o.modelRange||(o=Object.assign(o,r.convertChildren(o.viewItem,o.modelCursor))),function(t,e,n,i){var o=!1;for(var _i79=0,_Array$from4=Array.from(t.getItems({shallow:n}));_i79<_Array$from4.length;_i79++){var _r13=_Array$from4[_i79];i.schema.checkAttribute(_r13,e.key)&&(i.writer.setAttribute(e.key,e.value,_r13),o=!0);}return o;}(o.modelRange,{key:a,value:c},e,r)&&r.consumable.consume(o.viewItem,s.match)));};}var Aa=/*#__PURE__*/function(){function Aa(t){var _this51=this;_classCallCheck(this,Aa);this.model=t,this.view=new js(),this.mapper=new Qs(),this.downcastDispatcher=new Zs({mapper:this.mapper});var e=this.model.document,n=e.selection,i=this.model.markers;this.listenTo(this.model,\"_beforeChanges\",function(){_this51.view._disableRendering(!0);},{priority:\"highest\"}),this.listenTo(this.model,\"_afterChanges\",function(){_this51.view._disableRendering(!1);},{priority:\"lowest\"}),this.listenTo(e,\"change\",function(){_this51.view.change(function(t){_this51.downcastDispatcher.convertChanges(e.differ,t),_this51.downcastDispatcher.convertSelection(n,i,t);});},{priority:\"low\"}),this.listenTo(this.view.document,\"selectionChange\",function(t,e){return function(n,i){var o=i.newSelection,r=new ta(),s=[];var _iterator139=_createForOfIteratorHelper(o.getRanges()),_step139;try{for(_iterator139.s();!(_step139=_iterator139.n()).done;){var _t120=_step139.value;s.push(e.toModelRange(_t120));}}catch(err){_iterator139.e(err);}finally{_iterator139.f();}r.setTo(s,{backward:o.isBackward}),r.isEqual(t.document.selection)||t.change(function(t){t.setSelection(r);});};}(this.model,this.mapper)),this.downcastDispatcher.on(\"insert:$text\",function(t,e,n){if(!n.consumable.consume(e.item,\"insert\"))return;var i=n.writer,o=n.mapper.toViewPosition(e.range.start),r=i.createText(e.item.data);i.insert(o,r);},{priority:\"lowest\"}),this.downcastDispatcher.on(\"remove\",function(t,e,n){var i=n.mapper.toViewPosition(e.position),o=e.position.getShiftedBy(e.length),r=n.mapper.toViewPosition(o,{isPhantom:!0}),s=n.writer.createRange(i,r),a=n.writer.remove(s.getTrimmed());var _iterator140=_createForOfIteratorHelper(n.writer.createRangeIn(a).getItems()),_step140;try{for(_iterator140.s();!(_step140=_iterator140.n()).done;){var _t121=_step140.value;n.mapper.unbindViewElement(_t121);}}catch(err){_iterator140.e(err);}finally{_iterator140.f();}},{priority:\"low\"}),this.downcastDispatcher.on(\"selection\",function(t,e,n){var i=n.writer,o=i.document.selection;var _iterator141=_createForOfIteratorHelper(o.getRanges()),_step141;try{for(_iterator141.s();!(_step141=_iterator141.n()).done;){var _t122=_step141.value;_t122.isCollapsed&&_t122.end.parent.document&&n.writer.mergeAttributes(_t122.start);}}catch(err){_iterator141.e(err);}finally{_iterator141.f();}i.setSelection(null);},{priority:\"low\"}),this.downcastDispatcher.on(\"selection\",function(t,e,n){var i=e.selection;if(i.isCollapsed)return;if(!n.consumable.consume(i,\"selection\"))return;var o=[];var _iterator142=_createForOfIteratorHelper(i.getRanges()),_step142;try{for(_iterator142.s();!(_step142=_iterator142.n()).done;){var _t123=_step142.value;var _e111=n.mapper.toViewRange(_t123);o.push(_e111);}}catch(err){_iterator142.e(err);}finally{_iterator142.f();}n.writer.setSelection(o,{backward:i.isBackward});},{priority:\"low\"}),this.downcastDispatcher.on(\"selection\",function(t,e,n){var i=e.selection;if(!i.isCollapsed)return;if(!n.consumable.consume(i,\"selection\"))return;var o=n.writer,r=i.getFirstPosition(),s=n.mapper.toViewPosition(r),a=o.breakAttributes(s);o.setSelection(a);},{priority:\"low\"}),this.view.document.roots.bindTo(this.model.document.roots).using(function(t){if(\"$graveyard\"==t.rootName)return null;var e=new Ji(t.name);return e.rootName=t.rootName,e._document=_this51.view.document,_this51.mapper.bindElements(t,e),e;});}_createClass(Aa,[{key:\"destroy\",value:function destroy(){this.view.destroy(),this.stopListening();}}]);return Aa;}();ci(Aa,Fi);var Ca=/*#__PURE__*/function(_Symbol$iterator8){function Ca(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];_classCallCheck(this,Ca);this._editor=t,this._availablePlugins=new Map(),this._plugins=new Map();var _iterator143=_createForOfIteratorHelper(e),_step143;try{for(_iterator143.s();!(_step143=_iterator143.n()).done;){var _t124=_step143.value;this._availablePlugins.set(_t124,_t124),_t124.pluginName&&this._availablePlugins.set(_t124.pluginName,_t124);}}catch(err){_iterator143.e(err);}finally{_iterator143.f();}}_createClass(Ca,[{key:_Symbol$iterator8,value:/*#__PURE__*/_regeneratorRuntime().mark(function value(){var _iterator144,_step144,_t125;return _regeneratorRuntime().wrap(function value$(_context19){while(1)switch(_context19.prev=_context19.next){case 0:_iterator144=_createForOfIteratorHelper(this._plugins);_context19.prev=1;_iterator144.s();case 3:if((_step144=_iterator144.n()).done){_context19.next=11;break;}_t125=_step144.value;_context19.t0=\"function\"==typeof _t125[0];if(!_context19.t0){_context19.next=9;break;}_context19.next=9;return _t125;case 9:_context19.next=3;break;case 11:_context19.next=16;break;case 13:_context19.prev=13;_context19.t1=_context19[\"catch\"](1);_iterator144.e(_context19.t1);case 16:_context19.prev=16;_iterator144.f();return _context19.finish(16);case 19:case\"end\":return _context19.stop();}},value,this,[[1,13,16,19]]);})},{key:\"get\",value:function get(t){var e=this._plugins.get(t);if(!e){var _e112=\"plugincollection-plugin-not-loaded: The requested plugin is not loaded.\";var _n102=t;throw\"function\"==typeof t&&(_n102=t.pluginName||t.name),new Gn.b(_e112,{plugin:_n102});}return e;}},{key:\"has\",value:function has(t){return this._plugins.has(t);}},{key:\"init\",value:function init(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var n=this,i=this._editor,o=new Set(),r=[],s=h(t),a=h(e),c=function(t){var e=[];var _iterator145=_createForOfIteratorHelper(t),_step145;try{for(_iterator145.s();!(_step145=_iterator145.n()).done;){var _n103=_step145.value;u(_n103)||e.push(_n103);}}catch(err){_iterator145.e(err);}finally{_iterator145.f();}return e.length?e:null;}(t);if(c){var _t126=\"plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.\";return bs.a.error(_t126,{plugins:c}),Promise.reject(new Gn.b(_t126,{plugins:c}));}return Promise.all(s.map(l)).then(function(){return d(r,\"init\");}).then(function(){return d(r,\"afterInit\");}).then(function(){return r;});function l(t){if(!a.includes(t)&&!n._plugins.has(t)&&!o.has(t))return function(t){return new Promise(function(s){o.add(t),t.requires&&t.requires.forEach(function(n){var i=u(n);if(e.includes(i))throw new Gn.b(\"plugincollection-required: Cannot load a plugin because one of its dependencies is listed inthe `removePlugins` option.\",{plugin:i,requiredBy:t});l(i);});var a=new t(i);n._add(t,a),r.push(a),s();});}(t)[\"catch\"](function(e){throw bs.a.error(\"plugincollection-load: It was not possible to load the plugin.\",{plugin:t}),e;});}function d(t,e){return t.reduce(function(t,n){return n[e]?t.then(n[e].bind(n)):t;},Promise.resolve());}function u(t){return\"function\"==typeof t?t:n._availablePlugins.get(t);}function h(t){return t.map(function(t){return u(t);}).filter(function(t){return!!t;});}}},{key:\"destroy\",value:function destroy(){var t=Array.from(this).map(function(_ref3){var _ref4=_slicedToArray(_ref3,2),t=_ref4[1];return t;}).filter(function(t){return\"function\"==typeof t.destroy;}).map(function(t){return t.destroy();});return Promise.all(t);}},{key:\"_add\",value:function _add(t,e){this._plugins.set(t,e);var n=t.pluginName;n&&(this._plugins.has(n)?bs.a.warn(\"plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.\",{pluginName:n,plugin1:this._plugins.get(n).constructor,plugin2:t}):this._plugins.set(n,e));}}]);return Ca;}(Symbol.iterator);ci(Ca,ei);var Ta=/*#__PURE__*/function(_Symbol$iterator9){function Ta(){_classCallCheck(this,Ta);this._commands=new Map();}_createClass(Ta,[{key:\"add\",value:function add(t,e){this._commands.set(t,e);}},{key:\"get\",value:function get(t){return this._commands.get(t);}},{key:\"execute\",value:function execute(t){var n=this.get(t);if(!n)throw new Gn.b(\"commandcollection-command-not-found: Command does not exist.\",{commandName:t});for(var _len16=arguments.length,e=new Array(_len16>1?_len16-1:0),_key16=1;_key16<_len16;_key16++){e[_key16-1]=arguments[_key16];}n.execute.apply(n,e);}},{key:\"names\",value:/*#__PURE__*/_regeneratorRuntime().mark(function names(){return _regeneratorRuntime().wrap(function names$(_context20){while(1)switch(_context20.prev=_context20.next){case 0:return _context20.delegateYield(this._commands.keys(),\"t0\",1);case 1:case\"end\":return _context20.stop();}},names,this);})},{key:\"commands\",value:/*#__PURE__*/_regeneratorRuntime().mark(function commands(){return _regeneratorRuntime().wrap(function commands$(_context21){while(1)switch(_context21.prev=_context21.next){case 0:return _context21.delegateYield(this._commands.values(),\"t0\",1);case 1:case\"end\":return _context21.stop();}},commands,this);})},{key:_Symbol$iterator9,value:function value(){return this._commands[Symbol.iterator]();}},{key:\"destroy\",value:function destroy(){var _iterator146=_createForOfIteratorHelper(this.commands()),_step146;try{for(_iterator146.s();!(_step146=_iterator146.n()).done;){var _t127=_step146.value;_t127.destroy();}}catch(err){_iterator146.e(err);}finally{_iterator146.f();}}}]);return Ta;}(Symbol.iterator);function Pa(t,e){var n=Object.keys(window.CKEDITOR_TRANSLATIONS).length;return 1===n&&(t=Object.keys(window.CKEDITOR_TRANSLATIONS)[0]),0!==n&&function(t,e){return t in window.CKEDITOR_TRANSLATIONS&&e in window.CKEDITOR_TRANSLATIONS[t];}(t,e)?window.CKEDITOR_TRANSLATIONS[t][e].replace(/ \\[context: [^\\]]+\\]$/,\"\"):e.replace(/ \\[context: [^\\]]+\\]$/,\"\");}window.CKEDITOR_TRANSLATIONS||(window.CKEDITOR_TRANSLATIONS={});var Ma=/*#__PURE__*/function(){function Ma(t){var _this52=this;_classCallCheck(this,Ma);this.language=t||\"en\",this.t=function(){return _this52._t.apply(_this52,arguments);};}_createClass(Ma,[{key:\"_t\",value:function _t(t,e){var n=Pa(this.language,t);return e&&(n=n.replace(/%(\\d+)/g,function(t,n){return n1&&arguments[1]!==undefined?arguments[1]:null;if(t instanceof $s){var _e121=t.nodeBefore,_n107=t.nodeAfter;if(!(_e121 instanceof Hs))throw new Gn.b(\"schema-check-merge-no-element-before: The node before the merge position must be an element.\");if(!(_n107 instanceof Hs))throw new Gn.b(\"schema-check-merge-no-element-after: The node after the merge position must be an element.\");return this.checkMerge(_e121,_n107);}var _iterator155=_createForOfIteratorHelper(e.getChildren()),_step155;try{for(_iterator155.s();!(_step155=_iterator155.n()).done;){var _n108=_step155.value;if(!this.checkChild(t,_n108))return!1;}}catch(err){_iterator155.e(err);}finally{_iterator155.f();}return!0;}},{key:\"addChildCheck\",value:function addChildCheck(t){this.on(\"checkChild\",function(e,_ref5){var _ref6=_slicedToArray(_ref5,2),n=_ref6[0],i=_ref6[1];if(!i)return;var o=t(n,i);\"boolean\"==typeof o&&(e.stop(),e[\"return\"]=o);},{priority:\"high\"});}},{key:\"addAttributeCheck\",value:function addAttributeCheck(t){this.on(\"checkAttribute\",function(e,_ref7){var _ref8=_slicedToArray(_ref7,2),n=_ref8[0],i=_ref8[1];var o=t(n,i);\"boolean\"==typeof o&&(e.stop(),e[\"return\"]=o);},{priority:\"high\"});}},{key:\"getLimitElement\",value:function getLimitElement(t){var e;if(t instanceof $s)e=t.parent;else{e=(t instanceof Gs?[t]:Array.from(t.getRanges())).reduce(function(t,e){var n=e.getCommonAncestor();return t?t.getCommonAncestor(n,{includeSelf:!0}):n;},null);}for(;!this.isLimit(e)&&e.parent;)e=e.parent;return e;}},{key:\"checkAttributeInSelection\",value:function checkAttributeInSelection(t,e){if(t.isCollapsed){var _n109=[].concat(_toConsumableArray(t.getFirstPosition().getAncestors()),[new zs(\"\",t.getAttributes())]);return this.checkAttribute(_n109,e);}{var _n110=t.getRanges();var _iterator156=_createForOfIteratorHelper(_n110),_step156;try{for(_iterator156.s();!(_step156=_iterator156.n()).done;){var _t135=_step156.value;var _iterator157=_createForOfIteratorHelper(_t135),_step157;try{for(_iterator157.s();!(_step157=_iterator157.n()).done;){var _n111=_step157.value;if(this.checkAttribute(_n111.item,e))return!0;}}catch(err){_iterator157.e(err);}finally{_iterator157.f();}}}catch(err){_iterator156.e(err);}finally{_iterator156.f();}}return!1;}},{key:\"getValidRanges\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getValidRanges(t,e){var _iterator159,_step159,_n112;return _regeneratorRuntime().wrap(function getValidRanges$(_context23){while(1)switch(_context23.prev=_context23.next){case 0:t=/*#__PURE__*/_regeneratorRuntime().mark(function _callee7(t){var _iterator158,_step158,_e122;return _regeneratorRuntime().wrap(function _callee7$(_context22){while(1)switch(_context22.prev=_context22.next){case 0:_iterator158=_createForOfIteratorHelper(t);_context22.prev=1;_iterator158.s();case 3:if((_step158=_iterator158.n()).done){_context22.next=8;break;}_e122=_step158.value;return _context22.delegateYield(_e122.getMinimalFlatRanges(),\"t0\",6);case 6:_context22.next=3;break;case 8:_context22.next=13;break;case 10:_context22.prev=10;_context22.t1=_context22[\"catch\"](1);_iterator158.e(_context22.t1);case 13:_context22.prev=13;_iterator158.f();return _context22.finish(13);case 16:case\"end\":return _context22.stop();}},_callee7,null,[[1,10,13,16]]);})(t);_iterator159=_createForOfIteratorHelper(t);_context23.prev=2;_iterator159.s();case 4:if((_step159=_iterator159.n()).done){_context23.next=9;break;}_n112=_step159.value;return _context23.delegateYield(this._getValidRangesForRange(_n112,e),\"t0\",7);case 7:_context23.next=4;break;case 9:_context23.next=14;break;case 11:_context23.prev=11;_context23.t1=_context23[\"catch\"](2);_iterator159.e(_context23.t1);case 14:_context23.prev=14;_iterator159.f();return _context23.finish(14);case 17:case\"end\":return _context23.stop();}},getValidRanges,this,[[2,11,14,17]]);})},{key:\"getNearestSelectionRange\",value:function getNearestSelectionRange(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:\"both\";if(this.checkChild(t,\"$text\"))return new Gs(t);var n,i;\"both\"!=e&&\"backward\"!=e||(n=new qs({startPosition:t,direction:\"backward\"})),\"both\"!=e&&\"forward\"!=e||(i=new qs({startPosition:t}));var _iterator160=_createForOfIteratorHelper(/*#__PURE__*/_regeneratorRuntime().mark(function _callee8(t,e){var n,_e123,_t136;return _regeneratorRuntime().wrap(function _callee8$(_context24){while(1)switch(_context24.prev=_context24.next){case 0:n=!1;case 1:if(n){_context24.next=18;break;}if(!(n=!0,t)){_context24.next=9;break;}_e123=t.next();_context24.t0=_e123.done;if(_context24.t0){_context24.next=9;break;}n=!1;_context24.next=9;return{walker:t,value:_e123.value};case 9:if(!e){_context24.next=16;break;}_t136=e.next();_context24.t1=_t136.done;if(_context24.t1){_context24.next=16;break;}n=!1;_context24.next=16;return{walker:e,value:_t136.value};case 16:_context24.next=1;break;case 18:case\"end\":return _context24.stop();}},_callee8);})(n,i)),_step160;try{for(_iterator160.s();!(_step160=_iterator160.n()).done;){var _t137=_step160.value;var _e124=_t137.walker==n?\"elementEnd\":\"elementStart\",_i80=_t137.value;if(_i80.type==_e124&&this.isObject(_i80.item))return Gs._createOn(_i80.item);if(this.checkChild(_i80.nextPosition,\"$text\"))return new Gs(_i80.nextPosition);}}catch(err){_iterator160.e(err);}finally{_iterator160.f();}return null;}},{key:\"findAllowedParent\",value:function findAllowedParent(t,e){var n=t.parent;for(;n;){if(this.checkChild(n,e))return n;if(this.isLimit(n))return null;n=n.parent;}return null;}},{key:\"removeDisallowedAttributes\",value:function removeDisallowedAttributes(t,e){var _iterator161=_createForOfIteratorHelper(t),_step161;try{for(_iterator161.s();!(_step161=_iterator161.n()).done;){var _n113=_step161.value;var _iterator162=_createForOfIteratorHelper(_n113.getAttributeKeys()),_step162;try{for(_iterator162.s();!(_step162=_iterator162.n()).done;){var _t138=_step162.value;this.checkAttribute(_n113,_t138)||e.removeAttribute(_t138,_n113);}}catch(err){_iterator162.e(err);}finally{_iterator162.f();}_n113.is(\"element\")&&this.removeDisallowedAttributes(_n113.getChildren(),e);}}catch(err){_iterator161.e(err);}finally{_iterator161.f();}}},{key:\"createContext\",value:function createContext(t){return new Na(t);}},{key:\"_clearCache\",value:function _clearCache(){this._compiledDefinitions=null;}},{key:\"_compile\",value:function _compile(){var t={},e=this._sourceDefinitions,n=Object.keys(e);for(var _i81=0,_n114=n;_i81<_n114.length;_i81++){var _i82=_n114[_i81];t[_i82]=Oa(e[_i82],_i82);}for(var _i83=0,_n115=n;_i83<_n115.length;_i83++){var _e125=_n115[_i83];Ra(t,_e125);}for(var _i84=0,_n116=n;_i84<_n116.length;_i84++){var _e126=_n116[_i84];Da(t,_e126);}for(var _i85=0,_n117=n;_i85<_n117.length;_i85++){var _e127=_n117[_i85];La(t,_e127),ja(t,_e127);}for(var _i86=0,_n118=n;_i86<_n118.length;_i86++){var _e128=_n118[_i86];Va(t,_e128),Ba(t,_e128);}this._compiledDefinitions=t;}},{key:\"_checkContextMatch\",value:function _checkContextMatch(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:e.length-1;var i=e.getItem(n);if(t.allowIn.includes(i.name)){if(0==n)return!0;{var _t139=this.getDefinition(i);return this._checkContextMatch(_t139,e,n-1);}}return!1;}},{key:\"_getValidRangesForRange\",value:/*#__PURE__*/_regeneratorRuntime().mark(function _getValidRangesForRange(t,e){var n,i,_iterator163,_step163,_o34;return _regeneratorRuntime().wrap(function _getValidRangesForRange$(_context25){while(1)switch(_context25.prev=_context25.next){case 0:n=t.start,i=t.start;_iterator163=_createForOfIteratorHelper(t.getItems({shallow:!0}));_context25.prev=2;_iterator163.s();case 4:if((_step163=_iterator163.n()).done){_context25.next=19;break;}_o34=_step163.value;_context25.t0=_o34.is(\"element\");if(!_context25.t0){_context25.next=9;break;}return _context25.delegateYield(this._getValidRangesForRange(Gs._createIn(_o34),e),\"t1\",9);case 9:_context25.t2=this.checkAttribute(_o34,e);if(_context25.t2){_context25.next=16;break;}_context25.t3=n.isEqual(i);if(_context25.t3){_context25.next=15;break;}_context25.next=15;return new Gs(n,i);case 15:n=$s._createAfter(_o34);case 16:i=$s._createAfter(_o34);case 17:_context25.next=4;break;case 19:_context25.next=24;break;case 21:_context25.prev=21;_context25.t4=_context25[\"catch\"](2);_iterator163.e(_context25.t4);case 24:_context25.prev=24;_iterator163.f();return _context25.finish(24);case 27:_context25.t5=n.isEqual(i);if(_context25.t5){_context25.next=31;break;}_context25.next=31;return new Gs(n,i);case 31:case\"end\":return _context25.stop();}},_getValidRangesForRange,this,[[2,21,24,27]]);})}]);return Ia;}();ci(Ia,Fi);var Na=/*#__PURE__*/function(_Symbol$iterator10){function Na(t){_classCallCheck(this,Na);if(t instanceof Na)return t;\"string\"==typeof t?t=[t]:Array.isArray(t)||(t=t.getAncestors({includeSelf:!0})),t[0]&&\"string\"!=typeof t[0]&&t[0].is(\"documentFragment\")&&t.shift(),this._items=t.map(Ua);}_createClass(Na,[{key:\"length\",get:function get(){return this._items.length;}},{key:\"last\",get:function get(){return this._items[this._items.length-1];}},{key:_Symbol$iterator10,value:function value(){return this._items[Symbol.iterator]();}},{key:\"push\",value:function push(t){var e=new Na([t]);return e._items=[].concat(_toConsumableArray(this._items),_toConsumableArray(e._items)),e;}},{key:\"getItem\",value:function getItem(t){return this._items[t];}},{key:\"getNames\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getNames(){return _regeneratorRuntime().wrap(function getNames$(_context26){while(1)switch(_context26.prev=_context26.next){case 0:return _context26.delegateYield(this._items.map(function(t){return t.name;}),\"t0\",1);case 1:case\"end\":return _context26.stop();}},getNames,this);})},{key:\"endsWith\",value:function endsWith(t){return Array.from(this.getNames()).join(\" \").endsWith(t);}}]);return Na;}(Symbol.iterator);function Oa(t,e){var n={name:e,allowIn:[],allowContentOf:[],allowWhere:[],allowAttributes:[],allowAttributesOf:[],inheritTypesFrom:[]};return function(t,e){var _iterator164=_createForOfIteratorHelper(t),_step164;try{for(_iterator164.s();!(_step164=_iterator164.n()).done;){var _n119=_step164.value;var _t140=Object.keys(_n119).filter(function(t){return t.startsWith(\"is\");});var _iterator165=_createForOfIteratorHelper(_t140),_step165;try{for(_iterator165.s();!(_step165=_iterator165.n()).done;){var _i87=_step165.value;e[_i87]=_n119[_i87];}}catch(err){_iterator165.e(err);}finally{_iterator165.f();}}}catch(err){_iterator164.e(err);}finally{_iterator164.f();}}(t,n),za(t,n,\"allowIn\"),za(t,n,\"allowContentOf\"),za(t,n,\"allowWhere\"),za(t,n,\"allowAttributes\"),za(t,n,\"allowAttributesOf\"),za(t,n,\"inheritTypesFrom\"),function(t,e){var _iterator166=_createForOfIteratorHelper(t),_step166;try{for(_iterator166.s();!(_step166=_iterator166.n()).done;){var _n120=_step166.value;var _t141=_n120.inheritAllFrom;_t141&&(e.allowContentOf.push(_t141),e.allowWhere.push(_t141),e.allowAttributesOf.push(_t141),e.inheritTypesFrom.push(_t141));}}catch(err){_iterator166.e(err);}finally{_iterator166.f();}}(t,n),n;}function Ra(t,e){var _iterator167=_createForOfIteratorHelper(t[e].allowContentOf),_step167;try{for(_iterator167.s();!(_step167=_iterator167.n()).done;){var _n121=_step167.value;if(t[_n121]){Fa(t,_n121).forEach(function(t){t.allowIn.push(e);});}}}catch(err){_iterator167.e(err);}finally{_iterator167.f();}delete t[e].allowContentOf;}function Da(t,e){var _iterator168=_createForOfIteratorHelper(t[e].allowWhere),_step168;try{for(_iterator168.s();!(_step168=_iterator168.n()).done;){var _n122=_step168.value;var _i88=t[_n122];if(_i88){var _t$e$allowIn;var _n123=_i88.allowIn;(_t$e$allowIn=t[e].allowIn).push.apply(_t$e$allowIn,_toConsumableArray(_n123));}}}catch(err){_iterator168.e(err);}finally{_iterator168.f();}delete t[e].allowWhere;}function La(t,e){var _iterator169=_createForOfIteratorHelper(t[e].allowAttributesOf),_step169;try{for(_iterator169.s();!(_step169=_iterator169.n()).done;){var _n124=_step169.value;var _i89=t[_n124];if(_i89){var _t$e$allowAttributes;var _n125=_i89.allowAttributes;(_t$e$allowAttributes=t[e].allowAttributes).push.apply(_t$e$allowAttributes,_toConsumableArray(_n125));}}}catch(err){_iterator169.e(err);}finally{_iterator169.f();}delete t[e].allowAttributesOf;}function ja(t,e){var n=t[e];var _iterator170=_createForOfIteratorHelper(n.inheritTypesFrom),_step170;try{for(_iterator170.s();!(_step170=_iterator170.n()).done;){var _e129=_step170.value;var _i90=t[_e129];if(_i90){var _t142=Object.keys(_i90).filter(function(t){return t.startsWith(\"is\");});var _iterator171=_createForOfIteratorHelper(_t142),_step171;try{for(_iterator171.s();!(_step171=_iterator171.n()).done;){var _e130=_step171.value;_e130 in n||(n[_e130]=_i90[_e130]);}}catch(err){_iterator171.e(err);}finally{_iterator171.f();}}}}catch(err){_iterator170.e(err);}finally{_iterator170.f();}delete n.inheritTypesFrom;}function Va(t,e){var n=t[e],i=n.allowIn.filter(function(e){return t[e];});n.allowIn=Array.from(new Set(i));}function Ba(t,e){var n=t[e];n.allowAttributes=Array.from(new Set(n.allowAttributes));}function za(t,e,n){var _iterator172=_createForOfIteratorHelper(t),_step172;try{for(_iterator172.s();!(_step172=_iterator172.n()).done;){var _e$n;var _i91=_step172.value;\"string\"==typeof _i91[n]?e[n].push(_i91[n]):Array.isArray(_i91[n])&&(_e$n=e[n]).push.apply(_e$n,_toConsumableArray(_i91[n]));}}catch(err){_iterator172.e(err);}finally{_iterator172.f();}}function Fa(t,e){var n=t[e];return function(t){return Object.keys(t).map(function(e){return t[e];});}(t).filter(function(t){return t.allowIn.includes(n.name);});}function Ua(t){return\"string\"==typeof t?{name:t,getAttributeKeys:/*#__PURE__*/_regeneratorRuntime().mark(function getAttributeKeys(){return _regeneratorRuntime().wrap(function getAttributeKeys$(_context27){while(1)switch(_context27.prev=_context27.next){case 0:case\"end\":return _context27.stop();}},getAttributeKeys);}),getAttribute:function getAttribute(){}}:{name:t.is(\"element\")?t.name:\"$text\",getAttributeKeys:/*#__PURE__*/_regeneratorRuntime().mark(function getAttributeKeys(){return _regeneratorRuntime().wrap(function getAttributeKeys$(_context28){while(1)switch(_context28.prev=_context28.next){case 0:return _context28.delegateYield(t.getAttributeKeys(),\"t0\",1);case 1:case\"end\":return _context28.stop();}},getAttributeKeys);}),getAttribute:function getAttribute(e){return t.getAttribute(e);}};}var Ha=/*#__PURE__*/function(){function Ha(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};_classCallCheck(this,Ha);this._removeIfEmpty=new Set(),this._modelCursor=null,this.conversionApi=Object.assign({},t),this.conversionApi.convertItem=this._convertItem.bind(this),this.conversionApi.convertChildren=this._convertChildren.bind(this),this.conversionApi.splitToAllowedParent=this._splitToAllowedParent.bind(this);}_createClass(Ha,[{key:\"convert\",value:function convert(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:[\"$root\"];this.fire(\"viewCleanup\",t),this._modelCursor=function(t,e){var n;var _iterator173=_createForOfIteratorHelper(new Na(t)),_step173;try{for(_iterator173.s();!(_step173=_iterator173.n()).done;){var _i92=_step173.value;var _t143={};var _iterator174=_createForOfIteratorHelper(_i92.getAttributeKeys()),_step174;try{for(_iterator174.s();!(_step174=_iterator174.n()).done;){var _e131=_step174.value;_t143[_e131]=_i92.getAttribute(_e131);}}catch(err){_iterator174.e(err);}finally{_iterator174.f();}var _o35=e.createElement(_i92.name,_t143);n&&e.append(_o35,n),n=$s._createAt(_o35,0);}}catch(err){_iterator173.e(err);}finally{_iterator173.f();}return n;}(n,e),this.conversionApi.writer=e,this.conversionApi.consumable=Ea.createFrom(t),this.conversionApi.store={};var _this$_convertItem=this._convertItem(t,this._modelCursor),i=_this$_convertItem.modelRange,o=e.createDocumentFragment();if(i){this._removeEmptyElements();for(var _i93=0,_Array$from5=Array.from(this._modelCursor.parent.getChildren());_i93<_Array$from5.length;_i93++){var _t144=_Array$from5[_i93];e.append(_t144,o);}o.markers=function(t,e){var n=new Set(),i=new Map(),o=Gs._createIn(t).getItems();var _iterator175=_createForOfIteratorHelper(o),_step175;try{for(_iterator175.s();!(_step175=_iterator175.n()).done;){var _t145=_step175.value;\"$marker\"==_t145.name&&n.add(_t145);}}catch(err){_iterator175.e(err);}finally{_iterator175.f();}var _iterator176=_createForOfIteratorHelper(n),_step176;try{for(_iterator176.s();!(_step176=_iterator176.n()).done;){var _t146=_step176.value;var _n126=_t146.getAttribute(\"data-name\"),_o36=e.createPositionBefore(_t146);i.has(_n126)?i.get(_n126).end=_o36.clone():i.set(_n126,new Gs(_o36.clone())),e.remove(_t146);}}catch(err){_iterator176.e(err);}finally{_iterator176.f();}return i;}(o,e);}return this._modelCursor=null,this._removeIfEmpty.clear(),this.conversionApi.writer=null,this.conversionApi.store=null,o;}},{key:\"_convertItem\",value:function _convertItem(t,e){var n=Object.assign({viewItem:t,modelCursor:e,modelRange:null});if(t.is(\"element\")?this.fire(\"element:\"+t.name,n,this.conversionApi):t.is(\"text\")?this.fire(\"text\",n,this.conversionApi):this.fire(\"documentFragment\",n,this.conversionApi),n.modelRange&&!(n.modelRange instanceof Gs))throw new Gn.b(\"view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.\");return{modelRange:n.modelRange,modelCursor:n.modelCursor};}},{key:\"_convertChildren\",value:function _convertChildren(t,e){var n=new Gs(e);var i=e;for(var _i94=0,_Array$from6=Array.from(t.getChildren());_i94<_Array$from6.length;_i94++){var _e132=_Array$from6[_i94];var _t147=this._convertItem(_e132,i);_t147.modelRange instanceof Gs&&(n.end=_t147.modelRange.end,i=_t147.modelCursor);}return{modelRange:n,modelCursor:i};}},{key:\"_splitToAllowedParent\",value:function _splitToAllowedParent(t,e){var n=this.conversionApi.schema.findAllowedParent(e,t);if(!n)return null;if(n===e.parent)return{position:e};if(this._modelCursor.parent.getAncestors().includes(n))return null;var i=this.conversionApi.writer.split(e,n);var _iterator177=_createForOfIteratorHelper(i.range.getPositions()),_step177;try{for(_iterator177.s();!(_step177=_iterator177.n()).done;){var _t148=_step177.value;_t148.isEqual(i.position)||this._removeIfEmpty.add(_t148.parent);}}catch(err){_iterator177.e(err);}finally{_iterator177.f();}return{position:i.position,cursorParent:i.range.end.parent};}},{key:\"_removeEmptyElements\",value:function _removeEmptyElements(){var t=!1;var _iterator178=_createForOfIteratorHelper(this._removeIfEmpty),_step178;try{for(_iterator178.s();!(_step178=_iterator178.n()).done;){var _e133=_step178.value;_e133.isEmpty&&(this.conversionApi.writer.remove(_e133),this._removeIfEmpty[\"delete\"](_e133),t=!0);}}catch(err){_iterator178.e(err);}finally{_iterator178.f();}t&&this._removeEmptyElements();}}]);return Ha;}();ci(Ha,ei);var qa=/*#__PURE__*/function(){function qa(t,e){var _this54=this;_classCallCheck(this,qa);this.model=t,this.processor=e,this.mapper=new Qs(),this.downcastDispatcher=new Zs({mapper:this.mapper}),this.downcastDispatcher.on(\"insert:$text\",function(t,e,n){if(!n.consumable.consume(e.item,\"insert\"))return;var i=n.writer,o=n.mapper.toViewPosition(e.range.start),r=i.createText(e.item.data);i.insert(o,r);},{priority:\"lowest\"}),this.upcastDispatcher=new Ha({schema:t.schema}),this.upcastDispatcher.on(\"text\",function(t,e,n){if(n.schema.checkChild(e.modelCursor,\"$text\")&&n.consumable.consume(e.viewItem)){var _t149=n.writer.createText(e.viewItem.data);n.writer.insert(_t149,e.modelCursor),e.modelRange=Gs._createFromPositionAndShift(e.modelCursor,_t149.offsetSize),e.modelCursor=e.modelRange.end;}},{priority:\"lowest\"}),this.upcastDispatcher.on(\"element\",function(t,e,n){if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){var _n$convertChildren=n.convertChildren(e.viewItem,e.modelCursor),_t150=_n$convertChildren.modelRange,_i95=_n$convertChildren.modelCursor;e.modelRange=_t150,e.modelCursor=_i95;}},{priority:\"lowest\"}),this.upcastDispatcher.on(\"documentFragment\",function(t,e,n){if(!e.modelRange&&n.consumable.consume(e.viewItem,{name:!0})){var _n$convertChildren2=n.convertChildren(e.viewItem,e.modelCursor),_t151=_n$convertChildren2.modelRange,_i96=_n$convertChildren2.modelCursor;e.modelRange=_t151,e.modelCursor=_i96;}},{priority:\"lowest\"}),this.decorate(\"init\"),this.on(\"init\",function(){_this54.fire(\"ready\");},{priority:\"lowest\"});}_createClass(qa,[{key:\"get\",value:function get(t){var _ref9=t||{},_ref9$rootName=_ref9.rootName,e=_ref9$rootName===void 0?\"main\":_ref9$rootName,_ref9$trim=_ref9.trim,n=_ref9$trim===void 0?\"empty\":_ref9$trim;if(!this._checkIfRootsExists([e]))throw new Gn.b(\"datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.\");var i=this.model.document.getRoot(e);return\"empty\"!==n||this.model.hasContent(i,{ignoreWhitespaces:!0})?this.stringify(i):\"\";}},{key:\"stringify\",value:function stringify(t){var e=this.toView(t);return this.processor.toData(e);}},{key:\"toView\",value:function toView(t){this.mapper.clearBindings();var e=Gs._createIn(t),n=new Ao(),i=new Co(new ro());if(this.mapper.bindElements(t,n),this.downcastDispatcher.convertInsert(e,i),!t.is(\"documentFragment\")){var _e134=function(t){var e=[],n=t.root.document;if(!n)return[];var i=Gs._createIn(t);var _iterator179=_createForOfIteratorHelper(n.model.markers),_step179;try{for(_iterator179.s();!(_step179=_iterator179.n()).done;){var _t152=_step179.value;var _n127=i.getIntersection(_t152.getRange());_n127&&e.push([_t152.name,_n127]);}}catch(err){_iterator179.e(err);}finally{_iterator179.f();}return e;}(t);var _iterator180=_createForOfIteratorHelper(_e134),_step180;try{for(_iterator180.s();!(_step180=_iterator180.n()).done;){var _step180$value=_slicedToArray(_step180.value,2),_t153=_step180$value[0],_n128=_step180$value[1];this.downcastDispatcher.convertMarkerAdd(_t153,_n128,i);}}catch(err){_iterator180.e(err);}finally{_iterator180.f();}}return n;}},{key:\"init\",value:function init(t){var _this55=this;if(this.model.document.version)throw new Gn.b(\"datacontroller-init-document-not-empty: Trying to set initial data to not empty document.\");var e={};if(\"string\"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new Gn.b(\"datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.\");return this.model.enqueueChange(\"transparent\",function(t){for(var _i97=0,_Object$keys=Object.keys(e);_i97<_Object$keys.length;_i97++){var _n129=_Object$keys[_i97];var _i98=_this55.model.document.getRoot(_n129);t.insert(_this55.parse(e[_n129],_i98),_i98,0);}}),Promise.resolve();}},{key:\"set\",value:function set(t){var _this56=this;var e={};if(\"string\"==typeof t?e.main=t:e=t,!this._checkIfRootsExists(Object.keys(e)))throw new Gn.b(\"datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.\");this.model.enqueueChange(\"transparent\",function(t){t.setSelection(null),t.removeSelectionAttribute(_this56.model.document.selection.getAttributeKeys());for(var _i99=0,_Object$keys2=Object.keys(e);_i99<_Object$keys2.length;_i99++){var _n130=_Object$keys2[_i99];var _i100=_this56.model.document.getRoot(_n130);t.remove(t.createRangeIn(_i100)),t.insert(_this56.parse(e[_n130],_i100),_i100,0);}});}},{key:\"parse\",value:function parse(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:\"$root\";var n=this.processor.toView(t);return this.toModel(n,e);}},{key:\"toModel\",value:function toModel(t){var _this57=this;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:\"$root\";return this.model.change(function(n){return _this57.upcastDispatcher.convert(t,n,e);});}},{key:\"destroy\",value:function destroy(){this.stopListening();}},{key:\"_checkIfRootsExists\",value:function _checkIfRootsExists(t){var _iterator181=_createForOfIteratorHelper(t),_step181;try{for(_iterator181.s();!(_step181=_iterator181.n()).done;){var _e135=_step181.value;if(!this.model.document.getRootNames().includes(_e135))return!1;}}catch(err){_iterator181.e(err);}finally{_iterator181.f();}return!0;}}]);return qa;}();ci(qa,Fi);var Wa=/*#__PURE__*/function(){function Wa(t,e){_classCallCheck(this,Wa);this._helpers=new Map(),this._downcast=Array.isArray(t)?t:[t],this._createConversionHelpers({name:\"downcast\",dispatchers:this._downcast,isDowncast:!0}),this._upcast=Array.isArray(e)?e:[e],this._createConversionHelpers({name:\"upcast\",dispatchers:this._upcast,isDowncast:!1});}_createClass(Wa,[{key:\"addAlias\",value:function addAlias(t,e){var n=this._downcast.includes(e);if(!this._upcast.includes(e)&&!n)throw new Gn.b(\"conversion-add-alias-dispatcher-not-registered: Trying to register and alias for a dispatcher that nas not been registered.\");this._createConversionHelpers({name:t,dispatchers:[e],isDowncast:n});}},{key:\"for\",value:function _for(t){if(!this._helpers.has(t))throw new Gn.b(\"conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.\");return this._helpers.get(t);}},{key:\"elementToElement\",value:function elementToElement(t){this[\"for\"](\"downcast\").elementToElement(t);var _iterator182=_createForOfIteratorHelper(Ya(t)),_step182;try{for(_iterator182.s();!(_step182=_iterator182.n()).done;){var _step182$value=_step182.value,_e136=_step182$value.model,_n131=_step182$value.view;this[\"for\"](\"upcast\").elementToElement({model:_e136,view:_n131,converterPriority:t.converterPriority});}}catch(err){_iterator182.e(err);}finally{_iterator182.f();}}},{key:\"attributeToElement\",value:function attributeToElement(t){this[\"for\"](\"downcast\").attributeToElement(t);var _iterator183=_createForOfIteratorHelper(Ya(t)),_step183;try{for(_iterator183.s();!(_step183=_iterator183.n()).done;){var _step183$value=_step183.value,_e137=_step183$value.model,_n132=_step183$value.view;this[\"for\"](\"upcast\").elementToAttribute({view:_n132,model:_e137,converterPriority:t.converterPriority});}}catch(err){_iterator183.e(err);}finally{_iterator183.f();}}},{key:\"attributeToAttribute\",value:function attributeToAttribute(t){this[\"for\"](\"downcast\").attributeToAttribute(t);var _iterator184=_createForOfIteratorHelper(Ya(t)),_step184;try{for(_iterator184.s();!(_step184=_iterator184.n()).done;){var _step184$value=_step184.value,_e138=_step184$value.model,_n133=_step184$value.view;this[\"for\"](\"upcast\").attributeToAttribute({view:_n133,model:_e138});}}catch(err){_iterator184.e(err);}finally{_iterator184.f();}}},{key:\"_createConversionHelpers\",value:function _createConversionHelpers(_ref10){var t=_ref10.name,e=_ref10.dispatchers,n=_ref10.isDowncast;if(this._helpers.has(t))throw new Gn.b(\"conversion-group-exists: Trying to register a group name that has already been registered.\");var i=n?new fa(e):new _a(e);this._helpers.set(t,i);}}]);return Wa;}();function Ya(t){var _iterator185,_step185,_e139;return _regeneratorRuntime().wrap(function Ya$(_context29){while(1)switch(_context29.prev=_context29.next){case 0:if(!t.model.values){_context29.next=19;break;}_iterator185=_createForOfIteratorHelper(t.model.values);_context29.prev=2;_iterator185.s();case 4:if((_step185=_iterator185.n()).done){_context29.next=9;break;}_e139=_step185.value;return _context29.delegateYield($a({key:t.model.key,value:_e139},t.view[_e139],t.upcastAlso?t.upcastAlso[_e139]:void 0),\"t0\",7);case 7:_context29.next=4;break;case 9:_context29.next=14;break;case 11:_context29.prev=11;_context29.t1=_context29[\"catch\"](2);_iterator185.e(_context29.t1);case 14:_context29.prev=14;_iterator185.f();return _context29.finish(14);case 17:_context29.next=20;break;case 19:return _context29.delegateYield($a(t.model,t.view,t.upcastAlso),\"t2\",20);case 20:case\"end\":return _context29.stop();}},_marked,null,[[2,11,14,17]]);}function $a(t,e,n){var _iterator186,_step186,_e140;return _regeneratorRuntime().wrap(function $a$(_context30){while(1)switch(_context30.prev=_context30.next){case 0:_context30.next=2;return{model:t,view:e};case 2:if(!n){_context30.next=21;break;}n=Array.isArray(n)?n:[n];_iterator186=_createForOfIteratorHelper(n);_context30.prev=5;_iterator186.s();case 7:if((_step186=_iterator186.n()).done){_context30.next=13;break;}_e140=_step186.value;_context30.next=11;return{model:t,view:_e140};case 11:_context30.next=7;break;case 13:_context30.next=18;break;case 15:_context30.prev=15;_context30.t0=_context30[\"catch\"](5);_iterator186.e(_context30.t0);case 18:_context30.prev=18;_iterator186.f();return _context30.finish(18);case 21:case\"end\":return _context30.stop();}},_marked2,null,[[5,15,18,21]]);}var Ga=/*#__PURE__*/function(){function Ga(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:\"default\";_classCallCheck(this,Ga);this.operations=[],this.type=t;}_createClass(Ga,[{key:\"baseVersion\",get:function get(){var _iterator187=_createForOfIteratorHelper(this.operations),_step187;try{for(_iterator187.s();!(_step187=_iterator187.n()).done;){var _t154=_step187.value;if(null!==_t154.baseVersion)return _t154.baseVersion;}}catch(err){_iterator187.e(err);}finally{_iterator187.f();}return null;}},{key:\"addOperation\",value:function addOperation(t){return t.batch=this,this.operations.push(t),t;}}]);return Ga;}();var Qa=/*#__PURE__*/function(){function Qa(t){_classCallCheck(this,Qa);this.baseVersion=t,this.isDocumentOperation=null!==this.baseVersion,this.batch=null;}_createClass(Qa,[{key:\"_validate\",value:function _validate(){}},{key:\"toJSON\",value:function toJSON(){var t=Object.assign({},this);return t.__className=this.constructor.className,delete t.batch,delete t.isDocumentOperation,t;}}],[{key:\"className\",get:function get(){return\"Operation\";}},{key:\"fromJSON\",value:function fromJSON(t){return new this(t.baseVersion);}}]);return Qa;}();var Ja=/*#__PURE__*/function(_Symbol$iterator11){function Ja(t){_classCallCheck(this,Ja);this.markers=new Map(),this._children=new Us(),t&&this._insertChild(0,t);}_createClass(Ja,[{key:_Symbol$iterator11,value:function value(){return this.getChildren();}},{key:\"childCount\",get:function get(){return this._children.length;}},{key:\"maxOffset\",get:function get(){return this._children.maxOffset;}},{key:\"isEmpty\",get:function get(){return 0===this.childCount;}},{key:\"root\",get:function get(){return this;}},{key:\"parent\",get:function get(){return null;}},{key:\"is\",value:function is(t){return\"documentFragment\"==t;}},{key:\"getChild\",value:function getChild(t){return this._children.getNode(t);}},{key:\"getChildren\",value:function getChildren(){return this._children[Symbol.iterator]();}},{key:\"getChildIndex\",value:function getChildIndex(t){return this._children.getNodeIndex(t);}},{key:\"getChildStartOffset\",value:function getChildStartOffset(t){return this._children.getNodeStartOffset(t);}},{key:\"getPath\",value:function getPath(){return[];}},{key:\"getNodeByPath\",value:function getNodeByPath(t){var e=this;var _iterator188=_createForOfIteratorHelper(t),_step188;try{for(_iterator188.s();!(_step188=_iterator188.n()).done;){var _n134=_step188.value;e=e.getChild(e.offsetToIndex(_n134));}}catch(err){_iterator188.e(err);}finally{_iterator188.f();}return e;}},{key:\"offsetToIndex\",value:function offsetToIndex(t){return this._children.offsetToIndex(t);}},{key:\"toJSON\",value:function toJSON(){var t=[];var _iterator189=_createForOfIteratorHelper(this._children),_step189;try{for(_iterator189.s();!(_step189=_iterator189.n()).done;){var _e141=_step189.value;t.push(_e141.toJSON());}}catch(err){_iterator189.e(err);}finally{_iterator189.f();}return t;}},{key:\"_appendChild\",value:function _appendChild(t){this._insertChild(this.childCount,t);}},{key:\"_insertChild\",value:function _insertChild(t,e){var n=function(t){if(\"string\"==typeof t)return[new zs(t)];gi(t)||(t=[t]);return Array.from(t).map(function(t){return\"string\"==typeof t?new zs(t):t instanceof Fs?new zs(t.data,t.getAttributes()):t;});}(e);var _iterator190=_createForOfIteratorHelper(n),_step190;try{for(_iterator190.s();!(_step190=_iterator190.n()).done;){var _t155=_step190.value;null!==_t155.parent&&_t155._remove(),_t155.parent=this;}}catch(err){_iterator190.e(err);}finally{_iterator190.f();}this._children._insertNodes(t,n);}},{key:\"_removeChildren\",value:function _removeChildren(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;var n=this._children._removeNodes(t,e);var _iterator191=_createForOfIteratorHelper(n),_step191;try{for(_iterator191.s();!(_step191=_iterator191.n()).done;){var _t156=_step191.value;_t156.parent=null;}}catch(err){_iterator191.e(err);}finally{_iterator191.f();}return n;}}],[{key:\"fromJSON\",value:function fromJSON(t){var e=[];var _iterator192=_createForOfIteratorHelper(t),_step192;try{for(_iterator192.s();!(_step192=_iterator192.n()).done;){var _n135=_step192.value;_n135.name?e.push(Hs.fromJSON(_n135)):e.push(zs.fromJSON(_n135));}}catch(err){_iterator192.e(err);}finally{_iterator192.f();}return new Ja(e);}}]);return Ja;}(Symbol.iterator);function Ka(t,e){var n=(e=tc(e)).reduce(function(t,e){return t+e.offsetSize;},0),i=t.parent;nc(t);var o=t.index;return i._insertChild(o,e),ec(i,o+e.length),ec(i,o),new Gs(t,t.getShiftedBy(n));}function Za(t){if(!t.isFlat)throw new Gn.b(\"operation-utils-remove-range-not-flat: Trying to remove a range which starts and ends in different element.\");var e=t.start.parent;nc(t.start),nc(t.end);var n=e._removeChildren(t.start.index,t.end.index-t.start.index);return ec(e,t.start.index),n;}function Xa(t,e){if(!t.isFlat)throw new Gn.b(\"operation-utils-move-range-not-flat: Trying to move a range which starts and ends in different element.\");var n=Za(t);return Ka(e=e._getTransformedByDeletion(t.start,t.end.offset-t.start.offset),n);}function tc(t){var e=[];t instanceof Array||(t=[t]);for(var _n136=0;_n136t.maxOffset)throw new Gn.b(\"move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.\");if(t===e&&n=n&&this.targetPosition.path[_t161]2&&arguments[2]!==undefined?arguments[2]:\"main\";_classCallCheck(this,mc);_this67=_super32.call(this,e),_this67._doc=t,_this67.rootName=n;return _this67;}_createClass(mc,[{key:\"document\",get:function get(){return this._doc;}},{key:\"is\",value:function is(t,e){return e?\"rootElement\"==t&&e==this.name||_get(_getPrototypeOf(mc.prototype),\"is\",this).call(this,t,e):\"rootElement\"==t||_get(_getPrototypeOf(mc.prototype),\"is\",this).call(this,t);}},{key:\"toJSON\",value:function toJSON(){return this.rootName;}}]);return mc;}(Hs);var pc=/*#__PURE__*/function(){function pc(t,e){_classCallCheck(this,pc);this.model=t,this.batch=e;}_createClass(pc,[{key:\"createText\",value:function createText(t,e){return new zs(t,e);}},{key:\"createElement\",value:function createElement(t,e){return new Hs(t,e);}},{key:\"createDocumentFragment\",value:function createDocumentFragment(){return new Ja();}},{key:\"insert\",value:function insert(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;if(this._assertWriterUsedCorrectly(),t instanceof zs&&\"\"==t.data)return;var i=$s._createAt(e,n);if(t.parent){if(kc(t.root,i.root))return void this.move(Gs._createOn(t),i);if(t.root.document)throw new Error(\"model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.\");this.remove(t);}var o=i.root.document?i.root.document.version:null,r=new cc(i,t,o);if(t instanceof zs&&(r.shouldReceiveAttributes=!0),this.batch.addOperation(r),this.model.applyOperation(r),t instanceof Ja){var _iterator198=_createForOfIteratorHelper(t.markers),_step198;try{for(_iterator198.s();!(_step198=_iterator198.n()).done;){var _step198$value=_slicedToArray(_step198.value,2),_e144=_step198$value[0],_n138=_step198$value[1];var _t162=$s._createAt(_n138.root,0),_o39=new Gs(_n138.start._getCombined(_t162,i),_n138.end._getCombined(_t162,i));this.addMarker(_e144,{range:_o39,usingOperation:!0,affectsData:!0});}}catch(err){_iterator198.e(err);}finally{_iterator198.f();}}}},{key:\"insertText\",value:function insertText(t,e,n,i){e instanceof Ja||e instanceof Hs||e instanceof $s?this.insert(this.createText(t),e,n):this.insert(this.createText(t,e),n,i);}},{key:\"insertElement\",value:function insertElement(t,e,n,i){e instanceof Ja||e instanceof Hs||e instanceof $s?this.insert(this.createElement(t),e,n):this.insert(this.createElement(t,e),n,i);}},{key:\"append\",value:function append(t,e){this.insert(t,e,\"end\");}},{key:\"appendText\",value:function appendText(t,e,n){e instanceof Ja||e instanceof Hs?this.insert(this.createText(t),e,\"end\"):this.insert(this.createText(t,e),n,\"end\");}},{key:\"appendElement\",value:function appendElement(t,e,n){e instanceof Ja||e instanceof Hs?this.insert(this.createElement(t),e,\"end\"):this.insert(this.createElement(t,e),n,\"end\");}},{key:\"setAttribute\",value:function setAttribute(t,e,n){if(this._assertWriterUsedCorrectly(),n instanceof Gs){var _i105=n.getMinimalFlatRanges();var _iterator199=_createForOfIteratorHelper(_i105),_step199;try{for(_iterator199.s();!(_step199=_iterator199.n()).done;){var _n139=_step199.value;gc(this,t,e,_n139);}}catch(err){_iterator199.e(err);}finally{_iterator199.f();}}else bc(this,t,e,n);}},{key:\"setAttributes\",value:function setAttributes(t,e){var _iterator200=_createForOfIteratorHelper(Vs(t)),_step200;try{for(_iterator200.s();!(_step200=_iterator200.n()).done;){var _step200$value=_slicedToArray(_step200.value,2),_n140=_step200$value[0],_i106=_step200$value[1];this.setAttribute(_n140,_i106,e);}}catch(err){_iterator200.e(err);}finally{_iterator200.f();}}},{key:\"removeAttribute\",value:function removeAttribute(t,e){if(this._assertWriterUsedCorrectly(),e instanceof Gs){var _n141=e.getMinimalFlatRanges();var _iterator201=_createForOfIteratorHelper(_n141),_step201;try{for(_iterator201.s();!(_step201=_iterator201.n()).done;){var _e145=_step201.value;gc(this,t,null,_e145);}}catch(err){_iterator201.e(err);}finally{_iterator201.f();}}else bc(this,t,null,e);}},{key:\"clearAttributes\",value:function clearAttributes(t){var _this68=this;this._assertWriterUsedCorrectly();var e=function e(t){var _iterator202=_createForOfIteratorHelper(t.getAttributeKeys()),_step202;try{for(_iterator202.s();!(_step202=_iterator202.n()).done;){var _e146=_step202.value;_this68.removeAttribute(_e146,t);}}catch(err){_iterator202.e(err);}finally{_iterator202.f();}};if(t instanceof Gs){var _iterator203=_createForOfIteratorHelper(t.getItems()),_step203;try{for(_iterator203.s();!(_step203=_iterator203.n()).done;){var _n142=_step203.value;e(_n142);}}catch(err){_iterator203.e(err);}finally{_iterator203.f();}}else e(t);}},{key:\"move\",value:function move(t,e,n){if(this._assertWriterUsedCorrectly(),!(t instanceof Gs))throw new Gn.b(\"writer-move-invalid-range: Invalid range to move.\");if(!t.isFlat)throw new Gn.b(\"writer-move-range-not-flat: Range to move is not flat.\");var i=$s._createAt(e,n);if(i.isEqual(t.start))return;if(this._addOperationForAffectedMarkers(\"move\",t),!kc(t.root,i.root))throw new Gn.b(\"writer-move-different-document: Range is going to be moved between different documents.\");var o=t.root.document?t.root.document.version:null,r=new ac(t.start,t.end.offset-t.start.offset,i,o);this.batch.addOperation(r),this.model.applyOperation(r);}},{key:\"remove\",value:function remove(t){this._assertWriterUsedCorrectly();var e=(t instanceof Gs?t:Gs._createOn(t)).getMinimalFlatRanges().reverse();var _iterator204=_createForOfIteratorHelper(e),_step204;try{for(_iterator204.s();!(_step204=_iterator204.n()).done;){var _t163=_step204.value;this._addOperationForAffectedMarkers(\"move\",_t163),_c(_t163.start,_t163.end.offset-_t163.start.offset,this.batch,this.model);}}catch(err){_iterator204.e(err);}finally{_iterator204.f();}}},{key:\"merge\",value:function merge(t){this._assertWriterUsedCorrectly();var e=t.nodeBefore,n=t.nodeAfter;if(this._addOperationForAffectedMarkers(\"merge\",t),!(e instanceof Hs))throw new Gn.b(\"writer-merge-no-element-before: Node before merge position must be an element.\");if(!(n instanceof Hs))throw new Gn.b(\"writer-merge-no-element-after: Node after merge position must be an element.\");t.root.document?this._merge(t):this._mergeDetached(t);}},{key:\"createPositionFromPath\",value:function createPositionFromPath(t,e,n){return this.model.createPositionFromPath(t,e,n);}},{key:\"createPositionAt\",value:function createPositionAt(t,e){return this.model.createPositionAt(t,e);}},{key:\"createPositionAfter\",value:function createPositionAfter(t){return this.model.createPositionAfter(t);}},{key:\"createPositionBefore\",value:function createPositionBefore(t){return this.model.createPositionBefore(t);}},{key:\"createRange\",value:function createRange(t,e){return this.model.createRange(t,e);}},{key:\"createRangeIn\",value:function createRangeIn(t){return this.model.createRangeIn(t);}},{key:\"createRangeOn\",value:function createRangeOn(t){return this.model.createRangeOn(t);}},{key:\"createSelection\",value:function createSelection(t,e,n){return this.model.createSelection(t,e,n);}},{key:\"_mergeDetached\",value:function _mergeDetached(t){var e=t.nodeBefore,n=t.nodeAfter;this.move(Gs._createIn(n),$s._createAt(e,\"end\")),this.remove(n);}},{key:\"_merge\",value:function _merge(t){var e=$s._createAt(t.nodeBefore,\"end\"),n=$s._createAt(t.nodeAfter,0),i=t.root.document.graveyard,o=new $s(i,[0]),r=t.root.document.version,s=new hc(n,t.nodeAfter.maxOffset,e,o,r);this.batch.addOperation(s),this.model.applyOperation(s);}},{key:\"rename\",value:function rename(t,e){if(this._assertWriterUsedCorrectly(),!(t instanceof Hs))throw new Gn.b(\"writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.\");var n=t.root.document?t.root.document.version:null,i=new dc($s._createBefore(t),t.name,e,n);this.batch.addOperation(i),this.model.applyOperation(i);}},{key:\"split\",value:function split(t,e){this._assertWriterUsedCorrectly();var n,i,o=t.parent;if(!o.parent)throw new Gn.b(\"writer-split-element-no-parent: Element with no parent can not be split.\");if(e||(e=o.parent),!t.parent.getAncestors({includeSelf:!0}).includes(e))throw new Gn.b(\"writer-split-invalid-limit-element: Limit element is not a position ancestor.\");do{var _e147=o.root.document?o.root.document.version:null,_r15=o.maxOffset-t.offset,_s13=new fc(t,_r15,null,_e147);this.batch.addOperation(_s13),this.model.applyOperation(_s13),n||i||(n=o,i=t.parent.nextSibling),o=(t=this.createPositionAfter(t.parent)).parent;}while(o!==e);return{position:t,range:new Gs($s._createAt(n,\"end\"),$s._createAt(i,0))};}},{key:\"wrap\",value:function wrap(t,e){if(this._assertWriterUsedCorrectly(),!t.isFlat)throw new Gn.b(\"writer-wrap-range-not-flat: Range to wrap is not flat.\");var n=e instanceof Hs?e:new Hs(e);if(n.childCount>0)throw new Gn.b(\"writer-wrap-element-not-empty: Element to wrap with is not empty.\");if(null!==n.parent)throw new Gn.b(\"writer-wrap-element-attached: Element to wrap with is already attached to tree model.\");var i=t.root.document?t.root.document.version:null,o=new cc(t.start,n,i);this.batch.addOperation(o),this.model.applyOperation(o);var r=new ac(t.start.getShiftedBy(1),t.end.offset-t.start.offset,$s._createAt(n,0),null===i?null:i+1);this.batch.addOperation(r),this.model.applyOperation(r);}},{key:\"unwrap\",value:function unwrap(t){if(this._assertWriterUsedCorrectly(),null===t.parent)throw new Gn.b(\"writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.\");this.move(Gs._createIn(t),this.createPositionAfter(t)),this.remove(t);}},{key:\"addMarker\",value:function addMarker(t,e){if(this._assertWriterUsedCorrectly(),!e||\"boolean\"!=typeof e.usingOperation)throw new Gn.b(\"writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.\");var n=e.usingOperation,i=e.range,o=void 0!==e.affectsData&&e.affectsData;if(this.model.markers.has(t))throw new Gn.b(\"writer-addMarker-marker-exists: Marker with provided name already exists.\");if(!i)throw new Gn.b(\"writer-addMarker-no-range: Range parameter is required when adding a new marker.\");return n?(wc(this,t,null,i,o),this.model.markers.get(t)):this.model.markers._set(t,i,n,o);}},{key:\"updateMarker\",value:function updateMarker(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._assertWriterUsedCorrectly();var n=\"string\"==typeof t?t:t.name,i=this.model.markers.get(n);if(!i)throw new Gn.b(\"writer-updateMarker-marker-not-exists: Marker with provided name does not exists.\");var o=\"boolean\"==typeof e.usingOperation,r=\"boolean\"==typeof e.affectsData,s=r?e.affectsData:i.affectsData;if(!o&&!e.range&&!r)throw new Gn.b(\"writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.\");var a=i.getRange(),c=e.range?e.range:a;o&&e.usingOperation!==i.managedUsingOperations?e.usingOperation?wc(this,n,null,c,s):(wc(this,n,a,null,s),this.model.markers._set(n,c,void 0,s)):i.managedUsingOperations?wc(this,n,a,c,s):this.model.markers._set(n,c,void 0,s);}},{key:\"removeMarker\",value:function removeMarker(t){this._assertWriterUsedCorrectly();var e=\"string\"==typeof t?t:t.name;if(!this.model.markers.has(e))throw new Gn.b(\"writer-removeMarker-no-marker: Trying to remove marker which does not exist.\");var n=this.model.markers.get(e);n.managedUsingOperations?wc(this,e,n.getRange(),null,n.affectsData):this.model.markers._remove(e);}},{key:\"setSelection\",value:function setSelection(t,e,n){this._assertWriterUsedCorrectly(),this.model.document.selection._setTo(t,e,n);}},{key:\"setSelectionFocus\",value:function setSelectionFocus(t,e){this._assertWriterUsedCorrectly(),this.model.document.selection._setFocus(t,e);}},{key:\"setSelectionAttribute\",value:function setSelectionAttribute(t,e){if(this._assertWriterUsedCorrectly(),\"string\"==typeof t)this._setSelectionAttribute(t,e);else{var _iterator205=_createForOfIteratorHelper(Vs(t)),_step205;try{for(_iterator205.s();!(_step205=_iterator205.n()).done;){var _step205$value=_slicedToArray(_step205.value,2),_e148=_step205$value[0],_n143=_step205$value[1];this._setSelectionAttribute(_e148,_n143);}}catch(err){_iterator205.e(err);}finally{_iterator205.f();}}}},{key:\"removeSelectionAttribute\",value:function removeSelectionAttribute(t){if(this._assertWriterUsedCorrectly(),\"string\"==typeof t)this._removeSelectionAttribute(t);else{var _iterator206=_createForOfIteratorHelper(t),_step206;try{for(_iterator206.s();!(_step206=_iterator206.n()).done;){var _e149=_step206.value;this._removeSelectionAttribute(_e149);}}catch(err){_iterator206.e(err);}finally{_iterator206.f();}}}},{key:\"overrideSelectionGravity\",value:function overrideSelectionGravity(){return this.model.document.selection._overrideGravity();}},{key:\"restoreSelectionGravity\",value:function restoreSelectionGravity(t){this.model.document.selection._restoreGravity(t);}},{key:\"_setSelectionAttribute\",value:function _setSelectionAttribute(t,e){var n=this.model.document.selection;if(n.isCollapsed&&n.anchor.parent.isEmpty){var _i107=sa._getStoreAttributeKey(t);this.setAttribute(_i107,e,n.anchor.parent);}n._setAttribute(t,e);}},{key:\"_removeSelectionAttribute\",value:function _removeSelectionAttribute(t){var e=this.model.document.selection;if(e.isCollapsed&&e.anchor.parent.isEmpty){var _n144=sa._getStoreAttributeKey(t);this.removeAttribute(_n144,e.anchor.parent);}e._removeAttribute(t);}},{key:\"_assertWriterUsedCorrectly\",value:function _assertWriterUsedCorrectly(){if(this.model._currentWriter!==this)throw new Gn.b(\"writer-incorrect-use: Trying to use a writer outside the change() block.\");}},{key:\"_addOperationForAffectedMarkers\",value:function _addOperationForAffectedMarkers(t,e){var _iterator207=_createForOfIteratorHelper(this.model.markers),_step207;try{for(_iterator207.s();!(_step207=_iterator207.n()).done;){var _n145=_step207.value;if(!_n145.managedUsingOperations)continue;var _i108=_n145.getRange();var _o40=!1;if(\"move\"==t)_o40=e.containsPosition(_i108.start)||e.start.isEqual(_i108.start)||e.containsPosition(_i108.end)||e.end.isEqual(_i108.end);else{var _t164=e.nodeBefore,_n146=e.nodeAfter,_r16=_i108.start.parent==_t164&&_i108.start.isAtEnd,_s14=_i108.end.parent==_n146&&0==_i108.end.offset;_o40=_r16||_s14;}_o40&&this.updateMarker(_n145.name,{range:_i108});}}catch(err){_iterator207.e(err);}finally{_iterator207.f();}}}]);return pc;}();function gc(t,e,n,i){var o=t.model,r=o.document;var s,a,c,l=i.start;var _iterator208=_createForOfIteratorHelper(i.getWalker({shallow:!0})),_step208;try{for(_iterator208.s();!(_step208=_iterator208.n()).done;){var _t165=_step208.value;c=_t165.item.getAttribute(e),s&&a!=c&&(a!=n&&d(),l=s),s=_t165.nextPosition,a=c;}}catch(err){_iterator208.e(err);}finally{_iterator208.f();}function d(){var i=new Gs(l,s),c=i.root.document?r.version:null,d=new rc(i,e,a,n,c);t.batch.addOperation(d),o.applyOperation(d);}s instanceof $s&&s!=l&&a!=n&&d();}function bc(t,e,n,i){var o=t.model,r=o.document,s=i.getAttribute(e);var a,c;if(s!=n){if(i.root===i){var _t166=i.document?r.version:null;c=new uc(i,e,s,n,_t166);}else{var _o41=(a=new Gs($s._createBefore(i),t.createPositionAfter(i))).root.document?r.version:null;c=new rc(a,e,s,n,_o41);}t.batch.addOperation(c),o.applyOperation(c);}}function wc(t,e,n,i,o){var r=t.model,s=r.document,a=new lc(e,n,i,r.markers,o,s.version);t.batch.addOperation(a),r.applyOperation(a);}function _c(t,e,n,i){var o;if(t.root.document){var _n147=i.document,_r17=new $s(_n147.graveyard,[0]);o=new ac(t,e,_r17,_n147.version);}else o=new sc(t,e);n.addOperation(o),i.applyOperation(o);}function kc(t,e){return t===e||t instanceof mc&&e instanceof mc;}var vc=/*#__PURE__*/function(){function vc(t){_classCallCheck(this,vc);this._markerCollection=t,this._changesInElement=new Map(),this._elementSnapshots=new Map(),this._changedMarkers=new Map(),this._changeCount=0,this._cachedChanges=null,this._cachedChangesWithGraveyard=null;}_createClass(vc,[{key:\"isEmpty\",get:function get(){return 0==this._changesInElement.size&&0==this._changedMarkers.size;}},{key:\"bufferOperation\",value:function bufferOperation(t){switch(t.type){case\"insert\":if(this._isInInsertedElement(t.position.parent))return;this._markInsert(t.position.parent,t.position.offset,t.nodes.maxOffset);break;case\"addAttribute\":case\"removeAttribute\":case\"changeAttribute\":var _iterator209=_createForOfIteratorHelper(t.range.getItems()),_step209;try{for(_iterator209.s();!(_step209=_iterator209.n()).done;){var _e150=_step209.value;this._isInInsertedElement(_e150.parent)||this._markAttribute(_e150);}}catch(err){_iterator209.e(err);}finally{_iterator209.f();}break;case\"remove\":case\"move\":case\"reinsert\":{if(t.sourcePosition.isEqual(t.targetPosition)||t.sourcePosition.getShiftedBy(t.howMany).isEqual(t.targetPosition))return;var _e151=this._isInInsertedElement(t.sourcePosition.parent),_n148=this._isInInsertedElement(t.targetPosition.parent);_e151||this._markRemove(t.sourcePosition.parent,t.sourcePosition.offset,t.howMany),_n148||this._markInsert(t.targetPosition.parent,t.getMovedRangeStart().offset,t.howMany);break;}case\"rename\":{if(this._isInInsertedElement(t.position.parent))return;this._markRemove(t.position.parent,t.position.offset,1),this._markInsert(t.position.parent,t.position.offset,1);var _e152=Gs._createFromPositionAndShift(t.position,1);var _iterator210=_createForOfIteratorHelper(this._markerCollection.getMarkersIntersectingRange(_e152)),_step210;try{for(_iterator210.s();!(_step210=_iterator210.n()).done;){var _t167=_step210.value;var _e153=_t167.getRange();this.bufferMarkerChange(_t167.name,_e153,_e153,_t167.affectsData);}}catch(err){_iterator210.e(err);}finally{_iterator210.f();}break;}case\"split\":{var _e154=t.splitPosition.parent;this._isInInsertedElement(_e154)||this._markRemove(_e154,t.splitPosition.offset,t.howMany),this._isInInsertedElement(t.insertionPosition.parent)||this._markInsert(t.insertionPosition.parent,t.insertionPosition.offset,1),t.graveyardPosition&&this._markRemove(t.graveyardPosition.parent,t.graveyardPosition.offset,1);break;}case\"merge\":{var _e155=t.sourcePosition.parent;this._isInInsertedElement(_e155.parent)||this._markRemove(_e155.parent,_e155.startOffset,1);var _n149=t.graveyardPosition.parent;this._markInsert(_n149,t.graveyardPosition.offset,1);var _i109=t.targetPosition.parent;this._isInInsertedElement(_i109)||this._markInsert(_i109,t.targetPosition.offset,_e155.maxOffset);break;}}this._cachedChanges=null;}},{key:\"bufferMarkerChange\",value:function bufferMarkerChange(t,e,n,i){var o=this._changedMarkers.get(t);o?(o.newRange=n,o.affectsData=i,null==o.oldRange&&null==o.newRange&&this._changedMarkers[\"delete\"](t)):this._changedMarkers.set(t,{oldRange:e,newRange:n,affectsData:i});}},{key:\"getMarkersToRemove\",value:function getMarkersToRemove(){var t=[];var _iterator211=_createForOfIteratorHelper(this._changedMarkers),_step211;try{for(_iterator211.s();!(_step211=_iterator211.n()).done;){var _step211$value=_slicedToArray(_step211.value,2),_e156=_step211$value[0],_n150=_step211$value[1];null!=_n150.oldRange&&t.push({name:_e156,range:_n150.oldRange});}}catch(err){_iterator211.e(err);}finally{_iterator211.f();}return t;}},{key:\"getMarkersToAdd\",value:function getMarkersToAdd(){var t=[];var _iterator212=_createForOfIteratorHelper(this._changedMarkers),_step212;try{for(_iterator212.s();!(_step212=_iterator212.n()).done;){var _step212$value=_slicedToArray(_step212.value,2),_e157=_step212$value[0],_n151=_step212$value[1];null!=_n151.newRange&&t.push({name:_e157,range:_n151.newRange});}}catch(err){_iterator212.e(err);}finally{_iterator212.f();}return t;}},{key:\"getChangedMarkers\",value:function getChangedMarkers(){return Array.from(this._changedMarkers).map(function(t){return{name:t[0],data:{oldRange:t[1].oldRange,newRange:t[1].newRange}};});}},{key:\"hasDataChanges\",value:function hasDataChanges(){var _iterator213=_createForOfIteratorHelper(this._changedMarkers),_step213;try{for(_iterator213.s();!(_step213=_iterator213.n()).done;){var _step213$value=_slicedToArray(_step213.value,2),_t168=_step213$value[1];if(_t168.affectsData)return!0;}}catch(err){_iterator213.e(err);}finally{_iterator213.f();}return this._changesInElement.size>0;}},{key:\"getChanges\",value:function getChanges(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{includeChangesInGraveyard:!1};if(this._cachedChanges)return t.includeChangesInGraveyard?this._cachedChangesWithGraveyard.slice():this._cachedChanges.slice();var e=[];var _iterator214=_createForOfIteratorHelper(this._changesInElement.keys()),_step214;try{for(_iterator214.s();!(_step214=_iterator214.n()).done;){var _t171=_step214.value;var _n153=this._changesInElement.get(_t171).sort(function(t,e){return t.offset===e.offset?t.type!=e.type?\"remove\"==t.type?-1:1:0:t.offset_n156.offset){if(_i113>_o44){var _t173={type:\"attribute\",offset:_o44,howMany:_i113-_o44,count:this._changeCount++};this._handleChange(_t173,e),e.push(_t173);}t.nodesToHandle=_n156.offset-t.offset,t.howMany=t.nodesToHandle;}else t.offset>=_n156.offset&&t.offset<_o44&&(_i113>_o44?(t.nodesToHandle=_i113-_o44,t.offset=_o44):t.nodesToHandle=0);\"attribute\"==_n156.type&&(t.offset>=_n156.offset&&_i113<=_o44?(t.nodesToHandle=0,t.howMany=0,t.offset=0):t.offset<=_n156.offset&&_i113>=_o44&&(_n156.howMany=0));}}}catch(err){_iterator216.e(err);}finally{_iterator216.f();}t.howMany=t.nodesToHandle,delete t.nodesToHandle;}},{key:\"_getInsertDiff\",value:function _getInsertDiff(t,e,n){return{type:\"insert\",position:$s._createAt(t,e),name:n,length:1,changeCount:this._changeCount++};}},{key:\"_getRemoveDiff\",value:function _getRemoveDiff(t,e,n){return{type:\"remove\",position:$s._createAt(t,e),name:n,length:1,changeCount:this._changeCount++};}},{key:\"_getAttributesDiff\",value:function _getAttributesDiff(t,e,n){var i=[];n=new Map(n);var _iterator217=_createForOfIteratorHelper(e),_step217;try{for(_iterator217.s();!(_step217=_iterator217.n()).done;){var _step217$value=_slicedToArray(_step217.value,2),_o47=_step217$value[0],_r21=_step217$value[1];var _e163=n.has(_o47)?n.get(_o47):null;_e163!==_r21&&i.push({type:\"attribute\",position:t.start,range:t.clone(),length:1,attributeKey:_o47,attributeOldValue:_r21,attributeNewValue:_e163,changeCount:this._changeCount++}),n[\"delete\"](_o47);}}catch(err){_iterator217.e(err);}finally{_iterator217.f();}var _iterator218=_createForOfIteratorHelper(n),_step218;try{for(_iterator218.s();!(_step218=_iterator218.n()).done;){var _step218$value=_slicedToArray(_step218.value,2),_e164=_step218$value[0],_o48=_step218$value[1];i.push({type:\"attribute\",position:t.start,range:t.clone(),length:1,attributeKey:_e164,attributeOldValue:null,attributeNewValue:_o48,changeCount:this._changeCount++});}}catch(err){_iterator218.e(err);}finally{_iterator218.f();}return i;}},{key:\"_isInInsertedElement\",value:function _isInInsertedElement(t){var e=t.parent;if(!e)return!1;var n=this._changesInElement.get(e),i=t.startOffset;if(n){var _iterator219=_createForOfIteratorHelper(n),_step219;try{for(_iterator219.s();!(_step219=_iterator219.n()).done;){var _t174=_step219.value;if(\"insert\"==_t174.type&&i>=_t174.offset&&i<_t174.offset+_t174.howMany)return!0;}}catch(err){_iterator219.e(err);}finally{_iterator219.f();}}return this._isInInsertedElement(e);}},{key:\"_removeAllNestedChanges\",value:function _removeAllNestedChanges(t,e,n){var i=new Gs($s._createAt(t,e),$s._createAt(t,e+n));var _iterator220=_createForOfIteratorHelper(i.getItems({shallow:!0})),_step220;try{for(_iterator220.s();!(_step220=_iterator220.n()).done;){var _t175=_step220.value;_t175.is(\"element\")&&(this._elementSnapshots[\"delete\"](_t175),this._changesInElement[\"delete\"](_t175),this._removeAllNestedChanges(_t175,0,_t175.maxOffset));}}catch(err){_iterator220.e(err);}finally{_iterator220.f();}}}]);return vc;}();function yc(t){var e=[];var _iterator221=_createForOfIteratorHelper(t),_step221;try{for(_iterator221.s();!(_step221=_iterator221.n()).done;){var _n157=_step221.value;if(_n157.is(\"text\"))for(var _t176=0;_t176<_n157.data.length;_t176++)e.push({name:\"$text\",attributes:new Map(_n157.getAttributes())});else e.push({name:_n157.name,attributes:new Map(_n157.getAttributes())});}}catch(err){_iterator221.e(err);}finally{_iterator221.f();}return e;}function xc(t,e){var n=[];var i=0,o=0;var _iterator222=_createForOfIteratorHelper(e),_step222;try{for(_iterator222.s();!(_step222=_iterator222.n()).done;){var _t177=_step222.value;_t177.offset>i&&(n.push.apply(n,_toConsumableArray(\"e\".repeat(_t177.offset-i).split(\"\"))),o+=_t177.offset-i),\"insert\"==_t177.type?(n.push.apply(n,_toConsumableArray(\"i\".repeat(_t177.howMany).split(\"\"))),i=_t177.offset+_t177.howMany):\"remove\"==_t177.type?(n.push.apply(n,_toConsumableArray(\"r\".repeat(_t177.howMany).split(\"\"))),i=_t177.offset,o+=_t177.howMany):(n.push.apply(n,_toConsumableArray(\"a\".repeat(_t177.howMany).split(\"\"))),i=_t177.offset+_t177.howMany,o+=_t177.howMany);}}catch(err){_iterator222.e(err);}finally{_iterator222.f();}return o0&&arguments[0]!==undefined?arguments[0]:0;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Number.POSITIVE_INFINITY;return t<0?[]:this._operations.slice(t,e);}},{key:\"getOperation\",value:function getOperation(t){return this._operations[t];}},{key:\"setOperationAsUndone\",value:function setOperationAsUndone(t,e){this._undoPairs.set(e,t),this._undoneOperations.add(t);}},{key:\"isUndoingOperation\",value:function isUndoingOperation(t){return this._undoPairs.has(t);}},{key:\"isUndoneOperation\",value:function isUndoneOperation(t){return this._undoneOperations.has(t);}},{key:\"getUndoneOperation\",value:function getUndoneOperation(t){return this._undoPairs.get(t);}}]);return Cc;}();function Tc(t,e){return function(t){return!!t&&1==t.length&&/[\\ud800-\\udbff]/.test(t);}(t.charAt(e-1))&&function(t){return!!t&&1==t.length&&/[\\udc00-\\udfff]/.test(t);}(t.charAt(e));}function Pc(t,e){return function(t){return!!t&&1==t.length&&/[\\u0300-\\u036f\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\u20d0-\\u20ff\\ufe20-\\ufe2f]/.test(t);}(t.charAt(e));}var Mc=\"$graveyard\";var Ec=/*#__PURE__*/function(){function Ec(t){var _this69=this;_classCallCheck(this,Ec);this.model=t,this.version=0,this.history=new Cc(this),this.selection=new sa(this),this.roots=new oo({idProperty:\"rootName\"}),this.differ=new vc(t.markers),this._postFixers=new Set(),this._hasSelectionChangedFromTheLastChangeBlock=!1,this.createRoot(\"$root\",Mc),this.listenTo(t,\"applyOperation\",function(t,e){var n=e[0];if(n.isDocumentOperation&&n.baseVersion!==_this69.version)throw new Gn.b(\"model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.\",{operation:n});},{priority:\"highest\"}),this.listenTo(t,\"applyOperation\",function(t,e){var n=e[0];n.isDocumentOperation&&_this69.differ.bufferOperation(n);},{priority:\"high\"}),this.listenTo(t,\"applyOperation\",function(t,e){var n=e[0];n.isDocumentOperation&&(_this69.version++,_this69.history.addOperation(n));},{priority:\"low\"}),this.listenTo(this.selection,\"change\",function(){_this69._hasSelectionChangedFromTheLastChangeBlock=!0;}),this.listenTo(t.markers,\"update\",function(t,e,n,i){_this69.differ.bufferMarkerChange(e.name,n,i,e.affectsData),null===n&&e.on(\"change\",function(t,n){_this69.differ.bufferMarkerChange(e.name,n,e.getRange(),e.affectsData);});});}_createClass(Ec,[{key:\"graveyard\",get:function get(){return this.getRoot(Mc);}},{key:\"createRoot\",value:function createRoot(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:\"$root\";var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:\"main\";if(this.roots.get(e))throw new Gn.b(\"model-document-createRoot-name-exists: Root with specified name already exists.\",{name:e});var n=new mc(this,t,e);return this.roots.add(n),n;}},{key:\"destroy\",value:function destroy(){this.selection.destroy(),this.stopListening();}},{key:\"getRoot\",value:function getRoot(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:\"main\";return this.roots.get(t);}},{key:\"getRootNames\",value:function getRootNames(){return Array.from(this.roots,function(t){return t.rootName;}).filter(function(t){return t!=Mc;});}},{key:\"registerPostFixer\",value:function registerPostFixer(t){this._postFixers.add(t);}},{key:\"toJSON\",value:function toJSON(){var t=ui(this);return t.selection=\"[engine.model.DocumentSelection]\",t.model=\"[engine.model.Model]\",t;}},{key:\"_handleChangeBlock\",value:function _handleChangeBlock(t){this._hasDocumentChangedFromTheLastChangeBlock()&&(this._callPostFixers(t),this.differ.hasDataChanges()?this.fire(\"change:data\",t.batch):this.fire(\"change\",t.batch),this.differ.reset()),this._hasSelectionChangedFromTheLastChangeBlock=!1;}},{key:\"_hasDocumentChangedFromTheLastChangeBlock\",value:function _hasDocumentChangedFromTheLastChangeBlock(){return!this.differ.isEmpty||this._hasSelectionChangedFromTheLastChangeBlock;}},{key:\"_getDefaultRoot\",value:function _getDefaultRoot(){var _iterator223=_createForOfIteratorHelper(this.roots),_step223;try{for(_iterator223.s();!(_step223=_iterator223.n()).done;){var _t178=_step223.value;if(_t178!==this.graveyard)return _t178;}}catch(err){_iterator223.e(err);}finally{_iterator223.f();}return this.graveyard;}},{key:\"_getDefaultRange\",value:function _getDefaultRange(){var t=this._getDefaultRoot(),e=this.model,n=e.schema,i=e.createPositionFromPath(t,[0]);return n.getNearestSelectionRange(i)||e.createRange(i);}},{key:\"_validateSelectionRange\",value:function _validateSelectionRange(t){return Sc(t.start)&&Sc(t.end);}},{key:\"_callPostFixers\",value:function _callPostFixers(t){var e=!1;do{var _iterator224=_createForOfIteratorHelper(this._postFixers),_step224;try{for(_iterator224.s();!(_step224=_iterator224.n()).done;){var _n158=_step224.value;if(e=_n158(t))break;}}catch(err){_iterator224.e(err);}finally{_iterator224.f();}}while(e);}}]);return Ec;}();function Sc(t){var e=t.textNode;if(e){var _n159=e.data,_i115=t.offset-e.startOffset;return!Tc(_n159,_i115)&&!Pc(_n159,_i115);}return!0;}ci(Ec,ei);var Ic=/*#__PURE__*/function(_Symbol$iterator12){function Ic(){_classCallCheck(this,Ic);this._markers=new Map();}_createClass(Ic,[{key:_Symbol$iterator12,value:function value(){return this._markers.values();}},{key:\"has\",value:function has(t){return this._markers.has(t);}},{key:\"get\",value:function get(t){return this._markers.get(t)||null;}},{key:\"_set\",value:function _set(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;var i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:!1;var o=t instanceof Nc?t.name:t,r=this._markers.get(o);if(r){var _t179=r.getRange();var _s17=!1;return _t179.isEqual(e)||(r._attachLiveRange(oa.fromRange(e)),_s17=!0),n!=r.managedUsingOperations&&(r._managedUsingOperations=n,_s17=!0),\"boolean\"==typeof i&&i!=r.affectsData&&(r._affectsData=i,_s17=!0),_s17&&this.fire(\"update:\"+o,r,_t179,e),r;}var s=oa.fromRange(e),a=new Nc(o,s,n,i);return this._markers.set(o,a),this.fire(\"update:\"+o,a,null,e),a;}},{key:\"_remove\",value:function _remove(t){var e=t instanceof Nc?t.name:t,n=this._markers.get(e);return!!n&&(this._markers[\"delete\"](e),this.fire(\"update:\"+e,n,n.getRange(),null),this._destroyMarker(n),!0);}},{key:\"getMarkersAtPosition\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getMarkersAtPosition(t){var _iterator225,_step225,_e165;return _regeneratorRuntime().wrap(function getMarkersAtPosition$(_context31){while(1)switch(_context31.prev=_context31.next){case 0:_iterator225=_createForOfIteratorHelper(this);_context31.prev=1;_iterator225.s();case 3:if((_step225=_iterator225.n()).done){_context31.next=11;break;}_e165=_step225.value;_context31.t0=_e165.getRange().containsPosition(t);if(!_context31.t0){_context31.next=9;break;}_context31.next=9;return _e165;case 9:_context31.next=3;break;case 11:_context31.next=16;break;case 13:_context31.prev=13;_context31.t1=_context31[\"catch\"](1);_iterator225.e(_context31.t1);case 16:_context31.prev=16;_iterator225.f();return _context31.finish(16);case 19:case\"end\":return _context31.stop();}},getMarkersAtPosition,this,[[1,13,16,19]]);})},{key:\"getMarkersIntersectingRange\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getMarkersIntersectingRange(t){var _iterator226,_step226,_e166;return _regeneratorRuntime().wrap(function getMarkersIntersectingRange$(_context32){while(1)switch(_context32.prev=_context32.next){case 0:_iterator226=_createForOfIteratorHelper(this);_context32.prev=1;_iterator226.s();case 3:if((_step226=_iterator226.n()).done){_context32.next=11;break;}_e166=_step226.value;_context32.t0=null!==_e166.getRange().getIntersection(t);if(!_context32.t0){_context32.next=9;break;}_context32.next=9;return _e166;case 9:_context32.next=3;break;case 11:_context32.next=16;break;case 13:_context32.prev=13;_context32.t1=_context32[\"catch\"](1);_iterator226.e(_context32.t1);case 16:_context32.prev=16;_iterator226.f();return _context32.finish(16);case 19:case\"end\":return _context32.stop();}},getMarkersIntersectingRange,this,[[1,13,16,19]]);})},{key:\"destroy\",value:function destroy(){var _iterator227=_createForOfIteratorHelper(this._markers.values()),_step227;try{for(_iterator227.s();!(_step227=_iterator227.n()).done;){var _t180=_step227.value;this._destroyMarker(_t180);}}catch(err){_iterator227.e(err);}finally{_iterator227.f();}this._markers=null,this.stopListening();}},{key:\"getMarkersGroup\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getMarkersGroup(t){var _iterator228,_step228,_e167;return _regeneratorRuntime().wrap(function getMarkersGroup$(_context33){while(1)switch(_context33.prev=_context33.next){case 0:_iterator228=_createForOfIteratorHelper(this._markers.values());_context33.prev=1;_iterator228.s();case 3:if((_step228=_iterator228.n()).done){_context33.next=11;break;}_e167=_step228.value;_context33.t0=_e167.name.startsWith(t+\":\");if(!_context33.t0){_context33.next=9;break;}_context33.next=9;return _e167;case 9:_context33.next=3;break;case 11:_context33.next=16;break;case 13:_context33.prev=13;_context33.t1=_context33[\"catch\"](1);_iterator228.e(_context33.t1);case 16:_context33.prev=16;_iterator228.f();return _context33.finish(16);case 19:case\"end\":return _context33.stop();}},getMarkersGroup,this,[[1,13,16,19]]);})},{key:\"_destroyMarker\",value:function _destroyMarker(t){t.stopListening(),t._detachLiveRange();}}]);return Ic;}(Symbol.iterator);ci(Ic,ei);var Nc=/*#__PURE__*/function(){function Nc(t,e,n,i){_classCallCheck(this,Nc);this.name=t,this._liveRange=this._attachLiveRange(e),this._managedUsingOperations=n,this._affectsData=i;}_createClass(Nc,[{key:\"managedUsingOperations\",get:function get(){if(!this._liveRange)throw new Gn.b(\"marker-destroyed: Cannot use a destroyed marker instance.\");return this._managedUsingOperations;}},{key:\"affectsData\",get:function get(){if(!this._liveRange)throw new Gn.b(\"marker-destroyed: Cannot use a destroyed marker instance.\");return this._affectsData;}},{key:\"getStart\",value:function getStart(){if(!this._liveRange)throw new Gn.b(\"marker-destroyed: Cannot use a destroyed marker instance.\");return this._liveRange.start.clone();}},{key:\"getEnd\",value:function getEnd(){if(!this._liveRange)throw new Gn.b(\"marker-destroyed: Cannot use a destroyed marker instance.\");return this._liveRange.end.clone();}},{key:\"getRange\",value:function getRange(){if(!this._liveRange)throw new Gn.b(\"marker-destroyed: Cannot use a destroyed marker instance.\");return this._liveRange.toRange();}},{key:\"_attachLiveRange\",value:function _attachLiveRange(t){return this._liveRange&&this._detachLiveRange(),t.delegate(\"change:range\").to(this),t.delegate(\"change:content\").to(this),this._liveRange=t,t;}},{key:\"_detachLiveRange\",value:function _detachLiveRange(){this._liveRange.stopDelegating(\"change:range\",this),this._liveRange.stopDelegating(\"change:content\",this),this._liveRange.detach(),this._liveRange=null;}}]);return Nc;}();ci(Nc,ei);var Oc=/*#__PURE__*/function(_$s){_inherits(Oc,_$s);var _super33=_createSuper(Oc);function Oc(t,e){var _this70;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:\"toNone\";_classCallCheck(this,Oc);if(_this70=_super33.call(this,t,e,n),!_this70.root.is(\"rootElement\"))throw new Gn.b(\"model-liveposition-root-not-rootelement: LivePosition's root has to be an instance of RootElement.\");(function(){var _this71=this;this.listenTo(this.root.document.model,\"applyOperation\",function(t,e){var n=e[0];n.isDocumentOperation&&function(t){var e=this.getTransformedByOperation(t);if(!this.isEqual(e)){var _t181=this.toPosition();this.path=e.path,this.root=e.root,this.fire(\"change\",_t181);}}.call(_this71,n);},{priority:\"low\"});}).call(_assertThisInitialized(_this70));return _possibleConstructorReturn(_this70);}_createClass(Oc,[{key:\"detach\",value:function detach(){this.stopListening();}},{key:\"toPosition\",value:function toPosition(){return new $s(this.root,this.path.slice(),this.stickiness);}}],[{key:\"fromPosition\",value:function fromPosition(t,e){return new this(t.root,t.path.slice(),e||t.stickiness);}}]);return Oc;}($s);ci(Oc,ei);var Rc=/*#__PURE__*/function(){function Rc(t,e,n){_classCallCheck(this,Rc);this.model=t,this.writer=e,this.position=n,this.canMergeWith=new Set([this.position.parent]),this.schema=t.schema,this._filterAttributesOf=[];}_createClass(Rc,[{key:\"handleNodes\",value:function handleNodes(t,e){t=Array.from(t);for(var _n160=0;_n1602&&arguments[2]!==undefined?arguments[2]:{};if(e.isCollapsed)return;var i=t.schema;t.change(function(t){if(!n.doNotResetEntireContent&&function(t,e){var n=t.getLimitElement(e);if(!e.containsEntireContent(n))return!1;var i=e.getFirstRange();if(i.start.parent==i.end.parent)return!1;return t.checkChild(n,\"paragraph\");}(i,e))return void function(t,e){var n=t.model.schema.getLimitElement(e);t.remove(t.createRangeIn(n)),Lc(t,t.createPositionAt(n,0),e);}(t,e);var o=e.getFirstRange(),r=o.start,s=Oc.fromPosition(o.end,\"toNext\");o.start.isTouching(o.end)||t.remove(o),n.leaveUnmerged||(!function t(e,n,i){var o=n.parent;var r=i.parent;if(o==r)return;if(e.model.schema.isLimit(o)||e.model.schema.isLimit(r))return;if(!function(t,e,n){var i=new Gs(t,e);var _iterator229=_createForOfIteratorHelper(i.getWalker()),_step229;try{for(_iterator229.s();!(_step229=_iterator229.n()).done;){var _t186=_step229.value;if(n.isLimit(_t186.item))return!1;}}catch(err){_iterator229.e(err);}finally{_iterator229.f();}return!0;}(n,i,e.model.schema))return;n=e.createPositionAfter(o);i=e.createPositionBefore(r);i.isEqual(n)||e.insert(r,n);e.merge(n);for(;i.parent.isEmpty;){var _t187=i.parent;i=e.createPositionBefore(_t187),e.remove(_t187);}t(e,n,i);}(t,r,s),i.removeDisallowedAttributes(r.parent.getChildren(),t)),e instanceof sa?t.setSelection(r):e.setTo(r),function(t,e){var n=t.checkChild(e,\"$text\"),i=t.checkChild(e,\"paragraph\");return!n&&i;}(i,r)&&Lc(t,r,e),s.detach();});}function Lc(t,e,n){var i=t.createElement(\"paragraph\");t.insert(i,e),n instanceof sa?t.setSelection(i,0):n.setTo(i,0);}var jc=' ,.?!:;\"-()';function Vc(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=t.schema,o=\"backward\"!=n.direction,r=n.unit?n.unit:\"character\",s=e.focus,a=new qs({boundaries:function(t,e){var n=t.root,i=$s._createAt(n,e?\"end\":0);return e?new Gs(t,i):new Gs(i,t);}(s,o),singleCharacters:!0,direction:o?\"forward\":\"backward\"}),c={walker:a,schema:i,isForward:o,unit:r};var l;var _loop3=function _loop3(){if(l.done)return{v:void 0};var n=Bc(c,l.value);if(n)return{v:void(e instanceof sa?t.change(function(t){t.setSelectionFocus(n);}):e.setFocus(n))};},_ret;for(;l=a.next();){_ret=_loop3();if(_ret)return _ret.v;}}function Bc(t,e){if(\"text\"==e.type)return\"word\"===t.unit?function(t,e){var n=t.position.textNode;if(n){var _i117=t.position.offset-n.startOffset;for(;!zc(n.data,_i117,e)&&!Fc(n,_i117,e);){t.next();var _o49=e?t.position.nodeAfter:t.position.nodeBefore;if(_o49&&_o49.is(\"text\")){var _i118=_o49.data.charAt(e?0:_o49.data.length-1);jc.includes(_i118)||(t.next(),n=t.position.textNode);}_i117=t.position.offset-n.startOffset;}}return t.position;}(t.walker,t.isForward):function(t,e){var n=t.position.textNode;if(n){var _i119=n.data;var _o50=t.position.offset-n.startOffset;for(;Tc(_i119,_o50)||\"character\"==e&&Pc(_i119,_o50);)t.next(),_o50=t.position.offset-n.startOffset;}return t.position;}(t.walker,t.unit,t.isForward);if(e.type==(t.isForward?\"elementStart\":\"elementEnd\")){if(t.schema.isObject(e.item))return $s._createAt(e.item,t.isForward?\"after\":\"before\");if(t.schema.checkChild(e.nextPosition,\"$text\"))return e.nextPosition;}else{if(t.schema.isLimit(e.item))return void t.walker.skip(function(){return!0;});if(t.schema.checkChild(e.nextPosition,\"$text\"))return e.nextPosition;}}function zc(t,e,n){var i=e+(n?0:-1);return jc.includes(t.charAt(i));}function Fc(t,e,n){return e===(n?t.endOffset:0);}function Uc(t,e){var n=[];Array.from(t.getItems({direction:\"backward\"})).map(function(t){return e.createRangeOn(t);}).filter(function(e){return(e.start.isAfter(t.start)||e.start.isEqual(t.start))&&(e.end.isBefore(t.end)||e.end.isEqual(t.end));}).forEach(function(t){n.push(t.start.parent),e.remove(t);}),n.forEach(function(t){var n=t;for(;n.parent&&n.isEmpty;){var _t188=e.createRangeOn(n);n=n.parent,e.remove(_t188);}});}function Hc(t){t.document.registerPostFixer(function(e){return function(t,e){var n=e.document.selection,i=e.schema,o=[];var r=!1;var _iterator230=_createForOfIteratorHelper(n.getRanges()),_step230;try{for(_iterator230.s();!(_step230=_iterator230.n()).done;){var _t190=_step230.value;var _e169=qc(_t190,i);_e169?(o.push(_e169),r=!0):o.push(_t190);}}catch(err){_iterator230.e(err);}finally{_iterator230.f();}if(r){var _e168=o;if(o.length>1){var _t189=o[0].start,_n161=o[o.length-1].end;_e168=[new Gs(_t189,_n161)];}t.setSelection(_e168,{backward:n.isBackward});}}(e,t);});}function qc(t,e){return t.isCollapsed?function(t,e){var n=t.start,i=e.getNearestSelectionRange(n);if(!i)return null;var o=i.start;if(n.isEqual(o))return null;if(o.nodeAfter&&e.isLimit(o.nodeAfter))return new Gs(o,$s._createAfter(o.nodeAfter));return new Gs(o);}(t,e):function(t,e){var n=t.start,i=t.end,o=e.checkChild(n,\"$text\"),r=e.checkChild(i,\"$text\"),s=e.getLimitElement(n),a=e.getLimitElement(i);if(s===a){if(o&&r)return null;if(function(t,e,n){var i=t.nodeAfter&&!n.isLimit(t.nodeAfter)||n.checkChild(t,\"$text\"),o=e.nodeBefore&&!n.isLimit(e.nodeBefore)||n.checkChild(e,\"$text\");return i||o;}(n,i,e)){var _t191=n.nodeAfter&&e.isObject(n.nodeAfter),_o51=_t191?null:e.getNearestSelectionRange(n,\"forward\"),_r22=i.nodeBefore&&e.isObject(i.nodeBefore),_s18=_r22?null:e.getNearestSelectionRange(i,\"backward\"),_a9=_o51?_o51.start:n,_c4=_s18?_s18.start:i;return new Gs(_a9,_c4);}}var c=s&&!s.is(\"rootElement\"),l=a&&!a.is(\"rootElement\");if(c||l){var _t192=n.nodeAfter&&i.nodeBefore&&n.nodeAfter.parent===i.nodeBefore.parent,_o52=c&&(!_t192||!Yc(n.nodeAfter,e)),_r23=l&&(!_t192||!Yc(i.nodeBefore,e));var _d2=n,_u2=i;return _o52&&(_d2=$s._createBefore(Wc(s,e))),_r23&&(_u2=$s._createAfter(Wc(a,e))),new Gs(_d2,_u2);}return null;}(t,e);}function Wc(t,e){var n=t,i=n;for(;e.isLimit(i)&&i.parent;)n=i,i=i.parent;return n;}function Yc(t,e){return t&&e.isObject(t);}var $c=/*#__PURE__*/function(){function $c(){var _this72=this;_classCallCheck(this,$c);this.markers=new Ic(),this.document=new Ec(this),this.schema=new Ia(),this._pendingChanges=[],this._currentWriter=null,[\"insertContent\",\"deleteContent\",\"modifySelection\",\"getSelectedContent\",\"applyOperation\"].forEach(function(t){return _this72.decorate(t);}),this.on(\"applyOperation\",function(t,e){e[0]._validate();},{priority:\"highest\"}),this.schema.register(\"$root\",{isLimit:!0}),this.schema.register(\"$block\",{allowIn:\"$root\",isBlock:!0}),this.schema.register(\"$text\",{allowIn:\"$block\",isInline:!0}),this.schema.register(\"$clipboardHolder\",{allowContentOf:\"$root\",isLimit:!0}),this.schema.extend(\"$text\",{allowIn:\"$clipboardHolder\"}),this.schema.register(\"$marker\",{allowIn:[\"$root\",\"$block\"]}),Hc(this);}_createClass($c,[{key:\"change\",value:function change(t){return 0===this._pendingChanges.length?(this._pendingChanges.push({batch:new Ga(),callback:t}),this._runPendingChanges()[0]):t(this._currentWriter);}},{key:\"enqueueChange\",value:function enqueueChange(t,e){\"string\"==typeof t?t=new Ga(t):\"function\"==typeof t&&(e=t,t=new Ga()),this._pendingChanges.push({batch:t,callback:e}),1==this._pendingChanges.length&&this._runPendingChanges();}},{key:\"applyOperation\",value:function applyOperation(t){t._execute();}},{key:\"insertContent\",value:function insertContent(t,e,n){!function(t,e,n,i){t.change(function(o){var r;(r=n?n instanceof ta||n instanceof sa?n:o.createSelection(n,i):t.document.selection).isCollapsed||t.deleteContent(r);var s=new Rc(t,o,r.anchor);var a;a=e.is(\"documentFragment\")?e.getChildren():[e],s.handleNodes(a,{isFirst:!0,isLast:!0});var c=s.getSelectionRange();c?r instanceof sa?o.setSelection(c):r.setTo(c):bs.a.warn(\"insertcontent-no-range: Cannot determine a proper selection range after insertion.\");});}(this,t,e,n);}},{key:\"deleteContent\",value:function deleteContent(t,e){Dc(this,t,e);}},{key:\"modifySelection\",value:function modifySelection(t,e){Vc(this,t,e);}},{key:\"getSelectedContent\",value:function getSelectedContent(t){return function(t,e){return t.change(function(t){var n=t.createDocumentFragment(),i=e.getFirstRange();if(!i||i.isCollapsed)return n;var o=i.start.root,r=i.start.getCommonPath(i.end),s=o.getNodeByPath(r);var a;var c=(a=i.start.parent==i.end.parent?i:t.createRange(t.createPositionAt(s,i.start.path[r.length]),t.createPositionAt(s,i.end.path[r.length]+1))).end.offset-a.start.offset;var _iterator231=_createForOfIteratorHelper(a.getItems({shallow:!0})),_step231;try{for(_iterator231.s();!(_step231=_iterator231.n()).done;){var _e171=_step231.value;_e171.is(\"textProxy\")?t.appendText(_e171.data,_e171.getAttributes(),n):t.append(_e171._clone(!0),n);}}catch(err){_iterator231.e(err);}finally{_iterator231.f();}if(a!=i){var _e170=i._getTransformedByMove(a.start,t.createPositionAt(n,0),c)[0],_o53=t.createRange(t.createPositionAt(n,0),_e170.start);Uc(t.createRange(_e170.end,t.createPositionAt(n,\"end\")),t),Uc(_o53,t);}return n;});}(this,t);}},{key:\"hasContent\",value:function hasContent(t,e){var n=t instanceof Hs?Gs._createIn(t):t;if(n.isCollapsed)return!1;var _iterator232=_createForOfIteratorHelper(this.markers.getMarkersIntersectingRange(n)),_step232;try{for(_iterator232.s();!(_step232=_iterator232.n()).done;){var _t193=_step232.value;if(_t193.affectsData)return!0;}}catch(err){_iterator232.e(err);}finally{_iterator232.f();}var _ref11=e||{},_ref11$ignoreWhitespa=_ref11.ignoreWhitespaces,i=_ref11$ignoreWhitespa===void 0?!1:_ref11$ignoreWhitespa;var _iterator233=_createForOfIteratorHelper(n.getItems()),_step233;try{for(_iterator233.s();!(_step233=_iterator233.n()).done;){var _t194=_step233.value;if(_t194.is(\"textProxy\")){if(!i)return!0;if(-1!==_t194.data.search(/\\S/))return!0;}else if(this.schema.isObject(_t194))return!0;}}catch(err){_iterator233.e(err);}finally{_iterator233.f();}return!1;}},{key:\"createPositionFromPath\",value:function createPositionFromPath(t,e,n){return new $s(t,e,n);}},{key:\"createPositionAt\",value:function createPositionAt(t,e){return $s._createAt(t,e);}},{key:\"createPositionAfter\",value:function createPositionAfter(t){return $s._createAfter(t);}},{key:\"createPositionBefore\",value:function createPositionBefore(t){return $s._createBefore(t);}},{key:\"createRange\",value:function createRange(t,e){return new Gs(t,e);}},{key:\"createRangeIn\",value:function createRangeIn(t){return Gs._createIn(t);}},{key:\"createRangeOn\",value:function createRangeOn(t){return Gs._createOn(t);}},{key:\"createSelection\",value:function createSelection(t,e,n){return new ta(t,e,n);}},{key:\"createBatch\",value:function createBatch(){return new Ga();}},{key:\"destroy\",value:function destroy(){this.document.destroy(),this.stopListening();}},{key:\"_runPendingChanges\",value:function _runPendingChanges(){var t=[];for(this.fire(\"_beforeChanges\");this._pendingChanges.length;){var _e172=this._pendingChanges[0].batch;this._currentWriter=new pc(this,_e172);var _n162=this._pendingChanges[0].callback(this._currentWriter);t.push(_n162),this.fire(\"_change\",this._currentWriter),this.document._handleChangeBlock(this._currentWriter),this._pendingChanges.shift(),this._currentWriter=null;}return this.fire(\"_afterChanges\"),t;}}]);return $c;}();ci($c,Fi);var Gc=/*#__PURE__*/function(){function Gc(){_classCallCheck(this,Gc);this._listener=Object.create(lr);}_createClass(Gc,[{key:\"listenTo\",value:function listenTo(t){var _this73=this;this._listener.listenTo(t,\"keydown\",function(t,e){_this73._listener.fire(\"_keydown:\"+wo(e),e);});}},{key:\"set\",value:function set(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=_o(t),o=n.priority;this._listener.listenTo(this._listener,\"_keydown:\"+i,function(t,n){e(n,function(){n.preventDefault(),n.stopPropagation(),t.stop();}),t[\"return\"]=!0;},{priority:o});}},{key:\"press\",value:function press(t){return!!this._listener.fire(\"_keydown:\"+wo(t),t);}},{key:\"destroy\",value:function destroy(){this._listener.stopListening();}}]);return Gc;}();var Qc=/*#__PURE__*/function(_Gc){_inherits(Qc,_Gc);var _super34=_createSuper(Qc);function Qc(t){var _this74;_classCallCheck(this,Qc);_this74=_super34.call(this),_this74.editor=t;return _this74;}_createClass(Qc,[{key:\"set\",value:function set(t,e){var _this75=this;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};if(\"string\"==typeof e){var _t195=e;e=function e(_e173,n){_this75.editor.execute(_t195),n();};}_get(_getPrototypeOf(Qc.prototype),\"set\",this).call(this,t,e,n);}}]);return Qc;}(Gc);n(42);var Jc=/*#__PURE__*/function(){function Jc(t){var _this76=this;_classCallCheck(this,Jc);var e=this.constructor.builtinPlugins;this.config=new Yn(t,this.constructor.defaultConfig),this.config.define(\"plugins\",e),this.plugins=new Ca(this,e),this.commands=new Ta(),this.locale=new Ma(this.config.get(\"language\")),this.t=this.locale.t,this.set(\"state\",\"initializing\"),this.once(\"ready\",function(){return _this76.state=\"ready\";},{priority:\"high\"}),this.once(\"destroy\",function(){return _this76.state=\"destroyed\";},{priority:\"high\"}),this.set(\"isReadOnly\",!1),this.model=new $c(),this.data=new qa(this.model),this.editing=new Aa(this.model),this.editing.view.document.bind(\"isReadOnly\").to(this),this.conversion=new Wa([this.editing.downcastDispatcher,this.data.downcastDispatcher],this.data.upcastDispatcher),this.conversion.addAlias(\"dataDowncast\",this.data.downcastDispatcher),this.conversion.addAlias(\"editingDowncast\",this.editing.downcastDispatcher),this.keystrokes=new Qc(this),this.keystrokes.listenTo(this.editing.view.document);}_createClass(Jc,[{key:\"initPlugins\",value:function initPlugins(){var t=this.config,e=t.get(\"plugins\")||[],n=t.get(\"removePlugins\")||[],i=t.get(\"extraPlugins\")||[];return this.plugins.init(e.concat(i),n);}},{key:\"destroy\",value:function destroy(){var _this77=this;var t=Promise.resolve();return\"initializing\"==this.state&&(t=new Promise(function(t){return _this77.once(\"ready\",t);})),t.then(function(){_this77.fire(\"destroy\"),_this77.stopListening(),_this77.commands.destroy();}).then(function(){return _this77.plugins.destroy();}).then(function(){_this77.model.destroy(),_this77.data.destroy(),_this77.editing.destroy(),_this77.keystrokes.destroy();});}},{key:\"execute\",value:function execute(){var _this$commands;(_this$commands=this.commands).execute.apply(_this$commands,arguments);}}]);return Jc;}();ci(Jc,Fi);var Kc={setData:function setData(t){this.data.set(t);},getData:function getData(t){return this.data.get(t);}};var Zc={updateSourceElement:function updateSourceElement(){if(!this.sourceElement)throw new Gn.b(\"editor-missing-sourceelement: Cannot update the source element of a detached editor.\");!function(t,e){t instanceof HTMLTextAreaElement&&(t.value=e),t.innerHTML=e;}(this.sourceElement,this.data.get());}};var Xc=/*#__PURE__*/function(){function Xc(){_classCallCheck(this,Xc);}_createClass(Xc,[{key:\"getHtml\",value:function getHtml(t){var e=document.implementation.createHTMLDocument(\"\").createElement(\"div\");return e.appendChild(t),e.innerHTML;}}]);return Xc;}();var tl=/*#__PURE__*/function(){function tl(){_classCallCheck(this,tl);this._domParser=new DOMParser(),this._domConverter=new rr({blockFiller:jo}),this._htmlWriter=new Xc();}_createClass(tl,[{key:\"toData\",value:function toData(t){var e=this._domConverter.viewToDom(t,document);return this._htmlWriter.getHtml(e);}},{key:\"toView\",value:function toView(t){var e=this._toDom(t);return this._domConverter.domToView(e);}},{key:\"_toDom\",value:function _toDom(t){var e=this._domParser.parseFromString(t,\"text/html\"),n=e.createDocumentFragment(),i=e.body.childNodes;for(;i.length>0;)n.appendChild(i[0]);return n;}}]);return tl;}();var el=/*#__PURE__*/function(){function el(t){_classCallCheck(this,el);this.editor=t,this._components=new Map();}_createClass(el,[{key:\"names\",value:/*#__PURE__*/_regeneratorRuntime().mark(function names(){var _iterator234,_step234,_t196;return _regeneratorRuntime().wrap(function names$(_context34){while(1)switch(_context34.prev=_context34.next){case 0:_iterator234=_createForOfIteratorHelper(this._components.values());_context34.prev=1;_iterator234.s();case 3:if((_step234=_iterator234.n()).done){_context34.next=9;break;}_t196=_step234.value;_context34.next=7;return _t196.originalName;case 7:_context34.next=3;break;case 9:_context34.next=14;break;case 11:_context34.prev=11;_context34.t0=_context34[\"catch\"](1);_iterator234.e(_context34.t0);case 14:_context34.prev=14;_iterator234.f();return _context34.finish(14);case 17:case\"end\":return _context34.stop();}},names,this,[[1,11,14,17]]);})},{key:\"add\",value:function add(t,e){if(this.has(t))throw new Gn.b(\"componentfactory-item-exists: The item already exists in the component factory.\",{name:t});this._components.set(nl(t),{callback:e,originalName:t});}},{key:\"create\",value:function create(t){if(!this.has(t))throw new Gn.b(\"componentfactory-item-missing: The required component is not registered in the factory.\",{name:t});return this._components.get(nl(t)).callback(this.editor.locale);}},{key:\"has\",value:function has(t){return this._components.has(nl(t));}}]);return el;}();function nl(t){return String(t).toLowerCase();}var il=/*#__PURE__*/function(){function il(){_classCallCheck(this,il);this.set(\"isFocused\",!1),this.focusedElement=null,this._elements=new Set(),this._nextEventLoopTimeout=null;}_createClass(il,[{key:\"add\",value:function add(t){var _this78=this;if(this._elements.has(t))throw new Gn.b(\"focusTracker-add-element-already-exist\");this.listenTo(t,\"focus\",function(){return _this78._focus(t);},{useCapture:!0}),this.listenTo(t,\"blur\",function(){return _this78._blur();},{useCapture:!0}),this._elements.add(t);}},{key:\"remove\",value:function remove(t){t===this.focusedElement&&this._blur(t),this._elements.has(t)&&(this.stopListening(t),this._elements[\"delete\"](t));}},{key:\"destroy\",value:function destroy(){this.stopListening();}},{key:\"_focus\",value:function _focus(t){clearTimeout(this._nextEventLoopTimeout),this.focusedElement=t,this.isFocused=!0;}},{key:\"_blur\",value:function _blur(){var _this79=this;clearTimeout(this._nextEventLoopTimeout),this._nextEventLoopTimeout=setTimeout(function(){_this79.focusedElement=null,_this79.isFocused=!1;},0);}}]);return il;}();ci(il,lr),ci(il,Fi);var ol=/*#__PURE__*/function(){function ol(t){var _this80=this;_classCallCheck(this,ol);this.editor=t,this.componentFactory=new el(t),this.focusTracker=new il(),this._editableElements=new Map(),this.listenTo(t.editing.view.document,\"layoutChanged\",function(){return _this80.update();});}_createClass(ol,[{key:\"element\",get:function get(){return null;}},{key:\"update\",value:function update(){this.fire(\"update\");}},{key:\"destroy\",value:function destroy(){this.stopListening(),this.focusTracker.destroy(),this._editableElements=new Map();}},{key:\"getEditableElement\",value:function getEditableElement(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:\"main\";return this._editableElements.get(t);}},{key:\"getEditableElementsNames\",value:function getEditableElementsNames(){return this._editableElements.keys();}}]);return ol;}();ci(ol,ei);n(43);var rl=new WeakMap();function sl(t){var e=t.view,n=t.element,i=t.text,_t$isDirectHost=t.isDirectHost,o=_t$isDirectHost===void 0?!0:_t$isDirectHost,r=e.document;rl.has(r)||(rl.set(r,new Map()),r.registerPostFixer(function(t){return cl(r,t);})),rl.get(r).set(n,{text:i,isDirectHost:o}),e.change(function(t){return cl(r,t);});}function al(t,e){return!!e.hasClass(\"ck-placeholder\")&&(t.removeClass(\"ck-placeholder\",e),!0);}function cl(t,e){var n=rl.get(t);var i=!1;var _iterator235=_createForOfIteratorHelper(n),_step235;try{for(_iterator235.s();!(_step235=_iterator235.n()).done;){var _step235$value=_slicedToArray(_step235.value,2),_t197=_step235$value[0],_o54=_step235$value[1];ll(e,_t197,_o54)&&(i=!0);}}catch(err){_iterator235.e(err);}finally{_iterator235.f();}return i;}function ll(t,e,n){var i=n.text,o=n.isDirectHost,r=o?e:function(t){if(1===t.childCount){var _e174=t.getChild(0);if(_e174.is(\"element\")&&!_e174.is(\"uiElement\"))return _e174;}return null;}(e);var s=!1;return!!r&&(n.hostElement=r,r.getAttribute(\"data-placeholder\")!==i&&(t.setAttribute(\"data-placeholder\",i,r),s=!0),!function(t){var e=t.document;if(!e)return!1;var n=!Array.from(t.getChildren()).some(function(t){return!t.is(\"uiElement\");});if(!e.isFocused&&n)return!0;var i=e.selection.anchor;return!(!n||!i||i.parent===t);}(r)?al(t,r)&&(s=!0):function(t,e){return!e.hasClass(\"ck-placeholder\")&&(t.addClass(\"ck-placeholder\",e),!0);}(t,r)&&(s=!0),s);}var dl=/*#__PURE__*/function(){function dl(){_classCallCheck(this,dl);this._replacedElements=[];}_createClass(dl,[{key:\"replace\",value:function replace(t,e){this._replacedElements.push({element:t,newElement:e}),t.style.display=\"none\",e&&t.parentNode.insertBefore(e,t.nextSibling);}},{key:\"restore\",value:function restore(){this._replacedElements.forEach(function(_ref12){var t=_ref12.element,e=_ref12.newElement;t.style.display=\"\",e&&e.remove();}),this._replacedElements=[];}}]);return dl;}();var ul=/*#__PURE__*/function(_ol){_inherits(ul,_ol);var _super35=_createSuper(ul);function ul(t,e){var _this81;_classCallCheck(this,ul);_this81=_super35.call(this,t),_this81.view=e,_this81._toolbarConfig=function(t){return Array.isArray(t)?{items:t}:t?Object.assign({items:[]},t):{items:[]};}(t.config.get(\"toolbar\")),_this81._elementReplacer=new dl();return _this81;}_createClass(ul,[{key:\"element\",get:function get(){return this.view.element;}},{key:\"init\",value:function init(t){var e=this.editor,n=this.view,i=e.editing.view,o=n.editable,r=i.document.getRoot();o.name=r.rootName,n.render();var s=o.element;this._editableElements.set(o.name,s),this.focusTracker.add(s),n.editable.bind(\"isFocused\").to(this.focusTracker),i.attachDomRoot(s),t&&this._elementReplacer.replace(t,this.element),this._initPlaceholder(),this._initToolbar(),this.fire(\"ready\");}},{key:\"destroy\",value:function destroy(){var t=this.view,e=this.editor.editing.view;this._elementReplacer.restore(),e.detachDomRoot(t.editable.name),t.destroy(),_get(_getPrototypeOf(ul.prototype),\"destroy\",this).call(this);}},{key:\"_initToolbar\",value:function _initToolbar(){var t=this.editor,e=this.view,n=t.editing.view;e.stickyPanel.bind(\"isActive\").to(this.focusTracker,\"isFocused\"),e.stickyPanel.limiterElement=e.element,this._toolbarConfig.viewportTopOffset&&(e.stickyPanel.viewportTopOffset=this._toolbarConfig.viewportTopOffset),e.toolbar.fillFromConfig(this._toolbarConfig.items,this.componentFactory),function(_ref13){var t=_ref13.origin,e=_ref13.originKeystrokeHandler,n=_ref13.originFocusTracker,i=_ref13.toolbar,o=_ref13.beforeFocus,r=_ref13.afterBlur;n.add(i.element),e.set(\"Alt+F10\",function(t,e){n.isFocused&&!i.focusTracker.isFocused&&(o&&o(),i.focus(),e());}),i.keystrokes.set(\"Esc\",function(e,n){i.focusTracker.isFocused&&(t.focus(),r&&r(),n());});}({origin:n,originFocusTracker:this.focusTracker,originKeystrokeHandler:t.keystrokes,toolbar:e.toolbar});}},{key:\"_initPlaceholder\",value:function _initPlaceholder(){var t=this.editor,e=t.editing.view,n=e.document.getRoot(),i=t.sourceElement,o=t.config.get(\"placeholder\")||i&&\"textarea\"===i.tagName.toLowerCase()&&i.getAttribute(\"placeholder\");o&&sl({view:e,element:n,text:o,isDirectHost:!1});}}]);return ul;}(ol);var hl=/*#__PURE__*/function(_oo){_inherits(hl,_oo);var _super36=_createSuper(hl);function hl(t){var _this82;_classCallCheck(this,hl);_this82=_super36.call(this,{idProperty:\"viewUid\"}),_this82.on(\"add\",function(t,e,n){e.isRendered||e.render(),e.element&&_this82._parentElement&&_this82._parentElement.insertBefore(e.element,_this82._parentElement.children[n]);}),_this82.on(\"remove\",function(t,e){e.element&&_this82._parentElement&&e.element.remove();}),_this82.locale=t,_this82._parentElement=null;return _this82;}_createClass(hl,[{key:\"destroy\",value:function destroy(){this.map(function(t){return t.destroy();});}},{key:\"setParent\",value:function setParent(t){this._parentElement=t;}},{key:\"delegate\",value:function delegate(){var _this83=this;for(var _len17=arguments.length,t=new Array(_len17),_key17=0;_key17<_len17;_key17++){t[_key17]=arguments[_key17];}if(!t.length||!function(t){return t.every(function(t){return\"string\"==typeof t;});}(t))throw new Gn.b(\"ui-viewcollection-delegate-wrong-events: All event names must be strings.\");return{to:function to(e){var _iterator236=_createForOfIteratorHelper(_this83),_step236;try{for(_iterator236.s();!(_step236=_iterator236.n()).done;){var _n165=_step236.value;for(var _i122=0,_t200=t;_i122<_t200.length;_i122++){var _i123=_t200[_i122];_n165.delegate(_i123).to(e);}}}catch(err){_iterator236.e(err);}finally{_iterator236.f();}_this83.on(\"add\",function(n,i){for(var _i120=0,_t198=t;_i120<_t198.length;_i120++){var _n163=_t198[_i120];i.delegate(_n163).to(e);}}),_this83.on(\"remove\",function(n,i){for(var _i121=0,_t199=t;_i121<_t199.length;_i121++){var _n164=_t199[_i121];i.stopDelegating(_n164,e);}});}};}}]);return hl;}(oo);ci(oo,Fi);var fl=\"http://www.w3.org/1999/xhtml\";var ml=/*#__PURE__*/function(){function ml(t){_classCallCheck(this,ml);Object.assign(this,xl(yl(t))),this._isRendered=!1,this._revertData=null;}_createClass(ml,[{key:\"render\",value:function render(){var t=this._renderNode({intoFragment:!0});return this._isRendered=!0,t;}},{key:\"apply\",value:function apply(t){return this._revertData={children:[],bindings:[],attributes:{}},this._renderNode({node:t,isApplying:!0,revertData:this._revertData}),t;}},{key:\"revert\",value:function revert(t){if(!this._revertData)throw new Gn.b(\"ui-template-revert-not-applied: Attempting to revert a template which has not been applied yet.\");this._revertTemplateFromNode(t,this._revertData);}},{key:\"getViews\",value:/*#__PURE__*/_regeneratorRuntime().mark(function getViews(){return _regeneratorRuntime().wrap(function getViews$(_context36){while(1)switch(_context36.prev=_context36.next){case 0:return _context36.delegateYield(/*#__PURE__*/_regeneratorRuntime().mark(function t(e){var _iterator237,_step237,_n166;return _regeneratorRuntime().wrap(function t$(_context35){while(1)switch(_context35.prev=_context35.next){case 0:if(!e.children){_context35.next=24;break;}_iterator237=_createForOfIteratorHelper(e.children);_context35.prev=2;_iterator237.s();case 4:if((_step237=_iterator237.n()).done){_context35.next=16;break;}_n166=_step237.value;if(!Ml(_n166)){_context35.next=11;break;}_context35.next=9;return _n166;case 9:_context35.next=14;break;case 11:_context35.t0=El(_n166);if(!_context35.t0){_context35.next=14;break;}return _context35.delegateYield(t(_n166),\"t1\",14);case 14:_context35.next=4;break;case 16:_context35.next=21;break;case 18:_context35.prev=18;_context35.t2=_context35[\"catch\"](2);_iterator237.e(_context35.t2);case 21:_context35.prev=21;_iterator237.f();return _context35.finish(21);case 24:case\"end\":return _context35.stop();}},t,null,[[2,18,21,24]]);})(this),\"t0\",1);case 1:case\"end\":return _context36.stop();}},getViews,this);})},{key:\"_renderNode\",value:function _renderNode(t){var e;if(e=t.node?this.tag&&this.text:this.tag?this.text:!this.text)throw new Gn.b('ui-template-wrong-syntax: Node definition must have either \"tag\" or \"text\" when rendering a new Node.');return this.text?this._renderText(t):this._renderElement(t);}},{key:\"_renderElement\",value:function _renderElement(t){var e=t.node;return e||(e=t.node=document.createElementNS(this.ns||fl,this.tag)),this._renderAttributes(t),this._renderElementChildren(t),this._setUpListeners(t),e;}},{key:\"_renderText\",value:function _renderText(t){var e=t.node;return e?t.revertData.text=e.textContent:e=t.node=document.createTextNode(\"\"),wl(this.text)?this._bindToObservable({schema:this.text,updater:function(t){return{set:function set(e){t.textContent=e;},remove:function remove(){t.textContent=\"\";}};}(e),data:t}):e.textContent=this.text.join(\"\"),e;}},{key:\"_renderAttributes\",value:function _renderAttributes(t){var e,n,i,o;if(!this.attributes)return;var r=t.node,s=t.revertData;for(e in this.attributes)if(i=r.getAttribute(e),n=this.attributes[e],s&&(s.attributes[e]=i),o=z(n[0])&&n[0].ns?n[0].ns:null,wl(n)){var _a10=o?n[0].value:n;s&&Il(e)&&_a10.unshift(i),this._bindToObservable({schema:_a10,updater:kl(r,e,o),data:t});}else\"style\"==e&&\"string\"!=typeof n[0]?this._renderStyleAttribute(n[0],t):(s&&i&&Il(e)&&n.unshift(i),Pl(n=n.map(function(t){return t&&t.value||t;}).reduce(function(t,e){return t.concat(e);},[]).reduce(Cl,\"\"))||r.setAttributeNS(o,e,n));}},{key:\"_renderStyleAttribute\",value:function _renderStyleAttribute(t,e){var n=e.node;for(var _i124 in t){var _o55=t[_i124];wl(_o55)?this._bindToObservable({schema:[_o55],updater:vl(n,_i124),data:e}):n.style[_i124]=_o55;}}},{key:\"_renderElementChildren\",value:function _renderElementChildren(t){var e=t.node,n=t.intoFragment?document.createDocumentFragment():e,i=t.isApplying;var o=0;var _iterator238=_createForOfIteratorHelper(this.children),_step238;try{for(_iterator238.s();!(_step238=_iterator238.n()).done;){var _r24=_step238.value;if(Sl(_r24)){if(!i){_r24.setParent(e);var _iterator239=_createForOfIteratorHelper(_r24),_step239;try{for(_iterator239.s();!(_step239=_iterator239.n()).done;){var _t201=_step239.value;n.appendChild(_t201.element);}}catch(err){_iterator239.e(err);}finally{_iterator239.f();}}}else if(Ml(_r24))i||(_r24.isRendered||_r24.render(),n.appendChild(_r24.element));else if(Zo(_r24))n.appendChild(_r24);else if(i){var _e175={children:[],bindings:[],attributes:{}};t.revertData.children.push(_e175),_r24._renderNode({node:n.childNodes[o++],isApplying:!0,revertData:_e175});}else n.appendChild(_r24.render());}}catch(err){_iterator238.e(err);}finally{_iterator238.f();}t.intoFragment&&e.appendChild(n);}},{key:\"_setUpListeners\",value:function _setUpListeners(t){var _this84=this;if(this.eventListeners){var _loop4=function _loop4(_e176){var n=_this84.eventListeners[_e176].map(function(n){var _e176$split=_e176.split(\"@\"),_e176$split2=_slicedToArray(_e176$split,2),i=_e176$split2[0],o=_e176$split2[1];return n.activateDomEventListener(i,o,t);});t.revertData&&t.revertData.bindings.push(n);};for(var _e176 in this.eventListeners){_loop4(_e176);}}}},{key:\"_bindToObservable\",value:function _bindToObservable(_ref14){var t=_ref14.schema,e=_ref14.updater,n=_ref14.data;var i=n.revertData;_l(t,e,n);var o=t.filter(function(t){return!Pl(t);}).filter(function(t){return t.observable;}).map(function(i){return i.activateAttributeListener(t,e,n);});i&&i.bindings.push(o);}},{key:\"_revertTemplateFromNode\",value:function _revertTemplateFromNode(t,e){var _iterator240=_createForOfIteratorHelper(e.bindings),_step240;try{for(_iterator240.s();!(_step240=_iterator240.n()).done;){var _t202=_step240.value;var _iterator241=_createForOfIteratorHelper(_t202),_step241;try{for(_iterator241.s();!(_step241=_iterator241.n()).done;){var _e177=_step241.value;_e177();}}catch(err){_iterator241.e(err);}finally{_iterator241.f();}}}catch(err){_iterator240.e(err);}finally{_iterator240.f();}if(e.text)t.textContent=e.text;else{for(var _n167 in e.attributes){var _i125=e.attributes[_n167];null===_i125?t.removeAttribute(_n167):t.setAttribute(_n167,_i125);}for(var _n168=0;_n168(\\s+)<\\/span>/g,function(t,e){return 1==e.length?\" \":e;});}(i.getData(\"text/html\")):i.getData(\"text/plain\")&&(o=function(t){return(t=t.replace(//g,\">\").replace(/\\n\\n/g,\"

\").replace(/\\n/g,\"
\").replace(/^\\s/,\" \").replace(/\\s$/,\" \").replace(/\\s\\s/g,\"  \")).indexOf(\"

\")>-1&&(t=\"

\".concat(t,\"

\")),t;}(i.getData(\"text/plain\"))),o=_this107._htmlDataProcessor.toView(o),_this107.fire(\"inputTransformation\",{content:o,dataTransfer:i}),n.scrollToTheSelection();},{priority:\"low\"}),this.listenTo(this,\"inputTransformation\",function(t,e){if(!e.content.isEmpty){var _t204=_this107.editor.data,_n172=_this107.editor.model,_i129=_t204.toModel(e.content,\"$clipboardHolder\");if(0==_i129.childCount)return;_n172.insertContent(_i129);}},{priority:\"low\"}),this.listenTo(i,\"copy\",o,{priority:\"low\"}),this.listenTo(i,\"cut\",function(e,n){t.isReadOnly?n.preventDefault():o(e,n);},{priority:\"low\"}),this.listenTo(i,\"clipboardOutput\",function(n,i){i.content.isEmpty||(i.dataTransfer.setData(\"text/html\",_this107._htmlDataProcessor.toData(i.content)),i.dataTransfer.setData(\"text/plain\",function t(e){var n=\"\";if(e.is(\"text\")||e.is(\"textProxy\"))n=e.data;else if(e.is(\"img\")&&e.hasAttribute(\"alt\"))n=e.getAttribute(\"alt\");else{var _i130=null;var _iterator248=_createForOfIteratorHelper(e.getChildren()),_step248;try{for(_iterator248.s();!(_step248=_iterator248.n()).done;){var _o58=_step248.value;var _e185=t(_o58);_i130&&(_i130.is(\"containerElement\")||_o58.is(\"containerElement\"))&&(Jl.includes(_i130.name)||Jl.includes(_o58.name)?n+=\"\\n\":n+=\"\\n\\n\"),n+=_e185,_i130=_o58;}}catch(err){_iterator248.e(err);}finally{_iterator248.f();}}return n;}(i.content))),\"cut\"==i.method&&t.model.deleteContent(e.selection);},{priority:\"low\"});}}],[{key:\"pluginName\",get:function get(){return\"Clipboard\";}}]);return Kl;}($l);var Zl=/*#__PURE__*/function(){function Zl(t){var _this108=this;_classCallCheck(this,Zl);this.editor=t,this.set(\"value\",void 0),this.set(\"isEnabled\",!1),this.decorate(\"execute\"),this.listenTo(this.editor.model.document,\"change\",function(){_this108.refresh();}),this.on(\"execute\",function(t){_this108.isEnabled||t.stop();},{priority:\"high\"}),this.listenTo(t,\"change:isReadOnly\",function(t,e,n){n?(_this108.on(\"set:isEnabled\",Xl,{priority:\"highest\"}),_this108.isEnabled=!1):(_this108.off(\"set:isEnabled\",Xl),_this108.refresh());});}_createClass(Zl,[{key:\"refresh\",value:function refresh(){this.isEnabled=!0;}},{key:\"execute\",value:function execute(){}},{key:\"destroy\",value:function destroy(){this.stopListening();}}]);return Zl;}();function Xl(t){t[\"return\"]=!1,t.stop();}ci(Zl,Fi);var td=/*#__PURE__*/function(_Zl){_inherits(td,_Zl);var _super51=_createSuper(td);function td(){_classCallCheck(this,td);return _super51.apply(this,arguments);}_createClass(td,[{key:\"execute\",value:function execute(){var _this109=this;var t=this.editor.model,e=t.document;t.change(function(n){!function(t,e,n,i){var o=n.isCollapsed,r=n.getFirstRange(),s=r.start.parent,a=r.end.parent;if(i.isLimit(s)||i.isLimit(a))return void(o||s!=a||t.deleteContent(n));if(o)ed(e,r.start);else{var _i131=!(r.start.isAtStart&&r.end.isAtEnd),_o59=s==a;t.deleteContent(n,{leaveUnmerged:_i131}),_i131&&(_o59?ed(e,n.focus):e.setSelection(a,0));}}(_this109.editor.model,n,e.selection,t.schema),_this109.fire(\"afterExecute\",{writer:n});});}}]);return td;}(Zl);function ed(t,e){t.split(e),t.setSelection(e.parent.nextSibling,0);}var nd=/*#__PURE__*/function(_hr5){_inherits(nd,_hr5);var _super52=_createSuper(nd);function nd(t){var _this110;_classCallCheck(this,nd);_this110=_super52.call(this,t);var e=_this110.document;e.on(\"keydown\",function(t,n){if(_this110.isEnabled&&n.keyCode==bo.enter){var _i132;e.once(\"enter\",function(t){return _i132=t;},{priority:\"highest\"}),e.fire(\"enter\",new Xr(e,n.domEvent,{isSoft:n.shiftKey})),_i132&&_i132.stop.called&&t.stop();}});return _this110;}_createClass(nd,[{key:\"observe\",value:function observe(){}}]);return nd;}(hr);var id=/*#__PURE__*/function(_$l2){_inherits(id,_$l2);var _super53=_createSuper(id);function id(){_classCallCheck(this,id);return _super53.apply(this,arguments);}_createClass(id,[{key:\"init\",value:function init(){var t=this.editor,e=t.editing.view,n=e.document;e.addObserver(nd),t.commands.add(\"enter\",new td(t)),this.listenTo(n,\"enter\",function(n,i){i.preventDefault(),i.isSoft||(t.execute(\"enter\"),e.scrollToTheSelection());},{priority:\"low\"});}}],[{key:\"pluginName\",get:function get(){return\"Enter\";}}]);return id;}($l);var od=/*#__PURE__*/function(_Zl2){_inherits(od,_Zl2);var _super54=_createSuper(od);function od(){_classCallCheck(this,od);return _super54.apply(this,arguments);}_createClass(od,[{key:\"execute\",value:function execute(){var _this111=this;var t=this.editor.model,e=t.document;t.change(function(n){!function(t,e,n){var i=n.isCollapsed,o=n.getFirstRange(),r=o.start.parent,s=o.end.parent,a=r==s;if(i)rd(e,o.end);else{var _i133=!(o.start.isAtStart&&o.end.isAtEnd);t.deleteContent(n,{leaveUnmerged:_i133}),a?rd(e,n.focus):_i133&&e.setSelection(s,0);}}(t,n,e.selection),_this111.fire(\"afterExecute\",{writer:n});});}},{key:\"refresh\",value:function refresh(){var t=this.editor.model,e=t.document;this.isEnabled=function(t,e){if(e.rangeCount>1)return!1;var n=e.anchor;if(!n||!t.checkChild(n,\"softBreak\"))return!1;var i=e.getFirstRange(),o=i.start.parent,r=i.end.parent;if((sd(o,t)||sd(r,t))&&o!==r)return!1;return!0;}(t.schema,e.selection);}}]);return od;}(Zl);function rd(t,e){var n=t.createElement(\"softBreak\");t.insert(n,e),t.setSelection(n,\"after\");}function sd(t,e){return!t.is(\"rootElement\")&&(e.isLimit(t)||sd(t.parent,e));}var ad=/*#__PURE__*/function(_$l3){_inherits(ad,_$l3);var _super55=_createSuper(ad);function ad(){_classCallCheck(this,ad);return _super55.apply(this,arguments);}_createClass(ad,[{key:\"init\",value:function init(){var t=this.editor,e=t.model.schema,n=t.conversion,i=t.editing.view,o=i.document;e.register(\"softBreak\",{allowWhere:\"$text\",isInline:!0}),n[\"for\"](\"upcast\").elementToElement({model:\"softBreak\",view:\"br\"}),n[\"for\"](\"downcast\").elementToElement({model:\"softBreak\",view:function view(t,e){return e.createEmptyElement(\"br\");}}),i.addObserver(nd),t.commands.add(\"shiftEnter\",new od(t)),this.listenTo(o,\"enter\",function(e,n){n.preventDefault(),n.isSoft&&(t.execute(\"shiftEnter\"),i.scrollToTheSelection());},{priority:\"low\"});}}],[{key:\"pluginName\",get:function get(){return\"ShiftEnter\";}}]);return ad;}($l);var cd=/*#__PURE__*/function(){function cd(t){var _this112=this;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:20;_classCallCheck(this,cd);this.model=t,this.size=0,this.limit=e,this.isLocked=!1,this._changeCallback=function(t,e){\"transparent\"!=e.type&&e!==_this112._batch&&_this112._reset(!0);},this._selectionChangeCallback=function(){_this112._reset();},this.model.document.on(\"change\",this._changeCallback),this.model.document.selection.on(\"change:range\",this._selectionChangeCallback),this.model.document.selection.on(\"change:attribute\",this._selectionChangeCallback);}_createClass(cd,[{key:\"batch\",get:function get(){return this._batch||(this._batch=this.model.createBatch()),this._batch;}},{key:\"input\",value:function input(t){this.size+=t,this.size>=this.limit&&this._reset(!0);}},{key:\"lock\",value:function lock(){this.isLocked=!0;}},{key:\"unlock\",value:function unlock(){this.isLocked=!1;}},{key:\"destroy\",value:function destroy(){this.model.document.off(\"change\",this._changeCallback),this.model.document.selection.off(\"change:range\",this._selectionChangeCallback),this.model.document.selection.off(\"change:attribute\",this._selectionChangeCallback);}},{key:\"_reset\",value:function _reset(t){this.isLocked&&!t||(this._batch=null,this.size=0);}}]);return cd;}();var ld=/*#__PURE__*/function(_Zl3){_inherits(ld,_Zl3);var _super56=_createSuper(ld);function ld(t,e){var _this113;_classCallCheck(this,ld);_this113=_super56.call(this,t),_this113._buffer=new cd(t.model,e);return _this113;}_createClass(ld,[{key:\"buffer\",get:function get(){return this._buffer;}},{key:\"destroy\",value:function destroy(){_get(_getPrototypeOf(ld.prototype),\"destroy\",this).call(this),this._buffer.destroy();}},{key:\"execute\",value:function execute(){var _this114=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=this.editor.model,n=e.document,i=t.text||\"\",o=i.length,r=t.range||n.selection.getFirstRange(),s=t.resultRange;e.enqueueChange(this._buffer.batch,function(t){var a=r.isCollapsed;_this114._buffer.lock(),a||e.deleteContent(e.createSelection(r)),i&&t.insertText(i,n.selection.getAttributes(),r.start),s?t.setSelection(s):a&&t.setSelection(r.start.getShiftedBy(o)),_this114._buffer.unlock(),_this114._buffer.input(o);});}}]);return ld;}(Zl);function dd(t){var e=null;var n=t.model,i=t.editing.view,o=t.commands.get(\"input\");function r(){var t=o.buffer;t.lock(),n.enqueueChange(t.batch,function(){n.deleteContent(n.document.selection);}),t.unlock();}i.document.on(\"keydown\",function(t,s){return function(t){var s=n.document,a=i.document.isComposing,c=e&&e.isEqual(s.selection);if(e=null,!o.isEnabled)return;if(function(t){if(t.ctrlKey)return!0;return ud.includes(t.keyCode);}(t)||s.selection.isCollapsed)return;if(a&&229===t.keyCode)return;if(!a&&229===t.keyCode&&c)return;r();}(s);},{priority:\"lowest\"}),i.document.on(\"compositionstart\",function(){var t=n.document,e=1!==t.selection.rangeCount||t.selection.getFirstRange().isFlat;if(t.selection.isCollapsed||e)return;r();},{priority:\"lowest\"}),i.document.on(\"compositionend\",function(){e=n.createSelection(n.document.selection);},{priority:\"lowest\"});}var ud=[wo(\"arrowUp\"),wo(\"arrowRight\"),wo(\"arrowDown\"),wo(\"arrowLeft\"),9,16,17,18,19,20,27,33,34,35,36,45,91,93,144,145,173,174,175,176,177,178,179,255];for(var _t205=112;_t205<=135;_t205++)ud.push(_t205);function hd(t){if(0==t.length)return!1;var _iterator249=_createForOfIteratorHelper(t),_step249;try{for(_iterator249.s();!(_step249=_iterator249.n()).done;){var _e186=_step249.value;if(\"children\"===_e186.type&&!fd(_e186))return!0;}}catch(err){_iterator249.e(err);}finally{_iterator249.f();}return!1;}function fd(t){if(t.newChildren.length-t.oldChildren.length!=1)return;var e=function(t,e){var n=[];var i,o=0;return t.forEach(function(t){\"equal\"==t?(r(),o++):\"insert\"==t?(s(\"insert\")?i.values.push(e[o]):(r(),i={type:\"insert\",index:o,values:[e[o]]}),o++):s(\"delete\")?i.howMany++:(r(),i={type:\"delete\",index:o,howMany:1});}),r(),n;function r(){i&&(n.push(i),i=null);}function s(t){return i&&i.type==t;}}(Qo(t.oldChildren,t.newChildren,md),t.newChildren);if(e.length>1)return;var n=e[0];return n.values[0]&&n.values[0].is(\"text\")?n:void 0;}function md(t,e){return t&&t.is(\"text\")&&e&&e.is(\"text\")?t.data===e.data:t===e;}var pd=/*#__PURE__*/function(){function pd(t){_classCallCheck(this,pd);this.editor=t,this.editing=this.editor.editing;}_createClass(pd,[{key:\"handle\",value:function handle(t,e){if(hd(t))this._handleContainerChildrenMutations(t,e);else{var _iterator250=_createForOfIteratorHelper(t),_step250;try{for(_iterator250.s();!(_step250=_iterator250.n()).done;){var _n173=_step250.value;this._handleTextMutation(_n173,e),this._handleTextNodeInsertion(_n173);}}catch(err){_iterator250.e(err);}finally{_iterator250.f();}}}},{key:\"_handleContainerChildrenMutations\",value:function _handleContainerChildrenMutations(t,e){var n=function(t){var e=t.map(function(t){return t.node;}).reduce(function(t,e){return t.getCommonAncestor(e,{includeSelf:!0});});if(!e)return;return e.getAncestors({includeSelf:!0,parentFirst:!0}).find(function(t){return t.is(\"containerElement\")||t.is(\"rootElement\");});}(t);if(!n)return;var i=this.editor.editing.view.domConverter.mapViewToDom(n),o=new rr(),r=this.editor.data.toModel(o.domToView(i)).getChild(0),s=this.editor.editing.mapper.toModelElement(n);if(!s)return;var a=Array.from(r.getChildren()),c=Array.from(s.getChildren()),l=a[a.length-1],d=c[c.length-1];l&&l.is(\"softBreak\")&&d&&!d.is(\"softBreak\")&&a.pop();var u=this.editor.model.schema;if(!gd(a,u)||!gd(c,u))return;var h=a.map(function(t){return t.is(\"text\")?t.data:\"@\";}).join(\"\").replace(/\\u00A0/g,\" \"),f=c.map(function(t){return t.is(\"text\")?t.data:\"@\";}).join(\"\").replace(/\\u00A0/g,\" \");if(f===h)return;var m=Qo(f,h),_bd=bd(m),p=_bd.firstChangeAt,g=_bd.insertions,b=_bd.deletions;var w=null;e&&(w=this.editing.mapper.toModelRange(e.getFirstRange()));var _=h.substr(p,g),k=this.editor.model.createRange(this.editor.model.createPositionAt(s,p),this.editor.model.createPositionAt(s,p+b));this.editor.execute(\"input\",{text:_,range:k,resultRange:w});}},{key:\"_handleTextMutation\",value:function _handleTextMutation(t,e){if(\"text\"!=t.type)return;var n=t.newText.replace(/\\u00A0/g,\" \"),i=t.oldText.replace(/\\u00A0/g,\" \");if(i===n)return;var o=Qo(i,n),_bd2=bd(o),r=_bd2.firstChangeAt,s=_bd2.insertions,a=_bd2.deletions;var c=null;e&&(c=this.editing.mapper.toModelRange(e.getFirstRange()));var l=this.editing.view.createPositionAt(t.node,r),d=this.editing.mapper.toModelPosition(l),u=this.editor.model.createRange(d,d.getShiftedBy(a)),h=n.substr(r,s);this.editor.execute(\"input\",{text:h,range:u,resultRange:c});}},{key:\"_handleTextNodeInsertion\",value:function _handleTextNodeInsertion(t){if(\"children\"!=t.type)return;var e=fd(t),n=this.editing.view.createPositionAt(t.node,e.index),i=this.editing.mapper.toModelPosition(n),o=e.values[0].data;this.editor.execute(\"input\",{text:o.replace(/\\u00A0/g,\" \"),range:this.editor.model.createRange(i)});}}]);return pd;}();function gd(t,e){return t.every(function(t){return e.isInline(t);});}function bd(t){var e=null,n=null;for(var _i134=0;_i1340&&arguments[0]!==undefined?arguments[0]:{};var e=this.editor.model,n=e.document;e.enqueueChange(this._buffer.batch,function(i){_this116._buffer.lock();var o=i.createSelection(n.selection),r=o.isCollapsed;if(o.isCollapsed&&e.modifySelection(o,{direction:_this116.direction,unit:t.unit}),_this116._shouldEntireContentBeReplacedWithParagraph(t.sequence||1))return void _this116._replaceEntireContentWithParagraph(i);if(o.isCollapsed)return;var s=0;o.getFirstRange().getMinimalFlatRanges().forEach(function(t){s+=eo(t.getWalker({singleCharacters:!0,ignoreElementEnd:!0,shallow:!0}));}),e.deleteContent(o,{doNotResetEntireContent:r}),_this116._buffer.input(s),i.setSelection(o),_this116._buffer.unlock();});}},{key:\"_shouldEntireContentBeReplacedWithParagraph\",value:function _shouldEntireContentBeReplacedWithParagraph(t){if(t>1)return!1;var e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n);if(!(n.isCollapsed&&n.containsEntireContent(i)))return!1;if(!e.schema.checkChild(i,\"paragraph\"))return!1;var o=i.getChild(0);return!o||\"paragraph\"!==o.name;}},{key:\"_replaceEntireContentWithParagraph\",value:function _replaceEntireContentWithParagraph(t){var e=this.editor.model,n=e.document.selection,i=e.schema.getLimitElement(n),o=t.createElement(\"paragraph\");t.remove(t.createRangeIn(i)),t.insert(o,i),t.setSelection(o,0);}}]);return _d;}(Zl);var kd=/*#__PURE__*/function(_hr6){_inherits(kd,_hr6);var _super59=_createSuper(kd);function kd(t){var _this117;_classCallCheck(this,kd);_this117=_super59.call(this,t);var e=t.document;var n=0;e.on(\"keyup\",function(t,e){e.keyCode!=bo[\"delete\"]&&e.keyCode!=bo.backspace||(n=0);}),e.on(\"keydown\",function(t,i){var o={};if(i.keyCode==bo[\"delete\"])o.direction=\"forward\",o.unit=\"character\";else{if(i.keyCode!=bo.backspace)return;o.direction=\"backward\",o.unit=\"codePoint\";}var r=mo.isMac?i.altKey:i.ctrlKey;var s;o.unit=r?\"word\":o.unit,o.sequence=++n,e.once(\"delete\",function(t){return s=t;},{priority:\"highest\"}),e.fire(\"delete\",new Xr(e,i.domEvent,o)),s&&s.stop.called&&t.stop();});return _this117;}_createClass(kd,[{key:\"observe\",value:function observe(){}}]);return kd;}(hr);function vd(t){var e=t.model,n=t.editing.view,i=200;var o=null,r=e.createSelection(e.document.selection),s=Date.now();e.document.selection.on(\"change\",function(t){var n=e.createSelection(t.source);r.isEqual(n)||(o=r,r=n,s=Date.now());}),n.document.on(\"mutations\",function(n,a){hd(a)&&function(t){var _iterator251=_createForOfIteratorHelper(t),_step251;try{for(_iterator251.s();!(_step251=_iterator251.n()).done;){var _e187=_step251.value;if(\"children\"!==_e187.type)continue;var _t206=_e187.oldChildren,_n174=_e187.newChildren;if(!yd(_t206))continue;var _i135=Qo(_t206,_n174),_o60=_i135.some(function(t){return\"delete\"===t;}),_r26=_i135.some(function(t){return\"insert\"===t;});if(_o60&&!_r26)return!0;}}catch(err){_iterator251.e(err);}finally{_iterator251.f();}return!1;}(a)&&(!function(){Date.now()-s2&&arguments[2]!==undefined?arguments[2]:{};var i=function(t,e){var n=Td.get(t);return n&&n.has(e)?n.get(e):Md;}(t.constructor,e.constructor);try{return i(t=t.clone(),e,n);}catch(i){throw bs.a.error(\"Error during operation transformation!\",i.message),bs.a.error(\"Transformed operation\",t),bs.a.error(\"Operation transformed by\",e),bs.a.error(\"context.aIsStrong\",n.aIsStrong),bs.a.error(\"context.aWasUndone\",n.aWasUndone),bs.a.error(\"context.bWasUndone\",n.bWasUndone),bs.a.error(\"context.abRelation\",n.abRelation),bs.a.error(\"context.baRelation\",n.baRelation),i;}}function Sd(t,e,n){if(t=t.slice(),e=e.slice(),0==t.length||0==e.length)return{operationsA:t,operationsB:e};var i=new WeakMap();var _iterator252=_createForOfIteratorHelper(t),_step252;try{for(_iterator252.s();!(_step252=_iterator252.n()).done;){var _e189=_step252.value;i.set(_e189,0);}}catch(err){_iterator252.e(err);}finally{_iterator252.f();}var o={nextBaseVersionA:t[t.length-1].baseVersion+1,nextBaseVersionB:e[e.length-1].baseVersion+1,originalOperationsACount:t.length,originalOperationsBCount:e.length},r=new Id(n.document,n.useRelations,n.forceWeakRemove);r.setOriginalOperations(t),r.setOriginalOperations(e);var s=0;for(;s2&&arguments[2]!==undefined?arguments[2]:!1;_classCallCheck(this,Id);this._history=t.history,this._useRelations=e,this._forceWeakRemove=!!n,this._originalOperations=new Map(),this._relations=new Map();}_createClass(Id,[{key:\"setOriginalOperations\",value:function setOriginalOperations(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var n=e?this._originalOperations.get(e):null;var _iterator254=_createForOfIteratorHelper(t),_step254;try{for(_iterator254.s();!(_step254=_iterator254.n()).done;){var _e190=_step254.value;this._originalOperations.set(_e190,n||_e190);}}catch(err){_iterator254.e(err);}finally{_iterator254.f();}}},{key:\"updateRelation\",value:function updateRelation(t,e){switch(t.constructor){case ac:switch(e.constructor){case hc:t.targetPosition.isEqual(e.sourcePosition)||e.movedRange.containsPosition(t.targetPosition)?this._setRelation(t,e,\"insertAtSource\"):t.targetPosition.isEqual(e.deletionPosition)?this._setRelation(t,e,\"insertBetween\"):t.targetPosition.isAfter(e.sourcePosition)&&this._setRelation(t,e,\"moveTargetAfter\");break;case ac:t.targetPosition.isEqual(e.sourcePosition)||t.targetPosition.isBefore(e.sourcePosition)?this._setRelation(t,e,\"insertBefore\"):this._setRelation(t,e,\"insertAfter\");}break;case fc:switch(e.constructor){case hc:t.splitPosition.isBefore(e.sourcePosition)&&this._setRelation(t,e,\"splitBefore\");break;case ac:(t.splitPosition.isEqual(e.sourcePosition)||t.splitPosition.isBefore(e.sourcePosition))&&this._setRelation(t,e,\"splitBefore\");}break;case hc:switch(e.constructor){case hc:t.targetPosition.isEqual(e.sourcePosition)||this._setRelation(t,e,\"mergeTargetNotMoved\"),t.sourcePosition.isEqual(e.sourcePosition)&&this._setRelation(t,e,\"mergeSameElement\");break;case fc:t.sourcePosition.isEqual(e.splitPosition)&&this._setRelation(t,e,\"splitAtSource\");}break;case lc:{var _n177=t.newRange;if(!_n177)return;switch(e.constructor){case ac:{var _i137=Gs._createFromPositionAndShift(e.sourcePosition,e.howMany),_o62=_i137.containsPosition(_n177.start)||_i137.start.isEqual(_n177.start),_r27=_i137.containsPosition(_n177.end)||_i137.end.isEqual(_n177.end);!_o62&&!_r27||_i137.containsRange(_n177)||this._setRelation(t,e,{side:_o62?\"left\":\"right\",path:_o62?_n177.start.path.slice():_n177.end.path.slice()});break;}case hc:{var _i138=_n177.start.isEqual(e.targetPosition),_o63=_n177.start.isEqual(e.deletionPosition),_r28=_n177.end.isEqual(e.deletionPosition),_s19=_n177.end.isEqual(e.sourcePosition);(_i138||_o63||_r28||_s19)&&this._setRelation(t,e,{wasInLeftElement:_i138,wasStartBeforeMergedElement:_o63,wasEndBeforeMergedElement:_r28,wasInRightElement:_s19});break;}}break;}}}},{key:\"getContext\",value:function getContext(t,e,n){return{aIsStrong:n,aWasUndone:this._wasUndone(t),bWasUndone:this._wasUndone(e),abRelation:this._useRelations?this._getRelation(t,e):null,baRelation:this._useRelations?this._getRelation(e,t):null,forceWeakRemove:this._forceWeakRemove};}},{key:\"_wasUndone\",value:function _wasUndone(t){var e=this._originalOperations.get(t);return e.wasUndone||this._history.isUndoneOperation(e);}},{key:\"_getRelation\",value:function _getRelation(t,e){var n=this._originalOperations.get(e),i=this._history.getUndoneOperation(n);if(!i)return null;var o=this._originalOperations.get(t),r=this._relations.get(o);return r&&r.get(i)||null;}},{key:\"_setRelation\",value:function _setRelation(t,e,n){var i=this._originalOperations.get(t),o=this._originalOperations.get(e);var r=this._relations.get(i);r||(r=new Map(),this._relations.set(i,r)),r.set(o,n);}}]);return Id;}();function Nd(t,e){var _iterator255=_createForOfIteratorHelper(t),_step255;try{for(_iterator255.s();!(_step255=_iterator255.n()).done;){var _n178=_step255.value;_n178.baseVersion=e++;}}catch(err){_iterator255.e(err);}finally{_iterator255.f();}}function Od(t,e){for(var _n179=0;_n1790)?(t.sourcePosition=e.moveTargetPosition.clone(),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]):(t.sourcePosition.hasSameParentAs(e.splitPosition)&&(t.howMany=e.splitPosition.offset),t.sourcePosition=t.sourcePosition._getTransformedBySplitOperation(e),t.targetPosition=t.targetPosition._getTransformedBySplitOperation(e),[t]);}),Pd(ac,cc,function(t,e){var n=Gs._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByInsertOperation(e,!1)[0];return t.sourcePosition=n.start,t.howMany=n.end.offset-n.start.offset,t.targetPosition.isEqual(e.position)||(t.targetPosition=t.targetPosition._getTransformedByInsertOperation(e)),[t];}),Pd(ac,ac,function(t,e,n){var i=Gs._createFromPositionAndShift(t.sourcePosition,t.howMany),o=Gs._createFromPositionAndShift(e.sourcePosition,e.howMany);var r,s=n.aIsStrong,a=!n.aIsStrong;if(\"insertBefore\"==n.abRelation||\"insertAfter\"==n.baRelation?a=!0:\"insertAfter\"!=n.abRelation&&\"insertBefore\"!=n.baRelation||(a=!1),r=t.targetPosition.isEqual(e.targetPosition)&&a?t.targetPosition._getTransformedByDeletion(e.sourcePosition,e.howMany):t.targetPosition._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Dd(t,e)&&Dd(e,t))return[e.getReversed()];if(i.containsPosition(e.targetPosition)&&i.containsRange(o,!0))return i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Ld([i],r);if(o.containsPosition(t.targetPosition)&&o.containsRange(i,!0))return i.start=i.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),i.end=i.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),Ld([i],r);var c=li(t.sourcePosition.getParentPath(),e.sourcePosition.getParentPath());if(\"prefix\"==c||\"extension\"==c)return i.start=i.start._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),i.end=i.end._getTransformedByMove(e.sourcePosition,e.targetPosition,e.howMany),Ld([i],r);\"remove\"!=t.type||\"remove\"==e.type||n.aWasUndone||n.forceWeakRemove?\"remove\"==t.type||\"remove\"!=e.type||n.bWasUndone||n.forceWeakRemove||(s=!1):s=!0;var l=[],d=i.getDifference(o);var _iterator257=_createForOfIteratorHelper(d),_step257;try{for(_iterator257.s();!(_step257=_iterator257.n()).done;){var _t210=_step257.value;_t210.start=_t210.start._getTransformedByDeletion(e.sourcePosition,e.howMany),_t210.end=_t210.end._getTransformedByDeletion(e.sourcePosition,e.howMany);var _n185=\"same\"==li(_t210.start.getParentPath(),e.getMovedRangeStart().getParentPath()),_i149=_t210._getTransformedByInsertion(e.getMovedRangeStart(),e.howMany,_n185);l.push.apply(l,_toConsumableArray(_i149));}}catch(err){_iterator257.e(err);}finally{_iterator257.f();}var u=i.getIntersection(o);return null!==u&&s&&(u.start=u.start._getCombined(e.sourcePosition,e.getMovedRangeStart()),u.end=u.end._getCombined(e.sourcePosition,e.getMovedRangeStart()),0===l.length?l.push(u):1==l.length?o.start.isBefore(i.start)||o.start.isEqual(i.start)?l.unshift(u):l.push(u):l.splice(1,0,u)),0===l.length?[new Cd(t.baseVersion)]:Ld(l,r);}),Pd(ac,fc,function(t,e,n){var i=t.targetPosition.clone();t.targetPosition.isEqual(e.insertionPosition)&&e.graveyardPosition&&\"moveTargetAfter\"!=n.abRelation||(i=t.targetPosition._getTransformedBySplitOperation(e));var o=Gs._createFromPositionAndShift(t.sourcePosition,t.howMany);if(o.end.isEqual(e.insertionPosition))return e.graveyardPosition||t.howMany++,t.targetPosition=i,[t];if(o.start.hasSameParentAs(e.splitPosition)&&o.containsPosition(e.splitPosition)){var _t211=new Gs(e.splitPosition,o.end);return _t211=_t211._getTransformedBySplitOperation(e),Ld([new Gs(o.start,e.splitPosition),_t211],i);}t.targetPosition.isEqual(e.splitPosition)&&\"insertAtSource\"==n.abRelation&&(i=e.moveTargetPosition),t.targetPosition.isEqual(e.insertionPosition)&&\"insertBetween\"==n.abRelation&&(i=t.targetPosition);var r=[o._getTransformedBySplitOperation(e)];if(e.graveyardPosition){var _i150=o.start.isEqual(e.graveyardPosition)||o.containsPosition(e.graveyardPosition);t.howMany>1&&_i150&&!n.aWasUndone&&r.push(Gs._createFromPositionAndShift(e.insertionPosition,1));}return Ld(r,i);}),Pd(ac,hc,function(t,e,n){var i=Gs._createFromPositionAndShift(t.sourcePosition,t.howMany);if(e.deletionPosition.hasSameParentAs(t.sourcePosition)&&i.containsPosition(e.sourcePosition))if(\"remove\"!=t.type||n.forceWeakRemove){if(1==t.howMany)return n.bWasUndone?(t.sourcePosition=e.graveyardPosition.clone(),t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t]):[new Cd(0)];}else if(!n.aWasUndone){var _n186=[];var _i151=e.graveyardPosition.clone(),_o68=e.targetPosition._getTransformedByMergeOperation(e);t.howMany>1&&(_n186.push(new ac(t.sourcePosition,t.howMany-1,t.targetPosition,0)),_i151=_i151._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1),_o68=_o68._getTransformedByMove(t.sourcePosition,t.targetPosition,t.howMany-1));var _r30=e.deletionPosition._getCombined(t.sourcePosition,t.targetPosition),_s20=new ac(_i151,1,_r30,0),_a12=_s20.getMovedRangeStart().path.slice();_a12.push(0);var _c6=new $s(_s20.targetPosition.root,_a12);_o68=_o68._getTransformedByMove(_i151,_r30,1);var _l3=new ac(_o68,e.howMany,_c6,0);return _n186.push(_s20),_n186.push(_l3),_n186;}var o=Gs._createFromPositionAndShift(t.sourcePosition,t.howMany)._getTransformedByMergeOperation(e);return t.sourcePosition=o.start,t.howMany=o.end.offset-o.start.offset,t.targetPosition=t.targetPosition._getTransformedByMergeOperation(e),[t];}),Pd(dc,cc,function(t,e){return t.position=t.position._getTransformedByInsertOperation(e),[t];}),Pd(dc,hc,function(t,e){return t.position.isEqual(e.deletionPosition)?(t.position=e.graveyardPosition.clone(),t.position.stickiness=\"toNext\",[t]):(t.position=t.position._getTransformedByMergeOperation(e),[t]);}),Pd(dc,ac,function(t,e){return t.position=t.position._getTransformedByMoveOperation(e),[t];}),Pd(dc,dc,function(t,e,n){if(t.position.isEqual(e.position)){if(!n.aIsStrong)return[new Cd(0)];t.oldName=e.newName;}return[t];}),Pd(dc,fc,function(t,e){if(\"same\"==li(t.position.path,e.splitPosition.getParentPath())&&!e.graveyardPosition){return[t,new dc(t.position.getShiftedBy(1),t.oldName,t.newName,0)];}return t.position=t.position._getTransformedBySplitOperation(e),[t];}),Pd(uc,uc,function(t,e,n){if(t.root===e.root&&t.key===e.key){if(!n.aIsStrong||t.newValue===e.newValue)return[new Cd(0)];t.oldValue=e.newValue;}return[t];}),Pd(fc,cc,function(t,e){return t.splitPosition.hasSameParentAs(e.position)&&t.splitPosition.offset0;}},{key:\"addBatch\",value:function addBatch(t){var e=this.editor.model.document.selection,n={ranges:e.hasOwnRange?Array.from(e.getRanges()):[],isBackward:e.isBackward};this._stack.push({batch:t,selection:n}),this.refresh();}},{key:\"clearStack\",value:function clearStack(){this._stack=[],this.refresh();}},{key:\"_restoreSelection\",value:function _restoreSelection(t,e,n){var i=this.editor.model,o=i.document,r=[];var _iterator258=_createForOfIteratorHelper(t),_step258;try{for(_iterator258.s();!(_step258=_iterator258.n()).done;){var _e192=_step258.value;var _t212=Vd(_e192,n).find(function(t){return t.start.root!=o.graveyard;});_t212&&r.push(_t212);}}catch(err){_iterator258.e(err);}finally{_iterator258.f();}r.length&&i.change(function(t){t.setSelection(r,{backward:e});});}},{key:\"_undo\",value:function _undo(t,e){var n=this.editor.model,i=n.document;this._createdBatches.add(e);var o=t.operations.slice().filter(function(t){return t.isDocumentOperation;});o.reverse();var _iterator259=_createForOfIteratorHelper(o),_step259;try{for(_iterator259.s();!(_step259=_iterator259.n()).done;){var _t213=_step259.value;var _o73=_t213.baseVersion+1,_r33=Array.from(i.history.getOperations(_o73)),_s21=Sd([_t213.getReversed()],_r33,{useRelations:!0,document:this.editor.model.document,padWithNoOps:!1,forceWeakRemove:!0}).operationsA;var _iterator260=_createForOfIteratorHelper(_s21),_step260;try{for(_iterator260.s();!(_step260=_iterator260.n()).done;){var _o74=_step260.value;e.addOperation(_o74),n.applyOperation(_o74),i.history.setOperationAsUndone(_t213,_o74);}}catch(err){_iterator260.e(err);}finally{_iterator260.f();}}}catch(err){_iterator259.e(err);}finally{_iterator259.f();}}}]);return jd;}(Zl);function Vd(t,e){var n=t.getTransformedByOperations(e);n.sort(function(t,e){return t.start.isBefore(e.start)?-1:1;});for(var _t214=1;_t2140&&arguments[0]!==undefined?arguments[0]:null;var e=t?this._stack.findIndex(function(e){return e.batch==t;}):this._stack.length-1,n=this._stack.splice(e,1)[0],i=this.editor.model.createBatch();this.editor.model.enqueueChange(i,function(){_this119._undo(n.batch,i);var t=_this119.editor.model.document.history.getOperations(n.batch.baseVersion);_this119._restoreSelection(n.selection.ranges,n.selection.isBackward,t),_this119.fire(\"revert\",n.batch,i);}),this.refresh();}}]);return Bd;}(jd);var zd=/*#__PURE__*/function(_jd2){_inherits(zd,_jd2);var _super65=_createSuper(zd);function zd(){_classCallCheck(this,zd);return _super65.apply(this,arguments);}_createClass(zd,[{key:\"execute\",value:function execute(){var _this120=this;var t=this._stack.pop(),e=this.editor.model.createBatch();this.editor.model.enqueueChange(e,function(){var n=t.batch.operations[t.batch.operations.length-1].baseVersion+1,i=_this120.editor.model.document.history.getOperations(n);_this120._restoreSelection(t.selection.ranges,t.selection.isBackward,i),_this120._undo(t.batch,e);}),this.refresh();}}]);return zd;}(jd);var Fd=/*#__PURE__*/function(_$l7){_inherits(Fd,_$l7);var _super66=_createSuper(Fd);function Fd(t){var _this121;_classCallCheck(this,Fd);_this121=_super66.call(this,t),_this121._batchRegistry=new WeakSet();return _this121;}_createClass(Fd,[{key:\"init\",value:function init(){var _this122=this;var t=this.editor;this._undoCommand=new Bd(t),this._redoCommand=new zd(t),t.commands.add(\"undo\",this._undoCommand),t.commands.add(\"redo\",this._redoCommand),this.listenTo(t.model,\"applyOperation\",function(t,e){var n=e[0];if(!n.isDocumentOperation)return;var i=n.batch;_this122._batchRegistry.has(i)||\"transparent\"==i.type||(_this122._redoCommand._createdBatches.has(i)?_this122._undoCommand.addBatch(i):_this122._undoCommand._createdBatches.has(i)||(_this122._undoCommand.addBatch(i),_this122._redoCommand.clearStack()),_this122._batchRegistry.add(i));},{priority:\"highest\"}),this.listenTo(this._undoCommand,\"revert\",function(t,e,n){_this122._redoCommand.addBatch(n);}),t.keystrokes.set(\"CTRL+Z\",\"undo\"),t.keystrokes.set(\"CTRL+Y\",\"redo\"),t.keystrokes.set(\"CTRL+SHIFT+Z\",\"redo\");}}]);return Fd;}($l);n(58);var Ud=/*#__PURE__*/function(_Nl7){_inherits(Ud,_Nl7);var _super67=_createSuper(Ud);function Ud(){var _this123;_classCallCheck(this,Ud);_this123=_super67.call(this);var t=_this123.bindTemplate;_this123.set(\"content\",\"\"),_this123.set(\"viewBox\",\"0 0 20 20\"),_this123.set(\"fillColor\",\"\"),_this123.setTemplate({tag:\"svg\",ns:\"http://www.w3.org/2000/svg\",attributes:{\"class\":[\"ck\",\"ck-icon\"],viewBox:t.to(\"viewBox\")}});return _this123;}_createClass(Ud,[{key:\"render\",value:function render(){var _this124=this;_get(_getPrototypeOf(Ud.prototype),\"render\",this).call(this),this._updateXMLContent(),this._colorFillPaths(),this.on(\"change:content\",function(){_this124._updateXMLContent(),_this124._colorFillPaths();}),this.on(\"change:fillColor\",function(){_this124._colorFillPaths();});}},{key:\"_updateXMLContent\",value:function _updateXMLContent(){if(this.content){var _t215=new DOMParser().parseFromString(this.content.trim(),\"image/svg+xml\").querySelector(\"svg\"),_e194=_t215.getAttribute(\"viewBox\");for(_e194&&(this.viewBox=_e194),this.element.innerHTML=\"\";_t215.childNodes.length>0;)this.element.appendChild(_t215.childNodes[0]);}}},{key:\"_colorFillPaths\",value:function _colorFillPaths(){var _this125=this;this.fillColor&&this.element.querySelectorAll(\".ck-icon__fill\").forEach(function(t){t.style.fill=_this125.fillColor;});}}]);return Ud;}(Nl);n(60);var Hd=/*#__PURE__*/function(_Nl8){_inherits(Hd,_Nl8);var _super68=_createSuper(Hd);function Hd(t){var _this126;_classCallCheck(this,Hd);_this126=_super68.call(this,t),_this126.set(\"text\",\"\"),_this126.set(\"position\",\"s\");var e=_this126.bindTemplate;_this126.setTemplate({tag:\"span\",attributes:{\"class\":[\"ck\",\"ck-tooltip\",e.to(\"position\",function(t){return\"ck-tooltip_\"+t;}),e[\"if\"](\"text\",\"ck-hidden\",function(t){return!t.trim();})]},children:[{tag:\"span\",attributes:{\"class\":[\"ck\",\"ck-tooltip__text\"]},children:[{text:e.to(\"text\")}]}]});return _this126;}return _createClass(Hd);}(Nl);n(62);var qd=/*#__PURE__*/function(_Nl9){_inherits(qd,_Nl9);var _super69=_createSuper(qd);function qd(t){var _this127;_classCallCheck(this,qd);_this127=_super69.call(this,t);var e=_this127.bindTemplate,n=Kn();_this127.set(\"class\"),_this127.set(\"labelStyle\"),_this127.set(\"icon\"),_this127.set(\"isEnabled\",!0),_this127.set(\"isOn\",!1),_this127.set(\"isVisible\",!0),_this127.set(\"keystroke\"),_this127.set(\"label\"),_this127.set(\"tabindex\",-1),_this127.set(\"tooltip\"),_this127.set(\"tooltipPosition\",\"s\"),_this127.set(\"type\",\"button\"),_this127.set(\"withText\",!1),_this127.children=_this127.createCollection(),_this127.tooltipView=_this127._createTooltipView(),_this127.labelView=_this127._createLabelView(n),_this127.iconView=new Ud(),_this127.iconView.extendTemplate({attributes:{\"class\":\"ck-button__icon\"}}),_this127.bind(\"_tooltipString\").to(_assertThisInitialized(_this127),\"tooltip\",_assertThisInitialized(_this127),\"label\",_assertThisInitialized(_this127),\"keystroke\",_this127._getTooltipString.bind(_assertThisInitialized(_this127))),_this127.setTemplate({tag:\"button\",attributes:{\"class\":[\"ck\",\"ck-button\",e.to(\"class\"),e[\"if\"](\"isEnabled\",\"ck-disabled\",function(t){return!t;}),e[\"if\"](\"isVisible\",\"ck-hidden\",function(t){return!t;}),e.to(\"isOn\",function(t){return t?\"ck-on\":\"ck-off\";}),e[\"if\"](\"withText\",\"ck-button_with-text\")],type:e.to(\"type\",function(t){return t||\"button\";}),tabindex:e.to(\"tabindex\"),\"aria-labelledby\":\"ck-editor__aria-label_\".concat(n),\"aria-disabled\":e[\"if\"](\"isEnabled\",!0,function(t){return!t;}),\"aria-pressed\":e[\"if\"](\"isOn\",!0)},children:_this127.children,on:{mousedown:e.to(function(t){t.preventDefault();}),click:e.to(function(t){_this127.isEnabled?_this127.fire(\"execute\"):t.preventDefault();})}});return _this127;}_createClass(qd,[{key:\"render\",value:function render(){_get(_getPrototypeOf(qd.prototype),\"render\",this).call(this),this.icon&&(this.iconView.bind(\"content\").to(this,\"icon\"),this.children.add(this.iconView)),this.children.add(this.tooltipView),this.children.add(this.labelView);}},{key:\"focus\",value:function focus(){this.element.focus();}},{key:\"_createTooltipView\",value:function _createTooltipView(){var t=new Hd();return t.bind(\"text\").to(this,\"_tooltipString\"),t.bind(\"position\").to(this,\"tooltipPosition\"),t;}},{key:\"_createLabelView\",value:function _createLabelView(t){var e=new Nl(),n=this.bindTemplate;return e.setTemplate({tag:\"span\",attributes:{\"class\":[\"ck\",\"ck-button__label\"],style:n.to(\"labelStyle\"),id:\"ck-editor__aria-label_\".concat(t)},children:[{text:this.bindTemplate.to(\"label\")}]}),e;}},{key:\"_getTooltipString\",value:function _getTooltipString(t,e,n){return t?\"string\"==typeof t?t:(n&&(n=function(t){return mo.isMac?ko(t).map(function(t){return go[t.toLowerCase()]||t;}).reduce(function(t,e){return t.slice(-1)in po?t+e:t+\"+\"+e;}):t;}(n)),t instanceof Function?t(e,n):\"\".concat(e).concat(n?\" (\".concat(n,\")\"):\"\")):\"\";}}]);return qd;}(Nl);var Wd=n(20),Yd=n.n(Wd),$d=n(21),Gd=n.n($d);var Qd=/*#__PURE__*/function(_$l8){_inherits(Qd,_$l8);var _super70=_createSuper(Qd);function Qd(){_classCallCheck(this,Qd);return _super70.apply(this,arguments);}_createClass(Qd,[{key:\"init\",value:function init(){var t=this.editor.t;this._addButton(\"undo\",t(\"ba\"),\"CTRL+Z\",Yd.a),this._addButton(\"redo\",t(\"bb\"),\"CTRL+Y\",Gd.a);}},{key:\"_addButton\",value:function _addButton(t,e,n,i){var _this128=this;var o=this.editor;o.ui.componentFactory.add(t,function(r){var s=o.commands.get(t),a=new qd(r);return a.set({label:e,icon:i,keystroke:n,tooltip:!0}),a.bind(\"isEnabled\").to(s,\"isEnabled\"),_this128.listenTo(a,\"execute\",function(){return o.execute(t);}),a;});}}]);return Qd;}($l);var Jd=/*#__PURE__*/function(_$l9){_inherits(Jd,_$l9);var _super71=_createSuper(Jd);function Jd(){_classCallCheck(this,Jd);return _super71.apply(this,arguments);}_createClass(Jd,null,[{key:\"requires\",get:function get(){return[Fd,Qd];}},{key:\"pluginName\",get:function get(){return\"Undo\";}}]);return Jd;}($l);var Kd=/*#__PURE__*/function(_$l10,_Symbol$iterator13){_inherits(Kd,_$l10);var _super72=_createSuper(Kd);function Kd(){_classCallCheck(this,Kd);return _super72.apply(this,arguments);}_createClass(Kd,[{key:\"init\",value:function init(){this.set(\"hasAny\",!1),this._actions=new oo({idProperty:\"_id\"}),this._actions.delegate(\"add\",\"remove\").to(this);}},{key:\"add\",value:function add(t){if(\"string\"!=typeof t)throw new Gn.b(\"pendingactions-add-invalid-message: The message must be a string.\");var e=Object.create(Fi);return e.set(\"message\",t),this._actions.add(e),this.hasAny=!0,e;}},{key:\"remove\",value:function remove(t){this._actions.remove(t),this.hasAny=!!this._actions.length;}},{key:\"first\",get:function get(){return this._actions.get(0);}},{key:_Symbol$iterator13,value:function value(){return this._actions[Symbol.iterator]();}}],[{key:\"pluginName\",get:function get(){return\"PendingActions\";}}]);return Kd;}($l,Symbol.iterator);var Zd=/*#__PURE__*/function(){function Zd(){var _this129=this;_classCallCheck(this,Zd);var t=new window.FileReader();this._reader=t,this.set(\"loaded\",0),t.onprogress=function(t){_this129.loaded=t.loaded;};}_createClass(Zd,[{key:\"error\",get:function get(){return this._reader.error;}},{key:\"read\",value:function read(t){var _this130=this;var e=this._reader;return this.total=t.size,new Promise(function(n,i){e.onload=function(){n(e.result);},e.onerror=function(){i(\"error\");},e.onabort=function(){i(\"aborted\");},_this130._reader.readAsDataURL(t);});}},{key:\"abort\",value:function abort(){this._reader.abort();}}]);return Zd;}();ci(Zd,Fi);var Xd=/*#__PURE__*/function(_$l11){_inherits(Xd,_$l11);var _super73=_createSuper(Xd);function Xd(){_classCallCheck(this,Xd);return _super73.apply(this,arguments);}_createClass(Xd,[{key:\"init\",value:function init(){var _this131=this;this.loaders=new oo(),this.loaders.on(\"add\",function(){return _this131._updatePendingAction();}),this.loaders.on(\"remove\",function(){return _this131._updatePendingAction();}),this._loadersMap=new Map(),this._pendingAction=null,this.set(\"uploaded\",0),this.set(\"uploadTotal\",null),this.bind(\"uploadedPercent\").to(this,\"uploaded\",this,\"uploadTotal\",function(t,e){return e?t/e*100:0;});}},{key:\"getLoader\",value:function getLoader(t){return this._loadersMap.get(t)||null;}},{key:\"createLoader\",value:function createLoader(t){var _this132=this;if(!this.createUploadAdapter)return bs.a.error(\"filerepository-no-upload-adapter: Upload adapter is not defined.\"),null;var e=new tu(Promise.resolve(t),this.createUploadAdapter);return this.loaders.add(e),this._loadersMap.set(t,e),t instanceof Promise&&e.file.then(function(t){_this132._loadersMap.set(t,e);}),e.file[\"catch\"](function(){}),e.on(\"change:uploaded\",function(){var t=0;var _iterator261=_createForOfIteratorHelper(_this132.loaders),_step261;try{for(_iterator261.s();!(_step261=_iterator261.n()).done;){var _e195=_step261.value;t+=_e195.uploaded;}}catch(err){_iterator261.e(err);}finally{_iterator261.f();}_this132.uploaded=t;}),e.on(\"change:uploadTotal\",function(){var t=0;var _iterator262=_createForOfIteratorHelper(_this132.loaders),_step262;try{for(_iterator262.s();!(_step262=_iterator262.n()).done;){var _e196=_step262.value;_e196.uploadTotal&&(t+=_e196.uploadTotal);}}catch(err){_iterator262.e(err);}finally{_iterator262.f();}_this132.uploadTotal=t;}),e;}},{key:\"destroyLoader\",value:function destroyLoader(t){var _this133=this;var e=t instanceof tu?t:this.getLoader(t);e._destroy(),this.loaders.remove(e),this._loadersMap.forEach(function(t,n){t===e&&_this133._loadersMap[\"delete\"](n);});}},{key:\"_updatePendingAction\",value:function _updatePendingAction(){var t=this.editor.plugins.get(Kd);if(this.loaders.length){if(!this._pendingAction){var _e197=this.editor.t,_n192=function _n192(t){return\"\".concat(_e197(\"ap\"),\" \").concat(parseInt(t),\"%.\");};this._pendingAction=t.add(_n192(this.uploadedPercent)),this._pendingAction.bind(\"message\").to(this,\"uploadedPercent\",_n192);}}else t.remove(this._pendingAction),this._pendingAction=null;}}],[{key:\"pluginName\",get:function get(){return\"FileRepository\";}},{key:\"requires\",get:function get(){return[Kd];}}]);return Xd;}($l);ci(Xd,Fi);var tu=/*#__PURE__*/function(){function tu(t,e){_classCallCheck(this,tu);this.id=Kn(),this._filePromiseWrapper=this._createFilePromiseWrapper(t),this._adapter=e(this),this._reader=new Zd(),this.set(\"status\",\"idle\"),this.set(\"uploaded\",0),this.set(\"uploadTotal\",null),this.bind(\"uploadedPercent\").to(this,\"uploaded\",this,\"uploadTotal\",function(t,e){return e?t/e*100:0;}),this.set(\"uploadResponse\",null);}_createClass(tu,[{key:\"file\",get:function get(){var _this134=this;return this._filePromiseWrapper?this._filePromiseWrapper.promise.then(function(t){return _this134._filePromiseWrapper?t:null;}):Promise.resolve(null);}},{key:\"read\",value:function read(){var _this135=this;if(\"idle\"!=this.status)throw new Gn.b(\"filerepository-read-wrong-status: You cannot call read if the status is different than idle.\");return this.status=\"reading\",this._filePromiseWrapper.promise.then(function(t){return _this135._reader.read(t);}).then(function(t){return _this135.status=\"idle\",t;})[\"catch\"](function(t){if(\"aborted\"===t)throw _this135.status=\"aborted\",\"aborted\";throw _this135.status=\"error\",_this135._reader.error?_this135._reader.error:t;});}},{key:\"upload\",value:function upload(){var _this136=this;if(\"idle\"!=this.status)throw new Gn.b(\"filerepository-upload-wrong-status: You cannot call upload if the status is different than idle.\");return this.status=\"uploading\",this._filePromiseWrapper.promise.then(function(){return _this136._adapter.upload();}).then(function(t){return _this136.uploadResponse=t,_this136.status=\"idle\",t;})[\"catch\"](function(t){if(\"aborted\"===_this136.status)throw\"aborted\";throw _this136.status=\"error\",t;});}},{key:\"abort\",value:function abort(){var t=this.status;this.status=\"aborted\",this._filePromiseWrapper.isFulfilled?\"reading\"==t?this._reader.abort():\"uploading\"==t&&this._adapter.abort&&this._adapter.abort():this._filePromiseWrapper.rejecter(\"aborted\"),this._destroy();}},{key:\"_destroy\",value:function _destroy(){this._filePromiseWrapper=void 0,this._reader=void 0,this._adapter=void 0,this.data=void 0,this.uploadResponse=void 0;}},{key:\"_createFilePromiseWrapper\",value:function _createFilePromiseWrapper(t){var e={};return e.promise=new Promise(function(n,i){e.resolver=n,e.rejecter=i,e.isFulfilled=!1,t.then(function(t){e.isFulfilled=!0,n(t);})[\"catch\"](function(t){e.isFulfilled=!0,i(t);});}),e;}}]);return tu;}();ci(tu,Fi);var eu=\"ckCsrfToken\",nu=40,iu=\"abcdefghijklmnopqrstuvwxyz0123456789\";function ou(){var t=function(t){t=t.toLowerCase();var e=document.cookie.split(\";\");var _iterator263=_createForOfIteratorHelper(e),_step263;try{for(_iterator263.s();!(_step263=_iterator263.n()).done;){var _n193=_step263.value;var _e198=_n193.split(\"=\"),_i157=decodeURIComponent(_e198[0].trim().toLowerCase());if(_i157===t)return decodeURIComponent(_e198[1]);}}catch(err){_iterator263.e(err);}finally{_iterator263.f();}return null;}(eu);return t&&t.length==nu||(t=function(t){var e=\"\";var n=new Uint8Array(t);window.crypto.getRandomValues(n);for(var _t216=0;_t216.5?_i158.toUpperCase():_i158;}return e;}(nu),function(t,e){document.cookie=encodeURIComponent(t)+\"=\"+encodeURIComponent(e)+\";path=/\";}(eu,t)),t;}var ru=/*#__PURE__*/function(_$l12){_inherits(ru,_$l12);var _super74=_createSuper(ru);function ru(){_classCallCheck(this,ru);return _super74.apply(this,arguments);}_createClass(ru,[{key:\"init\",value:function init(){var _this137=this;var t=this.editor.config.get(\"ckfinder.uploadUrl\");t&&(this.editor.plugins.get(Xd).createUploadAdapter=function(e){return new su(e,t,_this137.editor.t);});}}],[{key:\"requires\",get:function get(){return[Xd];}},{key:\"pluginName\",get:function get(){return\"CKFinderUploadAdapter\";}}]);return ru;}($l);var su=/*#__PURE__*/function(){function su(t,e,n){_classCallCheck(this,su);this.loader=t,this.url=e,this.t=n;}_createClass(su,[{key:\"upload\",value:function upload(){var _this138=this;return this.loader.file.then(function(t){return new Promise(function(e,n){_this138._initRequest(),_this138._initListeners(e,n,t),_this138._sendRequest(t);});});}},{key:\"abort\",value:function abort(){this.xhr&&this.xhr.abort();}},{key:\"_initRequest\",value:function _initRequest(){var t=this.xhr=new XMLHttpRequest();t.open(\"POST\",this.url,!0),t.responseType=\"json\";}},{key:\"_initListeners\",value:function _initListeners(t,e,n){var i=this.xhr,o=this.loader,r=(0,this.t)(\"a\")+\" \".concat(n.name,\".\");i.addEventListener(\"error\",function(){return e(r);}),i.addEventListener(\"abort\",function(){return e();}),i.addEventListener(\"load\",function(){var n=i.response;if(!n||!n.uploaded)return e(n&&n.error&&n.error.message?n.error.message:r);t({\"default\":n.url});}),i.upload&&i.upload.addEventListener(\"progress\",function(t){t.lengthComputable&&(o.uploadTotal=t.total,o.uploaded=t.loaded);});}},{key:\"_sendRequest\",value:function _sendRequest(t){var e=new FormData();e.append(\"upload\",t),e.append(\"ckCsrfToken\",ou()),this.xhr.send(e);}}]);return su;}();var au=/*#__PURE__*/_createClass(function au(t,e,n){_classCallCheck(this,au);var i,o=null;\"function\"==typeof n?i=n:(o=t.commands.get(n),i=function i(){t.execute(n);}),t.model.document.on(\"change\",function(n,r){if(o&&!o.isEnabled)return;if(\"transparent\"==r.type)return;var s=Array.from(t.model.document.differ.getChanges()),a=s[0];if(1!=s.length||\"insert\"!==a.type||\"$text\"!=a.name||1!=a.length)return;var c=a.position.textNode||a.position.nodeAfter;if(!c.parent.is(\"paragraph\"))return;var l=e.exec(c.data);l&&t.model.enqueueChange(function(t){var e=t.createPositionAt(c.parent,0),n=t.createPositionAt(c.parent,l[0].length),o=new oa(e,n);!1!==i({match:l})&&t.remove(o),o.detach();});});});var cu=/*#__PURE__*/_createClass(function cu(t,e,n){_classCallCheck(this,cu);var i,o,r,s;e instanceof RegExp?i=e:r=e,\"string\"==typeof n?o=n:s=n,r=r||function(t){var e;var n=[],o=[];for(;null!==(e=i.exec(t))&&!(e&&e.length<4);){var _e199=e,_t217=_e199.index,_i159=_e199[1],_r34=_e199[2],_s22=_e199[3];var _a13=_i159+_r34+_s22,_c7=[_t217+=e[0].length-_a13.length,_t217+_i159.length],_l4=[_t217+_i159.length+_r34.length,_t217+_i159.length+_r34.length+_s22.length];n.push(_c7),n.push(_l4),o.push([_t217+_i159.length,_t217+_i159.length+_r34.length]);}return{remove:n,format:o};},s=s||function(e,n){var i=t.model.schema.getValidRanges(n,o);var _iterator264=_createForOfIteratorHelper(i),_step264;try{for(_iterator264.s();!(_step264=_iterator264.n()).done;){var _t218=_step264.value;e.setAttribute(o,!0,_t218);}}catch(err){_iterator264.e(err);}finally{_iterator264.f();}e.removeSelectionAttribute(o);},t.model.document.on(\"change\",function(e,n){if(\"transparent\"==n.type)return;var i=t.model.document.selection;if(!i.isCollapsed)return;var o=Array.from(t.model.document.differ.getChanges()),a=o[0];if(1!=o.length||\"insert\"!==a.type||\"$text\"!=a.name||1!=a.length)return;var c=i.focus.parent,l=function(t){return Array.from(t.getChildren()).reduce(function(t,e){return t+e.data;},\"\");}(c).slice(0,i.focus.offset),d=r(l),u=lu(c,d.format,t.model),h=lu(c,d.remove,t.model);u.length&&h.length&&t.model.enqueueChange(function(t){if(!1!==s(t,u)){var _iterator265=_createForOfIteratorHelper(h.reverse()),_step265;try{for(_iterator265.s();!(_step265=_iterator265.n()).done;){var _e200=_step265.value;t.remove(_e200);}}catch(err){_iterator265.e(err);}finally{_iterator265.f();}}});});});function lu(t,e,n){return e.filter(function(t){return void 0!==t[0]&&void 0!==t[1];}).map(function(e){return n.createRange(n.createPositionAt(t,e[0]),n.createPositionAt(t,e[1]));});}function du(t,e){return function(n,i){if(!t.commands.get(e).isEnabled)return!1;var o=t.model.schema.getValidRanges(i,e);var _iterator266=_createForOfIteratorHelper(o),_step266;try{for(_iterator266.s();!(_step266=_iterator266.n()).done;){var _t219=_step266.value;n.setAttribute(e,!0,_t219);}}catch(err){_iterator266.e(err);}finally{_iterator266.f();}n.removeSelectionAttribute(e);};}var uu=/*#__PURE__*/function(_Zl6){_inherits(uu,_Zl6);var _super75=_createSuper(uu);function uu(t,e){var _this139;_classCallCheck(this,uu);_this139=_super75.call(this,t),_this139.attributeKey=e;return _this139;}_createClass(uu,[{key:\"refresh\",value:function refresh(){var t=this.editor.model,e=t.document;this.value=this._getValueFromFirstAllowedNode(),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,this.attributeKey);}},{key:\"execute\",value:function execute(){var _this140=this;var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=this.editor.model,n=e.document.selection,i=void 0===t.forceValue?!this.value:t.forceValue;e.change(function(t){if(n.isCollapsed)i?t.setSelectionAttribute(_this140.attributeKey,!0):t.removeSelectionAttribute(_this140.attributeKey);else{var _o75=e.schema.getValidRanges(n.getRanges(),_this140.attributeKey);var _iterator267=_createForOfIteratorHelper(_o75),_step267;try{for(_iterator267.s();!(_step267=_iterator267.n()).done;){var _e201=_step267.value;i?t.setAttribute(_this140.attributeKey,i,_e201):t.removeAttribute(_this140.attributeKey,_e201);}}catch(err){_iterator267.e(err);}finally{_iterator267.f();}}});}},{key:\"_getValueFromFirstAllowedNode\",value:function _getValueFromFirstAllowedNode(){var t=this.editor.model,e=t.schema,n=t.document.selection;if(n.isCollapsed)return n.hasAttribute(this.attributeKey);var _iterator268=_createForOfIteratorHelper(n.getRanges()),_step268;try{for(_iterator268.s();!(_step268=_iterator268.n()).done;){var _t220=_step268.value;var _iterator269=_createForOfIteratorHelper(_t220.getItems()),_step269;try{for(_iterator269.s();!(_step269=_iterator269.n()).done;){var _n194=_step269.value;if(e.checkAttribute(_n194,this.attributeKey))return _n194.hasAttribute(this.attributeKey);}}catch(err){_iterator269.e(err);}finally{_iterator269.f();}}}catch(err){_iterator268.e(err);}finally{_iterator268.f();}return!1;}}]);return uu;}(Zl);var hu=\"bold\";var fu=/*#__PURE__*/function(_$l13){_inherits(fu,_$l13);var _super76=_createSuper(fu);function fu(){_classCallCheck(this,fu);return _super76.apply(this,arguments);}_createClass(fu,[{key:\"init\",value:function init(){var t=this.editor;t.model.schema.extend(\"$text\",{allowAttributes:hu}),t.conversion.attributeToElement({model:hu,view:\"strong\",upcastAlso:[\"b\",{styles:{\"font-weight\":\"bold\"}}]}),t.commands.add(hu,new uu(t,hu)),t.keystrokes.set(\"CTRL+B\",hu);}}]);return fu;}($l);var mu=n(22),pu=n.n(mu);var gu=\"bold\";var bu=/*#__PURE__*/function(_$l14){_inherits(bu,_$l14);var _super77=_createSuper(bu);function bu(){_classCallCheck(this,bu);return _super77.apply(this,arguments);}_createClass(bu,[{key:\"init\",value:function init(){var _this141=this;var t=this.editor,e=t.t;t.ui.componentFactory.add(gu,function(n){var i=t.commands.get(gu),o=new qd(n);return o.set({label:e(\"b\"),icon:pu.a,keystroke:\"CTRL+B\",tooltip:!0}),o.bind(\"isOn\",\"isEnabled\").to(i,\"value\",\"isEnabled\"),_this141.listenTo(o,\"execute\",function(){return t.execute(gu);}),o;});}}]);return bu;}($l);var wu=\"italic\";var _u=/*#__PURE__*/function(_$l15){_inherits(_u,_$l15);var _super78=_createSuper(_u);function _u(){_classCallCheck(this,_u);return _super78.apply(this,arguments);}_createClass(_u,[{key:\"init\",value:function init(){var t=this.editor;t.model.schema.extend(\"$text\",{allowAttributes:wu}),t.conversion.attributeToElement({model:wu,view:\"i\",upcastAlso:[\"em\",{styles:{\"font-style\":\"italic\"}}]}),t.commands.add(wu,new uu(t,wu)),t.keystrokes.set(\"CTRL+I\",wu);}}]);return _u;}($l);var ku=n(23),vu=n.n(ku);var yu=\"italic\";var xu=/*#__PURE__*/function(_$l16){_inherits(xu,_$l16);var _super79=_createSuper(xu);function xu(){_classCallCheck(this,xu);return _super79.apply(this,arguments);}_createClass(xu,[{key:\"init\",value:function init(){var _this142=this;var t=this.editor,e=t.t;t.ui.componentFactory.add(yu,function(n){var i=t.commands.get(yu),o=new qd(n);return o.set({label:e(\"d\"),icon:vu.a,keystroke:\"CTRL+I\",tooltip:!0}),o.bind(\"isOn\",\"isEnabled\").to(i,\"value\",\"isEnabled\"),_this142.listenTo(o,\"execute\",function(){return t.execute(yu);}),o;});}}]);return xu;}($l);function Au(t){var e=t.next();return e.done?null:e.value;}var Cu=/*#__PURE__*/function(_Zl7){_inherits(Cu,_Zl7);var _super80=_createSuper(Cu);function Cu(){_classCallCheck(this,Cu);return _super80.apply(this,arguments);}_createClass(Cu,[{key:\"refresh\",value:function refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled();}},{key:\"execute\",value:function execute(){var _this143=this;var t=this.editor.model,e=t.schema,n=t.document.selection,i=Array.from(n.getTopMostBlocks());t.change(function(t){if(_this143.value)_this143._removeQuote(t,i.filter(Tu));else{var _n195=i.filter(function(t){return Tu(t)||Mu(e,t);});_this143._applyQuote(t,_n195);}});}},{key:\"_getValue\",value:function _getValue(){var t=Au(this.editor.model.document.selection.getTopMostBlocks());return!(!t||!Tu(t));}},{key:\"_checkEnabled\",value:function _checkEnabled(){if(this.value)return!0;var t=this.editor.model.document.selection,e=this.editor.model.schema,n=Au(t.getSelectedBlocks());return!!n&&Mu(e,n);}},{key:\"_removeQuote\",value:function _removeQuote(t,e){Pu(t,e).reverse().forEach(function(e){if(e.start.isAtStart&&e.end.isAtEnd)return void t.unwrap(e.start.parent);if(e.start.isAtStart){var _n196=t.createPositionBefore(e.start.parent);return void t.move(e,_n196);}e.end.isAtEnd||t.split(e.end);var n=t.createPositionAfter(e.end.parent);t.move(e,n);});}},{key:\"_applyQuote\",value:function _applyQuote(t,e){var n=[];Pu(t,e).reverse().forEach(function(e){var i=Tu(e.start);i||(i=t.createElement(\"blockQuote\"),t.wrap(e,i)),n.push(i);}),n.reverse().reduce(function(e,n){return e.nextSibling==n?(t.merge(t.createPositionAfter(e)),e):n;});}}]);return Cu;}(Zl);function Tu(t){return\"blockQuote\"==t.parent.name?t.parent:null;}function Pu(t,e){var n,i=0;var o=[];for(;i1&&arguments[1]!==undefined?arguments[1]:{};this._showNotification({message:t,type:\"success\",namespace:e.namespace,title:e.title});}},{key:\"showInfo\",value:function showInfo(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._showNotification({message:t,type:\"info\",namespace:e.namespace,title:e.title});}},{key:\"showWarning\",value:function showWarning(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};this._showNotification({message:t,type:\"warning\",namespace:e.namespace,title:e.title});}},{key:\"_showNotification\",value:function _showNotification(t){var e=\"show:\".concat(t.type)+(t.namespace?\":\".concat(t.namespace):\"\");this.fire(e,{message:t.message,type:t.type,title:t.title||\"\"});}}],[{key:\"pluginName\",get:function get(){return\"Notification\";}}]);return Lu;}($l);var ju=/*#__PURE__*/function(_Zl8){_inherits(ju,_Zl8);var _super85=_createSuper(ju);function ju(t){var _this146;_classCallCheck(this,ju);_this146=_super85.call(this,t),_this146.stopListening(_this146.editor.model.document,\"change\"),_this146.listenTo(_this146.editor.model.document,\"change\",function(){return _this146.refresh();},{priority:\"low\"});return _this146;}_createClass(ju,[{key:\"refresh\",value:function refresh(){var t=this.editor.commands.get(\"imageUpload\"),e=this.editor.commands.get(\"link\");this.isEnabled=t&&e&&(t.isEnabled||e.isEnabled);}},{key:\"execute\",value:function execute(){var t=this.editor,e=this.editor.config.get(\"ckfinder.openerMethod\")||\"modal\";if(\"popup\"!=e&&\"modal\"!=e)throw new Gn.b('ckfinder-unknown-openerMethod: The openerMethod config option must by \"popup\" or \"modal\".');var n=this.editor.config.get(\"ckfinder.options\")||{};n.chooseFiles=!0;var i=n.onInit;n.language||(n.language=t.locale.language),n.onInit=function(e){i&&i(),e.on(\"files:choose\",function(n){var i=n.data.files.toArray(),o=i.filter(function(t){return!t.isImage();}),r=i.filter(function(t){return t.isImage();});var _iterator272=_createForOfIteratorHelper(o),_step272;try{for(_iterator272.s();!(_step272=_iterator272.n()).done;){var _e203=_step272.value;t.execute(\"link\",_e203.getUrl());}}catch(err){_iterator272.e(err);}finally{_iterator272.f();}var s=[];var _iterator273=_createForOfIteratorHelper(r),_step273;try{for(_iterator273.s();!(_step273=_iterator273.n()).done;){var _t223=_step273.value;var _n197=_t223.getUrl();s.push(_n197||e.request(\"file:getProxyUrl\",{file:_t223}));}}catch(err){_iterator273.e(err);}finally{_iterator273.f();}s.length&&Vu(t,s);}),e.on(\"file:choose:resizedImage\",function(e){var n=e.data.resizedUrl;if(n)Vu(t,[n]);else{var _e204=t.plugins.get(\"Notification\"),_n198=t.locale.t;_e204.showWarning(_n198(\"be\"),{title:_n198(\"bf\"),namespace:\"ckfinder\"});}});},window.CKFinder[e](n);}}]);return ju;}(Zl);function Vu(t,e){if(t.commands.get(\"imageUpload\").isEnabled)t.execute(\"imageInsert\",{source:e});else{var _e205=t.plugins.get(\"Notification\"),_n199=t.locale.t;_e205.showWarning(_n199(\"bg\"),{title:_n199(\"bh\"),namespace:\"ckfinder\"});}}var Bu=/*#__PURE__*/function(_$l21){_inherits(Bu,_$l21);var _super86=_createSuper(Bu);function Bu(){_classCallCheck(this,Bu);return _super86.apply(this,arguments);}_createClass(Bu,[{key:\"init\",value:function init(){var t=this.editor;t.commands.add(\"ckfinder\",new ju(t));}}],[{key:\"pluginName\",get:function get(){return\"CKFinderEditing\";}},{key:\"requires\",get:function get(){return[Lu];}}]);return Bu;}($l);var zu=/^data:(\\S*?);base64,/;var Fu=/*#__PURE__*/function(){function Fu(t,e,n){_classCallCheck(this,Fu);if(!t)throw new Error(\"File must be provided\");if(!e)throw new Error(\"Token must be provided\");if(!n)throw new Error(\"Api address must be provided\");this.file=function(t){if(\"string\"!=typeof t)return!1;var e=t.match(zu);return!(!e||!e.length);}(t)?function(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:512;try{var _n200=t.match(zu)[1],_i162=atob(t.replace(zu,\"\")),_o76=[];for(var _t224=0;_t224<_i162.length;_t224+=e){var _n201=_i162.slice(_t224,_t224+e),_r36=new Array(_n201.length);for(var _t225=0;_t225<_n201.length;_t225++)_r36[_t225]=_n201.charCodeAt(_t225);_o76.push(new Uint8Array(_r36));}return new Blob(_o76,{type:_n200});}catch(t){throw new Error(\"Problem with decoding Base64 image data.\");}}(t):t,this._token=e,this._apiAddress=n;}_createClass(Fu,[{key:\"onProgress\",value:function onProgress(t){return this.on(\"progress\",function(e,n){return t(n);}),this;}},{key:\"onError\",value:function onError(t){return this.once(\"error\",function(e,n){return t(n);}),this;}},{key:\"abort\",value:function abort(){this.xhr.abort();}},{key:\"send\",value:function send(){return this._prepareRequest(),this._attachXHRListeners(),this._sendRequest();}},{key:\"_prepareRequest\",value:function _prepareRequest(){var t=new XMLHttpRequest();t.open(\"POST\",this._apiAddress),t.setRequestHeader(\"Authorization\",this._token.value),t.responseType=\"json\",this.xhr=t;}},{key:\"_attachXHRListeners\",value:function _attachXHRListeners(){var _this147=this;var t=this,e=this.xhr;function n(e){return function(){return t.fire(\"error\",e);};}e.addEventListener(\"error\",n(\"Network Error\")),e.addEventListener(\"abort\",n(\"Abort\")),e.upload&&e.upload.addEventListener(\"progress\",function(t){t.lengthComputable&&_this147.fire(\"progress\",{total:t.total,uploaded:t.loaded});}),e.addEventListener(\"load\",function(){var t=e.status,n=e.response;if(t<200||t>299)return _this147.fire(\"error\",n.message||n.error);});}},{key:\"_sendRequest\",value:function _sendRequest(){var t=new FormData(),e=this.xhr;return t.append(\"file\",this.file),new Promise(function(n,i){e.addEventListener(\"load\",function(){var t=e.status,o=e.response;return t<200||t>299?o.message?i(new Error(o.message)):i(o.error):n(o);}),e.addEventListener(\"error\",function(){return i(new Error(\"Network Error\"));}),e.addEventListener(\"abort\",function(){return i(new Error(\"Abort\"));}),e.send(t);});}}]);return Fu;}();ci(Fu,ei);var Uu=Fu;var Hu={refreshInterval:36e5,autoRefresh:!0};var qu=/*#__PURE__*/function(){function qu(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Hu;_classCallCheck(this,qu);if(!t)throw new Error(\"A `tokenUrl` must be provided as the first constructor argument.\");this.set(\"value\",e.initValue),this._refresh=\"function\"==typeof t?t:function(){return function(t){return new Promise(function(e,n){var i=new XMLHttpRequest();i.open(\"GET\",t),i.addEventListener(\"load\",function(){var t=i.status,o=i.response;return t<200||t>299?n(new Error(\"Cannot download new token!\")):e(o);}),i.addEventListener(\"error\",function(){return n(new Error(\"Network Error\"));}),i.addEventListener(\"abort\",function(){return n(new Error(\"Abort\"));}),i.send();});}(t);},this._options=Object.assign({},Hu,e);}_createClass(qu,[{key:\"init\",value:function init(){var _this148=this;return new Promise(function(t,e){_this148._options.autoRefresh&&_this148._startRefreshing(),_this148.value?t(_this148):_this148._refreshToken().then(t)[\"catch\"](e);});}},{key:\"_refreshToken\",value:function _refreshToken(){var _this149=this;return this._refresh().then(function(t){return _this149.set(\"value\",t);}).then(function(){return _this149;});}},{key:\"destroy\",value:function destroy(){this._stopRefreshing();}},{key:\"_startRefreshing\",value:function _startRefreshing(){var _this150=this;this._refreshInterval=setInterval(function(){return _this150._refreshToken();},this._options.refreshInterval);}},{key:\"_stopRefreshing\",value:function _stopRefreshing(){clearInterval(this._refreshInterval);}}],[{key:\"create\",value:function create(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Hu;return new qu(t,e).init();}}]);return qu;}();ci(qu,Fi);var Wu=qu;var Yu=/*#__PURE__*/function(_$l22){_inherits(Yu,_$l22);var _super87=_createSuper(Yu);function Yu(){_classCallCheck(this,Yu);return _super87.apply(this,arguments);}_createClass(Yu,[{key:\"init\",value:function init(){var t=this.editor.config.get(\"cloudServices\")||{};for(var _e206 in t)this[_e206]=t[_e206];if(this.tokenUrl)return this.token=new Yu.Token(this.tokenUrl),this.token.init();this.token=null;}}],[{key:\"pluginName\",get:function get(){return\"CloudServices\";}}]);return Yu;}($l);Yu.Token=Wu;var $u=/*#__PURE__*/function(_$l23){_inherits($u,_$l23);var _super88=_createSuper($u);function $u(){_classCallCheck(this,$u);return _super88.apply(this,arguments);}_createClass($u,[{key:\"init\",value:function init(){var _this151=this;var t=this.editor,e=t.plugins.get(Yu),n=e.token,i=e.uploadUrl;n&&(this._uploadGateway=new $u._UploadGateway(n,i),t.plugins.get(Xd).createUploadAdapter=function(t){return new Gu(_this151._uploadGateway,t);});}}],[{key:\"requires\",get:function get(){return[Xd,Yu];}}]);return $u;}($l);var Gu=/*#__PURE__*/function(){function Gu(t,e){_classCallCheck(this,Gu);this.uploadGateway=t,this.loader=e;}_createClass(Gu,[{key:\"upload\",value:function upload(){var _this152=this;return this.loader.file.then(function(t){return _this152.fileUploader=_this152.uploadGateway.upload(t),_this152.fileUploader.on(\"progress\",function(t,e){_this152.loader.uploadTotal=e.total,_this152.loader.uploaded=e.uploaded;}),_this152.fileUploader.send();});}},{key:\"abort\",value:function abort(){this.fileUploader.abort();}}]);return Gu;}();$u._UploadGateway=/*#__PURE__*/function(){function _class(t,e){_classCallCheck(this,_class);if(!t)throw new Error(\"Token must be provided\");if(!e)throw new Error(\"Api address must be provided\");this._token=t,this._apiAddress=e;}_createClass(_class,[{key:\"upload\",value:function upload(t){return new Uu(t,this._token,this._apiAddress);}}]);return _class;}();var Qu=/*#__PURE__*/function(_hr7){_inherits(Qu,_hr7);var _super89=_createSuper(Qu);function Qu(t){var _this153;_classCallCheck(this,Qu);_this153=_super89.call(this,t),_this153._observedElements=new Set();return _this153;}_createClass(Qu,[{key:\"observe\",value:function observe(t,e){var _this154=this;this.document.getRoot(e).on(\"change:children\",function(e,n){_this154.view.once(\"render\",function(){return _this154._updateObservedElements(t,n);});});}},{key:\"_updateObservedElements\",value:function _updateObservedElements(t,e){var _this155=this;if(!e.is(\"element\")||e.is(\"attributeElement\"))return;var n=this.view.domConverter.mapViewToDom(e);if(n){var _iterator274=_createForOfIteratorHelper(n.querySelectorAll(\"img\")),_step274;try{for(_iterator274.s();!(_step274=_iterator274.n()).done;){var _t226=_step274.value;this._observedElements.has(_t226)||(this.listenTo(_t226,\"load\",function(t,e){return _this155._fireEvents(e);}),this._observedElements.add(_t226));}}catch(err){_iterator274.e(err);}finally{_iterator274.f();}var _iterator275=_createForOfIteratorHelper(this._observedElements),_step275;try{for(_iterator275.s();!(_step275=_iterator275.n()).done;){var _e207=_step275.value;t.contains(_e207)||(this.stopListening(_e207),this._observedElements[\"delete\"](_e207));}}catch(err){_iterator275.e(err);}finally{_iterator275.f();}}}},{key:\"_fireEvents\",value:function _fireEvents(t){this.isEnabled&&(this.document.fire(\"layoutChanged\"),this.document.fire(\"imageLoaded\",t));}},{key:\"destroy\",value:function destroy(){this._observedElements.clear(),_get(_getPrototypeOf(Qu.prototype),\"destroy\",this).call(this);}}]);return Qu;}(hr);function Ju(t){return function(n){n.on(\"attribute:\".concat(t,\":image\"),e);};function e(t,e,n){if(!n.consumable.consume(e.item,t.name))return;var i=n.writer,o=n.mapper.toViewElement(e.item).getChild(0);null!==e.attributeNewValue?i.setAttribute(e.attributeKey,e.attributeNewValue,o):i.removeAttribute(e.attributeKey,o);}}var Ku=/*#__PURE__*/function(){function Ku(){_classCallCheck(this,Ku);this._stack=[];}_createClass(Ku,[{key:\"add\",value:function add(t,e){var n=this._stack,i=n[0];this._insertDescriptor(t);var o=n[0];i===o||Zu(i,o)||this.fire(\"change:top\",{oldDescriptor:i,newDescriptor:o,writer:e});}},{key:\"remove\",value:function remove(t,e){var n=this._stack,i=n[0];this._removeDescriptor(t);var o=n[0];i===o||Zu(i,o)||this.fire(\"change:top\",{oldDescriptor:i,newDescriptor:o,writer:e});}},{key:\"_insertDescriptor\",value:function _insertDescriptor(t){var e=this._stack,n=e.findIndex(function(e){return e.id===t.id;});if(Zu(t,e[n]))return;n>-1&&e.splice(n,1);var i=0;for(;e[i]&&Xu(e[i],t);)i++;e.splice(i,0,t);}},{key:\"_removeDescriptor\",value:function _removeDescriptor(t){var e=this._stack,n=e.findIndex(function(e){return e.id===t;});n>-1&&e.splice(n,1);}}]);return Ku;}();function Zu(t,e){return t&&e&&t.priority==e.priority&&th(t.classes)==th(e.classes);}function Xu(t,e){return t.priority>e.priority||!(t.priorityth(e.classes);}function th(t){return Array.isArray(t)?t.sort().join(\",\"):t;}ci(Ku,ei);var eh=n(26),nh=n.n(eh);var ih=\"ck-widget\",oh=\"ck-widget_selected\";function rh(t){return!!t.is(\"element\")&&!!t.getCustomProperty(\"widget\");}function sh(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return mo.isEdge||e.setAttribute(\"contenteditable\",\"false\",t),e.addClass(ih,t),e.setCustomProperty(\"widget\",!0,t),t.getFillerOffset=dh,n.label&&function(t,e,n){n.setCustomProperty(\"widgetLabel\",e,t);}(t,n.label,e),n.hasSelectionHandler&&function(t,e){var n=e.createUIElement(\"div\",{\"class\":\"ck ck-widget__selection-handler\"},function(t){var e=this.toDomElement(t),n=new Ud();return n.set(\"content\",nh.a),n.render(),e.appendChild(n.element),e;});e.insert(e.createPositionAt(t,0),n),e.addClass([\"ck-widget_with-selection-handler\"],t);}(t,e),function(t,e,n,i){var o=new Ku();o.on(\"change:top\",function(e,o){o.oldDescriptor&&i(t,o.oldDescriptor,o.writer),o.newDescriptor&&n(t,o.newDescriptor,o.writer);}),e.setCustomProperty(\"addHighlight\",function(t,e,n){return o.add(e,n);},t),e.setCustomProperty(\"removeHighlight\",function(t,e,n){return o.remove(e,n);},t);}(t,e,function(t,e,n){return n.addClass(i(e.classes),t);},function(t,e,n){return n.removeClass(i(e.classes),t);}),t;function i(t){return Array.isArray(t)?t:[t];}}function ah(t){var e=t.getCustomProperty(\"widgetLabel\");return e?\"function\"==typeof e?e():e:\"\";}function ch(t,e){return e.addClass([\"ck-editor__editable\",\"ck-editor__nested-editable\"],t),mo.isEdge||(e.setAttribute(\"contenteditable\",t.isReadOnly?\"false\":\"true\",t),t.on(\"change:isReadOnly\",function(n,i,o){e.setAttribute(\"contenteditable\",o?\"false\":\"true\",t);})),t.on(\"change:isFocused\",function(n,i,o){o?e.addClass(\"ck-editor__nested-editable_focused\",t):e.removeClass(\"ck-editor__nested-editable_focused\",t);}),t;}function lh(t,e){var n=t.getSelectedElement();if(n&&e.schema.isBlock(n))return e.createPositionAfter(n);var i=t.getSelectedBlocks().next().value;if(i){if(i.isEmpty)return e.createPositionAt(i,0);var _n202=e.createPositionAfter(i);return t.focus.isTouching(_n202)?_n202:e.createPositionBefore(i);}return t.focus;}function dh(){return null;}function uh(t){var e=t.getSelectedElement();return e&&function(t){return!!t.getCustomProperty(\"image\")&&rh(t);}(e)?e:null;}function hh(t){return!!t&&t.is(\"image\");}function fh(t,e){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var i=t.createElement(\"image\",n),o=lh(e.document.selection,e);e.insertContent(i,o),i.parent&&t.setSelection(i,\"on\");}function mh(t){var e=t.schema,n=t.document.selection;return function(t,e,n){var i=function(t,e){var n=lh(t,e).parent;if(n.isEmpty&&!n.is(\"$root\"))return n.parent;return n;}(t,n);return e.checkChild(i,\"image\");}(n,e,t)&&!function(t,e){var n=t.getSelectedElement();return n&&e.isObject(n);}(n,e)&&function(t){return _toConsumableArray(t.focus.getAncestors()).every(function(t){return!t.is(\"image\");});}(n);}var ph=/*#__PURE__*/function(_Zl9){_inherits(ph,_Zl9);var _super90=_createSuper(ph);function ph(){_classCallCheck(this,ph);return _super90.apply(this,arguments);}_createClass(ph,[{key:\"refresh\",value:function refresh(){this.isEnabled=mh(this.editor.model);}},{key:\"execute\",value:function execute(t){var e=this.editor.model;e.change(function(n){var i=Array.isArray(t.source)?t.source:[t.source];var _iterator276=_createForOfIteratorHelper(i),_step276;try{for(_iterator276.s();!(_step276=_iterator276.n()).done;){var _t227=_step276.value;fh(n,e,{src:_t227});}}catch(err){_iterator276.e(err);}finally{_iterator276.f();}});}}]);return ph;}(Zl);var gh=/*#__PURE__*/function(_$l24){_inherits(gh,_$l24);var _super91=_createSuper(gh);function gh(){_classCallCheck(this,gh);return _super91.apply(this,arguments);}_createClass(gh,[{key:\"init\",value:function init(){var t=this.editor,e=t.model.schema,n=t.t,i=t.conversion;t.editing.view.addObserver(Qu),e.register(\"image\",{isObject:!0,isBlock:!0,allowWhere:\"$block\",allowAttributes:[\"alt\",\"src\",\"srcset\"]}),i[\"for\"](\"dataDowncast\").elementToElement({model:\"image\",view:function view(t,e){return bh(e);}}),i[\"for\"](\"editingDowncast\").elementToElement({model:\"image\",view:function view(t,e){return function(t,e,n){return e.setCustomProperty(\"image\",!0,t),sh(t,e,{label:function label(){var e=t.getChild(0).getAttribute(\"alt\");return e?\"\".concat(e,\" \").concat(n):n;}});}(bh(e),e,n(\"e\"));}}),i[\"for\"](\"downcast\").add(Ju(\"src\")).add(Ju(\"alt\")).add(function(){return function(e){e.on(\"attribute:srcset:image\",t);};function t(t,e,n){if(!n.consumable.consume(e.item,t.name))return;var i=n.writer,o=n.mapper.toViewElement(e.item).getChild(0);if(null===e.attributeNewValue){var _t228=e.attributeOldValue;_t228.data&&(i.removeAttribute(\"srcset\",o),i.removeAttribute(\"sizes\",o),_t228.width&&i.removeAttribute(\"width\",o));}else{var _t229=e.attributeNewValue;_t229.data&&(i.setAttribute(\"srcset\",_t229.data,o),i.setAttribute(\"sizes\",\"100vw\",o),_t229.width&&i.setAttribute(\"width\",_t229.width,o));}}}()),i[\"for\"](\"upcast\").elementToElement({view:{name:\"img\",attributes:{src:!0}},model:function model(t,e){return e.createElement(\"image\",{src:t.getAttribute(\"src\")});}}).attributeToAttribute({view:{name:\"img\",key:\"alt\"},model:\"alt\"}).attributeToAttribute({view:{name:\"img\",key:\"srcset\"},model:{key:\"srcset\",value:function value(t){var e={data:t.getAttribute(\"srcset\")};return t.hasAttribute(\"width\")&&(e.width=t.getAttribute(\"width\")),e;}}}).add(function(){return function(e){e.on(\"element:figure\",t);};function t(t,e,n){if(!n.consumable.test(e.viewItem,{name:!0,classes:\"image\"}))return;var i=Array.from(e.viewItem.getChildren()).find(function(t){return t.is(\"img\");});if(!i||!i.hasAttribute(\"src\")||!n.consumable.test(i,{name:!0}))return;var o=n.convertItem(i,e.modelCursor),r=Au(o.modelRange.getItems());r&&(n.convertChildren(e.viewItem,n.writer.createPositionAt(r,0)),e.modelRange=o.modelRange,e.modelCursor=o.modelCursor);}}()),t.commands.add(\"imageInsert\",new ph(t));}}]);return gh;}($l);function bh(t){var e=t.createEmptyElement(\"img\"),n=t.createContainerElement(\"figure\",{\"class\":\"image\"});return t.insert(t.createPositionAt(n,0),e),n;}var wh=/*#__PURE__*/function(_ts5){_inherits(wh,_ts5);var _super92=_createSuper(wh);function wh(t){var _this156;_classCallCheck(this,wh);_this156=_super92.call(this,t),_this156.domEventType=\"mousedown\";return _this156;}_createClass(wh,[{key:\"onDomEvent\",value:function onDomEvent(t){this.fire(t.type,t);}}]);return wh;}(ts);n(66);var _h=_o(\"Ctrl+A\");var kh=/*#__PURE__*/function(_$l25){_inherits(kh,_$l25);var _super93=_createSuper(kh);function kh(){_classCallCheck(this,kh);return _super93.apply(this,arguments);}_createClass(kh,[{key:\"init\",value:function init(){var _this157=this;var t=this.editor.editing.view,e=t.document;this._previouslySelected=new Set(),this.editor.editing.downcastDispatcher.on(\"selection\",function(t,e,n){_this157._clearPreviouslySelectedWidgets(n.writer);var i=n.writer,o=i.document.selection,r=o.getSelectedElement();var s=null;var _iterator277=_createForOfIteratorHelper(o.getRanges()),_step277;try{for(_iterator277.s();!(_step277=_iterator277.n()).done;){var _t230=_step277.value;var _iterator278=_createForOfIteratorHelper(_t230),_step278;try{for(_iterator278.s();!(_step278=_iterator278.n()).done;){var _e208=_step278.value;var _t231=_e208.item;rh(_t231)&&!vh(_t231,s)&&(i.addClass(oh,_t231),_this157._previouslySelected.add(_t231),s=_t231,_t231==r&&i.setSelection(o.getRanges(),{fake:!0,label:ah(r)}));}}catch(err){_iterator278.e(err);}finally{_iterator278.f();}}}catch(err){_iterator277.e(err);}finally{_iterator277.f();}},{priority:\"low\"}),t.addObserver(wh),this.listenTo(e,\"mousedown\",function(){return _this157._onMousedown.apply(_this157,arguments);}),this.listenTo(e,\"keydown\",function(){return _this157._onKeydown.apply(_this157,arguments);},{priority:\"high\"}),this.listenTo(e,\"delete\",function(t,e){_this157._handleDelete(\"forward\"==e.direction)&&(e.preventDefault(),t.stop());},{priority:\"high\"});}},{key:\"_onMousedown\",value:function _onMousedown(t,e){var n=this.editor,i=n.editing.view,o=i.document;var r=e.target;if(function(t){for(;t;){if(t.is(\"editableElement\")&&!t.is(\"rootElement\"))return!0;if(rh(t))return!1;t=t.parent;}return!1;}(r))return;if(!rh(r)&&!(r=r.findAncestor(rh)))return;e.preventDefault(),o.isFocused||i.focus();var s=n.editing.mapper.toModelElement(r);this._setSelectionOverElement(s);}},{key:\"_onKeydown\",value:function _onKeydown(t,e){var n=e.keyCode,i=n==bo.arrowdown||n==bo.arrowright;var o=!1;!function(t){return t==bo.arrowright||t==bo.arrowleft||t==bo.arrowup||t==bo.arrowdown;}(n)?!function(t){return wo(t)==_h;}(e)?n===bo.enter&&(o=this._handleEnterKey(e.shiftKey)):o=this._selectAllNestedEditableContent()||this._selectAllContent():o=this._handleArrowKeys(i),o&&(e.preventDefault(),t.stop());}},{key:\"_handleDelete\",value:function _handleDelete(t){var _this158=this;if(this.editor.isReadOnly)return;var e=this.editor.model.document.selection;if(!e.isCollapsed)return;var n=this._getObjectElementNextToSelection(t);return n?(this.editor.model.change(function(t){var i=e.anchor.parent;for(;i.isEmpty;){var _e209=i;i=_e209.parent,t.remove(_e209);}_this158._setSelectionOverElement(n);}),!0):void 0;}},{key:\"_handleArrowKeys\",value:function _handleArrowKeys(t){var e=this.editor.model,n=e.schema,i=e.document.selection,o=i.getSelectedElement();if(o&&n.isObject(o)){var _o77=t?i.getLastPosition():i.getFirstPosition(),_r37=n.getNearestSelectionRange(_o77,t?\"forward\":\"backward\");return _r37&&e.change(function(t){t.setSelection(_r37);}),!0;}if(!i.isCollapsed)return;var r=this._getObjectElementNextToSelection(t);return r&&n.isObject(r)?(this._setSelectionOverElement(r),!0):void 0;}},{key:\"_handleEnterKey\",value:function _handleEnterKey(t){var e=this.editor.model,n=e.document.selection.getSelectedElement();if(function(t,e){return t&&e.isObject(t)&&!e.isInline(t);}(n,e.schema))return e.change(function(i){var o=i.createPositionAt(n,t?\"before\":\"after\");var r=i.createElement(\"paragraph\");if(e.schema.isBlock(n.parent)){var _t232=e.schema.findAllowedParent(o,r);o=i.split(o,_t232).position;}i.insert(r,o),i.setSelection(r,\"in\");}),!0;}},{key:\"_selectAllNestedEditableContent\",value:function _selectAllNestedEditableContent(){var t=this.editor.model,e=t.document.selection,n=t.schema.getLimitElement(e);return e.getFirstRange().root!=n&&(t.change(function(t){t.setSelection(t.createRangeIn(n));}),!0);}},{key:\"_selectAllContent\",value:function _selectAllContent(){var t=this.editor.model,e=this.editor.editing,n=e.view.document.selection.getSelectedElement();if(n&&rh(n)){var _i163=e.mapper.toModelElement(n.parent);return t.change(function(t){t.setSelection(t.createRangeIn(_i163));}),!0;}return!1;}},{key:\"_setSelectionOverElement\",value:function _setSelectionOverElement(t){this.editor.model.change(function(e){e.setSelection(e.createRangeOn(t));});}},{key:\"_getObjectElementNextToSelection\",value:function _getObjectElementNextToSelection(t){var e=this.editor.model,n=e.schema,i=e.document.selection,o=e.createSelection(i);e.modifySelection(o,{direction:t?\"forward\":\"backward\"});var r=t?o.focus.nodeBefore:o.focus.nodeAfter;return r&&n.isObject(r)?r:null;}},{key:\"_clearPreviouslySelectedWidgets\",value:function _clearPreviouslySelectedWidgets(t){var _iterator279=_createForOfIteratorHelper(this._previouslySelected),_step279;try{for(_iterator279.s();!(_step279=_iterator279.n()).done;){var _e210=_step279.value;t.removeClass(oh,_e210);}}catch(err){_iterator279.e(err);}finally{_iterator279.f();}this._previouslySelected.clear();}}],[{key:\"pluginName\",get:function get(){return\"Widget\";}}]);return kh;}($l);function vh(t,e){return!!e&&Array.from(t.getAncestors()).includes(e);}var yh=/*#__PURE__*/function(_Zl10){_inherits(yh,_Zl10);var _super94=_createSuper(yh);function yh(){_classCallCheck(this,yh);return _super94.apply(this,arguments);}_createClass(yh,[{key:\"refresh\",value:function refresh(){var t=this.editor.model.document.selection.getSelectedElement();this.isEnabled=hh(t),hh(t)&&t.hasAttribute(\"alt\")?this.value=t.getAttribute(\"alt\"):this.value=!1;}},{key:\"execute\",value:function execute(t){var e=this.editor.model,n=e.document.selection.getSelectedElement();e.change(function(e){e.setAttribute(\"alt\",t.newValue,n);});}}]);return yh;}(Zl);var xh=/*#__PURE__*/function(_$l26){_inherits(xh,_$l26);var _super95=_createSuper(xh);function xh(){_classCallCheck(this,xh);return _super95.apply(this,arguments);}_createClass(xh,[{key:\"init\",value:function init(){this.editor.commands.add(\"imageTextAlternative\",new yh(this.editor));}}]);return xh;}($l);function Ah(_ref16){var t=_ref16.emitter,e=_ref16.activator,n=_ref16.callback,i=_ref16.contextElements;t.listenTo(document,\"mousedown\",function(t,_ref17){var o=_ref17.target;if(e()){var _iterator280=_createForOfIteratorHelper(i),_step280;try{for(_iterator280.s();!(_step280=_iterator280.n()).done;){var _t233=_step280.value;if(_t233.contains(o))return;}}catch(err){_iterator280.e(err);}finally{_iterator280.f();}n();}});}n(68);var Ch=/*#__PURE__*/function(_Nl10){_inherits(Ch,_Nl10);var _super96=_createSuper(Ch);function Ch(t,e){var _this159;_classCallCheck(this,Ch);_this159=_super96.call(this,t);var n=\"ck-input-\".concat(Kn()),i=\"ck-status-\".concat(Kn());_this159.set(\"label\"),_this159.set(\"value\"),_this159.set(\"isReadOnly\",!1),_this159.set(\"errorText\",null),_this159.set(\"infoText\",null),_this159.labelView=_this159._createLabelView(n),_this159.inputView=_this159._createInputView(e,n,i),_this159.statusView=_this159._createStatusView(i),_this159.bind(\"_statusText\").to(_assertThisInitialized(_this159),\"errorText\",_assertThisInitialized(_this159),\"infoText\",function(t,e){return t||e;});var o=_this159.bindTemplate;_this159.setTemplate({tag:\"div\",attributes:{\"class\":[\"ck\",\"ck-labeled-input\",o[\"if\"](\"isReadOnly\",\"ck-disabled\")]},children:[_this159.labelView,_this159.inputView,_this159.statusView]});return _this159;}_createClass(Ch,[{key:\"_createLabelView\",value:function _createLabelView(t){var e=new Rl(this.locale);return e[\"for\"]=t,e.bind(\"text\").to(this,\"label\"),e;}},{key:\"_createInputView\",value:function _createInputView(t,e,n){var _this160=this;var i=new t(this.locale,n);return i.id=e,i.ariaDesribedById=n,i.bind(\"value\").to(this),i.bind(\"isReadOnly\").to(this),i.bind(\"hasError\").to(this,\"errorText\",function(t){return!!t;}),i.on(\"input\",function(){_this160.errorText=null;}),i;}},{key:\"_createStatusView\",value:function _createStatusView(t){var e=new Nl(this.locale),n=this.bindTemplate;return e.setTemplate({tag:\"div\",attributes:{\"class\":[\"ck\",\"ck-labeled-input__status\",n[\"if\"](\"errorText\",\"ck-labeled-input__status_error\"),n[\"if\"](\"_statusText\",\"ck-hidden\",function(t){return!t;})],id:t},children:[{text:n.to(\"_statusText\")}]}),e;}},{key:\"select\",value:function select(){this.inputView.select();}},{key:\"focus\",value:function focus(){this.inputView.focus();}}]);return Ch;}(Nl);n(70);var Th=/*#__PURE__*/function(_Nl11){_inherits(Th,_Nl11);var _super97=_createSuper(Th);function Th(t){var _this161;_classCallCheck(this,Th);_this161=_super97.call(this,t),_this161.set(\"value\"),_this161.set(\"id\"),_this161.set(\"placeholder\"),_this161.set(\"isReadOnly\",!1),_this161.set(\"hasError\",!1),_this161.set(\"ariaDesribedById\");var e=_this161.bindTemplate;_this161.setTemplate({tag:\"input\",attributes:{type:\"text\",\"class\":[\"ck\",\"ck-input\",\"ck-input-text\",e[\"if\"](\"hasError\",\"ck-error\")],id:e.to(\"id\"),placeholder:e.to(\"placeholder\"),readonly:e.to(\"isReadOnly\"),\"aria-invalid\":e[\"if\"](\"hasError\",!0),\"aria-describedby\":e.to(\"ariaDesribedById\")},on:{input:e.to(\"input\")}});return _this161;}_createClass(Th,[{key:\"render\",value:function render(){var _this162=this;_get(_getPrototypeOf(Th.prototype),\"render\",this).call(this);var t=function t(_t234){_this162.element.value=_t234||0===_t234?_t234:\"\";};t(this.value),this.on(\"change:value\",function(e,n,i){t(i);});}},{key:\"select\",value:function select(){this.element.select();}},{key:\"focus\",value:function focus(){this.element.focus();}}]);return Th;}(Nl);function Ph(_ref18){var t=_ref18.view;t.listenTo(t.element,\"submit\",function(e,n){n.preventDefault(),t.fire(\"submit\");},{useCapture:!0});}var Mh=n(7),Eh=n.n(Mh),Sh=n(8),Ih=n.n(Sh);n(72);var Nh=/*#__PURE__*/function(_Nl12){_inherits(Nh,_Nl12);var _super98=_createSuper(Nh);function Nh(t){var _this163;_classCallCheck(this,Nh);_this163=_super98.call(this,t);var e=_this163.locale.t;_this163.focusTracker=new il(),_this163.keystrokes=new Gc(),_this163.labeledInput=_this163._createLabeledInputView(),_this163.saveButtonView=_this163._createButton(e(\"au\"),Eh.a,\"ck-button-save\"),_this163.saveButtonView.type=\"submit\",_this163.cancelButtonView=_this163._createButton(e(\"av\"),Ih.a,\"ck-button-cancel\",\"cancel\"),_this163._focusables=new hl(),_this163._focusCycler=new Fl({focusables:_this163._focusables,focusTracker:_this163.focusTracker,keystrokeHandler:_this163.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}}),_this163.setTemplate({tag:\"form\",attributes:{\"class\":[\"ck\",\"ck-text-alternative-form\"],tabindex:\"-1\"},children:[_this163.labeledInput,_this163.saveButtonView,_this163.cancelButtonView]});return _this163;}_createClass(Nh,[{key:\"render\",value:function render(){var _this164=this;_get(_getPrototypeOf(Nh.prototype),\"render\",this).call(this),this.keystrokes.listenTo(this.element),Ph({view:this}),[this.labeledInput,this.saveButtonView,this.cancelButtonView].forEach(function(t){_this164._focusables.add(t),_this164.focusTracker.add(t.element);});}},{key:\"_createButton\",value:function _createButton(t,e,n,i){var o=new qd(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{\"class\":n}}),i&&o.delegate(\"execute\").to(this,i),o;}},{key:\"_createLabeledInputView\",value:function _createLabeledInputView(){var t=this.locale.t,e=new Ch(this.locale,Th);return e.label=t(\"bq\"),e.inputView.placeholder=t(\"bq\"),e;}}]);return Nh;}(Nl);function Oh(_ref19){var t=_ref19.element,e=_ref19.target,n=_ref19.positions,i=_ref19.limiter,o=_ref19.fitInViewport;W(e)&&(e=e()),W(i)&&(i=i());var r=function(t){for(;t&&\"html\"!=t.tagName.toLowerCase();){if(\"static\"!=nr.window.getComputedStyle(t).position)return t;t=t.parentElement;}return null;}(t.parentElement),s=new As(t),a=new As(e);var c,l;if(i||o){var _t235=i&&new As(i).getVisible(),_e211=o&&new As(nr.window);var _ref20=function(t,e,n,i,o){var r,s,a=0,c=0;var l=n.getArea();return t.some(function(t){var _Rh=Rh(t,e,n),_Rh2=_slicedToArray(_Rh,2),d=_Rh2[0],u=_Rh2[1];var h,f;if(i)if(o){var _t236=i.getIntersection(o);h=_t236?_t236.getIntersectionArea(u):0;}else h=i.getIntersectionArea(u);function m(){c=f,a=h,r=u,s=d;}return o&&(f=o.getIntersectionArea(u)),o&&!i?f>c&&m():!o&&i?h>a&&m():f>c&&h>=a?m():f>=c&&h>a&&m(),h===l;}),r?[s,r]:null;}(n,a,s,_t235,_e211)||Rh(n[0],a,s);var _ref21=_slicedToArray(_ref20,2);l=_ref21[0];c=_ref21[1];}else{var _Rh3=Rh(n[0],a,s);var _Rh4=_slicedToArray(_Rh3,2);l=_Rh4[0];c=_Rh4[1];}var _Dh=Dh(c),d=_Dh.left,u=_Dh.top;if(r){var _t237=Dh(new As(r)),_e212=ys(r);d-=_t237.left,u-=_t237.top,d+=r.scrollLeft,u+=r.scrollTop,d-=_e212.left,u-=_e212.top;}return{left:d,top:u,name:l};}function Rh(t,e,n){var _t238=t(e,n),i=_t238.left,o=_t238.top,r=_t238.name;return[r,n.clone().moveTo(i,o)];}function Dh(_ref22){var t=_ref22.left,e=_ref22.top;var _nr$window2=nr.window,n=_nr$window2.scrollX,i=_nr$window2.scrollY;return{left:t+n,top:e+i};}n(74);var Lh=Vl(\"px\"),jh=nr.document.body;var Vh=/*#__PURE__*/function(_Nl13){_inherits(Vh,_Nl13);var _super99=_createSuper(Vh);function Vh(t){var _this165;_classCallCheck(this,Vh);_this165=_super99.call(this,t);var e=_this165.bindTemplate;_this165.set(\"top\",0),_this165.set(\"left\",0),_this165.set(\"position\",\"arrow_nw\"),_this165.set(\"isVisible\",!1),_this165.set(\"withArrow\",!0),_this165.set(\"class\"),_this165.content=_this165.createCollection(),_this165.setTemplate({tag:\"div\",attributes:{\"class\":[\"ck\",\"ck-balloon-panel\",e.to(\"position\",function(t){return\"ck-balloon-panel_\".concat(t);}),e[\"if\"](\"isVisible\",\"ck-balloon-panel_visible\"),e[\"if\"](\"withArrow\",\"ck-balloon-panel_with-arrow\"),e.to(\"class\")],style:{top:e.to(\"top\",Lh),left:e.to(\"left\",Lh)}},children:_this165.content});return _this165;}_createClass(Vh,[{key:\"show\",value:function show(){this.isVisible=!0;}},{key:\"hide\",value:function hide(){this.isVisible=!1;}},{key:\"attachTo\",value:function attachTo(t){this.show();var e=Vh.defaultPositions,n=Object.assign({},{element:this.element,positions:[e.southArrowNorth,e.southArrowNorthWest,e.southArrowNorthEast,e.northArrowSouth,e.northArrowSouthWest,e.northArrowSouthEast],limiter:jh,fitInViewport:!0},t),_Vh$_getOptimalPositi=Vh._getOptimalPosition(n),i=_Vh$_getOptimalPositi.top,o=_Vh$_getOptimalPositi.left,r=_Vh$_getOptimalPositi.name;Object.assign(this,{top:i,left:o,position:r});}},{key:\"pin\",value:function pin(t){var _this166=this;this.unpin(),this._pinWhenIsVisibleCallback=function(){_this166.isVisible?_this166._startPinning(t):_this166._stopPinning();},this._startPinning(t),this.listenTo(this,\"change:isVisible\",this._pinWhenIsVisibleCallback);}},{key:\"unpin\",value:function unpin(){this._pinWhenIsVisibleCallback&&(this._stopPinning(),this.stopListening(this,\"change:isVisible\",this._pinWhenIsVisibleCallback),this._pinWhenIsVisibleCallback=null,this.hide());}},{key:\"_startPinning\",value:function _startPinning(t){var _this167=this;this.attachTo(t);var e=Bh(t.target),n=t.limiter?Bh(t.limiter):jh;this.listenTo(nr.document,\"scroll\",function(i,o){var r=o.target,s=e&&r.contains(e),a=n&&r.contains(n);!s&&!a&&e&&n||_this167.attachTo(t);},{useCapture:!0}),this.listenTo(nr.window,\"resize\",function(){_this167.attachTo(t);});}},{key:\"_stopPinning\",value:function _stopPinning(){this.stopListening(nr.document,\"scroll\"),this.stopListening(nr.window,\"resize\");}}]);return Vh;}(Nl);function Bh(t){return Wn(t)?t:vs(t)?t.commonAncestorContainer:\"function\"==typeof t?Bh(t()):null;}function zh(t,e){return t.top-e.height-Vh.arrowVerticalOffset;}function Fh(t){return t.bottom+Vh.arrowVerticalOffset;}Vh.arrowHorizontalOffset=25,Vh.arrowVerticalOffset=10,Vh._getOptimalPosition=Oh,Vh.defaultPositions={northArrowSouth:function northArrowSouth(t,e){return{top:zh(t,e),left:t.left+t.width/2-e.width/2,name:\"arrow_s\"};},northArrowSouthEast:function northArrowSouthEast(t,e){return{top:zh(t,e),left:t.left+t.width/2-e.width+Vh.arrowHorizontalOffset,name:\"arrow_se\"};},northArrowSouthWest:function northArrowSouthWest(t,e){return{top:zh(t,e),left:t.left+t.width/2-Vh.arrowHorizontalOffset,name:\"arrow_sw\"};},northWestArrowSouth:function northWestArrowSouth(t,e){return{top:zh(t,e),left:t.left-e.width/2,name:\"arrow_s\"};},northWestArrowSouthWest:function northWestArrowSouthWest(t,e){return{top:zh(t,e),left:t.left-Vh.arrowHorizontalOffset,name:\"arrow_sw\"};},northWestArrowSouthEast:function northWestArrowSouthEast(t,e){return{top:zh(t,e),left:t.left-e.width+Vh.arrowHorizontalOffset,name:\"arrow_se\"};},northEastArrowSouth:function northEastArrowSouth(t,e){return{top:zh(t,e),left:t.right-e.width/2,name:\"arrow_s\"};},northEastArrowSouthEast:function northEastArrowSouthEast(t,e){return{top:zh(t,e),left:t.right-e.width+Vh.arrowHorizontalOffset,name:\"arrow_se\"};},northEastArrowSouthWest:function northEastArrowSouthWest(t,e){return{top:zh(t,e),left:t.right-Vh.arrowHorizontalOffset,name:\"arrow_sw\"};},southArrowNorth:function southArrowNorth(t,e){return{top:Fh(t),left:t.left+t.width/2-e.width/2,name:\"arrow_n\"};},southArrowNorthEast:function southArrowNorthEast(t,e){return{top:Fh(t),left:t.left+t.width/2-e.width+Vh.arrowHorizontalOffset,name:\"arrow_ne\"};},southArrowNorthWest:function southArrowNorthWest(t,e){return{top:Fh(t),left:t.left+t.width/2-Vh.arrowHorizontalOffset,name:\"arrow_nw\"};},southWestArrowNorth:function southWestArrowNorth(t,e){return{top:Fh(t),left:t.left-e.width/2,name:\"arrow_n\"};},southWestArrowNorthWest:function southWestArrowNorthWest(t,e){return{top:Fh(t),left:t.left-Vh.arrowHorizontalOffset,name:\"arrow_nw\"};},southWestArrowNorthEast:function southWestArrowNorthEast(t,e){return{top:Fh(t),left:t.left-e.width+Vh.arrowHorizontalOffset,name:\"arrow_ne\"};},southEastArrowNorth:function southEastArrowNorth(t,e){return{top:Fh(t),left:t.right-e.width/2,name:\"arrow_n\"};},southEastArrowNorthEast:function southEastArrowNorthEast(t,e){return{top:Fh(t),left:t.right-e.width+Vh.arrowHorizontalOffset,name:\"arrow_ne\"};},southEastArrowNorthWest:function southEastArrowNorthWest(t,e){return{top:Fh(t),left:t.right-Vh.arrowHorizontalOffset,name:\"arrow_nw\"};}};var Uh=/*#__PURE__*/function(_$l27){_inherits(Uh,_$l27);var _super100=_createSuper(Uh);function Uh(){_classCallCheck(this,Uh);return _super100.apply(this,arguments);}_createClass(Uh,[{key:\"init\",value:function init(){var _this168=this;this.view=new Vh(),this.positionLimiter=function(){var t=_this168.editor.editing.view,e=t.document.selection.editableElement;return e?t.domConverter.mapViewToDom(e.root):null;},this._stack=new Map(),this.editor.ui.view.body.add(this.view),this.editor.ui.focusTracker.add(this.view.element);}},{key:\"visibleView\",get:function get(){var t=this._stack.get(this.view.content.get(0));return t?t.view:null;}},{key:\"hasView\",value:function hasView(t){return this._stack.has(t);}},{key:\"add\",value:function add(t){if(this.hasView(t.view))throw new Gn.b(\"contextualballoon-add-view-exist: Cannot add configuration of the same view twice.\");this.visibleView&&this.view.content.remove(this.visibleView),this._stack.set(t.view,t),this._show(t);}},{key:\"remove\",value:function remove(t){if(!this.hasView(t))throw new Gn.b(\"contextualballoon-remove-view-not-exist: Cannot remove configuration of not existing view.\");if(this.visibleView===t){this.view.content.remove(t),this._stack[\"delete\"](t);var _e213=Array.from(this._stack.values()).pop();_e213?this._show(_e213):this.view.hide();}else this._stack[\"delete\"](t);}},{key:\"updatePosition\",value:function updatePosition(t){t&&(this._stack.get(this.visibleView).position=t),this.view.pin(this._getBalloonPosition());}},{key:\"_show\",value:function _show(_ref23){var t=_ref23.view,_ref23$balloonClassNa=_ref23.balloonClassName,e=_ref23$balloonClassNa===void 0?\"\":_ref23$balloonClassNa;this.view[\"class\"]=e,this.view.content.add(t),this.view.pin(this._getBalloonPosition());}},{key:\"_getBalloonPosition\",value:function _getBalloonPosition(){var t=Array.from(this._stack.values()).pop().position;return t&&!t.limiter&&(t=Object.assign({},t,{limiter:this.positionLimiter})),t;}}],[{key:\"pluginName\",get:function get(){return\"ContextualBalloon\";}}]);return Uh;}($l);var Hh=n(27),qh=n.n(Hh);function Wh(t){var e=t.editing.view,n=Vh.defaultPositions;return{target:e.domConverter.viewToDom(e.document.selection.getSelectedElement()),positions:[n.northArrowSouth,n.northArrowSouthWest,n.northArrowSouthEast,n.southArrowNorth,n.southArrowNorthWest,n.southArrowNorthEast]};}var Yh=/*#__PURE__*/function(_$l28){_inherits(Yh,_$l28);var _super101=_createSuper(Yh);function Yh(){_classCallCheck(this,Yh);return _super101.apply(this,arguments);}_createClass(Yh,[{key:\"init\",value:function init(){this._createButton(),this._createForm();}},{key:\"destroy\",value:function destroy(){_get(_getPrototypeOf(Yh.prototype),\"destroy\",this).call(this),this._form.destroy();}},{key:\"_createButton\",value:function _createButton(){var _this169=this;var t=this.editor,e=t.t;t.ui.componentFactory.add(\"imageTextAlternative\",function(n){var i=t.commands.get(\"imageTextAlternative\"),o=new qd(n);return o.set({label:e(\"bp\"),icon:qh.a,tooltip:!0}),o.bind(\"isEnabled\").to(i,\"isEnabled\"),_this169.listenTo(o,\"execute\",function(){return _this169._showForm();}),o;});}},{key:\"_createForm\",value:function _createForm(){var _this170=this;var t=this.editor,e=t.editing.view.document;this._balloon=this.editor.plugins.get(\"ContextualBalloon\"),this._form=new Nh(t.locale),this._form.render(),this.listenTo(this._form,\"submit\",function(){t.execute(\"imageTextAlternative\",{newValue:_this170._form.labeledInput.inputView.element.value}),_this170._hideForm(!0);}),this.listenTo(this._form,\"cancel\",function(){_this170._hideForm(!0);}),this._form.keystrokes.set(\"Esc\",function(t,e){_this170._hideForm(!0),e();}),this.listenTo(t.ui,\"update\",function(){uh(e.selection)?_this170._isVisible&&function(t){var e=t.plugins.get(\"ContextualBalloon\");if(uh(t.editing.view.document.selection)){var _n203=Wh(t);e.updatePosition(_n203);}}(t):_this170._hideForm(!0);}),Ah({emitter:this._form,activator:function activator(){return _this170._isVisible;},contextElements:[this._form.element],callback:function callback(){return _this170._hideForm();}});}},{key:\"_showForm\",value:function _showForm(){if(this._isVisible)return;var t=this.editor,e=t.commands.get(\"imageTextAlternative\"),n=this._form.labeledInput;this._balloon.hasView(this._form)||this._balloon.add({view:this._form,position:Wh(t)}),n.value=n.inputView.element.value=e.value||\"\",this._form.labeledInput.select();}},{key:\"_hideForm\",value:function _hideForm(t){this._isVisible&&(this._form.saveButtonView.focus(),this._balloon.remove(this._form),t&&this.editor.editing.view.focus());}},{key:\"_isVisible\",get:function get(){return this._balloon.visibleView==this._form;}}],[{key:\"requires\",get:function get(){return[Uh];}},{key:\"pluginName\",get:function get(){return\"ImageTextAlternativeUI\";}}]);return Yh;}($l);var $h=/*#__PURE__*/function(_$l29){_inherits($h,_$l29);var _super102=_createSuper($h);function $h(){_classCallCheck(this,$h);return _super102.apply(this,arguments);}_createClass($h,null,[{key:\"requires\",get:function get(){return[xh,Yh];}},{key:\"pluginName\",get:function get(){return\"ImageTextAlternative\";}}]);return $h;}($l);n(76);var Gh=/*#__PURE__*/function(_$l30){_inherits(Gh,_$l30);var _super103=_createSuper(Gh);function Gh(){_classCallCheck(this,Gh);return _super103.apply(this,arguments);}_createClass(Gh,null,[{key:\"requires\",get:function get(){return[gh,kh,$h];}},{key:\"pluginName\",get:function get(){return\"Image\";}}]);return Gh;}($l);var Qh=/*#__PURE__*/function(_Nl14){_inherits(Qh,_Nl14);var _super104=_createSuper(Qh);function Qh(t){var _this171;_classCallCheck(this,Qh);_this171=_super104.call(this,t),_this171.buttonView=new qd(t),_this171._fileInputView=new Jh(t),_this171._fileInputView.bind(\"acceptedType\").to(_assertThisInitialized(_this171)),_this171._fileInputView.bind(\"allowMultipleFiles\").to(_assertThisInitialized(_this171)),_this171._fileInputView.delegate(\"done\").to(_assertThisInitialized(_this171)),_this171.setTemplate({tag:\"span\",attributes:{\"class\":\"ck-file-dialog-button\"},children:[_this171.buttonView,_this171._fileInputView]}),_this171.buttonView.on(\"execute\",function(){_this171._fileInputView.open();});return _this171;}_createClass(Qh,[{key:\"focus\",value:function focus(){this.buttonView.focus();}}]);return Qh;}(Nl);var Jh=/*#__PURE__*/function(_Nl15){_inherits(Jh,_Nl15);var _super105=_createSuper(Jh);function Jh(t){var _this172;_classCallCheck(this,Jh);_this172=_super105.call(this,t),_this172.set(\"acceptedType\"),_this172.set(\"allowMultipleFiles\",!1);var e=_this172.bindTemplate;_this172.setTemplate({tag:\"input\",attributes:{\"class\":[\"ck-hidden\"],type:\"file\",tabindex:\"-1\",accept:e.to(\"acceptedType\"),multiple:e.to(\"allowMultipleFiles\")},on:{change:e.to(function(){_this172.element&&_this172.element.files&&_this172.element.files.length&&_this172.fire(\"done\",_this172.element.files),_this172.element.value=\"\";})}});return _this172;}_createClass(Jh,[{key:\"open\",value:function open(){this.element.click();}}]);return Jh;}(Nl);var Kh=n(28),Zh=n.n(Kh);function Xh(t){return /^image\\/(jpeg|png|gif|bmp)$/.test(t.type);}function tf(t){return new Promise(function(e,n){var i=t.getAttribute(\"src\");fetch(i).then(function(t){return t.blob();}).then(function(t){var o=function(t,e){return t.type?t.type:e.match(/data:(image\\/\\w+);base64/)?e.match(/data:(image\\/\\w+);base64/)[1].toLowerCase():\"image/jpeg\";}(t,i),r=function(t,e,n){try{return new File([t],e,{type:n});}catch(t){return null;}}(t,\"image.\".concat(o.replace(\"image/\",\"\")),o);r?e(r):n();})[\"catch\"](n);});}var ef=/*#__PURE__*/function(_$l31){_inherits(ef,_$l31);var _super106=_createSuper(ef);function ef(){_classCallCheck(this,ef);return _super106.apply(this,arguments);}_createClass(ef,[{key:\"init\",value:function init(){var t=this.editor,e=t.t;t.ui.componentFactory.add(\"imageUpload\",function(n){var i=new Qh(n),o=t.commands.get(\"imageUpload\");return i.set({acceptedType:\"image/*\",allowMultipleFiles:!0}),i.buttonView.set({label:e(\"n\"),icon:Zh.a,tooltip:!0}),i.buttonView.bind(\"isEnabled\").to(o),i.on(\"done\",function(e,n){var i=Array.from(n).filter(Xh);i.length&&t.execute(\"imageUpload\",{file:i});}),i;});}}]);return ef;}($l);var nf=n(29),of=n.n(nf);n(78),n(80),n(82);var rf=/*#__PURE__*/function(_$l32){_inherits(rf,_$l32);var _super107=_createSuper(rf);function rf(t){var _this173;_classCallCheck(this,rf);_this173=_super107.call(this,t),_this173.placeholder=\"data:image/svg+xml;utf8,\"+encodeURIComponent(of.a);return _this173;}_createClass(rf,[{key:\"init\",value:function init(){var _this174=this;this.editor.editing.downcastDispatcher.on(\"attribute:uploadStatus:image\",function(){return _this174.uploadStatusChange.apply(_this174,arguments);});}},{key:\"uploadStatusChange\",value:function uploadStatusChange(t,e,n){var i=this.editor,o=e.item,r=o.getAttribute(\"uploadId\");if(!n.consumable.consume(e.item,t.name))return;var s=i.plugins.get(Xd),a=r?e.attributeNewValue:null,c=this.placeholder,l=i.editing.mapper.toViewElement(o),d=n.writer;if(\"reading\"==a)return sf(l,d),void af(c,l,d);if(\"uploading\"==a){var _t239=s.loaders.get(r);return sf(l,d),void(_t239?(cf(l,d),function(t,e,n,i){var o=function(t){var e=t.createUIElement(\"div\",{\"class\":\"ck-progress-bar\"});return t.setCustomProperty(\"progressBar\",!0,e),e;}(e);e.insert(e.createPositionAt(t,\"end\"),o),n.on(\"change:uploadedPercent\",function(t,e,n){i.change(function(t){t.setStyle(\"width\",n+\"%\",o);});});}(l,d,_t239,i.editing.view)):af(c,l,d));}\"complete\"==a&&s.loaders.get(r)&&!mo.isEdge&&function(t,e,n){var i=e.createUIElement(\"div\",{\"class\":\"ck-image-upload-complete-icon\"});e.insert(e.createPositionAt(t,\"end\"),i),setTimeout(function(){n.change(function(t){return t.remove(t.createRangeOn(i));});},3e3);}(l,d,i.editing.view),function(t,e){df(t,e,\"progressBar\");}(l,d),cf(l,d),function(t,e){e.removeClass(\"ck-appear\",t);}(l,d);}}]);return rf;}($l);function sf(t,e){t.hasClass(\"ck-appear\")||e.addClass(\"ck-appear\",t);}function af(t,e,n){e.hasClass(\"ck-image-upload-placeholder\")||n.addClass(\"ck-image-upload-placeholder\",e);var i=e.getChild(0);i.getAttribute(\"src\")!==t&&n.setAttribute(\"src\",t,i),lf(e,\"placeholder\")||n.insert(n.createPositionAfter(i),function(t){var e=t.createUIElement(\"div\",{\"class\":\"ck-upload-placeholder-loader\"});return t.setCustomProperty(\"placeholder\",!0,e),e;}(n));}function cf(t,e){t.hasClass(\"ck-image-upload-placeholder\")&&e.removeClass(\"ck-image-upload-placeholder\",t),df(t,e,\"placeholder\");}function lf(t,e){var _iterator281=_createForOfIteratorHelper(t.getChildren()),_step281;try{for(_iterator281.s();!(_step281=_iterator281.n()).done;){var _n204=_step281.value;if(_n204.getCustomProperty(e))return _n204;}}catch(err){_iterator281.e(err);}finally{_iterator281.f();}}function df(t,e,n){var i=lf(t,n);i&&e.remove(e.createRangeOn(i));}var uf=/*#__PURE__*/function(){function uf(){_classCallCheck(this,uf);}_createClass(uf,[{key:\"createDocumentFragment\",value:function createDocumentFragment(t){return new Ao(t);}},{key:\"createElement\",value:function createElement(t,e,n){return new _i(t,e,n);}},{key:\"createText\",value:function createText(t){return new fi(t);}},{key:\"clone\",value:function clone(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!1;return t._clone(e);}},{key:\"appendChild\",value:function appendChild(t,e){return e._appendChild(t);}},{key:\"insertChild\",value:function insertChild(t,e,n){return n._insertChild(t,e);}},{key:\"removeChildren\",value:function removeChildren(t,e,n){return n._removeChildren(t,e);}},{key:\"remove\",value:function remove(t){var e=t.parent;return e?this.removeChildren(e.getChildIndex(t),1,e):[];}},{key:\"replace\",value:function replace(t,e){var n=t.parent;if(n){var _i164=n.getChildIndex(t);return this.removeChildren(_i164,1,n),this.insertChild(_i164,e,n),!0;}return!1;}},{key:\"rename\",value:function rename(t,e){var n=new _i(t,e.getAttributes(),e.getChildren());return this.replace(e,n)?n:null;}},{key:\"setAttribute\",value:function setAttribute(t,e,n){n._setAttribute(t,e);}},{key:\"removeAttribute\",value:function removeAttribute(t,e){e._removeAttribute(t);}},{key:\"addClass\",value:function addClass(t,e){e._addClass(t);}},{key:\"removeClass\",value:function removeClass(t,e){e._removeClass(t);}},{key:\"setStyle\",value:function setStyle(t,e,n){C(t)&&void 0===n&&(n=e),n._setStyle(t,e);}},{key:\"removeStyle\",value:function removeStyle(t,e){e._removeStyle(t);}},{key:\"setCustomProperty\",value:function setCustomProperty(t,e,n){n._setCustomProperty(t,e);}},{key:\"removeCustomProperty\",value:function removeCustomProperty(t,e){return e._removeCustomProperty(t);}},{key:\"createPositionAt\",value:function createPositionAt(t,e){return Zi._createAt(t,e);}},{key:\"createPositionAfter\",value:function createPositionAfter(t){return Zi._createAfter(t);}},{key:\"createPositionBefore\",value:function createPositionBefore(t){return Zi._createBefore(t);}},{key:\"createRange\",value:function createRange(t,e){return new Xi(t,e);}},{key:\"createRangeOn\",value:function createRangeOn(t){return Xi._createOn(t);}},{key:\"createRangeIn\",value:function createRangeIn(t){return Xi._createIn(t);}},{key:\"createSelection\",value:function createSelection(t,e,n){return new no(t,e,n);}}]);return uf;}();var hf=/*#__PURE__*/function(_Zl11){_inherits(hf,_Zl11);var _super108=_createSuper(hf);function hf(){_classCallCheck(this,hf);return _super108.apply(this,arguments);}_createClass(hf,[{key:\"refresh\",value:function refresh(){this.isEnabled=mh(this.editor.model);}},{key:\"execute\",value:function execute(t){var e=this.editor,n=e.model,i=e.plugins.get(Xd);n.change(function(e){var o=Array.isArray(t.file)?t.file:[t.file];var _iterator282=_createForOfIteratorHelper(o),_step282;try{for(_iterator282.s();!(_step282=_iterator282.n()).done;){var _t240=_step282.value;ff(e,n,i,_t240);}}catch(err){_iterator282.e(err);}finally{_iterator282.f();}});}}]);return hf;}(Zl);function ff(t,e,n,i){var o=n.createLoader(i);o&&fh(t,e,{uploadId:o.id});}var mf=/*#__PURE__*/function(_$l33){_inherits(mf,_$l33);var _super109=_createSuper(mf);function mf(){_classCallCheck(this,mf);return _super109.apply(this,arguments);}_createClass(mf,[{key:\"init\",value:function init(){var _this175=this;var t=this.editor,e=t.model.document,n=t.model.schema,i=t.conversion,o=t.plugins.get(Xd);n.extend(\"image\",{allowAttributes:[\"uploadId\",\"uploadStatus\"]}),t.commands.add(\"imageUpload\",new hf(t)),i[\"for\"](\"upcast\").attributeToAttribute({view:{name:\"img\",key:\"uploadId\"},model:\"uploadId\"}),this.listenTo(t.editing.view.document,\"clipboardInput\",function(e,n){if(function(t){return Array.from(t.types).includes(\"text/html\")&&\"\"!==t.getData(\"text/html\");}(n.dataTransfer))return;var i=Array.from(n.dataTransfer.files).filter(function(t){return!!t&&Xh(t);}),o=n.targetRanges.map(function(e){return t.editing.mapper.toModelRange(e);});t.model.change(function(n){n.setSelection(o),i.length&&(e.stop(),t.model.enqueueChange(\"default\",function(){t.execute(\"imageUpload\",{file:i});}));});}),t.plugins.has(\"Clipboard\")&&this.listenTo(t.plugins.get(\"Clipboard\"),\"inputTransformation\",function(e,n){var i=Array.from(t.editing.view.createRangeIn(n.content)).filter(function(t){return function(t){return!(!t.is(\"element\",\"img\")||!t.getAttribute(\"src\"))&&(t.getAttribute(\"src\").match(/^data:image\\/\\w+;base64,/g)||t.getAttribute(\"src\").match(/^blob:/g));}(t.item)&&!t.item.getAttribute(\"uploadProcessed\");}).map(function(t){return{promise:tf(t.item),imageElement:t.item};});if(!i.length)return;var r=new uf();var _iterator283=_createForOfIteratorHelper(i),_step283;try{for(_iterator283.s();!(_step283=_iterator283.n()).done;){var _t241=_step283.value;r.setAttribute(\"uploadProcessed\",!0,_t241.imageElement);var _e214=o.createLoader(_t241.promise);_e214&&(r.setAttribute(\"src\",\"\",_t241.imageElement),r.setAttribute(\"uploadId\",_e214.id,_t241.imageElement));}}catch(err){_iterator283.e(err);}finally{_iterator283.f();}}),t.editing.view.document.on(\"dragover\",function(t,e){e.preventDefault();}),e.on(\"change\",function(){var t=e.differ.getChanges({includeChangesInGraveyard:!0});var _iterator284=_createForOfIteratorHelper(t),_step284;try{for(_iterator284.s();!(_step284=_iterator284.n()).done;){var _e215=_step284.value;if(\"insert\"==_e215.type&&\"image\"==_e215.name){var _t242=_e215.position.nodeAfter,_n205=\"$graveyard\"==_e215.position.root.rootName,_i165=_t242.getAttribute(\"uploadId\");if(!_i165)continue;var _r38=o.loaders.get(_i165);if(!_r38)continue;_n205?_r38.abort():\"idle\"==_r38.status&&_this175._readAndUpload(_r38,_t242);}}}catch(err){_iterator284.e(err);}finally{_iterator284.f();}});}},{key:\"_readAndUpload\",value:function _readAndUpload(t,e){var _this176=this;var n=this.editor,i=n.model,o=n.locale.t,r=n.plugins.get(Xd),s=n.plugins.get(Lu);return i.enqueueChange(\"transparent\",function(t){t.setAttribute(\"uploadStatus\",\"reading\",e);}),t.read().then(function(o){var r=n.editing.mapper.toViewElement(e).getChild(0),s=t.upload();return n.editing.view.change(function(t){t.setAttribute(\"src\",o,r);}),i.enqueueChange(\"transparent\",function(t){t.setAttribute(\"uploadStatus\",\"uploading\",e);}),s;}).then(function(t){i.enqueueChange(\"transparent\",function(n){n.setAttributes({uploadStatus:\"complete\",src:t[\"default\"]},e),_this176._parseAndSetSrcsetAttributeOnImage(t,e,n);}),a();})[\"catch\"](function(n){if(\"error\"!==t.status&&\"aborted\"!==t.status)throw n;\"error\"==t.status&&n&&s.showWarning(n,{title:o(\"aj\"),namespace:\"upload\"}),a(),i.enqueueChange(\"transparent\",function(t){t.remove(e);});});function a(){i.enqueueChange(\"transparent\",function(t){t.removeAttribute(\"uploadId\",e),t.removeAttribute(\"uploadStatus\",e);}),r.destroyLoader(t);}}},{key:\"_parseAndSetSrcsetAttributeOnImage\",value:function _parseAndSetSrcsetAttributeOnImage(t,e,n){var i=0;var o=Object.keys(t).filter(function(t){var e=parseInt(t,10);if(!isNaN(e))return i=Math.max(i,e),!0;}).map(function(e){return\"\".concat(t[e],\" \").concat(e,\"w\");}).join(\", \");\"\"!=o&&n.setAttribute(\"srcset\",{data:o,width:i},e);}}],[{key:\"requires\",get:function get(){return[Xd,Lu];}}]);return mf;}($l);var pf=/*#__PURE__*/function(_$l34){_inherits(pf,_$l34);var _super110=_createSuper(pf);function pf(){_classCallCheck(this,pf);return _super110.apply(this,arguments);}_createClass(pf,null,[{key:\"pluginName\",get:function get(){return\"ImageUpload\";}},{key:\"requires\",get:function get(){return[mf,ef,rf];}}]);return pf;}($l);var gf=/*#__PURE__*/function(_Zl12){_inherits(gf,_Zl12);var _super111=_createSuper(gf);function gf(){_classCallCheck(this,gf);return _super111.apply(this,arguments);}_createClass(gf,[{key:\"refresh\",value:function refresh(){var t=this.editor.model,e=Au(t.document.selection.getSelectedBlocks());this.value=!!e&&e.is(\"paragraph\"),this.isEnabled=!!e&&bf(e,t.schema);}},{key:\"execute\",value:function execute(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var e=this.editor.model,n=e.document;e.change(function(i){var o=(t.selection||n.selection).getSelectedBlocks();var _iterator285=_createForOfIteratorHelper(o),_step285;try{for(_iterator285.s();!(_step285=_iterator285.n()).done;){var _t243=_step285.value;!_t243.is(\"paragraph\")&&bf(_t243,e.schema)&&i.rename(_t243,\"paragraph\");}}catch(err){_iterator285.e(err);}finally{_iterator285.f();}});}}]);return gf;}(Zl);function bf(t,e){return e.checkChild(t.parent,\"paragraph\")&&!e.isObject(t);}var wf=/*#__PURE__*/function(_$l35){_inherits(wf,_$l35);var _super112=_createSuper(wf);function wf(){_classCallCheck(this,wf);return _super112.apply(this,arguments);}_createClass(wf,[{key:\"init\",value:function init(){var _this177=this;var t=this.editor,e=t.model,n=t.data;t.commands.add(\"paragraph\",new gf(t)),e.schema.register(\"paragraph\",{inheritAllFrom:\"$block\"}),t.conversion.elementToElement({model:\"paragraph\",view:\"p\"}),n.upcastDispatcher.on(\"element\",function(t,e,n){var i=n.writer;if(n.consumable.test(e.viewItem,{name:e.viewItem.name}))if(wf.paragraphLikeElements.has(e.viewItem.name)){if(e.viewItem.isEmpty)return;var _t244=i.createElement(\"paragraph\"),_o78=n.splitToAllowedParent(_t244,e.modelCursor);if(!_o78)return;i.insert(_t244,_o78.position);var _n$convertChildren3=n.convertChildren(e.viewItem,i.createPositionAt(_t244,0)),_r39=_n$convertChildren3.modelRange;e.modelRange=i.createRange(i.createPositionBefore(_t244),_r39.end),e.modelCursor=e.modelRange.end;}else kf(e.viewItem,e.modelCursor,n.schema)&&(e=Object.assign(e,_f(e.viewItem,e.modelCursor,n)));},{priority:\"low\"}),n.upcastDispatcher.on(\"text\",function(t,e,n){e.modelRange||kf(e.viewItem,e.modelCursor,n.schema)&&(e=Object.assign(e,_f(e.viewItem,e.modelCursor,n)));},{priority:\"lowest\"}),e.document.registerPostFixer(function(t){return _this177._autoparagraphEmptyRoots(t);}),t.data.on(\"ready\",function(){e.enqueueChange(\"transparent\",function(t){return _this177._autoparagraphEmptyRoots(t);});},{priority:\"lowest\"});}},{key:\"_autoparagraphEmptyRoots\",value:function _autoparagraphEmptyRoots(t){var e=this.editor.model;var _iterator286=_createForOfIteratorHelper(e.document.getRootNames()),_step286;try{for(_iterator286.s();!(_step286=_iterator286.n()).done;){var _n206=_step286.value;var _i166=e.document.getRoot(_n206);if(_i166.isEmpty&&\"$graveyard\"!=_i166.rootName&&e.schema.checkChild(_i166,\"paragraph\"))return t.insertElement(\"paragraph\",_i166),!0;}}catch(err){_iterator286.e(err);}finally{_iterator286.f();}}}],[{key:\"pluginName\",get:function get(){return\"Paragraph\";}}]);return wf;}($l);function _f(t,e,n){var i=n.writer.createElement(\"paragraph\");return n.writer.insert(i,e),n.convertItem(t,n.writer.createPositionAt(i,0));}function kf(t,e,n){var i=n.createContext(e);return!!n.checkChild(i,\"paragraph\")&&!!n.checkChild(i.push(\"paragraph\"),t);}wf.paragraphLikeElements=new Set([\"blockquote\",\"dd\",\"div\",\"dt\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\",\"li\",\"p\",\"td\"]);var vf=/*#__PURE__*/function(_Zl13){_inherits(vf,_Zl13);var _super113=_createSuper(vf);function vf(t,e){var _this178;_classCallCheck(this,vf);_this178=_super113.call(this,t),_this178.modelElements=e;return _this178;}_createClass(vf,[{key:\"refresh\",value:function refresh(){var _this179=this;var t=Au(this.editor.model.document.selection.getSelectedBlocks());this.value=!!t&&this.modelElements.includes(t.name)&&t.name,this.isEnabled=!!t&&this.modelElements.some(function(e){return yf(t,e,_this179.editor.model.schema);});}},{key:\"execute\",value:function execute(t){var e=this.editor.model,n=e.document,i=t.value;e.change(function(t){var o=Array.from(n.selection.getSelectedBlocks()).filter(function(t){return yf(t,i,e.schema);});var _iterator287=_createForOfIteratorHelper(o),_step287;try{for(_iterator287.s();!(_step287=_iterator287.n()).done;){var _e216=_step287.value;_e216.is(i)||t.rename(_e216,i);}}catch(err){_iterator287.e(err);}finally{_iterator287.f();}});}}]);return vf;}(Zl);function yf(t,e,n){return n.checkChild(t.parent,e)&&!n.isObject(t);}var xf=\"paragraph\";var Af=/*#__PURE__*/function(_$l36){_inherits(Af,_$l36);var _super114=_createSuper(Af);function Af(t){var _this180;_classCallCheck(this,Af);_this180=_super114.call(this,t),t.config.define(\"heading\",{options:[{model:\"paragraph\",title:\"Paragraph\",\"class\":\"ck-heading_paragraph\"},{model:\"heading1\",view:\"h2\",title:\"Heading 1\",\"class\":\"ck-heading_heading1\"},{model:\"heading2\",view:\"h3\",title:\"Heading 2\",\"class\":\"ck-heading_heading2\"},{model:\"heading3\",view:\"h4\",title:\"Heading 3\",\"class\":\"ck-heading_heading3\"}]});return _this180;}_createClass(Af,[{key:\"init\",value:function init(){var t=this.editor,e=t.config.get(\"heading.options\"),n=[];var _iterator288=_createForOfIteratorHelper(e),_step288;try{for(_iterator288.s();!(_step288=_iterator288.n()).done;){var _i167=_step288.value;_i167.model!==xf&&(t.model.schema.register(_i167.model,{inheritAllFrom:\"$block\"}),t.conversion.elementToElement(_i167),n.push(_i167.model));}}catch(err){_iterator288.e(err);}finally{_iterator288.f();}this._addDefaultH1Conversion(t),t.commands.add(\"heading\",new vf(t,n));}},{key:\"afterInit\",value:function afterInit(){var t=this.editor,e=t.commands.get(\"enter\"),n=t.config.get(\"heading.options\");e&&this.listenTo(e,\"afterExecute\",function(e,i){var o=t.model.document.selection.getFirstPosition().parent;n.some(function(t){return o.is(t.model);})&&!o.is(xf)&&0===o.childCount&&i.writer.rename(o,xf);});}},{key:\"_addDefaultH1Conversion\",value:function _addDefaultH1Conversion(t){t.conversion[\"for\"](\"upcast\").elementToElement({model:\"heading1\",view:\"h1\",converterPriority:Zn.get(\"low\")+1});}}],[{key:\"requires\",get:function get(){return[wf];}}]);return Af;}($l);var Cf=/*#__PURE__*/_createClass(function Cf(t,e){_classCallCheck(this,Cf);e&&Li(this,e),t&&this.set(t);});ci(Cf,Fi);var Tf=/*#__PURE__*/function(_Nl16){_inherits(Tf,_Nl16);var _super115=_createSuper(Tf);function Tf(t){var _this181;_classCallCheck(this,Tf);_this181=_super115.call(this,t);var e=_this181.bindTemplate;_this181.set(\"isVisible\",!1),_this181.set(\"position\",\"se\"),_this181.children=_this181.createCollection(),_this181.setTemplate({tag:\"div\",attributes:{\"class\":[\"ck\",\"ck-reset\",\"ck-dropdown__panel\",e.to(\"position\",function(t){return\"ck-dropdown__panel_\".concat(t);}),e[\"if\"](\"isVisible\",\"ck-dropdown__panel-visible\")]},children:_this181.children,on:{selectstart:e.to(function(t){return t.preventDefault();})}});return _this181;}_createClass(Tf,[{key:\"focus\",value:function focus(){this.children.length&&this.children.first.focus();}},{key:\"focusLast\",value:function focusLast(){if(this.children.length){var _t245=this.children.last;\"function\"==typeof _t245.focusLast?_t245.focusLast():_t245.focus();}}}]);return Tf;}(Nl);n(84);var Pf=/*#__PURE__*/function(_Nl17){_inherits(Pf,_Nl17);var _super116=_createSuper(Pf);function Pf(t,e,n){var _this182;_classCallCheck(this,Pf);_this182=_super116.call(this,t);var i=_this182.bindTemplate;_this182.buttonView=e,_this182.panelView=n,_this182.set(\"isOpen\",!1),_this182.set(\"isEnabled\",!0),_this182.set(\"class\"),_this182.set(\"panelPosition\",\"auto\"),_this182.focusTracker=new il(),_this182.keystrokes=new Gc(),_this182.setTemplate({tag:\"div\",attributes:{\"class\":[\"ck\",\"ck-dropdown\",i.to(\"class\"),i[\"if\"](\"isEnabled\",\"ck-disabled\",function(t){return!t;})]},children:[e,n]}),e.extendTemplate({attributes:{\"class\":[\"ck-dropdown__button\"]}});return _this182;}_createClass(Pf,[{key:\"render\",value:function render(){var _this183=this;_get(_getPrototypeOf(Pf.prototype),\"render\",this).call(this),this.listenTo(this.buttonView,\"open\",function(){_this183.isOpen=!_this183.isOpen;}),this.panelView.bind(\"isVisible\").to(this,\"isOpen\"),this.on(\"change:isOpen\",function(){if(_this183.isOpen)if(\"auto\"===_this183.panelPosition){var _t246=Pf.defaultPanelPositions;_this183.panelView.position=Oh({element:_this183.panelView.element,target:_this183.buttonView.element,fitInViewport:!0,positions:[_t246.southEast,_t246.southWest,_t246.northEast,_t246.northWest]}).name;}else _this183.panelView.position=_this183.panelPosition;}),this.keystrokes.listenTo(this.element),this.focusTracker.add(this.element);var t=function t(_t247,e){_this183.isOpen&&(_this183.buttonView.focus(),_this183.isOpen=!1,e());};this.keystrokes.set(\"arrowdown\",function(t,e){_this183.buttonView.isEnabled&&!_this183.isOpen&&(_this183.isOpen=!0,e());}),this.keystrokes.set(\"arrowright\",function(t,e){_this183.isOpen&&e();}),this.keystrokes.set(\"arrowleft\",t),this.keystrokes.set(\"esc\",t);}},{key:\"focus\",value:function focus(){this.buttonView.focus();}}]);return Pf;}(Nl);Pf.defaultPanelPositions={southEast:function southEast(t){return{top:t.bottom,left:t.left,name:\"se\"};},southWest:function southWest(t,e){return{top:t.bottom,left:t.left-e.width+t.width,name:\"sw\"};},northEast:function northEast(t,e){return{top:t.top-e.height,left:t.left,name:\"ne\"};},northWest:function northWest(t,e){return{top:t.bottom-e.height,left:t.left-e.width+t.width,name:\"nw\"};}};var Mf=n(30),Ef=n.n(Mf);var Sf=/*#__PURE__*/function(_qd){_inherits(Sf,_qd);var _super117=_createSuper(Sf);function Sf(t){var _this184;_classCallCheck(this,Sf);_this184=_super117.call(this,t),_this184.arrowView=_this184._createArrowView(),_this184.extendTemplate({attributes:{\"aria-haspopup\":!0}}),_this184.delegate(\"execute\").to(_assertThisInitialized(_this184),\"open\");return _this184;}_createClass(Sf,[{key:\"render\",value:function render(){_get(_getPrototypeOf(Sf.prototype),\"render\",this).call(this),this.children.add(this.arrowView);}},{key:\"_createArrowView\",value:function _createArrowView(){var t=new Ud();return t.content=Ef.a,t.extendTemplate({attributes:{\"class\":\"ck-dropdown__arrow\"}}),t;}}]);return Sf;}(qd);n(86);var If=/*#__PURE__*/function(_Nl18){_inherits(If,_Nl18);var _super118=_createSuper(If);function If(){var _this185;_classCallCheck(this,If);_this185=_super118.call(this),_this185.items=_this185.createCollection(),_this185.focusTracker=new il(),_this185.keystrokes=new Gc(),_this185._focusCycler=new Fl({focusables:_this185.items,focusTracker:_this185.focusTracker,keystrokeHandler:_this185.keystrokes,actions:{focusPrevious:\"arrowup\",focusNext:\"arrowdown\"}}),_this185.setTemplate({tag:\"ul\",attributes:{\"class\":[\"ck\",\"ck-reset\",\"ck-list\"]},children:_this185.items});return _this185;}_createClass(If,[{key:\"render\",value:function render(){var _this186=this;_get(_getPrototypeOf(If.prototype),\"render\",this).call(this);var _iterator289=_createForOfIteratorHelper(this.items),_step289;try{for(_iterator289.s();!(_step289=_iterator289.n()).done;){var _t248=_step289.value;this.focusTracker.add(_t248.element);}}catch(err){_iterator289.e(err);}finally{_iterator289.f();}this.items.on(\"add\",function(t,e){_this186.focusTracker.add(e.element);}),this.items.on(\"remove\",function(t,e){_this186.focusTracker.remove(e.element);}),this.keystrokes.listenTo(this.element);}},{key:\"focus\",value:function focus(){this._focusCycler.focusFirst();}},{key:\"focusLast\",value:function focusLast(){this._focusCycler.focusLast();}}]);return If;}(Nl);var Nf=/*#__PURE__*/function(_Nl19){_inherits(Nf,_Nl19);var _super119=_createSuper(Nf);function Nf(t){var _this187;_classCallCheck(this,Nf);_this187=_super119.call(this,t),_this187.children=_this187.createCollection(),_this187.setTemplate({tag:\"li\",attributes:{\"class\":[\"ck\",\"ck-list__item\"]},children:_this187.children});return _this187;}_createClass(Nf,[{key:\"focus\",value:function focus(){this.children.first.focus();}}]);return Nf;}(Nl);var Of=/*#__PURE__*/function(_Nl20){_inherits(Of,_Nl20);var _super120=_createSuper(Of);function Of(t){var _this188;_classCallCheck(this,Of);_this188=_super120.call(this,t),_this188.setTemplate({tag:\"li\",attributes:{\"class\":[\"ck\",\"ck-list__separator\"]}});return _this188;}return _createClass(Of);}(Nl);n(88);var Rf=/*#__PURE__*/function(_qd2){_inherits(Rf,_qd2);var _super121=_createSuper(Rf);function Rf(t){var _this189;_classCallCheck(this,Rf);_this189=_super121.call(this,t),_this189.toggleSwitchView=_this189._createToggleView(),_this189.extendTemplate({attributes:{\"class\":\"ck-switchbutton\"}});return _this189;}_createClass(Rf,[{key:\"render\",value:function render(){_get(_getPrototypeOf(Rf.prototype),\"render\",this).call(this),this.children.add(this.toggleSwitchView);}},{key:\"_createToggleView\",value:function _createToggleView(){var t=new Nl();return t.setTemplate({tag:\"span\",attributes:{\"class\":[\"ck\",\"ck-button__toggle\"]},children:[{tag:\"span\",attributes:{\"class\":[\"ck\",\"ck-button__toggle__inner\"]}}]}),t;}}]);return Rf;}(qd);n(90),n(92);function Df(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:Sf;var n=new e(t),i=new Tf(t),o=new Pf(t,n,i);return n.bind(\"isEnabled\").to(o),n instanceof Sf?n.bind(\"isOn\").to(o,\"isOpen\"):n.arrowView.bind(\"isOn\").to(o,\"isOpen\"),function(t){(function(t){t.on(\"render\",function(){Ah({emitter:t,activator:function activator(){return t.isOpen;},callback:function callback(){t.isOpen=!1;},contextElements:[t.element]});});})(t),function(t){t.on(\"execute\",function(e){e.source instanceof Rf||(t.isOpen=!1);});}(t),function(t){t.keystrokes.set(\"arrowdown\",function(e,n){t.isOpen&&(t.panelView.focus(),n());}),t.keystrokes.set(\"arrowup\",function(e,n){t.isOpen&&(t.panelView.focusLast(),n());});}(t);}(o),o;}function Lf(t,e){var n=t.locale,i=t.listView=new If(n);i.items.bindTo(e).using(function(_ref24){var t=_ref24.type,e=_ref24.model;if(\"separator\"===t)return new Of(n);if(\"button\"===t||\"switchbutton\"===t){var _o80;var _i168=new Nf(n);var _o79;return(_o80=_o79=\"button\"===t?new qd(n):new Rf(n)).bind.apply(_o80,_toConsumableArray(Object.keys(e))).to(e),_o79.delegate(\"execute\").to(_i168),_i168.children.add(_o79),_i168;}}),t.panelView.children.add(i),i.items.delegate(\"execute\").to(t);}n(17);var jf=/*#__PURE__*/function(_$l37){_inherits(jf,_$l37);var _super122=_createSuper(jf);function jf(){_classCallCheck(this,jf);return _super122.apply(this,arguments);}_createClass(jf,[{key:\"init\",value:function init(){var _this190=this;var t=this.editor,e=t.t,n=function(t){var e=t.t,n={Paragraph:e(\"bi\"),\"Heading 1\":e(\"bj\"),\"Heading 2\":e(\"bk\"),\"Heading 3\":e(\"bl\"),\"Heading 4\":e(\"bm\"),\"Heading 5\":e(\"bn\"),\"Heading 6\":e(\"bo\")};return t.config.get(\"heading.options\").map(function(t){var e=n[t.title];return e&&e!=t.title&&(t.title=e),t;});}(t),i=e(\"f\"),o=e(\"g\");t.ui.componentFactory.add(\"heading\",function(e){var r={},s=new oo(),a=t.commands.get(\"heading\"),c=t.commands.get(\"paragraph\"),l=[a];var _iterator290=_createForOfIteratorHelper(n),_step290;try{var _loop6=function _loop6(){var t=_step290.value;var e={type:\"button\",model:new Cf({label:t.title,\"class\":t[\"class\"],withText:!0})};\"paragraph\"===t.model?(e.model.bind(\"isOn\").to(c,\"value\"),e.model.set(\"commandName\",\"paragraph\"),l.push(c)):(e.model.bind(\"isOn\").to(a,\"value\",function(e){return e===t.model;}),e.model.set({commandName:\"heading\",commandValue:t.model})),s.add(e),r[t.model]=t.title;};for(_iterator290.s();!(_step290=_iterator290.n()).done;){_loop6();}}catch(err){_iterator290.e(err);}finally{_iterator290.f();}var d=Df(e);return Lf(d,s),d.buttonView.set({isOn:!1,withText:!0,tooltip:o}),d.extendTemplate({attributes:{\"class\":[\"ck-heading-dropdown\"]}}),d.bind(\"isEnabled\").toMany(l,\"isEnabled\",function(){for(var _len18=arguments.length,t=new Array(_len18),_key18=0;_key18<_len18;_key18++){t[_key18]=arguments[_key18];}return t.some(function(t){return t;});}),d.buttonView.bind(\"label\").to(a,\"value\",c,\"value\",function(t,e){var n=t||e&&\"paragraph\";return r[n]?r[n]:i;}),_this190.listenTo(d,\"execute\",function(e){t.execute(e.source.commandName,e.source.commandValue?{value:e.source.commandValue}:void 0),t.editing.view.focus();}),d;});}}]);return jf;}($l);function Vf(t){var _iterator291=_createForOfIteratorHelper(t.getChildren()),_step291;try{for(_iterator291.s();!(_step291=_iterator291.n()).done;){var _e217=_step291.value;if(_e217&&_e217.is(\"caption\"))return _e217;}}catch(err){_iterator291.e(err);}finally{_iterator291.f();}return null;}function Bf(t){var e=t.parent;return\"figcaption\"==t.name&&e&&\"figure\"==e.name&&e.hasClass(\"image\")?{name:!0}:null;}var zf=/*#__PURE__*/function(_$l38){_inherits(zf,_$l38);var _super123=_createSuper(zf);function zf(){_classCallCheck(this,zf);return _super123.apply(this,arguments);}_createClass(zf,[{key:\"init\",value:function init(){var _this191=this;var t=this.editor,e=t.editing.view,n=t.model.schema,i=t.data,o=t.editing,r=t.t;n.register(\"caption\",{allowIn:\"image\",allowContentOf:\"$block\",isLimit:!0}),t.model.document.registerPostFixer(function(t){return _this191._insertMissingModelCaptionElement(t);}),t.conversion[\"for\"](\"upcast\").elementToElement({view:Bf,model:\"caption\"});i.downcastDispatcher.on(\"insert:caption\",Ff(function(t){return t.createContainerElement(\"figcaption\");},!1));var s=function(t,e){return function(n){var i=n.createEditableElement(\"figcaption\");return n.setCustomProperty(\"imageCaption\",!0,i),sl({view:t,element:i,text:e}),ch(i,n);};}(e,r(\"ai\"));o.downcastDispatcher.on(\"insert:caption\",Ff(s)),o.downcastDispatcher.on(\"insert\",this._fixCaptionVisibility(function(t){return t.item;}),{priority:\"high\"}),o.downcastDispatcher.on(\"remove\",this._fixCaptionVisibility(function(t){return t.position.parent;}),{priority:\"high\"}),e.document.registerPostFixer(function(t){return _this191._updateCaptionVisibility(t);});}},{key:\"_updateCaptionVisibility\",value:function _updateCaptionVisibility(t){var e=this.editor.editing.mapper,n=this._lastSelectedCaption;var i;var o=this.editor.model.document.selection,r=o.getSelectedElement();if(r&&r.is(\"image\")){var _t249=Vf(r);i=e.toViewElement(_t249);}var s=Uf(o.getFirstPosition().parent);if(s&&(i=e.toViewElement(s)),i)return n?n===i?qf(i,t):(Hf(n,t),this._lastSelectedCaption=i,qf(i,t)):(this._lastSelectedCaption=i,qf(i,t));if(n){var _e218=Hf(n,t);return this._lastSelectedCaption=null,_e218;}return!1;}},{key:\"_fixCaptionVisibility\",value:function _fixCaptionVisibility(t){var _this192=this;return function(e,n,i){var o=Uf(t(n)),r=_this192.editor.editing.mapper,s=i.writer;if(o){var _t250=r.toViewElement(o);_t250&&(o.childCount?s.removeClass(\"ck-hidden\",_t250):s.addClass(\"ck-hidden\",_t250));}};}},{key:\"_insertMissingModelCaptionElement\",value:function _insertMissingModelCaptionElement(t){var e=this.editor.model,n=e.document.differ.getChanges(),i=[];var _iterator292=_createForOfIteratorHelper(n),_step292;try{for(_iterator292.s();!(_step292=_iterator292.n()).done;){var _t251=_step292.value;if(\"insert\"==_t251.type&&\"$text\"!=_t251.name){var _n207=_t251.position.nodeAfter;if(_n207.is(\"image\")&&!Vf(_n207)&&i.push(_n207),!_n207.is(\"image\")&&_n207.childCount){var _iterator293=_createForOfIteratorHelper(e.createRangeIn(_n207).getItems()),_step293;try{for(_iterator293.s();!(_step293=_iterator293.n()).done;){var _t252=_step293.value;_t252.is(\"image\")&&!Vf(_t252)&&i.push(_t252);}}catch(err){_iterator293.e(err);}finally{_iterator293.f();}}}}}catch(err){_iterator292.e(err);}finally{_iterator292.f();}for(var _i170=0,_i169=i;_i170<_i169.length;_i170++){var _e219=_i169[_i170];t.appendElement(\"caption\",_e219);}return!!i.length;}}]);return zf;}($l);function Ff(t){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:!0;return function(n,i,o){var r=i.item;if((r.childCount||e)&&hh(r.parent)){if(!o.consumable.consume(i.item,\"insert\"))return;var _e220=o.mapper.toViewElement(i.range.start.parent),_n208=t(o.writer),_s24=o.writer;r.childCount||_s24.addClass(\"ck-hidden\",_n208),function(t,e,n,i){var o=i.writer.createPositionAt(n,\"end\");i.writer.insert(o,t),i.mapper.bindElements(e,t);}(_n208,i.item,_e220,o);}};}function Uf(t){var e=t.getAncestors({includeSelf:!0}).find(function(t){return\"caption\"==t.name;});return e&&e.parent&&\"image\"==e.parent.name?e:null;}function Hf(t,e){return!t.childCount&&!t.hasClass(\"ck-hidden\")&&(e.addClass(\"ck-hidden\",t),!0);}function qf(t,e){return!!t.hasClass(\"ck-hidden\")&&(e.removeClass(\"ck-hidden\",t),!0);}n(95);var Wf=/*#__PURE__*/function(_Zl14){_inherits(Wf,_Zl14);var _super124=_createSuper(Wf);function Wf(t,e){var _this193;_classCallCheck(this,Wf);_this193=_super124.call(this,t),_this193._defaultStyle=!1,_this193.styles=e.reduce(function(t,e){return t[e.name]=e,e.isDefault&&(_this193._defaultStyle=e.name),t;},{});return _this193;}_createClass(Wf,[{key:\"refresh\",value:function refresh(){var t=this.editor.model.document.selection.getSelectedElement();if(this.isEnabled=hh(t),t){if(t.hasAttribute(\"imageStyle\")){var _e221=t.getAttribute(\"imageStyle\");this.value=!!this.styles[_e221]&&_e221;}else this.value=this._defaultStyle;}else this.value=!1;}},{key:\"execute\",value:function execute(t){var _this194=this;var e=t.value,n=this.editor.model,i=n.document.selection.getSelectedElement();n.change(function(t){_this194.styles[e].isDefault?t.removeAttribute(\"imageStyle\",i):t.setAttribute(\"imageStyle\",e,i);});}}]);return Wf;}(Zl);function Yf(t,e){var _iterator294=_createForOfIteratorHelper(e),_step294;try{for(_iterator294.s();!(_step294=_iterator294.n()).done;){var _n209=_step294.value;if(_n209.name===t)return _n209;}}catch(err){_iterator294.e(err);}finally{_iterator294.f();}}var $f=n(13),Gf=n.n($f),Qf=n(14),Jf=n.n(Qf),Kf=n(15),Zf=n.n(Kf),Xf=n(10),tm=n.n(Xf);var em={full:{name:\"full\",title:\"Full size image\",icon:Gf.a,isDefault:!0},side:{name:\"side\",title:\"Side image\",icon:tm.a,className:\"image-style-side\"},alignLeft:{name:\"alignLeft\",title:\"Left aligned image\",icon:Jf.a,className:\"image-style-align-left\"},alignCenter:{name:\"alignCenter\",title:\"Centered image\",icon:Zf.a,className:\"image-style-align-center\"},alignRight:{name:\"alignRight\",title:\"Right aligned image\",icon:tm.a,className:\"image-style-align-right\"}},nm={full:Gf.a,left:Jf.a,right:tm.a,center:Zf.a};function im(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return t.map(om);}function om(t){if(\"string\"==typeof t){var _e222=t;em[_e222]?t=Object.assign({},em[_e222]):(bs.a.warn(\"image-style-not-found: There is no such image style of given name.\",{name:_e222}),t={name:_e222});}else if(em[t.name]){var _e223=em[t.name],_n210=Object.assign({},t);for(var _i171 in _e223)t.hasOwnProperty(_i171)||(_n210[_i171]=_e223[_i171]);t=_n210;}return\"string\"==typeof t.icon&&nm[t.icon]&&(t.icon=nm[t.icon]),t;}var rm=/*#__PURE__*/function(_$l39){_inherits(rm,_$l39);var _super125=_createSuper(rm);function rm(){_classCallCheck(this,rm);return _super125.apply(this,arguments);}_createClass(rm,[{key:\"init\",value:function init(){var t=this.editor,e=t.model.schema,n=t.data,i=t.editing;t.config.define(\"image.styles\",[\"full\",\"side\"]);var o=im(t.config.get(\"image.styles\"));e.extend(\"image\",{allowAttributes:\"imageStyle\"});var r=function(t){return function(e,n,i){if(!i.consumable.consume(n.item,e.name))return;var o=Yf(n.attributeNewValue,t),r=Yf(n.attributeOldValue,t),s=i.mapper.toViewElement(n.item),a=i.writer;r&&a.removeClass(r.className,s),o&&a.addClass(o.className,s);};}(o);i.downcastDispatcher.on(\"attribute:imageStyle:image\",r),n.downcastDispatcher.on(\"attribute:imageStyle:image\",r),n.upcastDispatcher.on(\"element:figure\",function(t){var e=t.filter(function(t){return!t.isDefault;});return function(t,n,i){if(!n.modelRange)return;var o=n.viewItem,r=Au(n.modelRange.getItems());if(i.schema.checkAttribute(r,\"imageStyle\")){var _iterator295=_createForOfIteratorHelper(e),_step295;try{for(_iterator295.s();!(_step295=_iterator295.n()).done;){var _t253=_step295.value;i.consumable.consume(o,{classes:_t253.className})&&i.writer.setAttribute(\"imageStyle\",_t253.name,r);}}catch(err){_iterator295.e(err);}finally{_iterator295.f();}}};}(o),{priority:\"low\"}),t.commands.add(\"imageStyle\",new Wf(t,o));}}],[{key:\"pluginName\",get:function get(){return\"ImageStyleEditing\";}}]);return rm;}($l);n(97);var sm=/*#__PURE__*/function(_$l40){_inherits(sm,_$l40);var _super126=_createSuper(sm);function sm(){_classCallCheck(this,sm);return _super126.apply(this,arguments);}_createClass(sm,[{key:\"localizedDefaultStylesTitles\",get:function get(){var t=this.editor.t;return{\"Full size image\":t(\"i\"),\"Side image\":t(\"j\"),\"Left aligned image\":t(\"k\"),\"Centered image\":t(\"l\"),\"Right aligned image\":t(\"m\")};}},{key:\"init\",value:function init(){var t=function(t,e){var _iterator296=_createForOfIteratorHelper(t),_step296;try{for(_iterator296.s();!(_step296=_iterator296.n()).done;){var _n211=_step296.value;e[_n211.title]&&(_n211.title=e[_n211.title]);}}catch(err){_iterator296.e(err);}finally{_iterator296.f();}return t;}(im(this.editor.config.get(\"image.styles\")),this.localizedDefaultStylesTitles);var _iterator297=_createForOfIteratorHelper(t),_step297;try{for(_iterator297.s();!(_step297=_iterator297.n()).done;){var _e224=_step297.value;this._createButton(_e224);}}catch(err){_iterator297.e(err);}finally{_iterator297.f();}}},{key:\"_createButton\",value:function _createButton(t){var _this195=this;var e=this.editor,n=\"imageStyle:\".concat(t.name);e.ui.componentFactory.add(n,function(n){var i=e.commands.get(\"imageStyle\"),o=new qd(n);return o.set({label:t.title,icon:t.icon,tooltip:!0}),o.bind(\"isEnabled\").to(i,\"isEnabled\"),o.bind(\"isOn\").to(i,\"value\",function(e){return e===t.name;}),_this195.listenTo(o,\"execute\",function(){return e.execute(\"imageStyle\",{value:t.name});}),o;});}}],[{key:\"pluginName\",get:function get(){return\"ImageStyleUI\";}}]);return sm;}($l);var am=/*#__PURE__*/function(_$l41){_inherits(am,_$l41);var _super127=_createSuper(am);function am(){_classCallCheck(this,am);return _super127.apply(this,arguments);}_createClass(am,[{key:\"init\",value:function init(){var _this196=this;var t=this.editor;if(t.plugins.has(\"BalloonToolbar\")){var _e225=t.plugins.get(\"BalloonToolbar\");this.listenTo(_e225,\"show\",function(e){(function(t){var e=t.getSelectedElement();return!(!e||!rh(e));})(t.editing.view.document.selection)&&e.stop();},{priority:\"high\"});}this._toolbarDefinitions=new Map(),this._balloon=this.editor.plugins.get(\"ContextualBalloon\"),this.listenTo(t.ui,\"update\",function(){_this196._updateToolbarsVisibility();}),this.listenTo(t.ui.focusTracker,\"change:isFocused\",function(){_this196._updateToolbarsVisibility();},{priority:\"low\"});}},{key:\"destroy\",value:function destroy(){_get(_getPrototypeOf(am.prototype),\"destroy\",this).call(this);var _iterator298=_createForOfIteratorHelper(this._toolbarDefinitions.values()),_step298;try{for(_iterator298.s();!(_step298=_iterator298.n()).done;){var _t254=_step298.value;_t254.view.destroy();}}catch(err){_iterator298.e(err);}finally{_iterator298.f();}}},{key:\"register\",value:function register(t,_ref25){var e=_ref25.items,n=_ref25.getRelatedElement,_ref25$balloonClassNa=_ref25.balloonClassName,i=_ref25$balloonClassNa===void 0?\"ck-toolbar-container\":_ref25$balloonClassNa;var o=this.editor,r=new ql();if(this._toolbarDefinitions.has(t))throw new Gn.b(\"widget-toolbar-duplicated: Toolbar with the given id was already added.\",{toolbarId:t});r.fillFromConfig(e,o.ui.componentFactory),this._toolbarDefinitions.set(t,{view:r,getRelatedElement:n,balloonClassName:i});}},{key:\"_updateToolbarsVisibility\",value:function _updateToolbarsVisibility(){var t=0,e=null,n=null;var _iterator299=_createForOfIteratorHelper(this._toolbarDefinitions.values()),_step299;try{for(_iterator299.s();!(_step299=_iterator299.n()).done;){var _i172=_step299.value;var _o81=_i172.getRelatedElement(this.editor.editing.view.document.selection);if(this.editor.ui.focusTracker.isFocused&&_o81){var _r40=_o81.getAncestors().length;_r40>t&&(t=_r40,e=_o81,n=_i172);}else this._hideToolbar(_i172);}}catch(err){_iterator299.e(err);}finally{_iterator299.f();}n&&this._showToolbar(n,e);}},{key:\"_hideToolbar\",value:function _hideToolbar(t){this._isToolbarVisible(t)&&this._balloon.remove(t.view);}},{key:\"_showToolbar\",value:function _showToolbar(t,e){this._isToolbarVisible(t)?function(t,e){var n=t.plugins.get(\"ContextualBalloon\"),i=cm(t,e);n.updatePosition(i);}(this.editor,e):this._balloon.hasView(t.view)||this._balloon.add({view:t.view,position:cm(this.editor,e),balloonClassName:t.balloonClassName});}},{key:\"_isToolbarVisible\",value:function _isToolbarVisible(t){return this._balloon.visibleView==t.view;}}],[{key:\"requires\",get:function get(){return[Uh];}},{key:\"pluginName\",get:function get(){return\"WidgetToolbarRepository\";}}]);return am;}($l);function cm(t,e){var n=t.editing.view,i=Vh.defaultPositions;return{target:n.domConverter.viewToDom(e),positions:[i.northArrowSouth,i.northArrowSouthWest,i.northArrowSouthEast,i.southArrowNorth,i.southArrowNorthWest,i.southArrowNorthEast]};}function lm(t,e,n){return n.createRange(dm(t,e,!0,n),dm(t,e,!1,n));}function dm(t,e,n,i){var o=t.textNode||(n?t.nodeBefore:t.nodeAfter),r=null;for(;o&&o.getAttribute(\"linkHref\")==e;)r=o,o=n?o.previousSibling:o.nextSibling;return r?i.createPositionAt(r,n?\"before\":\"after\"):t;}var um=/*#__PURE__*/function(_Zl15){_inherits(um,_Zl15);var _super128=_createSuper(um);function um(){_classCallCheck(this,um);return _super128.apply(this,arguments);}_createClass(um,[{key:\"refresh\",value:function refresh(){var t=this.editor.model,e=t.document;this.value=e.selection.getAttribute(\"linkHref\"),this.isEnabled=t.schema.checkAttributeInSelection(e.selection,\"linkHref\");}},{key:\"execute\",value:function execute(t){var e=this.editor.model,n=e.document.selection;e.change(function(i){if(n.isCollapsed){var _o82=n.getFirstPosition();if(n.hasAttribute(\"linkHref\")){var _o83=lm(n.getFirstPosition(),n.getAttribute(\"linkHref\"),e);i.setAttribute(\"linkHref\",t,_o83),i.setSelection(_o83);}else if(\"\"!==t){var _e226=Vs(n.getAttributes());_e226.set(\"linkHref\",t);var _r41=i.createText(t,_e226);i.insert(_r41,_o82),i.setSelection(i.createRangeOn(_r41));}}else{var _o84=e.schema.getValidRanges(n.getRanges(),\"linkHref\");var _iterator300=_createForOfIteratorHelper(_o84),_step300;try{for(_iterator300.s();!(_step300=_iterator300.n()).done;){var _e227=_step300.value;i.setAttribute(\"linkHref\",t,_e227);}}catch(err){_iterator300.e(err);}finally{_iterator300.f();}}});}}]);return um;}(Zl);var hm=/*#__PURE__*/function(_Zl16){_inherits(hm,_Zl16);var _super129=_createSuper(hm);function hm(){_classCallCheck(this,hm);return _super129.apply(this,arguments);}_createClass(hm,[{key:\"refresh\",value:function refresh(){this.isEnabled=this.editor.model.document.selection.hasAttribute(\"linkHref\");}},{key:\"execute\",value:function execute(){var t=this.editor.model,e=t.document.selection;t.change(function(n){var i=e.isCollapsed?[lm(e.getFirstPosition(),e.getAttribute(\"linkHref\"),t)]:e.getRanges();var _iterator301=_createForOfIteratorHelper(i),_step301;try{for(_iterator301.s();!(_step301=_iterator301.n()).done;){var _t255=_step301.value;n.removeAttribute(\"linkHref\",_t255);}}catch(err){_iterator301.e(err);}finally{_iterator301.f();}});}}]);return hm;}(Zl);var fm=/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205f\\u3000]/g,mm=/^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;function pm(t,e){var n=e.createAttributeElement(\"a\",{href:t},{priority:5});return e.setCustomProperty(\"link\",!0,n),n;}function gm(t){return function(t){return t.replace(fm,\"\").match(mm);}(t=String(t))?t:\"#\";}var bm=/*#__PURE__*/function(){function bm(t,e,n){var _this197=this;_classCallCheck(this,bm);this.model=t,this.attribute=n,this._modelSelection=t.document.selection,this._overrideUid=null,this._isNextGravityRestorationSkipped=!1,e.listenTo(this._modelSelection,\"change:range\",function(t,e){_this197._isNextGravityRestorationSkipped?_this197._isNextGravityRestorationSkipped=!1:_this197._isGravityOverridden&&(!e.directChange&&wm(_this197._modelSelection.getFirstPosition(),n)||_this197._restoreGravity());});}_createClass(bm,[{key:\"handleForwardMovement\",value:function handleForwardMovement(t,e){var n=this.attribute;if(!(this._isGravityOverridden||t.isAtStart&&this._hasSelectionAttribute))return vm(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._removeSelectionAttribute(),!0):_m(t,n)?(this._preventCaretMovement(e),this._overrideGravity(),!0):km(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._overrideGravity(),!0):void 0;}},{key:\"handleBackwardMovement\",value:function handleBackwardMovement(t,e){var n=this.attribute;return this._isGravityOverridden?vm(t,n)&&this._hasSelectionAttribute?(this._preventCaretMovement(e),this._restoreGravity(),this._removeSelectionAttribute(),!0):(this._preventCaretMovement(e),this._restoreGravity(),t.isAtStart&&this._removeSelectionAttribute(),!0):vm(t,n)&&!this._hasSelectionAttribute?(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtEnd&&km(t,n)?this._hasSelectionAttribute?void(ym(t,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity())):(this._preventCaretMovement(e),this._setSelectionAttributeFromTheNodeBefore(t),!0):t.isAtStart?this._hasSelectionAttribute?(this._removeSelectionAttribute(),this._preventCaretMovement(e),!0):void 0:void(ym(t,n)&&(this._skipNextAutomaticGravityRestoration(),this._overrideGravity()));}},{key:\"_isGravityOverridden\",get:function get(){return!!this._overrideUid;}},{key:\"_hasSelectionAttribute\",get:function get(){return this._modelSelection.hasAttribute(this.attribute);}},{key:\"_overrideGravity\",value:function _overrideGravity(){this._overrideUid=this.model.change(function(t){return t.overrideSelectionGravity();});}},{key:\"_restoreGravity\",value:function _restoreGravity(){var _this198=this;this.model.change(function(t){t.restoreSelectionGravity(_this198._overrideUid),_this198._overrideUid=null;});}},{key:\"_preventCaretMovement\",value:function _preventCaretMovement(t){t.preventDefault();}},{key:\"_removeSelectionAttribute\",value:function _removeSelectionAttribute(){var _this199=this;this.model.change(function(t){t.removeSelectionAttribute(_this199.attribute);});}},{key:\"_setSelectionAttributeFromTheNodeBefore\",value:function _setSelectionAttributeFromTheNodeBefore(t){var _this200=this;var e=this.attribute;this.model.change(function(n){n.setSelectionAttribute(_this200.attribute,t.nodeBefore.getAttribute(e));});}},{key:\"_skipNextAutomaticGravityRestoration\",value:function _skipNextAutomaticGravityRestoration(){this._isNextGravityRestorationSkipped=!0;}}]);return bm;}();function wm(t,e){return _m(t,e)||km(t,e);}function _m(t,e){var n=t.nodeBefore,i=t.nodeAfter,o=!!n&&n.hasAttribute(e);return!!i&&i.hasAttribute(e)&&(!o||n.getAttribute(e)!==i.getAttribute(e));}function km(t,e){var n=t.nodeBefore,i=t.nodeAfter,o=!!n&&n.hasAttribute(e),r=!!i&&i.hasAttribute(e);return o&&(!r||n.getAttribute(e)!==i.getAttribute(e));}function vm(t,e){var n=t.nodeBefore,i=t.nodeAfter,o=!!n&&n.hasAttribute(e);if(!!i&&i.hasAttribute(e)&&o)return i.getAttribute(e)!==n.getAttribute(e);}function ym(t,e){return wm(t.getShiftedBy(-1),e);}n(99);var xm=\"ck-link_selected\";var Am=/*#__PURE__*/function(_$l42){_inherits(Am,_$l42);var _super130=_createSuper(Am);function Am(){_classCallCheck(this,Am);return _super130.apply(this,arguments);}_createClass(Am,[{key:\"init\",value:function init(){var t=this.editor;t.model.schema.extend(\"$text\",{allowAttributes:\"linkHref\"}),t.conversion[\"for\"](\"dataDowncast\").attributeToElement({model:\"linkHref\",view:pm}),t.conversion[\"for\"](\"editingDowncast\").attributeToElement({model:\"linkHref\",view:function view(t,e){return pm(gm(t),e);}}),t.conversion[\"for\"](\"upcast\").elementToAttribute({view:{name:\"a\",attributes:{href:!0}},model:{key:\"linkHref\",value:function value(t){return t.getAttribute(\"href\");}}}),t.commands.add(\"link\",new um(t)),t.commands.add(\"unlink\",new hm(t)),function(t,e,n,i){var o=new bm(e,n,i),r=e.document.selection;n.listenTo(t.document,\"keydown\",function(t,e){if(!r.isCollapsed)return;if(e.shiftKey||e.altKey||e.ctrlKey)return;var n=e.keyCode==bo.arrowright,i=e.keyCode==bo.arrowleft;if(!n&&!i)return;var s=r.getFirstPosition();var a;(a=n?o.handleForwardMovement(s,e):o.handleBackwardMovement(s,e))&&t.stop();},{priority:Zn.get(\"high\")+1});}(t.editing.view,t.model,this,\"linkHref\"),this._setupLinkHighlight();}},{key:\"_setupLinkHighlight\",value:function _setupLinkHighlight(){var t=this.editor,e=t.editing.view,n=new Set();e.document.registerPostFixer(function(e){var i=t.model.document.selection;if(i.hasAttribute(\"linkHref\")){var _o85=lm(i.getFirstPosition(),i.getAttribute(\"linkHref\"),t.model),_r42=t.editing.mapper.toViewRange(_o85);var _iterator302=_createForOfIteratorHelper(_r42.getItems()),_step302;try{for(_iterator302.s();!(_step302=_iterator302.n()).done;){var _t256=_step302.value;_t256.is(\"a\")&&(e.addClass(xm,_t256),n.add(_t256));}}catch(err){_iterator302.e(err);}finally{_iterator302.f();}}}),t.conversion[\"for\"](\"editingDowncast\").add(function(t){function i(){e.change(function(t){var _iterator303=_createForOfIteratorHelper(n.values()),_step303;try{for(_iterator303.s();!(_step303=_iterator303.n()).done;){var _e228=_step303.value;t.removeClass(xm,_e228),n[\"delete\"](_e228);}}catch(err){_iterator303.e(err);}finally{_iterator303.f();}});}t.on(\"insert\",i,{priority:\"highest\"}),t.on(\"remove\",i,{priority:\"highest\"}),t.on(\"attribute\",i,{priority:\"highest\"}),t.on(\"selection\",i,{priority:\"highest\"});});}}]);return Am;}($l);var Cm=/*#__PURE__*/function(_ts6){_inherits(Cm,_ts6);var _super131=_createSuper(Cm);function Cm(t){var _this201;_classCallCheck(this,Cm);_this201=_super131.call(this,t),_this201.domEventType=\"click\";return _this201;}_createClass(Cm,[{key:\"onDomEvent\",value:function onDomEvent(t){this.fire(t.type,t);}}]);return Cm;}(ts);n(101);var Tm=/*#__PURE__*/function(_Nl21){_inherits(Tm,_Nl21);var _super132=_createSuper(Tm);function Tm(t){var _this202;_classCallCheck(this,Tm);_this202=_super132.call(this,t);var e=t.t;_this202.focusTracker=new il(),_this202.keystrokes=new Gc(),_this202.urlInputView=_this202._createUrlInput(),_this202.saveButtonView=_this202._createButton(e(\"au\"),Eh.a,\"ck-button-save\"),_this202.saveButtonView.type=\"submit\",_this202.cancelButtonView=_this202._createButton(e(\"av\"),Ih.a,\"ck-button-cancel\",\"cancel\"),_this202._focusables=new hl(),_this202._focusCycler=new Fl({focusables:_this202._focusables,focusTracker:_this202.focusTracker,keystrokeHandler:_this202.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}}),_this202.setTemplate({tag:\"form\",attributes:{\"class\":[\"ck\",\"ck-link-form\"],tabindex:\"-1\"},children:[_this202.urlInputView,_this202.saveButtonView,_this202.cancelButtonView]});return _this202;}_createClass(Tm,[{key:\"render\",value:function render(){var _this203=this;_get(_getPrototypeOf(Tm.prototype),\"render\",this).call(this),Ph({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(function(t){_this203._focusables.add(t),_this203.focusTracker.add(t.element);}),this.keystrokes.listenTo(this.element);}},{key:\"focus\",value:function focus(){this._focusCycler.focusFirst();}},{key:\"_createUrlInput\",value:function _createUrlInput(){var t=this.locale.t,e=new Ch(this.locale,Th);return e.label=t(\"aw\"),e.inputView.placeholder=\"https://example.com\",e;}},{key:\"_createButton\",value:function _createButton(t,e,n,i){var o=new qd(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{\"class\":n}}),i&&o.delegate(\"execute\").to(this,i),o;}}]);return Tm;}(Nl);var Pm=n(31),Mm=n.n(Pm),Em=n(32),Sm=n.n(Em);n(103);var Im=/*#__PURE__*/function(_Nl22){_inherits(Im,_Nl22);var _super133=_createSuper(Im);function Im(t){var _this204;_classCallCheck(this,Im);_this204=_super133.call(this,t);var e=t.t;_this204.focusTracker=new il(),_this204.keystrokes=new Gc(),_this204.previewButtonView=_this204._createPreviewButton(),_this204.unlinkButtonView=_this204._createButton(e(\"aq\"),Mm.a,\"unlink\"),_this204.editButtonView=_this204._createButton(e(\"ar\"),Sm.a,\"edit\"),_this204.set(\"href\"),_this204._focusables=new hl(),_this204._focusCycler=new Fl({focusables:_this204._focusables,focusTracker:_this204.focusTracker,keystrokeHandler:_this204.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}}),_this204.setTemplate({tag:\"div\",attributes:{\"class\":[\"ck\",\"ck-link-actions\"],tabindex:\"-1\"},children:[_this204.previewButtonView,_this204.editButtonView,_this204.unlinkButtonView]});return _this204;}_createClass(Im,[{key:\"render\",value:function render(){var _this205=this;_get(_getPrototypeOf(Im.prototype),\"render\",this).call(this),[this.previewButtonView,this.editButtonView,this.unlinkButtonView].forEach(function(t){_this205._focusables.add(t),_this205.focusTracker.add(t.element);}),this.keystrokes.listenTo(this.element);}},{key:\"focus\",value:function focus(){this._focusCycler.focusFirst();}},{key:\"_createButton\",value:function _createButton(t,e,n){var i=new qd(this.locale);return i.set({label:t,icon:e,tooltip:!0}),i.delegate(\"execute\").to(this,n),i;}},{key:\"_createPreviewButton\",value:function _createPreviewButton(){var t=new qd(this.locale),e=this.bindTemplate,n=this.t;return t.set({withText:!0,tooltip:n(\"as\")}),t.extendTemplate({attributes:{\"class\":[\"ck\",\"ck-link-actions__preview\"],href:e.to(\"href\",function(t){return t&&gm(t);}),target:\"_blank\"}}),t.bind(\"label\").to(this,\"href\",function(t){return t||n(\"at\");}),t.bind(\"isEnabled\").to(this,\"href\",function(t){return!!t;}),t.template.tag=\"a\",t.template.eventListeners={},t;}}]);return Im;}(Nl);var Nm=n(33),Om=n.n(Nm);var Rm=\"Ctrl+K\";var Dm=/*#__PURE__*/function(_$l43){_inherits(Dm,_$l43);var _super134=_createSuper(Dm);function Dm(){_classCallCheck(this,Dm);return _super134.apply(this,arguments);}_createClass(Dm,[{key:\"init\",value:function init(){var t=this.editor;t.editing.view.addObserver(Cm),this.actionsView=this._createActionsView(),this.formView=this._createFormView(),this._balloon=t.plugins.get(Uh),this._createToolbarLinkButton(),this._enableUserBalloonInteractions();}},{key:\"destroy\",value:function destroy(){_get(_getPrototypeOf(Dm.prototype),\"destroy\",this).call(this),this.formView.destroy();}},{key:\"_createActionsView\",value:function _createActionsView(){var _this206=this;var t=this.editor,e=new Im(t.locale),n=t.commands.get(\"link\"),i=t.commands.get(\"unlink\");return e.bind(\"href\").to(n,\"value\"),e.editButtonView.bind(\"isEnabled\").to(n),e.unlinkButtonView.bind(\"isEnabled\").to(i),this.listenTo(e,\"edit\",function(){_this206._addFormView();}),this.listenTo(e,\"unlink\",function(){t.execute(\"unlink\"),_this206._hideUI();}),e.keystrokes.set(\"Esc\",function(t,e){_this206._hideUI(),e();}),e.keystrokes.set(Rm,function(t,e){_this206._addFormView(),e();}),e;}},{key:\"_createFormView\",value:function _createFormView(){var _this207=this;var t=this.editor,e=new Tm(t.locale),n=t.commands.get(\"link\");return e.urlInputView.bind(\"value\").to(n,\"value\"),e.urlInputView.bind(\"isReadOnly\").to(n,\"isEnabled\",function(t){return!t;}),e.saveButtonView.bind(\"isEnabled\").to(n),this.listenTo(e,\"submit\",function(){t.execute(\"link\",e.urlInputView.inputView.element.value),_this207._removeFormView();}),this.listenTo(e,\"cancel\",function(){_this207._removeFormView();}),e.keystrokes.set(\"Esc\",function(t,e){_this207._removeFormView(),e();}),e;}},{key:\"_createToolbarLinkButton\",value:function _createToolbarLinkButton(){var _this208=this;var t=this.editor,e=t.commands.get(\"link\"),n=t.t;t.keystrokes.set(Rm,function(t,n){n(),e.isEnabled&&_this208._showUI();}),t.ui.componentFactory.add(\"link\",function(t){var i=new qd(t);return i.isEnabled=!0,i.label=n(\"ao\"),i.icon=Om.a,i.keystroke=Rm,i.tooltip=!0,i.bind(\"isOn\",\"isEnabled\").to(e,\"value\",\"isEnabled\"),_this208.listenTo(i,\"execute\",function(){return _this208._showUI();}),i;});}},{key:\"_enableUserBalloonInteractions\",value:function _enableUserBalloonInteractions(){var _this209=this;var t=this.editor.editing.view.document;this.listenTo(t,\"click\",function(){_this209._getSelectedLinkElement()&&_this209._showUI();}),this.editor.keystrokes.set(\"Tab\",function(t,e){_this209._areActionsVisible&&!_this209.actionsView.focusTracker.isFocused&&(_this209.actionsView.focus(),e());},{priority:\"high\"}),this.editor.keystrokes.set(\"Esc\",function(t,e){_this209._isUIVisible&&(_this209._hideUI(),e());}),Ah({emitter:this.formView,activator:function activator(){return _this209._isUIVisible;},contextElements:[this._balloon.view.element],callback:function callback(){return _this209._hideUI();}});}},{key:\"_addActionsView\",value:function _addActionsView(){this._areActionsInPanel||this._balloon.add({view:this.actionsView,position:this._getBalloonPositionData()});}},{key:\"_addFormView\",value:function _addFormView(){if(this._isFormInPanel)return;var t=this.editor.commands.get(\"link\");this._balloon.add({view:this.formView,position:this._getBalloonPositionData()}),this.formView.urlInputView.select(),this.formView.urlInputView.inputView.element.value=t.value||\"\";}},{key:\"_removeFormView\",value:function _removeFormView(){this._isFormInPanel&&(this.formView.saveButtonView.focus(),this._balloon.remove(this.formView),this.editor.editing.view.focus());}},{key:\"_showUI\",value:function _showUI(){this.editor.commands.get(\"link\").isEnabled&&(this._getSelectedLinkElement()?this._areActionsVisible?this._addFormView():this._addActionsView():(this._addActionsView(),this._addFormView()),this._startUpdatingUI());}},{key:\"_hideUI\",value:function _hideUI(){if(!this._isUIInPanel)return;var t=this.editor;this.stopListening(t.ui,\"update\"),t.editing.view.focus(),this._removeFormView(),this._balloon.remove(this.actionsView);}},{key:\"_startUpdatingUI\",value:function _startUpdatingUI(){var _this210=this;var t=this.editor,e=t.editing.view.document;var n=this._getSelectedLinkElement(),i=o();function o(){return e.selection.focus.getAncestors().reverse().find(function(t){return t.is(\"element\");});}this.listenTo(t.ui,\"update\",function(){var t=_this210._getSelectedLinkElement(),e=o();n&&!t||!n&&e!==i?_this210._hideUI():_this210._balloon.updatePosition(_this210._getBalloonPositionData()),n=t,i=e;});}},{key:\"_isFormInPanel\",get:function get(){return this._balloon.hasView(this.formView);}},{key:\"_areActionsInPanel\",get:function get(){return this._balloon.hasView(this.actionsView);}},{key:\"_areActionsVisible\",get:function get(){return this._balloon.visibleView===this.actionsView;}},{key:\"_isUIInPanel\",get:function get(){return this._isFormInPanel||this._areActionsInPanel;}},{key:\"_isUIVisible\",get:function get(){return this._balloon.visibleView==this.formView||this._areActionsVisible;}},{key:\"_getBalloonPositionData\",value:function _getBalloonPositionData(){var t=this.editor.editing.view,e=t.document,n=this._getSelectedLinkElement();return{target:n?t.domConverter.mapViewToDom(n):t.domConverter.viewRangeToDom(e.selection.getFirstRange())};}},{key:\"_getSelectedLinkElement\",value:function _getSelectedLinkElement(){var t=this.editor.editing.view,e=t.document.selection;if(e.isCollapsed)return Lm(e.getFirstPosition());{var _n212=e.getFirstRange().getTrimmed(),_i173=Lm(_n212.start),_o86=Lm(_n212.end);return _i173&&_i173==_o86&&t.createRangeIn(_i173).getTrimmed().isEqual(_n212)?_i173:null;}}}],[{key:\"requires\",get:function get(){return[Uh];}},{key:\"pluginName\",get:function get(){return\"LinkUI\";}}]);return Dm;}($l);function Lm(t){return t.getAncestors().find(function(t){return function(t){return t.is(\"attributeElement\")&&!!t.getCustomProperty(\"link\");}(t);});}var jm=/*#__PURE__*/function(_Zl17){_inherits(jm,_Zl17);var _super135=_createSuper(jm);function jm(t,e){var _this211;_classCallCheck(this,jm);_this211=_super135.call(this,t),_this211.type=\"bulleted\"==e?\"bulleted\":\"numbered\";return _this211;}_createClass(jm,[{key:\"refresh\",value:function refresh(){this.value=this._getValue(),this.isEnabled=this._checkEnabled();}},{key:\"execute\",value:function execute(){var _this212=this;var t=this.editor.model,e=t.document,n=Array.from(e.selection.getSelectedBlocks()).filter(function(e){return Bm(e,t.schema);}),i=!0===this.value;t.change(function(t){if(i){var _e229=n[n.length-1].nextSibling,_i174=Number.POSITIVE_INFINITY,_o87=[];for(;_e229&&\"listItem\"==_e229.name&&0!==_e229.getAttribute(\"listIndent\");){var _t257=_e229.getAttribute(\"listIndent\");_t257<_i174&&(_i174=_t257);var _n213=_t257-_i174;_o87.push({element:_e229,listIndent:_n213}),_e229=_e229.nextSibling;}_o87=_o87.reverse();var _iterator304=_createForOfIteratorHelper(_o87),_step304;try{for(_iterator304.s();!(_step304=_iterator304.n()).done;){var _e230=_step304.value;t.setAttribute(\"listIndent\",_e230.listIndent,_e230.element);}}catch(err){_iterator304.e(err);}finally{_iterator304.f();}}if(!i){var _t258=Number.POSITIVE_INFINITY;var _iterator305=_createForOfIteratorHelper(n),_step305;try{for(_iterator305.s();!(_step305=_iterator305.n()).done;){var _e231=_step305.value;_e231.is(\"listItem\")&&_e231.getAttribute(\"listIndent\")<_t258&&(_t258=_e231.getAttribute(\"listIndent\"));}}catch(err){_iterator305.e(err);}finally{_iterator305.f();}Vm(n,!0,_t258=0===_t258?1:_t258),Vm(n,!1,_t258);}var _iterator306=_createForOfIteratorHelper(n.reverse()),_step306;try{for(_iterator306.s();!(_step306=_iterator306.n()).done;){var _e232=_step306.value;i&&\"listItem\"==_e232.name?t.rename(_e232,\"paragraph\"):i||\"listItem\"==_e232.name?i||\"listItem\"!=_e232.name||_e232.getAttribute(\"listType\")==_this212.type||t.setAttribute(\"listType\",_this212.type,_e232):(t.setAttributes({listType:_this212.type,listIndent:0},_e232),t.rename(_e232,\"listItem\"));}}catch(err){_iterator306.e(err);}finally{_iterator306.f();}});}},{key:\"_getValue\",value:function _getValue(){var t=Au(this.editor.model.document.selection.getSelectedBlocks());return!!t&&t.is(\"listItem\")&&t.getAttribute(\"listType\")==this.type;}},{key:\"_checkEnabled\",value:function _checkEnabled(){if(this.value)return!0;var t=this.editor.model.document.selection,e=this.editor.model.schema,n=Au(t.getSelectedBlocks());return!!n&&Bm(n,e);}}]);return jm;}(Zl);function Vm(t,e,n){var i=e?t[0]:t[t.length-1];if(i.is(\"listItem\")){var _o88=i[e?\"previousSibling\":\"nextSibling\"],_r43=i.getAttribute(\"listIndent\");for(;_o88&&_o88.is(\"listItem\")&&_o88.getAttribute(\"listIndent\")>=n;)_r43>_o88.getAttribute(\"listIndent\")&&(_r43=_o88.getAttribute(\"listIndent\")),_o88.getAttribute(\"listIndent\")==_r43&&t[e?\"unshift\":\"push\"](_o88),_o88=_o88[e?\"previousSibling\":\"nextSibling\"];}}function Bm(t,e){return e.checkChild(t.parent,\"listItem\")&&!e.isObject(t);}var zm=/*#__PURE__*/function(_Zl18){_inherits(zm,_Zl18);var _super136=_createSuper(zm);function zm(t,e){var _this213;_classCallCheck(this,zm);_this213=_super136.call(this,t),_this213._indentBy=\"forward\"==e?1:-1;return _this213;}_createClass(zm,[{key:\"refresh\",value:function refresh(){this.isEnabled=this._checkEnabled();}},{key:\"execute\",value:function execute(){var _this214=this;var t=this.editor.model,e=t.document;var n=Array.from(e.selection.getSelectedBlocks());t.change(function(t){var e=n[n.length-1];var i=e.nextSibling;for(;i&&\"listItem\"==i.name&&i.getAttribute(\"listIndent\")>e.getAttribute(\"listIndent\");)n.push(i),i=i.nextSibling;_this214._indentBy<0&&(n=n.reverse());var _iterator307=_createForOfIteratorHelper(n),_step307;try{for(_iterator307.s();!(_step307=_iterator307.n()).done;){var _e233=_step307.value;var _n214=_e233.getAttribute(\"listIndent\")+_this214._indentBy;_n214<0?t.rename(_e233,\"paragraph\"):t.setAttribute(\"listIndent\",_n214,_e233);}}catch(err){_iterator307.e(err);}finally{_iterator307.f();}});}},{key:\"_checkEnabled\",value:function _checkEnabled(){var t=Au(this.editor.model.document.selection.getSelectedBlocks());if(!t||!t.is(\"listItem\"))return!1;if(this._indentBy>0){var _e234=t.getAttribute(\"listIndent\"),_n215=t.getAttribute(\"listType\");var _i175=t.previousSibling;for(;_i175&&_i175.is(\"listItem\")&&_i175.getAttribute(\"listIndent\")>=_e234;){if(_i175.getAttribute(\"listIndent\")==_e234)return _i175.getAttribute(\"listType\")==_n215;_i175=_i175.previousSibling;}return!1;}return!0;}}]);return zm;}(Zl);function Fm(){var t=!this.isEmpty&&(\"ul\"==this.getChild(0).name||\"ol\"==this.getChild(0).name);return this.isEmpty||t?0:xi.call(this);}function Um(t){return function(e,n,i){var o=i.consumable;if(!o.test(n.item,\"insert\")||!o.test(n.item,\"attribute:listType\")||!o.test(n.item,\"attribute:listIndent\"))return;o.consume(n.item,\"insert\"),o.consume(n.item,\"attribute:listType\"),o.consume(n.item,\"attribute:listIndent\");var r=n.item;np(r,function(t,e){var n=e.mapper,i=e.writer,o=\"numbered\"==t.getAttribute(\"listType\")?\"ol\":\"ul\",r=function(t){var e=t.createContainerElement(\"li\");return e.getFillerOffset=Fm,e;}(i),s=i.createContainerElement(o,null);return i.insert(i.createPositionAt(s,0),r),n.bindElements(t,r),r;}(r,i),i,t);};}function Hm(t){return function(e,n,i){var o=i.mapper.toViewPosition(n.position).getLastMatchingPosition(function(t){return!t.item.is(\"li\");}).nodeAfter,r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));var s=o.parent,a=s.previousSibling,c=r.createRangeOn(s),l=r.remove(c);a&&a.nextSibling&&ep(r,a,a.nextSibling),ip(i.mapper.toModelElement(o).getAttribute(\"listIndent\")+1,n.position,c.start,o,i,t);var _iterator308=_createForOfIteratorHelper(r.createRangeIn(l).getItems()),_step308;try{for(_iterator308.s();!(_step308=_iterator308.n()).done;){var _t259=_step308.value;i.mapper.unbindViewElement(_t259);}}catch(err){_iterator308.e(err);}finally{_iterator308.f();}e.stop();};}function qm(t,e,n){if(!n.consumable.consume(e.item,\"attribute:listType\"))return;var i=n.mapper.toViewElement(e.item),o=n.writer;o.breakContainer(o.createPositionBefore(i)),o.breakContainer(o.createPositionAfter(i));var r=i.parent;var s=\"numbered\"==e.attributeNewValue?\"ol\":\"ul\";ep(o,r=o.rename(s,r),r.nextSibling),ep(o,r.previousSibling,r);var _iterator309=_createForOfIteratorHelper(e.item.getChildren()),_step309;try{for(_iterator309.s();!(_step309=_iterator309.n()).done;){var _t260=_step309.value;n.consumable.consume(_t260,\"insert\");}}catch(err){_iterator309.e(err);}finally{_iterator309.f();}}function Wm(t){return function(e,n,i){if(!i.consumable.consume(n.item,\"attribute:listIndent\"))return;var o=i.mapper.toViewElement(n.item),r=i.writer;r.breakContainer(r.createPositionBefore(o)),r.breakContainer(r.createPositionAfter(o));var s=o.parent,a=s.previousSibling,c=r.createRangeOn(s);r.remove(c),a&&a.nextSibling&&ep(r,a,a.nextSibling),ip(n.attributeOldValue+1,n.range.start,c.start,o,i,t),np(n.item,o,i,t);var _iterator310=_createForOfIteratorHelper(n.item.getChildren()),_step310;try{for(_iterator310.s();!(_step310=_iterator310.n()).done;){var _t261=_step310.value;i.consumable.consume(_t261,\"insert\");}}catch(err){_iterator310.e(err);}finally{_iterator310.f();}};}function Ym(t,e,n){if(\"listItem\"!=e.item.name){var _t262=n.mapper.toViewPosition(e.range.start);var _i176=n.writer,_o89=[];for(;(\"ul\"==_t262.parent.name||\"ol\"==_t262.parent.name)&&\"li\"==(_t262=_i176.breakContainer(_t262)).parent.name;){var _e235=_t262,_n216=_i176.createPositionAt(_t262.parent,\"end\");if(!_e235.isEqual(_n216)){var _t263=_i176.remove(_i176.createRange(_e235,_n216));_o89.push(_t263);}_t262=_i176.createPositionAfter(_t262.parent);}if(_o89.length>0){for(var _e236=0;_e236<_o89.length;_e236++){var _n217=_t262.nodeBefore;if(_t262=_i176.insert(_t262,_o89[_e236]).end,_e236>0){var _e237=ep(_i176,_n217,_n217.nextSibling);_e237&&_e237.parent==_n217&&_t262.offset--;}}ep(_i176,_t262.nodeBefore,_t262.nodeAfter);}}}function $m(t,e,n){var i=n.mapper.toViewPosition(e.position),o=i.nodeBefore,r=i.nodeAfter;ep(n.writer,o,r);}function Gm(t,e,n){if(n.consumable.consume(e.viewItem,{name:!0})){var _t264=n.writer,_i177=this.conversionApi.store,_o90=_t264.createElement(\"listItem\");_i177.indent=_i177.indent||0,_t264.setAttribute(\"listIndent\",_i177.indent,_o90);var _r44=e.viewItem.parent&&\"ol\"==e.viewItem.parent.name?\"numbered\":\"bulleted\";_t264.setAttribute(\"listType\",_r44,_o90),_i177.indent++;var _s25=n.splitToAllowedParent(_o90,e.modelCursor);if(!_s25)return;_t264.insert(_o90,_s25.position);var _a14=function(t,e,n){var i=n.writer,o=n.schema;var r=i.createPositionAfter(t);var _iterator311=_createForOfIteratorHelper(e),_step311;try{for(_iterator311.s();!(_step311=_iterator311.n()).done;){var _s26=_step311.value;if(\"ul\"==_s26.name||\"ol\"==_s26.name)r=n.convertItem(_s26,r).modelCursor;else{var _e238=n.convertItem(_s26,i.createPositionAt(t,\"end\")),_a15=_e238.modelRange.start.nodeAfter,_c8=_a15&&_a15.is(\"element\")&&!o.checkChild(t,_a15.name);_c8&&(t=_e238.modelCursor.parent.is(\"listItem\")?_e238.modelCursor.parent:Xm(_e238.modelCursor),r=i.createPositionAfter(t));}}}catch(err){_iterator311.e(err);}finally{_iterator311.f();}return r;}(_o90,e.viewItem.getChildren(),n);_i177.indent--,e.modelRange=_t264.createRange(e.modelCursor,_a14),_s25.cursorParent?e.modelCursor=_t264.createPositionAt(_s25.cursorParent,0):e.modelCursor=e.modelRange.end;}}function Qm(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){var _t265=Array.from(e.viewItem.getChildren());for(var _i178=0,_t266=_t265;_i178<_t266.length;_i178++){var _e239=_t266[_i178];_e239.is(\"li\")||_e239._remove();}}}function Jm(t,e,n){if(n.consumable.test(e.viewItem,{name:!0})){if(0===e.viewItem.childCount)return;var _t267=_toConsumableArray(e.viewItem.getChildren());var _n218=!1,_i179=!0;var _iterator312=_createForOfIteratorHelper(_t267),_step312;try{for(_iterator312.s();!(_step312=_iterator312.n()).done;){var _e240=_step312.value;!_n218||_e240.is(\"ul\")||_e240.is(\"ol\")||_e240._remove(),_e240.is(\"text\")?(_i179&&(_e240._data=_e240.data.replace(/^\\s+/,\"\")),(!_e240.nextSibling||_e240.nextSibling.is(\"ul\")||_e240.nextSibling.is(\"ol\"))&&(_e240._data=_e240.data.replace(/\\s+$/,\"\"))):(_e240.is(\"ul\")||_e240.is(\"ol\"))&&(_n218=!0),_i179=!1;}}catch(err){_iterator312.e(err);}finally{_iterator312.f();}}}function Km(t){return function(e,n){if(n.isPhantom)return;var i=n.modelPosition.nodeBefore;if(i&&i.is(\"listItem\")){var _e241=n.mapper.toViewElement(i),_o91=_e241.getAncestors().find(function(t){return t.is(\"ul\")||t.is(\"ol\");}),_r45=t.createPositionAt(_e241,0).getWalker();var _iterator313=_createForOfIteratorHelper(_r45),_step313;try{for(_iterator313.s();!(_step313=_iterator313.n()).done;){var _t268=_step313.value;if(\"elementStart\"==_t268.type&&_t268.item.is(\"li\")){n.viewPosition=_t268.previousPosition;break;}if(\"elementEnd\"==_t268.type&&_t268.item==_o91){n.viewPosition=_t268.nextPosition;break;}}}catch(err){_iterator313.e(err);}finally{_iterator313.f();}}};}function Zm(t,_ref26){var _ref27=_slicedToArray(_ref26,2),e=_ref27[0],n=_ref27[1];var i,o=e.is(\"documentFragment\")?e.getChild(0):e;if(i=n?this.createSelection(n):this.document.selection,o&&o.is(\"listItem\")){var _t269=i.getFirstPosition();var _e242=null;if(_t269.parent.is(\"listItem\")?_e242=_t269.parent:_t269.nodeBefore&&_t269.nodeBefore.is(\"listItem\")&&(_e242=_t269.nodeBefore),_e242){var _t270=_e242.getAttribute(\"listIndent\");if(_t270>0)for(;o&&o.is(\"listItem\");)o._setAttribute(\"listIndent\",o.getAttribute(\"listIndent\")+_t270),o=o.nextSibling;}}}function Xm(t){var e=new qs({startPosition:t});var n;do{n=e.next();}while(!n.value.item.is(\"listItem\"));return n.value.item;}function tp(t,e){var n=!!e.sameIndent,i=!!e.smallerIndent,o=e.listIndent;var r=t;for(;r&&\"listItem\"==r.name;){var _t271=r.getAttribute(\"listIndent\");if(n&&o==_t271||i&&o>_t271)return r;r=r.previousSibling;}return null;}function ep(t,e,n){return e&&n&&(\"ul\"==e.name||\"ol\"==e.name)&&e.name==n.name?t.mergeContainers(t.createPositionAfter(e)):null;}function np(t,e,n,i){var o=e.parent,r=n.mapper,s=n.writer;var a=r.toViewPosition(i.createPositionBefore(t));var c=tp(t.previousSibling,{sameIndent:!0,smallerIndent:!0,listIndent:t.getAttribute(\"listIndent\")}),l=t.previousSibling;if(c&&c.getAttribute(\"listIndent\")==t.getAttribute(\"listIndent\")){var _t272=r.toViewElement(c);a=s.breakContainer(s.createPositionAfter(_t272));}else a=l&&\"listItem\"==l.name?r.toViewPosition(i.createPositionAt(l,\"end\")):r.toViewPosition(i.createPositionBefore(t));if(a=op(a),s.insert(a,o),l&&\"listItem\"==l.name){var _t273=r.toViewElement(l),_n219=s.createRange(s.createPositionAt(_t273,0),a).getWalker({ignoreElementEnd:!0});var _iterator314=_createForOfIteratorHelper(_n219),_step314;try{for(_iterator314.s();!(_step314=_iterator314.n()).done;){var _t274=_step314.value;if(_t274.item.is(\"li\")){var _i180=s.breakContainer(s.createPositionBefore(_t274.item)),_o92=_t274.item.parent,_r46=s.createPositionAt(e,\"end\");ep(s,_r46.nodeBefore,_r46.nodeAfter),s.move(s.createRangeOn(_o92),_r46),_n219.position=_i180;}}}catch(err){_iterator314.e(err);}finally{_iterator314.f();}}else{var _n220=o.nextSibling;if(_n220&&(_n220.is(\"ul\")||_n220.is(\"ol\"))){var _i181=null;var _iterator315=_createForOfIteratorHelper(_n220.getChildren()),_step315;try{for(_iterator315.s();!(_step315=_iterator315.n()).done;){var _e243=_step315.value;var _n221=r.toModelElement(_e243);if(!(_n221&&_n221.getAttribute(\"listIndent\")>t.getAttribute(\"listIndent\")))break;_i181=_e243;}}catch(err){_iterator315.e(err);}finally{_iterator315.f();}_i181&&(s.breakContainer(s.createPositionAfter(_i181)),s.move(s.createRangeOn(_i181.parent),s.createPositionAt(e,\"end\")));}}ep(s,o,o.nextSibling),ep(s,o.previousSibling,o);}function ip(t,e,n,i,o,r){var s=tp(e.nodeBefore,{sameIndent:!0,smallerIndent:!0,listIndent:t,foo:\"b\"}),a=o.mapper,c=o.writer,l=s?s.getAttribute(\"listIndent\"):null;var d;if(s){if(l==t){var _t275=a.toViewElement(s).parent;d=c.createPositionAfter(_t275);}else{var _t276=r.createPositionAt(s,\"end\");d=a.toViewPosition(_t276);}}else d=n;d=op(d);for(var _i182=0,_arr=_toConsumableArray(i.getChildren());_i182<_arr.length;_i182++){var _t277=_arr[_i182];(_t277.is(\"ul\")||_t277.is(\"ol\"))&&(d=c.move(c.createRangeOn(_t277),d).end,ep(c,_t277,_t277.nextSibling),ep(c,_t277.previousSibling,_t277));}}function op(t){return t.getLastMatchingPosition(function(t){return t.item.is(\"uiElement\");});}var rp=/*#__PURE__*/function(_$l44){_inherits(rp,_$l44);var _super137=_createSuper(rp);function rp(){_classCallCheck(this,rp);return _super137.apply(this,arguments);}_createClass(rp,[{key:\"init\",value:function init(){var _this215=this;var t=this.editor;t.model.schema.register(\"listItem\",{inheritAllFrom:\"$block\",allowAttributes:[\"listType\",\"listIndent\"]});var e=t.data,n=t.editing;t.model.document.registerPostFixer(function(e){return function(t,e){var n=t.document.differ.getChanges(),i=new Map();var o=!1;var _iterator316=_createForOfIteratorHelper(n),_step316;try{for(_iterator316.s();!(_step316=_iterator316.n()).done;){var _t278=_step316.value;if(\"insert\"==_t278.type&&\"listItem\"==_t278.name)r(_t278.position);else if(\"insert\"==_t278.type&&\"listItem\"!=_t278.name){if(\"$text\"!=_t278.name){var _n223=_t278.position.nodeAfter;_n223.hasAttribute(\"listIndent\")&&(e.removeAttribute(\"listIndent\",_n223),o=!0),_n223.hasAttribute(\"listType\")&&(e.removeAttribute(\"listType\",_n223),o=!0);}r(_t278.position.getShiftedBy(_t278.length));}else\"remove\"==_t278.type&&\"listItem\"==_t278.name?r(_t278.position):\"attribute\"==_t278.type&&\"listIndent\"==_t278.attributeKey?r(_t278.range.start):\"attribute\"==_t278.type&&\"listType\"==_t278.attributeKey&&r(_t278.range.start);}}catch(err){_iterator316.e(err);}finally{_iterator316.f();}var _iterator317=_createForOfIteratorHelper(i.values()),_step317;try{for(_iterator317.s();!(_step317=_iterator317.n()).done;){var _t279=_step317.value;s(_t279),a(_t279);}}catch(err){_iterator317.e(err);}finally{_iterator317.f();}return o;function r(t){var e=t.nodeBefore;if(e&&e.is(\"listItem\")){var _n222=e;if(i.has(_n222))return;for(;_n222.previousSibling&&_n222.previousSibling.is(\"listItem\");)if(_n222=_n222.previousSibling,i.has(_n222))return;i.set(t.nodeBefore,_n222);}else{var _e244=t.nodeAfter;_e244&&_e244.is(\"listItem\")&&i.set(_e244,_e244);}}function s(t){var n=0,i=null;for(;t&&t.is(\"listItem\");){var _r47=t.getAttribute(\"listIndent\");if(_r47>n){var _s27=void 0;null===i?(i=_r47-n,_s27=n):(i>_r47&&(i=_r47),_s27=_r47-i),e.setAttribute(\"listIndent\",_s27,t),o=!0;}else i=null,n=t.getAttribute(\"listIndent\")+1;t=t.nextSibling;}}function a(t){var n=[],i=null;for(;t&&t.is(\"listItem\");){var _r48=t.getAttribute(\"listIndent\");if(i&&i.getAttribute(\"listIndent\")>_r48&&(n=n.slice(0,_r48+1)),0!=_r48)if(n[_r48]){var _i183=n[_r48];t.getAttribute(\"listType\")!=_i183&&(e.setAttribute(\"listType\",_i183,t),o=!0);}else n[_r48]=t.getAttribute(\"listType\");i=t,t=t.nextSibling;}}}(t.model,e);}),n.mapper.registerViewToModelLength(\"li\",sp),e.mapper.registerViewToModelLength(\"li\",sp),n.mapper.on(\"modelToViewPosition\",Km(n.view)),n.mapper.on(\"viewToModelPosition\",function(t){return function(e,n){var i=n.viewPosition,o=i.parent,r=n.mapper;if(\"ul\"==o.name||\"ol\"==o.name){if(i.isAtEnd){var _e245=r.toModelElement(i.nodeBefore),_o93=r.getModelLength(i.nodeBefore);n.modelPosition=t.createPositionBefore(_e245).getShiftedBy(_o93);}else{var _e246=r.toModelElement(i.nodeAfter);n.modelPosition=t.createPositionBefore(_e246);}e.stop();}else if(\"li\"==o.name&&i.nodeBefore&&(\"ul\"==i.nodeBefore.name||\"ol\"==i.nodeBefore.name)){var _s28=r.toModelElement(o);var _a16=1,_c9=i.nodeBefore;for(;_c9&&(_c9.is(\"ul\")||_c9.is(\"ol\"));)_a16+=r.getModelLength(_c9),_c9=_c9.previousSibling;n.modelPosition=t.createPositionBefore(_s28).getShiftedBy(_a16),e.stop();}};}(t.model)),e.mapper.on(\"modelToViewPosition\",Km(n.view)),n.downcastDispatcher.on(\"insert\",Ym,{priority:\"high\"}),n.downcastDispatcher.on(\"insert:listItem\",Um(t.model)),e.downcastDispatcher.on(\"insert\",Ym,{priority:\"high\"}),e.downcastDispatcher.on(\"insert:listItem\",Um(t.model)),n.downcastDispatcher.on(\"attribute:listType:listItem\",qm),e.downcastDispatcher.on(\"attribute:listType:listItem\",qm),n.downcastDispatcher.on(\"attribute:listIndent:listItem\",Wm(t.model)),e.downcastDispatcher.on(\"attribute:listIndent:listItem\",Wm(t.model)),n.downcastDispatcher.on(\"remove:listItem\",Hm(t.model)),n.downcastDispatcher.on(\"remove\",$m,{priority:\"low\"}),e.downcastDispatcher.on(\"remove:listItem\",Hm(t.model)),e.downcastDispatcher.on(\"remove\",$m,{priority:\"low\"}),e.upcastDispatcher.on(\"element:ul\",Qm,{priority:\"high\"}),e.upcastDispatcher.on(\"element:ol\",Qm,{priority:\"high\"}),e.upcastDispatcher.on(\"element:li\",Jm,{priority:\"high\"}),e.upcastDispatcher.on(\"element:li\",Gm),t.model.on(\"insertContent\",Zm,{priority:\"high\"}),t.commands.add(\"numberedList\",new jm(t,\"numbered\")),t.commands.add(\"bulletedList\",new jm(t,\"bulleted\")),t.commands.add(\"indentList\",new zm(t,\"forward\")),t.commands.add(\"outdentList\",new zm(t,\"backward\"));var i=this.editor.editing.view.document;this.listenTo(i,\"enter\",function(t,e){var n=_this215.editor.model.document,i=n.selection.getLastPosition().parent;n.selection.isCollapsed&&\"listItem\"==i.name&&i.isEmpty&&(_this215.editor.execute(\"outdentList\"),e.preventDefault(),t.stop());}),this.listenTo(i,\"delete\",function(t,e){if(\"backward\"!==e.direction)return;var n=_this215.editor.model.document.selection;if(!n.isCollapsed)return;var i=n.getFirstPosition();if(!i.isAtStart)return;var o=i.parent;\"listItem\"===o.name&&(o.previousSibling&&\"listItem\"===o.previousSibling.name||(_this215.editor.execute(\"outdentList\"),e.preventDefault(),t.stop()));},{priority:\"high\"});var o=function o(t){return function(e,n){_this215.editor.commands.get(t).isEnabled&&(_this215.editor.execute(t),n());};};this.editor.keystrokes.set(\"Tab\",o(\"indentList\")),this.editor.keystrokes.set(\"Shift+Tab\",o(\"outdentList\"));}}],[{key:\"requires\",get:function get(){return[wf];}}]);return rp;}($l);function sp(t){var e=1;var _iterator318=_createForOfIteratorHelper(t.getChildren()),_step318;try{for(_iterator318.s();!(_step318=_iterator318.n()).done;){var _n224=_step318.value;if(\"ul\"==_n224.name||\"ol\"==_n224.name){var _iterator319=_createForOfIteratorHelper(_n224.getChildren()),_step319;try{for(_iterator319.s();!(_step319=_iterator319.n()).done;){var _t280=_step319.value;e+=sp(_t280);}}catch(err){_iterator319.e(err);}finally{_iterator319.f();}}}}catch(err){_iterator318.e(err);}finally{_iterator318.f();}return e;}var ap=n(34),cp=n.n(ap),lp=n(35),dp=n.n(lp);var up=/*#__PURE__*/function(_$l45){_inherits(up,_$l45);var _super138=_createSuper(up);function up(){_classCallCheck(this,up);return _super138.apply(this,arguments);}_createClass(up,[{key:\"init\",value:function init(){var t=this.editor.t;this._addButton(\"numberedList\",t(\"o\"),cp.a),this._addButton(\"bulletedList\",t(\"p\"),dp.a);}},{key:\"_addButton\",value:function _addButton(t,e,n){var _this216=this;var i=this.editor;i.ui.componentFactory.add(t,function(o){var r=i.commands.get(t),s=new qd(o);return s.set({label:e,icon:n,tooltip:!0}),s.bind(\"isOn\",\"isEnabled\").to(r,\"value\",\"isEnabled\"),_this216.listenTo(s,\"execute\",function(){return i.execute(t);}),s;});}}]);return up;}($l);function hp(t,e){return function(t){t.on(\"attribute:url:media\",n);};function n(n,i,o){if(!o.consumable.consume(i.item,n.name))return;var r=i.attributeNewValue,s=o.writer,a=o.mapper.toViewElement(i.item);s.remove(s.createRangeIn(a));var c=t.getMediaViewElement(s,r,e);s.insert(s.createPositionAt(a,0),c);}}function fp(t,e,n,i){var o=t.createContainerElement(\"figure\",{\"class\":\"media\"});return o.getFillerOffset=gp,t.insert(t.createPositionAt(o,0),e.getMediaViewElement(t,n,i)),o;}function mp(t){var e=t.getSelectedElement();return e&&e.is(\"media\")?e:null;}function pp(t,e,n){t.change(function(i){var o=i.createElement(\"media\",{url:e});t.insertContent(o,n),i.setSelection(o,\"on\");});}function gp(){return null;}var bp=/*#__PURE__*/function(_Zl19){_inherits(bp,_Zl19);var _super139=_createSuper(bp);function bp(){_classCallCheck(this,bp);return _super139.apply(this,arguments);}_createClass(bp,[{key:\"refresh\",value:function refresh(){var t=this.editor.model,e=t.document.selection,n=t.schema,i=e.getFirstPosition(),o=mp(e);var r=i.parent;r!=r.root&&(r=r.parent),this.value=o?o.getAttribute(\"url\"):null,this.isEnabled=n.checkChild(r,\"media\");}},{key:\"execute\",value:function execute(t){var e=this.editor.model,n=e.document.selection,i=mp(n);if(i)e.change(function(e){e.setAttribute(\"url\",t,i);});else{var _i184=lh(n,e);pp(e,t,_i184);}}}]);return bp;}(Zl);var wp=n(36),_p=n.n(wp);var kp=\"0 0 64 42\";var vp=/*#__PURE__*/function(){function vp(t,e){_classCallCheck(this,vp);var n=e.providers,i=e.extraProviders||[],o=new Set(e.removeProviders),r=n.concat(i).filter(function(t){var e=t.name;return e?!o.has(e):(bs.a.warn(\"media-embed-no-provider-name: The configured media provider has no name and cannot be used.\",{provider:t}),!1);});this.locale=t,this.providerDefinitions=r;}_createClass(vp,[{key:\"hasMedia\",value:function hasMedia(t){return!!this._getMedia(t);}},{key:\"getMediaViewElement\",value:function getMediaViewElement(t,e,n){return this._getMedia(e).getViewElement(t,n);}},{key:\"_getMedia\",value:function _getMedia(t){if(!t)return new yp(this.locale);t=t.trim();var _iterator320=_createForOfIteratorHelper(this.providerDefinitions),_step320;try{for(_iterator320.s();!(_step320=_iterator320.n()).done;){var _e247=_step320.value;var _n225=_e247.html;var _i185=_e247.url;Array.isArray(_i185)||(_i185=[_i185]);var _iterator321=_createForOfIteratorHelper(_i185),_step321;try{for(_iterator321.s();!(_step321=_iterator321.n()).done;){var _e248=_step321.value;var _i186=this._getUrlMatches(t,_e248);if(_i186)return new yp(this.locale,t,_i186,_n225);}}catch(err){_iterator321.e(err);}finally{_iterator321.f();}}}catch(err){_iterator320.e(err);}finally{_iterator320.f();}return null;}},{key:\"_getUrlMatches\",value:function _getUrlMatches(t,e){var n=t.match(e);if(n)return n;var i=t.replace(/^https?:\\/\\//,\"\");return(n=i.match(e))?n:(n=(i=i.replace(/^www\\./,\"\")).match(e))||null;}}]);return vp;}();var yp=/*#__PURE__*/function(){function yp(t,e,n,i){_classCallCheck(this,yp);this.url=this._getValidUrl(e),this._t=t.t,this._match=n,this._previewRenderer=i;}_createClass(yp,[{key:\"getViewElement\",value:function getViewElement(t,e){var n={};if(e.renderForEditingView||e.renderMediaPreview&&this.url&&this._previewRenderer){this.url&&(n[\"data-oembed-url\"]=this.url),e.renderForEditingView&&(n[\"class\"]=\"ck-media__wrapper\");var _i187=this._getPreviewHtml(e);return t.createUIElement(\"div\",n,function(t){var e=this.toDomElement(t);return e.innerHTML=_i187,e;});}return this.url&&(n.url=this.url),t.createEmptyElement(\"oembed\",n);}},{key:\"_getPreviewHtml\",value:function _getPreviewHtml(t){return this._previewRenderer?this._previewRenderer(this._match):this.url&&t.renderForEditingView?this._getPlaceholderHtml():\"\";}},{key:\"_getPlaceholderHtml\",value:function _getPlaceholderHtml(){var t=new Hd(),e=new Ud();return t.text=this._t(\"Open media in new tab\"),e.content=_p.a,e.viewBox=kp,new ml({tag:\"div\",attributes:{\"class\":\"ck ck-reset_all ck-media__placeholder\"},children:[{tag:\"div\",attributes:{\"class\":\"ck-media__placeholder__icon\"},children:[e]},{tag:\"a\",attributes:{\"class\":\"ck-media__placeholder__url\",target:\"new\",href:this.url},children:[{tag:\"span\",attributes:{\"class\":\"ck-media__placeholder__url__text\"},children:[this.url]},t]}]}).render().outerHTML;}},{key:\"_getValidUrl\",value:function _getValidUrl(t){return t?t.match(/^https?/)?t:\"https://\"+t:null;}}]);return yp;}();n(105);var xp=/*#__PURE__*/function(_$l46){_inherits(xp,_$l46);var _super140=_createSuper(xp);function xp(t){var _this217;_classCallCheck(this,xp);_this217=_super140.call(this,t),t.config.define(\"mediaEmbed\",{providers:[{name:\"dailymotion\",url:/^dailymotion\\.com\\/video\\/(\\w+)/,html:function html(t){return'
'+\"
';}},{name:\"spotify\",url:[/^open\\.spotify\\.com\\/(artist\\/\\w+)/,/^open\\.spotify\\.com\\/(album\\/\\w+)/,/^open\\.spotify\\.com\\/(track\\/\\w+)/],html:function html(t){return'
'+\"
';}},{name:\"youtube\",url:[/^youtube\\.com\\/watch\\?v=([\\w-]+)/,/^youtube\\.com\\/v\\/([\\w-]+)/,/^youtube\\.com\\/embed\\/([\\w-]+)/,/^youtu\\.be\\/([\\w-]+)/],html:function html(t){return'
'+\"
';}},{name:\"vimeo\",url:[/^vimeo\\.com\\/(\\d+)/,/^vimeo\\.com\\/[^/]+\\/[^/]+\\/video\\/(\\d+)/,/^vimeo\\.com\\/album\\/[^/]+\\/video\\/(\\d+)/,/^vimeo\\.com\\/channels\\/[^/]+\\/(\\d+)/,/^vimeo\\.com\\/groups\\/[^/]+\\/videos\\/(\\d+)/,/^vimeo\\.com\\/ondemand\\/[^/]+\\/(\\d+)/,/^player\\.vimeo\\.com\\/video\\/(\\d+)/],html:function html(t){return'
'+\"
';}},{name:\"instagram\",url:/^instagram\\.com\\/p\\/(\\w+)/},{name:\"twitter\",url:/^twitter\\.com/},{name:\"googleMaps\",url:/^google\\.com\\/maps/},{name:\"flickr\",url:/^flickr\\.com/},{name:\"facebook\",url:/^facebook\\.com/}]}),_this217.registry=new vp(t.locale,t.config.get(\"mediaEmbed\"));return _this217;}_createClass(xp,[{key:\"init\",value:function init(){var t=this.editor,e=t.model.schema,n=t.t,i=t.conversion,o=t.config.get(\"mediaEmbed.previewsInData\"),r=this.registry;t.commands.add(\"mediaEmbed\",new bp(t)),e.register(\"media\",{isObject:!0,isBlock:!0,allowWhere:\"$block\",allowAttributes:[\"url\"]}),i[\"for\"](\"dataDowncast\").elementToElement({model:\"media\",view:function view(t,e){var n=t.getAttribute(\"url\");return fp(e,r,n,{renderMediaPreview:n&&o});}}),i[\"for\"](\"dataDowncast\").add(hp(r,{renderMediaPreview:o})),i[\"for\"](\"editingDowncast\").elementToElement({model:\"media\",view:function view(t,e){var i=t.getAttribute(\"url\");return function(t,e,n){return e.setCustomProperty(\"media\",!0,t),sh(t,e,{label:n});}(fp(e,r,i,{renderForEditingView:!0}),e,n(\"ak\"));}}),i[\"for\"](\"editingDowncast\").add(hp(r,{renderForEditingView:!0})),i[\"for\"](\"upcast\").elementToElement({view:{name:\"oembed\",attributes:{url:!0}},model:function model(t,e){var n=t.getAttribute(\"url\");if(r.hasMedia(n))return e.createElement(\"media\",{url:n});}}).elementToElement({view:{name:\"div\",attributes:{\"data-oembed-url\":!0}},model:function model(t,e){var n=t.getAttribute(\"data-oembed-url\");if(r.hasMedia(n))return e.createElement(\"media\",{url:n});}});}}],[{key:\"pluginName\",get:function get(){return\"MediaEmbedEditing\";}}]);return xp;}($l);var Ap=/^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w\\-._~:/?#[\\]@!$&'()*+,;=]+$/;var Cp=/*#__PURE__*/function(_$l47){_inherits(Cp,_$l47);var _super141=_createSuper(Cp);function Cp(t){var _this218;_classCallCheck(this,Cp);_this218=_super141.call(this,t),_this218._timeoutId=null,_this218._positionToInsert=null;return _this218;}_createClass(Cp,[{key:\"init\",value:function init(){var _this219=this;var t=this.editor,e=t.model.document;this.listenTo(t.plugins.get(Kl),\"inputTransformation\",function(){var t=e.selection.getFirstRange(),n=Oc.fromPosition(t.start);n.stickiness=\"toPrevious\";var i=Oc.fromPosition(t.end);i.stickiness=\"toNext\",e.once(\"change:data\",function(){_this219._embedMediaBetweenPositions(n,i),n.detach(),i.detach();},{priority:\"high\"});}),t.commands.get(\"undo\").on(\"execute\",function(){_this219._timeoutId&&(nr.window.clearTimeout(_this219._timeoutId),_this219._positionToInsert.detach(),_this219._timeoutId=null,_this219._positionToInsert=null);},{priority:\"high\"});}},{key:\"_embedMediaBetweenPositions\",value:function _embedMediaBetweenPositions(t,e){var _this220=this;var n=this.editor,i=n.plugins.get(xp).registry,o=new oa(t,e),r=o.getWalker({ignoreElementEnd:!0});var s=\"\";var _iterator322=_createForOfIteratorHelper(r),_step322;try{for(_iterator322.s();!(_step322=_iterator322.n()).done;){var _t281=_step322.value;_t281.item.is(\"textProxy\")&&(s+=_t281.item.data);}}catch(err){_iterator322.e(err);}finally{_iterator322.f();}if(!(s=s.trim()).match(Ap))return;if(!i.hasMedia(s))return;n.commands.get(\"mediaEmbed\").isEnabled&&(this._positionToInsert=Oc.fromPosition(t),this._timeoutId=nr.window.setTimeout(function(){n.model.change(function(t){var e;_this220._timeoutId=null,t.remove(o),\"$graveyard\"!==_this220._positionToInsert.root.rootName&&(e=_this220._positionToInsert),pp(n.model,s,e),_this220._positionToInsert.detach(),_this220._positionToInsert=null;});},100));}}],[{key:\"requires\",get:function get(){return[Kl,Jd];}},{key:\"pluginName\",get:function get(){return\"AutoMediaEmbed\";}}]);return Cp;}($l);n(107);var Tp=/*#__PURE__*/function(_Nl23){_inherits(Tp,_Nl23);var _super142=_createSuper(Tp);function Tp(t,e){var _this221;_classCallCheck(this,Tp);_this221=_super142.call(this,e);var n=e.t;_this221.focusTracker=new il(),_this221.keystrokes=new Gc(),_this221.urlInputView=_this221._createUrlInput(),_this221.saveButtonView=_this221._createButton(n(\"au\"),Eh.a,\"ck-button-save\"),_this221.saveButtonView.type=\"submit\",_this221.cancelButtonView=_this221._createButton(n(\"av\"),Ih.a,\"ck-button-cancel\",\"cancel\"),_this221._focusables=new hl(),_this221._focusCycler=new Fl({focusables:_this221._focusables,focusTracker:_this221.focusTracker,keystrokeHandler:_this221.keystrokes,actions:{focusPrevious:\"shift + tab\",focusNext:\"tab\"}}),_this221._validators=t,_this221.setTemplate({tag:\"form\",attributes:{\"class\":[\"ck\",\"ck-media-form\"],tabindex:\"-1\"},children:[_this221.urlInputView,_this221.saveButtonView,_this221.cancelButtonView]});return _this221;}_createClass(Tp,[{key:\"render\",value:function render(){var _this222=this;_get(_getPrototypeOf(Tp.prototype),\"render\",this).call(this),Ph({view:this}),[this.urlInputView,this.saveButtonView,this.cancelButtonView].forEach(function(t){_this222._focusables.add(t),_this222.focusTracker.add(t.element);}),this.keystrokes.listenTo(this.element);var t=function t(_t282){return _t282.stopPropagation();};this.keystrokes.set(\"arrowright\",t),this.keystrokes.set(\"arrowleft\",t),this.keystrokes.set(\"arrowup\",t),this.keystrokes.set(\"arrowdown\",t),this.listenTo(this.urlInputView.element,\"selectstart\",function(t,e){e.stopPropagation();},{priority:\"high\"});}},{key:\"focus\",value:function focus(){this._focusCycler.focusFirst();}},{key:\"url\",get:function get(){return this.urlInputView.inputView.element.value.trim();},set:function set(t){this.urlInputView.inputView.element.value=t.trim();}},{key:\"isValid\",value:function isValid(){this.resetFormStatus();var _iterator323=_createForOfIteratorHelper(this._validators),_step323;try{for(_iterator323.s();!(_step323=_iterator323.n()).done;){var _t283=_step323.value;var _e249=_t283(this);if(_e249)return this.urlInputView.errorText=_e249,!1;}}catch(err){_iterator323.e(err);}finally{_iterator323.f();}return!0;}},{key:\"resetFormStatus\",value:function resetFormStatus(){this.urlInputView.errorText=null,this.urlInputView.infoText=this._urlInputViewInfoDefault;}},{key:\"_createUrlInput\",value:function _createUrlInput(){var _this223=this;var t=this.locale.t,e=new Ch(this.locale,Th),n=e.inputView;return this._urlInputViewInfoDefault=t(\"ax\"),this._urlInputViewInfoTip=t(\"ay\"),e.label=t(\"az\"),e.infoText=this._urlInputViewInfoDefault,n.placeholder=\"https://example.com\",n.on(\"input\",function(){e.infoText=n.element.value?_this223._urlInputViewInfoTip:_this223._urlInputViewInfoDefault;}),e;}},{key:\"_createButton\",value:function _createButton(t,e,n,i){var o=new qd(this.locale);return o.set({label:t,icon:e,tooltip:!0}),o.extendTemplate({attributes:{\"class\":n}}),i&&o.delegate(\"execute\").to(this,i),o;}}]);return Tp;}(Nl);var Pp=n(37),Mp=n.n(Pp);var Ep=/*#__PURE__*/function(_$l48){_inherits(Ep,_$l48);var _super143=_createSuper(Ep);function Ep(){_classCallCheck(this,Ep);return _super143.apply(this,arguments);}_createClass(Ep,[{key:\"init\",value:function init(){var _this224=this;var t=this.editor,e=t.commands.get(\"mediaEmbed\"),n=t.plugins.get(xp).registry;this.form=new Tp(function(t,e){return[function(e){if(!e.url.length)return t(\"am\");},function(n){if(!e.hasMedia(n.url))return t(\"an\");}];}(t.t,n),t.locale),t.ui.componentFactory.add(\"mediaEmbed\",function(n){var i=Df(n);return _this224._setUpDropdown(i,_this224.form,e,t),_this224._setUpForm(_this224.form,i,e),i;});}},{key:\"_setUpDropdown\",value:function _setUpDropdown(t,e,n){var i=this.editor,o=i.t,r=t.buttonView;function s(){i.editing.view.focus(),t.isOpen=!1;}t.bind(\"isEnabled\").to(n),t.panelView.children.add(e),r.set({label:o(\"al\"),icon:Mp.a,tooltip:!0}),r.on(\"open\",function(){e.url=n.value||\"\",e.urlInputView.select(),e.focus();},{priority:\"low\"}),t.on(\"submit\",function(){e.isValid()&&(i.execute(\"mediaEmbed\",e.url),s());}),t.on(\"change:isOpen\",function(){return e.resetFormStatus();}),t.on(\"cancel\",function(){return s();});}},{key:\"_setUpForm\",value:function _setUpForm(t,e,n){t.delegate(\"submit\",\"cancel\").to(e),t.urlInputView.bind(\"value\").to(n,\"value\"),t.urlInputView.bind(\"isReadOnly\").to(n,\"isEnabled\",function(t){return!t;}),t.saveButtonView.bind(\"isEnabled\").to(n);}}],[{key:\"requires\",get:function get(){return[xp];}},{key:\"pluginName\",get:function get(){return\"MediaEmbedUI\";}}]);return Ep;}($l);n(109);function Sp(t){return t.replace(/(\\s+)<\\/span>/g,function(t,e){return 1===e.length?\" \":Array(e.length+1).join(\"  \").substr(0,e.length);});}function Ip(t){var e=new DOMParser(),n=function(t){return Sp(Sp(t)).replace(/([\\s]*?)[\\r\\n]+(\\s*<\\/span>)/g,\"$1$2\").replace(/<\\/span>/g,\"\").replace(/ <\\//g,\" <\\/o:p>/g,\" \").replace(/>(\\s*[\\r\\n]\\s*)<\");}(function(t){var e=t.match(/<\\/body>(.*?)(<\\/html>|$)/);e&&e[1]&&(t=t.slice(0,e.index)+t.slice(e.index).replace(e[1],\"\"));return t;}(t=t.replace(/

ab

c[d

e]f

\n\t\t//

e[f

a]b

cd

-->

e[f

a]b

cd

\n\t\t//\n\t\t// Without this special condition, the default algorithm leaves an \"artifact\" range from one of `differenceSet` parts:\n\t\t//\n\t\t//

ab

c[d

e]f

-->

ab

{
}

c[d

e]f

\n\t\t//\n\t\t// This special case is applied only if the range is to be kept together (not spread).\n\t\tconst moveRange = Range._createFromPositionAndShift( sourcePosition, howMany );\n\t\tconst insertPosition = targetPosition._getTransformedByDeletion( sourcePosition, howMany );\n\n\t\tif ( this.containsPosition( targetPosition ) && !spread ) {\n\t\t\tif ( moveRange.containsPosition( this.start ) || moveRange.containsPosition( this.end ) ) {\n\t\t\t\tconst start = this.start._getTransformedByMove( sourcePosition, targetPosition, howMany );\n\t\t\t\tconst end = this.end._getTransformedByMove( sourcePosition, targetPosition, howMany );\n\n\t\t\t\treturn [ new Range( start, end ) ];\n\t\t\t}\n\t\t}\n\n\t\t// Default algorithm.\n\t\tlet result;\n\n\t\tconst differenceSet = this.getDifference( moveRange );\n\t\tlet difference = null;\n\n\t\tconst common = this.getIntersection( moveRange );\n\n\t\tif ( differenceSet.length == 1 ) {\n\t\t\t// `moveRange` and this range may intersect but may be separate.\n\t\t\tdifference = new Range(\n\t\t\t\tdifferenceSet[ 0 ].start._getTransformedByDeletion( sourcePosition, howMany ),\n\t\t\t\tdifferenceSet[ 0 ].end._getTransformedByDeletion( sourcePosition, howMany )\n\t\t\t);\n\t\t} else if ( differenceSet.length == 2 ) {\n\t\t\t// `moveRange` is inside this range.\n\t\t\tdifference = new Range(\n\t\t\t\tthis.start,\n\t\t\t\tthis.end._getTransformedByDeletion( sourcePosition, howMany )\n\t\t\t);\n\t\t} // else, `moveRange` contains this range.\n\n\t\tif ( difference ) {\n\t\t\tresult = difference._getTransformedByInsertion( insertPosition, howMany, common !== null || spread );\n\t\t} else {\n\t\t\tresult = [];\n\t\t}\n\n\t\tif ( common ) {\n\t\t\tconst transformedCommon = new Range(\n\t\t\t\tcommon.start._getCombined( moveRange.start, insertPosition ),\n\t\t\t\tcommon.end._getCombined( moveRange.start, insertPosition )\n\t\t\t);\n\n\t\t\tif ( result.length == 2 ) {\n\t\t\t\tresult.splice( 1, 0, transformedCommon );\n\t\t\t} else {\n\t\t\t\tresult.push( transformedCommon );\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns a copy of this range that is transformed by deletion of `howMany` nodes from `deletePosition`.\n\t *\n\t * If the deleted range is intersecting with the transformed range, the transformed range will be shrank.\n\t *\n\t * If the deleted range contains transformed range, `null` will be returned.\n\t *\n\t * @protected\n\t * @param {module:engine/model/position~Position} deletionPosition Position from which nodes are removed.\n\t * @param {Number} howMany How many nodes are removed.\n\t * @returns {module:engine/model/range~Range|null} Result of the transformation.\n\t */\n\t_getTransformedByDeletion( deletePosition, howMany ) {\n\t\tlet newStart = this.start._getTransformedByDeletion( deletePosition, howMany );\n\t\tlet newEnd = this.end._getTransformedByDeletion( deletePosition, howMany );\n\n\t\tif ( newStart == null && newEnd == null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( newStart == null ) {\n\t\t\tnewStart = deletePosition;\n\t\t}\n\n\t\tif ( newEnd == null ) {\n\t\t\tnewEnd = deletePosition;\n\t\t}\n\n\t\treturn new Range( newStart, newEnd );\n\t}\n\n\t/**\n\t * Creates a new range, spreading from specified {@link module:engine/model/position~Position position} to a position moved by\n\t * given `shift`. If `shift` is a negative value, shifted position is treated as the beginning of the range.\n\t *\n\t * @protected\n\t * @param {module:engine/model/position~Position} position Beginning of the range.\n\t * @param {Number} shift How long the range should be.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tstatic _createFromPositionAndShift( position, shift ) {\n\t\tconst start = position;\n\t\tconst end = position.getShiftedBy( shift );\n\n\t\treturn shift > 0 ? new this( start, end ) : new this( end, start );\n\t}\n\n\t/**\n\t * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n\t * that element and ends after the last child of that element.\n\t *\n\t * @protected\n\t * @param {module:engine/model/element~Element} element Element which is a parent for the range.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tstatic _createIn( element ) {\n\t\treturn new this( Position._createAt( element, 0 ), Position._createAt( element, element.maxOffset ) );\n\t}\n\n\t/**\n\t * Creates a range that starts before given {@link module:engine/model/item~Item model item} and ends after it.\n\t *\n\t * @protected\n\t * @param {module:engine/model/item~Item} item\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tstatic _createOn( item ) {\n\t\treturn this._createFromPositionAndShift( Position._createBefore( item ), item.offsetSize );\n\t}\n\n\t/**\n\t * Combines all ranges from the passed array into a one range. At least one range has to be passed.\n\t * Passed ranges must not have common parts.\n\t *\n\t * The first range from the array is a reference range. If other ranges start or end on the exactly same position where\n\t * the reference range, they get combined into one range.\n\t *\n\t *\t\t[ ][] [ ][ ][ ][ ][] [ ] // Passed ranges, shown sorted\n\t *\t\t[ ] // The result of the function if the first range was a reference range.\n\t *\t [ ] // The result of the function if the third-to-seventh range was a reference range.\n\t *\t [ ] // The result of the function if the last range was a reference range.\n\t *\n\t * @param {Array.} ranges Ranges to combine.\n\t * @returns {module:engine/model/range~Range} Combined range.\n\t */\n\tstatic _createFromRanges( ranges ) {\n\t\tif ( ranges.length === 0 ) {\n\t\t\t/**\n\t\t\t * At least one range has to be passed to\n\t\t\t * {@link module:engine/model/range~Range._createFromRanges `Range._createFromRanges()`}.\n\t\t\t *\n\t\t\t * @error range-create-from-ranges-empty-array\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'range-create-from-ranges-empty-array: At least one range has to be passed.' );\n\t\t} else if ( ranges.length == 1 ) {\n\t\t\treturn ranges[ 0 ].clone();\n\t\t}\n\n\t\t// 1. Set the first range in `ranges` array as a reference range.\n\t\t// If we are going to return just a one range, one of the ranges need to be the reference one.\n\t\t// Other ranges will be stuck to that range, if possible.\n\t\tconst ref = ranges[ 0 ];\n\n\t\t// 2. Sort all the ranges so it's easier to process them.\n\t\tranges.sort( ( a, b ) => {\n\t\t\treturn a.start.isAfter( b.start ) ? 1 : -1;\n\t\t} );\n\n\t\t// 3. Check at which index the reference range is now.\n\t\tconst refIndex = ranges.indexOf( ref );\n\n\t\t// 4. At this moment we don't need the original range.\n\t\t// We are going to modify the result and we need to return a new instance of Range.\n\t\t// We have to create a copy of the reference range.\n\t\tconst result = new this( ref.start, ref.end );\n\n\t\t// 5. Ranges should be checked and glued starting from the range that is closest to the reference range.\n\t\t// Since ranges are sorted, start with the range with index that is closest to reference range index.\n\t\tif ( refIndex > 0 ) {\n\t\t\tfor ( let i = refIndex - 1; true; i++ ) {\n\t\t\t\tif ( ranges[ i ].end.isEqual( result.start ) ) {\n\t\t\t\t\tresult.start = Position._createAt( ranges[ i ].start );\n\t\t\t\t} else {\n\t\t\t\t\t// If ranges are not starting/ending at the same position there is no point in looking further.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// 6. Ranges should be checked and glued starting from the range that is closest to the reference range.\n\t\t// Since ranges are sorted, start with the range with index that is closest to reference range index.\n\t\tfor ( let i = refIndex + 1; i < ranges.length; i++ ) {\n\t\t\tif ( ranges[ i ].start.isEqual( result.end ) ) {\n\t\t\t\tresult.end = Position._createAt( ranges[ i ].end );\n\t\t\t} else {\n\t\t\t\t// If ranges are not starting/ending at the same position there is no point in looking further.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Creates a `Range` instance from given plain object (i.e. parsed JSON string).\n\t *\n\t * @param {Object} json Plain object to be converted to `Range`.\n\t * @param {module:engine/model/document~Document} doc Document object that will be range owner.\n\t * @returns {module:engine/model/element~Element} `Range` instance created using given plain object.\n\t */\n\tstatic fromJSON( json, doc ) {\n\t\treturn new this( Position.fromJSON( json.start, doc ), Position.fromJSON( json.end, doc ) );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/mapper\n */\n\nimport ModelPosition from '../model/position';\nimport ModelRange from '../model/range';\n\nimport ViewPosition from '../view/position';\nimport ViewRange from '../view/range';\nimport ViewText from '../view/text';\n\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * Maps elements, positions and markers between {@link module:engine/view/document~Document the view} and\n * {@link module:engine/model/model the model}.\n *\n * Mapper use bound elements to find corresponding elements and positions, so, to get proper results,\n * all model elements should be {@link module:engine/conversion/mapper~Mapper#bindElements bound}.\n *\n * To map complex model to/from view relations, you may provide custom callbacks for\n * {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition modelToViewPosition event} and\n * {@link module:engine/conversion/mapper~Mapper#event:viewToModelPosition viewToModelPosition event} that are fired whenever\n * a position mapping request occurs.\n * Those events are fired by {@link module:engine/conversion/mapper~Mapper#toViewPosition toViewPosition}\n * and {@link module:engine/conversion/mapper~Mapper#toModelPosition toModelPosition} methods. `Mapper` adds it's own default callbacks\n * with `'lowest'` priority. To override default `Mapper` mapping, add custom callback with higher priority and\n * stop the event.\n */\nexport default class Mapper {\n\t/**\n\t * Creates an instance of the mapper.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Model element to view element mapping.\n\t\t *\n\t\t * @private\n\t\t * @member {WeakMap}\n\t\t */\n\t\tthis._modelToViewMapping = new WeakMap();\n\n\t\t/**\n\t\t * View element to model element mapping.\n\t\t *\n\t\t * @private\n\t\t * @member {WeakMap}\n\t\t */\n\t\tthis._viewToModelMapping = new WeakMap();\n\n\t\t/**\n\t\t * A map containing callbacks between view element names and functions evaluating length of view elements\n\t\t * in model.\n\t\t *\n\t\t * @private\n\t\t * @member {Map}\n\t\t */\n\t\tthis._viewToModelLengthCallbacks = new Map();\n\n\t\t/**\n\t\t * Model marker name to view elements mapping.\n\t\t *\n\t\t * Keys are `String`s while values are `Set`s with {@link module:engine/view/element~Element view elements}.\n\t\t * One marker (name) can be mapped to multiple elements.\n\t\t *\n\t\t * @private\n\t\t * @member {Map}\n\t\t */\n\t\tthis._markerNameToElements = new Map();\n\n\t\t// Default mapper algorithm for mapping model position to view position.\n\t\tthis.on( 'modelToViewPosition', ( evt, data ) => {\n\t\t\tif ( data.viewPosition ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst viewContainer = this._modelToViewMapping.get( data.modelPosition.parent );\n\n\t\t\tdata.viewPosition = this._findPositionIn( viewContainer, data.modelPosition.offset );\n\t\t}, { priority: 'low' } );\n\n\t\t// Default mapper algorithm for mapping view position to model position.\n\t\tthis.on( 'viewToModelPosition', ( evt, data ) => {\n\t\t\tif ( data.modelPosition ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst viewBlock = this.findMappedViewAncestor( data.viewPosition );\n\t\t\tconst modelParent = this._viewToModelMapping.get( viewBlock );\n\t\t\tconst modelOffset = this._toModelOffset( data.viewPosition.parent, data.viewPosition.offset, viewBlock );\n\n\t\t\tdata.modelPosition = ModelPosition._createAt( modelParent, modelOffset );\n\t\t}, { priority: 'low' } );\n\t}\n\n\t/**\n\t * Marks model and view elements as corresponding. Corresponding elements can be retrieved by using\n\t * the {@link module:engine/conversion/mapper~Mapper#toModelElement toModelElement} and\n\t * {@link module:engine/conversion/mapper~Mapper#toViewElement toViewElement} methods.\n\t * The information that elements are bound is also used to translate positions.\n\t *\n\t * @param {module:engine/model/element~Element} modelElement Model element.\n\t * @param {module:engine/view/element~Element} viewElement View element.\n\t */\n\tbindElements( modelElement, viewElement ) {\n\t\tthis._modelToViewMapping.set( modelElement, viewElement );\n\t\tthis._viewToModelMapping.set( viewElement, modelElement );\n\t}\n\n\t/**\n\t * Unbinds given {@link module:engine/view/element~Element view element} from the map.\n\t *\n\t * **Note:** view-to-model binding will be removed, if it existed. However, corresponding model-to-view binding\n\t * will be removed only if model element is still bound to passed `viewElement`.\n\t *\n\t * This behavior lets for re-binding model element to another view element without fear of losing the new binding\n\t * when the previously bound view element is unbound.\n\t *\n\t * @param {module:engine/view/element~Element} viewElement View element to unbind.\n\t */\n\tunbindViewElement( viewElement ) {\n\t\tconst modelElement = this.toModelElement( viewElement );\n\n\t\tthis._viewToModelMapping.delete( viewElement );\n\n\t\tif ( this._modelToViewMapping.get( modelElement ) == viewElement ) {\n\t\t\tthis._modelToViewMapping.delete( modelElement );\n\t\t}\n\t}\n\n\t/**\n\t * Unbinds given {@link module:engine/model/element~Element model element} from the map.\n\t *\n\t * **Note:** model-to-view binding will be removed, if it existed. However, corresponding view-to-model binding\n\t * will be removed only if view element is still bound to passed `modelElement`.\n\t *\n\t * This behavior lets for re-binding view element to another model element without fear of losing the new binding\n\t * when the previously bound model element is unbound.\n\t *\n\t * @param {module:engine/model/element~Element} modelElement Model element to unbind.\n\t */\n\tunbindModelElement( modelElement ) {\n\t\tconst viewElement = this.toViewElement( modelElement );\n\n\t\tthis._modelToViewMapping.delete( modelElement );\n\n\t\tif ( this._viewToModelMapping.get( viewElement ) == modelElement ) {\n\t\t\tthis._viewToModelMapping.delete( viewElement );\n\t\t}\n\t}\n\n\t/**\n\t * Binds given marker name with given {@link module:engine/view/element~Element view element}. The element\n\t * will be added to the current set of elements bound with given marker name.\n\t *\n\t * @param {module:engine/view/element~Element} element Element to bind.\n\t * @param {String} name Marker name.\n\t */\n\tbindElementToMarker( element, name ) {\n\t\tconst elements = this._markerNameToElements.get( name ) || new Set();\n\n\t\telements.add( element );\n\n\t\tthis._markerNameToElements.set( name, elements );\n\t}\n\n\t/**\n\t * Unbinds all elements from given marker name.\n\t *\n\t * @param {String} name Marker name.\n\t */\n\tunbindElementsFromMarkerName( name ) {\n\t\tthis._markerNameToElements.delete( name );\n\t}\n\n\t/**\n\t * Removes all model to view and view to model bindings.\n\t */\n\tclearBindings() {\n\t\tthis._modelToViewMapping = new WeakMap();\n\t\tthis._viewToModelMapping = new WeakMap();\n\t\tthis._markerNameToElements = new Map();\n\t}\n\n\t/**\n\t * Gets the corresponding model element.\n\t *\n\t * **Note:** {@link module:engine/view/uielement~UIElement} does not have corresponding element in model.\n\t *\n\t * @param {module:engine/view/element~Element} viewElement View element.\n\t * @returns {module:engine/model/element~Element|undefined} Corresponding model element or `undefined` if not found.\n\t */\n\ttoModelElement( viewElement ) {\n\t\treturn this._viewToModelMapping.get( viewElement );\n\t}\n\n\t/**\n\t * Gets the corresponding view element.\n\t *\n\t * @param {module:engine/model/element~Element} modelElement Model element.\n\t * @returns {module:engine/view/element~Element|undefined} Corresponding view element or `undefined` if not found.\n\t */\n\ttoViewElement( modelElement ) {\n\t\treturn this._modelToViewMapping.get( modelElement );\n\t}\n\n\t/**\n\t * Gets the corresponding model range.\n\t *\n\t * @param {module:engine/view/range~Range} viewRange View range.\n\t * @returns {module:engine/model/range~Range} Corresponding model range.\n\t */\n\ttoModelRange( viewRange ) {\n\t\treturn new ModelRange( this.toModelPosition( viewRange.start ), this.toModelPosition( viewRange.end ) );\n\t}\n\n\t/**\n\t * Gets the corresponding view range.\n\t *\n\t * @param {module:engine/model/range~Range} modelRange Model range.\n\t * @returns {module:engine/view/range~Range} Corresponding view range.\n\t */\n\ttoViewRange( modelRange ) {\n\t\treturn new ViewRange( this.toViewPosition( modelRange.start ), this.toViewPosition( modelRange.end ) );\n\t}\n\n\t/**\n\t * Gets the corresponding model position.\n\t *\n\t * @fires viewToModelPosition\n\t * @param {module:engine/view/position~Position} viewPosition View position.\n\t * @returns {module:engine/model/position~Position} Corresponding model position.\n\t */\n\ttoModelPosition( viewPosition ) {\n\t\tconst data = {\n\t\t\tviewPosition,\n\t\t\tmapper: this\n\t\t};\n\n\t\tthis.fire( 'viewToModelPosition', data );\n\n\t\treturn data.modelPosition;\n\t}\n\n\t/**\n\t * Gets the corresponding view position.\n\t *\n\t * @fires modelToViewPosition\n\t * @param {module:engine/model/position~Position} modelPosition Model position.\n\t * @param {Object} [options] Additional options for position mapping process.\n\t * @param {Boolean} [options.isPhantom=false] Should be set to `true` if the model position to map is pointing to a place\n\t * in model tree which no longer exists. For example, it could be an end of a removed model range.\n\t * @returns {module:engine/view/position~Position} Corresponding view position.\n\t */\n\ttoViewPosition( modelPosition, options = { isPhantom: false } ) {\n\t\tconst data = {\n\t\t\tmodelPosition,\n\t\t\tmapper: this,\n\t\t\tisPhantom: options.isPhantom\n\t\t};\n\n\t\tthis.fire( 'modelToViewPosition', data );\n\n\t\treturn data.viewPosition;\n\t}\n\n\t/**\n\t * Gets all view elements bound to the given marker name.\n\t *\n\t * @param {String} name Marker name.\n\t * @returns {Set.|null} View elements bound with given marker name or `null`\n\t * if no elements are bound to given marker name.\n\t */\n\tmarkerNameToElements( name ) {\n\t\tconst boundElements = this._markerNameToElements.get( name );\n\n\t\tif ( !boundElements ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst elements = new Set();\n\n\t\tfor ( const element of boundElements ) {\n\t\t\tif ( element.is( 'attributeElement' ) ) {\n\t\t\t\tfor ( const clone of element.getElementsWithSameId() ) {\n\t\t\t\t\telements.add( clone );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\telements.add( element );\n\t\t\t}\n\t\t}\n\n\t\treturn elements;\n\t}\n\n\t/**\n\t * Registers a callback that evaluates the length in the model of a view element with given name.\n\t *\n\t * The callback is fired with one argument, which is a view element instance. The callback is expected to return\n\t * a number representing the length of view element in model.\n\t *\n\t *\t\t// List item in view may contain nested list, which have other list items. In model though,\n\t *\t\t// the lists are represented by flat structure. Because of those differences, length of list view element\n\t *\t\t// may be greater than one. In the callback it's checked how many nested list items are in evaluated list item.\n\t *\n\t *\t\tfunction getViewListItemLength( element ) {\n\t *\t\t\tlet length = 1;\n\t *\n\t *\t\t\tfor ( let child of element.getChildren() ) {\n\t *\t\t\t\tif ( child.name == 'ul' || child.name == 'ol' ) {\n\t *\t\t\t\t\tfor ( let item of child.getChildren() ) {\n\t *\t\t\t\t\t\tlength += getViewListItemLength( item );\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\n\t *\t\t\treturn length;\n\t *\t\t}\n\t *\n\t *\t\tmapper.registerViewToModelLength( 'li', getViewListItemLength );\n\t *\n\t * @param {String} viewElementName Name of view element for which callback is registered.\n\t * @param {Function} lengthCallback Function return a length of view element instance in model.\n\t */\n\tregisterViewToModelLength( viewElementName, lengthCallback ) {\n\t\tthis._viewToModelLengthCallbacks.set( viewElementName, lengthCallback );\n\t}\n\n\t/**\n\t * For given `viewPosition`, finds and returns the closest ancestor of this position that has a mapping to\n\t * the model.\n\t *\n\t * @param {module:engine/view/position~Position} viewPosition Position for which mapped ancestor should be found.\n\t * @returns {module:engine/view/element~Element}\n\t */\n\tfindMappedViewAncestor( viewPosition ) {\n\t\tlet parent = viewPosition.parent;\n\n\t\twhile ( !this._viewToModelMapping.has( parent ) ) {\n\t\t\tparent = parent.parent;\n\t\t}\n\n\t\treturn parent;\n\t}\n\n\t/**\n\t * Calculates model offset based on the view position and the block element.\n\t *\n\t * Example:\n\t *\n\t *\t\t

fooba|r

// _toModelOffset( b, 2, p ) -> 5\n\t *\n\t * Is a sum of:\n\t *\n\t *\t\t

foo|bar

// _toModelOffset( p, 3, p ) -> 3\n\t *\t\t

fooba|r

// _toModelOffset( b, 2, b ) -> 2\n\t *\n\t * @private\n\t * @param {module:engine/view/element~Element} viewParent Position parent.\n\t * @param {Number} viewOffset Position offset.\n\t * @param {module:engine/view/element~Element} viewBlock Block used as a base to calculate offset.\n\t * @returns {Number} Offset in the model.\n\t */\n\t_toModelOffset( viewParent, viewOffset, viewBlock ) {\n\t\tif ( viewBlock != viewParent ) {\n\t\t\t// See example.\n\t\t\tconst offsetToParentStart = this._toModelOffset( viewParent.parent, viewParent.index, viewBlock );\n\t\t\tconst offsetInParent = this._toModelOffset( viewParent, viewOffset, viewParent );\n\n\t\t\treturn offsetToParentStart + offsetInParent;\n\t\t}\n\n\t\t// viewBlock == viewParent, so we need to calculate the offset in the parent element.\n\n\t\t// If the position is a text it is simple (\"ba|r\" -> 2).\n\t\tif ( viewParent.is( 'text' ) ) {\n\t\t\treturn viewOffset;\n\t\t}\n\n\t\t// If the position is in an element we need to sum lengths of siblings ( bar foo | -> 3 + 3 = 6 ).\n\t\tlet modelOffset = 0;\n\n\t\tfor ( let i = 0; i < viewOffset; i++ ) {\n\t\t\tmodelOffset += this.getModelLength( viewParent.getChild( i ) );\n\t\t}\n\n\t\treturn modelOffset;\n\t}\n\n\t/**\n\t * Gets the length of the view element in the model.\n\t *\n\t * The length is calculated as follows:\n\t * * if {@link #registerViewToModelLength length mapping callback} is provided for given `viewNode` it is used to\n\t * evaluate model length (`viewNode` is used as first and only parameter passed to the callback),\n\t * * length of a {@link module:engine/view/text~Text text node} is equal to the length of it's\n\t * {@link module:engine/view/text~Text#data data},\n\t * * length of a {@link module:engine/view/uielement~UIElement ui element} is equal to 0,\n\t * * length of a mapped {@link module:engine/view/element~Element element} is equal to 1,\n\t * * length of a not-mapped {@link module:engine/view/element~Element element} is equal to the length of it's children.\n\t *\n\t * Examples:\n\t *\n\t *\t\tfoo -> 3 // Text length is equal to it's data length.\n\t *\t\t

foo

-> 1 // Length of an element which is mapped is by default equal to 1.\n\t *\t\tfoo -> 3 // Length of an element which is not mapped is a length of its children.\n\t *\t\t

x

y

-> 2 // Assuming that
is not mapped and

are mapped.\n\t *\n\t * @param {module:engine/view/element~Element} viewNode View node.\n\t * @returns {Number} Length of the node in the tree model.\n\t */\n\tgetModelLength( viewNode ) {\n\t\tif ( this._viewToModelLengthCallbacks.get( viewNode.name ) ) {\n\t\t\tconst callback = this._viewToModelLengthCallbacks.get( viewNode.name );\n\n\t\t\treturn callback( viewNode );\n\t\t} else if ( this._viewToModelMapping.has( viewNode ) ) {\n\t\t\treturn 1;\n\t\t} else if ( viewNode.is( 'text' ) ) {\n\t\t\treturn viewNode.data.length;\n\t\t} else if ( viewNode.is( 'uiElement' ) ) {\n\t\t\treturn 0;\n\t\t} else {\n\t\t\tlet len = 0;\n\n\t\t\tfor ( const child of viewNode.getChildren() ) {\n\t\t\t\tlen += this.getModelLength( child );\n\t\t\t}\n\n\t\t\treturn len;\n\t\t}\n\t}\n\n\t/**\n\t * Finds the position in the view node (or its children) with the expected model offset.\n\t *\n\t * Example:\n\t *\n\t *\t\t

fobarbom

-> expected offset: 4\n\t *\n\t *\t\t_findPositionIn( p, 4 ):\n\t *\t\t

|fobarbom

-> expected offset: 4, actual offset: 0\n\t *\t\t

fo|barbom

-> expected offset: 4, actual offset: 2\n\t *\t\t

fobar|bom

-> expected offset: 4, actual offset: 5 -> we are too far\n\t *\n\t *\t\t_findPositionIn( b, 4 - ( 5 - 3 ) ):\n\t *\t\t

fo|barbom

-> expected offset: 2, actual offset: 0\n\t *\t\t

fobar|bom

-> expected offset: 2, actual offset: 3 -> we are too far\n\t *\n\t *\t\t_findPositionIn( bar, 2 - ( 3 - 3 ) ):\n\t *\t\tWe are in the text node so we can simple find the offset.\n\t *\t\t

foba|rbom

-> expected offset: 2, actual offset: 2 -> position found\n\t *\n\t * @private\n\t * @param {module:engine/view/element~Element} viewParent Tree view element in which we are looking for the position.\n\t * @param {Number} expectedOffset Expected offset.\n\t * @returns {module:engine/view/position~Position} Found position.\n\t */\n\t_findPositionIn( viewParent, expectedOffset ) {\n\t\t// Last scanned view node.\n\t\tlet viewNode;\n\t\t// Length of the last scanned view node.\n\t\tlet lastLength = 0;\n\n\t\tlet modelOffset = 0;\n\t\tlet viewOffset = 0;\n\n\t\t// In the text node it is simple: offset in the model equals offset in the text.\n\t\tif ( viewParent.is( 'text' ) ) {\n\t\t\treturn new ViewPosition( viewParent, expectedOffset );\n\t\t}\n\n\t\t// In other cases we add lengths of child nodes to find the proper offset.\n\n\t\t// If it is smaller we add the length.\n\t\twhile ( modelOffset < expectedOffset ) {\n\t\t\tviewNode = viewParent.getChild( viewOffset );\n\t\t\tlastLength = this.getModelLength( viewNode );\n\t\t\tmodelOffset += lastLength;\n\t\t\tviewOffset++;\n\t\t}\n\n\t\t// If it equals we found the position.\n\t\tif ( modelOffset == expectedOffset ) {\n\t\t\treturn this._moveViewPositionToTextNode( new ViewPosition( viewParent, viewOffset ) );\n\t\t}\n\t\t// If it is higher we need to enter last child.\n\t\telse {\n\t\t\t// ( modelOffset - lastLength ) is the offset to the child we enter,\n\t\t\t// so we subtract it from the expected offset to fine the offset in the child.\n\t\t\treturn this._findPositionIn( viewNode, expectedOffset - ( modelOffset - lastLength ) );\n\t\t}\n\t}\n\n\t/**\n\t * Because we prefer positions in text nodes over positions next to text node moves view position to the text node\n\t * if it was next to it.\n\t *\n\t *\t\t

[]foo

->

[]foo

// do not touch if position is not directly next to text\n\t *\t\t

foo[]foo

->

foo{}foo

// move to text node\n\t *\t\t

[]foo

->

{}foo

// move to text node\n\t *\n\t * @private\n\t * @param {module:engine/view/position~Position} viewPosition Position potentially next to text node.\n\t * @returns {module:engine/view/position~Position} Position in text node if possible.\n\t */\n\t_moveViewPositionToTextNode( viewPosition ) {\n\t\t// If the position is just after text node, put it at the end of that text node.\n\t\t// If the position is just before text node, put it at the beginning of that text node.\n\t\tconst nodeBefore = viewPosition.nodeBefore;\n\t\tconst nodeAfter = viewPosition.nodeAfter;\n\n\t\tif ( nodeBefore instanceof ViewText ) {\n\t\t\treturn new ViewPosition( nodeBefore, nodeBefore.data.length );\n\t\t} else if ( nodeAfter instanceof ViewText ) {\n\t\t\treturn new ViewPosition( nodeAfter, 0 );\n\t\t}\n\n\t\t// Otherwise, just return the given position.\n\t\treturn viewPosition;\n\t}\n\n\t/**\n\t * Fired for each model-to-view position mapping request. The purpose of this event is to enable custom model-to-view position\n\t * mapping. Callbacks added to this event take {@link module:engine/model/position~Position model position} and are expected to\n\t * calculate {@link module:engine/view/position~Position view position}. Calculated view position should be added as `viewPosition`\n\t * value in `data` object that is passed as one of parameters to the event callback.\n\t *\n\t * \t\t// Assume that \"captionedImage\" model element is converted to and following elements in view,\n\t * \t\t// and the model element is bound to element. Force mapping model positions inside \"captionedImage\" to that\n\t * \t\t// element.\n\t *\t\tmapper.on( 'modelToViewPosition', ( evt, data ) => {\n\t *\t\t\tconst positionParent = modelPosition.parent;\n\t *\n\t *\t\t\tif ( positionParent.name == 'captionedImage' ) {\n\t *\t\t\t\tconst viewImg = data.mapper.toViewElement( positionParent );\n\t *\t\t\t\tconst viewCaption = viewImg.nextSibling; // The element.\n\t *\n\t *\t\t\t\tdata.viewPosition = new ViewPosition( viewCaption, modelPosition.offset );\n\t *\n\t *\t\t\t\t// Stop the event if other callbacks should not modify calculated value.\n\t *\t\t\t\tevt.stop();\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * **Note:** keep in mind that sometimes a \"phantom\" model position is being converted. \"Phantom\" model position is\n\t * a position that points to a non-existing place in model. Such position might still be valid for conversion, though\n\t * (it would point to a correct place in view when converted). One example of such situation is when a range is\n\t * removed from model, there may be a need to map the range's end (which is no longer valid model position). To\n\t * handle such situation, check `data.isPhantom` flag:\n\t *\n\t * \t\t// Assume that there is \"customElement\" model element and whenever position is before it, we want to move it\n\t * \t\t// to the inside of the view element bound to \"customElement\".\n\t *\t\tmapper.on( 'modelToViewPosition', ( evt, data ) => {\n\t *\t\t\tif ( data.isPhantom ) {\n\t *\t\t\t\treturn;\n\t *\t\t\t}\n\t *\n\t *\t\t\t// Below line might crash for phantom position that does not exist in model.\n\t *\t\t\tconst sibling = data.modelPosition.nodeBefore;\n\t *\n\t *\t\t\t// Check if this is the element we are interested in.\n\t *\t\t\tif ( !sibling.is( 'customElement' ) ) {\n\t *\t\t\t\treturn;\n\t *\t\t\t}\n\t *\n\t *\t\t\tconst viewElement = data.mapper.toViewElement( sibling );\n\t *\n\t *\t\t\tdata.viewPosition = new ViewPosition( sibling, 0 );\n\t *\n\t *\t\t\tevt.stop();\n\t *\t\t} );\n\t *\n\t * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to\n\t * attach a custom callback after default callback and also use `data.viewPosition` calculated by default callback\n\t * (for example to fix it).\n\t *\n\t * **Note:** default mapping callback will not fire if `data.viewPosition` is already set.\n\t *\n\t * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position\n\t * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,\n\t * the condition that checks if special case scenario happened should be as simple as possible.\n\t *\n\t * @event modelToViewPosition\n\t * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add\n\t * `viewPosition` value to that object with calculated {@link module:engine/view/position~Position view position}.\n\t * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.\n\t */\n\n\t/**\n\t * Fired for each view-to-model position mapping request. See {@link module:engine/conversion/mapper~Mapper#event:modelToViewPosition}.\n\t *\n\t * \t\t// See example in `modelToViewPosition` event description.\n\t * \t\t// This custom mapping will map positions from element next to to the \"captionedImage\" element.\n\t *\t\tmapper.on( 'viewToModelPosition', ( evt, data ) => {\n\t *\t\t\tconst positionParent = viewPosition.parent;\n\t *\n\t *\t\t\tif ( positionParent.hasClass( 'image-caption' ) ) {\n\t *\t\t\t\tconst viewImg = positionParent.previousSibling;\n\t *\t\t\t\tconst modelImg = data.mapper.toModelElement( viewImg );\n\t *\n\t *\t\t\t\tdata.modelPosition = new ModelPosition( modelImg, viewPosition.offset );\n\t *\t\t\t\tevt.stop();\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * **Note:** default mapping callback is provided with `low` priority setting and does not cancel the event, so it is possible to\n\t * attach a custom callback after default callback and also use `data.modelPosition` calculated by default callback\n\t * (for example to fix it).\n\t *\n\t * **Note:** default mapping callback will not fire if `data.modelPosition` is already set.\n\t *\n\t * **Note:** these callbacks are called **very often**. For efficiency reasons, it is advised to use them only when position\n\t * mapping between given model and view elements is unsolvable using just elements mapping and default algorithm. Also,\n\t * the condition that checks if special case scenario happened should be as simple as possible.\n\t *\n\t * @event viewToModelPosition\n\t * @param {Object} data Data pipeline object that can store and pass data between callbacks. The callback should add\n\t * `modelPosition` value to that object with calculated {@link module:engine/model/position~Position model position}.\n\t * @param {module:engine/conversion/mapper~Mapper} data.mapper Mapper instance that fired the event.\n\t */\n}\n\nmix( Mapper, EmitterMixin );\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/modelconsumable\n */\n\nimport TextProxy from '../model/textproxy';\n\n/**\n * Manages a list of consumable values for {@link module:engine/model/item~Item model items}.\n *\n * Consumables are various aspects of the model. A model item can be broken down into singular properties that might be\n * taken into consideration when converting that item.\n *\n * `ModelConsumable` is used by {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} while analyzing changed\n * parts of {@link module:engine/model/document~Document the document}. The added / changed / removed model items are broken down\n * into singular properties (the item itself and it's attributes). All those parts are saved in `ModelConsumable`. Then,\n * during conversion, when given part of model item is converted (i.e. the view element has been inserted into the view,\n * but without attributes), consumable value is removed from `ModelConsumable`.\n *\n * For model items, `ModelConsumable` stores consumable values of one of following types: `insert`, `addattribute:`,\n * `changeattributes:`, `removeattributes:`.\n *\n * In most cases, it is enough to let {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}\n * gather consumable values, so there is no need to use\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#add add method} directly.\n * However, it is important to understand how consumable values can be\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.\n * See {@link module:engine/conversion/downcasthelpers default downcast converters} for more information.\n *\n * Keep in mind, that one conversion event may have multiple callbacks (converters) attached to it. Each of those is\n * able to convert one or more parts of the model. However, when one of those callbacks actually converts\n * something, other should not, because they would duplicate the results. Using `ModelConsumable` helps avoiding\n * this situation, because callbacks should only convert those values, which were not yet consumed from `ModelConsumable`.\n *\n * Consuming multiple values in a single callback:\n *\n *\t\t// Converter for custom `image` element that might have a `caption` element inside which changes\n *\t\t// how the image is displayed in the view:\n *\t\t//\n *\t\t// Model:\n *\t\t//\n *\t\t// [image]\n *\t\t// └─ [caption]\n *\t\t// └─ foo\n *\t\t//\n *\t\t// View:\n *\t\t//\n *\t\t//
\n *\t\t// ├─ \n *\t\t// └─ \n *\t\t// └─ foo\n *\t\tmodelConversionDispatcher.on( 'insert:image', ( evt, data, conversionApi ) => {\n *\t\t\t// First, consume the `image` element.\n *\t\t\tconversionApi.consumable.consume( data.item, 'insert' );\n *\n *\t\t\t// Just create normal image element for the view.\n *\t\t\t// Maybe it will be \"decorated\" later.\n *\t\t\tconst viewImage = new ViewElement( 'img' );\n *\t\t\tconst insertPosition = conversionApi.mapper.toViewPosition( data.range.start );\n *\t\t\tconst viewWriter = conversionApi.writer;\n *\n *\t\t\t// Check if the `image` element has children.\n *\t\t\tif ( data.item.childCount > 0 ) {\n *\t\t\t\tconst modelCaption = data.item.getChild( 0 );\n *\n *\t\t\t\t// `modelCaption` insertion change is consumed from consumable values.\n *\t\t\t\t// It will not be converted by other converters, but it's children (probably some text) will be.\n *\t\t\t\t// Through mapping, converters for text will know where to insert contents of `modelCaption`.\n *\t\t\t\tif ( conversionApi.consumable.consume( modelCaption, 'insert' ) ) {\n *\t\t\t\t\tconst viewCaption = new ViewElement( 'figcaption' );\n *\n *\t\t\t\t\tconst viewImageHolder = new ViewElement( 'figure', null, [ viewImage, viewCaption ] );\n *\n *\t\t\t\t\tconversionApi.mapper.bindElements( modelCaption, viewCaption );\n *\t\t\t\t\tconversionApi.mapper.bindElements( data.item, viewImageHolder );\n *\t\t\t\t\tviewWriter.insert( insertPosition, viewImageHolder );\n *\t\t\t\t}\n *\t\t\t} else {\n *\t\t\t\tconversionApi.mapper.bindElements( data.item, viewImage );\n *\t\t\t\tviewWriter.insert( insertPosition, viewImage );\n *\t\t\t}\n *\n *\t\t\tevt.stop();\n *\t\t} );\n */\nexport default class ModelConsumable {\n\t/**\n\t * Creates an empty consumables list.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Contains list of consumable values.\n\t\t *\n\t\t * @private\n\t\t * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_consumable\n\t\t */\n\t\tthis._consumable = new Map();\n\n\t\t/**\n\t\t * For each {@link module:engine/model/textproxy~TextProxy} added to `ModelConsumable`, this registry holds parent\n\t\t * of that `TextProxy` and start and end indices of that `TextProxy`. This allows identification of `TextProxy`\n\t\t * instances that points to the same part of the model but are different instances. Each distinct `TextProxy`\n\t\t * is given unique `Symbol` which is then registered as consumable. This process is transparent for `ModelConsumable`\n\t\t * API user because whenever `TextProxy` is added, tested, consumed or reverted, internal mechanisms of\n\t\t * `ModelConsumable` translates `TextProxy` to that unique `Symbol`.\n\t\t *\n\t\t * @private\n\t\t * @member {Map} module:engine/conversion/modelconsumable~ModelConsumable#_textProxyRegistry\n\t\t */\n\t\tthis._textProxyRegistry = new Map();\n\t}\n\n\t/**\n\t * Adds a consumable value to the consumables list and links it with given model item.\n\t *\n\t *\t\tmodelConsumable.add( modelElement, 'insert' ); // Add `modelElement` insertion change to consumable values.\n\t *\t\tmodelConsumable.add( modelElement, 'addAttribute:bold' ); // Add `bold` attribute insertion on `modelElement` change.\n\t *\t\tmodelConsumable.add( modelElement, 'removeAttribute:bold' ); // Add `bold` attribute removal on `modelElement` change.\n\t *\t\tmodelConsumable.add( modelSelection, 'selection' ); // Add `modelSelection` to consumable values.\n\t *\t\tmodelConsumable.add( modelRange, 'range' ); // Add `modelRange` to consumable values.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item\n\t * Model item, range or selection that has the consumable.\n\t * @param {String} type Consumable type. Will be normalized to a proper form, that is either `` or `:`.\n\t * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n\t */\n\tadd( item, type ) {\n\t\ttype = _normalizeConsumableType( type );\n\n\t\tif ( item instanceof TextProxy ) {\n\t\t\titem = this._getSymbolForTextProxy( item );\n\t\t}\n\n\t\tif ( !this._consumable.has( item ) ) {\n\t\t\tthis._consumable.set( item, new Map() );\n\t\t}\n\n\t\tthis._consumable.get( item ).set( type, true );\n\t}\n\n\t/**\n\t * Removes given consumable value from given model item.\n\t *\n\t *\t\tmodelConsumable.consume( modelElement, 'insert' ); // Remove `modelElement` insertion change from consumable values.\n\t *\t\tmodelConsumable.consume( modelElement, 'addAttribute:bold' ); // Remove `bold` attribute insertion on `modelElement` change.\n\t *\t\tmodelConsumable.consume( modelElement, 'removeAttribute:bold' ); // Remove `bold` attribute removal on `modelElement` change.\n\t *\t\tmodelConsumable.consume( modelSelection, 'selection' ); // Remove `modelSelection` from consumable values.\n\t *\t\tmodelConsumable.consume( modelRange, 'range' ); // Remove 'modelRange' from consumable values.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item\n\t * Model item, range or selection from which consumable will be consumed.\n\t * @param {String} type Consumable type. Will be normalized to a proper form, that is either `` or `:`.\n\t * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n\t * @returns {Boolean} `true` if consumable value was available and was consumed, `false` otherwise.\n\t */\n\tconsume( item, type ) {\n\t\ttype = _normalizeConsumableType( type );\n\n\t\tif ( item instanceof TextProxy ) {\n\t\t\titem = this._getSymbolForTextProxy( item );\n\t\t}\n\n\t\tif ( this.test( item, type ) ) {\n\t\t\tthis._consumable.get( item ).set( type, false );\n\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Tests whether there is a consumable value of given type connected with given model item.\n\t *\n\t *\t\tmodelConsumable.test( modelElement, 'insert' ); // Check for `modelElement` insertion change.\n\t *\t\tmodelConsumable.test( modelElement, 'addAttribute:bold' ); // Check for `bold` attribute insertion on `modelElement` change.\n\t *\t\tmodelConsumable.test( modelElement, 'removeAttribute:bold' ); // Check for `bold` attribute removal on `modelElement` change.\n\t *\t\tmodelConsumable.test( modelSelection, 'selection' ); // Check if `modelSelection` is consumable.\n\t *\t\tmodelConsumable.test( modelRange, 'range' ); // Check if `modelRange` is consumable.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item\n\t * Model item, range or selection to be tested.\n\t * @param {String} type Consumable type. Will be normalized to a proper form, that is either `` or `:`.\n\t * Second colon and everything after will be cut. Passing event name is a safe and good practice.\n\t * @returns {null|Boolean} `null` if such consumable was never added, `false` if the consumable values was\n\t * already consumed or `true` if it was added and not consumed yet.\n\t */\n\ttest( item, type ) {\n\t\ttype = _normalizeConsumableType( type );\n\n\t\tif ( item instanceof TextProxy ) {\n\t\t\titem = this._getSymbolForTextProxy( item );\n\t\t}\n\n\t\tconst itemConsumables = this._consumable.get( item );\n\n\t\tif ( itemConsumables === undefined ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst value = itemConsumables.get( type );\n\n\t\tif ( value === undefined ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn value;\n\t}\n\n\t/**\n\t * Reverts consuming of consumable value.\n\t *\n\t *\t\tmodelConsumable.revert( modelElement, 'insert' ); // Revert consuming `modelElement` insertion change.\n\t *\t\tmodelConsumable.revert( modelElement, 'addAttribute:bold' ); // Revert consuming `bold` attribute insert from `modelElement`.\n\t *\t\tmodelConsumable.revert( modelElement, 'removeAttribute:bold' ); // Revert consuming `bold` attribute remove from `modelElement`.\n\t *\t\tmodelConsumable.revert( modelSelection, 'selection' ); // Revert consuming `modelSelection`.\n\t *\t\tmodelConsumable.revert( modelRange, 'range' ); // Revert consuming `modelRange`.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/selection~Selection|module:engine/model/range~Range} item\n\t * Model item, range or selection to be reverted.\n\t * @param {String} type Consumable type.\n\t * @returns {null|Boolean} `true` if consumable has been reversed, `false` otherwise. `null` if the consumable has\n\t * never been added.\n\t */\n\trevert( item, type ) {\n\t\ttype = _normalizeConsumableType( type );\n\n\t\tif ( item instanceof TextProxy ) {\n\t\t\titem = this._getSymbolForTextProxy( item );\n\t\t}\n\n\t\tconst test = this.test( item, type );\n\n\t\tif ( test === false ) {\n\t\t\tthis._consumable.get( item ).set( type, true );\n\n\t\t\treturn true;\n\t\t} else if ( test === true ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Gets a unique symbol for passed {@link module:engine/model/textproxy~TextProxy} instance. All `TextProxy` instances that\n\t * have same parent, same start index and same end index will get the same symbol.\n\t *\n\t * Used internally to correctly consume `TextProxy` instances.\n\t *\n\t * @private\n\t * @param {module:engine/model/textproxy~TextProxy} textProxy `TextProxy` instance to get a symbol for.\n\t * @returns {Symbol} Symbol representing all equal instances of `TextProxy`.\n\t */\n\t_getSymbolForTextProxy( textProxy ) {\n\t\tlet symbol = null;\n\n\t\tconst startMap = this._textProxyRegistry.get( textProxy.startOffset );\n\n\t\tif ( startMap ) {\n\t\t\tconst endMap = startMap.get( textProxy.endOffset );\n\n\t\t\tif ( endMap ) {\n\t\t\t\tsymbol = endMap.get( textProxy.parent );\n\t\t\t}\n\t\t}\n\n\t\tif ( !symbol ) {\n\t\t\tsymbol = this._addSymbolForTextProxy( textProxy.startOffset, textProxy.endOffset, textProxy.parent );\n\t\t}\n\n\t\treturn symbol;\n\t}\n\n\t/**\n\t * Adds a symbol for given properties that characterizes a {@link module:engine/model/textproxy~TextProxy} instance.\n\t *\n\t * Used internally to correctly consume `TextProxy` instances.\n\t *\n\t * @private\n\t * @param {Number} startIndex Text proxy start index in it's parent.\n\t * @param {Number} endIndex Text proxy end index in it's parent.\n\t * @param {module:engine/model/element~Element} parent Text proxy parent.\n\t * @returns {Symbol} Symbol generated for given properties.\n\t */\n\t_addSymbolForTextProxy( start, end, parent ) {\n\t\tconst symbol = Symbol( 'textProxySymbol' );\n\t\tlet startMap, endMap;\n\n\t\tstartMap = this._textProxyRegistry.get( start );\n\n\t\tif ( !startMap ) {\n\t\t\tstartMap = new Map();\n\t\t\tthis._textProxyRegistry.set( start, startMap );\n\t\t}\n\n\t\tendMap = startMap.get( end );\n\n\t\tif ( !endMap ) {\n\t\t\tendMap = new Map();\n\t\t\tstartMap.set( end, endMap );\n\t\t}\n\n\t\tendMap.set( parent, symbol );\n\n\t\treturn symbol;\n\t}\n}\n\n// Returns a normalized consumable type name from given string. A normalized consumable type name is a string that has\n// at most one colon, for example: `insert` or `addMarker:highlight`. If string to normalize has more \"parts\" (more colons),\n// the other parts are dropped, for example: `addattribute:bold:$text` -> `addattributes:bold`.\n//\n// @param {String} type Consumable type.\n// @returns {String} Normalized consumable type.\nfunction _normalizeConsumableType( type ) {\n\tconst parts = type.split( ':' );\n\n\treturn parts.length > 1 ? parts[ 0 ] + ':' + parts[ 1 ] : parts[ 0 ];\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/downcastdispatcher\n */\n\nimport Consumable from './modelconsumable';\nimport Range from '../model/range';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport { extend } from 'lodash-es';\n\n/**\n * `DowncastDispatcher` is a central point of downcasting (conversion from model to view), which is a process of reacting to changes\n * in the model and firing a set of events. Callbacks listening to those events are called converters. Those\n * converters role is to convert the model changes to changes in view (for example, adding view nodes or\n * changing attributes on view elements).\n *\n * During conversion process, `DowncastDispatcher` fires events, basing on state of the model and prepares\n * data for those events. It is important to understand that those events are connected with changes done on model,\n * for example: \"node has been inserted\" or \"attribute has changed\". This is in a contrary to upcasting (view to model conversion),\n * where we convert view state (view nodes) to a model tree.\n *\n * The events are prepared basing on a diff created by {@link module:engine/model/differ~Differ Differ}, which buffers them\n * and then passes to `DowncastDispatcher` as a diff between old model state and new model state.\n *\n * Note, that because changes are converted there is a need to have a mapping between model structure and view structure.\n * To map positions and elements during downcast (model to view conversion) use {@link module:engine/conversion/mapper~Mapper}.\n *\n * `DowncastDispatcher` fires following events for model tree changes:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert insert}\n * if a range of nodes has been inserted to the model tree,\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:remove remove}\n * if a range of nodes has been removed from the model tree,\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute attribute}\n * if attribute has been added, changed or removed from a model node.\n *\n * For {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert insert}\n * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute attribute},\n * `DowncastDispatcher` generates {@link module:engine/conversion/modelconsumable~ModelConsumable consumables}.\n * These are used to have a control over which changes has been already consumed. It is useful when some converters\n * overwrite other or converts multiple changes (for example converts insertion of an element and also converts that\n * element's attributes during insertion).\n *\n * Additionally, `DowncastDispatcher` fires events for {@link module:engine/model/markercollection~Marker marker} changes:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} if a marker has been added,\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} if a marker has been removed.\n *\n * Note, that changing a marker is done through removing the marker from the old range, and adding on the new range,\n * so both those events are fired.\n *\n * Finally, `DowncastDispatcher` also handles firing events for {@link module:engine/model/selection model selection}\n * conversion:\n *\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:selection}\n * which converts selection from model to view,\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute}\n * which is fired for every selection attribute,\n * * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}\n * which is fired for every marker which contains selection.\n *\n * Unlike model tree and markers, events for selection are not fired for changes but for selection state.\n *\n * When providing custom listeners for `DowncastDispatcher` remember to check whether given change has not been\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} yet.\n *\n * When providing custom listeners for `DowncastDispatcher` keep in mind that any callback that had\n * {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed} a value from a consumable and\n * converted the change should also stop the event (for efficiency purposes).\n *\n * When providing custom listeners for `DowncastDispatcher` remember to use provided\n * {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer} to apply changes to the view document.\n *\n * Example of a custom converter for `DowncastDispatcher`:\n *\n *\t\t// We will convert inserting \"paragraph\" model element into the model.\n *\t\tdowncastDispatcher.on( 'insert:paragraph', ( evt, data, conversionApi ) => {\n *\t\t\t// Remember to check whether the change has not been consumed yet and consume it.\n *\t\t\tif ( conversionApi.consumable.consume( data.item, 'insert' ) ) {\n *\t\t\t\treturn;\n *\t\t\t}\n *\n *\t\t\t// Translate position in model to position in view.\n *\t\t\tconst viewPosition = conversionApi.mapper.toViewPosition( data.range.start );\n *\n *\t\t\t// Create

element that will be inserted in view at `viewPosition`.\n *\t\t\tconst viewElement = conversionApi.writer.createContainerElement( 'p' );\n *\n *\t\t\t// Bind the newly created view element to model element so positions will map accordingly in future.\n *\t\t\tconversionApi.mapper.bindElements( data.item, viewElement );\n *\n *\t\t\t// Add the newly created view element to the view.\n *\t\t\tconversionApi.writer.insert( viewPosition, viewElement );\n *\n *\t\t\t// Remember to stop the event propagation.\n *\t\t\tevt.stop();\n *\t\t} );\n */\nexport default class DowncastDispatcher {\n\t/**\n\t * Creates a `DowncastDispatcher` instance.\n\t *\n\t * @see module:engine/conversion/downcastdispatcher~DowncastConversionApi\n\t * @param {Object} [conversionApi] Additional properties for interface that will be passed to events fired\n\t * by `DowncastDispatcher`.\n\t */\n\tconstructor( conversionApi = {} ) {\n\t\t/**\n\t\t * Interface passed by dispatcher to the events callbacks.\n\t\t *\n\t\t * @member {module:engine/conversion/downcastdispatcher~DowncastConversionApi}\n\t\t */\n\t\tthis.conversionApi = extend( { dispatcher: this }, conversionApi );\n\t}\n\n\t/**\n\t * Takes {@link module:engine/model/differ~Differ model differ} object with buffered changes and fires conversion basing on it.\n\t *\n\t * @param {module:engine/model/differ~Differ} differ Differ object with buffered changes.\n\t * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.\n\t */\n\tconvertChanges( differ, writer ) {\n\t\t// Before the view is updated, remove markers which have changed.\n\t\tfor ( const change of differ.getMarkersToRemove() ) {\n\t\t\tthis.convertMarkerRemove( change.name, change.range, writer );\n\t\t}\n\n\t\t// Convert changes that happened on model tree.\n\t\tfor ( const entry of differ.getChanges() ) {\n\t\t\tif ( entry.type == 'insert' ) {\n\t\t\t\tthis.convertInsert( Range._createFromPositionAndShift( entry.position, entry.length ), writer );\n\t\t\t} else if ( entry.type == 'remove' ) {\n\t\t\t\tthis.convertRemove( entry.position, entry.length, entry.name, writer );\n\t\t\t} else {\n\t\t\t\t// entry.type == 'attribute'.\n\t\t\t\tthis.convertAttribute( entry.range, entry.attributeKey, entry.attributeOldValue, entry.attributeNewValue, writer );\n\t\t\t}\n\t\t}\n\n\t\t// After the view is updated, convert markers which have changed.\n\t\tfor ( const change of differ.getMarkersToAdd() ) {\n\t\t\tthis.convertMarkerAdd( change.name, change.range, writer );\n\t\t}\n\t}\n\n\t/**\n\t * Starts conversion of a range insertion.\n\t *\n\t * For each node in the range, {@link #event:insert insert event is fired}. For each attribute on each node,\n\t * {@link #event:attribute attribute event is fired}.\n\t *\n\t * @fires insert\n\t * @fires attribute\n\t * @param {module:engine/model/range~Range} range Inserted range.\n\t * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.\n\t */\n\tconvertInsert( range, writer ) {\n\t\tthis.conversionApi.writer = writer;\n\n\t\t// Create a list of things that can be consumed, consisting of nodes and their attributes.\n\t\tthis.conversionApi.consumable = this._createInsertConsumable( range );\n\n\t\t// Fire a separate insert event for each node and text fragment contained in the range.\n\t\tfor ( const value of range ) {\n\t\t\tconst item = value.item;\n\t\t\tconst itemRange = Range._createFromPositionAndShift( value.previousPosition, value.length );\n\t\t\tconst data = {\n\t\t\t\titem,\n\t\t\t\trange: itemRange\n\t\t\t};\n\n\t\t\tthis._testAndFire( 'insert', data );\n\n\t\t\t// Fire a separate addAttribute event for each attribute that was set on inserted items.\n\t\t\t// This is important because most attributes converters will listen only to add/change/removeAttribute events.\n\t\t\t// If we would not add this part, attributes on inserted nodes would not be converted.\n\t\t\tfor ( const key of item.getAttributeKeys() ) {\n\t\t\t\tdata.attributeKey = key;\n\t\t\t\tdata.attributeOldValue = null;\n\t\t\t\tdata.attributeNewValue = item.getAttribute( key );\n\n\t\t\t\tthis._testAndFire( `attribute:${ key }`, data );\n\t\t\t}\n\t\t}\n\n\t\tthis._clearConversionApi();\n\t}\n\n\t/**\n\t * Fires conversion of a single node removal. Fires {@link #event:remove remove event} with provided data.\n\t *\n\t * @param {module:engine/model/position~Position} position Position from which node was removed.\n\t * @param {Number} length Offset size of removed node.\n\t * @param {String} name Name of removed node.\n\t * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.\n\t */\n\tconvertRemove( position, length, name, writer ) {\n\t\tthis.conversionApi.writer = writer;\n\n\t\tthis.fire( 'remove:' + name, { position, length }, this.conversionApi );\n\n\t\tthis._clearConversionApi();\n\t}\n\n\t/**\n\t * Starts conversion of attribute change on given `range`.\n\t *\n\t * For each node in the given `range`, {@link #event:attribute attribute event} is fired with the passed data.\n\t *\n\t * @fires attribute\n\t * @param {module:engine/model/range~Range} range Changed range.\n\t * @param {String} key Key of the attribute that has changed.\n\t * @param {*} oldValue Attribute value before the change or `null` if the attribute has not been set before.\n\t * @param {*} newValue New attribute value or `null` if the attribute has been removed.\n\t * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.\n\t */\n\tconvertAttribute( range, key, oldValue, newValue, writer ) {\n\t\tthis.conversionApi.writer = writer;\n\n\t\t// Create a list with attributes to consume.\n\t\tthis.conversionApi.consumable = this._createConsumableForRange( range, `attribute:${ key }` );\n\n\t\t// Create a separate attribute event for each node in the range.\n\t\tfor ( const value of range ) {\n\t\t\tconst item = value.item;\n\t\t\tconst itemRange = Range._createFromPositionAndShift( value.previousPosition, value.length );\n\t\t\tconst data = {\n\t\t\t\titem,\n\t\t\t\trange: itemRange,\n\t\t\t\tattributeKey: key,\n\t\t\t\tattributeOldValue: oldValue,\n\t\t\t\tattributeNewValue: newValue\n\t\t\t};\n\n\t\t\tthis._testAndFire( `attribute:${ key }`, data );\n\t\t}\n\n\t\tthis._clearConversionApi();\n\t}\n\n\t/**\n\t * Starts model selection conversion.\n\t *\n\t * Fires events for given {@link module:engine/model/selection~Selection selection} to start selection conversion.\n\t *\n\t * @fires selection\n\t * @fires addMarker\n\t * @fires attribute\n\t * @param {module:engine/model/selection~Selection} selection Selection to convert.\n\t * @param {Array.} markers Array of markers containing model markers.\n\t * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.\n\t */\n\tconvertSelection( selection, markers, writer ) {\n\t\tconst markersAtSelection = Array.from( markers.getMarkersAtPosition( selection.getFirstPosition() ) );\n\n\t\tthis.conversionApi.writer = writer;\n\t\tthis.conversionApi.consumable = this._createSelectionConsumable( selection, markersAtSelection );\n\n\t\tthis.fire( 'selection', { selection }, this.conversionApi );\n\n\t\tif ( !selection.isCollapsed ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( const marker of markersAtSelection ) {\n\t\t\tconst markerRange = marker.getRange();\n\n\t\t\tif ( !shouldMarkerChangeBeConverted( selection.getFirstPosition(), marker, this.conversionApi.mapper ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst data = {\n\t\t\t\titem: selection,\n\t\t\t\tmarkerName: marker.name,\n\t\t\t\tmarkerRange\n\t\t\t};\n\n\t\t\tif ( this.conversionApi.consumable.test( selection, 'addMarker:' + marker.name ) ) {\n\t\t\t\tthis.fire( 'addMarker:' + marker.name, data, this.conversionApi );\n\t\t\t}\n\t\t}\n\n\t\tfor ( const key of selection.getAttributeKeys() ) {\n\t\t\tconst data = {\n\t\t\t\titem: selection,\n\t\t\t\trange: selection.getFirstRange(),\n\t\t\t\tattributeKey: key,\n\t\t\t\tattributeOldValue: null,\n\t\t\t\tattributeNewValue: selection.getAttribute( key )\n\t\t\t};\n\n\t\t\t// Do not fire event if the attribute has been consumed.\n\t\t\tif ( this.conversionApi.consumable.test( selection, 'attribute:' + data.attributeKey ) ) {\n\t\t\t\tthis.fire( 'attribute:' + data.attributeKey + ':$text', data, this.conversionApi );\n\t\t\t}\n\t\t}\n\n\t\tthis._clearConversionApi();\n\t}\n\n\t/**\n\t * Converts added marker. Fires {@link #event:addMarker addMarker} event for each item\n\t * in marker's range. If range is collapsed single event is dispatched. See event description for more details.\n\t *\n\t * @fires addMarker\n\t * @param {String} markerName Marker name.\n\t * @param {module:engine/model/range~Range} markerRange Marker range.\n\t * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.\n\t */\n\tconvertMarkerAdd( markerName, markerRange, writer ) {\n\t\t// Do not convert if range is in graveyard or not in the document (e.g. in DocumentFragment).\n\t\tif ( !markerRange.root.document || markerRange.root.rootName == '$graveyard' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.conversionApi.writer = writer;\n\n\t\t// In markers' case, event name == consumable name.\n\t\tconst eventName = 'addMarker:' + markerName;\n\n\t\t//\n\t\t// First, fire an event for the whole marker.\n\t\t//\n\t\tconst consumable = new Consumable();\n\t\tconsumable.add( markerRange, eventName );\n\n\t\tthis.conversionApi.consumable = consumable;\n\n\t\tthis.fire( eventName, { markerName, markerRange }, this.conversionApi );\n\n\t\t//\n\t\t// Do not fire events for each item inside the range if the range got consumed.\n\t\t//\n\t\tif ( !consumable.test( markerRange, eventName ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//\n\t\t// Then, fire an event for each item inside the marker range.\n\t\t//\n\t\tthis.conversionApi.consumable = this._createConsumableForRange( markerRange, eventName );\n\n\t\tfor ( const item of markerRange.getItems() ) {\n\t\t\t// Do not fire event for already consumed items.\n\t\t\tif ( !this.conversionApi.consumable.test( item, eventName ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst data = { item, range: Range._createOn( item ), markerName, markerRange };\n\n\t\t\tthis.fire( eventName, data, this.conversionApi );\n\t\t}\n\n\t\tthis._clearConversionApi();\n\t}\n\n\t/**\n\t * Fires conversion of marker removal. Fires {@link #event:removeMarker removeMarker} event with provided data.\n\t *\n\t * @fires removeMarker\n\t * @param {String} markerName Marker name.\n\t * @param {module:engine/model/range~Range} markerRange Marker range.\n\t * @param {module:engine/view/downcastwriter~DowncastWriter} writer View writer that should be used to modify view document.\n\t */\n\tconvertMarkerRemove( markerName, markerRange, writer ) {\n\t\t// Do not convert if range is in graveyard or not in the document (e.g. in DocumentFragment).\n\t\tif ( !markerRange.root.document || markerRange.root.rootName == '$graveyard' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.conversionApi.writer = writer;\n\n\t\tthis.fire( 'removeMarker:' + markerName, { markerName, markerRange }, this.conversionApi );\n\n\t\tthis._clearConversionApi();\n\t}\n\n\t/**\n\t * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume from given range,\n\t * assuming that the range has just been inserted to the model.\n\t *\n\t * @private\n\t * @param {module:engine/model/range~Range} range Inserted range.\n\t * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.\n\t */\n\t_createInsertConsumable( range ) {\n\t\tconst consumable = new Consumable();\n\n\t\tfor ( const value of range ) {\n\t\t\tconst item = value.item;\n\n\t\t\tconsumable.add( item, 'insert' );\n\n\t\t\tfor ( const key of item.getAttributeKeys() ) {\n\t\t\t\tconsumable.add( item, 'attribute:' + key );\n\t\t\t}\n\t\t}\n\n\t\treturn consumable;\n\t}\n\n\t/**\n\t * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with values to consume for given range.\n\t *\n\t * @private\n\t * @param {module:engine/model/range~Range} range Affected range.\n\t * @param {String} type Consumable type.\n\t * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.\n\t */\n\t_createConsumableForRange( range, type ) {\n\t\tconst consumable = new Consumable();\n\n\t\tfor ( const item of range.getItems() ) {\n\t\t\tconsumable.add( item, type );\n\t\t}\n\n\t\treturn consumable;\n\t}\n\n\t/**\n\t * Creates {@link module:engine/conversion/modelconsumable~ModelConsumable} with selection consumable values.\n\t *\n\t * @private\n\t * @param {module:engine/model/selection~Selection} selection Selection to create consumable from.\n\t * @param {Iterable.} markers Markers which contains selection.\n\t * @returns {module:engine/conversion/modelconsumable~ModelConsumable} Values to consume.\n\t */\n\t_createSelectionConsumable( selection, markers ) {\n\t\tconst consumable = new Consumable();\n\n\t\tconsumable.add( selection, 'selection' );\n\n\t\tfor ( const marker of markers ) {\n\t\t\tconsumable.add( selection, 'addMarker:' + marker.name );\n\t\t}\n\n\t\tfor ( const key of selection.getAttributeKeys() ) {\n\t\t\tconsumable.add( selection, 'attribute:' + key );\n\t\t}\n\n\t\treturn consumable;\n\t}\n\n\t/**\n\t * Tests passed `consumable` to check whether given event can be fired and if so, fires it.\n\t *\n\t * @private\n\t * @fires insert\n\t * @fires attribute\n\t * @param {String} type Event type.\n\t * @param {Object} data Event data.\n\t */\n\t_testAndFire( type, data ) {\n\t\tif ( !this.conversionApi.consumable.test( data.item, type ) ) {\n\t\t\t// Do not fire event if the item was consumed.\n\t\t\treturn;\n\t\t}\n\n\t\tconst name = data.item.name || '$text';\n\n\t\tthis.fire( type + ':' + name, data, this.conversionApi );\n\t}\n\n\t/**\n\t * Clears conversion API object.\n\t *\n\t * @private\n\t */\n\t_clearConversionApi() {\n\t\tdelete this.conversionApi.writer;\n\t\tdelete this.conversionApi.consumable;\n\t}\n\n\t/**\n\t * Fired for inserted nodes.\n\t *\n\t * `insert` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `insert:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been inserted,\n\t * or {@link module:engine/model/element~Element#name name} of inserted element.\n\t *\n\t * This way listeners can either listen to a general `insert` event or specific event (for example `insert:paragraph`).\n\t *\n\t * @event insert\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/item~Item} data.item Inserted item.\n\t * @param {module:engine/model/range~Range} data.range Range spanning over inserted item.\n\t * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface\n\t * to be used by callback, passed in `DowncastDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired for removed nodes.\n\t *\n\t * `remove` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `remove:name`. `name` is either `'$text'`, when {@link module:engine/model/text~Text a text node} has been removed,\n\t * or the {@link module:engine/model/element~Element#name name} of removed element.\n\t *\n\t * This way listeners can either listen to a general `remove` event or specific event (for example `remove:paragraph`).\n\t *\n\t * @event remove\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/position~Position} data.position Position from which the node has been removed.\n\t * @param {Number} data.length Offset size of the removed node.\n\t * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface\n\t * to be used by callback, passed in `DowncastDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired in the following cases:\n\t *\n\t * * when an attribute has been added, changed, or removed from a node,\n\t * * when a node with an attribute is inserted,\n\t * * when collapsed model selection attribute is converted.\n\t *\n\t * `attribute` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `attribute:attributeKey:name`. `attributeKey` is the key of added/changed/removed attribute.\n\t * `name` is either `'$text'` if change was on {@link module:engine/model/text~Text a text node},\n\t * or the {@link module:engine/model/element~Element#name name} of element which attribute has changed.\n\t *\n\t * This way listeners can either listen to a general `attribute:bold` event or specific event (for example `attribute:src:image`).\n\t *\n\t * @event attribute\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/item~Item|module:engine/model/documentselection~DocumentSelection} data.item Changed item\n\t * or converted selection.\n\t * @param {module:engine/model/range~Range} data.range Range spanning over changed item or selection range.\n\t * @param {String} data.attributeKey Attribute key.\n\t * @param {*} data.attributeOldValue Attribute value before the change. This is `null` when selection attribute is converted.\n\t * @param {*} data.attributeNewValue New attribute value.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface\n\t * to be used by callback, passed in `DowncastDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired for {@link module:engine/model/selection~Selection selection} changes.\n\t *\n\t * @event selection\n\t * @param {module:engine/model/selection~Selection} selection Selection that is converted.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface\n\t * to be used by callback, passed in `DowncastDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired when a new marker is added to the model. Also fired when collapsed model selection that is inside marker is converted.\n\t *\n\t * `addMarker` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `addMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,\n\t * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `addMarker:foo` or `addMarker:foo:abc` and\n\t * `addMarker:foo:bar` events.\n\t *\n\t * If the marker range is not collapsed:\n\t *\n\t * * the event is fired for each item in the marker range one by one,\n\t * * consumables object includes each item of the marker range and the consumable value is same as event name.\n\t *\n\t * If the marker range is collapsed:\n\t *\n\t * * there is only one event,\n\t * * consumables object includes marker range with event name.\n\t *\n\t * If selection inside a marker is converted:\n\t *\n\t * * there is only one event,\n\t * * consumables object includes selection instance with event name.\n\t *\n\t * @event addMarker\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/item~Item|module:engine/model/selection~Selection} data.item Item inside the new marker or\n\t * the selection that is being converted.\n\t * @param {module:engine/model/range~Range} [data.range] Range spanning over converted item. Available only in marker conversion, if\n\t * the marker range was not collapsed.\n\t * @param {module:engine/model/range~Range} data.markerRange Marker range.\n\t * @param {String} data.markerName Marker name.\n\t * @param {module:engine/conversion/modelconsumable~ModelConsumable} consumable Values to consume.\n\t * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface\n\t * to be used by callback, passed in `DowncastDispatcher` constructor.\n\t */\n\n\t/**\n\t * Fired when marker is removed from the model.\n\t *\n\t * `removeMarker` is a namespace for a class of events. Names of actually called events follow this pattern:\n\t * `removeMarker:markerName`. By specifying certain marker names, you can make the events even more gradual. For example,\n\t * if markers are named `foo:abc`, `foo:bar`, then it is possible to listen to `removeMarker:foo` or `removeMarker:foo:abc` and\n\t * `removeMarker:foo:bar` events.\n\t *\n\t * @event removeMarker\n\t * @param {Object} data Additional information about the change.\n\t * @param {module:engine/model/range~Range} data.markerRange Marker range.\n\t * @param {String} data.markerName Marker name.\n\t * @param {module:engine/conversion/downcastdispatcher~DowncastConversionApi} conversionApi Conversion interface\n\t * to be used by callback, passed in `DowncastDispatcher` constructor.\n\t */\n}\n\nmix( DowncastDispatcher, EmitterMixin );\n\n// Helper function, checks whether change of `marker` at `modelPosition` should be converted. Marker changes are not\n// converted if they happen inside an element with custom conversion method.\n//\n// @param {module:engine/model/position~Position} modelPosition\n// @param {module:engine/model/markercollection~Marker} marker\n// @param {module:engine/conversion/mapper~Mapper} mapper\n// @returns {Boolean}\nfunction shouldMarkerChangeBeConverted( modelPosition, marker, mapper ) {\n\tconst range = marker.getRange();\n\tconst ancestors = Array.from( modelPosition.getAncestors() );\n\tancestors.shift(); // Remove root element. It cannot be passed to `model.Range#containsItem`.\n\tancestors.reverse();\n\n\tconst hasCustomHandling = ancestors.some( element => {\n\t\tif ( range.containsItem( element ) ) {\n\t\t\tconst viewElement = mapper.toViewElement( element );\n\n\t\t\treturn !!viewElement.getCustomProperty( 'addHighlight' );\n\t\t}\n\t} );\n\n\treturn !hasCustomHandling;\n}\n\n/**\n * Conversion interface that is registered for given {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}\n * and is passed as one of parameters when {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher dispatcher}\n * fires it's events.\n *\n * @interface module:engine/conversion/downcastdispatcher~DowncastConversionApi\n */\n\n/**\n * The {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} instance.\n *\n * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #dispatcher\n */\n\n/**\n * Stores information about what parts of processed model item are still waiting to be handled. After a piece of model item\n * was converted, appropriate consumable value should be {@link module:engine/conversion/modelconsumable~ModelConsumable#consume consumed}.\n *\n * @member {module:engine/conversion/modelconsumable~ModelConsumable} #consumable\n */\n\n/**\n * The {@link module:engine/conversion/mapper~Mapper} instance.\n *\n * @member {module:engine/conversion/mapper~Mapper} #mapper\n */\n\n/**\n * The {@link module:engine/view/downcastwriter~DowncastWriter} instance used to manipulate data during conversion.\n *\n * @member {module:engine/view/downcastwriter~DowncastWriter} #writer\n */\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/selection\n */\n\nimport Position from './position';\nimport Element from './element';\nimport Node from './node';\nimport Range from './range';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\n\n/**\n * Selection is a set of {@link module:engine/model/range~Range ranges}. It has a direction specified by its\n * {@link module:engine/model/selection~Selection#anchor anchor} and {@link module:engine/model/selection~Selection#focus focus}\n * (it can be {@link module:engine/model/selection~Selection#isBackward forward or backward}).\n * Additionally, selection may have its own attributes (think – whether text typed in in this selection\n * should have those attributes – e.g. whether you type a bolded text).\n *\n * @mixes module:utils/emittermixin~EmitterMixin\n */\nexport default class Selection {\n\t/**\n\t * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}\n\t * or creates an empty selection if no arguments were passed.\n\t *\n\t *\t\t// Creates empty selection without ranges.\n\t *\t\tconst selection = writer.createSelection();\n\t *\n\t *\t\t// Creates selection at the given range.\n\t *\t\tconst range = writer.createRange( start, end );\n\t *\t\tconst selection = writer.createSelection( range );\n\t *\n\t *\t\t// Creates selection at the given ranges\n\t *\t\tconst ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n\t *\t\tconst selection = writer.createSelection( ranges );\n\t *\n\t *\t\t// Creates selection from the other selection.\n\t *\t\t// Note: It doesn't copies selection attributes.\n\t *\t\tconst otherSelection = writer.createSelection();\n\t *\t\tconst selection = writer.createSelection( otherSelection );\n\t *\n\t *\t\t// Creates selection from the given document selection.\n\t *\t\t// Note: It doesn't copies selection attributes.\n\t *\t\tconst documentSelection = model.document.selection;\n\t *\t\tconst selection = writer.createSelection( documentSelection );\n\t *\n\t *\t\t// Creates selection at the given position.\n\t *\t\tconst position = writer.createPositionFromPath( root, path );\n\t *\t\tconst selection = writer.createSelection( position );\n\t *\n\t *\t\t// Creates selection at the given offset in the given element.\n\t *\t\tconst paragraph = writer.createElement( 'paragraph' );\n\t *\t\tconst selection = writer.createSelection( paragraph, offset );\n\t *\n\t *\t\t// Creates a range inside an {@link module:engine/model/element~Element element} which starts before the\n\t *\t\t// first child of that element and ends after the last child of that element.\n\t *\t\tconst selection = writer.createSelection( paragraph, 'in' );\n\t *\n\t *\t\t// Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends\n\t *\t\t// just after the item.\n\t *\t\tconst selection = writer.createSelection( paragraph, 'on' );\n\t *\n\t * Selection's constructor allow passing additional options (`'backward'`) as the last argument.\n\t *\n\t *\t\t// Creates backward selection.\n\t *\t\tconst selection = writer.createSelection( range, { backward: true } );\n\t *\n\t * @param {module:engine/model/selection~Selectable} selectable\n\t * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.\n\t * @param {Object} [options]\n\t * @param {Boolean} [options.backward] Sets this selection instance to be backward.\n\t */\n\tconstructor( selectable, placeOrOffset, options ) {\n\t\t/**\n\t\t * Specifies whether the last added range was added as a backward or forward range.\n\t\t *\n\t\t * @private\n\t\t * @type {Boolean}\n\t\t */\n\t\tthis._lastRangeBackward = false;\n\n\t\t/**\n\t\t * Stores selection ranges.\n\t\t *\n\t\t * @protected\n\t\t * @type {Array.}\n\t\t */\n\t\tthis._ranges = [];\n\n\t\t/**\n\t\t * List of attributes set on current selection.\n\t\t *\n\t\t * @protected\n\t\t * @type {Map.}\n\t\t */\n\t\tthis._attrs = new Map();\n\n\t\tif ( selectable ) {\n\t\t\tthis.setTo( selectable, placeOrOffset, options );\n\t\t}\n\t}\n\n\t/**\n\t * Selection anchor. Anchor is the position from which the selection was started. If a user is making a selection\n\t * by dragging the mouse, the anchor is where the user pressed the mouse button (the beggining of the selection).\n\t *\n\t * Anchor and {@link #focus} define the direction of the selection, which is important\n\t * when expanding/shrinking selection. The focus moves, while the anchor should remain in the same place.\n\t *\n\t * Anchor is always set to the {@link module:engine/model/range~Range#start start} or\n\t * {@link module:engine/model/range~Range#end end} position of the last of selection's ranges. Whether it is\n\t * the `start` or `end` depends on the specified `options.backward`. See the {@link #setTo `setTo()`} method.\n\t *\n\t * May be set to `null` if there are no ranges in the selection.\n\t *\n\t * @see #focus\n\t * @readonly\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget anchor() {\n\t\tif ( this._ranges.length > 0 ) {\n\t\t\tconst range = this._ranges[ this._ranges.length - 1 ];\n\n\t\t\treturn this._lastRangeBackward ? range.end : range.start;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Selection focus. Focus is the position where the selection ends. If a user is making a selection\n\t * by dragging the mouse, the focus is where the mouse cursor is.\n\t *\n\t * May be set to `null` if there are no ranges in the selection.\n\t *\n\t * @see #anchor\n\t * @readonly\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget focus() {\n\t\tif ( this._ranges.length > 0 ) {\n\t\t\tconst range = this._ranges[ this._ranges.length - 1 ];\n\n\t\t\treturn this._lastRangeBackward ? range.start : range.end;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Whether the selection is collapsed. Selection is collapsed when there is exactly one range in it\n\t * and it is collapsed.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isCollapsed() {\n\t\tconst length = this._ranges.length;\n\n\t\tif ( length === 1 ) {\n\t\t\treturn this._ranges[ 0 ].isCollapsed;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Returns the number of ranges in the selection.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget rangeCount() {\n\t\treturn this._ranges.length;\n\t}\n\n\t/**\n\t * Specifies whether the selection's {@link #focus} precedes the selection's {@link #anchor}.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isBackward() {\n\t\treturn !this.isCollapsed && this._lastRangeBackward;\n\t}\n\n\t/**\n\t * Checks whether this selection is equal to the given selection. Selections are equal if they have the same directions,\n\t * the same number of ranges and all ranges from one selection equal to ranges from the another selection.\n\t *\n\t * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} otherSelection\n\t * Selection to compare with.\n\t * @returns {Boolean} `true` if selections are equal, `false` otherwise.\n\t */\n\tisEqual( otherSelection ) {\n\t\tif ( this.rangeCount != otherSelection.rangeCount ) {\n\t\t\treturn false;\n\t\t} else if ( this.rangeCount === 0 ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( !this.anchor.isEqual( otherSelection.anchor ) || !this.focus.isEqual( otherSelection.focus ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tfor ( const thisRange of this._ranges ) {\n\t\t\tlet found = false;\n\n\t\t\tfor ( const otherRange of otherSelection._ranges ) {\n\t\t\t\tif ( thisRange.isEqual( otherRange ) ) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( !found ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Returns an iterable object that iterates over copies of selection ranges.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t* getRanges() {\n\t\tfor ( const range of this._ranges ) {\n\t\t\tyield new Range( range.start, range.end );\n\t\t}\n\t}\n\n\t/**\n\t * Returns a copy of the first range in the selection.\n\t * First range is the one which {@link module:engine/model/range~Range#start start} position\n\t * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges\n\t * (not to confuse with the first range added to the selection).\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/range~Range|null}\n\t */\n\tgetFirstRange() {\n\t\tlet first = null;\n\n\t\tfor ( const range of this._ranges ) {\n\t\t\tif ( !first || range.start.isBefore( first.start ) ) {\n\t\t\t\tfirst = range;\n\t\t\t}\n\t\t}\n\n\t\treturn first ? new Range( first.start, first.end ) : null;\n\t}\n\n\t/**\n\t * Returns a copy of the last range in the selection.\n\t * Last range is the one which {@link module:engine/model/range~Range#end end} position\n\t * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most\n\t * recently added to the selection).\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/range~Range|null}\n\t */\n\tgetLastRange() {\n\t\tlet last = null;\n\n\t\tfor ( const range of this._ranges ) {\n\t\t\tif ( !last || range.end.isAfter( last.end ) ) {\n\t\t\t\tlast = range;\n\t\t\t}\n\t\t}\n\n\t\treturn last ? new Range( last.start, last.end ) : null;\n\t}\n\n\t/**\n\t * Returns the first position in the selection.\n\t * First position is the position that {@link module:engine/model/position~Position#isBefore is before}\n\t * any other position in the selection.\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/position~Position|null}\n\t */\n\tgetFirstPosition() {\n\t\tconst first = this.getFirstRange();\n\n\t\treturn first ? first.start.clone() : null;\n\t}\n\n\t/**\n\t * Returns the last position in the selection.\n\t * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}\n\t * any other position in the selection.\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/position~Position|null}\n\t */\n\tgetLastPosition() {\n\t\tconst lastRange = this.getLastRange();\n\n\t\treturn lastRange ? lastRange.end.clone() : null;\n\t}\n\n\t/**\n\t * Sets this selection's ranges and direction to the specified location based on the given\n\t * {@link module:engine/model/selection~Selectable selectable}.\n\t *\n\t *\t\t// Removes all selection's ranges.\n\t *\t\tselection.setTo( null );\n\t *\n\t *\t\t// Sets selection to the given range.\n\t *\t\tconst range = writer.createRange( start, end );\n\t *\t\tselection.setTo( range );\n\t *\n\t *\t\t// Sets selection to given ranges.\n\t *\t\tconst ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n\t *\t\tselection.setTo( ranges );\n\t *\n\t *\t\t// Sets selection to other selection.\n\t *\t\t// Note: It doesn't copies selection attributes.\n\t *\t\tconst otherSelection = writer.createSelection();\n\t *\t\tselection.setTo( otherSelection );\n\t *\n\t *\t\t// Sets selection to the given document selection.\n\t *\t\t// Note: It doesn't copies selection attributes.\n\t *\t\tconst documentSelection = new DocumentSelection( doc );\n\t *\t\tselection.setTo( documentSelection );\n\t *\n\t *\t\t// Sets collapsed selection at the given position.\n\t *\t\tconst position = writer.createPositionFromPath( root, path );\n\t *\t\tselection.setTo( position );\n\t *\n\t *\t\t// Sets collapsed selection at the position of the given node and an offset.\n\t *\t\tselection.setTo( paragraph, offset );\n\t *\n\t * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n \t * that element and ends after the last child of that element.\n\t *\n\t *\t\tselection.setTo( paragraph, 'in' );\n\t *\n\t * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.\n\t *\n\t *\t\tselection.setTo( paragraph, 'on' );\n\t *\n\t * `Selection#setTo()`' method allow passing additional options (`backward`) as the last argument.\n\t *\n\t *\t\t// Sets backward selection.\n\t *\t\tconst selection = writer.createSelection( range, { backward: true } );\n\t *\n\t * @param {module:engine/model/selection~Selectable} selectable\n\t * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.\n\t * @param {Object} [options]\n\t * @param {Boolean} [options.backward] Sets this selection instance to be backward.\n\t */\n\tsetTo( selectable, placeOrOffset, options ) {\n\t\tif ( selectable === null ) {\n\t\t\tthis._setRanges( [] );\n\t\t} else if ( selectable instanceof Selection ) {\n\t\t\tthis._setRanges( selectable.getRanges(), selectable.isBackward );\n\t\t} else if ( selectable && typeof selectable.getRanges == 'function' ) {\n\t\t\t// We assume that the selectable is a DocumentSelection.\n\t\t\t// It can't be imported here, because it would lead to circular imports.\n\t\t\tthis._setRanges( selectable.getRanges(), selectable.isBackward );\n\t\t} else if ( selectable instanceof Range ) {\n\t\t\tthis._setRanges( [ selectable ], !!placeOrOffset && !!placeOrOffset.backward );\n\t\t} else if ( selectable instanceof Position ) {\n\t\t\tthis._setRanges( [ new Range( selectable ) ] );\n\t\t} else if ( selectable instanceof Node ) {\n\t\t\tconst backward = !!options && !!options.backward;\n\t\t\tlet range;\n\n\t\t\tif ( placeOrOffset == 'in' ) {\n\t\t\t\trange = Range._createIn( selectable );\n\t\t\t} else if ( placeOrOffset == 'on' ) {\n\t\t\t\trange = Range._createOn( selectable );\n\t\t\t} else if ( placeOrOffset !== undefined ) {\n\t\t\t\trange = new Range( Position._createAt( selectable, placeOrOffset ) );\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * selection.setTo requires the second parameter when the first parameter is a node.\n\t\t\t\t *\n\t\t\t\t * @error model-selection-setTo-required-second-parameter\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'model-selection-setTo-required-second-parameter: ' +\n\t\t\t\t\t'selection.setTo requires the second parameter when the first parameter is a node.' );\n\t\t\t}\n\n\t\t\tthis._setRanges( [ range ], backward );\n\t\t} else if ( isIterable( selectable ) ) {\n\t\t\t// We assume that the selectable is an iterable of ranges.\n\t\t\tthis._setRanges( selectable, placeOrOffset && !!placeOrOffset.backward );\n\t\t} else {\n\t\t\t/**\n\t\t\t * Cannot set selection to given place.\n\t\t\t *\n\t\t\t * @error model-selection-setTo-not-selectable\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'model-selection-setTo-not-selectable: Cannot set selection to given place.' );\n\t\t}\n\t}\n\n\t/**\n\t * Replaces all ranges that were added to the selection with given array of ranges. Last range of the array\n\t * is treated like the last added range and is used to set {@link module:engine/model/selection~Selection#anchor} and\n\t * {@link module:engine/model/selection~Selection#focus}. Accepts a flag describing in which direction the selection is made.\n\t *\n\t * @protected\n\t * @fires change:range\n\t * @param {Iterable.} newRanges Ranges to set.\n\t * @param {Boolean} [isLastBackward=false] Flag describing if last added range was selected forward - from start to end (`false`)\n\t * or backward - from end to start (`true`).\n\t */\n\t_setRanges( newRanges, isLastBackward = false ) {\n\t\tnewRanges = Array.from( newRanges );\n\n\t\t// Check whether there is any range in new ranges set that is different than all already added ranges.\n\t\tconst anyNewRange = newRanges.some( newRange => {\n\t\t\tif ( !( newRange instanceof Range ) ) {\n\t\t\t\t/**\n\t\t\t\t * Selection range set to an object that is not an instance of {@link module:engine/model/range~Range}.\n\t\t\t\t *\n\t\t\t\t * Only {@link module:engine/model/range~Range} instances can be used to set a selection.\n\t\t\t\t * Common mistakes leading to this error are:\n\t\t\t\t *\n\t\t\t\t * * using DOM `Range` object,\n\t\t\t\t * * incorrect CKEditor 5 installation with multiple `ckeditor5-engine` packages having different versions.\n\t\t\t\t *\n\t\t\t\t * @error model-selection-set-ranges-not-range\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'model-selection-set-ranges-not-range: ' +\n\t\t\t\t\t'Selection range set to an object that is not an instance of model.Range.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn this._ranges.every( oldRange => {\n\t\t\t\treturn !oldRange.isEqual( newRange );\n\t\t\t} );\n\t\t} );\n\n\t\t// Don't do anything if nothing changed.\n\t\tif ( newRanges.length === this._ranges.length && !anyNewRange ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._removeAllRanges();\n\n\t\tfor ( const range of newRanges ) {\n\t\t\tthis._pushRange( range );\n\t\t}\n\n\t\tthis._lastRangeBackward = !!isLastBackward;\n\n\t\tthis.fire( 'change:range', { directChange: true } );\n\t}\n\n\t/**\n\t * Moves {@link module:engine/model/selection~Selection#focus} to the specified location.\n\t *\n\t * The location can be specified in the same form as\n\t * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.\n\t *\n\t * @fires change:range\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tsetFocus( itemOrPosition, offset ) {\n\t\tif ( this.anchor === null ) {\n\t\t\t/**\n\t\t\t * Cannot set selection focus if there are no ranges in selection.\n\t\t\t *\n\t\t\t * @error model-selection-setFocus-no-ranges\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'model-selection-setFocus-no-ranges: Cannot set selection focus if there are no ranges in selection.'\n\t\t\t);\n\t\t}\n\n\t\tconst newFocus = Position._createAt( itemOrPosition, offset );\n\n\t\tif ( newFocus.compareWith( this.focus ) == 'same' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst anchor = this.anchor;\n\n\t\tif ( this._ranges.length ) {\n\t\t\tthis._popRange();\n\t\t}\n\n\t\tif ( newFocus.compareWith( anchor ) == 'before' ) {\n\t\t\tthis._pushRange( new Range( newFocus, anchor ) );\n\t\t\tthis._lastRangeBackward = true;\n\t\t} else {\n\t\t\tthis._pushRange( new Range( anchor, newFocus ) );\n\t\t\tthis._lastRangeBackward = false;\n\t\t}\n\n\t\tthis.fire( 'change:range', { directChange: true } );\n\t}\n\n\t/**\n\t * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.\n\t *\n\t * @param {String} key Key of attribute to look for.\n\t * @returns {*} Attribute value or `undefined`.\n\t */\n\tgetAttribute( key ) {\n\t\treturn this._attrs.get( key );\n\t}\n\n\t/**\n\t * Returns iterable that iterates over this selection's attributes.\n\t *\n\t * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n\t * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n\t *\n\t * @returns {Iterable.<*>}\n\t */\n\tgetAttributes() {\n\t\treturn this._attrs.entries();\n\t}\n\n\t/**\n\t * Returns iterable that iterates over this selection's attribute keys.\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetAttributeKeys() {\n\t\treturn this._attrs.keys();\n\t}\n\n\t/**\n\t * Checks if the selection has an attribute for given key.\n\t *\n\t * @param {String} key Key of attribute to check.\n\t * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.\n\t */\n\thasAttribute( key ) {\n\t\treturn this._attrs.has( key );\n\t}\n\n\t/**\n\t * Removes an attribute with given key from the selection.\n\t *\n\t * If given attribute was set on the selection, fires the {@link #event:change:range} event with\n\t * removed attribute key.\n\t *\n\t * @fires change:attribute\n\t * @param {String} key Key of attribute to remove.\n\t */\n\tremoveAttribute( key ) {\n\t\tif ( this.hasAttribute( key ) ) {\n\t\t\tthis._attrs.delete( key );\n\n\t\t\tthis.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.\n\t *\n\t * If the attribute value has changed, fires the {@link #event:change:range} event with\n\t * the attribute key.\n\t *\n\t * @fires change:attribute\n\t * @param {String} key Key of attribute to set.\n\t * @param {*} value Attribute value.\n\t */\n\tsetAttribute( key, value ) {\n\t\tif ( this.getAttribute( key ) !== value ) {\n\t\t\tthis._attrs.set( key, value );\n\n\t\t\tthis.fire( 'change:attribute', { attributeKeys: [ key ], directChange: true } );\n\t\t}\n\t}\n\n\t/**\n\t * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only\n\t * one range in the selection, and that range contains exactly one element.\n\t * Returns `null` if there is no selected element.\n\t *\n\t * @returns {module:engine/model/element~Element|null}\n\t */\n\tgetSelectedElement() {\n\t\tif ( this.rangeCount !== 1 ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst range = this.getFirstRange();\n\t\tconst nodeAfterStart = range.start.nodeAfter;\n\t\tconst nodeBeforeEnd = range.end.nodeBefore;\n\n\t\treturn ( nodeAfterStart instanceof Element && nodeAfterStart == nodeBeforeEnd ) ? nodeAfterStart : null;\n\t}\n\n\t/**\n\t * Checks whether object is of given type following the convention set by\n\t * {@link module:engine/model/node~Node#is `Node#is()`}.\n\t *\n\t *\t\tconst selection = new Selection( ... );\n\t *\n\t *\t\tselection.is( 'selection' ); // true\n\t *\t\tselection.is( 'node' ); // false\n\t *\t\tselection.is( 'element' ); // false\n\t *\n\t * @param {String} type\n\t * @returns {Boolean}\n\t */\n\tis( type ) {\n\t\treturn type == 'selection';\n\t}\n\n\t/**\n\t * Gets elements of type \"block\" touched by the selection.\n\t *\n\t * This method's result can be used for example to apply block styling to all blocks covered by this selection.\n\t *\n\t * **Note:** `getSelectedBlocks()` always returns the deepest block.\n\t *\n\t * In this case the function will return exactly all 3 paragraphs:\n\t *\n\t *\t\t[a\n\t *\t\t\n\t *\t\t\tb\n\t *\t\t\n\t *\t\tc]d\n\t *\n\t * In this case the paragraph will also be returned, despite the collapsed selection:\n\t *\n\t *\t\t[]a\n\t *\n\t * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective\n\t * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.\n\t *\n\t *\t\t[a\n\t *\t\tb\n\t *\t\t]c // this block will not be returned\n\t *\n\t * @returns {Iterable.}\n\t */\n\t* getSelectedBlocks() {\n\t\tconst visited = new WeakSet();\n\n\t\tfor ( const range of this.getRanges() ) {\n\t\t\tconst startBlock = getParentBlock( range.start, visited );\n\n\t\t\tif ( startBlock ) {\n\t\t\t\tyield startBlock;\n\t\t\t}\n\n\t\t\tfor ( const value of range.getWalker() ) {\n\t\t\t\tif ( value.type == 'elementEnd' && isUnvisitedBlockContainer( value.item, visited ) ) {\n\t\t\t\t\tyield value.item;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst endBlock = getParentBlock( range.end, visited );\n\n\t\t\t// #984. Don't return the end block if the range ends right at its beginning.\n\t\t\tif ( endBlock && !range.end.isTouching( Position._createAt( endBlock, 0 ) ) ) {\n\t\t\t\tyield endBlock;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns blocks that aren't nested in other selected blocks.\n\t *\n\t * In this case the method will return blocks A, B and E because C & D are children of block B:\n\t *\n\t *\t\t[\n\t *\t\t\n\t *\t\t\t\n\t *\t\t\t\n\t *\t\t\n\t *\t\t]\n\t *\n\t * **Note:** To get all selected blocks use {@link #getSelectedBlocks `getSelectedBlocks()`}.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t* getTopMostBlocks() {\n\t\tconst selected = Array.from( this.getSelectedBlocks() );\n\n\t\tfor ( const block of selected ) {\n\t\t\tconst parentBlock = findAncestorBlock( block );\n\n\t\t\t// Filter out blocks that are nested in other selected blocks (like paragraphs in tables).\n\t\t\tif ( !parentBlock || !selected.includes( parentBlock ) ) {\n\t\t\t\tyield block;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks whether the selection contains the entire content of the given element. This means that selection must start\n\t * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position\n\t * touching the element's end.\n\t *\n\t * By default, this method will check whether the entire content of the selection's current root is selected.\n\t * Useful to check if e.g. the user has just pressed Ctrl + A.\n\t *\n\t * @param {module:engine/model/element~Element} [element=this.anchor.root]\n\t * @returns {Boolean}\n\t */\n\tcontainsEntireContent( element = this.anchor.root ) {\n\t\tconst limitStartPosition = Position._createAt( element, 0 );\n\t\tconst limitEndPosition = Position._createAt( element, 'end' );\n\n\t\treturn limitStartPosition.isTouching( this.getFirstPosition() ) &&\n\t\t\tlimitEndPosition.isTouching( this.getLastPosition() );\n\t}\n\n\t/**\n\t * Adds given range to internal {@link #_ranges ranges array}. Throws an error\n\t * if given range is intersecting with any range that is already stored in this selection.\n\t *\n\t * @protected\n\t * @param {module:engine/model/range~Range} range Range to add.\n\t */\n\t_pushRange( range ) {\n\t\tthis._checkRange( range );\n\t\tthis._ranges.push( new Range( range.start, range.end ) );\n\t}\n\n\t/**\n\t * Checks if given range intersects with ranges that are already in the selection. Throws an error if it does.\n\t *\n\t * @protected\n\t * @param {module:engine/model/range~Range} range Range to check.\n\t */\n\t_checkRange( range ) {\n\t\tfor ( let i = 0; i < this._ranges.length; i++ ) {\n\t\t\tif ( range.isIntersecting( this._ranges[ i ] ) ) {\n\t\t\t\t/**\n\t\t\t\t * Trying to add a range that intersects with another range in the selection.\n\t\t\t\t *\n\t\t\t\t * @error model-selection-range-intersects\n\t\t\t\t * @param {module:engine/model/range~Range} addedRange Range that was added to the selection.\n\t\t\t\t * @param {module:engine/model/range~Range} intersectingRange Range in the selection that intersects with `addedRange`.\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'model-selection-range-intersects: Trying to add a range that intersects with another range in the selection.',\n\t\t\t\t\t{ addedRange: range, intersectingRange: this._ranges[ i ] }\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Deletes ranges from internal range array. Uses {@link #_popRange _popRange} to\n\t * ensure proper ranges removal.\n\t *\n\t * @protected\n\t */\n\t_removeAllRanges() {\n\t\twhile ( this._ranges.length > 0 ) {\n\t\t\tthis._popRange();\n\t\t}\n\t}\n\n\t/**\n\t * Removes most recently added range from the selection.\n\t *\n\t * @protected\n\t */\n\t_popRange() {\n\t\tthis._ranges.pop();\n\t}\n\n\t/**\n\t * Fired when selection range(s) changed.\n\t *\n\t * @event change:range\n\t * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set\n\t * to `true` which indicates that the selection change was caused by a direct use of selection's API.\n\t * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position\n\t * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was\n\t * changed because the structure of the model has been changed (which means an indirect change).\n\t * The indirect change does not occur in case of normal (detached) selections because they are \"static\" (as \"not live\")\n\t * which mean that they are not updated once the document changes.\n\t */\n\n\t/**\n\t * Fired when selection attribute changed.\n\t *\n\t * @event change:attribute\n\t * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set\n\t * to `true` which indicates that the selection change was caused by a direct use of selection's API.\n\t * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes\n\t * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was\n\t * changed in the model and its attributes were refreshed (which means an indirect change).\n\t * The indirect change does not occur in case of normal (detached) selections because they are \"static\" (as \"not live\")\n\t * which mean that they are not updated once the document changes.\n\t * @param {Array.} attributeKeys Array containing keys of attributes that changed.\n\t */\n}\n\nmix( Selection, EmitterMixin );\n\n// Checks whether the given element extends $block in the schema and has a parent (is not a root).\n// Marks it as already visited.\nfunction isUnvisitedBlockContainer( element, visited ) {\n\tif ( visited.has( element ) ) {\n\t\treturn false;\n\t}\n\n\tvisited.add( element );\n\n\treturn element.document.model.schema.isBlock( element ) && element.parent;\n}\n\n// Finds the lowest element in position's ancestors which is a block.\n// It will search until first ancestor that is a limit element.\n// Marks all ancestors as already visited to not include any of them later on.\nfunction getParentBlock( position, visited ) {\n\tconst schema = position.parent.document.model.schema;\n\n\tconst ancestors = position.parent.getAncestors( { parentFirst: true, includeSelf: true } );\n\n\tlet hasParentLimit = false;\n\n\tconst block = ancestors.find( element => {\n\t\t// Stop searching after first parent node that is limit element.\n\t\tif ( hasParentLimit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\thasParentLimit = schema.isLimit( element );\n\n\t\treturn !hasParentLimit && isUnvisitedBlockContainer( element, visited );\n\t} );\n\n\t// Mark all ancestors of this position's parent, because find() might've stopped early and\n\t// the found block may be a child of another block.\n\tancestors.forEach( element => visited.add( element ) );\n\n\treturn block;\n}\n\n// Returns first ancestor block of a node.\n//\n// @param {module:engine/model/node~Node} node\n// @returns {module:engine/model/node~Node|undefined}\nfunction findAncestorBlock( node ) {\n\tconst schema = node.document.model.schema;\n\n\tlet parent = node.parent;\n\n\twhile ( parent ) {\n\t\tif ( schema.isBlock( parent ) ) {\n\t\t\treturn parent;\n\t\t}\n\n\t\tparent = parent.parent;\n\t}\n}\n\n/**\n * An entity that is used to set selection.\n *\n * See also {@link module:engine/model/selection~Selection#setTo}\n *\n * @typedef {\n * module:engine/model/selection~Selection|\n * module:engine/model/documentselection~DocumentSelection|\n * module:engine/model/position~Position|\n * module:engine/model/range~Range|\n * module:engine/model/node~Node|\n * Iterable.|\n * null\n * } module:engine/model/selection~Selectable\n */\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/liverange\n */\n\nimport Range from './range';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * `LiveRange` is a type of {@link module:engine/model/range~Range Range}\n * that updates itself as {@link module:engine/model/document~Document document}\n * is changed through operations. It may be used as a bookmark.\n *\n * **Note:** Be very careful when dealing with `LiveRange`. Each `LiveRange` instance bind events that might\n * have to be unbound. Use {@link module:engine/model/liverange~LiveRange#detach detach} whenever you don't need `LiveRange` anymore.\n */\nexport default class LiveRange extends Range {\n\t/**\n\t * Creates a live range.\n\t *\n\t * @see module:engine/model/range~Range\n\t */\n\tconstructor( start, end ) {\n\t\tsuper( start, end );\n\n\t\tbindWithDocument.call( this );\n\t}\n\n\t/**\n\t * Unbinds all events previously bound by `LiveRange`. Use it whenever you don't need `LiveRange` instance\n\t * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was\n\t * referring to it).\n\t */\n\tdetach() {\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Creates a {@link module:engine/model/range~Range range instance} that is equal to this live range.\n\t *\n\t * @returns {module:engine/model/range~Range}\n\t */\n\ttoRange() {\n\t\treturn new Range( this.start, this.end );\n\t}\n\n\t/**\n\t * Creates a `LiveRange` instance that is equal to the given range.\n\t *\n\t * @param {module:engine/model/range~Range} range\n\t * @returns {module:engine/model/liverange~LiveRange}\n\t */\n\tstatic fromRange( range ) {\n\t\treturn new LiveRange( range.start, range.end );\n\t}\n\n\t/**\n\t * @see module:engine/model/range~Range._createIn\n\t * @static\n\t * @protected\n\t * @method module:engine/model/liverange~LiveRange._createIn\n\t * @param {module:engine/model/element~Element} element\n\t * @returns {module:engine/model/liverange~LiveRange}\n\t */\n\n\t/**\n\t * @see module:engine/model/range~Range._createOn\n\t * @static\n\t * @protected\n\t * @method module:engine/model/liverange~LiveRange._createOn\n\t * @param {module:engine/model/element~Element} element\n\t * @returns {module:engine/model/liverange~LiveRange}\n\t */\n\n\t/**\n\t * @see module:engine/model/range~Range._createFromPositionAndShift\n\t * @static\n\t * @protected\n\t * @method module:engine/model/liverange~LiveRange._createFromPositionAndShift\n\t * @param {module:engine/model/position~Position} position\n\t * @param {Number} shift\n\t * @returns {module:engine/model/liverange~LiveRange}\n\t */\n\n\t/**\n\t * Fired when `LiveRange` instance boundaries have changed due to changes in the\n\t * {@link module:engine/model/document~Document document}.\n\t *\n\t * @event change:range\n\t * @param {module:engine/model/range~Range} oldRange Range with start and end position equal to start and end position of this live\n\t * range before it got changed.\n\t * @param {Object} data Object with additional information about the change.\n\t * @param {module:engine/model/position~Position|null} data.deletionPosition Source position for remove and merge changes.\n\t * Available if the range was moved to the graveyard root, `null` otherwise.\n\t */\n\n\t/**\n\t * Fired when `LiveRange` instance boundaries have not changed after a change in {@link module:engine/model/document~Document document}\n\t * but the change took place inside the range, effectively changing its content.\n\t *\n\t * @event change:content\n\t * @param {module:engine/model/range~Range} range Range with start and end position equal to start and end position of\n\t * change range.\n\t * @param {Object} data Object with additional information about the change.\n\t * @param {null} data.deletionPosition Due to the nature of this event, this property is always set to `null`. It is passed\n\t * for compatibility with the {@link module:engine/model/liverange~LiveRange#event:change:range} event.\n\t */\n}\n\n// Binds this `LiveRange` to the {@link module:engine/model/document~Document document}\n// that owns this range's {@link module:engine/model/range~Range#root root}.\n//\n// @private\nfunction bindWithDocument() {\n\tthis.listenTo(\n\t\tthis.root.document.model,\n\t\t'applyOperation',\n\t\t( event, args ) => {\n\t\t\tconst operation = args[ 0 ];\n\n\t\t\tif ( !operation.isDocumentOperation ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttransform.call( this, operation );\n\t\t},\n\t\t{ priority: 'low' }\n\t);\n}\n\n// Updates this range accordingly to the updates applied to the model. Bases on change events.\n//\n// @private\n// @param {module:engine/model/operation/operation~Operation} operation Executed operation.\nfunction transform( operation ) {\n\t// Transform the range by the operation. Join the result ranges if needed.\n\tconst ranges = this.getTransformedByOperation( operation );\n\tconst result = Range._createFromRanges( ranges );\n\n\tconst boundariesChanged = !result.isEqual( this );\n\tconst contentChanged = doesOperationChangeRangeContent( this, operation );\n\n\tlet deletionPosition = null;\n\n\tif ( boundariesChanged ) {\n\t\t// If range boundaries have changed, fire `change:range` event.\n\t\t//\n\t\tif ( result.root.rootName == '$graveyard' ) {\n\t\t\t// If the range was moved to the graveyard root, set `deletionPosition`.\n\t\t\tif ( operation.type == 'remove' ) {\n\t\t\t\tdeletionPosition = operation.sourcePosition;\n\t\t\t} else {\n\t\t\t\t// Merge operation.\n\t\t\t\tdeletionPosition = operation.deletionPosition;\n\t\t\t}\n\t\t}\n\n\t\tconst oldRange = this.toRange();\n\n\t\tthis.start = result.start;\n\t\tthis.end = result.end;\n\n\t\tthis.fire( 'change:range', oldRange, { deletionPosition } );\n\t} else if ( contentChanged ) {\n\t\t// If range boundaries have not changed, but there was change inside the range, fire `change:content` event.\n\t\tthis.fire( 'change:content', this.toRange(), { deletionPosition } );\n\t}\n}\n\n// Checks whether given operation changes something inside the range (even if it does not change boundaries).\n//\n// @private\n// @param {module:engine/model/range~Range} range Range to check.\n// @param {module:engine/model/operation/operation~Operation} operation Executed operation.\n// @returns {Boolean}\nfunction doesOperationChangeRangeContent( range, operation ) {\n\tswitch ( operation.type ) {\n\t\tcase 'insert':\n\t\t\treturn range.containsPosition( operation.position );\n\t\tcase 'move':\n\t\tcase 'remove':\n\t\tcase 'reinsert':\n\t\tcase 'merge':\n\t\t\treturn range.containsPosition( operation.sourcePosition ) ||\n\t\t\t\trange.start.isEqual( operation.sourcePosition ) ||\n\t\t\t\trange.containsPosition( operation.targetPosition );\n\t\tcase 'split':\n\t\t\treturn range.containsPosition( operation.splitPosition ) || range.containsPosition( operation.insertionPosition );\n\t}\n\n\treturn false;\n}\n\nmix( LiveRange, EmitterMixin );\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/documentselection\n */\n\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\n\nimport Selection from './selection';\nimport LiveRange from './liverange';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport toMap from '@ckeditor/ckeditor5-utils/src/tomap';\nimport Collection from '@ckeditor/ckeditor5-utils/src/collection';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport log from '@ckeditor/ckeditor5-utils/src/log';\nimport uid from '@ckeditor/ckeditor5-utils/src/uid';\n\nconst storePrefix = 'selection:';\n\n/**\n * `DocumentSelection` is a special selection which is used as the\n * {@link module:engine/model/document~Document#selection document's selection}.\n * There can be only one instance of `DocumentSelection` per document.\n *\n * Document selection can only be changed by using the {@link module:engine/model/writer~Writer} instance\n * inside the {@link module:engine/model/model~Model#change `change()`} block, as it provides a secure way to modify model.\n *\n * `DocumentSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}\n * to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.\n *\n * Differences between {@link module:engine/model/selection~Selection} and `DocumentSelection` are:\n * * there is always a range in `DocumentSelection` - even if no ranges were added there is a \"default range\"\n * present in the selection,\n * * ranges added to this selection updates automatically when the document changes,\n * * attributes of `DocumentSelection` are updated automatically according to selection ranges.\n *\n * Since `DocumentSelection` uses {@link module:engine/model/liverange~LiveRange live ranges}\n * and is updated when {@link module:engine/model/document~Document document}\n * changes, it cannot be set on {@link module:engine/model/node~Node nodes}\n * that are inside {@link module:engine/model/documentfragment~DocumentFragment document fragment}.\n * If you need to represent a selection in document fragment,\n * use {@link module:engine/model/selection~Selection Selection class} instead.\n *\n * @mixes module:utils/emittermixin~EmitterMixin\n */\nexport default class DocumentSelection {\n\t/**\n\t * Creates an empty live selection for given {@link module:engine/model/document~Document}.\n\t *\n\t * @param {module:engine/model/document~Document} doc Document which owns this selection.\n\t */\n\tconstructor( doc ) {\n\t\t/**\n\t\t * Selection used internally by that class (`DocumentSelection` is a proxy to that selection).\n\t\t *\n\t\t * @protected\n\t\t */\n\t\tthis._selection = new LiveSelection( doc );\n\n\t\tthis._selection.delegate( 'change:range' ).to( this );\n\t\tthis._selection.delegate( 'change:attribute' ).to( this );\n\t}\n\n\t/**\n\t * Returns whether the selection is collapsed. Selection is collapsed when there is exactly one range which is\n\t * collapsed.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isCollapsed() {\n\t\treturn this._selection.isCollapsed;\n\t}\n\n\t/**\n\t * Selection anchor. Anchor may be described as a position where the most recent part of the selection starts.\n\t * Together with {@link #focus} they define the direction of selection, which is important\n\t * when expanding/shrinking selection. Anchor is always {@link module:engine/model/range~Range#start start} or\n\t * {@link module:engine/model/range~Range#end end} position of the most recently added range.\n\t *\n\t * Is set to `null` if there are no ranges in selection.\n\t *\n\t * @see #focus\n\t * @readonly\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget anchor() {\n\t\treturn this._selection.anchor;\n\t}\n\n\t/**\n\t * Selection focus. Focus is a position where the selection ends.\n\t *\n\t * Is set to `null` if there are no ranges in selection.\n\t *\n\t * @see #anchor\n\t * @readonly\n\t * @type {module:engine/model/position~Position|null}\n\t */\n\tget focus() {\n\t\treturn this._selection.focus;\n\t}\n\n\t/**\n\t * Returns number of ranges in selection.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget rangeCount() {\n\t\treturn this._selection.rangeCount;\n\t}\n\n\t/**\n\t * Describes whether `Documentselection` has own range(s) set, or if it is defaulted to\n\t * {@link module:engine/model/document~Document#_getDefaultRange document's default range}.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget hasOwnRange() {\n\t\treturn this._selection.hasOwnRange;\n\t}\n\n\t/**\n\t * Specifies whether the {@link #focus}\n\t * precedes {@link #anchor}.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isBackward() {\n\t\treturn this._selection.isBackward;\n\t}\n\n\t/**\n\t * Describes whether the gravity is overridden (using {@link module:engine/model/writer~Writer#overrideSelectionGravity}) or not.\n\t *\n\t * Note that the gravity remains overridden as long as will not be restored the same number of times as it was overridden.\n\t *\n\t * @readonly\n\t * @returns {Boolean}\n\t */\n\tget isGravityOverridden() {\n\t\treturn this._selection.isGravityOverridden;\n\t}\n\n\t/**\n\t * A collection of selection markers.\n\t * Marker is a selection marker when selection range is inside the marker range.\n\t *\n\t * @readonly\n\t * @type {module:utils/collection~Collection.}\n\t */\n\tget markers() {\n\t\treturn this._selection.markers;\n\t}\n\n\t/**\n\t * Used for the compatibility with the {@link module:engine/model/selection~Selection#isEqual} method.\n\t *\n\t * @protected\n\t */\n\tget _ranges() {\n\t\treturn this._selection._ranges;\n\t}\n\n\t/**\n\t * Returns an iterable that iterates over copies of selection ranges.\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetRanges() {\n\t\treturn this._selection.getRanges();\n\t}\n\n\t/**\n\t * Returns the first position in the selection.\n\t * First position is the position that {@link module:engine/model/position~Position#isBefore is before}\n\t * any other position in the selection.\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/position~Position|null}\n\t */\n\tgetFirstPosition() {\n\t\treturn this._selection.getFirstPosition();\n\t}\n\n\t/**\n\t * Returns the last position in the selection.\n\t * Last position is the position that {@link module:engine/model/position~Position#isAfter is after}\n\t * any other position in the selection.\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/position~Position|null}\n\t */\n\tgetLastPosition() {\n\t\treturn this._selection.getLastPosition();\n\t}\n\n\t/**\n\t * Returns a copy of the first range in the selection.\n\t * First range is the one which {@link module:engine/model/range~Range#start start} position\n\t * {@link module:engine/model/position~Position#isBefore is before} start position of all other ranges\n\t * (not to confuse with the first range added to the selection).\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/range~Range|null}\n\t */\n\tgetFirstRange() {\n\t\treturn this._selection.getFirstRange();\n\t}\n\n\t/**\n\t * Returns a copy of the last range in the selection.\n\t * Last range is the one which {@link module:engine/model/range~Range#end end} position\n\t * {@link module:engine/model/position~Position#isAfter is after} end position of all other ranges (not to confuse with the range most\n\t * recently added to the selection).\n\t *\n\t * Returns `null` if there are no ranges in selection.\n\t *\n\t * @returns {module:engine/model/range~Range|null}\n\t */\n\tgetLastRange() {\n\t\treturn this._selection.getLastRange();\n\t}\n\n\t/**\n\t * Gets elements of type \"block\" touched by the selection.\n\t *\n\t * This method's result can be used for example to apply block styling to all blocks covered by this selection.\n\t *\n\t * **Note:** `getSelectedBlocks()` always returns the deepest block.\n\t *\n\t * In this case the function will return exactly all 3 paragraphs:\n\t *\n\t *\t\t[a\n\t *\t\t\n\t *\t\t\tb\n\t *\t\t\n\t *\t\tc]d\n\t *\n\t * In this case the paragraph will also be returned, despite the collapsed selection:\n\t *\n\t *\t\t[]a\n\t *\n\t * **Special case**: If a selection ends at the beginning of a block, that block is not returned as from user perspective\n\t * this block wasn't selected. See [#984](https://github.com/ckeditor/ckeditor5-engine/issues/984) for more details.\n\t *\n\t *\t\t[a\n\t *\t\tb\n\t *\t\t]c // this block will not be returned\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetSelectedBlocks() {\n\t\treturn this._selection.getSelectedBlocks();\n\t}\n\n\t/**\n\t * Returns blocks that aren't nested in other selected blocks.\n\t *\n\t * In this case the method will return blocks A, B and E because C & D are children of block B:\n\t *\n\t *\t\t[\n\t *\t\t\n\t *\t\t\t\n\t *\t\t\t\n\t *\t\t\n\t *\t\t]\n\t *\n\t * **Note:** To get all selected blocks use {@link #getSelectedBlocks `getSelectedBlocks()`}.\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetTopMostBlocks() {\n\t\treturn this._selection.getTopMostBlocks();\n\t}\n\n\t/**\n\t * Returns the selected element. {@link module:engine/model/element~Element Element} is considered as selected if there is only\n\t * one range in the selection, and that range contains exactly one element.\n\t * Returns `null` if there is no selected element.\n\t *\n\t * @returns {module:engine/model/element~Element|null}\n\t */\n\tgetSelectedElement() {\n\t\treturn this._selection.getSelectedElement();\n\t}\n\n\t/**\n\t * Checks whether the selection contains the entire content of the given element. This means that selection must start\n\t * at a position {@link module:engine/model/position~Position#isTouching touching} the element's start and ends at position\n\t * touching the element's end.\n\t *\n\t * By default, this method will check whether the entire content of the selection's current root is selected.\n\t * Useful to check if e.g. the user has just pressed Ctrl + A.\n\t *\n\t * @param {module:engine/model/element~Element} [element=this.anchor.root]\n\t * @returns {Boolean}\n\t */\n\tcontainsEntireContent( element ) {\n\t\treturn this._selection.containsEntireContent( element );\n\t}\n\n\t/**\n\t * Unbinds all events previously bound by document selection.\n\t */\n\tdestroy() {\n\t\tthis._selection.destroy();\n\t}\n\n\t/**\n\t * Returns iterable that iterates over this selection's attribute keys.\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetAttributeKeys() {\n\t\treturn this._selection.getAttributeKeys();\n\t}\n\n\t/**\n\t * Returns iterable that iterates over this selection's attributes.\n\t *\n\t * Attributes are returned as arrays containing two items. First one is attribute key and second is attribute value.\n\t * This format is accepted by native `Map` object and also can be passed in `Node` constructor.\n\t *\n\t * @returns {Iterable.<*>}\n\t */\n\tgetAttributes() {\n\t\treturn this._selection.getAttributes();\n\t}\n\n\t/**\n\t * Gets an attribute value for given key or `undefined` if that attribute is not set on the selection.\n\t *\n\t * @param {String} key Key of attribute to look for.\n\t * @returns {*} Attribute value or `undefined`.\n\t */\n\tgetAttribute( key ) {\n\t\treturn this._selection.getAttribute( key );\n\t}\n\n\t/**\n\t * Checks if the selection has an attribute for given key.\n\t *\n\t * @param {String} key Key of attribute to check.\n\t * @returns {Boolean} `true` if attribute with given key is set on selection, `false` otherwise.\n\t */\n\thasAttribute( key ) {\n\t\treturn this._selection.hasAttribute( key );\n\t}\n\n\t/**\n\t * Checks whether object is of given type following the convention set by\n\t * {@link module:engine/model/node~Node#is `Node#is()`}.\n\t *\n\t *\t\tconst selection = new DocumentSelection( ... );\n\t *\n\t *\t\tselection.is( 'selection' ); // true\n\t *\t\tselection.is( 'documentSelection' ); // true\n\t *\t\tselection.is( 'node' ); // false\n\t *\t\tselection.is( 'element' ); // false\n\t *\n\t * @param {String} type\n\t * @returns {Boolean}\n\t */\n\tis( type ) {\n\t\treturn type == 'selection' || type == 'documentSelection';\n\t}\n\n\t/**\n\t * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.\n\t * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionFocus} method.\n\t *\n\t * The location can be specified in the same form as\n\t * {@link module:engine/model/writer~Writer#createPositionAt writer.createPositionAt()} parameters.\n\t *\n\t * @see module:engine/model/writer~Writer#setSelectionFocus\n\t * @protected\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\t_setFocus( itemOrPosition, offset ) {\n\t\tthis._selection.setFocus( itemOrPosition, offset );\n\t}\n\n\t/**\n\t * Sets this selection's ranges and direction to the specified location based on the given\n\t * {@link module:engine/model/selection~Selectable selectable}.\n\t * Should be used only within the {@link module:engine/model/writer~Writer#setSelection} method.\n\t *\n\t * @see module:engine/model/writer~Writer#setSelection\n\t * @protected\n\t * @param {module:engine/model/selection~Selectable} selectable\n\t * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.\n\t * @param {Object} [options]\n\t * @param {Boolean} [options.backward] Sets this selection instance to be backward.\n\t */\n\t_setTo( selectable, placeOrOffset, options ) {\n\t\tthis._selection.setTo( selectable, placeOrOffset, options );\n\t}\n\n\t/**\n\t * Sets attribute on the selection. If attribute with the same key already is set, it's value is overwritten.\n\t * Should be used only within the {@link module:engine/model/writer~Writer#setSelectionAttribute} method.\n\t *\n\t * @see module:engine/model/writer~Writer#setSelectionAttribute\n\t * @protected\n\t * @param {String} key Key of the attribute to set.\n\t * @param {*} value Attribute value.\n\t */\n\t_setAttribute( key, value ) {\n\t\tthis._selection.setAttribute( key, value );\n\t}\n\n\t/**\n\t * Removes an attribute with given key from the selection.\n\t * If the given attribute was set on the selection, fires the {@link module:engine/model/selection~Selection#event:change:range}\n\t * event with removed attribute key.\n\t * Should be used only within the {@link module:engine/model/writer~Writer#removeSelectionAttribute} method.\n\t *\n\t * @see module:engine/model/writer~Writer#removeSelectionAttribute\n\t * @protected\n\t * @param {String} key Key of the attribute to remove.\n\t */\n\t_removeAttribute( key ) {\n\t\tthis._selection.removeAttribute( key );\n\t}\n\n\t/**\n\t * Returns an iterable that iterates through all selection attributes stored in current selection's parent.\n\t *\n\t * @protected\n\t * @returns {Iterable.<*>}\n\t */\n\t_getStoredAttributes() {\n\t\treturn this._selection._getStoredAttributes();\n\t}\n\n\t/**\n\t * Temporarily changes the gravity of the selection from the left to the right.\n\t *\n\t * The gravity defines from which direction the selection inherits its attributes. If it's the default left\n\t * gravity, the selection (after being moved by the the user) inherits attributes from its left hand side.\n\t * This method allows to temporarily override this behavior by forcing the gravity to the right.\n\t *\n\t * It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry\n\t * of the process.\n\t *\n\t * @see module:engine/model/writer~Writer#overrideSelectionGravity\n\t * @protected\n\t * @returns {String} The unique id which allows restoring the gravity.\n\t */\n\t_overrideGravity() {\n\t\treturn this._selection.overrideGravity();\n\t}\n\n\t/**\n\t * Restores the {@link ~DocumentSelection#_overrideGravity overridden gravity}.\n\t *\n\t * Restoring the gravity is only possible using the unique identifier returned by\n\t * {@link ~DocumentSelection#_overrideGravity}. Note that the gravity remains overridden as long as won't be restored\n\t * the same number of times it was overridden.\n\t *\n\t * @see module:engine/model/writer~Writer#restoreSelectionGravity\n\t * @protected\n\t * @param {String} uid The unique id returned by {@link #_overrideGravity}.\n\t */\n\t_restoreGravity( uid ) {\n\t\tthis._selection.restoreGravity( uid );\n\t}\n\n\t/**\n\t * Generates and returns an attribute key for selection attributes store, basing on original attribute key.\n\t *\n\t * @protected\n\t * @param {String} key Attribute key to convert.\n\t * @returns {String} Converted attribute key, applicable for selection store.\n\t */\n\tstatic _getStoreAttributeKey( key ) {\n\t\treturn storePrefix + key;\n\t}\n\n\t/**\n\t * Checks whether the given attribute key is an attribute stored on an element.\n\t *\n\t * @protected\n\t * @param {String} key\n\t * @returns {Boolean}\n\t */\n\tstatic _isStoreAttributeKey( key ) {\n\t\treturn key.startsWith( storePrefix );\n\t}\n}\n\nmix( DocumentSelection, EmitterMixin );\n\n/**\n * Fired when selection range(s) changed.\n *\n * @event change:range\n * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set\n * to `true` which indicates that the selection change was caused by a direct use of selection's API.\n * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its position\n * was directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was\n * changed because the structure of the model has been changed (which means an indirect change).\n * The indirect change does not occur in case of normal (detached) selections because they are \"static\" (as \"not live\")\n * which mean that they are not updated once the document changes.\n */\n\n/**\n * Fired when selection attribute changed.\n *\n * @event change:attribute\n * @param {Boolean} directChange In case of {@link module:engine/model/selection~Selection} class it is always set\n * to `true` which indicates that the selection change was caused by a direct use of selection's API.\n * The {@link module:engine/model/documentselection~DocumentSelection}, however, may change because its attributes\n * were directly changed through the {@link module:engine/model/writer~Writer writer} or because its position was\n * changed in the model and its attributes were refreshed (which means an indirect change).\n * The indirect change does not occur in case of normal (detached) selections because they are \"static\" (as \"not live\")\n * which mean that they are not updated once the document changes.\n * @param {Array.} attributeKeys Array containing keys of attributes that changed.\n */\n\n// `LiveSelection` is used internally by {@link module:engine/model/documentselection~DocumentSelection} and shouldn't be used directly.\n//\n// LiveSelection` is automatically updated upon changes in the {@link module:engine/model/document~Document document}\n// to always contain valid ranges. Its attributes are inherited from the text unless set explicitly.\n//\n// Differences between {@link module:engine/model/selection~Selection} and `LiveSelection` are:\n// * there is always a range in `LiveSelection` - even if no ranges were added there is a \"default range\"\n// present in the selection,\n// * ranges added to this selection updates automatically when the document changes,\n// * attributes of `LiveSelection` are updated automatically according to selection ranges.\n//\n// @extends module:engine/model/selection~Selection\n//\n\nclass LiveSelection extends Selection {\n\t// Creates an empty live selection for given {@link module:engine/model/document~Document}.\n\t// @param {module:engine/model/document~Document} doc Document which owns this selection.\n\tconstructor( doc ) {\n\t\tsuper();\n\n\t\t// List of selection markers.\n\t\t// Marker is a selection marker when selection range is inside the marker range.\n\t\t//\n\t\t// @type {module:utils/collection~Collection}\n\t\tthis.markers = new Collection( { idProperty: 'name' } );\n\n\t\t// Document which owns this selection.\n\t\t//\n\t\t// @protected\n\t\t// @member {module:engine/model/model~Model}\n\t\tthis._model = doc.model;\n\n\t\t// Document which owns this selection.\n\t\t//\n\t\t// @protected\n\t\t// @member {module:engine/model/document~Document}\n\t\tthis._document = doc;\n\n\t\t// Keeps mapping of attribute name to priority with which the attribute got modified (added/changed/removed)\n\t\t// last time. Possible values of priority are: `'low'` and `'normal'`.\n\t\t//\n\t\t// Priorities are used by internal `LiveSelection` mechanisms. All attributes set using `LiveSelection`\n\t\t// attributes API are set with `'normal'` priority.\n\t\t//\n\t\t// @private\n\t\t// @member {Map} module:engine/model/liveselection~LiveSelection#_attributePriority\n\t\tthis._attributePriority = new Map();\n\n\t\t// Contains data required to fix ranges which have been moved to the graveyard.\n\t\t// @private\n\t\t// @member {Array} module:engine/model/liveselection~LiveSelection#_fixGraveyardRangesData\n\t\tthis._fixGraveyardRangesData = [];\n\n\t\t// Flag that informs whether the selection ranges have changed. It is changed on true when `LiveRange#change:range` event is fired.\n\t\t// @private\n\t\t// @member {Array} module:engine/model/liveselection~LiveSelection#_hasChangedRange\n\t\tthis._hasChangedRange = false;\n\n\t\t// Each overriding gravity adds an UID to the set and each removal removes it.\n\t\t// Gravity is overridden when there's at least one UID in the set.\n\t\t// Gravity is restored when the set is empty.\n\t\t// This is to prevent conflicts when gravity is overridden by more than one feature at the same time.\n\t\t// @private\n\t\t// @type {Set}\n\t\tthis._overriddenGravityRegister = new Set();\n\n\t\t// Ensure selection is correct and up to date after each range change.\n\t\tthis.on( 'change:range', () => {\n\t\t\tfor ( const range of this.getRanges() ) {\n\t\t\t\tif ( !this._document._validateSelectionRange( range ) ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Range from {@link module:engine/model/documentselection~DocumentSelection document selection}\n\t\t\t\t\t * starts or ends at incorrect position.\n\t\t\t\t\t *\n\t\t\t\t\t * @error document-selection-wrong-position\n\t\t\t\t\t * @param {module:engine/model/range~Range} range\n\t\t\t\t\t */\n\t\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t\t'document-selection-wrong-position: Range from document selection starts or ends at incorrect position.',\n\t\t\t\t\t\t{ range }\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._updateMarkers();\n\t\t\tthis._updateAttributes( false );\n\t\t} );\n\n\t\t// Update markers data stored by the selection after each marker change.\n\t\tthis.listenTo( this._model.markers, 'update', () => this._updateMarkers() );\n\n\t\t// Ensure selection is correct and up to date after each operation.\n\t\tthis.listenTo( this._model, 'applyOperation', ( evt, args ) => {\n\t\t\tconst operation = args[ 0 ];\n\n\t\t\tif ( !operation.isDocumentOperation || operation.type == 'marker' || operation.type == 'rename' || operation.type == 'noop' ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\twhile ( this._fixGraveyardRangesData.length ) {\n\t\t\t\tconst { liveRange, sourcePosition } = this._fixGraveyardRangesData.shift();\n\n\t\t\t\tthis._fixGraveyardSelection( liveRange, sourcePosition );\n\t\t\t}\n\n\t\t\tif ( this._hasChangedRange ) {\n\t\t\t\tthis._hasChangedRange = false;\n\t\t\t\tthis.fire( 'change:range', { directChange: false } );\n\t\t\t}\n\n\t\t\tthis._updateMarkers();\n\t\t\tthis._updateAttributes( false );\n\t\t}, { priority: 'lowest' } );\n\n\t\t// Clear selection attributes from element if no longer empty.\n\t\tthis.listenTo( this._document, 'change', ( evt, batch ) => {\n\t\t\tclearAttributesStoredInElement( this._model, batch );\n\t\t} );\n\t}\n\n\tget isCollapsed() {\n\t\tconst length = this._ranges.length;\n\n\t\treturn length === 0 ? this._document._getDefaultRange().isCollapsed : super.isCollapsed;\n\t}\n\n\tget anchor() {\n\t\treturn super.anchor || this._document._getDefaultRange().start;\n\t}\n\n\tget focus() {\n\t\treturn super.focus || this._document._getDefaultRange().end;\n\t}\n\n\tget rangeCount() {\n\t\treturn this._ranges.length ? this._ranges.length : 1;\n\t}\n\n\t// Describes whether `LiveSelection` has own range(s) set, or if it is defaulted to\n\t// {@link module:engine/model/document~Document#_getDefaultRange document's default range}.\n\t//\n\t// @readonly\n\t// @type {Boolean}\n\tget hasOwnRange() {\n\t\treturn this._ranges.length > 0;\n\t}\n\n\t// When set to `true` then selection attributes on node before the caret won't be taken\n\t// into consideration while updating selection attributes.\n\t//\n\t// @protected\n\t// @type {Boolean}\n\tget isGravityOverridden() {\n\t\treturn !!this._overriddenGravityRegister.size;\n\t}\n\n\t// Unbinds all events previously bound by live selection.\n\tdestroy() {\n\t\tfor ( let i = 0; i < this._ranges.length; i++ ) {\n\t\t\tthis._ranges[ i ].detach();\n\t\t}\n\n\t\tthis.stopListening();\n\t}\n\n\t* getRanges() {\n\t\tif ( this._ranges.length ) {\n\t\t\tyield* super.getRanges();\n\t\t} else {\n\t\t\tyield this._document._getDefaultRange();\n\t\t}\n\t}\n\n\tgetFirstRange() {\n\t\treturn super.getFirstRange() || this._document._getDefaultRange();\n\t}\n\n\tgetLastRange() {\n\t\treturn super.getLastRange() || this._document._getDefaultRange();\n\t}\n\n\tsetTo( selectable, optionsOrPlaceOrOffset, options ) {\n\t\tsuper.setTo( selectable, optionsOrPlaceOrOffset, options );\n\t\tthis._refreshAttributes();\n\t}\n\n\tsetFocus( itemOrPosition, offset ) {\n\t\tsuper.setFocus( itemOrPosition, offset );\n\t\tthis._refreshAttributes();\n\t}\n\n\tsetAttribute( key, value ) {\n\t\tif ( this._setAttribute( key, value ) ) {\n\t\t\t// Fire event with exact data.\n\t\t\tconst attributeKeys = [ key ];\n\t\t\tthis.fire( 'change:attribute', { attributeKeys, directChange: true } );\n\t\t}\n\t}\n\n\tremoveAttribute( key ) {\n\t\tif ( this._removeAttribute( key ) ) {\n\t\t\t// Fire event with exact data.\n\t\t\tconst attributeKeys = [ key ];\n\t\t\tthis.fire( 'change:attribute', { attributeKeys, directChange: true } );\n\t\t}\n\t}\n\n\toverrideGravity() {\n\t\tconst overrideUid = uid();\n\n\t\t// Remember that another overriding has been requested. It will need to be removed\n\t\t// before the gravity is to be restored.\n\t\tthis._overriddenGravityRegister.add( overrideUid );\n\n\t\tif ( this._overriddenGravityRegister.size === 1 ) {\n\t\t\tthis._refreshAttributes();\n\t\t}\n\n\t\treturn overrideUid;\n\t}\n\n\trestoreGravity( uid ) {\n\t\tif ( !this._overriddenGravityRegister.has( uid ) ) {\n\t\t\t/**\n\t\t\t * Restoring gravity for an unknown UID is not possible. Make sure you are using a correct\n\t\t\t * UID obtained from the {@link module:engine/model/writer~Writer#overrideSelectionGravity} to restore.\n\t\t\t *\n\t\t\t * @error document-selection-gravity-wrong-restore\n\t\t\t * @param {String} uid The unique identifier returned by\n\t\t\t * {@link module:engine/model/documentselection~DocumentSelection#_overrideGravity}.\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'document-selection-gravity-wrong-restore: Attempting to restore the selection gravity for an unknown UID.',\n\t\t\t\t{ uid }\n\t\t\t);\n\t\t}\n\n\t\tthis._overriddenGravityRegister.delete( uid );\n\n\t\t// Restore gravity only when all overriding have been restored.\n\t\tif ( !this.isGravityOverridden ) {\n\t\t\tthis._refreshAttributes();\n\t\t}\n\t}\n\n\t// Removes all attributes from the selection and sets attributes according to the surrounding nodes.\n\t_refreshAttributes() {\n\t\tthis._updateAttributes( true );\n\t}\n\n\t_popRange() {\n\t\tthis._ranges.pop().detach();\n\t}\n\n\t_pushRange( range ) {\n\t\tconst liveRange = this._prepareRange( range );\n\n\t\t// `undefined` is returned when given `range` is in graveyard root.\n\t\tif ( liveRange ) {\n\t\t\tthis._ranges.push( liveRange );\n\t\t}\n\t}\n\n\t// Prepares given range to be added to selection. Checks if it is correct,\n\t// converts it to {@link module:engine/model/liverange~LiveRange LiveRange}\n\t// and sets listeners listening to the range's change event.\n\t//\n\t// @private\n\t// @param {module:engine/model/range~Range} range\n\t_prepareRange( range ) {\n\t\tthis._checkRange( range );\n\n\t\tif ( range.root == this._document.graveyard ) {\n\t\t\t/**\n\t\t\t * Trying to add a Range that is in the graveyard root. Range rejected.\n\t\t\t *\n\t\t\t * @warning model-selection-range-in-graveyard\n\t\t\t */\n\t\t\tlog.warn( 'model-selection-range-in-graveyard: Trying to add a Range that is in the graveyard root. Range rejected.' );\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst liveRange = LiveRange.fromRange( range );\n\n\t\tliveRange.on( 'change:range', ( evt, oldRange, data ) => {\n\t\t\tthis._hasChangedRange = true;\n\n\t\t\t// If `LiveRange` is in whole moved to the graveyard, save necessary data. It will be fixed on `Model#applyOperation` event.\n\t\t\tif ( liveRange.root == this._document.graveyard ) {\n\t\t\t\tthis._fixGraveyardRangesData.push( {\n\t\t\t\t\tliveRange,\n\t\t\t\t\tsourcePosition: data.deletionPosition\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\n\t\treturn liveRange;\n\t}\n\n\t_updateMarkers() {\n\t\tconst markers = [];\n\n\t\tfor ( const marker of this._model.markers ) {\n\t\t\tconst markerRange = marker.getRange();\n\n\t\t\tfor ( const selectionRange of this.getRanges() ) {\n\t\t\t\tif ( markerRange.containsRange( selectionRange, !selectionRange.isCollapsed ) ) {\n\t\t\t\t\tmarkers.push( marker );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor ( const marker of markers ) {\n\t\t\tif ( !this.markers.has( marker ) ) {\n\t\t\t\tthis.markers.add( marker );\n\t\t\t}\n\t\t}\n\n\t\tfor ( const marker of Array.from( this.markers ) ) {\n\t\t\tif ( !markers.includes( marker ) ) {\n\t\t\t\tthis.markers.remove( marker );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Updates this selection attributes according to its ranges and the {@link module:engine/model/document~Document model document}.\n\t//\n\t// @protected\n\t// @param {Boolean} clearAll\n\t// @fires change:attribute\n\t_updateAttributes( clearAll ) {\n\t\tconst newAttributes = toMap( this._getSurroundingAttributes() );\n\t\tconst oldAttributes = toMap( this.getAttributes() );\n\n\t\tif ( clearAll ) {\n\t\t\t// If `clearAll` remove all attributes and reset priorities.\n\t\t\tthis._attributePriority = new Map();\n\t\t\tthis._attrs = new Map();\n\t\t} else {\n\t\t\t// If not, remove only attributes added with `low` priority.\n\t\t\tfor ( const [ key, priority ] of this._attributePriority ) {\n\t\t\t\tif ( priority == 'low' ) {\n\t\t\t\t\tthis._attrs.delete( key );\n\t\t\t\t\tthis._attributePriority.delete( key );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis._setAttributesTo( newAttributes );\n\n\t\t// Let's evaluate which attributes really changed.\n\t\tconst changed = [];\n\n\t\t// First, loop through all attributes that are set on selection right now.\n\t\t// Check which of them are different than old attributes.\n\t\tfor ( const [ newKey, newValue ] of this.getAttributes() ) {\n\t\t\tif ( !oldAttributes.has( newKey ) || oldAttributes.get( newKey ) !== newValue ) {\n\t\t\t\tchanged.push( newKey );\n\t\t\t}\n\t\t}\n\n\t\t// Then, check which of old attributes got removed.\n\t\tfor ( const [ oldKey ] of oldAttributes ) {\n\t\t\tif ( !this.hasAttribute( oldKey ) ) {\n\t\t\t\tchanged.push( oldKey );\n\t\t\t}\n\t\t}\n\n\t\t// Fire event with exact data (fire only if anything changed).\n\t\tif ( changed.length > 0 ) {\n\t\t\tthis.fire( 'change:attribute', { attributeKeys: changed, directChange: false } );\n\t\t}\n\t}\n\n\t// Internal method for setting `LiveSelection` attribute. Supports attribute priorities (through `directChange`\n\t// parameter).\n\t//\n\t// @private\n\t// @param {String} key Attribute key.\n\t// @param {*} value Attribute value.\n\t// @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change\n\t// is caused by `Batch` API.\n\t// @returns {Boolean} Whether value has changed.\n\t_setAttribute( key, value, directChange = true ) {\n\t\tconst priority = directChange ? 'normal' : 'low';\n\n\t\tif ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {\n\t\t\t// Priority too low.\n\t\t\treturn false;\n\t\t}\n\n\t\tconst oldValue = super.getAttribute( key );\n\n\t\t// Don't do anything if value has not changed.\n\t\tif ( oldValue === value ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._attrs.set( key, value );\n\n\t\t// Update priorities map.\n\t\tthis._attributePriority.set( key, priority );\n\n\t\treturn true;\n\t}\n\n\t// Internal method for removing `LiveSelection` attribute. Supports attribute priorities (through `directChange`\n\t// parameter).\n\t//\n\t// NOTE: Even if attribute is not present in the selection but is provided to this method, it's priority will\n\t// be changed according to `directChange` parameter.\n\t//\n\t// @private\n\t// @param {String} key Attribute key.\n\t// @param {Boolean} [directChange=true] `true` if the change is caused by `Selection` API, `false` if change\n\t// is caused by `Batch` API.\n\t// @returns {Boolean} Whether attribute was removed. May not be true if such attributes didn't exist or the\n\t// existing attribute had higher priority.\n\t_removeAttribute( key, directChange = true ) {\n\t\tconst priority = directChange ? 'normal' : 'low';\n\n\t\tif ( priority == 'low' && this._attributePriority.get( key ) == 'normal' ) {\n\t\t\t// Priority too low.\n\t\t\treturn false;\n\t\t}\n\n\t\t// Update priorities map.\n\t\tthis._attributePriority.set( key, priority );\n\n\t\t// Don't do anything if value has not changed.\n\t\tif ( !super.hasAttribute( key ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis._attrs.delete( key );\n\n\t\treturn true;\n\t}\n\n\t// Internal method for setting multiple `LiveSelection` attributes. Supports attribute priorities (through\n\t// `directChange` parameter).\n\t//\n\t// @private\n\t// @param {Map.} attrs Iterable object containing attributes to be set.\n\t// @returns {Set.} Changed attribute keys.\n\t_setAttributesTo( attrs ) {\n\t\tconst changed = new Set();\n\n\t\tfor ( const [ oldKey, oldValue ] of this.getAttributes() ) {\n\t\t\t// Do not remove attribute if attribute with same key and value is about to be set.\n\t\t\tif ( attrs.get( oldKey ) === oldValue ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// All rest attributes will be removed so changed attributes won't change .\n\t\t\tthis._removeAttribute( oldKey, false );\n\t\t}\n\n\t\tfor ( const [ key, value ] of attrs ) {\n\t\t\t// Attribute may not be set because of attributes or because same key/value is already added.\n\t\t\tconst gotAdded = this._setAttribute( key, value, false );\n\n\t\t\tif ( gotAdded ) {\n\t\t\t\tchanged.add( key );\n\t\t\t}\n\t\t}\n\n\t\treturn changed;\n\t}\n\n\t// Returns an iterable that iterates through all selection attributes stored in current selection's parent.\n\t//\n\t// @protected\n\t// @returns {Iterable.<*>}\n\t* _getStoredAttributes() {\n\t\tconst selectionParent = this.getFirstPosition().parent;\n\n\t\tif ( this.isCollapsed && selectionParent.isEmpty ) {\n\t\t\tfor ( const key of selectionParent.getAttributeKeys() ) {\n\t\t\t\tif ( key.startsWith( storePrefix ) ) {\n\t\t\t\t\tconst realKey = key.substr( storePrefix.length );\n\n\t\t\t\t\tyield [ realKey, selectionParent.getAttribute( key ) ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Checks model text nodes that are closest to the selection's first position and returns attributes of first\n\t// found element. If there are no text nodes in selection's first position parent, it returns selection\n\t// attributes stored in that parent.\n\t//\n\t// @private\n\t// @returns {Iterable.<*>} Collection of attributes.\n\t_getSurroundingAttributes() {\n\t\tconst position = this.getFirstPosition();\n\t\tconst schema = this._model.schema;\n\n\t\tlet attrs = null;\n\n\t\tif ( !this.isCollapsed ) {\n\t\t\t// 1. If selection is a range...\n\t\t\tconst range = this.getFirstRange();\n\n\t\t\t// ...look for a first character node in that range and take attributes from it.\n\t\t\tfor ( const value of range ) {\n\t\t\t\t// If the item is an object, we don't want to get attributes from its children.\n\t\t\t\tif ( value.item.is( 'element' ) && schema.isObject( value.item ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif ( value.type == 'text' ) {\n\t\t\t\t\tattrs = value.item.getAttributes();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// 2. If the selection is a caret or the range does not contain a character node...\n\n\t\t\tconst nodeBefore = position.textNode ? position.textNode : position.nodeBefore;\n\t\t\tconst nodeAfter = position.textNode ? position.textNode : position.nodeAfter;\n\n\t\t\t// When gravity is overridden then don't take node before into consideration.\n\t\t\tif ( !this.isGravityOverridden ) {\n\t\t\t\t// ...look at the node before caret and take attributes from it if it is a character node.\n\t\t\t\tattrs = getAttrsIfCharacter( nodeBefore );\n\t\t\t}\n\n\t\t\t// 3. If not, look at the node after caret...\n\t\t\tif ( !attrs ) {\n\t\t\t\tattrs = getAttrsIfCharacter( nodeAfter );\n\t\t\t}\n\n\t\t\t// 4. If not, try to find the first character on the left, that is in the same node.\n\t\t\t// When gravity is overridden then don't take node before into consideration.\n\t\t\tif ( !this.isGravityOverridden && !attrs ) {\n\t\t\t\tlet node = nodeBefore;\n\n\t\t\t\twhile ( node && !attrs ) {\n\t\t\t\t\tnode = node.previousSibling;\n\t\t\t\t\tattrs = getAttrsIfCharacter( node );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 5. If not found, try to find the first character on the right, that is in the same node.\n\t\t\tif ( !attrs ) {\n\t\t\t\tlet node = nodeAfter;\n\n\t\t\t\twhile ( node && !attrs ) {\n\t\t\t\t\tnode = node.nextSibling;\n\t\t\t\t\tattrs = getAttrsIfCharacter( node );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 6. If not found, selection should retrieve attributes from parent.\n\t\t\tif ( !attrs ) {\n\t\t\t\tattrs = this._getStoredAttributes();\n\t\t\t}\n\t\t}\n\n\t\treturn attrs;\n\t}\n\n\t// Fixes a selection range after it ends up in graveyard root.\n\t//\n\t// @private\n\t// @param {module:engine/model/liverange~LiveRange} liveRange The range from selection, that ended up in the graveyard root.\n\t// @param {module:engine/model/position~Position} removedRangeStart Start position of a range which was removed.\n\t_fixGraveyardSelection( liveRange, removedRangeStart ) {\n\t\t// The start of the removed range is the closest position to the `liveRange` - the original selection range.\n\t\t// This is a good candidate for a fixed selection range.\n\t\tconst positionCandidate = removedRangeStart.clone();\n\n\t\t// Find a range that is a correct selection range and is closest to the start of removed range.\n\t\tconst selectionRange = this._model.schema.getNearestSelectionRange( positionCandidate );\n\n\t\t// Remove the old selection range before preparing and adding new selection range. This order is important,\n\t\t// because new range, in some cases, may intersect with old range (it depends on `getNearestSelectionRange()` result).\n\t\tconst index = this._ranges.indexOf( liveRange );\n\t\tthis._ranges.splice( index, 1 );\n\t\tliveRange.detach();\n\n\t\t// If nearest valid selection range has been found - add it in the place of old range.\n\t\tif ( selectionRange ) {\n\t\t\t// Check the range, convert it to live range, bind events, etc.\n\t\t\tconst newRange = this._prepareRange( selectionRange );\n\n\t\t\t// Add new range in the place of old range.\n\t\t\tthis._ranges.splice( index, 0, newRange );\n\t\t}\n\t\t// If nearest valid selection range cannot be found - just removing the old range is fine.\n\t}\n}\n\n// Helper function for {@link module:engine/model/liveselection~LiveSelection#_updateAttributes}.\n//\n// It takes model item, checks whether it is a text node (or text proxy) and, if so, returns it's attributes. If not, returns `null`.\n//\n// @param {module:engine/model/item~Item|null} node\n// @returns {Boolean}\nfunction getAttrsIfCharacter( node ) {\n\tif ( node instanceof TextProxy || node instanceof Text ) {\n\t\treturn node.getAttributes();\n\t}\n\n\treturn null;\n}\n\n// Removes selection attributes from element which is not empty anymore.\n//\n// @private\n// @param {module:engine/model/model~Model} model\n// @param {module:engine/model/batch~Batch} batch\nfunction clearAttributesStoredInElement( model, batch ) {\n\tconst differ = model.document.differ;\n\n\tfor ( const entry of differ.getChanges() ) {\n\t\tif ( entry.type != 'insert' ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst changeParent = entry.position.parent;\n\t\tconst isNoLongerEmpty = entry.length === changeParent.maxOffset;\n\n\t\tif ( isNoLongerEmpty ) {\n\t\t\tmodel.enqueueChange( batch, writer => {\n\t\t\t\tconst storedAttributes = Array.from( changeParent.getAttributeKeys() )\n\t\t\t\t\t.filter( key => key.startsWith( storePrefix ) );\n\n\t\t\t\tfor ( const key of storedAttributes ) {\n\t\t\t\t\twriter.removeAttribute( key, changeParent );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/conversionhelpers\n */\n\n/**\n * Base class for conversion helpers.\n */\nexport default class ConversionHelpers {\n\t/**\n\t * Creates a conversion helpers instance.\n\t *\n\t * @param {Array.} dispatchers\n\t */\n\tconstructor( dispatchers ) {\n\t\tthis._dispatchers = dispatchers;\n\t}\n\n\t/**\n\t * Registers a conversion helper.\n\t *\n\t * **Note**: See full usage example in the `{@link module:engine/conversion/conversion~Conversion#for conversion.for()}`\n\t * method description.\n\t *\n\t * @param {Function} conversionHelper The function to be called on event.\n\t * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}\n\t */\n\tadd( conversionHelper ) {\n\t\tfor ( const dispatcher of this._dispatchers ) {\n\t\t\tconversionHelper( dispatcher );\n\t\t}\n\n\t\treturn this;\n\t}\n}\n","import baseClone from './_baseClone.js';\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nexport default cloneDeep;\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport ModelRange from '../model/range';\nimport ModelSelection from '../model/selection';\nimport ModelElement from '../model/element';\n\nimport ViewAttributeElement from '../view/attributeelement';\nimport DocumentSelection from '../model/documentselection';\nimport ConversionHelpers from './conversionhelpers';\n\nimport log from '@ckeditor/ckeditor5-utils/src/log';\nimport { cloneDeep } from 'lodash-es';\n\n/**\n * Contains downcast (model-to-view) converters for {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}.\n *\n * @module engine/conversion/downcasthelpers\n */\n\n/**\n * Downcast conversion helper functions.\n *\n * @extends module:engine/conversion/conversionhelpers~ConversionHelpers\n */\nexport default class DowncastHelpers extends ConversionHelpers {\n\t/**\n\t * Model element to view element conversion helper.\n\t *\n\t * This conversion results in creating a view element. For example, model `Foo` becomes `

Foo

` in the view.\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).elementToElement( {\n\t *\t\t\tmodel: 'paragraph',\n\t *\t\t\tview: 'p'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).elementToElement( {\n\t *\t\t\tmodel: 'paragraph',\n\t *\t\t\tview: 'div',\n\t *\t\t\tconverterPriority: 'high'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).elementToElement( {\n\t *\t\t\tmodel: 'fancyParagraph',\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'p',\n\t *\t\t\t\tclasses: 'fancy'\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).elementToElement( {\n\t *\t\t\tmodel: 'heading',\n\t *\t\t\tview: ( modelElement, viewWriter ) => {\n\t *\t\t\t\treturn viewWriter.createContainerElement( 'h' + modelElement.getAttribute( 'level' ) )\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #elementToElement\n\t * @param {Object} config Conversion configuration.\n\t * @param {String} config.model The name of the model element to convert.\n\t * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function\n\t * that takes the model element and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}\n\t * as parameters and returns a view container element.\n\t * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}\n\t */\n\telementToElement( config ) {\n\t\treturn this.add( downcastElementToElement( config ) );\n\t}\n\n\t/**\n\t * Model attribute to view element conversion helper.\n\t *\n\t * This conversion results in wrapping view nodes with a view attribute element. For example, a model text node with\n\t * `\"Foo\"` as data and the `bold` attribute becomes `Foo` in the view.\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToElement( {\n\t *\t\t\tmodel: 'bold',\n\t *\t\t\tview: 'strong'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToElement( {\n\t *\t\t\tmodel: 'bold',\n\t *\t\t\tview: 'b',\n\t *\t\t\tconverterPriority: 'high'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToElement( {\n\t *\t\t\tmodel: 'invert',\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'span',\n\t *\t\t\t\tclasses: [ 'font-light', 'bg-dark' ]\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToElement( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'fontSize',\n\t *\t\t\t\tvalues: [ 'big', 'small' ]\n\t *\t\t\t},\n\t *\t\t\tview: {\n\t *\t\t\t\tbig: {\n\t *\t\t\t\t\tname: 'span',\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'font-size': '1.2em'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t},\n\t *\t\t\t\tsmall: {\n\t *\t\t\t\t\tname: 'span',\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'font-size': '0.8em'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToElement( {\n\t *\t\t\tmodel: 'bold',\n\t *\t\t\tview: ( modelAttributeValue, viewWriter ) => {\n\t *\t\t\t\treturn viewWriter.createAttributeElement( 'span', {\n\t *\t\t\t\t\tstyle: 'font-weight:' + modelAttributeValue\n\t *\t\t\t\t} );\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToElement( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'color',\n\t *\t\t\t\tname: '$text'\n\t *\t\t\t},\n\t *\t\t\tview: ( modelAttributeValue, viewWriter ) => {\n\t *\t\t\t\treturn viewWriter.createAttributeElement( 'span', {\n\t *\t\t\t\t\tstyle: 'color:' + modelAttributeValue\n\t *\t\t\t\t} );\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #attributeToElement\n\t * @param {Object} config Conversion configuration.\n\t * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array\n\t * of `String`s with possible values if the model attribute is an enumerable.\n\t * @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function\n\t * that takes the model attribute value and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}\n\t * as parameters and returns a view attribute element. If `config.model.values` is\n\t * given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.\n\t * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n\t * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}\n\t */\n\tattributeToElement( config ) {\n\t\treturn this.add( downcastAttributeToElement( config ) );\n\t}\n\n\t/**\n\t * Model attribute to view attribute conversion helper.\n\t *\n\t * This conversion results in adding an attribute to a view node, basing on an attribute from a model node. For example,\n\t * `` is converted to ``.\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToAttribute( {\n\t *\t\t\tmodel: 'source',\n\t *\t\t\tview: 'src'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToAttribute( {\n\t *\t\t\tmodel: 'source',\n\t *\t\t\tview: 'href',\n\t *\t\t\tconverterPriority: 'high'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToAttribute( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tname: 'image',\n\t *\t\t\t\tkey: 'source'\n\t *\t\t\t},\n\t *\t\t\tview: 'src'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToAttribute( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tname: 'styled',\n\t *\t\t\t\tvalues: [ 'dark', 'light' ]\n\t *\t\t\t},\n\t *\t\t\tview: {\n\t *\t\t\t\tdark: {\n\t *\t\t\t\t\tkey: 'class',\n\t *\t\t\t\t\tvalue: [ 'styled', 'styled-dark' ]\n\t *\t\t\t\t},\n\t *\t\t\t\tlight: {\n\t *\t\t\t\t\tkey: 'class',\n\t *\t\t\t\t\tvalue: [ 'styled', 'styled-light' ]\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).attributeToAttribute( {\n\t *\t\t\tmodel: 'styled',\n\t *\t\t\tview: modelAttributeValue => ( { key: 'class', value: 'styled-' + modelAttributeValue } )\n\t *\t\t} );\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #attributeToAttribute\n\t * @param {Object} config Conversion configuration.\n\t * @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing\n\t * the attribute key, possible values and, optionally, an element name to convert from.\n\t * @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes\n\t * the model attribute value and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an\n\t * array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.\n\t * If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to\n\t * `{ key, value }` objects or a functions.\n\t * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n\t * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}\n\t */\n\tattributeToAttribute( config ) {\n\t\treturn this.add( downcastAttributeToAttribute( config ) );\n\t}\n\n\t/**\n\t * Model marker to view element conversion helper.\n\t *\n\t * This conversion results in creating a view element on the boundaries of the converted marker. If the converted marker\n\t * is collapsed, only one element is created. For example, model marker set like this: `F[oo b]ar`\n\t * becomes `

Foo bar

` in the view.\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).markerToElement( {\n\t *\t\t\tmodel: 'search',\n\t *\t\t\tview: 'marker-search'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).markerToElement( {\n\t *\t\t\tmodel: 'search',\n\t *\t\t\tview: 'search-result',\n\t *\t\t\tconverterPriority: 'high'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).markerToElement( {\n\t *\t\t\tmodel: 'search',\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'span',\n\t *\t\t\t\tattributes: {\n\t *\t\t\t\t\t'data-marker': 'search'\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).markerToElement( {\n\t *\t\t\tmodel: 'search',\n\t *\t\t\tview: ( markerData, viewWriter ) => {\n\t *\t\t\t\treturn viewWriter.createUIElement( 'span', {\n\t *\t\t\t\t\t'data-marker': 'search',\n\t *\t\t\t\t\t'data-start': markerData.isOpening\n\t *\t\t\t\t} );\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * If a function is passed as the `config.view` parameter, it will be used to generate both boundary elements. The function\n\t * receives the `data` object as a parameter and should return an instance of the\n\t * {@link module:engine/view/uielement~UIElement view UI element}. The `data` object and\n\t * {@link module:engine/conversion/downcastdispatcher~DowncastConversionApi `conversionApi`} are passed from\n\t * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}. Additionally,\n\t * the `data.isOpening` parameter is passed, which is set to `true` for the marker start boundary element, and `false` to\n\t * the marker end boundary element.\n\t *\n\t * This kind of conversion is useful for saving data into the database, so it should be used in the data conversion pipeline.\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #markerToElement\n\t * @param {Object} config Conversion configuration.\n\t * @param {String} config.model The name of the model marker (or model marker group) to convert.\n\t * @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function\n\t * that takes the model marker data as a parameter and returns a view UI element.\n\t * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n\t * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}\n\t */\n\tmarkerToElement( config ) {\n\t\treturn this.add( downcastMarkerToElement( config ) );\n\t}\n\n\t/**\n\t * Model marker to highlight conversion helper.\n\t *\n\t * This conversion results in creating a highlight on view nodes. For this kind of conversion,\n\t * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor} should be provided.\n\t *\n\t * For text nodes, a `` {@link module:engine/view/attributeelement~AttributeElement} is created and it wraps all text nodes\n\t * in the converted marker range. For example, a model marker set like this: `F[oo b]ar` becomes\n\t * `

Foo bar

` in the view.\n\t *\n\t * {@link module:engine/view/containerelement~ContainerElement} may provide a custom way of handling highlight. Most often,\n\t * the element itself is given classes and attributes described in the highlight descriptor (instead of being wrapped in ``).\n\t * For example, a model marker set like this: `[]` becomes ``\n\t * in the view.\n\t *\n\t * For container elements, the conversion is two-step. While the converter processes the highlight descriptor and passes it\n\t * to a container element, it is the container element instance itself that applies values from the highlight descriptor.\n\t * So, in a sense, the converter takes care of stating what should be applied on what, while the element decides how to apply that.\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).markerToHighlight( { model: 'comment', view: { classes: 'comment' } } );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).markerToHighlight( {\n\t *\t\t\tmodel: 'comment',\n\t *\t\t\tview: { classes: 'new-comment' },\n\t *\t\t\tconverterPriority: 'high'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'downcast' ).markerToHighlight( {\n\t *\t\t\tmodel: 'comment',\n\t *\t\t\tview: data => {\n\t *\t\t\t\t// Assuming that the marker name is in a form of comment:commentType.\n\t *\t\t\t\tconst commentType = data.markerName.split( ':' )[ 1 ];\n\t *\n\t *\t\t\t\treturn {\n\t *\t\t\t\t\tclasses: [ 'comment', 'comment-' + commentType ]\n\t *\t\t\t\t};\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * If a function is passed as the `config.view` parameter, it will be used to generate the highlight descriptor. The function\n\t * receives the `data` object as a parameter and should return a\n\t * {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor}.\n\t * The `data` object properties are passed from {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker}.\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #markerToHighlight\n\t * @param {Object} config Conversion configuration.\n\t * @param {String} config.model The name of the model marker (or model marker group) to convert.\n\t * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor\n\t * that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.\n\t * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n\t * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers}\n\t */\n\tmarkerToHighlight( config ) {\n\t\treturn this.add( downcastMarkerToHighlight( config ) );\n\t}\n}\n\n/**\n * Function factory that creates a default downcast converter for text insertion changes.\n *\n * The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n *\n *\t\tmodelDispatcher.on( 'insert:$text', insertText() );\n *\n * @returns {Function} Insert text event converter.\n */\nexport function insertText() {\n\treturn ( evt, data, conversionApi ) => {\n\t\tif ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewWriter = conversionApi.writer;\n\t\tconst viewPosition = conversionApi.mapper.toViewPosition( data.range.start );\n\t\tconst viewText = viewWriter.createText( data.item.data );\n\n\t\tviewWriter.insert( viewPosition, viewText );\n\t};\n}\n\n/**\n * Function factory that creates a default downcast converter for node remove changes.\n *\n *\t\tmodelDispatcher.on( 'remove', remove() );\n *\n * @returns {Function} Remove event converter.\n */\nexport function remove() {\n\treturn ( evt, data, conversionApi ) => {\n\t\t// Find view range start position by mapping model position at which the remove happened.\n\t\tconst viewStart = conversionApi.mapper.toViewPosition( data.position );\n\n\t\tconst modelEnd = data.position.getShiftedBy( data.length );\n\t\tconst viewEnd = conversionApi.mapper.toViewPosition( modelEnd, { isPhantom: true } );\n\n\t\tconst viewRange = conversionApi.writer.createRange( viewStart, viewEnd );\n\n\t\t// Trim the range to remove in case some UI elements are on the view range boundaries.\n\t\tconst removed = conversionApi.writer.remove( viewRange.getTrimmed() );\n\n\t\t// After the range is removed, unbind all view elements from the model.\n\t\t// Range inside view document fragment is used to unbind deeply.\n\t\tfor ( const child of conversionApi.writer.createRangeIn( removed ).getItems() ) {\n\t\t\tconversionApi.mapper.unbindViewElement( child );\n\t\t}\n\t};\n}\n\n/**\n * Creates a `` {@link module:engine/view/attributeelement~AttributeElement view attribute element} from the information\n * provided by the {@link module:engine/conversion/downcasthelpers~HighlightDescriptor highlight descriptor} object. If a priority\n * is not provided in the descriptor, the default priority will be used.\n *\n * @param {module:engine/conversion/downcasthelpers~HighlightDescriptor} descriptor\n * @returns {module:engine/view/attributeelement~AttributeElement}\n */\nexport function createViewElementFromHighlightDescriptor( descriptor ) {\n\tconst viewElement = new ViewAttributeElement( 'span', descriptor.attributes );\n\n\tif ( descriptor.classes ) {\n\t\tviewElement._addClass( descriptor.classes );\n\t}\n\n\tif ( descriptor.priority ) {\n\t\tviewElement._priority = descriptor.priority;\n\t}\n\n\tviewElement._id = descriptor.id;\n\n\treturn viewElement;\n}\n\n/**\n * Function factory that creates a converter which converts a non-collapsed {@link module:engine/model/selection~Selection model selection}\n * to a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate\n * value from the `consumable` object and maps model positions from the selection to view positions.\n *\n *\t\tmodelDispatcher.on( 'selection', convertRangeSelection() );\n *\n * @returns {Function} Selection converter.\n */\nexport function convertRangeSelection() {\n\treturn ( evt, data, conversionApi ) => {\n\t\tconst selection = data.selection;\n\n\t\tif ( selection.isCollapsed ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !conversionApi.consumable.consume( selection, 'selection' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewRanges = [];\n\n\t\tfor ( const range of selection.getRanges() ) {\n\t\t\tconst viewRange = conversionApi.mapper.toViewRange( range );\n\t\t\tviewRanges.push( viewRange );\n\t\t}\n\n\t\tconversionApi.writer.setSelection( viewRanges, { backward: selection.isBackward } );\n\t};\n}\n\n/**\n * Function factory that creates a converter which converts a collapsed {@link module:engine/model/selection~Selection model selection} to\n * a {@link module:engine/view/documentselection~DocumentSelection view selection}. The converter consumes appropriate\n * value from the `consumable` object, maps the model selection position to the view position and breaks\n * {@link module:engine/view/attributeelement~AttributeElement attribute elements} at the selection position.\n *\n *\t\tmodelDispatcher.on( 'selection', convertCollapsedSelection() );\n *\n * An example of the view state before and after converting the collapsed selection:\n *\n *\t\t

f^oobar

\n *\t\t->

f^oobar

\n *\n * By breaking attribute elements like ``, the selection is in a correct element. Then, when the selection attribute is\n * converted, broken attributes might be merged again, or the position where the selection is may be wrapped\n * with different, appropriate attribute elements.\n *\n * See also {@link module:engine/conversion/downcasthelpers~clearAttributes} which does a clean-up\n * by merging attributes.\n *\n * @returns {Function} Selection converter.\n */\nexport function convertCollapsedSelection() {\n\treturn ( evt, data, conversionApi ) => {\n\t\tconst selection = data.selection;\n\n\t\tif ( !selection.isCollapsed ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !conversionApi.consumable.consume( selection, 'selection' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewWriter = conversionApi.writer;\n\t\tconst modelPosition = selection.getFirstPosition();\n\t\tconst viewPosition = conversionApi.mapper.toViewPosition( modelPosition );\n\t\tconst brokenPosition = viewWriter.breakAttributes( viewPosition );\n\n\t\tviewWriter.setSelection( brokenPosition );\n\t};\n}\n\n/**\n * Function factory that creates a converter which clears artifacts after the previous\n * {@link module:engine/model/selection~Selection model selection} conversion. It removes all empty\n * {@link module:engine/view/attributeelement~AttributeElement view attribute elements} and merges sibling attributes at all start and end\n * positions of all ranges.\n *\n *\t\t

^

\n *\t\t->

^

\n *\n *\t\t

foo^barbar

\n *\t\t->

foo^barbar

\n *\n *\t\t

foo^barbar

\n *\t\t->

foo^barbar

\n *\n * This listener should be assigned before any converter for the new selection:\n *\n *\t\tmodelDispatcher.on( 'selection', clearAttributes() );\n *\n * See {@link module:engine/conversion/downcasthelpers~convertCollapsedSelection}\n * which does the opposite by breaking attributes in the selection position.\n *\n * @returns {Function} Selection converter.\n */\nexport function clearAttributes() {\n\treturn ( evt, data, conversionApi ) => {\n\t\tconst viewWriter = conversionApi.writer;\n\t\tconst viewSelection = viewWriter.document.selection;\n\n\t\tfor ( const range of viewSelection.getRanges() ) {\n\t\t\t// Not collapsed selection should not have artifacts.\n\t\t\tif ( range.isCollapsed ) {\n\t\t\t\t// Position might be in the node removed by the view writer.\n\t\t\t\tif ( range.end.parent.document ) {\n\t\t\t\t\tconversionApi.writer.mergeAttributes( range.start );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tviewWriter.setSelection( null );\n\t};\n}\n\n/**\n * Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.\n * It can also be used to convert selection attributes. In that case, an empty attribute element will be created and the\n * selection will be put inside it.\n *\n * Attributes from the model are converted to a view element that will be wrapping these view nodes that are bound to\n * model elements having the given attribute. This is useful for attributes like `bold` that may be set on text nodes in the model\n * but are represented as an element in the view:\n *\n *\t\t[paragraph] MODEL ====> VIEW

\n *\t\t\t|- a {bold: true} |- \n *\t\t\t|- b {bold: true} | |- ab\n *\t\t\t|- c |- c\n *\n * Passed `Function` will be provided with the attribute value and then all the parameters of the\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:attribute `attribute` event}.\n * It is expected that the function returns an {@link module:engine/view/element~Element}.\n * The result of the function will be the wrapping element.\n * When the provided `Function` does not return any element, no conversion will take place.\n *\n * The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n *\n *\t\tmodelDispatcher.on( 'attribute:bold', wrap( ( modelAttributeValue, viewWriter ) => {\n *\t\t\treturn viewWriter.createAttributeElement( 'strong' );\n *\t\t} );\n *\n * @protected\n * @param {Function} elementCreator Function returning a view element that will be used for wrapping.\n * @returns {Function} Set/change attribute converter.\n */\nexport function wrap( elementCreator ) {\n\treturn ( evt, data, conversionApi ) => {\n\t\t// Recreate current wrapping node. It will be used to unwrap view range if the attribute value has changed\n\t\t// or the attribute was removed.\n\t\tconst oldViewElement = elementCreator( data.attributeOldValue, conversionApi.writer );\n\n\t\t// Create node to wrap with.\n\t\tconst newViewElement = elementCreator( data.attributeNewValue, conversionApi.writer );\n\n\t\tif ( !oldViewElement && !newViewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !conversionApi.consumable.consume( data.item, evt.name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewWriter = conversionApi.writer;\n\t\tconst viewSelection = viewWriter.document.selection;\n\n\t\tif ( data.item instanceof ModelSelection || data.item instanceof DocumentSelection ) {\n\t\t\t// Selection attribute conversion.\n\t\t\tviewWriter.wrap( viewSelection.getFirstRange(), newViewElement );\n\t\t} else {\n\t\t\t// Node attribute conversion.\n\t\t\tlet viewRange = conversionApi.mapper.toViewRange( data.range );\n\n\t\t\t// First, unwrap the range from current wrapper.\n\t\t\tif ( data.attributeOldValue !== null && oldViewElement ) {\n\t\t\t\tviewRange = viewWriter.unwrap( viewRange, oldViewElement );\n\t\t\t}\n\n\t\t\tif ( data.attributeNewValue !== null && newViewElement ) {\n\t\t\t\tviewWriter.wrap( viewRange, newViewElement );\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Function factory that creates a converter which converts node insertion changes from the model to the view.\n * The function passed will be provided with all the parameters of the dispatcher's\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:insert `insert` event}.\n * It is expected that the function returns an {@link module:engine/view/element~Element}.\n * The result of the function will be inserted into the view.\n *\n * The converter automatically consumes the corresponding value from the consumables list, stops the event (see\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}) and binds the model and view elements.\n *\n *\t\tdowncastDispatcher.on(\n *\t\t\t'insert:myElem',\n *\t\t\tinsertElement( ( modelItem, viewWriter ) => {\n *\t\t\t\tconst text = viewWriter.createText( 'myText' );\n *\t\t\t\tconst myElem = viewWriter.createElement( 'myElem', { myAttr: 'my-' + modelItem.getAttribute( 'myAttr' ) }, text );\n *\n *\t\t\t\t// Do something fancy with `myElem` using `modelItem` or other parameters.\n *\n *\t\t\t\treturn myElem;\n *\t\t\t}\n *\t\t) );\n *\n * @protected\n * @param {Function} elementCreator Function returning a view element, which will be inserted.\n * @returns {Function} Insert element event converter.\n */\nexport function insertElement( elementCreator ) {\n\treturn ( evt, data, conversionApi ) => {\n\t\tconst viewElement = elementCreator( data.item, conversionApi.writer );\n\n\t\tif ( !viewElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !conversionApi.consumable.consume( data.item, 'insert' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewPosition = conversionApi.mapper.toViewPosition( data.range.start );\n\n\t\tconversionApi.mapper.bindElements( data.item, viewElement );\n\t\tconversionApi.writer.insert( viewPosition, viewElement );\n\t};\n}\n\n/**\n * Function factory that creates a converter which converts marker adding change to the\n * {@link module:engine/view/uielement~UIElement view UI element}.\n *\n * The view UI element that will be added to the view depends on the passed parameter. See {@link ~insertElement}.\n * In case of a non-collapsed range, the UI element will not wrap nodes but separate elements will be placed at the beginning\n * and at the end of the range.\n *\n * This converter binds created UI elements with the marker name using {@link module:engine/conversion/mapper~Mapper#bindElementToMarker}.\n *\n * @protected\n * @param {module:engine/view/uielement~UIElement|Function} elementCreator A view UI element or a function returning the view element\n * that will be inserted.\n * @returns {Function} Insert element event converter.\n */\nexport function insertUIElement( elementCreator ) {\n\treturn ( evt, data, conversionApi ) => {\n\t\t// Create two view elements. One will be inserted at the beginning of marker, one at the end.\n\t\t// If marker is collapsed, only \"opening\" element will be inserted.\n\t\tdata.isOpening = true;\n\t\tconst viewStartElement = elementCreator( data, conversionApi.writer );\n\n\t\tdata.isOpening = false;\n\t\tconst viewEndElement = elementCreator( data, conversionApi.writer );\n\n\t\tif ( !viewStartElement || !viewEndElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst markerRange = data.markerRange;\n\n\t\t// Marker that is collapsed has consumable build differently that non-collapsed one.\n\t\t// For more information see `addMarker` event description.\n\t\t// If marker's range is collapsed - check if it can be consumed.\n\t\tif ( markerRange.isCollapsed && !conversionApi.consumable.consume( markerRange, evt.name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If marker's range is not collapsed - consume all items inside.\n\t\tfor ( const value of markerRange ) {\n\t\t\tif ( !conversionApi.consumable.consume( value.item, evt.name ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst mapper = conversionApi.mapper;\n\t\tconst viewWriter = conversionApi.writer;\n\n\t\t// Add \"opening\" element.\n\t\tviewWriter.insert( mapper.toViewPosition( markerRange.start ), viewStartElement );\n\t\tconversionApi.mapper.bindElementToMarker( viewStartElement, data.markerName );\n\n\t\t// Add \"closing\" element only if range is not collapsed.\n\t\tif ( !markerRange.isCollapsed ) {\n\t\t\tviewWriter.insert( mapper.toViewPosition( markerRange.end ), viewEndElement );\n\t\t\tconversionApi.mapper.bindElementToMarker( viewEndElement, data.markerName );\n\t\t}\n\n\t\tevt.stop();\n\t};\n}\n\n// Function factory that returns a default downcast converter for removing a {@link module:engine/view/uielement~UIElement UI element}\n// basing on marker remove change.\n//\n// This converter unbinds elements from the marker name.\n//\n// @returns {Function} Removed UI element converter.\nfunction removeUIElement() {\n\treturn ( evt, data, conversionApi ) => {\n\t\tconst elements = conversionApi.mapper.markerNameToElements( data.markerName );\n\n\t\tif ( !elements ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconversionApi.mapper.unbindElementsFromMarkerName( data.markerName );\n\n\t\tfor ( const element of elements ) {\n\t\t\tconversionApi.writer.clear( conversionApi.writer.createRangeOn( element ), element );\n\t\t}\n\n\t\tconversionApi.writer.clearClonedElementsGroup( data.markerName );\n\n\t\tevt.stop();\n\t};\n}\n\n// Function factory that creates a converter which converts set/change/remove attribute changes from the model to the view.\n//\n// Attributes from the model are converted to the view element attributes in the view. You may provide a custom function to generate\n// a key-value attribute pair to add/change/remove. If not provided, model attributes will be converted to view element\n// attributes on a one-to-one basis.\n//\n// *Note:** The provided attribute creator should always return the same `key` for a given attribute from the model.\n//\n// The converter automatically consumes the corresponding value from the consumables list and stops the event (see\n// {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher}).\n//\n//\t\tmodelDispatcher.on( 'attribute:customAttr:myElem', changeAttribute( ( value, data ) => {\n//\t\t\t// Change attribute key from `customAttr` to `class` in the view.\n//\t\t\tconst key = 'class';\n//\t\t\tlet value = data.attributeNewValue;\n//\n//\t\t\t// Force attribute value to 'empty' if the model element is empty.\n//\t\t\tif ( data.item.childCount === 0 ) {\n//\t\t\t\tvalue = 'empty';\n//\t\t\t}\n//\n//\t\t\t// Return the key-value pair.\n//\t\t\treturn { key, value };\n//\t\t} ) );\n//\n// @param {Function} [attributeCreator] Function returning an object with two properties: `key` and `value`, which\n// represent the attribute key and attribute value to be set on a {@link module:engine/view/element~Element view element}.\n// The function is passed the model attribute value as the first parameter and additional data about the change as the second parameter.\n// @returns {Function} Set/change attribute converter.\nfunction changeAttribute( attributeCreator ) {\n\treturn ( evt, data, conversionApi ) => {\n\t\tconst oldAttribute = attributeCreator( data.attributeOldValue, data );\n\t\tconst newAttribute = attributeCreator( data.attributeNewValue, data );\n\n\t\tif ( !oldAttribute && !newAttribute ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !conversionApi.consumable.consume( data.item, evt.name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewElement = conversionApi.mapper.toViewElement( data.item );\n\t\tconst viewWriter = conversionApi.writer;\n\n\t\t// If model item cannot be mapped to a view element, it means item is not an `Element` instance but a `TextProxy` node.\n\t\t// Only elements can have attributes in a view so do not proceed for anything else (#1587).\n\t\tif ( !viewElement ) {\n\t\t\t/**\n\t\t\t * This error occurs when a {@link module:engine/model/textproxy~TextProxy text node's} attribute is to be downcasted\n\t\t\t * by {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `Attribute to Attribute converter`}.\n\t\t\t * In most cases it is caused by converters misconfiguration when only \"generic\" converter is defined:\n\t\t\t *\n\t\t\t *\t\teditor.conversion.for( 'downcast' ).attributeToAttribute( {\n\t\t\t *\t\t\tmodel: 'attribute-name',\n\t\t\t *\t\t\tview: 'attribute-name'\n\t\t\t *\t\t} ) );\n\t\t\t *\n\t\t\t * and given attribute is used on text node, for example:\n\t\t\t *\n\t\t\t *\t\tmodel.change( writer => {\n\t\t\t *\t\t\twriter.insertText( 'Foo', { 'attribute-name': 'bar' }, parent, 0 );\n\t\t\t *\t\t} );\n\t\t\t *\n\t\t\t * In such cases, to convert the same attribute for both {@link module:engine/model/element~Element}\n\t\t\t * and {@link module:engine/model/textproxy~TextProxy `Text`} nodes, text specific\n\t\t\t * {@link module:engine/conversion/conversion~Conversion#attributeToElement `Attribute to Element converter`}\n\t\t\t * with higher {@link module:utils/priorities~PriorityString priority} must also be defined:\n\t\t\t *\n\t\t\t *\t\teditor.conversion.for( 'downcast' ).attributeToElement( {\n\t\t\t *\t\t\tmodel: {\n\t\t\t *\t\t\t\tkey: 'attribute-name',\n\t\t\t *\t\t\t\tname: '$text'\n\t\t\t *\t\t\t},\n\t\t\t *\t\t\tview: ( value, writer ) => {\n\t\t\t *\t\t\t\treturn writer.createAttributeElement( 'span', { 'attribute-name': value } );\n\t\t\t *\t\t\t},\n\t\t\t *\t\t\tconverterPriority: 'high'\n\t\t\t *\t\t} ) );\n\t\t\t *\n\t\t\t * @error conversion-attribute-to-attribute-on-text\n\t\t\t */\n\t\t\tlog.warn( 'conversion-attribute-to-attribute-on-text: ' +\n\t\t\t\t'Trying to convert text node\\'s attribute with attribute-to-attribute converter.' );\n\n\t\t\treturn;\n\t\t}\n\n\t\t// First remove the old attribute if there was one.\n\t\tif ( data.attributeOldValue !== null && oldAttribute ) {\n\t\t\tif ( oldAttribute.key == 'class' ) {\n\t\t\t\tconst classes = Array.isArray( oldAttribute.value ) ? oldAttribute.value : [ oldAttribute.value ];\n\n\t\t\t\tfor ( const className of classes ) {\n\t\t\t\t\tviewWriter.removeClass( className, viewElement );\n\t\t\t\t}\n\t\t\t} else if ( oldAttribute.key == 'style' ) {\n\t\t\t\tconst keys = Object.keys( oldAttribute.value );\n\n\t\t\t\tfor ( const key of keys ) {\n\t\t\t\t\tviewWriter.removeStyle( key, viewElement );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tviewWriter.removeAttribute( oldAttribute.key, viewElement );\n\t\t\t}\n\t\t}\n\n\t\t// Then set the new attribute.\n\t\tif ( data.attributeNewValue !== null && newAttribute ) {\n\t\t\tif ( newAttribute.key == 'class' ) {\n\t\t\t\tconst classes = Array.isArray( newAttribute.value ) ? newAttribute.value : [ newAttribute.value ];\n\n\t\t\t\tfor ( const className of classes ) {\n\t\t\t\t\tviewWriter.addClass( className, viewElement );\n\t\t\t\t}\n\t\t\t} else if ( newAttribute.key == 'style' ) {\n\t\t\t\tconst keys = Object.keys( newAttribute.value );\n\n\t\t\t\tfor ( const key of keys ) {\n\t\t\t\t\tviewWriter.setStyle( key, newAttribute.value[ key ], viewElement );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tviewWriter.setAttribute( newAttribute.key, newAttribute.value, viewElement );\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Function factory that creates a converter which converts the text inside marker's range. The converter wraps the text with\n// {@link module:engine/view/attributeelement~AttributeElement} created from the provided descriptor.\n// See {link module:engine/conversion/downcasthelpers~createViewElementFromHighlightDescriptor}.\n//\n// It can also be used to convert the selection that is inside a marker. In that case, an empty attribute element will be\n// created and the selection will be put inside it.\n//\n// If the highlight descriptor does not provide the `priority` property, `10` will be used.\n//\n// If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n//\n// This converter binds the created {@link module:engine/view/attributeelement~AttributeElement attribute elemens} with the marker name\n// using the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.\n//\n// @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor\n// @returns {Function}\nfunction highlightText( highlightDescriptor ) {\n\treturn ( evt, data, conversionApi ) => {\n\t\tif ( !data.item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !( data.item instanceof ModelSelection || data.item instanceof DocumentSelection ) && !data.item.is( 'textProxy' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );\n\n\t\tif ( !descriptor ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !conversionApi.consumable.consume( data.item, evt.name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewElement = createViewElementFromHighlightDescriptor( descriptor );\n\t\tconst viewWriter = conversionApi.writer;\n\t\tconst viewSelection = viewWriter.document.selection;\n\n\t\tif ( data.item instanceof ModelSelection || data.item instanceof DocumentSelection ) {\n\t\t\tviewWriter.wrap( viewSelection.getFirstRange(), viewElement, viewSelection );\n\t\t} else {\n\t\t\tconst viewRange = conversionApi.mapper.toViewRange( data.range );\n\t\t\tconst rangeAfterWrap = viewWriter.wrap( viewRange, viewElement );\n\n\t\t\tfor ( const element of rangeAfterWrap.getItems() ) {\n\t\t\t\tif ( element.is( 'attributeElement' ) && element.isSimilar( viewElement ) ) {\n\t\t\t\t\tconversionApi.mapper.bindElementToMarker( element, data.markerName );\n\n\t\t\t\t\t// One attribute element is enough, because all of them are bound together by the view writer.\n\t\t\t\t\t// Mapper uses this binding to get all the elements no matter how many of them are registered in the mapper.\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t};\n}\n\n// Converter function factory. It creates a function which applies the marker's highlight to an element inside the marker's range.\n//\n// The converter checks if an element has the `addHighlight` function stored as a\n// {@link module:engine/view/element~Element#_setCustomProperty custom property} and, if so, uses it to apply the highlight.\n// In such case the converter will consume all element's children, assuming that they were handled by the element itself.\n//\n// When the `addHighlight` custom property is not present, the element is not converted in any special way.\n// This means that converters will proceed to convert the element's child nodes.\n//\n// If the highlight descriptor does not provide the `priority` property, `10` will be used.\n//\n// If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n//\n// This converter binds altered {@link module:engine/view/containerelement~ContainerElement container elements} with the marker name using\n// the {@link module:engine/conversion/mapper~Mapper#bindElementToMarker} method.\n//\n// @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor\n// @returns {Function}\nfunction highlightElement( highlightDescriptor ) {\n\treturn ( evt, data, conversionApi ) => {\n\t\tif ( !data.item ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !( data.item instanceof ModelElement ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );\n\n\t\tif ( !descriptor ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( !conversionApi.consumable.test( data.item, evt.name ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst viewElement = conversionApi.mapper.toViewElement( data.item );\n\n\t\tif ( viewElement && viewElement.getCustomProperty( 'addHighlight' ) ) {\n\t\t\t// Consume element itself.\n\t\t\tconversionApi.consumable.consume( data.item, evt.name );\n\n\t\t\t// Consume all children nodes.\n\t\t\tfor ( const value of ModelRange._createIn( data.item ) ) {\n\t\t\t\tconversionApi.consumable.consume( value.item, evt.name );\n\t\t\t}\n\n\t\t\tviewElement.getCustomProperty( 'addHighlight' )( viewElement, descriptor, conversionApi.writer );\n\n\t\t\tconversionApi.mapper.bindElementToMarker( viewElement, data.markerName );\n\t\t}\n\t};\n}\n\n// Function factory that creates a converter which converts the removing model marker to the view.\n//\n// Both text nodes and elements are handled by this converter but they are handled a bit differently.\n//\n// Text nodes are unwrapped using the {@link module:engine/view/attributeelement~AttributeElement attribute element} created from the\n// provided highlight descriptor. See {link module:engine/conversion/downcasthelpers~HighlightDescriptor}.\n//\n// For elements, the converter checks if an element has the `removeHighlight` function stored as a\n// {@link module:engine/view/element~Element#_setCustomProperty custom property}. If so, it uses it to remove the highlight.\n// In such case, the children of that element will not be converted.\n//\n// When `removeHighlight` is not present, the element is not converted in any special way.\n// The converter will proceed to convert the element's child nodes instead.\n//\n// If the highlight descriptor does not provide the `priority` property, `10` will be used.\n//\n// If the highlight descriptor does not provide the `id` property, the name of the marker will be used.\n//\n// This converter unbinds elements from the marker name.\n//\n// @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} highlightDescriptor\n// @returns {Function}\nfunction removeHighlight( highlightDescriptor ) {\n\treturn ( evt, data, conversionApi ) => {\n\t\t// This conversion makes sense only for non-collapsed range.\n\t\tif ( data.markerRange.isCollapsed ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst descriptor = prepareDescriptor( highlightDescriptor, data, conversionApi );\n\n\t\tif ( !descriptor ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// View element that will be used to unwrap `AttributeElement`s.\n\t\tconst viewHighlightElement = createViewElementFromHighlightDescriptor( descriptor );\n\n\t\t// Get all elements bound with given marker name.\n\t\tconst elements = conversionApi.mapper.markerNameToElements( data.markerName );\n\n\t\tif ( !elements ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconversionApi.mapper.unbindElementsFromMarkerName( data.markerName );\n\n\t\tfor ( const element of elements ) {\n\t\t\tif ( element.is( 'attributeElement' ) ) {\n\t\t\t\tconversionApi.writer.unwrap( conversionApi.writer.createRangeOn( element ), viewHighlightElement );\n\t\t\t} else {\n\t\t\t\t// if element.is( 'containerElement' ).\n\t\t\t\telement.getCustomProperty( 'removeHighlight' )( element, descriptor.id, conversionApi.writer );\n\t\t\t}\n\t\t}\n\n\t\tconversionApi.writer.clearClonedElementsGroup( data.markerName );\n\n\t\tevt.stop();\n\t};\n}\n\n// Model element to view element conversion helper.\n//\n// See {@link ~DowncastHelpers#elementToElement `.elementToElement()` downcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {String} config.model The name of the model element to convert.\n// @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function\n// that takes the model element and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}\n// as parameters and returns a view container element.\n// @returns {Function} Conversion helper.\nfunction downcastElementToElement( config ) {\n\tconfig = cloneDeep( config );\n\n\tconfig.view = normalizeToElementConfig( config.view, 'container' );\n\n\treturn dispatcher => {\n\t\tdispatcher.on( 'insert:' + config.model, insertElement( config.view ), { priority: config.converterPriority || 'normal' } );\n\t};\n}\n\n// Model attribute to view element conversion helper.\n//\n// See {@link ~DowncastHelpers#attributeToElement `.attributeToElement()` downcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values }` object. `values` is an array\n// of `String`s with possible values if the model attribute is an enumerable.\n// @param {module:engine/view/elementdefinition~ElementDefinition|Function|Object} config.view A view element definition or a function\n// that takes the model attribute value and {@link module:engine/view/downcastwriter~DowncastWriter view downcast writer}\n// as parameters and returns a view attribute element. If `config.model.values` is\n// given, `config.view` should be an object assigning values from `config.model.values` to view element definitions or functions.\n// @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n// @returns {Function} Conversion helper.\nfunction downcastAttributeToElement( config ) {\n\tconfig = cloneDeep( config );\n\n\tconst modelKey = config.model.key ? config.model.key : config.model;\n\tlet eventName = 'attribute:' + modelKey;\n\n\tif ( config.model.name ) {\n\t\teventName += ':' + config.model.name;\n\t}\n\n\tif ( config.model.values ) {\n\t\tfor ( const modelValue of config.model.values ) {\n\t\t\tconfig.view[ modelValue ] = normalizeToElementConfig( config.view[ modelValue ], 'attribute' );\n\t\t}\n\t} else {\n\t\tconfig.view = normalizeToElementConfig( config.view, 'attribute' );\n\t}\n\n\tconst elementCreator = getFromAttributeCreator( config );\n\n\treturn dispatcher => {\n\t\tdispatcher.on( eventName, wrap( elementCreator ), { priority: config.converterPriority || 'normal' } );\n\t};\n}\n\n// Model attribute to view attribute conversion helper.\n//\n// See {@link ~DowncastHelpers#attributeToAttribute `.attributeToAttribute()` downcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {String|Object} config.model The key of the attribute to convert from or a `{ key, values, [ name ] }` object describing\n// the attribute key, possible values and, optionally, an element name to convert from.\n// @param {String|Object|Function} config.view A view attribute key, or a `{ key, value }` object or a function that takes\n// the model attribute value and returns a `{ key, value }` object. If `key` is `'class'`, `value` can be a `String` or an\n// array of `String`s. If `key` is `'style'`, `value` is an object with key-value pairs. In other cases, `value` is a `String`.\n// If `config.model.values` is set, `config.view` should be an object assigning values from `config.model.values` to\n// `{ key, value }` objects or a functions.\n// @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n// @returns {Function} Conversion helper.\nfunction downcastAttributeToAttribute( config ) {\n\tconfig = cloneDeep( config );\n\n\tconst modelKey = config.model.key ? config.model.key : config.model;\n\tlet eventName = 'attribute:' + modelKey;\n\n\tif ( config.model.name ) {\n\t\teventName += ':' + config.model.name;\n\t}\n\n\tif ( config.model.values ) {\n\t\tfor ( const modelValue of config.model.values ) {\n\t\t\tconfig.view[ modelValue ] = normalizeToAttributeConfig( config.view[ modelValue ] );\n\t\t}\n\t} else {\n\t\tconfig.view = normalizeToAttributeConfig( config.view );\n\t}\n\n\tconst elementCreator = getFromAttributeCreator( config );\n\n\treturn dispatcher => {\n\t\tdispatcher.on( eventName, changeAttribute( elementCreator ), { priority: config.converterPriority || 'normal' } );\n\t};\n}\n\n// Model marker to view element conversion helper.\n//\n// See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {String} config.model The name of the model marker (or model marker group) to convert.\n// @param {module:engine/view/elementdefinition~ElementDefinition|Function} config.view A view element definition or a function\n// that takes the model marker data as a parameter and returns a view UI element.\n// @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n// @returns {Function} Conversion helper.\nfunction downcastMarkerToElement( config ) {\n\tconfig = cloneDeep( config );\n\n\tconfig.view = normalizeToElementConfig( config.view, 'ui' );\n\n\treturn dispatcher => {\n\t\tdispatcher.on( 'addMarker:' + config.model, insertUIElement( config.view ), { priority: config.converterPriority || 'normal' } );\n\t\tdispatcher.on( 'removeMarker:' + config.model, removeUIElement( config.view ), { priority: config.converterPriority || 'normal' } );\n\t};\n}\n\n// Model marker to highlight conversion helper.\n//\n// See {@link ~DowncastHelpers#markerToElement `.markerToElement()` downcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {String} config.model The name of the model marker (or model marker group) to convert.\n// @param {module:engine/conversion/downcasthelpers~HighlightDescriptor|Function} config.view A highlight descriptor\n// that will be used for highlighting or a function that takes the model marker data as a parameter and returns a highlight descriptor.\n// @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n// @returns {Function} Conversion helper.\nfunction downcastMarkerToHighlight( config ) {\n\treturn dispatcher => {\n\t\tdispatcher.on( 'addMarker:' + config.model, highlightText( config.view ), { priority: config.converterPriority || 'normal' } );\n\t\tdispatcher.on( 'addMarker:' + config.model, highlightElement( config.view ), { priority: config.converterPriority || 'normal' } );\n\t\tdispatcher.on( 'removeMarker:' + config.model, removeHighlight( config.view ), { priority: config.converterPriority || 'normal' } );\n\t};\n}\n\n// Takes `config.view`, and if it is an {@link module:engine/view/elementdefinition~ElementDefinition}, converts it\n// to a function (because lower level converters accept only element creator functions).\n//\n// @param {module:engine/view/elementdefinition~ElementDefinition|Function} view View configuration.\n// @param {'container'|'attribute'|'ui'} viewElementType View element type to create.\n// @returns {Function} Element creator function to use in lower level converters.\nfunction normalizeToElementConfig( view, viewElementType ) {\n\tif ( typeof view == 'function' ) {\n\t\t// If `view` is already a function, don't do anything.\n\t\treturn view;\n\t}\n\n\treturn ( modelData, viewWriter ) => createViewElementFromDefinition( view, viewWriter, viewElementType );\n}\n\n// Creates a view element instance from the provided {@link module:engine/view/elementdefinition~ElementDefinition} and class.\n//\n// @param {module:engine/view/elementdefinition~ElementDefinition} viewElementDefinition\n// @param {module:engine/view/downcastwriter~DowncastWriter} viewWriter\n// @param {'container'|'attribute'|'ui'} viewElementType\n// @returns {module:engine/view/element~Element}\nfunction createViewElementFromDefinition( viewElementDefinition, viewWriter, viewElementType ) {\n\tif ( typeof viewElementDefinition == 'string' ) {\n\t\t// If `viewElementDefinition` is given as a `String`, normalize it to an object with `name` property.\n\t\tviewElementDefinition = { name: viewElementDefinition };\n\t}\n\n\tlet element;\n\tconst attributes = Object.assign( {}, viewElementDefinition.attributes );\n\n\tif ( viewElementType == 'container' ) {\n\t\telement = viewWriter.createContainerElement( viewElementDefinition.name, attributes );\n\t} else if ( viewElementType == 'attribute' ) {\n\t\tconst options = {\n\t\t\tpriority: viewElementDefinition.priority || ViewAttributeElement.DEFAULT_PRIORITY\n\t\t};\n\n\t\telement = viewWriter.createAttributeElement( viewElementDefinition.name, attributes, options );\n\t} else {\n\t\t// 'ui'.\n\t\telement = viewWriter.createUIElement( viewElementDefinition.name, attributes );\n\t}\n\n\tif ( viewElementDefinition.styles ) {\n\t\tconst keys = Object.keys( viewElementDefinition.styles );\n\n\t\tfor ( const key of keys ) {\n\t\t\tviewWriter.setStyle( key, viewElementDefinition.styles[ key ], element );\n\t\t}\n\t}\n\n\tif ( viewElementDefinition.classes ) {\n\t\tconst classes = viewElementDefinition.classes;\n\n\t\tif ( typeof classes == 'string' ) {\n\t\t\tviewWriter.addClass( classes, element );\n\t\t} else {\n\t\t\tfor ( const className of classes ) {\n\t\t\t\tviewWriter.addClass( className, element );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn element;\n}\n\nfunction getFromAttributeCreator( config ) {\n\tif ( config.model.values ) {\n\t\treturn ( modelAttributeValue, viewWriter ) => {\n\t\t\tconst view = config.view[ modelAttributeValue ];\n\n\t\t\tif ( view ) {\n\t\t\t\treturn view( modelAttributeValue, viewWriter );\n\t\t\t}\n\n\t\t\treturn null;\n\t\t};\n\t} else {\n\t\treturn config.view;\n\t}\n}\n\n// Takes the configuration, adds default parameters if they do not exist and normalizes other parameters to be used in downcast converters\n// for generating a view attribute.\n//\n// @param {Object} view View configuration.\nfunction normalizeToAttributeConfig( view ) {\n\tif ( typeof view == 'string' ) {\n\t\treturn modelAttributeValue => ( { key: view, value: modelAttributeValue } );\n\t} else if ( typeof view == 'object' ) {\n\t\t// { key, value, ... }\n\t\tif ( view.value ) {\n\t\t\treturn () => view;\n\t\t}\n\t\t// { key, ... }\n\t\telse {\n\t\t\treturn modelAttributeValue => ( { key: view.key, value: modelAttributeValue } );\n\t\t}\n\t} else {\n\t\t// function.\n\t\treturn view;\n\t}\n}\n\n// Helper function for `highlight`. Prepares the actual descriptor object using value passed to the converter.\nfunction prepareDescriptor( highlightDescriptor, data, conversionApi ) {\n\t// If passed descriptor is a creator function, call it. If not, just use passed value.\n\tconst descriptor = typeof highlightDescriptor == 'function' ?\n\t\thighlightDescriptor( data, conversionApi ) :\n\t\thighlightDescriptor;\n\n\tif ( !descriptor ) {\n\t\treturn null;\n\t}\n\n\t// Apply default descriptor priority.\n\tif ( !descriptor.priority ) {\n\t\tdescriptor.priority = 10;\n\t}\n\n\t// Default descriptor id is marker name.\n\tif ( !descriptor.id ) {\n\t\tdescriptor.id = data.markerName;\n\t}\n\n\treturn descriptor;\n}\n\n/**\n * An object describing how the marker highlight should be represented in the view.\n *\n * Each text node contained in a highlighted range will be wrapped in a ``\n * {@link module:engine/view/attributeelement~AttributeElement view attribute element} with CSS class(es), attributes and a priority\n * described by this object.\n *\n * Additionally, each {@link module:engine/view/containerelement~ContainerElement container element} can handle displaying the highlight\n * separately by providing the `addHighlight` and `removeHighlight` custom properties. In this case:\n *\n * * The `HighlightDescriptor` object is passed to the `addHighlight` function upon conversion and should be used to apply the highlight to\n * the element.\n * * The descriptor `id` is passed to the `removeHighlight` function upon conversion and should be used to remove the highlight with the\n * given ID from the element.\n *\n * @typedef {Object} module:engine/conversion/downcasthelpers~HighlightDescriptor\n *\n * @property {String|Array.} classes A CSS class or an array of classes to set. If the descriptor is used to\n * create an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these classes will be set\n * on that attribute element. If the descriptor is applied to an element, usually these classes will be set on that element, however,\n * this depends on how the element converts the descriptor.\n *\n * @property {String} [id] Descriptor identifier. If not provided, it defaults to the converted marker's name.\n *\n * @property {Number} [priority] Descriptor priority. If not provided, it defaults to `10`. If the descriptor is used to create\n * an {@link module:engine/view/attributeelement~AttributeElement attribute element}, it will be that element's\n * {@link module:engine/view/attributeelement~AttributeElement#priority priority}. If the descriptor is applied to an element,\n * the priority will be used to determine which descriptor is more important.\n *\n * @property {Object} [attributes] Attributes to set. If the descriptor is used to create\n * an {@link module:engine/view/attributeelement~AttributeElement attribute element} over text nodes, these attributes will be set on that\n * attribute element. If the descriptor is applied to an element, usually these attributes will be set on that element, however,\n * this depends on how the element converts the descriptor.\n */\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport Matcher from '../view/matcher';\nimport ModelRange from '../model/range';\nimport ConversionHelpers from './conversionhelpers';\n\nimport { cloneDeep } from 'lodash-es';\nimport ModelSelection from '../model/selection';\n\n/**\n * Contains {@link module:engine/view/view view} to {@link module:engine/model/model model} converters for\n * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}.\n *\n * @module engine/conversion/upcasthelpers\n */\n\n/**\n * Upcast conversion helper functions.\n *\n * @extends module:engine/conversion/conversionhelpers~ConversionHelpers\n */\nexport default class UpcastHelpers extends ConversionHelpers {\n\t/**\n\t * View element to model element conversion helper.\n\t *\n\t * This conversion results in creating a model element. For example,\n\t * view `

Foo

` becomes `Foo` in the model.\n\t *\n\t * Keep in mind that the element will be inserted only if it is allowed\n\t * by {@link module:engine/model/schema~Schema schema} configuration.\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToElement( {\n\t *\t\t\tview: 'p',\n\t *\t\t\tmodel: 'paragraph'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToElement( {\n\t *\t\t\tview: 'p',\n\t *\t\t\tmodel: 'paragraph',\n\t *\t\t\tconverterPriority: 'high'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToElement( {\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'p',\n\t *\t\t\t\tclasses: 'fancy'\n\t *\t\t\t},\n\t *\t\t\tmodel: 'fancyParagraph'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToElement( {\n\t * \t\t\tview: {\n\t *\t\t\t\tname: 'p',\n\t *\t\t\t\tclasses: 'heading'\n\t * \t\t\t},\n\t * \t\t\tmodel: ( viewElement, modelWriter ) => {\n\t * \t\t\t\treturn modelWriter.createElement( 'heading', { level: viewElement.getAttribute( 'data-level' ) } );\n\t * \t\t\t}\n\t * \t\t} );\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #elementToElement\n\t * @param {Object} config Conversion configuration.\n\t * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.\n\t * @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element\n\t * instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.\n\t * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n\t * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}\n\t */\n\telementToElement( config ) {\n\t\treturn this.add( upcastElementToElement( config ) );\n\t}\n\n\t/**\n\t * View element to model attribute conversion helper.\n\t *\n\t * This conversion results in setting an attribute on a model node. For example, view `Foo` becomes\n\t * `Foo` {@link module:engine/model/text~Text model text node} with `bold` attribute set to `true`.\n\t *\n\t * This helper is meant to set a model attribute on all the elements that are inside the converted element:\n\t *\n\t *\t\tFoo -->

Foo

--> <$text bold=\"true\">Foo\n\t *\n\t * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).\n\t * Even though `` is over `

` element, `bold=\"true\"` was added to the text. See\n\t * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute} for comparison.\n\t *\n\t * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToAttribute( {\n\t *\t\t\tview: 'strong',\n\t *\t\t\tmodel: 'bold'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToAttribute( {\n\t *\t\t\tview: 'strong',\n\t *\t\t\tmodel: 'bold',\n\t *\t\t\tconverterPriority: 'high'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToAttribute( {\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'span',\n\t *\t\t\t\tclasses: 'bold'\n\t *\t\t\t},\n\t *\t\t\tmodel: 'bold'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToAttribute( {\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'span',\n\t *\t\t\t\tclasses: [ 'styled', 'styled-dark' ]\n\t *\t\t\t},\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'styled',\n\t *\t\t\t\tvalue: 'dark'\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * \t\teditor.conversion.for( 'upcast' ).elementToAttribute( {\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'span',\n\t *\t\t\t\tstyles: {\n\t *\t\t\t\t\t'font-size': /[\\s\\S]+/\n\t *\t\t\t\t}\n\t *\t\t\t},\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'fontSize',\n\t *\t\t\t\tvalue: viewElement => {\n\t *\t\t\t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n\t *\t\t\t\t\tconst value = fontSize.substr( 0, fontSize.length - 2 );\n\t *\n\t *\t\t\t\t\tif ( value <= 10 ) {\n\t *\t\t\t\t\t\treturn 'small';\n\t *\t\t\t\t\t} else if ( value > 12 ) {\n\t *\t\t\t\t\t\treturn 'big';\n\t *\t\t\t\t\t}\n\t *\n\t *\t\t\t\t\treturn null;\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #elementToAttribute\n\t * @param {Object} config Conversion configuration.\n\t * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.\n\t * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing\n\t * the model attribute. `value` property may be set as a function that takes a view element and returns the value.\n\t * If `String` is given, the model attribute value will be set to `true`.\n\t * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n\t * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}\n\t */\n\telementToAttribute( config ) {\n\t\treturn this.add( upcastElementToAttribute( config ) );\n\t}\n\n\t/**\n\t * View attribute to model attribute conversion helper.\n\t *\n\t * This conversion results in setting an attribute on a model node. For example, view `` becomes\n\t * `` in the model.\n\t *\n\t * This helper is meant to convert view attributes from view elements which got converted to the model, so the view attribute\n\t * is set only on the corresponding model node:\n\t *\n\t *\t\t

foo
-->
foo
\n\t *\n\t * Above, `class=\"dark\"` attribute is added only to the `
` elements that has it. This is in contrary to\n\t * {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute} which sets attributes for\n\t * all the children in the model:\n\t *\n\t *\t\tFoo -->

Foo

--> <$text bold=\"true\">Foo\n\t *\n\t * Above is a sample of HTML code, that goes through autoparagraphing (first step) and then is converted (second step).\n\t * Even though `` is over `

` element, `bold=\"true\"` was added to the text.\n\t *\n\t * Keep in mind that the attribute will be set only if it is allowed by {@link module:engine/model/schema~Schema schema} configuration.\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).attributeToAttribute( {\n\t *\t\t\tview: 'src',\n\t *\t\t\tmodel: 'source'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).attributeToAttribute( {\n\t *\t\t\tview: { key: 'src' },\n\t *\t\t\tmodel: 'source'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).attributeToAttribute( {\n\t *\t\t\tview: { key: 'src' },\n\t *\t\t\tmodel: 'source',\n\t *\t\t\tconverterPriority: 'normal'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).attributeToAttribute( {\n\t *\t\t\tview: {\n\t *\t\t\t\tkey: 'data-style',\n\t *\t\t\t\tvalue: /[\\s\\S]+/\n\t *\t\t\t},\n\t *\t\t\tmodel: 'styled'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).attributeToAttribute( {\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'img',\n\t *\t\t\t\tkey: 'class',\n\t *\t\t\t\tvalue: 'styled-dark'\n\t *\t\t\t},\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'styled',\n\t *\t\t\t\tvalue: 'dark'\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).attributeToAttribute( {\n\t *\t\t\tview: {\n\t *\t\t\t\tkey: 'class',\n\t *\t\t\t\tvalue: /styled-[\\S]+/\n\t *\t\t\t},\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'styled'\n\t *\t\t\t\tvalue: viewElement => {\n\t *\t\t\t\t\tconst regexp = /styled-([\\S]+)/;\n\t *\t\t\t\t\tconst match = viewElement.getAttribute( 'class' ).match( regexp );\n\t *\n\t *\t\t\t\t\treturn match[ 1 ];\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #attributeToAttribute\n\t * @param {Object} config Conversion configuration.\n\t * @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,\n\t * attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,\n\t * specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`\n\t * property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,\n\t * a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.\n\t * @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing\n\t * the model attribute. `value` property may be set as a function that takes a view element and returns the value.\n\t * If `String` is given, the model attribute value will be same as view attribute value.\n\t * @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.\n\t * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}\n\t */\n\tattributeToAttribute( config ) {\n\t\treturn this.add( upcastAttributeToAttribute( config ) );\n\t}\n\n\t/**\n\t * View element to model marker conversion helper.\n\t *\n\t * This conversion results in creating a model marker. For example, if the marker was stored in a view as an element:\n\t * `

Foo

Bar

`,\n\t * after the conversion is done, the marker will be available in\n\t * {@link module:engine/model/model~Model#markers model document markers}.\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToMarker( {\n\t *\t\t\tview: 'marker-search',\n\t *\t\t\tmodel: 'search'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToMarker( {\n\t *\t\t\tview: 'marker-search',\n\t *\t\t\tmodel: 'search',\n\t *\t\t\tconverterPriority: 'high'\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToMarker( {\n\t *\t\t\tview: 'marker-search',\n\t *\t\t\tmodel: viewElement => 'comment:' + viewElement.getAttribute( 'data-comment-id' )\n\t *\t\t} );\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).elementToMarker( {\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'span',\n\t *\t\t\t\tattributes: {\n\t *\t\t\t\t\t'data-marker': 'search'\n\t *\t\t\t\t}\n\t *\t\t\t},\n\t *\t\t\tmodel: 'search'\n\t *\t\t} );\n\t *\n\t * See {@link module:engine/conversion/conversion~Conversion#for `conversion.for()`} to learn how to add a converter\n\t * to the conversion process.\n\t *\n\t * @method #elementToMarker\n\t * @param {Object} config Conversion configuration.\n\t * @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.\n\t * @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns\n\t * a model marker name.\n\t * @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n\t * @returns {module:engine/conversion/upcasthelpers~UpcastHelpers}\n\t */\n\telementToMarker( config ) {\n\t\treturn this.add( upcastElementToMarker( config ) );\n\t}\n}\n\n/**\n * Function factory, creates a converter that converts {@link module:engine/view/documentfragment~DocumentFragment view document fragment}\n * or all children of {@link module:engine/view/element~Element} into\n * {@link module:engine/model/documentfragment~DocumentFragment model document fragment}.\n * This is the \"entry-point\" converter for upcast (view to model conversion). This converter starts the conversion of all children\n * of passed view document fragment. Those children {@link module:engine/view/node~Node view nodes} are then handled by other converters.\n *\n * This also a \"default\", last resort converter for all view elements that has not been converted by other converters.\n * When a view element is being converted to the model but it does not have converter specified, that view element\n * will be converted to {@link module:engine/model/documentfragment~DocumentFragment model document fragment} and returned.\n *\n * @returns {Function} Universal converter for view {@link module:engine/view/documentfragment~DocumentFragment fragments} and\n * {@link module:engine/view/element~Element elements} that returns\n * {@link module:engine/model/documentfragment~DocumentFragment model fragment} with children of converted view item.\n */\nexport function convertToModelFragment() {\n\treturn ( evt, data, conversionApi ) => {\n\t\t// Second argument in `consumable.consume` is discarded for ViewDocumentFragment but is needed for ViewElement.\n\t\tif ( !data.modelRange && conversionApi.consumable.consume( data.viewItem, { name: true } ) ) {\n\t\t\tconst { modelRange, modelCursor } = conversionApi.convertChildren( data.viewItem, data.modelCursor );\n\n\t\t\tdata.modelRange = modelRange;\n\t\t\tdata.modelCursor = modelCursor;\n\t\t}\n\t};\n}\n\n/**\n * Function factory, creates a converter that converts {@link module:engine/view/text~Text} to {@link module:engine/model/text~Text}.\n *\n * @returns {Function} {@link module:engine/view/text~Text View text} converter.\n */\nexport function convertText() {\n\treturn ( evt, data, conversionApi ) => {\n\t\tif ( conversionApi.schema.checkChild( data.modelCursor, '$text' ) ) {\n\t\t\tif ( conversionApi.consumable.consume( data.viewItem ) ) {\n\t\t\t\tconst text = conversionApi.writer.createText( data.viewItem.data );\n\n\t\t\t\tconversionApi.writer.insert( text, data.modelCursor );\n\n\t\t\t\tdata.modelRange = ModelRange._createFromPositionAndShift( data.modelCursor, text.offsetSize );\n\t\t\t\tdata.modelCursor = data.modelRange.end;\n\t\t\t}\n\t\t}\n\t};\n}\n\n/**\n * Function factory, creates a callback function which converts a {@link module:engine/view/selection~Selection\n * view selection} taken from the {@link module:engine/view/document~Document#event:selectionChange} event\n * and sets in on the {@link module:engine/model/document~Document#selection model}.\n *\n * **Note**: because there is no view selection change dispatcher nor any other advanced view selection to model\n * conversion mechanism, the callback should be set directly on view document.\n *\n *\t\tview.document.on( 'selectionChange', convertSelectionChange( modelDocument, mapper ) );\n *\n * @param {module:engine/model/model~Model} model Data model.\n * @param {module:engine/conversion/mapper~Mapper} mapper Conversion mapper.\n * @returns {Function} {@link module:engine/view/document~Document#event:selectionChange} callback function.\n */\nexport function convertSelectionChange( model, mapper ) {\n\treturn ( evt, data ) => {\n\t\tconst viewSelection = data.newSelection;\n\t\tconst modelSelection = new ModelSelection();\n\n\t\tconst ranges = [];\n\n\t\tfor ( const viewRange of viewSelection.getRanges() ) {\n\t\t\tranges.push( mapper.toModelRange( viewRange ) );\n\t\t}\n\n\t\tmodelSelection.setTo( ranges, { backward: viewSelection.isBackward } );\n\n\t\tif ( !modelSelection.isEqual( model.document.selection ) ) {\n\t\t\tmodel.change( writer => {\n\t\t\t\twriter.setSelection( modelSelection );\n\t\t\t} );\n\t\t}\n\t};\n}\n\n// View element to model element conversion helper.\n//\n// See {@link ~UpcastHelpers#elementToElement `.elementToElement()` upcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.\n// @param {String|module:engine/model/element~Element|Function} config.model Name of the model element, a model element\n// instance or a function that takes a view element and returns a model element. The model element will be inserted in the model.\n// @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n// @returns {Function} Conversion helper.\nfunction upcastElementToElement( config ) {\n\tconfig = cloneDeep( config );\n\n\tconst converter = prepareToElementConverter( config );\n\n\tconst elementName = getViewElementNameFromConfig( config );\n\tconst eventName = elementName ? 'element:' + elementName : 'element';\n\n\treturn dispatcher => {\n\t\tdispatcher.on( eventName, converter, { priority: config.converterPriority || 'normal' } );\n\t};\n}\n\n// View element to model attribute conversion helper.\n//\n// See {@link ~UpcastHelpers#elementToAttribute `.elementToAttribute()` upcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.\n// @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing\n// the model attribute. `value` property may be set as a function that takes a view element and returns the value.\n// If `String` is given, the model attribute value will be set to `true`.\n// @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n// @returns {Function} Conversion helper.\nfunction upcastElementToAttribute( config ) {\n\tconfig = cloneDeep( config );\n\n\tnormalizeModelAttributeConfig( config );\n\n\tconst converter = prepareToAttributeConverter( config, false );\n\n\tconst elementName = getViewElementNameFromConfig( config );\n\tconst eventName = elementName ? 'element:' + elementName : 'element';\n\n\treturn dispatcher => {\n\t\tdispatcher.on( eventName, converter, { priority: config.converterPriority || 'low' } );\n\t};\n}\n\n// View attribute to model attribute conversion helper.\n//\n// See {@link ~UpcastHelpers#attributeToAttribute `.attributeToAttribute()` upcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {String|Object} config.view Specifies which view attribute will be converted. If a `String` is passed,\n// attributes with given key will be converted. If an `Object` is passed, it must have a required `key` property,\n// specifying view attribute key, and may have an optional `value` property, specifying view attribute value and optional `name`\n// property specifying a view element name from/on which the attribute should be converted. `value` can be given as a `String`,\n// a `RegExp` or a function callback, that takes view attribute value as the only parameter and returns `Boolean`.\n// @param {String|Object} config.model Model attribute key or an object with `key` and `value` properties, describing\n// the model attribute. `value` property may be set as a function that takes a view element and returns the value.\n// If `String` is given, the model attribute value will be same as view attribute value.\n// @param {module:utils/priorities~PriorityString} [config.converterPriority='low'] Converter priority.\n// @returns {Function} Conversion helper.\nfunction upcastAttributeToAttribute( config ) {\n\tconfig = cloneDeep( config );\n\n\tlet viewKey = null;\n\n\tif ( typeof config.view == 'string' || config.view.key ) {\n\t\tviewKey = normalizeViewAttributeKeyValueConfig( config );\n\t}\n\n\tnormalizeModelAttributeConfig( config, viewKey );\n\n\tconst converter = prepareToAttributeConverter( config, true );\n\n\treturn dispatcher => {\n\t\tdispatcher.on( 'element', converter, { priority: config.converterPriority || 'low' } );\n\t};\n}\n\n// View element to model marker conversion helper.\n//\n// See {@link ~UpcastHelpers#elementToMarker `.elementToMarker()` upcast helper} for examples.\n//\n// @param {Object} config Conversion configuration.\n// @param {module:engine/view/matcher~MatcherPattern} config.view Pattern matching all view elements which should be converted.\n// @param {String|Function} config.model Name of the model marker, or a function that takes a view element and returns\n// a model marker name.\n// @param {module:utils/priorities~PriorityString} [config.converterPriority='normal'] Converter priority.\n// @returns {Function} Conversion helper.\nfunction upcastElementToMarker( config ) {\n\tconfig = cloneDeep( config );\n\n\tnormalizeToMarkerConfig( config );\n\n\treturn upcastElementToElement( config );\n}\n\n// Helper function for from-view-element conversion. Checks if `config.view` directly specifies converted view element's name\n// and if so, returns it.\n//\n// @param {Object} config Conversion config.\n// @returns {String|null} View element name or `null` if name is not directly set.\nfunction getViewElementNameFromConfig( config ) {\n\tif ( typeof config.view == 'string' ) {\n\t\treturn config.view;\n\t}\n\n\tif ( typeof config.view == 'object' && typeof config.view.name == 'string' ) {\n\t\treturn config.view.name;\n\t}\n\n\treturn null;\n}\n\n// Helper for to-model-element conversion. Takes a config object and returns a proper converter function.\n//\n// @param {Object} config Conversion configuration.\n// @returns {Function} View to model converter.\nfunction prepareToElementConverter( config ) {\n\tconst matcher = new Matcher( config.view );\n\n\treturn ( evt, data, conversionApi ) => {\n\t\t// This will be usually just one pattern but we support matchers with many patterns too.\n\t\tconst match = matcher.match( data.viewItem );\n\n\t\t// If there is no match, this callback should not do anything.\n\t\tif ( !match ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Force consuming element's name.\n\t\tmatch.match.name = true;\n\n\t\t// Create model element basing on config.\n\t\tconst modelElement = getModelElement( config.model, data.viewItem, conversionApi.writer );\n\n\t\t// Do not convert if element building function returned falsy value.\n\t\tif ( !modelElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// When element was already consumed then skip it.\n\t\tif ( !conversionApi.consumable.test( data.viewItem, match.match ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Find allowed parent for element that we are going to insert.\n\t\t// If current parent does not allow to insert element but one of the ancestors does\n\t\t// then split nodes to allowed parent.\n\t\tconst splitResult = conversionApi.splitToAllowedParent( modelElement, data.modelCursor );\n\n\t\t// When there is no split result it means that we can't insert element to model tree, so let's skip it.\n\t\tif ( !splitResult ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Insert element on allowed position.\n\t\tconversionApi.writer.insert( modelElement, splitResult.position );\n\n\t\t// Convert children and insert to element.\n\t\tconst childrenResult = conversionApi.convertChildren( data.viewItem, conversionApi.writer.createPositionAt( modelElement, 0 ) );\n\n\t\t// Consume appropriate value from consumable values list.\n\t\tconversionApi.consumable.consume( data.viewItem, match.match );\n\n\t\t// Set conversion result range.\n\t\tdata.modelRange = new ModelRange(\n\t\t\t// Range should start before inserted element\n\t\t\tconversionApi.writer.createPositionBefore( modelElement ),\n\t\t\t// Should end after but we need to take into consideration that children could split our\n\t\t\t// element, so we need to move range after parent of the last converted child.\n\t\t\t// before: []\n\t\t\t// after: []\n\t\t\tconversionApi.writer.createPositionAfter( childrenResult.modelCursor.parent )\n\t\t);\n\n\t\t// Now we need to check where the modelCursor should be.\n\t\t// If we had to split parent to insert our element then we want to continue conversion inside split parent.\n\t\t//\n\t\t// before: []\n\t\t// after: []\n\t\tif ( splitResult.cursorParent ) {\n\t\t\tdata.modelCursor = conversionApi.writer.createPositionAt( splitResult.cursorParent, 0 );\n\n\t\t\t// Otherwise just continue after inserted element.\n\t\t} else {\n\t\t\tdata.modelCursor = data.modelRange.end;\n\t\t}\n\t};\n}\n\n// Helper function for upcasting-to-element converter. Takes the model configuration, the converted view element\n// and a writer instance and returns a model element instance to be inserted in the model.\n//\n// @param {String|Function|module:engine/model/element~Element} model Model conversion configuration.\n// @param {module:engine/view/node~Node} input The converted view node.\n// @param {module:engine/model/writer~Writer} writer A writer instance to use to create the model element.\nfunction getModelElement( model, input, writer ) {\n\tif ( model instanceof Function ) {\n\t\treturn model( input, writer );\n\t} else {\n\t\treturn writer.createElement( model );\n\t}\n}\n\n// Helper function view-attribute-to-model-attribute helper. Normalizes `config.view` which was set as `String` or\n// as an `Object` with `key`, `value` and `name` properties. Normalized `config.view` has is compatible with\n// {@link module:engine/view/matcher~MatcherPattern}.\n//\n// @param {Object} config Conversion config.\n// @returns {String} Key of the converted view attribute.\nfunction normalizeViewAttributeKeyValueConfig( config ) {\n\tif ( typeof config.view == 'string' ) {\n\t\tconfig.view = { key: config.view };\n\t}\n\n\tconst key = config.view.key;\n\tlet normalized;\n\n\tif ( key == 'class' || key == 'style' ) {\n\t\tconst keyName = key == 'class' ? 'classes' : 'styles';\n\n\t\tnormalized = {\n\t\t\t[ keyName ]: config.view.value\n\t\t};\n\t} else {\n\t\tconst value = typeof config.view.value == 'undefined' ? /[\\s\\S]*/ : config.view.value;\n\n\t\tnormalized = {\n\t\t\tattributes: {\n\t\t\t\t[ key ]: value\n\t\t\t}\n\t\t};\n\t}\n\n\tif ( config.view.name ) {\n\t\tnormalized.name = config.view.name;\n\t}\n\n\tconfig.view = normalized;\n\n\treturn key;\n}\n\n// Helper function that normalizes `config.model` in from-model-attribute conversion. `config.model` can be set\n// as a `String`, an `Object` with only `key` property or an `Object` with `key` and `value` properties. Normalized\n// `config.model` is an `Object` with `key` and `value` properties.\n//\n// @param {Object} config Conversion config.\n// @param {String} viewAttributeKeyToCopy Key of the converted view attribute. If it is set, model attribute value\n// will be equal to view attribute value.\nfunction normalizeModelAttributeConfig( config, viewAttributeKeyToCopy = null ) {\n\tconst defaultModelValue = viewAttributeKeyToCopy === null ? true : viewElement => viewElement.getAttribute( viewAttributeKeyToCopy );\n\n\tconst key = typeof config.model != 'object' ? config.model : config.model.key;\n\tconst value = typeof config.model != 'object' || typeof config.model.value == 'undefined' ? defaultModelValue : config.model.value;\n\n\tconfig.model = { key, value };\n}\n\n// Helper for to-model-attribute conversion. Takes the model attribute name and conversion configuration and returns\n// a proper converter function.\n//\n// @param {String} modelAttributeKey The key of the model attribute to set on a model node.\n// @param {Object|Array.} config Conversion configuration. It is possible to provide multiple configurations in an array.\n// @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set\n// on all elements in the range.\nfunction prepareToAttributeConverter( config, shallow ) {\n\tconst matcher = new Matcher( config.view );\n\n\treturn ( evt, data, conversionApi ) => {\n\t\tconst match = matcher.match( data.viewItem );\n\n\t\t// If there is no match, this callback should not do anything.\n\t\tif ( !match ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst modelKey = config.model.key;\n\t\tconst modelValue = typeof config.model.value == 'function' ? config.model.value( data.viewItem ) : config.model.value;\n\n\t\t// Do not convert if attribute building function returned falsy value.\n\t\tif ( modelValue === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( onlyViewNameIsDefined( config ) ) {\n\t\t\tmatch.match.name = true;\n\t\t} else {\n\t\t\t// Do not test or consume `name` consumable.\n\t\t\tdelete match.match.name;\n\t\t}\n\n\t\t// Try to consume appropriate values from consumable values list.\n\t\tif ( !conversionApi.consumable.test( data.viewItem, match.match ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Since we are converting to attribute we need an range on which we will set the attribute.\n\t\t// If the range is not created yet, we will create it.\n\t\tif ( !data.modelRange ) {\n\t\t\t// Convert children and set conversion result as a current data.\n\t\t\tdata = Object.assign( data, conversionApi.convertChildren( data.viewItem, data.modelCursor ) );\n\t\t}\n\n\t\t// Set attribute on current `output`. `Schema` is checked inside this helper function.\n\t\tconst attributeWasSet = setAttributeOn( data.modelRange, { key: modelKey, value: modelValue }, shallow, conversionApi );\n\n\t\tif ( attributeWasSet ) {\n\t\t\tconversionApi.consumable.consume( data.viewItem, match.match );\n\t\t}\n\t};\n}\n\n// Helper function that checks if element name should be consumed in attribute converters.\n//\n// @param {Object} config Conversion config.\n// @returns {Boolean}\nfunction onlyViewNameIsDefined( config ) {\n\tif ( typeof config.view == 'object' && !getViewElementNameFromConfig( config ) ) {\n\t\treturn false;\n\t}\n\n\treturn !config.view.classes && !config.view.attributes && !config.view.styles;\n}\n\n// Helper function for to-model-attribute converter. Sets model attribute on given range. Checks {@link module:engine/model/schema~Schema}\n// to ensure proper model structure.\n//\n// @param {module:engine/model/range~Range} modelRange Model range on which attribute should be set.\n// @param {Object} modelAttribute Model attribute to set.\n// @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion API.\n// @param {Boolean} shallow If set to `true` the attribute will be set only on top-level nodes. Otherwise, it will be set\n// on all elements in the range.\n// @returns {Boolean} `true` if attribute was set on at least one node from given `modelRange`.\nfunction setAttributeOn( modelRange, modelAttribute, shallow, conversionApi ) {\n\tlet result = false;\n\n\t// Set attribute on each item in range according to Schema.\n\tfor ( const node of Array.from( modelRange.getItems( { shallow } ) ) ) {\n\t\tif ( conversionApi.schema.checkAttribute( node, modelAttribute.key ) ) {\n\t\t\tconversionApi.writer.setAttribute( modelAttribute.key, modelAttribute.value, node );\n\n\t\t\tresult = true;\n\t\t}\n\t}\n\n\treturn result;\n}\n\n// Helper function for upcasting-to-marker conversion. Takes the config in a format requested by `upcastElementToMarker()`\n// function and converts it to a format that is supported by `_upcastElementToElement()` function.\n//\n// @param {Object} config Conversion configuration.\nfunction normalizeToMarkerConfig( config ) {\n\tconst oldModel = config.model;\n\n\tconfig.model = ( viewElement, modelWriter ) => {\n\t\tconst markerName = typeof oldModel == 'string' ? oldModel : oldModel( viewElement );\n\n\t\treturn modelWriter.createElement( '$marker', { 'data-name': markerName } );\n\t};\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/controller/editingcontroller\n */\n\nimport RootEditableElement from '../view/rooteditableelement';\nimport View from '../view/view';\nimport Mapper from '../conversion/mapper';\nimport DowncastDispatcher from '../conversion/downcastdispatcher';\nimport { clearAttributes, convertCollapsedSelection, convertRangeSelection, insertText, remove } from '../conversion/downcasthelpers';\n\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport { convertSelectionChange } from '../conversion/upcasthelpers';\n\n/**\n * Controller for the editing pipeline. The editing pipeline controls {@link ~EditingController#model model} rendering,\n * including selection handling. It also creates the {@link ~EditingController#view view} which builds a\n * browser-independent virtualization over the DOM elements. The editing controller also attaches default converters.\n *\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class EditingController {\n\t/**\n\t * Creates an editing controller instance.\n\t *\n\t * @param {module:engine/model/model~Model} model Editing model.\n\t */\n\tconstructor( model ) {\n\t\t/**\n\t\t * Editor model.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/model~Model}\n\t\t */\n\t\tthis.model = model;\n\n\t\t/**\n\t\t * Editing view controller.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/view/view~View}\n\t\t */\n\t\tthis.view = new View();\n\n\t\t/**\n\t\t * Mapper which describes the model-view binding.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/conversion/mapper~Mapper}\n\t\t */\n\t\tthis.mapper = new Mapper();\n\n\t\t/**\n\t\t * Downcast dispatcher that converts changes from the model to {@link #view the editing view}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher} #downcastDispatcher\n\t\t */\n\t\tthis.downcastDispatcher = new DowncastDispatcher( {\n\t\t\tmapper: this.mapper\n\t\t} );\n\n\t\tconst doc = this.model.document;\n\t\tconst selection = doc.selection;\n\t\tconst markers = this.model.markers;\n\n\t\t// When plugins listen on model changes (on selection change, post fixers, etc) and change the view as a result of\n\t\t// model's change, they might trigger view rendering before the conversion is completed (e.g. before the selection\n\t\t// is converted). We disable rendering for the length of the outermost model change() block to prevent that.\n\t\t//\n\t\t// See https://github.com/ckeditor/ckeditor5-engine/issues/1528\n\t\tthis.listenTo( this.model, '_beforeChanges', () => {\n\t\t\tthis.view._disableRendering( true );\n\t\t}, { priority: 'highest' } );\n\n\t\tthis.listenTo( this.model, '_afterChanges', () => {\n\t\t\tthis.view._disableRendering( false );\n\t\t}, { priority: 'lowest' } );\n\n\t\t// Whenever model document is changed, convert those changes to the view (using model.Document#differ).\n\t\t// Do it on 'low' priority, so changes are converted after other listeners did their job.\n\t\t// Also convert model selection.\n\t\tthis.listenTo( doc, 'change', () => {\n\t\t\tthis.view.change( writer => {\n\t\t\t\tthis.downcastDispatcher.convertChanges( doc.differ, writer );\n\t\t\t\tthis.downcastDispatcher.convertSelection( selection, markers, writer );\n\t\t\t} );\n\t\t}, { priority: 'low' } );\n\n\t\t// Convert selection from the view to the model when it changes in the view.\n\t\tthis.listenTo( this.view.document, 'selectionChange', convertSelectionChange( this.model, this.mapper ) );\n\n\t\t// Attach default model converters.\n\t\tthis.downcastDispatcher.on( 'insert:$text', insertText(), { priority: 'lowest' } );\n\t\tthis.downcastDispatcher.on( 'remove', remove(), { priority: 'low' } );\n\n\t\t// Attach default model selection converters.\n\t\tthis.downcastDispatcher.on( 'selection', clearAttributes(), { priority: 'low' } );\n\t\tthis.downcastDispatcher.on( 'selection', convertRangeSelection(), { priority: 'low' } );\n\t\tthis.downcastDispatcher.on( 'selection', convertCollapsedSelection(), { priority: 'low' } );\n\n\t\t// Binds {@link module:engine/view/document~Document#roots view roots collection} to\n\t\t// {@link module:engine/model/document~Document#roots model roots collection} so creating\n\t\t// model root automatically creates corresponding view root.\n\t\tthis.view.document.roots.bindTo( this.model.document.roots ).using( root => {\n\t\t\t// $graveyard is a special root that has no reflection in the view.\n\t\t\tif ( root.rootName == '$graveyard' ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst viewRoot = new RootEditableElement( root.name );\n\n\t\t\tviewRoot.rootName = root.rootName;\n\t\t\tviewRoot._document = this.view.document;\n\t\t\tthis.mapper.bindElements( root, viewRoot );\n\n\t\t\treturn viewRoot;\n\t\t} );\n\t}\n\n\t/**\n\t * Removes all event listeners attached to the `EditingController`. Destroys all objects created\n\t * by `EditingController` that need to be destroyed.\n\t */\n\tdestroy() {\n\t\tthis.view.destroy();\n\t\tthis.stopListening();\n\t}\n}\n\nmix( EditingController, ObservableMixin );\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/plugincollection\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport log from '@ckeditor/ckeditor5-utils/src/log';\n\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * Manages a list of CKEditor plugins, including loading, resolving dependencies and initialization.\n *\n * @mixes module:utils/emittermixin~EmitterMixin\n */\nexport default class PluginCollection {\n\t/**\n\t * Creates an instance of the PluginCollection class.\n\t * Allows loading and initializing plugins and their dependencies.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor\n\t * @param {Array.} [availablePlugins] Plugins (constructors) which the collection will be able to use\n\t * when {@link module:core/plugincollection~PluginCollection#init} is used with plugin names (strings, instead of constructors).\n\t * Usually, the editor will pass its built-in plugins to the collection so they can later be\n\t * used in `config.plugins` or `config.removePlugins` by names.\n\t */\n\tconstructor( editor, availablePlugins = [] ) {\n\t\t/**\n\t\t * @protected\n\t\t * @member {module:core/editor/editor~Editor} module:core/plugin~PluginCollection#_editor\n\t\t */\n\t\tthis._editor = editor;\n\n\t\t/**\n\t\t * Map of plugin constructors which can be retrieved by their names.\n\t\t *\n\t\t * @protected\n\t\t * @member {Map.} module:core/plugin~PluginCollection#_availablePlugins\n\t\t */\n\t\tthis._availablePlugins = new Map();\n\n\t\t/**\n\t\t * @protected\n\t\t * @member {Map} module:core/plugin~PluginCollection#_plugins\n\t\t */\n\t\tthis._plugins = new Map();\n\n\t\tfor ( const PluginConstructor of availablePlugins ) {\n\t\t\tthis._availablePlugins.set( PluginConstructor, PluginConstructor );\n\n\t\t\tif ( PluginConstructor.pluginName ) {\n\t\t\t\tthis._availablePlugins.set( PluginConstructor.pluginName, PluginConstructor );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Iterable interface.\n\t *\n\t * Returns `[ PluginConstructor, pluginInstance ]` pairs.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t* [ Symbol.iterator ]() {\n\t\tfor ( const entry of this._plugins ) {\n\t\t\tif ( typeof entry[ 0 ] == 'function' ) {\n\t\t\t\tyield entry;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Gets the plugin instance by its constructor or name.\n\t *\n\t *\t\t// Check if 'Clipboard' plugin was loaded.\n\t *\t\tif ( editor.plugins.has( 'Clipboard' ) ) {\n\t *\t\t\t// Get clipboard plugin instance\n\t *\t\t\tconst clipboard = editor.plugins.get( 'Clipboard' );\n\t *\n\t *\t\t\tthis.listenTo( clipboard, 'inputTransformation', ( evt, data ) => {\n\t *\t\t\t\t// Do something on clipboard input.\n\t *\t\t\t} );\n\t *\t\t}\n\t *\n\t * **Note**: This method will throw error if plugin is not loaded. Use `{@link #has editor.plugins.has()}`\n\t * to check if plugin is available.\n\t *\n\t * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.\n\t * @returns {module:core/plugin~PluginInterface}\n\t */\n\tget( key ) {\n\t\tconst plugin = this._plugins.get( key );\n\n\t\tif ( !plugin ) {\n\t\t\t/**\n\t\t\t * The plugin is not loaded and could not be obtained.\n\t\t\t *\n\t\t\t * Plugin classes (constructors) need to be provided to the editor and must be loaded before they can be obtained from\n\t\t\t * the plugin collection.\n\t\t\t * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}\n\t\t\t * property.\n\t\t\t *\n\t\t\t * **Note**: You can use `{@link module:core/plugincollection~PluginCollection#has editor.plugins.has()}`\n\t\t\t * to check if plugin was loaded.\n\t\t\t *\n\t\t\t * @error plugincollection-plugin-not-loaded\n\t\t\t * @param {String} plugin The name of the plugin which is not loaded.\n\t\t\t */\n\t\t\tconst errorMsg = 'plugincollection-plugin-not-loaded: The requested plugin is not loaded.';\n\n\t\t\tlet pluginName = key;\n\n\t\t\tif ( typeof key == 'function' ) {\n\t\t\t\tpluginName = key.pluginName || key.name;\n\t\t\t}\n\n\t\t\tthrow new CKEditorError( errorMsg, { plugin: pluginName } );\n\t\t}\n\n\t\treturn plugin;\n\t}\n\n\t/**\n\t * Checks if plugin is loaded.\n\t *\n\t *\t\t// Check if 'Clipboard' plugin was loaded.\n\t *\t\tif ( editor.plugins.has( 'Clipboard' ) ) {\n\t *\t\t\t// Now use clipboard plugin instance:\n\t *\t\t\tconst clipboard = editor.plugins.get( 'Clipboard' );\n\t *\n\t *\t\t\t// ...\n\t *\t\t}\n\t *\n\t * @param {Function|String} key The plugin constructor or {@link module:core/plugin~PluginInterface.pluginName name}.\n\t * @returns {Boolean}\n\t */\n\thas( key ) {\n\t\treturn this._plugins.has( key );\n\t}\n\n\t/**\n\t * Initializes a set of plugins and adds them to the collection.\n\t *\n\t * @param {Array.} plugins An array of {@link module:core/plugin~PluginInterface plugin constructors}\n\t * or {@link module:core/plugin~PluginInterface.pluginName plugin names}. The second option (names) works only if\n\t * `availablePlugins` were passed to the {@link #constructor}.\n\t * @param {Array.} [removePlugins] Names of plugins or plugin constructors\n\t * that should not be loaded (despite being specified in the `plugins` array).\n\t * @returns {Promise.} A promise which gets resolved once all plugins are loaded\n\t * and available in the collection.\n\t */\n\tinit( plugins, removePlugins = [] ) {\n\t\tconst that = this;\n\t\tconst editor = this._editor;\n\t\tconst loading = new Set();\n\t\tconst loaded = [];\n\n\t\tconst pluginConstructors = mapToAvailableConstructors( plugins );\n\t\tconst removePluginConstructors = mapToAvailableConstructors( removePlugins );\n\t\tconst missingPlugins = getMissingPluginNames( plugins );\n\n\t\tif ( missingPlugins ) {\n\t\t\t/**\n\t\t\t * Some plugins are not available and could not be loaded.\n\t\t\t *\n\t\t\t * Plugin classes (constructors) need to be provided to the editor before they can be loaded by name.\n\t\t\t * This is usually done in CKEditor 5 builds by setting the {@link module:core/editor/editor~Editor.builtinPlugins}\n\t\t\t * property.\n\t\t\t *\n\t\t\t * **If you see this warning when using one of the {@glink builds/index CKEditor 5 Builds}**, it means\n\t\t\t * that you try to enable a plugin which was not included in that build. This may be due to a typo\n\t\t\t * in the plugin name or simply because that plugin is not a part of this build. In the latter scenario,\n\t\t\t * read more about {@glink builds/guides/development/custom-builds custom builds}.\n\t\t\t *\n\t\t\t * **If you see this warning when using one of the editor creators directly** (not a build), then it means\n\t\t\t * that you tried loading plugins by name. However, unlike CKEditor 4, CKEditor 5 does not implement a \"plugin loader\".\n\t\t\t * This means that CKEditor 5 does not know where to load the plugin modules from. Therefore, you need to\n\t\t\t * provide each plugin through reference (as a constructor function). Check out the examples in\n\t\t\t * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source \"Building from source\"}.\n\t\t\t *\n\t\t\t * @error plugincollection-plugin-not-found\n\t\t\t * @param {Array.} plugins The name of the plugins which could not be loaded.\n\t\t\t */\n\t\t\tconst errorMsg = 'plugincollection-plugin-not-found: Some plugins are not available and could not be loaded.';\n\n\t\t\t// Log the error so it's more visible on the console. Hopefully, for better DX.\n\t\t\tlog.error( errorMsg, { plugins: missingPlugins } );\n\n\t\t\treturn Promise.reject( new CKEditorError( errorMsg, { plugins: missingPlugins } ) );\n\t\t}\n\n\t\treturn Promise.all( pluginConstructors.map( loadPlugin ) )\n\t\t\t.then( () => initPlugins( loaded, 'init' ) )\n\t\t\t.then( () => initPlugins( loaded, 'afterInit' ) )\n\t\t\t.then( () => loaded );\n\n\t\tfunction loadPlugin( PluginConstructor ) {\n\t\t\tif ( removePluginConstructors.includes( PluginConstructor ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// The plugin is already loaded or being loaded - do nothing.\n\t\t\tif ( that._plugins.has( PluginConstructor ) || loading.has( PluginConstructor ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn instantiatePlugin( PluginConstructor )\n\t\t\t\t.catch( err => {\n\t\t\t\t\t/**\n\t\t\t\t\t * It was not possible to load the plugin.\n\t\t\t\t\t *\n\t\t\t\t\t * This is a generic error logged to the console when a JavaSript error is thrown during the initialization\n\t\t\t\t\t * of one of the plugins.\n\t\t\t\t\t *\n\t\t\t\t\t * If you correctly handled the promise returned by the editor's `create()` method (like shown below)\n\t\t\t\t\t * you will find the original error logged to the console, too:\n\t\t\t\t\t *\n\t\t\t\t\t *\t\tClassicEditor.create( document.getElementById( 'editor' ) )\n\t\t\t\t\t *\t\t\t.then( editor => {\n\t\t\t\t\t *\t\t\t\t// ...\n\t\t\t\t\t * \t\t\t} )\n\t\t\t\t\t *\t\t\t.catch( error => {\n\t\t\t\t\t *\t\t\t\tconsole.error( error );\n\t\t\t\t\t *\t\t\t} );\n\t\t\t\t\t *\n\t\t\t\t\t * @error plugincollection-load\n\t\t\t\t\t * @param {String} plugin The name of the plugin that could not be loaded.\n\t\t\t\t\t */\n\t\t\t\t\tlog.error( 'plugincollection-load: It was not possible to load the plugin.', { plugin: PluginConstructor } );\n\n\t\t\t\t\tthrow err;\n\t\t\t\t} );\n\t\t}\n\n\t\tfunction initPlugins( loadedPlugins, method ) {\n\t\t\treturn loadedPlugins.reduce( ( promise, plugin ) => {\n\t\t\t\tif ( !plugin[ method ] ) {\n\t\t\t\t\treturn promise;\n\t\t\t\t}\n\n\t\t\t\treturn promise.then( plugin[ method ].bind( plugin ) );\n\t\t\t}, Promise.resolve() );\n\t\t}\n\n\t\tfunction instantiatePlugin( PluginConstructor ) {\n\t\t\treturn new Promise( resolve => {\n\t\t\t\tloading.add( PluginConstructor );\n\n\t\t\t\tif ( PluginConstructor.requires ) {\n\t\t\t\t\tPluginConstructor.requires.forEach( RequiredPluginConstructorOrName => {\n\t\t\t\t\t\tconst RequiredPluginConstructor = getPluginConstructor( RequiredPluginConstructorOrName );\n\n\t\t\t\t\t\tif ( removePlugins.includes( RequiredPluginConstructor ) ) {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Cannot load a plugin because one of its dependencies is listed in the `removePlugins` option.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * @error plugincollection-required\n\t\t\t\t\t\t\t * @param {Function} plugin The required plugin.\n\t\t\t\t\t\t\t * @param {Function} requiredBy The parent plugin.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t\t\t\t'plugincollection-required: Cannot load a plugin because one of its dependencies is listed in' +\n\t\t\t\t\t\t\t\t'the `removePlugins` option.',\n\t\t\t\t\t\t\t\t{ plugin: RequiredPluginConstructor, requiredBy: PluginConstructor }\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tloadPlugin( RequiredPluginConstructor );\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tconst plugin = new PluginConstructor( editor );\n\t\t\t\tthat._add( PluginConstructor, plugin );\n\t\t\t\tloaded.push( plugin );\n\n\t\t\t\tresolve();\n\t\t\t} );\n\t\t}\n\n\t\tfunction getPluginConstructor( PluginConstructorOrName ) {\n\t\t\tif ( typeof PluginConstructorOrName == 'function' ) {\n\t\t\t\treturn PluginConstructorOrName;\n\t\t\t}\n\n\t\t\treturn that._availablePlugins.get( PluginConstructorOrName );\n\t\t}\n\n\t\tfunction getMissingPluginNames( plugins ) {\n\t\t\tconst missingPlugins = [];\n\n\t\t\tfor ( const pluginNameOrConstructor of plugins ) {\n\t\t\t\tif ( !getPluginConstructor( pluginNameOrConstructor ) ) {\n\t\t\t\t\tmissingPlugins.push( pluginNameOrConstructor );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn missingPlugins.length ? missingPlugins : null;\n\t\t}\n\n\t\tfunction mapToAvailableConstructors( plugins ) {\n\t\t\treturn plugins\n\t\t\t\t.map( pluginNameOrConstructor => getPluginConstructor( pluginNameOrConstructor ) )\n\t\t\t\t.filter( PluginConstructor => !!PluginConstructor );\n\t\t}\n\t}\n\n\t/**\n\t * Destroys all loaded plugins.\n\t *\n\t * @returns {Promise}\n\t */\n\tdestroy() {\n\t\tconst promises = Array.from( this )\n\t\t\t.map( ( [ , pluginInstance ] ) => pluginInstance )\n\t\t\t.filter( pluginInstance => typeof pluginInstance.destroy == 'function' )\n\t\t\t.map( pluginInstance => pluginInstance.destroy() );\n\n\t\treturn Promise.all( promises );\n\t}\n\n\t/**\n\t * Adds the plugin to the collection. Exposed mainly for testing purposes.\n\t *\n\t * @protected\n\t * @param {Function} PluginConstructor The plugin constructor.\n\t * @param {module:core/plugin~PluginInterface} plugin The instance of the plugin.\n\t */\n\t_add( PluginConstructor, plugin ) {\n\t\tthis._plugins.set( PluginConstructor, plugin );\n\n\t\tconst pluginName = PluginConstructor.pluginName;\n\n\t\tif ( !pluginName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._plugins.has( pluginName ) ) {\n\t\t\t/**\n\t\t\t * Two plugins with the same {@link module:core/plugin~PluginInterface.pluginName} were loaded.\n\t\t\t * This will lead to runtime conflicts between these plugins.\n\t\t\t *\n\t\t\t * In practice, this warning usually means that new plugins were added to an existing CKEditor 5 build.\n\t\t\t * Plugins should always be added to a source version of the editor (`@ckeditor/ckeditor5-editor-*`),\n\t\t\t * not to an editor imported from one of the `@ckeditor/ckeditor5-build-*` packages.\n\t\t\t *\n\t\t\t * Check your import paths and the list of plugins passed to\n\t\t\t * {@link module:core/editor/editor~Editor.create `Editor.create()`}\n\t\t\t * or specified in {@link module:core/editor/editor~Editor.builtinPlugins `Editor.builtinPlugins`}.\n\t\t\t *\n\t\t\t * The second option is that your `node_modules/` directory contains duplicated versions of the same\n\t\t\t * CKEditor 5 packages. Normally, on clean installations, npm deduplicates packages in `node_modules/`, so\n\t\t\t * it may be enough to call `rm -rf node_modules && npm i`. However, if you installed conflicting versions\n\t\t\t * of packages, their dependencies may need to be installed in more than one version which may lead to this\n\t\t\t * warning.\n\t\t\t *\n\t\t\t * Technically speaking, this error occurs because after adding a plugin to an existing editor build\n\t\t\t * dependencies of this plugin are being duplicated.\n\t\t\t * They are already built into that editor build and now get added for the second time as dependencies\n\t\t\t * of the plugin you are installing.\n\t\t\t *\n\t\t\t * Read more about {@glink builds/guides/integration/installing-plugins installing plugins}.\n\t\t\t *\n\t\t\t * @error plugincollection-plugin-name-conflict\n\t\t\t * @param {String} pluginName The duplicated plugin name.\n\t\t\t * @param {Function} plugin1 The first plugin constructor.\n\t\t\t * @param {Function} plugin2 The second plugin constructor.\n\t\t\t */\n\t\t\tlog.warn(\n\t\t\t\t'plugincollection-plugin-name-conflict: Two plugins with the same name were loaded.',\n\t\t\t\t{ pluginName, plugin1: this._plugins.get( pluginName ).constructor, plugin2: PluginConstructor }\n\t\t\t);\n\t\t} else {\n\t\t\tthis._plugins.set( pluginName, plugin );\n\t\t}\n\t}\n}\n\nmix( PluginCollection, EmitterMixin );\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/commandcollection\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Collection of commands. Its instance is available in {@link module:core/editor/editor~Editor#commands `editor.commands`}.\n */\nexport default class CommandCollection {\n\t/**\n\t * Creates collection instance.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Command map.\n\t\t *\n\t\t * @private\n\t\t * @member {Map}\n\t\t */\n\t\tthis._commands = new Map();\n\t}\n\n\t/**\n\t * Registers a new command.\n\t *\n\t * @param {String} commandName The name of the command.\n\t * @param {module:core/command~Command} command\n\t */\n\tadd( commandName, command ) {\n\t\tthis._commands.set( commandName, command );\n\t}\n\n\t/**\n\t * Retrieves a command from the collection.\n\t *\n\t * @param {String} commandName The name of the command.\n\t * @returns {module:core/command~Command}\n\t */\n\tget( commandName ) {\n\t\treturn this._commands.get( commandName );\n\t}\n\n\t/**\n\t * Executes a command.\n\t *\n\t * @param {String} commandName The name of the command.\n\t * @param {*} [...commandParams] Command parameters.\n\t */\n\texecute( commandName, ...args ) {\n\t\tconst command = this.get( commandName );\n\n\t\tif ( !command ) {\n\t\t\t/**\n\t\t\t * Command does not exist.\n\t\t\t *\n\t\t\t * @error commandcollection-command-not-found\n\t\t\t * @param {String} commandName Name of the command.\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'commandcollection-command-not-found: Command does not exist.', { commandName } );\n\t\t}\n\n\t\tcommand.execute( ...args );\n\t}\n\n\t/**\n\t * Returns iterator of command names.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t* names() {\n\t\tyield* this._commands.keys();\n\t}\n\n\t/**\n\t * Returns iterator of command instances.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t* commands() {\n\t\tyield* this._commands.values();\n\t}\n\n\t/**\n\t * Iterable interface.\n\t *\n\t * Returns `[ commandName, commandInstance ]` pairs.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this._commands[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Destroys all collection commands.\n\t */\n\tdestroy() {\n\t\tfor ( const command of this.commands() ) {\n\t\t\tcommand.destroy();\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* globals window */\n\n/**\n * @module utils/translation-service\n */\n\n/* istanbul ignore else */\nif ( !window.CKEDITOR_TRANSLATIONS ) {\n\twindow.CKEDITOR_TRANSLATIONS = {};\n}\n\n/**\n * Adds translations to existing ones.\n * These translations will later be available for the {@link module:utils/translation-service~translate `translate()`} function.\n *\n *\t\tadd( 'pl', {\n *\t\t\t'OK': 'OK',\n *\t\t\t'Cancel [context: reject]': 'Anuluj'\n *\t\t} );\n *\n * If you cannot import this function from this module (e.g. because you use a CKEditor 5 build), then you can\n * still add translations by extending the global `window.CKEDITOR_TRANSLATIONS` object by using a function like\n * the one below:\n *\n *\t\tfunction addTranslations( language, translations ) {\n *\t\t\tif ( !window.CKEDITOR_TRANSLATIONS ) {\n *\t\t\t\twindow.CKEDITOR_TRANSLATIONS = {};\n *\t\t\t}\n *\n *\t\t\tconst dictionary = window.CKEDITOR_TRANSLATIONS[ language ] || ( window.CKEDITOR_TRANSLATIONS[ language ] = {} );\n *\n *\t\t\t// Extend the dictionary for the given language.\n *\t\t\tObject.assign( dictionary, translations );\n *\t\t}\n *\n * @param {String} language Target language.\n * @param {Object.} translations Translations which will be added to the dictionary.\n */\nexport function add( language, translations ) {\n\tconst dictionary = window.CKEDITOR_TRANSLATIONS[ language ] || ( window.CKEDITOR_TRANSLATIONS[ language ] = {} );\n\n\tObject.assign( dictionary, translations );\n}\n\n/**\n * Translates string if the translation of the string was previously added to the dictionary.\n * See {@link module:utils/translation-service Translation Service}.\n * This happens in a multi-language mode were translation modules are created by the bundler.\n *\n * When no translation is defined in the dictionary or the dictionary doesn't exist this function returns\n * the original string without the `'[context: ]'` (happens in development and single-language modes).\n *\n * In a single-language mode (when values passed to `t()` were replaced with target language strings) the dictionary\n * is left empty, so this function will return the original strings always.\n *\n *\t\ttranslate( 'pl', 'Cancel [context: reject]' );\n *\n * @param {String} language Target language.\n * @param {String} translationKey String that will be translated.\n * @returns {String} Translated sentence.\n */\nexport function translate( language, translationKey ) {\n\tconst numberOfLanguages = getNumberOfLanguages();\n\n\tif ( numberOfLanguages === 1 ) {\n\t\t// Override the language to the only supported one.\n\t\t// This can't be done in the `Locale` class, because the translations comes after the `Locale` class initialization.\n\t\tlanguage = Object.keys( window.CKEDITOR_TRANSLATIONS )[ 0 ];\n\t}\n\n\tif ( numberOfLanguages === 0 || !hasTranslation( language, translationKey ) ) {\n\t\treturn translationKey.replace( / \\[context: [^\\]]+\\]$/, '' );\n\t}\n\n\tconst dictionary = window.CKEDITOR_TRANSLATIONS[ language ];\n\n\t// In case of missing translations we still need to cut off the `[context: ]` parts.\n\treturn dictionary[ translationKey ].replace( / \\[context: [^\\]]+\\]$/, '' );\n}\n\n/**\n * Clears dictionaries for test purposes.\n *\n * @protected\n */\nexport function _clear() {\n\twindow.CKEDITOR_TRANSLATIONS = {};\n}\n\n// Checks whether the dictionary exists and translation in that dictionary exists.\nfunction hasTranslation( language, translationKey ) {\n\treturn (\n\t\t( language in window.CKEDITOR_TRANSLATIONS ) &&\n\t\t( translationKey in window.CKEDITOR_TRANSLATIONS[ language ] )\n\t);\n}\n\nfunction getNumberOfLanguages() {\n\treturn Object.keys( window.CKEDITOR_TRANSLATIONS ).length;\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/locale\n */\n\nimport { translate } from './translation-service';\n\n/**\n * Represents the localization services.\n */\nexport default class Locale {\n\t/**\n\t * Creates a new instance of the Locale class.\n\t *\n\t * @param {String} [language='en'] The language code in [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.\n\t */\n\tconstructor( language ) {\n\t\t/**\n\t\t * The language code in [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) format.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.language = language || 'en';\n\n\t\t/**\n\t\t * Translates the given string to the {@link #language}. This method is also available in {@link module:core/editor/editor~Editor#t}\n\t\t * and {@link module:ui/view~View#t}.\n\t\t *\n\t\t * The strings may contain placeholders (`%`) for values which are passed as the second argument.\n\t\t * `` is the index in the `values` array.\n\t\t *\n\t\t *\t\teditor.t( 'Created file \"%0\" in %1ms.', [ fileName, timeTaken ] );\n\t\t *\n\t\t * This method's context is statically bound to Locale instance,\n\t\t * so it can be called as a function:\n\t\t *\n\t\t *\t\tconst t = this.t;\n\t\t *\t\tt( 'Label' );\n\t\t *\n\t\t * @method #t\n\t\t * @param {String} str The string to translate.\n\t\t * @param {String[]} [values] Values that should be used to interpolate the string.\n\t\t */\n\t\tthis.t = ( ...args ) => this._t( ...args );\n\t}\n\n\t/**\n\t * Base for the {@link #t} method.\n\t *\n\t * @private\n\t */\n\t_t( str, values ) {\n\t\tlet translatedString = translate( this.language, str );\n\n\t\tif ( values ) {\n\t\t\ttranslatedString = translatedString.replace( /%(\\d+)/g, ( match, index ) => {\n\t\t\t\treturn ( index < values.length ) ? values[ index ] : match;\n\t\t\t} );\n\t\t}\n\n\t\treturn translatedString;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/viewconsumable\n */\n\nimport { isArray } from 'lodash-es';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Class used for handling consumption of view {@link module:engine/view/element~Element elements},\n * {@link module:engine/view/text~Text text nodes} and {@link module:engine/view/documentfragment~DocumentFragment document fragments}.\n * Element's name and its parts (attributes, classes and styles) can be consumed separately. Consuming an element's name\n * does not consume its attributes, classes and styles.\n * To add items for consumption use {@link module:engine/conversion/viewconsumable~ViewConsumable#add add method}.\n * To test items use {@link module:engine/conversion/viewconsumable~ViewConsumable#test test method}.\n * To consume items use {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consume method}.\n * To revert already consumed items use {@link module:engine/conversion/viewconsumable~ViewConsumable#revert revert method}.\n *\n *\t\tviewConsumable.add( element, { name: true } ); // Adds element's name as ready to be consumed.\n *\t\tviewConsumable.add( textNode ); // Adds text node for consumption.\n *\t\tviewConsumable.add( docFragment ); // Adds document fragment for consumption.\n *\t\tviewConsumable.test( element, { name: true } ); // Tests if element's name can be consumed.\n *\t\tviewConsumable.test( textNode ); // Tests if text node can be consumed.\n *\t\tviewConsumable.test( docFragment ); // Tests if document fragment can be consumed.\n *\t\tviewConsumable.consume( element, { name: true } ); // Consume element's name.\n *\t\tviewConsumable.consume( textNode ); // Consume text node.\n *\t\tviewConsumable.consume( docFragment ); // Consume document fragment.\n *\t\tviewConsumable.revert( element, { name: true } ); // Revert already consumed element's name.\n *\t\tviewConsumable.revert( textNode ); // Revert already consumed text node.\n *\t\tviewConsumable.revert( docFragment ); // Revert already consumed document fragment.\n */\nexport default class ViewConsumable {\n\t/**\n\t * Creates new ViewConsumable.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Map of consumable elements. If {@link module:engine/view/element~Element element} is used as a key,\n\t\t * {@link module:engine/conversion/viewconsumable~ViewElementConsumables ViewElementConsumables} instance is stored as value.\n\t\t * For {@link module:engine/view/text~Text text nodes} and\n\t\t * {@link module:engine/view/documentfragment~DocumentFragment document fragments} boolean value is stored as value.\n\t\t *\n\t\t * @protected\n\t\t * @member {Map.}\n\t\t*/\n\t\tthis._consumables = new Map();\n\t}\n\n\t/**\n\t * Adds {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n\t * {@link module:engine/view/documentfragment~DocumentFragment document fragment} as ready to be consumed.\n\t *\n\t *\t\tviewConsumable.add( p, { name: true } ); // Adds element's name to consume.\n\t *\t\tviewConsumable.add( p, { attributes: 'name' } ); // Adds element's attribute.\n\t *\t\tviewConsumable.add( p, { classes: 'foobar' } ); // Adds element's class.\n\t *\t\tviewConsumable.add( p, { styles: 'color' } ); // Adds element's style\n\t *\t\tviewConsumable.add( p, { attributes: 'name', styles: 'color' } ); // Adds attribute and style.\n\t *\t\tviewConsumable.add( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be provided.\n\t *\t\tviewConsumable.add( textNode ); // Adds text node to consume.\n\t *\t\tviewConsumable.add( docFragment ); // Adds document fragment to consume.\n\t *\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`\n\t * attribute is provided - it should be handled separately by providing actual style/class.\n\t *\n\t *\t\tviewConsumable.add( p, { attributes: 'style' } ); // This call will throw an exception.\n\t *\t\tviewConsumable.add( p, { styles: 'color' } ); // This is properly handled style.\n\t *\n\t * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element\n\t * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n\t * @param {Boolean} consumables.name If set to true element's name will be included.\n\t * @param {String|Array.} consumables.attributes Attribute name or array of attribute names.\n\t * @param {String|Array.} consumables.classes Class name or array of class names.\n\t * @param {String|Array.} consumables.styles Style name or array of style names.\n\t */\n\tadd( element, consumables ) {\n\t\tlet elementConsumables;\n\n\t\t// For text nodes and document fragments just mark them as consumable.\n\t\tif ( element.is( 'text' ) || element.is( 'documentFragment' ) ) {\n\t\t\tthis._consumables.set( element, true );\n\n\t\t\treturn;\n\t\t}\n\n\t\t// For elements create new ViewElementConsumables or update already existing one.\n\t\tif ( !this._consumables.has( element ) ) {\n\t\t\telementConsumables = new ViewElementConsumables();\n\t\t\tthis._consumables.set( element, elementConsumables );\n\t\t} else {\n\t\t\telementConsumables = this._consumables.get( element );\n\t\t}\n\n\t\telementConsumables.add( consumables );\n\t}\n\n\t/**\n\t * Tests if {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n\t * {@link module:engine/view/documentfragment~DocumentFragment document fragment} can be consumed.\n\t * It returns `true` when all items included in method's call can be consumed. Returns `false` when\n\t * first already consumed item is found and `null` when first non-consumable item is found.\n\t *\n\t *\t\tviewConsumable.test( p, { name: true } ); // Tests element's name.\n\t *\t\tviewConsumable.test( p, { attributes: 'name' } ); // Tests attribute.\n\t *\t\tviewConsumable.test( p, { classes: 'foobar' } ); // Tests class.\n\t *\t\tviewConsumable.test( p, { styles: 'color' } ); // Tests style.\n\t *\t\tviewConsumable.test( p, { attributes: 'name', styles: 'color' } ); // Tests attribute and style.\n\t *\t\tviewConsumable.test( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be tested.\n\t *\t\tviewConsumable.test( textNode ); // Tests text node.\n\t *\t\tviewConsumable.test( docFragment ); // Tests document fragment.\n\t *\n\t * Testing classes and styles as attribute will test if all added classes/styles can be consumed.\n\t *\n\t *\t\tviewConsumable.test( p, { attributes: 'class' } ); // Tests if all added classes can be consumed.\n\t *\t\tviewConsumable.test( p, { attributes: 'style' } ); // Tests if all added styles can be consumed.\n\t *\n\t * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element\n\t * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n\t * @param {Boolean} consumables.name If set to true element's name will be included.\n\t * @param {String|Array.} consumables.attributes Attribute name or array of attribute names.\n\t * @param {String|Array.} consumables.classes Class name or array of class names.\n\t * @param {String|Array.} consumables.styles Style name or array of style names.\n\t * @returns {Boolean|null} Returns `true` when all items included in method's call can be consumed. Returns `false`\n\t * when first already consumed item is found and `null` when first non-consumable item is found.\n\t */\n\ttest( element, consumables ) {\n\t\tconst elementConsumables = this._consumables.get( element );\n\n\t\tif ( elementConsumables === undefined ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// For text nodes and document fragments return stored boolean value.\n\t\tif ( element.is( 'text' ) || element.is( 'documentFragment' ) ) {\n\t\t\treturn elementConsumables;\n\t\t}\n\n\t\t// For elements test consumables object.\n\t\treturn elementConsumables.test( consumables );\n\t}\n\n\t/**\n\t * Consumes {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n\t * {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n\t * It returns `true` when all items included in method's call can be consumed, otherwise returns `false`.\n\t *\n\t *\t\tviewConsumable.consume( p, { name: true } ); // Consumes element's name.\n\t *\t\tviewConsumable.consume( p, { attributes: 'name' } ); // Consumes element's attribute.\n\t *\t\tviewConsumable.consume( p, { classes: 'foobar' } ); // Consumes element's class.\n\t *\t\tviewConsumable.consume( p, { styles: 'color' } ); // Consumes element's style.\n\t *\t\tviewConsumable.consume( p, { attributes: 'name', styles: 'color' } ); // Consumes attribute and style.\n\t *\t\tviewConsumable.consume( p, { classes: [ 'baz', 'bar' ] } ); // Multiple consumables can be consumed.\n\t *\t\tviewConsumable.consume( textNode ); // Consumes text node.\n\t *\t\tviewConsumable.consume( docFragment ); // Consumes document fragment.\n\t *\n\t * Consuming classes and styles as attribute will test if all added classes/styles can be consumed.\n\t *\n\t *\t\tviewConsumable.consume( p, { attributes: 'class' } ); // Consume only if all added classes can be consumed.\n\t *\t\tviewConsumable.consume( p, { attributes: 'style' } ); // Consume only if all added styles can be consumed.\n\t *\n\t * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element\n\t * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n\t * @param {Boolean} consumables.name If set to true element's name will be included.\n\t * @param {String|Array.} consumables.attributes Attribute name or array of attribute names.\n\t * @param {String|Array.} consumables.classes Class name or array of class names.\n\t * @param {String|Array.} consumables.styles Style name or array of style names.\n\t * @returns {Boolean} Returns `true` when all items included in method's call can be consumed,\n\t * otherwise returns `false`.\n\t */\n\tconsume( element, consumables ) {\n\t\tif ( this.test( element, consumables ) ) {\n\t\t\tif ( element.is( 'text' ) || element.is( 'documentFragment' ) ) {\n\t\t\t\t// For text nodes and document fragments set value to false.\n\t\t\t\tthis._consumables.set( element, false );\n\t\t\t} else {\n\t\t\t\t// For elements - consume consumables object.\n\t\t\t\tthis._consumables.get( element ).consume( consumables );\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Reverts {@link module:engine/view/element~Element view element}, {@link module:engine/view/text~Text text node} or\n\t * {@link module:engine/view/documentfragment~DocumentFragment document fragment} so they can be consumed once again.\n\t * Method does not revert items that were never previously added for consumption, even if they are included in\n\t * method's call.\n\t *\n\t *\t\tviewConsumable.revert( p, { name: true } ); // Reverts element's name.\n\t *\t\tviewConsumable.revert( p, { attributes: 'name' } ); // Reverts element's attribute.\n\t *\t\tviewConsumable.revert( p, { classes: 'foobar' } ); // Reverts element's class.\n\t *\t\tviewConsumable.revert( p, { styles: 'color' } ); // Reverts element's style.\n\t *\t\tviewConsumable.revert( p, { attributes: 'name', styles: 'color' } ); // Reverts attribute and style.\n\t *\t\tviewConsumable.revert( p, { classes: [ 'baz', 'bar' ] } ); // Multiple names can be reverted.\n\t *\t\tviewConsumable.revert( textNode ); // Reverts text node.\n\t *\t\tviewConsumable.revert( docFragment ); // Reverts document fragment.\n\t *\n\t * Reverting classes and styles as attribute will revert all classes/styles that were previously added for\n\t * consumption.\n\t *\n\t *\t\tviewConsumable.revert( p, { attributes: 'class' } ); // Reverts all classes added for consumption.\n\t *\t\tviewConsumable.revert( p, { attributes: 'style' } ); // Reverts all styles added for consumption.\n\t *\n\t * @param {module:engine/view/element~Element|module:engine/view/text~Text|module:engine/view/documentfragment~DocumentFragment} element\n\t * @param {Object} [consumables] Used only if first parameter is {@link module:engine/view/element~Element view element} instance.\n\t * @param {Boolean} consumables.name If set to true element's name will be included.\n\t * @param {String|Array.} consumables.attributes Attribute name or array of attribute names.\n\t * @param {String|Array.} consumables.classes Class name or array of class names.\n\t * @param {String|Array.} consumables.styles Style name or array of style names.\n\t */\n\trevert( element, consumables ) {\n\t\tconst elementConsumables = this._consumables.get( element );\n\n\t\tif ( elementConsumables !== undefined ) {\n\t\t\tif ( element.is( 'text' ) || element.is( 'documentFragment' ) ) {\n\t\t\t\t// For text nodes and document fragments - set consumable to true.\n\t\t\t\tthis._consumables.set( element, true );\n\t\t\t} else {\n\t\t\t\t// For elements - revert items from consumables object.\n\t\t\t\telementConsumables.revert( consumables );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates consumable object from {@link module:engine/view/element~Element view element}. Consumable object will include\n\t * element's name and all its attributes, classes and styles.\n\t *\n\t * @static\n\t * @param {module:engine/view/element~Element} element\n\t * @returns {Object} consumables\n\t */\n\tstatic consumablesFromElement( element ) {\n\t\tconst consumables = {\n\t\t\tname: true,\n\t\t\tattributes: [],\n\t\t\tclasses: [],\n\t\t\tstyles: []\n\t\t};\n\n\t\tconst attributes = element.getAttributeKeys();\n\n\t\tfor ( const attribute of attributes ) {\n\t\t\t// Skip classes and styles - will be added separately.\n\t\t\tif ( attribute == 'style' || attribute == 'class' ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconsumables.attributes.push( attribute );\n\t\t}\n\n\t\tconst classes = element.getClassNames();\n\n\t\tfor ( const className of classes ) {\n\t\t\tconsumables.classes.push( className );\n\t\t}\n\n\t\tconst styles = element.getStyleNames();\n\n\t\tfor ( const style of styles ) {\n\t\t\tconsumables.styles.push( style );\n\t\t}\n\n\t\treturn consumables;\n\t}\n\n\t/**\n\t * Creates {@link module:engine/conversion/viewconsumable~ViewConsumable ViewConsumable} instance from\n\t * {@link module:engine/view/node~Node node} or {@link module:engine/view/documentfragment~DocumentFragment document fragment}.\n\t * Instance will contain all elements, child nodes, attributes, styles and classes added for consumption.\n\t *\n\t * @static\n\t * @param {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment} from View node or document fragment\n\t * from which `ViewConsumable` will be created.\n\t * @param {module:engine/conversion/viewconsumable~ViewConsumable} [instance] If provided, given `ViewConsumable` instance will be used\n\t * to add all consumables. It will be returned instead of a new instance.\n\t */\n\tstatic createFrom( from, instance ) {\n\t\tif ( !instance ) {\n\t\t\tinstance = new ViewConsumable();\n\t\t}\n\n\t\tif ( from.is( 'text' ) ) {\n\t\t\tinstance.add( from );\n\n\t\t\treturn instance;\n\t\t}\n\n\t\t// Add `from` itself, if it is an element.\n\t\tif ( from.is( 'element' ) ) {\n\t\t\tinstance.add( from, ViewConsumable.consumablesFromElement( from ) );\n\t\t}\n\n\t\tif ( from.is( 'documentFragment' ) ) {\n\t\t\tinstance.add( from );\n\t\t}\n\n\t\tfor ( const child of from.getChildren() ) {\n\t\t\tinstance = ViewConsumable.createFrom( child, instance );\n\t\t}\n\n\t\treturn instance;\n\t}\n}\n\n/**\n * This is a private helper-class for {@link module:engine/conversion/viewconsumable~ViewConsumable}.\n * It represents and manipulates consumable parts of a single {@link module:engine/view/element~Element}.\n *\n * @private\n */\nclass ViewElementConsumables {\n\t/**\n\t * Creates ViewElementConsumables instance.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Flag indicating if name of the element can be consumed.\n\t\t *\n\t\t * @private\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis._canConsumeName = null;\n\n\t\t/**\n\t\t * Contains maps of element's consumables: attributes, classes and styles.\n\t\t *\n\t\t * @private\n\t\t * @member {Object}\n\t\t */\n\t\tthis._consumables = {\n\t\t\tattributes: new Map(),\n\t\t\tstyles: new Map(),\n\t\t\tclasses: new Map()\n\t\t};\n\t}\n\n\t/**\n\t * Adds consumable parts of the {@link module:engine/view/element~Element view element}.\n\t * Element's name itself can be marked to be consumed (when element's name is consumed its attributes, classes and\n\t * styles still could be consumed):\n\t *\n\t *\t\tconsumables.add( { name: true } );\n\t *\n\t * Attributes classes and styles:\n\t *\n\t *\t\tconsumables.add( { attributes: 'title', classes: 'foo', styles: 'color' } );\n\t *\t\tconsumables.add( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n\t *\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`\n\t * attribute is provided - it should be handled separately by providing `style` and `class` in consumables object.\n\t *\n\t * @param {Object} consumables Object describing which parts of the element can be consumed.\n\t * @param {Boolean} consumables.name If set to `true` element's name will be added as consumable.\n\t * @param {String|Array.} consumables.attributes Attribute name or array of attribute names to add as consumable.\n\t * @param {String|Array.} consumables.classes Class name or array of class names to add as consumable.\n\t * @param {String|Array.} consumables.styles Style name or array of style names to add as consumable.\n\t */\n\tadd( consumables ) {\n\t\tif ( consumables.name ) {\n\t\t\tthis._canConsumeName = true;\n\t\t}\n\n\t\tfor ( const type in this._consumables ) {\n\t\t\tif ( type in consumables ) {\n\t\t\t\tthis._add( type, consumables[ type ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Tests if parts of the {@link module:engine/view/node~Node view node} can be consumed.\n\t *\n\t * Element's name can be tested:\n\t *\n\t *\t\tconsumables.test( { name: true } );\n\t *\n\t * Attributes classes and styles:\n\t *\n\t *\t\tconsumables.test( { attributes: 'title', classes: 'foo', styles: 'color' } );\n\t *\t\tconsumables.test( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n\t *\n\t * @param {Object} consumables Object describing which parts of the element should be tested.\n\t * @param {Boolean} consumables.name If set to `true` element's name will be tested.\n\t * @param {String|Array.} consumables.attributes Attribute name or array of attribute names to test.\n\t * @param {String|Array.} consumables.classes Class name or array of class names to test.\n\t * @param {String|Array.} consumables.styles Style name or array of style names to test.\n\t * @returns {Boolean|null} `true` when all tested items can be consumed, `null` when even one of the items\n\t * was never marked for consumption and `false` when even one of the items was already consumed.\n\t */\n\ttest( consumables ) {\n\t\t// Check if name can be consumed.\n\t\tif ( consumables.name && !this._canConsumeName ) {\n\t\t\treturn this._canConsumeName;\n\t\t}\n\n\t\tfor ( const type in this._consumables ) {\n\t\t\tif ( type in consumables ) {\n\t\t\t\tconst value = this._test( type, consumables[ type ] );\n\n\t\t\t\tif ( value !== true ) {\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Return true only if all can be consumed.\n\t\treturn true;\n\t}\n\n\t/**\n\t * Consumes parts of {@link module:engine/view/element~Element view element}. This function does not check if consumable item\n\t * is already consumed - it consumes all consumable items provided.\n\t * Element's name can be consumed:\n\t *\n\t *\t\tconsumables.consume( { name: true } );\n\t *\n\t * Attributes classes and styles:\n\t *\n\t *\t\tconsumables.consume( { attributes: 'title', classes: 'foo', styles: 'color' } );\n\t *\t\tconsumables.consume( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n\t *\n\t * @param {Object} consumables Object describing which parts of the element should be consumed.\n\t * @param {Boolean} consumables.name If set to `true` element's name will be consumed.\n\t * @param {String|Array.} consumables.attributes Attribute name or array of attribute names to consume.\n\t * @param {String|Array.} consumables.classes Class name or array of class names to consume.\n\t * @param {String|Array.} consumables.styles Style name or array of style names to consume.\n\t */\n\tconsume( consumables ) {\n\t\tif ( consumables.name ) {\n\t\t\tthis._canConsumeName = false;\n\t\t}\n\n\t\tfor ( const type in this._consumables ) {\n\t\t\tif ( type in consumables ) {\n\t\t\t\tthis._consume( type, consumables[ type ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Revert already consumed parts of {@link module:engine/view/element~Element view Element}, so they can be consumed once again.\n\t * Element's name can be reverted:\n\t *\n\t *\t\tconsumables.revert( { name: true } );\n\t *\n\t * Attributes classes and styles:\n\t *\n\t *\t\tconsumables.revert( { attributes: 'title', classes: 'foo', styles: 'color' } );\n\t *\t\tconsumables.revert( { attributes: [ 'title', 'name' ], classes: [ 'foo', 'bar' ] );\n\t *\n\t * @param {Object} consumables Object describing which parts of the element should be reverted.\n\t * @param {Boolean} consumables.name If set to `true` element's name will be reverted.\n\t * @param {String|Array.} consumables.attributes Attribute name or array of attribute names to revert.\n\t * @param {String|Array.} consumables.classes Class name or array of class names to revert.\n\t * @param {String|Array.} consumables.styles Style name or array of style names to revert.\n\t */\n\trevert( consumables ) {\n\t\tif ( consumables.name ) {\n\t\t\tthis._canConsumeName = true;\n\t\t}\n\n\t\tfor ( const type in this._consumables ) {\n\t\t\tif ( type in consumables ) {\n\t\t\t\tthis._revert( type, consumables[ type ] );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Helper method that adds consumables of a given type: attribute, class or style.\n\t *\n\t * Throws {@link module:utils/ckeditorerror~CKEditorError CKEditorError} `viewconsumable-invalid-attribute` when `class` or `style`\n\t * type is provided - it should be handled separately by providing actual style/class type.\n\t *\n\t * @private\n\t * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.\n\t * @param {String|Array.} item Consumable item or array of items.\n\t */\n\t_add( type, item ) {\n\t\tconst items = isArray( item ) ? item : [ item ];\n\t\tconst consumables = this._consumables[ type ];\n\n\t\tfor ( const name of items ) {\n\t\t\tif ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {\n\t\t\t\t/**\n\t\t\t\t * Class and style attributes should be handled separately in\n\t\t\t\t * {@link module:engine/conversion/viewconsumable~ViewConsumable#add `ViewConsumable#add()`}.\n\t\t\t\t *\n\t\t\t\t * What you have done is trying to use:\n\t\t\t\t *\n\t\t\t\t *\t\tconsumables.add( { attributes: [ 'class', 'style' ] } );\n\t\t\t\t *\n\t\t\t\t * While each class and style should be registered separately:\n\t\t\t\t *\n\t\t\t\t *\t\tconsumables.add( { classes: 'some-class', styles: 'font-weight' } );\n\t\t\t\t *\n\t\t\t\t * @error viewconsumable-invalid-attribute\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError( 'viewconsumable-invalid-attribute: Classes and styles should be handled separately.' );\n\t\t\t}\n\n\t\t\tconsumables.set( name, true );\n\t\t}\n\t}\n\n\t/**\n\t * Helper method that tests consumables of a given type: attribute, class or style.\n\t *\n\t * @private\n\t * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.\n\t * @param {String|Array.} item Consumable item or array of items.\n\t * @returns {Boolean|null} Returns `true` if all items can be consumed, `null` when one of the items cannot be\n\t * consumed and `false` when one of the items is already consumed.\n\t */\n\t_test( type, item ) {\n\t\tconst items = isArray( item ) ? item : [ item ];\n\t\tconst consumables = this._consumables[ type ];\n\n\t\tfor ( const name of items ) {\n\t\t\tif ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {\n\t\t\t\tconst consumableName = name == 'class' ? 'classes' : 'styles';\n\n\t\t\t\t// Check all classes/styles if class/style attribute is tested.\n\t\t\t\tconst value = this._test( consumableName, [ ...this._consumables[ consumableName ].keys() ] );\n\n\t\t\t\tif ( value !== true ) {\n\t\t\t\t\treturn value;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst value = consumables.get( name );\n\t\t\t\t// Return null if attribute is not found.\n\t\t\t\tif ( value === undefined ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\tif ( !value ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Helper method that consumes items of a given type: attribute, class or style.\n\t *\n\t * @private\n\t * @param {String} type Type of the consumable item: `attributes`, `classes` or `styles`.\n\t * @param {String|Array.} item Consumable item or array of items.\n\t */\n\t_consume( type, item ) {\n\t\tconst items = isArray( item ) ? item : [ item ];\n\t\tconst consumables = this._consumables[ type ];\n\n\t\tfor ( const name of items ) {\n\t\t\tif ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {\n\t\t\t\tconst consumableName = name == 'class' ? 'classes' : 'styles';\n\n\t\t\t\t// If class or style is provided for consumption - consume them all.\n\t\t\t\tthis._consume( consumableName, [ ...this._consumables[ consumableName ].keys() ] );\n\t\t\t} else {\n\t\t\t\tconsumables.set( name, false );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Helper method that reverts items of a given type: attribute, class or style.\n\t *\n\t * @private\n\t * @param {String} type Type of the consumable item: `attributes`, `classes` or , `styles`.\n\t * @param {String|Array.} item Consumable item or array of items.\n\t */\n\t_revert( type, item ) {\n\t\tconst items = isArray( item ) ? item : [ item ];\n\t\tconst consumables = this._consumables[ type ];\n\n\t\tfor ( const name of items ) {\n\t\t\tif ( type === 'attributes' && ( name === 'class' || name === 'style' ) ) {\n\t\t\t\tconst consumableName = name == 'class' ? 'classes' : 'styles';\n\n\t\t\t\t// If class or style is provided for reverting - revert them all.\n\t\t\t\tthis._revert( consumableName, [ ...this._consumables[ consumableName ].keys() ] );\n\t\t\t} else {\n\t\t\t\tconst value = consumables.get( name );\n\n\t\t\t\tif ( value === false ) {\n\t\t\t\t\tconsumables.set( name, true );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/schema\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\nimport Range from './range';\nimport Position from './position';\nimport Element from './element';\nimport Text from './text';\nimport TreeWalker from './treewalker';\n\n/**\n * The model's schema. It defines allowed and disallowed structures of nodes as well as nodes' attributes.\n * The schema is usually defined by features and based on them the editing framework and features\n * make decisions how to change and process the model.\n *\n * The instance of schema is available in {@link module:engine/model/model~Model#schema `editor.model.schema`}.\n *\n * Read more about the schema in:\n *\n * * {@glink framework/guides/architecture/editing-engine#schema \"Schema\"} section of the\n * {@glink framework/guides/architecture/editing-engine Introduction to the \"Editing engine architecture\"}.\n * * {@glink framework/guides/deep-dive/schema \"Schema\" deep dive} guide.\n *\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class Schema {\n\t/**\n\t * Creates schema instance.\n\t */\n\tconstructor() {\n\t\tthis._sourceDefinitions = {};\n\n\t\tthis.decorate( 'checkChild' );\n\t\tthis.decorate( 'checkAttribute' );\n\n\t\tthis.on( 'checkAttribute', ( evt, args ) => {\n\t\t\targs[ 0 ] = new SchemaContext( args[ 0 ] );\n\t\t}, { priority: 'highest' } );\n\n\t\tthis.on( 'checkChild', ( evt, args ) => {\n\t\t\targs[ 0 ] = new SchemaContext( args[ 0 ] );\n\t\t\targs[ 1 ] = this.getDefinition( args[ 1 ] );\n\t\t}, { priority: 'highest' } );\n\t}\n\n\t/**\n\t * Registers schema item. Can only be called once for every item name.\n\t *\n\t *\t\tschema.register( 'paragraph', {\n\t *\t\t\tinheritAllFrom: '$block'\n\t *\t\t} );\n\t *\n\t * @param {String} itemName\n\t * @param {module:engine/model/schema~SchemaItemDefinition} definition\n\t */\n\tregister( itemName, definition ) {\n\t\tif ( this._sourceDefinitions[ itemName ] ) {\n\t\t\t/**\n\t\t\t * A single item cannot be registered twice in the schema.\n\t\t\t *\n\t\t\t * This situation may happen when:\n\t\t\t *\n\t\t\t * * Two or more plugins called {@link #register `register()`} with the same name. This will usually mean that\n\t\t\t * there is a collision between plugins which try to use the same element in the model. Unfortunately,\n\t\t\t * the only way to solve this is by modifying one of these plugins to use a unique model element name.\n\t\t\t * * A single plugin was loaded twice. This happens when it is installed by npm/yarn in two versions\n\t\t\t * and usually means one or more of the following issues:\n\t\t\t * * a version mismatch (two of your dependencies require two different versions of this plugin),\n\t\t\t * * incorrect imports (this plugin is somehow imported twice in a way which confuses webpack),\n\t\t\t * * mess in `node_modules/` (`rm -rf node_modules/` may help).\n\t\t\t *\n\t\t\t * **Note:** Check the logged `itemName` to better understand which plugin was duplicated/conflicting.\n\t\t\t *\n\t\t\t * @param itemName The name of the model element that is being registered twice.\n\t\t\t * @error schema-cannot-register-item-twice\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'schema-cannot-register-item-twice: A single item cannot be registered twice in the schema.', {\n\t\t\t\titemName\n\t\t\t} );\n\t\t}\n\n\t\tthis._sourceDefinitions[ itemName ] = [\n\t\t\tObject.assign( {}, definition )\n\t\t];\n\n\t\tthis._clearCache();\n\t}\n\n\t/**\n\t * Extends a {@link #register registered} item's definition.\n\t *\n\t * Extending properties such as `allowIn` will add more items to the existing properties,\n\t * while redefining properties such as `isBlock` will override the previously defined ones.\n\t *\n\t *\t\tschema.register( 'foo', {\n\t *\t\t\tallowIn: '$root',\n\t *\t\t\tisBlock: true;\n\t *\t\t} );\n\t *\t\tschema.extend( 'foo', {\n\t *\t\t\tallowIn: 'blockQuote',\n\t *\t\t\tisBlock: false\n\t *\t\t} );\n\t *\n\t *\t\tschema.getDefinition( 'foo' );\n\t *\t\t//\t{\n\t *\t\t//\t\tallowIn: [ '$root', 'blockQuote' ],\n\t *\t\t// \t\tisBlock: false\n\t *\t\t//\t}\n\t *\n\t * @param {String} itemName\n\t * @param {module:engine/model/schema~SchemaItemDefinition} definition\n\t */\n\textend( itemName, definition ) {\n\t\tif ( !this._sourceDefinitions[ itemName ] ) {\n\t\t\t/**\n\t\t\t * Cannot extend an item which was not registered yet.\n\t\t\t *\n\t\t\t * This error happens when a plugin tries to extend the schema definition of an item which was not\n\t\t\t * {@link #register registered} yet.\n\t\t\t *\n\t\t\t * @param itemName The name of the model element which is being extended.\n\t\t\t * @error schema-cannot-register-item-twice\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'schema-cannot-extend-missing-item: Cannot extend an item which was not registered yet.', {\n\t\t\t\titemName\n\t\t\t} );\n\t\t}\n\n\t\tthis._sourceDefinitions[ itemName ].push( Object.assign( {}, definition ) );\n\n\t\tthis._clearCache();\n\t}\n\n\t/**\n\t * Returns all registered items.\n\t *\n\t * @returns {Object.}\n\t */\n\tgetDefinitions() {\n\t\tif ( !this._compiledDefinitions ) {\n\t\t\tthis._compile();\n\t\t}\n\n\t\treturn this._compiledDefinitions;\n\t}\n\n\t/**\n\t * Returns a definition of the given item or `undefined` if item is not registered.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item\n\t * @returns {module:engine/model/schema~SchemaCompiledItemDefinition}\n\t */\n\tgetDefinition( item ) {\n\t\tlet itemName;\n\n\t\tif ( typeof item == 'string' ) {\n\t\t\titemName = item;\n\t\t} else if ( item.is && ( item.is( 'text' ) || item.is( 'textProxy' ) ) ) {\n\t\t\titemName = '$text';\n\t\t}\n\t\t// Element or module:engine/model/schema~SchemaContextItem.\n\t\telse {\n\t\t\titemName = item.name;\n\t\t}\n\n\t\treturn this.getDefinitions()[ itemName ];\n\t}\n\n\t/**\n\t * Returns `true` if the given item is registered in the schema.\n\t *\n\t *\t\tschema.isRegistered( 'paragraph' ); // -> true\n\t *\t\tschema.isRegistered( editor.model.document.getRoot() ); // -> true\n\t *\t\tschema.isRegistered( 'foo' ); // -> false\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item\n\t */\n\tisRegistered( item ) {\n\t\treturn !!this.getDefinition( item );\n\t}\n\n\t/**\n\t * Returns `true` if the given item is defined to be\n\t * a block by {@link module:engine/model/schema~SchemaItemDefinition}'s `isBlock` property.\n\t *\n\t *\t\tschema.isBlock( 'paragraph' ); // -> true\n\t *\t\tschema.isBlock( '$root' ); // -> false\n\t *\n\t *\t\tconst paragraphElement = writer.createElement( 'paragraph' );\n\t *\t\tschema.isBlock( paragraphElement ); // -> true\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item\n\t */\n\tisBlock( item ) {\n\t\tconst def = this.getDefinition( item );\n\n\t\treturn !!( def && def.isBlock );\n\t}\n\n\t/**\n\t * Returns `true` if the given item is defined to be\n\t * a limit element by {@link module:engine/model/schema~SchemaItemDefinition}'s `isLimit` or `isObject` property\n\t * (all objects are also limits).\n\t *\n\t *\t\tschema.isLimit( 'paragraph' ); // -> false\n\t *\t\tschema.isLimit( '$root' ); // -> true\n\t *\t\tschema.isLimit( editor.model.document.getRoot() ); // -> true\n\t *\t\tschema.isLimit( 'image' ); // -> true\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item\n\t */\n\tisLimit( item ) {\n\t\tconst def = this.getDefinition( item );\n\n\t\tif ( !def ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !!( def.isLimit || def.isObject );\n\t}\n\n\t/**\n\t * Returns `true` if the given item is defined to be\n\t * an object element by {@link module:engine/model/schema~SchemaItemDefinition}'s `isObject` property.\n\t *\n\t *\t\tschema.isObject( 'paragraph' ); // -> false\n\t *\t\tschema.isObject( 'image' ); // -> true\n\t *\n\t *\t\tconst imageElement = writer.createElement( 'image' );\n\t *\t\tschema.isObject( imageElement ); // -> true\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item\n\t */\n\tisObject( item ) {\n\t\tconst def = this.getDefinition( item );\n\n\t\treturn !!( def && def.isObject );\n\t}\n\n\t/**\n\t * Returns `true` if the given item is defined to be\n\t * an inline element by {@link module:engine/model/schema~SchemaItemDefinition}'s `isInline` property.\n\t *\n\t *\t\tschema.isInline( 'paragraph' ); // -> false\n\t *\t\tschema.isInline( 'softBreak' ); // -> true\n\t *\n\t *\t\tconst text = writer.createText('foo' );\n\t *\t\tschema.isInline( text ); // -> true\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/schema~SchemaContextItem|String} item\n\t */\n\tisInline( item ) {\n\t\tconst def = this.getDefinition( item );\n\n\t\treturn !!( def && def.isInline );\n\t}\n\n\t/**\n\t * Checks whether the given node (`child`) can be a child of the given context.\n\t *\n\t *\t\tschema.checkChild( model.document.getRoot(), paragraph ); // -> false\n\t *\n\t *\t\tschema.register( 'paragraph', {\n\t *\t\t\tallowIn: '$root'\n\t *\t\t} );\n\t *\t\tschema.checkChild( model.document.getRoot(), paragraph ); // -> true\n\t *\n\t * Note: When verifying whether the given node can be a child of the given context, the\n\t * schema also verifies the entire context — from its root to its last element. Therefore, it is possible\n\t * for `checkChild()` to return `false` even though the context's last element can contain the checked child.\n\t * It happens if one of the context's elements does not allow its child.\n\t *\n\t * @fires checkChild\n\t * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the child will be checked.\n\t * @param {module:engine/model/node~Node|String} def The child to check.\n\t */\n\tcheckChild( context, def ) {\n\t\t// Note: context and child are already normalized here to a SchemaContext and SchemaCompiledItemDefinition.\n\t\tif ( !def ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn this._checkContextMatch( def, context );\n\t}\n\n\t/**\n\t * Checks whether the given attribute can be applied in the given context (on the last\n\t * item of the context).\n\t *\n\t *\t\tschema.checkAttribute( textNode, 'bold' ); // -> false\n\t *\n\t *\t\tschema.extend( '$text', {\n\t *\t\t\tallowAttributes: 'bold'\n\t *\t\t} );\n\t *\t\tschema.checkAttribute( textNode, 'bold' ); // -> true\n\t *\n\t * @fires checkAttribute\n\t * @param {module:engine/model/schema~SchemaContextDefinition} context The context in which the attribute will be checked.\n\t * @param {String} attributeName\n\t */\n\tcheckAttribute( context, attributeName ) {\n\t\tconst def = this.getDefinition( context.last );\n\n\t\tif ( !def ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn def.allowAttributes.includes( attributeName );\n\t}\n\n\t/**\n\t * Checks whether the given element (`elementToMerge`) can be merged with the specified base element (`positionOrBaseElement`).\n\t *\n\t * In other words — whether `elementToMerge`'s children {@link #checkChild are allowed} in the `positionOrBaseElement`.\n\t *\n\t * This check ensures that elements merged with {@link module:engine/model/writer~Writer#merge `Writer#merge()`}\n\t * will be valid.\n\t *\n\t * Instead of elements, you can pass the instance of the {@link module:engine/model/position~Position} class as the\n\t * `positionOrBaseElement`. It means that the elements before and after the position will be checked whether they can be merged.\n\t *\n\t * @param {module:engine/model/position~Position|module:engine/model/element~Element} positionOrBaseElement The position or base\n\t * element to which the `elementToMerge` will be merged.\n\t * @param {module:engine/model/element~Element} elementToMerge The element to merge. Required if `positionOrBaseElement` is an element.\n\t * @returns {Boolean}\n\t */\n\tcheckMerge( positionOrBaseElement, elementToMerge = null ) {\n\t\tif ( positionOrBaseElement instanceof Position ) {\n\t\t\tconst nodeBefore = positionOrBaseElement.nodeBefore;\n\t\t\tconst nodeAfter = positionOrBaseElement.nodeAfter;\n\n\t\t\tif ( !( nodeBefore instanceof Element ) ) {\n\t\t\t\t/**\n\t\t\t\t * The node before the merge position must be an element.\n\t\t\t\t *\n\t\t\t\t * @error schema-check-merge-no-element-before\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError( 'schema-check-merge-no-element-before: The node before the merge position must be an element.' );\n\t\t\t}\n\n\t\t\tif ( !( nodeAfter instanceof Element ) ) {\n\t\t\t\t/**\n\t\t\t\t * The node after the merge position must be an element.\n\t\t\t\t *\n\t\t\t\t * @error schema-check-merge-no-element-after\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError( 'schema-check-merge-no-element-after: The node after the merge position must be an element.' );\n\t\t\t}\n\n\t\t\treturn this.checkMerge( nodeBefore, nodeAfter );\n\t\t}\n\n\t\tfor ( const child of elementToMerge.getChildren() ) {\n\t\t\tif ( !this.checkChild( positionOrBaseElement, child ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Allows registering a callback to the {@link #checkChild} method calls.\n\t *\n\t * Callbacks allow you to implement rules which are not otherwise possible to achieve\n\t * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.\n\t * For example, by using this method you can disallow elements in specific contexts.\n\t *\n\t * This method is a shorthand for using the {@link #event:checkChild} event. For even better control,\n\t * you can use that event instead.\n\t *\n\t * Example:\n\t *\n\t *\t\t// Disallow heading1 directly inside a blockQuote.\n\t *\t\tschema.addChildCheck( ( context, childDefinition ) => {\n\t *\t\t\tif ( context.endsWith( 'blockQuote' ) && childDefinition.name == 'heading1' ) {\n\t *\t\t\t\treturn false;\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * Which translates to:\n\t *\n\t *\t\tschema.on( 'checkChild', ( evt, args ) => {\n\t *\t\t\tconst context = args[ 0 ];\n\t *\t\t\tconst childDefinition = args[ 1 ];\n\t *\n\t *\t\t\tif ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {\n\t *\t\t\t\t// Prevent next listeners from being called.\n\t *\t\t\t\tevt.stop();\n\t *\t\t\t\t// Set the checkChild()'s return value.\n\t *\t\t\t\tevt.return = false;\n\t *\t\t\t}\n\t *\t\t}, { priority: 'high' } );\n\t *\n\t * @param {Function} callback The callback to be called. It is called with two parameters:\n\t * {@link module:engine/model/schema~SchemaContext} (context) instance and\n\t * {@link module:engine/model/schema~SchemaCompiledItemDefinition} (child-to-check definition).\n\t * The callback may return `true/false` to override `checkChild()`'s return value. If it does not return\n\t * a boolean value, the default algorithm (or other callbacks) will define `checkChild()`'s return value.\n\t */\n\taddChildCheck( callback ) {\n\t\tthis.on( 'checkChild', ( evt, [ ctx, childDef ] ) => {\n\t\t\t// checkChild() was called with a non-registered child.\n\t\t\t// In 99% cases such check should return false, so not to overcomplicate all callbacks\n\t\t\t// don't even execute them.\n\t\t\tif ( !childDef ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst retValue = callback( ctx, childDef );\n\n\t\t\tif ( typeof retValue == 'boolean' ) {\n\t\t\t\tevt.stop();\n\t\t\t\tevt.return = retValue;\n\t\t\t}\n\t\t}, { priority: 'high' } );\n\t}\n\n\t/**\n\t * Allows registering a callback to the {@link #checkAttribute} method calls.\n\t *\n\t * Callbacks allow you to implement rules which are not otherwise possible to achieve\n\t * by using the declarative API of {@link module:engine/model/schema~SchemaItemDefinition}.\n\t * For example, by using this method you can disallow attribute if node to which it is applied\n\t * is contained within some other element (e.g. you want to disallow `bold` on `$text` within `heading1`).\n\t *\n\t * This method is a shorthand for using the {@link #event:checkAttribute} event. For even better control,\n\t * you can use that event instead.\n\t *\n\t * Example:\n\t *\n\t *\t\t// Disallow bold on $text inside heading1.\n\t *\t\tschema.addAttributeCheck( ( context, attributeName ) => {\n\t *\t\t\tif ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {\n\t *\t\t\t\treturn false;\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * Which translates to:\n\t *\n\t *\t\tschema.on( 'checkAttribute', ( evt, args ) => {\n\t *\t\t\tconst context = args[ 0 ];\n\t *\t\t\tconst attributeName = args[ 1 ];\n\t *\n\t *\t\t\tif ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {\n\t *\t\t\t\t// Prevent next listeners from being called.\n\t *\t\t\t\tevt.stop();\n\t *\t\t\t\t// Set the checkAttribute()'s return value.\n\t *\t\t\t\tevt.return = false;\n\t *\t\t\t}\n\t *\t\t}, { priority: 'high' } );\n\t *\n\t * @param {Function} callback The callback to be called. It is called with two parameters:\n\t * {@link module:engine/model/schema~SchemaContext} (context) instance and attribute name.\n\t * The callback may return `true/false` to override `checkAttribute()`'s return value. If it does not return\n\t * a boolean value, the default algorithm (or other callbacks) will define `checkAttribute()`'s return value.\n\t */\n\taddAttributeCheck( callback ) {\n\t\tthis.on( 'checkAttribute', ( evt, [ ctx, attributeName ] ) => {\n\t\t\tconst retValue = callback( ctx, attributeName );\n\n\t\t\tif ( typeof retValue == 'boolean' ) {\n\t\t\t\tevt.stop();\n\t\t\t\tevt.return = retValue;\n\t\t\t}\n\t\t}, { priority: 'high' } );\n\t}\n\n\t/**\n\t * Returns the lowest {@link module:engine/model/schema~Schema#isLimit limit element} containing the entire\n\t * selection/range/position or the root otherwise.\n\t *\n\t * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection|\n\t * module:engine/model/range~Range|module:engine/model/position~Position} selectionOrRangeOrPosition\n\t * The selection/range/position to check.\n\t * @returns {module:engine/model/element~Element} The lowest limit element containing\n\t * the entire `selectionOrRangeOrPosition`.\n\t */\n\tgetLimitElement( selectionOrRangeOrPosition ) {\n\t\tlet element;\n\n\t\tif ( selectionOrRangeOrPosition instanceof Position ) {\n\t\t\telement = selectionOrRangeOrPosition.parent;\n\t\t} else {\n\t\t\tconst ranges = selectionOrRangeOrPosition instanceof Range ?\n\t\t\t\t[ selectionOrRangeOrPosition ] :\n\t\t\t\tArray.from( selectionOrRangeOrPosition.getRanges() );\n\n\t\t\t// Find the common ancestor for all selection's ranges.\n\t\t\telement = ranges\n\t\t\t\t.reduce( ( element, range ) => {\n\t\t\t\t\tconst rangeCommonAncestor = range.getCommonAncestor();\n\n\t\t\t\t\tif ( !element ) {\n\t\t\t\t\t\treturn rangeCommonAncestor;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn element.getCommonAncestor( rangeCommonAncestor, { includeSelf: true } );\n\t\t\t\t}, null );\n\t\t}\n\n\t\twhile ( !this.isLimit( element ) ) {\n\t\t\tif ( element.parent ) {\n\t\t\t\telement = element.parent;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn element;\n\t}\n\n\t/**\n\t * Checks whether the attribute is allowed in selection:\n\t *\n\t * * if the selection is not collapsed, then checks if the attribute is allowed on any of nodes in that range,\n\t * * if the selection is collapsed, then checks if on the selection position there's a text with the\n\t * specified attribute allowed.\n\t *\n\t * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n\t * Selection which will be checked.\n\t * @param {String} attribute The name of the attribute to check.\n\t * @returns {Boolean}\n\t */\n\tcheckAttributeInSelection( selection, attribute ) {\n\t\tif ( selection.isCollapsed ) {\n\t\t\tconst firstPosition = selection.getFirstPosition();\n\t\t\tconst context = [\n\t\t\t\t...firstPosition.getAncestors(),\n\t\t\t\tnew Text( '', selection.getAttributes() )\n\t\t\t];\n\n\t\t\t// Check whether schema allows for a text with the attribute in the selection.\n\t\t\treturn this.checkAttribute( context, attribute );\n\t\t} else {\n\t\t\tconst ranges = selection.getRanges();\n\n\t\t\t// For all ranges, check nodes in them until you find a node that is allowed to have the attribute.\n\t\t\tfor ( const range of ranges ) {\n\t\t\t\tfor ( const value of range ) {\n\t\t\t\t\tif ( this.checkAttribute( value.item, attribute ) ) {\n\t\t\t\t\t\t// If we found a node that is allowed to have the attribute, return true.\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we haven't found such node, return false.\n\t\treturn false;\n\t}\n\n\t/**\n\t * Transforms the given set of ranges into a set of ranges where the given attribute is allowed (and can be applied).\n\t *\n\t * @param {Array.} ranges Ranges to be validated.\n\t * @param {String} attribute The name of the attribute to check.\n\t * @returns {Iterable.} Ranges in which the attribute is allowed.\n\t */\n\t* getValidRanges( ranges, attribute ) {\n\t\tranges = convertToMinimalFlatRanges( ranges );\n\n\t\tfor ( const range of ranges ) {\n\t\t\tyield* this._getValidRangesForRange( range, attribute );\n\t\t}\n\t}\n\n\t/**\n\t * Basing on given `position`, finds and returns a {@link module:engine/model/range~Range range} which is\n\t * nearest to that `position` and is a correct range for selection.\n\t *\n\t * The correct selection range might be collapsed when it is located in a position where the text node can be placed.\n\t * Non-collapsed range is returned when selection can be placed around element marked as an \"object\" in\n\t * the {@link module:engine/model/schema~Schema schema}.\n\t *\n\t * Direction of searching for the nearest correct selection range can be specified as:\n\t *\n\t * * `both` - searching will be performed in both ways,\n\t * * `forward` - searching will be performed only forward,\n\t * * `backward` - searching will be performed only backward.\n\t *\n\t * When valid selection range cannot be found, `null` is returned.\n\t *\n\t * @param {module:engine/model/position~Position} position Reference position where new selection range should be looked for.\n\t * @param {'both'|'forward'|'backward'} [direction='both'] Search direction.\n\t * @returns {module:engine/model/range~Range|null} Nearest selection range or `null` if one cannot be found.\n\t */\n\tgetNearestSelectionRange( position, direction = 'both' ) {\n\t\t// Return collapsed range if provided position is valid.\n\t\tif ( this.checkChild( position, '$text' ) ) {\n\t\t\treturn new Range( position );\n\t\t}\n\n\t\tlet backwardWalker, forwardWalker;\n\n\t\tif ( direction == 'both' || direction == 'backward' ) {\n\t\t\tbackwardWalker = new TreeWalker( { startPosition: position, direction: 'backward' } );\n\t\t}\n\n\t\tif ( direction == 'both' || direction == 'forward' ) {\n\t\t\tforwardWalker = new TreeWalker( { startPosition: position } );\n\t\t}\n\n\t\tfor ( const data of combineWalkers( backwardWalker, forwardWalker ) ) {\n\t\t\tconst type = ( data.walker == backwardWalker ? 'elementEnd' : 'elementStart' );\n\t\t\tconst value = data.value;\n\n\t\t\tif ( value.type == type && this.isObject( value.item ) ) {\n\t\t\t\treturn Range._createOn( value.item );\n\t\t\t}\n\n\t\t\tif ( this.checkChild( value.nextPosition, '$text' ) ) {\n\t\t\t\treturn new Range( value.nextPosition );\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Tries to find position ancestors that allows to insert given node.\n\t * It starts searching from the given position and goes node by node to the top of the model tree\n\t * as long as {@link module:engine/model/schema~Schema#isLimit limit element},\n\t * {@link module:engine/model/schema~Schema#isObject object element} or top-most ancestor won't be reached.\n\t *\n\t * @params {module:engine/model/position~Position} position Position from searching will start.\n\t * @params {module:engine/model/node~Node|String} node Node for which allowed parent should be found or its name.\n\t * @returns {module:engine/model/element~Element|null} element Allowed parent or null if nothing was found.\n\t */\n\tfindAllowedParent( position, node ) {\n\t\tlet parent = position.parent;\n\n\t\twhile ( parent ) {\n\t\t\tif ( this.checkChild( parent, node ) ) {\n\t\t\t\treturn parent;\n\t\t\t}\n\n\t\t\t// Do not split limit elements.\n\t\t\tif ( this.isLimit( parent ) ) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tparent = parent.parent;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Removes attributes disallowed by the schema.\n\t *\n\t * @param {Iterable.} nodes Nodes that will be filtered.\n\t * @param {module:engine/model/writer~Writer} writer\n\t */\n\tremoveDisallowedAttributes( nodes, writer ) {\n\t\tfor ( const node of nodes ) {\n\t\t\tfor ( const attribute of node.getAttributeKeys() ) {\n\t\t\t\tif ( !this.checkAttribute( node, attribute ) ) {\n\t\t\t\t\twriter.removeAttribute( attribute, node );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( node.is( 'element' ) ) {\n\t\t\t\tthis.removeDisallowedAttributes( node.getChildren(), writer );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates an instance of the schema context.\n\t *\n\t * @param {module:engine/model/schema~SchemaContextDefinition} context\n\t * @returns {module:engine/model/schema~SchemaContext}\n\t */\n\tcreateContext( context ) {\n\t\treturn new SchemaContext( context );\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_clearCache() {\n\t\tthis._compiledDefinitions = null;\n\t}\n\n\t/**\n\t * @private\n\t */\n\t_compile() {\n\t\tconst compiledDefinitions = {};\n\t\tconst sourceRules = this._sourceDefinitions;\n\t\tconst itemNames = Object.keys( sourceRules );\n\n\t\tfor ( const itemName of itemNames ) {\n\t\t\tcompiledDefinitions[ itemName ] = compileBaseItemRule( sourceRules[ itemName ], itemName );\n\t\t}\n\n\t\tfor ( const itemName of itemNames ) {\n\t\t\tcompileAllowContentOf( compiledDefinitions, itemName );\n\t\t}\n\n\t\tfor ( const itemName of itemNames ) {\n\t\t\tcompileAllowWhere( compiledDefinitions, itemName );\n\t\t}\n\n\t\tfor ( const itemName of itemNames ) {\n\t\t\tcompileAllowAttributesOf( compiledDefinitions, itemName );\n\t\t\tcompileInheritPropertiesFrom( compiledDefinitions, itemName );\n\t\t}\n\n\t\tfor ( const itemName of itemNames ) {\n\t\t\tcleanUpAllowIn( compiledDefinitions, itemName );\n\t\t\tcleanUpAllowAttributes( compiledDefinitions, itemName );\n\t\t}\n\n\t\tthis._compiledDefinitions = compiledDefinitions;\n\t}\n\n\t/**\n\t * @private\n\t * @param {module:engine/model/schema~SchemaCompiledItemDefinition} def\n\t * @param {module:engine/model/schema~SchemaContext} context\n\t * @param {Number} contextItemIndex\n\t */\n\t_checkContextMatch( def, context, contextItemIndex = context.length - 1 ) {\n\t\tconst contextItem = context.getItem( contextItemIndex );\n\n\t\tif ( def.allowIn.includes( contextItem.name ) ) {\n\t\t\tif ( contextItemIndex == 0 ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tconst parentRule = this.getDefinition( contextItem );\n\n\t\t\t\treturn this._checkContextMatch( parentRule, context, contextItemIndex - 1 );\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Takes a flat range and an attribute name. Traverses the range recursively and deeply to find and return all ranges\n\t * inside the given range on which the attribute can be applied.\n\t *\n\t * This is a helper function for {@link ~Schema#getValidRanges}.\n\t *\n\t * @private\n\t * @param {module:engine/model/range~Range} range Range to process.\n\t * @param {String} attribute The name of the attribute to check.\n\t * @returns {Iterable.} Ranges in which the attribute is allowed.\n\t */\n\t* _getValidRangesForRange( range, attribute ) {\n\t\tlet start = range.start;\n\t\tlet end = range.start;\n\n\t\tfor ( const item of range.getItems( { shallow: true } ) ) {\n\t\t\tif ( item.is( 'element' ) ) {\n\t\t\t\tyield* this._getValidRangesForRange( Range._createIn( item ), attribute );\n\t\t\t}\n\n\t\t\tif ( !this.checkAttribute( item, attribute ) ) {\n\t\t\t\tif ( !start.isEqual( end ) ) {\n\t\t\t\t\tyield new Range( start, end );\n\t\t\t\t}\n\n\t\t\t\tstart = Position._createAfter( item );\n\t\t\t}\n\n\t\t\tend = Position._createAfter( item );\n\t\t}\n\n\t\tif ( !start.isEqual( end ) ) {\n\t\t\tyield new Range( start, end );\n\t\t}\n\t}\n}\n\nmix( Schema, ObservableMixin );\n\n/**\n * Event fired when the {@link #checkChild} method is called. It allows plugging in\n * additional behavior – e.g. implementing rules which cannot be defined using the declarative\n * {@link module:engine/model/schema~SchemaItemDefinition} interface.\n *\n * **Note:** The {@link #addChildCheck} method is a more handy way to register callbacks. Internally,\n * it registers a listener to this event but comes with a simpler API and it is the recommended choice\n * in most of the cases.\n *\n * The {@link #checkChild} method fires an event because it is\n * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can\n * use this event in a various way, but the most important use case is overriding standard behaviour of the\n * `checkChild()` method. Let's see a typical listener template:\n *\n *\t\tschema.on( 'checkChild', ( evt, args ) => {\n *\t\t\tconst context = args[ 0 ];\n *\t\t\tconst childDefinition = args[ 1 ];\n *\t\t}, { priority: 'high' } );\n *\n * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback\n * parameter contains arguments passed to `checkChild( context, child )`. However, the `context` parameter is already\n * normalized to a {@link module:engine/model/schema~SchemaContext} instance and `child` to a\n * {@link module:engine/model/schema~SchemaCompiledItemDefinition} instance, so you don't have to worry about\n * the various ways how `context` and `child` may be passed to `checkChild()`.\n *\n * **Note:** `childDefinition` may be `undefined` if `checkChild()` was called with a non-registered element.\n *\n * So, in order to implement a rule \"disallow `heading1` in `blockQuote`\" you can add such a listener:\n *\n *\t\tschema.on( 'checkChild', ( evt, args ) => {\n *\t\t\tconst context = args[ 0 ];\n *\t\t\tconst childDefinition = args[ 1 ];\n *\n *\t\t\tif ( context.endsWith( 'blockQuote' ) && childDefinition && childDefinition.name == 'heading1' ) {\n *\t\t\t\t// Prevent next listeners from being called.\n *\t\t\t\tevt.stop();\n *\t\t\t\t// Set the checkChild()'s return value.\n *\t\t\t\tevt.return = false;\n *\t\t\t}\n *\t\t}, { priority: 'high' } );\n *\n * Allowing elements in specific contexts will be a far less common use case, because it's normally handled by\n * `allowIn` rule from {@link module:engine/model/schema~SchemaItemDefinition} but if you have a complex scenario\n * where `listItem` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:\n *\n *\t\tschema.on( 'checkChild', ( evt, args ) => {\n *\t\t\tconst context = args[ 0 ];\n *\t\t\tconst childDefinition = args[ 1 ];\n *\n *\t\t\tif ( context.endsWith( 'bar foo' ) && childDefinition.name == 'listItem' ) {\n *\t\t\t\t// Prevent next listeners from being called.\n *\t\t\t\tevt.stop();\n *\t\t\t\t// Set the checkChild()'s return value.\n *\t\t\t\tevt.return = true;\n *\t\t\t}\n *\t\t}, { priority: 'high' } );\n *\n * @event checkChild\n * @param {Array} args The `checkChild()`'s arguments.\n */\n\n/**\n * Event fired when the {@link #checkAttribute} method is called. It allows plugging in\n * additional behavior – e.g. implementing rules which cannot be defined using the declarative\n * {@link module:engine/model/schema~SchemaItemDefinition} interface.\n *\n * **Note:** The {@link #addAttributeCheck} method is a more handy way to register callbacks. Internally,\n * it registers a listener to this event but comes with a simpler API and it is the recommended choice\n * in most of the cases.\n *\n * The {@link #checkAttribute} method fires an event because it's\n * {@link module:utils/observablemixin~ObservableMixin#decorate decorated} with it. Thanks to that you can\n * use this event in a various way, but the most important use case is overriding standard behaviour of the\n * `checkAttribute()` method. Let's see a typical listener template:\n *\n *\t\tschema.on( 'checkAttribute', ( evt, args ) => {\n *\t\t\tconst context = args[ 0 ];\n *\t\t\tconst attributeName = args[ 1 ];\n *\t\t}, { priority: 'high' } );\n *\n * The listener is added with a `high` priority to be executed before the default method is really called. The `args` callback\n * parameter contains arguments passed to `checkAttribute( context, attributeName )`. However, the `context` parameter is already\n * normalized to a {@link module:engine/model/schema~SchemaContext} instance, so you don't have to worry about\n * the various ways how `context` may be passed to `checkAttribute()`.\n *\n * So, in order to implement a rule \"disallow `bold` in a text which is in a `heading1` you can add such a listener:\n *\n *\t\tschema.on( 'checkAttribute', ( evt, args ) => {\n *\t\t\tconst context = args[ 0 ];\n *\t\t\tconst atributeName = args[ 1 ];\n *\n *\t\t\tif ( context.endsWith( 'heading1 $text' ) && attributeName == 'bold' ) {\n *\t\t\t\t// Prevent next listeners from being called.\n *\t\t\t\tevt.stop();\n *\t\t\t\t// Set the checkAttribute()'s return value.\n *\t\t\t\tevt.return = false;\n *\t\t\t}\n *\t\t}, { priority: 'high' } );\n *\n * Allowing attributes in specific contexts will be a far less common use case, because it's normally handled by\n * `allowAttributes` rule from {@link module:engine/model/schema~SchemaItemDefinition} but if you have a complex scenario\n * where `bold` should be allowed only in element `foo` which must be in element `bar`, then this would be the way:\n *\n *\t\tschema.on( 'checkAttribute', ( evt, args ) => {\n *\t\t\tconst context = args[ 0 ];\n *\t\t\tconst atributeName = args[ 1 ];\n *\n *\t\t\tif ( context.endsWith( 'bar foo $text' ) && attributeName == 'bold' ) {\n *\t\t\t\t// Prevent next listeners from being called.\n *\t\t\t\tevt.stop();\n *\t\t\t\t// Set the checkAttribute()'s return value.\n *\t\t\t\tevt.return = true;\n *\t\t\t}\n *\t\t}, { priority: 'high' } );\n *\n * @event checkAttribute\n * @param {Array} args The `checkAttribute()`'s arguments.\n */\n\n/**\n * A definition of a {@link module:engine/model/schema~Schema schema} item.\n *\n * You can define the following rules:\n *\n * * `allowIn` – A string or an array of strings. Defines in which other items this item will be allowed.\n * * `allowAttributes` – A string or an array of strings. Defines allowed attributes of the given item.\n * * `allowContentOf` – A string or an array of strings. Inherits \"allowed children\" from other items.\n * * `allowWhere` – A string or an array of strings. Inherits \"allowed in\" from other items.\n * * `allowAttributesOf` – A string or an array of strings. Inherits attributes from other items.\n * * `inheritTypesFrom` – A string or an array of strings. Inherits `is*` properties of other items.\n * * `inheritAllFrom` – A string. A shorthand for `allowContentOf`, `allowWhere`, `allowAttributesOf`, `inheritTypesFrom`.\n * * Additionally, you can define the following `is*` properties: `isBlock`, `isLimit`, `isObject`, `isInline`. Read about them below.\n *\n * # The is* properties\n *\n * There are 3 commonly used `is*` properties. Their role is to assign additional semantics to schema items.\n * You can define more properties but you will also need to implement support for them in the existing editor features.\n *\n * * `isBlock` – Whether this item is paragraph-like. Generally speaking, content is usually made out of blocks\n * like paragraphs, list items, images, headings, etc. All these elements are marked as blocks. A block\n * should not allow another block inside. Note: There is also the `$block` generic item which has `isBlock` set to `true`.\n * Most block type items will inherit from `$block` (through `inheritAllFrom`).\n * * `isLimit` – It can be understood as whether this element should not be split by Enter.\n * Examples of limit elements: `$root`, table cell, image caption, etc. In other words, all actions that happen inside\n * a limit element are limited to its content. **Note:** All objects (`isObject`) are treated as limit elements, too.\n * * `isObject` – Whether an item is \"self-contained\" and should be treated as a whole. Examples of object elements:\n * `image`, `table`, `video`, etc. **Note:** An object is also a limit, so\n * {@link module:engine/model/schema~Schema#isLimit `isLimit()`} returns `true` for object elements automatically.\n * * `isInline` – Whether an item is \"text-like\" and should be treated as an inline node. Examples of inline elements:\n * `$text`, `softBreak` (`
`), etc.\n *\n * # Generic items\n *\n * There are three basic generic items: `$root`, `$block` and `$text`.\n * They are defined as follows:\n *\n *\t\tthis.schema.register( '$root', {\n *\t\t\tisLimit: true\n *\t\t} );\n *\t\tthis.schema.register( '$block', {\n *\t\t\tallowIn: '$root',\n *\t\t\tisBlock: true\n *\t\t} );\n *\t\tthis.schema.register( '$text', {\n *\t\t\tallowIn: '$block',\n *\t\t\tisInline: true\n *\t\t} );\n *\n * They reflect typical editor content that is contained within one root, consists of several blocks\n * (paragraphs, lists items, headings, images) which, in turn, may contain text inside.\n *\n * By inheriting from the generic items you can define new items which will get extended by other editor features.\n * Read more about generic types in the {@linkTODO Defining schema} guide.\n *\n * # Example definitions\n *\n * Allow `paragraph` in roots and block quotes:\n *\n *\t\tschema.register( 'paragraph', {\n *\t\t\tallowIn: [ '$root', 'blockQuote' ],\n *\t\t\tisBlock: true\n *\t\t} );\n *\n * Allow `paragraph` everywhere where `$block` is allowed (i.e. in `$root`):\n *\n *\t\tschema.register( 'paragraph', {\n *\t\t\tallowWhere: '$block',\n *\t\t\tisBlock: true\n *\t\t} );\n *\n * Make `image` a block object, which is allowed everywhere where `$block` is.\n * Also, allow `src` and `alt` attributes in it:\n *\n *\t\tschema.register( 'image', {\n *\t\t\tallowWhere: '$block',\n *\t\t\tallowAttributes: [ 'src', 'alt' ],\n *\t\t\tisBlock: true,\n *\t\t\tisObject: true\n *\t\t} );\n *\n * Make `caption` allowed in `image` and make it allow all the content of `$block`s (usually, `$text`).\n * Also, mark it as a limit element so it cannot be split:\n *\n *\t\tschema.register( 'caption', {\n *\t\t\tallowIn: 'image',\n *\t\t\tallowContentOf: '$block',\n *\t\t\tisLimit: true\n *\t\t} );\n *\n * Make `listItem` inherit all from `$block` but also allow additional attributes:\n *\n *\t\tschema.register( 'listItem', {\n *\t\t\tinheritAllFrom: '$block',\n *\t\t\tallowAttributes: [ 'listType', 'listIndent' ]\n *\t\t} );\n *\n * Which translates to:\n *\n *\t\tschema.register( 'listItem', {\n *\t\t\tallowWhere: '$block',\n *\t\t\tallowContentOf: '$block',\n *\t\t\tallowAttributesOf: '$block',\n *\t\t\tinheritTypesFrom: '$block',\n *\t\t\tallowAttributes: [ 'listType', 'listIndent' ]\n *\t\t} );\n *\n * # Tips\n *\n * * Check schema definitions of existing features to see how they are defined.\n * * If you want to publish your feature so other developers can use it, try to use\n * generic items as much as possible.\n * * Keep your model clean. Limit it to the actual data and store information in a normalized way.\n * * Remember about definining the `is*` properties. They do not affect the allowed structures, but they can\n * affect how the editor features treat your elements.\n *\n * @typedef {Object} module:engine/model/schema~SchemaItemDefinition\n */\n\n/**\n * A simplified version of {@link module:engine/model/schema~SchemaItemDefinition} after\n * compilation by the {@link module:engine/model/schema~Schema schema}.\n * Rules fed to the schema by {@link module:engine/model/schema~Schema#register}\n * and {@link module:engine/model/schema~Schema#extend} methods are defined in the\n * {@link module:engine/model/schema~SchemaItemDefinition} format.\n * Later on, they are compiled to `SchemaCompiledItemDefition` so when you use e.g.\n * the {@link module:engine/model/schema~Schema#getDefinition} method you get the compiled version.\n *\n * The compiled version contains only the following properties:\n *\n * * The `name` property,\n * * The `is*` properties,\n * * The `allowIn` array,\n * * The `allowAttributes` array.\n *\n * @typedef {Object} module:engine/model/schema~SchemaCompiledItemDefinition\n */\n\n/**\n * A schema context — a list of ancestors of a given position in the document.\n *\n * Considering such position:\n *\n *\t\t<$root>\n *\t\t\t
\n *\t\t\t\t\n *\t\t\t\t\t^\n *\t\t\t\t\n *\t\t\t
\n *\t\t\n *\n * The context of this position is its {@link module:engine/model/position~Position#getAncestors lists of ancestors}:\n *\n *\t\t[ rootElement, blockQuoteElement, paragraphElement ]\n *\n * Contexts are used in the {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`} and\n * {@link module:engine/model/schema~Schema#event:checkAttribute `Schema#checkAttribute`} events as a definition\n * of a place in the document where the check occurs. The context instances are created based on the first arguments\n * of the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`} and\n * {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} methods so when\n * using these methods you need to use {@link module:engine/model/schema~SchemaContextDefinition}s.\n */\nexport class SchemaContext {\n\t/**\n\t * Creates an instance of the context.\n\t *\n\t * @param {module:engine/model/schema~SchemaContextDefinition} context\n\t */\n\tconstructor( context ) {\n\t\tif ( context instanceof SchemaContext ) {\n\t\t\treturn context;\n\t\t}\n\n\t\tif ( typeof context == 'string' ) {\n\t\t\tcontext = [ context ];\n\t\t} else if ( !Array.isArray( context ) ) {\n\t\t\t// `context` is item or position.\n\t\t\t// Position#getAncestors() doesn't accept any parameters but it works just fine here.\n\t\t\tcontext = context.getAncestors( { includeSelf: true } );\n\t\t}\n\n\t\tif ( context[ 0 ] && typeof context[ 0 ] != 'string' && context[ 0 ].is( 'documentFragment' ) ) {\n\t\t\tcontext.shift();\n\t\t}\n\n\t\tthis._items = context.map( mapContextItem );\n\t}\n\n\t/**\n\t * The number of items.\n\t *\n\t * @type {Number}\n\t */\n\tget length() {\n\t\treturn this._items.length;\n\t}\n\n\t/**\n\t * The last item (the lowest node).\n\t *\n\t * @type {module:engine/model/schema~SchemaContextItem}\n\t */\n\tget last() {\n\t\treturn this._items[ this._items.length - 1 ];\n\t}\n\n\t/**\n\t * Iterable interface.\n\t *\n\t * Iterates over all context items.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this._items[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Returns a new schema context instance with an additional item.\n\t *\n\t * Item can be added as:\n\t *\n\t * \t\tconst context = new SchemaContext( [ '$root' ] );\n\t *\n\t * \t\t// An element.\n\t * \t\tconst fooElement = writer.createElement( 'fooElement' );\n\t * \t\tconst newContext = context.push( fooElement ); // [ '$root', 'fooElement' ]\n\t *\n\t * \t\t// A text node.\n\t * \t\tconst text = writer.createText( 'foobar' );\n\t * \t\tconst newContext = context.push( text ); // [ '$root', '$text' ]\n\t *\n\t * \t\t// A string (element name).\n\t * \t\tconst newContext = context.push( 'barElement' ); // [ '$root', 'barElement' ]\n\t *\n\t * **Note** {@link module:engine/model/node~Node} that is already in the model tree will be added as the only item\n\t * (without ancestors).\n\t *\n\t * @param {String|module:engine/model/node~Node|Array} item An item that will be added\n\t * to the current context.\n\t * @returns {module:engine/model/schema~SchemaContext} A new schema context instance with an additional item.\n\t */\n\tpush( item ) {\n\t\tconst ctx = new SchemaContext( [ item ] );\n\n\t\tctx._items = [ ...this._items, ...ctx._items ];\n\n\t\treturn ctx;\n\t}\n\n\t/**\n\t * Gets an item on the given index.\n\t *\n\t * @returns {module:engine/model/schema~SchemaContextItem}\n\t */\n\tgetItem( index ) {\n\t\treturn this._items[ index ];\n\t}\n\n\t/**\n\t * Returns the names of items.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t* getNames() {\n\t\tyield* this._items.map( item => item.name );\n\t}\n\n\t/**\n\t * Checks whether the context ends with the given nodes.\n\t *\n\t *\t\tconst ctx = new SchemaContext( [ rootElement, paragraphElement, textNode ] );\n\t *\n\t *\t\tctx.endsWith( '$text' ); // -> true\n\t *\t\tctx.endsWith( 'paragraph $text' ); // -> true\n\t *\t\tctx.endsWith( '$root' ); // -> false\n\t *\t\tctx.endsWith( 'paragraph' ); // -> false\n\t *\n\t * @param {String} query\n\t * @returns {Boolean}\n\t */\n\tendsWith( query ) {\n\t\treturn Array.from( this.getNames() ).join( ' ' ).endsWith( query );\n\t}\n}\n\n/**\n * The definition of a {@link module:engine/model/schema~SchemaContext schema context}.\n *\n * Contexts can be created in multiple ways:\n *\n * * By defining a **node** – in this cases this node and all its ancestors will be used.\n * * By defining a **position** in the document – in this case all its ancestors will be used.\n * * By defining an **array of nodes** – in this case this array defines the entire context.\n * * By defining a **name of node** - in this case node will be \"mocked\". It is not recommended because context\n * will be unrealistic (e.g. attributes of these nodes are not specified). However, at times this may be the only\n * way to define the context (e.g. when checking some hypothetical situation).\n * * By defining an **array of node names** (potentially, mixed with real nodes) – The same as **name of node**\n * but it is possible to create a path.\n * * By defining a {@link module:engine/model/schema~SchemaContext} instance - in this case the same instance as provided\n * will be return.\n *\n * Examples of context definitions passed to the {@link module:engine/model/schema~Schema#checkChild `Schema#checkChild()`}\n * method:\n *\n *\t\t// Assuming that we have a $root > blockQuote > paragraph structure, the following code\n *\t\t// will check node 'foo' in the following context:\n *\t\t// [ rootElement, blockQuoteElement, paragraphElement ]\n *\t\tconst contextDefinition = paragraphElement;\n * \t\tconst childToCheck = 'foo';\n *\t\tschema.checkChild( contextDefinition, childToCheck );\n *\n *\t\t// Also check in [ rootElement, blockQuoteElement, paragraphElement ].\n *\t\tschema.checkChild( model.createPositionAt( paragraphElement, 0 ), 'foo' );\n *\n *\t\t// Check in [ rootElement, paragraphElement ].\n *\t\tschema.checkChild( [ rootElement, paragraphElement ], 'foo' );\n *\n *\t\t// Check only fakeParagraphElement.\n *\t\tschema.checkChild( 'paragraph', 'foo' );\n *\n *\t\t// Check in [ fakeRootElement, fakeBarElement, paragraphElement ].\n *\t\tschema.checkChild( [ '$root', 'bar', paragraphElement ], 'foo' );\n *\n * All these `checkChild()` calls will fire {@link module:engine/model/schema~Schema#event:checkChild `Schema#checkChild`}\n * events in which `args[ 0 ]` is an instance of the context. Therefore, you can write a listener like this:\n *\n *\t\tschema.on( 'checkChild', ( evt, args ) => {\n *\t\t\tconst ctx = args[ 0 ];\n *\n *\t\t\tconsole.log( Array.from( ctx.getNames() ) );\n *\t\t} );\n *\n * Which will log the following:\n *\n *\t\t[ '$root', 'blockQuote', 'paragraph' ]\n *\t\t[ '$root', 'paragraph' ]\n *\t\t[ '$root', 'bar', 'paragraph' ]\n *\n * Note: When using the {@link module:engine/model/schema~Schema#checkAttribute `Schema#checkAttribute()`} method\n * you may want to check whether a text node may have an attribute. A {@link module:engine/model/text~Text} is a\n * correct way to define a context so you can do this:\n *\n *\t\tschema.checkAttribute( textNode, 'bold' );\n *\n * But sometimes you want to check whether a text at a given position might've had some attribute,\n * in which case you can create a context by mising an array of elements with a `'$text'` string:\n *\n *\t\t// Check in [ rootElement, paragraphElement, textNode ].\n *\t\tschema.checkChild( [ ...positionInParagraph.getAncestors(), '$text' ], 'bold' );\n *\n * @typedef {module:engine/model/node~Node|module:engine/model/position~Position|module:engine/model/schema~SchemaContext|\n * String|Array.} module:engine/model/schema~SchemaContextDefinition\n */\n\n/**\n * An item of the {@link module:engine/model/schema~SchemaContext schema context}.\n *\n * It contains 3 properties:\n *\n * * `name` – the name of this item,\n * * `* getAttributeKeys()` – a generator of keys of item attributes,\n * * `getAttribute( keyName )` – a method to get attribute values.\n *\n * The context item interface is a highly simplified version of {@link module:engine/model/node~Node} and its role\n * is to expose only the information which schema checks are able to provide (which is the name of the node and\n * node's attributes).\n *\n *\t\tschema.on( 'checkChild', ( evt, args ) => {\n *\t\t\tconst ctx = args[ 0 ];\n *\t\t\tconst firstItem = ctx.getItem( 0 );\n *\n *\t\t\tconsole.log( firstItem.name ); // -> '$root'\n *\t\t\tconsole.log( firstItem.getAttribute( 'foo' ) ); // -> 'bar'\n *\t\t\tconsole.log( Array.from( firstItem.getAttributeKeys() ) ); // -> [ 'foo', 'faa' ]\n *\t\t} );\n *\n * @typedef {Object} module:engine/model/schema~SchemaContextItem\n */\n\nfunction compileBaseItemRule( sourceItemRules, itemName ) {\n\tconst itemRule = {\n\t\tname: itemName,\n\n\t\tallowIn: [],\n\t\tallowContentOf: [],\n\t\tallowWhere: [],\n\n\t\tallowAttributes: [],\n\t\tallowAttributesOf: [],\n\n\t\tinheritTypesFrom: []\n\t};\n\n\tcopyTypes( sourceItemRules, itemRule );\n\n\tcopyProperty( sourceItemRules, itemRule, 'allowIn' );\n\tcopyProperty( sourceItemRules, itemRule, 'allowContentOf' );\n\tcopyProperty( sourceItemRules, itemRule, 'allowWhere' );\n\n\tcopyProperty( sourceItemRules, itemRule, 'allowAttributes' );\n\tcopyProperty( sourceItemRules, itemRule, 'allowAttributesOf' );\n\n\tcopyProperty( sourceItemRules, itemRule, 'inheritTypesFrom' );\n\n\tmakeInheritAllWork( sourceItemRules, itemRule );\n\n\treturn itemRule;\n}\n\nfunction compileAllowContentOf( compiledDefinitions, itemName ) {\n\tfor ( const allowContentOfItemName of compiledDefinitions[ itemName ].allowContentOf ) {\n\t\t// The allowContentOf property may point to an unregistered element.\n\t\tif ( compiledDefinitions[ allowContentOfItemName ] ) {\n\t\t\tconst allowedChildren = getAllowedChildren( compiledDefinitions, allowContentOfItemName );\n\n\t\t\tallowedChildren.forEach( allowedItem => {\n\t\t\t\tallowedItem.allowIn.push( itemName );\n\t\t\t} );\n\t\t}\n\t}\n\n\tdelete compiledDefinitions[ itemName ].allowContentOf;\n}\n\nfunction compileAllowWhere( compiledDefinitions, itemName ) {\n\tfor ( const allowWhereItemName of compiledDefinitions[ itemName ].allowWhere ) {\n\t\tconst inheritFrom = compiledDefinitions[ allowWhereItemName ];\n\n\t\t// The allowWhere property may point to an unregistered element.\n\t\tif ( inheritFrom ) {\n\t\t\tconst allowedIn = inheritFrom.allowIn;\n\n\t\t\tcompiledDefinitions[ itemName ].allowIn.push( ...allowedIn );\n\t\t}\n\t}\n\n\tdelete compiledDefinitions[ itemName ].allowWhere;\n}\n\nfunction compileAllowAttributesOf( compiledDefinitions, itemName ) {\n\tfor ( const allowAttributeOfItem of compiledDefinitions[ itemName ].allowAttributesOf ) {\n\t\tconst inheritFrom = compiledDefinitions[ allowAttributeOfItem ];\n\n\t\tif ( inheritFrom ) {\n\t\t\tconst inheritAttributes = inheritFrom.allowAttributes;\n\n\t\t\tcompiledDefinitions[ itemName ].allowAttributes.push( ...inheritAttributes );\n\t\t}\n\t}\n\n\tdelete compiledDefinitions[ itemName ].allowAttributesOf;\n}\n\nfunction compileInheritPropertiesFrom( compiledDefinitions, itemName ) {\n\tconst item = compiledDefinitions[ itemName ];\n\n\tfor ( const inheritPropertiesOfItem of item.inheritTypesFrom ) {\n\t\tconst inheritFrom = compiledDefinitions[ inheritPropertiesOfItem ];\n\n\t\tif ( inheritFrom ) {\n\t\t\tconst typeNames = Object.keys( inheritFrom ).filter( name => name.startsWith( 'is' ) );\n\n\t\t\tfor ( const name of typeNames ) {\n\t\t\t\tif ( !( name in item ) ) {\n\t\t\t\t\titem[ name ] = inheritFrom[ name ];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdelete item.inheritTypesFrom;\n}\n\n// Remove items which weren't registered (because it may break some checks or we'd need to complicate them).\n// Make sure allowIn doesn't contain repeated values.\nfunction cleanUpAllowIn( compiledDefinitions, itemName ) {\n\tconst itemRule = compiledDefinitions[ itemName ];\n\tconst existingItems = itemRule.allowIn.filter( itemToCheck => compiledDefinitions[ itemToCheck ] );\n\n\titemRule.allowIn = Array.from( new Set( existingItems ) );\n}\n\nfunction cleanUpAllowAttributes( compiledDefinitions, itemName ) {\n\tconst itemRule = compiledDefinitions[ itemName ];\n\n\titemRule.allowAttributes = Array.from( new Set( itemRule.allowAttributes ) );\n}\n\nfunction copyTypes( sourceItemRules, itemRule ) {\n\tfor ( const sourceItemRule of sourceItemRules ) {\n\t\tconst typeNames = Object.keys( sourceItemRule ).filter( name => name.startsWith( 'is' ) );\n\n\t\tfor ( const name of typeNames ) {\n\t\t\titemRule[ name ] = sourceItemRule[ name ];\n\t\t}\n\t}\n}\n\nfunction copyProperty( sourceItemRules, itemRule, propertyName ) {\n\tfor ( const sourceItemRule of sourceItemRules ) {\n\t\tif ( typeof sourceItemRule[ propertyName ] == 'string' ) {\n\t\t\titemRule[ propertyName ].push( sourceItemRule[ propertyName ] );\n\t\t} else if ( Array.isArray( sourceItemRule[ propertyName ] ) ) {\n\t\t\titemRule[ propertyName ].push( ...sourceItemRule[ propertyName ] );\n\t\t}\n\t}\n}\n\nfunction makeInheritAllWork( sourceItemRules, itemRule ) {\n\tfor ( const sourceItemRule of sourceItemRules ) {\n\t\tconst inheritFrom = sourceItemRule.inheritAllFrom;\n\n\t\tif ( inheritFrom ) {\n\t\t\titemRule.allowContentOf.push( inheritFrom );\n\t\t\titemRule.allowWhere.push( inheritFrom );\n\t\t\titemRule.allowAttributesOf.push( inheritFrom );\n\t\t\titemRule.inheritTypesFrom.push( inheritFrom );\n\t\t}\n\t}\n}\n\nfunction getAllowedChildren( compiledDefinitions, itemName ) {\n\tconst itemRule = compiledDefinitions[ itemName ];\n\n\treturn getValues( compiledDefinitions ).filter( def => def.allowIn.includes( itemRule.name ) );\n}\n\nfunction getValues( obj ) {\n\treturn Object.keys( obj ).map( key => obj[ key ] );\n}\n\nfunction mapContextItem( ctxItem ) {\n\tif ( typeof ctxItem == 'string' ) {\n\t\treturn {\n\t\t\tname: ctxItem,\n\n\t\t\t* getAttributeKeys() {},\n\n\t\t\tgetAttribute() {}\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\t// '$text' means text nodes and text proxies.\n\t\t\tname: ctxItem.is( 'element' ) ? ctxItem.name : '$text',\n\n\t\t\t* getAttributeKeys() {\n\t\t\t\tyield* ctxItem.getAttributeKeys();\n\t\t\t},\n\n\t\t\tgetAttribute( key ) {\n\t\t\t\treturn ctxItem.getAttribute( key );\n\t\t\t}\n\t\t};\n\t}\n}\n\n// Generator function returning values from provided walkers, switching between them at each iteration. If only one walker\n// is provided it will return data only from that walker.\n//\n// @param {module:engine/module/treewalker~TreeWalker} [backward] Walker iterating in backward direction.\n// @param {module:engine/module/treewalker~TreeWalker} [forward] Walker iterating in forward direction.\n// @returns {Iterable.} Object returned at each iteration contains `value` and `walker` (informing which walker returned\n// given value) fields.\nfunction* combineWalkers( backward, forward ) {\n\tlet done = false;\n\n\twhile ( !done ) {\n\t\tdone = true;\n\n\t\tif ( backward ) {\n\t\t\tconst step = backward.next();\n\n\t\t\tif ( !step.done ) {\n\t\t\t\tdone = false;\n\t\t\t\tyield {\n\t\t\t\t\twalker: backward,\n\t\t\t\t\tvalue: step.value\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tif ( forward ) {\n\t\t\tconst step = forward.next();\n\n\t\t\tif ( !step.done ) {\n\t\t\t\tdone = false;\n\t\t\t\tyield {\n\t\t\t\t\twalker: forward,\n\t\t\t\t\tvalue: step.value\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Takes an array of non-intersecting ranges. For each of them gets minimal flat ranges covering that range and returns\n// all those minimal flat ranges.\n//\n// @param {Array.} ranges Ranges to process.\n// @returns {Iterable.} Minimal flat ranges of given `ranges`.\nfunction* convertToMinimalFlatRanges( ranges ) {\n\tfor ( const range of ranges ) {\n\t\tyield* range.getMinimalFlatRanges();\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/upcastdispatcher\n */\n\nimport ViewConsumable from './viewconsumable';\nimport ModelRange from '../model/range';\nimport ModelPosition from '../model/position';\nimport { SchemaContext } from '../model/schema';\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * `UpcastDispatcher` is a central point of {@link module:engine/view/view view} conversion, which is a process of\n * converting given {@link module:engine/view/documentfragment~DocumentFragment view document fragment} or\n * {@link module:engine/view/element~Element} into another structure.\n * In default application, {@link module:engine/view/view view} is converted to {@link module:engine/model/model}.\n *\n * During conversion process, for all {@link module:engine/view/node~Node view nodes} from the converted view document fragment,\n * `UpcastDispatcher` fires corresponding events. Special callbacks called \"converters\" should listen to\n * `UpcastDispatcher` for those events.\n *\n * Each callback, as the second argument, is passed a special object `data` that has `viewItem`, `modelCursor` and\n * `modelRange` properties. `viewItem` property contains {@link module:engine/view/node~Node view node} or\n * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}\n * that is converted at the moment and might be handled by the callback. `modelRange` property should be used to save the result\n * of conversion and is always a {@link module:engine/model/range~Range} when conversion result is correct.\n * `modelCursor` property is a {@link module:engine/model/position~Position position} on which conversion result will be inserted\n * and is a context according to {@link module:engine/model/schema~Schema schema} will be checked before the conversion.\n * See also {@link ~UpcastDispatcher#convert}. It is also shared by reference by all callbacks listening to given event.\n *\n * The third parameter passed to a callback is an instance of {@link ~UpcastDispatcher}\n * which provides additional tools for converters.\n *\n * Examples of providing callbacks for `UpcastDispatcher`:\n *\n *\t\t// Converter for links ().\n *\t\tupcastDispatcher.on( 'element:a', ( evt, data, conversionApi ) => {\n *\t\t\tif ( conversionApi.consumable.consume( data.viewItem, { name: true, attributes: [ 'href' ] } ) ) {\n *\t\t\t\t// element is inline and is represented by an attribute in the model.\n *\t\t\t\t// This is why we need to convert only children.\n *\t\t\t\tconst { modelRange } = conversionApi.convertChildren( data.viewItem, data.modelCursor );\n *\n *\t\t\t\tfor ( let item of modelRange.getItems() ) {\n *\t\t\t\t\tif ( conversionApi.schema.checkAttribute( item, 'linkHref' ) ) {\n *\t\t\t\t\t\tconversionApi.writer.setAttribute( 'linkHref', data.viewItem.getAttribute( 'href' ), item );\n *\t\t\t\t\t}\n *\t\t\t\t}\n *\t\t\t}\n *\t\t} );\n *\n *\t\t// Convert all elements which have no custom converter into paragraph (autoparagraphing).\n * \tdata.viewToModel.on( 'element', ( evt, data, conversionApi ) => {\n * \t \t// When element is already consumed by higher priority converters then do nothing.\n * \t \tif ( conversionApi.consumable.test( data.viewItem, { name: data.viewItem.name } ) ) {\n * \t \t\t\tconst paragraph = conversionApi.writer.createElement( 'paragraph' );\n *\n * \t \t\t\t// Find allowed parent for paragraph that we are going to insert. If current parent does not allow\n * \t \t\t\t// to insert paragraph but one of the ancestors does then split nodes to allowed parent.\n * \t \t\t\tconst splitResult = conversionApi.splitToAllowedParent( paragraph, data.modelCursor );\n *\n * \t \t\t\t// When there is no split result it means that we can't insert paragraph in this position.\n * \t \t\t\tif ( splitResult ) {\n * \t \t\t\t\t// Insert paragraph in allowed position.\n * \t \t\t\t\tconversionApi.writer.insert( paragraph, splitResult.position );\n *\n * \t \t\t\t\t// Convert children to paragraph.\n * \t \t\t\t\tconst { modelRange } = conversionApi.convertChildren(\n * \t \t\t\t\t\tdata.viewItem,\n * \t \t\t\t\t\tconversionApi.writer.createPositionAt( paragraph, 0 )\n * \t \t\t\t\t);\n *\n * \t\t\t\t\t\t// Set as conversion result, attribute converters may use this property.\n * \t \t\t\t\tdata.modelRange = conversionApi.writer.createRange(\n * \t \t\t\t\t\tconversionApi.writer.createPositionBefore( paragraph ),\n * \t \t\t\t\t\tmodelRange.end\n * \t \t\t\t\t);\n *\n * \t \t\t\t\t// Continue conversion inside paragraph.\n * \t \t\t\t\tdata.modelCursor = data.modelRange.end;\n * \t \t\t\t}\n * \t \t\t}\n * \t \t}\n * \t }, { priority: 'low' } );\n *\n * Before each conversion process, `UpcastDispatcher` fires {@link ~UpcastDispatcher#event:viewCleanup}\n * event which can be used to prepare tree view for conversion.\n *\n * @mixes module:utils/emittermixin~EmitterMixin\n * @fires viewCleanup\n * @fires element\n * @fires text\n * @fires documentFragment\n */\nexport default class UpcastDispatcher {\n\t/**\n\t * Creates a `UpcastDispatcher` that operates using passed API.\n\t *\n\t * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi\n\t * @param {Object} [conversionApi] Additional properties for interface that will be passed to events fired\n\t * by `UpcastDispatcher`.\n\t */\n\tconstructor( conversionApi = {} ) {\n\t\t/**\n\t\t * List of elements that will be checked after conversion process and if element in the list will be empty it\n\t\t * will be removed from conversion result.\n\t\t *\n\t\t * After conversion process list is cleared.\n\t\t *\n\t\t * @protected\n\t\t * @type {Set}\n\t\t */\n\t\tthis._removeIfEmpty = new Set();\n\n\t\t/**\n\t\t * Position in the temporary structure where the converted content is inserted. The structure reflect the context of\n\t\t * the target position where the content will be inserted. This property is build based on the context parameter of the\n\t\t * convert method.\n\t\t *\n\t\t * @private\n\t\t * @type {module:engine/model/position~Position|null}\n\t\t */\n\t\tthis._modelCursor = null;\n\n\t\t/**\n\t\t * Interface passed by dispatcher to the events callbacks.\n\t\t *\n\t\t * @member {module:engine/conversion/upcastdispatcher~UpcastConversionApi}\n\t\t */\n\t\tthis.conversionApi = Object.assign( {}, conversionApi );\n\n\t\t// `convertItem`, `convertChildren` and `splitToAllowedParent` are bound to this `UpcastDispatcher`\n\t\t// instance and set on `conversionApi`. This way only a part of `UpcastDispatcher` API is exposed.\n\t\tthis.conversionApi.convertItem = this._convertItem.bind( this );\n\t\tthis.conversionApi.convertChildren = this._convertChildren.bind( this );\n\t\tthis.conversionApi.splitToAllowedParent = this._splitToAllowedParent.bind( this );\n\t}\n\n\t/**\n\t * Starts the conversion process. The entry point for the conversion.\n\t *\n\t * @fires element\n\t * @fires text\n\t * @fires documentFragment\n\t * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element} viewItem\n\t * Part of the view to be converted.\n\t * @param {module:engine/model/writer~Writer} writer Instance of model writer.\n\t * @param {module:engine/model/schema~SchemaContextDefinition} [context=['$root']] Elements will be converted according to this context.\n\t * @returns {module:engine/model/documentfragment~DocumentFragment} Model data that is a result of the conversion process\n\t * wrapped in `DocumentFragment`. Converted marker elements will be set as that document fragment's\n\t * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.\n\t */\n\tconvert( viewItem, writer, context = [ '$root' ] ) {\n\t\tthis.fire( 'viewCleanup', viewItem );\n\n\t\t// Create context tree and set position in the top element.\n\t\t// Items will be converted according to this position.\n\t\tthis._modelCursor = createContextTree( context, writer );\n\n\t\t// Store writer in conversion as a conversion API\n\t\t// to be sure that conversion process will use the same batch.\n\t\tthis.conversionApi.writer = writer;\n\n\t\t// Create consumable values list for conversion process.\n\t\tthis.conversionApi.consumable = ViewConsumable.createFrom( viewItem );\n\n\t\t// Custom data stored by converter for conversion process.\n\t\tthis.conversionApi.store = {};\n\n\t\t// Do the conversion.\n\t\tconst { modelRange } = this._convertItem( viewItem, this._modelCursor );\n\n\t\t// Conversion result is always a document fragment so let's create this fragment.\n\t\tconst documentFragment = writer.createDocumentFragment();\n\n\t\t// When there is a conversion result.\n\t\tif ( modelRange ) {\n\t\t\t// Remove all empty elements that was added to #_removeIfEmpty list.\n\t\t\tthis._removeEmptyElements();\n\n\t\t\t// Move all items that was converted to context tree to document fragment.\n\t\t\tfor ( const item of Array.from( this._modelCursor.parent.getChildren() ) ) {\n\t\t\t\twriter.append( item, documentFragment );\n\t\t\t}\n\n\t\t\t// Extract temporary markers elements from model and set as static markers collection.\n\t\t\tdocumentFragment.markers = extractMarkersFromModelFragment( documentFragment, writer );\n\t\t}\n\n\t\t// Clear context position.\n\t\tthis._modelCursor = null;\n\n\t\t// Clear split elements.\n\t\tthis._removeIfEmpty.clear();\n\n\t\t// Clear conversion API.\n\t\tthis.conversionApi.writer = null;\n\t\tthis.conversionApi.store = null;\n\n\t\t// Return fragment as conversion result.\n\t\treturn documentFragment;\n\t}\n\n\t/**\n\t * @private\n\t * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertItem\n\t */\n\t_convertItem( viewItem, modelCursor ) {\n\t\tconst data = Object.assign( { viewItem, modelCursor, modelRange: null } );\n\n\t\tif ( viewItem.is( 'element' ) ) {\n\t\t\tthis.fire( 'element:' + viewItem.name, data, this.conversionApi );\n\t\t} else if ( viewItem.is( 'text' ) ) {\n\t\t\tthis.fire( 'text', data, this.conversionApi );\n\t\t} else {\n\t\t\tthis.fire( 'documentFragment', data, this.conversionApi );\n\t\t}\n\n\t\t// Handle incorrect conversion result.\n\t\tif ( data.modelRange && !( data.modelRange instanceof ModelRange ) ) {\n\t\t\t/**\n\t\t\t * Incorrect conversion result was dropped.\n\t\t\t *\n\t\t\t * {@link module:engine/model/range~Range Model range} should be a conversion result.\n\t\t\t *\n\t\t\t * @error view-conversion-dispatcher-incorrect-result\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'view-conversion-dispatcher-incorrect-result: Incorrect conversion result was dropped.' );\n\t\t}\n\n\t\treturn { modelRange: data.modelRange, modelCursor: data.modelCursor };\n\t}\n\n\t/**\n\t * @private\n\t * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#convertChildren\n\t */\n\t_convertChildren( viewItem, modelCursor ) {\n\t\tconst modelRange = new ModelRange( modelCursor );\n\t\tlet nextModelCursor = modelCursor;\n\n\t\tfor ( const viewChild of Array.from( viewItem.getChildren() ) ) {\n\t\t\tconst result = this._convertItem( viewChild, nextModelCursor );\n\n\t\t\tif ( result.modelRange instanceof ModelRange ) {\n\t\t\t\tmodelRange.end = result.modelRange.end;\n\t\t\t\tnextModelCursor = result.modelCursor;\n\t\t\t}\n\t\t}\n\n\t\treturn { modelRange, modelCursor: nextModelCursor };\n\t}\n\n\t/**\n\t * @private\n\t * @see module:engine/conversion/upcastdispatcher~UpcastConversionApi#splitToAllowedParent\n\t */\n\t_splitToAllowedParent( node, modelCursor ) {\n\t\t// Try to find allowed parent.\n\t\tconst allowedParent = this.conversionApi.schema.findAllowedParent( modelCursor, node );\n\n\t\t// When there is no parent that allows to insert node then return `null`.\n\t\tif ( !allowedParent ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// When current position parent allows to insert node then return this position.\n\t\tif ( allowedParent === modelCursor.parent ) {\n\t\t\treturn { position: modelCursor };\n\t\t}\n\n\t\t// When allowed parent is in context tree.\n\t\tif ( this._modelCursor.parent.getAncestors().includes( allowedParent ) ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Split element to allowed parent.\n\t\tconst splitResult = this.conversionApi.writer.split( modelCursor, allowedParent );\n\n\t\t// Remember all elements that are created as a result of split.\n\t\t// This is important because at the end of conversion we want to remove all empty split elements.\n\t\t//\n\t\t// Loop through positions between elements in range (except split result position) and collect parents.\n\t\t// [pos][pos][omit][pos][pos]\n\t\tfor ( const position of splitResult.range.getPositions() ) {\n\t\t\tif ( !position.isEqual( splitResult.position ) ) {\n\t\t\t\tthis._removeIfEmpty.add( position.parent );\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tposition: splitResult.position,\n\t\t\tcursorParent: splitResult.range.end.parent\n\t\t};\n\t}\n\n\t/**\n\t * Checks if {@link #_removeIfEmpty} contains empty elements and remove them.\n\t * We need to do it smart because there could be elements that are not empty because contains\n\t * other empty elements and after removing its children they become available to remove.\n\t * We need to continue iterating over split elements as long as any element will be removed.\n\t *\n\t * @private\n\t */\n\t_removeEmptyElements() {\n\t\tlet removed = false;\n\n\t\tfor ( const element of this._removeIfEmpty ) {\n\t\t\tif ( element.isEmpty ) {\n\t\t\t\tthis.conversionApi.writer.remove( element );\n\t\t\t\tthis._removeIfEmpty.delete( element );\n\t\t\t\tremoved = true;\n\t\t\t}\n\t\t}\n\n\t\tif ( removed ) {\n\t\t\tthis._removeEmptyElements();\n\t\t}\n\t}\n\n\t/**\n\t * Fired before the first conversion event, at the beginning of upcast (view to model conversion) process.\n\t *\n\t * @event viewCleanup\n\t * @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/element~Element}\n\t * viewItem Part of the view to be converted.\n\t */\n\n\t/**\n\t * Fired when {@link module:engine/view/element~Element} is converted.\n\t *\n\t * `element` is a namespace event for a class of events. Names of actually called events follow this pattern:\n\t * `element:` where `elementName` is the name of converted element. This way listeners may listen to\n\t * all elements conversion or to conversion of specific elements.\n\t *\n\t * @event element\n\t * @param {Object} data Conversion data. Keep in mind that this object is shared by reference between all\n\t * callbacks that will be called. This means that callbacks can override values if needed, and those values will\n\t * be available in other callbacks.\n\t * @param {module:engine/view/item~Item} data.viewItem Converted item.\n\t * @param {module:engine/model/position~Position} data.modelCursor Position where a converter should start changes.\n\t * Change this value for the next converter to tell where the conversion should continue.\n\t * @param {module:engine/model/range~Range} data.modelRange The current state of conversion result. Every change to\n\t * converted element should be reflected by setting or modifying this property.\n\t * @param {module:engine/conversion/upcastdispatcher~UpcastConversionApi} conversionApi Conversion utilities to be used by callback.\n\t */\n\n\t/**\n\t * Fired when {@link module:engine/view/text~Text} is converted.\n\t *\n\t * @event text\n\t * @see #event:element\n\t */\n\n\t/**\n\t * Fired when {@link module:engine/view/documentfragment~DocumentFragment} is converted.\n\t *\n\t * @event documentFragment\n\t * @see #event:element\n\t */\n}\n\nmix( UpcastDispatcher, EmitterMixin );\n\n// Traverses given model item and searches elements which marks marker range. Found element is removed from\n// DocumentFragment but path of this element is stored in a Map which is then returned.\n//\n// @param {module:engine/view/documentfragment~DocumentFragment|module:engine/view/node~Node} modelItem Fragment of model.\n// @returns {Map} List of static markers.\nfunction extractMarkersFromModelFragment( modelItem, writer ) {\n\tconst markerElements = new Set();\n\tconst markers = new Map();\n\n\t// Create ModelTreeWalker.\n\tconst range = ModelRange._createIn( modelItem ).getItems();\n\n\t// Walk through DocumentFragment and collect marker elements.\n\tfor ( const item of range ) {\n\t\t// Check if current element is a marker.\n\t\tif ( item.name == '$marker' ) {\n\t\t\tmarkerElements.add( item );\n\t\t}\n\t}\n\n\t// Walk through collected marker elements store its path and remove its from the DocumentFragment.\n\tfor ( const markerElement of markerElements ) {\n\t\tconst markerName = markerElement.getAttribute( 'data-name' );\n\t\tconst currentPosition = writer.createPositionBefore( markerElement );\n\n\t\t// When marker of given name is not stored it means that we have found the beginning of the range.\n\t\tif ( !markers.has( markerName ) ) {\n\t\t\tmarkers.set( markerName, new ModelRange( currentPosition.clone() ) );\n\t\t// Otherwise is means that we have found end of the marker range.\n\t\t} else {\n\t\t\tmarkers.get( markerName ).end = currentPosition.clone();\n\t\t}\n\n\t\t// Remove marker element from DocumentFragment.\n\t\twriter.remove( markerElement );\n\t}\n\n\treturn markers;\n}\n\n// Creates model fragment according to given context and returns position in top element.\nfunction createContextTree( contextDefinition, writer ) {\n\tlet position;\n\n\tfor ( const item of new SchemaContext( contextDefinition ) ) {\n\t\tconst attributes = {};\n\n\t\tfor ( const key of item.getAttributeKeys() ) {\n\t\t\tattributes[ key ] = item.getAttribute( key );\n\t\t}\n\n\t\tconst current = writer.createElement( item.name, attributes );\n\n\t\tif ( position ) {\n\t\t\twriter.append( current, position );\n\t\t}\n\n\t\tposition = ModelPosition._createAt( current, 0 );\n\t}\n\n\treturn position;\n}\n\n/**\n * Conversion interface that is registered for given {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}\n * and is passed as one of parameters when {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher dispatcher}\n * fires it's events.\n *\n * @interface module:engine/conversion/upcastdispatcher~UpcastConversionApi\n */\n\n/**\n * Starts conversion of given item by firing an appropriate event.\n *\n * Every fired event is passed (as first parameter) an object with `modelRange` property. Every event may set and/or\n * modify that property. When all callbacks are done, the final value of `modelRange` property is returned by this method.\n * The `modelRange` must be {@link module:engine/model/range~Range model range} or `null` (as set by default).\n *\n * @method #convertItem\n * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element\n * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text\n * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment\n * @param {module:engine/view/item~Item} viewItem Item to convert.\n * @param {module:engine/model/position~Position} modelCursor Position of conversion.\n * @returns {Object} result Conversion result.\n * @returns {module:engine/model/range~Range|null} result.modelRange Model range containing result of item conversion,\n * created and modified by callbacks attached to fired event, or `null` if the conversion result was incorrect.\n * @returns {module:engine/model/position~Position} result.modelCursor Position where conversion should be continued.\n */\n\n/**\n * Starts conversion of all children of given item by firing appropriate events for all those children.\n *\n * @method #convertChildren\n * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element\n * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:text\n * @fires module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:documentFragment\n * @param {module:engine/view/item~Item} viewItem Item to convert.\n * @param {module:engine/model/position~Position} modelCursor Position of conversion.\n * @returns {Object} result Conversion result.\n * @returns {module:engine/model/range~Range} result.modelRange Model range containing results of conversion of all children of given item.\n * When no children was converted then range is collapsed.\n * @returns {module:engine/model/position~Position} result.modelCursor Position where conversion should be continued.\n */\n\n/**\n * Checks {@link module:engine/model/schema~Schema schema} to find allowed parent for element that we are going to insert\n * starting from given position. If current parent does not allow to insert element but one of the ancestors does then\n * split nodes to allowed parent.\n *\n * If schema allows to insert node in given position, nothing is split and object with that position is returned.\n *\n * If it was not possible to find allowed parent, `null` is returned, nothing is split.\n *\n * Otherwise, ancestors are split and object with position and the copy of the split element is returned.\n *\n * For instance, if `` is not allowed in `` but is allowed in `$root`:\n *\n *\t\tfoo[]bar\n *\n * \t-> split for `` ->\n *\n * \tfoo[]bar\n *\n * In the sample above position between `` elements will be returned as `position` and the second `paragraph`\n * as `cursorParent`.\n *\n * @method #splitToAllowedParent\n * @param {module:engine/model/position~Position} position Position on which element is going to be inserted.\n * @param {module:engine/model/node~Node} node Node to insert.\n * @returns {Object|null} Split result. If it was not possible to find allowed position `null` is returned.\n * @returns {module:engine/model/position~Position} position between split elements.\n * @returns {module:engine/model/element~Element} [cursorParent] Element inside which cursor should be placed to\n * continue conversion. When element is not defined it means that there was no split.\n */\n\n/**\n * Stores information about what parts of processed view item are still waiting to be handled. After a piece of view item\n * was converted, appropriate consumable value should be {@link module:engine/conversion/viewconsumable~ViewConsumable#consume consumed}.\n *\n * @member {module:engine/conversion/viewconsumable~ViewConsumable} #consumable\n */\n\n/**\n * Custom data stored by converters for conversion process. Custom properties of this object can be defined and use to\n * pass parameters between converters.\n *\n * The difference between this property and `data` parameter of\n * {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element} is that `data` parameters allows you\n * to pass parameters within a single event and `store` within the whole conversion.\n *\n * @member {Object} #store\n */\n\n/**\n * The model's schema instance.\n *\n * @member {module:engine/model/schema~Schema} #schema\n */\n\n/**\n * The {@link module:engine/model/writer~Writer} instance used to manipulate data during conversion.\n *\n * @member {module:engine/model/writer~Writer} #writer\n */\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/controller/datacontroller\n */\n\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\nimport Mapper from '../conversion/mapper';\n\nimport DowncastDispatcher from '../conversion/downcastdispatcher';\nimport { insertText } from '../conversion/downcasthelpers';\n\nimport UpcastDispatcher from '../conversion/upcastdispatcher';\nimport { convertText, convertToModelFragment } from '../conversion/upcasthelpers';\n\nimport ViewDocumentFragment from '../view/documentfragment';\nimport ViewDocument from '../view/document';\nimport ViewDowncastWriter from '../view/downcastwriter';\n\nimport ModelRange from '../model/range';\n\n/**\n * Controller for the data pipeline. The data pipeline controls how data is retrieved from the document\n * and set inside it. Hence, the controller features two methods which allow to {@link ~DataController#get get}\n * and {@link ~DataController#set set} data of the {@link ~DataController#model model}\n * using given:\n *\n * * {@link module:engine/dataprocessor/dataprocessor~DataProcessor data processor},\n * * downcast converters,\n * * upcast converters.\n *\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class DataController {\n\t/**\n\t * Creates a data controller instance.\n\t *\n\t * @param {module:engine/model/model~Model} model Data model.\n\t * @param {module:engine/dataprocessor/dataprocessor~DataProcessor} [dataProcessor] Data processor that should be used\n\t * by the controller.\n\t */\n\tconstructor( model, dataProcessor ) {\n\t\t/**\n\t\t * Data model.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/model~Model}\n\t\t */\n\t\tthis.model = model;\n\n\t\t/**\n\t\t * Data processor used during the conversion.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/dataprocessor/dataprocessor~DataProcessor}\n\t\t */\n\t\tthis.processor = dataProcessor;\n\n\t\t/**\n\t\t * Mapper used for the conversion. It has no permanent bindings, because they are created when getting data and\n\t\t * cleared directly after the data are converted. However, the mapper is defined as a class property, because\n\t\t * it needs to be passed to the `DowncastDispatcher` as a conversion API.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/conversion/mapper~Mapper}\n\t\t */\n\t\tthis.mapper = new Mapper();\n\n\t\t/**\n\t\t * Downcast dispatcher used by the {@link #get get method}. Downcast converters should be attached to it.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/conversion/downcastdispatcher~DowncastDispatcher}\n\t\t */\n\t\tthis.downcastDispatcher = new DowncastDispatcher( {\n\t\t\tmapper: this.mapper\n\t\t} );\n\t\tthis.downcastDispatcher.on( 'insert:$text', insertText(), { priority: 'lowest' } );\n\n\t\t/**\n\t\t * Upcast dispatcher used by the {@link #set set method}. Upcast converters should be attached to it.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/conversion/upcastdispatcher~UpcastDispatcher}\n\t\t */\n\t\tthis.upcastDispatcher = new UpcastDispatcher( {\n\t\t\tschema: model.schema\n\t\t} );\n\n\t\t// Define default converters for text and elements.\n\t\t//\n\t\t// Note that if there is no default converter for the element it will be skipped, for instance `foo` will be\n\t\t// converted to nothing. We add `convertToModelFragment` as a last converter so it converts children of that\n\t\t// element to the document fragment so `foo` will be converted to `foo` if there is no converter for ``.\n\t\tthis.upcastDispatcher.on( 'text', convertText(), { priority: 'lowest' } );\n\t\tthis.upcastDispatcher.on( 'element', convertToModelFragment(), { priority: 'lowest' } );\n\t\tthis.upcastDispatcher.on( 'documentFragment', convertToModelFragment(), { priority: 'lowest' } );\n\n\t\tthis.decorate( 'init' );\n\n\t\t// Fire `ready` event when initialisation has completed. Such low level listener gives possibility\n\t\t// to plug into initialisation pipeline without interrupting the initialisation flow.\n\t\tthis.on( 'init', () => {\n\t\t\tthis.fire( 'ready' );\n\t\t}, { priority: 'lowest' } );\n\t}\n\n\t/**\n\t * Returns the model's data converted by downcast dispatchers attached to {@link #downcastDispatcher} and\n\t * formatted by the {@link #processor data processor}.\n\t *\n\t * @param {Object} [options]\n\t * @param {String} [options.rootName='main'] Root name.\n\t * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `empty` by default,\n\t * which means whenever editor content is considered empty, an empty string will be returned. To turn off trimming completely\n\t * use `'none'`. In such cases exact content will be returned (for example `

 

` for an empty editor).\n\t * @returns {String} Output data.\n\t */\n\tget( options ) {\n\t\tconst { rootName = 'main', trim = 'empty' } = options || {};\n\n\t\tif ( !this._checkIfRootsExists( [ rootName ] ) ) {\n\t\t\t/**\n\t\t\t * Cannot get data from a non-existing root. This error is thrown when {@link #get DataController#get() method}\n\t\t\t * is called with non-existent root name. For example, if there is an editor instance with only `main` root,\n\t\t\t * calling {@link #get} like:\n\t\t\t *\n\t\t\t *\t\tdata.get( 'root2' );\n\t\t\t *\n\t\t\t * will throw this error.\n\t\t\t *\n\t\t\t * @error datacontroller-get-non-existent-root\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'datacontroller-get-non-existent-root: Attempting to get data from a non-existing root.' );\n\t\t}\n\n\t\tconst root = this.model.document.getRoot( rootName );\n\n\t\tif ( trim === 'empty' && !this.model.hasContent( root, { ignoreWhitespaces: true } ) ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn this.stringify( root );\n\t}\n\n\t/**\n\t * Returns the content of the given {@link module:engine/model/element~Element model's element} or\n\t * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast converters\n\t * attached to {@link #downcastDispatcher} and formatted by the {@link #processor data processor}.\n\t *\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment\n\t * Element whose content will be stringified.\n\t * @returns {String} Output data.\n\t */\n\tstringify( modelElementOrFragment ) {\n\t\t// Model -> view.\n\t\tconst viewDocumentFragment = this.toView( modelElementOrFragment );\n\n\t\t// View -> data.\n\t\treturn this.processor.toData( viewDocumentFragment );\n\t}\n\n\t/**\n\t * Returns the content of the given {@link module:engine/model/element~Element model element} or\n\t * {@link module:engine/model/documentfragment~DocumentFragment model document fragment} converted by the downcast\n\t * converters attached to {@link #downcastDispatcher} to a\n\t * {@link module:engine/view/documentfragment~DocumentFragment view document fragment}.\n\t *\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} modelElementOrFragment\n\t * Element or document fragment whose content will be converted.\n\t * @returns {module:engine/view/documentfragment~DocumentFragment} Output view DocumentFragment.\n\t */\n\ttoView( modelElementOrFragment ) {\n\t\t// Clear bindings so the call to this method gives correct results.\n\t\tthis.mapper.clearBindings();\n\n\t\t// First, convert elements.\n\t\tconst modelRange = ModelRange._createIn( modelElementOrFragment );\n\n\t\tconst viewDocumentFragment = new ViewDocumentFragment();\n\n\t\t// Create separate ViewDowncastWriter just for data conversion purposes.\n\t\t// We have no view controller and rendering do DOM in DataController so view.change() block is not used here.\n\t\tconst viewWriter = new ViewDowncastWriter( new ViewDocument() );\n\t\tthis.mapper.bindElements( modelElementOrFragment, viewDocumentFragment );\n\n\t\tthis.downcastDispatcher.convertInsert( modelRange, viewWriter );\n\n\t\tif ( !modelElementOrFragment.is( 'documentFragment' ) ) {\n\t\t\t// Then, if a document element is converted, convert markers.\n\t\t\t// From all document markers, get those, which \"intersect\" with the converter element.\n\t\t\tconst markers = _getMarkersRelativeToElement( modelElementOrFragment );\n\n\t\t\tfor ( const [ name, range ] of markers ) {\n\t\t\t\tthis.downcastDispatcher.convertMarkerAdd( name, range, viewWriter );\n\t\t\t}\n\t\t}\n\n\t\treturn viewDocumentFragment;\n\t}\n\n\t/**\n\t * Sets initial input data parsed by the {@link #processor data processor} and\n\t * converted by the {@link #upcastDispatcher view-to-model converters}.\n\t * Initial data can be set only to document that {@link module:engine/model/document~Document#version} is equal 0.\n\t *\n\t * **Note** This method is {@link module:utils/observablemixin~ObservableMixin#decorate decorated} which is\n\t * used by e.g. collaborative editing plugin that syncs remote data on init.\n\t *\n\t * When data is passed as a string it is initialized on a default `main` root:\n\t *\n\t *\t\tdataController.init( '

Foo

' ); // Initializes data on the `main` root.\n\t *\n\t * To initialize data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:\n\t *\n\t *\t\tdataController.init( { main: '

Foo

', title: '

Bar

' } ); // Initializes data on the `main` and `title` roots.\n\t *\n\t * @fires init\n\t * @param {String|Object.} data Input data as a string or an object containing `rootName` - `data`\n\t * pairs to initialize data on multiple roots at once.\n\t * @returns {Promise} Promise that is resolved after the data is set on the editor.\n\t */\n\tinit( data ) {\n\t\tif ( this.model.document.version ) {\n\t\t\t/**\n\t\t\t * Cannot set initial data to not empty {@link module:engine/model/document~Document}.\n\t\t\t * Initial data should be set once, during {@link module:core/editor/editor~Editor} initialization,\n\t\t\t * when the {@link module:engine/model/document~Document#version} is equal 0.\n\t\t\t *\n\t\t\t * @error datacontroller-init-document-not-empty\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'datacontroller-init-document-not-empty: Trying to set initial data to not empty document.' );\n\t\t}\n\n\t\tlet initialData = {};\n\t\tif ( typeof data === 'string' ) {\n\t\t\tinitialData.main = data; // Default root is 'main'. To initiate data on a different root, object should be passed.\n\t\t} else {\n\t\t\tinitialData = data;\n\t\t}\n\n\t\tif ( !this._checkIfRootsExists( Object.keys( initialData ) ) ) {\n\t\t\t/**\n\t\t\t * Cannot init data on a non-existing root. This error is thrown when {@link #init DataController#init() method}\n\t\t\t * is called with non-existent root name. For example, if there is an editor instance with only `main` root,\n\t\t\t * calling {@link #init} like:\n\t\t\t *\n\t\t\t * \t\tdata.init( { main: '

Foo

', root2: '

Bar

' } );\n\t\t\t *\n\t\t\t * will throw this error.\n\t\t\t *\n\t\t\t * @error datacontroller-init-non-existent-root\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'datacontroller-init-non-existent-root: Attempting to init data on a non-existing root.' );\n\t\t}\n\n\t\tthis.model.enqueueChange( 'transparent', writer => {\n\t\t\tfor ( const rootName of Object.keys( initialData ) ) {\n\t\t\t\tconst modelRoot = this.model.document.getRoot( rootName );\n\t\t\t\twriter.insert( this.parse( initialData[ rootName ], modelRoot ), modelRoot, 0 );\n\t\t\t}\n\t\t} );\n\n\t\treturn Promise.resolve();\n\t}\n\n\t/**\n\t * Sets input data parsed by the {@link #processor data processor} and\n\t * converted by the {@link #upcastDispatcher view-to-model converters}.\n\t * This method can be used any time to replace existing editor data by the new one without clearing the\n\t * {@link module:engine/model/document~Document#history document history}.\n\t *\n\t * This method also creates a batch with all the changes applied. If all you need is to parse data, use\n\t * the {@link #parse} method.\n\t *\n\t * When data is passed as a string it is set on a default `main` root:\n\t *\n\t *\t\tdataController.set( '

Foo

' ); // Sets data on the `main` root.\n\t *\n\t * To set data on a different root or multiple roots at once, object containing `rootName` - `data` pairs should be passed:\n\t *\n\t *\t\tdataController.set( { main: '

Foo

', title: '

Bar

' } ); // Sets data on the `main` and `title` roots.\n\t *\n\t * @param {String|Object.} data Input data as a string or an object containing `rootName` - `data`\n\t * pairs to set data on multiple roots at once.\n\t */\n\tset( data ) {\n\t\tlet newData = {};\n\t\tif ( typeof data === 'string' ) {\n\t\t\tnewData.main = data; // Default root is 'main'. To set data on a different root, object should be passed.\n\t\t} else {\n\t\t\tnewData = data;\n\t\t}\n\n\t\tif ( !this._checkIfRootsExists( Object.keys( newData ) ) ) {\n\t\t\t/**\n\t\t\t * Cannot set data on a non-existing root. This error is thrown when {@link #set DataController#set() method}\n\t\t\t * is called with non-existent root name. For example, if there is an editor instance with only `main` root,\n\t\t\t * calling {@link #set} like:\n\t\t\t *\n\t\t\t * \t\tdata.set( { main: '

Foo

', root2: '

Bar

' } );\n\t\t\t *\n\t\t\t * will throw this error.\n\t\t\t *\n\t\t\t * @error datacontroller-set-non-existent-root\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'datacontroller-set-non-existent-root: Attempting to set data on a non-existing root.' );\n\t\t}\n\n\t\tthis.model.enqueueChange( 'transparent', writer => {\n\t\t\twriter.setSelection( null );\n\t\t\twriter.removeSelectionAttribute( this.model.document.selection.getAttributeKeys() );\n\n\t\t\tfor ( const rootName of Object.keys( newData ) ) {\n\t\t\t\t// Save to model.\n\t\t\t\tconst modelRoot = this.model.document.getRoot( rootName );\n\n\t\t\t\twriter.remove( writer.createRangeIn( modelRoot ) );\n\t\t\t\twriter.insert( this.parse( newData[ rootName ], modelRoot ), modelRoot, 0 );\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * Returns the data parsed by the {@link #processor data processor} and then converted by upcast converters\n\t * attached to the {@link #upcastDispatcher}.\n\t *\n\t * @see #set\n\t * @param {String} data Data to parse.\n\t * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will\n\t * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.\n\t * @returns {module:engine/model/documentfragment~DocumentFragment} Parsed data.\n\t */\n\tparse( data, context = '$root' ) {\n\t\t// data -> view\n\t\tconst viewDocumentFragment = this.processor.toView( data );\n\n\t\t// view -> model\n\t\treturn this.toModel( viewDocumentFragment, context );\n\t}\n\n\t/**\n\t * Returns the result of the given {@link module:engine/view/element~Element view element} or\n\t * {@link module:engine/view/documentfragment~DocumentFragment view document fragment} converted by the\n\t * {@link #upcastDispatcher view-to-model converters}, wrapped by {@link module:engine/model/documentfragment~DocumentFragment}.\n\t *\n\t * When marker elements were converted during the conversion process, it will be set as a document fragment's\n\t * {@link module:engine/model/documentfragment~DocumentFragment#markers static markers map}.\n\t *\n\t * @param {module:engine/view/element~Element|module:engine/view/documentfragment~DocumentFragment} viewElementOrFragment\n\t * Element or document fragment whose content will be converted.\n\t * @param {module:engine/model/schema~SchemaContextDefinition} [context='$root'] Base context in which the view will\n\t * be converted to the model. See: {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#convert}.\n\t * @returns {module:engine/model/documentfragment~DocumentFragment} Output document fragment.\n\t */\n\ttoModel( viewElementOrFragment, context = '$root' ) {\n\t\treturn this.model.change( writer => {\n\t\t\treturn this.upcastDispatcher.convert( viewElementOrFragment, writer, context );\n\t\t} );\n\t}\n\n\t/**\n\t * Removes all event listeners set by the DataController.\n\t */\n\tdestroy() {\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Checks if all provided root names are existing editor roots.\n\t *\n\t * @private\n\t * @param {Array.} rootNames Root names to check.\n\t * @returns {Boolean} Whether all provided root names are existing editor roots.\n\t */\n\t_checkIfRootsExists( rootNames ) {\n\t\tfor ( const rootName of rootNames ) {\n\t\t\tif ( !this.model.document.getRootNames().includes( rootName ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Event fired once data initialisation has finished.\n\t *\n\t * @event ready\n\t */\n\n\t/**\n\t * Event fired after {@link #init init() method} has been run. It can be {@link #listenTo listened to} to adjust/modify\n\t * the initialisation flow. However, if the `init` event is stopped or prevented, the {@link #event:ready ready event}\n\t * should be fired manually.\n\t *\n\t * The `init` event is fired by decorated {@link #init} method.\n\t * See {@link module:utils/observablemixin~ObservableMixin#decorate} for more information and samples.\n\t *\n\t * @event init\n\t */\n}\n\nmix( DataController, ObservableMixin );\n\n// Helper function for downcast conversion.\n//\n// Takes a document element (element that is added to a model document) and checks which markers are inside it\n// and which markers are containing it. If the marker is intersecting with element, the intersection is returned.\nfunction _getMarkersRelativeToElement( element ) {\n\tconst result = [];\n\tconst doc = element.root.document;\n\n\tif ( !doc ) {\n\t\treturn [];\n\t}\n\n\tconst elementRange = ModelRange._createIn( element );\n\n\tfor ( const marker of doc.model.markers ) {\n\t\tconst intersection = elementRange.getIntersection( marker.getRange() );\n\n\t\tif ( intersection ) {\n\t\t\tresult.push( [ marker.name, intersection ] );\n\t\t}\n\t}\n\n\treturn result;\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/conversion/conversion\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport UpcastHelpers from './upcasthelpers';\nimport DowncastHelpers from './downcasthelpers';\n\n/**\n * A utility class that helps add converters to upcast and downcast dispatchers.\n *\n * We recommend reading the {@glink framework/guides/architecture/editing-engine Editing engine architecture} guide first to\n * understand the core concepts of the conversion mechanisms.\n *\n * An instance of the conversion manager is available in the\n * {@link module:core/editor/editor~Editor#conversion `editor.conversion`} property\n * and by default has the following groups of dispatchers (i.e. directions of conversion):\n *\n * * `downcast` (editing and data downcasts)\n * * `editingDowncast`\n * * `dataDowncast`\n * * `upcast`\n *\n * # One-way converters\n *\n * To add a converter to a specific group, use the {@link module:engine/conversion/conversion~Conversion#for `for()`}\n * method:\n *\n *\t\t// Add a converter to editing downcast and data downcast.\n *\t\teditor.conversion.for( 'downcast' ).elementToElement( config ) );\n *\n *\t\t// Add a converter to the data pipepline only:\n *\t\teditor.conversion.for( 'dataDowncast' ).elementToElement( dataConversionConfig ) );\n *\n *\t\t// And a slightly different one for the editing pipeline:\n *\t\teditor.conversion.for( 'editingDowncast' ).elementToElement( editingConversionConfig ) );\n *\n * See {@link module:engine/conversion/conversion~Conversion#for `for()`} method documentation to learn more about\n * available conversion helpers and how to use your custom ones.\n *\n * # Two-way converters\n *\n * Besides using one-way converters via the `for()` method, you can also use other methods available in this\n * class to add two-way converters (upcast and downcast):\n *\n * * {@link module:engine/conversion/conversion~Conversion#elementToElement `elementToElement()`} –\n * Model element to view element and vice versa.\n * * {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement()`} –\n * Model attribute to view element and vice versa.\n * * {@link module:engine/conversion/conversion~Conversion#attributeToAttribute `attributeToAttribute()`} –\n * Model attribute to view element and vice versa.\n */\nexport default class Conversion {\n\t/**\n\t * Creates a new conversion instance.\n\t *\n\t * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|\n\t * Array.} downcastDispatchers\n\t * @param {module:engine/conversion/upcastdispatcher~UpcastDispatcher|\n\t * Array.} upcastDispatchers\n\t */\n\tconstructor( downcastDispatchers, upcastDispatchers ) {\n\t\t/**\n\t\t * Maps dispatchers group name to ConversionHelpers instances.\n\t\t *\n\t\t * @private\n\t\t * @member {Map.}\n\t\t */\n\t\tthis._helpers = new Map();\n\n\t\t// Define default 'downcast' & 'upcast' dispatchers groups. Those groups are always available as two-way converters needs them.\n\t\tthis._downcast = Array.isArray( downcastDispatchers ) ? downcastDispatchers : [ downcastDispatchers ];\n\t\tthis._createConversionHelpers( { name: 'downcast', dispatchers: this._downcast, isDowncast: true } );\n\n\t\tthis._upcast = Array.isArray( upcastDispatchers ) ? upcastDispatchers : [ upcastDispatchers ];\n\t\tthis._createConversionHelpers( { name: 'upcast', dispatchers: this._upcast, isDowncast: false } );\n\t}\n\n\t/**\n\t * Define an alias for registered dispatcher.\n\t *\n\t *\t\tconst conversion = new Conversion(\n\t *\t\t\t[ dataDowncastDispatcher, editingDowncastDispatcher ],\n\t *\t\t\tupcastDispatcher\n\t *\t\t);\n\t *\n\t *\t\tconversion.addAlias( 'dataDowncast', dataDowncastDispatcher );\n\t *\n\t * @param {String} alias An alias of a dispatcher.\n\t * @param {module:engine/conversion/downcastdispatcher~DowncastDispatcher|\n\t * module:engine/conversion/upcastdispatcher~UpcastDispatcher} dispatcher Dispatcher which should have an alias.\n\t */\n\taddAlias( alias, dispatcher ) {\n\t\tconst isDowncast = this._downcast.includes( dispatcher );\n\t\tconst isUpcast = this._upcast.includes( dispatcher );\n\n\t\tif ( !isUpcast && !isDowncast ) {\n\t\t\t/**\n\t\t\t * Trying to register and alias for a dispatcher that nas not been registered.\n\t\t\t *\n\t\t\t * @error conversion-add-alias-dispatcher-not-registered\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'conversion-add-alias-dispatcher-not-registered: ' +\n\t\t\t\t'Trying to register and alias for a dispatcher that nas not been registered.' );\n\t\t}\n\n\t\tthis._createConversionHelpers( { name: alias, dispatchers: [ dispatcher ], isDowncast } );\n\t}\n\n\t/**\n\t * Provides a chainable API to assign converters to conversion dispatchers group.\n\t *\n\t * If the given group name has not been registered, the\n\t * {@link module:utils/ckeditorerror~CKEditorError `conversion-for-unknown-group` error} is thrown.\n\t *\n\t * You can use conversion helpers available directly in the `for()` chain or your custom ones via\n\t * the {@link module:engine/conversion/conversionhelpers~ConversionHelpers#add `add()`} method.\n\t *\n\t * # Using bulit-in conversion helpers\n\t *\n\t * The `for()` chain comes with a set of conversion helpers which you can use like this:\n\t *\n\t *\t\teditor.conversion.for( 'downcast' )\n\t *\t\t\t.elementToElement( config1 ) // Adds an element-to-element downcast converter.\n\t *\t\t\t.attributeToElement( config2 ); // Adds an attribute-to-element downcast converter.\n\t *\n\t *\t\teditor.conversion.for( 'upcast' )\n\t *\t\t\t.elementToAttribute( config3 ); // Adds an element-to-attribute upcast converter.\n\t *\n\t * Refer to the documentation of built-in conversion helpers to learn about their configuration options.\n\t *\n\t * * downcast (model-to-view) conversion helpers:\n\t *\n\t *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#elementToElement `elementToElement()`},\n\t *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToElement `attributeToElement()`},\n\t *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#attributeToAttribute `attributeToAttribute()`}.\n\t *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToElement `markerToElement()`}.\n\t *\t* {@link module:engine/conversion/downcasthelpers~DowncastHelpers#markerToHighlight `markerToHighlight()`}.\n\t *\n\t * * upcast (view-to-model) conversion helpers:\n\t *\n\t *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToElement `elementToElement()`},\n\t *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToAttribute `elementToAttribute()`},\n\t *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#attributeToAttribute `attributeToAttribute()`}.\n\t *\t* {@link module:engine/conversion/upcasthelpers~UpcastHelpers#elementToMarker `elementToMarker()`}.\n\t *\n\t * # Using custom conversion helpers\n\t *\n\t * If you need to implement a nontypical converter, you can do so by calling:\n\t *\n\t *\t\teditor.conversion.for( direction ).add( customHelper );\n\t *\n\t * The `.add()` method takes exactly one parameter, which is a function. This function should accept one parameter that\n\t * is a dispatcher instance. The function should add an actual converter to the passed dispatcher instance.\n\t *\n\t * Example:\n\t *\n\t *\t\teditor.conversion.for( 'upcast' ).add( dispatcher => {\n\t *\t\t\tdispatcher.on( 'element:a', ( evt, data, conversionApi ) => {\n\t *\t\t\t\t// Do something with a view
element.\n\t *\t\t\t} );\n\t *\t\t} );\n\t *\n\t * Refer to the documentation of {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher}\n\t * and {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher} to learn how to write\n\t * custom converters.\n\t *\n\t * @param {String} groupName The name of dispatchers group to add the converters to.\n\t * @returns {module:engine/conversion/downcasthelpers~DowncastHelpers|module:engine/conversion/upcasthelpers~UpcastHelpers}\n\t */\n\tfor( groupName ) {\n\t\tif ( !this._helpers.has( groupName ) ) {\n\t\t\t/**\n\t\t\t * Trying to add a converter to an unknown dispatchers group.\n\t\t\t *\n\t\t\t * @error conversion-for-unknown-group\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'conversion-for-unknown-group: Trying to add a converter to an unknown dispatchers group.' );\n\t\t}\n\n\t\treturn this._helpers.get( groupName );\n\t}\n\n\t/**\n\t * Sets up converters between the model and the view that convert a model element to a view element (and vice versa).\n\t * For example, the model `Foo` is `

Foo

` in the view.\n\t *\n\t *\t\t// A simple conversion from the `paragraph` model element to the `

` view element (and vice versa).\n\t *\t\teditor.conversion.elementToElement( { model: 'paragraph', view: 'p' } );\n\t *\n\t *\t\t// Override other converters by specifying a converter definition with a higher priority.\n\t *\t\teditor.conversion.elementToElement( { model: 'paragraph', view: 'div', converterPriority: 'high' } );\n\t *\n\t *\t\t// View specified as an object instead of a string.\n\t *\t\teditor.conversion.elementToElement( {\n\t *\t\t\tmodel: 'fancyParagraph',\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'p',\n\t *\t\t\t\tclasses: 'fancy'\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\t// Use `upcastAlso` to define other view elements that should also be converted to a `paragraph` element.\n\t *\t\teditor.conversion.elementToElement( {\n\t *\t\t\tmodel: 'paragraph',\n\t *\t\t\tview: 'p',\n\t *\t\t\tupcastAlso: [\n\t *\t\t\t\t'div',\n\t *\t\t\t\t{\n\t *\t\t\t\t\t// Any element with the `display: block` style.\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\tdisplay: 'block'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t]\n\t *\t\t} );\n\t *\n\t *\t\t// `upcastAlso` set as callback enables a conversion of a wide range of different view elements.\n\t *\t\teditor.conversion.elementToElement( {\n\t *\t\t\tmodel: 'heading',\n\t *\t\t\tview: 'h2',\n\t *\t\t\t// Convert \"headling-like\" paragraphs to headings.\n\t *\t\t\tupcastAlso: viewElement => {\n\t *\t\t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n\t *\n\t *\t\t\t\tif ( !fontSize ) {\n\t *\t\t\t\t\treturn null;\n\t *\t\t\t\t}\n\t *\n\t *\t\t\t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n\t *\n\t *\t\t\t\tif ( !match ) {\n\t *\t\t\t\t\treturn null;\n\t *\t\t\t\t}\n\t *\n\t *\t\t\t\tconst size = Number( match[ 1 ] );\n\t *\n\t *\t\t\t\tif ( size > 26 ) {\n\t *\t\t\t\t\t// Returned value can be an object with the matched properties.\n\t *\t\t\t\t\t// These properties will be \"consumed\" during the conversion.\n\t *\t\t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n\t *\n\t *\t\t\t\t\treturn { name: true, styles: [ 'font-size' ] };\n\t *\t\t\t\t}\n\t *\n\t *\t\t\t\treturn null;\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * `definition.model` is a `String` with a model element name to convert from or to.\n\t * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.\n\t *\n\t * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.\n\t */\n\telementToElement( definition ) {\n\t\t// Set up downcast converter.\n\t\tthis.for( 'downcast' ).elementToElement( definition );\n\n\t\t// Set up upcast converter.\n\t\tfor ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {\n\t\t\tthis.for( 'upcast' )\n\t\t\t\t.elementToElement( {\n\t\t\t\t\tmodel,\n\t\t\t\t\tview,\n\t\t\t\t\tconverterPriority: definition.converterPriority\n\t\t\t\t} );\n\t\t}\n\t}\n\n\t/**\n\t * Sets up converters between the model and the view that convert a model attribute to a view element (and vice versa).\n\t * For example, a model text node with `\"Foo\"` as data and the `bold` attribute is `Foo` in the view.\n\t *\n\t *\t\t// A simple conversion from the `bold=true` attribute to the `` view element (and vice versa).\n\t *\t\teditor.conversion.attributeToElement( { model: 'bold', view: 'strong' } );\n\t *\n\t *\t\t// Override other converters by specifying a converter definition with a higher priority.\n\t *\t\teditor.conversion.attributeToElement( { model: 'bold', view: 'b', converterPriority: 'high' } );\n\t *\n\t *\t\t// View specified as an object instead of a string.\n\t *\t\teditor.conversion.attributeToElement( {\n\t *\t\t\tmodel: 'bold',\n\t *\t\t\tview: {\n\t *\t\t\t\tname: 'span',\n\t *\t\t\t\tclasses: 'bold'\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\t// Use `config.model.name` to define the conversion only from a given node type, `$text` in this case.\n\t *\t\t// The same attribute on different elements may then be handled by a different converter.\n\t *\t\teditor.conversion.attributeToElement( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'textDecoration',\n\t *\t\t\t\tvalues: [ 'underline', 'lineThrough' ],\n\t *\t\t\t\tname: '$text'\n\t *\t\t\t},\n\t *\t\t\tview: {\n\t *\t\t\t\tunderline: {\n\t *\t\t\t\t\tname: 'span',\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'text-decoration': 'underline'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t},\n\t *\t\t\t\tlineThrough: {\n\t *\t\t\t\t\tname: 'span',\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'text-decoration': 'line-through'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\t// Use `upcastAlso` to define other view elements that should also be converted to the `bold` attribute.\n\t *\t\teditor.conversion.attributeToElement( {\n\t *\t\t\tmodel: 'bold',\n\t *\t\t\tview: 'strong',\n\t *\t\t\tupcastAlso: [\n\t *\t\t\t\t'b',\n\t *\t\t\t\t{\n\t *\t\t\t\t\tname: 'span',\n\t *\t\t\t\t\tclasses: 'bold'\n\t *\t\t\t\t},\n\t *\t\t\t\t{\n\t *\t\t\t\t\tname: 'span',\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'font-weight': 'bold'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t},\n\t *\t\t\t\tviewElement => {\n\t *\t\t\t\t\tconst fontWeight = viewElement.getStyle( 'font-weight' );\n\t *\n\t *\t\t\t\t\tif ( viewElement.is( 'span' ) && fontWeight && /\\d+/.test() && Number( fontWeight ) > 500 ) {\n\t *\t\t\t\t\t\t// Returned value can be an object with the matched properties.\n\t *\t\t\t\t\t\t// These properties will be \"consumed\" during the conversion.\n\t *\t\t\t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n\t *\n\t *\t\t\t\t\t\treturn {\n\t *\t\t\t\t\t\t\tname: true,\n\t *\t\t\t\t\t\t\tstyles: [ 'font-weight' ]\n\t *\t\t\t\t\t\t};\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t]\n\t *\t\t} );\n\t *\n\t *\t\t// Conversion from and to a model attribute key whose value is an enum (`fontSize=big|small`).\n\t *\t\t// `upcastAlso` set as callback enables a conversion of a wide range of different view elements.\n\t *\t\teditor.conversion.attributeToElement( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'fontSize',\n\t *\t\t\t\tvalues: [ 'big', 'small' ]\n\t *\t\t\t},\n\t *\t\t\tview: {\n\t *\t\t\t\tbig: {\n\t *\t\t\t\t\tname: 'span',\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'font-size': '1.2em'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t},\n\t *\t\t\t\tsmall: {\n\t *\t\t\t\t\tname: 'span',\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'font-size': '0.8em'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t},\n\t *\t\t\tupcastAlso: {\n\t *\t\t\t\tbig: viewElement => {\n\t *\t\t\t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n\t *\n\t *\t\t\t\t\tif ( !fontSize ) {\n\t *\t\t\t\t\t\treturn null;\n\t *\t\t\t\t\t}\n\t *\n\t *\t\t\t\t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n\t *\n\t *\t\t\t\t\tif ( !match ) {\n\t *\t\t\t\t\t\treturn null;\n\t *\t\t\t\t\t}\n\t *\n\t *\t\t\t\t\tconst size = Number( match[ 1 ] );\n\t *\n\t *\t\t\t\t\tif ( viewElement.is( 'span' ) && size > 10 ) {\n\t *\t\t\t\t\t\t// Returned value can be an object with the matched properties.\n\t *\t\t\t\t\t\t// These properties will be \"consumed\" during the conversion.\n\t *\t\t\t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n\t *\n\t *\t\t\t\t\t\treturn { name: true, styles: [ 'font-size' ] };\n\t *\t\t\t\t\t}\n\t *\n\t *\t\t\t\t\treturn null;\n\t *\t\t\t\t},\n\t *\t\t\t\tsmall: viewElement => {\n\t *\t\t\t\t\tconst fontSize = viewElement.getStyle( 'font-size' );\n\t *\n\t *\t\t\t\t\tif ( !fontSize ) {\n\t *\t\t\t\t\t\treturn null;\n\t *\t\t\t\t\t}\n\t *\n\t *\t\t\t\t\tconst match = fontSize.match( /(\\d+)\\s*px/ );\n\t *\n\t *\t\t\t\t\tif ( !match ) {\n\t *\t\t\t\t\t\treturn null;\n\t *\t\t\t\t\t}\n\t *\n\t *\t\t\t\t\tconst size = Number( match[ 1 ] );\n\t *\n\t *\t\t\t\t\tif ( viewElement.is( 'span' ) && size < 10 ) {\n\t *\t\t\t\t\t\t// Returned value can be an object with the matched properties.\n\t *\t\t\t\t\t\t// These properties will be \"consumed\" during the conversion.\n\t *\t\t\t\t\t\t// See `engine.view.Matcher~MatcherPattern` and `engine.view.Matcher#match` for more details.\n\t *\n\t *\t\t\t\t\t\treturn { name: true, styles: [ 'font-size' ] };\n\t *\t\t\t\t\t}\n\t *\n\t *\t\t\t\t\treturn null;\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * The `definition.model` parameter specifies which model attribute should be converted from or to. It can be a `{ key, value }` object\n\t * describing the attribute key and value to convert or a `String` specifying just the attribute key (then `value` is set to `true`).\n\t * See {@link module:engine/conversion/conversion~ConverterDefinition} to learn about other parameters.\n\t *\n\t * @param {module:engine/conversion/conversion~ConverterDefinition} definition The converter definition.\n\t */\n\tattributeToElement( definition ) {\n\t\t// Set up downcast converter.\n\t\tthis.for( 'downcast' ).attributeToElement( definition );\n\n\t\t// Set up upcast converter.\n\t\tfor ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {\n\t\t\tthis.for( 'upcast' )\n\t\t\t\t.elementToAttribute( {\n\t\t\t\t\tview,\n\t\t\t\t\tmodel,\n\t\t\t\t\tconverterPriority: definition.converterPriority\n\t\t\t\t} );\n\t\t}\n\t}\n\n\t/**\n\t * Sets up converters between the model and the view that convert a model attribute to a view attribute (and vice versa).\n\t * For example, `` is converted to `` (the same attribute key and value).\n\t * This type of converters is intended to be used with {@link module:engine/model/element~Element model element} nodes.\n\t * To convert text attributes {@link module:engine/conversion/conversion~Conversion#attributeToElement `attributeToElement converter`}\n\t * should be set up.\n\t *\n\t *\t\t// A simple conversion from the `source` model attribute to the `src` view attribute (and vice versa).\n\t *\t\teditor.conversion.attributeToAttribute( { model: 'source', view: 'src' } );\n\t *\n\t *\t\t// Attribute values are strictly specified.\n\t *\t\teditor.conversion.attributeToAttribute( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tname: 'image',\n\t *\t\t\t\tkey: 'aside',\n\t *\t\t\t\tvalues: [ 'aside' ]\n\t *\t\t\t},\n\t *\t\t\tview: {\n\t *\t\t\t\taside: {\n\t *\t\t\t\t\tname: 'img',\n\t *\t\t\t\t\tkey: 'class',\n\t *\t\t\t\t\tvalue: [ 'aside', 'half-size' ]\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\t// Set the style attribute.\n\t *\t\teditor.conversion.attributeToAttribute( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tname: 'image',\n\t *\t\t\t\tkey: 'aside',\n\t *\t\t\t\tvalues: [ 'aside' ]\n\t *\t\t\t},\n\t *\t\t\tview: {\n\t *\t\t\t\taside: {\n\t *\t\t\t\t\tname: 'img',\n\t *\t\t\t\t\tkey: 'style',\n\t *\t\t\t\t\tvalue: {\n\t *\t\t\t\t\t\tfloat: 'right',\n\t *\t\t\t\t\t\twidth: '50%',\n\t *\t\t\t\t\t\tmargin: '5px'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t *\t\t// Conversion from and to a model attribute key whose value is an enum (`align=right|center`).\n\t *\t\t// Use `upcastAlso` to define other view elements that should also be converted to the `align=right` attribute.\n\t *\t\teditor.conversion.attributeToAttribute( {\n\t *\t\t\tmodel: {\n\t *\t\t\t\tkey: 'align',\n\t *\t\t\t\tvalues: [ 'right', 'center' ]\n\t *\t\t\t},\n\t *\t\t\tview: {\n\t *\t\t\t\tright: {\n\t *\t\t\t\t\tkey: 'class',\n\t *\t\t\t\t\tvalue: 'align-right'\n\t *\t\t\t\t},\n\t *\t\t\t\tcenter: {\n\t *\t\t\t\t\tkey: 'class',\n\t *\t\t\t\t\tvalue: 'align-center'\n\t *\t\t\t\t}\n\t *\t\t\t},\n\t *\t\t\tupcastAlso: {\n\t *\t\t\t\tright: {\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'text-align': 'right'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t},\n\t *\t\t\t\tcenter: {\n\t *\t\t\t\t\tstyles: {\n\t *\t\t\t\t\t\t'text-align': 'center'\n\t *\t\t\t\t\t}\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * The `definition.model` parameter specifies which model attribute should be converted from and to.\n\t * It can be a `{ key, [ values ], [ name ] }` object or a `String`, which will be treated like `{ key: definition.model }`.\n\t * The `key` property is the model attribute key to convert from and to.\n\t * The `values` are the possible model attribute values. If `values` is not set, the model attribute value will be the same as the\n\t * view attribute value.\n\t * If `name` is set, the conversion will be set up only for model elements with the given name.\n\t *\n\t * The `definition.view` parameter specifies which view attribute should be converted from and to.\n\t * It can be a `{ key, value, [ name ] }` object or a `String`, which will be treated like `{ key: definition.view }`.\n\t * The `key` property is the view attribute key to convert from and to.\n\t * The `value` is the view attribute value to convert from and to. If `definition.value` is not set, the view attribute value will be\n\t * the same as the model attribute value.\n\t * If `key` is `'class'`, `value` can be a `String` or an array of `String`s.\n\t * If `key` is `'style'`, `value` is an object with key-value pairs.\n\t * In other cases, `value` is a `String`.\n\t * If `name` is set, the conversion will be set up only for model elements with the given name.\n\t * If `definition.model.values` is set, `definition.view` is an object that assigns values from `definition.model.values`\n\t * to `{ key, value, [ name ] }` objects.\n\t *\n\t * `definition.upcastAlso` specifies which other matching view elements should also be upcast to the given model configuration.\n\t * If `definition.model.values` is set, `definition.upcastAlso` should be an object assigning values from `definition.model.values`\n\t * to {@link module:engine/view/matcher~MatcherPattern}s or arrays of {@link module:engine/view/matcher~MatcherPattern}s.\n\t *\n\t * **Note:** `definition.model` and `definition.view` form should be mirrored, so the same types of parameters should\n\t * be given in both parameters.\n\t *\n\t * @param {Object} definition The converter definition.\n\t * @param {String|Object} definition.model The model attribute to convert from and to.\n\t * @param {String|Object} definition.view The view attribute to convert from and to.\n\t * @param {module:engine/view/matcher~MatcherPattern|Array.} [definition.upcastAlso]\n\t * Any view element matching `definition.upcastAlso` will also be converted to the given model attribute. `definition.upcastAlso`\n\t * is used only if `config.model.values` is specified.\n\t */\n\tattributeToAttribute( definition ) {\n\t\t// Set up downcast converter.\n\t\tthis.for( 'downcast' ).attributeToAttribute( definition );\n\n\t\t// Set up upcast converter.\n\t\tfor ( const { model, view } of _getAllUpcastDefinitions( definition ) ) {\n\t\t\tthis.for( 'upcast' )\n\t\t\t\t.attributeToAttribute( {\n\t\t\t\t\tview,\n\t\t\t\t\tmodel\n\t\t\t\t} );\n\t\t}\n\t}\n\n\t/**\n\t * Creates and caches conversion helpers for given dispatchers group.\n\t *\n\t * @private\n\t * @param {Object} options\n\t * @param {String} options.name Group name.\n\t * @param {Array.} options.dispatchers\n\t * @param {Boolean} options.isDowncast\n\t */\n\t_createConversionHelpers( { name, dispatchers, isDowncast } ) {\n\t\tif ( this._helpers.has( name ) ) {\n\t\t\t/**\n\t\t\t * Trying to register a group name that has already been registered.\n\t\t\t *\n\t\t\t * @error conversion-group-exists\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'conversion-group-exists: Trying to register a group name that has already been registered.' );\n\t\t}\n\n\t\tconst helpers = isDowncast ? new DowncastHelpers( dispatchers ) : new UpcastHelpers( dispatchers );\n\n\t\tthis._helpers.set( name, helpers );\n\t}\n}\n\n/**\n * Defines how the model should be converted from and to the view.\n *\n * @typedef {Object} module:engine/conversion/conversion~ConverterDefinition\n *\n * @property {*} [model] The model conversion definition. Describes the model element or model attribute to convert. This parameter differs\n * for different functions that accept `ConverterDefinition`. See the description of the function to learn how to set it.\n * @property {module:engine/view/elementdefinition~ElementDefinition|Object} view The definition of the view element to convert from and\n * to. If `model` describes multiple values, `view` is an object that assigns these values (`view` object keys) to view element definitions\n * (`view` object values).\n * @property {module:engine/view/matcher~MatcherPattern|Array.} [upcastAlso]\n * Any view element matching `upcastAlso` will also be converted to the model. If `model` describes multiple values, `upcastAlso`\n * is an object that assigns these values (`upcastAlso` object keys) to {@link module:engine/view/matcher~MatcherPattern}s\n * (`upcastAlso` object values).\n * @property {module:utils/priorities~PriorityString} [converterPriority] The converter priority.\n */\n\n// Helper function that creates a joint array out of an item passed in `definition.view` and items passed in\n// `definition.upcastAlso`.\n//\n// @param {module:engine/conversion/conversion~ConverterDefinition} definition\n// @returns {Array} Array containing view definitions.\nfunction* _getAllUpcastDefinitions( definition ) {\n\tif ( definition.model.values ) {\n\t\tfor ( const value of definition.model.values ) {\n\t\t\tconst model = { key: definition.model.key, value };\n\t\t\tconst view = definition.view[ value ];\n\t\t\tconst upcastAlso = definition.upcastAlso ? definition.upcastAlso[ value ] : undefined;\n\n\t\t\tyield* _getUpcastDefinition( model, view, upcastAlso );\n\t\t}\n\t} else {\n\t\tyield* _getUpcastDefinition( definition.model, definition.view, definition.upcastAlso );\n\t}\n}\n\nfunction* _getUpcastDefinition( model, view, upcastAlso ) {\n\tyield { model, view };\n\n\tif ( upcastAlso ) {\n\t\tupcastAlso = Array.isArray( upcastAlso ) ? upcastAlso : [ upcastAlso ];\n\n\t\tfor ( const upcastAlsoItem of upcastAlso ) {\n\t\t\tyield { model, view: upcastAlsoItem };\n\t\t}\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/batch\n */\n\n/**\n * A batch instance groups model changes ({@link module:engine/model/operation/operation~Operation operations}). All operations\n * grouped in a single batch can be reverted together, so you can also think about a batch as of a single undo step. If you want\n * to extend a given undo step, you can add more changes to the batch using {@link module:engine/model/model~Model#enqueueChange}:\n *\n *\t\tmodel.enqueueChange( batch, writer => {\n *\t\t\twriter.insertText( 'foo', paragraph, 'end' );\n *\t\t} );\n *\n * @see module:engine/model/model~Model#enqueueChange\n * @see module:engine/model/model~Model#change\n */\nexport default class Batch {\n\t/**\n\t * Creates a batch instance.\n\t *\n\t * @see module:engine/model/model~Model#enqueueChange\n\t * @see module:engine/model/model~Model#change\n\t * @param {'transparent'|'default'} [type='default'] The type of the batch.\n\t */\n\tconstructor( type = 'default' ) {\n\t\t/**\n\t\t * An array of operations that compose this batch.\n\t\t *\n\t\t * @readonly\n\t\t * @type {Array.}\n\t\t */\n\t\tthis.operations = [];\n\n\t\t/**\n\t\t * The type of the batch.\n\t\t *\n\t\t * It can be one of the following values:\n\t\t * * `'default'` – All \"normal\" batches. This is the most commonly used type.\n\t\t * * `'transparent'` – A batch that should be ignored by other features, i.e. an initial batch or collaborative editing\n\t\t * changes.\n\t\t *\n\t\t * @readonly\n\t\t * @type {'transparent'|'default'}\n\t\t */\n\t\tthis.type = type;\n\t}\n\n\t/**\n\t * Returns the base version of this batch, which is equal to the base version of the first operation in the batch.\n\t * If there are no operations in the batch or neither operation has the base version set, it returns `null`.\n\t *\n\t * @readonly\n\t * @type {Number|null}\n\t */\n\tget baseVersion() {\n\t\tfor ( const op of this.operations ) {\n\t\t\tif ( op.baseVersion !== null ) {\n\t\t\t\treturn op.baseVersion;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * Adds an operation to the batch instance.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} operation An operation to add.\n\t * @returns {module:engine/model/operation/operation~Operation} The added operation.\n\t */\n\taddOperation( operation ) {\n\t\toperation.batch = this;\n\t\tthis.operations.push( operation );\n\n\t\treturn operation;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/operation\n */\n\n/**\n * Abstract base operation class.\n *\n * @abstract\n */\nexport default class Operation {\n\t/**\n\t * Base operation constructor.\n\t *\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( baseVersion ) {\n\t\t/**\n\t\t * {@link module:engine/model/document~Document#version} on which operation can be applied. If you try to\n\t\t * {@link module:engine/model/model~Model#applyOperation apply} operation with different base version than the\n\t\t * {@link module:engine/model/document~Document#version document version} the\n\t\t * {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.\n\t\t *\n\t\t * @member {Number}\n\t\t */\n\t\tthis.baseVersion = baseVersion;\n\n\t\t/**\n\t\t * Defines whether operation is executed on attached or detached {@link module:engine/model/item~Item items}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean} #isDocumentOperation\n\t\t */\n\t\tthis.isDocumentOperation = this.baseVersion !== null;\n\n\t\t/**\n\t\t * {@link module:engine/model/batch~Batch Batch} to which the operation is added or `null` if the operation is not\n\t\t * added to any batch yet.\n\t\t *\n\t\t * @member {module:engine/model/batch~Batch|null} #batch\n\t\t */\n\t\tthis.batch = null;\n\n\t\t/**\n\t\t * Operation type.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String} #type\n\t\t */\n\n\t\t/**\n\t\t * Creates and returns an operation that has the same parameters as this operation.\n\t\t *\n\t\t * @method #clone\n\t\t * @returns {module:engine/model/operation/operation~Operation} Clone of this operation.\n\t\t */\n\n\t\t/**\n\t\t * Creates and returns a reverse operation. Reverse operation when executed right after\n\t\t * the original operation will bring back tree model state to the point before the original\n\t\t * operation execution. In other words, it reverses changes done by the original operation.\n\t\t *\n\t\t * Keep in mind that tree model state may change since executing the original operation,\n\t\t * so reverse operation will be \"outdated\". In that case you will need to transform it by\n\t\t * all operations that were executed after the original operation.\n\t\t *\n\t\t * @method #getReversed\n\t\t * @returns {module:engine/model/operation/operation~Operation} Reversed operation.\n\t\t */\n\n\t\t/**\n\t\t * Executes the operation - modifications described by the operation properties will be applied to the model tree.\n\t\t *\n\t\t * @protected\n\t\t * @method #_execute\n\t\t */\n\t}\n\n\t/**\n\t * Checks whether the operation's parameters are correct and the operation can be correctly executed. Throws\n\t * an error if operation is not valid.\n\t *\n\t * @protected\n\t * @method #_validate\n\t */\n\t_validate() {\n\t}\n\n\t/**\n\t * Custom toJSON method to solve child-parent circular dependencies.\n\t *\n\t * @method #toJSON\n\t * @returns {Object} Clone of this object with the operation property replaced with string.\n\t */\n\ttoJSON() {\n\t\t// This method creates only a shallow copy, all nested objects should be defined separately.\n\t\t// See https://github.com/ckeditor/ckeditor5-engine/issues/1477.\n\t\tconst json = Object.assign( {}, this );\n\n\t\tjson.__className = this.constructor.className;\n\n\t\t// Remove reference to the parent `Batch` to avoid circular dependencies.\n\t\tdelete json.batch;\n\n\t\t// Only document operations are shared with other clients so it is not necessary to keep this information.\n\t\tdelete json.isDocumentOperation;\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Name of the operation class used for serialization.\n\t *\n\t * @type {String}\n\t */\n\tstatic get className() {\n\t\treturn 'Operation';\n\t}\n\n\t/**\n\t * Creates Operation object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} doc Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/operation~Operation}\n\t */\n\tstatic fromJSON( json ) {\n\t\treturn new this( json.baseVersion );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module module:engine/model/documentfragment\n */\n\nimport NodeList from './nodelist';\nimport Element from './element';\nimport Text from './text';\nimport TextProxy from './textproxy';\nimport isIterable from '@ckeditor/ckeditor5-utils/src/isiterable';\n\n/**\n * DocumentFragment represents a part of model which does not have a common root but it's top-level nodes\n * can be seen as siblings. In other words, it is a detached part of model tree, without a root.\n *\n * DocumentFragment has own {@link module:engine/model/markercollection~MarkerCollection}. Markers from this collection\n * will be set to the {@link module:engine/model/model~Model#markers model markers} by a\n * {@link module:engine/model/writer~Writer#insert} function.\n */\nexport default class DocumentFragment {\n\t/**\n\t * Creates an empty `DocumentFragment`.\n\t *\n\t * **Note:** Constructor of this class shouldn't be used directly in the code.\n\t * Use the {@link module:engine/model/writer~Writer#createDocumentFragment} method instead.\n\t *\n\t * @protected\n\t * @param {module:engine/model/node~Node|Iterable.} [children]\n\t * Nodes to be contained inside the `DocumentFragment`.\n\t */\n\tconstructor( children ) {\n\t\t/**\n\t\t * DocumentFragment static markers map. This is a list of names and {@link module:engine/model/range~Range ranges}\n\t\t * which will be set as Markers to {@link module:engine/model/model~Model#markers model markers collection}\n\t\t * when DocumentFragment will be inserted to the document.\n\t\t *\n\t\t * @readonly\n\t\t * @member {Map} module:engine/model/documentfragment~DocumentFragment#markers\n\t\t */\n\t\tthis.markers = new Map();\n\n\t\t/**\n\t\t * List of nodes contained inside the document fragment.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/nodelist~NodeList} module:engine/model/documentfragment~DocumentFragment#_children\n\t\t */\n\t\tthis._children = new NodeList();\n\n\t\tif ( children ) {\n\t\t\tthis._insertChild( 0, children );\n\t\t}\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all nodes contained inside this document fragment.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this.getChildren();\n\t}\n\n\t/**\n\t * Number of this document fragment's children.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget childCount() {\n\t\treturn this._children.length;\n\t}\n\n\t/**\n\t * Sum of {@link module:engine/model/node~Node#offsetSize offset sizes} of all of this document fragment's children.\n\t *\n\t * @readonly\n\t * @type {Number}\n\t */\n\tget maxOffset() {\n\t\treturn this._children.maxOffset;\n\t}\n\n\t/**\n\t * Is `true` if there are no nodes inside this document fragment, `false` otherwise.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isEmpty() {\n\t\treturn this.childCount === 0;\n\t}\n\n\t/**\n\t * Artificial root of `DocumentFragment`. Returns itself. Added for compatibility reasons.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/documentfragment~DocumentFragment}\n\t */\n\tget root() {\n\t\treturn this;\n\t}\n\n\t/**\n\t * Artificial parent of `DocumentFragment`. Returns `null`. Added for compatibility reasons.\n\t *\n\t * @readonly\n\t * @type {null}\n\t */\n\tget parent() {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Checks whether given model tree object is of given type.\n\t *\n\t * Read more in {@link module:engine/model/node~Node#is}.\n\t *\n\t * @param {String} type\n\t * @returns {Boolean}\n\t */\n\tis( type ) {\n\t\treturn type == 'documentFragment';\n\t}\n\n\t/**\n\t * Gets the child at the given index. Returns `null` if incorrect index was passed.\n\t *\n\t * @param {Number} index Index of child.\n\t * @returns {module:engine/model/node~Node|null} Child node.\n\t */\n\tgetChild( index ) {\n\t\treturn this._children.getNode( index );\n\t}\n\n\t/**\n\t * Returns an iterator that iterates over all of this document fragment's children.\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetChildren() {\n\t\treturn this._children[ Symbol.iterator ]();\n\t}\n\n\t/**\n\t * Returns an index of the given child node. Returns `null` if given node is not a child of this document fragment.\n\t *\n\t * @param {module:engine/model/node~Node} node Child node to look for.\n\t * @returns {Number|null} Child node's index.\n\t */\n\tgetChildIndex( node ) {\n\t\treturn this._children.getNodeIndex( node );\n\t}\n\n\t/**\n\t * Returns the starting offset of given child. Starting offset is equal to the sum of\n\t * {@link module:engine/model/node~Node#offsetSize offset sizes} of all node's siblings that are before it. Returns `null` if\n\t * given node is not a child of this document fragment.\n\t *\n\t * @param {module:engine/model/node~Node} node Child node to look for.\n\t * @returns {Number|null} Child node's starting offset.\n\t */\n\tgetChildStartOffset( node ) {\n\t\treturn this._children.getNodeStartOffset( node );\n\t}\n\n\t/**\n\t * Returns path to a `DocumentFragment`, which is an empty array. Added for compatibility reasons.\n\t *\n\t * @returns {Array}\n\t */\n\tgetPath() {\n\t\treturn [];\n\t}\n\n\t/**\n\t * Returns a descendant node by its path relative to this element.\n\t *\n\t *\t\t// ac\n\t *\t\tthis.getNodeByPath( [ 0 ] ); // -> \"a\"\n\t *\t\tthis.getNodeByPath( [ 1 ] ); // -> \n\t *\t\tthis.getNodeByPath( [ 1, 0 ] ); // -> \"c\"\n\t *\n\t * @param {Array.} relativePath Path of the node to find, relative to this element.\n\t * @returns {module:engine/model/node~Node|module:engine/model/documentfragment~DocumentFragment}\n\t */\n\tgetNodeByPath( relativePath ) {\n\t\tlet node = this; // eslint-disable-line consistent-this\n\n\t\tfor ( const index of relativePath ) {\n\t\t\tnode = node.getChild( node.offsetToIndex( index ) );\n\t\t}\n\n\t\treturn node;\n\t}\n\n\t/**\n\t * Converts offset \"position\" to index \"position\".\n\t *\n\t * Returns index of a node that occupies given offset. If given offset is too low, returns `0`. If given offset is\n\t * too high, returns index after last child}.\n\t *\n\t *\t\tconst textNode = new Text( 'foo' );\n\t *\t\tconst pElement = new Element( 'p' );\n\t *\t\tconst docFrag = new DocumentFragment( [ textNode, pElement ] );\n\t *\t\tdocFrag.offsetToIndex( -1 ); // Returns 0, because offset is too low.\n\t *\t\tdocFrag.offsetToIndex( 0 ); // Returns 0, because offset 0 is taken by `textNode` which is at index 0.\n\t *\t\tdocFrag.offsetToIndex( 1 ); // Returns 0, because `textNode` has `offsetSize` equal to 3, so it occupies offset 1 too.\n\t *\t\tdocFrag.offsetToIndex( 2 ); // Returns 0.\n\t *\t\tdocFrag.offsetToIndex( 3 ); // Returns 1.\n\t *\t\tdocFrag.offsetToIndex( 4 ); // Returns 2. There are no nodes at offset 4, so last available index is returned.\n\t *\n\t * @param {Number} offset Offset to look for.\n\t * @returns {Number} Index of a node that occupies given offset.\n\t */\n\toffsetToIndex( offset ) {\n\t\treturn this._children.offsetToIndex( offset );\n\t}\n\n\t/**\n\t * Converts `DocumentFragment` instance to plain object and returns it.\n\t * Takes care of converting all of this document fragment's children.\n\t *\n\t * @returns {Object} `DocumentFragment` instance converted to plain object.\n\t */\n\ttoJSON() {\n\t\tconst json = [];\n\n\t\tfor ( const node of this._children ) {\n\t\t\tjson.push( node.toJSON() );\n\t\t}\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Creates a `DocumentFragment` instance from given plain object (i.e. parsed JSON string).\n\t * Converts `DocumentFragment` children to proper nodes.\n\t *\n\t * @param {Object} json Plain object to be converted to `DocumentFragment`.\n\t * @returns {module:engine/model/documentfragment~DocumentFragment} `DocumentFragment` instance created using given plain object.\n\t */\n\tstatic fromJSON( json ) {\n\t\tconst children = [];\n\n\t\tfor ( const child of json ) {\n\t\t\tif ( child.name ) {\n\t\t\t\t// If child has name property, it is an Element.\n\t\t\t\tchildren.push( Element.fromJSON( child ) );\n\t\t\t} else {\n\t\t\t\t// Otherwise, it is a Text node.\n\t\t\t\tchildren.push( Text.fromJSON( child ) );\n\t\t\t}\n\t\t}\n\n\t\treturn new DocumentFragment( children );\n\t}\n\n\t/**\n\t * {@link #_insertChild Inserts} one or more nodes at the end of this document fragment.\n\t *\n\t * @protected\n\t * @param {module:engine/model/item~Item|Iterable.} items Items to be inserted.\n\t */\n\t_appendChild( items ) {\n\t\tthis._insertChild( this.childCount, items );\n\t}\n\n\t/**\n\t * Inserts one or more nodes at the given index and sets {@link module:engine/model/node~Node#parent parent} of these nodes\n\t * to this document fragment.\n\t *\n\t * @protected\n\t * @param {Number} index Index at which nodes should be inserted.\n\t * @param {module:engine/model/item~Item|Iterable.} items Items to be inserted.\n\t */\n\t_insertChild( index, items ) {\n\t\tconst nodes = normalize( items );\n\n\t\tfor ( const node of nodes ) {\n\t\t\t// If node that is being added to this element is already inside another element, first remove it from the old parent.\n\t\t\tif ( node.parent !== null ) {\n\t\t\t\tnode._remove();\n\t\t\t}\n\n\t\t\tnode.parent = this;\n\t\t}\n\n\t\tthis._children._insertNodes( index, nodes );\n\t}\n\n\t/**\n\t * Removes one or more nodes starting at the given index\n\t * and sets {@link module:engine/model/node~Node#parent parent} of these nodes to `null`.\n\t *\n\t * @protected\n\t * @param {Number} index Index of the first node to remove.\n\t * @param {Number} [howMany=1] Number of nodes to remove.\n\t * @returns {Array.} Array containing removed nodes.\n\t */\n\t_removeChildren( index, howMany = 1 ) {\n\t\tconst nodes = this._children._removeNodes( index, howMany );\n\n\t\tfor ( const node of nodes ) {\n\t\t\tnode.parent = null;\n\t\t}\n\n\t\treturn nodes;\n\t}\n}\n\n// Converts strings to Text and non-iterables to arrays.\n//\n// @param {String|module:engine/model/item~Item|Iterable.}\n// @returns {Iterable.}\nfunction normalize( nodes ) {\n\t// Separate condition because string is iterable.\n\tif ( typeof nodes == 'string' ) {\n\t\treturn [ new Text( nodes ) ];\n\t}\n\n\tif ( !isIterable( nodes ) ) {\n\t\tnodes = [ nodes ];\n\t}\n\n\t// Array.from to enable .map() on non-arrays.\n\treturn Array.from( nodes )\n\t\t.map( node => {\n\t\t\tif ( typeof node == 'string' ) {\n\t\t\t\treturn new Text( node );\n\t\t\t}\n\n\t\t\tif ( node instanceof TextProxy ) {\n\t\t\t\treturn new Text( node.data, node.getAttributes() );\n\t\t\t}\n\n\t\t\treturn node;\n\t\t} );\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/utils\n */\n\nimport Node from '../node';\nimport Text from '../text';\nimport TextProxy from '../textproxy';\nimport Range from '../range';\nimport DocumentFragment from '../documentfragment';\nimport NodeList from '../nodelist';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Contains functions used for composing model tree by {@link module:engine/model/operation/operation~Operation operations}.\n * Those functions are built on top of {@link module:engine/model/node~Node node}, and it's child classes', APIs.\n *\n * @protected\n * @namespace utils\n */\n\n/**\n * Inserts given nodes at given position.\n *\n * @protected\n * @function module:engine/model/operation/utils~utils.insert\n * @param {module:engine/model/position~Position} position Position at which nodes should be inserted.\n * @param {module:engine/model/node~NodeSet} nodes Nodes to insert.\n * @returns {module:engine/model/range~Range} Range spanning over inserted elements.\n */\nexport function _insert( position, nodes ) {\n\tnodes = _normalizeNodes( nodes );\n\n\t// We have to count offset before inserting nodes because they can get merged and we would get wrong offsets.\n\tconst offset = nodes.reduce( ( sum, node ) => sum + node.offsetSize, 0 );\n\tconst parent = position.parent;\n\n\t// Insertion might be in a text node, we should split it if that's the case.\n\t_splitNodeAtPosition( position );\n\tconst index = position.index;\n\n\t// Insert nodes at given index. After splitting we have a proper index and insertion is between nodes,\n\t// using basic `Element` API.\n\tparent._insertChild( index, nodes );\n\n\t// Merge text nodes, if possible. Merging is needed only at points where inserted nodes \"touch\" \"old\" nodes.\n\t_mergeNodesAtIndex( parent, index + nodes.length );\n\t_mergeNodesAtIndex( parent, index );\n\n\treturn new Range( position, position.getShiftedBy( offset ) );\n}\n\n/**\n * Removed nodes in given range. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.\n *\n * @protected\n * @function module:engine/model/operation/utils~utils._remove\n * @param {module:engine/model/range~Range} range Range containing nodes to remove.\n * @returns {Array.}\n */\nexport function _remove( range ) {\n\tif ( !range.isFlat ) {\n\t\t/**\n\t\t * Trying to remove a range which starts and ends in different element.\n\t\t *\n\t\t * @error operation-utils-remove-range-not-flat\n\t\t */\n\t\tthrow new CKEditorError( 'operation-utils-remove-range-not-flat: ' +\n\t\t\t'Trying to remove a range which starts and ends in different element.' );\n\t}\n\n\tconst parent = range.start.parent;\n\n\t// Range may be inside text nodes, we have to split them if that's the case.\n\t_splitNodeAtPosition( range.start );\n\t_splitNodeAtPosition( range.end );\n\n\t// Remove the text nodes using basic `Element` API.\n\tconst removed = parent._removeChildren( range.start.index, range.end.index - range.start.index );\n\n\t// Merge text nodes, if possible. After some nodes were removed, node before and after removed range will be\n\t// touching at the position equal to the removed range beginning. We check merging possibility there.\n\t_mergeNodesAtIndex( parent, range.start.index );\n\n\treturn removed;\n}\n\n/**\n * Moves nodes in given range to given target position. Only {@link module:engine/model/range~Range#isFlat flat} ranges are accepted.\n *\n * @protected\n * @function module:engine/model/operation/utils~utils.move\n * @param {module:engine/model/range~Range} sourceRange Range containing nodes to move.\n * @param {module:engine/model/position~Position} targetPosition Position to which nodes should be moved.\n * @returns {module:engine/model/range~Range} Range containing moved nodes.\n */\nexport function _move( sourceRange, targetPosition ) {\n\tif ( !sourceRange.isFlat ) {\n\t\t/**\n\t\t * Trying to move a range which starts and ends in different element.\n\t\t *\n\t\t * @error operation-utils-move-range-not-flat\n\t\t */\n\t\tthrow new CKEditorError( 'operation-utils-move-range-not-flat: ' +\n\t\t\t'Trying to move a range which starts and ends in different element.' );\n\t}\n\n\tconst nodes = _remove( sourceRange );\n\n\t// We have to fix `targetPosition` because model changed after nodes from `sourceRange` got removed and\n\t// that change might have an impact on `targetPosition`.\n\ttargetPosition = targetPosition._getTransformedByDeletion( sourceRange.start, sourceRange.end.offset - sourceRange.start.offset );\n\n\treturn _insert( targetPosition, nodes );\n}\n\n/**\n * Sets given attribute on nodes in given range. The attributes are only set on top-level nodes of the range, not on its children.\n *\n * @protected\n * @function module:engine/model/operation/utils~utils._setAttribute\n * @param {module:engine/model/range~Range} range Range containing nodes that should have the attribute set. Must be a flat range.\n * @param {String} key Key of attribute to set.\n * @param {*} value Attribute value.\n */\nexport function _setAttribute( range, key, value ) {\n\t// Range might start or end in text nodes, so we have to split them.\n\t_splitNodeAtPosition( range.start );\n\t_splitNodeAtPosition( range.end );\n\n\t// Iterate over all items in the range.\n\tfor ( const item of range.getItems( { shallow: true } ) ) {\n\t\t// Iterator will return `TextProxy` instances but we know that those text proxies will\n\t\t// always represent full text nodes (this is guaranteed thanks to splitting we did before).\n\t\t// So, we can operate on those text proxies' text nodes.\n\t\tconst node = item.is( 'textProxy' ) ? item.textNode : item;\n\n\t\tif ( value !== null ) {\n\t\t\tnode._setAttribute( key, value );\n\t\t} else {\n\t\t\tnode._removeAttribute( key );\n\t\t}\n\n\t\t// After attributes changing it may happen that some text nodes can be merged. Try to merge with previous node.\n\t\t_mergeNodesAtIndex( node.parent, node.index );\n\t}\n\n\t// Try to merge last changed node with it's previous sibling (not covered by the loop above).\n\t_mergeNodesAtIndex( range.end.parent, range.end.index );\n}\n\n/**\n * Normalizes given object or an array of objects to an array of {@link module:engine/model/node~Node nodes}. See\n * {@link module:engine/model/node~NodeSet NodeSet} for details on how normalization is performed.\n *\n * @protected\n * @function module:engine/model/operation/utils~utils.normalizeNodes\n * @param {module:engine/model/node~NodeSet} nodes Objects to normalize.\n * @returns {Array.} Normalized nodes.\n */\nexport function _normalizeNodes( nodes ) {\n\tconst normalized = [];\n\n\tif ( !( nodes instanceof Array ) ) {\n\t\tnodes = [ nodes ];\n\t}\n\n\t// Convert instances of classes other than Node.\n\tfor ( let i = 0; i < nodes.length; i++ ) {\n\t\tif ( typeof nodes[ i ] == 'string' ) {\n\t\t\tnormalized.push( new Text( nodes[ i ] ) );\n\t\t} else if ( nodes[ i ] instanceof TextProxy ) {\n\t\t\tnormalized.push( new Text( nodes[ i ].data, nodes[ i ].getAttributes() ) );\n\t\t} else if ( nodes[ i ] instanceof DocumentFragment || nodes[ i ] instanceof NodeList ) {\n\t\t\tfor ( const child of nodes[ i ] ) {\n\t\t\t\tnormalized.push( child );\n\t\t\t}\n\t\t} else if ( nodes[ i ] instanceof Node ) {\n\t\t\tnormalized.push( nodes[ i ] );\n\t\t}\n\t\t// Skip unrecognized type.\n\t}\n\n\t// Merge text nodes.\n\tfor ( let i = 1; i < normalized.length; i++ ) {\n\t\tconst node = normalized[ i ];\n\t\tconst prev = normalized[ i - 1 ];\n\n\t\tif ( node instanceof Text && prev instanceof Text && _haveSameAttributes( node, prev ) ) {\n\t\t\t// Doing this instead changing `prev.data` because `data` is readonly.\n\t\t\tnormalized.splice( i - 1, 2, new Text( prev.data + node.data, prev.getAttributes() ) );\n\t\t\ti--;\n\t\t}\n\t}\n\n\treturn normalized;\n}\n\n// Checks if nodes before and after given index in given element are {@link module:engine/model/text~Text text nodes} and\n// merges them into one node if they have same attributes.\n//\n// Merging is done by removing two text nodes and inserting a new text node containing data from both merged text nodes.\n//\n// @private\n// @param {module:engine/model/element~Element} element Parent element of nodes to merge.\n// @param {Number} index Index between nodes to merge.\nfunction _mergeNodesAtIndex( element, index ) {\n\tconst nodeBefore = element.getChild( index - 1 );\n\tconst nodeAfter = element.getChild( index );\n\n\t// Check if both of those nodes are text objects with same attributes.\n\tif ( nodeBefore && nodeAfter && nodeBefore.is( 'text' ) && nodeAfter.is( 'text' ) && _haveSameAttributes( nodeBefore, nodeAfter ) ) {\n\t\t// Append text of text node after index to the before one.\n\t\tconst mergedNode = new Text( nodeBefore.data + nodeAfter.data, nodeBefore.getAttributes() );\n\n\t\t// Remove separate text nodes.\n\t\telement._removeChildren( index - 1, 2 );\n\n\t\t// Insert merged text node.\n\t\telement._insertChild( index - 1, mergedNode );\n\t}\n}\n\n// Checks if given position is in a text node, and if so, splits the text node in two text nodes, each of them\n// containing a part of original text node.\n//\n// @private\n// @param {module:engine/model/position~Position} position Position at which node should be split.\nfunction _splitNodeAtPosition( position ) {\n\tconst textNode = position.textNode;\n\tconst element = position.parent;\n\n\tif ( textNode ) {\n\t\tconst offsetDiff = position.offset - textNode.startOffset;\n\t\tconst index = textNode.index;\n\n\t\telement._removeChildren( index, 1 );\n\n\t\tconst firstPart = new Text( textNode.data.substr( 0, offsetDiff ), textNode.getAttributes() );\n\t\tconst secondPart = new Text( textNode.data.substr( offsetDiff ), textNode.getAttributes() );\n\n\t\telement._insertChild( index, [ firstPart, secondPart ] );\n\t}\n}\n\n// Checks whether two given nodes have same attributes.\n//\n// @private\n// @param {module:engine/model/node~Node} nodeA Node to check.\n// @param {module:engine/model/node~Node} nodeB Node to check.\n// @returns {Boolean} `true` if nodes have same attributes, `false` otherwise.\nfunction _haveSameAttributes( nodeA, nodeB ) {\n\tconst iteratorA = nodeA.getAttributes();\n\tconst iteratorB = nodeB.getAttributes();\n\n\tfor ( const attr of iteratorA ) {\n\t\tif ( attr[ 1 ] !== nodeB.getAttribute( attr[ 0 ] ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\titeratorB.next();\n\t}\n\n\treturn iteratorB.next().done;\n}\n\n/**\n * Value that can be normalized to an array of {@link module:engine/model/node~Node nodes}.\n *\n * Non-arrays are normalized as follows:\n * * {@link module:engine/model/node~Node Node} is left as is,\n * * {@link module:engine/model/textproxy~TextProxy TextProxy} and `String` are normalized to {@link module:engine/model/text~Text Text},\n * * {@link module:engine/model/nodelist~NodeList NodeList} is normalized to an array containing all nodes that are in that node list,\n * * {@link module:engine/model/documentfragment~DocumentFragment DocumentFragment} is normalized to an array containing all of it's\n * * children.\n *\n * Arrays are processed item by item like non-array values and flattened to one array. Normalization always results in\n * a flat array of {@link module:engine/model/node~Node nodes}. Consecutive text nodes (or items normalized to text nodes) will be\n * merged if they have same attributes.\n *\n * @typedef {module:engine/model/node~Node|module:engine/model/textproxy~TextProxy|String|\n * module:engine/model/nodelist~NodeList|module:engine/model/documentfragment~DocumentFragment|Iterable}\n * module:engine/model/node~NodeSet\n */\n","import baseIsEqual from './_baseIsEqual.js';\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nexport default isEqual;\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/attributeoperation\n */\n\nimport Operation from './operation';\nimport Range from '../range';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport { _setAttribute } from './utils';\nimport { isEqual } from 'lodash-es';\n\n/**\n * Operation to change nodes' attribute.\n *\n * Using this class you can add, remove or change value of the attribute.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class AttributeOperation extends Operation {\n\t/**\n\t * Creates an operation that changes, removes or adds attributes.\n\t *\n\t * If only `newValue` is set, attribute will be added on a node. Note that all nodes in operation's range must not\n\t * have an attribute with the same key as the added attribute.\n\t *\n\t * If only `oldValue` is set, then attribute with given key will be removed. Note that all nodes in operation's range\n\t * must have an attribute with that key added.\n\t *\n\t * If both `newValue` and `oldValue` are set, then the operation will change the attribute value. Note that all nodes in\n\t * operation's ranges must already have an attribute with given key and `oldValue` as value\n\t *\n\t * @param {module:engine/model/range~Range} range Range on which the operation should be applied. Must be a flat range.\n\t * @param {String} key Key of an attribute to change or remove.\n\t * @param {*} oldValue Old value of the attribute with given key or `null`, if attribute was not set before.\n\t * @param {*} newValue New value of the attribute with given key or `null`, if operation should remove attribute.\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( range, key, oldValue, newValue, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Range on which operation should be applied.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/range~Range}\n\t\t */\n\t\tthis.range = range.clone();\n\n\t\t/**\n\t\t * Key of an attribute to change or remove.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.key = key;\n\n\t\t/**\n\t\t * Old value of the attribute with given key or `null`, if attribute was not set before.\n\t\t *\n\t\t * @readonly\n\t\t * @member {*}\n\t\t */\n\t\tthis.oldValue = oldValue === undefined ? null : oldValue;\n\n\t\t/**\n\t\t * New value of the attribute with given key or `null`, if operation should remove attribute.\n\t\t *\n\t\t * @readonly\n\t\t * @member {*}\n\t\t */\n\t\tthis.newValue = newValue === undefined ? null : newValue;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\tif ( this.oldValue === null ) {\n\t\t\treturn 'addAttribute';\n\t\t} else if ( this.newValue === null ) {\n\t\t\treturn 'removeAttribute';\n\t\t} else {\n\t\t\treturn 'changeAttribute';\n\t\t}\n\t}\n\n\t/**\n\t * Creates and returns an operation that has the same parameters as this operation.\n\t *\n\t * @returns {module:engine/model/operation/attributeoperation~AttributeOperation} Clone of this operation.\n\t */\n\tclone() {\n\t\treturn new AttributeOperation( this.range, this.key, this.oldValue, this.newValue, this.baseVersion );\n\t}\n\n\t/**\n\t * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n\t *\n\t * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}\n\t */\n\tgetReversed() {\n\t\treturn new AttributeOperation( this.range, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tjson.range = this.range.toJSON();\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_validate() {\n\t\tif ( !this.range.isFlat ) {\n\t\t\t/**\n\t\t\t * The range to change is not flat.\n\t\t\t *\n\t\t\t * @error attribute-operation-range-not-flat\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'attribute-operation-range-not-flat: The range to change is not flat.' );\n\t\t}\n\n\t\tfor ( const item of this.range.getItems( { shallow: true } ) ) {\n\t\t\tif ( this.oldValue !== null && !isEqual( item.getAttribute( this.key ), this.oldValue ) ) {\n\t\t\t\t/**\n\t\t\t\t * Changed node has different attribute value than operation's old attribute value.\n\t\t\t\t *\n\t\t\t\t * @error attribute-operation-wrong-old-value\n\t\t\t\t * @param {module:engine/model/item~Item} item\n\t\t\t\t * @param {String} key\n\t\t\t\t * @param {*} value\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'attribute-operation-wrong-old-value: Changed node has different attribute value than operation\\'s ' +\n\t\t\t\t\t'old attribute value.',\n\t\t\t\t\t{ item, key: this.key, value: this.oldValue }\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif ( this.oldValue === null && this.newValue !== null && item.hasAttribute( this.key ) ) {\n\t\t\t\t/**\n\t\t\t\t * The attribute with given key already exists for the given node.\n\t\t\t\t *\n\t\t\t\t * @error attribute-operation-attribute-exists\n\t\t\t\t * @param {module:engine/model/node~Node} node\n\t\t\t\t * @param {String} key\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'attribute-operation-attribute-exists: The attribute with given key already exists.',\n\t\t\t\t\t{ node: item, key: this.key }\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t// If value to set is same as old value, don't do anything.\n\t\tif ( !isEqual( this.oldValue, this.newValue ) ) {\n\t\t\t// Execution.\n\t\t\t_setAttribute( this.range, this.key, this.newValue );\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'AttributeOperation';\n\t}\n\n\t/**\n\t * Creates `AttributeOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\treturn new AttributeOperation( Range.fromJSON( json.range, document ), json.key, json.oldValue, json.newValue, json.baseVersion );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/detachoperation\n */\n\nimport Operation from './operation';\nimport Range from '../range';\nimport { _remove } from './utils';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Operation to permanently remove node from detached root.\n * Note this operation is only a local operation and won't be send to the other clients.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class DetachOperation extends Operation {\n\t/**\n\t * Creates an insert operation.\n\t *\n\t * @param {module:engine/model/position~Position} sourcePosition\n\t * Position before the first {@link module:engine/model/item~Item model item} to move.\n\t * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at\n\t * `sourcePosition` with offset shifted by `howMany`.\n\t */\n\tconstructor( sourcePosition, howMany ) {\n\t\tsuper( null );\n\n\t\t/**\n\t\t * Position before the first {@link module:engine/model/item~Item model item} to detach.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} #sourcePosition\n\t\t */\n\t\tthis.sourcePosition = sourcePosition.clone();\n\n\t\t/**\n\t\t * Offset size of moved range.\n\t\t *\n\t\t * @member {Number} #howMany\n\t\t */\n\t\tthis.howMany = howMany;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'detach';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tjson.sourcePosition = this.sourcePosition.toJSON();\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_validate() {\n\t\tif ( this.sourcePosition.root.document ) {\n\t\t\t/**\n\t\t\t * Cannot detach document node.\n\t\t\t *\n\t\t\t * @error detach-operation-on-document-node\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'detach-operation-on-document-node: Cannot detach document node.' );\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t_remove( Range._createFromPositionAndShift( this.sourcePosition, this.howMany ) );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'DetachOperation';\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/moveoperation\n */\n\nimport Operation from './operation';\nimport Position from '../position';\nimport Range from '../range';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport compareArrays from '@ckeditor/ckeditor5-utils/src/comparearrays';\nimport { _move } from './utils';\n\n/**\n * Operation to move a range of {@link module:engine/model/item~Item model items}\n * to given {@link module:engine/model/position~Position target position}.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class MoveOperation extends Operation {\n\t/**\n\t * Creates a move operation.\n\t *\n\t * @param {module:engine/model/position~Position} sourcePosition\n\t * Position before the first {@link module:engine/model/item~Item model item} to move.\n\t * @param {Number} howMany Offset size of moved range. Moved range will start from `sourcePosition` and end at\n\t * `sourcePosition` with offset shifted by `howMany`.\n\t * @param {module:engine/model/position~Position} targetPosition Position at which moved nodes will be inserted.\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( sourcePosition, howMany, targetPosition, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Position before the first {@link module:engine/model/item~Item model item} to move.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#sourcePosition\n\t\t */\n\t\tthis.sourcePosition = sourcePosition.clone();\n\t\t// `'toNext'` because `sourcePosition` is a bit like a start of the moved range.\n\t\tthis.sourcePosition.stickiness = 'toNext';\n\n\t\t/**\n\t\t * Offset size of moved range.\n\t\t *\n\t\t * @member {Number} module:engine/model/operation/moveoperation~MoveOperation#howMany\n\t\t */\n\t\tthis.howMany = howMany;\n\n\t\t/**\n\t\t * Position at which moved nodes will be inserted.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/moveoperation~MoveOperation#targetPosition\n\t\t */\n\t\tthis.targetPosition = targetPosition.clone();\n\t\tthis.targetPosition.stickiness = 'toNone';\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\tif ( this.targetPosition.root.rootName == '$graveyard' ) {\n\t\t\treturn 'remove';\n\t\t} else if ( this.sourcePosition.root.rootName == '$graveyard' ) {\n\t\t\treturn 'reinsert';\n\t\t}\n\n\t\treturn 'move';\n\t}\n\n\t/**\n\t * Creates and returns an operation that has the same parameters as this operation.\n\t *\n\t * @returns {module:engine/model/operation/moveoperation~MoveOperation} Clone of this operation.\n\t */\n\tclone() {\n\t\treturn new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.baseVersion );\n\t}\n\n\t/**\n\t * Returns the start position of the moved range after it got moved. This may be different than\n\t * {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition} in some cases, i.e. when a range is moved\n\t * inside the same parent but {@link module:engine/model/operation/moveoperation~MoveOperation#targetPosition targetPosition}\n\t * is after {@link module:engine/model/operation/moveoperation~MoveOperation#sourcePosition sourcePosition}.\n\t *\n\t *\t\t vv vv\n\t *\t\tabcdefg ===> adefbcg\n\t *\t\t ^ ^\n\t *\t\t targetPos\tmovedRangeStart\n\t *\t\t offset 6\toffset 4\n\t *\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tgetMovedRangeStart() {\n\t\treturn this.targetPosition._getTransformedByDeletion( this.sourcePosition, this.howMany );\n\t}\n\n\t/**\n\t * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n\t *\n\t * @returns {module:engine/model/operation/moveoperation~MoveOperation}\n\t */\n\tgetReversed() {\n\t\tconst newTargetPosition = this.sourcePosition._getTransformedByInsertion( this.targetPosition, this.howMany );\n\n\t\treturn new this.constructor( this.getMovedRangeStart(), this.howMany, newTargetPosition, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_validate() {\n\t\tconst sourceElement = this.sourcePosition.parent;\n\t\tconst targetElement = this.targetPosition.parent;\n\t\tconst sourceOffset = this.sourcePosition.offset;\n\t\tconst targetOffset = this.targetPosition.offset;\n\n\t\t// Validate whether move operation has correct parameters.\n\t\t// Validation is pretty complex but move operation is one of the core ways to manipulate the document state.\n\t\t// We expect that many errors might be connected with one of scenarios described below.\n\t\tif ( !sourceElement || !targetElement ) {\n\t\t\t/**\n\t\t\t * Source position or target position is invalid.\n\t\t\t *\n\t\t\t * @error move-operation-position-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'move-operation-position-invalid: Source position or target position is invalid.'\n\t\t\t);\n\t\t} else if ( sourceOffset + this.howMany > sourceElement.maxOffset ) {\n\t\t\t/**\n\t\t\t * The nodes which should be moved do not exist.\n\t\t\t *\n\t\t\t * @error move-operation-nodes-do-not-exist\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'move-operation-nodes-do-not-exist: The nodes which should be moved do not exist.'\n\t\t\t);\n\t\t} else if ( sourceElement === targetElement && sourceOffset < targetOffset && targetOffset < sourceOffset + this.howMany ) {\n\t\t\t/**\n\t\t\t * Trying to move a range of nodes into the middle of that range.\n\t\t\t *\n\t\t\t * @error move-operation-range-into-itself\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'move-operation-range-into-itself: Trying to move a range of nodes to the inside of that range.'\n\t\t\t);\n\t\t} else if ( this.sourcePosition.root == this.targetPosition.root ) {\n\t\t\tif ( compareArrays( this.sourcePosition.getParentPath(), this.targetPosition.getParentPath() ) == 'prefix' ) {\n\t\t\t\tconst i = this.sourcePosition.path.length - 1;\n\n\t\t\t\tif ( this.targetPosition.path[ i ] >= sourceOffset && this.targetPosition.path[ i ] < sourceOffset + this.howMany ) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Trying to move a range of nodes into one of nodes from that range.\n\t\t\t\t\t *\n\t\t\t\t\t * @error move-operation-node-into-itself\n\t\t\t\t\t */\n\t\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t\t'move-operation-node-into-itself: Trying to move a range of nodes into one of nodes from that range.'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t_move( Range._createFromPositionAndShift( this.sourcePosition, this.howMany ), this.targetPosition );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tjson.sourcePosition = this.sourcePosition.toJSON();\n\t\tjson.targetPosition = this.targetPosition.toJSON();\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'MoveOperation';\n\t}\n\n\t/**\n\t * Creates `MoveOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/moveoperation~MoveOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tconst sourcePosition = Position.fromJSON( json.sourcePosition, document );\n\t\tconst targetPosition = Position.fromJSON( json.targetPosition, document );\n\n\t\treturn new this( sourcePosition, json.howMany, targetPosition, json.baseVersion );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/insertoperation\n */\n\nimport Operation from './operation';\nimport Position from '../position';\nimport NodeList from '../nodelist';\nimport MoveOperation from './moveoperation';\nimport { _insert, _normalizeNodes } from './utils';\nimport Text from '../text';\nimport Element from '../element';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Operation to insert one or more nodes at given position in the model.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class InsertOperation extends Operation {\n\t/**\n\t * Creates an insert operation.\n\t *\n\t * @param {module:engine/model/position~Position} position Position of insertion.\n\t * @param {module:engine/model/node~NodeSet} nodes The list of nodes to be inserted.\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( position, nodes, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Position of insertion.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/insertoperation~InsertOperation#position\n\t\t */\n\t\tthis.position = position.clone();\n\t\tthis.position.stickiness = 'toNone';\n\n\t\t/**\n\t\t * List of nodes to insert.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/nodelist~NodeList} module:engine/model/operation/insertoperation~InsertOperation#nodeList\n\t\t */\n\t\tthis.nodes = new NodeList( _normalizeNodes( nodes ) );\n\n\t\t/**\n\t\t * Flag deciding how the operation should be transformed. If set to `true`, nodes might get additional attributes\n\t\t * during operational transformation. This happens when the operation insertion position is inside of a range\n\t\t * where attributes have changed.\n\t\t *\n\t\t * @member {Boolean} module:engine/model/operation/insertoperation~InsertOperation#shouldReceiveAttributes\n\t\t */\n\t\tthis.shouldReceiveAttributes = false;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'insert';\n\t}\n\n\t/**\n\t * Total offset size of inserted nodes.\n\t *\n\t * @returns {Number}\n\t */\n\tget howMany() {\n\t\treturn this.nodes.maxOffset;\n\t}\n\n\t/**\n\t * Creates and returns an operation that has the same parameters as this operation.\n\t *\n\t * @returns {module:engine/model/operation/insertoperation~InsertOperation} Clone of this operation.\n\t */\n\tclone() {\n\t\tconst nodes = new NodeList( [ ...this.nodes ].map( node => node._clone( true ) ) );\n\t\tconst insert = new InsertOperation( this.position, nodes, this.baseVersion );\n\n\t\tinsert.shouldReceiveAttributes = this.shouldReceiveAttributes;\n\n\t\treturn insert;\n\t}\n\n\t/**\n\t * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n\t *\n\t * @returns {module:engine/model/operation/moveoperation~MoveOperation}\n\t */\n\tgetReversed() {\n\t\tconst graveyard = this.position.root.document.graveyard;\n\t\tconst gyPosition = new Position( graveyard, [ 0 ] );\n\n\t\treturn new MoveOperation( this.position, this.nodes.maxOffset, gyPosition, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_validate() {\n\t\tconst targetElement = this.position.parent;\n\n\t\tif ( !targetElement || targetElement.maxOffset < this.position.offset ) {\n\t\t\t/**\n\t\t\t * Insertion position is invalid.\n\t\t\t *\n\t\t\t * @error insert-operation-position-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'insert-operation-position-invalid: Insertion position is invalid.'\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\t// What happens here is that we want original nodes be passed to writer because we want original nodes\n\t\t// to be inserted to the model. But in InsertOperation, we want to keep those nodes as they were added\n\t\t// to the operation, not modified. For example, text nodes can get merged or cropped while Elements can\n\t\t// get children. It is important that InsertOperation has the copy of original nodes in intact state.\n\t\tconst originalNodes = this.nodes;\n\t\tthis.nodes = new NodeList( [ ...originalNodes ].map( node => node._clone( true ) ) );\n\n\t\t_insert( this.position, originalNodes );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tjson.position = this.position.toJSON();\n\t\tjson.nodes = this.nodes.toJSON();\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'InsertOperation';\n\t}\n\n\t/**\n\t * Creates `InsertOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/insertoperation~InsertOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tconst children = [];\n\n\t\tfor ( const child of json.nodes ) {\n\t\t\tif ( child.name ) {\n\t\t\t\t// If child has name property, it is an Element.\n\t\t\t\tchildren.push( Element.fromJSON( child ) );\n\t\t\t} else {\n\t\t\t\t// Otherwise, it is a Text node.\n\t\t\t\tchildren.push( Text.fromJSON( child ) );\n\t\t\t}\n\t\t}\n\n\t\tconst insert = new InsertOperation( Position.fromJSON( json.position, document ), children, json.baseVersion );\n\t\tinsert.shouldReceiveAttributes = json.shouldReceiveAttributes;\n\n\t\treturn insert;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/markeroperation\n */\n\nimport Operation from './operation';\nimport Range from '../range';\n\n/**\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class MarkerOperation extends Operation {\n\t/**\n\t * @param {String} name Marker name.\n\t * @param {module:engine/model/range~Range} oldRange Marker range before the change.\n\t * @param {module:engine/model/range~Range} newRange Marker range after the change.\n\t * @param {module:engine/model/markercollection~MarkerCollection} markers Marker collection on which change should be executed.\n\t * @param {Boolean} affectsData Specifies whether the marker operation affects the data produced by the data pipeline\n\t * (is persisted in the editor's data).\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( name, oldRange, newRange, markers, affectsData, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Marker name.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t * Marker range before the change.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/range~Range}\n\t\t */\n\t\tthis.oldRange = oldRange ? oldRange.clone() : null;\n\n\t\t/**\n\t\t * Marker range after the change.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/range~Range}\n\t\t */\n\t\tthis.newRange = newRange ? newRange.clone() : null;\n\n\t\t/**\n\t\t * Specifies whether the marker operation affects the data produced by the data pipeline\n\t\t * (is persisted in the editor's data).\n\t\t *\n\t\t * @readonly\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis.affectsData = affectsData;\n\n\t\t/**\n\t\t * Marker collection on which change should be executed.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/markercollection~MarkerCollection}\n\t\t */\n\t\tthis._markers = markers;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'marker';\n\t}\n\n\t/**\n\t * Creates and returns an operation that has the same parameters as this operation.\n\t *\n\t * @returns {module:engine/model/operation/markeroperation~MarkerOperation} Clone of this operation.\n\t */\n\tclone() {\n\t\treturn new MarkerOperation( this.name, this.oldRange, this.newRange, this._markers, this.affectsData, this.baseVersion );\n\t}\n\n\t/**\n\t * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n\t *\n\t * @returns {module:engine/model/operation/markeroperation~MarkerOperation}\n\t */\n\tgetReversed() {\n\t\treturn new MarkerOperation( this.name, this.newRange, this.oldRange, this._markers, this.affectsData, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\tconst type = this.newRange ? '_set' : '_remove';\n\n\t\tthis._markers[ type ]( this.name, this.newRange, true, this.affectsData );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tif ( this.oldRange ) {\n\t\t\tjson.oldRange = this.oldRange.toJSON();\n\t\t}\n\n\t\tif ( this.newRange ) {\n\t\t\tjson.newRange = this.newRange.toJSON();\n\t\t}\n\n\t\tdelete json._markers;\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'MarkerOperation';\n\t}\n\n\t/**\n\t * Creates `MarkerOperation` object from deserialized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/markeroperation~MarkerOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\treturn new MarkerOperation(\n\t\t\tjson.name,\n\t\t\tjson.oldRange ? Range.fromJSON( json.oldRange, document ) : null,\n\t\t\tjson.newRange ? Range.fromJSON( json.newRange, document ) : null,\n\t\t\tdocument.model.markers,\n\t\t\tjson.affectsData,\n\t\t\tjson.baseVersion\n\t\t);\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/renameoperation\n */\n\nimport Operation from './operation';\nimport Element from '../element';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport Position from '../position';\n\n/**\n * Operation to change element's name.\n *\n * Using this class you can change element's name.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class RenameOperation extends Operation {\n\t/**\n\t * Creates an operation that changes element's name.\n\t *\n\t * @param {module:engine/model/position~Position} position Position before an element to change.\n\t * @param {String} oldName Current name of the element.\n\t * @param {String} newName New name for the element.\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( position, oldName, newName, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Position before an element to change.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/renameoperation~RenameOperation#position\n\t\t */\n\t\tthis.position = position;\n\t\t// This position sticks to the next node because it is a position before the node that we want to change.\n\t\tthis.position.stickiness = 'toNext';\n\n\t\t/**\n\t\t * Current name of the element.\n\t\t *\n\t\t * @member {String} module:engine/model/operation/renameoperation~RenameOperation#oldName\n\t\t */\n\t\tthis.oldName = oldName;\n\n\t\t/**\n\t\t * New name for the element.\n\t\t *\n\t\t * @member {String} module:engine/model/operation/renameoperation~RenameOperation#newName\n\t\t */\n\t\tthis.newName = newName;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'rename';\n\t}\n\n\t/**\n\t * Creates and returns an operation that has the same parameters as this operation.\n\t *\n\t * @returns {module:engine/model/operation/renameoperation~RenameOperation} Clone of this operation.\n\t */\n\tclone() {\n\t\treturn new RenameOperation( this.position.clone(), this.oldName, this.newName, this.baseVersion );\n\t}\n\n\t/**\n\t * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n\t *\n\t * @returns {module:engine/model/operation/renameoperation~RenameOperation}\n\t */\n\tgetReversed() {\n\t\treturn new RenameOperation( this.position.clone(), this.newName, this.oldName, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_validate() {\n\t\tconst element = this.position.nodeAfter;\n\n\t\tif ( !( element instanceof Element ) ) {\n\t\t\t/**\n\t\t\t * Given position is invalid or node after it is not instance of Element.\n\t\t\t *\n\t\t\t * @error rename-operation-wrong-position\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rename-operation-wrong-position: Given position is invalid or node after it is not an instance of Element.'\n\t\t\t);\n\t\t} else if ( element.name !== this.oldName ) {\n\t\t\t/**\n\t\t\t * Element to change has different name than operation's old name.\n\t\t\t *\n\t\t\t * @error rename-operation-wrong-name\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rename-operation-wrong-name: Element to change has different name than operation\\'s old name.'\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\tconst element = this.position.nodeAfter;\n\n\t\telement.name = this.newName;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tjson.position = this.position.toJSON();\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'RenameOperation';\n\t}\n\n\t/**\n\t * Creates `RenameOperation` object from deserialized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/attributeoperation~AttributeOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\treturn new RenameOperation( Position.fromJSON( json.position, document ), json.oldName, json.newName, json.baseVersion );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/rootattributeoperation\n */\n\nimport Operation from './operation';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Operation to change root element's attribute. Using this class you can add, remove or change value of the attribute.\n *\n * This operation is needed, because root elements can't be changed through\n * @link module:engine/model/operation/attributeoperation~AttributeOperation}.\n * It is because {@link module:engine/model/operation/attributeoperation~AttributeOperation}\n * requires a range to change and root element can't\n * be a part of range because every {@link module:engine/model/position~Position} has to be inside a root.\n * {@link module:engine/model/position~Position} can't be created before a root element.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class RootAttributeOperation extends Operation {\n\t/**\n\t * Creates an operation that changes, removes or adds attributes on root element.\n\t *\n\t * @see module:engine/model/operation/attributeoperation~AttributeOperation\n\t * @param {module:engine/model/rootelement~RootElement} root Root element to change.\n\t * @param {String} key Key of an attribute to change or remove.\n\t * @param {*} oldValue Old value of the attribute with given key or `null` if adding a new attribute.\n\t * @param {*} newValue New value to set for the attribute. If `null`, then the operation just removes the attribute.\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( root, key, oldValue, newValue, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Root element to change.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/rootelement~RootElement}\n\t\t */\n\t\tthis.root = root;\n\n\t\t/**\n\t\t * Key of an attribute to change or remove.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.key = key;\n\n\t\t/**\n\t\t * Old value of the attribute with given key or `null` if adding a new attribute.\n\t\t *\n\t\t * @readonly\n\t\t * @member {*}\n\t\t */\n\t\tthis.oldValue = oldValue;\n\n\t\t/**\n\t\t * New value to set for the attribute. If `null`, then the operation just removes the attribute.\n\t\t *\n\t\t * @readonly\n\t\t * @member {*}\n\t\t */\n\t\tthis.newValue = newValue;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\tif ( this.oldValue === null ) {\n\t\t\treturn 'addRootAttribute';\n\t\t} else if ( this.newValue === null ) {\n\t\t\treturn 'removeRootAttribute';\n\t\t} else {\n\t\t\treturn 'changeRootAttribute';\n\t\t}\n\t}\n\n\t/**\n\t * Creates and returns an operation that has the same parameters as this operation.\n\t *\n\t * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation} Clone of this operation.\n\t */\n\tclone() {\n\t\treturn new RootAttributeOperation( this.root, this.key, this.oldValue, this.newValue, this.baseVersion );\n\t}\n\n\t/**\n\t * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n\t *\n\t * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}\n\t */\n\tgetReversed() {\n\t\treturn new RootAttributeOperation( this.root, this.key, this.newValue, this.oldValue, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_validate() {\n\t\tif ( this.root != this.root.root || this.root.is( 'documentFragment' ) ) {\n\t\t\t/**\n\t\t\t * The element to change is not a root element.\n\t\t\t *\n\t\t\t * @error rootattribute-operation-not-a-root\n\t\t\t * @param {module:engine/model/rootelement~RootElement} root\n\t\t\t * @param {String} key\n\t\t\t * @param {*} value\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rootattribute-operation-not-a-root: The element to change is not a root element.',\n\t\t\t\t{ root: this.root, key: this.key }\n\t\t\t);\n\t\t}\n\n\t\tif ( this.oldValue !== null && this.root.getAttribute( this.key ) !== this.oldValue ) {\n\t\t\t/**\n\t\t\t * The attribute which should be removed does not exists for the given node.\n\t\t\t *\n\t\t\t * @error rootattribute-operation-wrong-old-value\n\t\t\t * @param {module:engine/model/rootelement~RootElement} root\n\t\t\t * @param {String} key\n\t\t\t * @param {*} value\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rootattribute-operation-wrong-old-value: Changed node has different attribute value than operation\\'s ' +\n\t\t\t\t'old attribute value.',\n\t\t\t\t{ root: this.root, key: this.key }\n\t\t\t);\n\t\t}\n\n\t\tif ( this.oldValue === null && this.newValue !== null && this.root.hasAttribute( this.key ) ) {\n\t\t\t/**\n\t\t\t * The attribute with given key already exists for the given node.\n\t\t\t *\n\t\t\t * @error rootattribute-operation-attribute-exists\n\t\t\t * @param {module:engine/model/rootelement~RootElement} root\n\t\t\t * @param {String} key\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rootattribute-operation-attribute-exists: The attribute with given key already exists.',\n\t\t\t\t{ root: this.root, key: this.key }\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\tif ( this.newValue !== null ) {\n\t\t\tthis.root._setAttribute( this.key, this.newValue );\n\t\t} else {\n\t\t\tthis.root._removeAttribute( this.key );\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tjson.root = this.root.toJSON();\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'RootAttributeOperation';\n\t}\n\n\t/**\n\t * Creates RootAttributeOperation object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/rootattributeoperation~RootAttributeOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tif ( !document.getRoot( json.root ) ) {\n\t\t\t/**\n\t\t\t * Cannot create RootAttributeOperation for document. Root with specified name does not exist.\n\t\t\t *\n\t\t\t * @error rootattributeoperation-fromjson-no-root\n\t\t\t * @param {String} rootName\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'rootattribute-operation-fromjson-no-root: Cannot create RootAttributeOperation. Root with specified name does not exist.',\n\t\t\t\t{ rootName: json.root }\n\t\t\t);\n\t\t}\n\n\t\treturn new RootAttributeOperation( document.getRoot( json.root ), json.key, json.oldValue, json.newValue, json.baseVersion );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/mergeoperation\n */\n\nimport Operation from './operation';\nimport SplitOperation from './splitoperation';\nimport Position from '../position';\nimport Range from '../range';\nimport { _move } from './utils';\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Operation to merge two {@link module:engine/model/element~Element elements}.\n *\n * The merged element is the parent of {@link ~MergeOperation#sourcePosition} and it is merged into the parent of\n * {@link ~MergeOperation#targetPosition}. All nodes from the merged element are moved to {@link ~MergeOperation#targetPosition}.\n *\n * The merged element is moved to the graveyard at {@link ~MergeOperation#graveyardPosition}.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class MergeOperation extends Operation {\n\t/**\n\t * Creates a merge operation.\n\t *\n\t * @param {module:engine/model/position~Position} sourcePosition Position inside the merged element. All nodes from that\n\t * element after that position will be moved to {@link ~#targetPosition}.\n\t * @param {Number} howMany Summary offset size of nodes which will be moved from the merged element to the new parent.\n\t * @param {module:engine/model/position~Position} targetPosition Position which the nodes from the merged elements will be moved to.\n\t * @param {module:engine/model/position~Position} graveyardPosition Position in graveyard to which the merged element will be moved.\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( sourcePosition, howMany, targetPosition, graveyardPosition, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Position inside the merged element. All nodes from that element after that position will be moved to {@link ~#targetPosition}.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#sourcePosition\n\t\t */\n\t\tthis.sourcePosition = sourcePosition.clone();\n\t\t// This is, and should always remain, the first position in its parent.\n\t\tthis.sourcePosition.stickiness = 'toPrevious';\n\n\t\t/**\n\t\t * Summary offset size of nodes which will be moved from the merged element to the new parent.\n\t\t *\n\t\t * @member {Number} module:engine/model/operation/mergeoperation~MergeOperation#howMany\n\t\t */\n\t\tthis.howMany = howMany;\n\n\t\t/**\n\t\t * Position which the nodes from the merged elements will be moved to.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#targetPosition\n\t\t */\n\t\tthis.targetPosition = targetPosition.clone();\n\t\t// Except of a rare scenario in `MergeOperation` x `MergeOperation` transformation,\n\t\t// this is, and should always remain, the last position in its parent.\n\t\tthis.targetPosition.stickiness = 'toNext';\n\n\t\t/**\n\t\t * Position in graveyard to which the merged element will be moved.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/mergeoperation~MergeOperation#graveyardPosition\n\t\t */\n\t\tthis.graveyardPosition = graveyardPosition.clone();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'merge';\n\t}\n\n\t/**\n\t * Position before the merged element (which will be deleted).\n\t *\n\t * @readonly\n\t * @type {module:engine/model/position~Position}\n\t */\n\tget deletionPosition() {\n\t\treturn new Position( this.sourcePosition.root, this.sourcePosition.path.slice( 0, -1 ) );\n\t}\n\n\t/**\n\t * Artificial range that contains all the nodes from the merged element that will be moved to {@link ~MergeOperation#sourcePosition}.\n\t * The range starts at {@link ~MergeOperation#sourcePosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/range~Range}\n\t */\n\tget movedRange() {\n\t\tconst end = this.sourcePosition.getShiftedBy( Number.POSITIVE_INFINITY );\n\n\t\treturn new Range( this.sourcePosition, end );\n\t}\n\n\t/**\n\t * Creates and returns an operation that has the same parameters as this operation.\n\t *\n\t * @returns {module:engine/model/operation/mergeoperation~MergeOperation} Clone of this operation.\n\t */\n\tclone() {\n\t\treturn new this.constructor( this.sourcePosition, this.howMany, this.targetPosition, this.graveyardPosition, this.baseVersion );\n\t}\n\n\t/**\n\t * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n\t *\n\t * @returns {module:engine/model/operation/splitoperation~SplitOperation}\n\t */\n\tgetReversed() {\n\t\t// Positions in this method are transformed by this merge operation because the split operation bases on\n\t\t// the context after this merge operation happened (because split operation reverses it).\n\t\t// So we need to acknowledge that the merge operation happened and those positions changed a little.\n\t\tconst targetPosition = this.targetPosition._getTransformedByMergeOperation( this );\n\n\t\tconst path = this.sourcePosition.path.slice( 0, -1 );\n\t\tconst insertionPosition = new Position( this.sourcePosition.root, path )._getTransformedByMergeOperation( this );\n\n\t\tconst split = new SplitOperation( targetPosition, this.howMany, this.graveyardPosition, this.baseVersion + 1 );\n\t\tsplit.insertionPosition = insertionPosition;\n\n\t\treturn split;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_validate() {\n\t\tconst sourceElement = this.sourcePosition.parent;\n\t\tconst targetElement = this.targetPosition.parent;\n\n\t\t// Validate whether merge operation has correct parameters.\n\t\tif ( !sourceElement || !sourceElement.is( 'element' ) || !sourceElement.parent ) {\n\t\t\t/**\n\t\t\t * Merge source position is invalid.\n\t\t\t *\n\t\t\t * @error merge-operation-source-position-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'merge-operation-source-position-invalid: Merge source position is invalid.' );\n\t\t} else if ( !targetElement || !targetElement.is( 'element' ) || !targetElement.parent ) {\n\t\t\t/**\n\t\t\t * Merge target position is invalid.\n\t\t\t *\n\t\t\t * @error merge-operation-target-position-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'merge-operation-target-position-invalid: Merge target position is invalid.' );\n\t\t} else if ( this.howMany != sourceElement.maxOffset ) {\n\t\t\t/**\n\t\t\t * Merge operation specifies wrong number of nodes to move.\n\t\t\t *\n\t\t\t * @error merge-operation-how-many-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'merge-operation-how-many-invalid: Merge operation specifies wrong number of nodes to move.' );\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\tconst mergedElement = this.sourcePosition.parent;\n\t\tconst sourceRange = Range._createIn( mergedElement );\n\n\t\t_move( sourceRange, this.targetPosition );\n\t\t_move( Range._createOn( mergedElement ), this.graveyardPosition );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tjson.sourcePosition = json.sourcePosition.toJSON();\n\t\tjson.targetPosition = json.targetPosition.toJSON();\n\t\tjson.graveyardPosition = json.graveyardPosition.toJSON();\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'MergeOperation';\n\t}\n\n\t/**\n\t * Creates `MergeOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/mergeoperation~MergeOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tconst sourcePosition = Position.fromJSON( json.sourcePosition, document );\n\t\tconst targetPosition = Position.fromJSON( json.targetPosition, document );\n\t\tconst graveyardPosition = Position.fromJSON( json.graveyardPosition, document );\n\n\t\treturn new this( sourcePosition, json.howMany, targetPosition, graveyardPosition, json.baseVersion );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/operation/splitoperation\n */\n\nimport Operation from './operation';\nimport MergeOperation from './mergeoperation';\nimport Position from '../position';\nimport Range from '../range';\nimport { _insert, _move } from './utils';\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * Operation to split {@link module:engine/model/element~Element an element} at given\n * {@link module:engine/model/operation/splitoperation~SplitOperation#splitPosition split position} into two elements,\n * both containing a part of the element's original content.\n *\n * @extends module:engine/model/operation/operation~Operation\n */\nexport default class SplitOperation extends Operation {\n\t/**\n\t * Creates a split operation.\n\t *\n\t * @param {module:engine/model/position~Position} splitPosition Position at which an element should be split.\n\t * @param {Number} howMany Total offset size of elements that are in the split element after `position`.\n\t * @param {module:engine/model/position~Position|null} graveyardPosition Position in the graveyard root before the element which\n\t * should be used as a parent of the nodes after `position`. If it is not set, a copy of the the `position` parent will be used.\n\t * @param {Number|null} baseVersion Document {@link module:engine/model/document~Document#version} on which operation\n\t * can be applied or `null` if the operation operates on detached (non-document) tree.\n\t */\n\tconstructor( splitPosition, howMany, graveyardPosition, baseVersion ) {\n\t\tsuper( baseVersion );\n\n\t\t/**\n\t\t * Position at which an element should be split.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#splitPosition\n\t\t */\n\t\tthis.splitPosition = splitPosition.clone();\n\t\t// Keep position sticking to the next node. This way any new content added at the place where the element is split\n\t\t// will be left in the original element.\n\t\tthis.splitPosition.stickiness = 'toNext';\n\n\t\t/**\n\t\t * Total offset size of elements that are in the split element after `position`.\n\t\t *\n\t\t * @member {Number} module:engine/model/operation/splitoperation~SplitOperation#howMany\n\t\t */\n\t\tthis.howMany = howMany;\n\n\t\t/**\n\t\t * Position at which the clone of split element (or element from graveyard) will be inserted.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} module:engine/model/operation/splitoperation~SplitOperation#insertionPosition\n\t\t */\n\t\tthis.insertionPosition = SplitOperation.getInsertionPosition( splitPosition );\n\t\tthis.insertionPosition.stickiness = 'toNone';\n\n\t\t/**\n\t\t * Position in the graveyard root before the element which should be used as a parent of the nodes after `position`.\n\t\t * If it is not set, a copy of the the `position` parent will be used.\n\t\t *\n\t\t * The default behavior is to clone the split element. Element from graveyard is used during undo.\n\t\t *\n\t\t * @member {module:engine/model/position~Position|null} #graveyardPosition\n\t\t */\n\t\tthis.graveyardPosition = graveyardPosition ? graveyardPosition.clone() : null;\n\n\t\tif ( this.graveyardPosition ) {\n\t\t\tthis.graveyardPosition.stickiness = 'toNext';\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget type() {\n\t\treturn 'split';\n\t}\n\n\t/**\n\t * Position inside the new clone of a split element.\n\t *\n\t * This is a position where nodes that are after the split position will be moved to.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/position~Position}\n\t */\n\tget moveTargetPosition() {\n\t\tconst path = this.insertionPosition.path.slice();\n\t\tpath.push( 0 );\n\n\t\treturn new Position( this.insertionPosition.root, path );\n\t}\n\n\t/**\n\t * Artificial range that contains all the nodes from the split element that will be moved to the new element.\n\t * The range starts at {@link ~#splitPosition} and ends in the same parent, at `POSITIVE_INFINITY` offset.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/range~Range}\n\t */\n\tget movedRange() {\n\t\tconst end = this.splitPosition.getShiftedBy( Number.POSITIVE_INFINITY );\n\n\t\treturn new Range( this.splitPosition, end );\n\t}\n\n\t/**\n\t * Creates and returns an operation that has the same parameters as this operation.\n\t *\n\t * @returns {module:engine/model/operation/splitoperation~SplitOperation} Clone of this operation.\n\t */\n\tclone() {\n\t\tconst split = new this.constructor( this.splitPosition, this.howMany, this.graveyardPosition, this.baseVersion );\n\t\tsplit.insertionPosition = this.insertionPosition;\n\n\t\treturn split;\n\t}\n\n\t/**\n\t * See {@link module:engine/model/operation/operation~Operation#getReversed `Operation#getReversed()`}.\n\t *\n\t * @returns {module:engine/model/operation/mergeoperation~MergeOperation}\n\t */\n\tgetReversed() {\n\t\tconst graveyard = this.splitPosition.root.document.graveyard;\n\t\tconst graveyardPosition = new Position( graveyard, [ 0 ] );\n\n\t\treturn new MergeOperation( this.moveTargetPosition, this.howMany, this.splitPosition, graveyardPosition, this.baseVersion + 1 );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_validate() {\n\t\tconst element = this.splitPosition.parent;\n\t\tconst offset = this.splitPosition.offset;\n\n\t\t// Validate whether split operation has correct parameters.\n\t\tif ( !element || element.maxOffset < offset ) {\n\t\t\t/**\n\t\t\t * Split position is invalid.\n\t\t\t *\n\t\t\t * @error split-operation-position-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'split-operation-position-invalid: Split position is invalid.' );\n\t\t} else if ( !element.parent ) {\n\t\t\t/**\n\t\t\t * Cannot split root element.\n\t\t\t *\n\t\t\t * @error split-operation-split-in-root\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'split-operation-split-in-root: Cannot split root element.' );\n\t\t} else if ( this.howMany != element.maxOffset - this.splitPosition.offset ) {\n\t\t\t/**\n\t\t\t * Split operation specifies wrong number of nodes to move.\n\t\t\t *\n\t\t\t * @error split-operation-how-many-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'split-operation-how-many-invalid: Split operation specifies wrong number of nodes to move.' );\n\t\t} else if ( this.graveyardPosition && !this.graveyardPosition.nodeAfter ) {\n\t\t\t/**\n\t\t\t * Graveyard position invalid.\n\t\t\t *\n\t\t\t * @error split-operation-graveyard-position-invalid\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'split-operation-graveyard-position-invalid: Graveyard position invalid.' );\n\t\t}\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\t_execute() {\n\t\tconst splitElement = this.splitPosition.parent;\n\n\t\tif ( this.graveyardPosition ) {\n\t\t\t_move( Range._createFromPositionAndShift( this.graveyardPosition, 1 ), this.insertionPosition );\n\t\t} else {\n\t\t\tconst newElement = splitElement._clone();\n\n\t\t\t_insert( this.insertionPosition, newElement );\n\t\t}\n\n\t\tconst sourceRange = new Range(\n\t\t\tPosition._createAt( splitElement, this.splitPosition.offset ),\n\t\t\tPosition._createAt( splitElement, splitElement.maxOffset )\n\t\t);\n\n\t\t_move( sourceRange, this.moveTargetPosition );\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\ttoJSON() {\n\t\tconst json = super.toJSON();\n\n\t\tjson.splitPosition = this.splitPosition.toJSON();\n\t\tjson.insertionPosition = this.insertionPosition.toJSON();\n\n\t\tif ( this.graveyardPosition ) {\n\t\t\tjson.graveyardPosition = this.graveyardPosition.toJSON();\n\t\t}\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tstatic get className() {\n\t\treturn 'SplitOperation';\n\t}\n\n\t/**\n\t * Helper function that returns a default insertion position basing on given `splitPosition`. The default insertion\n\t * position is after the split element.\n\t *\n\t * @param {module:engine/model/position~Position} splitPosition\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tstatic getInsertionPosition( splitPosition ) {\n\t\tconst path = splitPosition.path.slice( 0, -1 );\n\t\tpath[ path.length - 1 ]++;\n\n\t\treturn new Position( splitPosition.root, path );\n\t}\n\n\t/**\n\t * Creates `SplitOperation` object from deserilized object, i.e. from parsed JSON string.\n\t *\n\t * @param {Object} json Deserialized JSON object.\n\t * @param {module:engine/model/document~Document} document Document on which this operation will be applied.\n\t * @returns {module:engine/model/operation/splitoperation~SplitOperation}\n\t */\n\tstatic fromJSON( json, document ) {\n\t\tconst splitPosition = Position.fromJSON( json.splitPosition, document );\n\t\tconst insertionPosition = Position.fromJSON( json.insertionPosition, document );\n\t\tconst graveyardPosition = json.graveyardPosition ? Position.fromJSON( json.graveyardPosition, document ) : null;\n\n\t\tconst split = new this( splitPosition, json.howMany, graveyardPosition, json.baseVersion );\n\t\tsplit.insertionPosition = insertionPosition;\n\n\t\treturn split;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/rootelement\n */\n\nimport Element from './element';\n\n/**\n * Type of {@link module:engine/model/element~Element} that is a root of a model tree.\n * @extends module:engine/model/element~Element\n */\nexport default class RootElement extends Element {\n\t/**\n\t * Creates root element.\n\t *\n\t * @param {module:engine/model/document~Document} doc Document that is an owner of this root.\n\t * @param {String} name Node name.\n\t * @param {String} [rootName='main'] Unique root name used to identify this root\n\t * element by {@link module:engine/model/document~Document}.\n\t */\n\tconstructor( doc, name, rootName = 'main' ) {\n\t\tsuper( name );\n\n\t\t/**\n\t\t * Document that is an owner of this root.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/document~Document}\n\t\t */\n\t\tthis._doc = doc;\n\n\t\t/**\n\t\t * Unique root name used to identify this root element by {@link module:engine/model/document~Document}.\n\t\t *\n\t\t * @readonly\n\t\t * @member {String}\n\t\t */\n\t\tthis.rootName = rootName;\n\t}\n\n\t/**\n\t * {@link module:engine/model/document~Document Document} that owns this root element.\n\t *\n\t * In contrary, to {@link module:engine/model/node~Node node}, root element always have a `document`.\n\t *\n\t * @readonly\n\t * @type {module:engine/model/document~Document|null}\n\t */\n\tget document() {\n\t\treturn this._doc;\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tis( type, name ) {\n\t\tif ( !name ) {\n\t\t\treturn type == 'rootElement' || super.is( type );\n\t\t} else {\n\t\t\treturn ( type == 'rootElement' && name == this.name ) || super.is( type, name );\n\t\t}\n\t}\n\n\t/**\n\t * Converts `RootElement` instance to `String` containing it's name.\n\t *\n\t * @returns {String} `RootElement` instance converted to `String`.\n\t */\n\ttoJSON() {\n\t\treturn this.rootName;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/writer\n */\n\nimport AttributeOperation from './operation/attributeoperation';\nimport DetachOperation from './operation/detachoperation';\nimport InsertOperation from './operation/insertoperation';\nimport MarkerOperation from './operation/markeroperation';\nimport MoveOperation from './operation/moveoperation';\nimport RenameOperation from './operation/renameoperation';\nimport RootAttributeOperation from './operation/rootattributeoperation';\nimport SplitOperation from './operation/splitoperation';\nimport MergeOperation from './operation/mergeoperation';\n\nimport DocumentFragment from './documentfragment';\nimport Text from './text';\nimport Element from './element';\nimport RootElement from './rootelement';\nimport Position from './position';\nimport Range from './range.js';\nimport DocumentSelection from './documentselection';\n\nimport toMap from '@ckeditor/ckeditor5-utils/src/tomap';\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * The model can only be modified by using the writer. It should be used whenever you want to create a node, modify\n * child nodes, attributes or text, set the selection's position and its attributes.\n *\n * The instance of the writer is only available in the {@link module:engine/model/model~Model#change `change()`} or\n * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`}.\n *\n *\t\tmodel.change( writer => {\n *\t\t\twriter.insertText( 'foo', paragraph, 'end' );\n *\t\t} );\n *\n * Note that the writer should never be stored and used outside of the `change()` and\n * `enqueueChange()` blocks.\n *\n * Note that writer's methods do not check the {@link module:engine/model/schema~Schema}. It is possible\n * to create incorrect model structures by using the writer. Read more about in\n * {@glink framework/guides/deep-dive/schema#who-checks-the-schema \"Who checks the schema?\"}.\n *\n * @see module:engine/model/model~Model#change\n * @see module:engine/model/model~Model#enqueueChange\n */\nexport default class Writer {\n\t/**\n\t * Creates a writer instance.\n\t *\n\t * **Note:** It is not recommended to use it directly. Use {@link module:engine/model/model~Model#change `Model#change()`} or\n\t * {@link module:engine/model/model~Model#enqueueChange `Model#enqueueChange()`} instead.\n\t *\n\t * @protected\n\t * @param {module:engine/model/model~Model} model\n\t * @param {module:engine/model/batch~Batch} batch\n\t */\n\tconstructor( model, batch ) {\n\t\t/**\n\t\t * Instance of the model on which this writer operates.\n\t\t *\n\t\t * @readonly\n\t\t * @type {module:engine/model/model~Model}\n\t\t */\n\t\tthis.model = model;\n\n\t\t/**\n\t\t * The batch to which this writer will add changes.\n\t\t *\n\t\t * @readonly\n\t\t * @type {module:engine/model/batch~Batch}\n\t\t */\n\t\tthis.batch = batch;\n\t}\n\n\t/**\n\t * Creates a new {@link module:engine/model/text~Text text node}.\n\t *\n\t *\t\twriter.createText( 'foo' );\n\t *\t\twriter.createText( 'foo', { bold: true } );\n\t *\n\t * @param {String} data Text data.\n\t * @param {Object} [attributes] Text attributes.\n\t * @returns {module:engine/model/text~Text} Created text node.\n\t */\n\tcreateText( data, attributes ) {\n\t\treturn new Text( data, attributes );\n\t}\n\n\t/**\n\t * Creates a new {@link module:engine/model/element~Element element}.\n\t *\n\t *\t\twriter.createElement( 'paragraph' );\n\t *\t\twriter.createElement( 'paragraph', { alignment: 'center' } );\n\t *\n\t * @param {String} name Name of the element.\n\t * @param {Object} [attributes] Elements attributes.\n\t * @returns {module:engine/model/element~Element} Created element.\n\t */\n\tcreateElement( name, attributes ) {\n\t\treturn new Element( name, attributes );\n\t}\n\n\t/**\n\t * Creates a new {@link module:engine/model/documentfragment~DocumentFragment document fragment}.\n\t *\n\t * @returns {module:engine/model/documentfragment~DocumentFragment} Created document fragment.\n\t */\n\tcreateDocumentFragment() {\n\t\treturn new DocumentFragment();\n\t}\n\n\t/**\n\t * Inserts item on given position.\n\t *\n\t *\t\tconst paragraph = writer.createElement( 'paragraph' );\n\t *\t\twriter.insert( paragraph, position );\n\t *\n\t * Instead of using position you can use parent and offset:\n\t *\n\t *\t\tconst text = writer.createText( 'foo' );\n\t *\t\twriter.insert( text, paragraph, 5 );\n\t *\n\t * You can also use `end` instead of the offset to insert at the end:\n\t *\n\t *\t\tconst text = writer.createText( 'foo' );\n\t *\t\twriter.insert( text, paragraph, 'end' );\n\t *\n\t * Or insert before or after another element:\n\t *\n\t *\t\tconst paragraph = writer.createElement( 'paragraph' );\n\t *\t\twriter.insert( paragraph, anotherParagraph, 'after' );\n\t *\n\t * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.\n\t *\n\t * Note that if the item already has parent it will be removed from the previous parent.\n\t *\n\t * Note that you cannot re-insert a node from a document to a different document or a document fragment. In this case,\n\t * `model-writer-insert-forbidden-move` is thrown.\n\t *\n\t * If you want to move {@link module:engine/model/range~Range range} instead of an\n\t * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.\n\t *\n\t * **Note:** For a paste-like content insertion mechanism see\n\t * {@link module:engine/model/model~Model#insertContent `model.insertContent()`}.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment} item Item or document\n\t * fragment to insert.\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n\t * second parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tinsert( item, itemOrPosition, offset = 0 ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( item instanceof Text && item.data == '' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst position = Position._createAt( itemOrPosition, offset );\n\n\t\t// If item has a parent already.\n\t\tif ( item.parent ) {\n\t\t\t// We need to check if item is going to be inserted within the same document.\n\t\t\tif ( isSameTree( item.root, position.root ) ) {\n\t\t\t\t// If it's we just need to move it.\n\t\t\t\tthis.move( Range._createOn( item ), position );\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// If it isn't the same root.\n\t\t\telse {\n\t\t\t\tif ( item.root.document ) {\n\t\t\t\t\t// It is forbidden to move a node that was already in a document outside of it.\n\t\t\t\t\tthrow new Error( 'model-writer-insert-forbidden-move: Cannot move a node from a document to a different tree.' );\n\t\t\t\t} else {\n\t\t\t\t\t// Move between two different document fragments or from document fragment to a document is possible.\n\t\t\t\t\t// In that case, remove the item from it's original parent.\n\t\t\t\t\tthis.remove( item );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst version = position.root.document ? position.root.document.version : null;\n\n\t\tconst insert = new InsertOperation( position, item, version );\n\n\t\tif ( item instanceof Text ) {\n\t\t\tinsert.shouldReceiveAttributes = true;\n\t\t}\n\n\t\tthis.batch.addOperation( insert );\n\t\tthis.model.applyOperation( insert );\n\n\t\t// When element is a DocumentFragment we need to move its markers to Document#markers.\n\t\tif ( item instanceof DocumentFragment ) {\n\t\t\tfor ( const [ markerName, markerRange ] of item.markers ) {\n\t\t\t\t// We need to migrate marker range from DocumentFragment to Document.\n\t\t\t\tconst rangeRootPosition = Position._createAt( markerRange.root, 0 );\n\t\t\t\tconst range = new Range(\n\t\t\t\t\tmarkerRange.start._getCombined( rangeRootPosition, position ),\n\t\t\t\t\tmarkerRange.end._getCombined( rangeRootPosition, position )\n\t\t\t\t);\n\n\t\t\t\tthis.addMarker( markerName, { range, usingOperation: true, affectsData: true } );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Creates and inserts text on given position. You can optionally set text attributes:\n\t *\n\t *\t\twriter.insertText( 'foo', position );\n\t *\t\twriter.insertText( 'foo', { bold: true }, position );\n\t *\n\t * Instead of using position you can use parent and offset or define that text should be inserted at the end\n\t * or before or after other node:\n\t *\n\t *\t\t// Inserts 'foo' in paragraph, at offset 5:\n\t *\t\twriter.insertText( 'foo', paragraph, 5 );\n\t *\t\t// Inserts 'foo' at the end of a paragraph:\n\t *\t\twriter.insertText( 'foo', paragraph, 'end' );\n\t *\t\t// Inserts 'foo' after an image:\n\t *\t\twriter.insertText( 'foo', image, 'after' );\n\t *\n\t * These parameters work in the same way as {@link #createPositionAt `writer.createPositionAt()`}.\n\t *\n\t * @param {String} data Text data.\n\t * @param {Object} [attributes] Text attributes.\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n\t * third parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tinsertText( text, attributes, itemOrPosition, offset ) {\n\t\tif ( attributes instanceof DocumentFragment || attributes instanceof Element || attributes instanceof Position ) {\n\t\t\tthis.insert( this.createText( text ), attributes, itemOrPosition );\n\t\t} else {\n\t\t\tthis.insert( this.createText( text, attributes ), itemOrPosition, offset );\n\t\t}\n\t}\n\n\t/**\n\t * Creates and inserts element on given position. You can optionally set attributes:\n\t *\n\t *\t\twriter.insertElement( 'paragraph', position );\n\t *\t\twriter.insertElement( 'paragraph', { alignment: 'center' }, position );\n\t *\n\t * Instead of using position you can use parent and offset or define that text should be inserted at the end\n\t * or before or after other node:\n\t *\n\t *\t\t// Inserts paragraph in the root at offset 5:\n\t *\t\twriter.insertElement( 'paragraph', root, 5 );\n\t *\t\t// Inserts paragraph at the end of a blockquote:\n\t *\t\twriter.insertElement( 'paragraph', blockquote, 'end' );\n\t *\t\t// Inserts after an image:\n\t *\t\twriter.insertElement( 'paragraph', image, 'after' );\n\t *\n\t * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.\n\t *\n\t * @param {String} name Name of the element.\n\t * @param {Object} [attributes] Elements attributes.\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n\t * third parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tinsertElement( name, attributes, itemOrPosition, offset ) {\n\t\tif ( attributes instanceof DocumentFragment || attributes instanceof Element || attributes instanceof Position ) {\n\t\t\tthis.insert( this.createElement( name ), attributes, itemOrPosition );\n\t\t} else {\n\t\t\tthis.insert( this.createElement( name, attributes ), itemOrPosition, offset );\n\t\t}\n\t}\n\n\t/**\n\t * Inserts item at the end of the given parent.\n\t *\n\t *\t\tconst paragraph = writer.createElement( 'paragraph' );\n\t *\t\twriter.append( paragraph, root );\n\t *\n\t * Note that if the item already has parent it will be removed from the previous parent.\n\t *\n\t * If you want to move {@link module:engine/model/range~Range range} instead of an\n\t * {@link module:engine/model/item~Item item} use {@link module:engine/model/writer~Writer#move `Writer#move()`}.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/documentfragment~DocumentFragment}\n\t * item Item or document fragment to insert.\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent\n\t */\n\tappend( item, parent ) {\n\t\tthis.insert( item, parent, 'end' );\n\t}\n\n\t/**\n\t * Creates text node and inserts it at the end of the parent. You can optionally set text attributes:\n\t *\n\t *\t\twriter.appendText( 'foo', paragraph );\n\t *\t\twriter.appendText( 'foo', { bold: true }, paragraph );\n\t *\n\t * @param {String} text Text data.\n\t * @param {Object} [attributes] Text attributes.\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent\n\t */\n\tappendText( text, attributes, parent ) {\n\t\tif ( attributes instanceof DocumentFragment || attributes instanceof Element ) {\n\t\t\tthis.insert( this.createText( text ), attributes, 'end' );\n\t\t} else {\n\t\t\tthis.insert( this.createText( text, attributes ), parent, 'end' );\n\t\t}\n\t}\n\n\t/**\n\t * Creates element and inserts it at the end of the parent. You can optionally set attributes:\n\t *\n\t *\t\twriter.appendElement( 'paragraph', root );\n\t *\t\twriter.appendElement( 'paragraph', { alignment: 'center' }, root );\n\t *\n\t * @param {String} name Name of the element.\n\t * @param {Object} [attributes] Elements attributes.\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} parent\n\t */\n\tappendElement( name, attributes, parent ) {\n\t\tif ( attributes instanceof DocumentFragment || attributes instanceof Element ) {\n\t\t\tthis.insert( this.createElement( name ), attributes, 'end' );\n\t\t} else {\n\t\t\tthis.insert( this.createElement( name, attributes ), parent, 'end' );\n\t\t}\n\t}\n\n\t/**\n\t * Sets value of the attribute with given key on a {@link module:engine/model/item~Item model item}\n\t * or on a {@link module:engine/model/range~Range range}.\n\t *\n\t * @param {String} key Attribute key.\n\t * @param {*} value Attribute new value.\n\t * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange\n\t * Model item or range on which the attribute will be set.\n\t */\n\tsetAttribute( key, value, itemOrRange ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( itemOrRange instanceof Range ) {\n\t\t\tconst ranges = itemOrRange.getMinimalFlatRanges();\n\n\t\t\tfor ( const range of ranges ) {\n\t\t\t\tsetAttributeOnRange( this, key, value, range );\n\t\t\t}\n\t\t} else {\n\t\t\tsetAttributeOnItem( this, key, value, itemOrRange );\n\t\t}\n\t}\n\n\t/**\n\t * Sets values of attributes on a {@link module:engine/model/item~Item model item}\n\t * or on a {@link module:engine/model/range~Range range}.\n\t *\n\t *\t\twriter.setAttributes( {\n\t *\t\t\tbold: true,\n\t *\t\t\titalic: true\n\t *\t\t}, range );\n\t *\n\t * @param {Object} attributes Attributes keys and values.\n\t * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange\n\t * Model item or range on which the attributes will be set.\n\t */\n\tsetAttributes( attributes, itemOrRange ) {\n\t\tfor ( const [ key, val ] of toMap( attributes ) ) {\n\t\t\tthis.setAttribute( key, val, itemOrRange );\n\t\t}\n\t}\n\n\t/**\n\t * Removes an attribute with given key from a {@link module:engine/model/item~Item model item}\n\t * or from a {@link module:engine/model/range~Range range}.\n\t *\n\t * @param {String} key Attribute key.\n\t * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange\n\t * Model item or range from which the attribute will be removed.\n\t */\n\tremoveAttribute( key, itemOrRange ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( itemOrRange instanceof Range ) {\n\t\t\tconst ranges = itemOrRange.getMinimalFlatRanges();\n\n\t\t\tfor ( const range of ranges ) {\n\t\t\t\tsetAttributeOnRange( this, key, null, range );\n\t\t\t}\n\t\t} else {\n\t\t\tsetAttributeOnItem( this, key, null, itemOrRange );\n\t\t}\n\t}\n\n\t/**\n\t * Removes all attributes from all elements in the range or from the given item.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange\n\t * Model item or range from which all attributes will be removed.\n\t */\n\tclearAttributes( itemOrRange ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tconst removeAttributesFromItem = item => {\n\t\t\tfor ( const attribute of item.getAttributeKeys() ) {\n\t\t\t\tthis.removeAttribute( attribute, item );\n\t\t\t}\n\t\t};\n\n\t\tif ( !( itemOrRange instanceof Range ) ) {\n\t\t\tremoveAttributesFromItem( itemOrRange );\n\t\t} else {\n\t\t\tfor ( const item of itemOrRange.getItems() ) {\n\t\t\t\tremoveAttributesFromItem( item );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Moves all items in the source range to the target position.\n\t *\n\t *\t\twriter.move( sourceRange, targetPosition );\n\t *\n\t * Instead of the target position you can use parent and offset or define that range should be moved to the end\n\t * or before or after chosen item:\n\t *\n\t *\t\t// Moves all items in the range to the paragraph at offset 5:\n\t *\t\twriter.move( sourceRange, paragraph, 5 );\n\t *\t\t// Moves all items in the range to the end of a blockquote:\n\t *\t\twriter.move( sourceRange, blockquote, 'end' );\n\t *\t\t// Moves all items in the range to a position after an image:\n\t *\t\twriter.move( sourceRange, image, 'after' );\n\t *\n\t * These parameters works the same way as {@link #createPositionAt `writer.createPositionAt()`}.\n\t *\n\t * Note that items can be moved only within the same tree. It means that you can move items within the same root\n\t * (element or document fragment) or between {@link module:engine/model/document~Document#roots documents roots},\n\t * but you can not move items from document fragment to the document or from one detached element to another. Use\n\t * {@link module:engine/model/writer~Writer#insert} in such cases.\n\t *\n\t * @param {module:engine/model/range~Range} range Source range.\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n\t * second parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tmove( range, itemOrPosition, offset ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( !( range instanceof Range ) ) {\n\t\t\t/**\n\t\t\t * Invalid range to move.\n\t\t\t *\n\t\t\t * @error writer-move-invalid-range\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-move-invalid-range: Invalid range to move.' );\n\t\t}\n\n\t\tif ( !range.isFlat ) {\n\t\t\t/**\n\t\t\t * Range to move is not flat.\n\t\t\t *\n\t\t\t * @error writer-move-range-not-flat\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-move-range-not-flat: Range to move is not flat.' );\n\t\t}\n\n\t\tconst position = Position._createAt( itemOrPosition, offset );\n\n\t\t// Do not move anything if the move target is same as moved range start.\n\t\tif ( position.isEqual( range.start ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If part of the marker is removed, create additional marker operation for undo purposes.\n\t\tthis._addOperationForAffectedMarkers( 'move', range );\n\n\t\tif ( !isSameTree( range.root, position.root ) ) {\n\t\t\t/**\n\t\t\t * Range is going to be moved within not the same document. Please use\n\t\t\t * {@link module:engine/model/writer~Writer#insert insert} instead.\n\t\t\t *\n\t\t\t * @error writer-move-different-document\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-move-different-document: Range is going to be moved between different documents.' );\n\t\t}\n\n\t\tconst version = range.root.document ? range.root.document.version : null;\n\t\tconst operation = new MoveOperation( range.start, range.end.offset - range.start.offset, position, version );\n\n\t\tthis.batch.addOperation( operation );\n\t\tthis.model.applyOperation( operation );\n\t}\n\n\t/**\n\t * Removes given model {@link module:engine/model/item~Item item} or {@link module:engine/model/range~Range range}.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/range~Range} itemOrRange Model item or range to remove.\n\t */\n\tremove( itemOrRange ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tconst rangeToRemove = itemOrRange instanceof Range ? itemOrRange : Range._createOn( itemOrRange );\n\t\tconst ranges = rangeToRemove.getMinimalFlatRanges().reverse();\n\n\t\tfor ( const flat of ranges ) {\n\t\t\t// If part of the marker is removed, create additional marker operation for undo purposes.\n\t\t\tthis._addOperationForAffectedMarkers( 'move', flat );\n\n\t\t\tapplyRemoveOperation( flat.start, flat.end.offset - flat.start.offset, this.batch, this.model );\n\t\t}\n\t}\n\n\t/**\n\t * Merges two siblings at the given position.\n\t *\n\t * Node before and after the position have to be an element. Otherwise `writer-merge-no-element-before` or\n\t * `writer-merge-no-element-after` error will be thrown.\n\t *\n\t * @param {module:engine/model/position~Position} position Position between merged elements.\n\t */\n\tmerge( position ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tconst nodeBefore = position.nodeBefore;\n\t\tconst nodeAfter = position.nodeAfter;\n\n\t\t// If part of the marker is removed, create additional marker operation for undo purposes.\n\t\tthis._addOperationForAffectedMarkers( 'merge', position );\n\n\t\tif ( !( nodeBefore instanceof Element ) ) {\n\t\t\t/**\n\t\t\t * Node before merge position must be an element.\n\t\t\t *\n\t\t\t * @error writer-merge-no-element-before\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-merge-no-element-before: Node before merge position must be an element.' );\n\t\t}\n\n\t\tif ( !( nodeAfter instanceof Element ) ) {\n\t\t\t/**\n\t\t\t * Node after merge position must be an element.\n\t\t\t *\n\t\t\t * @error writer-merge-no-element-after\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-merge-no-element-after: Node after merge position must be an element.' );\n\t\t}\n\n\t\tif ( !position.root.document ) {\n\t\t\tthis._mergeDetached( position );\n\t\t} else {\n\t\t\tthis._merge( position );\n\t\t}\n\t}\n\n\t/**\n\t * Shortcut for {@link module:engine/model/model~Model#createPositionFromPath `Model#createPositionFromPath()`}.\n\t *\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.\n\t * @param {Array.} path Position path. See {@link module:engine/model/position~Position#path}.\n\t * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.\n\t * See {@link module:engine/model/position~PositionStickiness}.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tcreatePositionFromPath( root, path, stickiness ) {\n\t\treturn this.model.createPositionFromPath( root, path, stickiness );\n\t}\n\n\t/**\n\t * Shortcut for {@link module:engine/model/model~Model#createPositionAt `Model#createPositionAt()`}.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/model/item~Item model item}.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tcreatePositionAt( itemOrPosition, offset ) {\n\t\treturn this.model.createPositionAt( itemOrPosition, offset );\n\t}\n\n\t/**\n\t * Shortcut for {@link module:engine/model/model~Model#createPositionAfter `Model#createPositionAfter()`}.\n\t *\n\t * @param {module:engine/model/item~Item} item Item after which the position should be placed.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tcreatePositionAfter( item ) {\n\t\treturn this.model.createPositionAfter( item );\n\t}\n\n\t/**\n\t * Shortcut for {@link module:engine/model/model~Model#createPositionBefore `Model#createPositionBefore()`}.\n\t *\n\t * @param {module:engine/model/item~Item} item Item after which the position should be placed.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tcreatePositionBefore( item ) {\n\t\treturn this.model.createPositionBefore( item );\n\t}\n\n\t/**\n\t * Shortcut for {@link module:engine/model/model~Model#createRange `Model#createRange()`}.\n\t *\n\t * @param {module:engine/model/position~Position} start Start position.\n\t * @param {module:engine/model/position~Position} [end] End position. If not set, range will be collapsed at `start` position.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tcreateRange( start, end ) {\n\t\treturn this.model.createRange( start, end );\n\t}\n\n\t/**\n\t * Shortcut for {@link module:engine/model/model~Model#createRangeIn `Model#createRangeIn()`}.\n\t *\n\t * @param {module:engine/model/element~Element} element Element which is a parent for the range.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tcreateRangeIn( element ) {\n\t\treturn this.model.createRangeIn( element );\n\t}\n\n\t/**\n\t * Shortcut for {@link module:engine/model/model~Model#createRangeOn `Model#createRangeOn()`}.\n\t *\n\t * @param {module:engine/model/element~Element} element Element which is a parent for the range.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tcreateRangeOn( element ) {\n\t\treturn this.model.createRangeOn( element );\n\t}\n\n\t/**\n\t * Shortcut for {@link module:engine/model/model~Model#createSelection `Model#createSelection()`}.\n\t *\n\t * @param {module:engine/model/selection~Selectable} selectable\n\t * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.\n\t * @param {Object} [options]\n\t * @param {Boolean} [options.backward] Sets this selection instance to be backward.\n\t * @returns {module:engine/model/selection~Selection}\n\t */\n\tcreateSelection( selectable, placeOrOffset, options ) {\n\t\treturn this.model.createSelection( selectable, placeOrOffset, options );\n\t}\n\n\t/**\n\t * Performs merge action in a detached tree.\n\t *\n\t * @private\n\t * @param {module:engine/model/position~Position} position Position between merged elements.\n\t */\n\t_mergeDetached( position ) {\n\t\tconst nodeBefore = position.nodeBefore;\n\t\tconst nodeAfter = position.nodeAfter;\n\n\t\tthis.move( Range._createIn( nodeAfter ), Position._createAt( nodeBefore, 'end' ) );\n\t\tthis.remove( nodeAfter );\n\t}\n\n\t/**\n\t * Performs merge action in a non-detached tree.\n\t *\n\t * @private\n\t * @param {module:engine/model/position~Position} position Position between merged elements.\n\t */\n\t_merge( position ) {\n\t\tconst targetPosition = Position._createAt( position.nodeBefore, 'end' );\n\t\tconst sourcePosition = Position._createAt( position.nodeAfter, 0 );\n\n\t\tconst graveyard = position.root.document.graveyard;\n\t\tconst graveyardPosition = new Position( graveyard, [ 0 ] );\n\n\t\tconst version = position.root.document.version;\n\n\t\tconst merge = new MergeOperation( sourcePosition, position.nodeAfter.maxOffset, targetPosition, graveyardPosition, version );\n\n\t\tthis.batch.addOperation( merge );\n\t\tthis.model.applyOperation( merge );\n\t}\n\n\t/**\n\t * Renames the given element.\n\t *\n\t * @param {module:engine/model/element~Element} element The element to rename.\n\t * @param {String} newName New element name.\n\t */\n\trename( element, newName ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( !( element instanceof Element ) ) {\n\t\t\t/**\n\t\t\t * Trying to rename an object which is not an instance of Element.\n\t\t\t *\n\t\t\t * @error writer-rename-not-element-instance\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'writer-rename-not-element-instance: Trying to rename an object which is not an instance of Element.'\n\t\t\t);\n\t\t}\n\n\t\tconst version = element.root.document ? element.root.document.version : null;\n\t\tconst renameOperation = new RenameOperation( Position._createBefore( element ), element.name, newName, version );\n\n\t\tthis.batch.addOperation( renameOperation );\n\t\tthis.model.applyOperation( renameOperation );\n\t}\n\n\t/**\n\t * Splits elements starting from the given position and going to the top of the model tree as long as given\n\t * `limitElement` is reached. When `limitElement` is not defined then only the parent of the given position will be split.\n\t *\n\t * The element needs to have a parent. It cannot be a root element nor a document fragment.\n\t * The `writer-split-element-no-parent` error will be thrown if you try to split an element with no parent.\n\t *\n\t * @param {module:engine/model/position~Position} position Position of split.\n\t * @param {module:engine/model/node~Node} [limitElement] Stop splitting when this element will be reached.\n\t * @returns {Object} result Split result.\n\t * @returns {module:engine/model/position~Position} result.position between split elements.\n\t * @returns {module:engine/model/range~Range} result.range Range that stars from the end of the first split element and ands\n\t * at the beginning of the first copy element.\n\t */\n\tsplit( position, limitElement ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tlet splitElement = position.parent;\n\n\t\tif ( !splitElement.parent ) {\n\t\t\t/**\n\t\t\t * Element with no parent can not be split.\n\t\t\t *\n\t\t\t * @error writer-split-element-no-parent\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-split-element-no-parent: Element with no parent can not be split.' );\n\t\t}\n\n\t\t// When limit element is not defined lets set splitElement parent as limit.\n\t\tif ( !limitElement ) {\n\t\t\tlimitElement = splitElement.parent;\n\t\t}\n\n\t\tif ( !position.parent.getAncestors( { includeSelf: true } ).includes( limitElement ) ) {\n\t\t\tthrow new CKEditorError( 'writer-split-invalid-limit-element: Limit element is not a position ancestor.' );\n\t\t}\n\n\t\t// We need to cache elements that will be created as a result of the first split because\n\t\t// we need to create a range from the end of the first split element to the beginning of the\n\t\t// first copy element. This should be handled by LiveRange but it doesn't work on detached nodes.\n\t\tlet firstSplitElement, firstCopyElement;\n\n\t\tdo {\n\t\t\tconst version = splitElement.root.document ? splitElement.root.document.version : null;\n\t\t\tconst howMany = splitElement.maxOffset - position.offset;\n\t\t\tconst split = new SplitOperation( position, howMany, null, version );\n\n\t\t\tthis.batch.addOperation( split );\n\t\t\tthis.model.applyOperation( split );\n\n\t\t\t// Cache result of the first split.\n\t\t\tif ( !firstSplitElement && !firstCopyElement ) {\n\t\t\t\tfirstSplitElement = splitElement;\n\t\t\t\tfirstCopyElement = position.parent.nextSibling;\n\t\t\t}\n\n\t\t\tposition = this.createPositionAfter( position.parent );\n\t\t\tsplitElement = position.parent;\n\t\t} while ( splitElement !== limitElement );\n\n\t\treturn {\n\t\t\tposition,\n\t\t\trange: new Range( Position._createAt( firstSplitElement, 'end' ), Position._createAt( firstCopyElement, 0 ) )\n\t\t};\n\t}\n\n\t/**\n\t * Wraps the given range with the given element or with a new element (if a string was passed).\n\t *\n\t * **Note:** range to wrap should be a \"flat range\" (see {@link module:engine/model/range~Range#isFlat `Range#isFlat`}).\n\t * If not, an error will be thrown.\n\t *\n\t * @param {module:engine/model/range~Range} range Range to wrap.\n\t * @param {module:engine/model/element~Element|String} elementOrString Element or name of element to wrap the range with.\n\t */\n\twrap( range, elementOrString ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( !range.isFlat ) {\n\t\t\t/**\n\t\t\t * Range to wrap is not flat.\n\t\t\t *\n\t\t\t * @error writer-wrap-range-not-flat\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-wrap-range-not-flat: Range to wrap is not flat.' );\n\t\t}\n\n\t\tconst element = elementOrString instanceof Element ? elementOrString : new Element( elementOrString );\n\n\t\tif ( element.childCount > 0 ) {\n\t\t\t/**\n\t\t\t * Element to wrap with is not empty.\n\t\t\t *\n\t\t\t * @error writer-wrap-element-not-empty\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-wrap-element-not-empty: Element to wrap with is not empty.' );\n\t\t}\n\n\t\tif ( element.parent !== null ) {\n\t\t\t/**\n\t\t\t * Element to wrap with is already attached to a tree model.\n\t\t\t *\n\t\t\t * @error writer-wrap-element-attached\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-wrap-element-attached: Element to wrap with is already attached to tree model.' );\n\t\t}\n\n\t\tconst version = range.root.document ? range.root.document.version : null;\n\n\t\t// Has to be `range.start` not `range.end` for better transformations.\n\t\tconst insert = new InsertOperation( range.start, element, version );\n\t\tthis.batch.addOperation( insert );\n\t\tthis.model.applyOperation( insert );\n\n\t\tconst move = new MoveOperation(\n\t\t\trange.start.getShiftedBy( 1 ),\n\t\t\trange.end.offset - range.start.offset,\n\t\t\tPosition._createAt( element, 0 ),\n\t\t\tversion === null ? null : version + 1\n\t\t);\n\n\t\tthis.batch.addOperation( move );\n\t\tthis.model.applyOperation( move );\n\t}\n\n\t/**\n\t * Unwraps children of the given element – all its children are moved before it and then the element is removed.\n\t * Throws error if you try to unwrap an element which does not have a parent.\n\t *\n\t * @param {module:engine/model/element~Element} element Element to unwrap.\n\t */\n\tunwrap( element ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( element.parent === null ) {\n\t\t\t/**\n\t\t\t * Trying to unwrap an element which has no parent.\n\t\t\t *\n\t\t\t * @error writer-unwrap-element-no-parent\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-unwrap-element-no-parent: Trying to unwrap an element which has no parent.' );\n\t\t}\n\n\t\tthis.move( Range._createIn( element ), this.createPositionAfter( element ) );\n\t\tthis.remove( element );\n\t}\n\n\t/**\n\t * Adds a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks\n\t * changes in the document and updates its range automatically, when model tree changes.\n\t *\n\t * As the first parameter you can set marker name.\n\t *\n\t * The required `options.usingOperation` parameter lets you decide if the marker should be managed by operations or not. See\n\t * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between\n\t * markers managed by operations and not-managed by operations.\n\t *\n\t * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be\n\t * `true` when the marker change changes the data returned by the\n\t * {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.\n\t * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.\n\t * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.\n\t *\n\t * Create marker directly base on marker's name:\n\t *\n\t *\t\taddMarker( markerName, { range, usingOperation: false } );\n\t *\n\t * Create marker using operation:\n\t *\n\t *\t\taddMarker( markerName, { range, usingOperation: true } );\n\t *\n\t * Create marker that affects the editor data:\n\t *\n\t *\t\taddMarker( markerName, { range, usingOperation: false, affectsData: true } );\n\t *\n\t * Note: For efficiency reasons, it's best to create and keep as little markers as possible.\n\t *\n\t * @see module:engine/model/markercollection~Marker\n\t * @param {String} name Name of a marker to create - must be unique.\n\t * @param {Object} options\n\t * @param {Boolean} options.usingOperation Flag indicating that the marker should be added by MarkerOperation.\n\t * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.\n\t * @param {module:engine/model/range~Range} options.range Marker range.\n\t * @param {Boolean} [options.affectsData=false] Flag indicating that the marker changes the editor data.\n\t * @returns {module:engine/model/markercollection~Marker} Marker that was set.\n\t */\n\taddMarker( name, options ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( !options || typeof options.usingOperation != 'boolean' ) {\n\t\t\t/**\n\t\t\t * The `options.usingOperation` parameter is required when adding a new marker.\n\t\t\t *\n\t\t\t * @error writer-addMarker-no-usingOperation\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'writer-addMarker-no-usingOperation: The options.usingOperation parameter is required when adding a new marker.'\n\t\t\t);\n\t\t}\n\n\t\tconst usingOperation = options.usingOperation;\n\t\tconst range = options.range;\n\t\tconst affectsData = options.affectsData === undefined ? false : options.affectsData;\n\n\t\tif ( this.model.markers.has( name ) ) {\n\t\t\t/**\n\t\t\t * Marker with provided name already exists.\n\t\t\t *\n\t\t\t * @error writer-addMarker-marker-exists\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-addMarker-marker-exists: Marker with provided name already exists.' );\n\t\t}\n\n\t\tif ( !range ) {\n\t\t\t/**\n\t\t\t * Range parameter is required when adding a new marker.\n\t\t\t *\n\t\t\t * @error writer-addMarker-no-range\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-addMarker-no-range: Range parameter is required when adding a new marker.' );\n\t\t}\n\n\t\tif ( !usingOperation ) {\n\t\t\treturn this.model.markers._set( name, range, usingOperation, affectsData );\n\t\t}\n\n\t\tapplyMarkerOperation( this, name, null, range, affectsData );\n\n\t\treturn this.model.markers.get( name );\n\t}\n\n\t/**\n\t * Adds or updates a {@link module:engine/model/markercollection~Marker marker}. Marker is a named range, which tracks\n\t * changes in the document and updates its range automatically, when model tree changes. Still, it is possible to change the\n\t * marker's range directly using this method.\n\t *\n\t * As the first parameter you can set marker name or instance. If none of them is provided, new marker, with a unique\n\t * name is created and returned.\n\t *\n\t * The `options.usingOperation` parameter lets you change if the marker should be managed by operations or not. See\n\t * {@link module:engine/model/markercollection~Marker marker class description} to learn about the difference between\n\t * markers managed by operations and not-managed by operations. It is possible to change this option for an existing marker.\n\t *\n\t * The `options.affectsData` parameter, which defaults to `false`, allows you to define if a marker affects the data. It should be\n\t * `true` when the marker change changes the data returned by\n\t * the {@link module:core/editor/utils/dataapimixin~DataApi#getData `editor.getData()`} method.\n\t * When set to `true` it fires the {@link module:engine/model/document~Document#event:change:data `change:data`} event.\n\t * When set to `false` it fires the {@link module:engine/model/document~Document#event:change `change`} event.\n\t *\n\t * Update marker directly base on marker's name:\n\t *\n\t *\t\tupdateMarker( markerName, { range } );\n\t *\n\t * Update marker using operation:\n\t *\n\t *\t\tupdateMarker( marker, { range, usingOperation: true } );\n\t *\t\tupdateMarker( markerName, { range, usingOperation: true } );\n\t *\n\t * Change marker's option (start using operations to manage it):\n\t *\n\t *\t\tupdateMarker( marker, { usingOperation: true } );\n\t *\n\t * Change marker's option (inform the engine, that the marker does not affect the data anymore):\n\t *\n\t *\t\tupdateMarker( markerName, { affectsData: false } );\n\t *\n\t * @see module:engine/model/markercollection~Marker\n\t * @param {String} markerOrName Name of a marker to update, or a marker instance.\n\t * @param {Object} options\n\t * @param {module:engine/model/range~Range} [options.range] Marker range to update.\n\t * @param {Boolean} [options.usingOperation] Flag indicated whether the marker should be added by MarkerOperation.\n\t * See {@link module:engine/model/markercollection~Marker#managedUsingOperations}.\n\t * @param {Boolean} [options.affectsData] Flag indicating that the marker changes the editor data.\n\t */\n\tupdateMarker( markerOrName, options = {} ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tconst markerName = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;\n\t\tconst currentMarker = this.model.markers.get( markerName );\n\n\t\tif ( !currentMarker ) {\n\t\t\t/**\n\t\t\t * Marker with provided name does not exists.\n\t\t\t *\n\t\t\t * @error writer-updateMarker-marker-not-exists\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-updateMarker-marker-not-exists: Marker with provided name does not exists.' );\n\t\t}\n\n\t\tconst hasUsingOperationDefined = typeof options.usingOperation == 'boolean';\n\t\tconst affectsDataDefined = typeof options.affectsData == 'boolean';\n\n\t\t// Use previously defined marker's affectsData if the property is not provided.\n\t\tconst affectsData = affectsDataDefined ? options.affectsData : currentMarker.affectsData;\n\n\t\tif ( !hasUsingOperationDefined && !options.range && !affectsDataDefined ) {\n\t\t\t/**\n\t\t\t * One of the options is required - provide range, usingOperations or affectsData.\n\t\t\t *\n\t\t\t * @error writer-updateMarker-wrong-options\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'writer-updateMarker-wrong-options: One of the options is required - provide range, usingOperations or affectsData.'\n\t\t\t);\n\t\t}\n\n\t\tconst currentRange = currentMarker.getRange();\n\t\tconst updatedRange = options.range ? options.range : currentRange;\n\n\t\tif ( hasUsingOperationDefined && options.usingOperation !== currentMarker.managedUsingOperations ) {\n\t\t\t// The marker type is changed so it's necessary to create proper operations.\n\t\t\tif ( options.usingOperation ) {\n\t\t\t\t// If marker changes to a managed one treat this as synchronizing existing marker.\n\t\t\t\t// Create `MarkerOperation` with `oldRange` set to `null`, so reverse operation will remove the marker.\n\t\t\t\tapplyMarkerOperation( this, markerName, null, updatedRange, affectsData );\n\t\t\t} else {\n\t\t\t\t// If marker changes to a marker that do not use operations then we need to create additional operation\n\t\t\t\t// that removes that marker first.\n\t\t\t\tapplyMarkerOperation( this, markerName, currentRange, null, affectsData );\n\n\t\t\t\t// Although not managed the marker itself should stay in model and its range should be preserver or changed to passed range.\n\t\t\t\tthis.model.markers._set( markerName, updatedRange, undefined, affectsData );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Marker's type doesn't change so update it accordingly.\n\t\tif ( currentMarker.managedUsingOperations ) {\n\t\t\tapplyMarkerOperation( this, markerName, currentRange, updatedRange, affectsData );\n\t\t} else {\n\t\t\tthis.model.markers._set( markerName, updatedRange, undefined, affectsData );\n\t\t}\n\t}\n\n\t/**\n\t * Removes given {@link module:engine/model/markercollection~Marker marker} or marker with given name.\n\t * The marker is removed accordingly to how it has been created, so if the marker was created using operation,\n\t * it will be destroyed using operation.\n\t *\n\t * @param {module:engine/model/markercollection~Marker|String} markerOrName Marker or marker name to remove.\n\t */\n\tremoveMarker( markerOrName ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tconst name = typeof markerOrName == 'string' ? markerOrName : markerOrName.name;\n\n\t\tif ( !this.model.markers.has( name ) ) {\n\t\t\t/**\n\t\t\t * Trying to remove marker which does not exist.\n\t\t\t *\n\t\t\t * @error writer-removeMarker-no-marker\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'writer-removeMarker-no-marker: Trying to remove marker which does not exist.' );\n\t\t}\n\n\t\tconst marker = this.model.markers.get( name );\n\n\t\tif ( !marker.managedUsingOperations ) {\n\t\t\tthis.model.markers._remove( name );\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst oldRange = marker.getRange();\n\n\t\tapplyMarkerOperation( this, name, oldRange, null, marker.affectsData );\n\t}\n\n\t/**\n\t * Sets the document's selection (ranges and direction) to the specified location based on the given\n\t * {@link module:engine/model/selection~Selectable selectable} or creates an empty selection if no arguments were passed.\n\t *\n\t *\t\t// Sets selection to the given range.\n\t *\t\tconst range = writer.createRange( start, end );\n\t *\t\twriter.setSelection( range );\n\t *\n\t *\t\t// Sets selection to given ranges.\n\t *\t\tconst ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n\t *\t\twriter.setSelection( range );\n\t *\n\t *\t\t// Sets selection to other selection.\n\t *\t\tconst otherSelection = writer.createSelection();\n\t *\t\twriter.setSelection( otherSelection );\n\t *\n\t *\t\t// Sets selection to the given document selection.\n\t *\t\tconst documentSelection = model.document.selection;\n\t *\t\twriter.setSelection( documentSelection );\n\t *\n\t *\t\t// Sets collapsed selection at the given position.\n\t *\t\tconst position = writer.createPosition( root, path );\n\t *\t\twriter.setSelection( position );\n\t *\n\t *\t\t// Sets collapsed selection at the position of the given node and an offset.\n\t *\t\twriter.setSelection( paragraph, offset );\n\t *\n\t * Creates a range inside an {@link module:engine/model/element~Element element} which starts before the first child of\n \t * that element and ends after the last child of that element.\n\t *\n\t *\t\twriter.setSelection( paragraph, 'in' );\n\t *\n\t * Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends just after the item.\n\t *\n\t *\t\twriter.setSelection( paragraph, 'on' );\n\t *\n\t *\t\t// Removes all selection's ranges.\n\t *\t\twriter.setSelection( null );\n\t *\n\t * `Writer#setSelection()` allow passing additional options (`backward`) as the last argument.\n\t *\n\t *\t\t// Sets selection as backward.\n\t *\t\twriter.setSelection( range, { backward: true } );\n\t *\n\t * Throws `writer-incorrect-use` error when the writer is used outside the `change()` block.\n\t *\n\t * @param {module:engine/model/selection~Selectable} selectable\n\t * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.\n\t * @param {Object} [options]\n\t * @param {Boolean} [options.backward] Sets this selection instance to be backward.\n\t */\n\tsetSelection( selectable, placeOrOffset, options ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tthis.model.document.selection._setTo( selectable, placeOrOffset, options );\n\t}\n\n\t/**\n\t * Moves {@link module:engine/model/documentselection~DocumentSelection#focus} to the specified location.\n\t *\n\t * The location can be specified in the same form as\n\t * {@link #createPositionAt `writer.createPositionAt()`} parameters.\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset=0] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tsetSelectionFocus( itemOrPosition, offset ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tthis.model.document.selection._setFocus( itemOrPosition, offset );\n\t}\n\n\t/**\n\t * Sets attribute(s) on the selection. If attribute with the same key already is set, it's value is overwritten.\n\t *\n\t * Using key and value pair:\n\t *\n\t * \twriter.setSelectionAttribute( 'italic', true );\n\t *\n\t * Using key-value object:\n\t *\n\t * \twriter.setSelectionAttribute( { italic: true, bold: false } );\n\t *\n\t * Using iterable object:\n\t *\n\t * \twriter.setSelectionAttribute( new Map( [ [ 'italic', true ] ] ) );\n\t *\n\t * @param {String|Object|Iterable.<*>} keyOrObjectOrIterable Key of the attribute to set\n\t * or object / iterable of key => value attribute pairs.\n\t * @param {*} [value] Attribute value.\n\t */\n\tsetSelectionAttribute( keyOrObjectOrIterable, value ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( typeof keyOrObjectOrIterable === 'string' ) {\n\t\t\tthis._setSelectionAttribute( keyOrObjectOrIterable, value );\n\t\t} else {\n\t\t\tfor ( const [ key, value ] of toMap( keyOrObjectOrIterable ) ) {\n\t\t\t\tthis._setSelectionAttribute( key, value );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Removes attribute(s) with given key(s) from the selection.\n\t *\n\t * Remove one attribute:\n\t *\n\t *\t\twriter.removeSelectionAttribute( 'italic' );\n\t *\n\t * Remove multiple attributes:\n\t *\n\t *\t\twriter.removeSelectionAttribute( [ 'italic', 'bold' ] );\n\t *\n\t * @param {String|Iterable.} keyOrIterableOfKeys Key of the attribute to remove or an iterable of attribute keys to remove.\n\t */\n\tremoveSelectionAttribute( keyOrIterableOfKeys ) {\n\t\tthis._assertWriterUsedCorrectly();\n\n\t\tif ( typeof keyOrIterableOfKeys === 'string' ) {\n\t\t\tthis._removeSelectionAttribute( keyOrIterableOfKeys );\n\t\t} else {\n\t\t\tfor ( const key of keyOrIterableOfKeys ) {\n\t\t\t\tthis._removeSelectionAttribute( key );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Temporarily changes the {@link module:engine/model/documentselection~DocumentSelection#isGravityOverridden gravity}\n\t * of the selection from left to right.\n\t *\n\t * The gravity defines from which direction the selection inherits its attributes. If it's the default left gravity,\n\t * then the selection (after being moved by the user) inherits attributes from its left-hand side.\n\t * This method allows to temporarily override this behavior by forcing the gravity to the right.\n\t *\n\t * For the following model fragment:\n\t *\n\t *\t\t<$text bold=\"true\" linkHref=\"url\">bar[]<$text bold=\"true\">biz\n\t *\n\t * * Default gravity: selection will have the `bold` and `linkHref` attributes.\n\t * * Overridden gravity: selection will have `bold` attribute.\n\t *\n\t * **Note**: It returns an unique identifier which is required to restore the gravity. It guarantees the symmetry\n\t * of the process.\n\t *\n\t * @returns {String} The unique id which allows restoring the gravity.\n\t */\n\toverrideSelectionGravity() {\n\t\treturn this.model.document.selection._overrideGravity();\n\t}\n\n\t/**\n\t * Restores {@link ~Writer#overrideSelectionGravity} gravity to default.\n\t *\n\t * Restoring the gravity is only possible using the unique identifier returned by\n\t * {@link ~Writer#overrideSelectionGravity}. Note that the gravity remains overridden as long as won't be restored\n\t * the same number of times it was overridden.\n\t *\n\t * @param {String} uid The unique id returned by {@link ~Writer#overrideSelectionGravity}.\n\t */\n\trestoreSelectionGravity( uid ) {\n\t\tthis.model.document.selection._restoreGravity( uid );\n\t}\n\n\t/**\n\t * @private\n\t * @param {String} key Key of the attribute to remove.\n\t * @param {*} value Attribute value.\n\t */\n\t_setSelectionAttribute( key, value ) {\n\t\tconst selection = this.model.document.selection;\n\n\t\t// Store attribute in parent element if the selection is collapsed in an empty node.\n\t\tif ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {\n\t\t\tconst storeKey = DocumentSelection._getStoreAttributeKey( key );\n\n\t\t\tthis.setAttribute( storeKey, value, selection.anchor.parent );\n\t\t}\n\n\t\tselection._setAttribute( key, value );\n\t}\n\n\t/**\n\t * @private\n\t * @param {String} key Key of the attribute to remove.\n\t */\n\t_removeSelectionAttribute( key ) {\n\t\tconst selection = this.model.document.selection;\n\n\t\t// Remove stored attribute from parent element if the selection is collapsed in an empty node.\n\t\tif ( selection.isCollapsed && selection.anchor.parent.isEmpty ) {\n\t\t\tconst storeKey = DocumentSelection._getStoreAttributeKey( key );\n\n\t\t\tthis.removeAttribute( storeKey, selection.anchor.parent );\n\t\t}\n\n\t\tselection._removeAttribute( key );\n\t}\n\n\t/**\n\t * Throws `writer-detached-writer-tries-to-modify-model` error when the writer is used outside of the `change()` block.\n\t *\n\t * @private\n\t */\n\t_assertWriterUsedCorrectly() {\n\t\t/**\n\t\t * Trying to use a writer outside a {@link module:engine/model/model~Model#change `change()` or\n\t\t * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()`} blocks.\n\t\t *\n\t\t * The writer can only be used inside these blocks which ensures that the model\n\t\t * can only be changed during such \"sessions\".\n\t\t *\n\t\t * @error writer-incorrect-use\n\t\t */\n\t\tif ( this.model._currentWriter !== this ) {\n\t\t\tthrow new CKEditorError( 'writer-incorrect-use: Trying to use a writer outside the change() block.' );\n\t\t}\n\t}\n\n\t/**\n\t * For given action `type` and `positionOrRange` where the action happens, this function finds all affected markers\n\t * and applies a marker operation with the new marker range equal to the current range. Thanks to this, the marker range\n\t * can be later correctly processed during undo.\n\t *\n\t * @private\n\t * @param {'move'|'merge'} type Writer action type.\n\t * @param {module:engine/model/position~Position|module:engine/model/range~Range} positionOrRange Position or range\n\t * where the writer action happens.\n\t */\n\t_addOperationForAffectedMarkers( type, positionOrRange ) {\n\t\tfor ( const marker of this.model.markers ) {\n\t\t\tif ( !marker.managedUsingOperations ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst markerRange = marker.getRange();\n\t\t\tlet isAffected = false;\n\n\t\t\tif ( type == 'move' ) {\n\t\t\t\tisAffected =\n\t\t\t\t\tpositionOrRange.containsPosition( markerRange.start ) ||\n\t\t\t\t\tpositionOrRange.start.isEqual( markerRange.start ) ||\n\t\t\t\t\tpositionOrRange.containsPosition( markerRange.end ) ||\n\t\t\t\t\tpositionOrRange.end.isEqual( markerRange.end );\n\t\t\t} else {\n\t\t\t\t// if type == 'merge'.\n\t\t\t\tconst elementBefore = positionOrRange.nodeBefore;\n\t\t\t\tconst elementAfter = positionOrRange.nodeAfter;\n\n\t\t\t\tconst affectedOnLeft = markerRange.start.parent == elementBefore && markerRange.start.isAtEnd;\n\t\t\t\tconst affectedOnRight = markerRange.end.parent == elementAfter && markerRange.end.offset == 0;\n\n\t\t\t\tisAffected = affectedOnLeft || affectedOnRight;\n\t\t\t}\n\n\t\t\tif ( isAffected ) {\n\t\t\t\tthis.updateMarker( marker.name, { range: markerRange } );\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Sets given attribute to each node in given range. When attribute value is null then attribute will be removed.\n//\n// Because attribute operation needs to have the same attribute value on the whole range, this function splits\n// the range into smaller parts.\n//\n// Given `range` must be flat.\n//\n// @private\n// @param {module:engine/model/writer~Writer} writer\n// @param {String} key Attribute key.\n// @param {*} value Attribute new value.\n// @param {module:engine/model/range~Range} range Model range on which the attribute will be set.\nfunction setAttributeOnRange( writer, key, value, range ) {\n\tconst model = writer.model;\n\tconst doc = model.document;\n\n\t// Position of the last split, the beginning of the new range.\n\tlet lastSplitPosition = range.start;\n\n\t// Currently position in the scanning range. Because we need value after the position, it is not a current\n\t// position of the iterator but the previous one (we need to iterate one more time to get the value after).\n\tlet position;\n\n\t// Value before the currently position.\n\tlet valueBefore;\n\n\t// Value after the currently position.\n\tlet valueAfter;\n\n\tfor ( const val of range.getWalker( { shallow: true } ) ) {\n\t\tvalueAfter = val.item.getAttribute( key );\n\n\t\t// At the first run of the iterator the position in undefined. We also do not have a valueBefore, but\n\t\t// because valueAfter may be null, valueBefore may be equal valueAfter ( undefined == null ).\n\t\tif ( position && valueBefore != valueAfter ) {\n\t\t\t// if valueBefore == value there is nothing to change, so we add operation only if these values are different.\n\t\t\tif ( valueBefore != value ) {\n\t\t\t\taddOperation();\n\t\t\t}\n\n\t\t\tlastSplitPosition = position;\n\t\t}\n\n\t\tposition = val.nextPosition;\n\t\tvalueBefore = valueAfter;\n\t}\n\n\t// Because position in the loop is not the iterator position (see let position comment), the last position in\n\t// the while loop will be last but one position in the range. We need to check the last position manually.\n\tif ( position instanceof Position && position != lastSplitPosition && valueBefore != value ) {\n\t\taddOperation();\n\t}\n\n\tfunction addOperation() {\n\t\tconst range = new Range( lastSplitPosition, position );\n\t\tconst version = range.root.document ? doc.version : null;\n\t\tconst operation = new AttributeOperation( range, key, valueBefore, value, version );\n\n\t\twriter.batch.addOperation( operation );\n\t\tmodel.applyOperation( operation );\n\t}\n}\n\n// Sets given attribute to the given node. When attribute value is null then attribute will be removed.\n//\n// @private\n// @param {module:engine/model/writer~Writer} writer\n// @param {String} key Attribute key.\n// @param {*} value Attribute new value.\n// @param {module:engine/model/item~Item} item Model item on which the attribute will be set.\nfunction setAttributeOnItem( writer, key, value, item ) {\n\tconst model = writer.model;\n\tconst doc = model.document;\n\tconst previousValue = item.getAttribute( key );\n\tlet range, operation;\n\n\tif ( previousValue != value ) {\n\t\tconst isRootChanged = item.root === item;\n\n\t\tif ( isRootChanged ) {\n\t\t\t// If we change attributes of root element, we have to use `RootAttributeOperation`.\n\t\t\tconst version = item.document ? doc.version : null;\n\n\t\t\toperation = new RootAttributeOperation( item, key, previousValue, value, version );\n\t\t} else {\n\t\t\trange = new Range( Position._createBefore( item ), writer.createPositionAfter( item ) );\n\n\t\t\tconst version = range.root.document ? doc.version : null;\n\n\t\t\toperation = new AttributeOperation( range, key, previousValue, value, version );\n\t\t}\n\n\t\twriter.batch.addOperation( operation );\n\t\tmodel.applyOperation( operation );\n\t}\n}\n\n// Creates and applies marker operation to {@link module:engine/model/operation/operation~Operation operation}.\n//\n// @private\n// @param {module:engine/model/writer~Writer} writer\n// @param {String} name Marker name.\n// @param {module:engine/model/range~Range} oldRange Marker range before the change.\n// @param {module:engine/model/range~Range} newRange Marker range after the change.\n// @param {Boolean} affectsData\nfunction applyMarkerOperation( writer, name, oldRange, newRange, affectsData ) {\n\tconst model = writer.model;\n\tconst doc = model.document;\n\n\tconst operation = new MarkerOperation( name, oldRange, newRange, model.markers, affectsData, doc.version );\n\n\twriter.batch.addOperation( operation );\n\tmodel.applyOperation( operation );\n}\n\n// Creates `MoveOperation` or `DetachOperation` that removes `howMany` nodes starting from `position`.\n// The operation will be applied on given model instance and added to given operation instance.\n//\n// @private\n// @param {module:engine/model/position~Position} position Position from which nodes are removed.\n// @param {Number} howMany Number of nodes to remove.\n// @param {Batch} batch Batch to which the operation will be added.\n// @param {module:engine/model/model~Model} model Model instance on which operation will be applied.\nfunction applyRemoveOperation( position, howMany, batch, model ) {\n\tlet operation;\n\n\tif ( position.root.document ) {\n\t\tconst doc = model.document;\n\t\tconst graveyardPosition = new Position( doc.graveyard, [ 0 ] );\n\n\t\toperation = new MoveOperation( position, howMany, graveyardPosition, doc.version );\n\t} else {\n\t\toperation = new DetachOperation( position, howMany );\n\t}\n\n\tbatch.addOperation( operation );\n\tmodel.applyOperation( operation );\n}\n\n// Returns `true` if both root elements are the same element or both are documents root elements.\n//\n// Elements in the same tree can be moved (for instance you can move element form one documents root to another, or\n// within the same document fragment), but when element supposed to be moved from document fragment to the document, or\n// to another document it should be removed and inserted to avoid problems with OT. This is because features like undo or\n// collaboration may track changes on the document but ignore changes on detached fragments and should not get\n// unexpected `move` operation.\nfunction isSameTree( rootA, rootB ) {\n\t// If it is the same root this is the same tree.\n\tif ( rootA === rootB ) {\n\t\treturn true;\n\t}\n\n\t// If both roots are documents root it is operation within the document what we still treat as the same tree.\n\tif ( rootA instanceof RootElement && rootB instanceof RootElement ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/differ\n */\n\nimport Position from './position';\nimport Range from './range';\n\n/**\n * Calculates the difference between two model states.\n *\n * Receives operations that are to be applied on the model document. Marks parts of the model document tree which\n * are changed and saves the state of these elements before the change. Then, it compares saved elements with the\n * changed elements, after all changes are applied on the model document. Calculates the diff between saved\n * elements and new ones and returns a change set.\n */\nexport default class Differ {\n\t/**\n\t * Creates a `Differ` instance.\n\t *\n\t * @param {module:engine/model/markercollection~MarkerCollection} markerCollection Model's marker collection.\n\t */\n\tconstructor( markerCollection ) {\n\t\t/**\n\t\t * Reference to the model's marker collection.\n\t\t *\n\t\t * @private\n\t\t * @type {module:engine/model/markercollection~MarkerCollection}\n\t\t */\n\t\tthis._markerCollection = markerCollection;\n\n\t\t/**\n\t\t * A map that stores changes that happened in a given element.\n\t\t *\n\t\t * The keys of the map are references to the model elements.\n\t\t * The values of the map are arrays with changes that were done on this element.\n\t\t *\n\t\t * @private\n\t\t * @type {Map}\n\t\t */\n\t\tthis._changesInElement = new Map();\n\n\t\t/**\n\t\t * A map that stores \"element's children snapshots\". A snapshot is representing children of a given element before\n\t\t * the first change was applied on that element. Snapshot items are objects with two properties: `name`,\n\t\t * containing the element name (or `'$text'` for a text node) and `attributes` which is a map of the node's attributes.\n\t\t *\n\t\t * @private\n\t\t * @type {Map}\n\t\t */\n\t\tthis._elementSnapshots = new Map();\n\n\t\t/**\n\t\t * A map that stores all changed markers.\n\t\t *\n\t\t * The keys of the map are marker names.\n\t\t * The values of the map are objects with the `oldRange` and `newRange` properties. They store the marker range\n\t\t * state before and after the change.\n\t\t *\n\t\t * @private\n\t\t * @type {Map}\n\t\t */\n\t\tthis._changedMarkers = new Map();\n\n\t\t/**\n\t\t * Stores the number of changes that were processed. Used to order the changes chronologically. It is important\n\t\t * when changes are sorted.\n\t\t *\n\t\t * @private\n\t\t * @type {Number}\n\t\t */\n\t\tthis._changeCount = 0;\n\n\t\t/**\n\t\t * For efficiency purposes, `Differ` stores the change set returned by the differ after {@link #getChanges} call.\n\t\t * Cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will\n\t\t * return the cached value instead of calculating it again.\n\t\t *\n\t\t * This property stores those changes that did not take place in graveyard root.\n\t\t *\n\t\t * @private\n\t\t * @type {Array.|null}\n\t\t */\n\t\tthis._cachedChanges = null;\n\n\t\t/**\n\t\t * For efficiency purposes, `Differ` stores the change set returned by the differ after the {@link #getChanges} call.\n\t\t * The cache is reset each time a new operation is buffered. If the cache has not been reset, {@link #getChanges} will\n\t\t * return the cached value instead of calculating it again.\n\t\t *\n\t\t * This property stores all changes evaluated by `Differ`, including those that took place in the graveyard.\n\t\t *\n\t\t * @private\n\t\t * @type {Array.|null}\n\t\t */\n\t\tthis._cachedChangesWithGraveyard = null;\n\t}\n\n\t/**\n\t * Informs whether there are any changes buffered in `Differ`.\n\t *\n\t * @readonly\n\t * @type {Boolean}\n\t */\n\tget isEmpty() {\n\t\treturn this._changesInElement.size == 0 && this._changedMarkers.size == 0;\n\t}\n\n\t/**\n\t * Buffers the given operation. An operation has to be buffered before it is executed.\n\t *\n\t * Operation type is checked and it is checked which nodes it will affect. These nodes are then stored in `Differ`\n\t * in the state before the operation is executed.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} operation An operation to buffer.\n\t */\n\tbufferOperation( operation ) {\n\t\t// Below we take an operation, check its type, then use its parameters in marking (private) methods.\n\t\t// The general rule is to not mark elements inside inserted element. All inserted elements are re-rendered.\n\t\t// Marking changes in them would cause a \"double\" changing then.\n\t\t//\n\t\tswitch ( operation.type ) {\n\t\t\tcase 'insert': {\n\t\t\t\tif ( this._isInInsertedElement( operation.position.parent ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._markInsert( operation.position.parent, operation.position.offset, operation.nodes.maxOffset );\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'addAttribute':\n\t\t\tcase 'removeAttribute':\n\t\t\tcase 'changeAttribute': {\n\t\t\t\tfor ( const item of operation.range.getItems() ) {\n\t\t\t\t\tif ( this._isInInsertedElement( item.parent ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._markAttribute( item );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'remove':\n\t\t\tcase 'move':\n\t\t\tcase 'reinsert': {\n\t\t\t\t// When range is moved to the same position then not mark it as a change.\n\t\t\t\t// See: https://github.com/ckeditor/ckeditor5-engine/issues/1664.\n\t\t\t\tif (\n\t\t\t\t\toperation.sourcePosition.isEqual( operation.targetPosition ) ||\n\t\t\t\t\toperation.sourcePosition.getShiftedBy( operation.howMany ).isEqual( operation.targetPosition )\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst sourceParentInserted = this._isInInsertedElement( operation.sourcePosition.parent );\n\t\t\t\tconst targetParentInserted = this._isInInsertedElement( operation.targetPosition.parent );\n\n\t\t\t\tif ( !sourceParentInserted ) {\n\t\t\t\t\tthis._markRemove( operation.sourcePosition.parent, operation.sourcePosition.offset, operation.howMany );\n\t\t\t\t}\n\n\t\t\t\tif ( !targetParentInserted ) {\n\t\t\t\t\tthis._markInsert( operation.targetPosition.parent, operation.getMovedRangeStart().offset, operation.howMany );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'rename': {\n\t\t\t\tif ( this._isInInsertedElement( operation.position.parent ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tthis._markRemove( operation.position.parent, operation.position.offset, 1 );\n\t\t\t\tthis._markInsert( operation.position.parent, operation.position.offset, 1 );\n\n\t\t\t\tconst range = Range._createFromPositionAndShift( operation.position, 1 );\n\n\t\t\t\tfor ( const marker of this._markerCollection.getMarkersIntersectingRange( range ) ) {\n\t\t\t\t\tconst markerRange = marker.getRange();\n\n\t\t\t\t\tthis.bufferMarkerChange( marker.name, markerRange, markerRange, marker.affectsData );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'split': {\n\t\t\t\tconst splitElement = operation.splitPosition.parent;\n\n\t\t\t\t// Mark that children of the split element were removed.\n\t\t\t\tif ( !this._isInInsertedElement( splitElement ) ) {\n\t\t\t\t\tthis._markRemove( splitElement, operation.splitPosition.offset, operation.howMany );\n\t\t\t\t}\n\n\t\t\t\t// Mark that the new element (split copy) was inserted.\n\t\t\t\tif ( !this._isInInsertedElement( operation.insertionPosition.parent ) ) {\n\t\t\t\t\tthis._markInsert( operation.insertionPosition.parent, operation.insertionPosition.offset, 1 );\n\t\t\t\t}\n\n\t\t\t\t// If the split took the element from the graveyard, mark that the element from the graveyard was removed.\n\t\t\t\tif ( operation.graveyardPosition ) {\n\t\t\t\t\tthis._markRemove( operation.graveyardPosition.parent, operation.graveyardPosition.offset, 1 );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase 'merge': {\n\t\t\t\t// Mark that the merged element was removed.\n\t\t\t\tconst mergedElement = operation.sourcePosition.parent;\n\n\t\t\t\tif ( !this._isInInsertedElement( mergedElement.parent ) ) {\n\t\t\t\t\tthis._markRemove( mergedElement.parent, mergedElement.startOffset, 1 );\n\t\t\t\t}\n\n\t\t\t\t// Mark that the merged element was inserted into graveyard.\n\t\t\t\tconst graveyardParent = operation.graveyardPosition.parent;\n\n\t\t\t\tthis._markInsert( graveyardParent, operation.graveyardPosition.offset, 1 );\n\n\t\t\t\t// Mark that children of merged element were inserted at new parent.\n\t\t\t\tconst mergedIntoElement = operation.targetPosition.parent;\n\n\t\t\t\tif ( !this._isInInsertedElement( mergedIntoElement ) ) {\n\t\t\t\t\tthis._markInsert( mergedIntoElement, operation.targetPosition.offset, mergedElement.maxOffset );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Clear cache after each buffered operation as it is no longer valid.\n\t\tthis._cachedChanges = null;\n\t}\n\n\t/**\n\t * Buffers a marker change.\n\t *\n\t * @param {String} markerName The name of the marker that changed.\n\t * @param {module:engine/model/range~Range|null} oldRange Marker range before the change or `null` if the marker has just\n\t * been created.\n\t * @param {module:engine/model/range~Range|null} newRange Marker range after the change or `null` if the marker was removed.\n\t * @param {Boolean} affectsData Flag indicating whether marker affects the editor data.\n\t */\n\tbufferMarkerChange( markerName, oldRange, newRange, affectsData ) {\n\t\tconst buffered = this._changedMarkers.get( markerName );\n\n\t\tif ( !buffered ) {\n\t\t\tthis._changedMarkers.set( markerName, {\n\t\t\t\toldRange,\n\t\t\t\tnewRange,\n\t\t\t\taffectsData\n\t\t\t} );\n\t\t} else {\n\t\t\tbuffered.newRange = newRange;\n\t\t\tbuffered.affectsData = affectsData;\n\n\t\t\tif ( buffered.oldRange == null && buffered.newRange == null ) {\n\t\t\t\t// The marker is going to be removed (`newRange == null`) but it did not exist before the first buffered change\n\t\t\t\t// (`buffered.oldRange == null`). In this case, do not keep the marker in buffer at all.\n\t\t\t\tthis._changedMarkers.delete( markerName );\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns all markers that should be removed as a result of buffered changes.\n\t *\n\t * @returns {Array.} Markers to remove. Each array item is an object containing the `name` and `range` properties.\n\t */\n\tgetMarkersToRemove() {\n\t\tconst result = [];\n\n\t\tfor ( const [ name, change ] of this._changedMarkers ) {\n\t\t\tif ( change.oldRange != null ) {\n\t\t\t\tresult.push( { name, range: change.oldRange } );\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns all markers which should be added as a result of buffered changes.\n\t *\n\t * @returns {Array.} Markers to add. Each array item is an object containing the `name` and `range` properties.\n\t */\n\tgetMarkersToAdd() {\n\t\tconst result = [];\n\n\t\tfor ( const [ name, change ] of this._changedMarkers ) {\n\t\t\tif ( change.newRange != null ) {\n\t\t\t\tresult.push( { name, range: change.newRange } );\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/**\n\t * Returns all markers which changed.\n\t *\n\t * @returns {Array.}\n\t */\n\tgetChangedMarkers() {\n\t\treturn Array.from( this._changedMarkers ).map( item => (\n\t\t\t{\n\t\t\t\tname: item[ 0 ],\n\t\t\t\tdata: {\n\t\t\t\t\toldRange: item[ 1 ].oldRange,\n\t\t\t\t\tnewRange: item[ 1 ].newRange\n\t\t\t\t}\n\t\t\t}\n\t\t) );\n\t}\n\n\t/**\n\t * Checks whether some of the buffered changes affect the editor data.\n\t *\n\t * Types of changes which affect the editor data:\n\t *\n\t * * model structure changes,\n\t * * attribute changes,\n\t * * changes of markers which were defined as `affectingData`.\n\t *\n\t * @returns {Boolean}\n\t */\n\thasDataChanges() {\n\t\tfor ( const [ , change ] of this._changedMarkers ) {\n\t\t\tif ( change.affectsData ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// If markers do not affect the data, check whether there are some changes in elements.\n\t\treturn this._changesInElement.size > 0;\n\t}\n\n\t/**\n\t * Calculates the diff between the old model tree state (the state before the first buffered operations since the last {@link #reset}\n\t * call) and the new model tree state (actual one). It should be called after all buffered operations are executed.\n\t *\n\t * The diff set is returned as an array of diff items, each describing a change done on the model. The items are sorted by\n\t * the position on which the change happened. If a position {@link module:engine/model/position~Position#isBefore is before}\n\t * another one, it will be on an earlier index in the diff set.\n\t *\n\t * Because calculating the diff is a costly operation, the result is cached. If no new operation was buffered since the\n\t * previous {@link #getChanges} call, the next call will return the cached value.\n\t *\n\t * @param {Object} options Additional options.\n\t * @param {Boolean} [options.includeChangesInGraveyard=false] If set to `true`, also changes that happened\n\t * in the graveyard root will be returned. By default, changes in the graveyard root are not returned.\n\t * @returns {Array.} Diff between the old and the new model tree state.\n\t */\n\tgetChanges( options = { includeChangesInGraveyard: false } ) {\n\t\t// If there are cached changes, just return them instead of calculating changes again.\n\t\tif ( this._cachedChanges ) {\n\t\t\tif ( options.includeChangesInGraveyard ) {\n\t\t\t\treturn this._cachedChangesWithGraveyard.slice();\n\t\t\t} else {\n\t\t\t\treturn this._cachedChanges.slice();\n\t\t\t}\n\t\t}\n\n\t\t// Will contain returned results.\n\t\tconst diffSet = [];\n\n\t\t// Check all changed elements.\n\t\tfor ( const element of this._changesInElement.keys() ) {\n\t\t\t// Get changes for this element and sort them.\n\t\t\tconst changes = this._changesInElement.get( element ).sort( ( a, b ) => {\n\t\t\t\tif ( a.offset === b.offset ) {\n\t\t\t\t\tif ( a.type != b.type ) {\n\t\t\t\t\t\t// If there are multiple changes at the same position, \"remove\" change should be first.\n\t\t\t\t\t\t// If the order is different, for example, we would first add some nodes and then removed them\n\t\t\t\t\t\t// (instead of the nodes that we should remove).\n\t\t\t\t\t\treturn a.type == 'remove' ? -1 : 1;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn a.offset < b.offset ? -1 : 1;\n\t\t\t} );\n\n\t\t\t// Get children of this element before any change was applied on it.\n\t\t\tconst snapshotChildren = this._elementSnapshots.get( element );\n\t\t\t// Get snapshot of current element's children.\n\t\t\tconst elementChildren = _getChildrenSnapshot( element.getChildren() );\n\n\t\t\t// Generate actions basing on changes done on element.\n\t\t\tconst actions = _generateActionsFromChanges( snapshotChildren.length, changes );\n\n\t\t\tlet i = 0; // Iterator in `elementChildren` array -- iterates through current children of element.\n\t\t\tlet j = 0; // Iterator in `snapshotChildren` array -- iterates through old children of element.\n\n\t\t\t// Process every action.\n\t\t\tfor ( const action of actions ) {\n\t\t\t\tif ( action === 'i' ) {\n\t\t\t\t\t// Generate diff item for this element and insert it into the diff set.\n\t\t\t\t\tdiffSet.push( this._getInsertDiff( element, i, elementChildren[ i ].name ) );\n\n\t\t\t\t\ti++;\n\t\t\t\t} else if ( action === 'r' ) {\n\t\t\t\t\t// Generate diff item for this element and insert it into the diff set.\n\t\t\t\t\tdiffSet.push( this._getRemoveDiff( element, i, snapshotChildren[ j ].name ) );\n\n\t\t\t\t\tj++;\n\t\t\t\t} else if ( action === 'a' ) {\n\t\t\t\t\t// Take attributes from saved and current children.\n\t\t\t\t\tconst elementAttributes = elementChildren[ i ].attributes;\n\t\t\t\t\tconst snapshotAttributes = snapshotChildren[ j ].attributes;\n\t\t\t\t\tlet range;\n\n\t\t\t\t\tif ( elementChildren[ i ].name == '$text' ) {\n\t\t\t\t\t\trange = new Range( Position._createAt( element, i ), Position._createAt( element, i + 1 ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst index = element.offsetToIndex( i );\n\t\t\t\t\t\trange = new Range( Position._createAt( element, i ), Position._createAt( element.getChild( index ), 0 ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Generate diff items for this change (there might be multiple attributes changed and\n\t\t\t\t\t// there is a single diff for each of them) and insert them into the diff set.\n\t\t\t\t\tdiffSet.push( ...this._getAttributesDiff( range, snapshotAttributes, elementAttributes ) );\n\n\t\t\t\t\ti++;\n\t\t\t\t\tj++;\n\t\t\t\t} else {\n\t\t\t\t\t// `action` is 'equal'. Child not changed.\n\t\t\t\t\ti++;\n\t\t\t\t\tj++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Then, sort the changes by the position (change at position before other changes is first).\n\t\tdiffSet.sort( ( a, b ) => {\n\t\t\t// If the change is in different root, we don't care much, but we'd like to have all changes in given\n\t\t\t// root \"together\" in the array. So let's just sort them by the root name. It does not matter which root\n\t\t\t// will be processed first.\n\t\t\tif ( a.position.root != b.position.root ) {\n\t\t\t\treturn a.position.root.rootName < b.position.root.rootName ? -1 : 1;\n\t\t\t}\n\n\t\t\t// If change happens at the same position...\n\t\t\tif ( a.position.isEqual( b.position ) ) {\n\t\t\t\t// Keep chronological order of operations.\n\t\t\t\treturn a.changeCount - b.changeCount;\n\t\t\t}\n\n\t\t\t// If positions differ, position \"on the left\" should be earlier in the result.\n\t\t\treturn a.position.isBefore( b.position ) ? -1 : 1;\n\t\t} );\n\n\t\t// Glue together multiple changes (mostly on text nodes).\n\t\tfor ( let i = 1; i < diffSet.length; i++ ) {\n\t\t\tconst prevDiff = diffSet[ i - 1 ];\n\t\t\tconst thisDiff = diffSet[ i ];\n\n\t\t\t// Glue remove changes if they happen on text on same position.\n\t\t\tconst isConsecutiveTextRemove =\n\t\t\t\tprevDiff.type == 'remove' && thisDiff.type == 'remove' &&\n\t\t\t\tprevDiff.name == '$text' && thisDiff.name == '$text' &&\n\t\t\t\tprevDiff.position.isEqual( thisDiff.position );\n\n\t\t\t// Glue insert changes if they happen on text on consecutive fragments.\n\t\t\tconst isConsecutiveTextAdd =\n\t\t\t\tprevDiff.type == 'insert' && thisDiff.type == 'insert' &&\n\t\t\t\tprevDiff.name == '$text' && thisDiff.name == '$text' &&\n\t\t\t\tprevDiff.position.parent == thisDiff.position.parent &&\n\t\t\t\tprevDiff.position.offset + prevDiff.length == thisDiff.position.offset;\n\n\t\t\t// Glue attribute changes if they happen on consecutive fragments and have same key, old value and new value.\n\t\t\tconst isConsecutiveAttributeChange =\n\t\t\t\tprevDiff.type == 'attribute' && thisDiff.type == 'attribute' &&\n\t\t\t\tprevDiff.position.parent == thisDiff.position.parent &&\n\t\t\t\tprevDiff.range.isFlat && thisDiff.range.isFlat &&\n\t\t\t\tprevDiff.position.offset + prevDiff.length == thisDiff.position.offset &&\n\t\t\t\tprevDiff.attributeKey == thisDiff.attributeKey &&\n\t\t\t\tprevDiff.attributeOldValue == thisDiff.attributeOldValue &&\n\t\t\t\tprevDiff.attributeNewValue == thisDiff.attributeNewValue;\n\n\t\t\tif ( isConsecutiveTextRemove || isConsecutiveTextAdd || isConsecutiveAttributeChange ) {\n\t\t\t\tdiffSet[ i - 1 ].length++;\n\n\t\t\t\tif ( isConsecutiveAttributeChange ) {\n\t\t\t\t\tdiffSet[ i - 1 ].range.end = diffSet[ i - 1 ].range.end.getShiftedBy( 1 );\n\t\t\t\t}\n\n\t\t\t\tdiffSet.splice( i, 1 );\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\n\t\t// Remove `changeCount` property from diff items. It is used only for sorting and is internal thing.\n\t\tfor ( const item of diffSet ) {\n\t\t\tdelete item.changeCount;\n\n\t\t\tif ( item.type == 'attribute' ) {\n\t\t\t\tdelete item.position;\n\t\t\t\tdelete item.length;\n\t\t\t}\n\t\t}\n\n\t\tthis._changeCount = 0;\n\n\t\t// Cache changes.\n\t\tthis._cachedChangesWithGraveyard = diffSet.slice();\n\t\tthis._cachedChanges = diffSet.slice().filter( _changesInGraveyardFilter );\n\n\t\tif ( options.includeChangesInGraveyard ) {\n\t\t\treturn this._cachedChangesWithGraveyard;\n\t\t} else {\n\t\t\treturn this._cachedChanges;\n\t\t}\n\t}\n\n\t/**\n\t * Resets `Differ`. Removes all buffered changes.\n\t */\n\treset() {\n\t\tthis._changesInElement.clear();\n\t\tthis._elementSnapshots.clear();\n\t\tthis._changedMarkers.clear();\n\t\tthis._cachedChanges = null;\n\t}\n\n\t/**\n\t * Saves and handles an insert change.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} parent\n\t * @param {Number} offset\n\t * @param {Number} howMany\n\t */\n\t_markInsert( parent, offset, howMany ) {\n\t\tconst changeItem = { type: 'insert', offset, howMany, count: this._changeCount++ };\n\n\t\tthis._markChange( parent, changeItem );\n\t}\n\n\t/**\n\t * Saves and handles a remove change.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} parent\n\t * @param {Number} offset\n\t * @param {Number} howMany\n\t */\n\t_markRemove( parent, offset, howMany ) {\n\t\tconst changeItem = { type: 'remove', offset, howMany, count: this._changeCount++ };\n\n\t\tthis._markChange( parent, changeItem );\n\n\t\tthis._removeAllNestedChanges( parent, offset, howMany );\n\t}\n\n\t/**\n\t * Saves and handles an attribute change.\n\t *\n\t * @private\n\t * @param {module:engine/model/item~Item} item\n\t */\n\t_markAttribute( item ) {\n\t\tconst changeItem = { type: 'attribute', offset: item.startOffset, howMany: item.offsetSize, count: this._changeCount++ };\n\n\t\tthis._markChange( item.parent, changeItem );\n\t}\n\n\t/**\n\t * Saves and handles a model change.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} parent\n\t * @param {Object} changeItem\n\t */\n\t_markChange( parent, changeItem ) {\n\t\t// First, make a snapshot of this parent's children (it will be made only if it was not made before).\n\t\tthis._makeSnapshot( parent );\n\n\t\t// Then, get all changes that already were done on the element (empty array if this is the first change).\n\t\tconst changes = this._getChangesForElement( parent );\n\n\t\t// Then, look through all the changes, and transform them or the new change.\n\t\tthis._handleChange( changeItem, changes );\n\n\t\t// Add the new change.\n\t\tchanges.push( changeItem );\n\n\t\t// Remove incorrect changes. During transformation some change might be, for example, included in another.\n\t\t// In that case, the change will have `howMany` property set to `0` or less. We need to remove those changes.\n\t\tfor ( let i = 0; i < changes.length; i++ ) {\n\t\t\tif ( changes[ i ].howMany < 1 ) {\n\t\t\t\tchanges.splice( i, 1 );\n\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Gets an array of changes that have already been saved for a given element.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} element\n\t * @returns {Array.}\n\t */\n\t_getChangesForElement( element ) {\n\t\tlet changes;\n\n\t\tif ( this._changesInElement.has( element ) ) {\n\t\t\tchanges = this._changesInElement.get( element );\n\t\t} else {\n\t\t\tchanges = [];\n\n\t\t\tthis._changesInElement.set( element, changes );\n\t\t}\n\n\t\treturn changes;\n\t}\n\n\t/**\n\t * Saves a children snapshot for a given element.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} element\n\t */\n\t_makeSnapshot( element ) {\n\t\tif ( !this._elementSnapshots.has( element ) ) {\n\t\t\tthis._elementSnapshots.set( element, _getChildrenSnapshot( element.getChildren() ) );\n\t\t}\n\t}\n\n\t/**\n\t * For a given newly saved change, compares it with a change already done on the element and modifies the incoming\n\t * change and/or the old change.\n\t *\n\t * @private\n\t * @param {Object} inc Incoming (new) change.\n\t * @param {Array.} changes An array containing all the changes done on that element.\n\t */\n\t_handleChange( inc, changes ) {\n\t\t// We need a helper variable that will store how many nodes are to be still handled for this change item.\n\t\t// `nodesToHandle` (how many nodes still need to be handled) and `howMany` (how many nodes were affected)\n\t\t// needs to be differentiated.\n\t\t//\n\t\t// This comes up when there are multiple changes that are affected by `inc` change item.\n\t\t//\n\t\t// For example: assume two insert changes: `{ offset: 2, howMany: 1 }` and `{ offset: 5, howMany: 1 }`.\n\t\t// Assume that `inc` change is remove `{ offset: 2, howMany: 2, nodesToHandle: 2 }`.\n\t\t//\n\t\t// Then, we:\n\t\t// - \"forget\" about first insert change (it is \"eaten\" by remove),\n\t\t// - because of that, at the end we will want to remove only one node (`nodesToHandle = 1`),\n\t\t// - but still we have to change offset of the second insert change from `5` to `3`!\n\t\t//\n\t\t// So, `howMany` does not change throughout items transformation and keeps information about how many nodes were affected,\n\t\t// while `nodesToHandle` means how many nodes need to be handled after the change item is transformed by other changes.\n\t\tinc.nodesToHandle = inc.howMany;\n\n\t\tfor ( const old of changes ) {\n\t\t\tconst incEnd = inc.offset + inc.howMany;\n\t\t\tconst oldEnd = old.offset + old.howMany;\n\n\t\t\tif ( inc.type == 'insert' ) {\n\t\t\t\tif ( old.type == 'insert' ) {\n\t\t\t\t\tif ( inc.offset <= old.offset ) {\n\t\t\t\t\t\told.offset += inc.howMany;\n\t\t\t\t\t} else if ( inc.offset < oldEnd ) {\n\t\t\t\t\t\told.howMany += inc.nodesToHandle;\n\t\t\t\t\t\tinc.nodesToHandle = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( old.type == 'remove' ) {\n\t\t\t\t\tif ( inc.offset < old.offset ) {\n\t\t\t\t\t\told.offset += inc.howMany;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( old.type == 'attribute' ) {\n\t\t\t\t\tif ( inc.offset <= old.offset ) {\n\t\t\t\t\t\told.offset += inc.howMany;\n\t\t\t\t\t} else if ( inc.offset < oldEnd ) {\n\t\t\t\t\t\t// This case is more complicated, because attribute change has to be split into two.\n\t\t\t\t\t\t// Example (assume that uppercase and lowercase letters mean different attributes):\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// initial state:\t\tabcxyz\n\t\t\t\t\t\t// attribute change:\taBCXYz\n\t\t\t\t\t\t// incoming insert:\t\taBCfooXYz\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// Change ranges cannot intersect because each item has to be described exactly (it was either\n\t\t\t\t\t\t// not changed, inserted, removed, or its attribute was changed). That's why old attribute\n\t\t\t\t\t\t// change has to be split and both parts has to be handled separately from now on.\n\t\t\t\t\t\tconst howMany = old.howMany;\n\n\t\t\t\t\t\told.howMany = inc.offset - old.offset;\n\n\t\t\t\t\t\t// Add the second part of attribute change to the beginning of processed array so it won't\n\t\t\t\t\t\t// be processed again in this loop.\n\t\t\t\t\t\tchanges.unshift( {\n\t\t\t\t\t\t\ttype: 'attribute',\n\t\t\t\t\t\t\toffset: incEnd,\n\t\t\t\t\t\t\thowMany: howMany - old.howMany,\n\t\t\t\t\t\t\tcount: this._changeCount++\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( inc.type == 'remove' ) {\n\t\t\t\tif ( old.type == 'insert' ) {\n\t\t\t\t\tif ( incEnd <= old.offset ) {\n\t\t\t\t\t\told.offset -= inc.howMany;\n\t\t\t\t\t} else if ( incEnd <= oldEnd ) {\n\t\t\t\t\t\tif ( inc.offset < old.offset ) {\n\t\t\t\t\t\t\tconst intersectionLength = incEnd - old.offset;\n\n\t\t\t\t\t\t\told.offset = inc.offset;\n\n\t\t\t\t\t\t\told.howMany -= intersectionLength;\n\t\t\t\t\t\t\tinc.nodesToHandle -= intersectionLength;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\told.howMany -= inc.nodesToHandle;\n\t\t\t\t\t\t\tinc.nodesToHandle = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( inc.offset <= old.offset ) {\n\t\t\t\t\t\t\tinc.nodesToHandle -= old.howMany;\n\t\t\t\t\t\t\told.howMany = 0;\n\t\t\t\t\t\t} else if ( inc.offset < oldEnd ) {\n\t\t\t\t\t\t\tconst intersectionLength = oldEnd - inc.offset;\n\n\t\t\t\t\t\t\told.howMany -= intersectionLength;\n\t\t\t\t\t\t\tinc.nodesToHandle -= intersectionLength;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( old.type == 'remove' ) {\n\t\t\t\t\tif ( incEnd <= old.offset ) {\n\t\t\t\t\t\told.offset -= inc.howMany;\n\t\t\t\t\t} else if ( inc.offset < old.offset ) {\n\t\t\t\t\t\tinc.nodesToHandle += old.howMany;\n\t\t\t\t\t\told.howMany = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( old.type == 'attribute' ) {\n\t\t\t\t\tif ( incEnd <= old.offset ) {\n\t\t\t\t\t\told.offset -= inc.howMany;\n\t\t\t\t\t} else if ( inc.offset < old.offset ) {\n\t\t\t\t\t\tconst intersectionLength = incEnd - old.offset;\n\n\t\t\t\t\t\told.offset = inc.offset;\n\t\t\t\t\t\told.howMany -= intersectionLength;\n\t\t\t\t\t} else if ( inc.offset < oldEnd ) {\n\t\t\t\t\t\tif ( incEnd <= oldEnd ) {\n\t\t\t\t\t\t\t// On first sight in this case we don't need to split attribute operation into two.\n\t\t\t\t\t\t\t// However the changes set is later converted to actions (see `_generateActionsFromChanges`).\n\t\t\t\t\t\t\t// For that reason, no two changes may intersect.\n\t\t\t\t\t\t\t// So we cannot have an attribute change that \"contains\" remove change.\n\t\t\t\t\t\t\t// Attribute change needs to be split.\n\t\t\t\t\t\t\tconst howMany = old.howMany;\n\n\t\t\t\t\t\t\told.howMany = inc.offset - old.offset;\n\n\t\t\t\t\t\t\tconst howManyAfter = howMany - old.howMany - inc.nodesToHandle;\n\n\t\t\t\t\t\t\t// Add the second part of attribute change to the beginning of processed array so it won't\n\t\t\t\t\t\t\t// be processed again in this loop.\n\t\t\t\t\t\t\tchanges.unshift( {\n\t\t\t\t\t\t\t\ttype: 'attribute',\n\t\t\t\t\t\t\t\toffset: inc.offset,\n\t\t\t\t\t\t\t\thowMany: howManyAfter,\n\t\t\t\t\t\t\t\tcount: this._changeCount++\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\told.howMany -= oldEnd - inc.offset;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( inc.type == 'attribute' ) {\n\t\t\t\t// In case of attribute change, `howMany` should be kept same as `nodesToHandle`. It's not an error.\n\t\t\t\tif ( old.type == 'insert' ) {\n\t\t\t\t\tif ( inc.offset < old.offset && incEnd > old.offset ) {\n\t\t\t\t\t\tif ( incEnd > oldEnd ) {\n\t\t\t\t\t\t\t// This case is similar to a case described when incoming change was insert and old change was attribute.\n\t\t\t\t\t\t\t// See comment above.\n\t\t\t\t\t\t\t//\n\t\t\t\t\t\t\t// This time incoming change is attribute. We need to split incoming change in this case too.\n\t\t\t\t\t\t\t// However this time, the second part of the attribute change needs to be processed further\n\t\t\t\t\t\t\t// because there might be other changes that it collides with.\n\t\t\t\t\t\t\tconst attributePart = {\n\t\t\t\t\t\t\t\ttype: 'attribute',\n\t\t\t\t\t\t\t\toffset: oldEnd,\n\t\t\t\t\t\t\t\thowMany: incEnd - oldEnd,\n\t\t\t\t\t\t\t\tcount: this._changeCount++\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tthis._handleChange( attributePart, changes );\n\n\t\t\t\t\t\t\tchanges.push( attributePart );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tinc.nodesToHandle = old.offset - inc.offset;\n\t\t\t\t\t\tinc.howMany = inc.nodesToHandle;\n\t\t\t\t\t} else if ( inc.offset >= old.offset && inc.offset < oldEnd ) {\n\t\t\t\t\t\tif ( incEnd > oldEnd ) {\n\t\t\t\t\t\t\tinc.nodesToHandle = incEnd - oldEnd;\n\t\t\t\t\t\t\tinc.offset = oldEnd;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tinc.nodesToHandle = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( old.type == 'attribute' ) {\n\t\t\t\t\t// There are only two conflicting scenarios possible here:\n\t\t\t\t\tif ( inc.offset >= old.offset && incEnd <= oldEnd ) {\n\t\t\t\t\t\t// `old` change includes `inc` change, or they are the same.\n\t\t\t\t\t\tinc.nodesToHandle = 0;\n\t\t\t\t\t\tinc.howMany = 0;\n\t\t\t\t\t\tinc.offset = 0;\n\t\t\t\t\t} else if ( inc.offset <= old.offset && incEnd >= oldEnd ) {\n\t\t\t\t\t\t// `inc` change includes `old` change.\n\t\t\t\t\t\told.howMany = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tinc.howMany = inc.nodesToHandle;\n\t\tdelete inc.nodesToHandle;\n\t}\n\n\t/**\n\t * Returns an object with a single insert change description.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} parent The element in which the change happened.\n\t * @param {Number} offset The offset at which change happened.\n\t * @param {String} name The name of the removed element or `'$text'` for a character.\n\t * @returns {Object} The diff item.\n\t */\n\t_getInsertDiff( parent, offset, name ) {\n\t\treturn {\n\t\t\ttype: 'insert',\n\t\t\tposition: Position._createAt( parent, offset ),\n\t\t\tname,\n\t\t\tlength: 1,\n\t\t\tchangeCount: this._changeCount++\n\t\t};\n\t}\n\n\t/**\n\t * Returns an object with a single remove change description.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} parent The element in which change happened.\n\t * @param {Number} offset The offset at which change happened.\n\t * @param {String} name The name of the removed element or `'$text'` for a character.\n\t * @returns {Object} The diff item.\n\t */\n\t_getRemoveDiff( parent, offset, name ) {\n\t\treturn {\n\t\t\ttype: 'remove',\n\t\t\tposition: Position._createAt( parent, offset ),\n\t\t\tname,\n\t\t\tlength: 1,\n\t\t\tchangeCount: this._changeCount++\n\t\t};\n\t}\n\n\t/**\n\t * Returns an array of objects where each one is a single attribute change description.\n\t *\n\t * @private\n\t * @param {module:engine/model/range~Range} range The range where the change happened.\n\t * @param {Map} oldAttributes A map, map iterator or compatible object that contains attributes before the change.\n\t * @param {Map} newAttributes A map, map iterator or compatible object that contains attributes after the change.\n\t * @returns {Array.} An array containing one or more diff items.\n\t */\n\t_getAttributesDiff( range, oldAttributes, newAttributes ) {\n\t\t// Results holder.\n\t\tconst diffs = [];\n\n\t\t// Clone new attributes as we will be performing changes on this object.\n\t\tnewAttributes = new Map( newAttributes );\n\n\t\t// Look through old attributes.\n\t\tfor ( const [ key, oldValue ] of oldAttributes ) {\n\t\t\t// Check what is the new value of the attribute (or if it was removed).\n\t\t\tconst newValue = newAttributes.has( key ) ? newAttributes.get( key ) : null;\n\n\t\t\t// If values are different (or attribute was removed)...\n\t\t\tif ( newValue !== oldValue ) {\n\t\t\t\t// Add diff item.\n\t\t\t\tdiffs.push( {\n\t\t\t\t\ttype: 'attribute',\n\t\t\t\t\tposition: range.start,\n\t\t\t\t\trange: range.clone(),\n\t\t\t\t\tlength: 1,\n\t\t\t\t\tattributeKey: key,\n\t\t\t\t\tattributeOldValue: oldValue,\n\t\t\t\t\tattributeNewValue: newValue,\n\t\t\t\t\tchangeCount: this._changeCount++\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\t// Prevent returning two diff items for the same change.\n\t\t\tnewAttributes.delete( key );\n\t\t}\n\n\t\t// Look through new attributes that weren't handled above.\n\t\tfor ( const [ key, newValue ] of newAttributes ) {\n\t\t\t// Each of them is a new attribute. Add diff item.\n\t\t\tdiffs.push( {\n\t\t\t\ttype: 'attribute',\n\t\t\t\tposition: range.start,\n\t\t\t\trange: range.clone(),\n\t\t\t\tlength: 1,\n\t\t\t\tattributeKey: key,\n\t\t\t\tattributeOldValue: null,\n\t\t\t\tattributeNewValue: newValue,\n\t\t\t\tchangeCount: this._changeCount++\n\t\t\t} );\n\t\t}\n\n\t\treturn diffs;\n\t}\n\n\t/**\n\t * Checks whether given element or any of its parents is an element that is buffered as an inserted element.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} element Element to check.\n\t * @returns {Boolean}\n\t */\n\t_isInInsertedElement( element ) {\n\t\tconst parent = element.parent;\n\n\t\tif ( !parent ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst changes = this._changesInElement.get( parent );\n\t\tconst offset = element.startOffset;\n\n\t\tif ( changes ) {\n\t\t\tfor ( const change of changes ) {\n\t\t\t\tif ( change.type == 'insert' && offset >= change.offset && offset < change.offset + change.howMany ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn this._isInInsertedElement( parent );\n\t}\n\n\t/**\n\t * Removes deeply all buffered changes that are registered in elements from range specified by `parent`, `offset`\n\t * and `howMany`.\n\t *\n\t * @private\n\t * @param {module:engine/model/element~Element} parent\n\t * @param {Number} offset\n\t * @param {Number} howMany\n\t */\n\t_removeAllNestedChanges( parent, offset, howMany ) {\n\t\tconst range = new Range( Position._createAt( parent, offset ), Position._createAt( parent, offset + howMany ) );\n\n\t\tfor ( const item of range.getItems( { shallow: true } ) ) {\n\t\t\tif ( item.is( 'element' ) ) {\n\t\t\t\tthis._elementSnapshots.delete( item );\n\t\t\t\tthis._changesInElement.delete( item );\n\n\t\t\t\tthis._removeAllNestedChanges( item, 0, item.maxOffset );\n\t\t\t}\n\t\t}\n\t}\n}\n\n// Returns an array that is a copy of passed child list with the exception that text nodes are split to one or more\n// objects, each representing one character and attributes set on that character.\nfunction _getChildrenSnapshot( children ) {\n\tconst snapshot = [];\n\n\tfor ( const child of children ) {\n\t\tif ( child.is( 'text' ) ) {\n\t\t\tfor ( let i = 0; i < child.data.length; i++ ) {\n\t\t\t\tsnapshot.push( {\n\t\t\t\t\tname: '$text',\n\t\t\t\t\tattributes: new Map( child.getAttributes() )\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\t\t\tsnapshot.push( {\n\t\t\t\tname: child.name,\n\t\t\t\tattributes: new Map( child.getAttributes() )\n\t\t\t} );\n\t\t}\n\t}\n\n\treturn snapshot;\n}\n\n// Generates array of actions for given changes set.\n// It simulates what `diff` function does.\n// Generated actions are:\n// - 'e' for 'equal' - when item at that position did not change,\n// - 'i' for 'insert' - when item at that position was inserted,\n// - 'r' for 'remove' - when item at that position was removed,\n// - 'a' for 'attribute' - when item at that position has it attributes changed.\n//\n// Example (assume that uppercase letters have bold attribute, compare with function code):\n//\n// children before:\tfooBAR\n// children after:\tfoxybAR\n//\n// changes: type: remove, offset: 1, howMany: 1\n//\t\t\ttype: insert, offset: 2, howMany: 2\n//\t\t\ttype: attribute, offset: 4, howMany: 1\n//\n// expected actions: equal (f), remove (o), equal (o), insert (x), insert (y), attribute (b), equal (A), equal (R)\n//\n// steps taken by th script:\n//\n// 1. change = \"type: remove, offset: 1, howMany: 1\"; offset = 0; oldChildrenHandled = 0\n// 1.1 between this change and the beginning is one not-changed node, fill with one equal action, one old child has been handled\n// 1.2 this change removes one node, add one remove action\n// 1.3 change last visited `offset` to 1\n// 1.4 since an old child has been removed, one more old child has been handled\n// 1.5 actions at this point are: equal, remove\n//\n// 2. change = \"type: insert, offset: 2, howMany: 2\"; offset = 1; oldChildrenHandled = 2\n// 2.1 between this change and previous change is one not-changed node, add equal action, another one old children has been handled\n// 2.2 this change inserts two nodes, add two insert actions\n// 2.3 change last visited offset to the end of the inserted range, that is 4\n// 2.4 actions at this point are: equal, remove, equal, insert, insert\n//\n// 3. change = \"type: attribute, offset: 4, howMany: 1\"; offset = 4, oldChildrenHandled = 3\n// 3.1 between this change and previous change are no not-changed nodes\n// 3.2 this change changes one node, add one attribute action\n// 3.3 change last visited `offset` to the end of change range, that is 5\n// 3.4 since an old child has been changed, one more old child has been handled\n// 3.5 actions at this point are: equal, remove, equal, insert, insert, attribute\n//\n// 4. after loop oldChildrenHandled = 4, oldChildrenLength = 6 (fooBAR is 6 characters)\n// 4.1 fill up with two equal actions\n//\n// The result actions are: equal, remove, equal, insert, insert, attribute, equal, equal.\nfunction _generateActionsFromChanges( oldChildrenLength, changes ) {\n\tconst actions = [];\n\n\tlet offset = 0;\n\tlet oldChildrenHandled = 0;\n\n\t// Go through all buffered changes.\n\tfor ( const change of changes ) {\n\t\t// First, fill \"holes\" between changes with \"equal\" actions.\n\t\tif ( change.offset > offset ) {\n\t\t\tactions.push( ...'e'.repeat( change.offset - offset ).split( '' ) );\n\n\t\t\toldChildrenHandled += change.offset - offset;\n\t\t}\n\n\t\t// Then, fill up actions accordingly to change type.\n\t\tif ( change.type == 'insert' ) {\n\t\t\tactions.push( ...'i'.repeat( change.howMany ).split( '' ) );\n\n\t\t\t// The last handled offset is after inserted range.\n\t\t\toffset = change.offset + change.howMany;\n\t\t} else if ( change.type == 'remove' ) {\n\t\t\tactions.push( ...'r'.repeat( change.howMany ).split( '' ) );\n\n\t\t\t// The last handled offset is at the position where the nodes were removed.\n\t\t\toffset = change.offset;\n\t\t\t// We removed `howMany` old nodes, update `oldChildrenHandled`.\n\t\t\toldChildrenHandled += change.howMany;\n\t\t} else {\n\t\t\tactions.push( ...'a'.repeat( change.howMany ).split( '' ) );\n\n\t\t\t// The last handled offset isa at the position after the changed range.\n\t\t\toffset = change.offset + change.howMany;\n\t\t\t// We changed `howMany` old nodes, update `oldChildrenHandled`.\n\t\t\toldChildrenHandled += change.howMany;\n\t\t}\n\t}\n\n\t// Fill \"equal\" actions at the end of actions set. Use `oldChildrenHandled` to see how many children\n\t// has not been changed / removed at the end of their parent.\n\tif ( oldChildrenHandled < oldChildrenLength ) {\n\t\tactions.push( ...'e'.repeat( oldChildrenLength - oldChildrenHandled ).split( '' ) );\n\t}\n\n\treturn actions;\n}\n\n// Filter callback for Array.filter that filters out change entries that are in graveyard.\nfunction _changesInGraveyardFilter( entry ) {\n\tconst posInGy = entry.position && entry.position.root.rootName == '$graveyard';\n\tconst rangeInGy = entry.range && entry.range.root.rootName == '$graveyard';\n\n\treturn !posInGy && !rangeInGy;\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/history\n */\n\n/**\n * `History` keeps the track of all the operations applied to the {@link module:engine/model/document~Document document}.\n */\nexport default class History {\n\t/**\n\t * Creates an empty History instance.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Operations added to the history.\n\t\t *\n\t\t * @protected\n\t\t * @member {Array.} module:engine/model/history~History#_operations\n\t\t */\n\t\tthis._operations = [];\n\n\t\t/**\n\t\t * Holds an information which {@link module:engine/model/operation/operation~Operation operation} undoes which\n\t\t * {@link module:engine/model/operation/operation~Operation operation}.\n\t\t *\n\t\t * Keys of the map are \"undoing operations\", that is operations that undone some other operations. For each key, the\n\t\t * value is an operation that has been undone by the \"undoing operation\".\n\t\t *\n\t\t * @private\n\t\t * @member {Map} module:engine/model/history~History#_undoPairs\n\t\t */\n\t\tthis._undoPairs = new Map();\n\n\t\t/**\n\t\t * Holds all undone operations.\n\t\t *\n\t\t * @private\n\t\t * @member {Set.} module:engine/model/history~History#_undoneOperations\n\t\t */\n\t\tthis._undoneOperations = new Set();\n\t}\n\n\t/**\n\t * Adds an operation to the history.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} operation Operation to add.\n\t */\n\taddOperation( operation ) {\n\t\tif ( this._operations.includes( operation ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._operations.push( operation );\n\t}\n\n\t/**\n\t * Returns operations added to the history.\n\t *\n\t * @param {Number} [from=0] Base version from which operations should be returned (inclusive). Defaults to `0`, which means\n\t * that operations from the first one will be returned.\n\t * @param {Number} [to=Number.POSITIVE_INFINITY] Base version up to which operations should be returned (exclusive).\n\t * Defaults to `Number.POSITIVE_INFINITY` which means that operations up to the last one will be returned.\n\t * @returns {Iterable.} Operations added to the history.\n\t */\n\tgetOperations( from = 0, to = Number.POSITIVE_INFINITY ) {\n\t\tif ( from < 0 ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn this._operations.slice( from, to );\n\t}\n\n\t/**\n\t * Returns operation from the history that bases on given `baseVersion`.\n\t *\n\t * @param {Number} baseVersion Base version of the operation to get.\n\t * @returns {module:engine/model/operation/operation~Operation|null} Operation with given base version or `null` if\n\t * there is no such operation in history.\n\t */\n\tgetOperation( baseVersion ) {\n\t\treturn this._operations[ baseVersion ];\n\t}\n\n\t/**\n\t * Marks in history that one operation is an operation that is undoing the other operation. By marking operation this way,\n\t * history is keeping more context information about operations, which helps in operational transformation.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} undoneOperation Operation which is undone by `undoingOperation`.\n\t * @param {module:engine/model/operation/operation~Operation} undoingOperation Operation which undoes `undoneOperation`.\n\t */\n\tsetOperationAsUndone( undoneOperation, undoingOperation ) {\n\t\tthis._undoPairs.set( undoingOperation, undoneOperation );\n\t\tthis._undoneOperations.add( undoneOperation );\n\t}\n\n\t/**\n\t * Checks whether given `operation` is undoing any other operation.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} operation Operation to check.\n\t * @returns {Boolean} `true` if given `operation` is undoing any other operation, `false` otherwise.\n\t */\n\tisUndoingOperation( operation ) {\n\t\treturn this._undoPairs.has( operation );\n\t}\n\n\t/**\n\t * Checks whether given `operation` has been undone by any other operation.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} operation Operation to check.\n\t * @returns {Boolean} `true` if given `operation` has been undone any other operation, `false` otherwise.\n\t */\n\tisUndoneOperation( operation ) {\n\t\treturn this._undoneOperations.has( operation );\n\t}\n\n\t/**\n\t * For given `undoingOperation`, returns the operation which has been undone by it.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} undoingOperation\n\t * @returns {module:engine/model/operation/operation~Operation|undefined} Operation that has been undone by given\n\t * `undoingOperation` or `undefined` if given `undoingOperation` is not undoing any other operation.\n\t */\n\tgetUndoneOperation( undoingOperation ) {\n\t\treturn this._undoPairs.get( undoingOperation );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * Set of utils to handle unicode characters.\n *\n * @module utils/unicode\n */\n\n/**\n * Checks whether given `character` is a combining mark.\n *\n * @param {String} character Character to check.\n * @returns {Boolean}\n */\nexport function isCombiningMark( character ) {\n\treturn !!character && character.length == 1 && /[\\u0300-\\u036f\\u1ab0-\\u1aff\\u1dc0-\\u1dff\\u20d0-\\u20ff\\ufe20-\\ufe2f]/.test( character );\n}\n\n/**\n * Checks whether given `character` is a high half of surrogate pair.\n *\n * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair\n * consist of high surrogate pair character followed by low surrogate pair character.\n *\n * @param {String} character Character to check.\n * @returns {Boolean}\n */\nexport function isHighSurrogateHalf( character ) {\n\treturn !!character && character.length == 1 && /[\\ud800-\\udbff]/.test( character );\n}\n\n/**\n * Checks whether given `character` is a low half of surrogate pair.\n *\n * Using UTF-16 terminology, a surrogate pair denotes UTF-16 character using two UTF-8 characters. The surrogate pair\n * consist of high surrogate pair character followed by low surrogate pair character.\n *\n * @param {String} character Character to check.\n * @returns {Boolean}\n */\nexport function isLowSurrogateHalf( character ) {\n\treturn !!character && character.length == 1 && /[\\udc00-\\udfff]/.test( character );\n}\n\n/**\n * Checks whether given offset in a string is inside a surrogate pair (between two surrogate halves).\n *\n * @param {String} string String to check.\n * @param {Number} offset Offset to check.\n * @returns {Boolean}\n */\nexport function isInsideSurrogatePair( string, offset ) {\n\treturn isHighSurrogateHalf( string.charAt( offset - 1 ) ) && isLowSurrogateHalf( string.charAt( offset ) );\n}\n\n/**\n * Checks whether given offset in a string is between base character and combining mark or between two combining marks.\n *\n * @param {String} string String to check.\n * @param {Number} offset Offset to check.\n * @returns {Boolean}\n */\nexport function isInsideCombinedSymbol( string, offset ) {\n\treturn isCombiningMark( string.charAt( offset ) );\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/document\n */\n\nimport Differ from './differ';\nimport RootElement from './rootelement';\nimport History from './history';\nimport DocumentSelection from './documentselection';\nimport Collection from '@ckeditor/ckeditor5-utils/src/collection';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport { isInsideSurrogatePair, isInsideCombinedSymbol } from '@ckeditor/ckeditor5-utils/src/unicode';\nimport { clone } from 'lodash-es';\n\nconst graveyardName = '$graveyard';\n\n/**\n * Data model's document. It contains the model's structure, its selection and the history of changes.\n *\n * Read more about working with the model in\n * {@glink framework/guides/architecture/editing-engine#model introduction to the the editing engine's architecture}.\n *\n * Usually, the document contains just one {@link module:engine/model/document~Document#roots root element}, so\n * you can retrieve it by just calling {@link module:engine/model/document~Document#getRoot} without specifying its name:\n *\n *\t\tmodel.document.getRoot(); // -> returns the main root\n *\n * However, the document may contain multiple roots – e.g. when the editor has multiple editable areas\n * (e.g. a title and a body of a message).\n *\n * @mixes module:utils/emittermixin~EmitterMixin\n */\nexport default class Document {\n\t/**\n\t * Creates an empty document instance with no {@link #roots} (other than\n\t * the {@link #graveyard graveyard root}).\n\t */\n\tconstructor( model ) {\n\t\t/**\n\t\t * The {@link module:engine/model/model~Model model} that the document is a part of.\n\t\t *\n\t\t * @readonly\n\t\t * @type {module:engine/model/model~Model}\n\t\t */\n\t\tthis.model = model;\n\n\t\t/**\n\t\t * The document version. It starts from `0` and every operation increases the version number. It is used to ensure that\n\t\t * operations are applied on a proper document version.\n\t\t *\n\t\t * If the {@link module:engine/model/operation/operation~Operation#baseVersion base version} does not match the document version,\n\t\t * a {@link module:utils/ckeditorerror~CKEditorError model-document-applyOperation-wrong-version} error is thrown.\n\t\t *\n\t\t * @readonly\n\t\t * @type {Number}\n\t\t */\n\t\tthis.version = 0;\n\n\t\t/**\n\t\t * The document's history.\n\t\t *\n\t\t * @readonly\n\t\t * @type {module:engine/model/history~History}\n\t\t */\n\t\tthis.history = new History( this );\n\n\t\t/**\n\t\t * The selection in this document.\n\t\t *\n\t\t * @readonly\n\t\t * @type {module:engine/model/documentselection~DocumentSelection}\n\t\t */\n\t\tthis.selection = new DocumentSelection( this );\n\n\t\t/**\n\t\t * A list of roots that are owned and managed by this document. Use {@link #createRoot} and\n\t\t * {@link #getRoot} to manipulate it.\n\t\t *\n\t\t * @readonly\n\t\t * @type {module:utils/collection~Collection}\n\t\t */\n\t\tthis.roots = new Collection( { idProperty: 'rootName' } );\n\n\t\t/**\n\t\t * The model differ object. Its role is to buffer changes done on the model document and then calculate a diff of those changes.\n\t\t *\n\t\t * @readonly\n\t\t * @type {module:engine/model/differ~Differ}\n\t\t */\n\t\tthis.differ = new Differ( model.markers );\n\n\t\t/**\n\t\t * Post-fixer callbacks registered to the model document.\n\t\t *\n\t\t * @private\n\t\t * @type {Set.}\n\t\t */\n\t\tthis._postFixers = new Set();\n\n\t\t/**\n\t\t * A boolean indicates whether the selection has changed until\n\t\t *\n\t\t * @private\n\t\t * @type {Boolean}\n\t\t */\n\t\tthis._hasSelectionChangedFromTheLastChangeBlock = false;\n\n\t\t// Graveyard tree root. Document always have a graveyard root, which stores removed nodes.\n\t\tthis.createRoot( '$root', graveyardName );\n\n\t\t// First, if the operation is a document operation check if it's base version is correct.\n\t\tthis.listenTo( model, 'applyOperation', ( evt, args ) => {\n\t\t\tconst operation = args[ 0 ];\n\n\t\t\tif ( operation.isDocumentOperation && operation.baseVersion !== this.version ) {\n\t\t\t\t/**\n\t\t\t\t * Only operations with matching versions can be applied.\n\t\t\t\t *\n\t\t\t\t * @error document-applyOperation-wrong-version\n\t\t\t\t * @param {module:engine/model/operation/operation~Operation} operation\n\t\t\t\t */\n\t\t\t\tthrow new CKEditorError(\n\t\t\t\t\t'model-document-applyOperation-wrong-version: Only operations with matching versions can be applied.',\n\t\t\t\t\t{ operation }\n\t\t\t\t);\n\t\t\t}\n\t\t}, { priority: 'highest' } );\n\n\t\t// Then, still before an operation is applied on model, buffer the change in differ.\n\t\tthis.listenTo( model, 'applyOperation', ( evt, args ) => {\n\t\t\tconst operation = args[ 0 ];\n\n\t\t\tif ( operation.isDocumentOperation ) {\n\t\t\t\tthis.differ.bufferOperation( operation );\n\t\t\t}\n\t\t}, { priority: 'high' } );\n\n\t\t// After the operation is applied, bump document's version and add the operation to the history.\n\t\tthis.listenTo( model, 'applyOperation', ( evt, args ) => {\n\t\t\tconst operation = args[ 0 ];\n\n\t\t\tif ( operation.isDocumentOperation ) {\n\t\t\t\tthis.version++;\n\t\t\t\tthis.history.addOperation( operation );\n\t\t\t}\n\t\t}, { priority: 'low' } );\n\n\t\t// Listen to selection changes. If selection changed, mark it.\n\t\tthis.listenTo( this.selection, 'change', () => {\n\t\t\tthis._hasSelectionChangedFromTheLastChangeBlock = true;\n\t\t} );\n\n\t\t// Buffer marker changes.\n\t\t// This is not covered in buffering operations because markers may change outside of them (when they\n\t\t// are modified using `model.markers` collection, not through `MarkerOperation`).\n\t\tthis.listenTo( model.markers, 'update', ( evt, marker, oldRange, newRange ) => {\n\t\t\t// Whenever marker is updated, buffer that change.\n\t\t\tthis.differ.bufferMarkerChange( marker.name, oldRange, newRange, marker.affectsData );\n\n\t\t\tif ( oldRange === null ) {\n\t\t\t\t// If this is a new marker, add a listener that will buffer change whenever marker changes.\n\t\t\t\tmarker.on( 'change', ( evt, oldRange ) => {\n\t\t\t\t\tthis.differ.bufferMarkerChange( marker.name, oldRange, marker.getRange(), marker.affectsData );\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\t/**\n\t * The graveyard tree root. A document always has a graveyard root that stores removed nodes.\n\t *\n\t * @readonly\n\t * @member {module:engine/model/rootelement~RootElement}\n\t */\n\tget graveyard() {\n\t\treturn this.getRoot( graveyardName );\n\t}\n\n\t/**\n\t * Creates a new root.\n\t *\n\t * @param {String} [elementName='$root'] The element name. Defaults to `'$root'` which also has some basic schema defined\n\t * (`$block`s are allowed inside the `$root`). Make sure to define a proper schema if you use a different name.\n\t * @param {String} [rootName='main'] A unique root name.\n\t * @returns {module:engine/model/rootelement~RootElement} The created root.\n\t */\n\tcreateRoot( elementName = '$root', rootName = 'main' ) {\n\t\tif ( this.roots.get( rootName ) ) {\n\t\t\t/**\n\t\t\t * A root with the specified name already exists.\n\t\t\t *\n\t\t\t * @error model-document-createRoot-name-exists\n\t\t\t * @param {module:engine/model/document~Document} doc\n\t\t\t * @param {String} name\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'model-document-createRoot-name-exists: Root with specified name already exists.',\n\t\t\t\t{ name: rootName }\n\t\t\t);\n\t\t}\n\n\t\tconst root = new RootElement( this, elementName, rootName );\n\t\tthis.roots.add( root );\n\n\t\treturn root;\n\t}\n\n\t/**\n\t * Removes all event listeners set by the document instance.\n\t */\n\tdestroy() {\n\t\tthis.selection.destroy();\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Returns a root by its name.\n\t *\n\t * @param {String} [name='main'] A unique root name.\n\t * @returns {module:engine/model/rootelement~RootElement|null} The root registered under a given name or `null` when\n\t * there is no root with the given name.\n\t */\n\tgetRoot( name = 'main' ) {\n\t\treturn this.roots.get( name );\n\t}\n\n\t/**\n\t * Returns an array with names of all roots (without the {@link #graveyard}) added to the document.\n\t *\n\t * @returns {Array.} Roots names.\n\t */\n\tgetRootNames() {\n\t\treturn Array.from( this.roots, root => root.rootName ).filter( name => name != graveyardName );\n\t}\n\n\t/**\n\t * Used to register a post-fixer callback. A post-fixer mechanism guarantees that the features\n\t * will operate on a correct model state.\n\t *\n\t * An execution of a feature may lead to an incorrect document tree state. The callbacks are used to fix the document tree after\n\t * it has changed. Post-fixers are fired just after all changes from the outermost change block were applied but\n\t * before the {@link module:engine/model/document~Document#event:change change event} is fired. If a post-fixer callback made\n\t * a change, it should return `true`. When this happens, all post-fixers are fired again to check if something else should\n\t * not be fixed in the new document tree state.\n\t *\n\t * As a parameter, a post-fixer callback receives a {@link module:engine/model/writer~Writer writer} instance connected with the\n\t * executed changes block. Thanks to that, all changes done by the callback will be added to the same\n\t * {@link module:engine/model/batch~Batch batch} (and undo step) as the original changes. This makes post-fixer changes transparent\n\t * for the user.\n\t *\n\t * An example of a post-fixer is a callback that checks if all the data were removed from the editor. If so, the\n\t * callback should add an empty paragraph so that the editor is never empty:\n\t *\n\t *\t\tdocument.registerPostFixer( writer => {\n\t *\t\t\tconst changes = document.differ.getChanges();\n\t *\n\t *\t\t\t// Check if the changes lead to an empty root in the editor.\n\t *\t\t\tfor ( const entry of changes ) {\n\t *\t\t\t\tif ( entry.type == 'remove' && entry.position.root.isEmpty ) {\n\t *\t\t\t\t\twriter.insertElement( 'paragraph', entry.position.root, 0 );\n\t *\n\t *\t\t\t\t\t// It is fine to return early, even if multiple roots would need to be fixed.\n\t *\t\t\t\t\t// All post-fixers will be fired again, so if there are more empty roots, those will be fixed, too.\n\t *\t\t\t\t\treturn true;\n\t *\t\t\t\t}\n\t *\t\t\t}\n\t *\t\t} );\n\t *\n\t * @param {Function} postFixer\n\t */\n\tregisterPostFixer( postFixer ) {\n\t\tthis._postFixers.add( postFixer );\n\t}\n\n\t/**\n\t * A custom `toJSON()` method to solve child-parent circular dependencies.\n\t *\n\t * @returns {Object} A clone of this object with the document property changed to a string.\n\t */\n\ttoJSON() {\n\t\tconst json = clone( this );\n\n\t\t// Due to circular references we need to remove parent reference.\n\t\tjson.selection = '[engine.model.DocumentSelection]';\n\t\tjson.model = '[engine.model.Model]';\n\n\t\treturn json;\n\t}\n\n\t/**\n\t * Check if there were any changes done on document, and if so, call post-fixers,\n\t * fire `change` event for features and conversion and then reset the differ.\n\t * Fire `change:data` event when at least one operation or buffered marker changes the data.\n\t *\n\t * @protected\n\t * @fires change\n\t * @fires change:data\n\t * @param {module:engine/model/writer~Writer} writer The writer on which post-fixers will be called.\n\t */\n\t_handleChangeBlock( writer ) {\n\t\tif ( this._hasDocumentChangedFromTheLastChangeBlock() ) {\n\t\t\tthis._callPostFixers( writer );\n\n\t\t\tif ( this.differ.hasDataChanges() ) {\n\t\t\t\tthis.fire( 'change:data', writer.batch );\n\t\t\t} else {\n\t\t\t\tthis.fire( 'change', writer.batch );\n\t\t\t}\n\n\t\t\tthis.differ.reset();\n\t\t}\n\n\t\tthis._hasSelectionChangedFromTheLastChangeBlock = false;\n\t}\n\n\t/**\n\t * Returns whether there is a buffered change or if the selection has changed from the last\n\t * {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block}\n\t * or {@link module:engine/model/model~Model#change `change()` block}.\n\t *\n\t * @protected\n\t * @returns {Boolean} Returns `true` if document has changed from the last `change()` or `enqueueChange()` block.\n\t */\n\t_hasDocumentChangedFromTheLastChangeBlock() {\n\t\treturn !this.differ.isEmpty || this._hasSelectionChangedFromTheLastChangeBlock;\n\t}\n\n\t/**\n\t * Returns the default root for this document which is either the first root that was added to the document using\n\t * {@link #createRoot} or the {@link #graveyard graveyard root} if no other roots were created.\n\t *\n\t * @protected\n\t * @returns {module:engine/model/rootelement~RootElement} The default root for this document.\n\t */\n\t_getDefaultRoot() {\n\t\tfor ( const root of this.roots ) {\n\t\t\tif ( root !== this.graveyard ) {\n\t\t\t\treturn root;\n\t\t\t}\n\t\t}\n\n\t\treturn this.graveyard;\n\t}\n\n\t/**\n\t * Returns the default range for this selection. The default range is a collapsed range that starts and ends\n\t * at the beginning of this selection's document {@link #_getDefaultRoot default root}.\n\t *\n\t * @protected\n\t * @returns {module:engine/model/range~Range}\n\t */\n\t_getDefaultRange() {\n\t\tconst defaultRoot = this._getDefaultRoot();\n\t\tconst model = this.model;\n\t\tconst schema = model.schema;\n\n\t\t// Find the first position where the selection can be put.\n\t\tconst position = model.createPositionFromPath( defaultRoot, [ 0 ] );\n\t\tconst nearestRange = schema.getNearestSelectionRange( position );\n\n\t\t// If valid selection range is not found - return range collapsed at the beginning of the root.\n\t\treturn nearestRange || model.createRange( position );\n\t}\n\n\t/**\n\t * Checks whether a given {@link module:engine/model/range~Range range} is a valid range for\n\t * the {@link #selection document's selection}.\n\t *\n\t * @private\n\t * @param {module:engine/model/range~Range} range A range to check.\n\t * @returns {Boolean} `true` if `range` is valid, `false` otherwise.\n\t */\n\t_validateSelectionRange( range ) {\n\t\treturn validateTextNodePosition( range.start ) && validateTextNodePosition( range.end );\n\t}\n\n\t/**\n\t * Performs post-fixer loops. Executes post-fixer callbacks as long as none of them has done any changes to the model.\n\t *\n\t * @private\n\t * @param {module:engine/model/writer~Writer} writer The writer on which post-fixer callbacks will be called.\n\t */\n\t_callPostFixers( writer ) {\n\t\tlet wasFixed = false;\n\n\t\tdo {\n\t\t\tfor ( const callback of this._postFixers ) {\n\t\t\t\twasFixed = callback( writer );\n\n\t\t\t\tif ( wasFixed ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} while ( wasFixed );\n\t}\n\n\t/**\n\t * Fired after each {@link module:engine/model/model~Model#enqueueChange `enqueueChange()` block} or the outermost\n\t * {@link module:engine/model/model~Model#change `change()` block} was executed and the document was changed\n\t * during that block's execution.\n\t *\n\t * The changes which this event will cover include:\n\t *\n\t * * document structure changes,\n\t * * selection changes,\n\t * * marker changes.\n\t *\n\t * If you want to be notified about all these changes, then simply listen to this event like this:\n\t *\n\t *\t\tmodel.document.on( 'change', () => {\n\t *\t\t\tconsole.log( 'The document has changed!' );\n\t *\t\t} );\n\t *\n\t * If, however, you only want to be notified about the data changes, then use the\n\t * {@link module:engine/model/document~Document#event:change:data change:data} event,\n\t * which is fired for document structure changes and marker changes (which affects the data).\n\t *\n\t *\t\tmodel.document.on( 'change:data', () => {\n\t *\t\t\tconsole.log( 'The data has changed!' );\n\t *\t\t} );\n\t *\n\t * @event change\n\t * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.\n\t */\n\n\t/**\n\t * It is a narrower version of the {@link #event:change} event. It is fired for changes which\n\t * affect the editor data. This is:\n\t *\n\t * * document structure changes,\n\t * * marker changes (which affects the data).\n\t *\n\t * If you want to be notified about the data changes, then listen to this event:\n\t *\n\t *\t\tmodel.document.on( 'change:data', () => {\n\t *\t\t\tconsole.log( 'The data has changed!' );\n\t *\t\t} );\n\t *\n\t * If you would like to listen to all document changes, then check out the\n\t * {@link module:engine/model/document~Document#event:change change} event.\n\t *\n\t * @event change:data\n\t * @param {module:engine/model/batch~Batch} batch The batch that was used in the executed changes block.\n\t */\n}\n\nmix( Document, EmitterMixin );\n\n// Checks whether given range boundary position is valid for document selection, meaning that is not between\n// unicode surrogate pairs or base character and combining marks.\nfunction validateTextNodePosition( rangeBoundary ) {\n\tconst textNode = rangeBoundary.textNode;\n\n\tif ( textNode ) {\n\t\tconst data = textNode.data;\n\t\tconst offset = rangeBoundary.offset - textNode.startOffset;\n\n\t\treturn !isInsideSurrogatePair( data, offset ) && !isInsideCombinedSymbol( data, offset );\n\t}\n\n\treturn true;\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/markercollection\n */\n\nimport LiveRange from './liverange';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * The collection of all {@link module:engine/model/markercollection~Marker markers} attached to the document.\n * It lets you {@link module:engine/model/markercollection~MarkerCollection#get get} markers or track them using\n * {@link module:engine/model/markercollection~MarkerCollection#event:update} event.\n *\n * To create, change or remove makers use {@link module:engine/model/writer~Writer model writers'} methods:\n * {@link module:engine/model/writer~Writer#addMarker} or {@link module:engine/model/writer~Writer#removeMarker}. Since\n * the writer is the only proper way to change the data model it is not possible to change markers directly using this\n * collection. All markers created by the writer will be automatically added to this collection.\n *\n * By default there is one marker collection available as {@link module:engine/model/model~Model#markers model property}.\n *\n * @see module:engine/model/markercollection~Marker\n */\nexport default class MarkerCollection {\n\t/**\n\t * Creates a markers collection.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Stores {@link ~Marker markers} added to the collection.\n\t\t *\n\t\t * @private\n\t\t * @member {Map} #_markers\n\t\t */\n\t\tthis._markers = new Map();\n\t}\n\n\t/**\n\t * Iterable interface.\n\t *\n\t * Iterates over all {@link ~Marker markers} added to the collection.\n\t *\n\t * @returns {Iterable}\n\t */\n\t[ Symbol.iterator ]() {\n\t\treturn this._markers.values();\n\t}\n\n\t/**\n\t * Checks if marker with given `markerName` is in the collection.\n\t *\n\t * @param {String} markerName Marker name.\n\t * @returns {Boolean} `true` if marker with given `markerName` is in the collection, `false` otherwise.\n\t */\n\thas( markerName ) {\n\t\treturn this._markers.has( markerName );\n\t}\n\n\t/**\n\t * Returns {@link ~Marker marker} with given `markerName`.\n\t *\n\t * @param {String} markerName Name of marker to get.\n\t * @returns {module:engine/model/markercollection~Marker|null} Marker with given name or `null` if such marker was\n\t * not added to the collection.\n\t */\n\tget( markerName ) {\n\t\treturn this._markers.get( markerName ) || null;\n\t}\n\n\t/**\n\t * Creates and adds a {@link ~Marker marker} to the `MarkerCollection` with given name on given\n\t * {@link module:engine/model/range~Range range}.\n\t *\n\t * If `MarkerCollection` already had a marker with given name (or {@link ~Marker marker} was passed), the marker in\n\t * collection is updated and {@link module:engine/model/markercollection~MarkerCollection#event:update} event is fired\n\t * but only if there was a change (marker range or {@link module:engine/model/markercollection~Marker#managedUsingOperations}\n\t * flag has changed.\n\t *\n\t * @protected\n\t * @fires module:engine/model/markercollection~MarkerCollection#event:update\n\t * @param {String|module:engine/model/markercollection~Marker} markerOrName Name of marker to set or marker instance to update.\n\t * @param {module:engine/model/range~Range} range Marker range.\n\t * @param {Boolean} [managedUsingOperations=false] Specifies whether the marker is managed using operations.\n\t * @param {Boolean} [affectsData=false] Specifies whether the marker affects the data produced by the data pipeline\n\t * (is persisted in the editor's data).\n\t * @returns {module:engine/model/markercollection~Marker} `Marker` instance which was added or updated.\n\t */\n\t_set( markerOrName, range, managedUsingOperations = false, affectsData = false ) {\n\t\tconst markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n\t\tconst oldMarker = this._markers.get( markerName );\n\n\t\tif ( oldMarker ) {\n\t\t\tconst oldRange = oldMarker.getRange();\n\t\t\tlet hasChanged = false;\n\n\t\t\tif ( !oldRange.isEqual( range ) ) {\n\t\t\t\toldMarker._attachLiveRange( LiveRange.fromRange( range ) );\n\t\t\t\thasChanged = true;\n\t\t\t}\n\n\t\t\tif ( managedUsingOperations != oldMarker.managedUsingOperations ) {\n\t\t\t\toldMarker._managedUsingOperations = managedUsingOperations;\n\t\t\t\thasChanged = true;\n\t\t\t}\n\n\t\t\tif ( typeof affectsData === 'boolean' && affectsData != oldMarker.affectsData ) {\n\t\t\t\toldMarker._affectsData = affectsData;\n\t\t\t\thasChanged = true;\n\t\t\t}\n\n\t\t\tif ( hasChanged ) {\n\t\t\t\tthis.fire( 'update:' + markerName, oldMarker, oldRange, range );\n\t\t\t}\n\n\t\t\treturn oldMarker;\n\t\t}\n\n\t\tconst liveRange = LiveRange.fromRange( range );\n\t\tconst marker = new Marker( markerName, liveRange, managedUsingOperations, affectsData );\n\n\t\tthis._markers.set( markerName, marker );\n\t\tthis.fire( 'update:' + markerName, marker, null, range );\n\n\t\treturn marker;\n\t}\n\n\t/**\n\t * Removes given {@link ~Marker marker} or a marker with given name from the `MarkerCollection`.\n\t *\n\t * @protected\n\t * @fires module:engine/model/markercollection~MarkerCollection#event:update\n\t * @param {String} markerOrName Marker or name of a marker to remove.\n\t * @returns {Boolean} `true` if marker was found and removed, `false` otherwise.\n\t */\n\t_remove( markerOrName ) {\n\t\tconst markerName = markerOrName instanceof Marker ? markerOrName.name : markerOrName;\n\t\tconst oldMarker = this._markers.get( markerName );\n\n\t\tif ( oldMarker ) {\n\t\t\tthis._markers.delete( markerName );\n\t\t\tthis.fire( 'update:' + markerName, oldMarker, oldMarker.getRange(), null );\n\n\t\t\tthis._destroyMarker( oldMarker );\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Returns iterator that iterates over all markers, which ranges contain given {@link module:engine/model/position~Position position}.\n\t *\n\t * @param {module:engine/model/position~Position} position\n\t * @returns {Iterable.}\n\t */\n\t* getMarkersAtPosition( position ) {\n\t\tfor ( const marker of this ) {\n\t\t\tif ( marker.getRange().containsPosition( position ) ) {\n\t\t\t\tyield marker;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns iterator that iterates over all markers, which intersects with given {@link module:engine/model/range~Range range}.\n\t *\n\t * @param {module:engine/model/range~Range} range\n\t * @returns {Iterable.}\n\t */\n\t* getMarkersIntersectingRange( range ) {\n\t\tfor ( const marker of this ) {\n\t\t\tif ( marker.getRange().getIntersection( range ) !== null ) {\n\t\t\t\tyield marker;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Destroys marker collection and all markers inside it.\n\t */\n\tdestroy() {\n\t\tfor ( const marker of this._markers.values() ) {\n\t\t\tthis._destroyMarker( marker );\n\t\t}\n\n\t\tthis._markers = null;\n\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Iterates over all markers that starts with given `prefix`.\n\t *\n\t *\t\tconst markerFooA = markersCollection.set( 'foo:a', rangeFooA );\n\t *\t\tconst markerFooB = markersCollection.set( 'foo:b', rangeFooB );\n\t *\t\tconst markerBarA = markersCollection.set( 'bar:a', rangeBarA );\n\t *\t\tconst markerFooBarA = markersCollection.set( 'foobar:a', rangeFooBarA );\n\t *\t\tArray.from( markersCollection.getMarkersGroup( 'foo' ) ); // [ markerFooA, markerFooB ]\n\t *\t\tArray.from( markersCollection.getMarkersGroup( 'a' ) ); // []\n\t *\n\t * @param prefix\n\t * @returns {Iterable.}\n\t */\n\t* getMarkersGroup( prefix ) {\n\t\tfor ( const marker of this._markers.values() ) {\n\t\t\tif ( marker.name.startsWith( prefix + ':' ) ) {\n\t\t\t\tyield marker;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Destroys the marker.\n\t *\n\t * @private\n\t * @param {module:engine/model/markercollection~Marker} marker Marker to destroy.\n\t */\n\t_destroyMarker( marker ) {\n\t\tmarker.stopListening();\n\t\tmarker._detachLiveRange();\n\t}\n\n\t/**\n\t * Fired whenever marker is added, updated or removed from `MarkerCollection`.\n\t *\n\t * @event update\n\t * @param {module:engine/model/markercollection~Marker} marker Updated Marker.\n\t * @param {module:engine/model/range~Range|null} oldRange Marker range before the update. When is not defined it\n\t * means that marker is just added.\n\t * @param {module:engine/model/range~Range|null} newRange Marker range after update. When is not defined it\n\t * means that marker is just removed.\n\t */\n}\n\nmix( MarkerCollection, EmitterMixin );\n\n/**\n * `Marker` is a continuous parts of model (like a range), is named and represent some kind of information about marked\n * part of model document. In contrary to {@link module:engine/model/node~Node nodes}, which are building blocks of\n * model document tree, markers are not stored directly in document tree but in\n * {@link module:engine/model/model~Model#markers model markers' collection}. Still, they are document data, by giving\n * additional meaning to the part of a model document between marker start and marker end.\n *\n * In this sense, markers are similar to adding and converting attributes on nodes. The difference is that attribute is\n * connected with a given node (e.g. a character is bold no matter if it gets moved or content around it changes).\n * Markers on the other hand are continuous ranges and are characterized by their start and end position. This means that\n * any character in the marker is marked by the marker. For example, if a character is moved outside of marker it stops being\n * \"special\" and the marker is shrunk. Similarly, when a character is moved into the marker from other place in document\n * model, it starts being \"special\" and the marker is enlarged.\n *\n * Another upside of markers is that finding marked part of document is fast and easy. Using attributes to mark some nodes\n * and then trying to find that part of document would require traversing whole document tree. Marker gives instant access\n * to the range which it is marking at the moment.\n *\n * Markers are built from a name and a range.\n *\n * Range of the marker is updated automatically when document changes, using\n * {@link module:engine/model/liverange~LiveRange live range} mechanism.\n *\n * Name is used to group and identify markers. Names have to be unique, but markers can be grouped by\n * using common prefixes, separated with `:`, for example: `user:john` or `search:3`. That's useful in term of creating\n * namespaces for custom elements (e.g. comments, highlights). You can use this prefixes in\n * {@link module:engine/model/markercollection~MarkerCollection#event:update} listeners to listen on changes in a group of markers.\n * For instance: `model.markers.on( 'set:user', callback );` will be called whenever any `user:*` markers changes.\n *\n * There are two types of markers.\n *\n * 1. Markers managed directly, without using operations. They are added directly by {@link module:engine/model/writer~Writer}\n * to the {@link module:engine/model/markercollection~MarkerCollection} without any additional mechanism. They can be used\n * as bookmarks or visual markers. They are great for showing results of the find, or select link when the focus is in the input.\n *\n * 1. Markers managed using operations. These markers are also stored in {@link module:engine/model/markercollection~MarkerCollection}\n * but changes in these markers is managed the same way all other changes in the model structure - using operations.\n * Therefore, they are handled in the undo stack and synchronized between clients if the collaboration plugin is enabled.\n * This type of markers is useful for solutions like spell checking or comments.\n *\n * Both type of them should be added / updated by {@link module:engine/model/writer~Writer#addMarker}\n * and removed by {@link module:engine/model/writer~Writer#removeMarker} methods.\n *\n *\t\tmodel.change( ( writer ) => {\n * \t\t\tconst marker = writer.addMarker( name, { range, usingOperation: true } );\n *\n * \t\t\t// ...\n *\n * \t\t\twriter.removeMarker( marker );\n *\t\t} );\n *\n * See {@link module:engine/model/writer~Writer} to find more examples.\n *\n * Since markers need to track change in the document, for efficiency reasons, it is best to create and keep as little\n * markers as possible and remove them as soon as they are not needed anymore.\n *\n * Markers can be downcasted and upcasted.\n *\n * Markers downcast happens on {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:addMarker} and\n * {@link module:engine/conversion/downcastdispatcher~DowncastDispatcher#event:removeMarker} events.\n * Use {@link module:engine/conversion/downcasthelpers downcast converters} or attach a custom converter to mentioned events.\n * For {@link module:engine/controller/datacontroller~DataController data pipeline}, marker should be downcasted to an element.\n * Then, it can be upcasted back to a marker. Again, use {@link module:engine/conversion/upcasthelpers upcast converters} or\n * attach a custom converter to {@link module:engine/conversion/upcastdispatcher~UpcastDispatcher#event:element}.\n *\n * `Marker` instances are created and destroyed only by {@link ~MarkerCollection MarkerCollection}.\n */\nclass Marker {\n\t/**\n\t * Creates a marker instance.\n\t *\n\t * @param {String} name Marker name.\n\t * @param {module:engine/model/liverange~LiveRange} liveRange Range marked by the marker.\n\t * @param {Boolean} managedUsingOperations Specifies whether the marker is managed using operations.\n\t * @param {Boolean} affectsData Specifies whether the marker affects the data produced by the data pipeline\n\t * (is persisted in the editor's data).\n\t */\n\tconstructor( name, liveRange, managedUsingOperations, affectsData ) {\n\t\t/**\n\t\t * Marker's name.\n\t\t *\n\t\t * @readonly\n\t\t * @type {String}\n\t\t */\n\t\tthis.name = name;\n\n\t\t/**\n\t\t * Range marked by the marker.\n\t\t *\n\t\t * @protected\n\t\t * @member {module:engine/model/liverange~LiveRange}\n\t\t */\n\t\tthis._liveRange = this._attachLiveRange( liveRange );\n\n\t\t/**\n\t\t * Flag indicates if the marker is managed using operations or not.\n\t\t *\n\t\t * @private\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis._managedUsingOperations = managedUsingOperations;\n\n\t\t/**\n\t\t * Specifies whether the marker affects the data produced by the data pipeline\n\t\t * (is persisted in the editor's data).\n\t\t *\n\t\t * @private\n\t\t * @member {Boolean}\n\t\t */\n\t\tthis._affectsData = affectsData;\n\t}\n\n\t/**\n\t * A value indicating if the marker is managed using operations.\n\t * See {@link ~Marker marker class description} to learn more about marker types.\n\t * See {@link module:engine/model/writer~Writer#addMarker}.\n\t *\n\t * @returns {Boolean}\n\t */\n\tget managedUsingOperations() {\n\t\tif ( !this._liveRange ) {\n\t\t\tthrow new CKEditorError( 'marker-destroyed: Cannot use a destroyed marker instance.' );\n\t\t}\n\n\t\treturn this._managedUsingOperations;\n\t}\n\n\t/**\n\t * A value indicating if the marker changes the data.\n\t *\n\t * @returns {Boolean}\n\t */\n\tget affectsData() {\n\t\tif ( !this._liveRange ) {\n\t\t\tthrow new CKEditorError( 'marker-destroyed: Cannot use a destroyed marker instance.' );\n\t\t}\n\n\t\treturn this._affectsData;\n\t}\n\n\t/**\n\t * Returns current marker start position.\n\t *\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tgetStart() {\n\t\tif ( !this._liveRange ) {\n\t\t\tthrow new CKEditorError( 'marker-destroyed: Cannot use a destroyed marker instance.' );\n\t\t}\n\n\t\treturn this._liveRange.start.clone();\n\t}\n\n\t/**\n\t * Returns current marker end position.\n\t *\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tgetEnd() {\n\t\tif ( !this._liveRange ) {\n\t\t\tthrow new CKEditorError( 'marker-destroyed: Cannot use a destroyed marker instance.' );\n\t\t}\n\n\t\treturn this._liveRange.end.clone();\n\t}\n\n\t/**\n\t * Returns a range that represents the current state of the marker.\n\t *\n\t * Keep in mind that returned value is a {@link module:engine/model/range~Range Range}, not a\n\t * {@link module:engine/model/liverange~LiveRange LiveRange}. This means that it is up-to-date and relevant only\n\t * until next model document change. Do not store values returned by this method. Instead, store {@link ~Marker#name}\n\t * and get `Marker` instance from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection} every\n\t * time there is a need to read marker properties. This will guarantee that the marker has not been removed and\n\t * that it's data is up-to-date.\n\t *\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tgetRange() {\n\t\tif ( !this._liveRange ) {\n\t\t\tthrow new CKEditorError( 'marker-destroyed: Cannot use a destroyed marker instance.' );\n\t\t}\n\n\t\treturn this._liveRange.toRange();\n\t}\n\n\t/**\n\t * Binds new live range to the marker and detach the old one if is attached.\n\t *\n\t * @protected\n\t * @param {module:engine/model/liverange~LiveRange} liveRange Live range to attach\n\t * @returns {module:engine/model/liverange~LiveRange} Attached live range.\n\t */\n\t_attachLiveRange( liveRange ) {\n\t\tif ( this._liveRange ) {\n\t\t\tthis._detachLiveRange();\n\t\t}\n\n\t\t// Delegating does not work with namespaces. Alternatively, we could delegate all events (using `*`).\n\t\tliveRange.delegate( 'change:range' ).to( this );\n\t\tliveRange.delegate( 'change:content' ).to( this );\n\n\t\tthis._liveRange = liveRange;\n\n\t\treturn liveRange;\n\t}\n\n\t/**\n\t * Unbinds and destroys currently attached live range.\n\t *\n\t * @protected\n\t */\n\t_detachLiveRange() {\n\t\tthis._liveRange.stopDelegating( 'change:range', this );\n\t\tthis._liveRange.stopDelegating( 'change:content', this );\n\t\tthis._liveRange.detach();\n\t\tthis._liveRange = null;\n\t}\n\n\t/**\n\t * Fired whenever {@link ~Marker#_liveRange marker range} is changed due to changes on {@link module:engine/model/document~Document}.\n\t * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:range LiveRange change:range event}.\n\t *\n\t * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},\n\t * all event listeners listening to it should be removed. It is best to do it on\n\t * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.\n\t *\n\t * @see module:engine/model/liverange~LiveRange#event:change:range\n\t * @event change:range\n\t * @param {module:engine/model/range~Range} oldRange\n\t * @param {Object} data\n\t */\n\n\t/**\n\t * Fired whenever change on {@link module:engine/model/document~Document} is done inside {@link ~Marker#_liveRange marker range}.\n\t * This is a delegated {@link module:engine/model/liverange~LiveRange#event:change:content LiveRange change:content event}.\n\t *\n\t * When marker is removed from {@link module:engine/model/markercollection~MarkerCollection MarkerCollection},\n\t * all event listeners listening to it should be removed. It is best to do it on\n\t * {@link module:engine/model/markercollection~MarkerCollection#event:update MarkerCollection update event}.\n\t *\n\t * @see module:engine/model/liverange~LiveRange#event:change:content\n\t * @event change:content\n\t * @param {module:engine/model/range~Range} oldRange\n\t * @param {Object} data\n\t */\n}\n\nmix( Marker, EmitterMixin );\n\n/**\n * Cannot use a {@link module:engine/model/markercollection~MarkerCollection#destroy destroyed marker} instance.\n *\n * @error marker-destroyed\n */\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/liveposition\n */\n\nimport Position from './position';\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * `LivePosition` is a type of {@link module:engine/model/position~Position Position}\n * that updates itself as {@link module:engine/model/document~Document document}\n * is changed through operations. It may be used as a bookmark.\n *\n * **Note:** Contrary to {@link module:engine/model/position~Position}, `LivePosition` works only in roots that are\n * {@link module:engine/model/rootelement~RootElement}.\n * If {@link module:engine/model/documentfragment~DocumentFragment} is passed, error will be thrown.\n *\n * **Note:** Be very careful when dealing with `LivePosition`. Each `LivePosition` instance bind events that might\n * have to be unbound.\n * Use {@link module:engine/model/liveposition~LivePosition#detach} whenever you don't need `LivePosition` anymore.\n *\n * @extends module:engine/model/position~Position\n */\nexport default class LivePosition extends Position {\n\t/**\n\t * Creates a live position.\n\t *\n\t * @see module:engine/model/position~Position\n\t * @param {module:engine/model/rootelement~RootElement} root\n\t * @param {Array.} path\n\t * @param {module:engine/model/position~PositionStickiness} [stickiness]\n\t */\n\tconstructor( root, path, stickiness = 'toNone' ) {\n\t\tsuper( root, path, stickiness );\n\n\t\tif ( !this.root.is( 'rootElement' ) ) {\n\t\t\t/**\n\t\t\t * LivePosition's root has to be an instance of RootElement.\n\t\t\t *\n\t\t\t * @error liveposition-root-not-rootelement\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'model-liveposition-root-not-rootelement: LivePosition\\'s root has to be an instance of RootElement.'\n\t\t\t);\n\t\t}\n\n\t\tbindWithDocument.call( this );\n\t}\n\n\t/**\n\t * Unbinds all events previously bound by `LivePosition`. Use it whenever you don't need `LivePosition` instance\n\t * anymore (i.e. when leaving scope in which it was declared or before re-assigning variable that was\n\t * referring to it).\n\t */\n\tdetach() {\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Creates a {@link module:engine/model/position~Position position instance}, which is equal to this live position.\n\t *\n\t * @returns {module:engine/model/position~Position}\n\t */\n\ttoPosition() {\n\t\treturn new Position( this.root, this.path.slice(), this.stickiness );\n\t}\n\n\t/**\n\t * Creates a `LivePosition` instance that is equal to position.\n\t *\n\t * @param {module:engine/model/position~Position} position\n\t * @param {module:engine/model/position~PositionStickiness} [stickiness]\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tstatic fromPosition( position, stickiness ) {\n\t\treturn new this( position.root, position.path.slice(), stickiness ? stickiness : position.stickiness );\n\t}\n\n\t/**\n\t * @static\n\t * @protected\n\t * @method module:engine/model/liveposition~LivePosition._createAfter\n\t * @see module:engine/model/position~Position._createAfter\n\t * @param {module:engine/model/node~Node} node\n\t * @returns {module:engine/model/liveposition~LivePosition}\n\t */\n\n\t/**\n\t * @static\n\t * @protected\n\t * @method module:engine/model/liveposition~LivePosition._createBefore\n\t * @see module:engine/model/position~Position._createBefore\n\t * @param {module:engine/model/node~Node} node\n\t * @returns {module:engine/model/liveposition~LivePosition}\n\t */\n\n\t/**\n\t * Fired when `LivePosition` instance is changed due to changes on {@link module:engine/model/document~Document}.\n\t *\n\t * @event module:engine/model/liveposition~LivePosition#change\n\t * @param {module:engine/model/position~Position} oldPosition Position equal to this live position before it got changed.\n\t */\n}\n\n// Binds this `LivePosition` to the {@link module:engine/model/document~Document document} that owns\n// this position's {@link module:engine/model/position~Position#root root}.\n//\n// @private\nfunction bindWithDocument() {\n\tthis.listenTo(\n\t\tthis.root.document.model,\n\t\t'applyOperation',\n\t\t( event, args ) => {\n\t\t\tconst operation = args[ 0 ];\n\n\t\t\tif ( !operation.isDocumentOperation ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttransform.call( this, operation );\n\t\t},\n\t\t{ priority: 'low' }\n\t);\n}\n\n// Updates this position accordingly to the updates applied to the model. Bases on change events.\n//\n// @private\n// @param {module:engine/model/operation/operation~Operation} operation Executed operation.\nfunction transform( operation ) {\n\tconst result = this.getTransformedByOperation( operation );\n\n\tif ( !this.isEqual( result ) ) {\n\t\tconst oldPosition = this.toPosition();\n\n\t\tthis.path = result.path;\n\t\tthis.root = result.root;\n\n\t\tthis.fire( 'change', oldPosition );\n\t}\n}\n\nmix( LivePosition, EmitterMixin );\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/utils/insertcontent\n */\n\nimport Position from '../position';\nimport LivePosition from '../liveposition';\nimport Element from '../element';\nimport Range from '../range';\nimport log from '@ckeditor/ckeditor5-utils/src/log';\nimport DocumentSelection from '../documentselection';\nimport Selection from '../selection';\n\n/**\n * Inserts content into the editor (specified selection) as one would expect the paste\n * functionality to work.\n *\n * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable` it will be modified\n * to the insertion selection (equal to a range to be selected after insertion).\n *\n * **Note:** Use {@link module:engine/model/model~Model#insertContent} instead of this function.\n * This function is only exposed to be reusable in algorithms which change the {@link module:engine/model/model~Model#insertContent}\n * method's behavior.\n *\n * @param {module:engine/model/model~Model} model The model in context of which the insertion\n * should be performed.\n * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.\n * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]\n * Selection into which the content should be inserted.\n * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.\n */\nexport default function insertContent( model, content, selectable, placeOrOffset ) {\n\tmodel.change( writer => {\n\t\tlet selection;\n\n\t\tif ( !selectable ) {\n\t\t\tselection = model.document.selection;\n\t\t} else if ( selectable instanceof Selection || selectable instanceof DocumentSelection ) {\n\t\t\tselection = selectable;\n\t\t} else {\n\t\t\tselection = writer.createSelection( selectable, placeOrOffset );\n\t\t}\n\n\t\tif ( !selection.isCollapsed ) {\n\t\t\tmodel.deleteContent( selection );\n\t\t}\n\n\t\tconst insertion = new Insertion( model, writer, selection.anchor );\n\n\t\tlet nodesToInsert;\n\n\t\tif ( content.is( 'documentFragment' ) ) {\n\t\t\tnodesToInsert = content.getChildren();\n\t\t} else {\n\t\t\tnodesToInsert = [ content ];\n\t\t}\n\n\t\tinsertion.handleNodes( nodesToInsert, {\n\t\t\t// The set of children being inserted is the only set in this context\n\t\t\t// so it's the first and last (it's a hack ;)).\n\t\t\tisFirst: true,\n\t\t\tisLast: true\n\t\t} );\n\n\t\tconst newRange = insertion.getSelectionRange();\n\n\t\t/* istanbul ignore else */\n\t\tif ( newRange ) {\n\t\t\tif ( selection instanceof DocumentSelection ) {\n\t\t\t\twriter.setSelection( newRange );\n\t\t\t} else {\n\t\t\t\tselection.setTo( newRange );\n\t\t\t}\n\t\t} else {\n\t\t\t// We are not testing else because it's a safe check for unpredictable edge cases:\n\t\t\t// an insertion without proper range to select.\n\n\t\t\t/**\n\t\t\t * Cannot determine a proper selection range after insertion.\n\t\t\t *\n\t\t\t * @warning insertcontent-no-range\n\t\t\t */\n\t\t\tlog.warn( 'insertcontent-no-range: Cannot determine a proper selection range after insertion.' );\n\t\t}\n\t} );\n}\n\n/**\n * Utility class for performing content insertion.\n *\n * @private\n */\nclass Insertion {\n\tconstructor( model, writer, position ) {\n\t\t/**\n\t\t * The model in context of which the insertion should be performed.\n\t\t *\n\t\t * @member {module:engine/model~Model} #model\n\t\t */\n\t\tthis.model = model;\n\n\t\t/**\n\t\t * Batch to which operations will be added.\n\t\t *\n\t\t * @member {module:engine/controller/writer~Batch} #writer\n\t\t */\n\t\tthis.writer = writer;\n\n\t\t/**\n\t\t * The position at which (or near which) the next node will be inserted.\n\t\t *\n\t\t * @member {module:engine/model/position~Position} #position\n\t\t */\n\t\tthis.position = position;\n\n\t\t/**\n\t\t * Elements with which the inserted elements can be merged.\n\t\t *\n\t\t *\t\t

x^

y

+

z

(can merge to

x

)\n\t\t *\t\t

x

^y

+

z

(can merge to

y

)\n\t\t *\t\t

x^y

+

z

(can merge to

xy

which will be split during the action,\n\t\t *\t\t\t\t\t\t\t\tso both its pieces will be added to this set)\n\t\t *\n\t\t *\n\t\t * @member {Set} #canMergeWith\n\t\t */\n\t\tthis.canMergeWith = new Set( [ this.position.parent ] );\n\n\t\t/**\n\t\t * Schema of the model.\n\t\t *\n\t\t * @member {module:engine/model/schema~Schema} #schema\n\t\t */\n\t\tthis.schema = model.schema;\n\n\t\tthis._filterAttributesOf = [];\n\t}\n\n\t/**\n\t * Handles insertion of a set of nodes.\n\t *\n\t * @param {Iterable.} nodes Nodes to insert.\n\t * @param {Object} parentContext Context in which parent of these nodes was supposed to be inserted.\n\t * If the parent context is passed it means that the parent element was stripped (was not allowed).\n\t */\n\thandleNodes( nodes, parentContext ) {\n\t\tnodes = Array.from( nodes );\n\n\t\tfor ( let i = 0; i < nodes.length; i++ ) {\n\t\t\tconst node = nodes[ i ];\n\n\t\t\tthis._handleNode( node, {\n\t\t\t\tisFirst: i === 0 && parentContext.isFirst,\n\t\t\t\tisLast: ( i === ( nodes.length - 1 ) ) && parentContext.isLast\n\t\t\t} );\n\t\t}\n\n\t\t// TMP this will become a post-fixer.\n\t\tthis.schema.removeDisallowedAttributes( this._filterAttributesOf, this.writer );\n\t\tthis._filterAttributesOf = [];\n\t}\n\n\t/**\n\t * Returns range to be selected after insertion.\n\t * Returns null if there is no valid range to select after insertion.\n\t *\n\t * @returns {module:engine/model/range~Range|null}\n\t */\n\tgetSelectionRange() {\n\t\tif ( this.nodeToSelect ) {\n\t\t\treturn Range._createOn( this.nodeToSelect );\n\t\t}\n\n\t\treturn this.model.schema.getNearestSelectionRange( this.position );\n\t}\n\n\t/**\n\t * Handles insertion of a single node.\n\t *\n\t * @private\n\t * @param {module:engine/model/node~Node} node\n\t * @param {Object} context\n\t * @param {Boolean} context.isFirst Whether the given node is the first one in the content to be inserted.\n\t * @param {Boolean} context.isLast Whether the given node is the last one in the content to be inserted.\n\t */\n\t_handleNode( node, context ) {\n\t\t// Let's handle object in a special way.\n\t\t// * They should never be merged with other elements.\n\t\t// * If they are not allowed in any of the selection ancestors, they could be either autoparagraphed or totally removed.\n\t\tif ( this.schema.isObject( node ) ) {\n\t\t\tthis._handleObject( node, context );\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Try to find a place for the given node.\n\t\t// Split the position.parent's branch up to a point where the node can be inserted.\n\t\t// If it isn't allowed in the whole branch, then of course don't split anything.\n\t\tconst isAllowed = this._checkAndSplitToAllowedPosition( node, context );\n\n\t\tif ( !isAllowed ) {\n\t\t\tthis._handleDisallowedNode( node, context );\n\n\t\t\treturn;\n\t\t}\n\n\t\tthis._insert( node );\n\n\t\t// After the node was inserted we may try to merge it with its siblings.\n\t\t// This should happen only if it was the first and/or last of the nodes (so only with boundary nodes)\n\t\t// and only if the selection was in those elements initially.\n\t\t//\n\t\t// E.g.:\n\t\t//

x^

+

y

=>

x

y

=>

xy[]

\n\t\t// and:\n\t\t//

x^y

+

z

=>

x

^

y

+

z

=>

x

y

z

=>

xy[]z

\n\t\t// but:\n\t\t//

x

^

z

+

y

=>

x

y

z

(no merging)\n\t\t//

x

[]

z

+

y

=>

x

y

z

(no merging, note: after running deletetContents\n\t\t//\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t it's exactly the same case as above)\n\t\tthis._mergeSiblingsOf( node, context );\n\t}\n\n\t/**\n\t * @private\n\t * @param {module:engine/model/element~Element} node The object element.\n\t * @param {Object} context\n\t */\n\t_handleObject( node, context ) {\n\t\t// Try finding it a place in the tree.\n\t\tif ( this._checkAndSplitToAllowedPosition( node ) ) {\n\t\t\tthis._insert( node );\n\t\t}\n\t\t// Try autoparagraphing.\n\t\telse {\n\t\t\tthis._tryAutoparagraphing( node, context );\n\t\t}\n\t}\n\n\t/**\n\t * @private\n\t * @param {module:engine/model/node~Node} node The disallowed node which needs to be handled.\n\t * @param {Object} context\n\t */\n\t_handleDisallowedNode( node, context ) {\n\t\t// If the node is an element, try inserting its children (strip the parent).\n\t\tif ( node.is( 'element' ) ) {\n\t\t\tthis.handleNodes( node.getChildren(), context );\n\t\t}\n\t\t// If text is not allowed, try autoparagraphing it.\n\t\telse {\n\t\t\tthis._tryAutoparagraphing( node, context );\n\t\t}\n\t}\n\n\t/**\n\t * @private\n\t * @param {module:engine/model/node~Node} node The node to insert.\n\t */\n\t_insert( node ) {\n\t\t/* istanbul ignore if */\n\t\tif ( !this.schema.checkChild( this.position, node ) ) {\n\t\t\t// Algorithm's correctness check. We should never end up here but it's good to know that we did.\n\t\t\t// Note that it would often be a silent issue if we insert node in a place where it's not allowed.\n\t\t\tlog.error(\n\t\t\t\t'insertcontent-wrong-position: The node cannot be inserted on the given position.',\n\t\t\t\t{ node, position: this.position }\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst livePos = LivePosition.fromPosition( this.position, 'toNext' );\n\n\t\tthis.writer.insert( node, this.position );\n\n\t\tthis.position = livePos.toPosition();\n\t\tlivePos.detach();\n\n\t\t// The last inserted object should be selected because we can't put a collapsed selection after it.\n\t\tif ( this.schema.isObject( node ) && !this.schema.checkChild( this.position, '$text' ) ) {\n\t\t\tthis.nodeToSelect = node;\n\t\t} else {\n\t\t\tthis.nodeToSelect = null;\n\t\t}\n\n\t\tthis._filterAttributesOf.push( node );\n\t}\n\n\t/**\n\t * @private\n\t * @param {module:engine/model/node~Node} node The node which could potentially be merged.\n\t * @param {Object} context\n\t */\n\t_mergeSiblingsOf( node, context ) {\n\t\tif ( !( node instanceof Element ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst mergeLeft = this._canMergeLeft( node, context );\n\t\tconst mergeRight = this._canMergeRight( node, context );\n\t\tconst mergePosLeft = LivePosition._createBefore( node );\n\t\tmergePosLeft.stickiness = 'toNext';\n\t\tconst mergePosRight = LivePosition._createAfter( node );\n\t\tmergePosRight.stickiness = 'toNext';\n\n\t\tif ( mergeLeft ) {\n\t\t\tconst livePosition = LivePosition.fromPosition( this.position );\n\t\t\tlivePosition.stickiness = 'toNext';\n\n\t\t\tthis.writer.merge( mergePosLeft );\n\n\t\t\tthis.position = livePosition.toPosition();\n\t\t\tlivePosition.detach();\n\t\t}\n\n\t\tif ( mergeRight ) {\n\t\t\t/* istanbul ignore if */\n\t\t\tif ( !this.position.isEqual( mergePosRight ) ) {\n\t\t\t\t// Algorithm's correctness check. We should never end up here but it's good to know that we did.\n\t\t\t\t// At this point the insertion position should be after the node we'll merge. If it isn't,\n\t\t\t\t// it should need to be secured as in the left merge case.\n\t\t\t\tlog.error( 'insertcontent-wrong-position-on-merge: The insertion position should equal the merge position' );\n\t\t\t}\n\n\t\t\t// Move the position to the previous node, so it isn't moved to the graveyard on merge.\n\t\t\t//

x

[]

y

=>

x[]

y

\n\t\t\tthis.position = Position._createAt( mergePosRight.nodeBefore, 'end' );\n\n\t\t\t// OK:

xx[]

+

yy

=>

xx[]yy

(when sticks to previous)\n\t\t\t// NOK:

xx[]

+

yy

=>

xxyy[]

(when sticks to next)\n\t\t\tconst livePosition = new LivePosition( this.position.root, this.position.path, 'toPrevious' );\n\n\t\t\tthis.writer.merge( mergePosRight );\n\n\t\t\tthis.position = livePosition.toPosition();\n\t\t\tlivePosition.detach();\n\t\t}\n\n\t\tif ( mergeLeft || mergeRight ) {\n\t\t\t// After merge elements that were marked by _insert() to be filtered might be gone so\n\t\t\t// we need to mark the new container.\n\t\t\tthis._filterAttributesOf.push( this.position.parent );\n\t\t}\n\n\t\tmergePosLeft.detach();\n\t\tmergePosRight.detach();\n\t}\n\n\t/**\n\t * Checks whether specified node can be merged with previous sibling element.\n\t *\n\t * @private\n\t * @param {module:engine/model/node~Node} node The node which could potentially be merged.\n\t * @param {Object} context\n\t * @returns {Boolean}\n\t */\n\t_canMergeLeft( node, context ) {\n\t\tconst previousSibling = node.previousSibling;\n\n\t\treturn context.isFirst &&\n\t\t\t( previousSibling instanceof Element ) &&\n\t\t\tthis.canMergeWith.has( previousSibling ) &&\n\t\t\tthis.model.schema.checkMerge( previousSibling, node );\n\t}\n\n\t/**\n\t * Checks whether specified node can be merged with next sibling element.\n\t *\n\t * @private\n\t * @param {module:engine/model/node~Node} node The node which could potentially be merged.\n\t * @param {Object} context\n\t * @returns {Boolean}\n\t */\n\t_canMergeRight( node, context ) {\n\t\tconst nextSibling = node.nextSibling;\n\n\t\treturn context.isLast &&\n\t\t\t( nextSibling instanceof Element ) &&\n\t\t\tthis.canMergeWith.has( nextSibling ) &&\n\t\t\tthis.model.schema.checkMerge( node, nextSibling );\n\t}\n\n\t/**\n\t * Tries wrapping the node in a new paragraph and inserting it this way.\n\t *\n\t * @private\n\t * @param {module:engine/model/node~Node} node The node which needs to be autoparagraphed.\n\t * @param {Object} context\n\t */\n\t_tryAutoparagraphing( node, context ) {\n\t\tconst paragraph = this.writer.createElement( 'paragraph' );\n\n\t\t// Do not autoparagraph if the paragraph won't be allowed there,\n\t\t// cause that would lead to an infinite loop. The paragraph would be rejected in\n\t\t// the next _handleNode() call and we'd be here again.\n\t\tif ( this._getAllowedIn( paragraph, this.position.parent ) && this.schema.checkChild( paragraph, node ) ) {\n\t\t\tparagraph._appendChild( node );\n\t\t\tthis._handleNode( paragraph, context );\n\t\t}\n\t}\n\n\t/**\n\t * @private\n\t * @param {module:engine/model/node~Node} node\n\t * @returns {Boolean} Whether an allowed position was found.\n\t * `false` is returned if the node isn't allowed at any position up in the tree, `true` if was.\n\t */\n\t_checkAndSplitToAllowedPosition( node ) {\n\t\tconst allowedIn = this._getAllowedIn( node, this.position.parent );\n\n\t\tif ( !allowedIn ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twhile ( allowedIn != this.position.parent ) {\n\t\t\t// If a parent which we'd need to leave is a limit element, break.\n\t\t\tif ( this.schema.isLimit( this.position.parent ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif ( this.position.isAtStart ) {\n\t\t\t\tconst parent = this.position.parent;\n\t\t\t\tthis.position = this.writer.createPositionBefore( parent );\n\n\t\t\t\t// Special case – parent is empty (

^

) so isAtStart == isAtEnd == true.\n\t\t\t\t// We can remove the element after moving selection out of it.\n\t\t\t\tif ( parent.isEmpty ) {\n\t\t\t\t\tthis.writer.remove( parent );\n\t\t\t\t}\n\t\t\t} else if ( this.position.isAtEnd ) {\n\t\t\t\tthis.position = this.writer.createPositionAfter( this.position.parent );\n\t\t\t} else {\n\t\t\t\tconst tempPos = this.writer.createPositionAfter( this.position.parent );\n\n\t\t\t\tthis.writer.split( this.position );\n\n\t\t\t\tthis.position = tempPos;\n\n\t\t\t\tthis.canMergeWith.add( this.position.nodeAfter );\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Gets the element in which the given node is allowed. It checks the passed element and all its ancestors.\n\t *\n\t * @private\n\t * @param {module:engine/model/node~Node} node The node to check.\n\t * @param {module:engine/model/element~Element} element The element in which the node's correctness should be checked.\n\t * @returns {module:engine/model/element~Element|null}\n\t */\n\t_getAllowedIn( node, element ) {\n\t\tif ( this.schema.checkChild( element, node ) ) {\n\t\t\treturn element;\n\t\t}\n\n\t\tif ( element.parent ) {\n\t\t\treturn this._getAllowedIn( node, element.parent );\n\t\t}\n\n\t\treturn null;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/utils/deletecontent\n */\n\nimport LivePosition from '../liveposition';\nimport Range from '../range';\nimport DocumentSelection from '../documentselection';\n\n/**\n * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.\n *\n * **Note:** Use {@link module:engine/model/model~Model#deleteContent} instead of this function.\n * This function is only exposed to be reusable in algorithms\n * which change the {@link module:engine/model/model~Model#deleteContent}\n * method's behavior.\n *\n * @param {module:engine/model/model~Model} model The model in context of which the insertion\n * should be performed.\n * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n * Selection of which the content should be deleted.\n * @param {module:engine/model/batch~Batch} batch Batch to which the operations will be added.\n * @param {Object} [options]\n * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.\n *\n * For example `x[xy]y` will become:\n *\n * * `x^y` with the option disabled (`leaveUnmerged == false`)\n * * `x^y` with enabled (`leaveUnmerged == true`).\n *\n * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}\n * elements will not be merged.\n *\n * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a\n * paragraph when the entire content was selected.\n *\n * For example `[xy]` will become:\n *\n * * `^` with the option disabled (`doNotResetEntireContent == false`)\n * * `^` with enabled (`doNotResetEntireContent == true`).\n */\nexport default function deleteContent( model, selection, options = {} ) {\n\tif ( selection.isCollapsed ) {\n\t\treturn;\n\t}\n\n\tconst schema = model.schema;\n\n\tmodel.change( writer => {\n\t\t// 1. Replace the entire content with paragraph.\n\t\t// See: https://github.com/ckeditor/ckeditor5-engine/issues/1012#issuecomment-315017594.\n\t\tif ( !options.doNotResetEntireContent && shouldEntireContentBeReplacedWithParagraph( schema, selection ) ) {\n\t\t\treplaceEntireContentWithParagraph( writer, selection, schema );\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst selRange = selection.getFirstRange();\n\t\tconst startPos = selRange.start;\n\t\tconst endPos = LivePosition.fromPosition( selRange.end, 'toNext' );\n\n\t\t// 2. Remove the content if there is any.\n\t\tif ( !selRange.start.isTouching( selRange.end ) ) {\n\t\t\twriter.remove( selRange );\n\t\t}\n\n\t\t// 3. Merge elements in the right branch to the elements in the left branch.\n\t\t// The only reasonable (in terms of data and selection correctness) case in which we need to do that is:\n\t\t//\n\t\t// Fo[]ar => Fo^ar\n\t\t//\n\t\t// However, the algorithm supports also merging deeper structures (up to the depth of the shallower branch),\n\t\t// as it's hard to imagine what should actually be the default behavior. Usually, specific features will\n\t\t// want to override that behavior anyway.\n\t\tif ( !options.leaveUnmerged ) {\n\t\t\tmergeBranches( writer, startPos, endPos );\n\n\t\t\t// TMP this will be replaced with a postifxer.\n\t\t\t// We need to check and strip disallowed attributes in all nested nodes because after merge\n\t\t\t// some attributes could end up in a path where are disallowed.\n\t\t\t//\n\t\t\t// e.g. bold is disallowed for

\n\t\t\t//

Fo{o

b}ar

->

Fo{}ar

->

Fo{}ar

.\n\t\t\tschema.removeDisallowedAttributes( startPos.parent.getChildren(), writer );\n\t\t}\n\n\t\tif ( selection instanceof DocumentSelection ) {\n\t\t\twriter.setSelection( startPos );\n\t\t} else {\n\t\t\tselection.setTo( startPos );\n\t\t}\n\n\t\t// 4. Autoparagraphing.\n\t\t// Check if a text is allowed in the new container. If not, try to create a new paragraph (if it's allowed here).\n\t\tif ( shouldAutoparagraph( schema, startPos ) ) {\n\t\t\tinsertParagraph( writer, startPos, selection );\n\t\t}\n\n\t\tendPos.detach();\n\t} );\n}\n\n// This function is a result of reaching the Ballmer's peak for just the right amount of time.\n// Even I had troubles documenting it after a while and after reading it again I couldn't believe that it really works.\nfunction mergeBranches( writer, startPos, endPos ) {\n\tconst startParent = startPos.parent;\n\tconst endParent = endPos.parent;\n\n\t// If both positions ended up in the same parent, then there's nothing more to merge:\n\t// <$root>

x[]

{}y

=> <$root>

xy

[]{}\n\tif ( startParent == endParent ) {\n\t\treturn;\n\t}\n\n\t// If one of the positions is a limit element, then there's nothing to merge because we don't want to cross the limit boundaries.\n\tif ( writer.model.schema.isLimit( startParent ) || writer.model.schema.isLimit( endParent ) ) {\n\t\treturn;\n\t}\n\n\t// Check if operations we'll need to do won't need to cross object or limit boundaries.\n\t// E.g., we can't merge endParent into startParent in this case:\n\t// x[]{}\n\tif ( !checkCanBeMerged( startPos, endPos, writer.model.schema ) ) {\n\t\treturn;\n\t}\n\n\t// Remember next positions to merge. For example:\n\t// x[]{}y\n\t// will become:\n\t// xy[]{}\n\tstartPos = writer.createPositionAfter( startParent );\n\tendPos = writer.createPositionBefore( endParent );\n\n\tif ( !endPos.isEqual( startPos ) ) {\n\t\t// In this case, before we merge, we need to move `endParent` to the `startPos`:\n\t\t// x[]{}y\n\t\t// becomes:\n\t\t// x[]y{}\n\t\twriter.insert( endParent, startPos );\n\t}\n\n\t// Merge two siblings:\n\t// x[]y -> xy (the usual case)\n\t// x[]y -> xy[] (this is the \"move parent\" case shown above)\n\twriter.merge( startPos );\n\n\t// Remove empty end ancestors:\n\t// fo[obar]\n\t// becomes:\n\t// fo[]{}\n\t// So we can remove and .\n\twhile ( endPos.parent.isEmpty ) {\n\t\tconst parentToRemove = endPos.parent;\n\n\t\tendPos = writer.createPositionBefore( parentToRemove );\n\n\t\twriter.remove( parentToRemove );\n\t}\n\n\t// Continue merging next level.\n\tmergeBranches( writer, startPos, endPos );\n}\n\nfunction shouldAutoparagraph( schema, position ) {\n\tconst isTextAllowed = schema.checkChild( position, '$text' );\n\tconst isParagraphAllowed = schema.checkChild( position, 'paragraph' );\n\n\treturn !isTextAllowed && isParagraphAllowed;\n}\n\n// Check if parents of two positions can be merged by checking if there are no limit/object\n// boundaries between those two positions.\n//\n// E.g. in

x[]

{}\n// we'll check

, , and .\n// Usually, widget and caption are marked as objects/limits in the schema, so in this case merging will be blocked.\nfunction checkCanBeMerged( leftPos, rightPos, schema ) {\n\tconst rangeToCheck = new Range( leftPos, rightPos );\n\n\tfor ( const value of rangeToCheck.getWalker() ) {\n\t\tif ( schema.isLimit( value.item ) ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}\n\nfunction insertParagraph( writer, position, selection ) {\n\tconst paragraph = writer.createElement( 'paragraph' );\n\n\twriter.insert( paragraph, position );\n\n\tif ( selection instanceof DocumentSelection ) {\n\t\twriter.setSelection( paragraph, 0 );\n\t} else {\n\t\tselection.setTo( paragraph, 0 );\n\t}\n}\n\nfunction replaceEntireContentWithParagraph( writer, selection ) {\n\tconst limitElement = writer.model.schema.getLimitElement( selection );\n\n\twriter.remove( writer.createRangeIn( limitElement ) );\n\tinsertParagraph( writer, writer.createPositionAt( limitElement, 0 ), selection );\n}\n\n// We want to replace the entire content with a paragraph when:\n// * the entire content is selected,\n// * selection contains at least two elements,\n// * whether the paragraph is allowed in schema in the common ancestor.\nfunction shouldEntireContentBeReplacedWithParagraph( schema, selection ) {\n\tconst limitElement = schema.getLimitElement( selection );\n\n\tif ( !selection.containsEntireContent( limitElement ) ) {\n\t\treturn false;\n\t}\n\n\tconst range = selection.getFirstRange();\n\n\tif ( range.start.parent == range.end.parent ) {\n\t\treturn false;\n\t}\n\n\treturn schema.checkChild( limitElement, 'paragraph' );\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/utils/modifyselection\n */\n\nimport Position from '../position';\nimport TreeWalker from '../treewalker';\nimport Range from '../range';\nimport { isInsideSurrogatePair, isInsideCombinedSymbol } from '@ckeditor/ckeditor5-utils/src/unicode';\nimport DocumentSelection from '../documentselection';\n\nconst wordBoundaryCharacters = ' ,.?!:;\"-()';\n\n/**\n * Modifies the selection. Currently, the supported modifications are:\n *\n * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.\n * Possible values for `unit` are:\n * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one\n * character in `String` sense. However, unicode also defines \"combing marks\". These are special symbols, that combines\n * with a symbol before it (\"base character\") to create one user-perceived character. For example, `q̣̇` is a normal\n * letter `q` with two \"combining marks\": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending\n * selection by one position, it is correct to include both \"base character\" and all of it's \"combining marks\". That is\n * why `'character'` value is most natural and common method of modifying selection.\n * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert\n * selection between \"base character\" and \"combining mark\", because \"combining marks\" have their own unicode code points.\n * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by\n * two characters, called \"surrogate pairs\". Halves of \"surrogate pairs\" have a meaning only when placed next to each other.\n * For example `𨭎` is represented in `String` by `\\uD862\\uDF4E`. Both `\\uD862` and `\\uDF4E` do not have any meaning\n * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection\n * extension will include whole \"surrogate pair\".\n * * `'word'` - moves selection by a whole word.\n *\n * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.\n *\n * **Note:** Use {@link module:engine/model/model~Model#modifySelection} instead of this function.\n * This function is only exposed to be reusable in algorithms\n * which change the {@link module:engine/model/model~Model#modifySelection}\n * method's behavior.\n *\n * @param {module:engine/model/model~Model} model The model in context of which\n * the selection modification should be performed.\n * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n * The selection to modify.\n * @param {Object} [options]\n * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.\n * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.\n */\nexport default function modifySelection( model, selection, options = {} ) {\n\tconst schema = model.schema;\n\tconst isForward = options.direction != 'backward';\n\tconst unit = options.unit ? options.unit : 'character';\n\n\tconst focus = selection.focus;\n\n\tconst walker = new TreeWalker( {\n\t\tboundaries: getSearchRange( focus, isForward ),\n\t\tsingleCharacters: true,\n\t\tdirection: isForward ? 'forward' : 'backward'\n\t} );\n\n\tconst data = { walker, schema, isForward, unit };\n\n\tlet next;\n\n\twhile ( ( next = walker.next() ) ) {\n\t\tif ( next.done ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst position = tryExtendingTo( data, next.value );\n\n\t\tif ( position ) {\n\t\t\tif ( selection instanceof DocumentSelection ) {\n\t\t\t\tmodel.change( writer => {\n\t\t\t\t\twriter.setSelectionFocus( position );\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tselection.setFocus( position );\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\t}\n}\n\n// Checks whether the selection can be extended to the the walker's next value (next position).\n// @param {{ walker, unit, isForward, schema }} data\n// @param {module:engine/view/treewalker~TreeWalkerValue} value\nfunction tryExtendingTo( data, value ) {\n\t// If found text, we can certainly put the focus in it. Let's just find a correct position\n\t// based on the unit.\n\tif ( value.type == 'text' ) {\n\t\tif ( data.unit === 'word' ) {\n\t\t\treturn getCorrectWordBreakPosition( data.walker, data.isForward );\n\t\t}\n\n\t\treturn getCorrectPosition( data.walker, data.unit, data.isForward );\n\t}\n\n\t// Entering an element.\n\tif ( value.type == ( data.isForward ? 'elementStart' : 'elementEnd' ) ) {\n\t\t// If it's an object, we can select it now.\n\t\tif ( data.schema.isObject( value.item ) ) {\n\t\t\treturn Position._createAt( value.item, data.isForward ? 'after' : 'before' );\n\t\t}\n\n\t\t// If text allowed on this position, extend to this place.\n\t\tif ( data.schema.checkChild( value.nextPosition, '$text' ) ) {\n\t\t\treturn value.nextPosition;\n\t\t}\n\t}\n\t// Leaving an element.\n\telse {\n\t\t// If leaving a limit element, stop.\n\t\tif ( data.schema.isLimit( value.item ) ) {\n\t\t\t// NOTE: Fast-forward the walker until the end.\n\t\t\tdata.walker.skip( () => true );\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If text allowed on this position, extend to this place.\n\t\tif ( data.schema.checkChild( value.nextPosition, '$text' ) ) {\n\t\t\treturn value.nextPosition;\n\t\t}\n\t}\n}\n\n// Finds a correct position by walking in a text node and checking whether selection can be extended to given position\n// or should be extended further.\n//\n// @param {module:engine/model/treewalker~TreeWalker} walker\n// @param {String} unit The unit by which selection should be modified.\nfunction getCorrectPosition( walker, unit ) {\n\tconst textNode = walker.position.textNode;\n\n\tif ( textNode ) {\n\t\tconst data = textNode.data;\n\t\tlet offset = walker.position.offset - textNode.startOffset;\n\n\t\twhile ( isInsideSurrogatePair( data, offset ) || ( unit == 'character' && isInsideCombinedSymbol( data, offset ) ) ) {\n\t\t\twalker.next();\n\n\t\t\toffset = walker.position.offset - textNode.startOffset;\n\t\t}\n\t}\n\n\treturn walker.position;\n}\n\n// Finds a correct position of a word break by walking in a text node and checking whether selection can be extended to given position\n// or should be extended further.\n//\n// @param {module:engine/model/treewalker~TreeWalker} walker\n// @param {Boolean} isForward Is the direction in which the selection should be modified is forward.\nfunction getCorrectWordBreakPosition( walker, isForward ) {\n\tlet textNode = walker.position.textNode;\n\n\tif ( textNode ) {\n\t\tlet offset = walker.position.offset - textNode.startOffset;\n\n\t\twhile ( !isAtWordBoundary( textNode.data, offset, isForward ) && !isAtNodeBoundary( textNode, offset, isForward ) ) {\n\t\t\twalker.next();\n\n\t\t\t// Check of adjacent text nodes with different attributes (like BOLD).\n\t\t\t// Example : 'foofoo []bar<$text bold=\"true\">bar bazbaz'\n\t\t\t// should expand to : 'foofoo [bar<$text bold=\"true\">bar] bazbaz'.\n\t\t\tconst nextNode = isForward ? walker.position.nodeAfter : walker.position.nodeBefore;\n\n\t\t\t// Scan only text nodes. Ignore inline elements (like ``).\n\t\t\tif ( nextNode && nextNode.is( 'text' ) ) {\n\t\t\t\t// Check boundary char of an adjacent text node.\n\t\t\t\tconst boundaryChar = nextNode.data.charAt( isForward ? 0 : nextNode.data.length - 1 );\n\n\t\t\t\t// Go to the next node if the character at the boundary of that node belongs to the same word.\n\t\t\t\tif ( !wordBoundaryCharacters.includes( boundaryChar ) ) {\n\t\t\t\t\t// If adjacent text node belongs to the same word go to it & reset values.\n\t\t\t\t\twalker.next();\n\n\t\t\t\t\ttextNode = walker.position.textNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toffset = walker.position.offset - textNode.startOffset;\n\t\t}\n\t}\n\n\treturn walker.position;\n}\n\nfunction getSearchRange( start, isForward ) {\n\tconst root = start.root;\n\tconst searchEnd = Position._createAt( root, isForward ? 'end' : 0 );\n\n\tif ( isForward ) {\n\t\treturn new Range( start, searchEnd );\n\t} else {\n\t\treturn new Range( searchEnd, start );\n\t}\n}\n\n// Checks if selection is on word boundary.\n//\n// @param {String} data The text node value to investigate.\n// @param {Number} offset Position offset.\n// @param {Boolean} isForward Is the direction in which the selection should be modified is forward.\nfunction isAtWordBoundary( data, offset, isForward ) {\n\t// The offset to check depends on direction.\n\tconst offsetToCheck = offset + ( isForward ? 0 : -1 );\n\n\treturn wordBoundaryCharacters.includes( data.charAt( offsetToCheck ) );\n}\n\n// Checks if selection is on node boundary.\n//\n// @param {module:engine/model/text~Text} textNode The text node to investigate.\n// @param {Number} offset Position offset.\n// @param {Boolean} isForward Is the direction in which the selection should be modified is forward.\nfunction isAtNodeBoundary( textNode, offset, isForward ) {\n\treturn offset === ( isForward ? textNode.endOffset : 0 );\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/utils/getselectedcontent\n */\n\n/**\n * Gets a clone of the selected content.\n *\n * For example, for the following selection:\n *\n * ```html\n *

x

y

fir[st

se]cond

z

\n * ```\n *\n * It will return a document fragment with such a content:\n *\n * ```html\n * st

se

\n * ```\n *\n * @param {module:engine/model/model~Model} model The model in context of which\n * the selection modification should be performed.\n * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n * The selection of which content will be returned.\n * @returns {module:engine/model/documentfragment~DocumentFragment}\n */\nexport default function getSelectedContent( model, selection ) {\n\treturn model.change( writer => {\n\t\tconst frag = writer.createDocumentFragment();\n\t\tconst range = selection.getFirstRange();\n\n\t\tif ( !range || range.isCollapsed ) {\n\t\t\treturn frag;\n\t\t}\n\n\t\tconst root = range.start.root;\n\t\tconst commonPath = range.start.getCommonPath( range.end );\n\t\tconst commonParent = root.getNodeByPath( commonPath );\n\n\t\t// ## 1st step\n\t\t//\n\t\t// First, we'll clone a fragment represented by a minimal flat range\n\t\t// containing the original range to be cloned.\n\t\t// E.g. let's consider such a range:\n\t\t//\n\t\t//

x

y

fir[st

se]cond

z

\n\t\t//\n\t\t// A minimal flat range containing this one is:\n\t\t//\n\t\t//

x

[

y

first

second

]

z

\n\t\t//\n\t\t// We can easily clone this structure, preserving e.g. the element.\n\t\tlet flatSubtreeRange;\n\n\t\tif ( range.start.parent == range.end.parent ) {\n\t\t\t// The original range is flat, so take it.\n\t\t\tflatSubtreeRange = range;\n\t\t} else {\n\t\t\tflatSubtreeRange = writer.createRange(\n\t\t\t\twriter.createPositionAt( commonParent, range.start.path[ commonPath.length ] ),\n\t\t\t\twriter.createPositionAt( commonParent, range.end.path[ commonPath.length ] + 1 )\n\t\t\t);\n\t\t}\n\n\t\tconst howMany = flatSubtreeRange.end.offset - flatSubtreeRange.start.offset;\n\n\t\t// Clone the whole contents.\n\t\tfor ( const item of flatSubtreeRange.getItems( { shallow: true } ) ) {\n\t\t\tif ( item.is( 'textProxy' ) ) {\n\t\t\t\twriter.appendText( item.data, item.getAttributes(), frag );\n\t\t\t} else {\n\t\t\t\twriter.append( item._clone( true ), frag );\n\t\t\t}\n\t\t}\n\n\t\t// ## 2nd step\n\t\t//\n\t\t// If the original range wasn't flat, then we need to remove the excess nodes from the both ends of the cloned fragment.\n\t\t//\n\t\t// For example, for the range shown in the 1st step comment, we need to remove these pieces:\n\t\t//\n\t\t// [

y

][fir]st

se[cond]

\n\t\t//\n\t\t// So this will be the final copied content:\n\t\t//\n\t\t// st

se

\n\t\t//\n\t\t// In order to do that, we remove content from these two ranges:\n\t\t//\n\t\t// [

y

fir]st

se[cond

]\n\t\tif ( flatSubtreeRange != range ) {\n\t\t\t// Find the position of the original range in the cloned fragment.\n\t\t\tconst newRange = range._getTransformedByMove( flatSubtreeRange.start, writer.createPositionAt( frag, 0 ), howMany )[ 0 ];\n\n\t\t\tconst leftExcessRange = writer.createRange( writer.createPositionAt( frag, 0 ), newRange.start );\n\t\t\tconst rightExcessRange = writer.createRange( newRange.end, writer.createPositionAt( frag, 'end' ) );\n\n\t\t\tremoveRangeContent( rightExcessRange, writer );\n\t\t\tremoveRangeContent( leftExcessRange, writer );\n\t\t}\n\n\t\treturn frag;\n\t} );\n}\n\n// After https://github.com/ckeditor/ckeditor5-engine/issues/690 is fixed,\n// this function will, most likely, be able to rewritten using getMinimalFlatRanges().\nfunction removeRangeContent( range, writer ) {\n\tconst parentsToCheck = [];\n\n\tArray.from( range.getItems( { direction: 'backward' } ) )\n\t\t// We should better store ranges because text proxies will lose integrity\n\t\t// with the text nodes when we'll start removing content.\n\t\t.map( item => writer.createRangeOn( item ) )\n\t\t// Filter only these items which are fully contained in the passed range.\n\t\t//\n\t\t// E.g. for the following range: [

y

fir]st\n\t\t// the walker will return the entire element, when only the \"fir\" item inside it is fully contained.\n\t\t.filter( itemRange => {\n\t\t\t// We should be able to use Range.containsRange, but https://github.com/ckeditor/ckeditor5-engine/issues/691.\n\t\t\tconst contained =\n\t\t\t\t( itemRange.start.isAfter( range.start ) || itemRange.start.isEqual( range.start ) ) &&\n\t\t\t\t( itemRange.end.isBefore( range.end ) || itemRange.end.isEqual( range.end ) );\n\n\t\t\treturn contained;\n\t\t} )\n\t\t.forEach( itemRange => {\n\t\t\tparentsToCheck.push( itemRange.start.parent );\n\n\t\t\twriter.remove( itemRange );\n\t\t} );\n\n\t// Remove ancestors of the removed items if they turned to be empty now\n\t// (their whole content was contained in the range).\n\tparentsToCheck.forEach( parentToCheck => {\n\t\tlet parent = parentToCheck;\n\n\t\twhile ( parent.parent && parent.isEmpty ) {\n\t\t\tconst removeRange = writer.createRangeOn( parent );\n\n\t\t\tparent = parent.parent;\n\n\t\t\twriter.remove( removeRange );\n\t\t}\n\t} );\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/utils/selection-post-fixer\n */\n\nimport Range from '../range';\nimport Position from '../position';\n\n/**\n * Injects selection post-fixer to the model.\n *\n * The role of the selection post-fixer is to ensure that the selection is in a correct place\n * after a {@link module:engine/model/model~Model#change `change()`} block was executed.\n *\n * The correct position means that:\n *\n * * All collapsed selection ranges are in a place where the {@link module:engine/model/schema~Schema}\n * allows a `$text`.\n * * None of the selection's non-collapsed ranges crosses a {@link module:engine/model/schema~Schema#isLimit limit element}\n * boundary (a range must be rooted within one limit element).\n * * Only {@link module:engine/model/schema~Schema#isObject object elements} can be selected from the outside\n * (e.g. `[foo]` is invalid). This rule applies independently to both selection ends, so this\n * selection is correct: `f[oo]`.\n *\n * If the position is not correct, the post-fixer will automatically correct it.\n *\n * ## Fixing a non-collapsed selection\n *\n * See as an example a selection that starts in a P1 element and ends inside the text of a TD element\n * (`[` and `]` are range boundaries and `(l)` denotes an element defined as `isLimit=true`):\n *\n *\t\troot\n *\t\t |- element P1\n *\t\t | |- \"foo\" root\n *\t\t |- element TABLE (l) P1 TABLE P2\n *\t\t | |- element TR (l) f o[o TR TR b a r\n *\t\t | | |- element TD (l) TD TD\n *\t\t | | |- \"aaa\" a]a a b b b\n *\t\t | |- element TR (l)\n *\t\t | | |- element TD (l) ||\n *\t\t | | |- \"bbb\" ||\n *\t\t |- element P2 VV\n *\t\t | |- \"bar\"\n *\t\t root\n *\t\t P1 TABLE] P2\n *\t\t f o[o TR TR b a r\n *\t\t TD TD\n *\t\t a a a b b b\n *\n * In the example above, the TABLE, TR and TD are defined as `isLimit=true` in the schema. The range which is not contained within\n * a single limit element must be expanded to select the outermost limit element. The range end is inside the text node of the TD element.\n * As the TD element is a child of the TR and TABLE elements, where both are defined as `isLimit=true` in the schema, the range must be\n * expanded to select the whole TABLE element.\n *\n * **Note** If the selection contains multiple ranges, the method returns a minimal set of ranges that are not intersecting after expanding\n * them to select `isLimit=true` elements.\n *\n * @param {module:engine/model/model~Model} model\n */\nexport function injectSelectionPostFixer( model ) {\n\tmodel.document.registerPostFixer( writer => selectionPostFixer( writer, model ) );\n}\n\n// The selection post-fixer.\n//\n// @param {module:engine/model/writer~Writer} writer\n// @param {module:engine/model/model~Model} model\nfunction selectionPostFixer( writer, model ) {\n\tconst selection = model.document.selection;\n\tconst schema = model.schema;\n\n\tconst ranges = [];\n\n\tlet wasFixed = false;\n\n\tfor ( const modelRange of selection.getRanges() ) {\n\t\t// Go through all ranges in selection and try fixing each of them.\n\t\t// Those ranges might overlap but will be corrected later.\n\t\tconst correctedRange = tryFixingRange( modelRange, schema );\n\n\t\tif ( correctedRange ) {\n\t\t\tranges.push( correctedRange );\n\t\t\twasFixed = true;\n\t\t} else {\n\t\t\tranges.push( modelRange );\n\t\t}\n\t}\n\n\t// If any of ranges were corrected update the selection.\n\tif ( wasFixed ) {\n\t\t// The above algorithm might create ranges that intersects each other when selection contains more then one range.\n\t\t// This is case happens mostly on Firefox which creates multiple ranges for selected table.\n\t\tlet fixedRanges = ranges;\n\n\t\t// Fixing selection with many ranges usually breaks the selection in Firefox. As only Firefox supports multiple selection ranges\n\t\t// we simply create one continuous range from fixed selection ranges (even if they are not adjacent).\n\t\tif ( ranges.length > 1 ) {\n\t\t\tconst selectionStart = ranges[ 0 ].start;\n\t\t\tconst selectionEnd = ranges[ ranges.length - 1 ].end;\n\n\t\t\tfixedRanges = [ new Range( selectionStart, selectionEnd ) ];\n\t\t}\n\n\t\twriter.setSelection( fixedRanges, { backward: selection.isBackward } );\n\t}\n}\n\n// Tries fixing a range if it's incorrect.\n//\n// @param {module:engine/model/range~Range} range\n// @param {module:engine/model/schema~Schema} schema\n// @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.\nfunction tryFixingRange( range, schema ) {\n\tif ( range.isCollapsed ) {\n\t\treturn tryFixingCollapsedRange( range, schema );\n\t}\n\n\treturn tryFixingNonCollapsedRage( range, schema );\n}\n\n// Tries to fix collapsed ranges.\n//\n// * Fixes situation when a range is in a place where $text is not allowed\n//\n// @param {module:engine/model/range~Range} range Collapsed range to fix.\n// @param {module:engine/model/schema~Schema} schema\n// @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.\nfunction tryFixingCollapsedRange( range, schema ) {\n\tconst originalPosition = range.start;\n\n\tconst nearestSelectionRange = schema.getNearestSelectionRange( originalPosition );\n\n\t// This might be null ie when editor data is empty.\n\t// In such cases there is no need to fix the selection range.\n\tif ( !nearestSelectionRange ) {\n\t\treturn null;\n\t}\n\n\tconst fixedPosition = nearestSelectionRange.start;\n\n\t// Fixed position is the same as original - no need to return corrected range.\n\tif ( originalPosition.isEqual( fixedPosition ) ) {\n\t\treturn null;\n\t}\n\n\t// Check single node selection (happens in tables).\n\tif ( fixedPosition.nodeAfter && schema.isLimit( fixedPosition.nodeAfter ) ) {\n\t\treturn new Range( fixedPosition, Position._createAfter( fixedPosition.nodeAfter ) );\n\t}\n\n\treturn new Range( fixedPosition );\n}\n\n// Tries to fix an expanded range.\n//\n// @param {module:engine/model/range~Range} range Expanded range to fix.\n// @param {module:engine/model/schema~Schema} schema\n// @returns {module:engine/model/range~Range|null} Returns fixed range or null if range is valid.\nfunction tryFixingNonCollapsedRage( range, schema ) {\n\tconst start = range.start;\n\tconst end = range.end;\n\n\tconst isTextAllowedOnStart = schema.checkChild( start, '$text' );\n\tconst isTextAllowedOnEnd = schema.checkChild( end, '$text' );\n\n\tconst startLimitElement = schema.getLimitElement( start );\n\tconst endLimitElement = schema.getLimitElement( end );\n\n\t// Ranges which both end are inside the same limit element (or root) might needs only minor fix.\n\tif ( startLimitElement === endLimitElement ) {\n\t\t// Range is valid when both position allows to place a text:\n\t\t// - f[oobarba]z\n\t\t// This would be \"fixed\" by a next check but as it will be the same it's better to return null so the selection stays the same.\n\t\tif ( isTextAllowedOnStart && isTextAllowedOnEnd ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Range that is on non-limit element (or is partially) must be fixed so it is placed inside the block around $text:\n\t\t// - [foo] -> [foo]\n\t\t// - [foo] -> [foo]\n\t\t// - f[oo] -> f[oo]\n\t\t// - [foo] -> [foo]\n\t\tif ( checkSelectionOnNonLimitElements( start, end, schema ) ) {\n\t\t\tconst isStartObject = start.nodeAfter && schema.isObject( start.nodeAfter );\n\t\t\tconst fixedStart = isStartObject ? null : schema.getNearestSelectionRange( start, 'forward' );\n\n\t\t\tconst isEndObject = end.nodeBefore && schema.isObject( end.nodeBefore );\n\t\t\tconst fixedEnd = isEndObject ? null : schema.getNearestSelectionRange( end, 'backward' );\n\n\t\t\t// The schema.getNearestSelectionRange might return null - if that happens use original position.\n\t\t\tconst rangeStart = fixedStart ? fixedStart.start : start;\n\t\t\tconst rangeEnd = fixedEnd ? fixedEnd.start : end;\n\n\t\t\treturn new Range( rangeStart, rangeEnd );\n\t\t}\n\t}\n\n\tconst isStartInLimit = startLimitElement && !startLimitElement.is( 'rootElement' );\n\tconst isEndInLimit = endLimitElement && !endLimitElement.is( 'rootElement' );\n\n\t// At this point we eliminated valid positions on text nodes so if one of range positions is placed inside a limit element\n\t// then the range crossed limit element boundaries and needs to be fixed.\n\tif ( isStartInLimit || isEndInLimit ) {\n\t\tconst bothInSameParent = ( start.nodeAfter && end.nodeBefore ) && start.nodeAfter.parent === end.nodeBefore.parent;\n\n\t\tconst expandStart = isStartInLimit && ( !bothInSameParent || !isInObject( start.nodeAfter, schema ) );\n\t\tconst expandEnd = isEndInLimit && ( !bothInSameParent || !isInObject( end.nodeBefore, schema ) );\n\n\t\t// Although we've already found limit element on start/end positions we must find the outer-most limit element.\n\t\t// as limit elements might be nested directly inside (ie table > tableRow > tableCell).\n\t\tlet fixedStart = start;\n\t\tlet fixedEnd = end;\n\n\t\tif ( expandStart ) {\n\t\t\tfixedStart = Position._createBefore( findOutermostLimitAncestor( startLimitElement, schema ) );\n\t\t}\n\n\t\tif ( expandEnd ) {\n\t\t\tfixedEnd = Position._createAfter( findOutermostLimitAncestor( endLimitElement, schema ) );\n\t\t}\n\n\t\treturn new Range( fixedStart, fixedEnd );\n\t}\n\n\t// Range was not fixed at this point so it is valid - ie it was placed around limit element already.\n\treturn null;\n}\n\n// Finds the outer-most ancestor.\n//\n// @param {module:engine/model/node~Node} startingNode\n// @param {module:engine/model/schema~Schema} schema\n// @param {String} expandToDirection Direction of expansion - either 'start' or 'end' of the range.\n// @returns {module:engine/model/node~Node}\nfunction findOutermostLimitAncestor( startingNode, schema ) {\n\tlet isLimitNode = startingNode;\n\tlet parent = isLimitNode;\n\n\t// Find outer most isLimit block as such blocks might be nested (ie. in tables).\n\twhile ( schema.isLimit( parent ) && parent.parent ) {\n\t\tisLimitNode = parent;\n\t\tparent = parent.parent;\n\t}\n\n\treturn isLimitNode;\n}\n\n// Checks whether any of range boundaries is placed around non-limit elements.\n//\n// @param {module:engine/model/position~Position} start\n// @param {module:engine/model/position~Position} end\n// @param {module:engine/model/schema~Schema} schema\n// @returns {Boolean}\nfunction checkSelectionOnNonLimitElements( start, end, schema ) {\n\tconst startIsOnBlock = ( start.nodeAfter && !schema.isLimit( start.nodeAfter ) ) || schema.checkChild( start, '$text' );\n\tconst endIsOnBlock = ( end.nodeBefore && !schema.isLimit( end.nodeBefore ) ) || schema.checkChild( end, '$text' );\n\n\t// We should fix such selection when one of those nodes needs fixing.\n\treturn startIsOnBlock || endIsOnBlock;\n}\n\n// Checks if node exists and if it's an object.\n//\n// @param {module:engine/model/node~Node} node\n// @param {module:engine/model/schema~Schema} schema\n// @returns {Boolean}\nfunction isInObject( node, schema ) {\n\treturn node && schema.isObject( node );\n}\n\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/model/model\n */\n\nimport Batch from './batch';\nimport Writer from './writer';\nimport Schema from './schema';\nimport Document from './document';\nimport MarkerCollection from './markercollection';\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\nimport ModelElement from './element';\nimport ModelRange from './range';\nimport ModelPosition from './position';\nimport ModelSelection from './selection';\n\nimport insertContent from './utils/insertcontent';\nimport deleteContent from './utils/deletecontent';\nimport modifySelection from './utils/modifyselection';\nimport getSelectedContent from './utils/getselectedcontent';\nimport { injectSelectionPostFixer } from './utils/selection-post-fixer';\n\n/**\n * Editor's data model. Read about the model in the\n * {@glink framework/guides/architecture/editing-engine engine architecture guide}.\n *\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class Model {\n\tconstructor() {\n\t\t/**\n\t\t * Model's marker collection.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/markercollection~MarkerCollection}\n\t\t */\n\t\tthis.markers = new MarkerCollection();\n\n\t\t/**\n\t\t * Model's document.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/document~Document}\n\t\t */\n\t\tthis.document = new Document( this );\n\n\t\t/**\n\t\t * Model's schema.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/schema~Schema}\n\t\t */\n\t\tthis.schema = new Schema();\n\n\t\t/**\n\t\t * All callbacks added by {@link module:engine/model/model~Model#change} or\n\t\t * {@link module:engine/model/model~Model#enqueueChange} methods waiting to be executed.\n\t\t *\n\t\t * @private\n\t\t * @type {Array.}\n\t\t */\n\t\tthis._pendingChanges = [];\n\n\t\t/**\n\t\t * The last created and currently used writer instance.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/model/writer~Writer}\n\t\t */\n\t\tthis._currentWriter = null;\n\n\t\t[ 'insertContent', 'deleteContent', 'modifySelection', 'getSelectedContent', 'applyOperation' ]\n\t\t\t.forEach( methodName => this.decorate( methodName ) );\n\n\t\t// Adding operation validation with `highest` priority, so it is called before any other feature would like\n\t\t// to do anything with the operation. If the operation has incorrect parameters it should throw on the earliest occasion.\n\t\tthis.on( 'applyOperation', ( evt, args ) => {\n\t\t\tconst operation = args[ 0 ];\n\n\t\t\toperation._validate();\n\t\t}, { priority: 'highest' } );\n\n\t\t// Register some default abstract entities.\n\t\tthis.schema.register( '$root', {\n\t\t\tisLimit: true\n\t\t} );\n\t\tthis.schema.register( '$block', {\n\t\t\tallowIn: '$root',\n\t\t\tisBlock: true\n\t\t} );\n\t\tthis.schema.register( '$text', {\n\t\t\tallowIn: '$block',\n\t\t\tisInline: true\n\t\t} );\n\t\tthis.schema.register( '$clipboardHolder', {\n\t\t\tallowContentOf: '$root',\n\t\t\tisLimit: true\n\t\t} );\n\t\tthis.schema.extend( '$text', { allowIn: '$clipboardHolder' } );\n\n\t\t// Element needed by `upcastElementToMarker` converter.\n\t\t// This element temporarily represents marker bound during conversion process and is removed\n\t\t// at the end of conversion. `UpcastDispatcher` or at least `Conversion` class looks like a better for this\n\t\t// registration but both know nothing about Schema.\n\t\tthis.schema.register( '$marker', {\n\t\t\tallowIn: [ '$root', '$block' ]\n\t\t} );\n\n\t\tinjectSelectionPostFixer( this );\n\t}\n\n\t/**\n\t * The `change()` method is the primary way of changing the model. You should use it to modify all document nodes\n\t * (including detached nodes – i.e. nodes not added to the {@link module:engine/model/model~Model#document model document}),\n\t * the {@link module:engine/model/document~Document#selection document's selection}, and\n\t * {@link module:engine/model/model~Model#markers model markers}.\n\t *\n\t *\t\tmodel.change( writer => {\n\t *\t\t\twriter.insertText( 'foo', paragraph, 'end' );\n\t *\t\t} );\n\t *\n\t * All changes inside the change block use the same {@link module:engine/model/batch~Batch} so they are combined\n\t * into a single undo step.\n\t *\n\t *\t\tmodel.change( writer => {\n\t *\t\t\twriter.insertText( 'foo', paragraph, 'end' ); // foo.\n\t *\n\t *\t\t\tmodel.change( writer => {\n\t *\t\t\t\twriter.insertText( 'bar', paragraph, 'end' ); // foobar.\n\t *\t\t\t} );\n\t *\n\t * \t\t\twriter.insertText( 'bom', paragraph, 'end' ); // foobarbom.\n\t *\t\t} );\n\t *\n\t * The callback of the `change()` block is executed synchronously.\n\t *\n\t * You can also return a value from the change block.\n\t *\n\t *\t\tconst img = model.change( writer => {\n\t *\t\t\treturn writer.createElement( 'img' );\n\t *\t\t} );\n\t *\n\t * @see #enqueueChange\n\t * @param {Function} callback Callback function which may modify the model.\n\t * @returns {*} Value returned by the callback.\n\t */\n\tchange( callback ) {\n\t\tif ( this._pendingChanges.length === 0 ) {\n\t\t\t// If this is the outermost block, create a new batch and start `_runPendingChanges` execution flow.\n\t\t\tthis._pendingChanges.push( { batch: new Batch(), callback } );\n\n\t\t\treturn this._runPendingChanges()[ 0 ];\n\t\t} else {\n\t\t\t// If this is not the outermost block, just execute the callback.\n\t\t\treturn callback( this._currentWriter );\n\t\t}\n\t}\n\n\t/**\n\t * The `enqueueChange()` method performs similar task as the {@link #change `change()` method}, with two major differences.\n\t *\n\t * First, the callback of `enqueueChange()` is executed when all other enqueued changes are done. It might be executed\n\t * immediately if it is not nested in any other change block, but if it is nested in another (enqueue)change block,\n\t * it will be delayed and executed after the outermost block.\n\t *\n\t *\t\tmodel.change( writer => {\n\t *\t\t\tconsole.log( 1 );\n\t *\n\t *\t\t\tmodel.enqueueChange( writer => {\n\t *\t\t\t\tconsole.log( 2 );\n\t *\t\t\t} );\n\t *\n\t * \t\t\tconsole.log( 3 );\n\t *\t\t} ); // Will log: 1, 3, 2.\n\t *\n\t * Second, it lets you define the {@link module:engine/model/batch~Batch} into which you want to add your changes.\n\t * By default, a new batch is created. In the sample above, `change` and `enqueueChange` blocks use a different\n\t * batch (and different {@link module:engine/model/writer~Writer} since each of them operates on the separate batch).\n\t *\n\t * When using the `enqueueChange()` block you can also add some changes to the batch you used before.\n\t *\n\t *\t\tmodel.enqueueChange( batch, writer => {\n\t *\t\t\twriter.insertText( 'foo', paragraph, 'end' );\n\t *\t\t} );\n\t *\n\t * The batch instance can be obtained from {@link module:engine/model/writer~Writer#batch the writer}.\n\t *\n\t * @param {module:engine/model/batch~Batch|'transparent'|'default'} batchOrType Batch or batch type should be used in the callback.\n\t * If not defined, a new batch will be created.\n\t * @param {Function} callback Callback function which may modify the model.\n\t */\n\tenqueueChange( batchOrType, callback ) {\n\t\tif ( typeof batchOrType === 'string' ) {\n\t\t\tbatchOrType = new Batch( batchOrType );\n\t\t} else if ( typeof batchOrType == 'function' ) {\n\t\t\tcallback = batchOrType;\n\t\t\tbatchOrType = new Batch();\n\t\t}\n\n\t\tthis._pendingChanges.push( { batch: batchOrType, callback } );\n\n\t\tif ( this._pendingChanges.length == 1 ) {\n\t\t\tthis._runPendingChanges();\n\t\t}\n\t}\n\n\t/**\n\t * {@link module:utils/observablemixin~ObservableMixin#decorate Decorated} function for applying\n\t * {@link module:engine/model/operation/operation~Operation operations} to the model.\n\t *\n\t * This is a low-level way of changing the model. It is exposed for very specific use cases (like the undo feature).\n\t * Normally, to modify the model, you will want to use {@link module:engine/model/writer~Writer `Writer`}.\n\t * See also {@glink framework/guides/architecture/editing-engine#changing-the-model Changing the model} section\n\t * of the {@glink framework/guides/architecture/editing-engine Editing architecture} guide.\n\t *\n\t * @param {module:engine/model/operation/operation~Operation} operation The operation to apply.\n\t */\n\tapplyOperation( operation ) {\n\t\toperation._execute();\n\t}\n\n\t/**\n\t * Inserts content at the position in the editor specified by the selection, as one would expect the paste\n\t * functionality to work.\n\t *\n\t * This is a high-level method. It takes the {@link #schema schema} into consideration when inserting\n\t * the content, clears the given selection's content before inserting nodes and moves the selection\n\t * to its target position at the end of the process.\n\t * It can split elements, merge them, wrap bare text nodes with paragraphs, etc. — just like the\n\t * pasting feature should do.\n\t *\n\t * For lower-level methods see {@link module:engine/model/writer~Writer `Writer`}.\n\t *\n\t * This method, unlike {@link module:engine/model/writer~Writer `Writer`}'s methods, does not have to be used\n\t * inside a {@link #change `change()` block}.\n\t *\n\t * # Conversion and schema\n\t *\n\t * Inserting elements and text nodes into the model is not enough to make CKEditor 5 render that content\n\t * to the user. CKEditor 5 implements a model-view-controller architecture and what `model.insertContent()` does\n\t * is only adding nodes to the model. Additionally, you need to define\n\t * {@glink framework/guides/architecture/editing-engine#conversion converters} between the model and view\n\t * and define those nodes in the {@glink framework/guides/architecture/editing-engine#schema schema}.\n\t *\n\t * So, while this method may seem similar to CKEditor 4 `editor.insertHtml()` (in fact, both methods\n\t * are used for paste-like content insertion), the CKEditor 5 method cannot be use to insert arbitrary HTML\n\t * unless converters are defined for all elements and attributes in that HTML.\n\t *\n\t * # Examples\n\t *\n\t * Using `insertContent()` with a manually created model structure:\n\t *\n\t *\t\t// Let's create a document fragment containing such content as:\n\t *\t\t//\n\t *\t\t// foo\n\t *\t\t//
\n\t *\t\t// bar\n\t *\t\t//
\n\t *\t\tconst docFrag = editor.model.change( writer => {\n\t *\t\t\tconst p1 = writer.createElement( 'paragraph' );\n\t *\t\t\tconst p2 = writer.createElement( 'paragraph' );\n\t *\t\t\tconst blockQuote = writer.createElement( 'blockQuote' );\n\t *\t\t\tconst docFrag = writer.createDocumentFragment();\n\t *\n\t *\t\t\twriter.append( p1, docFrag );\n\t *\t\t\twriter.append( blockQuote, docFrag );\n\t *\t\t\twriter.append( p2, blockQuote );\n\t *\t\t\twriter.insertText( 'foo', p1 );\n\t *\t\t\twriter.insertText( 'bar', p2 );\n\t *\n\t *\t\t\treturn docFrag;\n\t *\t\t} );\n\t *\n\t *\t\t// insertContent() does not have to be used in a change() block. It can, though,\n\t *\t\t// so this code could be moved to the callback defined above.\n\t *\t\teditor.model.insertContent( docFrag );\n\t *\n\t * Using `insertContent()` with an HTML string converted to a model document fragment (similar to the pasting mechanism):\n\t *\n\t *\t\t// You can create your own HtmlDataProcessor instance or use editor.data.processor\n\t *\t\t// if you have not overridden the default one (which is the HtmlDataProcessor instance).\n\t *\t\tconst htmlDP = new HtmlDataProcessor();\n\t *\n\t *\t\t// Convert an HTML string to a view document fragment:\n\t *\t\tconst viewFragment = htmlDP.toView( htmlString );\n\t *\n\t *\t\t// Convert the view document fragment to a model document fragment\n\t *\t\t// in the context of $root. This conversion takes the schema into\n\t *\t\t// account so if, for example, the view document fragment contained a bare text node,\n\t *\t\t// this text node cannot be a child of $root, so it will be automatically\n\t *\t\t// wrapped with a . You can define the context yourself (in the second parameter),\n\t *\t\t// and e.g. convert the content like it would happen in a .\n\t *\t\t// Note: The clipboard feature uses a custom context called $clipboardHolder\n\t *\t\t// which has a loosened schema.\n\t *\t\tconst modelFragment = editor.data.toModel( viewFragment );\n\t *\n\t *\t\teditor.model.insertContent( modelFragment );\n\t *\n\t * By default this method will use the document selection but it can also be used with a position, range or selection instance.\n\t *\n\t *\t\t// Insert text at the current document selection position.\n\t *\t\teditor.model.change( writer => {\n\t *\t\t\teditor.model.insertContent( writer.createText( 'x' ) );\n\t *\t\t} );\n\t *\n\t *\t\t// Insert text at a given position - the document selection will not be modified.\n\t *\t\teditor.model.change( writer => {\n\t *\t\t\teditor.model.insertContent( writer.createText( 'x' ), doc.getRoot(), 2 );\n\t *\n\t *\t\t\t// Which is a shorthand for:\n\t *\t\t\teditor.model.insertContent( writer.createText( 'x' ), writer.createPositionAt( doc.getRoot(), 2 ) );\n\t *\t\t} );\n\t *\n\t * If an instance of {@link module:engine/model/selection~Selection} is passed as `selectable`\n\t * it will be moved to the target position (where the document selection should be moved after the insertion).\n\t *\n\t *\t\teditor.model.change( writer => {\n\t *\t\t\t// Insert text replacing the given selection instance.\n\t *\t\t\tconst selection = writer.createSelection( paragraph, 'in' );\n\t *\n\t *\t\t\teditor.model.insertContent( writer.createText( 'x' ), selection );\n\t *\n\t *\t\t\t// insertContent() modifies the passed selection instance so it can be used to set the document selection.\n\t *\t\t\t// Note: This is not necessary when you passed the document selection to insertContent().\n\t *\t\t\twriter.setSelection( selection );\n\t *\t\t} );\n\t *\n\t * @fires insertContent\n\t * @param {module:engine/model/documentfragment~DocumentFragment|module:engine/model/item~Item} content The content to insert.\n\t * @param {module:engine/model/selection~Selectable} [selectable=model.document.selection]\n\t * The selection into which the content should be inserted. If not provided the current model document selection will be used.\n\t * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] To be used when a model item was passed as `selectable`.\n\t * This param defines a position in relation to that item.\n\t */\n\tinsertContent( content, selectable, placeOrOffset ) {\n\t\tinsertContent( this, content, selectable, placeOrOffset );\n\t}\n\n\t/**\n\t * Deletes content of the selection and merge siblings. The resulting selection is always collapsed.\n\t *\n\t * **Note:** For the sake of predictability, the resulting selection should always be collapsed.\n\t * In cases where a feature wants to modify deleting behavior so selection isn't collapsed\n\t * (e.g. a table feature may want to keep row selection after pressing Backspace),\n\t * then that behavior should be implemented in the view's listener. At the same time, the table feature\n\t * will need to modify this method's behavior too, e.g. to \"delete contents and then collapse\n\t * the selection inside the last selected cell\" or \"delete the row and collapse selection somewhere near\".\n\t * That needs to be done in order to ensure that other features which use `deleteContent()` will work well with tables.\n\t *\n\t * @fires deleteContent\n\t * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n\t * Selection of which the content should be deleted.\n\t * @param {Object} [options]\n\t * @param {Boolean} [options.leaveUnmerged=false] Whether to merge elements after removing the content of the selection.\n\t *\n\t * For example `x[xy]y` will become:\n\t *\n\t * * `x^y` with the option disabled (`leaveUnmerged == false`)\n\t * * `x^y` with enabled (`leaveUnmerged == true`).\n\t *\n\t * Note: {@link module:engine/model/schema~Schema#isObject object} and {@link module:engine/model/schema~Schema#isLimit limit}\n\t * elements will not be merged.\n\t *\n\t * @param {Boolean} [options.doNotResetEntireContent=false] Whether to skip replacing the entire content with a\n\t * paragraph when the entire content was selected.\n\t *\n\t * For example `[xy]` will become:\n\t *\n\t * * `^` with the option disabled (`doNotResetEntireContent == false`)\n\t * * `^` with enabled (`doNotResetEntireContent == true`)\n\t */\n\tdeleteContent( selection, options ) {\n\t\tdeleteContent( this, selection, options );\n\t}\n\n\t/**\n\t * Modifies the selection. Currently, the supported modifications are:\n\t *\n\t * * Extending. The selection focus is moved in the specified `options.direction` with a step specified in `options.unit`.\n\t * Possible values for `unit` are:\n\t * * `'character'` (default) - moves selection by one user-perceived character. In most cases this means moving by one\n\t * character in `String` sense. However, unicode also defines \"combing marks\". These are special symbols, that combines\n\t * with a symbol before it (\"base character\") to create one user-perceived character. For example, `q̣̇` is a normal\n\t * letter `q` with two \"combining marks\": upper dot (`Ux0307`) and lower dot (`Ux0323`). For most actions, i.e. extending\n\t * selection by one position, it is correct to include both \"base character\" and all of it's \"combining marks\". That is\n\t * why `'character'` value is most natural and common method of modifying selection.\n\t * * `'codePoint'` - moves selection by one unicode code point. In contrary to, `'character'` unit, this will insert\n\t * selection between \"base character\" and \"combining mark\", because \"combining marks\" have their own unicode code points.\n\t * However, for technical reasons, unicode code points with values above `UxFFFF` are represented in native `String` by\n\t * two characters, called \"surrogate pairs\". Halves of \"surrogate pairs\" have a meaning only when placed next to each other.\n\t * For example `𨭎` is represented in `String` by `\\uD862\\uDF4E`. Both `\\uD862` and `\\uDF4E` do not have any meaning\n\t * outside the pair (are rendered as ? when alone). Position between them would be incorrect. In this case, selection\n\t * extension will include whole \"surrogate pair\".\n\t * * `'word'` - moves selection by a whole word.\n\t *\n\t * **Note:** if you extend a forward selection in a backward direction you will in fact shrink it.\n\t *\n\t * @fires modifySelection\n\t * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n\t * The selection to modify.\n\t * @param {Object} [options]\n\t * @param {'forward'|'backward'} [options.direction='forward'] The direction in which the selection should be modified.\n\t * @param {'character'|'codePoint'|'word'} [options.unit='character'] The unit by which selection should be modified.\n\t */\n\tmodifySelection( selection, options ) {\n\t\tmodifySelection( this, selection, options );\n\t}\n\n\t/**\n\t * Gets a clone of the selected content.\n\t *\n\t * For example, for the following selection:\n\t *\n\t * ```html\n\t * x\n\t *
\n\t *\ty\n\t *\tfir[st\n\t *
\n\t * se]cond\n\t * z\n\t * ```\n\t *\n\t * It will return a document fragment with such a content:\n\t *\n\t * ```html\n\t *
\n\t *\tst\n\t *
\n\t * se\n\t * ```\n\t *\n\t * @fires getSelectedContent\n\t * @param {module:engine/model/selection~Selection|module:engine/model/documentselection~DocumentSelection} selection\n\t * The selection of which content will be returned.\n\t * @returns {module:engine/model/documentfragment~DocumentFragment}\n\t */\n\tgetSelectedContent( selection ) {\n\t\treturn getSelectedContent( this, selection );\n\t}\n\n\t/**\n\t * Checks whether the given {@link module:engine/model/range~Range range} or\n\t * {@link module:engine/model/element~Element element} has any meaningful content.\n\t *\n\t * Meaningful content is:\n\t *\n\t * * any text node (`options.ignoreWhitespaces` allows controlling whether this text node must also contain\n\t * any non-whitespace characters),\n\t * * or any {@link module:engine/model/schema~Schema#isObject object element},\n\t * * or any {@link module:engine/model/markercollection~Marker marker} which\n\t * {@link module:engine/model/markercollection~Marker#_affectsData affects data}.\n\t *\n\t * This means that a range containing an empty `` is not considered to have a meaningful content.\n\t * However, a range containing an `` (which would normally be marked in the schema as an object element)\n\t * is considered non-empty.\n\t *\n\t * @param {module:engine/model/range~Range|module:engine/model/element~Element} rangeOrElement Range or element to check.\n\t * @param {Object} [options]\n\t * @param {Boolean} [options.ignoreWhitespaces] Whether text node with whitespaces only should be considered empty.\n\t * @returns {Boolean}\n\t */\n\thasContent( rangeOrElement, options ) {\n\t\tconst range = rangeOrElement instanceof ModelElement ? ModelRange._createIn( rangeOrElement ) : rangeOrElement;\n\n\t\tif ( range.isCollapsed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check if there are any markers which affects data in this given range.\n\t\tfor ( const intersectingMarker of this.markers.getMarkersIntersectingRange( range ) ) {\n\t\t\tif ( intersectingMarker.affectsData ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tconst { ignoreWhitespaces = false } = options || {};\n\n\t\tfor ( const item of range.getItems() ) {\n\t\t\tif ( item.is( 'textProxy' ) ) {\n\t\t\t\tif ( !ignoreWhitespaces ) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else if ( item.data.search( /\\S/ ) !== -1 ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t} else if ( this.schema.isObject( item ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\t/**\n\t * Creates a position from the given root and path in that root.\n\t *\n\t * Note: This method is also available as\n\t * {@link module:engine/model/writer~Writer#createPositionFromPath `Writer#createPositionFromPath()`}.\n\t *\n\t * @param {module:engine/model/element~Element|module:engine/model/documentfragment~DocumentFragment} root Root of the position.\n\t * @param {Array.} path Position path. See {@link module:engine/model/position~Position#path}.\n\t * @param {module:engine/model/position~PositionStickiness} [stickiness='toNone'] Position stickiness.\n\t * See {@link module:engine/model/position~PositionStickiness}.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tcreatePositionFromPath( root, path, stickiness ) {\n\t\treturn new ModelPosition( root, path, stickiness );\n\t}\n\n\t/**\n\t * Creates position at the given location. The location can be specified as:\n\t *\n\t * * a {@link module:engine/model/position~Position position},\n\t * * a parent element and offset in that element,\n\t * * a parent element and `'end'` (the position will be set at the end of that element),\n\t * * a {@link module:engine/model/item~Item model item} and `'before'` or `'after'`\n\t * (the position will be set before or after the given model item).\n\t *\n\t * This method is a shortcut to other factory methods such as:\n\t *\n\t * * {@link module:engine/model/model~Model#createPositionBefore `createPositionBefore()`},\n\t * * {@link module:engine/model/model~Model#createPositionAfter `createPositionAfter()`}.\n\t *\n\t * Note: This method is also available as\n\t * {@link module:engine/model/writer~Writer#createPositionAt `Writer#createPositionAt()`},\n\t *\n\t * @param {module:engine/model/item~Item|module:engine/model/position~Position} itemOrPosition\n\t * @param {Number|'end'|'before'|'after'} [offset] Offset or one of the flags. Used only when\n\t * first parameter is a {@link module:engine/model/item~Item model item}.\n\t */\n\tcreatePositionAt( itemOrPosition, offset ) {\n\t\treturn ModelPosition._createAt( itemOrPosition, offset );\n\t}\n\n\t/**\n\t * Creates a new position after the given {@link module:engine/model/item~Item model item}.\n\t *\n\t * Note: This method is also available as\n\t * {@link module:engine/model/writer~Writer#createPositionAfter `Writer#createPositionAfter()`}.\n\t *\n\t * @param {module:engine/model/item~Item} item Item after which the position should be placed.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tcreatePositionAfter( item ) {\n\t\treturn ModelPosition._createAfter( item );\n\t}\n\n\t/**\n\t * Creates a new position before the given {@link module:engine/model/item~Item model item}.\n\t *\n\t * Note: This method is also available as\n\t * {@link module:engine/model/writer~Writer#createPositionBefore `Writer#createPositionBefore()`}.\n\t *\n\t * @param {module:engine/model/item~Item} item Item before which the position should be placed.\n\t * @returns {module:engine/model/position~Position}\n\t */\n\tcreatePositionBefore( item ) {\n\t\treturn ModelPosition._createBefore( item );\n\t}\n\n\t/**\n\t * Creates a range spanning from the `start` position to the `end` position.\n\t *\n\t * Note: This method is also available as\n\t * {@link module:engine/model/writer~Writer#createRange `Writer#createRange()`}:\n\t *\n\t *\t\tmodel.change( writer => {\n\t *\t\t\tconst range = writer.createRange( start, end );\n\t *\t\t} );\n\t *\n\t * @param {module:engine/model/position~Position} start Start position.\n\t * @param {module:engine/model/position~Position} [end] End position. If not set, the range will be collapsed\n\t * to the `start` position.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tcreateRange( start, end ) {\n\t\treturn new ModelRange( start, end );\n\t}\n\n\t/**\n\t * Creates a range inside the given element which starts before the first child of\n\t * that element and ends after the last child of that element.\n\t *\n\t * Note: This method is also available as\n\t * {@link module:engine/model/writer~Writer#createRangeIn `Writer#createRangeIn()`}:\n\t *\n\t *\t\tmodel.change( writer => {\n\t *\t\t\tconst range = writer.createRangeIn( paragraph );\n\t *\t\t} );\n\t *\n\t * @param {module:engine/model/element~Element} element Element which is a parent for the range.\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tcreateRangeIn( element ) {\n\t\treturn ModelRange._createIn( element );\n\t}\n\n\t/**\n\t * Creates a range that starts before the given {@link module:engine/model/item~Item model item} and ends after it.\n\t *\n\t * Note: This method is also available on `writer` instance as\n\t * {@link module:engine/model/writer~Writer#createRangeOn `Writer.createRangeOn()`}:\n\t *\n\t *\t\tmodel.change( writer => {\n\t *\t\t\tconst range = writer.createRangeOn( paragraph );\n\t *\t\t} );\n\t *\n\t * @param {module:engine/model/item~Item} item\n\t * @returns {module:engine/model/range~Range}\n\t */\n\tcreateRangeOn( item ) {\n\t\treturn ModelRange._createOn( item );\n\t}\n\n\t/**\n\t * Creates a new selection instance based on the given {@link module:engine/model/selection~Selectable selectable}\n\t * or creates an empty selection if no arguments were passed.\n\t *\n\t * Note: This method is also available as\n\t * {@link module:engine/model/writer~Writer#createSelection `Writer#createSelection()`}.\n\t *\n\t *\t\t// Creates empty selection without ranges.\n\t *\t\tconst selection = writer.createSelection();\n\t *\n\t *\t\t// Creates selection at the given range.\n\t *\t\tconst range = writer.createRange( start, end );\n\t *\t\tconst selection = writer.createSelection( range );\n\t *\n\t *\t\t// Creates selection at the given ranges\n\t *\t\tconst ranges = [ writer.createRange( start1, end2 ), writer.createRange( star2, end2 ) ];\n\t *\t\tconst selection = writer.createSelection( ranges );\n\t *\n\t *\t\t// Creates selection from the other selection.\n\t *\t\t// Note: It doesn't copies selection attributes.\n\t *\t\tconst otherSelection = writer.createSelection();\n\t *\t\tconst selection = writer.createSelection( otherSelection );\n\t *\n\t *\t\t// Creates selection from the given document selection.\n\t *\t\t// Note: It doesn't copies selection attributes.\n\t *\t\tconst documentSelection = model.document.selection;\n\t *\t\tconst selection = writer.createSelection( documentSelection );\n\t *\n\t *\t\t// Creates selection at the given position.\n\t *\t\tconst position = writer.createPositionFromPath( root, path );\n\t *\t\tconst selection = writer.createSelection( position );\n\t *\n\t *\t\t// Creates selection at the given offset in the given element.\n\t *\t\tconst paragraph = writer.createElement( 'paragraph' );\n\t *\t\tconst selection = writer.createSelection( paragraph, offset );\n\t *\n\t *\t\t// Creates a range inside an {@link module:engine/model/element~Element element} which starts before the\n\t *\t\t// first child of that element and ends after the last child of that element.\n\t *\t\tconst selection = writer.createSelection( paragraph, 'in' );\n\t *\n\t *\t\t// Creates a range on an {@link module:engine/model/item~Item item} which starts before the item and ends\n\t *\t\t// just after the item.\n\t *\t\tconst selection = writer.createSelection( paragraph, 'on' );\n\t *\n\t *\t\t// Additional options (`'backward'`) can be specified as the last argument.\n\t *\n\t *\t\t// Creates backward selection.\n\t *\t\tconst selection = writer.createSelection( range, { backward: true } );\n\t *\n\t * @param {module:engine/model/selection~Selectable} selectable\n\t * @param {Number|'before'|'end'|'after'|'on'|'in'} [placeOrOffset] Sets place or offset of the selection.\n\t * @param {Object} [options]\n\t * @param {Boolean} [options.backward] Sets this selection instance to be backward.\n\t * @returns {module:engine/model/selection~Selection}\n\t */\n\tcreateSelection( selectable, placeOrOffset, options ) {\n\t\treturn new ModelSelection( selectable, placeOrOffset, options );\n\t}\n\n\t/**\n\t * Creates a {@link module:engine/model/batch~Batch} instance.\n\t *\n\t * **Note:** In most cases creating a batch instance is not necessary as they are created when using:\n\t *\n\t * * {@link #change `change()`},\n\t * * {@link #enqueueChange `enqueueChange()`}.\n\t *\n\t * @returns {module:engine/model/batch~Batch}\n\t */\n\tcreateBatch() {\n\t\treturn new Batch();\n\t}\n\n\t/**\n\t * Removes all events listeners set by model instance and destroys {@link module:engine/model/document~Document}.\n\t */\n\tdestroy() {\n\t\tthis.document.destroy();\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Common part of {@link module:engine/model/model~Model#change} and {@link module:engine/model/model~Model#enqueueChange}\n\t * which calls callbacks and returns array of values returned by these callbacks.\n\t *\n\t * @private\n\t * @returns {Array.<*>} Array of values returned by callbacks.\n\t */\n\t_runPendingChanges() {\n\t\tconst ret = [];\n\n\t\tthis.fire( '_beforeChanges' );\n\n\t\twhile ( this._pendingChanges.length ) {\n\t\t\t// Create a new writer using batch instance created for this chain of changes.\n\t\t\tconst currentBatch = this._pendingChanges[ 0 ].batch;\n\t\t\tthis._currentWriter = new Writer( this, currentBatch );\n\n\t\t\t// Execute changes callback and gather the returned value.\n\t\t\tconst callbackReturnValue = this._pendingChanges[ 0 ].callback( this._currentWriter );\n\t\t\tret.push( callbackReturnValue );\n\n\t\t\t// Fire '_change' event before resetting differ.\n\t\t\tthis.fire( '_change', this._currentWriter );\n\n\t\t\tthis.document._handleChangeBlock( this._currentWriter );\n\n\t\t\tthis._pendingChanges.shift();\n\t\t\tthis._currentWriter = null;\n\t\t}\n\n\t\tthis.fire( '_afterChanges' );\n\n\t\treturn ret;\n\t}\n\n\t/**\n\t * Fired after leaving each {@link module:engine/model/model~Model#enqueueChange} block or outermost\n\t * {@link module:engine/model/model~Model#change} block.\n\t *\n\t * **Note:** This is an internal event! Use {@link module:engine/model/document~Document#event:change} instead.\n\t *\n\t * @deprecated\n\t * @protected\n\t * @event _change\n\t * @param {module:engine/model/writer~Writer} writer `Writer` instance that has been used in the change block.\n\t */\n\n\t/**\n\t * Fired when entering the outermost {@link module:engine/model/model~Model#enqueueChange} or\n\t * {@link module:engine/model/model~Model#change} block.\n\t *\n\t * @protected\n\t * @event _beforeChanges\n\t */\n\n\t/**\n\t * Fired when leaving the outermost {@link module:engine/model/model~Model#enqueueChange} or\n\t * {@link module:engine/model/model~Model#change} block.\n\t *\n\t * @protected\n\t * @event _afterChanges\n\t */\n\n\t/**\n\t * Fired every time any {@link module:engine/model/operation/operation~Operation operation} is applied on the model\n\t * using {@link #applyOperation}.\n\t *\n\t * Note that this event is suitable only for very specific use-cases. Use it if you need to listen to every single operation\n\t * applied on the document. However, in most cases {@link module:engine/model/document~Document#event:change} should\n\t * be used.\n\t *\n\t * A few callbacks are already added to this event by engine internal classes:\n\t *\n\t * * with `highest` priority operation is validated,\n\t * * with `normal` priority operation is executed,\n\t * * with `low` priority the {@link module:engine/model/document~Document} updates its version,\n\t * * with `low` priority {@link module:engine/model/liveposition~LivePosition} and {@link module:engine/model/liverange~LiveRange}\n\t * update themselves.\n\t *\n\t * @event applyOperation\n\t * @param {Array} args Arguments of the `applyOperation` which is an array with a single element - applied\n\t * {@link module:engine/model/operation/operation~Operation operation}.\n\t */\n\n\t/**\n\t * Event fired when {@link #insertContent} method is called.\n\t *\n\t * The {@link #insertContent default action of that method} is implemented as a\n\t * listener to this event so it can be fully customized by the features.\n\t *\n\t * **Note** The `selectable` parameter for the {@link #insertContent} is optional. When `undefined` value is passed the method uses\n\t * `model.document.selection`.\n\t *\n\t * @event insertContent\n\t * @param {Array} args The arguments passed to the original method.\n\t */\n\n\t/**\n\t * Event fired when {@link #deleteContent} method is called.\n\t *\n\t * The {@link #deleteContent default action of that method} is implemented as a\n\t * listener to this event so it can be fully customized by the features.\n\t *\n\t * @event deleteContent\n\t * @param {Array} args The arguments passed to the original method.\n\t */\n\n\t/**\n\t * Event fired when {@link #modifySelection} method is called.\n\t *\n\t * The {@link #modifySelection default action of that method} is implemented as a\n\t * listener to this event so it can be fully customized by the features.\n\t *\n\t * @event modifySelection\n\t * @param {Array} args The arguments passed to the original method.\n\t */\n\n\t/**\n\t * Event fired when {@link #getSelectedContent} method is called.\n\t *\n\t * The {@link #getSelectedContent default action of that method} is implemented as a\n\t * listener to this event so it can be fully customized by the features.\n\t *\n\t * @event getSelectedContent\n\t * @param {Array} args The arguments passed to the original method.\n\t */\n}\n\nmix( Model, ObservableMixin );\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/keystrokehandler\n */\n\nimport DomEmitterMixin from './dom/emittermixin';\nimport { getCode, parseKeystroke } from './keyboard';\n\n/**\n * Keystroke handler allows registering callbacks for given keystrokes.\n *\n * The most frequent use of this class is through the {@link module:core/editor/editor~Editor#keystrokes `editor.keystrokes`}\n * property. It allows listening to keystrokes executed in the editing view:\n *\n *\t\teditor.keystrokes.set( 'Ctrl+A', ( keyEvtData, cancel ) => {\n *\t\t\tconsole.log( 'Ctrl+A has been pressed' );\n *\t\t\tcancel();\n *\t\t} );\n *\n * However, this utility class can be used in various part of the UI. For instance, a certain {@link module:ui/view~View}\n * can use it like this:\n *\n *\t\tclass MyView extends View {\n *\t\t\tconstructor() {\n *\t\t\t\tthis.keystrokes = new KeystrokeHandler();\n *\n * \t\t\t\tthis.keystrokes.set( 'tab', handleTabKey );\n *\t\t\t}\n *\n *\t\t\trender() {\n *\t\t\t\tsuper.render();\n *\n *\t\t\t\tthis.keystrokes.listenTo( this.element );\n *\t\t\t}\n *\t\t}\n *\n * That keystroke handler will listen to `keydown` events fired in this view's main element.\n *\n */\nexport default class KeystrokeHandler {\n\t/**\n\t * Creates an instance of the keystroke handler.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * Listener used to listen to events for easier keystroke handler destruction.\n\t\t *\n\t\t * @protected\n\t\t * @member {module:utils/dom/emittermixin~Emitter}\n\t\t */\n\t\tthis._listener = Object.create( DomEmitterMixin );\n\t}\n\n\t/**\n\t * Starts listening for `keydown` events from a given emitter.\n\t *\n\t * @param {module:utils/emittermixin~Emitter} emitter\n\t */\n\tlistenTo( emitter ) {\n\t\t// The #_listener works here as a kind of dispatcher. It groups the events coming from the same\n\t\t// keystroke so the listeners can be attached to them with different priorities.\n\t\t//\n\t\t// E.g. all the keystrokes with the `keyCode` of 42 coming from the `emitter` are propagated\n\t\t// as a `_keydown:42` event by the `_listener`. If there's a callback created by the `set`\n\t\t// method for this 42 keystroke, it listens to the `_listener#_keydown:42` event only and interacts\n\t\t// only with other listeners of this particular event, thus making it possible to prioritize\n\t\t// the listeners and safely cancel execution, when needed. Instead of duplicating the Emitter logic,\n\t\t// the KeystrokeHandler re–uses it to do its job.\n\t\tthis._listener.listenTo( emitter, 'keydown', ( evt, keyEvtData ) => {\n\t\t\tthis._listener.fire( '_keydown:' + getCode( keyEvtData ), keyEvtData );\n\t\t} );\n\t}\n\n\t/**\n\t * Registers a handler for the specified keystroke.\n\t *\n\t * @param {String|Array.} keystroke Keystroke defined in a format accepted by\n\t * the {@link module:utils/keyboard~parseKeystroke} function.\n\t * @param {Function} callback A function called with the\n\t * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and\n\t * a helper funcion to call both `preventDefault()` and `stopPropagation()` on the underlying event.\n\t * @param {Object} [options={}] Additional options.\n\t * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke\n\t * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority\n\t * are called in the order they were added.\n\t */\n\tset( keystroke, callback, options = {} ) {\n\t\tconst keyCode = parseKeystroke( keystroke );\n\t\tconst priority = options.priority;\n\n\t\t// Execute the passed callback on KeystrokeHandler#_keydown.\n\t\t// TODO: https://github.com/ckeditor/ckeditor5-utils/issues/144\n\t\tthis._listener.listenTo( this._listener, '_keydown:' + keyCode, ( evt, keyEvtData ) => {\n\t\t\tcallback( keyEvtData, () => {\n\t\t\t\t// Stop the event in the DOM: no listener in the web page\n\t\t\t\t// will be triggered by this event.\n\t\t\t\tkeyEvtData.preventDefault();\n\t\t\t\tkeyEvtData.stopPropagation();\n\n\t\t\t\t// Stop the event in the KeystrokeHandler: no more callbacks\n\t\t\t\t// will be executed for this keystroke.\n\t\t\t\tevt.stop();\n\t\t\t} );\n\n\t\t\t// Mark this keystroke as handled by the callback. See: #press.\n\t\t\tevt.return = true;\n\t\t}, { priority } );\n\t}\n\n\t/**\n\t * Triggers a keystroke handler for a specified key combination, if such a keystroke was {@link #set defined}.\n\t *\n\t * @param {module:engine/view/observer/keyobserver~KeyEventData} keyEvtData Key event data.\n\t * @returns {Boolean} Whether the keystroke was handled.\n\t */\n\tpress( keyEvtData ) {\n\t\treturn !!this._listener.fire( '_keydown:' + getCode( keyEvtData ), keyEvtData );\n\t}\n\n\t/**\n\t * Destroys the keystroke handler.\n\t */\n\tdestroy() {\n\t\tthis._listener.stopListening();\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/editingkeystrokehandler\n */\n\nimport KeystrokeHandler from '@ckeditor/ckeditor5-utils/src/keystrokehandler';\n\n/**\n * A keystroke handler for editor editing. Its instance is available\n * in {@link module:core/editor/editor~Editor#keystrokes} so plugins\n * can register their keystrokes.\n *\n * E.g. an undo plugin would do this:\n *\n *\t\teditor.keystrokes.set( 'Ctrl+Z', 'undo' );\n *\t\teditor.keystrokes.set( 'Ctrl+Shift+Z', 'redo' );\n *\t\teditor.keystrokes.set( 'Ctrl+Y', 'redo' );\n *\n * @extends utils/keystrokehandler~KeystrokeHandler\n */\nexport default class EditingKeystrokeHandler extends KeystrokeHandler {\n\t/**\n\t * Creates an instance of the keystroke handler.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor\n\t */\n\tconstructor( editor ) {\n\t\tsuper();\n\n\t\t/**\n\t\t * The editor instance.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:core/editor/editor~Editor}\n\t\t */\n\t\tthis.editor = editor;\n\t}\n\n\t/**\n\t * Registers a handler for the specified keystroke.\n\t *\n\t * The handler can be specified as a command name or a callback.\n\t *\n\t * @param {String|Array.} keystroke Keystroke defined in a format accepted by\n\t * the {@link module:utils/keyboard~parseKeystroke} function.\n\t * @param {Function|String} callback If a string is passed, then the keystroke will\n\t * {@link module:core/editor/editor~Editor#execute execute a command}.\n\t * If a function, then it will be called with the\n\t * {@link module:engine/view/observer/keyobserver~KeyEventData key event data} object and\n\t * a `cancel()` helper to both `preventDefault()` and `stopPropagation()` of the event.\n\t * @param {Object} [options={}] Additional options.\n\t * @param {module:utils/priorities~PriorityString|Number} [options.priority='normal'] The priority of the keystroke\n\t * callback. The higher the priority value the sooner the callback will be executed. Keystrokes having the same priority\n\t * are called in the order they were added.\n\t */\n\tset( keystroke, callback, options = {} ) {\n\t\tif ( typeof callback == 'string' ) {\n\t\t\tconst commandName = callback;\n\n\t\t\tcallback = ( evtData, cancel ) => {\n\t\t\t\tthis.editor.execute( commandName );\n\t\t\t\tcancel();\n\t\t\t};\n\t\t}\n\n\t\tsuper.set( keystroke, callback, options );\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/editor/editor\n */\n\nimport Config from '@ckeditor/ckeditor5-utils/src/config';\nimport EditingController from '@ckeditor/ckeditor5-engine/src/controller/editingcontroller';\nimport PluginCollection from '../plugincollection';\nimport CommandCollection from '../commandcollection';\nimport Locale from '@ckeditor/ckeditor5-utils/src/locale';\nimport DataController from '@ckeditor/ckeditor5-engine/src/controller/datacontroller';\nimport Conversion from '@ckeditor/ckeditor5-engine/src/conversion/conversion';\nimport Model from '@ckeditor/ckeditor5-engine/src/model/model';\nimport EditingKeystrokeHandler from '../editingkeystrokehandler';\n\nimport ObservableMixin from '@ckeditor/ckeditor5-utils/src/observablemixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\nimport '@ckeditor/ckeditor5-utils/src/version';\n\n/**\n * Class representing a basic, generic editor.\n *\n * Check out the list of its subclasses to learn about specific editor implementations.\n *\n * All editor implementations (like {@link module:editor-classic/classiceditor~ClassicEditor} or\n * {@link module:editor-inline/inlineeditor~InlineEditor}) should extend this class. They can add their\n * own methods and properties.\n *\n * When you are implementing a plugin, then this editor represents the API\n * which your plugin can expect to get when using its {@link module:core/plugin~Plugin#editor} property.\n *\n * This API should be sufficient in order to implement the \"editing\" part of your feature\n * (schema definition, conversion, commands, keystrokes, etc.).\n * It does not define the editor UI, which is available only if the\n * the specific editor implements also the {@link module:core/editor/editorwithui~EditorWithUI} interface\n * (as most editor implementations do).\n *\n * @abstract\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class Editor {\n\t/**\n\t * Creates a new instance of the Editor class.\n\t *\n\t * Usually, not to be used directly. See the static {@link module:core/editor/editor~Editor.create `create()`} method.\n\t *\n\t * @param {Object} [config] The editor config.\n\t */\n\tconstructor( config ) {\n\t\tconst availablePlugins = this.constructor.builtinPlugins;\n\n\t\t/**\n\t\t * Holds all configurations specific to this editor instance.\n\t\t *\n\t\t *\t\teditor.config.get( 'image.toolbar' );\n\t\t *\t\t// -> [ 'imageStyle:full', 'imageStyle:side', '|', 'imageTextAlternative' ]\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:utils/config~Config}\n\t\t */\n\t\tthis.config = new Config( config, this.constructor.defaultConfig );\n\n\t\tthis.config.define( 'plugins', availablePlugins );\n\n\t\t/**\n\t\t * The plugins loaded and in use by this editor instance.\n\t\t *\n\t\t *\t\teditor.plugins.get( 'Clipboard' ); // -> instance of the Clipboard plugin.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:core/plugincollection~PluginCollection}\n\t\t */\n\t\tthis.plugins = new PluginCollection( this, availablePlugins );\n\n\t\t/**\n\t\t * Commands registered to the editor.\n\t\t *\n\t\t * Use the shorthand {@link #execute `editor.execute()`} method to execute commands:\n\t\t *\n\t\t *\t\t// Execute the bold command:\n\t\t *\t\teditor.execute( 'bold' );\n\t\t *\n\t\t *\t\t// Check the state of the bold command:\n\t\t *\t\teditor.commands.get( 'bold' ).value;\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:core/commandcollection~CommandCollection}\n\t\t */\n\t\tthis.commands = new CommandCollection();\n\n\t\t/**\n\t\t * @readonly\n\t\t * @member {module:utils/locale~Locale}\n\t\t */\n\t\tthis.locale = new Locale( this.config.get( 'language' ) );\n\n\t\t/**\n\t\t * Shorthand for {@link module:utils/locale~Locale#t}.\n\t\t *\n\t\t * @see module:utils/locale~Locale#t\n\t\t * @method #t\n\t\t */\n\t\tthis.t = this.locale.t;\n\n\t\t/**\n\t\t * Indicates the editor life-cycle state.\n\t\t *\n\t\t * The editor is in one of the following states:\n\t\t *\n\t\t * * `initializing` - during the editor initialization (before {@link module:core/editor/editor~Editor.create `Editor.create()`})\n\t\t * finished its job,\n\t\t * * `ready` - after the promise returned by the {@link module:core/editor/editor~Editor.create `Editor.create()`}\n\t\t * method is resolved,\n\t\t * * `destroyed` - once the {@link #destroy `editor.destroy()`} method was called.\n\t\t *\n\t\t * @observable\n\t\t * @member {'initializing'|'ready'|'destroyed'} #state\n\t\t */\n\t\tthis.set( 'state', 'initializing' );\n\t\tthis.once( 'ready', () => ( this.state = 'ready' ), { priority: 'high' } );\n\t\tthis.once( 'destroy', () => ( this.state = 'destroyed' ), { priority: 'high' } );\n\n\t\t/**\n\t\t * Defines whether this editor is in read-only mode.\n\t\t *\n\t\t * In read-only mode the editor {@link #commands commands} are disabled so it is not possible\n\t\t * to modify the document by using them. Also, the editable element(s) become non-editable.\n\t\t *\n\t\t * In order to make the editor read-only, you can set this value directly:\n\t\t *\n\t\t *\t\teditor.isReadOnly = true;\n\t\t *\n\t\t * @observable\n\t\t * @member {Boolean} #isReadOnly\n\t\t */\n\t\tthis.set( 'isReadOnly', false );\n\n\t\t/**\n\t\t * The editor's model.\n\t\t *\n\t\t * The central point of the editor's abstract data model.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/model/model~Model}\n\t\t */\n\t\tthis.model = new Model();\n\n\t\t/**\n\t\t * The {@link module:engine/controller/datacontroller~DataController data controller}.\n\t\t * Used e.g. for setting and retrieving editor data.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/controller/datacontroller~DataController}\n\t\t */\n\t\tthis.data = new DataController( this.model );\n\n\t\t/**\n\t\t * The {@link module:engine/controller/editingcontroller~EditingController editing controller}.\n\t\t * Controls user input and rendering the content for editing.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/controller/editingcontroller~EditingController}\n\t\t */\n\t\tthis.editing = new EditingController( this.model );\n\t\tthis.editing.view.document.bind( 'isReadOnly' ).to( this );\n\n\t\t/**\n\t\t * Conversion manager through which you can register model to view and view to model converters.\n\t\t *\n\t\t * See {@link module:engine/conversion/conversion~Conversion}'s documentation to learn how to add converters.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:engine/conversion/conversion~Conversion}\n\t\t */\n\t\tthis.conversion = new Conversion( [ this.editing.downcastDispatcher, this.data.downcastDispatcher ], this.data.upcastDispatcher );\n\t\tthis.conversion.addAlias( 'dataDowncast', this.data.downcastDispatcher );\n\t\tthis.conversion.addAlias( 'editingDowncast', this.editing.downcastDispatcher );\n\n\t\t/**\n\t\t * Instance of the {@link module:core/editingkeystrokehandler~EditingKeystrokeHandler}.\n\t\t *\n\t\t * It allows setting simple keystrokes:\n\t\t *\n\t\t *\t\t// Execute the bold command on Ctrl+E:\n\t\t *\t\teditor.keystrokes.set( 'Ctrl+E', 'bold' );\n\t\t *\n\t\t *\t\t// Execute your own callback:\n\t\t *\t\teditor.keystrokes.set( 'Ctrl+E', ( data, cancel ) => {\n\t\t *\t\t\tconsole.log( data.keyCode );\n\t\t *\n\t\t *\t\t\t// Prevent default (native) action and stop the underlying keydown event\n\t\t *\t\t\t// so no other editor feature will interfere.\n\t\t *\t\t\tcancel();\n\t\t *\t\t} );\n\t\t *\n\t\t * Note: Certain, typing oriented keystrokes (like Backspace or Enter) are handled\n\t\t * by low level mechanism and trying to listen to them via the keystroke handler will not work reliably.\n\t\t * To handle those specific keystrokes see the events fired by the\n\t\t * {@link module:engine/view/document~Document editing view document} (`editor.editing.view.document`).\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:core/editingkeystrokehandler~EditingKeystrokeHandler}\n\t\t */\n\t\tthis.keystrokes = new EditingKeystrokeHandler( this );\n\t\tthis.keystrokes.listenTo( this.editing.view.document );\n\t}\n\n\t/**\n\t * Loads and initializes plugins specified in the config.\n\t *\n\t * @returns {Promise.} A promise which resolves\n\t * once the initialization is completed providing an array of loaded plugins.\n\t */\n\tinitPlugins() {\n\t\tconst config = this.config;\n\t\tconst plugins = config.get( 'plugins' ) || [];\n\t\tconst removePlugins = config.get( 'removePlugins' ) || [];\n\t\tconst extraPlugins = config.get( 'extraPlugins' ) || [];\n\n\t\treturn this.plugins.init( plugins.concat( extraPlugins ), removePlugins );\n\t}\n\n\t/**\n\t * Destroys the editor instance, releasing all resources used by it.\n\t *\n\t * **Note** The editor cannot be destroyed during the initialization phase so if it is called\n\t * while the editor {@link #state is being initialized}, it will wait for the editor initialization before destroying it.\n\t *\n\t * @fires destroy\n\t * @returns {Promise} A promise that resolves once the editor instance is fully destroyed.\n\t */\n\tdestroy() {\n\t\tlet readyPromise = Promise.resolve();\n\n\t\tif ( this.state == 'initializing' ) {\n\t\t\treadyPromise = new Promise( resolve => this.once( 'ready', resolve ) );\n\t\t}\n\n\t\treturn readyPromise\n\t\t\t.then( () => {\n\t\t\t\tthis.fire( 'destroy' );\n\t\t\t\tthis.stopListening();\n\t\t\t\tthis.commands.destroy();\n\t\t\t} )\n\t\t\t.then( () => this.plugins.destroy() )\n\t\t\t.then( () => {\n\t\t\t\tthis.model.destroy();\n\t\t\t\tthis.data.destroy();\n\t\t\t\tthis.editing.destroy();\n\t\t\t\tthis.keystrokes.destroy();\n\t\t\t} );\n\t}\n\n\t/**\n\t * Executes specified command with given parameters.\n\t *\n\t * Shorthand for:\n\t *\n\t *\t\teditor.commands.get( commandName ).execute( ... );\n\t *\n\t * @param {String} commandName Name of command to execute.\n\t * @param {*} [...commandParams] Command parameters.\n\t */\n\texecute( ...args ) {\n\t\tthis.commands.execute( ...args );\n\t}\n\n\t/**\n\t * Creates and initializes a new editor instance.\n\t *\n\t * This is an abstract method. Every editor type needs to implement its own initialization logic.\n\t *\n\t * See the `create()` methods of the existing editor types to learn how to use them:\n\t *\n\t * * {@link module:editor-classic/classiceditor~ClassicEditor.create `ClassicEditor.create()`}\n\t * * {@link module:editor-balloon/ballooneditor~BalloonEditor.create `BalloonEditor.create()`}\n\t * * {@link module:editor-decoupled/decouplededitor~DecoupledEditor.create `DecoupledEditor.create()`}\n\t * * {@link module:editor-inline/inlineeditor~InlineEditor.create `InlineEditor.create()`}\n\t *\n\t * @abstract\n\t * @method module:core/editor/editor~Editor.create\n\t */\n}\n\nmix( Editor, ObservableMixin );\n\n/**\n * Fired when {@link module:engine/controller/datacontroller~DataController#event:ready data} and all additional\n * editor components are ready.\n *\n * Note: This event is most useful for plugin developers. When integrating the editor with your website or\n * application you do not have to listen to `editor#ready` because when the promise returned by the static\n * {@link module:core/editor/editor~Editor.create `Editor.create()`} event is resolved, the editor is already ready.\n * In fact, since the first moment when the editor instance is available to you is inside `then()`'s callback,\n * you cannot even add a listener to the `editor#ready` event.\n *\n * See also the {@link #state `editor.state`} property.\n *\n * @event ready\n */\n\n/**\n * Fired when this editor instance is destroyed. The editor at this point is not usable and this event should be used to\n * perform the clean-up in any plugin.\n *\n *\n * See also the {@link #state `editor.state`} property.\n *\n * @event destroy\n */\n\n/**\n * An array of plugins built into this editor class.\n * It is used in CKEditor 5 builds to provide a list of plugins which are later automatically initialized\n * during the editor initialization.\n *\n * They will be automatically initialized by the editor, unless listed in `config.removePlugins` and\n * unless `config.plugins` is passed.\n *\n *\t\t// Build some plugins into the editor class first.\n *\t\tClassicEditor.builtinPlugins = [ FooPlugin, BarPlugin ];\n *\n *\t\t// Normally, you need to define config.plugins, but since ClassicEditor.builtinPlugins was\n *\t\t// defined, now you can call create() without any configuration.\n *\t\tClassicEditor\n *\t\t\t.create( sourceElement )\n *\t\t\t.then( editor => {\n *\t\t\t\teditor.plugins.get( FooPlugin ); // -> instance of the Foo plugin\n *\t\t\t\teditor.plugins.get( BarPlugin ); // -> instance of the Bar plugin\n *\t\t\t} );\n *\n *\t\tClassicEditor\n *\t\t\t.create( sourceElement, {\n *\t\t\t\t// Don't initialize this plugins (note: it's defined by a string):\n *\t\t\t\tremovePlugins: [ 'Foo' ]\n *\t\t\t} )\n *\t\t\t.then( editor => {\n *\t\t\t\teditor.plugins.get( FooPlugin ); // -> undefined\n *\t\t\t\teditor.config.get( BarPlugin ); // -> instance of the Bar plugin\n *\t\t\t} );\n *\n *\t\tClassicEditor\n *\t\t\t.create( sourceElement, {\n *\t\t\t\t// Load only this plugin. Can also be define by a string if\n *\t\t\t\t// this plugin was built into the editor class.\n *\t\t\t\tplugins: [ FooPlugin ]\n *\t\t\t} )\n *\t\t\t.then( editor => {\n *\t\t\t\teditor.plugins.get( FooPlugin ); // -> instance of the Foo plugin\n *\t\t\t\teditor.config.get( BarPlugin ); // -> undefined\n *\t\t\t} );\n *\n * See also {@link module:core/editor/editor~Editor.defaultConfig}.\n *\n * @static\n * @member {Array.} module:core/editor/editor~Editor.builtinPlugins\n */\n\n/**\n * The default config which is built into the editor class.\n * It is used in CKEditor 5 builds to provide the default config options which are later used during editor initialization.\n *\n *\t\tClassicEditor.defaultConfig = {\n *\t\t\tfoo: 1,\n *\t\t\tbar: 2\n *\t\t};\n *\n *\t\tClassicEditor\n *\t\t\t.create( sourceElement )\n *\t\t\t.then( editor => {\n *\t\t\t\teditor.config.get( 'foo' ); // -> 1\n *\t\t\t\teditor.config.get( 'bar' ); // -> 2\n *\t\t\t} );\n *\n *\t\t// The default options can be overridden by the config passed to create().\n *\t\tClassicEditor\n *\t\t\t.create( sourceElement, { bar: 3 } )\n *\t\t\t.then( editor => {\n *\t\t\t\teditor.config.get( 'foo' ); // -> 1\n *\t\t\t\teditor.config.get( 'bar' ); // -> 3\n *\t\t\t} );\n *\n * See also {@link module:core/editor/editor~Editor.builtinPlugins}.\n *\n * @static\n * @member {Object} module:core/editor/editor~Editor.defaultConfig\n */\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/editor/utils/dataapimixin\n */\n\n/**\n * Implementation of the {@link module:core/editor/utils/dataapimixin~DataApi}.\n *\n * @mixin DataApiMixin\n * @implements module:core/editor/utils/dataapimixin~DataApi\n */\nconst DataApiMixin = {\n\t/**\n\t * @inheritDoc\n\t */\n\tsetData( data ) {\n\t\tthis.data.set( data );\n\t},\n\n\t/**\n\t * @inheritDoc\n\t */\n\tgetData( options ) {\n\t\treturn this.data.get( options );\n\t}\n};\n\nexport default DataApiMixin;\n\n/**\n * Interface defining editor methods for setting and getting data to and from the editor's main root element\n * using the {@link module:core/editor/editor~Editor#data data pipeline}.\n *\n * This interface is not a part of the {@link module:core/editor/editor~Editor} class because one may want to implement\n * an editor with multiple root elements, in which case the methods for setting and getting data will need to be implemented\n * differently.\n *\n * @interface DataApi\n */\n\n/**\n * Sets the data in the editor.\n *\n *\t\teditor.setData( '

This is editor!

' );\n *\n * By default the editor accepts HTML. This can be controlled by injecting a different data processor.\n * See the {@glink features/markdown Markdown output} guide for more details.\n *\n * Note: Not only is the format of the data configurable, but the type of the `setData()`'s parameter does not\n * have to be a string either. You can e.g. accept an object or a DOM `DocumentFragment` if you consider this\n * the right format for you.\n *\n * @method #setData\n * @param {String} data Input data.\n */\n\n/**\n * Gets the data from the editor.\n *\n *\t\teditor.getData(); // -> '

This is editor!

'\n *\n * By default the editor outputs HTML. This can be controlled by injecting a different data processor.\n * See the {@glink features/markdown Markdown output} guide for more details.\n *\n * Note: Not only is the format of the data configurable, but the type of the `getData()`'s return value does not\n * have to be a string either. You can e.g. return an object or a DOM `DocumentFragment` if you consider this\n * the right format for you.\n *\n * @method #getData\n * @param {Object} [options]\n * @param {String} [options.rootName='main'] Root name.\n * @param {String} [options.trim='empty'] Whether returned data should be trimmed. This option is set to `'empty'` by default,\n * which means that whenever editor content is considered empty, an empty string is returned. To turn off trimming\n * use `'none'`. In such cases exact content will be returned (for example `'

 

'` for an empty editor).\n * @returns {String} Output data.\n */\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\nimport setDataInElement from '@ckeditor/ckeditor5-utils/src/dom/setdatainelement';\n\n/**\n * @module core/editor/utils/elementapimixin\n */\n\n/**\n * Implementation of the {@link module:core/editor/utils/elementapimixin~ElementApi}.\n *\n * @mixin ElementApiMixin\n * @implements module:core/editor/utils/elementapimixin~ElementApi\n */\nconst ElementApiMixin = {\n\t/**\n\t * @inheritDoc\n\t */\n\tupdateSourceElement() {\n\t\tif ( !this.sourceElement ) {\n\t\t\t/**\n\t\t\t * Cannot update the source element of a detached editor.\n\t\t\t *\n\t\t\t * The {@link ~ElementApi#updateSourceElement `updateSourceElement()`} method cannot be called if you did not\n\t\t\t * pass an element to `Editor.create()`.\n\t\t\t *\n\t\t\t * @error editor-missing-sourceelement\n\t\t\t */\n\t\t\tthrow new CKEditorError( 'editor-missing-sourceelement: Cannot update the source element of a detached editor.' );\n\t\t}\n\n\t\tsetDataInElement( this.sourceElement, this.data.get() );\n\t}\n};\n\nexport default ElementApiMixin;\n\n/**\n * Interface describing an editor that replaced a DOM element (was \"initialized on an element\").\n *\n * Such an editor should provide a method to\n * {@link module:core/editor/utils/elementapimixin~ElementApi#updateSourceElement update the replaced element with the current data}.\n *\n * @interface ElementApi\n */\n\n/**\n * The element on which the editor has been initialized.\n *\n * @readonly\n * @member {HTMLElement} #sourceElement\n */\n\n/**\n * Updates the {@link #sourceElement editor source element}'s content with the data.\n *\n * @method #updateSourceElement\n */\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/dom/setdatainelement\n */\n\n/* globals HTMLTextAreaElement */\n\n/**\n * Sets data in a given element.\n *\n * @param {HTMLElement} el The element in which the data will be set.\n * @param {String} data The data string.\n */\nexport default function setDataInElement( el, data ) {\n\tif ( el instanceof HTMLTextAreaElement ) {\n\t\tel.value = data;\n\t}\n\n\tel.innerHTML = data;\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/dataprocessor/basichtmlwriter\n */\n\n/* globals document */\n\n/**\n * Basic HTML writer. It uses the native `innerHTML` property for basic conversion\n * from a document fragment to an HTML string.\n *\n * @implements module:engine/dataprocessor/htmlwriter~HtmlWriter\n */\nexport default class BasicHtmlWriter {\n\t/**\n\t * Returns an HTML string created from the document fragment.\n\t *\n\t * @param {DocumentFragment} fragment\n\t * @returns {String}\n\t */\n\tgetHtml( fragment ) {\n\t\tconst doc = document.implementation.createHTMLDocument( '' );\n\t\tconst container = doc.createElement( 'div' );\n\t\tcontainer.appendChild( fragment );\n\n\t\treturn container.innerHTML;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/dataprocessor/htmldataprocessor\n */\n\n/* globals document, DOMParser */\n\nimport BasicHtmlWriter from './basichtmlwriter';\nimport DomConverter from '../view/domconverter';\nimport { NBSP_FILLER } from '../view/filler';\n\n/**\n * The HTML data processor class.\n * This data processor implementation uses HTML as input and output data.\n *\n * @implements module:engine/dataprocessor/dataprocessor~DataProcessor\n */\nexport default class HtmlDataProcessor {\n\t/**\n\t * Creates a new instance of the HTML data processor class.\n\t */\n\tconstructor() {\n\t\t/**\n\t\t * A DOM parser instance used to parse an HTML string to an HTML document.\n\t\t *\n\t\t * @private\n\t\t * @member {DOMParser}\n\t\t */\n\t\tthis._domParser = new DOMParser();\n\n\t\t/**\n\t\t * A DOM converter used to convert DOM elements to view elements.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/view/domconverter~DomConverter}\n\t\t */\n\t\tthis._domConverter = new DomConverter( { blockFiller: NBSP_FILLER } );\n\n\t\t/**\n\t\t * A basic HTML writer instance used to convert DOM elements to an HTML string.\n\t\t *\n\t\t * @private\n\t\t * @member {module:engine/dataprocessor/basichtmlwriter~BasicHtmlWriter}\n\t\t */\n\t\tthis._htmlWriter = new BasicHtmlWriter();\n\t}\n\n\t/**\n\t * Converts a provided {@link module:engine/view/documentfragment~DocumentFragment document fragment}\n\t * to data format — in this case to an HTML string.\n\t *\n\t * @param {module:engine/view/documentfragment~DocumentFragment} viewFragment\n\t * @returns {String} HTML string.\n\t */\n\ttoData( viewFragment ) {\n\t\t// Convert view DocumentFragment to DOM DocumentFragment.\n\t\tconst domFragment = this._domConverter.viewToDom( viewFragment, document );\n\n\t\t// Convert DOM DocumentFragment to HTML output.\n\t\treturn this._htmlWriter.getHtml( domFragment );\n\t}\n\n\t/**\n\t * Converts the provided HTML string to a view tree.\n\t *\n\t * @param {String} data An HTML string.\n\t * @returns {module:engine/view/node~Node|module:engine/view/documentfragment~DocumentFragment|null} A converted view element.\n\t */\n\ttoView( data ) {\n\t\t// Convert input HTML data to DOM DocumentFragment.\n\t\tconst domFragment = this._toDom( data );\n\n\t\t// Convert DOM DocumentFragment to view DocumentFragment.\n\t\treturn this._domConverter.domToView( domFragment );\n\t}\n\n\t/**\n\t * Converts an HTML string to its DOM representation. Returns a document fragment containing nodes parsed from\n\t * the provided data.\n\t *\n\t * @private\n\t * @param {String} data\n\t * @returns {DocumentFragment}\n\t */\n\t_toDom( data ) {\n\t\tconst document = this._domParser.parseFromString( data, 'text/html' );\n\t\tconst fragment = document.createDocumentFragment();\n\t\tconst nodes = document.body.childNodes;\n\n\t\twhile ( nodes.length > 0 ) {\n\t\t\tfragment.appendChild( nodes[ 0 ] );\n\t\t}\n\n\t\treturn fragment;\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module ui/componentfactory\n */\n\nimport CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';\n\n/**\n * A helper class implementing the UI component ({@link module:ui/view~View view}) factory.\n *\n * It allows functions producing specific UI components to be registered under their unique names\n * in the factory. A registered component can be then instantiated by providing its name.\n * Note that names are case insensitive.\n *\n *\t\t// The editor provides localization tools for the factory.\n *\t\tconst factory = new ComponentFactory( editor );\n *\n *\t\tfactory.add( 'foo', locale => new FooView( locale ) );\n *\t\tfactory.add( 'bar', locale => new BarView( locale ) );\n *\n *\t\t// An instance of FooView.\n *\t\tconst fooInstance = factory.create( 'foo' );\n *\n *\t\t// Names are case insensitive so this is also allowed:\n *\t\tconst barInstance = factory.create( 'Bar' );\n *\n * The {@link module:core/editor/editor~Editor#locale editor locale} is passed to the factory\n * function when {@link module:ui/componentfactory~ComponentFactory#create} is called.\n */\nexport default class ComponentFactory {\n\t/**\n\t * Creates an instance of the factory.\n\t *\n\t * @constructor\n\t * @param {module:core/editor/editor~Editor} editor The editor instance.\n\t */\n\tconstructor( editor ) {\n\t\t/**\n\t\t * The editor instance that the factory belongs to.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:core/editor/editor~Editor}\n\t\t */\n\t\tthis.editor = editor;\n\n\t\t/**\n\t\t * Registered component factories.\n\t\t *\n\t\t * @private\n\t\t * @member {Map}\n\t\t */\n\t\tthis._components = new Map();\n\t}\n\n\t/**\n\t * Returns an iterator of registered component names. Names are returned in lower case.\n\t *\n\t * @returns {Iterable.}\n\t */\n\t* names() {\n\t\tfor ( const value of this._components.values() ) {\n\t\t\tyield value.originalName;\n\t\t}\n\t}\n\n\t/**\n\t * Registers a component factory function that will be used by the\n\t * {@link #create create} method and called with the\n\t * {@link module:core/editor/editor~Editor#locale editor locale} as an argument,\n\t * allowing localization of the {@link module:ui/view~View view}.\n\t *\n\t * @param {String} name The name of the component.\n\t * @param {Function} callback The callback that returns the component.\n\t */\n\tadd( name, callback ) {\n\t\tif ( this.has( name ) ) {\n\t\t\t/**\n\t\t\t * The item already exists in the component factory.\n\t\t\t *\n\t\t\t * @error componentfactory-item-exists\n\t\t\t * @param {String} name The name of the component.\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'componentfactory-item-exists: The item already exists in the component factory.', { name }\n\t\t\t);\n\t\t}\n\n\t\tthis._components.set( getNormalized( name ), { callback, originalName: name } );\n\t}\n\n\t/**\n\t * Creates an instance of a component registered in the factory under a specific name.\n\t *\n\t * When called, the {@link module:core/editor/editor~Editor#locale editor locale} is passed to\n\t * the previously {@link #add added} factory function, allowing localization of the\n\t * {@link module:ui/view~View view}.\n\t *\n\t * @param {String} name The name of the component.\n\t * @returns {module:ui/view~View} The instantiated component view.\n\t */\n\tcreate( name ) {\n\t\tif ( !this.has( name ) ) {\n\t\t\t/**\n\t\t\t * The required component is not registered in the component factory. Please make sure\n\t\t\t * the provided name is correct and the component has been correctly\n\t\t\t * {@link #add added} to the factory.\n\t\t\t *\n\t\t\t * @error componentfactory-item-missing\n\t\t\t * @param {String} name The name of the missing component.\n\t\t\t */\n\t\t\tthrow new CKEditorError(\n\t\t\t\t'componentfactory-item-missing: The required component is not registered in the factory.', { name }\n\t\t\t);\n\t\t}\n\n\t\treturn this._components.get( getNormalized( name ) ).callback( this.editor.locale );\n\t}\n\n\t/**\n\t * Checks if a component of a given name is registered in the factory.\n\t *\n\t * @param {String} name The name of the component.\n\t * @returns {Boolean}\n\t */\n\thas( name ) {\n\t\treturn this._components.has( getNormalized( name ) );\n\t}\n}\n\n//\n// Ensures that the component name used as the key in the internal map is in lower case.\n//\n// @private\n// @param {String} name\n// @returns {String}\nfunction getNormalized( name ) {\n\treturn String( name ).toLowerCase();\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/* global setTimeout, clearTimeout */\n\n/**\n * @module utils/focustracker\n */\n\nimport DomEmitterMixin from './dom/emittermixin';\nimport ObservableMixin from './observablemixin';\nimport CKEditorError from './ckeditorerror';\nimport mix from './mix';\n\n/**\n * Allows observing a group of `HTMLElement`s whether at least one of them is focused.\n *\n * Used by the {@link module:core/editor/editor~Editor} in order to track whether the focus is still within the application,\n * or were used outside of its UI.\n *\n * **Note** `focus` and `blur` listeners use event capturing, so it is only needed to register wrapper `HTMLElement`\n * which contain other `focusable` elements. But note that this wrapper element has to be focusable too\n * (have e.g. `tabindex=\"-1\"`).\n *\n * @mixes module:utils/dom/emittermixin~EmitterMixin\n * @mixes module:utils/observablemixin~ObservableMixin\n */\nexport default class FocusTracker {\n\tconstructor() {\n\t\t/**\n\t\t * True when one of the registered elements is focused.\n\t\t *\n\t\t * @readonly\n\t\t * @observable\n\t\t * @member {Boolean} #isFocused\n\t\t */\n\t\tthis.set( 'isFocused', false );\n\n\t\t/**\n\t\t * Currently focused element.\n\t\t *\n\t\t * @readonly\n\t\t * @member {HTMLElement}\n\t\t */\n\t\tthis.focusedElement = null;\n\n\t\t/**\n\t\t * List of registered elements.\n\t\t *\n\t\t * @private\n\t\t * @member {Set.}\n\t\t */\n\t\tthis._elements = new Set();\n\n\t\t/**\n\t\t * Event loop timeout.\n\t\t *\n\t\t * @private\n\t\t * @member {Number}\n\t\t */\n\t\tthis._nextEventLoopTimeout = null;\n\t}\n\n\t/**\n\t * Starts tracking the specified element.\n\t *\n\t * @param {HTMLElement} element\n\t */\n\tadd( element ) {\n\t\tif ( this._elements.has( element ) ) {\n\t\t\tthrow new CKEditorError( 'focusTracker-add-element-already-exist' );\n\t\t}\n\n\t\tthis.listenTo( element, 'focus', () => this._focus( element ), { useCapture: true } );\n\t\tthis.listenTo( element, 'blur', () => this._blur(), { useCapture: true } );\n\t\tthis._elements.add( element );\n\t}\n\n\t/**\n\t * Stops tracking the specified element and stops listening on this element.\n\t *\n\t * @param {HTMLElement} element\n\t */\n\tremove( element ) {\n\t\tif ( element === this.focusedElement ) {\n\t\t\tthis._blur( element );\n\t\t}\n\n\t\tif ( this._elements.has( element ) ) {\n\t\t\tthis.stopListening( element );\n\t\t\tthis._elements.delete( element );\n\t\t}\n\t}\n\n\t/**\n\t * Destroys the focus tracker by:\n\t * - Disabling all event listeners attached to tracked elements.\n\t * - Removing all tracked elements that were previously added.\n\t */\n\tdestroy() {\n\t\tthis.stopListening();\n\t}\n\n\t/**\n\t * Stores currently focused element and set {#isFocused} as `true`.\n\t *\n\t * @private\n\t * @param {HTMLElement} element Element which has been focused.\n\t */\n\t_focus( element ) {\n\t\tclearTimeout( this._nextEventLoopTimeout );\n\n\t\tthis.focusedElement = element;\n\t\tthis.isFocused = true;\n\t}\n\n\t/**\n\t * Clears currently focused element and set {@link #isFocused} as `false`.\n\t * This method uses `setTimeout` to change order of fires `blur` and `focus` events.\n\t *\n\t * @private\n\t * @fires blur\n\t */\n\t_blur() {\n\t\tclearTimeout( this._nextEventLoopTimeout );\n\n\t\tthis._nextEventLoopTimeout = setTimeout( () => {\n\t\t\tthis.focusedElement = null;\n\t\t\tthis.isFocused = false;\n\t\t}, 0 );\n\t}\n\n\t/**\n\t * @event focus\n\t */\n\n\t/**\n\t * @event blur\n\t */\n}\n\nmix( FocusTracker, DomEmitterMixin );\nmix( FocusTracker, ObservableMixin );\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module core/editor/editorui\n */\n\nimport ComponentFactory from '@ckeditor/ckeditor5-ui/src/componentfactory';\nimport FocusTracker from '@ckeditor/ckeditor5-utils/src/focustracker';\n\nimport EmitterMixin from '@ckeditor/ckeditor5-utils/src/emittermixin';\nimport mix from '@ckeditor/ckeditor5-utils/src/mix';\n\n/**\n * A class providing the minimal interface that is required to successfully bootstrap any editor UI.\n *\n * @mixes module:utils/emittermixin~EmitterMixin\n */\nexport default class EditorUI {\n\t/**\n\t * Creates an instance of the editor UI class.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor The editor instance.\n\t */\n\tconstructor( editor ) {\n\t\t/**\n\t\t * The editor that the UI belongs to.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:core/editor/editor~Editor} #editor\n\t\t */\n\t\tthis.editor = editor;\n\n\t\t/**\n\t\t * An instance of the {@link module:ui/componentfactory~ComponentFactory}, a registry used by plugins\n\t\t * to register factories of specific UI components.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:ui/componentfactory~ComponentFactory} #componentFactory\n\t\t */\n\t\tthis.componentFactory = new ComponentFactory( editor );\n\n\t\t/**\n\t\t * Stores the information about the editor UI focus and propagates it so various plugins and components\n\t\t * are unified as a focus group.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:utils/focustracker~FocusTracker} #focusTracker\n\t\t */\n\t\tthis.focusTracker = new FocusTracker();\n\n\t\t/**\n\t\t * Stores all editable elements used by the editor instance.\n\t\t *\n\t\t * @protected\n\t\t * @member {Map.}\n\t\t */\n\t\tthis._editableElements = new Map();\n\n\t\t// Informs UI components that should be refreshed after layout change.\n\t\tthis.listenTo( editor.editing.view.document, 'layoutChanged', () => this.update() );\n\t}\n\n\t/**\n\t * The main (outermost) DOM element of the editor UI.\n\t *\n\t * For example, in {@link module:editor-classic/classiceditor~ClassicEditor} it is a `
` which\n\t * wraps the editable element and the toolbar. In {@link module:editor-inline/inlineeditor~InlineEditor}\n\t * it is the editable element itself (as there is no other wrapper). However, in\n\t * {@link module:editor-decoupled/decouplededitor~DecoupledEditor} it is set to `null` because this editor does not\n\t * come with a single \"main\" HTML element (its editable element and toolbar are separate).\n\t *\n\t * This property can be understood as a shorthand for retrieving the element that a specific editor integration\n\t * considers to be its main DOM element.\n\t *\n\t * @readonly\n\t * @member {HTMLElement|null} #element\n\t */\n\tget element() {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Fires the {@link module:core/editor/editorui~EditorUI#event:update `update`} event.\n\t *\n\t * This method should be called when the editor UI (e.g. positions of its balloons) needs to be updated due to\n\t * some environmental change which CKEditor 5 is not aware of (e.g. resize of a container in which it is used).\n\t */\n\tupdate() {\n\t\tthis.fire( 'update' );\n\t}\n\n\t/**\n\t * Destroys the UI.\n\t */\n\tdestroy() {\n\t\tthis.stopListening();\n\n\t\tthis.focusTracker.destroy();\n\n\t\tthis._editableElements = new Map();\n\t}\n\n\t/**\n\t * Returns the editable editor element with the given name or null if editable does not exist.\n\t *\n\t * @param {String} [rootName=main] The editable name.\n\t * @returns {HTMLElement|undefined}\n\t */\n\tgetEditableElement( rootName = 'main' ) {\n\t\treturn this._editableElements.get( rootName );\n\t}\n\n\t/**\n\t * Returns array of names of all editor editable elements.\n\t *\n\t * @returns {Iterable.}\n\t */\n\tgetEditableElementsNames() {\n\t\treturn this._editableElements.keys();\n\t}\n\n\t/**\n\t * Fired when the editor UI is ready.\n\t *\n\t * Fired before {@link module:engine/controller/datacontroller~DataController#event:ready}.\n\t *\n\t * @event ready\n\t */\n\n\t/**\n\t * Fired whenever the UI (all related components) should be refreshed.\n\t *\n\t * **Note:**: The event is fired after each {@link module:engine/view/document~Document#event:layoutChanged}.\n\t * It can also be fired manually via the {@link module:core/editor/editorui~EditorUI#update} method.\n\t *\n\t * @event update\n\t */\n}\n\nmix( EditorUI, EmitterMixin );\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module engine/view/placeholder\n */\n\nimport '../../theme/placeholder.css';\n\n// Each document stores information about its placeholder elements and check functions.\nconst documentPlaceholders = new WeakMap();\n\n/**\n * A helper that enables a placeholder on the provided view element (also updates its visibility).\n * The placeholder is a CSS pseudo–element (with a text content) attached to the element.\n *\n * To change the placeholder text, simply call this method again with new options.\n *\n * To disable the placeholder, use {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} helper.\n *\n * @param {Object} [options] Configuration options of the placeholder.\n * @param {module:engine/view/view~View} options.view Editing view instance.\n * @param {module:engine/view/element~Element} options.element Element that will gain a placeholder.\n * See `options.isDirectHost` to learn more.\n * @param {String} options.text Placeholder text.\n * @param {Boolean} [options.isDirectHost=true] If set `false`, the placeholder will not be enabled directly\n * in the passed `element` but in one of its children (selected automatically, i.e. a first empty child element).\n * Useful when attaching placeholders to elements that can host other elements (not just text), for instance,\n * editable root elements.\n */\nexport function enablePlaceholder( options ) {\n\tconst { view, element, text, isDirectHost = true } = options;\n\tconst doc = view.document;\n\n\t// Use a single a single post fixer per—document to update all placeholders.\n\tif ( !documentPlaceholders.has( doc ) ) {\n\t\tdocumentPlaceholders.set( doc, new Map() );\n\n\t\t// If a post-fixer callback makes a change, it should return `true` so other post–fixers\n\t\t// can re–evaluate the document again.\n\t\tdoc.registerPostFixer( writer => updateDocumentPlaceholders( doc, writer ) );\n\t}\n\n\t// Store information about the element placeholder under its document.\n\tdocumentPlaceholders.get( doc ).set( element, {\n\t\ttext,\n\t\tisDirectHost\n\t} );\n\n\t// Update the placeholders right away.\n\tview.change( writer => updateDocumentPlaceholders( doc, writer ) );\n}\n\n/**\n * Disables the placeholder functionality from a given element.\n *\n * See {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} to learn more.\n *\n * @param {module:engine/view/view~View} view\n * @param {module:engine/view/element~Element} element\n */\nexport function disablePlaceholder( view, element ) {\n\tconst doc = element.document;\n\n\tview.change( writer => {\n\t\tif ( !documentPlaceholders.has( doc ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst placeholders = documentPlaceholders.get( doc );\n\t\tconst config = placeholders.get( element );\n\n\t\twriter.removeAttribute( 'data-placeholder', config.hostElement );\n\t\thidePlaceholder( writer, config.hostElement );\n\n\t\tplaceholders.delete( element );\n\t} );\n}\n\n/**\n * Shows a placeholder in the provided element by changing related attributes and CSS classes.\n *\n * **Note**: This helper will not update the placeholder visibility nor manage the\n * it in any way in the future. What it does is a one–time state change of an element. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and\n * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full\n * placeholder functionality.\n *\n * **Note**: This helper will blindly show the placeholder directly in the root editable element if\n * one is passed, which could result in a visual clash if the editable element has some children\n * (for instance, an empty paragraph). Use {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`}\n * in that case or make sure the correct element is passed to the helper.\n *\n * @param {module:engine/view/downcastwriter~DowncastWriter} writer\n * @param {module:engine/view/element~Element} element\n * @returns {Boolean} `true`, if any changes were made to the `element`.\n */\nexport function showPlaceholder( writer, element ) {\n\tif ( !element.hasClass( 'ck-placeholder' ) ) {\n\t\twriter.addClass( 'ck-placeholder', element );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Hides a placeholder in the element by changing related attributes and CSS classes.\n *\n * **Note**: This helper will not update the placeholder visibility nor manage the\n * it in any way in the future. What it does is a one–time state change of an element. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} and\n * {@link module:engine/view/placeholder~disablePlaceholder `disablePlaceholder()`} for full\n * placeholder functionality.\n *\n * @param {module:engine/view/downcastwriter~DowncastWriter} writer\n * @param {module:engine/view/element~Element} element\n * @returns {Boolean} `true`, if any changes were made to the `element`.\n */\nexport function hidePlaceholder( writer, element ) {\n\tif ( element.hasClass( 'ck-placeholder' ) ) {\n\t\twriter.removeClass( 'ck-placeholder', element );\n\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n/**\n * Checks if a placeholder should be displayed in the element.\n *\n * **Note**: This helper will blindly check the possibility of showing a placeholder directly in the\n * root editable element if one is passed, which may not be the expected result. If an element can\n * host other elements (not just text), most likely one of its children should be checked instead\n * because it will be the final host for the placeholder. Use\n * {@link module:engine/view/placeholder~enablePlaceholder `enablePlaceholder()`} in that case or make\n * sure the correct element is passed to the helper.\n *\n * @param {module:engine/view/downcastwriter~DowncastWriter} writer\n * @param {module:engine/view/element~Element} element\n * @param {String} text\n * @returns {Boolean}\n */\nexport function needsPlaceholder( element ) {\n\tconst doc = element.document;\n\n\t// The element was removed from document.\n\tif ( !doc ) {\n\t\treturn false;\n\t}\n\n\t// The element is empty only as long as it contains nothing but uiElements.\n\tconst isEmptyish = !Array.from( element.getChildren() )\n\t\t.some( element => !element.is( 'uiElement' ) );\n\n\t// If the element is empty and the document is blurred.\n\tif ( !doc.isFocused && isEmptyish ) {\n\t\treturn true;\n\t}\n\n\tconst viewSelection = doc.selection;\n\tconst selectionAnchor = viewSelection.anchor;\n\n\t// If document is focused and the element is empty but the selection is not anchored inside it.\n\tif ( isEmptyish && selectionAnchor && selectionAnchor.parent !== element ) {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\n// Updates all placeholders associated with a document in a post–fixer callback.\n//\n// @private\n// @param { module:engine/model/document~Document} doc\n// @param {module:engine/view/downcastwriter~DowncastWriter} writer\n// @returns {Boolean} True if any changes were made to the view document.\nfunction updateDocumentPlaceholders( doc, writer ) {\n\tconst placeholders = documentPlaceholders.get( doc );\n\tlet wasViewModified = false;\n\n\tfor ( const [ element, config ] of placeholders ) {\n\t\tif ( updatePlaceholder( writer, element, config ) ) {\n\t\t\twasViewModified = true;\n\t\t}\n\t}\n\n\treturn wasViewModified;\n}\n\n// Updates a single placeholder in a post–fixer callback.\n//\n// @private\n// @param {module:engine/view/downcastwriter~DowncastWriter} writer\n// @param {module:engine/view/element~Element} element\n// @param {Object} config Configuration of the placeholder\n// @param {String} config.text\n// @param {Boolean} config.isDirectHost\n// @returns {Boolean} True if any changes were made to the view document.\nfunction updatePlaceholder( writer, element, config ) {\n\tconst { text, isDirectHost } = config;\n\tconst hostElement = isDirectHost ? element : getChildPlaceholderHostSubstitute( element );\n\tlet wasViewModified = false;\n\n\t// When not a direct host, it could happen that there is no child element\n\t// capable of displaying a placeholder.\n\tif ( !hostElement ) {\n\t\treturn false;\n\t}\n\n\t// Cache the host element. It will be necessary for disablePlaceholder() to know\n\t// which element should have class and attribute removed because, depending on\n\t// the config.isDirectHost value, it could be the element or one of its descendants.\n\tconfig.hostElement = hostElement;\n\n\t// This may be necessary when updating the placeholder text to something else.\n\tif ( hostElement.getAttribute( 'data-placeholder' ) !== text ) {\n\t\twriter.setAttribute( 'data-placeholder', text, hostElement );\n\t\twasViewModified = true;\n\t}\n\n\tif ( needsPlaceholder( hostElement ) ) {\n\t\tif ( showPlaceholder( writer, hostElement ) ) {\n\t\t\twasViewModified = true;\n\t\t}\n\t} else if ( hidePlaceholder( writer, hostElement ) ) {\n\t\twasViewModified = true;\n\t}\n\n\treturn wasViewModified;\n}\n\n// Gets a child element capable of displaying a placeholder if a parent element can host more\n// than just text (for instance, when it is a root editable element). The child element\n// can then be used in other placeholder helpers as a substitute of its parent.\n//\n// @private\n// @param {module:engine/view/element~Element} parent\n// @returns {module:engine/view/element~Element|null}\nfunction getChildPlaceholderHostSubstitute( parent ) {\n\tif ( parent.childCount === 1 ) {\n\t\tconst firstChild = parent.getChild( 0 );\n\n\t\tif ( firstChild.is( 'element' ) && !firstChild.is( 'uiElement' ) ) {\n\t\t\treturn firstChild;\n\t\t}\n\t}\n\n\treturn null;\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module utils/elementreplacer\n */\n\n/**\n * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove\n * the original elements from the DOM.\n */\nexport default class ElementReplacer {\n\tconstructor() {\n\t\t/**\n\t\t * The elements replaced by {@link #replace} and their replacements.\n\t\t *\n\t\t * @private\n\t\t * @member {Array.}\n\t\t */\n\t\tthis._replacedElements = [];\n\t}\n\n\t/**\n\t * Hides the `element` and, if specified, inserts the the given element next to it.\n\t *\n\t * The effect of this method can be reverted by {@link #restore}.\n\t *\n\t * @param {HTMLElement} element The element to replace.\n\t * @param {HTMLElement} [newElement] The replacement element. If not passed, then the `element` will just be hidden.\n\t */\n\treplace( element, newElement ) {\n\t\tthis._replacedElements.push( { element, newElement } );\n\n\t\telement.style.display = 'none';\n\n\t\tif ( newElement ) {\n\t\t\telement.parentNode.insertBefore( newElement, element.nextSibling );\n\t\t}\n\t}\n\n\t/**\n\t * Restores what {@link #replace} did.\n\t */\n\trestore() {\n\t\tthis._replacedElements.forEach( ( { element, newElement } ) => {\n\t\t\telement.style.display = '';\n\n\t\t\tif ( newElement ) {\n\t\t\t\tnewElement.remove();\n\t\t\t}\n\t\t} );\n\n\t\tthis._replacedElements = [];\n\t}\n}\n","/**\n * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.\n * For licensing, see LICENSE.md.\n */\n\n/**\n * @module editor-classic/classiceditorui\n */\n\nimport EditorUI from '@ckeditor/ckeditor5-core/src/editor/editorui';\nimport enableToolbarKeyboardFocus from '@ckeditor/ckeditor5-ui/src/toolbar/enabletoolbarkeyboardfocus';\nimport normalizeToolbarConfig from '@ckeditor/ckeditor5-ui/src/toolbar/normalizetoolbarconfig';\nimport { enablePlaceholder } from '@ckeditor/ckeditor5-engine/src/view/placeholder';\nimport ElementReplacer from '@ckeditor/ckeditor5-utils/src/elementreplacer';\n\n/**\n * The classic editor UI class.\n *\n * @extends module:core/editor/editorui~EditorUI\n */\nexport default class ClassicEditorUI extends EditorUI {\n\t/**\n\t * Creates an instance of the classic editor UI class.\n\t *\n\t * @param {module:core/editor/editor~Editor} editor The editor instance.\n\t * @param {module:ui/editorui/editoruiview~EditorUIView} view The view of the UI.\n\t */\n\tconstructor( editor, view ) {\n\t\tsuper( editor );\n\n\t\t/**\n\t\t * The main (top–most) view of the editor UI.\n\t\t *\n\t\t * @readonly\n\t\t * @member {module:ui/editorui/editoruiview~EditorUIView} #view\n\t\t */\n\t\tthis.view = view;\n\n\t\t/**\n\t\t * A normalized `config.toolbar` object.\n\t\t *\n\t\t * @private\n\t\t * @member {Object}\n\t\t */\n\t\tthis._toolbarConfig = normalizeToolbarConfig( editor.config.get( 'toolbar' ) );\n\n\t\t/**\n\t\t * The element replacer instance used to hide the editor's source element.\n\t\t *\n\t\t * @protected\n\t\t * @member {module:utils/elementreplacer~ElementReplacer}\n\t\t */\n\t\tthis._elementReplacer = new ElementReplacer();\n\t}\n\n\t/**\n\t * @inheritDoc\n\t */\n\tget element() {\n\t\treturn this.view.element;\n\t}\n\n\t/**\n\t * Initializes the UI.\n\t *\n\t * @param {HTMLElement|null} replacementElement The DOM element that will be the source for the created editor.\n\t */\n\tinit( replacementElement ) {\n\t\tconst editor = this.editor;\n\t\tconst view = this.view;\n\t\tconst editingView = editor.editing.view;\n\t\tconst editable = view.editable;\n\t\tconst editingRoot = editingView.document.getRoot();\n\n\t\t// The editable UI and editing root should share the same name. Then name is used\n\t\t// to recognize the particular editable, for instance in ARIA attributes.\n\t\teditable.name = editingRoot.rootName;\n\n\t\tview.render();\n\n\t\t// The editable UI element in DOM is available for sure only after the editor UI view has been rendered.\n\t\t// But it can be available earlier if a DOM element has been passed to BalloonEditor.create().\n\t\tconst editableElement = editable.element;\n\n\t\t// Register the editable UI view in the editor. A single editor instance can aggregate multiple\n\t\t// editable areas (roots) but the classic editor has only one.\n\t\tthis._editableElements.set( editable.name, editableElement );\n\n\t\t// Let the global focus tracker know that the editable UI element is focusable and\n\t\t// belongs to the editor. From now on, the focus tracker will sustain the editor focus\n\t\t// as long as the editable is focused (e.g. the user is typing).\n\t\tthis.focusTracker.add( editableElement );\n\n\t\t// Let the editable UI element respond to the changes in the global editor focus\n\t\t// tracker. It has been added to the same tracker a few lines above but, in reality, there are\n\t\t// many focusable areas in the editor, like balloons, toolbars or dropdowns and as long\n\t\t// as they have focus, the editable should act like it is focused too (although technically\n\t\t// it isn't), e.g. by setting the proper CSS class, visually announcing focus to the user.\n\t\t// Doing otherwise will result in editable focus styles disappearing, once e.g. the\n\t\t// toolbar gets focused.\n\t\tview.editable.bind( 'isFocused' ).to( this.focusTracker );\n\n\t\t// Bind the editable UI element to the editing view, making it an end– and entry–point\n\t\t// of the editor's engine. This is where the engine meets the UI.\n\t\teditingView.attachDomRoot( editableElement );\n\n\t\t// If an element containing the initial data of the editor was provided, replace it with\n\t\t// an editor instance's UI in DOM until the editor is destroyed. For instance, a + @@ -266,5 +266,13 @@ } }) } + + const mde = new SimpleMDE({ + element: document.getElementById('mde1'), + minHeight: "200px", + maxHeight: "200px", + status: false, + }); + @endsection diff --git a/resources/views/controls/make.blade.php b/resources/views/controls/make.blade.php index 28e713f3..e9429588 100644 --- a/resources/views/controls/make.blade.php +++ b/resources/views/controls/make.blade.php @@ -34,7 +34,7 @@ {{ trans('cruds.control.fields.objective') }}
- {{ $control->objective }} + {!! Michelf\Markdown::defaultTransform($control->objective) !!}
diff --git a/resources/views/controls/show.blade.php b/resources/views/controls/show.blade.php index 18abf296..312e12f8 100644 --- a/resources/views/controls/show.blade.php +++ b/resources/views/controls/show.blade.php @@ -25,7 +25,7 @@ {{ trans("cruds.control.fields.objective") }}
-
{!! $control->objective !!}
+ {!! Michelf\Markdown::defaultTransform($control->objective) !!}
diff --git a/resources/views/layout.blade.php b/resources/views/layout.blade.php index 33efa29c..1b43bc17 100644 --- a/resources/views/layout.blade.php +++ b/resources/views/layout.blade.php @@ -10,6 +10,26 @@ + + + + + + + + diff --git a/resources/views/measures/create.blade.php b/resources/views/measures/create.blade.php index 2fa008ff..c16080b4 100644 --- a/resources/views/measures/create.blade.php +++ b/resources/views/measures/create.blade.php @@ -56,8 +56,8 @@ {{ trans("cruds.measure.fields.objective") }}
- -
+ +
@@ -77,7 +77,7 @@
{{ trans("cruds.measure.fields.input") }}
-
+
@@ -86,18 +86,18 @@
{{ trans("cruds.measure.fields.model") }}
-
+
-
+
{{ trans("cruds.measure.fields.indicator") }}
-
+
-
+
@@ -106,7 +106,7 @@
-
+
@@ -120,7 +120,7 @@  
@@ -130,7 +130,13 @@
- + + @endsection - - \ No newline at end of file diff --git a/resources/views/measures/edit.blade.php b/resources/views/measures/edit.blade.php index f63be804..9a839e79 100644 --- a/resources/views/measures/edit.blade.php +++ b/resources/views/measures/edit.blade.php @@ -62,7 +62,7 @@ {{ trans('cruds.measure.fields.objective') }}
- +
@@ -138,4 +138,13 @@ + + @endsection diff --git a/resources/views/measures/show.blade.php b/resources/views/measures/show.blade.php index d6d966c6..9356b517 100644 --- a/resources/views/measures/show.blade.php +++ b/resources/views/measures/show.blade.php @@ -32,7 +32,7 @@ {{ trans('cruds.measure.fields.objective') }}
- {{ $measure->objective }} + {!! Michelf\Markdown::defaultTransform($measure->objective) !!}
diff --git a/routes/web.php b/routes/web.php index e3665986..3d3a3f34 100644 --- a/routes/web.php +++ b/routes/web.php @@ -19,6 +19,9 @@ Route::get('/home', 'HomeController@index'); Route::get('/index', 'HomeController@index'); + /* Testing */ + Route::get('/test', 'HomeController@test'); + /* Global-search engine */ Route::get('global-search', 'GlobalSearchController@search'); diff --git a/webpack.mix.js b/webpack.mix.js index 5bb9cbb3..5ab94d6e 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -14,21 +14,21 @@ let mix = require('laravel-mix'); mix.js([ 'public/vendors/chartjs/Chart.js', - 'public/vendors/ckeditor/ckeditor.js', 'node_modules/jquery/dist/jquery.min.js', 'public/vendors/metro4/js/metro.js', 'vendor/enyo/dropzone/dist/dropzone.js', 'resources/js/utils.js', - ], + ], 'public/js/all.js') .sourceMaps(); mix.styles([ - 'public/vendors/chartjs/Chart.css', + 'public/vendors/chartjs/Chart.css', 'public/vendors/metro4/css/metro-all.css', 'resources/css/app.css', 'vendor/enyo/dropzone/dist/dropzone.css', 'resources/css/calendar.css', - ], + 'node_modules/simplemde/dist/simplemde.min.css', + 'node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css', + ], 'public/css/all.css'); -