diff --git a/TODO b/TODO deleted file mode 100644 index 99e7e542..00000000 --- a/TODO +++ /dev/null @@ -1,10 +0,0 @@ -1、把 log 提取出 dbgout 之类的方法;已改作 beego.Info() 调用; -2、把源代码里的 TODO 完成; -3、Export 的两个 URL 应该可以合并,用是否有 :id 来区分;这样 0 号文档输出整个 book 更顺;已完成; -4、统一代码风格,空格、命名之类的; -5、美化 PDF 的输出格式; -6、自动登录新开标签页而且并不能跳转至起始请求页的问题; -7、用户分组管理; -8、[自动]展示历史版本;增强历史版本对比显示的能力; -9、[自动]展示作者信息;也许可以和上一需求合并考虑; -10、查看了解评论功能; diff --git a/static/css/markdown.css b/static/css/markdown.css index 9e5e408e..fe24f160 100644 --- a/static/css/markdown.css +++ b/static/css/markdown.css @@ -131,17 +131,16 @@ body{ left: 0; right: 0; } +.btn-toolbar{position: absolute;} .editormd-group{ float: left; height: 32px; margin-right: 10px; } -.editormd-group a{ +.editormd-group a,.editormd-group .editor-item{ float: left; } -.editormd-group a.change{ -} .editormd-group .change i{ color: #ffffff; background-color: #44B036 !important; @@ -158,10 +157,10 @@ body{ opacity: .6; cursor: default } -.editormd-group a>i { +.editormd-group a>i{ display: inline-block; - width: 34px; - height: 30px; + width: 34px !important; + height: 30px !important; line-height: 30px; text-align: center; color: #4b4b4b; diff --git a/static/katex/README.md b/static/katex/README.md new file mode 100644 index 00000000..c7de02a7 --- /dev/null +++ b/static/katex/README.md @@ -0,0 +1,94 @@ +# [KaTeX](https://khan.github.io/KaTeX/) [![Build Status](https://travis-ci.org/Khan/KaTeX.svg?branch=master)](https://travis-ci.org/Khan/KaTeX) + +[![Join the chat at https://gitter.im/Khan/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Khan/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. + + * **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://www.intmath.com/cg5/katex-mathjax-comparison.php). + * **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting. + * **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources. + * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML. + +KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 9 - IE 11. A list of supported commands can be found on the [wiki](https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX). + +## Usage + +You can [download KaTeX](https://github.com/khan/katex/releases) and host it on your server or include the `katex.min.js` and `katex.min.css` files on your page directly from a CDN: + +```html + + +``` + +#### In-browser rendering + +Call `katex.render` with a TeX expression and a DOM element to render into: + +```js +katex.render("c = \\pm\\sqrt{a^2 + b^2}", element); +``` + +If KaTeX can't parse the expression, it throws a `katex.ParseError` error. + +#### Server side rendering or rendering to a string + +To generate HTML on the server or to generate an HTML string of the rendered math, you can use `katex.renderToString`: + +```js +var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}"); +// '...' +``` + +Make sure to include the CSS and font files, but there is no need to include the JavaScript. Like `render`, `renderToString` throws if it can't parse the expression. + +#### Rendering options + +You can provide an object of options as the last argument to `katex.render` and `katex.renderToString`. Available options are: + +- `displayMode`: `boolean`. If `true` the math will be rendered in display mode, which will put the math in display style (so `\int` and `\sum` are large, for example), and will center the math on the page on its own line. If `false` the math will be rendered in inline mode. (default: `false`) +- `throwOnError`: `boolean`. If `true`, KaTeX will throw a `ParseError` when it encounters an unsupported command. If `false`, KaTeX will render the unsupported command as text in the color given by `errorColor`. (default: `true`) +- `errorColor`: `string`. A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option determines the color which unsupported commands are rendered in. (default: `#cc0000`) +- `macros`: `object`. A collection of custom macros. Each macro is a property with a name like `\name` (written `"\\name"` in JavaScript) which maps to a string that describes the expansion of the macro. +- `colorIsTextColor`: `boolean`. If `true`, `\color` will work like LaTeX's `\textcolor`, and take two arguments (e.g., `\color{blue}{hello}`), which restores the old behavior of KaTeX (pre-0.8.0). If `false` (the default), `\color` will work like LaTeX's `\color`, and take one argument (e.g., `\color{blue}hello`). In both cases, `\textcolor` works as in LaTeX (e.g., `\textcolor{blue}{hello}`). + +For example: + +```js +katex.render("c = \\pm\\sqrt{a^2 + b^2}\\in\\RR", element, { + displayMode: true, + macros: { + "\\RR": "\\mathbb{R}" + } +}); +``` + +#### Automatic rendering of math on a page + +Math on the page can be automatically rendered using the auto-render extension. See [the Auto-render README](contrib/auto-render/README.md) for more information. + +#### Font size and lengths + +By default, KaTeX math is rendered in a 1.21× larger font than the surrounding +context, which makes super- and subscripts easier to read. You can control +this using CSS, for example: + +```css +.katex { font-size: 1.1em; } +``` + +KaTeX supports all TeX units, including absolute units like `cm` and `in`. +Absolute units are currently scaled relative to the default TeX font size of +10pt, so that `\kern1cm` produces the same results as `\kern2.845275em`. +As a result, relative and absolute units are both uniformly scaled relative +to LaTeX with a 10pt font; for example, the rectangle `\rule{1cm}{1em}` has +the same aspect ratio in KaTeX as in LaTeX. However, because most browsers +default to a larger font size, this typically means that a 1cm kern in KaTeX +will appear larger than 1cm in browser units. + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) + +## License + +KaTeX is licensed under the [MIT License](http://opensource.org/licenses/MIT). diff --git a/static/katex/contrib/auto-render.min.js b/static/katex/contrib/auto-render.min.js new file mode 100644 index 00000000..96e1ddec --- /dev/null +++ b/static/katex/contrib/auto-render.min.js @@ -0,0 +1 @@ +(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.renderMathInElement=e()}})(function(){var e,t,n;return function e(t,n,r){function o(c,a){if(!n[c]){if(!t[c]){var u=typeof require=="function"&&require;if(!a&&u)return u(c,!0);if(i)return i(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var s=n[c]={exports:{}};t[c][0].call(s.exports,function(e){var n=t[c][1][e];return o(n?n:e)},s,s.exports,e,t,n,r)}return n[c].exports}var i=typeof require=="function"&&require;for(var c=0;cf){s=a[f++];if(s!=s)return true}else for(;u>f;f++)if(e||f in a){if(a[f]===n)return e||f||0}return!e&&-1}}},{"./_to-index":32,"./_to-iobject":34,"./_to-length":35}],8:[function(e,t,n){var r={}.toString;t.exports=function(e){return r.call(e).slice(8,-1)}},{}],9:[function(e,t,n){var r=t.exports={version:"2.4.0"};if(typeof __e=="number")__e=r},{}],10:[function(e,t,n){var r=e("./_a-function");t.exports=function(e,t,n){r(e);if(t===undefined)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":5}],11:[function(e,t,n){t.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},{}],12:[function(e,t,n){t.exports=!e("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":16}],13:[function(e,t,n){var r=e("./_is-object"),o=e("./_global").document,i=r(o)&&r(o.createElement);t.exports=function(e){return i?o.createElement(e):{}}},{"./_global":17,"./_is-object":22}],14:[function(e,t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],15:[function(e,t,n){var r=e("./_global"),o=e("./_core"),i=e("./_ctx"),c=e("./_hide"),a="prototype";var u=function(e,t,n){var f=e&u.F,s=e&u.G,l=e&u.S,p=e&u.P,d=e&u.B,_=e&u.W,v=s?o:o[t]||(o[t]={}),h=v[a],b=s?r:l?r[t]:(r[t]||{})[a],y,g,x;if(s)n=t;for(y in n){g=!f&&b&&b[y]!==undefined;if(g&&y in v)continue;x=g?b[y]:n[y];v[y]=s&&typeof b[y]!="function"?n[y]:d&&g?i(x,r):_&&b[y]==x?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};t[a]=e[a];return t}(x):p&&typeof x=="function"?i(Function.call,x):x;if(p){(v.virtual||(v.virtual={}))[y]=x;if(e&u.R&&h&&!h[y])c(h,y,x)}}};u.F=1;u.G=2;u.S=4;u.P=8;u.B=16;u.W=32;u.U=64;u.R=128;t.exports=u},{"./_core":9,"./_ctx":10,"./_global":17,"./_hide":19}],16:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return true}}},{}],17:[function(e,t,n){var r=t.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();if(typeof __g=="number")__g=r},{}],18:[function(e,t,n){var r={}.hasOwnProperty;t.exports=function(e,t){return r.call(e,t)}},{}],19:[function(e,t,n){var r=e("./_object-dp"),o=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){e[t]=n;return e}},{"./_descriptors":12,"./_object-dp":24,"./_property-desc":29}],20:[function(e,t,n){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":12,"./_dom-create":13,"./_fails":16}],21:[function(e,t,n){var r=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return r(e)=="String"?e.split(""):Object(e)}},{"./_cof":8}],22:[function(e,t,n){t.exports=function(e){return typeof e==="object"?e!==null:typeof e==="function"}},{}],23:[function(e,t,n){"use strict";var r=e("./_object-keys"),o=e("./_object-gops"),i=e("./_object-pie"),c=e("./_to-object"),a=e("./_iobject"),u=Object.assign;t.exports=!u||e("./_fails")(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";e[n]=7;r.split("").forEach(function(e){t[e]=e});return u({},e)[n]!=7||Object.keys(u({},t)).join("")!=r})?function e(t,n){var u=c(t),f=arguments.length,s=1,l=o.f,p=i.f;while(f>s){var d=a(arguments[s++]),_=l?r(d).concat(l(d)):r(d),v=_.length,h=0,b;while(v>h)if(p.call(d,b=_[h++]))u[b]=d[b]}return u}:u},{"./_fails":16,"./_iobject":21,"./_object-gops":25,"./_object-keys":27,"./_object-pie":28,"./_to-object":36}],24:[function(e,t,n){var r=e("./_an-object"),o=e("./_ie8-dom-define"),i=e("./_to-primitive"),c=Object.defineProperty;n.f=e("./_descriptors")?Object.defineProperty:function e(t,n,a){r(t);n=i(n,true);r(a);if(o)try{return c(t,n,a)}catch(e){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");if("value"in a)t[n]=a.value;return t}},{"./_an-object":6,"./_descriptors":12,"./_ie8-dom-define":20,"./_to-primitive":37}],25:[function(e,t,n){n.f=Object.getOwnPropertySymbols},{}],26:[function(e,t,n){var r=e("./_has"),o=e("./_to-iobject"),i=e("./_array-includes")(false),c=e("./_shared-key")("IE_PROTO");t.exports=function(e,t){var n=o(e),a=0,u=[],f;for(f in n)if(f!=c)r(n,f)&&u.push(f);while(t.length>a)if(r(n,f=t[a++])){~i(u,f)||u.push(f)}return u}},{"./_array-includes":7,"./_has":18,"./_shared-key":30,"./_to-iobject":34}],27:[function(e,t,n){var r=e("./_object-keys-internal"),o=e("./_enum-bug-keys");t.exports=Object.keys||function e(t){return r(t,o)}},{"./_enum-bug-keys":14,"./_object-keys-internal":26}],28:[function(e,t,n){n.f={}.propertyIsEnumerable},{}],29:[function(e,t,n){t.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},{}],30:[function(e,t,n){var r=e("./_shared")("keys"),o=e("./_uid");t.exports=function(e){return r[e]||(r[e]=o(e))}},{"./_shared":31,"./_uid":38}],31:[function(e,t,n){var r=e("./_global"),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(e){return i[e]||(i[e]={})}},{"./_global":17}],32:[function(e,t,n){var r=e("./_to-integer"),o=Math.max,i=Math.min;t.exports=function(e,t){e=r(e);return e<0?o(e+t,0):i(e,t)}},{"./_to-integer":33}],33:[function(e,t,n){var r=Math.ceil,o=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?o:r)(e)}},{}],34:[function(e,t,n){var r=e("./_iobject"),o=e("./_defined");t.exports=function(e){return r(o(e))}},{"./_defined":11,"./_iobject":21}],35:[function(e,t,n){var r=e("./_to-integer"),o=Math.min;t.exports=function(e){return e>0?o(r(e),9007199254740991):0}},{"./_to-integer":33}],36:[function(e,t,n){var r=e("./_defined");t.exports=function(e){return Object(r(e))}},{"./_defined":11}],37:[function(e,t,n){var r=e("./_is-object");t.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&typeof(n=e.toString)=="function"&&!r(o=n.call(e)))return o;if(typeof(n=e.valueOf)=="function"&&!r(o=n.call(e)))return o;if(!t&&typeof(n=e.toString)=="function"&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":22}],38:[function(e,t,n){var r=0,o=Math.random();t.exports=function(e){return"Symbol(".concat(e===undefined?"":e,")_",(++r+o).toString(36))}},{}],39:[function(e,t,n){var r=e("./_export");r(r.S+r.F,"Object",{assign:e("./_object-assign")})},{"./_export":15,"./_object-assign":23}]},{},[1])(1)}); diff --git a/static/katex/fonts/KaTeX_AMS-Regular.eot b/static/katex/fonts/KaTeX_AMS-Regular.eot new file mode 100644 index 00000000..784276a3 Binary files /dev/null and b/static/katex/fonts/KaTeX_AMS-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_AMS-Regular.ttf b/static/katex/fonts/KaTeX_AMS-Regular.ttf new file mode 100644 index 00000000..6f1e0be2 Binary files /dev/null and b/static/katex/fonts/KaTeX_AMS-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_AMS-Regular.woff b/static/katex/fonts/KaTeX_AMS-Regular.woff new file mode 100644 index 00000000..4dded473 Binary files /dev/null and b/static/katex/fonts/KaTeX_AMS-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_AMS-Regular.woff2 b/static/katex/fonts/KaTeX_AMS-Regular.woff2 new file mode 100644 index 00000000..ea81079c Binary files /dev/null and b/static/katex/fonts/KaTeX_AMS-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Caligraphic-Bold.eot b/static/katex/fonts/KaTeX_Caligraphic-Bold.eot new file mode 100644 index 00000000..1a0db0c5 Binary files /dev/null and b/static/katex/fonts/KaTeX_Caligraphic-Bold.eot differ diff --git a/static/katex/fonts/KaTeX_Caligraphic-Bold.ttf b/static/katex/fonts/KaTeX_Caligraphic-Bold.ttf new file mode 100644 index 00000000..b94907da Binary files /dev/null and b/static/katex/fonts/KaTeX_Caligraphic-Bold.ttf differ diff --git a/static/katex/fonts/KaTeX_Caligraphic-Bold.woff b/static/katex/fonts/KaTeX_Caligraphic-Bold.woff new file mode 100644 index 00000000..799fa812 Binary files /dev/null and b/static/katex/fonts/KaTeX_Caligraphic-Bold.woff differ diff --git a/static/katex/fonts/KaTeX_Caligraphic-Bold.woff2 b/static/katex/fonts/KaTeX_Caligraphic-Bold.woff2 new file mode 100644 index 00000000..73bb5422 Binary files /dev/null and b/static/katex/fonts/KaTeX_Caligraphic-Bold.woff2 differ diff --git a/static/katex/fonts/KaTeX_Caligraphic-Regular.eot b/static/katex/fonts/KaTeX_Caligraphic-Regular.eot new file mode 100644 index 00000000..6cc83d09 Binary files /dev/null and b/static/katex/fonts/KaTeX_Caligraphic-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Caligraphic-Regular.ttf b/static/katex/fonts/KaTeX_Caligraphic-Regular.ttf new file mode 100644 index 00000000..cf51e202 Binary files /dev/null and b/static/katex/fonts/KaTeX_Caligraphic-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Caligraphic-Regular.woff b/static/katex/fonts/KaTeX_Caligraphic-Regular.woff new file mode 100644 index 00000000..f5e5c623 Binary files /dev/null and b/static/katex/fonts/KaTeX_Caligraphic-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Caligraphic-Regular.woff2 b/static/katex/fonts/KaTeX_Caligraphic-Regular.woff2 new file mode 100644 index 00000000..dd76d348 Binary files /dev/null and b/static/katex/fonts/KaTeX_Caligraphic-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Fraktur-Bold.eot b/static/katex/fonts/KaTeX_Fraktur-Bold.eot new file mode 100644 index 00000000..1960b106 Binary files /dev/null and b/static/katex/fonts/KaTeX_Fraktur-Bold.eot differ diff --git a/static/katex/fonts/KaTeX_Fraktur-Bold.ttf b/static/katex/fonts/KaTeX_Fraktur-Bold.ttf new file mode 100644 index 00000000..7b0790f1 Binary files /dev/null and b/static/katex/fonts/KaTeX_Fraktur-Bold.ttf differ diff --git a/static/katex/fonts/KaTeX_Fraktur-Bold.woff b/static/katex/fonts/KaTeX_Fraktur-Bold.woff new file mode 100644 index 00000000..dc325713 Binary files /dev/null and b/static/katex/fonts/KaTeX_Fraktur-Bold.woff differ diff --git a/static/katex/fonts/KaTeX_Fraktur-Bold.woff2 b/static/katex/fonts/KaTeX_Fraktur-Bold.woff2 new file mode 100644 index 00000000..fdc42922 Binary files /dev/null and b/static/katex/fonts/KaTeX_Fraktur-Bold.woff2 differ diff --git a/static/katex/fonts/KaTeX_Fraktur-Regular.eot b/static/katex/fonts/KaTeX_Fraktur-Regular.eot new file mode 100644 index 00000000..e4e73796 Binary files /dev/null and b/static/katex/fonts/KaTeX_Fraktur-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Fraktur-Regular.ttf b/static/katex/fonts/KaTeX_Fraktur-Regular.ttf new file mode 100644 index 00000000..063bc026 Binary files /dev/null and b/static/katex/fonts/KaTeX_Fraktur-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Fraktur-Regular.woff b/static/katex/fonts/KaTeX_Fraktur-Regular.woff new file mode 100644 index 00000000..c4b18d86 Binary files /dev/null and b/static/katex/fonts/KaTeX_Fraktur-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Fraktur-Regular.woff2 b/static/katex/fonts/KaTeX_Fraktur-Regular.woff2 new file mode 100644 index 00000000..4318d938 Binary files /dev/null and b/static/katex/fonts/KaTeX_Fraktur-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Main-Bold.eot b/static/katex/fonts/KaTeX_Main-Bold.eot new file mode 100644 index 00000000..80fbd022 Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Bold.eot differ diff --git a/static/katex/fonts/KaTeX_Main-Bold.ttf b/static/katex/fonts/KaTeX_Main-Bold.ttf new file mode 100644 index 00000000..8e10722a Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Bold.ttf differ diff --git a/static/katex/fonts/KaTeX_Main-Bold.woff b/static/katex/fonts/KaTeX_Main-Bold.woff new file mode 100644 index 00000000..43b361a6 Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Bold.woff differ diff --git a/static/katex/fonts/KaTeX_Main-Bold.woff2 b/static/katex/fonts/KaTeX_Main-Bold.woff2 new file mode 100644 index 00000000..af57a96c Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Bold.woff2 differ diff --git a/static/katex/fonts/KaTeX_Main-Italic.eot b/static/katex/fonts/KaTeX_Main-Italic.eot new file mode 100644 index 00000000..fc770166 Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Italic.eot differ diff --git a/static/katex/fonts/KaTeX_Main-Italic.ttf b/static/katex/fonts/KaTeX_Main-Italic.ttf new file mode 100644 index 00000000..d124495d Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Italic.ttf differ diff --git a/static/katex/fonts/KaTeX_Main-Italic.woff b/static/katex/fonts/KaTeX_Main-Italic.woff new file mode 100644 index 00000000..e623236b Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Italic.woff differ diff --git a/static/katex/fonts/KaTeX_Main-Italic.woff2 b/static/katex/fonts/KaTeX_Main-Italic.woff2 new file mode 100644 index 00000000..944e9740 Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Italic.woff2 differ diff --git a/static/katex/fonts/KaTeX_Main-Regular.eot b/static/katex/fonts/KaTeX_Main-Regular.eot new file mode 100644 index 00000000..dc60c090 Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Main-Regular.ttf b/static/katex/fonts/KaTeX_Main-Regular.ttf new file mode 100644 index 00000000..da5797ff Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Main-Regular.woff b/static/katex/fonts/KaTeX_Main-Regular.woff new file mode 100644 index 00000000..37db672e Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Main-Regular.woff2 b/static/katex/fonts/KaTeX_Main-Regular.woff2 new file mode 100644 index 00000000..48820424 Binary files /dev/null and b/static/katex/fonts/KaTeX_Main-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Math-BoldItalic.eot b/static/katex/fonts/KaTeX_Math-BoldItalic.eot new file mode 100644 index 00000000..52c8b8c6 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-BoldItalic.eot differ diff --git a/static/katex/fonts/KaTeX_Math-BoldItalic.ttf b/static/katex/fonts/KaTeX_Math-BoldItalic.ttf new file mode 100644 index 00000000..a8b527c7 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-BoldItalic.ttf differ diff --git a/static/katex/fonts/KaTeX_Math-BoldItalic.woff b/static/katex/fonts/KaTeX_Math-BoldItalic.woff new file mode 100644 index 00000000..8940e0b5 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-BoldItalic.woff differ diff --git a/static/katex/fonts/KaTeX_Math-BoldItalic.woff2 b/static/katex/fonts/KaTeX_Math-BoldItalic.woff2 new file mode 100644 index 00000000..15cf56d3 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-BoldItalic.woff2 differ diff --git a/static/katex/fonts/KaTeX_Math-Italic.eot b/static/katex/fonts/KaTeX_Math-Italic.eot new file mode 100644 index 00000000..64c8992c Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-Italic.eot differ diff --git a/static/katex/fonts/KaTeX_Math-Italic.ttf b/static/katex/fonts/KaTeX_Math-Italic.ttf new file mode 100644 index 00000000..06f39d3a Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-Italic.ttf differ diff --git a/static/katex/fonts/KaTeX_Math-Italic.woff b/static/katex/fonts/KaTeX_Math-Italic.woff new file mode 100644 index 00000000..cf3b4b79 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-Italic.woff differ diff --git a/static/katex/fonts/KaTeX_Math-Italic.woff2 b/static/katex/fonts/KaTeX_Math-Italic.woff2 new file mode 100644 index 00000000..5f8c4bfa Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-Italic.woff2 differ diff --git a/static/katex/fonts/KaTeX_Math-Regular.eot b/static/katex/fonts/KaTeX_Math-Regular.eot new file mode 100644 index 00000000..5521e6a5 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Math-Regular.ttf b/static/katex/fonts/KaTeX_Math-Regular.ttf new file mode 100644 index 00000000..73127082 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Math-Regular.woff b/static/katex/fonts/KaTeX_Math-Regular.woff new file mode 100644 index 00000000..0e2ebdf1 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Math-Regular.woff2 b/static/katex/fonts/KaTeX_Math-Regular.woff2 new file mode 100644 index 00000000..ebe3d028 Binary files /dev/null and b/static/katex/fonts/KaTeX_Math-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Bold.eot b/static/katex/fonts/KaTeX_SansSerif-Bold.eot new file mode 100644 index 00000000..1660e76a Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Bold.eot differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Bold.ttf b/static/katex/fonts/KaTeX_SansSerif-Bold.ttf new file mode 100644 index 00000000..dbeb7b92 Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Bold.ttf differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Bold.woff b/static/katex/fonts/KaTeX_SansSerif-Bold.woff new file mode 100644 index 00000000..8f144a8b Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Bold.woff differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Bold.woff2 b/static/katex/fonts/KaTeX_SansSerif-Bold.woff2 new file mode 100644 index 00000000..329e8555 Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Bold.woff2 differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Italic.eot b/static/katex/fonts/KaTeX_SansSerif-Italic.eot new file mode 100644 index 00000000..289ae3ff Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Italic.eot differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Italic.ttf b/static/katex/fonts/KaTeX_SansSerif-Italic.ttf new file mode 100644 index 00000000..b3a2f38f Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Italic.ttf differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Italic.woff b/static/katex/fonts/KaTeX_SansSerif-Italic.woff new file mode 100644 index 00000000..bddf7ea6 Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Italic.woff differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Italic.woff2 b/static/katex/fonts/KaTeX_SansSerif-Italic.woff2 new file mode 100644 index 00000000..5fa767bd Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Italic.woff2 differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Regular.eot b/static/katex/fonts/KaTeX_SansSerif-Regular.eot new file mode 100644 index 00000000..1b38b98a Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Regular.ttf b/static/katex/fonts/KaTeX_SansSerif-Regular.ttf new file mode 100644 index 00000000..e4712f84 Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Regular.woff b/static/katex/fonts/KaTeX_SansSerif-Regular.woff new file mode 100644 index 00000000..33be3680 Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_SansSerif-Regular.woff2 b/static/katex/fonts/KaTeX_SansSerif-Regular.woff2 new file mode 100644 index 00000000..4fcb2e29 Binary files /dev/null and b/static/katex/fonts/KaTeX_SansSerif-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Script-Regular.eot b/static/katex/fonts/KaTeX_Script-Regular.eot new file mode 100644 index 00000000..7870d7f3 Binary files /dev/null and b/static/katex/fonts/KaTeX_Script-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Script-Regular.ttf b/static/katex/fonts/KaTeX_Script-Regular.ttf new file mode 100644 index 00000000..da4d1130 Binary files /dev/null and b/static/katex/fonts/KaTeX_Script-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Script-Regular.woff b/static/katex/fonts/KaTeX_Script-Regular.woff new file mode 100644 index 00000000..d6ae79f9 Binary files /dev/null and b/static/katex/fonts/KaTeX_Script-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Script-Regular.woff2 b/static/katex/fonts/KaTeX_Script-Regular.woff2 new file mode 100644 index 00000000..1b43deb4 Binary files /dev/null and b/static/katex/fonts/KaTeX_Script-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Size1-Regular.eot b/static/katex/fonts/KaTeX_Size1-Regular.eot new file mode 100644 index 00000000..29950f95 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size1-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Size1-Regular.ttf b/static/katex/fonts/KaTeX_Size1-Regular.ttf new file mode 100644 index 00000000..194466a6 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size1-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Size1-Regular.woff b/static/katex/fonts/KaTeX_Size1-Regular.woff new file mode 100644 index 00000000..237f271e Binary files /dev/null and b/static/katex/fonts/KaTeX_Size1-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Size1-Regular.woff2 b/static/katex/fonts/KaTeX_Size1-Regular.woff2 new file mode 100644 index 00000000..39b6f8f7 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size1-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Size2-Regular.eot b/static/katex/fonts/KaTeX_Size2-Regular.eot new file mode 100644 index 00000000..b8b0536f Binary files /dev/null and b/static/katex/fonts/KaTeX_Size2-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Size2-Regular.ttf b/static/katex/fonts/KaTeX_Size2-Regular.ttf new file mode 100644 index 00000000..b41b66a6 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size2-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Size2-Regular.woff b/static/katex/fonts/KaTeX_Size2-Regular.woff new file mode 100644 index 00000000..4a305585 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size2-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Size2-Regular.woff2 b/static/katex/fonts/KaTeX_Size2-Regular.woff2 new file mode 100644 index 00000000..3facec1a Binary files /dev/null and b/static/katex/fonts/KaTeX_Size2-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Size3-Regular.eot b/static/katex/fonts/KaTeX_Size3-Regular.eot new file mode 100644 index 00000000..576b864f Binary files /dev/null and b/static/katex/fonts/KaTeX_Size3-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Size3-Regular.ttf b/static/katex/fonts/KaTeX_Size3-Regular.ttf new file mode 100644 index 00000000..790ddbbc Binary files /dev/null and b/static/katex/fonts/KaTeX_Size3-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Size3-Regular.woff b/static/katex/fonts/KaTeX_Size3-Regular.woff new file mode 100644 index 00000000..3a6d062e Binary files /dev/null and b/static/katex/fonts/KaTeX_Size3-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Size3-Regular.woff2 b/static/katex/fonts/KaTeX_Size3-Regular.woff2 new file mode 100644 index 00000000..2cffafe5 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size3-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Size4-Regular.eot b/static/katex/fonts/KaTeX_Size4-Regular.eot new file mode 100644 index 00000000..c2b045fc Binary files /dev/null and b/static/katex/fonts/KaTeX_Size4-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Size4-Regular.ttf b/static/katex/fonts/KaTeX_Size4-Regular.ttf new file mode 100644 index 00000000..ce660aa7 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size4-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Size4-Regular.woff b/static/katex/fonts/KaTeX_Size4-Regular.woff new file mode 100644 index 00000000..7826c6c9 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size4-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Size4-Regular.woff2 b/static/katex/fonts/KaTeX_Size4-Regular.woff2 new file mode 100644 index 00000000..c9218981 Binary files /dev/null and b/static/katex/fonts/KaTeX_Size4-Regular.woff2 differ diff --git a/static/katex/fonts/KaTeX_Typewriter-Regular.eot b/static/katex/fonts/KaTeX_Typewriter-Regular.eot new file mode 100644 index 00000000..4c178f48 Binary files /dev/null and b/static/katex/fonts/KaTeX_Typewriter-Regular.eot differ diff --git a/static/katex/fonts/KaTeX_Typewriter-Regular.ttf b/static/katex/fonts/KaTeX_Typewriter-Regular.ttf new file mode 100644 index 00000000..b0427ad0 Binary files /dev/null and b/static/katex/fonts/KaTeX_Typewriter-Regular.ttf differ diff --git a/static/katex/fonts/KaTeX_Typewriter-Regular.woff b/static/katex/fonts/KaTeX_Typewriter-Regular.woff new file mode 100644 index 00000000..78e99048 Binary files /dev/null and b/static/katex/fonts/KaTeX_Typewriter-Regular.woff differ diff --git a/static/katex/fonts/KaTeX_Typewriter-Regular.woff2 b/static/katex/fonts/KaTeX_Typewriter-Regular.woff2 new file mode 100644 index 00000000..618de99d Binary files /dev/null and b/static/katex/fonts/KaTeX_Typewriter-Regular.woff2 differ diff --git a/static/katex/katex.css b/static/katex/katex.css new file mode 100644 index 00000000..ff028dd2 --- /dev/null +++ b/static/katex/katex.css @@ -0,0 +1,1074 @@ +@font-face { + font-family: 'KaTeX_AMS'; + src: url('fonts/KaTeX_AMS-Regular.eot'); + src: url('fonts/KaTeX_AMS-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_AMS-Regular.woff2') format('woff2'), url('fonts/KaTeX_AMS-Regular.woff') format('woff'), url('fonts/KaTeX_AMS-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Caligraphic'; + src: url('fonts/KaTeX_Caligraphic-Bold.eot'); + src: url('fonts/KaTeX_Caligraphic-Bold.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Caligraphic-Bold.woff2') format('woff2'), url('fonts/KaTeX_Caligraphic-Bold.woff') format('woff'), url('fonts/KaTeX_Caligraphic-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Caligraphic'; + src: url('fonts/KaTeX_Caligraphic-Regular.eot'); + src: url('fonts/KaTeX_Caligraphic-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Caligraphic-Regular.woff2') format('woff2'), url('fonts/KaTeX_Caligraphic-Regular.woff') format('woff'), url('fonts/KaTeX_Caligraphic-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Fraktur'; + src: url('fonts/KaTeX_Fraktur-Bold.eot'); + src: url('fonts/KaTeX_Fraktur-Bold.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Fraktur-Bold.woff2') format('woff2'), url('fonts/KaTeX_Fraktur-Bold.woff') format('woff'), url('fonts/KaTeX_Fraktur-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Fraktur'; + src: url('fonts/KaTeX_Fraktur-Regular.eot'); + src: url('fonts/KaTeX_Fraktur-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Fraktur-Regular.woff2') format('woff2'), url('fonts/KaTeX_Fraktur-Regular.woff') format('woff'), url('fonts/KaTeX_Fraktur-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Main'; + src: url('fonts/KaTeX_Main-Bold.eot'); + src: url('fonts/KaTeX_Main-Bold.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Main-Bold.woff2') format('woff2'), url('fonts/KaTeX_Main-Bold.woff') format('woff'), url('fonts/KaTeX_Main-Bold.ttf') format('truetype'); + font-weight: bold; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Main'; + src: url('fonts/KaTeX_Main-Italic.eot'); + src: url('fonts/KaTeX_Main-Italic.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Main-Italic.woff2') format('woff2'), url('fonts/KaTeX_Main-Italic.woff') format('woff'), url('fonts/KaTeX_Main-Italic.ttf') format('truetype'); + font-weight: normal; + font-style: italic; +} +@font-face { + font-family: 'KaTeX_Main'; + src: url('fonts/KaTeX_Main-Regular.eot'); + src: url('fonts/KaTeX_Main-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Main-Regular.woff2') format('woff2'), url('fonts/KaTeX_Main-Regular.woff') format('woff'), url('fonts/KaTeX_Main-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Math'; + src: url('fonts/KaTeX_Math-Italic.eot'); + src: url('fonts/KaTeX_Math-Italic.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Math-Italic.woff2') format('woff2'), url('fonts/KaTeX_Math-Italic.woff') format('woff'), url('fonts/KaTeX_Math-Italic.ttf') format('truetype'); + font-weight: normal; + font-style: italic; +} +@font-face { + font-family: 'KaTeX_SansSerif'; + src: url('fonts/KaTeX_SansSerif-Regular.eot'); + src: url('fonts/KaTeX_SansSerif-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_SansSerif-Regular.woff2') format('woff2'), url('fonts/KaTeX_SansSerif-Regular.woff') format('woff'), url('fonts/KaTeX_SansSerif-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Script'; + src: url('fonts/KaTeX_Script-Regular.eot'); + src: url('fonts/KaTeX_Script-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Script-Regular.woff2') format('woff2'), url('fonts/KaTeX_Script-Regular.woff') format('woff'), url('fonts/KaTeX_Script-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Size1'; + src: url('fonts/KaTeX_Size1-Regular.eot'); + src: url('fonts/KaTeX_Size1-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Size1-Regular.woff2') format('woff2'), url('fonts/KaTeX_Size1-Regular.woff') format('woff'), url('fonts/KaTeX_Size1-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Size2'; + src: url('fonts/KaTeX_Size2-Regular.eot'); + src: url('fonts/KaTeX_Size2-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Size2-Regular.woff2') format('woff2'), url('fonts/KaTeX_Size2-Regular.woff') format('woff'), url('fonts/KaTeX_Size2-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Size3'; + src: url('fonts/KaTeX_Size3-Regular.eot'); + src: url('fonts/KaTeX_Size3-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Size3-Regular.woff2') format('woff2'), url('fonts/KaTeX_Size3-Regular.woff') format('woff'), url('fonts/KaTeX_Size3-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Size4'; + src: url('fonts/KaTeX_Size4-Regular.eot'); + src: url('fonts/KaTeX_Size4-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Size4-Regular.woff2') format('woff2'), url('fonts/KaTeX_Size4-Regular.woff') format('woff'), url('fonts/KaTeX_Size4-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +@font-face { + font-family: 'KaTeX_Typewriter'; + src: url('fonts/KaTeX_Typewriter-Regular.eot'); + src: url('fonts/KaTeX_Typewriter-Regular.eot#iefix') format('embedded-opentype'), url('fonts/KaTeX_Typewriter-Regular.woff2') format('woff2'), url('fonts/KaTeX_Typewriter-Regular.woff') format('woff'), url('fonts/KaTeX_Typewriter-Regular.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} +.katex-display { + display: block; + margin: 1em 0; + text-align: center; +} +.katex-display > .katex { + display: inline-block; + text-align: initial; +} +.katex { + font: normal 1.21em KaTeX_Main, Times New Roman, serif; + line-height: 1.2; + white-space: nowrap; + text-indent: 0; + text-rendering: auto; +} +.katex * { + -ms-high-contrast-adjust: none !important; +} +.katex .katex-html { + display: inline-block; +} +.katex .katex-mathml { + position: absolute; + clip: rect(1px, 1px, 1px, 1px); + padding: 0; + border: 0; + height: 1px; + width: 1px; + overflow: hidden; +} +.katex .base { + position: relative; + display: inline-block; +} +.katex .strut { + display: inline-block; +} +.katex .mathrm { + font-style: normal; +} +.katex .textit { + font-style: italic; +} +.katex .mathit { + font-family: KaTeX_Math; + font-style: italic; +} +.katex .mathbf { + font-family: KaTeX_Main; + font-weight: bold; +} +.katex .amsrm { + font-family: KaTeX_AMS; +} +.katex .mathbb { + font-family: KaTeX_AMS; +} +.katex .mathcal { + font-family: KaTeX_Caligraphic; +} +.katex .mathfrak { + font-family: KaTeX_Fraktur; +} +.katex .mathtt { + font-family: KaTeX_Typewriter; +} +.katex .mathscr { + font-family: KaTeX_Script; +} +.katex .mathsf { + font-family: KaTeX_SansSerif; +} +.katex .mainit { + font-family: KaTeX_Main; + font-style: italic; +} +.katex .mainrm { + font-family: KaTeX_Main; + font-style: normal; +} +.katex .mord + .mop { + margin-left: 0.16667em; +} +.katex .mord + .mbin { + margin-left: 0.22222em; +} +.katex .mord + .mrel { + margin-left: 0.27778em; +} +.katex .mord + .minner { + margin-left: 0.16667em; +} +.katex .mop + .mord { + margin-left: 0.16667em; +} +.katex .mop + .mop { + margin-left: 0.16667em; +} +.katex .mop + .mrel { + margin-left: 0.27778em; +} +.katex .mop + .minner { + margin-left: 0.16667em; +} +.katex .mbin + .mord { + margin-left: 0.22222em; +} +.katex .mbin + .mop { + margin-left: 0.22222em; +} +.katex .mbin + .mopen { + margin-left: 0.22222em; +} +.katex .mbin + .minner { + margin-left: 0.22222em; +} +.katex .mrel + .mord { + margin-left: 0.27778em; +} +.katex .mrel + .mop { + margin-left: 0.27778em; +} +.katex .mrel + .mopen { + margin-left: 0.27778em; +} +.katex .mrel + .minner { + margin-left: 0.27778em; +} +.katex .mclose + .mop { + margin-left: 0.16667em; +} +.katex .mclose + .mbin { + margin-left: 0.22222em; +} +.katex .mclose + .mrel { + margin-left: 0.27778em; +} +.katex .mclose + .minner { + margin-left: 0.16667em; +} +.katex .mpunct + .mord { + margin-left: 0.16667em; +} +.katex .mpunct + .mop { + margin-left: 0.16667em; +} +.katex .mpunct + .mrel { + margin-left: 0.16667em; +} +.katex .mpunct + .mopen { + margin-left: 0.16667em; +} +.katex .mpunct + .mclose { + margin-left: 0.16667em; +} +.katex .mpunct + .mpunct { + margin-left: 0.16667em; +} +.katex .mpunct + .minner { + margin-left: 0.16667em; +} +.katex .minner + .mord { + margin-left: 0.16667em; +} +.katex .minner + .mop { + margin-left: 0.16667em; +} +.katex .minner + .mbin { + margin-left: 0.22222em; +} +.katex .minner + .mrel { + margin-left: 0.27778em; +} +.katex .minner + .mopen { + margin-left: 0.16667em; +} +.katex .minner + .mpunct { + margin-left: 0.16667em; +} +.katex .minner + .minner { + margin-left: 0.16667em; +} +.katex .mord.mtight { + margin-left: 0; +} +.katex .mop.mtight { + margin-left: 0; +} +.katex .mbin.mtight { + margin-left: 0; +} +.katex .mrel.mtight { + margin-left: 0; +} +.katex .mopen.mtight { + margin-left: 0; +} +.katex .mclose.mtight { + margin-left: 0; +} +.katex .mpunct.mtight { + margin-left: 0; +} +.katex .minner.mtight { + margin-left: 0; +} +.katex .mord + .mop.mtight { + margin-left: 0.16667em; +} +.katex .mop + .mord.mtight { + margin-left: 0.16667em; +} +.katex .mop + .mop.mtight { + margin-left: 0.16667em; +} +.katex .mclose + .mop.mtight { + margin-left: 0.16667em; +} +.katex .minner + .mop.mtight { + margin-left: 0.16667em; +} +.katex .vlist-t { + display: inline-table; + table-layout: fixed; +} +.katex .vlist-r { + display: table-row; +} +.katex .vlist { + display: table-cell; + vertical-align: bottom; + position: relative; +} +.katex .vlist > span { + display: block; + height: 0; + position: relative; +} +.katex .vlist > span > span { + display: inline-block; +} +.katex .vlist > span > .pstrut { + overflow: hidden; + width: 0; +} +.katex .vlist-t2 { + margin-right: -2px; +} +.katex .vlist-s { + display: table-cell; + vertical-align: bottom; + font-size: 1px; + width: 2px; +} +.katex .msupsub { + text-align: left; +} +.katex .mfrac > span > span { + text-align: center; +} +.katex .mfrac .frac-line { + display: inline-block; + width: 100%; + border-bottom-style: solid; +} +.katex .mspace { + display: inline-block; +} +.katex .mspace.negativethinspace { + margin-left: -0.16667em; +} +.katex .mspace.thinspace { + width: 0.16667em; +} +.katex .mspace.negativemediumspace { + margin-left: -0.22222em; +} +.katex .mspace.mediumspace { + width: 0.22222em; +} +.katex .mspace.thickspace { + width: 0.27778em; +} +.katex .mspace.sixmuspace { + width: 0.333333em; +} +.katex .mspace.eightmuspace { + width: 0.444444em; +} +.katex .mspace.enspace { + width: 0.5em; +} +.katex .mspace.twelvemuspace { + width: 0.666667em; +} +.katex .mspace.quad { + width: 1em; +} +.katex .mspace.qquad { + width: 2em; +} +.katex .llap, +.katex .rlap { + width: 0; + position: relative; +} +.katex .llap > .inner, +.katex .rlap > .inner { + position: absolute; +} +.katex .llap > .fix, +.katex .rlap > .fix { + display: inline-block; +} +.katex .llap > .inner { + right: 0; +} +.katex .rlap > .inner { + left: 0; +} +.katex .katex-logo .a { + font-size: 0.75em; + margin-left: -0.32em; + position: relative; + top: -0.2em; +} +.katex .katex-logo .t { + margin-left: -0.23em; +} +.katex .katex-logo .e { + margin-left: -0.1667em; + position: relative; + top: 0.2155em; +} +.katex .katex-logo .x { + margin-left: -0.125em; +} +.katex .rule { + display: inline-block; + border: solid 0; + position: relative; +} +.katex .overline .overline-line, +.katex .underline .underline-line { + display: inline-block; + width: 100%; + border-bottom-style: solid; +} +.katex .sqrt > .root { + margin-left: 0.27777778em; + margin-right: -0.55555556em; +} +.katex .sizing, +.katex .fontsize-ensurer { + display: inline-block; +} +.katex .sizing.reset-size1.size1, +.katex .fontsize-ensurer.reset-size1.size1 { + font-size: 1em; +} +.katex .sizing.reset-size1.size2, +.katex .fontsize-ensurer.reset-size1.size2 { + font-size: 1.2em; +} +.katex .sizing.reset-size1.size3, +.katex .fontsize-ensurer.reset-size1.size3 { + font-size: 1.4em; +} +.katex .sizing.reset-size1.size4, +.katex .fontsize-ensurer.reset-size1.size4 { + font-size: 1.6em; +} +.katex .sizing.reset-size1.size5, +.katex .fontsize-ensurer.reset-size1.size5 { + font-size: 1.8em; +} +.katex .sizing.reset-size1.size6, +.katex .fontsize-ensurer.reset-size1.size6 { + font-size: 2em; +} +.katex .sizing.reset-size1.size7, +.katex .fontsize-ensurer.reset-size1.size7 { + font-size: 2.4em; +} +.katex .sizing.reset-size1.size8, +.katex .fontsize-ensurer.reset-size1.size8 { + font-size: 2.88em; +} +.katex .sizing.reset-size1.size9, +.katex .fontsize-ensurer.reset-size1.size9 { + font-size: 3.456em; +} +.katex .sizing.reset-size1.size10, +.katex .fontsize-ensurer.reset-size1.size10 { + font-size: 4.148em; +} +.katex .sizing.reset-size1.size11, +.katex .fontsize-ensurer.reset-size1.size11 { + font-size: 4.976em; +} +.katex .sizing.reset-size2.size1, +.katex .fontsize-ensurer.reset-size2.size1 { + font-size: 0.83333333em; +} +.katex .sizing.reset-size2.size2, +.katex .fontsize-ensurer.reset-size2.size2 { + font-size: 1em; +} +.katex .sizing.reset-size2.size3, +.katex .fontsize-ensurer.reset-size2.size3 { + font-size: 1.16666667em; +} +.katex .sizing.reset-size2.size4, +.katex .fontsize-ensurer.reset-size2.size4 { + font-size: 1.33333333em; +} +.katex .sizing.reset-size2.size5, +.katex .fontsize-ensurer.reset-size2.size5 { + font-size: 1.5em; +} +.katex .sizing.reset-size2.size6, +.katex .fontsize-ensurer.reset-size2.size6 { + font-size: 1.66666667em; +} +.katex .sizing.reset-size2.size7, +.katex .fontsize-ensurer.reset-size2.size7 { + font-size: 2em; +} +.katex .sizing.reset-size2.size8, +.katex .fontsize-ensurer.reset-size2.size8 { + font-size: 2.4em; +} +.katex .sizing.reset-size2.size9, +.katex .fontsize-ensurer.reset-size2.size9 { + font-size: 2.88em; +} +.katex .sizing.reset-size2.size10, +.katex .fontsize-ensurer.reset-size2.size10 { + font-size: 3.45666667em; +} +.katex .sizing.reset-size2.size11, +.katex .fontsize-ensurer.reset-size2.size11 { + font-size: 4.14666667em; +} +.katex .sizing.reset-size3.size1, +.katex .fontsize-ensurer.reset-size3.size1 { + font-size: 0.71428571em; +} +.katex .sizing.reset-size3.size2, +.katex .fontsize-ensurer.reset-size3.size2 { + font-size: 0.85714286em; +} +.katex .sizing.reset-size3.size3, +.katex .fontsize-ensurer.reset-size3.size3 { + font-size: 1em; +} +.katex .sizing.reset-size3.size4, +.katex .fontsize-ensurer.reset-size3.size4 { + font-size: 1.14285714em; +} +.katex .sizing.reset-size3.size5, +.katex .fontsize-ensurer.reset-size3.size5 { + font-size: 1.28571429em; +} +.katex .sizing.reset-size3.size6, +.katex .fontsize-ensurer.reset-size3.size6 { + font-size: 1.42857143em; +} +.katex .sizing.reset-size3.size7, +.katex .fontsize-ensurer.reset-size3.size7 { + font-size: 1.71428571em; +} +.katex .sizing.reset-size3.size8, +.katex .fontsize-ensurer.reset-size3.size8 { + font-size: 2.05714286em; +} +.katex .sizing.reset-size3.size9, +.katex .fontsize-ensurer.reset-size3.size9 { + font-size: 2.46857143em; +} +.katex .sizing.reset-size3.size10, +.katex .fontsize-ensurer.reset-size3.size10 { + font-size: 2.96285714em; +} +.katex .sizing.reset-size3.size11, +.katex .fontsize-ensurer.reset-size3.size11 { + font-size: 3.55428571em; +} +.katex .sizing.reset-size4.size1, +.katex .fontsize-ensurer.reset-size4.size1 { + font-size: 0.625em; +} +.katex .sizing.reset-size4.size2, +.katex .fontsize-ensurer.reset-size4.size2 { + font-size: 0.75em; +} +.katex .sizing.reset-size4.size3, +.katex .fontsize-ensurer.reset-size4.size3 { + font-size: 0.875em; +} +.katex .sizing.reset-size4.size4, +.katex .fontsize-ensurer.reset-size4.size4 { + font-size: 1em; +} +.katex .sizing.reset-size4.size5, +.katex .fontsize-ensurer.reset-size4.size5 { + font-size: 1.125em; +} +.katex .sizing.reset-size4.size6, +.katex .fontsize-ensurer.reset-size4.size6 { + font-size: 1.25em; +} +.katex .sizing.reset-size4.size7, +.katex .fontsize-ensurer.reset-size4.size7 { + font-size: 1.5em; +} +.katex .sizing.reset-size4.size8, +.katex .fontsize-ensurer.reset-size4.size8 { + font-size: 1.8em; +} +.katex .sizing.reset-size4.size9, +.katex .fontsize-ensurer.reset-size4.size9 { + font-size: 2.16em; +} +.katex .sizing.reset-size4.size10, +.katex .fontsize-ensurer.reset-size4.size10 { + font-size: 2.5925em; +} +.katex .sizing.reset-size4.size11, +.katex .fontsize-ensurer.reset-size4.size11 { + font-size: 3.11em; +} +.katex .sizing.reset-size5.size1, +.katex .fontsize-ensurer.reset-size5.size1 { + font-size: 0.55555556em; +} +.katex .sizing.reset-size5.size2, +.katex .fontsize-ensurer.reset-size5.size2 { + font-size: 0.66666667em; +} +.katex .sizing.reset-size5.size3, +.katex .fontsize-ensurer.reset-size5.size3 { + font-size: 0.77777778em; +} +.katex .sizing.reset-size5.size4, +.katex .fontsize-ensurer.reset-size5.size4 { + font-size: 0.88888889em; +} +.katex .sizing.reset-size5.size5, +.katex .fontsize-ensurer.reset-size5.size5 { + font-size: 1em; +} +.katex .sizing.reset-size5.size6, +.katex .fontsize-ensurer.reset-size5.size6 { + font-size: 1.11111111em; +} +.katex .sizing.reset-size5.size7, +.katex .fontsize-ensurer.reset-size5.size7 { + font-size: 1.33333333em; +} +.katex .sizing.reset-size5.size8, +.katex .fontsize-ensurer.reset-size5.size8 { + font-size: 1.6em; +} +.katex .sizing.reset-size5.size9, +.katex .fontsize-ensurer.reset-size5.size9 { + font-size: 1.92em; +} +.katex .sizing.reset-size5.size10, +.katex .fontsize-ensurer.reset-size5.size10 { + font-size: 2.30444444em; +} +.katex .sizing.reset-size5.size11, +.katex .fontsize-ensurer.reset-size5.size11 { + font-size: 2.76444444em; +} +.katex .sizing.reset-size6.size1, +.katex .fontsize-ensurer.reset-size6.size1 { + font-size: 0.5em; +} +.katex .sizing.reset-size6.size2, +.katex .fontsize-ensurer.reset-size6.size2 { + font-size: 0.6em; +} +.katex .sizing.reset-size6.size3, +.katex .fontsize-ensurer.reset-size6.size3 { + font-size: 0.7em; +} +.katex .sizing.reset-size6.size4, +.katex .fontsize-ensurer.reset-size6.size4 { + font-size: 0.8em; +} +.katex .sizing.reset-size6.size5, +.katex .fontsize-ensurer.reset-size6.size5 { + font-size: 0.9em; +} +.katex .sizing.reset-size6.size6, +.katex .fontsize-ensurer.reset-size6.size6 { + font-size: 1em; +} +.katex .sizing.reset-size6.size7, +.katex .fontsize-ensurer.reset-size6.size7 { + font-size: 1.2em; +} +.katex .sizing.reset-size6.size8, +.katex .fontsize-ensurer.reset-size6.size8 { + font-size: 1.44em; +} +.katex .sizing.reset-size6.size9, +.katex .fontsize-ensurer.reset-size6.size9 { + font-size: 1.728em; +} +.katex .sizing.reset-size6.size10, +.katex .fontsize-ensurer.reset-size6.size10 { + font-size: 2.074em; +} +.katex .sizing.reset-size6.size11, +.katex .fontsize-ensurer.reset-size6.size11 { + font-size: 2.488em; +} +.katex .sizing.reset-size7.size1, +.katex .fontsize-ensurer.reset-size7.size1 { + font-size: 0.41666667em; +} +.katex .sizing.reset-size7.size2, +.katex .fontsize-ensurer.reset-size7.size2 { + font-size: 0.5em; +} +.katex .sizing.reset-size7.size3, +.katex .fontsize-ensurer.reset-size7.size3 { + font-size: 0.58333333em; +} +.katex .sizing.reset-size7.size4, +.katex .fontsize-ensurer.reset-size7.size4 { + font-size: 0.66666667em; +} +.katex .sizing.reset-size7.size5, +.katex .fontsize-ensurer.reset-size7.size5 { + font-size: 0.75em; +} +.katex .sizing.reset-size7.size6, +.katex .fontsize-ensurer.reset-size7.size6 { + font-size: 0.83333333em; +} +.katex .sizing.reset-size7.size7, +.katex .fontsize-ensurer.reset-size7.size7 { + font-size: 1em; +} +.katex .sizing.reset-size7.size8, +.katex .fontsize-ensurer.reset-size7.size8 { + font-size: 1.2em; +} +.katex .sizing.reset-size7.size9, +.katex .fontsize-ensurer.reset-size7.size9 { + font-size: 1.44em; +} +.katex .sizing.reset-size7.size10, +.katex .fontsize-ensurer.reset-size7.size10 { + font-size: 1.72833333em; +} +.katex .sizing.reset-size7.size11, +.katex .fontsize-ensurer.reset-size7.size11 { + font-size: 2.07333333em; +} +.katex .sizing.reset-size8.size1, +.katex .fontsize-ensurer.reset-size8.size1 { + font-size: 0.34722222em; +} +.katex .sizing.reset-size8.size2, +.katex .fontsize-ensurer.reset-size8.size2 { + font-size: 0.41666667em; +} +.katex .sizing.reset-size8.size3, +.katex .fontsize-ensurer.reset-size8.size3 { + font-size: 0.48611111em; +} +.katex .sizing.reset-size8.size4, +.katex .fontsize-ensurer.reset-size8.size4 { + font-size: 0.55555556em; +} +.katex .sizing.reset-size8.size5, +.katex .fontsize-ensurer.reset-size8.size5 { + font-size: 0.625em; +} +.katex .sizing.reset-size8.size6, +.katex .fontsize-ensurer.reset-size8.size6 { + font-size: 0.69444444em; +} +.katex .sizing.reset-size8.size7, +.katex .fontsize-ensurer.reset-size8.size7 { + font-size: 0.83333333em; +} +.katex .sizing.reset-size8.size8, +.katex .fontsize-ensurer.reset-size8.size8 { + font-size: 1em; +} +.katex .sizing.reset-size8.size9, +.katex .fontsize-ensurer.reset-size8.size9 { + font-size: 1.2em; +} +.katex .sizing.reset-size8.size10, +.katex .fontsize-ensurer.reset-size8.size10 { + font-size: 1.44027778em; +} +.katex .sizing.reset-size8.size11, +.katex .fontsize-ensurer.reset-size8.size11 { + font-size: 1.72777778em; +} +.katex .sizing.reset-size9.size1, +.katex .fontsize-ensurer.reset-size9.size1 { + font-size: 0.28935185em; +} +.katex .sizing.reset-size9.size2, +.katex .fontsize-ensurer.reset-size9.size2 { + font-size: 0.34722222em; +} +.katex .sizing.reset-size9.size3, +.katex .fontsize-ensurer.reset-size9.size3 { + font-size: 0.40509259em; +} +.katex .sizing.reset-size9.size4, +.katex .fontsize-ensurer.reset-size9.size4 { + font-size: 0.46296296em; +} +.katex .sizing.reset-size9.size5, +.katex .fontsize-ensurer.reset-size9.size5 { + font-size: 0.52083333em; +} +.katex .sizing.reset-size9.size6, +.katex .fontsize-ensurer.reset-size9.size6 { + font-size: 0.5787037em; +} +.katex .sizing.reset-size9.size7, +.katex .fontsize-ensurer.reset-size9.size7 { + font-size: 0.69444444em; +} +.katex .sizing.reset-size9.size8, +.katex .fontsize-ensurer.reset-size9.size8 { + font-size: 0.83333333em; +} +.katex .sizing.reset-size9.size9, +.katex .fontsize-ensurer.reset-size9.size9 { + font-size: 1em; +} +.katex .sizing.reset-size9.size10, +.katex .fontsize-ensurer.reset-size9.size10 { + font-size: 1.20023148em; +} +.katex .sizing.reset-size9.size11, +.katex .fontsize-ensurer.reset-size9.size11 { + font-size: 1.43981481em; +} +.katex .sizing.reset-size10.size1, +.katex .fontsize-ensurer.reset-size10.size1 { + font-size: 0.24108004em; +} +.katex .sizing.reset-size10.size2, +.katex .fontsize-ensurer.reset-size10.size2 { + font-size: 0.28929605em; +} +.katex .sizing.reset-size10.size3, +.katex .fontsize-ensurer.reset-size10.size3 { + font-size: 0.33751205em; +} +.katex .sizing.reset-size10.size4, +.katex .fontsize-ensurer.reset-size10.size4 { + font-size: 0.38572806em; +} +.katex .sizing.reset-size10.size5, +.katex .fontsize-ensurer.reset-size10.size5 { + font-size: 0.43394407em; +} +.katex .sizing.reset-size10.size6, +.katex .fontsize-ensurer.reset-size10.size6 { + font-size: 0.48216008em; +} +.katex .sizing.reset-size10.size7, +.katex .fontsize-ensurer.reset-size10.size7 { + font-size: 0.57859209em; +} +.katex .sizing.reset-size10.size8, +.katex .fontsize-ensurer.reset-size10.size8 { + font-size: 0.69431051em; +} +.katex .sizing.reset-size10.size9, +.katex .fontsize-ensurer.reset-size10.size9 { + font-size: 0.83317261em; +} +.katex .sizing.reset-size10.size10, +.katex .fontsize-ensurer.reset-size10.size10 { + font-size: 1em; +} +.katex .sizing.reset-size10.size11, +.katex .fontsize-ensurer.reset-size10.size11 { + font-size: 1.19961427em; +} +.katex .sizing.reset-size11.size1, +.katex .fontsize-ensurer.reset-size11.size1 { + font-size: 0.20096463em; +} +.katex .sizing.reset-size11.size2, +.katex .fontsize-ensurer.reset-size11.size2 { + font-size: 0.24115756em; +} +.katex .sizing.reset-size11.size3, +.katex .fontsize-ensurer.reset-size11.size3 { + font-size: 0.28135048em; +} +.katex .sizing.reset-size11.size4, +.katex .fontsize-ensurer.reset-size11.size4 { + font-size: 0.32154341em; +} +.katex .sizing.reset-size11.size5, +.katex .fontsize-ensurer.reset-size11.size5 { + font-size: 0.36173633em; +} +.katex .sizing.reset-size11.size6, +.katex .fontsize-ensurer.reset-size11.size6 { + font-size: 0.40192926em; +} +.katex .sizing.reset-size11.size7, +.katex .fontsize-ensurer.reset-size11.size7 { + font-size: 0.48231511em; +} +.katex .sizing.reset-size11.size8, +.katex .fontsize-ensurer.reset-size11.size8 { + font-size: 0.57877814em; +} +.katex .sizing.reset-size11.size9, +.katex .fontsize-ensurer.reset-size11.size9 { + font-size: 0.69453376em; +} +.katex .sizing.reset-size11.size10, +.katex .fontsize-ensurer.reset-size11.size10 { + font-size: 0.83360129em; +} +.katex .sizing.reset-size11.size11, +.katex .fontsize-ensurer.reset-size11.size11 { + font-size: 1em; +} +.katex .delimsizing.size1 { + font-family: KaTeX_Size1; +} +.katex .delimsizing.size2 { + font-family: KaTeX_Size2; +} +.katex .delimsizing.size3 { + font-family: KaTeX_Size3; +} +.katex .delimsizing.size4 { + font-family: KaTeX_Size4; +} +.katex .delimsizing.mult .delim-size1 > span { + font-family: KaTeX_Size1; +} +.katex .delimsizing.mult .delim-size4 > span { + font-family: KaTeX_Size4; +} +.katex .nulldelimiter { + display: inline-block; + width: 0.12em; +} +.katex .delimcenter { + position: relative; +} +.katex .op-symbol { + position: relative; +} +.katex .op-symbol.small-op { + font-family: KaTeX_Size1; +} +.katex .op-symbol.large-op { + font-family: KaTeX_Size2; +} +.katex .op-limits > .vlist-t { + text-align: center; +} +.katex .accent > .vlist-t { + text-align: center; +} +.katex .accent .accent-body > span { + width: 0; +} +.katex .accent .accent-body.accent-vec > span { + position: relative; + left: 0.326em; +} +.katex .accent .accent-body.accent-hungarian > span { + position: relative; + left: 0.250em; +} +.katex .mtable .vertical-separator { + display: inline-block; + margin: 0 -0.025em; + border-right: 0.05em solid black; +} +.katex .mtable .arraycolsep { + display: inline-block; +} +.katex .mtable .col-align-c > .vlist-t { + text-align: center; +} +.katex .mtable .col-align-l > .vlist-t { + text-align: left; +} +.katex .mtable .col-align-r > .vlist-t { + text-align: right; +} +.katex .svg-align { + text-align: left; +} +.katex svg { + display: block; + position: absolute; + width: 100%; +} +.katex svg path { + fill: currentColor; +} +.katex svg line { + stroke: currentColor; +} +.katex .stretchy { + width: 100%; + display: block; +} +.katex .stretchy:before, +.katex .stretchy:after { + content: ""; +} +.katex .x-arrow-pad { + padding: 0 0.5em; +} +.katex .x-arrow, +.katex .mover, +.katex .munder { + text-align: center; +} +.katex .boxpad { + padding: 0 0.3em 0 0.3em; +} +.katex .fbox { + box-sizing: border-box; + border: 0.04em solid black; +} +.katex .cancel-pad { + padding: 0 0.2em 0 0.2em; +} +.katex .mord + .cancel-lap, +.katex .mbin + .cancel-lap { + margin-left: -0.2em; +} +.katex .cancel-lap + .mord, +.katex .cancel-lap + .mbin, +.katex .cancel-lap + .msupsub { + margin-left: -0.2em; +} +.katex .sout { + border-bottom-style: solid; + border-bottom-width: 0.08em; +} diff --git a/static/katex/katex.js b/static/katex/katex.js new file mode 100644 index 00000000..7e018746 --- /dev/null +++ b/static/katex/katex.js @@ -0,0 +1,10788 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.katex = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 0; --i) { + tok = expansion[i]; + if (tok.text === "#") { + if (i === 0) { + throw new _ParseError2.default("Incomplete placeholder at end of macro body", tok); + } + tok = expansion[--i]; // next token on stack + if (tok.text === "#") { + // ## → # + expansion.splice(i + 1, 1); // drop first # + } else if (/^[1-9]$/.test(tok.text)) { + // expansion.splice(i, 2, arg[0], arg[1], …) + // to replace placeholder with the indicated argument. + // TODO: use spread once we move to ES2015 + expansion.splice.apply(expansion, [i, 2].concat(args[tok.text - 1])); + } else { + throw new _ParseError2.default("Not a valid argument number", tok); + } + } + } + } + this.stack = this.stack.concat(expansion); + } + } + }, { + key: "get", + value: function get(ignoreSpace) { + this.discardedWhiteSpace = []; + var token = this.nextToken(); + if (ignoreSpace) { + while (token.text === " ") { + this.discardedWhiteSpace.push(token); + token = this.nextToken(); + } + } + return token; + } + + /** + * Undo the effect of the preceding call to the get method. + * A call to this method MUST be immediately preceded and immediately followed + * by a call to get. Only used during mode switching, i.e. after one token + * was got in the old mode but should get got again in a new mode + * with possibly different whitespace handling. + */ + + }, { + key: "unget", + value: function unget(token) { + this.stack.push(token); + while (this.discardedWhiteSpace.length !== 0) { + this.stack.push(this.discardedWhiteSpace.pop()); + } + } + }]); + return MacroExpander; +}(); + +module.exports = MacroExpander; + +},{"./Lexer":26,"./ParseError":29,"./macros":44,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5,"object-assign":25}],28:[function(require,module,exports){ +"use strict"; + +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _createClass2 = require("babel-runtime/helpers/createClass"); + +var _createClass3 = _interopRequireDefault(_createClass2); + +var _fontMetrics2 = require("./fontMetrics"); + +var _fontMetrics3 = _interopRequireDefault(_fontMetrics2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BASESIZE = 6; /** + * This file contains information about the options that the Parser carries + * around with it while parsing. Data is held in an `Options` object, and when + * recursing, a new `Options` object can be created with the `.with*` and + * `.reset` functions. + */ + +var sizeStyleMap = [ +// Each element contains [textsize, scriptsize, scriptscriptsize]. +// The size mappings are taken from TeX with \normalsize=10pt. +[1, 1, 1], // size1: [5, 5, 5] \tiny +[2, 1, 1], // size2: [6, 5, 5] +[3, 1, 1], // size3: [7, 5, 5] \scriptsize +[4, 2, 1], // size4: [8, 6, 5] \footnotesize +[5, 2, 1], // size5: [9, 6, 5] \small +[6, 3, 1], // size6: [10, 7, 5] \normalsize +[7, 4, 2], // size7: [12, 8, 6] \large +[8, 6, 3], // size8: [14.4, 10, 7] \Large +[9, 7, 6], // size9: [17.28, 12, 10] \LARGE +[10, 8, 7], // size10: [20.74, 14.4, 12] \huge +[11, 10, 9]]; + +var sizeMultipliers = [ +// fontMetrics.js:getFontMetrics also uses size indexes, so if +// you change size indexes, change that function. +0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.44, 1.728, 2.074, 2.488]; + +var sizeAtStyle = function sizeAtStyle(size, style) { + return style.size < 2 ? size : sizeStyleMap[size - 1][style.size - 1]; +}; + +/** + * This is the main options class. It contains the current style, size, color, + * and font. + * + * Options objects should not be modified. To create a new Options with + * different properties, call a `.having*` method. + */ + +var Options = function () { + function Options(data) { + (0, _classCallCheck3.default)(this, Options); + + this.style = data.style; + this.color = data.color; + this.size = data.size || BASESIZE; + this.textSize = data.textSize || this.size; + this.phantom = data.phantom; + this.font = data.font; + this.sizeMultiplier = sizeMultipliers[this.size - 1]; + this._fontMetrics = null; + } + + /** + * Returns a new options object with the same properties as "this". Properties + * from "extension" will be copied to the new options object. + */ + + + (0, _createClass3.default)(Options, [{ + key: "extend", + value: function extend(extension) { + var data = { + style: this.style, + size: this.size, + textSize: this.textSize, + color: this.color, + phantom: this.phantom, + font: this.font + }; + + for (var key in extension) { + if (extension.hasOwnProperty(key)) { + data[key] = extension[key]; + } + } + + return new Options(data); + } + + /** + * Return an options object with the given style. If `this.style === style`, + * returns `this`. + */ + + }, { + key: "havingStyle", + value: function havingStyle(style) { + if (this.style === style) { + return this; + } else { + return this.extend({ + style: style, + size: sizeAtStyle(this.textSize, style) + }); + } + } + + /** + * Return an options object with a cramped version of the current style. If + * the current style is cramped, returns `this`. + */ + + }, { + key: "havingCrampedStyle", + value: function havingCrampedStyle() { + return this.havingStyle(this.style.cramp()); + } + + /** + * Return an options object with the given size and in at least `\textstyle`. + * Returns `this` if appropriate. + */ + + }, { + key: "havingSize", + value: function havingSize(size) { + if (this.size === size && this.textSize === size) { + return this; + } else { + return this.extend({ + style: this.style.text(), + size: size, + textSize: size + }); + } + } + + /** + * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted, + * changes to at least `\textstyle`. + */ + + }, { + key: "havingBaseStyle", + value: function havingBaseStyle(style) { + style = style || this.style.text(); + var wantSize = sizeAtStyle(BASESIZE, style); + if (this.size === wantSize && this.textSize === BASESIZE && this.style === style) { + return this; + } else { + return this.extend({ + style: style, + size: wantSize, + baseSize: BASESIZE + }); + } + } + + /** + * Create a new options object with the given color. + */ + + }, { + key: "withColor", + value: function withColor(color) { + return this.extend({ + color: color + }); + } + + /** + * Create a new options object with "phantom" set to true. + */ + + }, { + key: "withPhantom", + value: function withPhantom() { + return this.extend({ + phantom: true + }); + } + + /** + * Create a new options objects with the give font. + */ + + }, { + key: "withFont", + value: function withFont(font) { + return this.extend({ + font: font || this.font + }); + } + + /** + * Return the CSS sizing classes required to switch from enclosing options + * `oldOptions` to `this`. Returns an array of classes. + */ + + }, { + key: "sizingClasses", + value: function sizingClasses(oldOptions) { + if (oldOptions.size !== this.size) { + return ["sizing", "reset-size" + oldOptions.size, "size" + this.size]; + } else { + return []; + } + } + + /** + * Return the CSS sizing classes required to switch to the base size. Like + * `this.havingSize(BASESIZE).sizingClasses(this)`. + */ + + }, { + key: "baseSizingClasses", + value: function baseSizingClasses() { + if (this.size !== BASESIZE) { + return ["sizing", "reset-size" + this.size, "size" + BASESIZE]; + } else { + return []; + } + } + + /** + * Return the font metrics for this size. + */ + + }, { + key: "fontMetrics", + value: function fontMetrics() { + if (!this._fontMetrics) { + this._fontMetrics = _fontMetrics3.default.getFontMetrics(this.size); + } + return this._fontMetrics; + } + + /** + * A map of color names to CSS colors. + * TODO(emily): Remove this when we have real macros + */ + + }, { + key: "getColor", + + + /** + * Gets the CSS color of the current options object, accounting for the + * `colorMap`. + */ + value: function getColor() { + if (this.phantom) { + return "transparent"; + } else { + return Options.colorMap[this.color] || this.color; + } + } + }]); + return Options; +}(); + +/** + * The base size index. + */ + + +Options.colorMap = { + "katex-blue": "#6495ed", + "katex-orange": "#ffa500", + "katex-pink": "#ff00af", + "katex-red": "#df0030", + "katex-green": "#28ae7b", + "katex-gray": "gray", + "katex-purple": "#9d38bd", + "katex-blueA": "#ccfaff", + "katex-blueB": "#80f6ff", + "katex-blueC": "#63d9ea", + "katex-blueD": "#11accd", + "katex-blueE": "#0c7f99", + "katex-tealA": "#94fff5", + "katex-tealB": "#26edd5", + "katex-tealC": "#01d1c1", + "katex-tealD": "#01a995", + "katex-tealE": "#208170", + "katex-greenA": "#b6ffb0", + "katex-greenB": "#8af281", + "katex-greenC": "#74cf70", + "katex-greenD": "#1fab54", + "katex-greenE": "#0d923f", + "katex-goldA": "#ffd0a9", + "katex-goldB": "#ffbb71", + "katex-goldC": "#ff9c39", + "katex-goldD": "#e07d10", + "katex-goldE": "#a75a05", + "katex-redA": "#fca9a9", + "katex-redB": "#ff8482", + "katex-redC": "#f9685d", + "katex-redD": "#e84d39", + "katex-redE": "#bc2612", + "katex-maroonA": "#ffbde0", + "katex-maroonB": "#ff92c6", + "katex-maroonC": "#ed5fa6", + "katex-maroonD": "#ca337c", + "katex-maroonE": "#9e034e", + "katex-purpleA": "#ddd7ff", + "katex-purpleB": "#c6b9fc", + "katex-purpleC": "#aa87ff", + "katex-purpleD": "#7854ab", + "katex-purpleE": "#543b78", + "katex-mintA": "#f5f9e8", + "katex-mintB": "#edf2df", + "katex-mintC": "#e0e5cc", + "katex-grayA": "#f6f7f7", + "katex-grayB": "#f0f1f2", + "katex-grayC": "#e3e5e6", + "katex-grayD": "#d6d8da", + "katex-grayE": "#babec2", + "katex-grayF": "#888d93", + "katex-grayG": "#626569", + "katex-grayH": "#3b3e40", + "katex-grayI": "#21242c", + "katex-kaBlue": "#314453", + "katex-kaGreen": "#71B307" +}; +Options.BASESIZE = BASESIZE; + +module.exports = Options; + +},{"./fontMetrics":41,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],29:[function(require,module,exports){ +"use strict"; + +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * This is the ParseError class, which is the main error thrown by KaTeX + * functions when something has gone wrong. This is used to distinguish internal + * errors from errors in the expression that the user provided. + * + * If possible, a caller should provide a Token or ParseNode with information + * about where in the source string the problem occurred. + * + * @param {string} message The error message + * @param {(Token|ParseNode)=} token An object providing position information + */ +var ParseError = function ParseError(message, token) { + (0, _classCallCheck3.default)(this, ParseError); + + var error = "KaTeX parse error: " + message; + var start = void 0; + var end = void 0; + + if (token && token.lexer && token.start <= token.end) { + // If we have the input and a position, make the error a bit fancier + + // Get the input + var input = token.lexer.input; + + // Prepend some information + start = token.start; + end = token.end; + if (start === input.length) { + error += " at end of input: "; + } else { + error += " at position " + (start + 1) + ": "; + } + + // Underline token in question using combining underscores + var underlined = input.slice(start, end).replace(/[^]/g, "$&\u0332"); + + // Extract some context from the input and add it to the error + var left = void 0; + if (start > 15) { + left = "…" + input.slice(start - 15, start); + } else { + left = input.slice(0, start); + } + var right = void 0; + if (end + 15 < input.length) { + right = input.slice(end, end + 15) + "…"; + } else { + right = input.slice(end); + } + error += left + underlined + right; + } + + // Some hackery to make ParseError a prototype of Error + // See http://stackoverflow.com/a/8460753 + var self = new Error(error); + self.name = "ParseError"; + self.__proto__ = ParseError.prototype; + + self.position = start; + return self; +}; + +// More hackery + + +ParseError.prototype.__proto__ = Error.prototype; + +module.exports = ParseError; + +},{"babel-runtime/helpers/classCallCheck":4}],30:[function(require,module,exports){ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The resulting parse tree nodes of the parse tree. + * + * It is possible to provide position information, so that a ParseNode can + * fulfil a role similar to a Token in error reporting. + * For details on the corresponding properties see Token constructor. + * Providing such information can lead to better error reporting. + * + * @param {string} type type of node, like e.g. "ordgroup" + * @param {?object} value type-specific representation of the node + * @param {string} mode parse mode in action for this node, + * "math" or "text" + * @param {Token=} firstToken first token of the input for this node, + * will omit position information if unset + * @param {Token=} lastToken last token of the input for this node, + * will default to firstToken if unset + */ +var ParseNode = function ParseNode(type, value, mode, firstToken, lastToken) { + (0, _classCallCheck3.default)(this, ParseNode); + + this.type = type; + this.value = value; + this.mode = mode; + if (firstToken && (!lastToken || lastToken.lexer === firstToken.lexer)) { + this.lexer = firstToken.lexer; + this.start = firstToken.start; + this.end = (lastToken || firstToken).end; + } +}; + +exports.default = ParseNode; + +},{"babel-runtime/helpers/classCallCheck":4}],31:[function(require,module,exports){ +"use strict"; + +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _createClass2 = require("babel-runtime/helpers/createClass"); + +var _createClass3 = _interopRequireDefault(_createClass2); + +var _functions = require("./functions"); + +var _functions2 = _interopRequireDefault(_functions); + +var _environments = require("./environments"); + +var _environments2 = _interopRequireDefault(_environments); + +var _MacroExpander = require("./MacroExpander"); + +var _MacroExpander2 = _interopRequireDefault(_MacroExpander); + +var _symbols = require("./symbols"); + +var _symbols2 = _interopRequireDefault(_symbols); + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +var _units = require("./units"); + +var _units2 = _interopRequireDefault(_units); + +var _unicodeRegexes = require("./unicodeRegexes"); + +var _ParseNode = require("./ParseNode"); + +var _ParseNode2 = _interopRequireDefault(_ParseNode); + +var _ParseError = require("./ParseError"); + +var _ParseError2 = _interopRequireDefault(_ParseError); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * This file contains the parser used to parse out a TeX expression from the + * input. Since TeX isn't context-free, standard parsers don't work particularly + * well. + * + * The strategy of this parser is as such: + * + * The main functions (the `.parse...` ones) take a position in the current + * parse string to parse tokens from. The lexer (found in Lexer.js, stored at + * this.lexer) also supports pulling out tokens at arbitrary places. When + * individual tokens are needed at a position, the lexer is called to pull out a + * token, which is then used. + * + * The parser has a property called "mode" indicating the mode that + * the parser is currently in. Currently it has to be one of "math" or + * "text", which denotes whether the current environment is a math-y + * one or a text-y one (e.g. inside \text). Currently, this serves to + * limit the functions which can be used in text mode. + * + * The main functions then return an object which contains the useful data that + * was parsed at its given point, and a new position at the end of the parsed + * data. The main functions can call each other and continue the parsing by + * using the returned position as a new starting point. + * + * There are also extra `.handle...` functions, which pull out some reused + * functionality into self-contained functions. + * + * The earlier functions return ParseNodes. + * The later functions (which are called deeper in the parse) sometimes return + * ParseFuncOrArgument, which contain a ParseNode as well as some data about + * whether the parsed object is a function which is missing some arguments, or a + * standalone object which can be used as an argument to another function. + */ + +/** + * An initial function (without its arguments), or an argument to a function. + * The `result` argument should be a ParseNode. + */ +function ParseFuncOrArgument(result, isFunction, token) { + this.result = result; + // Is this a function (i.e. is it something defined in functions.js)? + this.isFunction = isFunction; + this.token = token; +} /* eslint no-constant-condition:0 */ + +var Parser = function () { + function Parser(input, settings) { + (0, _classCallCheck3.default)(this, Parser); + + // Create a new macro expander (gullet) and (indirectly via that) also a + // new lexer (mouth) for this parser (stomach, in the language of TeX) + this.gullet = new _MacroExpander2.default(input, settings.macros); + // Use old \color behavior (same as LaTeX's \textcolor) if requested. + // We do this after the macros object has been copied by MacroExpander. + if (settings.colorIsTextColor) { + this.gullet.macros["\\color"] = "\\textcolor"; + } + // Store the settings for use in parsing + this.settings = settings; + // Count leftright depth (for \middle errors) + this.leftrightDepth = 0; + } + + /** + * Checks a result to make sure it has the right type, and throws an + * appropriate error otherwise. + * + * @param {boolean=} consume whether to consume the expected token, + * defaults to true + */ + + + (0, _createClass3.default)(Parser, [{ + key: "expect", + value: function expect(text, consume) { + if (this.nextToken.text !== text) { + throw new _ParseError2.default("Expected '" + text + "', got '" + this.nextToken.text + "'", this.nextToken); + } + if (consume !== false) { + this.consume(); + } + } + + /** + * Considers the current look ahead token as consumed, + * and fetches the one after that as the new look ahead. + */ + + }, { + key: "consume", + value: function consume() { + this.nextToken = this.gullet.get(this.mode === "math"); + } + }, { + key: "switchMode", + value: function switchMode(newMode) { + this.gullet.unget(this.nextToken); + this.mode = newMode; + this.consume(); + } + + /** + * Main parsing function, which parses an entire input. + * + * @return {?Array.} + */ + + }, { + key: "parse", + value: function parse() { + // Try to parse the input + this.mode = "math"; + this.consume(); + var parse = this.parseInput(); + return parse; + } + + /** + * Parses an entire input tree. + */ + + }, { + key: "parseInput", + value: function parseInput() { + // Parse an expression + var expression = this.parseExpression(false); + // If we succeeded, make sure there's an EOF at the end + this.expect("EOF", false); + return expression; + } + }, { + key: "parseExpression", + + + /** + * Parses an "expression", which is a list of atoms. + * + * @param {boolean} breakOnInfix Should the parsing stop when we hit infix + * nodes? This happens when functions have higher precendence + * than infix nodes in implicit parses. + * + * @param {?string} breakOnTokenText The text of the token that the expression + * should end with, or `null` if something else should end the + * expression. + * + * @return {ParseNode} + */ + value: function parseExpression(breakOnInfix, breakOnTokenText) { + var body = []; + // Keep adding atoms to the body until we can't parse any more atoms (either + // we reached the end, a }, or a \right) + while (true) { + var lex = this.nextToken; + if (Parser.endOfExpression.indexOf(lex.text) !== -1) { + break; + } + if (breakOnTokenText && lex.text === breakOnTokenText) { + break; + } + if (breakOnInfix && _functions2.default[lex.text] && _functions2.default[lex.text].infix) { + break; + } + var atom = this.parseAtom(); + if (!atom) { + if (!this.settings.throwOnError && lex.text[0] === "\\") { + var errorNode = this.handleUnsupportedCmd(); + body.push(errorNode); + continue; + } + + break; + } + body.push(atom); + } + return this.handleInfixNodes(body); + } + + /** + * Rewrites infix operators such as \over with corresponding commands such + * as \frac. + * + * There can only be one infix operator per group. If there's more than one + * then the expression is ambiguous. This can be resolved by adding {}. + * + * @returns {Array} + */ + + }, { + key: "handleInfixNodes", + value: function handleInfixNodes(body) { + var overIndex = -1; + var funcName = void 0; + + for (var i = 0; i < body.length; i++) { + var node = body[i]; + if (node.type === "infix") { + if (overIndex !== -1) { + throw new _ParseError2.default("only one infix operator per group", node.value.token); + } + overIndex = i; + funcName = node.value.replaceWith; + } + } + + if (overIndex !== -1) { + var numerNode = void 0; + var denomNode = void 0; + + var numerBody = body.slice(0, overIndex); + var denomBody = body.slice(overIndex + 1); + + if (numerBody.length === 1 && numerBody[0].type === "ordgroup") { + numerNode = numerBody[0]; + } else { + numerNode = new _ParseNode2.default("ordgroup", numerBody, this.mode); + } + + if (denomBody.length === 1 && denomBody[0].type === "ordgroup") { + denomNode = denomBody[0]; + } else { + denomNode = new _ParseNode2.default("ordgroup", denomBody, this.mode); + } + + var value = this.callFunction(funcName, [numerNode, denomNode], null); + return [new _ParseNode2.default(value.type, value, this.mode)]; + } else { + return body; + } + } + + // The greediness of a superscript or subscript + + }, { + key: "handleSupSubscript", + + + /** + * Handle a subscript or superscript with nice errors. + */ + value: function handleSupSubscript(name) { + var symbolToken = this.nextToken; + var symbol = symbolToken.text; + this.consume(); + var group = this.parseGroup(); + + if (!group) { + if (!this.settings.throwOnError && this.nextToken.text[0] === "\\") { + return this.handleUnsupportedCmd(); + } else { + throw new _ParseError2.default("Expected group after '" + symbol + "'", symbolToken); + } + } else if (group.isFunction) { + // ^ and _ have a greediness, so handle interactions with functions' + // greediness + var funcGreediness = _functions2.default[group.result].greediness; + if (funcGreediness > Parser.SUPSUB_GREEDINESS) { + return this.parseFunction(group); + } else { + throw new _ParseError2.default("Got function '" + group.result + "' with no arguments " + "as " + name, symbolToken); + } + } else { + return group.result; + } + } + + /** + * Converts the textual input of an unsupported command into a text node + * contained within a color node whose color is determined by errorColor + */ + + }, { + key: "handleUnsupportedCmd", + value: function handleUnsupportedCmd() { + var text = this.nextToken.text; + var textordArray = []; + + for (var i = 0; i < text.length; i++) { + textordArray.push(new _ParseNode2.default("textord", text[i], "text")); + } + + var textNode = new _ParseNode2.default("text", { + body: textordArray, + type: "text" + }, this.mode); + + var colorNode = new _ParseNode2.default("color", { + color: this.settings.errorColor, + value: [textNode], + type: "color" + }, this.mode); + + this.consume(); + return colorNode; + } + + /** + * Parses a group with optional super/subscripts. + * + * @return {?ParseNode} + */ + + }, { + key: "parseAtom", + value: function parseAtom() { + // The body of an atom is an implicit group, so that things like + // \left(x\right)^2 work correctly. + var base = this.parseImplicitGroup(); + + // In text mode, we don't have superscripts or subscripts + if (this.mode === "text") { + return base; + } + + // Note that base may be empty (i.e. null) at this point. + + var superscript = void 0; + var subscript = void 0; + while (true) { + // Lex the first token + var lex = this.nextToken; + + if (lex.text === "\\limits" || lex.text === "\\nolimits") { + // We got a limit control + if (!base || base.type !== "op") { + throw new _ParseError2.default("Limit controls must follow a math operator", lex); + } else { + var limits = lex.text === "\\limits"; + base.value.limits = limits; + base.value.alwaysHandleSupSub = true; + } + this.consume(); + } else if (lex.text === "^") { + // We got a superscript start + if (superscript) { + throw new _ParseError2.default("Double superscript", lex); + } + superscript = this.handleSupSubscript("superscript"); + } else if (lex.text === "_") { + // We got a subscript start + if (subscript) { + throw new _ParseError2.default("Double subscript", lex); + } + subscript = this.handleSupSubscript("subscript"); + } else if (lex.text === "'") { + // We got a prime + if (superscript) { + throw new _ParseError2.default("Double superscript", lex); + } + var prime = new _ParseNode2.default("textord", "\\prime", this.mode); + + // Many primes can be grouped together, so we handle this here + var primes = [prime]; + this.consume(); + // Keep lexing tokens until we get something that's not a prime + while (this.nextToken.text === "'") { + // For each one, add another prime to the list + primes.push(prime); + this.consume(); + } + // If there's a superscript following the primes, combine that + // superscript in with the primes. + if (this.nextToken.text === "^") { + primes.push(this.handleSupSubscript("superscript")); + } + // Put everything into an ordgroup as the superscript + superscript = new _ParseNode2.default("ordgroup", primes, this.mode); + } else { + // If it wasn't ^, _, or ', stop parsing super/subscripts + break; + } + } + + if (superscript || subscript) { + // If we got either a superscript or subscript, create a supsub + return new _ParseNode2.default("supsub", { + base: base, + sup: superscript, + sub: subscript + }, this.mode); + } else { + // Otherwise return the original body + return base; + } + } + + // A list of the size-changing functions, for use in parseImplicitGroup + + + // A list of the style-changing functions, for use in parseImplicitGroup + + + // Old font functions + + }, { + key: "parseImplicitGroup", + + + /** + * Parses an implicit group, which is a group that starts at the end of a + * specified, and ends right before a higher explicit group ends, or at EOL. It + * is used for functions that appear to affect the current style, like \Large or + * \textrm, where instead of keeping a style we just pretend that there is an + * implicit grouping after it until the end of the group. E.g. + * small text {\Large large text} small text again + * It is also used for \left and \right to get the correct grouping. + * + * @return {?ParseNode} + */ + value: function parseImplicitGroup() { + var start = this.parseSymbol(); + + if (start == null) { + // If we didn't get anything we handle, fall back to parseFunction + return this.parseFunction(); + } + + var func = start.result; + + if (func === "\\left") { + // If we see a left: + // Parse the entire left function (including the delimiter) + var left = this.parseFunction(start); + // Parse out the implicit body + ++this.leftrightDepth; + var body = this.parseExpression(false); + --this.leftrightDepth; + // Check the next token + this.expect("\\right", false); + var right = this.parseFunction(); + return new _ParseNode2.default("leftright", { + body: body, + left: left.value.value, + right: right.value.value + }, this.mode); + } else if (func === "\\begin") { + // begin...end is similar to left...right + var begin = this.parseFunction(start); + var envName = begin.value.name; + if (!_environments2.default.hasOwnProperty(envName)) { + throw new _ParseError2.default("No such environment: " + envName, begin.value.nameGroup); + } + // Build the environment object. Arguments and other information will + // be made available to the begin and end methods using properties. + var env = _environments2.default[envName]; + var args = this.parseArguments("\\begin{" + envName + "}", env); + var context = { + mode: this.mode, + envName: envName, + parser: this, + positions: args.pop() + }; + var result = env.handler(context, args); + this.expect("\\end", false); + var endNameToken = this.nextToken; + var end = this.parseFunction(); + if (end.value.name !== envName) { + throw new _ParseError2.default("Mismatch: \\begin{" + envName + "} matched " + "by \\end{" + end.value.name + "}", endNameToken); + } + result.position = end.position; + return result; + } else if (_utils2.default.contains(Parser.sizeFuncs, func)) { + // If we see a sizing function, parse out the implicit body + this.consumeSpaces(); + var _body = this.parseExpression(false); + return new _ParseNode2.default("sizing", { + // Figure out what size to use based on the list of functions above + size: _utils2.default.indexOf(Parser.sizeFuncs, func) + 1, + value: _body + }, this.mode); + } else if (_utils2.default.contains(Parser.styleFuncs, func)) { + // If we see a styling function, parse out the implicit body + this.consumeSpaces(); + var _body2 = this.parseExpression(true); + return new _ParseNode2.default("styling", { + // Figure out what style to use by pulling out the style from + // the function name + style: func.slice(1, func.length - 5), + value: _body2 + }, this.mode); + } else if (func in Parser.oldFontFuncs) { + var style = Parser.oldFontFuncs[func]; + // If we see an old font function, parse out the implicit body + this.consumeSpaces(); + var _body3 = this.parseExpression(true); + if (style.slice(0, 4) === 'text') { + return new _ParseNode2.default("text", { + style: style, + body: new _ParseNode2.default("ordgroup", _body3, this.mode) + }, this.mode); + } else { + return new _ParseNode2.default("font", { + font: style, + body: new _ParseNode2.default("ordgroup", _body3, this.mode) + }, this.mode); + } + } else if (func === "\\color") { + // If we see a styling function, parse out the implicit body + var color = this.parseColorGroup(false); + if (!color) { + throw new _ParseError2.default("\\color not followed by color"); + } + var _body4 = this.parseExpression(true); + return new _ParseNode2.default("color", { + type: "color", + color: color.result.value, + value: _body4 + }, this.mode); + } else if (func === "$") { + if (this.mode === "math") { + throw new _ParseError2.default("$ within math mode"); + } + this.consume(); + var outerMode = this.mode; + this.switchMode("math"); + var _body5 = this.parseExpression(false, "$"); + this.expect("$", true); + this.switchMode(outerMode); + return new _ParseNode2.default("styling", { + style: "text", + value: _body5 + }, "math"); + } else { + // Defer to parseFunction if it's not a function we handle + return this.parseFunction(start); + } + } + + /** + * Parses an entire function, including its base and all of its arguments. + * The base might either have been parsed already, in which case + * it is provided as an argument, or it's the next group in the input. + * + * @param {ParseFuncOrArgument=} baseGroup optional as described above + * @return {?ParseNode} + */ + + }, { + key: "parseFunction", + value: function parseFunction(baseGroup) { + if (!baseGroup) { + baseGroup = this.parseGroup(); + } + + if (baseGroup) { + if (baseGroup.isFunction) { + var func = baseGroup.result; + var funcData = _functions2.default[func]; + if (this.mode === "text" && !funcData.allowedInText) { + throw new _ParseError2.default("Can't use function '" + func + "' in text mode", baseGroup.token); + } else if (this.mode === "math" && funcData.allowedInMath === false) { + throw new _ParseError2.default("Can't use function '" + func + "' in math mode", baseGroup.token); + } + + var args = this.parseArguments(func, funcData); + var token = baseGroup.token; + var result = this.callFunction(func, args, args.pop(), token); + return new _ParseNode2.default(result.type, result, this.mode); + } else { + return baseGroup.result; + } + } else { + return null; + } + } + + /** + * Call a function handler with a suitable context and arguments. + */ + + }, { + key: "callFunction", + value: function callFunction(name, args, positions, token) { + var context = { + funcName: name, + parser: this, + positions: positions, + token: token + }; + return _functions2.default[name].handler(context, args); + } + + /** + * Parses the arguments of a function or environment + * + * @param {string} func "\name" or "\begin{name}" + * @param {{numArgs:number,numOptionalArgs:number|undefined}} funcData + * @return the array of arguments, with the list of positions as last element + */ + + }, { + key: "parseArguments", + value: function parseArguments(func, funcData) { + var totalArgs = funcData.numArgs + funcData.numOptionalArgs; + if (totalArgs === 0) { + return [[this.pos]]; + } + + var baseGreediness = funcData.greediness; + var positions = [this.pos]; + var args = []; + + for (var i = 0; i < totalArgs; i++) { + var nextToken = this.nextToken; + var argType = funcData.argTypes && funcData.argTypes[i]; + var arg = void 0; + if (i < funcData.numOptionalArgs) { + if (argType) { + arg = this.parseGroupOfType(argType, true); + } else { + arg = this.parseGroup(true); + } + if (!arg) { + args.push(null); + positions.push(this.pos); + continue; + } + } else { + if (argType) { + arg = this.parseGroupOfType(argType); + } else { + arg = this.parseGroup(); + } + if (!arg) { + if (!this.settings.throwOnError && this.nextToken.text[0] === "\\") { + arg = new ParseFuncOrArgument(this.handleUnsupportedCmd(this.nextToken.text), false); + } else { + throw new _ParseError2.default("Expected group after '" + func + "'", nextToken); + } + } + } + var argNode = void 0; + if (arg.isFunction) { + var argGreediness = _functions2.default[arg.result].greediness; + if (argGreediness > baseGreediness) { + argNode = this.parseFunction(arg); + } else { + throw new _ParseError2.default("Got function '" + arg.result + "' as " + "argument to '" + func + "'", nextToken); + } + } else { + argNode = arg.result; + } + args.push(argNode); + positions.push(this.pos); + } + + args.push(positions); + + return args; + } + + /** + * Parses a group when the mode is changing. + * + * @return {?ParseFuncOrArgument} + */ + + }, { + key: "parseGroupOfType", + value: function parseGroupOfType(innerMode, optional) { + var outerMode = this.mode; + // Handle `original` argTypes + if (innerMode === "original") { + innerMode = outerMode; + } + + if (innerMode === "color") { + return this.parseColorGroup(optional); + } + if (innerMode === "size") { + return this.parseSizeGroup(optional); + } + + this.switchMode(innerMode); + if (innerMode === "text") { + // text mode is special because it should ignore the whitespace before + // it + this.consumeSpaces(); + } + // By the time we get here, innerMode is one of "text" or "math". + // We switch the mode of the parser, recurse, then restore the old mode. + var res = this.parseGroup(optional); + this.switchMode(outerMode); + return res; + } + }, { + key: "consumeSpaces", + value: function consumeSpaces() { + while (this.nextToken.text === " ") { + this.consume(); + } + } + + /** + * Parses a group, essentially returning the string formed by the + * brace-enclosed tokens plus some position information. + * + * @param {string} modeName Used to describe the mode in error messages + * @param {boolean=} optional Whether the group is optional or required + */ + + }, { + key: "parseStringGroup", + value: function parseStringGroup(modeName, optional) { + if (optional && this.nextToken.text !== "[") { + return null; + } + var outerMode = this.mode; + this.mode = "text"; + this.expect(optional ? "[" : "{"); + var str = ""; + var firstToken = this.nextToken; + var lastToken = firstToken; + while (this.nextToken.text !== (optional ? "]" : "}")) { + if (this.nextToken.text === "EOF") { + throw new _ParseError2.default("Unexpected end of input in " + modeName, firstToken.range(this.nextToken, str)); + } + lastToken = this.nextToken; + str += lastToken.text; + this.consume(); + } + this.mode = outerMode; + this.expect(optional ? "]" : "}"); + return firstToken.range(lastToken, str); + } + + /** + * Parses a regex-delimited group: the largest sequence of tokens + * whose concatenated strings match `regex`. Returns the string + * formed by the tokens plus some position information. + * + * @param {RegExp} regex + * @param {string} modeName Used to describe the mode in error messages + */ + + }, { + key: "parseRegexGroup", + value: function parseRegexGroup(regex, modeName) { + var outerMode = this.mode; + this.mode = "text"; + var firstToken = this.nextToken; + var lastToken = firstToken; + var str = ""; + while (this.nextToken.text !== "EOF" && regex.test(str + this.nextToken.text)) { + lastToken = this.nextToken; + str += lastToken.text; + this.consume(); + } + if (str === "") { + throw new _ParseError2.default("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken); + } + this.mode = outerMode; + return firstToken.range(lastToken, str); + } + + /** + * Parses a color description. + */ + + }, { + key: "parseColorGroup", + value: function parseColorGroup(optional) { + var res = this.parseStringGroup("color", optional); + if (!res) { + return null; + } + var match = /^(#[a-z0-9]+|[a-z]+)$/i.exec(res.text); + if (!match) { + throw new _ParseError2.default("Invalid color: '" + res.text + "'", res); + } + return new ParseFuncOrArgument(new _ParseNode2.default("color", match[0], this.mode), false); + } + + /** + * Parses a size specification, consisting of magnitude and unit. + */ + + }, { + key: "parseSizeGroup", + value: function parseSizeGroup(optional) { + var res = void 0; + if (!optional && this.nextToken.text !== "{") { + res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size"); + } else { + res = this.parseStringGroup("size", optional); + } + if (!res) { + return null; + } + var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text); + if (!match) { + throw new _ParseError2.default("Invalid size: '" + res.text + "'", res); + } + var data = { + number: +(match[1] + match[2]), // sign + magnitude, cast to number + unit: match[3] + }; + if (!_units2.default.validUnit(data)) { + throw new _ParseError2.default("Invalid unit: '" + data.unit + "'", res); + } + return new ParseFuncOrArgument(new _ParseNode2.default("size", data, this.mode), false); + } + + /** + * If the argument is false or absent, this parses an ordinary group, + * which is either a single nucleus (like "x") or an expression + * in braces (like "{x+y}"). + * If the argument is true, it parses either a bracket-delimited expression + * (like "[x+y]") or returns null to indicate the absence of a + * bracket-enclosed group. + * + * @param {boolean=} optional Whether the group is optional or required + * @return {?ParseFuncOrArgument} + */ + + }, { + key: "parseGroup", + value: function parseGroup(optional) { + var firstToken = this.nextToken; + // Try to parse an open brace + if (this.nextToken.text === (optional ? "[" : "{")) { + // If we get a brace, parse an expression + this.consume(); + var expression = this.parseExpression(false, optional ? "]" : null); + var lastToken = this.nextToken; + // Make sure we get a close brace + this.expect(optional ? "]" : "}"); + if (this.mode === "text") { + this.formLigatures(expression); + } + return new ParseFuncOrArgument(new _ParseNode2.default("ordgroup", expression, this.mode, firstToken, lastToken), false); + } else { + // Otherwise, just return a nucleus, or nothing for an optional group + return optional ? null : this.parseSymbol(); + } + } + + /** + * Form ligature-like combinations of characters for text mode. + * This includes inputs like "--", "---", "``" and "''". + * The result will simply replace multiple textord nodes with a single + * character in each value by a single textord node having multiple + * characters in its value. The representation is still ASCII source. + * + * @param {Array.} group the nodes of this group, + * list will be moified in place + */ + + }, { + key: "formLigatures", + value: function formLigatures(group) { + var n = group.length - 1; + for (var i = 0; i < n; ++i) { + var a = group[i]; + var v = a.value; + if (v === "-" && group[i + 1].value === "-") { + if (i + 1 < n && group[i + 2].value === "-") { + group.splice(i, 3, new _ParseNode2.default("textord", "---", "text", a, group[i + 2])); + n -= 2; + } else { + group.splice(i, 2, new _ParseNode2.default("textord", "--", "text", a, group[i + 1])); + n -= 1; + } + } + if ((v === "'" || v === "`") && group[i + 1].value === v) { + group.splice(i, 2, new _ParseNode2.default("textord", v + v, "text", a, group[i + 1])); + n -= 1; + } + } + } + + /** + * Parse a single symbol out of the string. Here, we handle both the functions + * we have defined, as well as the single character symbols + * + * @return {?ParseFuncOrArgument} + */ + + }, { + key: "parseSymbol", + value: function parseSymbol() { + var nucleus = this.nextToken; + + if (_functions2.default[nucleus.text]) { + this.consume(); + // If there exists a function with this name, we return the function and + // say that it is a function. + return new ParseFuncOrArgument(nucleus.text, true, nucleus); + } else if (_symbols2.default[this.mode][nucleus.text]) { + this.consume(); + // Otherwise if this is a no-argument function, find the type it + // corresponds to in the symbols map + return new ParseFuncOrArgument(new _ParseNode2.default(_symbols2.default[this.mode][nucleus.text].group, nucleus.text, this.mode, nucleus), false, nucleus); + } else if (this.mode === "text" && _unicodeRegexes.cjkRegex.test(nucleus.text)) { + this.consume(); + return new ParseFuncOrArgument(new _ParseNode2.default("textord", nucleus.text, this.mode, nucleus), false, nucleus); + } else if (nucleus.text === "$") { + return new ParseFuncOrArgument(nucleus.text, false, nucleus); + } else { + return null; + } + } + }]); + return Parser; +}(); + +Parser.endOfExpression = ["}", "\\end", "\\right", "&", "\\\\", "\\cr"]; +Parser.SUPSUB_GREEDINESS = 1; +Parser.sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"]; +Parser.styleFuncs = ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"]; +Parser.oldFontFuncs = { + "\\rm": "mathrm", + "\\sf": "mathsf", + "\\tt": "mathtt", + "\\bf": "mathbf", + "\\it": "mathit" +}; + + +Parser.prototype.ParseNode = _ParseNode2.default; + +module.exports = Parser; + +},{"./MacroExpander":27,"./ParseError":29,"./ParseNode":30,"./environments":40,"./functions":43,"./symbols":48,"./unicodeRegexes":49,"./units":50,"./utils":51,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],32:[function(require,module,exports){ +"use strict"; + +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * The main Settings object + * + * The current options stored are: + * - displayMode: Whether the expression should be typeset as inline math + * (false, the default), meaning that the math starts in + * \textstyle and is placed in an inline-block); or as display + * math (true), meaning that the math starts in \displaystyle + * and is placed in a block with vertical margin. + */ +var Settings = function Settings(options) { + (0, _classCallCheck3.default)(this, Settings); + + // allow null options + options = options || {}; + this.displayMode = _utils2.default.deflt(options.displayMode, false); + this.throwOnError = _utils2.default.deflt(options.throwOnError, true); + this.errorColor = _utils2.default.deflt(options.errorColor, "#cc0000"); + this.macros = options.macros || {}; + this.colorIsTextColor = _utils2.default.deflt(options.colorIsTextColor, false); +}; /** + * This is a module for storing settings passed into KaTeX. It correctly handles + * default settings. + */ + +module.exports = Settings; + +},{"./utils":51,"babel-runtime/helpers/classCallCheck":4}],33:[function(require,module,exports){ +"use strict"; + +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _createClass2 = require("babel-runtime/helpers/createClass"); + +var _createClass3 = _interopRequireDefault(_createClass2); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * This file contains information and classes for the various kinds of styles + * used in TeX. It provides a generic `Style` class, which holds information + * about a specific style. It then provides instances of all the different kinds + * of styles possible, and provides functions to move between them and get + * information about them. + */ + +/** + * The main style class. Contains a unique id for the style, a size (which is + * the same for cramped and uncramped version of a style), and a cramped flag. + */ +var Style = function () { + function Style(id, size, cramped) { + (0, _classCallCheck3.default)(this, Style); + + this.id = id; + this.size = size; + this.cramped = cramped; + } + + /** + * Get the style of a superscript given a base in the current style. + */ + + + (0, _createClass3.default)(Style, [{ + key: "sup", + value: function sup() { + return styles[_sup[this.id]]; + } + + /** + * Get the style of a subscript given a base in the current style. + */ + + }, { + key: "sub", + value: function sub() { + return styles[_sub[this.id]]; + } + + /** + * Get the style of a fraction numerator given the fraction in the current + * style. + */ + + }, { + key: "fracNum", + value: function fracNum() { + return styles[_fracNum[this.id]]; + } + + /** + * Get the style of a fraction denominator given the fraction in the current + * style. + */ + + }, { + key: "fracDen", + value: function fracDen() { + return styles[_fracDen[this.id]]; + } + + /** + * Get the cramped version of a style (in particular, cramping a cramped style + * doesn't change the style). + */ + + }, { + key: "cramp", + value: function cramp() { + return styles[_cramp[this.id]]; + } + + /** + * Get a text or display version of this style. + */ + + }, { + key: "text", + value: function text() { + return styles[_text[this.id]]; + } + + /** + * Return if this style is tightly spaced (scriptstyle/scriptscriptstyle) + */ + + }, { + key: "isTight", + value: function isTight() { + return this.size >= 2; + } + }]); + return Style; +}(); + +// IDs of the different styles + + +var D = 0; +var Dc = 1; +var T = 2; +var Tc = 3; +var S = 4; +var Sc = 5; +var SS = 6; +var SSc = 7; + +// Instances of the different styles +var styles = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)]; + +// Lookup tables for switching from one style to another +var _sup = [S, Sc, S, Sc, SS, SSc, SS, SSc]; +var _sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc]; +var _fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc]; +var _fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc]; +var _cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc]; +var _text = [D, Dc, T, Tc, T, Tc, T, Tc]; + +// We only export some of the styles. Also, we don't export the `Style` class so +// no more styles can be generated. +module.exports = { + DISPLAY: styles[D], + TEXT: styles[T], + SCRIPT: styles[S], + SCRIPTSCRIPT: styles[SS] +}; + +},{"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],34:[function(require,module,exports){ +"use strict"; + +var _domTree = require("./domTree"); + +var _domTree2 = _interopRequireDefault(_domTree); + +var _fontMetrics = require("./fontMetrics"); + +var _fontMetrics2 = _interopRequireDefault(_fontMetrics); + +var _symbols = require("./symbols"); + +var _symbols2 = _interopRequireDefault(_symbols); + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// The following have to be loaded from Main-Italic font, using class mainit +/* eslint no-console:0 */ +/** + * This module contains general functions that can be used for building + * different kinds of domTree nodes in a consistent manner. + */ + +var mainitLetters = ["\\imath", // dotless i +"\\jmath", // dotless j +"\\pounds"]; + +/** + * Looks up the given symbol in fontMetrics, after applying any symbol + * replacements defined in symbol.js + */ +var lookupSymbol = function lookupSymbol(value, fontFamily, mode) { + // Replace the value with its replaced value from symbol.js + if (_symbols2.default[mode][value] && _symbols2.default[mode][value].replace) { + value = _symbols2.default[mode][value].replace; + } + return { + value: value, + metrics: _fontMetrics2.default.getCharacterMetrics(value, fontFamily) + }; +}; + +/** + * Makes a symbolNode after translation via the list of symbols in symbols.js. + * Correctly pulls out metrics for the character, and optionally takes a list of + * classes to be attached to the node. + * + * TODO: make argument order closer to makeSpan + * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which + * should if present come first in `classes`. + */ +var makeSymbol = function makeSymbol(value, fontFamily, mode, options, classes) { + var lookup = lookupSymbol(value, fontFamily, mode); + var metrics = lookup.metrics; + value = lookup.value; + + var symbolNode = void 0; + if (metrics) { + var italic = metrics.italic; + if (mode === "text") { + italic = 0; + } + symbolNode = new _domTree2.default.symbolNode(value, metrics.height, metrics.depth, italic, metrics.skew, classes); + } else { + // TODO(emily): Figure out a good way to only print this in development + typeof console !== "undefined" && console.warn("No character metrics for '" + value + "' in style '" + fontFamily + "'"); + symbolNode = new _domTree2.default.symbolNode(value, 0, 0, 0, 0, classes); + } + + if (options) { + symbolNode.maxFontSize = options.sizeMultiplier; + if (options.style.isTight()) { + symbolNode.classes.push("mtight"); + } + if (options.getColor()) { + symbolNode.style.color = options.getColor(); + } + } + + return symbolNode; +}; + +/** + * Makes a symbol in Main-Regular or AMS-Regular. + * Used for rel, bin, open, close, inner, and punct. + */ +var mathsym = function mathsym(value, mode, options, classes) { + // Decide what font to render the symbol in by its entry in the symbols + // table. + // Have a special case for when the value = \ because the \ is used as a + // textord in unsupported command errors but cannot be parsed as a regular + // text ordinal and is therefore not present as a symbol in the symbols + // table for text + if (value === "\\" || _symbols2.default[mode][value].font === "main") { + return makeSymbol(value, "Main-Regular", mode, options, classes); + } else { + return makeSymbol(value, "AMS-Regular", mode, options, classes.concat(["amsrm"])); + } +}; + +/** + * Makes a symbol in the default font for mathords and textords. + */ +var mathDefault = function mathDefault(value, mode, options, classes, type) { + if (type === "mathord") { + var fontLookup = mathit(value, mode, options, classes); + return makeSymbol(value, fontLookup.fontName, mode, options, classes.concat([fontLookup.fontClass])); + } else if (type === "textord") { + var font = _symbols2.default[mode][value] && _symbols2.default[mode][value].font; + if (font === "ams") { + return makeSymbol(value, "AMS-Regular", mode, options, classes.concat(["amsrm"])); + } else { + // if (font === "main") { + return makeSymbol(value, "Main-Regular", mode, options, classes.concat(["mathrm"])); + } + } else { + throw new Error("unexpected type: " + type + " in mathDefault"); + } +}; + +/** + * Determines which of the two font names (Main-Italic and Math-Italic) and + * corresponding style tags (mainit or mathit) to use for font "mathit", + * depending on the symbol. Use this function instead of fontMap for font + * "mathit". + */ +var mathit = function mathit(value, mode, options, classes) { + if (/[0-9]/.test(value.charAt(0)) || + // glyphs for \imath and \jmath do not exist in Math-Italic so we + // need to use Main-Italic instead + _utils2.default.contains(mainitLetters, value)) { + return { + fontName: "Main-Italic", + fontClass: "mainit" + }; + } else { + return { + fontName: "Math-Italic", + fontClass: "mathit" + }; + } +}; + +/** + * Makes either a mathord or textord in the correct font and color. + */ +var makeOrd = function makeOrd(group, options, type) { + var mode = group.mode; + var value = group.value; + + var classes = ["mord"]; + + var font = options.font; + if (font) { + var fontLookup = void 0; + if (font === "mathit" || _utils2.default.contains(mainitLetters, value)) { + fontLookup = mathit(value, mode, options, classes); + } else { + fontLookup = fontMap[font]; + } + if (lookupSymbol(value, fontLookup.fontName, mode).metrics) { + return makeSymbol(value, fontLookup.fontName, mode, options, classes.concat([fontLookup.fontClass || font])); + } else { + return mathDefault(value, mode, options, classes, type); + } + } else { + return mathDefault(value, mode, options, classes, type); + } +}; + +/** + * Calculate the height, depth, and maxFontSize of an element based on its + * children. + */ +var sizeElementFromChildren = function sizeElementFromChildren(elem) { + var height = 0; + var depth = 0; + var maxFontSize = 0; + + if (elem.children) { + for (var i = 0; i < elem.children.length; i++) { + if (elem.children[i].height > height) { + height = elem.children[i].height; + } + if (elem.children[i].depth > depth) { + depth = elem.children[i].depth; + } + if (elem.children[i].maxFontSize > maxFontSize) { + maxFontSize = elem.children[i].maxFontSize; + } + } + } + + elem.height = height; + elem.depth = depth; + elem.maxFontSize = maxFontSize; +}; + +/** + * Makes a span with the given list of classes, list of children, and options. + * + * TODO: Ensure that `options` is always provided (currently some call sites + * don't pass it). + * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which + * should if present come first in `classes`. + */ +var makeSpan = function makeSpan(classes, children, options) { + var span = new _domTree2.default.span(classes, children, options); + + sizeElementFromChildren(span); + + return span; +}; + +/** + * Prepends the given children to the given span, updating height, depth, and + * maxFontSize. + */ +var prependChildren = function prependChildren(span, children) { + span.children = children.concat(span.children); + + sizeElementFromChildren(span); +}; + +/** + * Makes a document fragment with the given list of children. + */ +var makeFragment = function makeFragment(children) { + var fragment = new _domTree2.default.documentFragment(children); + + sizeElementFromChildren(fragment); + + return fragment; +}; + +/** + * Makes a vertical list by stacking elements and kerns on top of each other. + * Allows for many different ways of specifying the positioning method. + * + * Arguments: + * - children: A list of child or kern nodes to be stacked on top of each other + * (i.e. the first element will be at the bottom, and the last at + * the top). Element nodes are specified as + * {type: "elem", elem: node} + * while kern nodes are specified as + * {type: "kern", size: size} + * - positionType: The method by which the vlist should be positioned. Valid + * values are: + * - "individualShift": The children list only contains elem + * nodes, and each node contains an extra + * "shift" value of how much it should be + * shifted (note that shifting is always + * moving downwards). positionData is + * ignored. + * - "top": The positionData specifies the topmost point of + * the vlist (note this is expected to be a height, + * so positive values move up) + * - "bottom": The positionData specifies the bottommost point + * of the vlist (note this is expected to be a + * depth, so positive values move down + * - "shift": The vlist will be positioned such that its + * baseline is positionData away from the baseline + * of the first child. Positive values move + * downwards. + * - "firstBaseline": The vlist will be positioned such that + * its baseline is aligned with the + * baseline of the first child. + * positionData is ignored. (this is + * equivalent to "shift" with + * positionData=0) + * - positionData: Data used in different ways depending on positionType + * - options: An Options object + * + */ +var makeVList = function makeVList(children, positionType, positionData, options) { + var depth = void 0; + var currPos = void 0; + var i = void 0; + if (positionType === "individualShift") { + var oldChildren = children; + children = [oldChildren[0]]; + + // Add in kerns to the list of children to get each element to be + // shifted to the correct specified shift + depth = -oldChildren[0].shift - oldChildren[0].elem.depth; + currPos = depth; + for (i = 1; i < oldChildren.length; i++) { + var diff = -oldChildren[i].shift - currPos - oldChildren[i].elem.depth; + var size = diff - (oldChildren[i - 1].elem.height + oldChildren[i - 1].elem.depth); + + currPos = currPos + diff; + + children.push({ type: "kern", size: size }); + children.push(oldChildren[i]); + } + } else if (positionType === "top") { + // We always start at the bottom, so calculate the bottom by adding up + // all the sizes + var bottom = positionData; + for (i = 0; i < children.length; i++) { + if (children[i].type === "kern") { + bottom -= children[i].size; + } else { + bottom -= children[i].elem.height + children[i].elem.depth; + } + } + depth = bottom; + } else if (positionType === "bottom") { + depth = -positionData; + } else if (positionType === "shift") { + depth = -children[0].elem.depth - positionData; + } else if (positionType === "firstBaseline") { + depth = -children[0].elem.depth; + } else { + depth = 0; + } + + // Create a strut that is taller than any list item. The strut is added to + // each item, where it will determine the item's baseline. Since it has + // `overflow:hidden`, the strut's top edge will sit on the item's line box's + // top edge and the strut's bottom edge will sit on the item's baseline, + // with no additional line-height spacing. This allows the item baseline to + // be positioned precisely without worrying about font ascent and + // line-height. + var pstrutSize = 0; + for (i = 0; i < children.length; i++) { + if (children[i].type === "elem") { + var child = children[i].elem; + pstrutSize = Math.max(pstrutSize, child.maxFontSize, child.height); + } + } + pstrutSize += 2; + var pstrut = makeSpan(["pstrut"], []); + pstrut.style.height = pstrutSize + "em"; + + // Create a new list of actual children at the correct offsets + var realChildren = []; + var minPos = depth; + var maxPos = depth; + currPos = depth; + for (i = 0; i < children.length; i++) { + if (children[i].type === "kern") { + currPos += children[i].size; + } else { + var _child = children[i].elem; + + var childWrap = makeSpan([], [pstrut, _child]); + childWrap.style.top = -pstrutSize - currPos - _child.depth + "em"; + if (children[i].marginLeft) { + childWrap.style.marginLeft = children[i].marginLeft; + } + if (children[i].marginRight) { + childWrap.style.marginRight = children[i].marginRight; + } + + realChildren.push(childWrap); + currPos += _child.height + _child.depth; + } + minPos = Math.min(minPos, currPos); + maxPos = Math.max(maxPos, currPos); + } + + // The vlist contents go in a table-cell with `vertical-align:bottom`. + // This cell's bottom edge will determine the containing table's baseline + // without overly expanding the containing line-box. + var vlist = makeSpan(["vlist"], realChildren); + vlist.style.height = maxPos + "em"; + + // A second row is used if necessary to represent the vlist's depth. + var rows = void 0; + if (minPos < 0) { + var depthStrut = makeSpan(["vlist"], []); + depthStrut.style.height = -minPos + "em"; + + // Safari wants the first row to have inline content; otherwise it + // puts the bottom of the *second* row on the baseline. + var topStrut = makeSpan(["vlist-s"], [new _domTree2.default.symbolNode("\u200B")]); + + rows = [makeSpan(["vlist-r"], [vlist, topStrut]), makeSpan(["vlist-r"], [depthStrut])]; + } else { + rows = [makeSpan(["vlist-r"], [vlist])]; + } + + var vtable = makeSpan(["vlist-t"], rows); + if (rows.length === 2) { + vtable.classes.push("vlist-t2"); + } + vtable.height = maxPos; + vtable.depth = -minPos; + return vtable; +}; + +// A map of spacing functions to their attributes, like size and corresponding +// CSS class +var spacingFunctions = { + "\\qquad": { + size: "2em", + className: "qquad" + }, + "\\quad": { + size: "1em", + className: "quad" + }, + "\\enspace": { + size: "0.5em", + className: "enspace" + }, + "\\;": { + size: "0.277778em", + className: "thickspace" + }, + "\\:": { + size: "0.22222em", + className: "mediumspace" + }, + "\\,": { + size: "0.16667em", + className: "thinspace" + }, + "\\!": { + size: "-0.16667em", + className: "negativethinspace" + } +}; + +/** + * Maps TeX font commands to objects containing: + * - variant: string used for "mathvariant" attribute in buildMathML.js + * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics + */ +// A map between tex font commands an MathML mathvariant attribute values +var fontMap = { + // styles + "mathbf": { + variant: "bold", + fontName: "Main-Bold" + }, + "mathrm": { + variant: "normal", + fontName: "Main-Regular" + }, + "textit": { + variant: "italic", + fontName: "Main-Italic" + }, + + // "mathit" is missing because it requires the use of two fonts: Main-Italic + // and Math-Italic. This is handled by a special case in makeOrd which ends + // up calling mathit. + + // families + "mathbb": { + variant: "double-struck", + fontName: "AMS-Regular" + }, + "mathcal": { + variant: "script", + fontName: "Caligraphic-Regular" + }, + "mathfrak": { + variant: "fraktur", + fontName: "Fraktur-Regular" + }, + "mathscr": { + variant: "script", + fontName: "Script-Regular" + }, + "mathsf": { + variant: "sans-serif", + fontName: "SansSerif-Regular" + }, + "mathtt": { + variant: "monospace", + fontName: "Typewriter-Regular" + } +}; + +module.exports = { + fontMap: fontMap, + makeSymbol: makeSymbol, + mathsym: mathsym, + makeSpan: makeSpan, + makeFragment: makeFragment, + makeVList: makeVList, + makeOrd: makeOrd, + prependChildren: prependChildren, + spacingFunctions: spacingFunctions +}; + +},{"./domTree":39,"./fontMetrics":41,"./symbols":48,"./utils":51}],35:[function(require,module,exports){ +"use strict"; + +var _stringify = require("babel-runtime/core-js/json/stringify"); + +var _stringify2 = _interopRequireDefault(_stringify); + +var _ParseError = require("./ParseError"); + +var _ParseError2 = _interopRequireDefault(_ParseError); + +var _Style = require("./Style"); + +var _Style2 = _interopRequireDefault(_Style); + +var _buildCommon = require("./buildCommon"); + +var _buildCommon2 = _interopRequireDefault(_buildCommon); + +var _delimiter = require("./delimiter"); + +var _delimiter2 = _interopRequireDefault(_delimiter); + +var _domTree = require("./domTree"); + +var _domTree2 = _interopRequireDefault(_domTree); + +var _units = require("./units"); + +var _units2 = _interopRequireDefault(_units); + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +var _stretchy = require("./stretchy"); + +var _stretchy2 = _interopRequireDefault(_stretchy); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* eslint no-console:0 */ +/** + * This file does the main work of building a domTree structure from a parse + * tree. The entry point is the `buildHTML` function, which takes a parse tree. + * Then, the buildExpression, buildGroup, and various groupTypes functions are + * called, to produce a final HTML tree. + */ + +var isSpace = function isSpace(node) { + return node instanceof _domTree2.default.span && node.classes[0] === "mspace"; +}; + +// Binary atoms (first class `mbin`) change into ordinary atoms (`mord`) +// depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6, +// and the text before Rule 19. +var isBin = function isBin(node) { + return node && node.classes[0] === "mbin"; +}; + +var isBinLeftCanceller = function isBinLeftCanceller(node, isRealGroup) { + // TODO: This code assumes that a node's math class is the first element + // of its `classes` array. A later cleanup should ensure this, for + // instance by changing the signature of `makeSpan`. + if (node) { + return _utils2.default.contains(["mbin", "mopen", "mrel", "mop", "mpunct"], node.classes[0]); + } else { + return isRealGroup; + } +}; + +var isBinRightCanceller = function isBinRightCanceller(node, isRealGroup) { + if (node) { + return _utils2.default.contains(["mrel", "mclose", "mpunct"], node.classes[0]); + } else { + return isRealGroup; + } +}; + +/** + * Splice out any spaces from `children` starting at position `i`, and return + * the spliced-out array. Returns null if `children[i]` does not exist or is not + * a space. + */ +var spliceSpaces = function spliceSpaces(children, i) { + var j = i; + while (j < children.length && isSpace(children[j])) { + j++; + } + if (j === i) { + return null; + } else { + return children.splice(i, j - i); + } +}; + +/** + * Take a list of nodes, build them in order, and return a list of the built + * nodes. documentFragments are flattened into their contents, so the + * returned list contains no fragments. `isRealGroup` is true if `expression` + * is a real group (no atoms will be added on either side), as opposed to + * a partial group (e.g. one created by \color). + */ +var buildExpression = function buildExpression(expression, options, isRealGroup) { + // Parse expressions into `groups`. + var groups = []; + for (var i = 0; i < expression.length; i++) { + var group = expression[i]; + var output = buildGroup(group, options); + if (output instanceof _domTree2.default.documentFragment) { + Array.prototype.push.apply(groups, output.children); + } else { + groups.push(output); + } + } + // At this point `groups` consists entirely of `symbolNode`s and `span`s. + + // Explicit spaces (e.g., \;, \,) should be ignored with respect to atom + // spacing (e.g., "add thick space between mord and mrel"). Since CSS + // adjacency rules implement atom spacing, spaces should be invisible to + // CSS. So we splice them out of `groups` and into the atoms themselves. + for (var _i = 0; _i < groups.length; _i++) { + var spaces = spliceSpaces(groups, _i); + if (spaces) { + // Splicing of spaces may have removed all remaining groups. + if (_i < groups.length) { + // If there is a following group, move space within it. + if (groups[_i] instanceof _domTree2.default.symbolNode) { + groups[_i] = (0, _buildCommon.makeSpan)([].concat(groups[_i].classes), [groups[_i]]); + } + _buildCommon2.default.prependChildren(groups[_i], spaces); + } else { + // Otherwise, put any spaces back at the end of the groups. + Array.prototype.push.apply(groups, spaces); + break; + } + } + } + + // Binary operators change to ordinary symbols in some contexts. + for (var _i2 = 0; _i2 < groups.length; _i2++) { + if (isBin(groups[_i2]) && (isBinLeftCanceller(groups[_i2 - 1], isRealGroup) || isBinRightCanceller(groups[_i2 + 1], isRealGroup))) { + groups[_i2].classes[0] = "mord"; + } + } + + // Process \\not commands within the group. + // TODO(kevinb): Handle multiple \\not commands in a row. + // TODO(kevinb): Handle \\not{abc} correctly. The \\not should appear over + // the 'a' instead of the 'c'. + for (var _i3 = 0; _i3 < groups.length; _i3++) { + if (groups[_i3].value === "\u0338" && _i3 + 1 < groups.length) { + var children = groups.slice(_i3, _i3 + 2); + + children[0].classes = ["mainrm"]; + // \u0338 is a combining glyph so we could reorder the children so + // that it comes after the other glyph. This works correctly on + // most browsers except for Safari. Instead we absolutely position + // the glyph and set its right side to match that of the other + // glyph which is visually equivalent. + children[0].style.position = "absolute"; + children[0].style.right = "0"; + + // Copy the classes from the second glyph to the new container. + // This is so it behaves the same as though there was no \\not. + var classes = groups[_i3 + 1].classes; + var container = (0, _buildCommon.makeSpan)(classes, children); + + // LaTeX adds a space between ords separated by a \\not. + if (classes.indexOf("mord") !== -1) { + // \glue(\thickmuskip) 2.77771 plus 2.77771 + container.style.paddingLeft = "0.277771em"; + } + + // Ensure that the \u0338 is positioned relative to the container. + container.style.position = "relative"; + groups.splice(_i3, 2, container); + } + } + + return groups; +}; + +// Return math atom class (mclass) of a domTree. +var getTypeOfDomTree = function getTypeOfDomTree(node) { + if (node instanceof _domTree2.default.documentFragment) { + if (node.children.length) { + return getTypeOfDomTree(node.children[node.children.length - 1]); + } + } else { + if (_utils2.default.contains(["mord", "mop", "mbin", "mrel", "mopen", "mclose", "mpunct", "minner"], node.classes[0])) { + return node.classes[0]; + } + } + return null; +}; + +/** + * Sometimes, groups perform special rules when they have superscripts or + * subscripts attached to them. This function lets the `supsub` group know that + * its inner element should handle the superscripts and subscripts instead of + * handling them itself. + */ +var shouldHandleSupSub = function shouldHandleSupSub(group, options) { + if (!group.value.base) { + return false; + } else { + var base = group.value.base; + if (base.type === "op") { + // Operators handle supsubs differently when they have limits + // (e.g. `\displaystyle\sum_2^3`) + return base.value.limits && (options.style.size === _Style2.default.DISPLAY.size || base.value.alwaysHandleSupSub); + } else if (base.type === "accent") { + return isCharacterBox(base.value.base); + } else if (base.type === "horizBrace") { + var isSup = group.value.sub ? false : true; + return isSup === base.value.isOver; + } else { + return null; + } + } +}; + +/** + * Sometimes we want to pull out the innermost element of a group. In most + * cases, this will just be the group itself, but when ordgroups and colors have + * a single element, we want to pull that out. + */ +var getBaseElem = function getBaseElem(group) { + if (!group) { + return false; + } else if (group.type === "ordgroup") { + if (group.value.length === 1) { + return getBaseElem(group.value[0]); + } else { + return group; + } + } else if (group.type === "color") { + if (group.value.value.length === 1) { + return getBaseElem(group.value.value[0]); + } else { + return group; + } + } else if (group.type === "font") { + return getBaseElem(group.value.body); + } else { + return group; + } +}; + +/** + * TeXbook algorithms often reference "character boxes", which are simply groups + * with a single character in them. To decide if something is a character box, + * we find its innermost group, and see if it is a single character. + */ +var isCharacterBox = function isCharacterBox(group) { + var baseElem = getBaseElem(group); + + // These are all they types of groups which hold single characters + return baseElem.type === "mathord" || baseElem.type === "textord" || baseElem.type === "bin" || baseElem.type === "rel" || baseElem.type === "inner" || baseElem.type === "open" || baseElem.type === "close" || baseElem.type === "punct"; +}; + +var makeNullDelimiter = function makeNullDelimiter(options, classes) { + var moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses()); + return (0, _buildCommon.makeSpan)(classes.concat(moreClasses)); +}; + +/** + * This is a map of group types to the function used to handle that type. + * Simpler types come at the beginning, while complicated types come afterwards. + */ +var groupTypes = {}; + +groupTypes.mathord = function (group, options) { + return _buildCommon2.default.makeOrd(group, options, "mathord"); +}; + +groupTypes.textord = function (group, options) { + return _buildCommon2.default.makeOrd(group, options, "textord"); +}; + +groupTypes.bin = function (group, options) { + return _buildCommon2.default.mathsym(group.value, group.mode, options, ["mbin"]); +}; + +groupTypes.rel = function (group, options) { + return _buildCommon2.default.mathsym(group.value, group.mode, options, ["mrel"]); +}; + +groupTypes.open = function (group, options) { + return _buildCommon2.default.mathsym(group.value, group.mode, options, ["mopen"]); +}; + +groupTypes.close = function (group, options) { + return _buildCommon2.default.mathsym(group.value, group.mode, options, ["mclose"]); +}; + +groupTypes.inner = function (group, options) { + return _buildCommon2.default.mathsym(group.value, group.mode, options, ["minner"]); +}; + +groupTypes.punct = function (group, options) { + return _buildCommon2.default.mathsym(group.value, group.mode, options, ["mpunct"]); +}; + +groupTypes.ordgroup = function (group, options) { + return (0, _buildCommon.makeSpan)(["mord"], buildExpression(group.value, options, true), options); +}; + +groupTypes.text = function (group, options) { + var newOptions = options.withFont(group.value.style); + var inner = buildExpression(group.value.body, newOptions, true); + for (var i = 0; i < inner.length - 1; i++) { + if (inner[i].tryCombine(inner[i + 1])) { + inner.splice(i + 1, 1); + i--; + } + } + return (0, _buildCommon.makeSpan)(["mord", "text"], inner, newOptions); +}; + +groupTypes.color = function (group, options) { + var elements = buildExpression(group.value.value, options.withColor(group.value.color), false); + + // \color isn't supposed to affect the type of the elements it contains. + // To accomplish this, we wrap the results in a fragment, so the inner + // elements will be able to directly interact with their neighbors. For + // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3` + return new _buildCommon2.default.makeFragment(elements); +}; + +groupTypes.supsub = function (group, options) { + // Superscript and subscripts are handled in the TeXbook on page + // 445-446, rules 18(a-f). + + // Here is where we defer to the inner group if it should handle + // superscripts and subscripts itself. + if (shouldHandleSupSub(group, options)) { + return groupTypes[group.value.base.type](group, options); + } + + var base = buildGroup(group.value.base, options); + var supm = void 0; + var subm = void 0; + + var metrics = options.fontMetrics(); + var newOptions = void 0; + + // Rule 18a + var supShift = 0; + var subShift = 0; + + if (group.value.sup) { + newOptions = options.havingStyle(options.style.sup()); + supm = buildGroup(group.value.sup, newOptions, options); + if (!isCharacterBox(group.value.base)) { + supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options.sizeMultiplier; + } + } + + if (group.value.sub) { + newOptions = options.havingStyle(options.style.sub()); + subm = buildGroup(group.value.sub, newOptions, options); + if (!isCharacterBox(group.value.base)) { + subShift = base.depth + newOptions.fontMetrics().subDrop * newOptions.sizeMultiplier / options.sizeMultiplier; + } + } + + // Rule 18c + var minSupShift = void 0; + if (options.style === _Style2.default.DISPLAY) { + minSupShift = metrics.sup1; + } else if (options.style.cramped) { + minSupShift = metrics.sup3; + } else { + minSupShift = metrics.sup2; + } + + // scriptspace is a font-size-independent size, so scale it + // appropriately + var multiplier = options.sizeMultiplier; + var scriptspace = 0.5 / metrics.ptPerEm / multiplier + "em"; + + var supsub = void 0; + if (!group.value.sup) { + // Rule 18b + subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight); + + var vlistElem = [{ type: "elem", elem: subm, marginRight: scriptspace }]; + // Subscripts shouldn't be shifted by the base's italic correction. + // Account for that by shifting the subscript back the appropriate + // amount. Note we only do this when the base is a single symbol. + if (base instanceof _domTree2.default.symbolNode) { + vlistElem[0].marginLeft = -base.italic + "em"; + } + + supsub = _buildCommon2.default.makeVList(vlistElem, "shift", subShift, options); + } else if (!group.value.sub) { + // Rule 18c, d + supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight); + + supsub = _buildCommon2.default.makeVList([{ type: "elem", elem: supm, marginRight: scriptspace }], "shift", -supShift, options); + } else { + supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight); + subShift = Math.max(subShift, metrics.sub2); + + var ruleWidth = metrics.defaultRuleThickness; + + // Rule 18e + if (supShift - supm.depth - (subm.height - subShift) < 4 * ruleWidth) { + subShift = 4 * ruleWidth - (supShift - supm.depth) + subm.height; + var psi = 0.8 * metrics.xHeight - (supShift - supm.depth); + if (psi > 0) { + supShift += psi; + subShift -= psi; + } + } + + var _vlistElem = [{ type: "elem", elem: subm, shift: subShift, marginRight: scriptspace }, { type: "elem", elem: supm, shift: -supShift, marginRight: scriptspace }]; + // See comment above about subscripts not being shifted + if (base instanceof _domTree2.default.symbolNode) { + _vlistElem[0].marginLeft = -base.italic + "em"; + } + + supsub = _buildCommon2.default.makeVList(_vlistElem, "individualShift", null, options); + } + + // We ensure to wrap the supsub vlist in a span.msupsub to reset text-align + var mclass = getTypeOfDomTree(base) || "mord"; + return (0, _buildCommon.makeSpan)([mclass], [base, (0, _buildCommon.makeSpan)(["msupsub"], [supsub])], options); +}; + +groupTypes.genfrac = function (group, options) { + // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e). + // Figure out what style this fraction should be in based on the + // function used + var style = options.style; + if (group.value.size === "display") { + style = _Style2.default.DISPLAY; + } else if (group.value.size === "text") { + style = _Style2.default.TEXT; + } + + var nstyle = style.fracNum(); + var dstyle = style.fracDen(); + var newOptions = void 0; + + newOptions = options.havingStyle(nstyle); + var numerm = buildGroup(group.value.numer, newOptions, options); + + newOptions = options.havingStyle(dstyle); + var denomm = buildGroup(group.value.denom, newOptions, options); + + var rule = void 0; + var ruleWidth = void 0; + var ruleSpacing = void 0; + if (group.value.hasBarLine) { + rule = makeLineSpan("frac-line", options); + ruleWidth = rule.height; + ruleSpacing = rule.height; + } else { + rule = null; + ruleWidth = 0; + ruleSpacing = options.fontMetrics().defaultRuleThickness; + } + + // Rule 15b + var numShift = void 0; + var clearance = void 0; + var denomShift = void 0; + if (style.size === _Style2.default.DISPLAY.size) { + numShift = options.fontMetrics().num1; + if (ruleWidth > 0) { + clearance = 3 * ruleSpacing; + } else { + clearance = 7 * ruleSpacing; + } + denomShift = options.fontMetrics().denom1; + } else { + if (ruleWidth > 0) { + numShift = options.fontMetrics().num2; + clearance = ruleSpacing; + } else { + numShift = options.fontMetrics().num3; + clearance = 3 * ruleSpacing; + } + denomShift = options.fontMetrics().denom2; + } + + var frac = void 0; + if (ruleWidth === 0) { + // Rule 15c + var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift); + if (candidateClearance < clearance) { + numShift += 0.5 * (clearance - candidateClearance); + denomShift += 0.5 * (clearance - candidateClearance); + } + + frac = _buildCommon2.default.makeVList([{ type: "elem", elem: denomm, shift: denomShift }, { type: "elem", elem: numerm, shift: -numShift }], "individualShift", null, options); + } else { + // Rule 15d + var axisHeight = options.fontMetrics().axisHeight; + + if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) { + numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth)); + } + + if (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift) < clearance) { + denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift)); + } + + var midShift = -(axisHeight - 0.5 * ruleWidth); + + frac = _buildCommon2.default.makeVList([{ type: "elem", elem: denomm, shift: denomShift }, { type: "elem", elem: rule, shift: midShift }, { type: "elem", elem: numerm, shift: -numShift }], "individualShift", null, options); + } + + // Since we manually change the style sometimes (with \dfrac or \tfrac), + // account for the possible size change here. + newOptions = options.havingStyle(style); + frac.height *= newOptions.sizeMultiplier / options.sizeMultiplier; + frac.depth *= newOptions.sizeMultiplier / options.sizeMultiplier; + + // Rule 15e + var delimSize = void 0; + if (style.size === _Style2.default.DISPLAY.size) { + delimSize = options.fontMetrics().delim1; + } else { + delimSize = options.fontMetrics().delim2; + } + + var leftDelim = void 0; + var rightDelim = void 0; + if (group.value.leftDelim == null) { + leftDelim = makeNullDelimiter(options, ["mopen"]); + } else { + leftDelim = _delimiter2.default.customSizedDelim(group.value.leftDelim, delimSize, true, options.havingStyle(style), group.mode, ["mopen"]); + } + if (group.value.rightDelim == null) { + rightDelim = makeNullDelimiter(options, ["mclose"]); + } else { + rightDelim = _delimiter2.default.customSizedDelim(group.value.rightDelim, delimSize, true, options.havingStyle(style), group.mode, ["mclose"]); + } + + return (0, _buildCommon.makeSpan)(["mord"].concat(newOptions.sizingClasses(options)), [leftDelim, (0, _buildCommon.makeSpan)(["mfrac"], [frac]), rightDelim], options); +}; + +groupTypes.array = function (group, options) { + var r = void 0; + var c = void 0; + var nr = group.value.body.length; + var nc = 0; + var body = new Array(nr); + + // Horizontal spacing + var pt = 1 / options.fontMetrics().ptPerEm; + var arraycolsep = 5 * pt; // \arraycolsep in article.cls + + // Vertical spacing + var baselineskip = 12 * pt; // see size10.clo + // Default \jot from ltmath.dtx + // TODO(edemaine): allow overriding \jot via \setlength (#687) + var jot = 3 * pt; + // Default \arraystretch from lttab.dtx + // TODO(gagern): may get redefined once we have user-defined macros + var arraystretch = _utils2.default.deflt(group.value.arraystretch, 1); + var arrayskip = arraystretch * baselineskip; + var arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and + var arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx + + var totalHeight = 0; + for (r = 0; r < group.value.body.length; ++r) { + var inrow = group.value.body[r]; + var height = arstrutHeight; // \@array adds an \@arstrut + var depth = arstrutDepth; // to each tow (via the template) + + if (nc < inrow.length) { + nc = inrow.length; + } + + var outrow = new Array(inrow.length); + for (c = 0; c < inrow.length; ++c) { + var elt = buildGroup(inrow[c], options); + if (depth < elt.depth) { + depth = elt.depth; + } + if (height < elt.height) { + height = elt.height; + } + outrow[c] = elt; + } + + var gap = 0; + if (group.value.rowGaps[r]) { + gap = _units2.default.calculateSize(group.value.rowGaps[r].value, options); + if (gap > 0) { + // \@argarraycr + gap += arstrutDepth; + if (depth < gap) { + depth = gap; // \@xargarraycr + } + gap = 0; + } + } + // In AMS multiline environments such as aligned and gathered, rows + // correspond to lines that have additional \jot added to the + // \baselineskip via \openup. + if (group.value.addJot) { + depth += jot; + } + + outrow.height = height; + outrow.depth = depth; + totalHeight += height; + outrow.pos = totalHeight; + totalHeight += depth + gap; // \@yargarraycr + body[r] = outrow; + } + + var offset = totalHeight / 2 + options.fontMetrics().axisHeight; + var colDescriptions = group.value.cols || []; + var cols = []; + var colSep = void 0; + var colDescrNum = void 0; + for (c = 0, colDescrNum = 0; + // Continue while either there are more columns or more column + // descriptions, so trailing separators don't get lost. + c < nc || colDescrNum < colDescriptions.length; ++c, ++colDescrNum) { + + var colDescr = colDescriptions[colDescrNum] || {}; + + var firstSeparator = true; + while (colDescr.type === "separator") { + // If there is more than one separator in a row, add a space + // between them. + if (!firstSeparator) { + colSep = (0, _buildCommon.makeSpan)(["arraycolsep"], []); + colSep.style.width = options.fontMetrics().doubleRuleSep + "em"; + cols.push(colSep); + } + + if (colDescr.separator === "|") { + var separator = (0, _buildCommon.makeSpan)(["vertical-separator"], []); + separator.style.height = totalHeight + "em"; + separator.style.verticalAlign = -(totalHeight - offset) + "em"; + + cols.push(separator); + } else { + throw new _ParseError2.default("Invalid separator type: " + colDescr.separator); + } + + colDescrNum++; + colDescr = colDescriptions[colDescrNum] || {}; + firstSeparator = false; + } + + if (c >= nc) { + continue; + } + + var sepwidth = void 0; + if (c > 0 || group.value.hskipBeforeAndAfter) { + sepwidth = _utils2.default.deflt(colDescr.pregap, arraycolsep); + if (sepwidth !== 0) { + colSep = (0, _buildCommon.makeSpan)(["arraycolsep"], []); + colSep.style.width = sepwidth + "em"; + cols.push(colSep); + } + } + + var col = []; + for (r = 0; r < nr; ++r) { + var row = body[r]; + var elem = row[c]; + if (!elem) { + continue; + } + var shift = row.pos - offset; + elem.depth = row.depth; + elem.height = row.height; + col.push({ type: "elem", elem: elem, shift: shift }); + } + + col = _buildCommon2.default.makeVList(col, "individualShift", null, options); + col = (0, _buildCommon.makeSpan)(["col-align-" + (colDescr.align || "c")], [col]); + cols.push(col); + + if (c < nc - 1 || group.value.hskipBeforeAndAfter) { + sepwidth = _utils2.default.deflt(colDescr.postgap, arraycolsep); + if (sepwidth !== 0) { + colSep = (0, _buildCommon.makeSpan)(["arraycolsep"], []); + colSep.style.width = sepwidth + "em"; + cols.push(colSep); + } + } + } + body = (0, _buildCommon.makeSpan)(["mtable"], cols); + return (0, _buildCommon.makeSpan)(["mord"], [body], options); +}; + +groupTypes.spacing = function (group, options) { + if (group.value === "\\ " || group.value === "\\space" || group.value === " " || group.value === "~") { + // Spaces are generated by adding an actual space. Each of these + // things has an entry in the symbols table, so these will be turned + // into appropriate outputs. + if (group.mode === "text") { + return _buildCommon2.default.makeOrd(group, options, "textord"); + } else { + return (0, _buildCommon.makeSpan)(["mspace"], [_buildCommon2.default.mathsym(group.value, group.mode, options)], options); + } + } else { + // Other kinds of spaces are of arbitrary width. We use CSS to + // generate these. + return (0, _buildCommon.makeSpan)(["mspace", _buildCommon2.default.spacingFunctions[group.value].className], [], options); + } +}; + +groupTypes.llap = function (group, options) { + var inner = (0, _buildCommon.makeSpan)(["inner"], [buildGroup(group.value.body, options)]); + var fix = (0, _buildCommon.makeSpan)(["fix"], []); + return (0, _buildCommon.makeSpan)(["mord", "llap"], [inner, fix], options); +}; + +groupTypes.rlap = function (group, options) { + var inner = (0, _buildCommon.makeSpan)(["inner"], [buildGroup(group.value.body, options)]); + var fix = (0, _buildCommon.makeSpan)(["fix"], []); + return (0, _buildCommon.makeSpan)(["mord", "rlap"], [inner, fix], options); +}; + +groupTypes.op = function (group, options) { + // Operators are handled in the TeXbook pg. 443-444, rule 13(a). + var supGroup = void 0; + var subGroup = void 0; + var hasLimits = false; + if (group.type === "supsub") { + // If we have limits, supsub will pass us its group to handle. Pull + // out the superscript and subscript and set the group to the op in + // its base. + supGroup = group.value.sup; + subGroup = group.value.sub; + group = group.value.base; + hasLimits = true; + } + + var style = options.style; + + // Most operators have a large successor symbol, but these don't. + var noSuccessor = ["\\smallint"]; + + var large = false; + if (style.size === _Style2.default.DISPLAY.size && group.value.symbol && !_utils2.default.contains(noSuccessor, group.value.body)) { + + // Most symbol operators get larger in displaystyle (rule 13) + large = true; + } + + var base = void 0; + if (group.value.symbol) { + // If this is a symbol, create the symbol. + var fontName = large ? "Size2-Regular" : "Size1-Regular"; + base = _buildCommon2.default.makeSymbol(group.value.body, fontName, "math", options, ["mop", "op-symbol", large ? "large-op" : "small-op"]); + } else if (group.value.value) { + // If this is a list, compose that list. + var inner = buildExpression(group.value.value, options, true); + if (inner.length === 1 && inner[0] instanceof _domTree2.default.symbolNode) { + base = inner[0]; + base.classes[0] = "mop"; // replace old mclass + } else { + base = (0, _buildCommon.makeSpan)(["mop"], inner, options); + } + } else { + // Otherwise, this is a text operator. Build the text from the + // operator's name. + // TODO(emily): Add a space in the middle of some of these + // operators, like \limsup + var output = []; + for (var i = 1; i < group.value.body.length; i++) { + output.push(_buildCommon2.default.mathsym(group.value.body[i], group.mode)); + } + base = (0, _buildCommon.makeSpan)(["mop"], output, options); + } + + // If content of op is a single symbol, shift it vertically. + var baseShift = 0; + var slant = 0; + if (base instanceof _domTree2.default.symbolNode) { + // Shift the symbol so its center lies on the axis (rule 13). It + // appears that our fonts have the centers of the symbols already + // almost on the axis, so these numbers are very small. Note we + // don't actually apply this here, but instead it is used either in + // the vlist creation or separately when there are no limits. + baseShift = (base.height - base.depth) / 2 - options.fontMetrics().axisHeight; + + // The slant of the symbol is just its italic correction. + slant = base.italic; + } + + if (hasLimits) { + // IE 8 clips \int if it is in a display: inline-block. We wrap it + // in a new span so it is an inline, and works. + base = (0, _buildCommon.makeSpan)([], [base]); + + var supm = void 0; + var supKern = void 0; + var subm = void 0; + var subKern = void 0; + var newOptions = void 0; + // We manually have to handle the superscripts and subscripts. This, + // aside from the kern calculations, is copied from supsub. + if (supGroup) { + newOptions = options.havingStyle(style.sup()); + supm = buildGroup(supGroup, newOptions, options); + + supKern = Math.max(options.fontMetrics().bigOpSpacing1, options.fontMetrics().bigOpSpacing3 - supm.depth); + } + + if (subGroup) { + newOptions = options.havingStyle(style.sub()); + subm = buildGroup(subGroup, newOptions, options); + + subKern = Math.max(options.fontMetrics().bigOpSpacing2, options.fontMetrics().bigOpSpacing4 - subm.height); + } + + // Build the final group as a vlist of the possible subscript, base, + // and possible superscript. + var finalGroup = void 0; + var top = void 0; + var bottom = void 0; + if (!supGroup) { + top = base.height - baseShift; + + // Shift the limits by the slant of the symbol. Note + // that we are supposed to shift the limits by 1/2 of the slant, + // but since we are centering the limits adding a full slant of + // margin will shift by 1/2 that. + finalGroup = _buildCommon2.default.makeVList([{ type: "kern", size: options.fontMetrics().bigOpSpacing5 }, { type: "elem", elem: subm, marginLeft: -slant + "em" }, { type: "kern", size: subKern }, { type: "elem", elem: base }], "top", top, options); + } else if (!subGroup) { + bottom = base.depth + baseShift; + + finalGroup = _buildCommon2.default.makeVList([{ type: "elem", elem: base }, { type: "kern", size: supKern }, { type: "elem", elem: supm, marginLeft: slant + "em" }, { type: "kern", size: options.fontMetrics().bigOpSpacing5 }], "bottom", bottom, options); + } else if (!supGroup && !subGroup) { + // This case probably shouldn't occur (this would mean the + // supsub was sending us a group with no superscript or + // subscript) but be safe. + return base; + } else { + bottom = options.fontMetrics().bigOpSpacing5 + subm.height + subm.depth + subKern + base.depth + baseShift; + + finalGroup = _buildCommon2.default.makeVList([{ type: "kern", size: options.fontMetrics().bigOpSpacing5 }, { type: "elem", elem: subm, marginLeft: -slant + "em" }, { type: "kern", size: subKern }, { type: "elem", elem: base }, { type: "kern", size: supKern }, { type: "elem", elem: supm, marginLeft: slant + "em" }, { type: "kern", size: options.fontMetrics().bigOpSpacing5 }], "bottom", bottom, options); + } + + return (0, _buildCommon.makeSpan)(["mop", "op-limits"], [finalGroup], options); + } else { + if (baseShift) { + base.style.position = "relative"; + base.style.top = baseShift + "em"; + } + + return base; + } +}; + +groupTypes.mod = function (group, options) { + var inner = []; + + if (group.value.modType === "bmod") { + // “\nonscript\mskip-\medmuskip\mkern5mu” + if (!options.style.isTight()) { + inner.push((0, _buildCommon.makeSpan)(["mspace", "negativemediumspace"], [], options)); + } + inner.push((0, _buildCommon.makeSpan)(["mspace", "thickspace"], [], options)); + } else if (options.style.size === _Style2.default.DISPLAY.size) { + inner.push((0, _buildCommon.makeSpan)(["mspace", "quad"], [], options)); + } else if (group.value.modType === "mod") { + inner.push((0, _buildCommon.makeSpan)(["mspace", "twelvemuspace"], [], options)); + } else { + inner.push((0, _buildCommon.makeSpan)(["mspace", "eightmuspace"], [], options)); + } + + if (group.value.modType === "pod" || group.value.modType === "pmod") { + inner.push(_buildCommon2.default.mathsym("(", group.mode)); + } + + if (group.value.modType !== "pod") { + var modInner = [_buildCommon2.default.mathsym("m", group.mode), _buildCommon2.default.mathsym("o", group.mode), _buildCommon2.default.mathsym("d", group.mode)]; + if (group.value.modType === "bmod") { + inner.push((0, _buildCommon.makeSpan)(["mbin"], modInner, options)); + // “\mkern5mu\nonscript\mskip-\medmuskip” + inner.push((0, _buildCommon.makeSpan)(["mspace", "thickspace"], [], options)); + if (!options.style.isTight()) { + inner.push((0, _buildCommon.makeSpan)(["mspace", "negativemediumspace"], [], options)); + } + } else { + Array.prototype.push.apply(inner, modInner); + inner.push((0, _buildCommon.makeSpan)(["mspace", "sixmuspace"], [], options)); + } + } + + if (group.value.value) { + Array.prototype.push.apply(inner, buildExpression(group.value.value, options, false)); + } + + if (group.value.modType === "pod" || group.value.modType === "pmod") { + inner.push(_buildCommon2.default.mathsym(")", group.mode)); + } + + return _buildCommon2.default.makeFragment(inner); +}; + +groupTypes.katex = function (group, options) { + // The KaTeX logo. The offsets for the K and a were chosen to look + // good, but the offsets for the T, E, and X were taken from the + // definition of \TeX in TeX (see TeXbook pg. 356) + var k = (0, _buildCommon.makeSpan)(["k"], [_buildCommon2.default.mathsym("K", group.mode)], options); + var a = (0, _buildCommon.makeSpan)(["a"], [_buildCommon2.default.mathsym("A", group.mode)], options); + + a.height = (a.height + 0.2) * 0.75; + a.depth = (a.height - 0.2) * 0.75; + + var t = (0, _buildCommon.makeSpan)(["t"], [_buildCommon2.default.mathsym("T", group.mode)], options); + var e = (0, _buildCommon.makeSpan)(["e"], [_buildCommon2.default.mathsym("E", group.mode)], options); + + e.height = e.height - 0.2155; + e.depth = e.depth + 0.2155; + + var x = (0, _buildCommon.makeSpan)(["x"], [_buildCommon2.default.mathsym("X", group.mode)], options); + + return (0, _buildCommon.makeSpan)(["mord", "katex-logo"], [k, a, t, e, x], options); +}; + +var makeLineSpan = function makeLineSpan(className, options, thickness) { + var line = (0, _buildCommon.makeSpan)([className], [], options); + line.height = thickness || options.fontMetrics().defaultRuleThickness; + line.style.borderBottomWidth = line.height + "em"; + line.maxFontSize = 1.0; + return line; +}; + +groupTypes.overline = function (group, options) { + // Overlines are handled in the TeXbook pg 443, Rule 9. + + // Build the inner group in the cramped style. + var innerGroup = buildGroup(group.value.body, options.havingCrampedStyle()); + + // Create the line above the body + var line = makeLineSpan("overline-line", options); + + // Generate the vlist, with the appropriate kerns + var vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: innerGroup }, { type: "kern", size: 3 * line.height }, { type: "elem", elem: line }, { type: "kern", size: line.height }], "firstBaseline", null, options); + + return (0, _buildCommon.makeSpan)(["mord", "overline"], [vlist], options); +}; + +groupTypes.underline = function (group, options) { + // Underlines are handled in the TeXbook pg 443, Rule 10. + // Build the inner group. + var innerGroup = buildGroup(group.value.body, options); + + // Create the line above the body + var line = makeLineSpan("underline-line", options); + + // Generate the vlist, with the appropriate kerns + var vlist = _buildCommon2.default.makeVList([{ type: "kern", size: line.height }, { type: "elem", elem: line }, { type: "kern", size: 3 * line.height }, { type: "elem", elem: innerGroup }], "top", innerGroup.height, options); + + return (0, _buildCommon.makeSpan)(["mord", "underline"], [vlist], options); +}; + +groupTypes.sqrt = function (group, options) { + // Square roots are handled in the TeXbook pg. 443, Rule 11. + + // First, we do the same steps as in overline to build the inner group + // and line + var inner = buildGroup(group.value.body, options.havingCrampedStyle()); + + // Some groups can return document fragments. Handle those by wrapping + // them in a span. + if (inner instanceof _domTree2.default.documentFragment) { + inner = (0, _buildCommon.makeSpan)([], [inner], options); + } + + // Calculate the minimum size for the \surd delimiter + var metrics = options.fontMetrics(); + var theta = metrics.defaultRuleThickness; + + var phi = theta; + if (options.style.id < _Style2.default.TEXT.id) { + phi = options.fontMetrics().xHeight; + } + + // Calculate the clearance between the body and line + var lineClearance = theta + phi / 4; + + var minDelimiterHeight = (inner.height + inner.depth + lineClearance + theta) * options.sizeMultiplier; + + // Create a sqrt SVG of the required minimum size + var img = _delimiter2.default.customSizedDelim("\\surd", minDelimiterHeight, false, options, group.mode); + + // Calculate the actual line width. + // This actually should depend on the chosen font -- e.g. \boldmath + // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and + // have thicker rules. + var ruleWidth = options.fontMetrics().sqrtRuleThickness * img.sizeMultiplier; + + var delimDepth = img.height - ruleWidth; + + // Adjust the clearance based on the delimiter size + if (delimDepth > inner.height + inner.depth + lineClearance) { + lineClearance = (lineClearance + delimDepth - inner.height - inner.depth) / 2; + } + + // Shift the sqrt image + var imgShift = img.height - inner.height - lineClearance - ruleWidth; + + // We add a special case here, because even when `inner` is empty, we + // still get a line. So, we use a simple heuristic to decide if we + // should omit the body entirely. (note this doesn't work for something + // like `\sqrt{\rlap{x}}`, but if someone is doing that they deserve for + // it not to work. + var body = void 0; + if (inner.height === 0 && inner.depth === 0) { + body = (0, _buildCommon.makeSpan)(); + } else { + inner.style.paddingLeft = img.surdWidth + "em"; + + // Overlay the image and the argument. + body = _buildCommon2.default.makeVList([{ type: "elem", elem: inner }, { type: "kern", size: -(inner.height + imgShift) }, { type: "elem", elem: img }, { type: "kern", size: ruleWidth }], "firstBaseline", null, options); + body.children[0].children[0].classes.push("svg-align"); + } + + if (!group.value.index) { + return (0, _buildCommon.makeSpan)(["mord", "sqrt"], [body], options); + } else { + // Handle the optional root index + + // The index is always in scriptscript style + var newOptions = options.havingStyle(_Style2.default.SCRIPTSCRIPT); + var rootm = buildGroup(group.value.index, newOptions, options); + + // The amount the index is shifted by. This is taken from the TeX + // source, in the definition of `\r@@t`. + var toShift = 0.6 * (body.height - body.depth); + + // Build a VList with the superscript shifted up correctly + var rootVList = _buildCommon2.default.makeVList([{ type: "elem", elem: rootm }], "shift", -toShift, options); + // Add a class surrounding it so we can add on the appropriate + // kerning + var rootVListWrap = (0, _buildCommon.makeSpan)(["root"], [rootVList]); + + return (0, _buildCommon.makeSpan)(["mord", "sqrt"], [rootVListWrap, body], options); + } +}; + +function sizingGroup(value, options, baseOptions) { + var inner = buildExpression(value, options, false); + var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; + + // Add size-resetting classes to the inner list and set maxFontSize + // manually. Handle nested size changes. + for (var i = 0; i < inner.length; i++) { + var pos = _utils2.default.indexOf(inner[i].classes, "sizing"); + if (pos < 0) { + Array.prototype.push.apply(inner[i].classes, options.sizingClasses(baseOptions)); + } else if (inner[i].classes[pos + 1] === "reset-size" + options.size) { + // This is a nested size change: e.g., inner[i] is the "b" in + // `\Huge a \small b`. Override the old size (the `reset-` class) + // but not the new size. + inner[i].classes[pos + 1] = "reset-size" + baseOptions.size; + } + + inner[i].height *= multiplier; + inner[i].depth *= multiplier; + } + + return _buildCommon2.default.makeFragment(inner); +} + +groupTypes.sizing = function (group, options) { + // Handle sizing operators like \Huge. Real TeX doesn't actually allow + // these functions inside of math expressions, so we do some special + // handling. + var newOptions = options.havingSize(group.value.size); + return sizingGroup(group.value.value, newOptions, options); +}; + +groupTypes.styling = function (group, options) { + // Style changes are handled in the TeXbook on pg. 442, Rule 3. + + // Figure out what style we're changing to. + var styleMap = { + "display": _Style2.default.DISPLAY, + "text": _Style2.default.TEXT, + "script": _Style2.default.SCRIPT, + "scriptscript": _Style2.default.SCRIPTSCRIPT + }; + + var newStyle = styleMap[group.value.style]; + var newOptions = options.havingStyle(newStyle); + return sizingGroup(group.value.value, newOptions, options); +}; + +groupTypes.font = function (group, options) { + var font = group.value.font; + return buildGroup(group.value.body, options.withFont(font)); +}; + +groupTypes.delimsizing = function (group, options) { + var delim = group.value.value; + + if (delim === ".") { + // Empty delimiters still count as elements, even though they don't + // show anything. + return (0, _buildCommon.makeSpan)([group.value.mclass]); + } + + // Use delimiter.sizedDelim to generate the delimiter. + return _delimiter2.default.sizedDelim(delim, group.value.size, options, group.mode, [group.value.mclass]); +}; + +groupTypes.leftright = function (group, options) { + // Build the inner expression + var inner = buildExpression(group.value.body, options, true); + + var innerHeight = 0; + var innerDepth = 0; + var hadMiddle = false; + + // Calculate its height and depth + for (var i = 0; i < inner.length; i++) { + if (inner[i].isMiddle) { + hadMiddle = true; + } else { + innerHeight = Math.max(inner[i].height, innerHeight); + innerDepth = Math.max(inner[i].depth, innerDepth); + } + } + + // The size of delimiters is the same, regardless of what style we are + // in. Thus, to correctly calculate the size of delimiter we need around + // a group, we scale down the inner size based on the size. + innerHeight *= options.sizeMultiplier; + innerDepth *= options.sizeMultiplier; + + var leftDelim = void 0; + if (group.value.left === ".") { + // Empty delimiters in \left and \right make null delimiter spaces. + leftDelim = makeNullDelimiter(options, ["mopen"]); + } else { + // Otherwise, use leftRightDelim to generate the correct sized + // delimiter. + leftDelim = _delimiter2.default.leftRightDelim(group.value.left, innerHeight, innerDepth, options, group.mode, ["mopen"]); + } + // Add it to the beginning of the expression + inner.unshift(leftDelim); + + // Handle middle delimiters + if (hadMiddle) { + for (var _i4 = 1; _i4 < inner.length; _i4++) { + var middleDelim = inner[_i4]; + if (middleDelim.isMiddle) { + // Apply the options that were active when \middle was called + inner[_i4] = _delimiter2.default.leftRightDelim(middleDelim.isMiddle.value, innerHeight, innerDepth, middleDelim.isMiddle.options, group.mode, []); + // Add back spaces shifted into the delimiter + var spaces = spliceSpaces(middleDelim.children, 0); + if (spaces) { + _buildCommon2.default.prependChildren(inner[_i4], spaces); + } + } + } + } + + var rightDelim = void 0; + // Same for the right delimiter + if (group.value.right === ".") { + rightDelim = makeNullDelimiter(options, ["mclose"]); + } else { + rightDelim = _delimiter2.default.leftRightDelim(group.value.right, innerHeight, innerDepth, options, group.mode, ["mclose"]); + } + // Add it to the end of the expression. + inner.push(rightDelim); + + return (0, _buildCommon.makeSpan)(["minner"], inner, options); +}; + +groupTypes.middle = function (group, options) { + var middleDelim = void 0; + if (group.value.value === ".") { + middleDelim = makeNullDelimiter(options, []); + } else { + middleDelim = _delimiter2.default.sizedDelim(group.value.value, 1, options, group.mode, []); + middleDelim.isMiddle = { value: group.value.value, options: options }; + } + return middleDelim; +}; + +groupTypes.rule = function (group, options) { + // Make an empty span for the rule + var rule = (0, _buildCommon.makeSpan)(["mord", "rule"], [], options); + + // Calculate the shift, width, and height of the rule, and account for units + var shift = 0; + if (group.value.shift) { + shift = _units2.default.calculateSize(group.value.shift, options); + } + + var width = _units2.default.calculateSize(group.value.width, options); + var height = _units2.default.calculateSize(group.value.height, options); + + // Style the rule to the right size + rule.style.borderRightWidth = width + "em"; + rule.style.borderTopWidth = height + "em"; + rule.style.bottom = shift + "em"; + + // Record the height and width + rule.width = width; + rule.height = height + shift; + rule.depth = -shift; + // Font size is the number large enough that the browser will + // reserve at least `absHeight` space above the baseline. + // The 1.125 factor was empirically determined + rule.maxFontSize = height * 1.125 * options.sizeMultiplier; + + return rule; +}; + +groupTypes.kern = function (group, options) { + // Make an empty span for the rule + var rule = (0, _buildCommon.makeSpan)(["mord", "rule"], [], options); + + if (group.value.dimension) { + var dimension = _units2.default.calculateSize(group.value.dimension, options); + rule.style.marginLeft = dimension + "em"; + } + + return rule; +}; + +groupTypes.accent = function (group, options) { + // Accents are handled in the TeXbook pg. 443, rule 12. + var base = group.value.base; + + var supsubGroup = void 0; + if (group.type === "supsub") { + // If our base is a character box, and we have superscripts and + // subscripts, the supsub will defer to us. In particular, we want + // to attach the superscripts and subscripts to the inner body (so + // that the position of the superscripts and subscripts won't be + // affected by the height of the accent). We accomplish this by + // sticking the base of the accent into the base of the supsub, and + // rendering that, while keeping track of where the accent is. + + // The supsub group is the group that was passed in + var supsub = group; + // The real accent group is the base of the supsub group + group = supsub.value.base; + // The character box is the base of the accent group + base = group.value.base; + // Stick the character box into the base of the supsub group + supsub.value.base = base; + + // Rerender the supsub group with its new base, and store that + // result. + supsubGroup = buildGroup(supsub, options); + } + + // Build the base group + var body = buildGroup(base, options.havingCrampedStyle()); + + // Does the accent need to shift for the skew of a character? + var mustShift = group.value.isShifty && isCharacterBox(base); + + // Calculate the skew of the accent. This is based on the line "If the + // nucleus is not a single character, let s = 0; otherwise set s to the + // kern amount for the nucleus followed by the \skewchar of its font." + // Note that our skew metrics are just the kern between each character + // and the skewchar. + var skew = 0; + if (mustShift) { + // If the base is a character box, then we want the skew of the + // innermost character. To do that, we find the innermost character: + var baseChar = getBaseElem(base); + // Then, we render its group to get the symbol inside it + var baseGroup = buildGroup(baseChar, options.havingCrampedStyle()); + // Finally, we pull the skew off of the symbol. + skew = baseGroup.skew; + // Note that we now throw away baseGroup, because the layers we + // removed with getBaseElem might contain things like \color which + // we can't get rid of. + // TODO(emily): Find a better way to get the skew + } + + // calculate the amount of space between the body and the accent + var clearance = Math.min(body.height, options.fontMetrics().xHeight); + + // Build the accent + var accentBody = void 0; + if (!group.value.isStretchy) { + var accent = _buildCommon2.default.makeSymbol(group.value.label, "Main-Regular", group.mode, options); + // Remove the italic correction of the accent, because it only serves to + // shift the accent over to a place we don't want. + accent.italic = 0; + + // The \vec character that the fonts use is a combining character, and + // thus shows up much too far to the left. To account for this, we add a + // specific class which shifts the accent over to where we want it. + // TODO(emily): Fix this in a better way, like by changing the font + // Similarly, text accent \H is a combining character and + // requires a different adjustment. + var accentClass = null; + if (group.value.label === "\\vec") { + accentClass = "accent-vec"; + } else if (group.value.label === '\\H') { + accentClass = "accent-hungarian"; + } + + accentBody = (0, _buildCommon.makeSpan)([], [accent]); + accentBody = (0, _buildCommon.makeSpan)(["accent-body", accentClass], [accentBody]); + + // Shift the accent over by the skew. Note we shift by twice the skew + // because we are centering the accent, so by adding 2*skew to the left, + // we shift it to the right by 1*skew. + accentBody.style.marginLeft = 2 * skew + "em"; + + accentBody = _buildCommon2.default.makeVList([{ type: "elem", elem: body }, { type: "kern", size: -clearance }, { type: "elem", elem: accentBody }], "firstBaseline", null, options); + } else { + accentBody = _stretchy2.default.svgSpan(group, options); + + accentBody = _buildCommon2.default.makeVList([{ type: "elem", elem: body }, { type: "elem", elem: accentBody }], "firstBaseline", null, options); + + var styleSpan = accentBody.children[0].children[0].children[1]; + styleSpan.classes.push("svg-align"); // text-align: left; + if (skew > 0) { + // Shorten the accent and nudge it to the right. + styleSpan.style.width = "calc(100% - " + 2 * skew + "em)"; + styleSpan.style.marginLeft = 2 * skew + "em"; + } + } + + var accentWrap = (0, _buildCommon.makeSpan)(["mord", "accent"], [accentBody], options); + + if (supsubGroup) { + // Here, we replace the "base" child of the supsub with our newly + // generated accent. + supsubGroup.children[0] = accentWrap; + + // Since we don't rerun the height calculation after replacing the + // accent, we manually recalculate height. + supsubGroup.height = Math.max(accentWrap.height, supsubGroup.height); + + // Accents should always be ords, even when their innards are not. + supsubGroup.classes[0] = "mord"; + + return supsubGroup; + } else { + return accentWrap; + } +}; + +groupTypes.horizBrace = function (group, options) { + var style = options.style; + + var hasSupSub = group.type === "supsub"; + var supSubGroup = void 0; + var newOptions = void 0; + if (hasSupSub) { + // Ref: LaTeX source2e: }}}}\limits} + // i.e. LaTeX treats the brace similar to an op and passes it + // with \limits, so we need to assign supsub style. + if (group.value.sup) { + newOptions = options.havingStyle(style.sup()); + supSubGroup = buildGroup(group.value.sup, newOptions, options); + } else { + newOptions = options.havingStyle(style.sub()); + supSubGroup = buildGroup(group.value.sub, newOptions, options); + } + group = group.value.base; + } + + // Build the base group + var body = buildGroup(group.value.base, options.havingBaseStyle(_Style2.default.DISPLAY)); + + // Create the stretchy element + var braceBody = _stretchy2.default.svgSpan(group, options); + + // Generate the vlist, with the appropriate kerns ┏━━━━━━━━┓ + // This first vlist contains the subject matter and the brace: equation + var vlist = void 0; + if (group.value.isOver) { + vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: body }, { type: "kern", size: 0.1 }, { type: "elem", elem: braceBody }], "firstBaseline", null, options); + vlist.children[0].children[0].children[1].classes.push("svg-align"); + } else { + vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: braceBody }, { type: "kern", size: 0.1 }, { type: "elem", elem: body }], "bottom", body.depth + 0.1 + braceBody.height, options); + vlist.children[0].children[0].children[0].classes.push("svg-align"); + } + + if (hasSupSub) { + // In order to write the supsub, wrap the first vlist in another vlist: + // They can't all go in the same vlist, because the note might be wider + // than the equation. We want the equation to control the brace width. + + // note long note long note + // ┏━━━━━━━━┓ or ┏━━━┓ not ┏━━━━━━━━━┓ + // equation eqn eqn + + var vSpan = (0, _buildCommon.makeSpan)(["mord", group.value.isOver ? "mover" : "munder"], [vlist], options); + + if (group.value.isOver) { + vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: vSpan }, { type: "kern", size: 0.2 }, { type: "elem", elem: supSubGroup }], "firstBaseline", null, options); + } else { + vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: supSubGroup }, { type: "kern", size: 0.2 }, { type: "elem", elem: vSpan }], "bottom", vSpan.depth + 0.2 + supSubGroup.height, options); + } + } + + return (0, _buildCommon.makeSpan)(["mord", group.value.isOver ? "mover" : "munder"], [vlist], options); +}; + +groupTypes.accentUnder = function (group, options) { + // Treat under accents much like underlines. + var innerGroup = buildGroup(group.value.body, options); + + var accentBody = _stretchy2.default.svgSpan(group, options); + var kern = /tilde/.test(group.value.label) ? 0.12 : 0; + + // Generate the vlist, with the appropriate kerns + var vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: accentBody }, { type: "kern", size: kern }, { type: "elem", elem: innerGroup }], "bottom", accentBody.height + kern, options); + + vlist.children[0].children[0].children[0].classes.push("svg-align"); + + return (0, _buildCommon.makeSpan)(["mord", "accentunder"], [vlist], options); +}; + +groupTypes.enclose = function (group, options) { + // \cancel, \bcancel, \xcancel, \sout, \fbox + var inner = buildGroup(group.value.body, options); + + var label = group.value.label.substr(1); + var scale = options.sizeMultiplier; + var img = void 0; + var pad = 0; + var imgShift = 0; + + if (label === "sout") { + img = (0, _buildCommon.makeSpan)(["stretchy", "sout"]); + img.height = options.fontMetrics().defaultRuleThickness / scale; + imgShift = -0.5 * options.fontMetrics().xHeight; + } else { + // Add horizontal padding + inner.classes.push(label === "fbox" ? "boxpad" : "cancel-pad"); + + // Add vertical padding + var isCharBox = isCharacterBox(group.value.body); + // ref: LaTeX source2e: \fboxsep = 3pt; \fboxrule = .4pt + // ref: cancel package: \advance\totalheight2\p@ % "+2" + pad = label === "fbox" ? 0.34 : isCharBox ? 0.2 : 0; + imgShift = inner.depth + pad; + + img = _stretchy2.default.encloseSpan(inner, label, pad, options); + } + + var vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: inner, shift: 0 }, { type: "elem", elem: img, shift: imgShift }], "individualShift", null, options); + + if (label !== "fbox") { + vlist.children[0].children[0].children[1].classes.push("svg-align"); + } + + if (/cancel/.test(label)) { + // cancel does not create horiz space for its line extension. + // That is, not when adjacent to a mord. + return (0, _buildCommon.makeSpan)(["mord", "cancel-lap"], [vlist], options); + } else { + return (0, _buildCommon.makeSpan)(["mord"], [vlist], options); + } +}; + +groupTypes.xArrow = function (group, options) { + var style = options.style; + + // Build the argument groups in the appropriate style. + // Ref: amsmath.dtx: \hbox{$\scriptstyle\mkern#3mu{#6}\mkern#4mu$}% + + var newOptions = options.havingStyle(style.sup()); + var upperGroup = buildGroup(group.value.body, newOptions, options); + upperGroup.classes.push("x-arrow-pad"); + + var lowerGroup = void 0; + if (group.value.below) { + // Build the lower group + newOptions = options.havingStyle(style.sub()); + lowerGroup = buildGroup(group.value.below, newOptions, options); + lowerGroup.classes.push("x-arrow-pad"); + } + + var arrowBody = _stretchy2.default.svgSpan(group, options); + + var arrowShift = -options.fontMetrics().axisHeight + arrowBody.depth; + var upperShift = -options.fontMetrics().axisHeight - arrowBody.height - 0.111; // 2 mu. Ref: amsmath.dtx: #7\if0#2\else\mkern#2mu\fi + + // Generate the vlist + var vlist = void 0; + if (group.value.below) { + var lowerShift = -options.fontMetrics().axisHeight + lowerGroup.height + arrowBody.height + 0.111; + vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: upperGroup, shift: upperShift }, { type: "elem", elem: arrowBody, shift: arrowShift }, { type: "elem", elem: lowerGroup, shift: lowerShift }], "individualShift", null, options); + } else { + vlist = _buildCommon2.default.makeVList([{ type: "elem", elem: upperGroup, shift: upperShift }, { type: "elem", elem: arrowBody, shift: arrowShift }], "individualShift", null, options); + } + + vlist.children[0].children[0].children[1].classes.push("svg-align"); + + return (0, _buildCommon.makeSpan)(["mrel", "x-arrow"], [vlist], options); +}; + +groupTypes.phantom = function (group, options) { + var elements = buildExpression(group.value.value, options.withPhantom(), false); + + // \phantom isn't supposed to affect the elements it contains. + // See "color" for more details. + return new _buildCommon2.default.makeFragment(elements); +}; + +groupTypes.mclass = function (group, options) { + var elements = buildExpression(group.value.value, options, true); + + return (0, _buildCommon.makeSpan)([group.value.mclass], elements, options); +}; + +/** + * buildGroup is the function that takes a group and calls the correct groupType + * function for it. It also handles the interaction of size and style changes + * between parents and children. + */ +var buildGroup = function buildGroup(group, options, baseOptions) { + if (!group) { + return (0, _buildCommon.makeSpan)(); + } + + if (groupTypes[group.type]) { + // Call the groupTypes function + var groupNode = groupTypes[group.type](group, options); + + // If the size changed between the parent and the current group, account + // for that size difference. + if (baseOptions && options.size !== baseOptions.size) { + groupNode = (0, _buildCommon.makeSpan)(options.sizingClasses(baseOptions), [groupNode], options); + + var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier; + + groupNode.height *= multiplier; + groupNode.depth *= multiplier; + } + + return groupNode; + } else { + throw new _ParseError2.default("Got group of unknown type: '" + group.type + "'"); + } +}; + +/** + * Take an entire parse tree, and build it into an appropriate set of HTML + * nodes. + */ +var buildHTML = function buildHTML(tree, options) { + // buildExpression is destructive, so we need to make a clone + // of the incoming tree so that it isn't accidentally changed + tree = JSON.parse((0, _stringify2.default)(tree)); + + // Build the expression contained in the tree + var expression = buildExpression(tree, options, true); + var body = (0, _buildCommon.makeSpan)(["base"], expression, options); + + // Add struts, which ensure that the top of the HTML element falls at the + // height of the expression, and the bottom of the HTML element falls at the + // depth of the expression. + var topStrut = (0, _buildCommon.makeSpan)(["strut"]); + var bottomStrut = (0, _buildCommon.makeSpan)(["strut", "bottom"]); + + topStrut.style.height = body.height + "em"; + bottomStrut.style.height = body.height + body.depth + "em"; + // We'd like to use `vertical-align: top` but in IE 9 this lowers the + // baseline of the box to the bottom of this strut (instead staying in the + // normal place) so we use an absolute value for vertical-align instead + bottomStrut.style.verticalAlign = -body.depth + "em"; + + // Wrap the struts and body together + var htmlNode = (0, _buildCommon.makeSpan)(["katex-html"], [topStrut, bottomStrut, body]); + + htmlNode.setAttribute("aria-hidden", "true"); + + return htmlNode; +}; + +module.exports = buildHTML; + +},{"./ParseError":29,"./Style":33,"./buildCommon":34,"./delimiter":38,"./domTree":39,"./stretchy":47,"./units":50,"./utils":51,"babel-runtime/core-js/json/stringify":2}],36:[function(require,module,exports){ +"use strict"; + +var _buildCommon = require("./buildCommon"); + +var _buildCommon2 = _interopRequireDefault(_buildCommon); + +var _fontMetrics = require("./fontMetrics"); + +var _fontMetrics2 = _interopRequireDefault(_fontMetrics); + +var _mathMLTree = require("./mathMLTree"); + +var _mathMLTree2 = _interopRequireDefault(_mathMLTree); + +var _ParseError = require("./ParseError"); + +var _ParseError2 = _interopRequireDefault(_ParseError); + +var _Style = require("./Style"); + +var _Style2 = _interopRequireDefault(_Style); + +var _symbols = require("./symbols"); + +var _symbols2 = _interopRequireDefault(_symbols); + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +var _stretchy = require("./stretchy"); + +var _stretchy2 = _interopRequireDefault(_stretchy); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Takes a symbol and converts it into a MathML text node after performing + * optional replacement from symbols.js. + */ +/** + * This file converts a parse tree into a cooresponding MathML tree. The main + * entry point is the `buildMathML` function, which takes a parse tree from the + * parser. + */ + +var makeText = function makeText(text, mode) { + if (_symbols2.default[mode][text] && _symbols2.default[mode][text].replace) { + text = _symbols2.default[mode][text].replace; + } + + return new _mathMLTree2.default.TextNode(text); +}; + +/** + * Returns the math variant as a string or null if none is required. + */ +var getVariant = function getVariant(group, options) { + var font = options.font; + if (!font) { + return null; + } + + var mode = group.mode; + if (font === "mathit") { + return "italic"; + } + + var value = group.value; + if (_utils2.default.contains(["\\imath", "\\jmath"], value)) { + return null; + } + + if (_symbols2.default[mode][value] && _symbols2.default[mode][value].replace) { + value = _symbols2.default[mode][value].replace; + } + + var fontName = _buildCommon.fontMap[font].fontName; + if (_fontMetrics2.default.getCharacterMetrics(value, fontName)) { + return _buildCommon.fontMap[options.font].variant; + } + + return null; +}; + +/** + * Functions for handling the different types of groups found in the parse + * tree. Each function should take a parse group and return a MathML node. + */ +var groupTypes = {}; + +var defaultVariant = { + "mi": "italic", + "mn": "normal", + "mtext": "normal" +}; + +groupTypes.mathord = function (group, options) { + var node = new _mathMLTree2.default.MathNode("mi", [makeText(group.value, group.mode)]); + + var variant = getVariant(group, options) || "italic"; + if (variant !== defaultVariant[node.type]) { + node.setAttribute("mathvariant", variant); + } + return node; +}; + +groupTypes.textord = function (group, options) { + var text = makeText(group.value, group.mode); + + var variant = getVariant(group, options) || "normal"; + + var node = void 0; + if (group.mode === 'text') { + node = new _mathMLTree2.default.MathNode("mtext", [text]); + } else if (/[0-9]/.test(group.value)) { + // TODO(kevinb) merge adjacent nodes + // do it as a post processing step + node = new _mathMLTree2.default.MathNode("mn", [text]); + } else if (group.value === "\\prime") { + node = new _mathMLTree2.default.MathNode("mo", [text]); + } else { + node = new _mathMLTree2.default.MathNode("mi", [text]); + } + if (variant !== defaultVariant[node.type]) { + node.setAttribute("mathvariant", variant); + } + + return node; +}; + +groupTypes.bin = function (group) { + var node = new _mathMLTree2.default.MathNode("mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.rel = function (group) { + var node = new _mathMLTree2.default.MathNode("mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.open = function (group) { + var node = new _mathMLTree2.default.MathNode("mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.close = function (group) { + var node = new _mathMLTree2.default.MathNode("mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.inner = function (group) { + var node = new _mathMLTree2.default.MathNode("mo", [makeText(group.value, group.mode)]); + + return node; +}; + +groupTypes.punct = function (group) { + var node = new _mathMLTree2.default.MathNode("mo", [makeText(group.value, group.mode)]); + + node.setAttribute("separator", "true"); + + return node; +}; + +groupTypes.ordgroup = function (group, options) { + var inner = buildExpression(group.value, options); + + var node = new _mathMLTree2.default.MathNode("mrow", inner); + + return node; +}; + +groupTypes.text = function (group, options) { + var body = group.value.body; + + // Convert each element of the body into MathML, and combine consecutive + // outputs into a single tag. In this way, we don't + // nest non-text items (e.g., $nested-math$) within an . + var inner = []; + var currentText = null; + for (var i = 0; i < body.length; i++) { + var _group = buildGroup(body[i], options); + if (_group.type === 'mtext' && currentText != null) { + Array.prototype.push.apply(currentText.children, _group.children); + } else { + inner.push(_group); + if (_group.type === 'mtext') { + currentText = _group; + } + } + } + + // If there is a single tag in the end (presumably ), + // just return it. Otherwise, wrap them in an . + if (inner.length === 1) { + return inner[0]; + } else { + return new _mathMLTree2.default.MathNode("mrow", inner); + } +}; + +groupTypes.color = function (group, options) { + var inner = buildExpression(group.value.value, options); + + var node = new _mathMLTree2.default.MathNode("mstyle", inner); + + node.setAttribute("mathcolor", group.value.color); + + return node; +}; + +groupTypes.supsub = function (group, options) { + // Is the inner group a relevant horizonal brace? + var isBrace = false; + var isOver = void 0; + var isSup = void 0; + if (group.value.base) { + if (group.value.base.value.type === "horizBrace") { + isSup = group.value.sup ? true : false; + if (isSup === group.value.base.value.isOver) { + isBrace = true; + isOver = group.value.base.value.isOver; + } + } + } + + var removeUnnecessaryRow = true; + var children = [buildGroup(group.value.base, options, removeUnnecessaryRow)]; + + if (group.value.sub) { + children.push(buildGroup(group.value.sub, options, removeUnnecessaryRow)); + } + + if (group.value.sup) { + children.push(buildGroup(group.value.sup, options, removeUnnecessaryRow)); + } + + var nodeType = void 0; + if (isBrace) { + nodeType = isOver ? "mover" : "munder"; + } else if (!group.value.sub) { + nodeType = "msup"; + } else if (!group.value.sup) { + nodeType = "msub"; + } else { + var base = group.value.base; + if (base && base.value.limits && options.style === _Style2.default.DISPLAY) { + nodeType = "munderover"; + } else { + nodeType = "msubsup"; + } + } + + var node = new _mathMLTree2.default.MathNode(nodeType, children); + + return node; +}; + +groupTypes.genfrac = function (group, options) { + var node = new _mathMLTree2.default.MathNode("mfrac", [buildGroup(group.value.numer, options), buildGroup(group.value.denom, options)]); + + if (!group.value.hasBarLine) { + node.setAttribute("linethickness", "0px"); + } + + if (group.value.leftDelim != null || group.value.rightDelim != null) { + var withDelims = []; + + if (group.value.leftDelim != null) { + var leftOp = new _mathMLTree2.default.MathNode("mo", [new _mathMLTree2.default.TextNode(group.value.leftDelim)]); + + leftOp.setAttribute("fence", "true"); + + withDelims.push(leftOp); + } + + withDelims.push(node); + + if (group.value.rightDelim != null) { + var rightOp = new _mathMLTree2.default.MathNode("mo", [new _mathMLTree2.default.TextNode(group.value.rightDelim)]); + + rightOp.setAttribute("fence", "true"); + + withDelims.push(rightOp); + } + + var outerNode = new _mathMLTree2.default.MathNode("mrow", withDelims); + + return outerNode; + } + + return node; +}; + +groupTypes.array = function (group, options) { + return new _mathMLTree2.default.MathNode("mtable", group.value.body.map(function (row) { + return new _mathMLTree2.default.MathNode("mtr", row.map(function (cell) { + return new _mathMLTree2.default.MathNode("mtd", [buildGroup(cell, options)]); + })); + })); +}; + +groupTypes.sqrt = function (group, options) { + var node = void 0; + if (group.value.index) { + node = new _mathMLTree2.default.MathNode("mroot", [buildGroup(group.value.body, options), buildGroup(group.value.index, options)]); + } else { + node = new _mathMLTree2.default.MathNode("msqrt", [buildGroup(group.value.body, options)]); + } + + return node; +}; + +groupTypes.leftright = function (group, options) { + var inner = buildExpression(group.value.body, options); + + if (group.value.left !== ".") { + var leftNode = new _mathMLTree2.default.MathNode("mo", [makeText(group.value.left, group.mode)]); + + leftNode.setAttribute("fence", "true"); + + inner.unshift(leftNode); + } + + if (group.value.right !== ".") { + var rightNode = new _mathMLTree2.default.MathNode("mo", [makeText(group.value.right, group.mode)]); + + rightNode.setAttribute("fence", "true"); + + inner.push(rightNode); + } + + var outerNode = new _mathMLTree2.default.MathNode("mrow", inner); + + return outerNode; +}; + +groupTypes.middle = function (group, options) { + var middleNode = new _mathMLTree2.default.MathNode("mo", [makeText(group.value.middle, group.mode)]); + middleNode.setAttribute("fence", "true"); + return middleNode; +}; + +groupTypes.accent = function (group, options) { + var accentNode = void 0; + if (group.value.isStretchy) { + accentNode = _stretchy2.default.mathMLnode(group.value.label); + } else { + accentNode = new _mathMLTree2.default.MathNode("mo", [makeText(group.value.label, group.mode)]); + } + + var node = new _mathMLTree2.default.MathNode("mover", [buildGroup(group.value.base, options), accentNode]); + + node.setAttribute("accent", "true"); + + return node; +}; + +groupTypes.spacing = function (group) { + var node = void 0; + + if (group.value === "\\ " || group.value === "\\space" || group.value === " " || group.value === "~") { + node = new _mathMLTree2.default.MathNode("mtext", [new _mathMLTree2.default.TextNode("\xA0")]); + } else { + node = new _mathMLTree2.default.MathNode("mspace"); + + node.setAttribute("width", _buildCommon2.default.spacingFunctions[group.value].size); + } + + return node; +}; + +groupTypes.op = function (group, options) { + var node = void 0; + + // TODO(emily): handle big operators using the `largeop` attribute + + if (group.value.symbol) { + // This is a symbol. Just add the symbol. + node = new _mathMLTree2.default.MathNode("mo", [makeText(group.value.body, group.mode)]); + } else if (group.value.value) { + // This is an operator with children. Add them. + node = new _mathMLTree2.default.MathNode("mo", buildExpression(group.value.value, options)); + } else { + // This is a text operator. Add all of the characters from the + // operator's name. + // TODO(emily): Add a space in the middle of some of these + // operators, like \limsup. + node = new _mathMLTree2.default.MathNode("mi", [new _mathMLTree2.default.TextNode(group.value.body.slice(1))]); + } + + return node; +}; + +groupTypes.mod = function (group, options) { + var inner = []; + + if (group.value.modType === "pod" || group.value.modType === "pmod") { + inner.push(new _mathMLTree2.default.MathNode("mo", [makeText("(", group.mode)])); + } + if (group.value.modType !== "pod") { + inner.push(new _mathMLTree2.default.MathNode("mo", [makeText("mod", group.mode)])); + } + if (group.value.value) { + var space = new _mathMLTree2.default.MathNode("mspace"); + space.setAttribute("width", "0.333333em"); + inner.push(space); + inner = inner.concat(buildExpression(group.value.value, options)); + } + if (group.value.modType === "pod" || group.value.modType === "pmod") { + inner.push(new _mathMLTree2.default.MathNode("mo", [makeText(")", group.mode)])); + } + + return new _mathMLTree2.default.MathNode("mo", inner); +}; + +groupTypes.katex = function (group) { + var node = new _mathMLTree2.default.MathNode("mtext", [new _mathMLTree2.default.TextNode("KaTeX")]); + + return node; +}; + +groupTypes.font = function (group, options) { + var font = group.value.font; + return buildGroup(group.value.body, options.withFont(font)); +}; + +groupTypes.delimsizing = function (group) { + var children = []; + + if (group.value.value !== ".") { + children.push(makeText(group.value.value, group.mode)); + } + + var node = new _mathMLTree2.default.MathNode("mo", children); + + if (group.value.mclass === "mopen" || group.value.mclass === "mclose") { + // Only some of the delimsizing functions act as fences, and they + // return "mopen" or "mclose" mclass. + node.setAttribute("fence", "true"); + } else { + // Explicitly disable fencing if it's not a fence, to override the + // defaults. + node.setAttribute("fence", "false"); + } + + return node; +}; + +groupTypes.styling = function (group, options) { + // Figure out what style we're changing to. + // TODO(kevinb): dedupe this with buildHTML.js + // This will be easier of handling of styling nodes is in the same file. + var styleMap = { + "display": _Style2.default.DISPLAY, + "text": _Style2.default.TEXT, + "script": _Style2.default.SCRIPT, + "scriptscript": _Style2.default.SCRIPTSCRIPT + }; + + var newStyle = styleMap[group.value.style]; + var newOptions = options.havingStyle(newStyle); + + var inner = buildExpression(group.value.value, newOptions); + + var node = new _mathMLTree2.default.MathNode("mstyle", inner); + + var styleAttributes = { + "display": ["0", "true"], + "text": ["0", "false"], + "script": ["1", "false"], + "scriptscript": ["2", "false"] + }; + + var attr = styleAttributes[group.value.style]; + + node.setAttribute("scriptlevel", attr[0]); + node.setAttribute("displaystyle", attr[1]); + + return node; +}; + +groupTypes.sizing = function (group, options) { + var newOptions = options.havingSize(group.value.size); + var inner = buildExpression(group.value.value, newOptions); + + var node = new _mathMLTree2.default.MathNode("mstyle", inner); + + // TODO(emily): This doesn't produce the correct size for nested size + // changes, because we don't keep state of what style we're currently + // in, so we can't reset the size to normal before changing it. Now + // that we're passing an options parameter we should be able to fix + // this. + node.setAttribute("mathsize", newOptions.sizeMultiplier + "em"); + + return node; +}; + +groupTypes.overline = function (group, options) { + var operator = new _mathMLTree2.default.MathNode("mo", [new _mathMLTree2.default.TextNode("\u203E")]); + operator.setAttribute("stretchy", "true"); + + var node = new _mathMLTree2.default.MathNode("mover", [buildGroup(group.value.body, options), operator]); + node.setAttribute("accent", "true"); + + return node; +}; + +groupTypes.underline = function (group, options) { + var operator = new _mathMLTree2.default.MathNode("mo", [new _mathMLTree2.default.TextNode("\u203E")]); + operator.setAttribute("stretchy", "true"); + + var node = new _mathMLTree2.default.MathNode("munder", [buildGroup(group.value.body, options), operator]); + node.setAttribute("accentunder", "true"); + + return node; +}; + +groupTypes.accentUnder = function (group, options) { + var accentNode = _stretchy2.default.mathMLnode(group.value.label); + var node = new _mathMLTree2.default.MathNode("munder", [buildGroup(group.value.body, options), accentNode]); + node.setAttribute("accentunder", "true"); + return node; +}; + +groupTypes.enclose = function (group, options) { + var node = new _mathMLTree2.default.MathNode("menclose", [buildGroup(group.value.body, options)]); + var notation = ""; + switch (group.value.label) { + case "\\bcancel": + notation = "downdiagonalstrike"; + break; + case "\\sout": + notation = "horizontalstrike"; + break; + case "\\fbox": + notation = "box"; + break; + default: + notation = "updiagonalstrike"; + } + node.setAttribute("notation", notation); + return node; +}; + +groupTypes.horizBrace = function (group, options) { + var accentNode = _stretchy2.default.mathMLnode(group.value.label); + return new _mathMLTree2.default.MathNode(group.value.isOver ? "mover" : "munder", [buildGroup(group.value.base, options), accentNode]); +}; + +groupTypes.xArrow = function (group, options) { + var arrowNode = _stretchy2.default.mathMLnode(group.value.label); + var node = void 0; + var lowerNode = void 0; + + if (group.value.body) { + var upperNode = buildGroup(group.value.body, options); + if (group.value.below) { + lowerNode = buildGroup(group.value.below, options); + node = new _mathMLTree2.default.MathNode("munderover", [arrowNode, lowerNode, upperNode]); + } else { + node = new _mathMLTree2.default.MathNode("mover", [arrowNode, upperNode]); + } + } else if (group.value.below) { + lowerNode = buildGroup(group.value.below, options); + node = new _mathMLTree2.default.MathNode("munder", [arrowNode, lowerNode]); + } else { + node = new _mathMLTree2.default.MathNode("mover", [arrowNode]); + } + return node; +}; + +groupTypes.rule = function (group) { + // TODO(emily): Figure out if there's an actual way to draw black boxes + // in MathML. + var node = new _mathMLTree2.default.MathNode("mrow"); + + return node; +}; + +groupTypes.kern = function (group) { + // TODO(kevin): Figure out if there's a way to add space in MathML + var node = new _mathMLTree2.default.MathNode("mrow"); + + return node; +}; + +groupTypes.llap = function (group, options) { + var node = new _mathMLTree2.default.MathNode("mpadded", [buildGroup(group.value.body, options)]); + + node.setAttribute("lspace", "-1width"); + node.setAttribute("width", "0px"); + + return node; +}; + +groupTypes.rlap = function (group, options) { + var node = new _mathMLTree2.default.MathNode("mpadded", [buildGroup(group.value.body, options)]); + + node.setAttribute("width", "0px"); + + return node; +}; + +groupTypes.phantom = function (group, options) { + var inner = buildExpression(group.value.value, options); + return new _mathMLTree2.default.MathNode("mphantom", inner); +}; + +groupTypes.mclass = function (group, options) { + var inner = buildExpression(group.value.value, options); + return new _mathMLTree2.default.MathNode("mstyle", inner); +}; + +/** + * Takes a list of nodes, builds them, and returns a list of the generated + * MathML nodes. A little simpler than the HTML version because we don't do any + * previous-node handling. + */ +var buildExpression = function buildExpression(expression, options) { + var groups = []; + for (var i = 0; i < expression.length; i++) { + var group = expression[i]; + groups.push(buildGroup(group, options)); + } + + // TODO(kevinb): combine \\not with mrels and mords + + return groups; +}; + +/** + * Takes a group from the parser and calls the appropriate groupTypes function + * on it to produce a MathML node. + */ +// TODO(kevinb): determine if removeUnnecessaryRow should always be true +var buildGroup = function buildGroup(group, options) { + var removeUnnecessaryRow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (!group) { + return new _mathMLTree2.default.MathNode("mrow"); + } + + if (groupTypes[group.type]) { + // Call the groupTypes function + var result = groupTypes[group.type](group, options); + if (removeUnnecessaryRow) { + if (result.type === "mrow" && result.children.length === 1) { + return result.children[0]; + } + } + return result; + } else { + throw new _ParseError2.default("Got group of unknown type: '" + group.type + "'"); + } +}; + +/** + * Takes a full parse tree and settings and builds a MathML representation of + * it. In particular, we put the elements from building the parse tree into a + * tag so we can also include that TeX source as an annotation. + * + * Note that we actually return a domTree element with a `` inside it so + * we can do appropriate styling. + */ +var buildMathML = function buildMathML(tree, texExpression, options) { + var expression = buildExpression(tree, options); + + // Wrap up the expression in an mrow so it is presented in the semantics + // tag correctly. + var wrapper = new _mathMLTree2.default.MathNode("mrow", expression); + + // Build a TeX annotation of the source + var annotation = new _mathMLTree2.default.MathNode("annotation", [new _mathMLTree2.default.TextNode(texExpression)]); + + annotation.setAttribute("encoding", "application/x-tex"); + + var semantics = new _mathMLTree2.default.MathNode("semantics", [wrapper, annotation]); + + var math = new _mathMLTree2.default.MathNode("math", [semantics]); + + // You can't style nodes, so we wrap the node in a span. + return (0, _buildCommon.makeSpan)(["katex-mathml"], [math]); +}; + +module.exports = buildMathML; + +},{"./ParseError":29,"./Style":33,"./buildCommon":34,"./fontMetrics":41,"./mathMLTree":45,"./stretchy":47,"./symbols":48,"./utils":51}],37:[function(require,module,exports){ +"use strict"; + +var _buildHTML = require("./buildHTML"); + +var _buildHTML2 = _interopRequireDefault(_buildHTML); + +var _buildMathML = require("./buildMathML"); + +var _buildMathML2 = _interopRequireDefault(_buildMathML); + +var _buildCommon = require("./buildCommon"); + +var _Options = require("./Options"); + +var _Options2 = _interopRequireDefault(_Options); + +var _Settings = require("./Settings"); + +var _Settings2 = _interopRequireDefault(_Settings); + +var _Style = require("./Style"); + +var _Style2 = _interopRequireDefault(_Style); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var buildTree = function buildTree(tree, expression, settings) { + settings = settings || new _Settings2.default({}); + + var startStyle = _Style2.default.TEXT; + if (settings.displayMode) { + startStyle = _Style2.default.DISPLAY; + } + + // Setup the default options + var options = new _Options2.default({ + style: startStyle + }); + + // `buildHTML` sometimes messes with the parse tree (like turning bins -> + // ords), so we build the MathML version first. + var mathMLNode = (0, _buildMathML2.default)(tree, expression, options); + var htmlNode = (0, _buildHTML2.default)(tree, options); + + var katexNode = (0, _buildCommon.makeSpan)(["katex"], [mathMLNode, htmlNode]); + + if (settings.displayMode) { + return (0, _buildCommon.makeSpan)(["katex-display"], [katexNode]); + } else { + return katexNode; + } +}; + +module.exports = buildTree; + +},{"./Options":28,"./Settings":32,"./Style":33,"./buildCommon":34,"./buildHTML":35,"./buildMathML":36}],38:[function(require,module,exports){ +"use strict"; + +var _ParseError = require("./ParseError"); + +var _ParseError2 = _interopRequireDefault(_ParseError); + +var _Style = require("./Style"); + +var _Style2 = _interopRequireDefault(_Style); + +var _buildCommon = require("./buildCommon"); + +var _buildCommon2 = _interopRequireDefault(_buildCommon); + +var _fontMetrics = require("./fontMetrics"); + +var _fontMetrics2 = _interopRequireDefault(_fontMetrics); + +var _symbols = require("./symbols"); + +var _symbols2 = _interopRequireDefault(_symbols); + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Get the metrics for a given symbol and font, after transformation (i.e. + * after following replacement from symbols.js) + */ +/** + * This file deals with creating delimiters of various sizes. The TeXbook + * discusses these routines on page 441-442, in the "Another subroutine sets box + * x to a specified variable delimiter" paragraph. + * + * There are three main routines here. `makeSmallDelim` makes a delimiter in the + * normal font, but in either text, script, or scriptscript style. + * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1, + * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of + * smaller pieces that are stacked on top of one another. + * + * The functions take a parameter `center`, which determines if the delimiter + * should be centered around the axis. + * + * Then, there are three exposed functions. `sizedDelim` makes a delimiter in + * one of the given sizes. This is used for things like `\bigl`. + * `customSizedDelim` makes a delimiter with a given total height+depth. It is + * called in places like `\sqrt`. `leftRightDelim` makes an appropriate + * delimiter which surrounds an expression of a given height an depth. It is + * used in `\left` and `\right`. + */ + +var getMetrics = function getMetrics(symbol, font) { + if (_symbols2.default.math[symbol] && _symbols2.default.math[symbol].replace) { + return _fontMetrics2.default.getCharacterMetrics(_symbols2.default.math[symbol].replace, font); + } else { + return _fontMetrics2.default.getCharacterMetrics(symbol, font); + } +}; + +/** + * Puts a delimiter span in a given style, and adds appropriate height, depth, + * and maxFontSizes. + */ +var styleWrap = function styleWrap(delim, toStyle, options, classes) { + var newOptions = options.havingBaseStyle(toStyle); + + var span = (0, _buildCommon.makeSpan)((classes || []).concat(newOptions.sizingClasses(options)), [delim], options); + + span.delimSizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier; + span.height *= span.delimSizeMultiplier; + span.depth *= span.delimSizeMultiplier; + span.maxFontSize = newOptions.sizeMultiplier; + + return span; +}; + +var centerSpan = function centerSpan(span, options, style) { + var newOptions = options.havingBaseStyle(style); + var shift = (1 - options.sizeMultiplier / newOptions.sizeMultiplier) * options.fontMetrics().axisHeight; + + span.classes.push("delimcenter"); + span.style.top = shift + "em"; + span.height -= shift; + span.depth += shift; +}; + +/** + * Makes a small delimiter. This is a delimiter that comes in the Main-Regular + * font, but is restyled to either be in textstyle, scriptstyle, or + * scriptscriptstyle. + */ +var makeSmallDelim = function makeSmallDelim(delim, style, center, options, mode, classes) { + var text = _buildCommon2.default.makeSymbol(delim, "Main-Regular", mode, options); + var span = styleWrap(text, style, options, classes); + if (center) { + centerSpan(span, options, style); + } + return span; +}; + +/** + * Builds a symbol in the given font size (note size is an integer) + */ +var mathrmSize = function mathrmSize(value, size, mode, options) { + return _buildCommon2.default.makeSymbol(value, "Size" + size + "-Regular", mode, options); +}; + +/** + * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2, + * Size3, or Size4 fonts. It is always rendered in textstyle. + */ +var makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode, classes) { + var inner = mathrmSize(delim, size, mode, options); + var span = styleWrap((0, _buildCommon.makeSpan)(["delimsizing", "size" + size], [inner], options), _Style2.default.TEXT, options, classes); + if (center) { + centerSpan(span, options, _Style2.default.TEXT); + } + return span; +}; + +/** + * Make an inner span with the given offset and in the given font. This is used + * in `makeStackedDelim` to make the stacking pieces for the delimiter. + */ +var makeInner = function makeInner(symbol, font, mode) { + var sizeClass = void 0; + // Apply the correct CSS class to choose the right font. + if (font === "Size1-Regular") { + sizeClass = "delim-size1"; + } else if (font === "Size4-Regular") { + sizeClass = "delim-size4"; + } + + var inner = (0, _buildCommon.makeSpan)(["delimsizinginner", sizeClass], [(0, _buildCommon.makeSpan)([], [_buildCommon2.default.makeSymbol(symbol, font, mode)])]); + + // Since this will be passed into `makeVList` in the end, wrap the element + // in the appropriate tag that VList uses. + return { type: "elem", elem: inner }; +}; + +/** + * Make a stacked delimiter out of a given delimiter, with the total height at + * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook. + */ +var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, options, mode, classes) { + // There are four parts, the top, an optional middle, a repeated part, and a + // bottom. + var top = void 0; + var middle = void 0; + var repeat = void 0; + var bottom = void 0; + top = repeat = bottom = delim; + middle = null; + // Also keep track of what font the delimiters are in + var font = "Size1-Regular"; + + // We set the parts and font based on the symbol. Note that we use + // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the + // repeats of the arrows + if (delim === "\\uparrow") { + repeat = bottom = "\u23D0"; + } else if (delim === "\\Uparrow") { + repeat = bottom = "\u2016"; + } else if (delim === "\\downarrow") { + top = repeat = "\u23D0"; + } else if (delim === "\\Downarrow") { + top = repeat = "\u2016"; + } else if (delim === "\\updownarrow") { + top = "\\uparrow"; + repeat = "\u23D0"; + bottom = "\\downarrow"; + } else if (delim === "\\Updownarrow") { + top = "\\Uparrow"; + repeat = "\u2016"; + bottom = "\\Downarrow"; + } else if (delim === "[" || delim === "\\lbrack") { + top = "\u23A1"; + repeat = "\u23A2"; + bottom = "\u23A3"; + font = "Size4-Regular"; + } else if (delim === "]" || delim === "\\rbrack") { + top = "\u23A4"; + repeat = "\u23A5"; + bottom = "\u23A6"; + font = "Size4-Regular"; + } else if (delim === "\\lfloor") { + repeat = top = "\u23A2"; + bottom = "\u23A3"; + font = "Size4-Regular"; + } else if (delim === "\\lceil") { + top = "\u23A1"; + repeat = bottom = "\u23A2"; + font = "Size4-Regular"; + } else if (delim === "\\rfloor") { + repeat = top = "\u23A5"; + bottom = "\u23A6"; + font = "Size4-Regular"; + } else if (delim === "\\rceil") { + top = "\u23A4"; + repeat = bottom = "\u23A5"; + font = "Size4-Regular"; + } else if (delim === "(") { + top = "\u239B"; + repeat = "\u239C"; + bottom = "\u239D"; + font = "Size4-Regular"; + } else if (delim === ")") { + top = "\u239E"; + repeat = "\u239F"; + bottom = "\u23A0"; + font = "Size4-Regular"; + } else if (delim === "\\{" || delim === "\\lbrace") { + top = "\u23A7"; + middle = "\u23A8"; + bottom = "\u23A9"; + repeat = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\}" || delim === "\\rbrace") { + top = "\u23AB"; + middle = "\u23AC"; + bottom = "\u23AD"; + repeat = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\lgroup") { + top = "\u23A7"; + bottom = "\u23A9"; + repeat = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\rgroup") { + top = "\u23AB"; + bottom = "\u23AD"; + repeat = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\lmoustache") { + top = "\u23A7"; + bottom = "\u23AD"; + repeat = "\u23AA"; + font = "Size4-Regular"; + } else if (delim === "\\rmoustache") { + top = "\u23AB"; + bottom = "\u23A9"; + repeat = "\u23AA"; + font = "Size4-Regular"; + } + + // Get the metrics of the four sections + var topMetrics = getMetrics(top, font); + var topHeightTotal = topMetrics.height + topMetrics.depth; + var repeatMetrics = getMetrics(repeat, font); + var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth; + var bottomMetrics = getMetrics(bottom, font); + var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth; + var middleHeightTotal = 0; + var middleFactor = 1; + if (middle !== null) { + var middleMetrics = getMetrics(middle, font); + middleHeightTotal = middleMetrics.height + middleMetrics.depth; + middleFactor = 2; // repeat symmetrically above and below middle + } + + // Calcuate the minimal height that the delimiter can have. + // It is at least the size of the top, bottom, and optional middle combined. + var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal; + + // Compute the number of copies of the repeat symbol we will need + var repeatCount = Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal)); + + // Compute the total height of the delimiter including all the symbols + var realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal; + + // The center of the delimiter is placed at the center of the axis. Note + // that in this context, "center" means that the delimiter should be + // centered around the axis in the current style, while normally it is + // centered around the axis in textstyle. + var axisHeight = options.fontMetrics().axisHeight; + if (center) { + axisHeight *= options.sizeMultiplier; + } + // Calculate the depth + var depth = realHeightTotal / 2 - axisHeight; + + // Now, we start building the pieces that will go into the vlist + + // Keep a list of the inner pieces + var inners = []; + + // Add the bottom symbol + inners.push(makeInner(bottom, font, mode)); + + if (middle === null) { + // Add that many symbols + for (var i = 0; i < repeatCount; i++) { + inners.push(makeInner(repeat, font, mode)); + } + } else { + // When there is a middle bit, we need the middle part and two repeated + // sections + for (var _i = 0; _i < repeatCount; _i++) { + inners.push(makeInner(repeat, font, mode)); + } + inners.push(makeInner(middle, font, mode)); + for (var _i2 = 0; _i2 < repeatCount; _i2++) { + inners.push(makeInner(repeat, font, mode)); + } + } + + // Add the top symbol + inners.push(makeInner(top, font, mode)); + + // Finally, build the vlist + var newOptions = options.havingBaseStyle(_Style2.default.TEXT); + var inner = _buildCommon2.default.makeVList(inners, "bottom", depth, newOptions); + + return styleWrap((0, _buildCommon.makeSpan)(["delimsizing", "mult"], [inner], newOptions), _Style2.default.TEXT, options, classes); +}; + +var sqrtInnerSVG = { + // The main path geometry is from glyph U221A in the font KaTeX Main + main: "", + + // size1 is from glyph U221A in the font KaTeX_Size1-Regular + 1: "", + + // size2 is from glyph U221A in the font KaTeX_Size2-Regular + 2: "", + + // size3 is from glyph U221A in the font KaTeX_Size3-Regular + 3: "", + + // size4 is from glyph U221A in the font KaTeX_Size4-Regular + 4: "", + + // tall is from glyph U23B7 in the font KaTeX_Size4-Regular + tall: "l-4 4-4 4c-.667.667-2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1h\n-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170c-4-3.333-8.333\n-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 219 661 l218 661z\nM702 0H400000v40H742z'/>" +}; + +var sqrtSpan = function sqrtSpan(height, delim, options) { + // Create a span containing an SVG image of a sqrt symbol. + var span = _buildCommon2.default.makeSpan([], [], options); + var sizeMultiplier = options.sizeMultiplier; // default + + if (delim.type === "small") { + // Get an SVG that is derived from glyph U+221A in font KaTeX-Main. + var newOptions = options.havingBaseStyle(delim.style); + sizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier; + + span.height = 1 * sizeMultiplier; + span.style.height = span.height + "em"; + span.surdWidth = 0.833 * sizeMultiplier; // from the font. + //In the font, the glyph is 1000 units tall. The font scale is 1:1000. + + span.innerHTML = "\n " + sqrtInnerSVG['main'] + ""; + } else if (delim.type === "large") { + // These SVGs come from fonts: KaTeX_Size1, _Size2, etc. + // Get sqrt height from font data + span.height = sizeToMaxHeight[delim.size] / sizeMultiplier; + span.style.height = span.height + "em"; + span.surdWidth = 1.0 / sizeMultiplier; // from the font + + span.innerHTML = "\n " + sqrtInnerSVG[delim.size] + ""; + } else { + // Tall sqrt. In TeX, this would be stacked using multiple glyphs. + // We'll use a single SVG to accomplish the same thing. + span.height = height / sizeMultiplier; + span.style.height = span.height + "em"; + span.surdWidth = 1.056 / sizeMultiplier; + var viewBoxHeight = Math.floor(span.height * 1000); // scale = 1:1000 + var vertSegment = viewBoxHeight - 54; + + // This \sqrt is customized in both height and width. We set the + // height now. Then CSS will stretch the image to the correct width. + // This SVG path comes from glyph U+23B7, font KaTeX_Size4-Regular. + span.innerHTML = "\n \n "; + } + + span.sizeMultiplier = sizeMultiplier; + + return span; +}; + +// There are three kinds of delimiters, delimiters that stack when they become +// too large +var stackLargeDelimiters = ["(", ")", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\\lceil", "\\rceil", "\\surd"]; + +// delimiters that always stack +var stackAlwaysDelimiters = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\\lmoustache", "\\rmoustache"]; + +// and delimiters that never stack +var stackNeverDelimiters = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"]; + +// Metrics of the different sizes. Found by looking at TeX's output of +// $\bigl| // \Bigl| \biggl| \Biggl| \showlists$ +// Used to create stacked delimiters of appropriate sizes in makeSizedDelim. +var sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0]; + +/** + * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4. + */ +var makeSizedDelim = function makeSizedDelim(delim, size, options, mode, classes) { + // < and > turn into \langle and \rangle in delimiters + if (delim === "<" || delim === "\\lt") { + delim = "\\langle"; + } else if (delim === ">" || delim === "\\gt") { + delim = "\\rangle"; + } + + // Sized delimiters are never centered. + if (_utils2.default.contains(stackLargeDelimiters, delim) || _utils2.default.contains(stackNeverDelimiters, delim)) { + return makeLargeDelim(delim, size, false, options, mode, classes); + } else if (_utils2.default.contains(stackAlwaysDelimiters, delim)) { + return makeStackedDelim(delim, sizeToMaxHeight[size], false, options, mode, classes); + } else { + throw new _ParseError2.default("Illegal delimiter: '" + delim + "'"); + } +}; + +/** + * There are three different sequences of delimiter sizes that the delimiters + * follow depending on the kind of delimiter. This is used when creating custom + * sized delimiters to decide whether to create a small, large, or stacked + * delimiter. + * + * In real TeX, these sequences aren't explicitly defined, but are instead + * defined inside the font metrics. Since there are only three sequences that + * are possible for the delimiters that TeX defines, it is easier to just encode + * them explicitly here. + */ + +// Delimiters that never stack try small delimiters and large delimiters only +var stackNeverDelimiterSequence = [{ type: "small", style: _Style2.default.SCRIPTSCRIPT }, { type: "small", style: _Style2.default.SCRIPT }, { type: "small", style: _Style2.default.TEXT }, { type: "large", size: 1 }, { type: "large", size: 2 }, { type: "large", size: 3 }, { type: "large", size: 4 }]; + +// Delimiters that always stack try the small delimiters first, then stack +var stackAlwaysDelimiterSequence = [{ type: "small", style: _Style2.default.SCRIPTSCRIPT }, { type: "small", style: _Style2.default.SCRIPT }, { type: "small", style: _Style2.default.TEXT }, { type: "stack" }]; + +// Delimiters that stack when large try the small and then large delimiters, and +// stack afterwards +var stackLargeDelimiterSequence = [{ type: "small", style: _Style2.default.SCRIPTSCRIPT }, { type: "small", style: _Style2.default.SCRIPT }, { type: "small", style: _Style2.default.TEXT }, { type: "large", size: 1 }, { type: "large", size: 2 }, { type: "large", size: 3 }, { type: "large", size: 4 }, { type: "stack" }]; + +/** + * Get the font used in a delimiter based on what kind of delimiter it is. + */ +var delimTypeToFont = function delimTypeToFont(type) { + if (type.type === "small") { + return "Main-Regular"; + } else if (type.type === "large") { + return "Size" + type.size + "-Regular"; + } else if (type.type === "stack") { + return "Size4-Regular"; + } +}; + +/** + * Traverse a sequence of types of delimiters to decide what kind of delimiter + * should be used to create a delimiter of the given height+depth. + */ +var traverseSequence = function traverseSequence(delim, height, sequence, options) { + // Here, we choose the index we should start at in the sequences. In smaller + // sizes (which correspond to larger numbers in style.size) we start earlier + // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts + // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2 + var start = Math.min(2, 3 - options.style.size); + for (var i = start; i < sequence.length; i++) { + if (sequence[i].type === "stack") { + // This is always the last delimiter, so we just break the loop now. + break; + } + + var metrics = getMetrics(delim, delimTypeToFont(sequence[i])); + var heightDepth = metrics.height + metrics.depth; + + // Small delimiters are scaled down versions of the same font, so we + // account for the style change size. + + if (sequence[i].type === "small") { + var newOptions = options.havingBaseStyle(sequence[i].style); + heightDepth *= newOptions.sizeMultiplier; + } + + // Check if the delimiter at this size works for the given height. + if (heightDepth > height) { + return sequence[i]; + } + } + + // If we reached the end of the sequence, return the last sequence element. + return sequence[sequence.length - 1]; +}; + +/** + * Make a delimiter of a given height+depth, with optional centering. Here, we + * traverse the sequences, and create a delimiter that the sequence tells us to. + */ +var makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, options, mode, classes) { + if (delim === "<" || delim === "\\lt") { + delim = "\\langle"; + } else if (delim === ">" || delim === "\\gt") { + delim = "\\rangle"; + } + + // Decide what sequence to use + var sequence = void 0; + if (_utils2.default.contains(stackNeverDelimiters, delim)) { + sequence = stackNeverDelimiterSequence; + } else if (_utils2.default.contains(stackLargeDelimiters, delim)) { + sequence = stackLargeDelimiterSequence; + } else { + sequence = stackAlwaysDelimiterSequence; + } + + // Look through the sequence + var delimType = traverseSequence(delim, height, sequence, options); + + if (delim === "\\surd") { + // Get an SVG image for + return sqrtSpan(height, delimType, options); + } else { + // Get the delimiter from font glyphs. + // Depending on the sequence element we decided on, call the + // appropriate function. + if (delimType.type === "small") { + return makeSmallDelim(delim, delimType.style, center, options, mode, classes); + } else if (delimType.type === "large") { + return makeLargeDelim(delim, delimType.size, center, options, mode, classes); + } else if (delimType.type === "stack") { + return makeStackedDelim(delim, height, center, options, mode, classes); + } + } +}; + +/** + * Make a delimiter for use with `\left` and `\right`, given a height and depth + * of an expression that the delimiters surround. + */ +var makeLeftRightDelim = function makeLeftRightDelim(delim, height, depth, options, mode, classes) { + // We always center \left/\right delimiters, so the axis is always shifted + var axisHeight = options.fontMetrics().axisHeight * options.sizeMultiplier; + + // Taken from TeX source, tex.web, function make_left_right + var delimiterFactor = 901; + var delimiterExtend = 5.0 / options.fontMetrics().ptPerEm; + + var maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight); + + var totalHeight = Math.max( + // In real TeX, calculations are done using integral values which are + // 65536 per pt, or 655360 per em. So, the division here truncates in + // TeX but doesn't here, producing different results. If we wanted to + // exactly match TeX's calculation, we could do + // Math.floor(655360 * maxDistFromAxis / 500) * + // delimiterFactor / 655360 + // (To see the difference, compare + // x^{x^{\left(\rule{0.1em}{0.68em}\right)}} + // in TeX and KaTeX) + maxDistFromAxis / 500 * delimiterFactor, 2 * maxDistFromAxis - delimiterExtend); + + // Finally, we defer to `makeCustomSizedDelim` with our calculated total + // height + return makeCustomSizedDelim(delim, totalHeight, true, options, mode, classes); +}; + +module.exports = { + sizedDelim: makeSizedDelim, + customSizedDelim: makeCustomSizedDelim, + leftRightDelim: makeLeftRightDelim +}; + +},{"./ParseError":29,"./Style":33,"./buildCommon":34,"./fontMetrics":41,"./symbols":48,"./utils":51}],39:[function(require,module,exports){ +"use strict"; + +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _createClass2 = require("babel-runtime/helpers/createClass"); + +var _createClass3 = _interopRequireDefault(_createClass2); + +var _unicodeRegexes = require("./unicodeRegexes"); + +var _unicodeRegexes2 = _interopRequireDefault(_unicodeRegexes); + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Create an HTML className based on a list of classes. In addition to joining + * with spaces, we also remove null or empty classes. + */ +/** + * These objects store the data about the DOM nodes we create, as well as some + * extra data. They can then be transformed into real DOM nodes with the + * `toNode` function or HTML markup using `toMarkup`. They are useful for both + * storing extra properties on the nodes, as well as providing a way to easily + * work with the DOM. + * + * Similar functions for working with MathML nodes exist in mathMLTree.js. + */ +var createClass = function createClass(classes) { + classes = classes.slice(); + for (var i = classes.length - 1; i >= 0; i--) { + if (!classes[i]) { + classes.splice(i, 1); + } + } + + return classes.join(" "); +}; + +/** + * This node represents a span node, with a className, a list of children, and + * an inline style. It also contains information about its height, depth, and + * maxFontSize. + */ + +var span = function () { + function span(classes, children, options) { + (0, _classCallCheck3.default)(this, span); + + this.classes = classes || []; + this.children = children || []; + this.height = 0; + this.depth = 0; + this.maxFontSize = 0; + this.style = {}; + this.attributes = {}; + this.innerHTML; // used for inline SVG code. + if (options) { + if (options.style.isTight()) { + this.classes.push("mtight"); + } + if (options.getColor()) { + this.style.color = options.getColor(); + } + } + } + + /** + * Sets an arbitrary attribute on the span. Warning: use this wisely. Not all + * browsers support attributes the same, and having too many custom attributes + * is probably bad. + */ + + + (0, _createClass3.default)(span, [{ + key: "setAttribute", + value: function setAttribute(attribute, value) { + this.attributes[attribute] = value; + } + }, { + key: "tryCombine", + value: function tryCombine(sibling) { + return false; + } + + /** + * Convert the span into an HTML node + */ + + }, { + key: "toNode", + value: function toNode() { + var span = document.createElement("span"); + + // Apply the class + span.className = createClass(this.classes); + + // Apply inline styles + for (var style in this.style) { + if (Object.prototype.hasOwnProperty.call(this.style, style)) { + span.style[style] = this.style[style]; + } + } + + // Apply attributes + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + span.setAttribute(attr, this.attributes[attr]); + } + } + + if (this.innerHTML) { + span.innerHTML = this.innerHTML; + } + + // Append the children, also as HTML nodes + for (var i = 0; i < this.children.length; i++) { + span.appendChild(this.children[i].toNode()); + } + + return span; + } + + /** + * Convert the span into an HTML markup string + */ + + }, { + key: "toMarkup", + value: function toMarkup() { + var markup = " 0 || createClass(this.classes) !== createClass(sibling.classes) || this.skew !== sibling.skew || this.maxFontSize !== sibling.maxFontSize) { + return false; + } + for (var style in this.style) { + if (this.style.hasOwnProperty(style) && this.style[style] !== sibling.style[style]) { + return false; + } + } + for (var _style in sibling.style) { + if (sibling.style.hasOwnProperty(_style) && this.style[_style] !== sibling.style[_style]) { + return false; + } + } + this.value += sibling.value; + this.height = Math.max(this.height, sibling.height); + this.depth = Math.max(this.depth, sibling.depth); + this.italic = sibling.italic; + return true; + } + + /** + * Creates a text node or span from a symbol node. Note that a span is only + * created if it is needed. + */ + + }, { + key: "toNode", + value: function toNode() { + var node = document.createTextNode(this.value); + var span = null; + + if (this.italic > 0) { + span = document.createElement("span"); + span.style.marginRight = this.italic + "em"; + } + + if (this.classes.length > 0) { + span = span || document.createElement("span"); + span.className = createClass(this.classes); + } + + for (var style in this.style) { + if (this.style.hasOwnProperty(style)) { + span = span || document.createElement("span"); + span.style[style] = this.style[style]; + } + } + + if (span) { + span.appendChild(node); + return span; + } else { + return node; + } + } + + /** + * Creates markup for a symbol node. + */ + + }, { + key: "toMarkup", + value: function toMarkup() { + // TODO(alpert): More duplication than I'd like from + // span.prototype.toMarkup and symbolNode.prototype.toNode... + var needsSpan = false; + + var markup = " 0) { + styles += "margin-right:" + this.italic + "em;"; + } + for (var style in this.style) { + if (this.style.hasOwnProperty(style)) { + styles += _utils2.default.hyphenate(style) + ":" + this.style[style] + ";"; + } + } + + if (styles) { + needsSpan = true; + markup += " style=\"" + _utils2.default.escape(styles) + "\""; + } + + var escaped = _utils2.default.escape(this.value); + if (needsSpan) { + markup += ">"; + markup += escaped; + markup += ""; + return markup; + } else { + return escaped; + } + } + }]); + return symbolNode; +}(); + +module.exports = { + span: span, + documentFragment: documentFragment, + symbolNode: symbolNode +}; + +},{"./unicodeRegexes":49,"./utils":51,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],40:[function(require,module,exports){ +"use strict"; + +var _ParseNode = require("./ParseNode"); + +var _ParseNode2 = _interopRequireDefault(_ParseNode); + +var _ParseError = require("./ParseError"); + +var _ParseError2 = _interopRequireDefault(_ParseError); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Parse the body of the environment, with rows delimited by \\ and + * columns delimited by &, and create a nested list in row-major order + * with one group per cell. If given an optional argument style + * ("text", "display", etc.), then each cell is cast into that style. + */ +/* eslint no-constant-condition:0 */ +function parseArray(parser, result, style) { + var row = []; + var body = [row]; + var rowGaps = []; + while (true) { + var cell = parser.parseExpression(false, null); + cell = new _ParseNode2.default("ordgroup", cell, parser.mode); + if (style) { + cell = new _ParseNode2.default("styling", { + style: style, + value: [cell] + }, parser.mode); + } + row.push(cell); + var next = parser.nextToken.text; + if (next === "&") { + parser.consume(); + } else if (next === "\\end") { + break; + } else if (next === "\\\\" || next === "\\cr") { + var cr = parser.parseFunction(); + rowGaps.push(cr.value.size); + row = []; + body.push(row); + } else { + throw new _ParseError2.default("Expected & or \\\\ or \\end", parser.nextToken); + } + } + result.body = body; + result.rowGaps = rowGaps; + return new _ParseNode2.default(result.type, result, parser.mode); +} + +/* + * An environment definition is very similar to a function definition: + * it is declared with a name or a list of names, a set of properties + * and a handler containing the actual implementation. + * + * The properties include: + * - numArgs: The number of arguments after the \begin{name} function. + * - argTypes: (optional) Just like for a function + * - allowedInText: (optional) Whether or not the environment is allowed inside + * text mode (default false) (not enforced yet) + * - numOptionalArgs: (optional) Just like for a function + * A bare number instead of that object indicates the numArgs value. + * + * The handler function will receive two arguments + * - context: information and references provided by the parser + * - args: an array of arguments passed to \begin{name} + * The context contains the following properties: + * - envName: the name of the environment, one of the listed names. + * - parser: the parser object + * - lexer: the lexer object + * - positions: the positions associated with these arguments from args. + * The handler must return a ParseResult. + */ +function defineEnvironment(names, props, handler) { + if (typeof names === "string") { + names = [names]; + } + if (typeof props === "number") { + props = { numArgs: props }; + } + // Set default values of environments + var data = { + numArgs: props.numArgs || 0, + argTypes: props.argTypes, + greediness: 1, + allowedInText: !!props.allowedInText, + numOptionalArgs: props.numOptionalArgs || 0, + handler: handler + }; + for (var i = 0; i < names.length; ++i) { + module.exports[names[i]] = data; + } +} + +// Decides on a style for cells in an array according to whether the given +// environment name starts with the letter 'd'. +function dCellStyle(envName) { + if (envName.substr(0, 1) === "d") { + return "display"; + } else { + return "text"; + } +} + +// Arrays are part of LaTeX, defined in lttab.dtx so its documentation +// is part of the source2e.pdf file of LaTeX2e source documentation. +// {darray} is an {array} environment where cells are set in \displaystyle, +// as defined in nccmath.sty. +defineEnvironment(["array", "darray"], { + numArgs: 1 +}, function (context, args) { + var colalign = args[0]; + colalign = colalign.value.map ? colalign.value : [colalign]; + var cols = colalign.map(function (node) { + var ca = node.value; + if ("lcr".indexOf(ca) !== -1) { + return { + type: "align", + align: ca + }; + } else if (ca === "|") { + return { + type: "separator", + separator: "|" + }; + } + throw new _ParseError2.default("Unknown column alignment: " + node.value, node); + }); + var res = { + type: "array", + cols: cols, + hskipBeforeAndAfter: true }; + res = parseArray(context.parser, res, dCellStyle(context.envName)); + return res; +}); + +// The matrix environments of amsmath builds on the array environment +// of LaTeX, which is discussed above. +defineEnvironment(["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix"], {}, function (context) { + var delimiters = { + "matrix": null, + "pmatrix": ["(", ")"], + "bmatrix": ["[", "]"], + "Bmatrix": ["\\{", "\\}"], + "vmatrix": ["|", "|"], + "Vmatrix": ["\\Vert", "\\Vert"] + }[context.envName]; + var res = { + type: "array", + hskipBeforeAndAfter: false }; + res = parseArray(context.parser, res, dCellStyle(context.envName)); + if (delimiters) { + res = new _ParseNode2.default("leftright", { + body: [res], + left: delimiters[0], + right: delimiters[1] + }, context.mode); + } + return res; +}); + +// A cases environment (in amsmath.sty) is almost equivalent to +// \def\arraystretch{1.2}% +// \left\{\begin{array}{@{}l@{\quad}l@{}} … \end{array}\right. +// {dcases} is a {cases} environment where cells are set in \displaystyle, +// as defined in mathtools.sty. +defineEnvironment(["cases", "dcases"], {}, function (context) { + var res = { + type: "array", + arraystretch: 1.2, + cols: [{ + type: "align", + align: "l", + pregap: 0, + // TODO(kevinb) get the current style. + // For now we use the metrics for TEXT style which is what we were + // doing before. Before attempting to get the current style we + // should look at TeX's behavior especially for \over and matrices. + postgap: 1.0 }, { + type: "align", + align: "l", + pregap: 0, + postgap: 0 + }] + }; + res = parseArray(context.parser, res, dCellStyle(context.envName)); + res = new _ParseNode2.default("leftright", { + body: [res], + left: "\\{", + right: "." + }, context.mode); + return res; +}); + +// An aligned environment is like the align* environment +// except it operates within math mode. +// Note that we assume \nomallineskiplimit to be zero, +// so that \strut@ is the same as \strut. +defineEnvironment("aligned", {}, function (context) { + var res = { + type: "array", + cols: [], + addJot: true + }; + res = parseArray(context.parser, res, "display"); + // Count number of columns = maximum number of cells in each row. + // At the same time, prepend empty group {} at beginning of every second + // cell in each row (starting with second cell) so that operators become + // binary. This behavior is implemented in amsmath's \start@aligned. + var emptyGroup = new _ParseNode2.default("ordgroup", [], context.mode); + var numCols = 0; + res.value.body.forEach(function (row) { + for (var i = 1; i < row.length; i += 2) { + // Modify ordgroup node within styling node + var ordgroup = row[i].value.value[0]; + ordgroup.value.unshift(emptyGroup); + } + if (numCols < row.length) { + numCols = row.length; + } + }); + for (var i = 0; i < numCols; ++i) { + var align = "r"; + var pregap = 0; + if (i % 2 === 1) { + align = "l"; + } else if (i > 0) { + pregap = 2; // one \qquad between columns + } + res.value.cols[i] = { + type: "align", + align: align, + pregap: pregap, + postgap: 0 + }; + } + return res; +}); + +// A gathered environment is like an array environment with one centered +// column, but where rows are considered lines so get \jot line spacing +// and contents are set in \displaystyle. +defineEnvironment("gathered", {}, function (context) { + var res = { + type: "array", + cols: [{ + type: "align", + align: "c" + }], + addJot: true + }; + res = parseArray(context.parser, res, "display"); + return res; +}); + +},{"./ParseError":29,"./ParseNode":30}],41:[function(require,module,exports){ +"use strict"; + +var _unicodeRegexes = require("./unicodeRegexes"); + +var _fontMetricsData = require("./fontMetricsData"); + +var _fontMetricsData2 = _interopRequireDefault(_fontMetricsData); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * This file contains metrics regarding fonts and individual symbols. The sigma + * and xi variables, as well as the metricMap map contain data extracted from + * TeX, TeX font metrics, and the TTF files. These data are then exposed via the + * `metrics` variable and the getCharacterMetrics function. + */ + +// In TeX, there are actually three sets of dimensions, one for each of +// textstyle (size index 5 and higher: >=9pt), scriptstyle (size index 3 and 4: +// 7-8pt), and scriptscriptstyle (size index 1 and 2: 5-6pt). These are +// provided in the the arrays below, in that order. +// +// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respsectively. +// This was determined by running the following script: +// +// latex -interaction=nonstopmode \ +// '\documentclass{article}\usepackage{amsmath}\begin{document}' \ +// '$a$ \expandafter\show\the\textfont2' \ +// '\expandafter\show\the\scriptfont2' \ +// '\expandafter\show\the\scriptscriptfont2' \ +// '\stop' +// +// The metrics themselves were retreived using the following commands: +// +// tftopl cmsy10 +// tftopl cmsy7 +// tftopl cmsy5 +// +// The output of each of these commands is quite lengthy. The only part we +// care about is the FONTDIMEN section. Each value is measured in EMs. +var sigmasAndXis = { + slant: [0.250, 0.250, 0.250], // sigma1 + space: [0.000, 0.000, 0.000], // sigma2 + stretch: [0.000, 0.000, 0.000], // sigma3 + shrink: [0.000, 0.000, 0.000], // sigma4 + xHeight: [0.431, 0.431, 0.431], // sigma5 + quad: [1.000, 1.171, 1.472], // sigma6 + extraSpace: [0.000, 0.000, 0.000], // sigma7 + num1: [0.677, 0.732, 0.925], // sigma8 + num2: [0.394, 0.384, 0.387], // sigma9 + num3: [0.444, 0.471, 0.504], // sigma10 + denom1: [0.686, 0.752, 1.025], // sigma11 + denom2: [0.345, 0.344, 0.532], // sigma12 + sup1: [0.413, 0.503, 0.504], // sigma13 + sup2: [0.363, 0.431, 0.404], // sigma14 + sup3: [0.289, 0.286, 0.294], // sigma15 + sub1: [0.150, 0.143, 0.200], // sigma16 + sub2: [0.247, 0.286, 0.400], // sigma17 + supDrop: [0.386, 0.353, 0.494], // sigma18 + subDrop: [0.050, 0.071, 0.100], // sigma19 + delim1: [2.390, 1.700, 1.980], // sigma20 + delim2: [1.010, 1.157, 1.420], // sigma21 + axisHeight: [0.250, 0.250, 0.250], // sigma22 + + // These font metrics are extracted from TeX by using tftopl on cmex10.tfm; + // they correspond to the font parameters of the extension fonts (family 3). + // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to + // match cmex7, we'd use cmex7.tfm values for script and scriptscript + // values. + defaultRuleThickness: [0.04, 0.049, 0.049], // xi8; cmex7: 0.049 + bigOpSpacing1: [0.111, 0.111, 0.111], // xi9 + bigOpSpacing2: [0.166, 0.166, 0.166], // xi10 + bigOpSpacing3: [0.2, 0.2, 0.2], // xi11 + bigOpSpacing4: [0.6, 0.611, 0.611], // xi12; cmex7: 0.611 + bigOpSpacing5: [0.1, 0.143, 0.143], // xi13; cmex7: 0.143 + + // The \sqrt rule width is taken from the height of the surd character. + // Since we use the same font at all sizes, this thickness doesn't scale. + sqrtRuleThickness: [0.04, 0.04, 0.04], + + // This value determines how large a pt is, for metrics which are defined + // in terms of pts. + // This value is also used in katex.less; if you change it make sure the + // values match. + ptPerEm: [10.0, 10.0, 10.0], + + // The space between adjacent `|` columns in an array definition. From + // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm. + doubleRuleSep: [0.2, 0.2, 0.2] +}; + +// This map contains a mapping from font name and character code to character +// metrics, including height, depth, italic correction, and skew (kern from the +// character to the corresponding \skewchar) +// This map is generated via `make metrics`. It should not be changed manually. + + +// These are very rough approximations. We default to Times New Roman which +// should have Latin-1 and Cyrillic characters, but may not depending on the +// operating system. The metrics do not account for extra height from the +// accents. In the case of Cyrillic characters which have both ascenders and +// descenders we prefer approximations with ascenders, primarily to prevent +// the fraction bar or root line from intersecting the glyph. +// TODO(kevinb) allow union of multiple glyph metrics for better accuracy. +var extraCharacterMap = { + // Latin-1 + 'À': 'A', + 'Á': 'A', + 'Â': 'A', + 'Ã': 'A', + 'Ä': 'A', + 'Å': 'A', + 'Æ': 'A', + 'Ç': 'C', + 'È': 'E', + 'É': 'E', + 'Ê': 'E', + 'Ë': 'E', + 'Ì': 'I', + 'Í': 'I', + 'Î': 'I', + 'Ï': 'I', + 'Ð': 'D', + 'Ñ': 'N', + 'Ò': 'O', + 'Ó': 'O', + 'Ô': 'O', + 'Õ': 'O', + 'Ö': 'O', + 'Ø': 'O', + 'Ù': 'U', + 'Ú': 'U', + 'Û': 'U', + 'Ü': 'U', + 'Ý': 'Y', + 'Þ': 'o', + 'ß': 'B', + 'à': 'a', + 'á': 'a', + 'â': 'a', + 'ã': 'a', + 'ä': 'a', + 'å': 'a', + 'æ': 'a', + 'ç': 'c', + 'è': 'e', + 'é': 'e', + 'ê': 'e', + 'ë': 'e', + 'ì': 'i', + 'í': 'i', + 'î': 'i', + 'ï': 'i', + 'ð': 'd', + 'ñ': 'n', + 'ò': 'o', + 'ó': 'o', + 'ô': 'o', + 'õ': 'o', + 'ö': 'o', + 'ø': 'o', + 'ù': 'u', + 'ú': 'u', + 'û': 'u', + 'ü': 'u', + 'ý': 'y', + 'þ': 'o', + 'ÿ': 'y', + + // Cyrillic + 'А': 'A', + 'Б': 'B', + 'В': 'B', + 'Г': 'F', + 'Д': 'A', + 'Е': 'E', + 'Ж': 'K', + 'З': '3', + 'И': 'N', + 'Й': 'N', + 'К': 'K', + 'Л': 'N', + 'М': 'M', + 'Н': 'H', + 'О': 'O', + 'П': 'N', + 'Р': 'P', + 'С': 'C', + 'Т': 'T', + 'У': 'y', + 'Ф': 'O', + 'Х': 'X', + 'Ц': 'U', + 'Ч': 'h', + 'Ш': 'W', + 'Щ': 'W', + 'Ъ': 'B', + 'Ы': 'X', + 'Ь': 'B', + 'Э': '3', + 'Ю': 'X', + 'Я': 'R', + 'а': 'a', + 'б': 'b', + 'в': 'a', + 'г': 'r', + 'д': 'y', + 'е': 'e', + 'ж': 'm', + 'з': 'e', + 'и': 'n', + 'й': 'n', + 'к': 'n', + 'л': 'n', + 'м': 'm', + 'н': 'n', + 'о': 'o', + 'п': 'n', + 'р': 'p', + 'с': 'c', + 'т': 'o', + 'у': 'y', + 'ф': 'b', + 'х': 'x', + 'ц': 'n', + 'ч': 'n', + 'ш': 'w', + 'щ': 'w', + 'ъ': 'a', + 'ы': 'm', + 'ь': 'a', + 'э': 'e', + 'ю': 'm', + 'я': 'r' +}; + +/** + * This function is a convenience function for looking up information in the + * metricMap table. It takes a character as a string, and a style. + * + * Note: the `width` property may be undefined if fontMetricsData.js wasn't + * built using `Make extended_metrics`. + */ +var getCharacterMetrics = function getCharacterMetrics(character, style) { + var ch = character.charCodeAt(0); + if (character[0] in extraCharacterMap) { + ch = extraCharacterMap[character[0]].charCodeAt(0); + } else if (_unicodeRegexes.cjkRegex.test(character[0])) { + ch = 'M'.charCodeAt(0); + } + var metrics = _fontMetricsData2.default[style][ch]; + if (metrics) { + return { + depth: metrics[0], + height: metrics[1], + italic: metrics[2], + skew: metrics[3], + width: metrics[4] + }; + } +}; + +var fontMetricsBySizeIndex = {}; + +/** + * Get the font metrics for a given size. + */ +var getFontMetrics = function getFontMetrics(size) { + var sizeIndex = void 0; + if (size >= 5) { + sizeIndex = 0; + } else if (size >= 3) { + sizeIndex = 1; + } else { + sizeIndex = 2; + } + if (!fontMetricsBySizeIndex[sizeIndex]) { + var metrics = fontMetricsBySizeIndex[sizeIndex] = {}; + for (var key in sigmasAndXis) { + if (sigmasAndXis.hasOwnProperty(key)) { + metrics[key] = sigmasAndXis[key][sizeIndex]; + } + } + metrics.cssEmPerMu = metrics.quad / 18; + } + return fontMetricsBySizeIndex[sizeIndex]; +}; + +module.exports = { + getFontMetrics: getFontMetrics, + getCharacterMetrics: getCharacterMetrics +}; + +},{"./fontMetricsData":42,"./unicodeRegexes":49}],42:[function(require,module,exports){ +"use strict"; + +module.exports = { + "AMS-Regular": { + "65": [0, 0.68889, 0, 0], + "66": [0, 0.68889, 0, 0], + "67": [0, 0.68889, 0, 0], + "68": [0, 0.68889, 0, 0], + "69": [0, 0.68889, 0, 0], + "70": [0, 0.68889, 0, 0], + "71": [0, 0.68889, 0, 0], + "72": [0, 0.68889, 0, 0], + "73": [0, 0.68889, 0, 0], + "74": [0.16667, 0.68889, 0, 0], + "75": [0, 0.68889, 0, 0], + "76": [0, 0.68889, 0, 0], + "77": [0, 0.68889, 0, 0], + "78": [0, 0.68889, 0, 0], + "79": [0.16667, 0.68889, 0, 0], + "80": [0, 0.68889, 0, 0], + "81": [0.16667, 0.68889, 0, 0], + "82": [0, 0.68889, 0, 0], + "83": [0, 0.68889, 0, 0], + "84": [0, 0.68889, 0, 0], + "85": [0, 0.68889, 0, 0], + "86": [0, 0.68889, 0, 0], + "87": [0, 0.68889, 0, 0], + "88": [0, 0.68889, 0, 0], + "89": [0, 0.68889, 0, 0], + "90": [0, 0.68889, 0, 0], + "107": [0, 0.68889, 0, 0], + "165": [0, 0.675, 0.025, 0], + "174": [0.15559, 0.69224, 0, 0], + "240": [0, 0.68889, 0, 0], + "295": [0, 0.68889, 0, 0], + "710": [0, 0.825, 0, 0], + "732": [0, 0.9, 0, 0], + "770": [0, 0.825, 0, 0], + "771": [0, 0.9, 0, 0], + "989": [0.08167, 0.58167, 0, 0], + "1008": [0, 0.43056, 0.04028, 0], + "8245": [0, 0.54986, 0, 0], + "8463": [0, 0.68889, 0, 0], + "8487": [0, 0.68889, 0, 0], + "8498": [0, 0.68889, 0, 0], + "8502": [0, 0.68889, 0, 0], + "8503": [0, 0.68889, 0, 0], + "8504": [0, 0.68889, 0, 0], + "8513": [0, 0.68889, 0, 0], + "8592": [-0.03598, 0.46402, 0, 0], + "8594": [-0.03598, 0.46402, 0, 0], + "8602": [-0.13313, 0.36687, 0, 0], + "8603": [-0.13313, 0.36687, 0, 0], + "8606": [0.01354, 0.52239, 0, 0], + "8608": [0.01354, 0.52239, 0, 0], + "8610": [0.01354, 0.52239, 0, 0], + "8611": [0.01354, 0.52239, 0, 0], + "8619": [0, 0.54986, 0, 0], + "8620": [0, 0.54986, 0, 0], + "8621": [-0.13313, 0.37788, 0, 0], + "8622": [-0.13313, 0.36687, 0, 0], + "8624": [0, 0.69224, 0, 0], + "8625": [0, 0.69224, 0, 0], + "8630": [0, 0.43056, 0, 0], + "8631": [0, 0.43056, 0, 0], + "8634": [0.08198, 0.58198, 0, 0], + "8635": [0.08198, 0.58198, 0, 0], + "8638": [0.19444, 0.69224, 0, 0], + "8639": [0.19444, 0.69224, 0, 0], + "8642": [0.19444, 0.69224, 0, 0], + "8643": [0.19444, 0.69224, 0, 0], + "8644": [0.1808, 0.675, 0, 0], + "8646": [0.1808, 0.675, 0, 0], + "8647": [0.1808, 0.675, 0, 0], + "8648": [0.19444, 0.69224, 0, 0], + "8649": [0.1808, 0.675, 0, 0], + "8650": [0.19444, 0.69224, 0, 0], + "8651": [0.01354, 0.52239, 0, 0], + "8652": [0.01354, 0.52239, 0, 0], + "8653": [-0.13313, 0.36687, 0, 0], + "8654": [-0.13313, 0.36687, 0, 0], + "8655": [-0.13313, 0.36687, 0, 0], + "8666": [0.13667, 0.63667, 0, 0], + "8667": [0.13667, 0.63667, 0, 0], + "8669": [-0.13313, 0.37788, 0, 0], + "8672": [-0.064, 0.437, 0, 0], + "8674": [-0.064, 0.437, 0, 0], + "8705": [0, 0.825, 0, 0], + "8708": [0, 0.68889, 0, 0], + "8709": [0.08167, 0.58167, 0, 0], + "8717": [0, 0.43056, 0, 0], + "8722": [-0.03598, 0.46402, 0, 0], + "8724": [0.08198, 0.69224, 0, 0], + "8726": [0.08167, 0.58167, 0, 0], + "8733": [0, 0.69224, 0, 0], + "8736": [0, 0.69224, 0, 0], + "8737": [0, 0.69224, 0, 0], + "8738": [0.03517, 0.52239, 0, 0], + "8739": [0.08167, 0.58167, 0, 0], + "8740": [0.25142, 0.74111, 0, 0], + "8741": [0.08167, 0.58167, 0, 0], + "8742": [0.25142, 0.74111, 0, 0], + "8756": [0, 0.69224, 0, 0], + "8757": [0, 0.69224, 0, 0], + "8764": [-0.13313, 0.36687, 0, 0], + "8765": [-0.13313, 0.37788, 0, 0], + "8769": [-0.13313, 0.36687, 0, 0], + "8770": [-0.03625, 0.46375, 0, 0], + "8774": [0.30274, 0.79383, 0, 0], + "8776": [-0.01688, 0.48312, 0, 0], + "8778": [0.08167, 0.58167, 0, 0], + "8782": [0.06062, 0.54986, 0, 0], + "8783": [0.06062, 0.54986, 0, 0], + "8785": [0.08198, 0.58198, 0, 0], + "8786": [0.08198, 0.58198, 0, 0], + "8787": [0.08198, 0.58198, 0, 0], + "8790": [0, 0.69224, 0, 0], + "8791": [0.22958, 0.72958, 0, 0], + "8796": [0.08198, 0.91667, 0, 0], + "8806": [0.25583, 0.75583, 0, 0], + "8807": [0.25583, 0.75583, 0, 0], + "8808": [0.25142, 0.75726, 0, 0], + "8809": [0.25142, 0.75726, 0, 0], + "8812": [0.25583, 0.75583, 0, 0], + "8814": [0.20576, 0.70576, 0, 0], + "8815": [0.20576, 0.70576, 0, 0], + "8816": [0.30274, 0.79383, 0, 0], + "8817": [0.30274, 0.79383, 0, 0], + "8818": [0.22958, 0.72958, 0, 0], + "8819": [0.22958, 0.72958, 0, 0], + "8822": [0.1808, 0.675, 0, 0], + "8823": [0.1808, 0.675, 0, 0], + "8828": [0.13667, 0.63667, 0, 0], + "8829": [0.13667, 0.63667, 0, 0], + "8830": [0.22958, 0.72958, 0, 0], + "8831": [0.22958, 0.72958, 0, 0], + "8832": [0.20576, 0.70576, 0, 0], + "8833": [0.20576, 0.70576, 0, 0], + "8840": [0.30274, 0.79383, 0, 0], + "8841": [0.30274, 0.79383, 0, 0], + "8842": [0.13597, 0.63597, 0, 0], + "8843": [0.13597, 0.63597, 0, 0], + "8847": [0.03517, 0.54986, 0, 0], + "8848": [0.03517, 0.54986, 0, 0], + "8858": [0.08198, 0.58198, 0, 0], + "8859": [0.08198, 0.58198, 0, 0], + "8861": [0.08198, 0.58198, 0, 0], + "8862": [0, 0.675, 0, 0], + "8863": [0, 0.675, 0, 0], + "8864": [0, 0.675, 0, 0], + "8865": [0, 0.675, 0, 0], + "8872": [0, 0.69224, 0, 0], + "8873": [0, 0.69224, 0, 0], + "8874": [0, 0.69224, 0, 0], + "8876": [0, 0.68889, 0, 0], + "8877": [0, 0.68889, 0, 0], + "8878": [0, 0.68889, 0, 0], + "8879": [0, 0.68889, 0, 0], + "8882": [0.03517, 0.54986, 0, 0], + "8883": [0.03517, 0.54986, 0, 0], + "8884": [0.13667, 0.63667, 0, 0], + "8885": [0.13667, 0.63667, 0, 0], + "8888": [0, 0.54986, 0, 0], + "8890": [0.19444, 0.43056, 0, 0], + "8891": [0.19444, 0.69224, 0, 0], + "8892": [0.19444, 0.69224, 0, 0], + "8901": [0, 0.54986, 0, 0], + "8903": [0.08167, 0.58167, 0, 0], + "8905": [0.08167, 0.58167, 0, 0], + "8906": [0.08167, 0.58167, 0, 0], + "8907": [0, 0.69224, 0, 0], + "8908": [0, 0.69224, 0, 0], + "8909": [-0.03598, 0.46402, 0, 0], + "8910": [0, 0.54986, 0, 0], + "8911": [0, 0.54986, 0, 0], + "8912": [0.03517, 0.54986, 0, 0], + "8913": [0.03517, 0.54986, 0, 0], + "8914": [0, 0.54986, 0, 0], + "8915": [0, 0.54986, 0, 0], + "8916": [0, 0.69224, 0, 0], + "8918": [0.0391, 0.5391, 0, 0], + "8919": [0.0391, 0.5391, 0, 0], + "8920": [0.03517, 0.54986, 0, 0], + "8921": [0.03517, 0.54986, 0, 0], + "8922": [0.38569, 0.88569, 0, 0], + "8923": [0.38569, 0.88569, 0, 0], + "8926": [0.13667, 0.63667, 0, 0], + "8927": [0.13667, 0.63667, 0, 0], + "8928": [0.30274, 0.79383, 0, 0], + "8929": [0.30274, 0.79383, 0, 0], + "8934": [0.23222, 0.74111, 0, 0], + "8935": [0.23222, 0.74111, 0, 0], + "8936": [0.23222, 0.74111, 0, 0], + "8937": [0.23222, 0.74111, 0, 0], + "8938": [0.20576, 0.70576, 0, 0], + "8939": [0.20576, 0.70576, 0, 0], + "8940": [0.30274, 0.79383, 0, 0], + "8941": [0.30274, 0.79383, 0, 0], + "8994": [0.19444, 0.69224, 0, 0], + "8995": [0.19444, 0.69224, 0, 0], + "9416": [0.15559, 0.69224, 0, 0], + "9484": [0, 0.69224, 0, 0], + "9488": [0, 0.69224, 0, 0], + "9492": [0, 0.37788, 0, 0], + "9496": [0, 0.37788, 0, 0], + "9585": [0.19444, 0.68889, 0, 0], + "9586": [0.19444, 0.74111, 0, 0], + "9632": [0, 0.675, 0, 0], + "9633": [0, 0.675, 0, 0], + "9650": [0, 0.54986, 0, 0], + "9651": [0, 0.54986, 0, 0], + "9654": [0.03517, 0.54986, 0, 0], + "9660": [0, 0.54986, 0, 0], + "9661": [0, 0.54986, 0, 0], + "9664": [0.03517, 0.54986, 0, 0], + "9674": [0.11111, 0.69224, 0, 0], + "9733": [0.19444, 0.69224, 0, 0], + "10003": [0, 0.69224, 0, 0], + "10016": [0, 0.69224, 0, 0], + "10731": [0.11111, 0.69224, 0, 0], + "10846": [0.19444, 0.75583, 0, 0], + "10877": [0.13667, 0.63667, 0, 0], + "10878": [0.13667, 0.63667, 0, 0], + "10885": [0.25583, 0.75583, 0, 0], + "10886": [0.25583, 0.75583, 0, 0], + "10887": [0.13597, 0.63597, 0, 0], + "10888": [0.13597, 0.63597, 0, 0], + "10889": [0.26167, 0.75726, 0, 0], + "10890": [0.26167, 0.75726, 0, 0], + "10891": [0.48256, 0.98256, 0, 0], + "10892": [0.48256, 0.98256, 0, 0], + "10901": [0.13667, 0.63667, 0, 0], + "10902": [0.13667, 0.63667, 0, 0], + "10933": [0.25142, 0.75726, 0, 0], + "10934": [0.25142, 0.75726, 0, 0], + "10935": [0.26167, 0.75726, 0, 0], + "10936": [0.26167, 0.75726, 0, 0], + "10937": [0.26167, 0.75726, 0, 0], + "10938": [0.26167, 0.75726, 0, 0], + "10949": [0.25583, 0.75583, 0, 0], + "10950": [0.25583, 0.75583, 0, 0], + "10955": [0.28481, 0.79383, 0, 0], + "10956": [0.28481, 0.79383, 0, 0], + "57350": [0.08167, 0.58167, 0, 0], + "57351": [0.08167, 0.58167, 0, 0], + "57352": [0.08167, 0.58167, 0, 0], + "57353": [0, 0.43056, 0.04028, 0], + "57356": [0.25142, 0.75726, 0, 0], + "57357": [0.25142, 0.75726, 0, 0], + "57358": [0.41951, 0.91951, 0, 0], + "57359": [0.30274, 0.79383, 0, 0], + "57360": [0.30274, 0.79383, 0, 0], + "57361": [0.41951, 0.91951, 0, 0], + "57366": [0.25142, 0.75726, 0, 0], + "57367": [0.25142, 0.75726, 0, 0], + "57368": [0.25142, 0.75726, 0, 0], + "57369": [0.25142, 0.75726, 0, 0], + "57370": [0.13597, 0.63597, 0, 0], + "57371": [0.13597, 0.63597, 0, 0] + }, + "Caligraphic-Regular": { + "48": [0, 0.43056, 0, 0], + "49": [0, 0.43056, 0, 0], + "50": [0, 0.43056, 0, 0], + "51": [0.19444, 0.43056, 0, 0], + "52": [0.19444, 0.43056, 0, 0], + "53": [0.19444, 0.43056, 0, 0], + "54": [0, 0.64444, 0, 0], + "55": [0.19444, 0.43056, 0, 0], + "56": [0, 0.64444, 0, 0], + "57": [0.19444, 0.43056, 0, 0], + "65": [0, 0.68333, 0, 0.19445], + "66": [0, 0.68333, 0.03041, 0.13889], + "67": [0, 0.68333, 0.05834, 0.13889], + "68": [0, 0.68333, 0.02778, 0.08334], + "69": [0, 0.68333, 0.08944, 0.11111], + "70": [0, 0.68333, 0.09931, 0.11111], + "71": [0.09722, 0.68333, 0.0593, 0.11111], + "72": [0, 0.68333, 0.00965, 0.11111], + "73": [0, 0.68333, 0.07382, 0], + "74": [0.09722, 0.68333, 0.18472, 0.16667], + "75": [0, 0.68333, 0.01445, 0.05556], + "76": [0, 0.68333, 0, 0.13889], + "77": [0, 0.68333, 0, 0.13889], + "78": [0, 0.68333, 0.14736, 0.08334], + "79": [0, 0.68333, 0.02778, 0.11111], + "80": [0, 0.68333, 0.08222, 0.08334], + "81": [0.09722, 0.68333, 0, 0.11111], + "82": [0, 0.68333, 0, 0.08334], + "83": [0, 0.68333, 0.075, 0.13889], + "84": [0, 0.68333, 0.25417, 0], + "85": [0, 0.68333, 0.09931, 0.08334], + "86": [0, 0.68333, 0.08222, 0], + "87": [0, 0.68333, 0.08222, 0.08334], + "88": [0, 0.68333, 0.14643, 0.13889], + "89": [0.09722, 0.68333, 0.08222, 0.08334], + "90": [0, 0.68333, 0.07944, 0.13889] + }, + "Fraktur-Regular": { + "33": [0, 0.69141, 0, 0], + "34": [0, 0.69141, 0, 0], + "38": [0, 0.69141, 0, 0], + "39": [0, 0.69141, 0, 0], + "40": [0.24982, 0.74947, 0, 0], + "41": [0.24982, 0.74947, 0, 0], + "42": [0, 0.62119, 0, 0], + "43": [0.08319, 0.58283, 0, 0], + "44": [0, 0.10803, 0, 0], + "45": [0.08319, 0.58283, 0, 0], + "46": [0, 0.10803, 0, 0], + "47": [0.24982, 0.74947, 0, 0], + "48": [0, 0.47534, 0, 0], + "49": [0, 0.47534, 0, 0], + "50": [0, 0.47534, 0, 0], + "51": [0.18906, 0.47534, 0, 0], + "52": [0.18906, 0.47534, 0, 0], + "53": [0.18906, 0.47534, 0, 0], + "54": [0, 0.69141, 0, 0], + "55": [0.18906, 0.47534, 0, 0], + "56": [0, 0.69141, 0, 0], + "57": [0.18906, 0.47534, 0, 0], + "58": [0, 0.47534, 0, 0], + "59": [0.12604, 0.47534, 0, 0], + "61": [-0.13099, 0.36866, 0, 0], + "63": [0, 0.69141, 0, 0], + "65": [0, 0.69141, 0, 0], + "66": [0, 0.69141, 0, 0], + "67": [0, 0.69141, 0, 0], + "68": [0, 0.69141, 0, 0], + "69": [0, 0.69141, 0, 0], + "70": [0.12604, 0.69141, 0, 0], + "71": [0, 0.69141, 0, 0], + "72": [0.06302, 0.69141, 0, 0], + "73": [0, 0.69141, 0, 0], + "74": [0.12604, 0.69141, 0, 0], + "75": [0, 0.69141, 0, 0], + "76": [0, 0.69141, 0, 0], + "77": [0, 0.69141, 0, 0], + "78": [0, 0.69141, 0, 0], + "79": [0, 0.69141, 0, 0], + "80": [0.18906, 0.69141, 0, 0], + "81": [0.03781, 0.69141, 0, 0], + "82": [0, 0.69141, 0, 0], + "83": [0, 0.69141, 0, 0], + "84": [0, 0.69141, 0, 0], + "85": [0, 0.69141, 0, 0], + "86": [0, 0.69141, 0, 0], + "87": [0, 0.69141, 0, 0], + "88": [0, 0.69141, 0, 0], + "89": [0.18906, 0.69141, 0, 0], + "90": [0.12604, 0.69141, 0, 0], + "91": [0.24982, 0.74947, 0, 0], + "93": [0.24982, 0.74947, 0, 0], + "94": [0, 0.69141, 0, 0], + "97": [0, 0.47534, 0, 0], + "98": [0, 0.69141, 0, 0], + "99": [0, 0.47534, 0, 0], + "100": [0, 0.62119, 0, 0], + "101": [0, 0.47534, 0, 0], + "102": [0.18906, 0.69141, 0, 0], + "103": [0.18906, 0.47534, 0, 0], + "104": [0.18906, 0.69141, 0, 0], + "105": [0, 0.69141, 0, 0], + "106": [0, 0.69141, 0, 0], + "107": [0, 0.69141, 0, 0], + "108": [0, 0.69141, 0, 0], + "109": [0, 0.47534, 0, 0], + "110": [0, 0.47534, 0, 0], + "111": [0, 0.47534, 0, 0], + "112": [0.18906, 0.52396, 0, 0], + "113": [0.18906, 0.47534, 0, 0], + "114": [0, 0.47534, 0, 0], + "115": [0, 0.47534, 0, 0], + "116": [0, 0.62119, 0, 0], + "117": [0, 0.47534, 0, 0], + "118": [0, 0.52396, 0, 0], + "119": [0, 0.52396, 0, 0], + "120": [0.18906, 0.47534, 0, 0], + "121": [0.18906, 0.47534, 0, 0], + "122": [0.18906, 0.47534, 0, 0], + "8216": [0, 0.69141, 0, 0], + "8217": [0, 0.69141, 0, 0], + "58112": [0, 0.62119, 0, 0], + "58113": [0, 0.62119, 0, 0], + "58114": [0.18906, 0.69141, 0, 0], + "58115": [0.18906, 0.69141, 0, 0], + "58116": [0.18906, 0.47534, 0, 0], + "58117": [0, 0.69141, 0, 0], + "58118": [0, 0.62119, 0, 0], + "58119": [0, 0.47534, 0, 0] + }, + "Main-Bold": { + "33": [0, 0.69444, 0, 0], + "34": [0, 0.69444, 0, 0], + "35": [0.19444, 0.69444, 0, 0], + "36": [0.05556, 0.75, 0, 0], + "37": [0.05556, 0.75, 0, 0], + "38": [0, 0.69444, 0, 0], + "39": [0, 0.69444, 0, 0], + "40": [0.25, 0.75, 0, 0], + "41": [0.25, 0.75, 0, 0], + "42": [0, 0.75, 0, 0], + "43": [0.13333, 0.63333, 0, 0], + "44": [0.19444, 0.15556, 0, 0], + "45": [0, 0.44444, 0, 0], + "46": [0, 0.15556, 0, 0], + "47": [0.25, 0.75, 0, 0], + "48": [0, 0.64444, 0, 0], + "49": [0, 0.64444, 0, 0], + "50": [0, 0.64444, 0, 0], + "51": [0, 0.64444, 0, 0], + "52": [0, 0.64444, 0, 0], + "53": [0, 0.64444, 0, 0], + "54": [0, 0.64444, 0, 0], + "55": [0, 0.64444, 0, 0], + "56": [0, 0.64444, 0, 0], + "57": [0, 0.64444, 0, 0], + "58": [0, 0.44444, 0, 0], + "59": [0.19444, 0.44444, 0, 0], + "60": [0.08556, 0.58556, 0, 0], + "61": [-0.10889, 0.39111, 0, 0], + "62": [0.08556, 0.58556, 0, 0], + "63": [0, 0.69444, 0, 0], + "64": [0, 0.69444, 0, 0], + "65": [0, 0.68611, 0, 0], + "66": [0, 0.68611, 0, 0], + "67": [0, 0.68611, 0, 0], + "68": [0, 0.68611, 0, 0], + "69": [0, 0.68611, 0, 0], + "70": [0, 0.68611, 0, 0], + "71": [0, 0.68611, 0, 0], + "72": [0, 0.68611, 0, 0], + "73": [0, 0.68611, 0, 0], + "74": [0, 0.68611, 0, 0], + "75": [0, 0.68611, 0, 0], + "76": [0, 0.68611, 0, 0], + "77": [0, 0.68611, 0, 0], + "78": [0, 0.68611, 0, 0], + "79": [0, 0.68611, 0, 0], + "80": [0, 0.68611, 0, 0], + "81": [0.19444, 0.68611, 0, 0], + "82": [0, 0.68611, 0, 0], + "83": [0, 0.68611, 0, 0], + "84": [0, 0.68611, 0, 0], + "85": [0, 0.68611, 0, 0], + "86": [0, 0.68611, 0.01597, 0], + "87": [0, 0.68611, 0.01597, 0], + "88": [0, 0.68611, 0, 0], + "89": [0, 0.68611, 0.02875, 0], + "90": [0, 0.68611, 0, 0], + "91": [0.25, 0.75, 0, 0], + "92": [0.25, 0.75, 0, 0], + "93": [0.25, 0.75, 0, 0], + "94": [0, 0.69444, 0, 0], + "95": [0.31, 0.13444, 0.03194, 0], + "96": [0, 0.69444, 0, 0], + "97": [0, 0.44444, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.44444, 0, 0], + "100": [0, 0.69444, 0, 0], + "101": [0, 0.44444, 0, 0], + "102": [0, 0.69444, 0.10903, 0], + "103": [0.19444, 0.44444, 0.01597, 0], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.69444, 0, 0], + "106": [0.19444, 0.69444, 0, 0], + "107": [0, 0.69444, 0, 0], + "108": [0, 0.69444, 0, 0], + "109": [0, 0.44444, 0, 0], + "110": [0, 0.44444, 0, 0], + "111": [0, 0.44444, 0, 0], + "112": [0.19444, 0.44444, 0, 0], + "113": [0.19444, 0.44444, 0, 0], + "114": [0, 0.44444, 0, 0], + "115": [0, 0.44444, 0, 0], + "116": [0, 0.63492, 0, 0], + "117": [0, 0.44444, 0, 0], + "118": [0, 0.44444, 0.01597, 0], + "119": [0, 0.44444, 0.01597, 0], + "120": [0, 0.44444, 0, 0], + "121": [0.19444, 0.44444, 0.01597, 0], + "122": [0, 0.44444, 0, 0], + "123": [0.25, 0.75, 0, 0], + "124": [0.25, 0.75, 0, 0], + "125": [0.25, 0.75, 0, 0], + "126": [0.35, 0.34444, 0, 0], + "168": [0, 0.69444, 0, 0], + "172": [0, 0.44444, 0, 0], + "175": [0, 0.59611, 0, 0], + "176": [0, 0.69444, 0, 0], + "177": [0.13333, 0.63333, 0, 0], + "180": [0, 0.69444, 0, 0], + "215": [0.13333, 0.63333, 0, 0], + "247": [0.13333, 0.63333, 0, 0], + "305": [0, 0.44444, 0, 0], + "567": [0.19444, 0.44444, 0, 0], + "710": [0, 0.69444, 0, 0], + "711": [0, 0.63194, 0, 0], + "713": [0, 0.59611, 0, 0], + "714": [0, 0.69444, 0, 0], + "715": [0, 0.69444, 0, 0], + "728": [0, 0.69444, 0, 0], + "729": [0, 0.69444, 0, 0], + "730": [0, 0.69444, 0, 0], + "732": [0, 0.69444, 0, 0], + "768": [0, 0.69444, 0, 0], + "769": [0, 0.69444, 0, 0], + "770": [0, 0.69444, 0, 0], + "771": [0, 0.69444, 0, 0], + "772": [0, 0.59611, 0, 0], + "774": [0, 0.69444, 0, 0], + "775": [0, 0.69444, 0, 0], + "776": [0, 0.69444, 0, 0], + "778": [0, 0.69444, 0, 0], + "779": [0, 0.69444, 0, 0], + "780": [0, 0.63194, 0, 0], + "824": [0.19444, 0.69444, 0, 0], + "915": [0, 0.68611, 0, 0], + "916": [0, 0.68611, 0, 0], + "920": [0, 0.68611, 0, 0], + "923": [0, 0.68611, 0, 0], + "926": [0, 0.68611, 0, 0], + "928": [0, 0.68611, 0, 0], + "931": [0, 0.68611, 0, 0], + "933": [0, 0.68611, 0, 0], + "934": [0, 0.68611, 0, 0], + "936": [0, 0.68611, 0, 0], + "937": [0, 0.68611, 0, 0], + "8211": [0, 0.44444, 0.03194, 0], + "8212": [0, 0.44444, 0.03194, 0], + "8216": [0, 0.69444, 0, 0], + "8217": [0, 0.69444, 0, 0], + "8220": [0, 0.69444, 0, 0], + "8221": [0, 0.69444, 0, 0], + "8224": [0.19444, 0.69444, 0, 0], + "8225": [0.19444, 0.69444, 0, 0], + "8242": [0, 0.55556, 0, 0], + "8407": [0, 0.72444, 0.15486, 0], + "8463": [0, 0.69444, 0, 0], + "8465": [0, 0.69444, 0, 0], + "8467": [0, 0.69444, 0, 0], + "8472": [0.19444, 0.44444, 0, 0], + "8476": [0, 0.69444, 0, 0], + "8501": [0, 0.69444, 0, 0], + "8592": [-0.10889, 0.39111, 0, 0], + "8593": [0.19444, 0.69444, 0, 0], + "8594": [-0.10889, 0.39111, 0, 0], + "8595": [0.19444, 0.69444, 0, 0], + "8596": [-0.10889, 0.39111, 0, 0], + "8597": [0.25, 0.75, 0, 0], + "8598": [0.19444, 0.69444, 0, 0], + "8599": [0.19444, 0.69444, 0, 0], + "8600": [0.19444, 0.69444, 0, 0], + "8601": [0.19444, 0.69444, 0, 0], + "8636": [-0.10889, 0.39111, 0, 0], + "8637": [-0.10889, 0.39111, 0, 0], + "8640": [-0.10889, 0.39111, 0, 0], + "8641": [-0.10889, 0.39111, 0, 0], + "8656": [-0.10889, 0.39111, 0, 0], + "8657": [0.19444, 0.69444, 0, 0], + "8658": [-0.10889, 0.39111, 0, 0], + "8659": [0.19444, 0.69444, 0, 0], + "8660": [-0.10889, 0.39111, 0, 0], + "8661": [0.25, 0.75, 0, 0], + "8704": [0, 0.69444, 0, 0], + "8706": [0, 0.69444, 0.06389, 0], + "8707": [0, 0.69444, 0, 0], + "8709": [0.05556, 0.75, 0, 0], + "8711": [0, 0.68611, 0, 0], + "8712": [0.08556, 0.58556, 0, 0], + "8715": [0.08556, 0.58556, 0, 0], + "8722": [0.13333, 0.63333, 0, 0], + "8723": [0.13333, 0.63333, 0, 0], + "8725": [0.25, 0.75, 0, 0], + "8726": [0.25, 0.75, 0, 0], + "8727": [-0.02778, 0.47222, 0, 0], + "8728": [-0.02639, 0.47361, 0, 0], + "8729": [-0.02639, 0.47361, 0, 0], + "8730": [0.18, 0.82, 0, 0], + "8733": [0, 0.44444, 0, 0], + "8734": [0, 0.44444, 0, 0], + "8736": [0, 0.69224, 0, 0], + "8739": [0.25, 0.75, 0, 0], + "8741": [0.25, 0.75, 0, 0], + "8743": [0, 0.55556, 0, 0], + "8744": [0, 0.55556, 0, 0], + "8745": [0, 0.55556, 0, 0], + "8746": [0, 0.55556, 0, 0], + "8747": [0.19444, 0.69444, 0.12778, 0], + "8764": [-0.10889, 0.39111, 0, 0], + "8768": [0.19444, 0.69444, 0, 0], + "8771": [0.00222, 0.50222, 0, 0], + "8776": [0.02444, 0.52444, 0, 0], + "8781": [0.00222, 0.50222, 0, 0], + "8801": [0.00222, 0.50222, 0, 0], + "8804": [0.19667, 0.69667, 0, 0], + "8805": [0.19667, 0.69667, 0, 0], + "8810": [0.08556, 0.58556, 0, 0], + "8811": [0.08556, 0.58556, 0, 0], + "8826": [0.08556, 0.58556, 0, 0], + "8827": [0.08556, 0.58556, 0, 0], + "8834": [0.08556, 0.58556, 0, 0], + "8835": [0.08556, 0.58556, 0, 0], + "8838": [0.19667, 0.69667, 0, 0], + "8839": [0.19667, 0.69667, 0, 0], + "8846": [0, 0.55556, 0, 0], + "8849": [0.19667, 0.69667, 0, 0], + "8850": [0.19667, 0.69667, 0, 0], + "8851": [0, 0.55556, 0, 0], + "8852": [0, 0.55556, 0, 0], + "8853": [0.13333, 0.63333, 0, 0], + "8854": [0.13333, 0.63333, 0, 0], + "8855": [0.13333, 0.63333, 0, 0], + "8856": [0.13333, 0.63333, 0, 0], + "8857": [0.13333, 0.63333, 0, 0], + "8866": [0, 0.69444, 0, 0], + "8867": [0, 0.69444, 0, 0], + "8868": [0, 0.69444, 0, 0], + "8869": [0, 0.69444, 0, 0], + "8900": [-0.02639, 0.47361, 0, 0], + "8901": [-0.02639, 0.47361, 0, 0], + "8902": [-0.02778, 0.47222, 0, 0], + "8968": [0.25, 0.75, 0, 0], + "8969": [0.25, 0.75, 0, 0], + "8970": [0.25, 0.75, 0, 0], + "8971": [0.25, 0.75, 0, 0], + "8994": [-0.13889, 0.36111, 0, 0], + "8995": [-0.13889, 0.36111, 0, 0], + "9651": [0.19444, 0.69444, 0, 0], + "9657": [-0.02778, 0.47222, 0, 0], + "9661": [0.19444, 0.69444, 0, 0], + "9667": [-0.02778, 0.47222, 0, 0], + "9711": [0.19444, 0.69444, 0, 0], + "9824": [0.12963, 0.69444, 0, 0], + "9825": [0.12963, 0.69444, 0, 0], + "9826": [0.12963, 0.69444, 0, 0], + "9827": [0.12963, 0.69444, 0, 0], + "9837": [0, 0.75, 0, 0], + "9838": [0.19444, 0.69444, 0, 0], + "9839": [0.19444, 0.69444, 0, 0], + "10216": [0.25, 0.75, 0, 0], + "10217": [0.25, 0.75, 0, 0], + "10815": [0, 0.68611, 0, 0], + "10927": [0.19667, 0.69667, 0, 0], + "10928": [0.19667, 0.69667, 0, 0] + }, + "Main-Italic": { + "33": [0, 0.69444, 0.12417, 0], + "34": [0, 0.69444, 0.06961, 0], + "35": [0.19444, 0.69444, 0.06616, 0], + "37": [0.05556, 0.75, 0.13639, 0], + "38": [0, 0.69444, 0.09694, 0], + "39": [0, 0.69444, 0.12417, 0], + "40": [0.25, 0.75, 0.16194, 0], + "41": [0.25, 0.75, 0.03694, 0], + "42": [0, 0.75, 0.14917, 0], + "43": [0.05667, 0.56167, 0.03694, 0], + "44": [0.19444, 0.10556, 0, 0], + "45": [0, 0.43056, 0.02826, 0], + "46": [0, 0.10556, 0, 0], + "47": [0.25, 0.75, 0.16194, 0], + "48": [0, 0.64444, 0.13556, 0], + "49": [0, 0.64444, 0.13556, 0], + "50": [0, 0.64444, 0.13556, 0], + "51": [0, 0.64444, 0.13556, 0], + "52": [0.19444, 0.64444, 0.13556, 0], + "53": [0, 0.64444, 0.13556, 0], + "54": [0, 0.64444, 0.13556, 0], + "55": [0.19444, 0.64444, 0.13556, 0], + "56": [0, 0.64444, 0.13556, 0], + "57": [0, 0.64444, 0.13556, 0], + "58": [0, 0.43056, 0.0582, 0], + "59": [0.19444, 0.43056, 0.0582, 0], + "61": [-0.13313, 0.36687, 0.06616, 0], + "63": [0, 0.69444, 0.1225, 0], + "64": [0, 0.69444, 0.09597, 0], + "65": [0, 0.68333, 0, 0], + "66": [0, 0.68333, 0.10257, 0], + "67": [0, 0.68333, 0.14528, 0], + "68": [0, 0.68333, 0.09403, 0], + "69": [0, 0.68333, 0.12028, 0], + "70": [0, 0.68333, 0.13305, 0], + "71": [0, 0.68333, 0.08722, 0], + "72": [0, 0.68333, 0.16389, 0], + "73": [0, 0.68333, 0.15806, 0], + "74": [0, 0.68333, 0.14028, 0], + "75": [0, 0.68333, 0.14528, 0], + "76": [0, 0.68333, 0, 0], + "77": [0, 0.68333, 0.16389, 0], + "78": [0, 0.68333, 0.16389, 0], + "79": [0, 0.68333, 0.09403, 0], + "80": [0, 0.68333, 0.10257, 0], + "81": [0.19444, 0.68333, 0.09403, 0], + "82": [0, 0.68333, 0.03868, 0], + "83": [0, 0.68333, 0.11972, 0], + "84": [0, 0.68333, 0.13305, 0], + "85": [0, 0.68333, 0.16389, 0], + "86": [0, 0.68333, 0.18361, 0], + "87": [0, 0.68333, 0.18361, 0], + "88": [0, 0.68333, 0.15806, 0], + "89": [0, 0.68333, 0.19383, 0], + "90": [0, 0.68333, 0.14528, 0], + "91": [0.25, 0.75, 0.1875, 0], + "93": [0.25, 0.75, 0.10528, 0], + "94": [0, 0.69444, 0.06646, 0], + "95": [0.31, 0.12056, 0.09208, 0], + "97": [0, 0.43056, 0.07671, 0], + "98": [0, 0.69444, 0.06312, 0], + "99": [0, 0.43056, 0.05653, 0], + "100": [0, 0.69444, 0.10333, 0], + "101": [0, 0.43056, 0.07514, 0], + "102": [0.19444, 0.69444, 0.21194, 0], + "103": [0.19444, 0.43056, 0.08847, 0], + "104": [0, 0.69444, 0.07671, 0], + "105": [0, 0.65536, 0.1019, 0], + "106": [0.19444, 0.65536, 0.14467, 0], + "107": [0, 0.69444, 0.10764, 0], + "108": [0, 0.69444, 0.10333, 0], + "109": [0, 0.43056, 0.07671, 0], + "110": [0, 0.43056, 0.07671, 0], + "111": [0, 0.43056, 0.06312, 0], + "112": [0.19444, 0.43056, 0.06312, 0], + "113": [0.19444, 0.43056, 0.08847, 0], + "114": [0, 0.43056, 0.10764, 0], + "115": [0, 0.43056, 0.08208, 0], + "116": [0, 0.61508, 0.09486, 0], + "117": [0, 0.43056, 0.07671, 0], + "118": [0, 0.43056, 0.10764, 0], + "119": [0, 0.43056, 0.10764, 0], + "120": [0, 0.43056, 0.12042, 0], + "121": [0.19444, 0.43056, 0.08847, 0], + "122": [0, 0.43056, 0.12292, 0], + "126": [0.35, 0.31786, 0.11585, 0], + "163": [0, 0.69444, 0, 0], + "305": [0, 0.43056, 0, 0.02778], + "567": [0.19444, 0.43056, 0, 0.08334], + "768": [0, 0.69444, 0, 0], + "769": [0, 0.69444, 0.09694, 0], + "770": [0, 0.69444, 0.06646, 0], + "771": [0, 0.66786, 0.11585, 0], + "772": [0, 0.56167, 0.10333, 0], + "774": [0, 0.69444, 0.10806, 0], + "775": [0, 0.66786, 0.11752, 0], + "776": [0, 0.66786, 0.10474, 0], + "778": [0, 0.69444, 0, 0], + "779": [0, 0.69444, 0.1225, 0], + "780": [0, 0.62847, 0.08295, 0], + "915": [0, 0.68333, 0.13305, 0], + "916": [0, 0.68333, 0, 0], + "920": [0, 0.68333, 0.09403, 0], + "923": [0, 0.68333, 0, 0], + "926": [0, 0.68333, 0.15294, 0], + "928": [0, 0.68333, 0.16389, 0], + "931": [0, 0.68333, 0.12028, 0], + "933": [0, 0.68333, 0.11111, 0], + "934": [0, 0.68333, 0.05986, 0], + "936": [0, 0.68333, 0.11111, 0], + "937": [0, 0.68333, 0.10257, 0], + "8211": [0, 0.43056, 0.09208, 0], + "8212": [0, 0.43056, 0.09208, 0], + "8216": [0, 0.69444, 0.12417, 0], + "8217": [0, 0.69444, 0.12417, 0], + "8220": [0, 0.69444, 0.1685, 0], + "8221": [0, 0.69444, 0.06961, 0], + "8463": [0, 0.68889, 0, 0] + }, + "Main-Regular": { + "32": [0, 0, 0, 0], + "33": [0, 0.69444, 0, 0], + "34": [0, 0.69444, 0, 0], + "35": [0.19444, 0.69444, 0, 0], + "36": [0.05556, 0.75, 0, 0], + "37": [0.05556, 0.75, 0, 0], + "38": [0, 0.69444, 0, 0], + "39": [0, 0.69444, 0, 0], + "40": [0.25, 0.75, 0, 0], + "41": [0.25, 0.75, 0, 0], + "42": [0, 0.75, 0, 0], + "43": [0.08333, 0.58333, 0, 0], + "44": [0.19444, 0.10556, 0, 0], + "45": [0, 0.43056, 0, 0], + "46": [0, 0.10556, 0, 0], + "47": [0.25, 0.75, 0, 0], + "48": [0, 0.64444, 0, 0], + "49": [0, 0.64444, 0, 0], + "50": [0, 0.64444, 0, 0], + "51": [0, 0.64444, 0, 0], + "52": [0, 0.64444, 0, 0], + "53": [0, 0.64444, 0, 0], + "54": [0, 0.64444, 0, 0], + "55": [0, 0.64444, 0, 0], + "56": [0, 0.64444, 0, 0], + "57": [0, 0.64444, 0, 0], + "58": [0, 0.43056, 0, 0], + "59": [0.19444, 0.43056, 0, 0], + "60": [0.0391, 0.5391, 0, 0], + "61": [-0.13313, 0.36687, 0, 0], + "62": [0.0391, 0.5391, 0, 0], + "63": [0, 0.69444, 0, 0], + "64": [0, 0.69444, 0, 0], + "65": [0, 0.68333, 0, 0], + "66": [0, 0.68333, 0, 0], + "67": [0, 0.68333, 0, 0], + "68": [0, 0.68333, 0, 0], + "69": [0, 0.68333, 0, 0], + "70": [0, 0.68333, 0, 0], + "71": [0, 0.68333, 0, 0], + "72": [0, 0.68333, 0, 0], + "73": [0, 0.68333, 0, 0], + "74": [0, 0.68333, 0, 0], + "75": [0, 0.68333, 0, 0], + "76": [0, 0.68333, 0, 0], + "77": [0, 0.68333, 0, 0], + "78": [0, 0.68333, 0, 0], + "79": [0, 0.68333, 0, 0], + "80": [0, 0.68333, 0, 0], + "81": [0.19444, 0.68333, 0, 0], + "82": [0, 0.68333, 0, 0], + "83": [0, 0.68333, 0, 0], + "84": [0, 0.68333, 0, 0], + "85": [0, 0.68333, 0, 0], + "86": [0, 0.68333, 0.01389, 0], + "87": [0, 0.68333, 0.01389, 0], + "88": [0, 0.68333, 0, 0], + "89": [0, 0.68333, 0.025, 0], + "90": [0, 0.68333, 0, 0], + "91": [0.25, 0.75, 0, 0], + "92": [0.25, 0.75, 0, 0], + "93": [0.25, 0.75, 0, 0], + "94": [0, 0.69444, 0, 0], + "95": [0.31, 0.12056, 0.02778, 0], + "96": [0, 0.69444, 0, 0], + "97": [0, 0.43056, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.43056, 0, 0], + "100": [0, 0.69444, 0, 0], + "101": [0, 0.43056, 0, 0], + "102": [0, 0.69444, 0.07778, 0], + "103": [0.19444, 0.43056, 0.01389, 0], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.66786, 0, 0], + "106": [0.19444, 0.66786, 0, 0], + "107": [0, 0.69444, 0, 0], + "108": [0, 0.69444, 0, 0], + "109": [0, 0.43056, 0, 0], + "110": [0, 0.43056, 0, 0], + "111": [0, 0.43056, 0, 0], + "112": [0.19444, 0.43056, 0, 0], + "113": [0.19444, 0.43056, 0, 0], + "114": [0, 0.43056, 0, 0], + "115": [0, 0.43056, 0, 0], + "116": [0, 0.61508, 0, 0], + "117": [0, 0.43056, 0, 0], + "118": [0, 0.43056, 0.01389, 0], + "119": [0, 0.43056, 0.01389, 0], + "120": [0, 0.43056, 0, 0], + "121": [0.19444, 0.43056, 0.01389, 0], + "122": [0, 0.43056, 0, 0], + "123": [0.25, 0.75, 0, 0], + "124": [0.25, 0.75, 0, 0], + "125": [0.25, 0.75, 0, 0], + "126": [0.35, 0.31786, 0, 0], + "160": [0, 0, 0, 0], + "168": [0, 0.66786, 0, 0], + "172": [0, 0.43056, 0, 0], + "175": [0, 0.56778, 0, 0], + "176": [0, 0.69444, 0, 0], + "177": [0.08333, 0.58333, 0, 0], + "180": [0, 0.69444, 0, 0], + "215": [0.08333, 0.58333, 0, 0], + "247": [0.08333, 0.58333, 0, 0], + "305": [0, 0.43056, 0, 0], + "567": [0.19444, 0.43056, 0, 0], + "710": [0, 0.69444, 0, 0], + "711": [0, 0.62847, 0, 0], + "713": [0, 0.56778, 0, 0], + "714": [0, 0.69444, 0, 0], + "715": [0, 0.69444, 0, 0], + "728": [0, 0.69444, 0, 0], + "729": [0, 0.66786, 0, 0], + "730": [0, 0.69444, 0, 0], + "732": [0, 0.66786, 0, 0], + "768": [0, 0.69444, 0, 0], + "769": [0, 0.69444, 0, 0], + "770": [0, 0.69444, 0, 0], + "771": [0, 0.66786, 0, 0], + "772": [0, 0.56778, 0, 0], + "774": [0, 0.69444, 0, 0], + "775": [0, 0.66786, 0, 0], + "776": [0, 0.66786, 0, 0], + "778": [0, 0.69444, 0, 0], + "779": [0, 0.69444, 0, 0], + "780": [0, 0.62847, 0, 0], + "824": [0.19444, 0.69444, 0, 0], + "915": [0, 0.68333, 0, 0], + "916": [0, 0.68333, 0, 0], + "920": [0, 0.68333, 0, 0], + "923": [0, 0.68333, 0, 0], + "926": [0, 0.68333, 0, 0], + "928": [0, 0.68333, 0, 0], + "931": [0, 0.68333, 0, 0], + "933": [0, 0.68333, 0, 0], + "934": [0, 0.68333, 0, 0], + "936": [0, 0.68333, 0, 0], + "937": [0, 0.68333, 0, 0], + "8211": [0, 0.43056, 0.02778, 0], + "8212": [0, 0.43056, 0.02778, 0], + "8216": [0, 0.69444, 0, 0], + "8217": [0, 0.69444, 0, 0], + "8220": [0, 0.69444, 0, 0], + "8221": [0, 0.69444, 0, 0], + "8224": [0.19444, 0.69444, 0, 0], + "8225": [0.19444, 0.69444, 0, 0], + "8230": [0, 0.12, 0, 0], + "8242": [0, 0.55556, 0, 0], + "8407": [0, 0.71444, 0.15382, 0], + "8463": [0, 0.68889, 0, 0], + "8465": [0, 0.69444, 0, 0], + "8467": [0, 0.69444, 0, 0.11111], + "8472": [0.19444, 0.43056, 0, 0.11111], + "8476": [0, 0.69444, 0, 0], + "8501": [0, 0.69444, 0, 0], + "8592": [-0.13313, 0.36687, 0, 0], + "8593": [0.19444, 0.69444, 0, 0], + "8594": [-0.13313, 0.36687, 0, 0], + "8595": [0.19444, 0.69444, 0, 0], + "8596": [-0.13313, 0.36687, 0, 0], + "8597": [0.25, 0.75, 0, 0], + "8598": [0.19444, 0.69444, 0, 0], + "8599": [0.19444, 0.69444, 0, 0], + "8600": [0.19444, 0.69444, 0, 0], + "8601": [0.19444, 0.69444, 0, 0], + "8614": [0.011, 0.511, 0, 0], + "8617": [0.011, 0.511, 0, 0], + "8618": [0.011, 0.511, 0, 0], + "8636": [-0.13313, 0.36687, 0, 0], + "8637": [-0.13313, 0.36687, 0, 0], + "8640": [-0.13313, 0.36687, 0, 0], + "8641": [-0.13313, 0.36687, 0, 0], + "8652": [0.011, 0.671, 0, 0], + "8656": [-0.13313, 0.36687, 0, 0], + "8657": [0.19444, 0.69444, 0, 0], + "8658": [-0.13313, 0.36687, 0, 0], + "8659": [0.19444, 0.69444, 0, 0], + "8660": [-0.13313, 0.36687, 0, 0], + "8661": [0.25, 0.75, 0, 0], + "8704": [0, 0.69444, 0, 0], + "8706": [0, 0.69444, 0.05556, 0.08334], + "8707": [0, 0.69444, 0, 0], + "8709": [0.05556, 0.75, 0, 0], + "8711": [0, 0.68333, 0, 0], + "8712": [0.0391, 0.5391, 0, 0], + "8715": [0.0391, 0.5391, 0, 0], + "8722": [0.08333, 0.58333, 0, 0], + "8723": [0.08333, 0.58333, 0, 0], + "8725": [0.25, 0.75, 0, 0], + "8726": [0.25, 0.75, 0, 0], + "8727": [-0.03472, 0.46528, 0, 0], + "8728": [-0.05555, 0.44445, 0, 0], + "8729": [-0.05555, 0.44445, 0, 0], + "8730": [0.2, 0.8, 0, 0], + "8733": [0, 0.43056, 0, 0], + "8734": [0, 0.43056, 0, 0], + "8736": [0, 0.69224, 0, 0], + "8739": [0.25, 0.75, 0, 0], + "8741": [0.25, 0.75, 0, 0], + "8743": [0, 0.55556, 0, 0], + "8744": [0, 0.55556, 0, 0], + "8745": [0, 0.55556, 0, 0], + "8746": [0, 0.55556, 0, 0], + "8747": [0.19444, 0.69444, 0.11111, 0], + "8764": [-0.13313, 0.36687, 0, 0], + "8768": [0.19444, 0.69444, 0, 0], + "8771": [-0.03625, 0.46375, 0, 0], + "8773": [-0.022, 0.589, 0, 0], + "8776": [-0.01688, 0.48312, 0, 0], + "8781": [-0.03625, 0.46375, 0, 0], + "8784": [-0.133, 0.67, 0, 0], + "8800": [0.215, 0.716, 0, 0], + "8801": [-0.03625, 0.46375, 0, 0], + "8804": [0.13597, 0.63597, 0, 0], + "8805": [0.13597, 0.63597, 0, 0], + "8810": [0.0391, 0.5391, 0, 0], + "8811": [0.0391, 0.5391, 0, 0], + "8826": [0.0391, 0.5391, 0, 0], + "8827": [0.0391, 0.5391, 0, 0], + "8834": [0.0391, 0.5391, 0, 0], + "8835": [0.0391, 0.5391, 0, 0], + "8838": [0.13597, 0.63597, 0, 0], + "8839": [0.13597, 0.63597, 0, 0], + "8846": [0, 0.55556, 0, 0], + "8849": [0.13597, 0.63597, 0, 0], + "8850": [0.13597, 0.63597, 0, 0], + "8851": [0, 0.55556, 0, 0], + "8852": [0, 0.55556, 0, 0], + "8853": [0.08333, 0.58333, 0, 0], + "8854": [0.08333, 0.58333, 0, 0], + "8855": [0.08333, 0.58333, 0, 0], + "8856": [0.08333, 0.58333, 0, 0], + "8857": [0.08333, 0.58333, 0, 0], + "8866": [0, 0.69444, 0, 0], + "8867": [0, 0.69444, 0, 0], + "8868": [0, 0.69444, 0, 0], + "8869": [0, 0.69444, 0, 0], + "8872": [0.249, 0.75, 0, 0], + "8900": [-0.05555, 0.44445, 0, 0], + "8901": [-0.05555, 0.44445, 0, 0], + "8902": [-0.03472, 0.46528, 0, 0], + "8904": [0.005, 0.505, 0, 0], + "8942": [0.03, 0.9, 0, 0], + "8943": [-0.19, 0.31, 0, 0], + "8945": [-0.1, 0.82, 0, 0], + "8968": [0.25, 0.75, 0, 0], + "8969": [0.25, 0.75, 0, 0], + "8970": [0.25, 0.75, 0, 0], + "8971": [0.25, 0.75, 0, 0], + "8994": [-0.14236, 0.35764, 0, 0], + "8995": [-0.14236, 0.35764, 0, 0], + "9136": [0.244, 0.744, 0, 0], + "9137": [0.244, 0.744, 0, 0], + "9651": [0.19444, 0.69444, 0, 0], + "9657": [-0.03472, 0.46528, 0, 0], + "9661": [0.19444, 0.69444, 0, 0], + "9667": [-0.03472, 0.46528, 0, 0], + "9711": [0.19444, 0.69444, 0, 0], + "9824": [0.12963, 0.69444, 0, 0], + "9825": [0.12963, 0.69444, 0, 0], + "9826": [0.12963, 0.69444, 0, 0], + "9827": [0.12963, 0.69444, 0, 0], + "9837": [0, 0.75, 0, 0], + "9838": [0.19444, 0.69444, 0, 0], + "9839": [0.19444, 0.69444, 0, 0], + "10216": [0.25, 0.75, 0, 0], + "10217": [0.25, 0.75, 0, 0], + "10222": [0.244, 0.744, 0, 0], + "10223": [0.244, 0.744, 0, 0], + "10229": [0.011, 0.511, 0, 0], + "10230": [0.011, 0.511, 0, 0], + "10231": [0.011, 0.511, 0, 0], + "10232": [0.024, 0.525, 0, 0], + "10233": [0.024, 0.525, 0, 0], + "10234": [0.024, 0.525, 0, 0], + "10236": [0.011, 0.511, 0, 0], + "10815": [0, 0.68333, 0, 0], + "10927": [0.13597, 0.63597, 0, 0], + "10928": [0.13597, 0.63597, 0, 0] + }, + "Math-BoldItalic": { + "47": [0.19444, 0.69444, 0, 0], + "65": [0, 0.68611, 0, 0], + "66": [0, 0.68611, 0.04835, 0], + "67": [0, 0.68611, 0.06979, 0], + "68": [0, 0.68611, 0.03194, 0], + "69": [0, 0.68611, 0.05451, 0], + "70": [0, 0.68611, 0.15972, 0], + "71": [0, 0.68611, 0, 0], + "72": [0, 0.68611, 0.08229, 0], + "73": [0, 0.68611, 0.07778, 0], + "74": [0, 0.68611, 0.10069, 0], + "75": [0, 0.68611, 0.06979, 0], + "76": [0, 0.68611, 0, 0], + "77": [0, 0.68611, 0.11424, 0], + "78": [0, 0.68611, 0.11424, 0], + "79": [0, 0.68611, 0.03194, 0], + "80": [0, 0.68611, 0.15972, 0], + "81": [0.19444, 0.68611, 0, 0], + "82": [0, 0.68611, 0.00421, 0], + "83": [0, 0.68611, 0.05382, 0], + "84": [0, 0.68611, 0.15972, 0], + "85": [0, 0.68611, 0.11424, 0], + "86": [0, 0.68611, 0.25555, 0], + "87": [0, 0.68611, 0.15972, 0], + "88": [0, 0.68611, 0.07778, 0], + "89": [0, 0.68611, 0.25555, 0], + "90": [0, 0.68611, 0.06979, 0], + "97": [0, 0.44444, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.44444, 0, 0], + "100": [0, 0.69444, 0, 0], + "101": [0, 0.44444, 0, 0], + "102": [0.19444, 0.69444, 0.11042, 0], + "103": [0.19444, 0.44444, 0.03704, 0], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.69326, 0, 0], + "106": [0.19444, 0.69326, 0.0622, 0], + "107": [0, 0.69444, 0.01852, 0], + "108": [0, 0.69444, 0.0088, 0], + "109": [0, 0.44444, 0, 0], + "110": [0, 0.44444, 0, 0], + "111": [0, 0.44444, 0, 0], + "112": [0.19444, 0.44444, 0, 0], + "113": [0.19444, 0.44444, 0.03704, 0], + "114": [0, 0.44444, 0.03194, 0], + "115": [0, 0.44444, 0, 0], + "116": [0, 0.63492, 0, 0], + "117": [0, 0.44444, 0, 0], + "118": [0, 0.44444, 0.03704, 0], + "119": [0, 0.44444, 0.02778, 0], + "120": [0, 0.44444, 0, 0], + "121": [0.19444, 0.44444, 0.03704, 0], + "122": [0, 0.44444, 0.04213, 0], + "915": [0, 0.68611, 0.15972, 0], + "916": [0, 0.68611, 0, 0], + "920": [0, 0.68611, 0.03194, 0], + "923": [0, 0.68611, 0, 0], + "926": [0, 0.68611, 0.07458, 0], + "928": [0, 0.68611, 0.08229, 0], + "931": [0, 0.68611, 0.05451, 0], + "933": [0, 0.68611, 0.15972, 0], + "934": [0, 0.68611, 0, 0], + "936": [0, 0.68611, 0.11653, 0], + "937": [0, 0.68611, 0.04835, 0], + "945": [0, 0.44444, 0, 0], + "946": [0.19444, 0.69444, 0.03403, 0], + "947": [0.19444, 0.44444, 0.06389, 0], + "948": [0, 0.69444, 0.03819, 0], + "949": [0, 0.44444, 0, 0], + "950": [0.19444, 0.69444, 0.06215, 0], + "951": [0.19444, 0.44444, 0.03704, 0], + "952": [0, 0.69444, 0.03194, 0], + "953": [0, 0.44444, 0, 0], + "954": [0, 0.44444, 0, 0], + "955": [0, 0.69444, 0, 0], + "956": [0.19444, 0.44444, 0, 0], + "957": [0, 0.44444, 0.06898, 0], + "958": [0.19444, 0.69444, 0.03021, 0], + "959": [0, 0.44444, 0, 0], + "960": [0, 0.44444, 0.03704, 0], + "961": [0.19444, 0.44444, 0, 0], + "962": [0.09722, 0.44444, 0.07917, 0], + "963": [0, 0.44444, 0.03704, 0], + "964": [0, 0.44444, 0.13472, 0], + "965": [0, 0.44444, 0.03704, 0], + "966": [0.19444, 0.44444, 0, 0], + "967": [0.19444, 0.44444, 0, 0], + "968": [0.19444, 0.69444, 0.03704, 0], + "969": [0, 0.44444, 0.03704, 0], + "977": [0, 0.69444, 0, 0], + "981": [0.19444, 0.69444, 0, 0], + "982": [0, 0.44444, 0.03194, 0], + "1009": [0.19444, 0.44444, 0, 0], + "1013": [0, 0.44444, 0, 0] + }, + "Math-Italic": { + "47": [0.19444, 0.69444, 0, 0], + "65": [0, 0.68333, 0, 0.13889], + "66": [0, 0.68333, 0.05017, 0.08334], + "67": [0, 0.68333, 0.07153, 0.08334], + "68": [0, 0.68333, 0.02778, 0.05556], + "69": [0, 0.68333, 0.05764, 0.08334], + "70": [0, 0.68333, 0.13889, 0.08334], + "71": [0, 0.68333, 0, 0.08334], + "72": [0, 0.68333, 0.08125, 0.05556], + "73": [0, 0.68333, 0.07847, 0.11111], + "74": [0, 0.68333, 0.09618, 0.16667], + "75": [0, 0.68333, 0.07153, 0.05556], + "76": [0, 0.68333, 0, 0.02778], + "77": [0, 0.68333, 0.10903, 0.08334], + "78": [0, 0.68333, 0.10903, 0.08334], + "79": [0, 0.68333, 0.02778, 0.08334], + "80": [0, 0.68333, 0.13889, 0.08334], + "81": [0.19444, 0.68333, 0, 0.08334], + "82": [0, 0.68333, 0.00773, 0.08334], + "83": [0, 0.68333, 0.05764, 0.08334], + "84": [0, 0.68333, 0.13889, 0.08334], + "85": [0, 0.68333, 0.10903, 0.02778], + "86": [0, 0.68333, 0.22222, 0], + "87": [0, 0.68333, 0.13889, 0], + "88": [0, 0.68333, 0.07847, 0.08334], + "89": [0, 0.68333, 0.22222, 0], + "90": [0, 0.68333, 0.07153, 0.08334], + "97": [0, 0.43056, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.43056, 0, 0.05556], + "100": [0, 0.69444, 0, 0.16667], + "101": [0, 0.43056, 0, 0.05556], + "102": [0.19444, 0.69444, 0.10764, 0.16667], + "103": [0.19444, 0.43056, 0.03588, 0.02778], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.65952, 0, 0], + "106": [0.19444, 0.65952, 0.05724, 0], + "107": [0, 0.69444, 0.03148, 0], + "108": [0, 0.69444, 0.01968, 0.08334], + "109": [0, 0.43056, 0, 0], + "110": [0, 0.43056, 0, 0], + "111": [0, 0.43056, 0, 0.05556], + "112": [0.19444, 0.43056, 0, 0.08334], + "113": [0.19444, 0.43056, 0.03588, 0.08334], + "114": [0, 0.43056, 0.02778, 0.05556], + "115": [0, 0.43056, 0, 0.05556], + "116": [0, 0.61508, 0, 0.08334], + "117": [0, 0.43056, 0, 0.02778], + "118": [0, 0.43056, 0.03588, 0.02778], + "119": [0, 0.43056, 0.02691, 0.08334], + "120": [0, 0.43056, 0, 0.02778], + "121": [0.19444, 0.43056, 0.03588, 0.05556], + "122": [0, 0.43056, 0.04398, 0.05556], + "915": [0, 0.68333, 0.13889, 0.08334], + "916": [0, 0.68333, 0, 0.16667], + "920": [0, 0.68333, 0.02778, 0.08334], + "923": [0, 0.68333, 0, 0.16667], + "926": [0, 0.68333, 0.07569, 0.08334], + "928": [0, 0.68333, 0.08125, 0.05556], + "931": [0, 0.68333, 0.05764, 0.08334], + "933": [0, 0.68333, 0.13889, 0.05556], + "934": [0, 0.68333, 0, 0.08334], + "936": [0, 0.68333, 0.11, 0.05556], + "937": [0, 0.68333, 0.05017, 0.08334], + "945": [0, 0.43056, 0.0037, 0.02778], + "946": [0.19444, 0.69444, 0.05278, 0.08334], + "947": [0.19444, 0.43056, 0.05556, 0], + "948": [0, 0.69444, 0.03785, 0.05556], + "949": [0, 0.43056, 0, 0.08334], + "950": [0.19444, 0.69444, 0.07378, 0.08334], + "951": [0.19444, 0.43056, 0.03588, 0.05556], + "952": [0, 0.69444, 0.02778, 0.08334], + "953": [0, 0.43056, 0, 0.05556], + "954": [0, 0.43056, 0, 0], + "955": [0, 0.69444, 0, 0], + "956": [0.19444, 0.43056, 0, 0.02778], + "957": [0, 0.43056, 0.06366, 0.02778], + "958": [0.19444, 0.69444, 0.04601, 0.11111], + "959": [0, 0.43056, 0, 0.05556], + "960": [0, 0.43056, 0.03588, 0], + "961": [0.19444, 0.43056, 0, 0.08334], + "962": [0.09722, 0.43056, 0.07986, 0.08334], + "963": [0, 0.43056, 0.03588, 0], + "964": [0, 0.43056, 0.1132, 0.02778], + "965": [0, 0.43056, 0.03588, 0.02778], + "966": [0.19444, 0.43056, 0, 0.08334], + "967": [0.19444, 0.43056, 0, 0.05556], + "968": [0.19444, 0.69444, 0.03588, 0.11111], + "969": [0, 0.43056, 0.03588, 0], + "977": [0, 0.69444, 0, 0.08334], + "981": [0.19444, 0.69444, 0, 0.08334], + "982": [0, 0.43056, 0.02778, 0], + "1009": [0.19444, 0.43056, 0, 0.08334], + "1013": [0, 0.43056, 0, 0.05556] + }, + "Math-Regular": { + "65": [0, 0.68333, 0, 0.13889], + "66": [0, 0.68333, 0.05017, 0.08334], + "67": [0, 0.68333, 0.07153, 0.08334], + "68": [0, 0.68333, 0.02778, 0.05556], + "69": [0, 0.68333, 0.05764, 0.08334], + "70": [0, 0.68333, 0.13889, 0.08334], + "71": [0, 0.68333, 0, 0.08334], + "72": [0, 0.68333, 0.08125, 0.05556], + "73": [0, 0.68333, 0.07847, 0.11111], + "74": [0, 0.68333, 0.09618, 0.16667], + "75": [0, 0.68333, 0.07153, 0.05556], + "76": [0, 0.68333, 0, 0.02778], + "77": [0, 0.68333, 0.10903, 0.08334], + "78": [0, 0.68333, 0.10903, 0.08334], + "79": [0, 0.68333, 0.02778, 0.08334], + "80": [0, 0.68333, 0.13889, 0.08334], + "81": [0.19444, 0.68333, 0, 0.08334], + "82": [0, 0.68333, 0.00773, 0.08334], + "83": [0, 0.68333, 0.05764, 0.08334], + "84": [0, 0.68333, 0.13889, 0.08334], + "85": [0, 0.68333, 0.10903, 0.02778], + "86": [0, 0.68333, 0.22222, 0], + "87": [0, 0.68333, 0.13889, 0], + "88": [0, 0.68333, 0.07847, 0.08334], + "89": [0, 0.68333, 0.22222, 0], + "90": [0, 0.68333, 0.07153, 0.08334], + "97": [0, 0.43056, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.43056, 0, 0.05556], + "100": [0, 0.69444, 0, 0.16667], + "101": [0, 0.43056, 0, 0.05556], + "102": [0.19444, 0.69444, 0.10764, 0.16667], + "103": [0.19444, 0.43056, 0.03588, 0.02778], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.65952, 0, 0], + "106": [0.19444, 0.65952, 0.05724, 0], + "107": [0, 0.69444, 0.03148, 0], + "108": [0, 0.69444, 0.01968, 0.08334], + "109": [0, 0.43056, 0, 0], + "110": [0, 0.43056, 0, 0], + "111": [0, 0.43056, 0, 0.05556], + "112": [0.19444, 0.43056, 0, 0.08334], + "113": [0.19444, 0.43056, 0.03588, 0.08334], + "114": [0, 0.43056, 0.02778, 0.05556], + "115": [0, 0.43056, 0, 0.05556], + "116": [0, 0.61508, 0, 0.08334], + "117": [0, 0.43056, 0, 0.02778], + "118": [0, 0.43056, 0.03588, 0.02778], + "119": [0, 0.43056, 0.02691, 0.08334], + "120": [0, 0.43056, 0, 0.02778], + "121": [0.19444, 0.43056, 0.03588, 0.05556], + "122": [0, 0.43056, 0.04398, 0.05556], + "915": [0, 0.68333, 0.13889, 0.08334], + "916": [0, 0.68333, 0, 0.16667], + "920": [0, 0.68333, 0.02778, 0.08334], + "923": [0, 0.68333, 0, 0.16667], + "926": [0, 0.68333, 0.07569, 0.08334], + "928": [0, 0.68333, 0.08125, 0.05556], + "931": [0, 0.68333, 0.05764, 0.08334], + "933": [0, 0.68333, 0.13889, 0.05556], + "934": [0, 0.68333, 0, 0.08334], + "936": [0, 0.68333, 0.11, 0.05556], + "937": [0, 0.68333, 0.05017, 0.08334], + "945": [0, 0.43056, 0.0037, 0.02778], + "946": [0.19444, 0.69444, 0.05278, 0.08334], + "947": [0.19444, 0.43056, 0.05556, 0], + "948": [0, 0.69444, 0.03785, 0.05556], + "949": [0, 0.43056, 0, 0.08334], + "950": [0.19444, 0.69444, 0.07378, 0.08334], + "951": [0.19444, 0.43056, 0.03588, 0.05556], + "952": [0, 0.69444, 0.02778, 0.08334], + "953": [0, 0.43056, 0, 0.05556], + "954": [0, 0.43056, 0, 0], + "955": [0, 0.69444, 0, 0], + "956": [0.19444, 0.43056, 0, 0.02778], + "957": [0, 0.43056, 0.06366, 0.02778], + "958": [0.19444, 0.69444, 0.04601, 0.11111], + "959": [0, 0.43056, 0, 0.05556], + "960": [0, 0.43056, 0.03588, 0], + "961": [0.19444, 0.43056, 0, 0.08334], + "962": [0.09722, 0.43056, 0.07986, 0.08334], + "963": [0, 0.43056, 0.03588, 0], + "964": [0, 0.43056, 0.1132, 0.02778], + "965": [0, 0.43056, 0.03588, 0.02778], + "966": [0.19444, 0.43056, 0, 0.08334], + "967": [0.19444, 0.43056, 0, 0.05556], + "968": [0.19444, 0.69444, 0.03588, 0.11111], + "969": [0, 0.43056, 0.03588, 0], + "977": [0, 0.69444, 0, 0.08334], + "981": [0.19444, 0.69444, 0, 0.08334], + "982": [0, 0.43056, 0.02778, 0], + "1009": [0.19444, 0.43056, 0, 0.08334], + "1013": [0, 0.43056, 0, 0.05556] + }, + "SansSerif-Regular": { + "33": [0, 0.69444, 0, 0], + "34": [0, 0.69444, 0, 0], + "35": [0.19444, 0.69444, 0, 0], + "36": [0.05556, 0.75, 0, 0], + "37": [0.05556, 0.75, 0, 0], + "38": [0, 0.69444, 0, 0], + "39": [0, 0.69444, 0, 0], + "40": [0.25, 0.75, 0, 0], + "41": [0.25, 0.75, 0, 0], + "42": [0, 0.75, 0, 0], + "43": [0.08333, 0.58333, 0, 0], + "44": [0.125, 0.08333, 0, 0], + "45": [0, 0.44444, 0, 0], + "46": [0, 0.08333, 0, 0], + "47": [0.25, 0.75, 0, 0], + "48": [0, 0.65556, 0, 0], + "49": [0, 0.65556, 0, 0], + "50": [0, 0.65556, 0, 0], + "51": [0, 0.65556, 0, 0], + "52": [0, 0.65556, 0, 0], + "53": [0, 0.65556, 0, 0], + "54": [0, 0.65556, 0, 0], + "55": [0, 0.65556, 0, 0], + "56": [0, 0.65556, 0, 0], + "57": [0, 0.65556, 0, 0], + "58": [0, 0.44444, 0, 0], + "59": [0.125, 0.44444, 0, 0], + "61": [-0.13, 0.37, 0, 0], + "63": [0, 0.69444, 0, 0], + "64": [0, 0.69444, 0, 0], + "65": [0, 0.69444, 0, 0], + "66": [0, 0.69444, 0, 0], + "67": [0, 0.69444, 0, 0], + "68": [0, 0.69444, 0, 0], + "69": [0, 0.69444, 0, 0], + "70": [0, 0.69444, 0, 0], + "71": [0, 0.69444, 0, 0], + "72": [0, 0.69444, 0, 0], + "73": [0, 0.69444, 0, 0], + "74": [0, 0.69444, 0, 0], + "75": [0, 0.69444, 0, 0], + "76": [0, 0.69444, 0, 0], + "77": [0, 0.69444, 0, 0], + "78": [0, 0.69444, 0, 0], + "79": [0, 0.69444, 0, 0], + "80": [0, 0.69444, 0, 0], + "81": [0.125, 0.69444, 0, 0], + "82": [0, 0.69444, 0, 0], + "83": [0, 0.69444, 0, 0], + "84": [0, 0.69444, 0, 0], + "85": [0, 0.69444, 0, 0], + "86": [0, 0.69444, 0.01389, 0], + "87": [0, 0.69444, 0.01389, 0], + "88": [0, 0.69444, 0, 0], + "89": [0, 0.69444, 0.025, 0], + "90": [0, 0.69444, 0, 0], + "91": [0.25, 0.75, 0, 0], + "93": [0.25, 0.75, 0, 0], + "94": [0, 0.69444, 0, 0], + "95": [0.35, 0.09444, 0.02778, 0], + "97": [0, 0.44444, 0, 0], + "98": [0, 0.69444, 0, 0], + "99": [0, 0.44444, 0, 0], + "100": [0, 0.69444, 0, 0], + "101": [0, 0.44444, 0, 0], + "102": [0, 0.69444, 0.06944, 0], + "103": [0.19444, 0.44444, 0.01389, 0], + "104": [0, 0.69444, 0, 0], + "105": [0, 0.67937, 0, 0], + "106": [0.19444, 0.67937, 0, 0], + "107": [0, 0.69444, 0, 0], + "108": [0, 0.69444, 0, 0], + "109": [0, 0.44444, 0, 0], + "110": [0, 0.44444, 0, 0], + "111": [0, 0.44444, 0, 0], + "112": [0.19444, 0.44444, 0, 0], + "113": [0.19444, 0.44444, 0, 0], + "114": [0, 0.44444, 0.01389, 0], + "115": [0, 0.44444, 0, 0], + "116": [0, 0.57143, 0, 0], + "117": [0, 0.44444, 0, 0], + "118": [0, 0.44444, 0.01389, 0], + "119": [0, 0.44444, 0.01389, 0], + "120": [0, 0.44444, 0, 0], + "121": [0.19444, 0.44444, 0.01389, 0], + "122": [0, 0.44444, 0, 0], + "126": [0.35, 0.32659, 0, 0], + "305": [0, 0.44444, 0, 0], + "567": [0.19444, 0.44444, 0, 0], + "768": [0, 0.69444, 0, 0], + "769": [0, 0.69444, 0, 0], + "770": [0, 0.69444, 0, 0], + "771": [0, 0.67659, 0, 0], + "772": [0, 0.60889, 0, 0], + "774": [0, 0.69444, 0, 0], + "775": [0, 0.67937, 0, 0], + "776": [0, 0.67937, 0, 0], + "778": [0, 0.69444, 0, 0], + "779": [0, 0.69444, 0, 0], + "780": [0, 0.63194, 0, 0], + "915": [0, 0.69444, 0, 0], + "916": [0, 0.69444, 0, 0], + "920": [0, 0.69444, 0, 0], + "923": [0, 0.69444, 0, 0], + "926": [0, 0.69444, 0, 0], + "928": [0, 0.69444, 0, 0], + "931": [0, 0.69444, 0, 0], + "933": [0, 0.69444, 0, 0], + "934": [0, 0.69444, 0, 0], + "936": [0, 0.69444, 0, 0], + "937": [0, 0.69444, 0, 0], + "8211": [0, 0.44444, 0.02778, 0], + "8212": [0, 0.44444, 0.02778, 0], + "8216": [0, 0.69444, 0, 0], + "8217": [0, 0.69444, 0, 0], + "8220": [0, 0.69444, 0, 0], + "8221": [0, 0.69444, 0, 0] + }, + "Script-Regular": { + "65": [0, 0.7, 0.22925, 0], + "66": [0, 0.7, 0.04087, 0], + "67": [0, 0.7, 0.1689, 0], + "68": [0, 0.7, 0.09371, 0], + "69": [0, 0.7, 0.18583, 0], + "70": [0, 0.7, 0.13634, 0], + "71": [0, 0.7, 0.17322, 0], + "72": [0, 0.7, 0.29694, 0], + "73": [0, 0.7, 0.19189, 0], + "74": [0.27778, 0.7, 0.19189, 0], + "75": [0, 0.7, 0.31259, 0], + "76": [0, 0.7, 0.19189, 0], + "77": [0, 0.7, 0.15981, 0], + "78": [0, 0.7, 0.3525, 0], + "79": [0, 0.7, 0.08078, 0], + "80": [0, 0.7, 0.08078, 0], + "81": [0, 0.7, 0.03305, 0], + "82": [0, 0.7, 0.06259, 0], + "83": [0, 0.7, 0.19189, 0], + "84": [0, 0.7, 0.29087, 0], + "85": [0, 0.7, 0.25815, 0], + "86": [0, 0.7, 0.27523, 0], + "87": [0, 0.7, 0.27523, 0], + "88": [0, 0.7, 0.26006, 0], + "89": [0, 0.7, 0.2939, 0], + "90": [0, 0.7, 0.24037, 0] + }, + "Size1-Regular": { + "40": [0.35001, 0.85, 0, 0], + "41": [0.35001, 0.85, 0, 0], + "47": [0.35001, 0.85, 0, 0], + "91": [0.35001, 0.85, 0, 0], + "92": [0.35001, 0.85, 0, 0], + "93": [0.35001, 0.85, 0, 0], + "123": [0.35001, 0.85, 0, 0], + "125": [0.35001, 0.85, 0, 0], + "710": [0, 0.72222, 0, 0], + "732": [0, 0.72222, 0, 0], + "770": [0, 0.72222, 0, 0], + "771": [0, 0.72222, 0, 0], + "8214": [-0.00099, 0.601, 0, 0], + "8593": [1e-05, 0.6, 0, 0], + "8595": [1e-05, 0.6, 0, 0], + "8657": [1e-05, 0.6, 0, 0], + "8659": [1e-05, 0.6, 0, 0], + "8719": [0.25001, 0.75, 0, 0], + "8720": [0.25001, 0.75, 0, 0], + "8721": [0.25001, 0.75, 0, 0], + "8730": [0.35001, 0.85, 0, 0], + "8739": [-0.00599, 0.606, 0, 0], + "8741": [-0.00599, 0.606, 0, 0], + "8747": [0.30612, 0.805, 0.19445, 0], + "8748": [0.306, 0.805, 0.19445, 0], + "8749": [0.306, 0.805, 0.19445, 0], + "8750": [0.30612, 0.805, 0.19445, 0], + "8896": [0.25001, 0.75, 0, 0], + "8897": [0.25001, 0.75, 0, 0], + "8898": [0.25001, 0.75, 0, 0], + "8899": [0.25001, 0.75, 0, 0], + "8968": [0.35001, 0.85, 0, 0], + "8969": [0.35001, 0.85, 0, 0], + "8970": [0.35001, 0.85, 0, 0], + "8971": [0.35001, 0.85, 0, 0], + "9168": [-0.00099, 0.601, 0, 0], + "10216": [0.35001, 0.85, 0, 0], + "10217": [0.35001, 0.85, 0, 0], + "10752": [0.25001, 0.75, 0, 0], + "10753": [0.25001, 0.75, 0, 0], + "10754": [0.25001, 0.75, 0, 0], + "10756": [0.25001, 0.75, 0, 0], + "10758": [0.25001, 0.75, 0, 0] + }, + "Size2-Regular": { + "40": [0.65002, 1.15, 0, 0], + "41": [0.65002, 1.15, 0, 0], + "47": [0.65002, 1.15, 0, 0], + "91": [0.65002, 1.15, 0, 0], + "92": [0.65002, 1.15, 0, 0], + "93": [0.65002, 1.15, 0, 0], + "123": [0.65002, 1.15, 0, 0], + "125": [0.65002, 1.15, 0, 0], + "710": [0, 0.75, 0, 0], + "732": [0, 0.75, 0, 0], + "770": [0, 0.75, 0, 0], + "771": [0, 0.75, 0, 0], + "8719": [0.55001, 1.05, 0, 0], + "8720": [0.55001, 1.05, 0, 0], + "8721": [0.55001, 1.05, 0, 0], + "8730": [0.65002, 1.15, 0, 0], + "8747": [0.86225, 1.36, 0.44445, 0], + "8748": [0.862, 1.36, 0.44445, 0], + "8749": [0.862, 1.36, 0.44445, 0], + "8750": [0.86225, 1.36, 0.44445, 0], + "8896": [0.55001, 1.05, 0, 0], + "8897": [0.55001, 1.05, 0, 0], + "8898": [0.55001, 1.05, 0, 0], + "8899": [0.55001, 1.05, 0, 0], + "8968": [0.65002, 1.15, 0, 0], + "8969": [0.65002, 1.15, 0, 0], + "8970": [0.65002, 1.15, 0, 0], + "8971": [0.65002, 1.15, 0, 0], + "10216": [0.65002, 1.15, 0, 0], + "10217": [0.65002, 1.15, 0, 0], + "10752": [0.55001, 1.05, 0, 0], + "10753": [0.55001, 1.05, 0, 0], + "10754": [0.55001, 1.05, 0, 0], + "10756": [0.55001, 1.05, 0, 0], + "10758": [0.55001, 1.05, 0, 0] + }, + "Size3-Regular": { + "40": [0.95003, 1.45, 0, 0], + "41": [0.95003, 1.45, 0, 0], + "47": [0.95003, 1.45, 0, 0], + "91": [0.95003, 1.45, 0, 0], + "92": [0.95003, 1.45, 0, 0], + "93": [0.95003, 1.45, 0, 0], + "123": [0.95003, 1.45, 0, 0], + "125": [0.95003, 1.45, 0, 0], + "710": [0, 0.75, 0, 0], + "732": [0, 0.75, 0, 0], + "770": [0, 0.75, 0, 0], + "771": [0, 0.75, 0, 0], + "8730": [0.95003, 1.45, 0, 0], + "8968": [0.95003, 1.45, 0, 0], + "8969": [0.95003, 1.45, 0, 0], + "8970": [0.95003, 1.45, 0, 0], + "8971": [0.95003, 1.45, 0, 0], + "10216": [0.95003, 1.45, 0, 0], + "10217": [0.95003, 1.45, 0, 0] + }, + "Size4-Regular": { + "40": [1.25003, 1.75, 0, 0], + "41": [1.25003, 1.75, 0, 0], + "47": [1.25003, 1.75, 0, 0], + "91": [1.25003, 1.75, 0, 0], + "92": [1.25003, 1.75, 0, 0], + "93": [1.25003, 1.75, 0, 0], + "123": [1.25003, 1.75, 0, 0], + "125": [1.25003, 1.75, 0, 0], + "710": [0, 0.825, 0, 0], + "732": [0, 0.825, 0, 0], + "770": [0, 0.825, 0, 0], + "771": [0, 0.825, 0, 0], + "8730": [1.25003, 1.75, 0, 0], + "8968": [1.25003, 1.75, 0, 0], + "8969": [1.25003, 1.75, 0, 0], + "8970": [1.25003, 1.75, 0, 0], + "8971": [1.25003, 1.75, 0, 0], + "9115": [0.64502, 1.155, 0, 0], + "9116": [1e-05, 0.6, 0, 0], + "9117": [0.64502, 1.155, 0, 0], + "9118": [0.64502, 1.155, 0, 0], + "9119": [1e-05, 0.6, 0, 0], + "9120": [0.64502, 1.155, 0, 0], + "9121": [0.64502, 1.155, 0, 0], + "9122": [-0.00099, 0.601, 0, 0], + "9123": [0.64502, 1.155, 0, 0], + "9124": [0.64502, 1.155, 0, 0], + "9125": [-0.00099, 0.601, 0, 0], + "9126": [0.64502, 1.155, 0, 0], + "9127": [1e-05, 0.9, 0, 0], + "9128": [0.65002, 1.15, 0, 0], + "9129": [0.90001, 0, 0, 0], + "9130": [0, 0.3, 0, 0], + "9131": [1e-05, 0.9, 0, 0], + "9132": [0.65002, 1.15, 0, 0], + "9133": [0.90001, 0, 0, 0], + "9143": [0.88502, 0.915, 0, 0], + "10216": [1.25003, 1.75, 0, 0], + "10217": [1.25003, 1.75, 0, 0], + "57344": [-0.00499, 0.605, 0, 0], + "57345": [-0.00499, 0.605, 0, 0], + "57680": [0, 0.12, 0, 0], + "57681": [0, 0.12, 0, 0], + "57682": [0, 0.12, 0, 0], + "57683": [0, 0.12, 0, 0] + }, + "Typewriter-Regular": { + "33": [0, 0.61111, 0, 0], + "34": [0, 0.61111, 0, 0], + "35": [0, 0.61111, 0, 0], + "36": [0.08333, 0.69444, 0, 0], + "37": [0.08333, 0.69444, 0, 0], + "38": [0, 0.61111, 0, 0], + "39": [0, 0.61111, 0, 0], + "40": [0.08333, 0.69444, 0, 0], + "41": [0.08333, 0.69444, 0, 0], + "42": [0, 0.52083, 0, 0], + "43": [-0.08056, 0.53055, 0, 0], + "44": [0.13889, 0.125, 0, 0], + "45": [-0.08056, 0.53055, 0, 0], + "46": [0, 0.125, 0, 0], + "47": [0.08333, 0.69444, 0, 0], + "48": [0, 0.61111, 0, 0], + "49": [0, 0.61111, 0, 0], + "50": [0, 0.61111, 0, 0], + "51": [0, 0.61111, 0, 0], + "52": [0, 0.61111, 0, 0], + "53": [0, 0.61111, 0, 0], + "54": [0, 0.61111, 0, 0], + "55": [0, 0.61111, 0, 0], + "56": [0, 0.61111, 0, 0], + "57": [0, 0.61111, 0, 0], + "58": [0, 0.43056, 0, 0], + "59": [0.13889, 0.43056, 0, 0], + "60": [-0.05556, 0.55556, 0, 0], + "61": [-0.19549, 0.41562, 0, 0], + "62": [-0.05556, 0.55556, 0, 0], + "63": [0, 0.61111, 0, 0], + "64": [0, 0.61111, 0, 0], + "65": [0, 0.61111, 0, 0], + "66": [0, 0.61111, 0, 0], + "67": [0, 0.61111, 0, 0], + "68": [0, 0.61111, 0, 0], + "69": [0, 0.61111, 0, 0], + "70": [0, 0.61111, 0, 0], + "71": [0, 0.61111, 0, 0], + "72": [0, 0.61111, 0, 0], + "73": [0, 0.61111, 0, 0], + "74": [0, 0.61111, 0, 0], + "75": [0, 0.61111, 0, 0], + "76": [0, 0.61111, 0, 0], + "77": [0, 0.61111, 0, 0], + "78": [0, 0.61111, 0, 0], + "79": [0, 0.61111, 0, 0], + "80": [0, 0.61111, 0, 0], + "81": [0.13889, 0.61111, 0, 0], + "82": [0, 0.61111, 0, 0], + "83": [0, 0.61111, 0, 0], + "84": [0, 0.61111, 0, 0], + "85": [0, 0.61111, 0, 0], + "86": [0, 0.61111, 0, 0], + "87": [0, 0.61111, 0, 0], + "88": [0, 0.61111, 0, 0], + "89": [0, 0.61111, 0, 0], + "90": [0, 0.61111, 0, 0], + "91": [0.08333, 0.69444, 0, 0], + "92": [0.08333, 0.69444, 0, 0], + "93": [0.08333, 0.69444, 0, 0], + "94": [0, 0.61111, 0, 0], + "95": [0.09514, 0, 0, 0], + "96": [0, 0.61111, 0, 0], + "97": [0, 0.43056, 0, 0], + "98": [0, 0.61111, 0, 0], + "99": [0, 0.43056, 0, 0], + "100": [0, 0.61111, 0, 0], + "101": [0, 0.43056, 0, 0], + "102": [0, 0.61111, 0, 0], + "103": [0.22222, 0.43056, 0, 0], + "104": [0, 0.61111, 0, 0], + "105": [0, 0.61111, 0, 0], + "106": [0.22222, 0.61111, 0, 0], + "107": [0, 0.61111, 0, 0], + "108": [0, 0.61111, 0, 0], + "109": [0, 0.43056, 0, 0], + "110": [0, 0.43056, 0, 0], + "111": [0, 0.43056, 0, 0], + "112": [0.22222, 0.43056, 0, 0], + "113": [0.22222, 0.43056, 0, 0], + "114": [0, 0.43056, 0, 0], + "115": [0, 0.43056, 0, 0], + "116": [0, 0.55358, 0, 0], + "117": [0, 0.43056, 0, 0], + "118": [0, 0.43056, 0, 0], + "119": [0, 0.43056, 0, 0], + "120": [0, 0.43056, 0, 0], + "121": [0.22222, 0.43056, 0, 0], + "122": [0, 0.43056, 0, 0], + "123": [0.08333, 0.69444, 0, 0], + "124": [0.08333, 0.69444, 0, 0], + "125": [0.08333, 0.69444, 0, 0], + "126": [0, 0.61111, 0, 0], + "127": [0, 0.61111, 0, 0], + "305": [0, 0.43056, 0, 0], + "567": [0.22222, 0.43056, 0, 0], + "768": [0, 0.61111, 0, 0], + "769": [0, 0.61111, 0, 0], + "770": [0, 0.61111, 0, 0], + "771": [0, 0.61111, 0, 0], + "772": [0, 0.56555, 0, 0], + "774": [0, 0.61111, 0, 0], + "776": [0, 0.61111, 0, 0], + "778": [0, 0.61111, 0, 0], + "780": [0, 0.56597, 0, 0], + "915": [0, 0.61111, 0, 0], + "916": [0, 0.61111, 0, 0], + "920": [0, 0.61111, 0, 0], + "923": [0, 0.61111, 0, 0], + "926": [0, 0.61111, 0, 0], + "928": [0, 0.61111, 0, 0], + "931": [0, 0.61111, 0, 0], + "933": [0, 0.61111, 0, 0], + "934": [0, 0.61111, 0, 0], + "936": [0, 0.61111, 0, 0], + "937": [0, 0.61111, 0, 0], + "2018": [0, 0.61111, 0, 0], + "2019": [0, 0.61111, 0, 0], + "8242": [0, 0.61111, 0, 0] + } +}; + +},{}],43:[function(require,module,exports){ +"use strict"; + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +var _ParseError = require("./ParseError"); + +var _ParseError2 = _interopRequireDefault(_ParseError); + +var _ParseNode = require("./ParseNode"); + +var _ParseNode2 = _interopRequireDefault(_ParseNode); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/* This file contains a list of functions that we parse, identified by + * the calls to defineFunction. + * + * The first argument to defineFunction is a single name or a list of names. + * All functions named in such a list will share a single implementation. + * + * Each declared function can have associated properties, which + * include the following: + * + * - numArgs: The number of arguments the function takes. + * If this is the only property, it can be passed as a number + * instead of an element of a properties object. + * - argTypes: (optional) An array corresponding to each argument of the + * function, giving the type of argument that should be parsed. Its + * length should be equal to `numArgs + numOptionalArgs`. Valid + * types: + * - "size": A size-like thing, such as "1em" or "5ex" + * - "color": An html color, like "#abc" or "blue" + * - "original": The same type as the environment that the + * function being parsed is in (e.g. used for the + * bodies of functions like \textcolor where the + * first argument is special and the second + * argument is parsed normally) + * Other possible types (probably shouldn't be used) + * - "text": Text-like (e.g. \text) + * - "math": Normal math + * If undefined, this will be treated as an appropriate length + * array of "original" strings + * - greediness: (optional) The greediness of the function to use ungrouped + * arguments. + * + * E.g. if you have an expression + * \sqrt \frac 1 2 + * since \frac has greediness=2 vs \sqrt's greediness=1, \frac + * will use the two arguments '1' and '2' as its two arguments, + * then that whole function will be used as the argument to + * \sqrt. On the other hand, the expressions + * \frac \frac 1 2 3 + * and + * \frac \sqrt 1 2 + * will fail because \frac and \frac have equal greediness + * and \sqrt has a lower greediness than \frac respectively. To + * make these parse, we would have to change them to: + * \frac {\frac 1 2} 3 + * and + * \frac {\sqrt 1} 2 + * + * The default value is `1` + * - allowedInText: (optional) Whether or not the function is allowed inside + * text mode (default false) + * - numOptionalArgs: (optional) The number of optional arguments the function + * should parse. If the optional arguments aren't found, + * `null` will be passed to the handler in their place. + * (default 0) + * - infix: (optional) Must be true if the function is an infix operator. + * + * The last argument is that implementation, the handler for the function(s). + * It is called to handle these functions and their arguments. + * It receives two arguments: + * - context contains information and references provided by the parser + * - args is an array of arguments obtained from TeX input + * The context contains the following properties: + * - funcName: the text (i.e. name) of the function, including \ + * - parser: the parser object + * - lexer: the lexer object + * - positions: the positions in the overall string of the function + * and the arguments. + * The latter three should only be used to produce error messages. + * + * The function should return an object with the following keys: + * - type: The type of element that this is. This is then used in + * buildHTML/buildMathML to determine which function + * should be called to build this node into a DOM node + * Any other data can be added to the object, which will be passed + * in to the function in buildHTML/buildMathML as `group.value`. + */ + +function defineFunction(names, props, handler) { + if (typeof names === "string") { + names = [names]; + } + if (typeof props === "number") { + props = { numArgs: props }; + } + // Set default values of functions + var data = { + numArgs: props.numArgs, + argTypes: props.argTypes, + greediness: props.greediness === undefined ? 1 : props.greediness, + allowedInText: !!props.allowedInText, + allowedInMath: props.allowedInMath, + numOptionalArgs: props.numOptionalArgs || 0, + infix: !!props.infix, + handler: handler + }; + for (var i = 0; i < names.length; ++i) { + module.exports[names[i]] = data; + } +} + +// Since the corresponding buildHTML/buildMathML function expects a +// list of elements, we normalize for different kinds of arguments +var ordargument = function ordargument(arg) { + if (arg.type === "ordgroup") { + return arg.value; + } else { + return [arg]; + } +}; + +// A normal square root +defineFunction("\\sqrt", { + numArgs: 1, + numOptionalArgs: 1 +}, function (context, args) { + var index = args[0]; + var body = args[1]; + return { + type: "sqrt", + body: body, + index: index + }; +}); + +// Non-mathy text, possibly in a font +var textFunctionStyles = { + "\\text": undefined, "\\textrm": "mathrm", "\\textsf": "mathsf", + "\\texttt": "mathtt", "\\textnormal": "mathrm", "\\textbf": "mathbf", + "\\textit": "textit" +}; + +defineFunction(["\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal", "\\textbf", "\\textit"], { + numArgs: 1, + argTypes: ["text"], + greediness: 2, + allowedInText: true +}, function (context, args) { + var body = args[0]; + return { + type: "text", + body: ordargument(body), + style: textFunctionStyles[context.funcName] + }; +}); + +// A two-argument custom color +defineFunction("\\textcolor", { + numArgs: 2, + allowedInText: true, + greediness: 3, + argTypes: ["color", "original"] +}, function (context, args) { + var color = args[0]; + var body = args[1]; + return { + type: "color", + color: color.value, + value: ordargument(body) + }; +}); + +// \color is handled in Parser.js's parseImplicitGroup +defineFunction("\\color", { + numArgs: 1, + allowedInText: true, + greediness: 3, + argTypes: ["color"] +}, null); + +// An overline +defineFunction("\\overline", { + numArgs: 1 +}, function (context, args) { + var body = args[0]; + return { + type: "overline", + body: body + }; +}); + +// An underline +defineFunction("\\underline", { + numArgs: 1 +}, function (context, args) { + var body = args[0]; + return { + type: "underline", + body: body + }; +}); + +// A box of the width and height +defineFunction("\\rule", { + numArgs: 2, + numOptionalArgs: 1, + argTypes: ["size", "size", "size"] +}, function (context, args) { + var shift = args[0]; + var width = args[1]; + var height = args[2]; + return { + type: "rule", + shift: shift && shift.value, + width: width.value, + height: height.value + }; +}); + +// TODO: In TeX, \mkern only accepts mu-units, and \kern does not accept +// mu-units. In current KaTeX we relax this; both commands accept any unit. +defineFunction(["\\kern", "\\mkern"], { + numArgs: 1, + argTypes: ["size"] +}, function (context, args) { + return { + type: "kern", + dimension: args[0].value + }; +}); + +// A KaTeX logo +defineFunction("\\KaTeX", { + numArgs: 0 +}, function (context) { + return { + type: "katex" + }; +}); + +defineFunction("\\phantom", { + numArgs: 1 +}, function (context, args) { + var body = args[0]; + return { + type: "phantom", + value: ordargument(body) + }; +}); + +// Math class commands except \mathop +defineFunction(["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"], { + numArgs: 1 +}, function (context, args) { + var body = args[0]; + return { + type: "mclass", + mclass: "m" + context.funcName.substr(5), + value: ordargument(body) + }; +}); + +// Build a relation by placing one symbol on top of another +defineFunction("\\stackrel", { + numArgs: 2 +}, function (context, args) { + var top = args[0]; + var bottom = args[1]; + + var bottomop = new _ParseNode2.default("op", { + type: "op", + limits: true, + alwaysHandleSupSub: true, + symbol: false, + value: ordargument(bottom) + }, bottom.mode); + + var supsub = new _ParseNode2.default("supsub", { + base: bottomop, + sup: top, + sub: null + }, top.mode); + + return { + type: "mclass", + mclass: "mrel", + value: [supsub] + }; +}); + +// \mod-type functions +defineFunction("\\bmod", { + numArgs: 0 +}, function (context, args) { + return { + type: "mod", + modType: "bmod", + value: null + }; +}); + +defineFunction(["\\pod", "\\pmod", "\\mod"], { + numArgs: 1 +}, function (context, args) { + var body = args[0]; + return { + type: "mod", + modType: context.funcName.substr(1), + value: ordargument(body) + }; +}); + +// Extra data needed for the delimiter handler down below +var delimiterSizes = { + "\\bigl": { mclass: "mopen", size: 1 }, + "\\Bigl": { mclass: "mopen", size: 2 }, + "\\biggl": { mclass: "mopen", size: 3 }, + "\\Biggl": { mclass: "mopen", size: 4 }, + "\\bigr": { mclass: "mclose", size: 1 }, + "\\Bigr": { mclass: "mclose", size: 2 }, + "\\biggr": { mclass: "mclose", size: 3 }, + "\\Biggr": { mclass: "mclose", size: 4 }, + "\\bigm": { mclass: "mrel", size: 1 }, + "\\Bigm": { mclass: "mrel", size: 2 }, + "\\biggm": { mclass: "mrel", size: 3 }, + "\\Biggm": { mclass: "mrel", size: 4 }, + "\\big": { mclass: "mord", size: 1 }, + "\\Big": { mclass: "mord", size: 2 }, + "\\bigg": { mclass: "mord", size: 3 }, + "\\Bigg": { mclass: "mord", size: 4 } +}; + +var delimiters = ["(", ")", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\\lceil", "\\rceil", "<", ">", "\\langle", "\\rangle", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\\lmoustache", "\\rmoustache", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."]; + +var fontAliases = { + "\\Bbb": "\\mathbb", + "\\bold": "\\mathbf", + "\\frak": "\\mathfrak" +}; + +// Single-argument color functions +defineFunction(["\\blue", "\\orange", "\\pink", "\\red", "\\green", "\\gray", "\\purple", "\\blueA", "\\blueB", "\\blueC", "\\blueD", "\\blueE", "\\tealA", "\\tealB", "\\tealC", "\\tealD", "\\tealE", "\\greenA", "\\greenB", "\\greenC", "\\greenD", "\\greenE", "\\goldA", "\\goldB", "\\goldC", "\\goldD", "\\goldE", "\\redA", "\\redB", "\\redC", "\\redD", "\\redE", "\\maroonA", "\\maroonB", "\\maroonC", "\\maroonD", "\\maroonE", "\\purpleA", "\\purpleB", "\\purpleC", "\\purpleD", "\\purpleE", "\\mintA", "\\mintB", "\\mintC", "\\grayA", "\\grayB", "\\grayC", "\\grayD", "\\grayE", "\\grayF", "\\grayG", "\\grayH", "\\grayI", "\\kaBlue", "\\kaGreen"], { + numArgs: 1, + allowedInText: true, + greediness: 3 +}, function (context, args) { + var body = args[0]; + return { + type: "color", + color: "katex-" + context.funcName.slice(1), + value: ordargument(body) + }; +}); + +// There are 2 flags for operators; whether they produce limits in +// displaystyle, and whether they are symbols and should grow in +// displaystyle. These four groups cover the four possible choices. + +// No limits, not symbols +defineFunction(["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"], { + numArgs: 0 +}, function (context) { + return { + type: "op", + limits: false, + symbol: false, + body: context.funcName + }; +}); + +// Limits, not symbols +defineFunction(["\\det", "\\gcd", "\\inf", "\\lim", "\\liminf", "\\limsup", "\\max", "\\min", "\\Pr", "\\sup"], { + numArgs: 0 +}, function (context) { + return { + type: "op", + limits: true, + symbol: false, + body: context.funcName + }; +}); + +// No limits, symbols +defineFunction(["\\int", "\\iint", "\\iiint", "\\oint"], { + numArgs: 0 +}, function (context) { + return { + type: "op", + limits: false, + symbol: true, + body: context.funcName + }; +}); + +// Limits, symbols +defineFunction(["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint"], { + numArgs: 0 +}, function (context) { + return { + type: "op", + limits: true, + symbol: true, + body: context.funcName + }; +}); + +// \mathop class command +defineFunction("\\mathop", { + numArgs: 1 +}, function (context, args) { + var body = args[0]; + return { + type: "op", + limits: false, + symbol: false, + value: ordargument(body) + }; +}); + +// Fractions +defineFunction(["\\dfrac", "\\frac", "\\tfrac", "\\dbinom", "\\binom", "\\tbinom", "\\\\atopfrac"], { + numArgs: 2, + greediness: 2 +}, function (context, args) { + var numer = args[0]; + var denom = args[1]; + var hasBarLine = void 0; + var leftDelim = null; + var rightDelim = null; + var size = "auto"; + + switch (context.funcName) { + case "\\dfrac": + case "\\frac": + case "\\tfrac": + hasBarLine = true; + break; + case "\\\\atopfrac": + hasBarLine = false; + break; + case "\\dbinom": + case "\\binom": + case "\\tbinom": + hasBarLine = false; + leftDelim = "("; + rightDelim = ")"; + break; + default: + throw new Error("Unrecognized genfrac command"); + } + + switch (context.funcName) { + case "\\dfrac": + case "\\dbinom": + size = "display"; + break; + case "\\tfrac": + case "\\tbinom": + size = "text"; + break; + } + + return { + type: "genfrac", + numer: numer, + denom: denom, + hasBarLine: hasBarLine, + leftDelim: leftDelim, + rightDelim: rightDelim, + size: size + }; +}); + +// Left and right overlap functions +defineFunction(["\\llap", "\\rlap"], { + numArgs: 1, + allowedInText: true +}, function (context, args) { + var body = args[0]; + return { + type: context.funcName.slice(1), + body: body + }; +}); + +// Delimiter functions +var checkDelimiter = function checkDelimiter(delim, context) { + if (_utils2.default.contains(delimiters, delim.value)) { + return delim; + } else { + throw new _ParseError2.default("Invalid delimiter: '" + delim.value + "' after '" + context.funcName + "'", delim); + } +}; + +defineFunction(["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"], { + numArgs: 1 +}, function (context, args) { + var delim = checkDelimiter(args[0], context); + + return { + type: "delimsizing", + size: delimiterSizes[context.funcName].size, + mclass: delimiterSizes[context.funcName].mclass, + value: delim.value + }; +}); + +defineFunction(["\\left", "\\right"], { + numArgs: 1 +}, function (context, args) { + var delim = checkDelimiter(args[0], context); + + // \left and \right are caught somewhere in Parser.js, which is + // why this data doesn't match what is in buildHTML. + return { + type: "leftright", + value: delim.value + }; +}); + +defineFunction("\\middle", { + numArgs: 1 +}, function (context, args) { + var delim = checkDelimiter(args[0], context); + if (!context.parser.leftrightDepth) { + throw new _ParseError2.default("\\middle without preceding \\left", delim); + } + + return { + type: "middle", + value: delim.value + }; +}); + +// Sizing functions (handled in Parser.js explicitly, hence no handler) +defineFunction(["\\tiny", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], 0, null); + +// Style changing functions (handled in Parser.js explicitly, hence no +// handler) +defineFunction(["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"], 0, null); + +// Old font changing functions +defineFunction(["\\rm", "\\sf", "\\tt", "\\bf", "\\it"], 0, null); + +defineFunction([ +// styles +"\\mathrm", "\\mathit", "\\mathbf", + +// families +"\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf", "\\mathtt", + +// aliases +"\\Bbb", "\\bold", "\\frak"], { + numArgs: 1, + greediness: 2 +}, function (context, args) { + var body = args[0]; + var func = context.funcName; + if (func in fontAliases) { + func = fontAliases[func]; + } + return { + type: "font", + font: func.slice(1), + body: body + }; +}); + +// Accents +defineFunction(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"], { + numArgs: 1 +}, function (context, args) { + var base = args[0]; + + var isStretchy = !_utils2.default.contains(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot"], context.funcName); + + var isShifty = !isStretchy || _utils2.default.contains(["\\widehat", "\\widetilde"], context.funcName); + + return { + type: "accent", + label: context.funcName, + isStretchy: isStretchy, + isShifty: isShifty, + value: ordargument(base), + base: base + }; +}); + +// Text-mode accents +defineFunction(["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\r", "\\H", "\\v"], { + numArgs: 1, + allowedInText: true, + allowedInMath: false +}, function (context, args) { + var base = args[0]; + + return { + type: "accent", + label: context.funcName, + isStretchy: false, + isShifty: true, + value: ordargument(base), + base: base + }; +}); + +// Horizontal stretchy braces +defineFunction(["\\overbrace", "\\underbrace"], { + numArgs: 1 +}, function (context, args) { + var base = args[0]; + return { + type: "horizBrace", + label: context.funcName, + isOver: /^\\over/.test(context.funcName), + base: base + }; +}); + +// Stretchy accents under the body +defineFunction(["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\undertilde"], { + numArgs: 1 +}, function (context, args) { + var body = args[0]; + return { + type: "accentUnder", + label: context.funcName, + value: ordargument(body), + body: body + }; +}); + +// Stretchy arrows with an optional argument +defineFunction(["\\xleftarrow", "\\xrightarrow", "\\xLeftarrow", "\\xRightarrow", "\\xleftrightarrow", "\\xLeftrightarrow", "\\xhookleftarrow", "\\xhookrightarrow", "\\xmapsto", "\\xrightharpoondown", "\\xrightharpoonup", "\\xleftharpoondown", "\\xleftharpoonup", "\\xrightleftharpoons", "\\xleftrightharpoons", "\\xLongequal", "\\xtwoheadrightarrow", "\\xtwoheadleftarrow", "\\xLongequal", "\\xtofrom"], { + numArgs: 1, + numOptionalArgs: 1 +}, function (context, args) { + var below = args[0]; + var body = args[1]; + return { + type: "xArrow", // x for extensible + label: context.funcName, + body: body, + below: below + }; +}); + +// enclose +defineFunction(["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\fbox"], { + numArgs: 1 +}, function (context, args) { + var body = args[0]; + return { + type: "enclose", + label: context.funcName, + body: body + }; +}); + +// Infix generalized fractions +defineFunction(["\\over", "\\choose", "\\atop"], { + numArgs: 0, + infix: true +}, function (context) { + var replaceWith = void 0; + switch (context.funcName) { + case "\\over": + replaceWith = "\\frac"; + break; + case "\\choose": + replaceWith = "\\binom"; + break; + case "\\atop": + replaceWith = "\\\\atopfrac"; + break; + default: + throw new Error("Unrecognized infix genfrac command"); + } + return { + type: "infix", + replaceWith: replaceWith, + token: context.token + }; +}); + +// Row breaks for aligned data +defineFunction(["\\\\", "\\cr"], { + numArgs: 0, + numOptionalArgs: 1, + argTypes: ["size"] +}, function (context, args) { + var size = args[0]; + return { + type: "cr", + size: size + }; +}); + +// Environment delimiters +defineFunction(["\\begin", "\\end"], { + numArgs: 1, + argTypes: ["text"] +}, function (context, args) { + var nameGroup = args[0]; + if (nameGroup.type !== "ordgroup") { + throw new _ParseError2.default("Invalid environment name", nameGroup); + } + var name = ""; + for (var i = 0; i < nameGroup.value.length; ++i) { + name += nameGroup.value[i].value; + } + return { + type: "environment", + name: name, + nameGroup: nameGroup + }; +}); + +},{"./ParseError":29,"./ParseNode":30,"./utils":51}],44:[function(require,module,exports){ +"use strict"; + +/** + * Predefined macros for KaTeX. + * This can be used to define some commands in terms of others. + */ + +// This function might one day accept additional argument and do more things. +function defineMacro(name, body) { + module.exports[name] = body; +} + +////////////////////////////////////////////////////////////////////// +// basics +defineMacro("\\bgroup", "{"); +defineMacro("\\egroup", "}"); +defineMacro("\\begingroup", "{"); +defineMacro("\\endgroup", "}"); + +// We don't distinguish between math and nonmath kerns. +// (In TeX, the mu unit works only with \mkern.) +defineMacro("\\mkern", "\\kern"); + +////////////////////////////////////////////////////////////////////// +// amsmath.sty + +// \def\overset#1#2{\binrel@{#2}\binrel@@{\mathop{\kern\z@#2}\limits^{#1}}} +defineMacro("\\overset", "\\mathop{#2}\\limits^{#1}"); +defineMacro("\\underset", "\\mathop{#2}\\limits_{#1}"); + +// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}} +defineMacro("\\boxed", "\\fbox{\\displaystyle{#1}}"); + +//TODO: When implementing \dots, should ideally add the \DOTSB indicator +// into the macro, to indicate these are binary operators. +// \def\iff{\DOTSB\;\Longleftrightarrow\;} +// \def\implies{\DOTSB\;\Longrightarrow\;} +// \def\impliedby{\DOTSB\;\Longleftarrow\;} +defineMacro("\\iff", "\\;\\Longleftrightarrow\\;"); +defineMacro("\\implies", "\\;\\Longrightarrow\\;"); +defineMacro("\\impliedby", "\\;\\Longleftarrow\\;"); + +////////////////////////////////////////////////////////////////////// +// mathtools.sty + +//\providecommand\ordinarycolon{:} +defineMacro("\\ordinarycolon", ":"); +//\def\vcentcolon{\mathrel{\mathop\ordinarycolon}} +//TODO(edemaine): Not yet centered. Fix via \raisebox or #726 +defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}"); +// \providecommand*\dblcolon{\vcentcolon\mathrel{\mkern-.9mu}\vcentcolon} +defineMacro("\\dblcolon", "\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon"); +// \providecommand*\coloneqq{\vcentcolon\mathrel{\mkern-1.2mu}=} +defineMacro("\\coloneqq", "\\vcentcolon\\mathrel{\\mkern-1.2mu}="); +// \providecommand*\Coloneqq{\dblcolon\mathrel{\mkern-1.2mu}=} +defineMacro("\\Coloneqq", "\\dblcolon\\mathrel{\\mkern-1.2mu}="); +// \providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}} +defineMacro("\\coloneq", "\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}"); +// \providecommand*\Coloneq{\dblcolon\mathrel{\mkern-1.2mu}\mathrel{-}} +defineMacro("\\Coloneq", "\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}"); +// \providecommand*\eqqcolon{=\mathrel{\mkern-1.2mu}\vcentcolon} +defineMacro("\\eqqcolon", "=\\mathrel{\\mkern-1.2mu}\\vcentcolon"); +// \providecommand*\Eqqcolon{=\mathrel{\mkern-1.2mu}\dblcolon} +defineMacro("\\Eqqcolon", "=\\mathrel{\\mkern-1.2mu}\\dblcolon"); +// \providecommand*\eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\vcentcolon} +defineMacro("\\eqcolon", "\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon"); +// \providecommand*\Eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\dblcolon} +defineMacro("\\Eqcolon", "\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon"); +// \providecommand*\colonapprox{\vcentcolon\mathrel{\mkern-1.2mu}\approx} +defineMacro("\\colonapprox", "\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx"); +// \providecommand*\Colonapprox{\dblcolon\mathrel{\mkern-1.2mu}\approx} +defineMacro("\\Colonapprox", "\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx"); +// \providecommand*\colonsim{\vcentcolon\mathrel{\mkern-1.2mu}\sim} +defineMacro("\\colonsim", "\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim"); +// \providecommand*\Colonsim{\dblcolon\mathrel{\mkern-1.2mu}\sim} +defineMacro("\\Colonsim", "\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim"); + +////////////////////////////////////////////////////////////////////// +// colonequals.sty + +// Alternate names for mathtools's macros: +defineMacro("\\ratio", "\\vcentcolon"); +defineMacro("\\coloncolon", "\\dblcolon"); +defineMacro("\\colonequals", "\\coloneqq"); +defineMacro("\\coloncolonequals", "\\Coloneqq"); +defineMacro("\\equalscolon", "\\eqqcolon"); +defineMacro("\\equalscoloncolon", "\\Eqqcolon"); +defineMacro("\\colonminus", "\\coloneq"); +defineMacro("\\coloncolonminus", "\\Coloneq"); +defineMacro("\\minuscolon", "\\eqcolon"); +defineMacro("\\minuscoloncolon", "\\Eqcolon"); +// \colonapprox name is same in mathtools and colonequals. +defineMacro("\\coloncolonapprox", "\\Colonapprox"); +// \colonsim name is same in mathtools and colonequals. +defineMacro("\\coloncolonsim", "\\Colonsim"); + +// Additional macros, implemented by analogy with mathtools definitions: +defineMacro("\\simcolon", "\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon"); +defineMacro("\\simcoloncolon", "\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon"); +defineMacro("\\approxcolon", "\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon"); +defineMacro("\\approxcoloncolon", "\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon"); + +},{}],45:[function(require,module,exports){ +"use strict"; + +var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck"); + +var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); + +var _createClass2 = require("babel-runtime/helpers/createClass"); + +var _createClass3 = _interopRequireDefault(_createClass2); + +var _utils = require("./utils"); + +var _utils2 = _interopRequireDefault(_utils); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * This node represents a general purpose MathML node of any type. The + * constructor requires the type of node to create (for example, `"mo"` or + * `"mspace"`, corresponding to `` and `` tags). + */ +var MathNode = function () { + function MathNode(type, children) { + (0, _classCallCheck3.default)(this, MathNode); + + this.type = type; + this.attributes = {}; + this.children = children || []; + } + + /** + * Sets an attribute on a MathML node. MathML depends on attributes to convey a + * semantic content, so this is used heavily. + */ + + + (0, _createClass3.default)(MathNode, [{ + key: "setAttribute", + value: function setAttribute(name, value) { + this.attributes[name] = value; + } + + /** + * Converts the math node into a MathML-namespaced DOM element. + */ + + }, { + key: "toNode", + value: function toNode() { + var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type); + + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + node.setAttribute(attr, this.attributes[attr]); + } + } + + for (var i = 0; i < this.children.length; i++) { + node.appendChild(this.children[i].toNode()); + } + + return node; + } + + /** + * Converts the math node into an HTML markup string. + */ + + }, { + key: "toMarkup", + value: function toMarkup() { + var markup = "<" + this.type; + + // Add the attributes + for (var attr in this.attributes) { + if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) { + markup += " " + attr + "=\""; + markup += _utils2.default.escape(this.attributes[attr]); + markup += "\""; + } + } + + markup += ">"; + + for (var i = 0; i < this.children.length; i++) { + markup += this.children[i].toMarkup(); + } + + markup += ""; + + return markup; + } + }]); + return MathNode; +}(); + +/** + * This node represents a piece of text. + */ +/** + * These objects store data about MathML nodes. This is the MathML equivalent + * of the types in domTree.js. Since MathML handles its own rendering, and + * since we're mainly using MathML to improve accessibility, we don't manage + * any of the styling state that the plain DOM nodes do. + * + * The `toNode` and `toMarkup` functions work simlarly to how they do in + * domTree.js, creating namespaced DOM nodes and HTML text markup respectively. + */ + +var TextNode = function () { + function TextNode(text) { + (0, _classCallCheck3.default)(this, TextNode); + + this.text = text; + } + + /** + * Converts the text node into a DOM text node. + */ + + + (0, _createClass3.default)(TextNode, [{ + key: "toNode", + value: function toNode() { + return document.createTextNode(this.text); + } + + /** + * Converts the text node into HTML markup (which is just the text itself). + */ + + }, { + key: "toMarkup", + value: function toMarkup() { + return _utils2.default.escape(this.text); + } + }]); + return TextNode; +}(); + +module.exports = { + MathNode: MathNode, + TextNode: TextNode +}; + +},{"./utils":51,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],46:[function(require,module,exports){ +'use strict'; + +var _Parser = require('./Parser'); + +var _Parser2 = _interopRequireDefault(_Parser); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Parses an expression using a Parser, then returns the parsed result. + */ +var parseTree = function parseTree(toParse, settings) { + if (!(typeof toParse === 'string' || toParse instanceof String)) { + throw new TypeError('KaTeX can only parse string typed expression'); + } + var parser = new _Parser2.default(toParse, settings); + + return parser.parse(); +}; /** + * Provides a single function for parsing an expression using a Parser + * TODO(emily): Remove this + */ + +module.exports = parseTree; + +},{"./Parser":31}],47:[function(require,module,exports){ +"use strict"; + +/** + * This file provides support to buildMathML.js and buildHTML.js + * for stretchy wide elements rendered from SVG files + * and other CSS trickery. + */ + +var buildCommon = require("./buildCommon"); +var mathMLTree = require("./mathMLTree"); +var utils = require("./utils"); + +var stretchyCodePoint = { + widehat: "^", + widetilde: "~", + undertilde: "~", + overleftarrow: "\u2190", + underleftarrow: "\u2190", + xleftarrow: "\u2190", + overrightarrow: "\u2192", + underrightarrow: "\u2192", + xrightarrow: "\u2192", + underbrace: "\u23B5", + overbrace: "\u23DE", + overleftrightarrow: "\u2194", + underleftrightarrow: "\u2194", + xleftrightarrow: "\u2194", + Overrightarrow: "\u21D2", + xRightarrow: "\u21D2", + overleftharpoon: "\u21BC", + xleftharpoonup: "\u21BC", + overrightharpoon: "\u21C0", + xrightharpoonup: "\u21C0", + xLeftarrow: "\u21D0", + xLeftrightarrow: "\u21D4", + xhookleftarrow: "\u21A9", + xhookrightarrow: "\u21AA", + xmapsto: "\u21A6", + xrightharpoondown: "\u21C1", + xleftharpoondown: "\u21BD", + xrightleftharpoons: "\u21CC", + xleftrightharpoons: "\u21CB", + xtwoheadleftarrow: "\u219E", + xtwoheadrightarrow: "\u21A0", + xLongequal: "=", + xtofrom: "\u21C4" +}; + +var mathMLnode = function mathMLnode(label) { + var node = new mathMLTree.MathNode("mo", [new mathMLTree.TextNode(stretchyCodePoint[label.substr(1)])]); + node.setAttribute("stretchy", "true"); + return node; +}; + +// In the katexImagesData object just below, the dimensions all +// correspond to path geometry inside the relevant SVG. +// For example, \rightarrow uses the same arrowhead as glyph U+2192 +// from the KaTeX Main font. The scaling factor is 1000. +// That is, inside the font, that arrowhead is 522 units tall, which +// corresponds to 0.522 em inside the document. +// And for extensible arrows, we split that distance around the math axis. + +var katexImagesData = { + // height, depth, imageName, minWidth + overleftarrow: [0.522, 0, "leftarrow", 0.5], + underleftarrow: [0.522, 0, "leftarrow", 0.5], + xleftarrow: [0.261, 0.261, "leftarrow", 0.783], + overrightarrow: [0.522, 0, "rightarrow", 0.5], + underrightarrow: [0.522, 0, "rightarrow", 0.5], + xrightarrow: [0.261, 0.261, "rightarrow", 0.783], + overbrace: [0.548, 0, "overbrace", 1.6], + underbrace: [0.548, 0, "underbrace", 1.6], + overleftrightarrow: [0.522, 0, "leftrightarrow", 0.5], + underleftrightarrow: [0.522, 0, "leftrightarrow", 0.5], + xleftrightarrow: [0.261, 0.261, "leftrightarrow", 0.783], + Overrightarrow: [0.56, 0, "doublerightarrow", 0.5], + xLeftarrow: [0.28, 0.28, "doubleleftarrow", 0.783], + xRightarrow: [0.28, 0.28, "doublerightarrow", 0.783], + xLeftrightarrow: [0.28, 0.28, "doubleleftrightarrow", 0.955], + overleftharpoon: [0.522, 0, "leftharpoon", 0.5], + overrightharpoon: [0.522, 0, "rightharpoon", 0.5], + xleftharpoonup: [0.261, 0.261, "leftharpoon", 0.783], + xrightharpoonup: [0.261, 0.261, "rightharpoon", 0.783], + xhookleftarrow: [0.261, 0.261, "hookleftarrow", 0.87], + xhookrightarrow: [0.261, 0.261, "hookrightarrow", 0.87], + overlinesegment: [0.414, 0, "linesegment", 0.5], + underlinesegment: [0.414, 0, "linesegment", 0.5], + xmapsto: [0.261, 0.261, "mapsto", 0.783], + xrightharpoondown: [0.261, 0.261, "rightharpoondown", 0.783], + xleftharpoondown: [0.261, 0.261, "leftharpoondown", 0.783], + xrightleftharpoons: [0.358, 0.358, "rightleftharpoons", 0.716], + xleftrightharpoons: [0.358, 0.358, "leftrightharpoons", 0.716], + overgroup: [0.342, 0, "overgroup", 0.87], + undergroup: [0.342, 0, "undergroup", 0.87], + xtwoheadleftarrow: [0.167, 0.167, "twoheadleftarrow", 0.86], + xtwoheadrightarrow: [0.167, 0.167, "twoheadrightarrow", 0.86], + xLongequal: [0.167, 0.167, "longequal", 0.5], + xtofrom: [0.264, 0.264, "tofrom", 0.86] +}; + +// Many of the KaTeX SVG images have been adapted from glyphs in KaTeX fonts. +// Copyright (c) 2009-2010, Design Science, Inc. () +// Copyright (c) 2014-2017 Khan Academy () +// Licensed under the SIL Open Font License, Version 1.1. +// See \nhttp://scripts.sil.org/OFL + +// Nested SVGs +// Many of the KaTeX SVG images contain a nested SVG. This is done to +// achieve a stretchy image while avoiding distortion of arrowheads or +// brace corners. + +// The inner SVG typically contains a very long (400 em) arrow. + +// The outer SVG acts like a window that exposes only part of the inner SVG. +// The outer SVG will grow or shrink to match the dimensions set by CSS. + +// The inner SVG always has a longer, thinner aspect ratio than the outer +// SVG. After the inner SVG fills 100% of the height of the outer SVG, +// there is a long arrow shaft left over. That left-over shaft is not shown. +// Instead, it is sliced off because the inner SVG is set to +// "preserveAspectRatio='... slice'". + +// Thus, the reader sees an arrow that matches the subject matter width +// without distortion. + +// Some functions, such as \cancel, need to vary their aspect ratio. These +// functions do not get the nested SVG treatment. + +// Second Brush Stroke +// Low resolution monitors struggle to display images in fine detail. +// So browsers apply anti-aliasing. A long straight arrow shaft therefore +// will sometimes appear as if it has a blurred edge. + +// To mitigate this, these SVG files contain a second "brush-stroke" on the +// arrow shafts. That is, a second long thin rectangular SVG path has been +// written directly on top of each arrow shaft. This reinforcement causes +// some of the screen pixels to display as black instead of the anti-aliased +// gray pixel that a single path would generate. So we get arrow shafts +// whose edges appear to be sharper. + +var svgPath = { + doubleleftarrow: "", + + doublerightarrow: "", + + leftarrow: "", + + rightarrow: "" +}; + +var innerSVG = { + // Since bcancel's SVG is inline and it omits the viewBox attribute, + // it's stroke-width will not vary with span area. + bcancel: "", + + cancel: "", + + // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main + doubleleftarrow: ">" + svgPath["doubleleftarrow"] + "", + + // doubleleftrightarrow is from glyph U+21D4 in font KaTeX Main + doubleleftrightarrow: ">" + svgPath["doubleleftarrow"] + "\n" + svgPath["doublerightarrow"] + "", + + // doublerightarrow is from glyph U+21D2 in font KaTeX Main + doublerightarrow: ">" + svgPath["doublerightarrow"] + "", + + // hookleftarrow is from glyph U+21A9 in font KaTeX Main + hookleftarrow: ">" + svgPath["leftarrow"] + "\n", + + // hookrightarrow is from glyph U+21AA in font KaTeX Main + hookrightarrow: ">" + svgPath["rightarrow"] + "", + + // leftarrow is from glyph U+2190 in font KaTeX Main + leftarrow: ">" + svgPath["leftarrow"] + "", + + // leftharpoon is from glyph U+21BD in font KaTeX Main + leftharpoon: ">", + + // leftharpoondown is from glyph U+21BD in font KaTeX Main + leftharpoondown: ">", + + // leftrightarrow is from glyph U+2194 in font KaTeX Main + leftrightarrow: ">" + svgPath["leftarrow"] + "\n" + svgPath["rightarrow"] + "", + + // leftrightharpoons is from glyphs U+21BC/21B1 in font KaTeX Main + leftrightharpoons: ">\n", + + linesegment: ">\n", + + longequal: " viewBox='0 0 100 334' preserveAspectRatio='none'>\n", + + // mapsto is from glyph U+21A6 in font KaTeX Main + mapsto: ">" + svgPath["rightarrow"] + "", + + // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular + overbrace: ">\n", + + // overgroup is from the MnSymbol package (public domain) + overgroup: ">", + + // rightarrow is from glyph U+2192 in font KaTeX Main + rightarrow: ">" + svgPath["rightarrow"] + "", + + // rightharpoon is from glyph U+21C0 in font KaTeX Main + rightharpoon: ">", + + // rightharpoondown is from glyph U+21C1 in font KaTeX Main + rightharpoondown: ">", + + // rightleftharpoons is from glyph U+21CC in font KaTeX Main + rightleftharpoons: ">", + + // tilde1 is a modified version of a glyph from the MnSymbol package + tilde1: " viewBox='0 0 600 260' preserveAspectRatio='none'>\n", + + // Ditto tilde2, tilde3, and tilde 4 + tilde2: " viewBox='0 0 1033 286' preserveAspectRatio='none'>\n", + + tilde3: " viewBox='0 0 2339 306' preserveAspectRatio='none'>\n", + + tilde4: " viewBox='0 0 2340 312' preserveAspectRatio='none'>\n", + + // tofrom is from glyph U+21C4 in font KaTeX AMS Regular + tofrom: ">", + + // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular + twoheadleftarrow: ">\n", + + // twoheadrightarrow is from glyph U+21A0 in font KaTeX AMS Regular + twoheadrightarrow: ">\n", + + // underbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular + underbrace: ">\n", + + // undergroup is from the MnSymbol package (public domain) + undergroup: ">", + + // widehat1 is a modified version of a glyph from the MnSymbol package + widehat1: " viewBox='0 0 1062 239' preserveAspectRatio='none'>\n", + + // Ditto widehat2, widehat3, and widehat4 + widehat2: " viewBox='0 0 2364 300' preserveAspectRatio='none'>\n", + + widehat3: " viewBox='0 0 2364 360' preserveAspectRatio='none'>\n", + + widehat4: " viewBox='0 0 2364 420' preserveAspectRatio='none'>\n", + + xcancel: "\n" +}; + +var svgSpan = function svgSpan(group, options) { + // Create a span with inline SVG for the element. + var label = group.value.label.substr(1); + var height = 0; + var depth = 0; + var imageName = ""; + var minWidth = 0; + + if (utils.contains(["widehat", "widetilde", "undertilde"], label)) { + // There are four SVG images available for each function. + // Choose a taller image when there are more characters. + var numChars = group.value.value.length; + if (numChars > 5) { + height = 0.312; + imageName = (label === "widehat" ? "widehat" : "tilde") + "4"; + } else { + var imgIndex = [1, 1, 2, 2, 3, 3][numChars]; + if (label === "widehat") { + height = [0, 0.24, 0.30, 0.30, 0.36, 0.36][numChars]; + imageName = "widehat" + imgIndex; + } else { + height = [0, 0.26, 0.30, 0.30, 0.34, 0.34][numChars]; + imageName = "tilde" + imgIndex; + } + } + } else { + var imgData = katexImagesData[label]; + height = imgData[0]; + depth = imgData[1]; + imageName = imgData[2]; + minWidth = imgData[3]; + } + + var span = buildCommon.makeSpan([], [], options); + span.height = height; + span.depth = depth; + var totalHeight = height + depth; + span.style.height = totalHeight + "em"; + if (minWidth > 0) { + span.style.minWidth = minWidth + "em"; + } + + span.innerHTML = ""; + + return span; +}; + +var encloseSpan = function encloseSpan(inner, label, pad, options) { + // Return an image span for \cancel, \bcancel, \xcancel, or \fbox + var img = void 0; + var totalHeight = inner.height + inner.depth + 2 * pad; + + if (label === "fbox") { + img = buildCommon.makeSpan(["stretchy", label], [], options); + if (options.color) { + img.style.borderColor = options.getColor(); + } + } else { + img = buildCommon.makeSpan([], [], options); + img.innerHTML = "" + innerSVG[label] + ""; + } + + img.height = totalHeight; + img.style.height = totalHeight + "em"; + + return img; +}; + +module.exports = { + encloseSpan: encloseSpan, + mathMLnode: mathMLnode, + svgSpan: svgSpan +}; + +},{"./buildCommon":34,"./mathMLTree":45,"./utils":51}],48:[function(require,module,exports){ +"use strict"; + +/** + * This file holds a list of all no-argument functions and single-character + * symbols (like 'a' or ';'). + * + * For each of the symbols, there are three properties they can have: + * - font (required): the font to be used for this symbol. Either "main" (the + normal font), or "ams" (the ams fonts). + * - group (required): the ParseNode group type the symbol should have (i.e. + "textord", "mathord", etc). + See https://github.com/Khan/KaTeX/wiki/Examining-TeX#group-types + * - replace: the character that this symbol or function should be + * replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi + * character in the main font). + * + * The outermost map in the table indicates what mode the symbols should be + * accepted in (e.g. "math" or "text"). + */ + +module.exports = { + math: {}, + text: {} +}; + +function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) { + module.exports[mode][name] = { + font: font, + group: group, + replace: replace + }; + + if (acceptUnicodeChar) { + module.exports[mode][replace] = module.exports[mode][name]; + } +} + +// Some abbreviations for commonly used strings. +// This helps minify the code, and also spotting typos using jshint. + +// modes: +var math = "math"; +var text = "text"; + +// fonts: +var main = "main"; +var ams = "ams"; + +// groups: +var accent = "accent"; +var bin = "bin"; +var close = "close"; +var inner = "inner"; +var mathord = "mathord"; +var op = "op"; +var open = "open"; +var punct = "punct"; +var rel = "rel"; +var spacing = "spacing"; +var textord = "textord"; + +// Now comes the symbol table + +// Relation Symbols +defineSymbol(math, main, rel, "\u2261", "\\equiv"); +defineSymbol(math, main, rel, "\u227A", "\\prec"); +defineSymbol(math, main, rel, "\u227B", "\\succ"); +defineSymbol(math, main, rel, "\u223C", "\\sim"); +defineSymbol(math, main, rel, "\u22A5", "\\perp"); +defineSymbol(math, main, rel, "\u2AAF", "\\preceq"); +defineSymbol(math, main, rel, "\u2AB0", "\\succeq"); +defineSymbol(math, main, rel, "\u2243", "\\simeq"); +defineSymbol(math, main, rel, "\u2223", "\\mid"); +defineSymbol(math, main, rel, "\u226A", "\\ll"); +defineSymbol(math, main, rel, "\u226B", "\\gg"); +defineSymbol(math, main, rel, "\u224D", "\\asymp"); +defineSymbol(math, main, rel, "\u2225", "\\parallel"); +defineSymbol(math, main, rel, "\u22C8", "\\bowtie"); +defineSymbol(math, main, rel, "\u2323", "\\smile"); +defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq"); +defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq"); +defineSymbol(math, main, rel, "\u2250", "\\doteq"); +defineSymbol(math, main, rel, "\u2322", "\\frown"); +defineSymbol(math, main, rel, "\u220B", "\\ni"); +defineSymbol(math, main, rel, "\u221D", "\\propto"); +defineSymbol(math, main, rel, "\u22A2", "\\vdash"); +defineSymbol(math, main, rel, "\u22A3", "\\dashv"); +defineSymbol(math, main, rel, "\u220B", "\\owns"); + +// Punctuation +defineSymbol(math, main, punct, ".", "\\ldotp"); +defineSymbol(math, main, punct, "\u22C5", "\\cdotp"); + +// Misc Symbols +defineSymbol(math, main, textord, "#", "\\#"); +defineSymbol(text, main, textord, "#", "\\#"); +defineSymbol(math, main, textord, "&", "\\&"); +defineSymbol(text, main, textord, "&", "\\&"); +defineSymbol(math, main, textord, "\u2135", "\\aleph"); +defineSymbol(math, main, textord, "\u2200", "\\forall"); +defineSymbol(math, main, textord, "\u210F", "\\hbar"); +defineSymbol(math, main, textord, "\u2203", "\\exists"); +defineSymbol(math, main, textord, "\u2207", "\\nabla"); +defineSymbol(math, main, textord, "\u266D", "\\flat"); +defineSymbol(math, main, textord, "\u2113", "\\ell"); +defineSymbol(math, main, textord, "\u266E", "\\natural"); +defineSymbol(math, main, textord, "\u2663", "\\clubsuit"); +defineSymbol(math, main, textord, "\u2118", "\\wp"); +defineSymbol(math, main, textord, "\u266F", "\\sharp"); +defineSymbol(math, main, textord, "\u2662", "\\diamondsuit"); +defineSymbol(math, main, textord, "\u211C", "\\Re"); +defineSymbol(math, main, textord, "\u2661", "\\heartsuit"); +defineSymbol(math, main, textord, "\u2111", "\\Im"); +defineSymbol(math, main, textord, "\u2660", "\\spadesuit"); + +// Math and Text +defineSymbol(math, main, textord, "\u2020", "\\dag"); +defineSymbol(text, main, textord, "\u2020", "\\dag"); +defineSymbol(text, main, textord, "\u2020", "\\textdagger"); +defineSymbol(math, main, textord, "\u2021", "\\ddag"); +defineSymbol(text, main, textord, "\u2021", "\\ddag"); +defineSymbol(text, main, textord, "\u2020", "\\textdaggerdbl"); + +// Large Delimiters +defineSymbol(math, main, close, "\u23B1", "\\rmoustache"); +defineSymbol(math, main, open, "\u23B0", "\\lmoustache"); +defineSymbol(math, main, close, "\u27EF", "\\rgroup"); +defineSymbol(math, main, open, "\u27EE", "\\lgroup"); + +// Binary Operators +defineSymbol(math, main, bin, "\u2213", "\\mp"); +defineSymbol(math, main, bin, "\u2296", "\\ominus"); +defineSymbol(math, main, bin, "\u228E", "\\uplus"); +defineSymbol(math, main, bin, "\u2293", "\\sqcap"); +defineSymbol(math, main, bin, "\u2217", "\\ast"); +defineSymbol(math, main, bin, "\u2294", "\\sqcup"); +defineSymbol(math, main, bin, "\u25EF", "\\bigcirc"); +defineSymbol(math, main, bin, "\u2219", "\\bullet"); +defineSymbol(math, main, bin, "\u2021", "\\ddagger"); +defineSymbol(math, main, bin, "\u2240", "\\wr"); +defineSymbol(math, main, bin, "\u2A3F", "\\amalg"); + +// Arrow Symbols +defineSymbol(math, main, rel, "\u27F5", "\\longleftarrow"); +defineSymbol(math, main, rel, "\u21D0", "\\Leftarrow"); +defineSymbol(math, main, rel, "\u27F8", "\\Longleftarrow"); +defineSymbol(math, main, rel, "\u27F6", "\\longrightarrow"); +defineSymbol(math, main, rel, "\u21D2", "\\Rightarrow"); +defineSymbol(math, main, rel, "\u27F9", "\\Longrightarrow"); +defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow"); +defineSymbol(math, main, rel, "\u27F7", "\\longleftrightarrow"); +defineSymbol(math, main, rel, "\u21D4", "\\Leftrightarrow"); +defineSymbol(math, main, rel, "\u27FA", "\\Longleftrightarrow"); +defineSymbol(math, main, rel, "\u21A6", "\\mapsto"); +defineSymbol(math, main, rel, "\u27FC", "\\longmapsto"); +defineSymbol(math, main, rel, "\u2197", "\\nearrow"); +defineSymbol(math, main, rel, "\u21A9", "\\hookleftarrow"); +defineSymbol(math, main, rel, "\u21AA", "\\hookrightarrow"); +defineSymbol(math, main, rel, "\u2198", "\\searrow"); +defineSymbol(math, main, rel, "\u21BC", "\\leftharpoonup"); +defineSymbol(math, main, rel, "\u21C0", "\\rightharpoonup"); +defineSymbol(math, main, rel, "\u2199", "\\swarrow"); +defineSymbol(math, main, rel, "\u21BD", "\\leftharpoondown"); +defineSymbol(math, main, rel, "\u21C1", "\\rightharpoondown"); +defineSymbol(math, main, rel, "\u2196", "\\nwarrow"); +defineSymbol(math, main, rel, "\u21CC", "\\rightleftharpoons"); + +// AMS Negated Binary Relations +defineSymbol(math, ams, rel, "\u226E", "\\nless"); +defineSymbol(math, ams, rel, "\uE010", "\\nleqslant"); +defineSymbol(math, ams, rel, "\uE011", "\\nleqq"); +defineSymbol(math, ams, rel, "\u2A87", "\\lneq"); +defineSymbol(math, ams, rel, "\u2268", "\\lneqq"); +defineSymbol(math, ams, rel, "\uE00C", "\\lvertneqq"); +defineSymbol(math, ams, rel, "\u22E6", "\\lnsim"); +defineSymbol(math, ams, rel, "\u2A89", "\\lnapprox"); +defineSymbol(math, ams, rel, "\u2280", "\\nprec"); +defineSymbol(math, ams, rel, "\u22E0", "\\npreceq"); +defineSymbol(math, ams, rel, "\u22E8", "\\precnsim"); +defineSymbol(math, ams, rel, "\u2AB9", "\\precnapprox"); +defineSymbol(math, ams, rel, "\u2241", "\\nsim"); +defineSymbol(math, ams, rel, "\uE006", "\\nshortmid"); +defineSymbol(math, ams, rel, "\u2224", "\\nmid"); +defineSymbol(math, ams, rel, "\u22AC", "\\nvdash"); +defineSymbol(math, ams, rel, "\u22AD", "\\nvDash"); +defineSymbol(math, ams, rel, "\u22EA", "\\ntriangleleft"); +defineSymbol(math, ams, rel, "\u22EC", "\\ntrianglelefteq"); +defineSymbol(math, ams, rel, "\u228A", "\\subsetneq"); +defineSymbol(math, ams, rel, "\uE01A", "\\varsubsetneq"); +defineSymbol(math, ams, rel, "\u2ACB", "\\subsetneqq"); +defineSymbol(math, ams, rel, "\uE017", "\\varsubsetneqq"); +defineSymbol(math, ams, rel, "\u226F", "\\ngtr"); +defineSymbol(math, ams, rel, "\uE00F", "\\ngeqslant"); +defineSymbol(math, ams, rel, "\uE00E", "\\ngeqq"); +defineSymbol(math, ams, rel, "\u2A88", "\\gneq"); +defineSymbol(math, ams, rel, "\u2269", "\\gneqq"); +defineSymbol(math, ams, rel, "\uE00D", "\\gvertneqq"); +defineSymbol(math, ams, rel, "\u22E7", "\\gnsim"); +defineSymbol(math, ams, rel, "\u2A8A", "\\gnapprox"); +defineSymbol(math, ams, rel, "\u2281", "\\nsucc"); +defineSymbol(math, ams, rel, "\u22E1", "\\nsucceq"); +defineSymbol(math, ams, rel, "\u22E9", "\\succnsim"); +defineSymbol(math, ams, rel, "\u2ABA", "\\succnapprox"); +defineSymbol(math, ams, rel, "\u2246", "\\ncong"); +defineSymbol(math, ams, rel, "\uE007", "\\nshortparallel"); +defineSymbol(math, ams, rel, "\u2226", "\\nparallel"); +defineSymbol(math, ams, rel, "\u22AF", "\\nVDash"); +defineSymbol(math, ams, rel, "\u22EB", "\\ntriangleright"); +defineSymbol(math, ams, rel, "\u22ED", "\\ntrianglerighteq"); +defineSymbol(math, ams, rel, "\uE018", "\\nsupseteqq"); +defineSymbol(math, ams, rel, "\u228B", "\\supsetneq"); +defineSymbol(math, ams, rel, "\uE01B", "\\varsupsetneq"); +defineSymbol(math, ams, rel, "\u2ACC", "\\supsetneqq"); +defineSymbol(math, ams, rel, "\uE019", "\\varsupsetneqq"); +defineSymbol(math, ams, rel, "\u22AE", "\\nVdash"); +defineSymbol(math, ams, rel, "\u2AB5", "\\precneqq"); +defineSymbol(math, ams, rel, "\u2AB6", "\\succneqq"); +defineSymbol(math, ams, rel, "\uE016", "\\nsubseteqq"); +defineSymbol(math, ams, bin, "\u22B4", "\\unlhd"); +defineSymbol(math, ams, bin, "\u22B5", "\\unrhd"); + +// AMS Negated Arrows +defineSymbol(math, ams, rel, "\u219A", "\\nleftarrow"); +defineSymbol(math, ams, rel, "\u219B", "\\nrightarrow"); +defineSymbol(math, ams, rel, "\u21CD", "\\nLeftarrow"); +defineSymbol(math, ams, rel, "\u21CF", "\\nRightarrow"); +defineSymbol(math, ams, rel, "\u21AE", "\\nleftrightarrow"); +defineSymbol(math, ams, rel, "\u21CE", "\\nLeftrightarrow"); + +// AMS Misc +defineSymbol(math, ams, rel, "\u25B3", "\\vartriangle"); +defineSymbol(math, ams, textord, "\u210F", "\\hslash"); +defineSymbol(math, ams, textord, "\u25BD", "\\triangledown"); +defineSymbol(math, ams, textord, "\u25CA", "\\lozenge"); +defineSymbol(math, ams, textord, "\u24C8", "\\circledS"); +defineSymbol(math, ams, textord, "\xAE", "\\circledR"); +defineSymbol(text, ams, textord, "\xAE", "\\circledR"); +defineSymbol(math, ams, textord, "\u2221", "\\measuredangle"); +defineSymbol(math, ams, textord, "\u2204", "\\nexists"); +defineSymbol(math, ams, textord, "\u2127", "\\mho"); +defineSymbol(math, ams, textord, "\u2132", "\\Finv"); +defineSymbol(math, ams, textord, "\u2141", "\\Game"); +defineSymbol(math, ams, textord, "k", "\\Bbbk"); +defineSymbol(math, ams, textord, "\u2035", "\\backprime"); +defineSymbol(math, ams, textord, "\u25B2", "\\blacktriangle"); +defineSymbol(math, ams, textord, "\u25BC", "\\blacktriangledown"); +defineSymbol(math, ams, textord, "\u25A0", "\\blacksquare"); +defineSymbol(math, ams, textord, "\u29EB", "\\blacklozenge"); +defineSymbol(math, ams, textord, "\u2605", "\\bigstar"); +defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle"); +defineSymbol(math, ams, textord, "\u2201", "\\complement"); +defineSymbol(math, ams, textord, "\xF0", "\\eth"); +defineSymbol(math, ams, textord, "\u2571", "\\diagup"); +defineSymbol(math, ams, textord, "\u2572", "\\diagdown"); +defineSymbol(math, ams, textord, "\u25A1", "\\square"); +defineSymbol(math, ams, textord, "\u25A1", "\\Box"); +defineSymbol(math, ams, textord, "\u25CA", "\\Diamond"); +defineSymbol(math, ams, textord, "\xA5", "\\yen"); +defineSymbol(math, ams, textord, "\u2713", "\\checkmark"); +defineSymbol(text, ams, textord, "\u2713", "\\checkmark"); + +// AMS Hebrew +defineSymbol(math, ams, textord, "\u2136", "\\beth"); +defineSymbol(math, ams, textord, "\u2138", "\\daleth"); +defineSymbol(math, ams, textord, "\u2137", "\\gimel"); + +// AMS Greek +defineSymbol(math, ams, textord, "\u03DD", "\\digamma"); +defineSymbol(math, ams, textord, "\u03F0", "\\varkappa"); + +// AMS Delimiters +defineSymbol(math, ams, open, "\u250C", "\\ulcorner"); +defineSymbol(math, ams, close, "\u2510", "\\urcorner"); +defineSymbol(math, ams, open, "\u2514", "\\llcorner"); +defineSymbol(math, ams, close, "\u2518", "\\lrcorner"); + +// AMS Binary Relations +defineSymbol(math, ams, rel, "\u2266", "\\leqq"); +defineSymbol(math, ams, rel, "\u2A7D", "\\leqslant"); +defineSymbol(math, ams, rel, "\u2A95", "\\eqslantless"); +defineSymbol(math, ams, rel, "\u2272", "\\lesssim"); +defineSymbol(math, ams, rel, "\u2A85", "\\lessapprox"); +defineSymbol(math, ams, rel, "\u224A", "\\approxeq"); +defineSymbol(math, ams, bin, "\u22D6", "\\lessdot"); +defineSymbol(math, ams, rel, "\u22D8", "\\lll"); +defineSymbol(math, ams, rel, "\u2276", "\\lessgtr"); +defineSymbol(math, ams, rel, "\u22DA", "\\lesseqgtr"); +defineSymbol(math, ams, rel, "\u2A8B", "\\lesseqqgtr"); +defineSymbol(math, ams, rel, "\u2251", "\\doteqdot"); +defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq"); +defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq"); +defineSymbol(math, ams, rel, "\u223D", "\\backsim"); +defineSymbol(math, ams, rel, "\u22CD", "\\backsimeq"); +defineSymbol(math, ams, rel, "\u2AC5", "\\subseteqq"); +defineSymbol(math, ams, rel, "\u22D0", "\\Subset"); +defineSymbol(math, ams, rel, "\u228F", "\\sqsubset"); +defineSymbol(math, ams, rel, "\u227C", "\\preccurlyeq"); +defineSymbol(math, ams, rel, "\u22DE", "\\curlyeqprec"); +defineSymbol(math, ams, rel, "\u227E", "\\precsim"); +defineSymbol(math, ams, rel, "\u2AB7", "\\precapprox"); +defineSymbol(math, ams, rel, "\u22B2", "\\vartriangleleft"); +defineSymbol(math, ams, rel, "\u22B4", "\\trianglelefteq"); +defineSymbol(math, ams, rel, "\u22A8", "\\vDash"); +defineSymbol(math, ams, rel, "\u22AA", "\\Vvdash"); +defineSymbol(math, ams, rel, "\u2323", "\\smallsmile"); +defineSymbol(math, ams, rel, "\u2322", "\\smallfrown"); +defineSymbol(math, ams, rel, "\u224F", "\\bumpeq"); +defineSymbol(math, ams, rel, "\u224E", "\\Bumpeq"); +defineSymbol(math, ams, rel, "\u2267", "\\geqq"); +defineSymbol(math, ams, rel, "\u2A7E", "\\geqslant"); +defineSymbol(math, ams, rel, "\u2A96", "\\eqslantgtr"); +defineSymbol(math, ams, rel, "\u2273", "\\gtrsim"); +defineSymbol(math, ams, rel, "\u2A86", "\\gtrapprox"); +defineSymbol(math, ams, bin, "\u22D7", "\\gtrdot"); +defineSymbol(math, ams, rel, "\u22D9", "\\ggg"); +defineSymbol(math, ams, rel, "\u2277", "\\gtrless"); +defineSymbol(math, ams, rel, "\u22DB", "\\gtreqless"); +defineSymbol(math, ams, rel, "\u2A8C", "\\gtreqqless"); +defineSymbol(math, ams, rel, "\u2256", "\\eqcirc"); +defineSymbol(math, ams, rel, "\u2257", "\\circeq"); +defineSymbol(math, ams, rel, "\u225C", "\\triangleq"); +defineSymbol(math, ams, rel, "\u223C", "\\thicksim"); +defineSymbol(math, ams, rel, "\u2248", "\\thickapprox"); +defineSymbol(math, ams, rel, "\u2AC6", "\\supseteqq"); +defineSymbol(math, ams, rel, "\u22D1", "\\Supset"); +defineSymbol(math, ams, rel, "\u2290", "\\sqsupset"); +defineSymbol(math, ams, rel, "\u227D", "\\succcurlyeq"); +defineSymbol(math, ams, rel, "\u22DF", "\\curlyeqsucc"); +defineSymbol(math, ams, rel, "\u227F", "\\succsim"); +defineSymbol(math, ams, rel, "\u2AB8", "\\succapprox"); +defineSymbol(math, ams, rel, "\u22B3", "\\vartriangleright"); +defineSymbol(math, ams, rel, "\u22B5", "\\trianglerighteq"); +defineSymbol(math, ams, rel, "\u22A9", "\\Vdash"); +defineSymbol(math, ams, rel, "\u2223", "\\shortmid"); +defineSymbol(math, ams, rel, "\u2225", "\\shortparallel"); +defineSymbol(math, ams, rel, "\u226C", "\\between"); +defineSymbol(math, ams, rel, "\u22D4", "\\pitchfork"); +defineSymbol(math, ams, rel, "\u221D", "\\varpropto"); +defineSymbol(math, ams, rel, "\u25C0", "\\blacktriangleleft"); +defineSymbol(math, ams, rel, "\u2234", "\\therefore"); +defineSymbol(math, ams, rel, "\u220D", "\\backepsilon"); +defineSymbol(math, ams, rel, "\u25B6", "\\blacktriangleright"); +defineSymbol(math, ams, rel, "\u2235", "\\because"); +defineSymbol(math, ams, rel, "\u22D8", "\\llless"); +defineSymbol(math, ams, rel, "\u22D9", "\\gggtr"); +defineSymbol(math, ams, bin, "\u22B2", "\\lhd"); +defineSymbol(math, ams, bin, "\u22B3", "\\rhd"); +defineSymbol(math, ams, rel, "\u2242", "\\eqsim"); +defineSymbol(math, main, rel, "\u22C8", "\\Join"); +defineSymbol(math, ams, rel, "\u2251", "\\Doteq"); + +// AMS Binary Operators +defineSymbol(math, ams, bin, "\u2214", "\\dotplus"); +defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus"); +defineSymbol(math, ams, bin, "\u22D2", "\\Cap"); +defineSymbol(math, ams, bin, "\u22D3", "\\Cup"); +defineSymbol(math, ams, bin, "\u2A5E", "\\doublebarwedge"); +defineSymbol(math, ams, bin, "\u229F", "\\boxminus"); +defineSymbol(math, ams, bin, "\u229E", "\\boxplus"); +defineSymbol(math, ams, bin, "\u22C7", "\\divideontimes"); +defineSymbol(math, ams, bin, "\u22C9", "\\ltimes"); +defineSymbol(math, ams, bin, "\u22CA", "\\rtimes"); +defineSymbol(math, ams, bin, "\u22CB", "\\leftthreetimes"); +defineSymbol(math, ams, bin, "\u22CC", "\\rightthreetimes"); +defineSymbol(math, ams, bin, "\u22CF", "\\curlywedge"); +defineSymbol(math, ams, bin, "\u22CE", "\\curlyvee"); +defineSymbol(math, ams, bin, "\u229D", "\\circleddash"); +defineSymbol(math, ams, bin, "\u229B", "\\circledast"); +defineSymbol(math, ams, bin, "\u22C5", "\\centerdot"); +defineSymbol(math, ams, bin, "\u22BA", "\\intercal"); +defineSymbol(math, ams, bin, "\u22D2", "\\doublecap"); +defineSymbol(math, ams, bin, "\u22D3", "\\doublecup"); +defineSymbol(math, ams, bin, "\u22A0", "\\boxtimes"); + +// AMS Arrows +defineSymbol(math, ams, rel, "\u21E2", "\\dashrightarrow"); +defineSymbol(math, ams, rel, "\u21E0", "\\dashleftarrow"); +defineSymbol(math, ams, rel, "\u21C7", "\\leftleftarrows"); +defineSymbol(math, ams, rel, "\u21C6", "\\leftrightarrows"); +defineSymbol(math, ams, rel, "\u21DA", "\\Lleftarrow"); +defineSymbol(math, ams, rel, "\u219E", "\\twoheadleftarrow"); +defineSymbol(math, ams, rel, "\u21A2", "\\leftarrowtail"); +defineSymbol(math, ams, rel, "\u21AB", "\\looparrowleft"); +defineSymbol(math, ams, rel, "\u21CB", "\\leftrightharpoons"); +defineSymbol(math, ams, rel, "\u21B6", "\\curvearrowleft"); +defineSymbol(math, ams, rel, "\u21BA", "\\circlearrowleft"); +defineSymbol(math, ams, rel, "\u21B0", "\\Lsh"); +defineSymbol(math, ams, rel, "\u21C8", "\\upuparrows"); +defineSymbol(math, ams, rel, "\u21BF", "\\upharpoonleft"); +defineSymbol(math, ams, rel, "\u21C3", "\\downharpoonleft"); +defineSymbol(math, ams, rel, "\u22B8", "\\multimap"); +defineSymbol(math, ams, rel, "\u21AD", "\\leftrightsquigarrow"); +defineSymbol(math, ams, rel, "\u21C9", "\\rightrightarrows"); +defineSymbol(math, ams, rel, "\u21C4", "\\rightleftarrows"); +defineSymbol(math, ams, rel, "\u21A0", "\\twoheadrightarrow"); +defineSymbol(math, ams, rel, "\u21A3", "\\rightarrowtail"); +defineSymbol(math, ams, rel, "\u21AC", "\\looparrowright"); +defineSymbol(math, ams, rel, "\u21B7", "\\curvearrowright"); +defineSymbol(math, ams, rel, "\u21BB", "\\circlearrowright"); +defineSymbol(math, ams, rel, "\u21B1", "\\Rsh"); +defineSymbol(math, ams, rel, "\u21CA", "\\downdownarrows"); +defineSymbol(math, ams, rel, "\u21BE", "\\upharpoonright"); +defineSymbol(math, ams, rel, "\u21C2", "\\downharpoonright"); +defineSymbol(math, ams, rel, "\u21DD", "\\rightsquigarrow"); +defineSymbol(math, ams, rel, "\u21DD", "\\leadsto"); +defineSymbol(math, ams, rel, "\u21DB", "\\Rrightarrow"); +defineSymbol(math, ams, rel, "\u21BE", "\\restriction"); + +defineSymbol(math, main, textord, "\u2018", "`"); +defineSymbol(math, main, textord, "$", "\\$"); +defineSymbol(text, main, textord, "$", "\\$"); +defineSymbol(text, main, textord, "$", "\\textdollar"); +defineSymbol(math, main, textord, "%", "\\%"); +defineSymbol(text, main, textord, "%", "\\%"); +defineSymbol(math, main, textord, "_", "\\_"); +defineSymbol(text, main, textord, "_", "\\_"); +defineSymbol(text, main, textord, "_", "\\textunderscore"); +defineSymbol(math, main, textord, "\u2220", "\\angle"); +defineSymbol(math, main, textord, "\u221E", "\\infty"); +defineSymbol(math, main, textord, "\u2032", "\\prime"); +defineSymbol(math, main, textord, "\u25B3", "\\triangle"); +defineSymbol(math, main, textord, "\u0393", "\\Gamma", true); +defineSymbol(math, main, textord, "\u0394", "\\Delta", true); +defineSymbol(math, main, textord, "\u0398", "\\Theta", true); +defineSymbol(math, main, textord, "\u039B", "\\Lambda", true); +defineSymbol(math, main, textord, "\u039E", "\\Xi", true); +defineSymbol(math, main, textord, "\u03A0", "\\Pi", true); +defineSymbol(math, main, textord, "\u03A3", "\\Sigma", true); +defineSymbol(math, main, textord, "\u03A5", "\\Upsilon", true); +defineSymbol(math, main, textord, "\u03A6", "\\Phi", true); +defineSymbol(math, main, textord, "\u03A8", "\\Psi", true); +defineSymbol(math, main, textord, "\u03A9", "\\Omega", true); +defineSymbol(math, main, textord, "\xAC", "\\neg"); +defineSymbol(math, main, textord, "\xAC", "\\lnot"); +defineSymbol(math, main, textord, "\u22A4", "\\top"); +defineSymbol(math, main, textord, "\u22A5", "\\bot"); +defineSymbol(math, main, textord, "\u2205", "\\emptyset"); +defineSymbol(math, ams, textord, "\u2205", "\\varnothing"); +defineSymbol(math, main, mathord, "\u03B1", "\\alpha", true); +defineSymbol(math, main, mathord, "\u03B2", "\\beta", true); +defineSymbol(math, main, mathord, "\u03B3", "\\gamma", true); +defineSymbol(math, main, mathord, "\u03B4", "\\delta", true); +defineSymbol(math, main, mathord, "\u03F5", "\\epsilon", true); +defineSymbol(math, main, mathord, "\u03B6", "\\zeta", true); +defineSymbol(math, main, mathord, "\u03B7", "\\eta", true); +defineSymbol(math, main, mathord, "\u03B8", "\\theta", true); +defineSymbol(math, main, mathord, "\u03B9", "\\iota", true); +defineSymbol(math, main, mathord, "\u03BA", "\\kappa", true); +defineSymbol(math, main, mathord, "\u03BB", "\\lambda", true); +defineSymbol(math, main, mathord, "\u03BC", "\\mu", true); +defineSymbol(math, main, mathord, "\u03BD", "\\nu", true); +defineSymbol(math, main, mathord, "\u03BE", "\\xi", true); +defineSymbol(math, main, mathord, "\u03BF", "\\omicron", true); +defineSymbol(math, main, mathord, "\u03C0", "\\pi", true); +defineSymbol(math, main, mathord, "\u03C1", "\\rho", true); +defineSymbol(math, main, mathord, "\u03C3", "\\sigma", true); +defineSymbol(math, main, mathord, "\u03C4", "\\tau", true); +defineSymbol(math, main, mathord, "\u03C5", "\\upsilon", true); +defineSymbol(math, main, mathord, "\u03D5", "\\phi", true); +defineSymbol(math, main, mathord, "\u03C7", "\\chi", true); +defineSymbol(math, main, mathord, "\u03C8", "\\psi", true); +defineSymbol(math, main, mathord, "\u03C9", "\\omega", true); +defineSymbol(math, main, mathord, "\u03B5", "\\varepsilon", true); +defineSymbol(math, main, mathord, "\u03D1", "\\vartheta", true); +defineSymbol(math, main, mathord, "\u03D6", "\\varpi", true); +defineSymbol(math, main, mathord, "\u03F1", "\\varrho", true); +defineSymbol(math, main, mathord, "\u03C2", "\\varsigma", true); +defineSymbol(math, main, mathord, "\u03C6", "\\varphi", true); +defineSymbol(math, main, bin, "\u2217", "*"); +defineSymbol(math, main, bin, "+", "+"); +defineSymbol(math, main, bin, "\u2212", "-"); +defineSymbol(math, main, bin, "\u22C5", "\\cdot"); +defineSymbol(math, main, bin, "\u2218", "\\circ"); +defineSymbol(math, main, bin, "\xF7", "\\div"); +defineSymbol(math, main, bin, "\xB1", "\\pm"); +defineSymbol(math, main, bin, "\xD7", "\\times"); +defineSymbol(math, main, bin, "\u2229", "\\cap"); +defineSymbol(math, main, bin, "\u222A", "\\cup"); +defineSymbol(math, main, bin, "\u2216", "\\setminus"); +defineSymbol(math, main, bin, "\u2227", "\\land"); +defineSymbol(math, main, bin, "\u2228", "\\lor"); +defineSymbol(math, main, bin, "\u2227", "\\wedge"); +defineSymbol(math, main, bin, "\u2228", "\\vee"); +defineSymbol(math, main, textord, "\u221A", "\\surd"); +defineSymbol(math, main, open, "(", "("); +defineSymbol(math, main, open, "[", "["); +defineSymbol(math, main, open, "\u27E8", "\\langle"); +defineSymbol(math, main, open, "\u2223", "\\lvert"); +defineSymbol(math, main, open, "\u2225", "\\lVert"); +defineSymbol(math, main, close, ")", ")"); +defineSymbol(math, main, close, "]", "]"); +defineSymbol(math, main, close, "?", "?"); +defineSymbol(math, main, close, "!", "!"); +defineSymbol(math, main, close, "\u27E9", "\\rangle"); +defineSymbol(math, main, close, "\u2223", "\\rvert"); +defineSymbol(math, main, close, "\u2225", "\\rVert"); +defineSymbol(math, main, rel, "=", "="); +defineSymbol(math, main, rel, "<", "<"); +defineSymbol(math, main, rel, ">", ">"); +defineSymbol(math, main, rel, ":", ":"); +defineSymbol(math, main, rel, "\u2248", "\\approx"); +defineSymbol(math, main, rel, "\u2245", "\\cong"); +defineSymbol(math, main, rel, "\u2265", "\\ge"); +defineSymbol(math, main, rel, "\u2265", "\\geq"); +defineSymbol(math, main, rel, "\u2190", "\\gets"); +defineSymbol(math, main, rel, ">", "\\gt"); +defineSymbol(math, main, rel, "\u2208", "\\in"); +defineSymbol(math, main, rel, "\u2209", "\\notin"); +defineSymbol(math, main, rel, "\u0338", "\\not"); +defineSymbol(math, main, rel, "\u2282", "\\subset"); +defineSymbol(math, main, rel, "\u2283", "\\supset"); +defineSymbol(math, main, rel, "\u2286", "\\subseteq"); +defineSymbol(math, main, rel, "\u2287", "\\supseteq"); +defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq"); +defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq"); +defineSymbol(math, main, rel, "\u22A8", "\\models"); +defineSymbol(math, main, rel, "\u2190", "\\leftarrow"); +defineSymbol(math, main, rel, "\u2264", "\\le"); +defineSymbol(math, main, rel, "\u2264", "\\leq"); +defineSymbol(math, main, rel, "<", "\\lt"); +defineSymbol(math, main, rel, "\u2260", "\\ne"); +defineSymbol(math, main, rel, "\u2260", "\\neq"); +defineSymbol(math, main, rel, "\u2192", "\\rightarrow"); +defineSymbol(math, main, rel, "\u2192", "\\to"); +defineSymbol(math, ams, rel, "\u2271", "\\ngeq"); +defineSymbol(math, ams, rel, "\u2270", "\\nleq"); +defineSymbol(math, main, spacing, null, "\\!"); +defineSymbol(math, main, spacing, "\xA0", "\\ "); +defineSymbol(math, main, spacing, "\xA0", "~"); +defineSymbol(math, main, spacing, null, "\\,"); +defineSymbol(math, main, spacing, null, "\\:"); +defineSymbol(math, main, spacing, null, "\\;"); +defineSymbol(math, main, spacing, null, "\\enspace"); +defineSymbol(math, main, spacing, null, "\\qquad"); +defineSymbol(math, main, spacing, null, "\\quad"); +defineSymbol(math, main, spacing, "\xA0", "\\space"); +defineSymbol(math, main, punct, ",", ","); +defineSymbol(math, main, punct, ";", ";"); +defineSymbol(math, main, punct, ":", "\\colon"); +defineSymbol(math, ams, bin, "\u22BC", "\\barwedge"); +defineSymbol(math, ams, bin, "\u22BB", "\\veebar"); +defineSymbol(math, main, bin, "\u2299", "\\odot"); +defineSymbol(math, main, bin, "\u2295", "\\oplus"); +defineSymbol(math, main, bin, "\u2297", "\\otimes"); +defineSymbol(math, main, textord, "\u2202", "\\partial"); +defineSymbol(math, main, bin, "\u2298", "\\oslash"); +defineSymbol(math, ams, bin, "\u229A", "\\circledcirc"); +defineSymbol(math, ams, bin, "\u22A1", "\\boxdot"); +defineSymbol(math, main, bin, "\u25B3", "\\bigtriangleup"); +defineSymbol(math, main, bin, "\u25BD", "\\bigtriangledown"); +defineSymbol(math, main, bin, "\u2020", "\\dagger"); +defineSymbol(math, main, bin, "\u22C4", "\\diamond"); +defineSymbol(math, main, bin, "\u22C6", "\\star"); +defineSymbol(math, main, bin, "\u25C3", "\\triangleleft"); +defineSymbol(math, main, bin, "\u25B9", "\\triangleright"); +defineSymbol(math, main, open, "{", "\\{"); +defineSymbol(text, main, textord, "{", "\\{"); +defineSymbol(text, main, textord, "{", "\\textbraceleft"); +defineSymbol(math, main, close, "}", "\\}"); +defineSymbol(text, main, textord, "}", "\\}"); +defineSymbol(text, main, textord, "}", "\\textbraceright"); +defineSymbol(math, main, open, "{", "\\lbrace"); +defineSymbol(math, main, close, "}", "\\rbrace"); +defineSymbol(math, main, open, "[", "\\lbrack"); +defineSymbol(math, main, close, "]", "\\rbrack"); +defineSymbol(text, main, textord, "<", "\\textless"); // in T1 fontenc +defineSymbol(text, main, textord, ">", "\\textgreater"); // in T1 fontenc +defineSymbol(math, main, open, "\u230A", "\\lfloor"); +defineSymbol(math, main, close, "\u230B", "\\rfloor"); +defineSymbol(math, main, open, "\u2308", "\\lceil"); +defineSymbol(math, main, close, "\u2309", "\\rceil"); +defineSymbol(math, main, textord, "\\", "\\backslash"); +defineSymbol(math, main, textord, "\u2223", "|"); +defineSymbol(math, main, textord, "\u2223", "\\vert"); +defineSymbol(text, main, textord, "|", "\\textbar"); // in T1 fontenc +defineSymbol(math, main, textord, "\u2225", "\\|"); +defineSymbol(math, main, textord, "\u2225", "\\Vert"); +defineSymbol(text, main, textord, "\u2225", "\\textbardbl"); +defineSymbol(math, main, rel, "\u2191", "\\uparrow"); +defineSymbol(math, main, rel, "\u21D1", "\\Uparrow"); +defineSymbol(math, main, rel, "\u2193", "\\downarrow"); +defineSymbol(math, main, rel, "\u21D3", "\\Downarrow"); +defineSymbol(math, main, rel, "\u2195", "\\updownarrow"); +defineSymbol(math, main, rel, "\u21D5", "\\Updownarrow"); +defineSymbol(math, main, op, "\u2210", "\\coprod"); +defineSymbol(math, main, op, "\u22C1", "\\bigvee"); +defineSymbol(math, main, op, "\u22C0", "\\bigwedge"); +defineSymbol(math, main, op, "\u2A04", "\\biguplus"); +defineSymbol(math, main, op, "\u22C2", "\\bigcap"); +defineSymbol(math, main, op, "\u22C3", "\\bigcup"); +defineSymbol(math, main, op, "\u222B", "\\int"); +defineSymbol(math, main, op, "\u222B", "\\intop"); +defineSymbol(math, main, op, "\u222C", "\\iint"); +defineSymbol(math, main, op, "\u222D", "\\iiint"); +defineSymbol(math, main, op, "\u220F", "\\prod"); +defineSymbol(math, main, op, "\u2211", "\\sum"); +defineSymbol(math, main, op, "\u2A02", "\\bigotimes"); +defineSymbol(math, main, op, "\u2A01", "\\bigoplus"); +defineSymbol(math, main, op, "\u2A00", "\\bigodot"); +defineSymbol(math, main, op, "\u222E", "\\oint"); +defineSymbol(math, main, op, "\u2A06", "\\bigsqcup"); +defineSymbol(math, main, op, "\u222B", "\\smallint"); +defineSymbol(text, main, inner, "\u2026", "\\textellipsis"); +defineSymbol(math, main, inner, "\u2026", "\\mathellipsis"); +defineSymbol(text, main, inner, "\u2026", "\\ldots", true); +defineSymbol(math, main, inner, "\u2026", "\\ldots", true); +defineSymbol(math, main, inner, "\u22EF", "\\cdots", true); +defineSymbol(math, main, inner, "\u22F1", "\\ddots", true); +defineSymbol(math, main, textord, "\u22EE", "\\vdots", true); +defineSymbol(math, main, accent, "\xB4", "\\acute"); +defineSymbol(math, main, accent, "`", "\\grave"); +defineSymbol(math, main, accent, "\xA8", "\\ddot"); +defineSymbol(math, main, accent, "~", "\\tilde"); +defineSymbol(math, main, accent, "\xAF", "\\bar"); +defineSymbol(math, main, accent, "\u02D8", "\\breve"); +defineSymbol(math, main, accent, "\u02C7", "\\check"); +defineSymbol(math, main, accent, "^", "\\hat"); +defineSymbol(math, main, accent, "\u20D7", "\\vec"); +defineSymbol(math, main, accent, "\u02D9", "\\dot"); +defineSymbol(math, main, mathord, "\u0131", "\\imath"); +defineSymbol(math, main, mathord, "\u0237", "\\jmath"); +defineSymbol(text, main, accent, "\u02CA", "\\'"); // acute +defineSymbol(text, main, accent, "\u02CB", "\\`"); // grave +defineSymbol(text, main, accent, "\u02C6", "\\^"); // circumflex +defineSymbol(text, main, accent, "\u02DC", "\\~"); // tilde +defineSymbol(text, main, accent, "\u02C9", "\\="); // macron +defineSymbol(text, main, accent, "\u02D8", "\\u"); // breve +defineSymbol(text, main, accent, "\u02D9", "\\."); // dot above +defineSymbol(text, main, accent, "\u02DA", "\\r"); // ring above +defineSymbol(text, main, accent, "\u02C7", "\\v"); // caron +defineSymbol(text, main, accent, "\xA8", '\\"'); // diaresis +defineSymbol(text, main, accent, "\u030B", "\\H"); // double acute + +defineSymbol(text, main, textord, "\u2013", "--"); +defineSymbol(text, main, textord, "\u2013", "\\textendash"); +defineSymbol(text, main, textord, "\u2014", "---"); +defineSymbol(text, main, textord, "\u2014", "\\textemdash"); +defineSymbol(text, main, textord, "\u2018", "`"); +defineSymbol(text, main, textord, "\u2018", "\\textquoteleft"); +defineSymbol(text, main, textord, "\u2019", "'"); +defineSymbol(text, main, textord, "\u2019", "\\textquoteright"); +defineSymbol(text, main, textord, "\u201C", "``"); +defineSymbol(text, main, textord, "\u201C", "\\textquotedblleft"); +defineSymbol(text, main, textord, "\u201D", "''"); +defineSymbol(text, main, textord, "\u201D", "\\textquotedblright"); +defineSymbol(math, main, textord, "\xB0", "\\degree"); +defineSymbol(text, main, textord, "\xB0", "\\degree"); +// TODO: In LaTeX, \pounds can generate a different character in text and math +// mode, but among our fonts, only Main-Italic defines this character "163". +defineSymbol(math, main, mathord, "\xA3", "\\pounds"); +defineSymbol(math, main, mathord, "\xA3", "\\mathsterling"); +defineSymbol(text, main, mathord, "\xA3", "\\pounds"); +defineSymbol(text, main, mathord, "\xA3", "\\textsterling"); +defineSymbol(math, ams, textord, "\u2720", "\\maltese"); +defineSymbol(text, ams, textord, "\u2720", "\\maltese"); + +defineSymbol(text, main, spacing, "\xA0", "\\ "); +defineSymbol(text, main, spacing, "\xA0", " "); +defineSymbol(text, main, spacing, "\xA0", "~"); + +// There are lots of symbols which are the same, so we add them in afterwards. + +// All of these are textords in math mode +var mathTextSymbols = "0123456789/@.\""; +for (var i = 0; i < mathTextSymbols.length; i++) { + var ch = mathTextSymbols.charAt(i); + defineSymbol(math, main, textord, ch, ch); +} + +// All of these are textords in text mode +var textSymbols = "0123456789!@*()-=+[]<>|\";:?/.,"; +for (var _i = 0; _i < textSymbols.length; _i++) { + var _ch = textSymbols.charAt(_i); + defineSymbol(text, main, textord, _ch, _ch); +} + +// All of these are textords in text mode, and mathords in math mode +var letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; +for (var _i2 = 0; _i2 < letters.length; _i2++) { + var _ch2 = letters.charAt(_i2); + defineSymbol(math, main, mathord, _ch2, _ch2); + defineSymbol(text, main, textord, _ch2, _ch2); +} + +// Latin-1 letters +for (var _i3 = 0x00C0; _i3 <= 0x00D6; _i3++) { + var _ch3 = String.fromCharCode(_i3); + defineSymbol(math, main, mathord, _ch3, _ch3); + defineSymbol(text, main, textord, _ch3, _ch3); +} + +for (var _i4 = 0x00D8; _i4 <= 0x00F6; _i4++) { + var _ch4 = String.fromCharCode(_i4); + defineSymbol(math, main, mathord, _ch4, _ch4); + defineSymbol(text, main, textord, _ch4, _ch4); +} + +for (var _i5 = 0x00F8; _i5 <= 0x00FF; _i5++) { + var _ch5 = String.fromCharCode(_i5); + defineSymbol(math, main, mathord, _ch5, _ch5); + defineSymbol(text, main, textord, _ch5, _ch5); +} + +// Cyrillic +for (var _i6 = 0x0410; _i6 <= 0x044F; _i6++) { + var _ch6 = String.fromCharCode(_i6); + defineSymbol(text, main, textord, _ch6, _ch6); +} + +// Unicode versions of existing characters +defineSymbol(text, main, textord, "\u2013", "–"); +defineSymbol(text, main, textord, "\u2014", "—"); +defineSymbol(text, main, textord, "\u2018", "‘"); +defineSymbol(text, main, textord, "\u2019", "’"); +defineSymbol(text, main, textord, "\u201C", "“"); +defineSymbol(text, main, textord, "\u201D", "”"); + +},{}],49:[function(require,module,exports){ +"use strict"; + +var hangulRegex = /[\uAC00-\uD7AF]/; + +// This regex combines +// - CJK symbols and punctuation: [\u3000-\u303F] +// - Hiragana: [\u3040-\u309F] +// - Katakana: [\u30A0-\u30FF] +// - CJK ideograms: [\u4E00-\u9FAF] +// - Hangul syllables: [\uAC00-\uD7AF] +// - Fullwidth punctuation: [\uFF00-\uFF60] +// Notably missing are halfwidth Katakana and Romanji glyphs. +var cjkRegex = /[\u3000-\u30FF\u4E00-\u9FAF\uAC00-\uD7AF\uFF00-\uFF60]/; + +module.exports = { + cjkRegex: cjkRegex, + hangulRegex: hangulRegex +}; + +},{}],50:[function(require,module,exports){ +"use strict"; + +var _ParseError = require("./ParseError"); + +var _ParseError2 = _interopRequireDefault(_ParseError); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// This table gives the number of TeX pts in one of each *absolute* TeX unit. +// Thus, multiplying a length by this number converts the length from units +// into pts. Dividing the result by ptPerEm gives the number of ems +// *assuming* a font size of ptPerEm (normal size, normal style). +var ptPerUnit = { + // https://en.wikibooks.org/wiki/LaTeX/Lengths and + // https://tex.stackexchange.com/a/8263 + "pt": 1, // TeX point + "mm": 7227 / 2540, // millimeter + "cm": 7227 / 254, // centimeter + "in": 72.27, // inch + "bp": 803 / 800, // big (PostScript) points + "pc": 12, // pica + "dd": 1238 / 1157, // didot + "cc": 14856 / 1157, // cicero (12 didot) + "nd": 685 / 642, // new didot + "nc": 1370 / 107, // new cicero (12 new didot) + "sp": 1 / 65536, // scaled point (TeX's internal smallest unit) + // https://tex.stackexchange.com/a/41371 + "px": 803 / 800 }; + +// Dictionary of relative units, for fast validity testing. +/* eslint no-console:0 */ + +/** + * This file does conversion between units. In particular, it provides + * calculateSize to convert other units into ems. + */ + +var relativeUnit = { + "ex": true, + "em": true, + "mu": true +}; + +/** + * Determine whether the specified unit (either a string defining the unit + * or a "size" parse node containing a unit field) is valid. + */ +var validUnit = function validUnit(unit) { + if (unit.unit) { + unit = unit.unit; + } + return unit in ptPerUnit || unit in relativeUnit || unit === "ex"; +}; + +/* + * Convert a "size" parse node (with numeric "number" and string "unit" fields, + * as parsed by functions.js argType "size") into a CSS em value for the + * current style/scale. `options` gives the current options. + */ +var calculateSize = function calculateSize(sizeValue, options) { + var scale = void 0; + if (sizeValue.unit in ptPerUnit) { + // Absolute units + scale = ptPerUnit[sizeValue.unit] // Convert unit to pt + / options.fontMetrics().ptPerEm // Convert pt to CSS em + / options.sizeMultiplier; // Unscale to make absolute units + } else if (sizeValue.unit === "mu") { + // `mu` units scale with scriptstyle/scriptscriptstyle. + scale = options.fontMetrics().cssEmPerMu; + } else { + // Other relative units always refer to the *textstyle* font + // in the current size. + var unitOptions = void 0; + if (options.style.isTight()) { + // isTight() means current style is script/scriptscript. + unitOptions = options.havingStyle(options.style.text()); + } else { + unitOptions = options; + } + // TODO: In TeX these units are relative to the quad of the current + // *text* font, e.g. cmr10. KaTeX instead uses values from the + // comparably-sized *Computer Modern symbol* font. At 10pt, these + // match. At 7pt and 5pt, they differ: cmr7=1.138894, cmsy7=1.170641; + // cmr5=1.361133, cmsy5=1.472241. Consider $\scriptsize a\kern1emb$. + // TeX \showlists shows a kern of 1.13889 * fontsize; + // KaTeX shows a kern of 1.171 * fontsize. + if (sizeValue.unit === "ex") { + scale = unitOptions.fontMetrics().xHeight; + } else if (sizeValue.unit === "em") { + scale = unitOptions.fontMetrics().quad; + } else { + throw new _ParseError2.default("Invalid unit: '" + sizeValue.unit + "'"); + } + if (unitOptions !== options) { + scale *= unitOptions.sizeMultiplier / options.sizeMultiplier; + } + } + return sizeValue.number * scale; +}; + +module.exports = { + validUnit: validUnit, + calculateSize: calculateSize +}; + +},{"./ParseError":29}],51:[function(require,module,exports){ +"use strict"; + +/** + * This file contains a list of utility functions which are useful in other + * files. + */ + +/** + * Provide an `indexOf` function which works in IE8, but defers to native if + * possible. + */ +var nativeIndexOf = Array.prototype.indexOf; +var indexOf = function indexOf(list, elem) { + if (list == null) { + return -1; + } + if (nativeIndexOf && list.indexOf === nativeIndexOf) { + return list.indexOf(elem); + } + var l = list.length; + for (var i = 0; i < l; i++) { + if (list[i] === elem) { + return i; + } + } + return -1; +}; + +/** + * Return whether an element is contained in a list + */ +var contains = function contains(list, elem) { + return indexOf(list, elem) !== -1; +}; + +/** + * Provide a default value if a setting is undefined + */ +var deflt = function deflt(setting, defaultIfUndefined) { + return setting === undefined ? defaultIfUndefined : setting; +}; + +// hyphenate and escape adapted from Facebook's React under Apache 2 license + +var uppercase = /([A-Z])/g; +var hyphenate = function hyphenate(str) { + return str.replace(uppercase, "-$1").toLowerCase(); +}; + +var ESCAPE_LOOKUP = { + "&": "&", + ">": ">", + "<": "<", + "\"": """, + "'": "'" +}; + +var ESCAPE_REGEX = /[&><"']/g; + +function escaper(match) { + return ESCAPE_LOOKUP[match]; +} + +/** + * Escapes text to prevent scripting attacks. + * + * @param {*} text Text value to escape. + * @return {string} An escaped string. + */ +function escape(text) { + return ("" + text).replace(ESCAPE_REGEX, escaper); +} + +/** + * A function to set the text content of a DOM element in all supported + * browsers. Note that we don't define this if there is no document. + */ +var setTextContent = void 0; +if (typeof document !== "undefined") { + var testNode = document.createElement("span"); + if ("textContent" in testNode) { + setTextContent = function setTextContent(node, text) { + node.textContent = text; + }; + } else { + setTextContent = function setTextContent(node, text) { + node.innerText = text; + }; + } +} + +/** + * A function to clear a node. + */ +function clearNode(node) { + setTextContent(node, ""); +} + +module.exports = { + contains: contains, + deflt: deflt, + escape: escape, + hyphenate: hyphenate, + indexOf: indexOf, + setTextContent: setTextContent, + clearNode: clearNode +}; + +},{}]},{},[1])(1) +}); \ No newline at end of file diff --git a/static/katex/katex.min.css b/static/katex/katex.min.css new file mode 100644 index 00000000..2aba5d86 --- /dev/null +++ b/static/katex/katex.min.css @@ -0,0 +1 @@ +@font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.eot);src:url(fonts/KaTeX_AMS-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_AMS-Regular.woff2) format('woff2'),url(fonts/KaTeX_AMS-Regular.woff) format('woff'),url(fonts/KaTeX_AMS-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.eot);src:url(fonts/KaTeX_Caligraphic-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Caligraphic-Bold.woff2) format('woff2'),url(fonts/KaTeX_Caligraphic-Bold.woff) format('woff'),url(fonts/KaTeX_Caligraphic-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.eot);src:url(fonts/KaTeX_Caligraphic-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Caligraphic-Regular.woff2) format('woff2'),url(fonts/KaTeX_Caligraphic-Regular.woff) format('woff'),url(fonts/KaTeX_Caligraphic-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.eot);src:url(fonts/KaTeX_Fraktur-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Fraktur-Bold.woff2) format('woff2'),url(fonts/KaTeX_Fraktur-Bold.woff) format('woff'),url(fonts/KaTeX_Fraktur-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.eot);src:url(fonts/KaTeX_Fraktur-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Fraktur-Regular.woff2) format('woff2'),url(fonts/KaTeX_Fraktur-Regular.woff) format('woff'),url(fonts/KaTeX_Fraktur-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.eot);src:url(fonts/KaTeX_Main-Bold.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Bold.woff2) format('woff2'),url(fonts/KaTeX_Main-Bold.woff) format('woff'),url(fonts/KaTeX_Main-Bold.ttf) format('truetype');font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.eot);src:url(fonts/KaTeX_Main-Italic.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Italic.woff2) format('woff2'),url(fonts/KaTeX_Main-Italic.woff) format('woff'),url(fonts/KaTeX_Main-Italic.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.eot);src:url(fonts/KaTeX_Main-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Main-Regular.woff2) format('woff2'),url(fonts/KaTeX_Main-Regular.woff) format('woff'),url(fonts/KaTeX_Main-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.eot);src:url(fonts/KaTeX_Math-Italic.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Math-Italic.woff2) format('woff2'),url(fonts/KaTeX_Math-Italic.woff) format('woff'),url(fonts/KaTeX_Math-Italic.ttf) format('truetype');font-weight:400;font-style:italic}@font-face{font-family:KaTeX_SansSerif;src:url(fonts/KaTeX_SansSerif-Regular.eot);src:url(fonts/KaTeX_SansSerif-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_SansSerif-Regular.woff2) format('woff2'),url(fonts/KaTeX_SansSerif-Regular.woff) format('woff'),url(fonts/KaTeX_SansSerif-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.eot);src:url(fonts/KaTeX_Script-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Script-Regular.woff2) format('woff2'),url(fonts/KaTeX_Script-Regular.woff) format('woff'),url(fonts/KaTeX_Script-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.eot);src:url(fonts/KaTeX_Size1-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size1-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size1-Regular.woff) format('woff'),url(fonts/KaTeX_Size1-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.eot);src:url(fonts/KaTeX_Size2-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size2-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size2-Regular.woff) format('woff'),url(fonts/KaTeX_Size2-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.eot);src:url(fonts/KaTeX_Size3-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size3-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size3-Regular.woff) format('woff'),url(fonts/KaTeX_Size3-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.eot);src:url(fonts/KaTeX_Size4-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Size4-Regular.woff2) format('woff2'),url(fonts/KaTeX_Size4-Regular.woff) format('woff'),url(fonts/KaTeX_Size4-Regular.ttf) format('truetype');font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.eot);src:url(fonts/KaTeX_Typewriter-Regular.eot#iefix) format('embedded-opentype'),url(fonts/KaTeX_Typewriter-Regular.woff2) format('woff2'),url(fonts/KaTeX_Typewriter-Regular.woff) format('woff'),url(fonts/KaTeX_Typewriter-Regular.ttf) format('truetype');font-weight:400;font-style:normal}.katex-display{display:block;margin:1em 0;text-align:center}.katex .base,.katex .katex-html,.katex .strut{display:inline-block}.katex-display>.katex{display:inline-block;text-align:initial}.katex{font:400 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;white-space:nowrap;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important}.katex .katex-mathml{position:absolute;clip:rect(1px,1px,1px,1px);padding:0;border:0;height:1px;width:1px;overflow:hidden}.katex .base{position:relative}.katex .mathrm{font-style:normal}.katex .mainit,.katex .mathit,.katex .textit{font-style:italic}.katex .mathit{font-family:KaTeX_Math}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .amsrm,.katex .mathbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr{font-family:KaTeX_Script}.katex .mathsf{font-family:KaTeX_SansSerif}.katex .mainit{font-family:KaTeX_Main}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .mord+.mop{margin-left:.16667em}.katex .mord+.mbin{margin-left:.22222em}.katex .mord+.mrel{margin-left:.27778em}.katex .mop+.mop,.katex .mop+.mord,.katex .mord+.minner{margin-left:.16667em}.katex .mop+.mrel{margin-left:.27778em}.katex .mop+.minner{margin-left:.16667em}.katex .mbin+.minner,.katex .mbin+.mop,.katex .mbin+.mopen,.katex .mbin+.mord{margin-left:.22222em}.katex .mrel+.minner,.katex .mrel+.mop,.katex .mrel+.mopen,.katex .mrel+.mord{margin-left:.27778em}.katex .mclose+.mop{margin-left:.16667em}.katex .mclose+.mbin{margin-left:.22222em}.katex .mclose+.mrel{margin-left:.27778em}.katex .mclose+.minner,.katex .minner+.mop,.katex .minner+.mord,.katex .mpunct+.mclose,.katex .mpunct+.minner,.katex .mpunct+.mop,.katex .mpunct+.mopen,.katex .mpunct+.mord,.katex .mpunct+.mpunct,.katex .mpunct+.mrel{margin-left:.16667em}.katex .minner+.mbin{margin-left:.22222em}.katex .minner+.mrel{margin-left:.27778em}.katex .minner+.minner,.katex .minner+.mopen,.katex .minner+.mpunct{margin-left:.16667em}.katex .mbin.mtight,.katex .mclose.mtight,.katex .minner.mtight,.katex .mop.mtight,.katex .mopen.mtight,.katex .mord.mtight,.katex .mpunct.mtight,.katex .mrel.mtight{margin-left:0}.katex .mclose+.mop.mtight,.katex .minner+.mop.mtight,.katex .mop+.mop.mtight,.katex .mop+.mord.mtight,.katex .mord+.mop.mtight{margin-left:.16667em}.katex .vlist-t{display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;vertical-align:bottom;position:relative}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;vertical-align:bottom;font-size:1px;width:2px}.katex .fontsize-ensurer,.katex .llap>.fix,.katex .mfrac .frac-line,.katex .mspace,.katex .mtable .arraycolsep,.katex .mtable .vertical-separator,.katex .nulldelimiter,.katex .rlap>.fix,.katex .rule,.katex .sizing{display:inline-block}.katex .msupsub{text-align:left}.katex .accent>.vlist-t,.katex .mfrac>span>span,.katex .mtable .col-align-c>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .mfrac .frac-line{width:100%;border-bottom-style:solid}.katex .mspace.negativethinspace{margin-left:-.16667em}.katex .mspace.thinspace{width:.16667em}.katex .mspace.negativemediumspace{margin-left:-.22222em}.katex .mspace.mediumspace{width:.22222em}.katex .mspace.thickspace{width:.27778em}.katex .mspace.sixmuspace{width:.333333em}.katex .mspace.eightmuspace{width:.444444em}.katex .mspace.enspace{width:.5em}.katex .mspace.twelvemuspace{width:.666667em}.katex .mspace.quad{width:1em}.katex .mspace.qquad{width:2em}.katex .llap,.katex .rlap{width:0;position:relative}.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .llap>.inner{right:0}.katex .rlap>.inner{left:0}.katex .katex-logo .a{font-size:.75em;margin-left:-.32em;position:relative;top:-.2em}.katex .katex-logo .t{margin-left:-.23em}.katex .katex-logo .e{margin-left:-.1667em;position:relative;top:.2155em}.katex .katex-logo .x{margin-left:-.125em}.katex .rule{border:0 solid;position:relative}.katex .overline .overline-line,.katex .underline .underline-line{display:inline-block;width:100%;border-bottom-style:solid}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent .accent-body>span{width:0}.katex .accent .accent-body.accent-vec>span{position:relative;left:.326em}.katex .accent .accent-body.accent-hungarian>span{position:relative;left:.25em}.katex .mtable .vertical-separator{margin:0 -.025em;border-right:.05em solid #000}.katex .stretchy,.katex svg{width:100%;display:block}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{position:absolute}.katex svg path{fill:currentColor}.katex svg line{stroke:currentColor}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .x-arrow-pad{padding:0 .5em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox{box-sizing:border-box;border:.04em solid #000}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap+.mbin,.katex .cancel-lap+.mord,.katex .cancel-lap+.msupsub,.katex .mbin+.cancel-lap,.katex .mord+.cancel-lap{margin-left:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em} \ No newline at end of file diff --git a/static/katex/katex.min.js b/static/katex/katex.min.js new file mode 100644 index 00000000..a7aba03b --- /dev/null +++ b/static/katex/katex.min.js @@ -0,0 +1,6 @@ +(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.katex=e()}})(function(){var e,t,r;return function e(t,r,a){function n(l,s){if(!r[l]){if(!t[l]){var o=typeof require=="function"&&require;if(!s&&o)return o(l,!0);if(i)return i(l,!0);var u=new Error("Cannot find module '"+l+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[l]={exports:{}};t[l][0].call(c.exports,function(e){var r=t[l][1][e];return n(r?r:e)},c,c.exports,e,t,r,a)}return r[l].exports}var i=typeof require=="function"&&require;for(var l=0;l=0;--c){a=n[c];if(a.text==="#"){if(c===0){throw new h.default("Incomplete placeholder at end of macro body",a)}a=n[--c];if(a.text==="#"){n.splice(c+1,1)}else if(/^[1-9]$/.test(a.text)){n.splice.apply(n,[c,2].concat(u[a.text-1]))}else{throw new h.default("Not a valid argument number",a)}}}}this.stack=this.stack.concat(n)}}},{key:"get",value:function e(t){this.discardedWhiteSpace=[];var r=this.nextToken();if(t){while(r.text===" "){this.discardedWhiteSpace.push(r);r=this.nextToken()}}return r}},{key:"unget",value:function e(t){this.stack.push(t);while(this.discardedWhiteSpace.length!==0){this.stack.push(this.discardedWhiteSpace.pop())}}}]);return e}();t.exports=m},{"./Lexer":26,"./ParseError":29,"./macros":44,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5,"object-assign":25}],28:[function(e,t,r){"use strict";var a=e("babel-runtime/helpers/classCallCheck");var n=u(a);var i=e("babel-runtime/helpers/createClass");var l=u(i);var s=e("./fontMetrics");var o=u(s);function u(e){return e&&e.__esModule?e:{default:e}}var c=6;var f=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]];var h=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488];var v=function e(t,r){return r.size<2?t:f[t-1][r.size-1]};var d=function(){function e(t){(0,n.default)(this,e);this.style=t.style;this.color=t.color;this.size=t.size||c;this.textSize=t.textSize||this.size;this.phantom=t.phantom;this.font=t.font;this.sizeMultiplier=h[this.size-1];this._fontMetrics=null}(0,l.default)(e,[{key:"extend",value:function t(r){var a={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font};for(var n in r){if(r.hasOwnProperty(n)){a[n]=r[n]}}return new e(a)}},{key:"havingStyle",value:function e(t){if(this.style===t){return this}else{return this.extend({style:t,size:v(this.textSize,t)})}}},{key:"havingCrampedStyle",value:function e(){return this.havingStyle(this.style.cramp())}},{key:"havingSize",value:function e(t){if(this.size===t&&this.textSize===t){return this}else{return this.extend({style:this.style.text(),size:t,textSize:t})}}},{key:"havingBaseStyle",value:function e(t){t=t||this.style.text();var r=v(c,t);if(this.size===r&&this.textSize===c&&this.style===t){return this}else{return this.extend({style:t,size:r,baseSize:c})}}},{key:"withColor",value:function e(t){return this.extend({color:t})}},{key:"withPhantom",value:function e(){return this.extend({phantom:true})}},{key:"withFont",value:function e(t){return this.extend({font:t||this.font})}},{key:"sizingClasses",value:function e(t){if(t.size!==this.size){return["sizing","reset-size"+t.size,"size"+this.size]}else{return[]}}},{key:"baseSizingClasses",value:function e(){if(this.size!==c){return["sizing","reset-size"+this.size,"size"+c]}else{return[]}}},{key:"fontMetrics",value:function e(){if(!this._fontMetrics){this._fontMetrics=o.default.getFontMetrics(this.size)}return this._fontMetrics}},{key:"getColor",value:function t(){if(this.phantom){return"transparent"}else{return e.colorMap[this.color]||this.color}}}]);return e}();d.colorMap={"katex-blue":"#6495ed","katex-orange":"#ffa500","katex-pink":"#ff00af","katex-red":"#df0030","katex-green":"#28ae7b","katex-gray":"gray","katex-purple":"#9d38bd","katex-blueA":"#ccfaff","katex-blueB":"#80f6ff","katex-blueC":"#63d9ea","katex-blueD":"#11accd","katex-blueE":"#0c7f99","katex-tealA":"#94fff5","katex-tealB":"#26edd5","katex-tealC":"#01d1c1","katex-tealD":"#01a995","katex-tealE":"#208170","katex-greenA":"#b6ffb0","katex-greenB":"#8af281","katex-greenC":"#74cf70","katex-greenD":"#1fab54","katex-greenE":"#0d923f","katex-goldA":"#ffd0a9","katex-goldB":"#ffbb71","katex-goldC":"#ff9c39","katex-goldD":"#e07d10","katex-goldE":"#a75a05","katex-redA":"#fca9a9","katex-redB":"#ff8482","katex-redC":"#f9685d","katex-redD":"#e84d39","katex-redE":"#bc2612","katex-maroonA":"#ffbde0","katex-maroonB":"#ff92c6","katex-maroonC":"#ed5fa6","katex-maroonD":"#ca337c","katex-maroonE":"#9e034e","katex-purpleA":"#ddd7ff","katex-purpleB":"#c6b9fc","katex-purpleC":"#aa87ff","katex-purpleD":"#7854ab","katex-purpleE":"#543b78","katex-mintA":"#f5f9e8","katex-mintB":"#edf2df","katex-mintC":"#e0e5cc","katex-grayA":"#f6f7f7","katex-grayB":"#f0f1f2","katex-grayC":"#e3e5e6","katex-grayD":"#d6d8da","katex-grayE":"#babec2","katex-grayF":"#888d93","katex-grayG":"#626569","katex-grayH":"#3b3e40","katex-grayI":"#21242c","katex-kaBlue":"#314453","katex-kaGreen":"#71B307"};d.BASESIZE=c;t.exports=d},{"./fontMetrics":41,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],29:[function(e,t,r){"use strict";var a=e("babel-runtime/helpers/classCallCheck");var n=i(a);function i(e){return e&&e.__esModule?e:{default:e}}var l=function e(t,r){(0,n.default)(this,e);var a="KaTeX parse error: "+t;var i=void 0;var l=void 0;if(r&&r.lexer&&r.start<=r.end){var s=r.lexer.input;i=r.start;l=r.end;if(i===s.length){a+=" at end of input: "}else{a+=" at position "+(i+1)+": "}var o=s.slice(i,l).replace(/[^]/g,"$&\u0332");var u=void 0;if(i>15){u="\u2026"+s.slice(i-15,i)}else{u=s.slice(0,i)}var c=void 0;if(l+15e.SUPSUB_GREEDINESS){return this.parseFunction(i)}else{throw new M.default("Got function '"+i.result+"' with no arguments "+"as "+r,a)}}else{return i.result}}},{key:"handleUnsupportedCmd",value:function e(){var t=this.nextToken.text;var r=[];for(var a=0;an){h=this.parseFunction(f)}else{throw new M.default("Got function '"+f.result+"' as "+"argument to '"+t+"'",u)}}else{h=f.result}l.push(h);i.push(this.pos)}l.push(i);return l}},{key:"parseGroupOfType",value:function e(t,r){var a=this.mode;if(t==="original"){t=a}if(t==="color"){return this.parseColorGroup(r)}if(t==="size"){return this.parseSizeGroup(r)}this.switchMode(t);if(t==="text"){this.consumeSpaces()}var n=this.parseGroup(r);this.switchMode(a);return n}},{key:"consumeSpaces",value:function e(){while(this.nextToken.text===" "){this.consume()}}},{key:"parseStringGroup",value:function e(t,r){if(r&&this.nextToken.text!=="["){return null}var a=this.mode;this.mode="text";this.expect(r?"[":"{");var n="";var i=this.nextToken;var l=i;while(this.nextToken.text!==(r?"]":"}")){if(this.nextToken.text==="EOF"){throw new M.default("Unexpected end of input in "+t,i.range(this.nextToken,n))}l=this.nextToken;n+=l.text;this.consume()}this.mode=a;this.expect(r?"]":"}");return i.range(l,n)}},{key:"parseRegexGroup",value:function e(t,r){var a=this.mode;this.mode="text";var n=this.nextToken;var i=n;var l="";while(this.nextToken.text!=="EOF"&&t.test(l+this.nextToken.text)){i=this.nextToken;l+=i.text;this.consume()}if(l===""){throw new M.default("Invalid "+r+": '"+n.text+"'",n)}this.mode=a;return n.range(i,l)}},{key:"parseColorGroup",value:function e(t){var r=this.parseStringGroup("color",t);if(!r){return null}var a=/^(#[a-z0-9]+|[a-z]+)$/i.exec(r.text);if(!a){throw new M.default("Invalid color: '"+r.text+"'",r)}return new S(new b.default("color",a[0],this.mode),false)}},{key:"parseSizeGroup",value:function e(t){var r=void 0;if(!t&&this.nextToken.text!=="{"){r=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")}else{r=this.parseStringGroup("size",t)}if(!r){return null}var a=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(r.text);if(!a){throw new M.default("Invalid size: '"+r.text+"'",r)}var n={number:+(a[1]+a[2]),unit:a[3]};if(!y.default.validUnit(n)){throw new M.default("Invalid unit: '"+n.unit+"'",r)}return new S(new b.default("size",n,this.mode),false)}},{key:"parseGroup",value:function e(t){var r=this.nextToken;if(this.nextToken.text===(t?"[":"{")){this.consume();var a=this.parseExpression(false,t?"]":null);var n=this.nextToken;this.expect(t?"]":"}");if(this.mode==="text"){this.formLigatures(a)}return new S(new b.default("ordgroup",a,this.mode,r,n),false)}else{return t?null:this.parseSymbol()}}},{key:"formLigatures",value:function e(t){var r=t.length-1;for(var a=0;a=2}}]);return e}();var u=0;var c=1;var f=2;var h=3;var v=4;var d=5;var p=6;var m=7;var g=[new o(u,0,false),new o(c,0,true),new o(f,1,false),new o(h,1,true),new o(v,2,false),new o(d,2,true),new o(p,3,false),new o(m,3,true)];var y=[v,d,v,d,p,m,p,m];var x=[d,d,d,d,m,m,m,m];var w=[f,h,v,d,p,m,p,m];var b=[h,h,d,d,m,m,m,m];var k=[c,c,h,h,d,d,m,m];var M=[u,c,f,h,f,h,f,h];t.exports={DISPLAY:g[u],TEXT:g[f],SCRIPT:g[v],SCRIPTSCRIPT:g[p]}},{"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],34:[function(e,t,r){"use strict";var a=e("./domTree");var n=f(a);var i=e("./fontMetrics");var l=f(i);var s=e("./symbols");var o=f(s);var u=e("./utils");var c=f(u);function f(e){return e&&e.__esModule?e:{default:e}}var h=["\\imath","\\jmath","\\pounds"];var v=function e(t,r,a){if(o.default[a][t]&&o.default[a][t].replace){t=o.default[a][t].replace}return{value:t,metrics:l.default.getCharacterMetrics(t,r)}};var d=function e(t,r,a,i,l){var s=v(t,r,a);var o=s.metrics;t=s.value;var u=void 0;if(o){var c=o.italic;if(a==="text"){c=0}u=new n.default.symbolNode(t,o.height,o.depth,c,o.skew,l)}else{typeof console!=="undefined"&&console.warn("No character metrics for '"+t+"' in style '"+r+"'");u=new n.default.symbolNode(t,0,0,0,0,l)}if(i){u.maxFontSize=i.sizeMultiplier;if(i.style.isTight()){u.classes.push("mtight")}if(i.getColor()){u.style.color=i.getColor()}}return u};var p=function e(t,r,a,n){if(t==="\\"||o.default[r][t].font==="main"){return d(t,"Main-Regular",r,a,n)}else{return d(t,"AMS-Regular",r,a,n.concat(["amsrm"]))}};var m=function e(t,r,a,n,i){if(i==="mathord"){var l=g(t,r,a,n);return d(t,l.fontName,r,a,n.concat([l.fontClass]))}else if(i==="textord"){var s=o.default[r][t]&&o.default[r][t].font;if(s==="ams"){return d(t,"AMS-Regular",r,a,n.concat(["amsrm"]))}else{return d(t,"Main-Regular",r,a,n.concat(["mathrm"]))}}else{throw new Error("unexpected type: "+i+" in mathDefault")}};var g=function e(t,r,a,n){if(/[0-9]/.test(t.charAt(0))||c.default.contains(h,t)){ +return{fontName:"Main-Italic",fontClass:"mainit"}}else{return{fontName:"Math-Italic",fontClass:"mathit"}}};var y=function e(t,r,a){var n=t.mode;var i=t.value;var l=["mord"];var s=r.font;if(s){var o=void 0;if(s==="mathit"||c.default.contains(h,i)){o=g(i,n,r,l)}else{o=S[s]}if(v(i,o.fontName,n).metrics){return d(i,o.fontName,n,r,l.concat([o.fontClass||s]))}else{return m(i,n,r,l,a)}}else{return m(i,n,r,l,a)}};var x=function e(t){var r=0;var a=0;var n=0;if(t.children){for(var i=0;ir){r=t.children[i].height}if(t.children[i].depth>a){a=t.children[i].depth}if(t.children[i].maxFontSize>n){n=t.children[i].maxFontSize}}}t.height=r;t.depth=a;t.maxFontSize=n};var w=function e(t,r,a){var i=new n.default.span(t,r,a);x(i);return i};var b=function e(t,r){t.children=r.concat(t.children);x(t)};var k=function e(t){var r=new n.default.documentFragment(t);x(r);return r};var M=function e(t,r,a,i){var l=void 0;var s=void 0;var o=void 0;if(r==="individualShift"){var u=t;t=[u[0]];l=-u[0].shift-u[0].elem.depth;s=l;for(o=1;o0){s+=x;f-=x}}var w=[{type:"elem",elem:n,shift:f,marginRight:p},{type:"elem",elem:a,shift:-s,marginRight:p}];if(r instanceof d.default.symbolNode){w[0].marginLeft=-r.italic+"em"}m=c.default.makeVList(w,"individualShift",null,t)}var b=T(r)||"mord";return(0,u.makeSpan)([b],[r,(0,u.makeSpan)(["msupsub"],[m])],t)};E.genfrac=function(e,t){var r=t.style;if(e.value.size==="display"){r=o.default.DISPLAY}else if(e.value.size==="text"){r=o.default.TEXT}var a=r.fracNum();var n=r.fracDen();var i=void 0;i=t.havingStyle(a);var l=L(e.value.numer,i,t);i=t.havingStyle(n);var s=L(e.value.denom,i,t);var f=void 0;var v=void 0;var d=void 0;if(e.value.hasBarLine){f=B("frac-line",t);v=f.height;d=f.height}else{f=null;v=0;d=t.fontMetrics().defaultRuleThickness}var p=void 0;var m=void 0;var g=void 0;if(r.size===o.default.DISPLAY.size){p=t.fontMetrics().num1;if(v>0){m=3*d}else{m=7*d}g=t.fontMetrics().denom1}else{if(v>0){p=t.fontMetrics().num2;m=d}else{p=t.fontMetrics().num3;m=3*d}g=t.fontMetrics().denom2}var y=void 0;if(v===0){var x=p-l.depth-(s.height-g);if(x0){A+=x;if(M=i){continue}var O=void 0;if(a>0||e.value.hskipBeforeAndAfter){O=y.default.deflt(_.pregap,f);if(O!==0){R=(0,u.makeSpan)(["arraycolsep"],[]);R.style.width=O+"em";N.push(R)}}var P=[];for(r=0;rr.height+r.depth+l){l=(l+p-r.height-r.depth)/2}var m=f.height-r.height-l-v;var g=void 0;if(r.height===0&&r.depth===0){g=(0,u.makeSpan)()}else{r.style.paddingLeft=f.surdWidth+"em";g=c.default.makeVList([{type:"elem",elem:r},{type:"kern",size:-(r.height+m)},{type:"elem",elem:f},{type:"kern",size:v}],"firstBaseline",null,t);g.children[0].children[0].classes.push("svg-align")}if(!e.value.index){return(0,u.makeSpan)(["mord","sqrt"],[g],t)}else{var y=t.havingStyle(o.default.SCRIPTSCRIPT);var x=L(e.value.index,y,t);var w=.6*(g.height-g.depth);var b=c.default.makeVList([{type:"elem",elem:x}],"shift",-w,t);var k=(0,u.makeSpan)(["root"],[b]);return(0,u.makeSpan)(["mord","sqrt"],[k,g],t)}};function O(e,t,r){var a=C(e,t,false);var n=t.sizeMultiplier/r.sizeMultiplier;for(var i=0;i0){m.style.width="calc(100% - "+2*s+"em)";m.style.marginLeft=2*s+"em"}}var g=(0,u.makeSpan)(["mord","accent"],[v],t);if(a){a.children[0]=g;a.height=Math.max(g.height,a.height);a.classes[0]="mord";return a}else{return g}};E.horizBrace=function(e,t){var r=t.style;var a=e.type==="supsub";var n=void 0;var i=void 0;if(a){if(e.value.sup){i=t.havingStyle(r.sup());n=L(e.value.sup,i,t)}else{i=t.havingStyle(r.sub());n=L(e.value.sub,i,t)}e=e.value.base}var l=L(e.value.base,t.havingBaseStyle(o.default.DISPLAY));var s=w.default.svgSpan(e,t);var f=void 0;if(e.value.isOver){f=c.default.makeVList([{type:"elem",elem:l},{type:"kern",size:.1},{type:"elem",elem:s}],"firstBaseline",null,t);f.children[0].children[0].children[1].classes.push("svg-align")}else{f=c.default.makeVList([{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:l}],"bottom",l.depth+.1+s.height,t);f.children[0].children[0].children[0].classes.push("svg-align")}if(a){var h=(0,u.makeSpan)(["mord",e.value.isOver?"mover":"munder"],[f],t);if(e.value.isOver){f=c.default.makeVList([{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:n}],"firstBaseline",null,t)}else{f=c.default.makeVList([{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:h}],"bottom",h.depth+.2+n.height,t)}}return(0,u.makeSpan)(["mord",e.value.isOver?"mover":"munder"],[f],t)};E.accentUnder=function(e,t){var r=L(e.value.body,t);var a=w.default.svgSpan(e,t);var n=/tilde/.test(e.value.label)?.12:0;var i=c.default.makeVList([{type:"elem",elem:a},{type:"kern",size:n},{type:"elem",elem:r}],"bottom",a.height+n,t);i.children[0].children[0].children[0].classes.push("svg-align");return(0,u.makeSpan)(["mord","accentunder"],[i],t)};E.enclose=function(e,t){var r=L(e.value.body,t);var a=e.value.label.substr(1);var n=t.sizeMultiplier;var i=void 0;var l=0;var s=0;if(a==="sout"){i=(0,u.makeSpan)(["stretchy","sout"]);i.height=t.fontMetrics().defaultRuleThickness/n;s=-.5*t.fontMetrics().xHeight}else{r.classes.push(a==="fbox"?"boxpad":"cancel-pad");var o=q(e.value.body);l=a==="fbox"?.34:o?.2:0;s=r.depth+l;i=w.default.encloseSpan(r,a,l,t)}var f=c.default.makeVList([{type:"elem",elem:r,shift:0},{type:"elem",elem:i,shift:s}],"individualShift",null,t);if(a!=="fbox"){f.children[0].children[0].children[1].classes.push("svg-align")}if(/cancel/.test(a)){return(0,u.makeSpan)(["mord","cancel-lap"],[f],t)}else{return(0,u.makeSpan)(["mord"],[f],t)}};E.xArrow=function(e,t){var r=t.style;var a=t.havingStyle(r.sup());var n=L(e.value.body,a,t);n.classes.push("x-arrow-pad");var i=void 0;if(e.value.below){a=t.havingStyle(r.sub());i=L(e.value.below,a,t);i.classes.push("x-arrow-pad")}var l=w.default.svgSpan(e,t);var s=-t.fontMetrics().axisHeight+l.depth;var o=-t.fontMetrics().axisHeight-l.height-.111;var f=void 0;if(e.value.below){var h=-t.fontMetrics().axisHeight+i.height+l.height+.111;f=c.default.makeVList([{type:"elem",elem:n,shift:o},{type:"elem",elem:l,shift:s},{type:"elem",elem:i,shift:h}],"individualShift",null,t)}else{f=c.default.makeVList([{type:"elem",elem:n,shift:o},{type:"elem",elem:l,shift:s}],"individualShift",null,t)}f.children[0].children[0].children[1].classes.push("svg-align");return(0,u.makeSpan)(["mrel","x-arrow"],[f],t)};E.phantom=function(e,t){var r=C(e.value.value,t.withPhantom(),false);return new c.default.makeFragment(r)};E.mclass=function(e,t){var r=C(e.value.value,t,true);return(0,u.makeSpan)([e.value.mclass],r,t)};var L=function e(t,r,a){if(!t){return(0,u.makeSpan)()}if(E[t.type]){var n=E[t.type](t,r);if(a&&r.size!==a.size){n=(0,u.makeSpan)(r.sizingClasses(a),[n],r);var i=r.sizeMultiplier/a.sizeMultiplier;n.height*=i;n.depth*=i}return n}else{throw new l.default("Got group of unknown type: '"+t.type+"'")}};var P=function e(t,r){t=JSON.parse((0,n.default)(t));var a=C(t,r,true);var i=(0,u.makeSpan)(["base"],a,r);var l=(0,u.makeSpan)(["strut"]);var s=(0,u.makeSpan)(["strut","bottom"]);l.style.height=i.height+"em";s.style.height=i.height+i.depth+"em";s.style.verticalAlign=-i.depth+"em";var o=(0,u.makeSpan)(["katex-html"],[l,s,i]);o.setAttribute("aria-hidden","true");return o};t.exports=P},{"./ParseError":29,"./Style":33,"./buildCommon":34,"./delimiter":38,"./domTree":39,"./stretchy":47,"./units":50,"./utils":51,"babel-runtime/core-js/json/stringify":2}],36:[function(e,t,r){"use strict";var a=e("./buildCommon");var n=x(a);var i=e("./fontMetrics");var l=x(i);var s=e("./mathMLTree");var o=x(s);var u=e("./ParseError");var c=x(u);var f=e("./Style");var h=x(f);var v=e("./symbols");var d=x(v);var p=e("./utils");var m=x(p);var g=e("./stretchy");var y=x(g);function x(e){return e&&e.__esModule?e:{default:e}}var w=function e(t,r){if(d.default[r][t]&&d.default[r][t].replace){t=d.default[r][t].replace}return new o.default.TextNode(t)};var b=function e(t,r){var n=r.font;if(!n){return null}var i=t.mode;if(n==="mathit"){return"italic"}var s=t.value;if(m.default.contains(["\\imath","\\jmath"],s)){return null}if(d.default[i][s]&&d.default[i][s].replace){s=d.default[i][s].replace}var o=a.fontMap[n].fontName;if(l.default.getCharacterMetrics(s,o)){return a.fontMap[r.font].variant}return null};var k={};var M={mi:"italic",mn:"normal",mtext:"normal"};k.mathord=function(e,t){var r=new o.default.MathNode("mi",[w(e.value,e.mode)]);var a=b(e,t)||"italic";if(a!==M[r.type]){r.setAttribute("mathvariant",a)}return r};k.textord=function(e,t){var r=w(e.value,e.mode);var a=b(e,t)||"normal";var n=void 0;if(e.mode==="text"){n=new o.default.MathNode("mtext",[r])}else if(/[0-9]/.test(e.value)){n=new o.default.MathNode("mn",[r])}else if(e.value==="\\prime"){n=new o.default.MathNode("mo",[r])}else{n=new o.default.MathNode("mi",[r])}if(a!==M[n.type]){n.setAttribute("mathvariant",a)}return n};k.bin=function(e){var t=new o.default.MathNode("mo",[w(e.value,e.mode)]);return t};k.rel=function(e){var t=new o.default.MathNode("mo",[w(e.value,e.mode)]);return t};k.open=function(e){var t=new o.default.MathNode("mo",[w(e.value,e.mode)]);return t};k.close=function(e){var t=new o.default.MathNode("mo",[w(e.value,e.mode)]);return t};k.inner=function(e){var t=new o.default.MathNode("mo",[w(e.value,e.mode)]);return t};k.punct=function(e){var t=new o.default.MathNode("mo",[w(e.value,e.mode)]);t.setAttribute("separator","true");return t};k.ordgroup=function(e,t){var r=z(e.value,t);var a=new o.default.MathNode("mrow",r);return a};k.text=function(e,t){var r=e.value.body;var a=[];var n=null;for(var i=0;i2&&arguments[2]!==undefined?arguments[2]:false;if(!t){return new o.default.MathNode("mrow")}if(k[t.type]){var n=k[t.type](t,r);if(a){if(n.type==="mrow"&&n.children.length===1){return n.children[0]}}return n}else{throw new c.default("Got group of unknown type: '"+t.type+"'")}};var A=function e(t,r,n){var i=z(t,n);var l=new o.default.MathNode("mrow",i);var s=new o.default.MathNode("annotation",[new o.default.TextNode(r)]);s.setAttribute("encoding","application/x-tex");var u=new o.default.MathNode("semantics",[l,s]);var c=new o.default.MathNode("math",[u]);return(0,a.makeSpan)(["katex-mathml"],[c])};t.exports=A},{"./ParseError":29,"./Style":33,"./buildCommon":34,"./fontMetrics":41,"./mathMLTree":45,"./stretchy":47,"./symbols":48,"./utils":51}],37:[function(e,t,r){"use strict";var a=e("./buildHTML");var n=d(a);var i=e("./buildMathML");var l=d(i);var s=e("./buildCommon");var o=e("./Options");var u=d(o);var c=e("./Settings");var f=d(c);var h=e("./Style");var v=d(h);function d(e){return e&&e.__esModule?e:{default:e}}var p=function e(t,r,a){a=a||new f.default({});var i=v.default.TEXT;if(a.displayMode){i=v.default.DISPLAY}var o=new u.default({style:i});var c=(0,l.default)(t,r,o);var h=(0,n.default)(t,o);var d=(0,s.makeSpan)(["katex"],[c,h]);if(a.displayMode){return(0,s.makeSpan)(["katex-display"],[d])}else{return d}};t.exports=p},{"./Options":28,"./Settings":32,"./Style":33,"./buildCommon":34,"./buildHTML":35,"./buildMathML":36}],38:[function(e,t,r){"use strict";var a=e("./ParseError");var n=p(a);var i=e("./Style");var l=p(i);var s=e("./buildCommon");var o=p(s);var u=e("./fontMetrics");var c=p(u);var f=e("./symbols");var h=p(f);var v=e("./utils");var d=p(v);function p(e){return e&&e.__esModule?e:{default:e}}var m=function e(t,r){if(h.default.math[t]&&h.default.math[t].replace){return c.default.getCharacterMetrics(h.default.math[t].replace,r)}else{return c.default.getCharacterMetrics(t,r)}};var g=function e(t,r,a,n){var i=a.havingBaseStyle(r);var l=(0,s.makeSpan)((n||[]).concat(i.sizingClasses(a)),[t],a);l.delimSizeMultiplier=i.sizeMultiplier/a.sizeMultiplier;l.height*=l.delimSizeMultiplier;l.depth*=l.delimSizeMultiplier;l.maxFontSize=i.sizeMultiplier;return l};var y=function e(t,r,a){var n=r.havingBaseStyle(a);var i=(1-r.sizeMultiplier/n.sizeMultiplier)*r.fontMetrics().axisHeight;t.classes.push("delimcenter");t.style.top=i+"em";t.height-=i;t.depth+=i};var x=function e(t,r,a,n,i,l){var s=o.default.makeSymbol(t,"Main-Regular",i,n);var u=g(s,r,n,l);if(a){y(u,n,r)}return u};var w=function e(t,r,a,n){return o.default.makeSymbol(t,"Size"+r+"-Regular",a,n)};var b=function e(t,r,a,n,i,o){var u=w(t,r,i,n);var c=g((0,s.makeSpan)(["delimsizing","size"+r],[u],n),l.default.TEXT,n,o);if(a){y(c,n,l.default.TEXT)}return c};var k=function e(t,r,a){var n=void 0;if(r==="Size1-Regular"){n="delim-size1"}else if(r==="Size4-Regular"){n="delim-size4"}var i=(0,s.makeSpan)(["delimsizinginner",n],[(0,s.makeSpan)([],[o.default.makeSymbol(t,r,a)])]);return{type:"elem",elem:i}};var M=function e(t,r,a,n,i,u){var c=void 0;var f=void 0;var h=void 0;var v=void 0;c=h=v=t;f=null;var d="Size1-Regular";if(t==="\\uparrow"){h=v="\u23d0"}else if(t==="\\Uparrow"){h=v="\u2016"}else if(t==="\\downarrow"){c=h="\u23d0"}else if(t==="\\Downarrow"){c=h="\u2016"}else if(t==="\\updownarrow"){c="\\uparrow";h="\u23d0";v="\\downarrow"}else if(t==="\\Updownarrow"){c="\\Uparrow";h="\u2016";v="\\Downarrow"}else if(t==="["||t==="\\lbrack"){c="\u23a1";h="\u23a2";v="\u23a3";d="Size4-Regular"}else if(t==="]"||t==="\\rbrack"){c="\u23a4";h="\u23a5";v="\u23a6";d="Size4-Regular"}else if(t==="\\lfloor"){h=c="\u23a2";v="\u23a3";d="Size4-Regular"}else if(t==="\\lceil"){c="\u23a1";h=v="\u23a2";d="Size4-Regular"}else if(t==="\\rfloor"){h=c="\u23a5";v="\u23a6";d="Size4-Regular"}else if(t==="\\rceil"){c="\u23a4";h=v="\u23a5";d="Size4-Regular"}else if(t==="("){c="\u239b";h="\u239c";v="\u239d";d="Size4-Regular"}else if(t===")"){c="\u239e";h="\u239f";v="\u23a0";d="Size4-Regular"}else if(t==="\\{"||t==="\\lbrace"){c="\u23a7";f="\u23a8";v="\u23a9";h="\u23aa";d="Size4-Regular"}else if(t==="\\}"||t==="\\rbrace"){c="\u23ab";f="\u23ac";v="\u23ad";h="\u23aa";d="Size4-Regular"}else if(t==="\\lgroup"){c="\u23a7";v="\u23a9";h="\u23aa";d="Size4-Regular"}else if(t==="\\rgroup"){c="\u23ab";v="\u23ad";h="\u23aa";d="Size4-Regular"}else if(t==="\\lmoustache"){c="\u23a7";v="\u23ad";h="\u23aa";d="Size4-Regular"}else if(t==="\\rmoustache"){c="\u23ab";v="\u23a9";h="\u23aa";d="Size4-Regular"}var p=m(c,d);var y=p.height+p.depth;var x=m(h,d);var w=x.height+x.depth;var b=m(v,d);var M=b.height+b.depth;var z=0;var S=1;if(f!==null){var A=m(f,d);z=A.height+A.depth;S=2}var C=y+M+z;var T=Math.ceil((r-C)/(S*w));var N=C+T*S*w;var R=n.fontMetrics().axisHeight;if(a){R*=n.sizeMultiplier}var q=N/2-R;var _=[];_.push(k(v,d,i));if(f===null){for(var E=0;E",1:"",2:"",3:"",4:"",tall:"l-4 4-4 4c-.667.667-2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1h\n-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170c-4-3.333-8.333\n-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 219 661 l218 661z\nM702 0H400000v40H742z'/>"};var S=function e(t,r,a){var n=o.default.makeSpan([],[],a);var i=a.sizeMultiplier;if(r.type==="small"){var l=a.havingBaseStyle(r.style);i=l.sizeMultiplier/a.sizeMultiplier;n.height=1*i;n.style.height=n.height+"em";n.surdWidth=.833*i;n.innerHTML="\n "+z["main"]+""}else if(r.type==="large"){n.height=N[r.size]/i;n.style.height=n.height+"em";n.surdWidth=1/i;n.innerHTML='\n '+z[r.size]+""}else{n.height=t/i;n.style.height=n.height+"em";n.surdWidth=1.056/i;var s=Math.floor(n.height*1e3);var u=s-54;n.innerHTML="\n \n r){return a[l]}}return a[a.length-1]};var L=function e(t,r,a,n,i,l){if(t==="<"||t==="\\lt"){t="\\langle"}else if(t===">"||t==="\\gt"){t="\\rangle"}var s=void 0;if(d.default.contains(T,t)){s=q}else if(d.default.contains(A,t)){s=E}else{s=_}var o=O(t,r,s,n);if(t==="\\surd"){return S(r,o,n)}else{if(o.type==="small"){return x(t,o.style,a,n,i,l)}else if(o.type==="large"){return b(t,o.size,a,n,i,l)}else if(o.type==="stack"){return M(t,r,a,n,i,l)}}};var P=function e(t,r,a,n,i,l){var s=n.fontMetrics().axisHeight*n.sizeMultiplier;var o=901;var u=5/n.fontMetrics().ptPerEm;var c=Math.max(r-s,a+s);var f=Math.max(c/500*o,2*c-u);return L(t,f,true,n,i,l)};t.exports={sizedDelim:R,customSizedDelim:L,leftRightDelim:P}},{"./ParseError":29,"./Style":33,"./buildCommon":34,"./fontMetrics":41,"./symbols":48,"./utils":51}],39:[function(e,t,r){"use strict";var a=e("babel-runtime/helpers/classCallCheck");var n=f(a);var i=e("babel-runtime/helpers/createClass");var l=f(i);var s=e("./unicodeRegexes");var o=f(s);var u=e("./utils");var c=f(u);function f(e){return e&&e.__esModule?e:{default:e}}var h=function e(t){t=t.slice();for(var r=t.length-1;r>=0;r--){if(!t[r]){t.splice(r,1)}}return t.join(" ")};var v=function(){function e(t,r,a){(0,n.default)(this,e);this.classes=t||[];this.children=r||[];this.height=0;this.depth=0;this.maxFontSize=0;this.style={};this.attributes={};this.innerHTML;if(a){if(a.style.isTight()){this.classes.push("mtight")}if(a.getColor()){this.style.color=a.getColor()}}}(0,l.default)(e,[{key:"setAttribute",value:function e(t,r){this.attributes[t]=r}},{key:"tryCombine",value:function e(t){return false}},{key:"toNode",value:function e(){var t=document.createElement("span");t.className=h(this.classes);for(var r in this.style){if(Object.prototype.hasOwnProperty.call(this.style,r)){t.style[r]=this.style[r]}}for(var a in this.attributes){if(Object.prototype.hasOwnProperty.call(this.attributes,a)){t.setAttribute(a,this.attributes[a])}}if(this.innerHTML){t.innerHTML=this.innerHTML}for(var n=0;n";return t}}]);return e}();var d=function(){function e(t){(0,n.default)(this,e);this.children=t||[];this.height=0;this.depth=0;this.maxFontSize=0}(0,l.default)(e,[{key:"toNode",value:function e(){var t=document.createDocumentFragment();for(var r=0;r0||h(this.classes)!==h(r.classes)||this.skew!==r.skew||this.maxFontSize!==r.maxFontSize){return false}for(var a in this.style){if(this.style.hasOwnProperty(a)&&this.style[a]!==r.style[a]){return false}}for(var n in r.style){if(r.style.hasOwnProperty(n)&&this.style[n]!==r.style[n]){return false}}this.value+=r.value;this.height=Math.max(this.height,r.height);this.depth=Math.max(this.depth,r.depth);this.italic=r.italic;return true}},{key:"toNode",value:function e(){var t=document.createTextNode(this.value);var r=null;if(this.italic>0){r=document.createElement("span");r.style.marginRight=this.italic+"em"}if(this.classes.length>0){r=r||document.createElement("span");r.className=h(this.classes)}for(var a in this.style){if(this.style.hasOwnProperty(a)){r=r||document.createElement("span");r.style[a]=this.style[a]}}if(r){r.appendChild(t);return r}else{return t}}},{key:"toMarkup",value:function e(){var t=false;var r="0){a+="margin-right:"+this.italic+"em;"}for(var n in this.style){if(this.style.hasOwnProperty(n)){a+=c.default.hyphenate(n)+":"+this.style[n]+";"}}if(a){t=true;r+=' style="'+c.default.escape(a)+'"'}var i=c.default.escape(this.value);if(t){r+=">";r+=i;r+="";return r}else{return i}}}]);return e}();t.exports={span:v,documentFragment:d,symbolNode:m}},{"./unicodeRegexes":49,"./utils":51,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],40:[function(e,t,r){"use strict";var a=e("./ParseNode");var n=s(a);var i=e("./ParseError");var l=s(i);function s(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){var a=[];var i=[a];var s=[];while(true){var o=e.parseExpression(false,null);o=new n.default("ordgroup",o,e.mode);if(r){o=new n.default("styling",{style:r,value:[o]},e.mode)}a.push(o);var u=e.nextToken.text;if(u==="&"){e.consume()}else if(u==="\\end"){break}else if(u==="\\\\"||u==="\\cr"){var c=e.parseFunction();s.push(c.value.size);a=[];i.push(a)}else{throw new l.default("Expected & or \\\\ or \\end",e.nextToken)}}t.body=i;t.rowGaps=s;return new n.default(t.type,t,e.mode)}function u(e,r,a){if(typeof e==="string"){e=[e]}if(typeof r==="number"){r={numArgs:r}}var n={numArgs:r.numArgs||0,argTypes:r.argTypes,greediness:1,allowedInText:!!r.allowedInText,numOptionalArgs:r.numOptionalArgs||0,handler:a};for(var i=0;i0){s=2}t.value.cols[i]={type:"align",align:l,pregap:s,postgap:0}}return t});u("gathered",{},function(e){var t={type:"array",cols:[{type:"align",align:"c"}],addJot:true};t=o(e.parser,t,"display");return t})},{"./ParseError":29,"./ParseNode":30}],41:[function(e,t,r){"use strict";var a=e("./unicodeRegexes");var n=e("./fontMetricsData");var i=l(n);function l(e){return e&&e.__esModule?e:{default:e}}var s={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2]};var o={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xc6":"A","\xc7":"C","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xd0":"D","\xd1":"N","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xdd":"Y","\xde":"o","\xdf":"B","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xe6":"a","\xe7":"c","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xf0":"d","\xf1":"n","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xfd":"y","\xfe":"o","\xff":"y","\u0410":"A","\u0411":"B","\u0412":"B","\u0413":"F","\u0414":"A","\u0415":"E","\u0416":"K","\u0417":"3","\u0418":"N","\u0419":"N","\u041a":"K","\u041b":"N","\u041c":"M","\u041d":"H","\u041e":"O","\u041f":"N","\u0420":"P","\u0421":"C","\u0422":"T","\u0423":"y","\u0424":"O","\u0425":"X","\u0426":"U","\u0427":"h","\u0428":"W","\u0429":"W","\u042a":"B","\u042b":"X","\u042c":"B","\u042d":"3","\u042e":"X","\u042f":"R","\u0430":"a","\u0431":"b","\u0432":"a","\u0433":"r","\u0434":"y","\u0435":"e","\u0436":"m","\u0437":"e","\u0438":"n","\u0439":"n","\u043a":"n","\u043b":"n","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"n","\u0440":"p","\u0441":"c","\u0442":"o","\u0443":"y","\u0444":"b","\u0445":"x","\u0446":"n","\u0447":"n","\u0448":"w","\u0449":"w","\u044a":"a","\u044b":"m","\u044c":"a","\u044d":"e","\u044e":"m","\u044f":"r"};var u=function e(t,r){var n=t.charCodeAt(0);if(t[0]in o){n=o[t[0]].charCodeAt(0)}else if(a.cjkRegex.test(t[0])){n="M".charCodeAt(0)}var l=i.default[r][n];if(l){return{depth:l[0],height:l[1],italic:l[2],skew:l[3],width:l[4]}}};var c={};var f=function e(t){var r=void 0;if(t>=5){r=0}else if(t>=3){r=1}else{r=2}if(!c[r]){var a=c[r]={};for(var n in s){if(s.hasOwnProperty(n)){a[n]=s[n][r]}}a.cssEmPerMu=a.quad/18}return c[r]};t.exports={getFontMetrics:f,getCharacterMetrics:u}},{"./fontMetricsData":42,"./unicodeRegexes":49}],42:[function(e,t,r){"use strict";t.exports={"AMS-Regular":{65:[0,.68889,0,0],66:[0,.68889,0,0],67:[0,.68889,0,0],68:[0,.68889,0,0],69:[0,.68889,0,0],70:[0,.68889,0,0],71:[0,.68889,0,0],72:[0,.68889,0,0],73:[0,.68889,0,0],74:[.16667,.68889,0,0],75:[0,.68889,0,0],76:[0,.68889,0,0],77:[0,.68889,0,0],78:[0,.68889,0,0],79:[.16667,.68889,0,0],80:[0,.68889,0,0],81:[.16667,.68889,0,0],82:[0,.68889,0,0],83:[0,.68889,0,0],84:[0,.68889,0,0],85:[0,.68889,0,0],86:[0,.68889,0,0],87:[0,.68889,0,0],88:[0,.68889,0,0],89:[0,.68889,0,0],90:[0,.68889,0,0],107:[0,.68889,0,0],165:[0,.675,.025,0],174:[.15559,.69224,0,0],240:[0,.68889,0,0],295:[0,.68889,0,0],710:[0,.825,0,0],732:[0,.9,0,0],770:[0,.825,0,0],771:[0,.9,0,0],989:[.08167,.58167,0,0],1008:[0,.43056,.04028,0],8245:[0,.54986,0,0],8463:[0,.68889,0,0],8487:[0,.68889,0,0],8498:[0,.68889,0,0],8502:[0,.68889,0,0],8503:[0,.68889,0,0],8504:[0,.68889,0,0],8513:[0,.68889,0,0],8592:[-.03598,.46402,0,0],8594:[-.03598,.46402,0,0],8602:[-.13313,.36687,0,0],8603:[-.13313,.36687,0,0],8606:[.01354,.52239,0,0],8608:[.01354,.52239,0,0],8610:[.01354,.52239,0,0],8611:[.01354,.52239,0,0],8619:[0,.54986,0,0],8620:[0,.54986,0,0],8621:[-.13313,.37788,0,0],8622:[-.13313,.36687,0,0],8624:[0,.69224,0,0],8625:[0,.69224,0,0],8630:[0,.43056,0,0],8631:[0,.43056,0,0],8634:[.08198,.58198,0,0],8635:[.08198,.58198,0,0],8638:[.19444,.69224,0,0],8639:[.19444,.69224,0,0],8642:[.19444,.69224,0,0],8643:[.19444,.69224,0,0],8644:[.1808,.675,0,0],8646:[.1808,.675,0,0],8647:[.1808,.675,0,0],8648:[.19444,.69224,0,0],8649:[.1808,.675,0,0],8650:[.19444,.69224,0,0],8651:[.01354,.52239,0,0],8652:[.01354,.52239,0,0],8653:[-.13313,.36687,0,0],8654:[-.13313,.36687,0,0],8655:[-.13313,.36687,0,0],8666:[.13667,.63667,0,0],8667:[.13667,.63667,0,0],8669:[-.13313,.37788,0,0],8672:[-.064,.437,0,0],8674:[-.064,.437,0,0],8705:[0,.825,0,0],8708:[0,.68889,0,0],8709:[.08167,.58167,0,0],8717:[0,.43056,0,0],8722:[-.03598,.46402,0,0],8724:[.08198,.69224,0,0],8726:[.08167,.58167,0,0],8733:[0,.69224,0,0],8736:[0,.69224,0,0],8737:[0,.69224,0,0],8738:[.03517,.52239,0,0],8739:[.08167,.58167,0,0],8740:[.25142,.74111,0,0],8741:[.08167,.58167,0,0],8742:[.25142,.74111,0,0],8756:[0,.69224,0,0],8757:[0,.69224,0,0],8764:[-.13313,.36687,0,0],8765:[-.13313,.37788,0,0],8769:[-.13313,.36687,0,0],8770:[-.03625,.46375,0,0],8774:[.30274,.79383,0,0],8776:[-.01688,.48312,0,0],8778:[.08167,.58167,0,0],8782:[.06062,.54986,0,0],8783:[.06062,.54986,0,0],8785:[.08198,.58198,0,0],8786:[.08198,.58198,0,0],8787:[.08198,.58198,0,0],8790:[0,.69224,0,0],8791:[.22958,.72958,0,0],8796:[.08198,.91667,0,0],8806:[.25583,.75583,0,0],8807:[.25583,.75583,0,0],8808:[.25142,.75726,0,0],8809:[.25142,.75726,0,0],8812:[.25583,.75583,0,0],8814:[.20576,.70576,0,0],8815:[.20576,.70576,0,0],8816:[.30274,.79383,0,0],8817:[.30274,.79383,0,0],8818:[.22958,.72958,0,0],8819:[.22958,.72958,0,0],8822:[.1808,.675,0,0],8823:[.1808,.675,0,0],8828:[.13667,.63667,0,0],8829:[.13667,.63667,0,0],8830:[.22958,.72958,0,0],8831:[.22958,.72958,0,0],8832:[.20576,.70576,0,0],8833:[.20576,.70576,0,0],8840:[.30274,.79383,0,0],8841:[.30274,.79383,0,0],8842:[.13597,.63597,0,0],8843:[.13597,.63597,0,0],8847:[.03517,.54986,0,0],8848:[.03517,.54986,0,0],8858:[.08198,.58198,0,0],8859:[.08198,.58198,0,0],8861:[.08198,.58198,0,0],8862:[0,.675,0,0],8863:[0,.675,0,0],8864:[0,.675,0,0],8865:[0,.675,0,0],8872:[0,.69224,0,0],8873:[0,.69224,0,0],8874:[0,.69224,0,0],8876:[0,.68889,0,0],8877:[0,.68889,0,0],8878:[0,.68889,0,0],8879:[0,.68889,0,0],8882:[.03517,.54986,0,0],8883:[.03517,.54986,0,0],8884:[.13667,.63667,0,0],8885:[.13667,.63667,0,0],8888:[0,.54986,0,0],8890:[.19444,.43056,0,0],8891:[.19444,.69224,0,0],8892:[.19444,.69224,0,0],8901:[0,.54986,0,0],8903:[.08167,.58167,0,0],8905:[.08167,.58167,0,0],8906:[.08167,.58167,0,0],8907:[0,.69224,0,0],8908:[0,.69224,0,0],8909:[-.03598,.46402,0,0],8910:[0,.54986,0,0],8911:[0,.54986,0,0],8912:[.03517,.54986,0,0],8913:[.03517,.54986,0,0],8914:[0,.54986,0,0],8915:[0,.54986,0,0],8916:[0,.69224,0,0],8918:[.0391,.5391,0,0],8919:[.0391,.5391,0,0],8920:[.03517,.54986,0,0],8921:[.03517,.54986,0,0],8922:[.38569,.88569,0,0],8923:[.38569,.88569,0,0],8926:[.13667,.63667,0,0],8927:[.13667,.63667,0,0],8928:[.30274,.79383,0,0],8929:[.30274,.79383,0,0],8934:[.23222,.74111,0,0],8935:[.23222,.74111,0,0],8936:[.23222,.74111,0,0],8937:[.23222,.74111,0,0],8938:[.20576,.70576,0,0],8939:[.20576,.70576,0,0],8940:[.30274,.79383,0,0],8941:[.30274,.79383,0,0],8994:[.19444,.69224,0,0],8995:[.19444,.69224,0,0],9416:[.15559,.69224,0,0],9484:[0,.69224,0,0],9488:[0,.69224,0,0],9492:[0,.37788,0,0],9496:[0,.37788,0,0],9585:[.19444,.68889,0,0],9586:[.19444,.74111,0,0],9632:[0,.675,0,0],9633:[0,.675,0,0],9650:[0,.54986,0,0],9651:[0,.54986,0,0],9654:[.03517,.54986,0,0],9660:[0,.54986,0,0],9661:[0,.54986,0,0],9664:[.03517,.54986,0,0],9674:[.11111,.69224,0,0],9733:[.19444,.69224,0,0],10003:[0,.69224,0,0],10016:[0,.69224,0,0],10731:[.11111,.69224,0,0],10846:[.19444,.75583,0,0],10877:[.13667,.63667,0,0],10878:[.13667,.63667,0,0],10885:[.25583,.75583,0,0],10886:[.25583,.75583,0,0],10887:[.13597,.63597,0,0],10888:[.13597,.63597,0,0],10889:[.26167,.75726,0,0],10890:[.26167,.75726,0,0],10891:[.48256,.98256,0,0],10892:[.48256,.98256,0,0],10901:[.13667,.63667,0,0],10902:[.13667,.63667,0,0],10933:[.25142,.75726,0,0],10934:[.25142,.75726,0,0],10935:[.26167,.75726,0,0],10936:[.26167,.75726,0,0],10937:[.26167,.75726,0,0],10938:[.26167,.75726,0,0],10949:[.25583,.75583,0,0],10950:[.25583,.75583,0,0],10955:[.28481,.79383,0,0],10956:[.28481,.79383,0,0],57350:[.08167,.58167,0,0],57351:[.08167,.58167,0,0],57352:[.08167,.58167,0,0],57353:[0,.43056,.04028,0],57356:[.25142,.75726,0,0],57357:[.25142,.75726,0,0],57358:[.41951,.91951,0,0],57359:[.30274,.79383,0,0],57360:[.30274,.79383,0,0],57361:[.41951,.91951,0,0],57366:[.25142,.75726,0,0],57367:[.25142,.75726,0,0],57368:[.25142,.75726,0,0],57369:[.25142,.75726,0,0],57370:[.13597,.63597,0,0],57371:[.13597,.63597,0,0]},"Caligraphic-Regular":{48:[0,.43056,0,0],49:[0,.43056,0,0],50:[0,.43056,0,0],51:[.19444,.43056,0,0],52:[.19444,.43056,0,0],53:[.19444,.43056,0,0],54:[0,.64444,0,0],55:[.19444,.43056,0,0],56:[0,.64444,0,0],57:[.19444,.43056,0,0],65:[0,.68333,0,.19445],66:[0,.68333,.03041,.13889],67:[0,.68333,.05834,.13889],68:[0,.68333,.02778,.08334],69:[0,.68333,.08944,.11111],70:[0,.68333,.09931,.11111],71:[.09722,.68333,.0593,.11111],72:[0,.68333,.00965,.11111],73:[0,.68333,.07382,0],74:[.09722,.68333,.18472,.16667],75:[0,.68333,.01445,.05556],76:[0,.68333,0,.13889],77:[0,.68333,0,.13889],78:[0,.68333,.14736,.08334],79:[0,.68333,.02778,.11111],80:[0,.68333,.08222,.08334],81:[.09722,.68333,0,.11111],82:[0,.68333,0,.08334],83:[0,.68333,.075,.13889],84:[0,.68333,.25417,0],85:[0,.68333,.09931,.08334],86:[0,.68333,.08222,0],87:[0,.68333,.08222,.08334],88:[0,.68333,.14643,.13889],89:[.09722,.68333,.08222,.08334],90:[0,.68333,.07944,.13889]},"Fraktur-Regular":{33:[0,.69141,0,0],34:[0,.69141,0,0],38:[0,.69141,0,0],39:[0,.69141,0,0],40:[.24982,.74947,0,0],41:[.24982,.74947,0,0],42:[0,.62119,0,0],43:[.08319,.58283,0,0],44:[0,.10803,0,0],45:[.08319,.58283,0,0],46:[0,.10803,0,0],47:[.24982,.74947,0,0],48:[0,.47534,0,0],49:[0,.47534,0,0],50:[0,.47534,0,0],51:[.18906,.47534,0,0],52:[.18906,.47534,0,0],53:[.18906,.47534,0,0],54:[0,.69141,0,0],55:[.18906,.47534,0,0],56:[0,.69141,0,0],57:[.18906,.47534,0,0], +58:[0,.47534,0,0],59:[.12604,.47534,0,0],61:[-.13099,.36866,0,0],63:[0,.69141,0,0],65:[0,.69141,0,0],66:[0,.69141,0,0],67:[0,.69141,0,0],68:[0,.69141,0,0],69:[0,.69141,0,0],70:[.12604,.69141,0,0],71:[0,.69141,0,0],72:[.06302,.69141,0,0],73:[0,.69141,0,0],74:[.12604,.69141,0,0],75:[0,.69141,0,0],76:[0,.69141,0,0],77:[0,.69141,0,0],78:[0,.69141,0,0],79:[0,.69141,0,0],80:[.18906,.69141,0,0],81:[.03781,.69141,0,0],82:[0,.69141,0,0],83:[0,.69141,0,0],84:[0,.69141,0,0],85:[0,.69141,0,0],86:[0,.69141,0,0],87:[0,.69141,0,0],88:[0,.69141,0,0],89:[.18906,.69141,0,0],90:[.12604,.69141,0,0],91:[.24982,.74947,0,0],93:[.24982,.74947,0,0],94:[0,.69141,0,0],97:[0,.47534,0,0],98:[0,.69141,0,0],99:[0,.47534,0,0],100:[0,.62119,0,0],101:[0,.47534,0,0],102:[.18906,.69141,0,0],103:[.18906,.47534,0,0],104:[.18906,.69141,0,0],105:[0,.69141,0,0],106:[0,.69141,0,0],107:[0,.69141,0,0],108:[0,.69141,0,0],109:[0,.47534,0,0],110:[0,.47534,0,0],111:[0,.47534,0,0],112:[.18906,.52396,0,0],113:[.18906,.47534,0,0],114:[0,.47534,0,0],115:[0,.47534,0,0],116:[0,.62119,0,0],117:[0,.47534,0,0],118:[0,.52396,0,0],119:[0,.52396,0,0],120:[.18906,.47534,0,0],121:[.18906,.47534,0,0],122:[.18906,.47534,0,0],8216:[0,.69141,0,0],8217:[0,.69141,0,0],58112:[0,.62119,0,0],58113:[0,.62119,0,0],58114:[.18906,.69141,0,0],58115:[.18906,.69141,0,0],58116:[.18906,.47534,0,0],58117:[0,.69141,0,0],58118:[0,.62119,0,0],58119:[0,.47534,0,0]},"Main-Bold":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.13333,.63333,0,0],44:[.19444,.15556,0,0],45:[0,.44444,0,0],46:[0,.15556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.44444,0,0],59:[.19444,.44444,0,0],60:[.08556,.58556,0,0],61:[-.10889,.39111,0,0],62:[.08556,.58556,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,0,0],67:[0,.68611,0,0],68:[0,.68611,0,0],69:[0,.68611,0,0],70:[0,.68611,0,0],71:[0,.68611,0,0],72:[0,.68611,0,0],73:[0,.68611,0,0],74:[0,.68611,0,0],75:[0,.68611,0,0],76:[0,.68611,0,0],77:[0,.68611,0,0],78:[0,.68611,0,0],79:[0,.68611,0,0],80:[0,.68611,0,0],81:[.19444,.68611,0,0],82:[0,.68611,0,0],83:[0,.68611,0,0],84:[0,.68611,0,0],85:[0,.68611,0,0],86:[0,.68611,.01597,0],87:[0,.68611,.01597,0],88:[0,.68611,0,0],89:[0,.68611,.02875,0],90:[0,.68611,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.13444,.03194,0],96:[0,.69444,0,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.10903,0],103:[.19444,.44444,.01597,0],104:[0,.69444,0,0],105:[0,.69444,0,0],106:[.19444,.69444,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,0,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.01597,0],119:[0,.44444,.01597,0],120:[0,.44444,0,0],121:[.19444,.44444,.01597,0],122:[0,.44444,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.34444,0,0],168:[0,.69444,0,0],172:[0,.44444,0,0],175:[0,.59611,0,0],176:[0,.69444,0,0],177:[.13333,.63333,0,0],180:[0,.69444,0,0],215:[.13333,.63333,0,0],247:[.13333,.63333,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],710:[0,.69444,0,0],711:[0,.63194,0,0],713:[0,.59611,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.69444,0,0],730:[0,.69444,0,0],732:[0,.69444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.69444,0,0],772:[0,.59611,0,0],774:[0,.69444,0,0],775:[0,.69444,0,0],776:[0,.69444,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],824:[.19444,.69444,0,0],915:[0,.68611,0,0],916:[0,.68611,0,0],920:[0,.68611,0,0],923:[0,.68611,0,0],926:[0,.68611,0,0],928:[0,.68611,0,0],931:[0,.68611,0,0],933:[0,.68611,0,0],934:[0,.68611,0,0],936:[0,.68611,0,0],937:[0,.68611,0,0],8211:[0,.44444,.03194,0],8212:[0,.44444,.03194,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8242:[0,.55556,0,0],8407:[0,.72444,.15486,0],8463:[0,.69444,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,0],8472:[.19444,.44444,0,0],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.10889,.39111,0,0],8593:[.19444,.69444,0,0],8594:[-.10889,.39111,0,0],8595:[.19444,.69444,0,0],8596:[-.10889,.39111,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8636:[-.10889,.39111,0,0],8637:[-.10889,.39111,0,0],8640:[-.10889,.39111,0,0],8641:[-.10889,.39111,0,0],8656:[-.10889,.39111,0,0],8657:[.19444,.69444,0,0],8658:[-.10889,.39111,0,0],8659:[.19444,.69444,0,0],8660:[-.10889,.39111,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.06389,0],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68611,0,0],8712:[.08556,.58556,0,0],8715:[.08556,.58556,0,0],8722:[.13333,.63333,0,0],8723:[.13333,.63333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.02778,.47222,0,0],8728:[-.02639,.47361,0,0],8729:[-.02639,.47361,0,0],8730:[.18,.82,0,0],8733:[0,.44444,0,0],8734:[0,.44444,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.12778,0],8764:[-.10889,.39111,0,0],8768:[.19444,.69444,0,0],8771:[.00222,.50222,0,0],8776:[.02444,.52444,0,0],8781:[.00222,.50222,0,0],8801:[.00222,.50222,0,0],8804:[.19667,.69667,0,0],8805:[.19667,.69667,0,0],8810:[.08556,.58556,0,0],8811:[.08556,.58556,0,0],8826:[.08556,.58556,0,0],8827:[.08556,.58556,0,0],8834:[.08556,.58556,0,0],8835:[.08556,.58556,0,0],8838:[.19667,.69667,0,0],8839:[.19667,.69667,0,0],8846:[0,.55556,0,0],8849:[.19667,.69667,0,0],8850:[.19667,.69667,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.13333,.63333,0,0],8854:[.13333,.63333,0,0],8855:[.13333,.63333,0,0],8856:[.13333,.63333,0,0],8857:[.13333,.63333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8900:[-.02639,.47361,0,0],8901:[-.02639,.47361,0,0],8902:[-.02778,.47222,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.13889,.36111,0,0],8995:[-.13889,.36111,0,0],9651:[.19444,.69444,0,0],9657:[-.02778,.47222,0,0],9661:[.19444,.69444,0,0],9667:[-.02778,.47222,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10815:[0,.68611,0,0],10927:[.19667,.69667,0,0],10928:[.19667,.69667,0,0]},"Main-Italic":{33:[0,.69444,.12417,0],34:[0,.69444,.06961,0],35:[.19444,.69444,.06616,0],37:[.05556,.75,.13639,0],38:[0,.69444,.09694,0],39:[0,.69444,.12417,0],40:[.25,.75,.16194,0],41:[.25,.75,.03694,0],42:[0,.75,.14917,0],43:[.05667,.56167,.03694,0],44:[.19444,.10556,0,0],45:[0,.43056,.02826,0],46:[0,.10556,0,0],47:[.25,.75,.16194,0],48:[0,.64444,.13556,0],49:[0,.64444,.13556,0],50:[0,.64444,.13556,0],51:[0,.64444,.13556,0],52:[.19444,.64444,.13556,0],53:[0,.64444,.13556,0],54:[0,.64444,.13556,0],55:[.19444,.64444,.13556,0],56:[0,.64444,.13556,0],57:[0,.64444,.13556,0],58:[0,.43056,.0582,0],59:[.19444,.43056,.0582,0],61:[-.13313,.36687,.06616,0],63:[0,.69444,.1225,0],64:[0,.69444,.09597,0],65:[0,.68333,0,0],66:[0,.68333,.10257,0],67:[0,.68333,.14528,0],68:[0,.68333,.09403,0],69:[0,.68333,.12028,0],70:[0,.68333,.13305,0],71:[0,.68333,.08722,0],72:[0,.68333,.16389,0],73:[0,.68333,.15806,0],74:[0,.68333,.14028,0],75:[0,.68333,.14528,0],76:[0,.68333,0,0],77:[0,.68333,.16389,0],78:[0,.68333,.16389,0],79:[0,.68333,.09403,0],80:[0,.68333,.10257,0],81:[.19444,.68333,.09403,0],82:[0,.68333,.03868,0],83:[0,.68333,.11972,0],84:[0,.68333,.13305,0],85:[0,.68333,.16389,0],86:[0,.68333,.18361,0],87:[0,.68333,.18361,0],88:[0,.68333,.15806,0],89:[0,.68333,.19383,0],90:[0,.68333,.14528,0],91:[.25,.75,.1875,0],93:[.25,.75,.10528,0],94:[0,.69444,.06646,0],95:[.31,.12056,.09208,0],97:[0,.43056,.07671,0],98:[0,.69444,.06312,0],99:[0,.43056,.05653,0],100:[0,.69444,.10333,0],101:[0,.43056,.07514,0],102:[.19444,.69444,.21194,0],103:[.19444,.43056,.08847,0],104:[0,.69444,.07671,0],105:[0,.65536,.1019,0],106:[.19444,.65536,.14467,0],107:[0,.69444,.10764,0],108:[0,.69444,.10333,0],109:[0,.43056,.07671,0],110:[0,.43056,.07671,0],111:[0,.43056,.06312,0],112:[.19444,.43056,.06312,0],113:[.19444,.43056,.08847,0],114:[0,.43056,.10764,0],115:[0,.43056,.08208,0],116:[0,.61508,.09486,0],117:[0,.43056,.07671,0],118:[0,.43056,.10764,0],119:[0,.43056,.10764,0],120:[0,.43056,.12042,0],121:[.19444,.43056,.08847,0],122:[0,.43056,.12292,0],126:[.35,.31786,.11585,0],163:[0,.69444,0,0],305:[0,.43056,0,.02778],567:[.19444,.43056,0,.08334],768:[0,.69444,0,0],769:[0,.69444,.09694,0],770:[0,.69444,.06646,0],771:[0,.66786,.11585,0],772:[0,.56167,.10333,0],774:[0,.69444,.10806,0],775:[0,.66786,.11752,0],776:[0,.66786,.10474,0],778:[0,.69444,0,0],779:[0,.69444,.1225,0],780:[0,.62847,.08295,0],915:[0,.68333,.13305,0],916:[0,.68333,0,0],920:[0,.68333,.09403,0],923:[0,.68333,0,0],926:[0,.68333,.15294,0],928:[0,.68333,.16389,0],931:[0,.68333,.12028,0],933:[0,.68333,.11111,0],934:[0,.68333,.05986,0],936:[0,.68333,.11111,0],937:[0,.68333,.10257,0],8211:[0,.43056,.09208,0],8212:[0,.43056,.09208,0],8216:[0,.69444,.12417,0],8217:[0,.69444,.12417,0],8220:[0,.69444,.1685,0],8221:[0,.69444,.06961,0],8463:[0,.68889,0,0]},"Main-Regular":{32:[0,0,0,0],33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.19444,.10556,0,0],45:[0,.43056,0,0],46:[0,.10556,0,0],47:[.25,.75,0,0],48:[0,.64444,0,0],49:[0,.64444,0,0],50:[0,.64444,0,0],51:[0,.64444,0,0],52:[0,.64444,0,0],53:[0,.64444,0,0],54:[0,.64444,0,0],55:[0,.64444,0,0],56:[0,.64444,0,0],57:[0,.64444,0,0],58:[0,.43056,0,0],59:[.19444,.43056,0,0],60:[.0391,.5391,0,0],61:[-.13313,.36687,0,0],62:[.0391,.5391,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.68333,0,0],66:[0,.68333,0,0],67:[0,.68333,0,0],68:[0,.68333,0,0],69:[0,.68333,0,0],70:[0,.68333,0,0],71:[0,.68333,0,0],72:[0,.68333,0,0],73:[0,.68333,0,0],74:[0,.68333,0,0],75:[0,.68333,0,0],76:[0,.68333,0,0],77:[0,.68333,0,0],78:[0,.68333,0,0],79:[0,.68333,0,0],80:[0,.68333,0,0],81:[.19444,.68333,0,0],82:[0,.68333,0,0],83:[0,.68333,0,0],84:[0,.68333,0,0],85:[0,.68333,0,0],86:[0,.68333,.01389,0],87:[0,.68333,.01389,0],88:[0,.68333,0,0],89:[0,.68333,.025,0],90:[0,.68333,0,0],91:[.25,.75,0,0],92:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.31,.12056,.02778,0],96:[0,.69444,0,0],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,0],100:[0,.69444,0,0],101:[0,.43056,0,0],102:[0,.69444,.07778,0],103:[.19444,.43056,.01389,0],104:[0,.69444,0,0],105:[0,.66786,0,0],106:[.19444,.66786,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.19444,.43056,0,0],113:[.19444,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.61508,0,0],117:[0,.43056,0,0],118:[0,.43056,.01389,0],119:[0,.43056,.01389,0],120:[0,.43056,0,0],121:[.19444,.43056,.01389,0],122:[0,.43056,0,0],123:[.25,.75,0,0],124:[.25,.75,0,0],125:[.25,.75,0,0],126:[.35,.31786,0,0],160:[0,0,0,0],168:[0,.66786,0,0],172:[0,.43056,0,0],175:[0,.56778,0,0],176:[0,.69444,0,0],177:[.08333,.58333,0,0],180:[0,.69444,0,0],215:[.08333,.58333,0,0],247:[.08333,.58333,0,0],305:[0,.43056,0,0],567:[.19444,.43056,0,0],710:[0,.69444,0,0],711:[0,.62847,0,0],713:[0,.56778,0,0],714:[0,.69444,0,0],715:[0,.69444,0,0],728:[0,.69444,0,0],729:[0,.66786,0,0],730:[0,.69444,0,0],732:[0,.66786,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.66786,0,0],772:[0,.56778,0,0],774:[0,.69444,0,0],775:[0,.66786,0,0],776:[0,.66786,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.62847,0,0],824:[.19444,.69444,0,0],915:[0,.68333,0,0],916:[0,.68333,0,0],920:[0,.68333,0,0],923:[0,.68333,0,0],926:[0,.68333,0,0],928:[0,.68333,0,0],931:[0,.68333,0,0],933:[0,.68333,0,0],934:[0,.68333,0,0],936:[0,.68333,0,0],937:[0,.68333,0,0],8211:[0,.43056,.02778,0],8212:[0,.43056,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0],8224:[.19444,.69444,0,0],8225:[.19444,.69444,0,0],8230:[0,.12,0,0],8242:[0,.55556,0,0],8407:[0,.71444,.15382,0],8463:[0,.68889,0,0],8465:[0,.69444,0,0],8467:[0,.69444,0,.11111],8472:[.19444,.43056,0,.11111],8476:[0,.69444,0,0],8501:[0,.69444,0,0],8592:[-.13313,.36687,0,0],8593:[.19444,.69444,0,0],8594:[-.13313,.36687,0,0],8595:[.19444,.69444,0,0],8596:[-.13313,.36687,0,0],8597:[.25,.75,0,0],8598:[.19444,.69444,0,0],8599:[.19444,.69444,0,0],8600:[.19444,.69444,0,0],8601:[.19444,.69444,0,0],8614:[.011,.511,0,0],8617:[.011,.511,0,0],8618:[.011,.511,0,0],8636:[-.13313,.36687,0,0],8637:[-.13313,.36687,0,0],8640:[-.13313,.36687,0,0],8641:[-.13313,.36687,0,0],8652:[.011,.671,0,0],8656:[-.13313,.36687,0,0],8657:[.19444,.69444,0,0],8658:[-.13313,.36687,0,0],8659:[.19444,.69444,0,0],8660:[-.13313,.36687,0,0],8661:[.25,.75,0,0],8704:[0,.69444,0,0],8706:[0,.69444,.05556,.08334],8707:[0,.69444,0,0],8709:[.05556,.75,0,0],8711:[0,.68333,0,0],8712:[.0391,.5391,0,0],8715:[.0391,.5391,0,0],8722:[.08333,.58333,0,0],8723:[.08333,.58333,0,0],8725:[.25,.75,0,0],8726:[.25,.75,0,0],8727:[-.03472,.46528,0,0],8728:[-.05555,.44445,0,0],8729:[-.05555,.44445,0,0],8730:[.2,.8,0,0],8733:[0,.43056,0,0],8734:[0,.43056,0,0],8736:[0,.69224,0,0],8739:[.25,.75,0,0],8741:[.25,.75,0,0],8743:[0,.55556,0,0],8744:[0,.55556,0,0],8745:[0,.55556,0,0],8746:[0,.55556,0,0],8747:[.19444,.69444,.11111,0],8764:[-.13313,.36687,0,0],8768:[.19444,.69444,0,0],8771:[-.03625,.46375,0,0],8773:[-.022,.589,0,0],8776:[-.01688,.48312,0,0],8781:[-.03625,.46375,0,0],8784:[-.133,.67,0,0],8800:[.215,.716,0,0],8801:[-.03625,.46375,0,0],8804:[.13597,.63597,0,0],8805:[.13597,.63597,0,0],8810:[.0391,.5391,0,0],8811:[.0391,.5391,0,0],8826:[.0391,.5391,0,0],8827:[.0391,.5391,0,0],8834:[.0391,.5391,0,0],8835:[.0391,.5391,0,0],8838:[.13597,.63597,0,0],8839:[.13597,.63597,0,0],8846:[0,.55556,0,0],8849:[.13597,.63597,0,0],8850:[.13597,.63597,0,0],8851:[0,.55556,0,0],8852:[0,.55556,0,0],8853:[.08333,.58333,0,0],8854:[.08333,.58333,0,0],8855:[.08333,.58333,0,0],8856:[.08333,.58333,0,0],8857:[.08333,.58333,0,0],8866:[0,.69444,0,0],8867:[0,.69444,0,0],8868:[0,.69444,0,0],8869:[0,.69444,0,0],8872:[.249,.75,0,0],8900:[-.05555,.44445,0,0],8901:[-.05555,.44445,0,0],8902:[-.03472,.46528,0,0],8904:[.005,.505,0,0],8942:[.03,.9,0,0],8943:[-.19,.31,0,0],8945:[-.1,.82,0,0],8968:[.25,.75,0,0],8969:[.25,.75,0,0],8970:[.25,.75,0,0],8971:[.25,.75,0,0],8994:[-.14236,.35764,0,0],8995:[-.14236,.35764,0,0],9136:[.244,.744,0,0],9137:[.244,.744,0,0],9651:[.19444,.69444,0,0],9657:[-.03472,.46528,0,0],9661:[.19444,.69444,0,0],9667:[-.03472,.46528,0,0],9711:[.19444,.69444,0,0],9824:[.12963,.69444,0,0],9825:[.12963,.69444,0,0],9826:[.12963,.69444,0,0],9827:[.12963,.69444,0,0],9837:[0,.75,0,0],9838:[.19444,.69444,0,0],9839:[.19444,.69444,0,0],10216:[.25,.75,0,0],10217:[.25,.75,0,0],10222:[.244,.744,0,0],10223:[.244,.744,0,0],10229:[.011,.511,0,0],10230:[.011,.511,0,0],10231:[.011,.511,0,0],10232:[.024,.525,0,0],10233:[.024,.525,0,0],10234:[.024,.525,0,0],10236:[.011,.511,0,0],10815:[0,.68333,0,0],10927:[.13597,.63597,0,0],10928:[.13597,.63597,0,0]},"Math-BoldItalic":{47:[.19444,.69444,0,0],65:[0,.68611,0,0],66:[0,.68611,.04835,0],67:[0,.68611,.06979,0],68:[0,.68611,.03194,0],69:[0,.68611,.05451,0],70:[0,.68611,.15972,0],71:[0,.68611,0,0],72:[0,.68611,.08229,0],73:[0,.68611,.07778,0],74:[0,.68611,.10069,0],75:[0,.68611,.06979,0],76:[0,.68611,0,0],77:[0,.68611,.11424,0],78:[0,.68611,.11424,0],79:[0,.68611,.03194,0],80:[0,.68611,.15972,0],81:[.19444,.68611,0,0],82:[0,.68611,.00421,0],83:[0,.68611,.05382,0],84:[0,.68611,.15972,0],85:[0,.68611,.11424,0],86:[0,.68611,.25555,0],87:[0,.68611,.15972,0],88:[0,.68611,.07778,0],89:[0,.68611,.25555,0],90:[0,.68611,.06979,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[.19444,.69444,.11042,0],103:[.19444,.44444,.03704,0],104:[0,.69444,0,0],105:[0,.69326,0,0],106:[.19444,.69326,.0622,0],107:[0,.69444,.01852,0],108:[0,.69444,.0088,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,.03704,0],114:[0,.44444,.03194,0],115:[0,.44444,0,0],116:[0,.63492,0,0],117:[0,.44444,0,0],118:[0,.44444,.03704,0],119:[0,.44444,.02778,0],120:[0,.44444,0,0],121:[.19444,.44444,.03704,0],122:[0,.44444,.04213,0],915:[0,.68611,.15972,0],916:[0,.68611,0,0],920:[0,.68611,.03194,0],923:[0,.68611,0,0],926:[0,.68611,.07458,0],928:[0,.68611,.08229,0],931:[0,.68611,.05451,0],933:[0,.68611,.15972,0],934:[0,.68611,0,0],936:[0,.68611,.11653,0],937:[0,.68611,.04835,0],945:[0,.44444,0,0],946:[.19444,.69444,.03403,0],947:[.19444,.44444,.06389,0],948:[0,.69444,.03819,0],949:[0,.44444,0,0],950:[.19444,.69444,.06215,0],951:[.19444,.44444,.03704,0],952:[0,.69444,.03194,0],953:[0,.44444,0,0],954:[0,.44444,0,0],955:[0,.69444,0,0],956:[.19444,.44444,0,0],957:[0,.44444,.06898,0],958:[.19444,.69444,.03021,0],959:[0,.44444,0,0],960:[0,.44444,.03704,0],961:[.19444,.44444,0,0],962:[.09722,.44444,.07917,0],963:[0,.44444,.03704,0],964:[0,.44444,.13472,0],965:[0,.44444,.03704,0],966:[.19444,.44444,0,0],967:[.19444,.44444,0,0],968:[.19444,.69444,.03704,0],969:[0,.44444,.03704,0],977:[0,.69444,0,0],981:[.19444,.69444,0,0],982:[0,.44444,.03194,0],1009:[.19444,.44444,0,0],1013:[0,.44444,0,0]},"Math-Italic":{47:[.19444,.69444,0,0],65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"Math-Regular":{65:[0,.68333,0,.13889],66:[0,.68333,.05017,.08334],67:[0,.68333,.07153,.08334],68:[0,.68333,.02778,.05556],69:[0,.68333,.05764,.08334],70:[0,.68333,.13889,.08334],71:[0,.68333,0,.08334],72:[0,.68333,.08125,.05556],73:[0,.68333,.07847,.11111],74:[0,.68333,.09618,.16667],75:[0,.68333,.07153,.05556],76:[0,.68333,0,.02778],77:[0,.68333,.10903,.08334],78:[0,.68333,.10903,.08334],79:[0,.68333,.02778,.08334],80:[0,.68333,.13889,.08334],81:[.19444,.68333,0,.08334],82:[0,.68333,.00773,.08334],83:[0,.68333,.05764,.08334],84:[0,.68333,.13889,.08334],85:[0,.68333,.10903,.02778],86:[0,.68333,.22222,0],87:[0,.68333,.13889,0],88:[0,.68333,.07847,.08334],89:[0,.68333,.22222,0],90:[0,.68333,.07153,.08334],97:[0,.43056,0,0],98:[0,.69444,0,0],99:[0,.43056,0,.05556],100:[0,.69444,0,.16667],101:[0,.43056,0,.05556],102:[.19444,.69444,.10764,.16667],103:[.19444,.43056,.03588,.02778],104:[0,.69444,0,0],105:[0,.65952,0,0],106:[.19444,.65952,.05724,0],107:[0,.69444,.03148,0],108:[0,.69444,.01968,.08334],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,.05556],112:[.19444,.43056,0,.08334],113:[.19444,.43056,.03588,.08334],114:[0,.43056,.02778,.05556],115:[0,.43056,0,.05556],116:[0,.61508,0,.08334],117:[0,.43056,0,.02778],118:[0,.43056,.03588,.02778],119:[0,.43056,.02691,.08334],120:[0,.43056,0,.02778],121:[.19444,.43056,.03588,.05556],122:[0,.43056,.04398,.05556],915:[0,.68333,.13889,.08334],916:[0,.68333,0,.16667],920:[0,.68333,.02778,.08334],923:[0,.68333,0,.16667],926:[0,.68333,.07569,.08334],928:[0,.68333,.08125,.05556],931:[0,.68333,.05764,.08334],933:[0,.68333,.13889,.05556],934:[0,.68333,0,.08334],936:[0,.68333,.11,.05556],937:[0,.68333,.05017,.08334],945:[0,.43056,.0037,.02778],946:[.19444,.69444,.05278,.08334],947:[.19444,.43056,.05556,0],948:[0,.69444,.03785,.05556],949:[0,.43056,0,.08334],950:[.19444,.69444,.07378,.08334],951:[.19444,.43056,.03588,.05556],952:[0,.69444,.02778,.08334],953:[0,.43056,0,.05556],954:[0,.43056,0,0],955:[0,.69444,0,0],956:[.19444,.43056,0,.02778],957:[0,.43056,.06366,.02778],958:[.19444,.69444,.04601,.11111],959:[0,.43056,0,.05556],960:[0,.43056,.03588,0],961:[.19444,.43056,0,.08334],962:[.09722,.43056,.07986,.08334],963:[0,.43056,.03588,0],964:[0,.43056,.1132,.02778],965:[0,.43056,.03588,.02778],966:[.19444,.43056,0,.08334],967:[.19444,.43056,0,.05556],968:[.19444,.69444,.03588,.11111],969:[0,.43056,.03588,0],977:[0,.69444,0,.08334],981:[.19444,.69444,0,.08334],982:[0,.43056,.02778,0],1009:[.19444,.43056,0,.08334],1013:[0,.43056,0,.05556]},"SansSerif-Regular":{33:[0,.69444,0,0],34:[0,.69444,0,0],35:[.19444,.69444,0,0],36:[.05556,.75,0,0],37:[.05556,.75,0,0],38:[0,.69444,0,0],39:[0,.69444,0,0],40:[.25,.75,0,0],41:[.25,.75,0,0],42:[0,.75,0,0],43:[.08333,.58333,0,0],44:[.125,.08333,0,0],45:[0,.44444,0,0],46:[0,.08333,0,0],47:[.25,.75,0,0],48:[0,.65556,0,0],49:[0,.65556,0,0],50:[0,.65556,0,0],51:[0,.65556,0,0],52:[0,.65556,0,0],53:[0,.65556,0,0],54:[0,.65556,0,0],55:[0,.65556,0,0],56:[0,.65556,0,0],57:[0,.65556,0,0],58:[0,.44444,0,0],59:[.125,.44444,0,0],61:[-.13,.37,0,0],63:[0,.69444,0,0],64:[0,.69444,0,0],65:[0,.69444,0,0],66:[0,.69444,0,0],67:[0,.69444,0,0],68:[0,.69444,0,0],69:[0,.69444,0,0],70:[0,.69444,0,0],71:[0,.69444,0,0],72:[0,.69444,0,0],73:[0,.69444,0,0],74:[0,.69444,0,0],75:[0,.69444,0,0],76:[0,.69444,0,0],77:[0,.69444,0,0],78:[0,.69444,0,0],79:[0,.69444,0,0],80:[0,.69444,0,0],81:[.125,.69444,0,0],82:[0,.69444,0,0],83:[0,.69444,0,0],84:[0,.69444,0,0],85:[0,.69444,0,0],86:[0,.69444,.01389,0],87:[0,.69444,.01389,0],88:[0,.69444,0,0],89:[0,.69444,.025,0],90:[0,.69444,0,0],91:[.25,.75,0,0],93:[.25,.75,0,0],94:[0,.69444,0,0],95:[.35,.09444,.02778,0],97:[0,.44444,0,0],98:[0,.69444,0,0],99:[0,.44444,0,0],100:[0,.69444,0,0],101:[0,.44444,0,0],102:[0,.69444,.06944,0],103:[.19444,.44444,.01389,0],104:[0,.69444,0,0],105:[0,.67937,0,0],106:[.19444,.67937,0,0],107:[0,.69444,0,0],108:[0,.69444,0,0],109:[0,.44444,0,0],110:[0,.44444,0,0],111:[0,.44444,0,0],112:[.19444,.44444,0,0],113:[.19444,.44444,0,0],114:[0,.44444,.01389,0],115:[0,.44444,0,0],116:[0,.57143,0,0],117:[0,.44444,0,0],118:[0,.44444,.01389,0],119:[0,.44444,.01389,0],120:[0,.44444,0,0],121:[.19444,.44444,.01389,0],122:[0,.44444,0,0],126:[.35,.32659,0,0],305:[0,.44444,0,0],567:[.19444,.44444,0,0],768:[0,.69444,0,0],769:[0,.69444,0,0],770:[0,.69444,0,0],771:[0,.67659,0,0],772:[0,.60889,0,0],774:[0,.69444,0,0],775:[0,.67937,0,0],776:[0,.67937,0,0],778:[0,.69444,0,0],779:[0,.69444,0,0],780:[0,.63194,0,0],915:[0,.69444,0,0],916:[0,.69444,0,0],920:[0,.69444,0,0],923:[0,.69444,0,0],926:[0,.69444,0,0],928:[0,.69444,0,0],931:[0,.69444,0,0],933:[0,.69444,0,0],934:[0,.69444,0,0],936:[0,.69444,0,0],937:[0,.69444,0,0],8211:[0,.44444,.02778,0],8212:[0,.44444,.02778,0],8216:[0,.69444,0,0],8217:[0,.69444,0,0],8220:[0,.69444,0,0],8221:[0,.69444,0,0]},"Script-Regular":{65:[0,.7,.22925,0],66:[0,.7,.04087,0],67:[0,.7,.1689,0],68:[0,.7,.09371,0],69:[0,.7,.18583,0],70:[0,.7,.13634,0],71:[0,.7,.17322,0],72:[0,.7,.29694,0],73:[0,.7,.19189,0],74:[.27778,.7,.19189,0],75:[0,.7,.31259,0],76:[0,.7,.19189,0],77:[0,.7,.15981,0],78:[0,.7,.3525,0],79:[0,.7,.08078,0],80:[0,.7,.08078,0],81:[0,.7,.03305,0],82:[0,.7,.06259,0],83:[0,.7,.19189,0],84:[0,.7,.29087,0],85:[0,.7,.25815,0],86:[0,.7,.27523,0],87:[0,.7,.27523,0],88:[0,.7,.26006,0],89:[0,.7,.2939,0],90:[0,.7,.24037,0]},"Size1-Regular":{40:[.35001,.85,0,0],41:[.35001,.85,0,0],47:[.35001,.85,0,0],91:[.35001,.85,0,0],92:[.35001,.85,0,0],93:[.35001,.85,0,0],123:[.35001,.85,0,0],125:[.35001,.85,0,0],710:[0,.72222,0,0],732:[0,.72222,0,0],770:[0,.72222,0,0],771:[0,.72222,0,0],8214:[-99e-5,.601,0,0],8593:[1e-5,.6,0,0],8595:[1e-5,.6,0,0],8657:[1e-5,.6,0,0],8659:[1e-5,.6,0,0],8719:[.25001,.75,0,0],8720:[.25001,.75,0,0],8721:[.25001,.75,0,0],8730:[.35001,.85,0,0],8739:[-.00599,.606,0,0],8741:[-.00599,.606,0,0],8747:[.30612,.805,.19445,0],8748:[.306,.805,.19445,0],8749:[.306,.805,.19445,0],8750:[.30612,.805,.19445,0],8896:[.25001,.75,0,0],8897:[.25001,.75,0,0],8898:[.25001,.75,0,0],8899:[.25001,.75,0,0],8968:[.35001,.85,0,0],8969:[.35001,.85,0,0],8970:[.35001,.85,0,0],8971:[.35001,.85,0,0],9168:[-99e-5,.601,0,0],10216:[.35001,.85,0,0],10217:[.35001,.85,0,0],10752:[.25001,.75,0,0],10753:[.25001,.75,0,0],10754:[.25001,.75,0,0],10756:[.25001,.75,0,0],10758:[.25001,.75,0,0]},"Size2-Regular":{40:[.65002,1.15,0,0],41:[.65002,1.15,0,0],47:[.65002,1.15,0,0],91:[.65002,1.15,0,0],92:[.65002,1.15,0,0],93:[.65002,1.15,0,0],123:[.65002,1.15,0,0],125:[.65002,1.15,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8719:[.55001,1.05,0,0],8720:[.55001,1.05,0,0],8721:[.55001,1.05,0,0],8730:[.65002,1.15,0,0],8747:[.86225,1.36,.44445,0],8748:[.862,1.36,.44445,0],8749:[.862,1.36,.44445,0],8750:[.86225,1.36,.44445,0],8896:[.55001,1.05,0,0],8897:[.55001,1.05,0,0],8898:[.55001,1.05,0,0],8899:[.55001,1.05,0,0],8968:[.65002,1.15,0,0],8969:[.65002,1.15,0,0],8970:[.65002,1.15,0,0],8971:[.65002,1.15,0,0],10216:[.65002,1.15,0,0],10217:[.65002,1.15,0,0],10752:[.55001,1.05,0,0],10753:[.55001,1.05,0,0],10754:[.55001,1.05,0,0],10756:[.55001,1.05,0,0],10758:[.55001,1.05,0,0]},"Size3-Regular":{40:[.95003,1.45,0,0],41:[.95003,1.45,0,0],47:[.95003,1.45,0,0],91:[.95003,1.45,0,0],92:[.95003,1.45,0,0],93:[.95003,1.45,0,0],123:[.95003,1.45,0,0],125:[.95003,1.45,0,0],710:[0,.75,0,0],732:[0,.75,0,0],770:[0,.75,0,0],771:[0,.75,0,0],8730:[.95003,1.45,0,0],8968:[.95003,1.45,0,0],8969:[.95003,1.45,0,0],8970:[.95003,1.45,0,0],8971:[.95003,1.45,0,0],10216:[.95003,1.45,0,0],10217:[.95003,1.45,0,0]},"Size4-Regular":{40:[1.25003,1.75,0,0],41:[1.25003,1.75,0,0],47:[1.25003,1.75,0,0],91:[1.25003,1.75,0,0],92:[1.25003,1.75,0,0],93:[1.25003,1.75,0,0],123:[1.25003,1.75,0,0],125:[1.25003,1.75,0,0],710:[0,.825,0,0],732:[0,.825,0,0],770:[0,.825,0,0],771:[0,.825,0,0],8730:[1.25003,1.75,0,0],8968:[1.25003,1.75,0,0],8969:[1.25003,1.75,0,0],8970:[1.25003,1.75,0,0],8971:[1.25003,1.75,0,0],9115:[.64502,1.155,0,0],9116:[1e-5,.6,0,0],9117:[.64502,1.155,0,0],9118:[.64502,1.155,0,0],9119:[1e-5,.6,0,0],9120:[.64502,1.155,0,0],9121:[.64502,1.155,0,0],9122:[-99e-5,.601,0,0],9123:[.64502,1.155,0,0],9124:[.64502,1.155,0,0],9125:[-99e-5,.601,0,0],9126:[.64502,1.155,0,0],9127:[1e-5,.9,0,0],9128:[.65002,1.15,0,0],9129:[.90001,0,0,0],9130:[0,.3,0,0],9131:[1e-5,.9,0,0],9132:[.65002,1.15,0,0],9133:[.90001,0,0,0],9143:[.88502,.915,0,0],10216:[1.25003,1.75,0,0],10217:[1.25003,1.75,0,0],57344:[-.00499,.605,0,0],57345:[-.00499,.605,0,0],57680:[0,.12,0,0],57681:[0,.12,0,0],57682:[0,.12,0,0],57683:[0,.12,0,0]},"Typewriter-Regular":{33:[0,.61111,0,0],34:[0,.61111,0,0],35:[0,.61111,0,0],36:[.08333,.69444,0,0],37:[.08333,.69444,0,0],38:[0,.61111,0,0],39:[0,.61111,0,0],40:[.08333,.69444,0,0],41:[.08333,.69444,0,0],42:[0,.52083,0,0],43:[-.08056,.53055,0,0],44:[.13889,.125,0,0],45:[-.08056,.53055,0,0],46:[0,.125,0,0],47:[.08333,.69444,0,0],48:[0,.61111,0,0],49:[0,.61111,0,0],50:[0,.61111,0,0],51:[0,.61111,0,0],52:[0,.61111,0,0],53:[0,.61111,0,0],54:[0,.61111,0,0],55:[0,.61111,0,0],56:[0,.61111,0,0],57:[0,.61111,0,0],58:[0,.43056,0,0],59:[.13889,.43056,0,0],60:[-.05556,.55556,0,0],61:[-.19549,.41562,0,0],62:[-.05556,.55556,0,0],63:[0,.61111,0,0],64:[0,.61111,0,0],65:[0,.61111,0,0],66:[0,.61111,0,0],67:[0,.61111,0,0],68:[0,.61111,0,0],69:[0,.61111,0,0],70:[0,.61111,0,0],71:[0,.61111,0,0],72:[0,.61111,0,0],73:[0,.61111,0,0],74:[0,.61111,0,0],75:[0,.61111,0,0],76:[0,.61111,0,0],77:[0,.61111,0,0],78:[0,.61111,0,0],79:[0,.61111,0,0],80:[0,.61111,0,0],81:[.13889,.61111,0,0],82:[0,.61111,0,0],83:[0,.61111,0,0],84:[0,.61111,0,0],85:[0,.61111,0,0],86:[0,.61111,0,0],87:[0,.61111,0,0],88:[0,.61111,0,0],89:[0,.61111,0,0],90:[0,.61111,0,0],91:[.08333,.69444,0,0],92:[.08333,.69444,0,0],93:[.08333,.69444,0,0],94:[0,.61111,0,0],95:[.09514,0,0,0],96:[0,.61111,0,0],97:[0,.43056,0,0],98:[0,.61111,0,0],99:[0,.43056,0,0],100:[0,.61111,0,0],101:[0,.43056,0,0],102:[0,.61111,0,0],103:[.22222,.43056,0,0],104:[0,.61111,0,0],105:[0,.61111,0,0],106:[.22222,.61111,0,0],107:[0,.61111,0,0],108:[0,.61111,0,0],109:[0,.43056,0,0],110:[0,.43056,0,0],111:[0,.43056,0,0],112:[.22222,.43056,0,0],113:[.22222,.43056,0,0],114:[0,.43056,0,0],115:[0,.43056,0,0],116:[0,.55358,0,0],117:[0,.43056,0,0],118:[0,.43056,0,0],119:[0,.43056,0,0],120:[0,.43056,0,0],121:[.22222,.43056,0,0],122:[0,.43056,0,0],123:[.08333,.69444,0,0],124:[.08333,.69444,0,0],125:[.08333,.69444,0,0],126:[0,.61111,0,0],127:[0,.61111,0,0],305:[0,.43056,0,0],567:[.22222,.43056,0,0],768:[0,.61111,0,0],769:[0,.61111,0,0],770:[0,.61111,0,0],771:[0,.61111,0,0],772:[0,.56555,0,0],774:[0,.61111,0,0],776:[0,.61111,0,0],778:[0,.61111,0,0],780:[0,.56597,0,0],915:[0,.61111,0,0],916:[0,.61111,0,0],920:[0,.61111,0,0],923:[0,.61111,0,0],926:[0,.61111,0,0],928:[0,.61111,0,0],931:[0,.61111,0,0],933:[0,.61111,0,0],934:[0,.61111,0,0],936:[0,.61111,0,0],937:[0,.61111,0,0],2018:[0,.61111,0,0],2019:[0,.61111,0,0],8242:[0,.61111,0,0]}}},{}],43:[function(e,t,r){"use strict";var a=e("./utils");var n=u(a);var i=e("./ParseError");var l=u(i);var s=e("./ParseNode");var o=u(s);function u(e){return e&&e.__esModule?e:{default:e}}function c(e,r,a){if(typeof e==="string"){e=[e]}if(typeof r==="number"){r={numArgs:r}}var n={numArgs:r.numArgs,argTypes:r.argTypes,greediness:r.greediness===undefined?1:r.greediness,allowedInText:!!r.allowedInText,allowedInMath:r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,handler:a};for(var i=0;i","\\langle","\\rangle","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\\lmoustache","\\rmoustache","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];var p={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};c(["\\blue","\\orange","\\pink","\\red","\\green","\\gray","\\purple","\\blueA","\\blueB","\\blueC","\\blueD","\\blueE","\\tealA","\\tealB","\\tealC","\\tealD","\\tealE","\\greenA","\\greenB","\\greenC","\\greenD","\\greenE","\\goldA","\\goldB","\\goldC","\\goldD","\\goldE","\\redA","\\redB","\\redC","\\redD","\\redE","\\maroonA","\\maroonB","\\maroonC","\\maroonD","\\maroonE","\\purpleA","\\purpleB","\\purpleC","\\purpleD","\\purpleE","\\mintA","\\mintB","\\mintC","\\grayA","\\grayB","\\grayC","\\grayD","\\grayE","\\grayF","\\grayG","\\grayH","\\grayI","\\kaBlue","\\kaGreen"],{numArgs:1,allowedInText:true,greediness:3},function(e,t){var r=t[0];return{type:"color",color:"katex-"+e.funcName.slice(1),value:f(r)}});c(["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],{numArgs:0},function(e){return{type:"op",limits:false,symbol:false,body:e.funcName}});c(["\\det","\\gcd","\\inf","\\lim","\\liminf","\\limsup","\\max","\\min","\\Pr","\\sup"],{numArgs:0},function(e){return{type:"op",limits:true,symbol:false,body:e.funcName}});c(["\\int","\\iint","\\iiint","\\oint"],{numArgs:0},function(e){return{type:"op",limits:false,symbol:true,body:e.funcName}});c(["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint"],{numArgs:0},function(e){return{type:"op",limits:true,symbol:true,body:e.funcName}});c("\\mathop",{numArgs:1},function(e,t){var r=t[0];return{type:"op",limits:false,symbol:false,value:f(r)}});c(["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac"],{numArgs:2,greediness:2},function(e,t){var r=t[0];var a=t[1];var n=void 0;var i=null;var l=null;var s="auto";switch(e.funcName){case"\\dfrac":case"\\frac":case"\\tfrac":n=true;break;case"\\\\atopfrac":n=false;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=false;i="(";l=")";break;default:throw new Error("Unrecognized genfrac command")}switch(e.funcName){case"\\dfrac":case"\\dbinom":s="display";break;case"\\tfrac":case"\\tbinom":s="text";break}return{type:"genfrac",numer:r,denom:a,hasBarLine:n,leftDelim:i,rightDelim:l,size:s}});c(["\\llap","\\rlap"],{numArgs:1,allowedInText:true},function(e,t){var r=t[0];return{type:e.funcName.slice(1),body:r}});var m=function e(t,r){if(n.default.contains(d,t.value)){return t}else{throw new l.default("Invalid delimiter: '"+t.value+"' after '"+r.funcName+"'",t)}};c(["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],{numArgs:1},function(e,t){var r=m(t[0],e);return{type:"delimsizing",size:v[e.funcName].size,mclass:v[e.funcName].mclass,value:r.value}});c(["\\left","\\right"],{numArgs:1},function(e,t){var r=m(t[0],e);return{type:"leftright",value:r.value}});c("\\middle",{numArgs:1},function(e,t){var r=m(t[0],e);if(!e.parser.leftrightDepth){throw new l.default("\\middle without preceding \\left",r)}return{type:"middle",value:r.value}});c(["\\tiny","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],0,null);c(["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],0,null);c(["\\rm","\\sf","\\tt","\\bf","\\it"],0,null);c(["\\mathrm","\\mathit","\\mathbf","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],{numArgs:1,greediness:2},function(e,t){var r=t[0];var a=e.funcName;if(a in p){a=p[a]}return{type:"font",font:a.slice(1),body:r}});c(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],{numArgs:1},function(e,t){var r=t[0];var a=!n.default.contains(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot"],e.funcName);var i=!a||n.default.contains(["\\widehat","\\widetilde"],e.funcName);return{type:"accent",label:e.funcName,isStretchy:a,isShifty:i,value:f(r),base:r}});c(["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\r","\\H","\\v"],{numArgs:1,allowedInText:true,allowedInMath:false},function(e,t){var r=t[0];return{type:"accent",label:e.funcName,isStretchy:false,isShifty:true,value:f(r),base:r}});c(["\\overbrace","\\underbrace"],{numArgs:1},function(e,t){var r=t[0];return{type:"horizBrace",label:e.funcName,isOver:/^\\over/.test(e.funcName),base:r}});c(["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\undertilde"],{numArgs:1},function(e,t){var r=t[0];return{type:"accentUnder",label:e.funcName,value:f(r),body:r}});c(["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xLongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xLongequal","\\xtofrom"],{numArgs:1,numOptionalArgs:1},function(e,t){var r=t[0];var a=t[1];return{type:"xArrow",label:e.funcName,body:a,below:r}});c(["\\cancel","\\bcancel","\\xcancel","\\sout","\\fbox"],{numArgs:1},function(e,t){var r=t[0];return{type:"enclose",label:e.funcName,body:r}});c(["\\over","\\choose","\\atop"],{numArgs:0,infix:true},function(e){var t=void 0;switch(e.funcName){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",replaceWith:t,token:e.token}});c(["\\\\","\\cr"],{numArgs:0,numOptionalArgs:1,argTypes:["size"]},function(e,t){var r=t[0];return{type:"cr",size:r}});c(["\\begin","\\end"],{numArgs:1,argTypes:["text"]},function(e,t){var r=t[0];if(r.type!=="ordgroup"){throw new l.default("Invalid environment name",r)}var a="";for(var n=0;n";return t}}]);return e}();var f=function(){function e(t){(0,n.default)(this,e);this.text=t}(0,l.default)(e,[{key:"toNode",value:function e(){return document.createTextNode(this.text)}},{key:"toMarkup",value:function e(){return o.default.escape(this.text)}}]);return e}();t.exports={MathNode:c,TextNode:f}},{"./utils":51,"babel-runtime/helpers/classCallCheck":4,"babel-runtime/helpers/createClass":5}],46:[function(e,t,r){"use strict";var a=e("./Parser");var n=i(a);function i(e){return e&&e.__esModule?e:{default:e}}var l=function e(t,r){if(!(typeof t==="string"||t instanceof String)){throw new TypeError("KaTeX can only parse string typed expression")}var a=new n.default(t,r);return a.parse()};t.exports=l},{"./Parser":31}],47:[function(e,t,r){"use strict";var a=e("./buildCommon");var n=e("./mathMLTree");var i=e("./utils");var l={widehat:"^",widetilde:"~",undertilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23b5",overbrace:"\u23de",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21d2",xRightarrow:"\u21d2",overleftharpoon:"\u21bc",xleftharpoonup:"\u21bc",overrightharpoon:"\u21c0",xrightharpoonup:"\u21c0",xLeftarrow:"\u21d0",xLeftrightarrow:"\u21d4",xhookleftarrow:"\u21a9",xhookrightarrow:"\u21aa",xmapsto:"\u21a6",xrightharpoondown:"\u21c1",xleftharpoondown:"\u21bd",xrightleftharpoons:"\u21cc",xleftrightharpoons:"\u21cb",xtwoheadleftarrow:"\u219e",xtwoheadrightarrow:"\u21a0",xLongequal:"=",xtofrom:"\u21c4"};var s=function e(t){var r=new n.MathNode("mo",[new n.TextNode(l[t.substr(1)])]);r.setAttribute("stretchy","true");return r};var o={overleftarrow:[.522,0,"leftarrow",.5],underleftarrow:[.522,0,"leftarrow",.5],xleftarrow:[.261,.261,"leftarrow",.783],overrightarrow:[.522,0,"rightarrow",.5],underrightarrow:[.522,0,"rightarrow",.5],xrightarrow:[.261,.261,"rightarrow",.783],overbrace:[.548,0,"overbrace",1.6],underbrace:[.548,0,"underbrace",1.6],overleftrightarrow:[.522,0,"leftrightarrow",.5],underleftrightarrow:[.522,0,"leftrightarrow",.5],xleftrightarrow:[.261,.261,"leftrightarrow",.783],Overrightarrow:[.56,0,"doublerightarrow",.5],xLeftarrow:[.28,.28,"doubleleftarrow",.783],xRightarrow:[.28,.28,"doublerightarrow",.783],xLeftrightarrow:[.28,.28,"doubleleftrightarrow",.955],overleftharpoon:[.522,0,"leftharpoon",.5],overrightharpoon:[.522,0,"rightharpoon",.5],xleftharpoonup:[.261,.261,"leftharpoon",.783],xrightharpoonup:[.261,.261,"rightharpoon",.783],xhookleftarrow:[.261,.261,"hookleftarrow",.87],xhookrightarrow:[.261,.261,"hookrightarrow",.87],overlinesegment:[.414,0,"linesegment",.5],underlinesegment:[.414,0,"linesegment",.5],xmapsto:[.261,.261,"mapsto",.783],xrightharpoondown:[.261,.261,"rightharpoondown",.783],xleftharpoondown:[.261,.261,"leftharpoondown",.783],xrightleftharpoons:[.358,.358,"rightleftharpoons",.716],xleftrightharpoons:[.358,.358,"leftrightharpoons",.716],overgroup:[.342,0,"overgroup",.87],undergroup:[.342,0,"undergroup",.87],xtwoheadleftarrow:[.167,.167,"twoheadleftarrow",.86],xtwoheadrightarrow:[.167,.167,"twoheadrightarrow",.86],xLongequal:[.167,.167,"longequal",.5],xtofrom:[.264,.264,"tofrom",.86]};var u={doubleleftarrow:"",doublerightarrow:"",leftarrow:"",rightarrow:""};var c={bcancel:"",cancel:"",doubleleftarrow:">"+u["doubleleftarrow"]+"",doubleleftrightarrow:">"+u["doubleleftarrow"]+"\n"+u["doublerightarrow"]+"",doublerightarrow:">"+u["doublerightarrow"]+"",hookleftarrow:">"+u["leftarrow"]+"\n",hookrightarrow:">"+u["rightarrow"]+"",leftarrow:">"+u["leftarrow"]+"",leftharpoon:">",leftharpoondown:">",leftrightarrow:">"+u["leftarrow"]+"\n"+u["rightarrow"]+"",leftrightharpoons:">\n",linesegment:">\n",longequal:" viewBox='0 0 100 334' preserveAspectRatio='none'>\n",mapsto:">"+u["rightarrow"]+"",overbrace:">\n",overgroup:">",rightarrow:">"+u["rightarrow"]+"",rightharpoon:">",rightharpoondown:">",rightleftharpoons:">",tilde1:" viewBox='0 0 600 260' preserveAspectRatio='none'>\n",tilde2:" viewBox='0 0 1033 286' preserveAspectRatio='none'>\n",tilde3:" viewBox='0 0 2339 306' preserveAspectRatio='none'>\n",tilde4:" viewBox='0 0 2340 312' preserveAspectRatio='none'>\n",tofrom:">",twoheadleftarrow:">\n",twoheadrightarrow:">\n",underbrace:">\n",undergroup:">",widehat1:" viewBox='0 0 1062 239' preserveAspectRatio='none'>\n",widehat2:" viewBox='0 0 2364 300' preserveAspectRatio='none'>\n",widehat3:" viewBox='0 0 2364 360' preserveAspectRatio='none'>\n",widehat4:" viewBox='0 0 2364 420' preserveAspectRatio='none'>\n",xcancel:"\n"};var f=function e(t,r){var n=t.value.label.substr(1);var l=0;var s=0;var u="";var f=0;if(i.contains(["widehat","widetilde","undertilde"],n)){var h=t.value.value.length;if(h>5){l=.312;u=(n==="widehat"?"widehat":"tilde")+"4"}else{var v=[1,1,2,2,3,3][h];if(n==="widehat"){l=[0,.24,.3,.3,.36,.36][h];u="widehat"+v}else{l=[0,.26,.3,.3,.34,.34][h];u="tilde"+v}}}else{var d=o[n];l=d[0];s=d[1];u=d[2];f=d[3]}var p=a.makeSpan([],[],r);p.height=l;p.depth=s;var m=l+s;p.style.height=m+"em";if(f>0){p.style.minWidth=f+"em"}p.innerHTML="";return p};var h=function e(t,r,n,i){var l=void 0;var s=t.height+t.depth+2*n;if(r==="fbox"){l=a.makeSpan(["stretchy",r],[],i);if(i.color){l.style.borderColor=i.getColor()}}else{l=a.makeSpan([],[],i);l.innerHTML=""+c[r]+""}l.height=s;l.style.height=s+"em";return l};t.exports={encloseSpan:h,mathMLnode:s,svgSpan:f}},{"./buildCommon":34,"./mathMLTree":45,"./utils":51}],48:[function(e,t,r){"use strict";t.exports={math:{},text:{}};function a(e,r,a,n,i,l){t.exports[e][i]={ +font:r,group:a,replace:n};if(l){t.exports[e][n]=t.exports[e][i]}}var n="math";var i="text";var l="main";var s="ams";var o="accent";var u="bin";var c="close";var f="inner";var h="mathord";var v="op";var d="open";var p="punct";var m="rel";var g="spacing";var y="textord";a(n,l,m,"\u2261","\\equiv");a(n,l,m,"\u227a","\\prec");a(n,l,m,"\u227b","\\succ");a(n,l,m,"\u223c","\\sim");a(n,l,m,"\u22a5","\\perp");a(n,l,m,"\u2aaf","\\preceq");a(n,l,m,"\u2ab0","\\succeq");a(n,l,m,"\u2243","\\simeq");a(n,l,m,"\u2223","\\mid");a(n,l,m,"\u226a","\\ll");a(n,l,m,"\u226b","\\gg");a(n,l,m,"\u224d","\\asymp");a(n,l,m,"\u2225","\\parallel");a(n,l,m,"\u22c8","\\bowtie");a(n,l,m,"\u2323","\\smile");a(n,l,m,"\u2291","\\sqsubseteq");a(n,l,m,"\u2292","\\sqsupseteq");a(n,l,m,"\u2250","\\doteq");a(n,l,m,"\u2322","\\frown");a(n,l,m,"\u220b","\\ni");a(n,l,m,"\u221d","\\propto");a(n,l,m,"\u22a2","\\vdash");a(n,l,m,"\u22a3","\\dashv");a(n,l,m,"\u220b","\\owns");a(n,l,p,".","\\ldotp");a(n,l,p,"\u22c5","\\cdotp");a(n,l,y,"#","\\#");a(i,l,y,"#","\\#");a(n,l,y,"&","\\&");a(i,l,y,"&","\\&");a(n,l,y,"\u2135","\\aleph");a(n,l,y,"\u2200","\\forall");a(n,l,y,"\u210f","\\hbar");a(n,l,y,"\u2203","\\exists");a(n,l,y,"\u2207","\\nabla");a(n,l,y,"\u266d","\\flat");a(n,l,y,"\u2113","\\ell");a(n,l,y,"\u266e","\\natural");a(n,l,y,"\u2663","\\clubsuit");a(n,l,y,"\u2118","\\wp");a(n,l,y,"\u266f","\\sharp");a(n,l,y,"\u2662","\\diamondsuit");a(n,l,y,"\u211c","\\Re");a(n,l,y,"\u2661","\\heartsuit");a(n,l,y,"\u2111","\\Im");a(n,l,y,"\u2660","\\spadesuit");a(n,l,y,"\u2020","\\dag");a(i,l,y,"\u2020","\\dag");a(i,l,y,"\u2020","\\textdagger");a(n,l,y,"\u2021","\\ddag");a(i,l,y,"\u2021","\\ddag");a(i,l,y,"\u2020","\\textdaggerdbl");a(n,l,c,"\u23b1","\\rmoustache");a(n,l,d,"\u23b0","\\lmoustache");a(n,l,c,"\u27ef","\\rgroup");a(n,l,d,"\u27ee","\\lgroup");a(n,l,u,"\u2213","\\mp");a(n,l,u,"\u2296","\\ominus");a(n,l,u,"\u228e","\\uplus");a(n,l,u,"\u2293","\\sqcap");a(n,l,u,"\u2217","\\ast");a(n,l,u,"\u2294","\\sqcup");a(n,l,u,"\u25ef","\\bigcirc");a(n,l,u,"\u2219","\\bullet");a(n,l,u,"\u2021","\\ddagger");a(n,l,u,"\u2240","\\wr");a(n,l,u,"\u2a3f","\\amalg");a(n,l,m,"\u27f5","\\longleftarrow");a(n,l,m,"\u21d0","\\Leftarrow");a(n,l,m,"\u27f8","\\Longleftarrow");a(n,l,m,"\u27f6","\\longrightarrow");a(n,l,m,"\u21d2","\\Rightarrow");a(n,l,m,"\u27f9","\\Longrightarrow");a(n,l,m,"\u2194","\\leftrightarrow");a(n,l,m,"\u27f7","\\longleftrightarrow");a(n,l,m,"\u21d4","\\Leftrightarrow");a(n,l,m,"\u27fa","\\Longleftrightarrow");a(n,l,m,"\u21a6","\\mapsto");a(n,l,m,"\u27fc","\\longmapsto");a(n,l,m,"\u2197","\\nearrow");a(n,l,m,"\u21a9","\\hookleftarrow");a(n,l,m,"\u21aa","\\hookrightarrow");a(n,l,m,"\u2198","\\searrow");a(n,l,m,"\u21bc","\\leftharpoonup");a(n,l,m,"\u21c0","\\rightharpoonup");a(n,l,m,"\u2199","\\swarrow");a(n,l,m,"\u21bd","\\leftharpoondown");a(n,l,m,"\u21c1","\\rightharpoondown");a(n,l,m,"\u2196","\\nwarrow");a(n,l,m,"\u21cc","\\rightleftharpoons");a(n,s,m,"\u226e","\\nless");a(n,s,m,"\ue010","\\nleqslant");a(n,s,m,"\ue011","\\nleqq");a(n,s,m,"\u2a87","\\lneq");a(n,s,m,"\u2268","\\lneqq");a(n,s,m,"\ue00c","\\lvertneqq");a(n,s,m,"\u22e6","\\lnsim");a(n,s,m,"\u2a89","\\lnapprox");a(n,s,m,"\u2280","\\nprec");a(n,s,m,"\u22e0","\\npreceq");a(n,s,m,"\u22e8","\\precnsim");a(n,s,m,"\u2ab9","\\precnapprox");a(n,s,m,"\u2241","\\nsim");a(n,s,m,"\ue006","\\nshortmid");a(n,s,m,"\u2224","\\nmid");a(n,s,m,"\u22ac","\\nvdash");a(n,s,m,"\u22ad","\\nvDash");a(n,s,m,"\u22ea","\\ntriangleleft");a(n,s,m,"\u22ec","\\ntrianglelefteq");a(n,s,m,"\u228a","\\subsetneq");a(n,s,m,"\ue01a","\\varsubsetneq");a(n,s,m,"\u2acb","\\subsetneqq");a(n,s,m,"\ue017","\\varsubsetneqq");a(n,s,m,"\u226f","\\ngtr");a(n,s,m,"\ue00f","\\ngeqslant");a(n,s,m,"\ue00e","\\ngeqq");a(n,s,m,"\u2a88","\\gneq");a(n,s,m,"\u2269","\\gneqq");a(n,s,m,"\ue00d","\\gvertneqq");a(n,s,m,"\u22e7","\\gnsim");a(n,s,m,"\u2a8a","\\gnapprox");a(n,s,m,"\u2281","\\nsucc");a(n,s,m,"\u22e1","\\nsucceq");a(n,s,m,"\u22e9","\\succnsim");a(n,s,m,"\u2aba","\\succnapprox");a(n,s,m,"\u2246","\\ncong");a(n,s,m,"\ue007","\\nshortparallel");a(n,s,m,"\u2226","\\nparallel");a(n,s,m,"\u22af","\\nVDash");a(n,s,m,"\u22eb","\\ntriangleright");a(n,s,m,"\u22ed","\\ntrianglerighteq");a(n,s,m,"\ue018","\\nsupseteqq");a(n,s,m,"\u228b","\\supsetneq");a(n,s,m,"\ue01b","\\varsupsetneq");a(n,s,m,"\u2acc","\\supsetneqq");a(n,s,m,"\ue019","\\varsupsetneqq");a(n,s,m,"\u22ae","\\nVdash");a(n,s,m,"\u2ab5","\\precneqq");a(n,s,m,"\u2ab6","\\succneqq");a(n,s,m,"\ue016","\\nsubseteqq");a(n,s,u,"\u22b4","\\unlhd");a(n,s,u,"\u22b5","\\unrhd");a(n,s,m,"\u219a","\\nleftarrow");a(n,s,m,"\u219b","\\nrightarrow");a(n,s,m,"\u21cd","\\nLeftarrow");a(n,s,m,"\u21cf","\\nRightarrow");a(n,s,m,"\u21ae","\\nleftrightarrow");a(n,s,m,"\u21ce","\\nLeftrightarrow");a(n,s,m,"\u25b3","\\vartriangle");a(n,s,y,"\u210f","\\hslash");a(n,s,y,"\u25bd","\\triangledown");a(n,s,y,"\u25ca","\\lozenge");a(n,s,y,"\u24c8","\\circledS");a(n,s,y,"\xae","\\circledR");a(i,s,y,"\xae","\\circledR");a(n,s,y,"\u2221","\\measuredangle");a(n,s,y,"\u2204","\\nexists");a(n,s,y,"\u2127","\\mho");a(n,s,y,"\u2132","\\Finv");a(n,s,y,"\u2141","\\Game");a(n,s,y,"k","\\Bbbk");a(n,s,y,"\u2035","\\backprime");a(n,s,y,"\u25b2","\\blacktriangle");a(n,s,y,"\u25bc","\\blacktriangledown");a(n,s,y,"\u25a0","\\blacksquare");a(n,s,y,"\u29eb","\\blacklozenge");a(n,s,y,"\u2605","\\bigstar");a(n,s,y,"\u2222","\\sphericalangle");a(n,s,y,"\u2201","\\complement");a(n,s,y,"\xf0","\\eth");a(n,s,y,"\u2571","\\diagup");a(n,s,y,"\u2572","\\diagdown");a(n,s,y,"\u25a1","\\square");a(n,s,y,"\u25a1","\\Box");a(n,s,y,"\u25ca","\\Diamond");a(n,s,y,"\xa5","\\yen");a(n,s,y,"\u2713","\\checkmark");a(i,s,y,"\u2713","\\checkmark");a(n,s,y,"\u2136","\\beth");a(n,s,y,"\u2138","\\daleth");a(n,s,y,"\u2137","\\gimel");a(n,s,y,"\u03dd","\\digamma");a(n,s,y,"\u03f0","\\varkappa");a(n,s,d,"\u250c","\\ulcorner");a(n,s,c,"\u2510","\\urcorner");a(n,s,d,"\u2514","\\llcorner");a(n,s,c,"\u2518","\\lrcorner");a(n,s,m,"\u2266","\\leqq");a(n,s,m,"\u2a7d","\\leqslant");a(n,s,m,"\u2a95","\\eqslantless");a(n,s,m,"\u2272","\\lesssim");a(n,s,m,"\u2a85","\\lessapprox");a(n,s,m,"\u224a","\\approxeq");a(n,s,u,"\u22d6","\\lessdot");a(n,s,m,"\u22d8","\\lll");a(n,s,m,"\u2276","\\lessgtr");a(n,s,m,"\u22da","\\lesseqgtr");a(n,s,m,"\u2a8b","\\lesseqqgtr");a(n,s,m,"\u2251","\\doteqdot");a(n,s,m,"\u2253","\\risingdotseq");a(n,s,m,"\u2252","\\fallingdotseq");a(n,s,m,"\u223d","\\backsim");a(n,s,m,"\u22cd","\\backsimeq");a(n,s,m,"\u2ac5","\\subseteqq");a(n,s,m,"\u22d0","\\Subset");a(n,s,m,"\u228f","\\sqsubset");a(n,s,m,"\u227c","\\preccurlyeq");a(n,s,m,"\u22de","\\curlyeqprec");a(n,s,m,"\u227e","\\precsim");a(n,s,m,"\u2ab7","\\precapprox");a(n,s,m,"\u22b2","\\vartriangleleft");a(n,s,m,"\u22b4","\\trianglelefteq");a(n,s,m,"\u22a8","\\vDash");a(n,s,m,"\u22aa","\\Vvdash");a(n,s,m,"\u2323","\\smallsmile");a(n,s,m,"\u2322","\\smallfrown");a(n,s,m,"\u224f","\\bumpeq");a(n,s,m,"\u224e","\\Bumpeq");a(n,s,m,"\u2267","\\geqq");a(n,s,m,"\u2a7e","\\geqslant");a(n,s,m,"\u2a96","\\eqslantgtr");a(n,s,m,"\u2273","\\gtrsim");a(n,s,m,"\u2a86","\\gtrapprox");a(n,s,u,"\u22d7","\\gtrdot");a(n,s,m,"\u22d9","\\ggg");a(n,s,m,"\u2277","\\gtrless");a(n,s,m,"\u22db","\\gtreqless");a(n,s,m,"\u2a8c","\\gtreqqless");a(n,s,m,"\u2256","\\eqcirc");a(n,s,m,"\u2257","\\circeq");a(n,s,m,"\u225c","\\triangleq");a(n,s,m,"\u223c","\\thicksim");a(n,s,m,"\u2248","\\thickapprox");a(n,s,m,"\u2ac6","\\supseteqq");a(n,s,m,"\u22d1","\\Supset");a(n,s,m,"\u2290","\\sqsupset");a(n,s,m,"\u227d","\\succcurlyeq");a(n,s,m,"\u22df","\\curlyeqsucc");a(n,s,m,"\u227f","\\succsim");a(n,s,m,"\u2ab8","\\succapprox");a(n,s,m,"\u22b3","\\vartriangleright");a(n,s,m,"\u22b5","\\trianglerighteq");a(n,s,m,"\u22a9","\\Vdash");a(n,s,m,"\u2223","\\shortmid");a(n,s,m,"\u2225","\\shortparallel");a(n,s,m,"\u226c","\\between");a(n,s,m,"\u22d4","\\pitchfork");a(n,s,m,"\u221d","\\varpropto");a(n,s,m,"\u25c0","\\blacktriangleleft");a(n,s,m,"\u2234","\\therefore");a(n,s,m,"\u220d","\\backepsilon");a(n,s,m,"\u25b6","\\blacktriangleright");a(n,s,m,"\u2235","\\because");a(n,s,m,"\u22d8","\\llless");a(n,s,m,"\u22d9","\\gggtr");a(n,s,u,"\u22b2","\\lhd");a(n,s,u,"\u22b3","\\rhd");a(n,s,m,"\u2242","\\eqsim");a(n,l,m,"\u22c8","\\Join");a(n,s,m,"\u2251","\\Doteq");a(n,s,u,"\u2214","\\dotplus");a(n,s,u,"\u2216","\\smallsetminus");a(n,s,u,"\u22d2","\\Cap");a(n,s,u,"\u22d3","\\Cup");a(n,s,u,"\u2a5e","\\doublebarwedge");a(n,s,u,"\u229f","\\boxminus");a(n,s,u,"\u229e","\\boxplus");a(n,s,u,"\u22c7","\\divideontimes");a(n,s,u,"\u22c9","\\ltimes");a(n,s,u,"\u22ca","\\rtimes");a(n,s,u,"\u22cb","\\leftthreetimes");a(n,s,u,"\u22cc","\\rightthreetimes");a(n,s,u,"\u22cf","\\curlywedge");a(n,s,u,"\u22ce","\\curlyvee");a(n,s,u,"\u229d","\\circleddash");a(n,s,u,"\u229b","\\circledast");a(n,s,u,"\u22c5","\\centerdot");a(n,s,u,"\u22ba","\\intercal");a(n,s,u,"\u22d2","\\doublecap");a(n,s,u,"\u22d3","\\doublecup");a(n,s,u,"\u22a0","\\boxtimes");a(n,s,m,"\u21e2","\\dashrightarrow");a(n,s,m,"\u21e0","\\dashleftarrow");a(n,s,m,"\u21c7","\\leftleftarrows");a(n,s,m,"\u21c6","\\leftrightarrows");a(n,s,m,"\u21da","\\Lleftarrow");a(n,s,m,"\u219e","\\twoheadleftarrow");a(n,s,m,"\u21a2","\\leftarrowtail");a(n,s,m,"\u21ab","\\looparrowleft");a(n,s,m,"\u21cb","\\leftrightharpoons");a(n,s,m,"\u21b6","\\curvearrowleft");a(n,s,m,"\u21ba","\\circlearrowleft");a(n,s,m,"\u21b0","\\Lsh");a(n,s,m,"\u21c8","\\upuparrows");a(n,s,m,"\u21bf","\\upharpoonleft");a(n,s,m,"\u21c3","\\downharpoonleft");a(n,s,m,"\u22b8","\\multimap");a(n,s,m,"\u21ad","\\leftrightsquigarrow");a(n,s,m,"\u21c9","\\rightrightarrows");a(n,s,m,"\u21c4","\\rightleftarrows");a(n,s,m,"\u21a0","\\twoheadrightarrow");a(n,s,m,"\u21a3","\\rightarrowtail");a(n,s,m,"\u21ac","\\looparrowright");a(n,s,m,"\u21b7","\\curvearrowright");a(n,s,m,"\u21bb","\\circlearrowright");a(n,s,m,"\u21b1","\\Rsh");a(n,s,m,"\u21ca","\\downdownarrows");a(n,s,m,"\u21be","\\upharpoonright");a(n,s,m,"\u21c2","\\downharpoonright");a(n,s,m,"\u21dd","\\rightsquigarrow");a(n,s,m,"\u21dd","\\leadsto");a(n,s,m,"\u21db","\\Rrightarrow");a(n,s,m,"\u21be","\\restriction");a(n,l,y,"\u2018","`");a(n,l,y,"$","\\$");a(i,l,y,"$","\\$");a(i,l,y,"$","\\textdollar");a(n,l,y,"%","\\%");a(i,l,y,"%","\\%");a(n,l,y,"_","\\_");a(i,l,y,"_","\\_");a(i,l,y,"_","\\textunderscore");a(n,l,y,"\u2220","\\angle");a(n,l,y,"\u221e","\\infty");a(n,l,y,"\u2032","\\prime");a(n,l,y,"\u25b3","\\triangle");a(n,l,y,"\u0393","\\Gamma",true);a(n,l,y,"\u0394","\\Delta",true);a(n,l,y,"\u0398","\\Theta",true);a(n,l,y,"\u039b","\\Lambda",true);a(n,l,y,"\u039e","\\Xi",true);a(n,l,y,"\u03a0","\\Pi",true);a(n,l,y,"\u03a3","\\Sigma",true);a(n,l,y,"\u03a5","\\Upsilon",true);a(n,l,y,"\u03a6","\\Phi",true);a(n,l,y,"\u03a8","\\Psi",true);a(n,l,y,"\u03a9","\\Omega",true);a(n,l,y,"\xac","\\neg");a(n,l,y,"\xac","\\lnot");a(n,l,y,"\u22a4","\\top");a(n,l,y,"\u22a5","\\bot");a(n,l,y,"\u2205","\\emptyset");a(n,s,y,"\u2205","\\varnothing");a(n,l,h,"\u03b1","\\alpha",true);a(n,l,h,"\u03b2","\\beta",true);a(n,l,h,"\u03b3","\\gamma",true);a(n,l,h,"\u03b4","\\delta",true);a(n,l,h,"\u03f5","\\epsilon",true);a(n,l,h,"\u03b6","\\zeta",true);a(n,l,h,"\u03b7","\\eta",true);a(n,l,h,"\u03b8","\\theta",true);a(n,l,h,"\u03b9","\\iota",true);a(n,l,h,"\u03ba","\\kappa",true);a(n,l,h,"\u03bb","\\lambda",true);a(n,l,h,"\u03bc","\\mu",true);a(n,l,h,"\u03bd","\\nu",true);a(n,l,h,"\u03be","\\xi",true);a(n,l,h,"\u03bf","\\omicron",true);a(n,l,h,"\u03c0","\\pi",true);a(n,l,h,"\u03c1","\\rho",true);a(n,l,h,"\u03c3","\\sigma",true);a(n,l,h,"\u03c4","\\tau",true);a(n,l,h,"\u03c5","\\upsilon",true);a(n,l,h,"\u03d5","\\phi",true);a(n,l,h,"\u03c7","\\chi",true);a(n,l,h,"\u03c8","\\psi",true);a(n,l,h,"\u03c9","\\omega",true);a(n,l,h,"\u03b5","\\varepsilon",true);a(n,l,h,"\u03d1","\\vartheta",true);a(n,l,h,"\u03d6","\\varpi",true);a(n,l,h,"\u03f1","\\varrho",true);a(n,l,h,"\u03c2","\\varsigma",true);a(n,l,h,"\u03c6","\\varphi",true);a(n,l,u,"\u2217","*");a(n,l,u,"+","+");a(n,l,u,"\u2212","-");a(n,l,u,"\u22c5","\\cdot");a(n,l,u,"\u2218","\\circ");a(n,l,u,"\xf7","\\div");a(n,l,u,"\xb1","\\pm");a(n,l,u,"\xd7","\\times");a(n,l,u,"\u2229","\\cap");a(n,l,u,"\u222a","\\cup");a(n,l,u,"\u2216","\\setminus");a(n,l,u,"\u2227","\\land");a(n,l,u,"\u2228","\\lor");a(n,l,u,"\u2227","\\wedge");a(n,l,u,"\u2228","\\vee");a(n,l,y,"\u221a","\\surd");a(n,l,d,"(","(");a(n,l,d,"[","[");a(n,l,d,"\u27e8","\\langle");a(n,l,d,"\u2223","\\lvert");a(n,l,d,"\u2225","\\lVert");a(n,l,c,")",")");a(n,l,c,"]","]");a(n,l,c,"?","?");a(n,l,c,"!","!");a(n,l,c,"\u27e9","\\rangle");a(n,l,c,"\u2223","\\rvert");a(n,l,c,"\u2225","\\rVert");a(n,l,m,"=","=");a(n,l,m,"<","<");a(n,l,m,">",">");a(n,l,m,":",":");a(n,l,m,"\u2248","\\approx");a(n,l,m,"\u2245","\\cong");a(n,l,m,"\u2265","\\ge");a(n,l,m,"\u2265","\\geq");a(n,l,m,"\u2190","\\gets");a(n,l,m,">","\\gt");a(n,l,m,"\u2208","\\in");a(n,l,m,"\u2209","\\notin");a(n,l,m,"\u0338","\\not");a(n,l,m,"\u2282","\\subset");a(n,l,m,"\u2283","\\supset");a(n,l,m,"\u2286","\\subseteq");a(n,l,m,"\u2287","\\supseteq");a(n,s,m,"\u2288","\\nsubseteq");a(n,s,m,"\u2289","\\nsupseteq");a(n,l,m,"\u22a8","\\models");a(n,l,m,"\u2190","\\leftarrow");a(n,l,m,"\u2264","\\le");a(n,l,m,"\u2264","\\leq");a(n,l,m,"<","\\lt");a(n,l,m,"\u2260","\\ne");a(n,l,m,"\u2260","\\neq");a(n,l,m,"\u2192","\\rightarrow");a(n,l,m,"\u2192","\\to");a(n,s,m,"\u2271","\\ngeq");a(n,s,m,"\u2270","\\nleq");a(n,l,g,null,"\\!");a(n,l,g,"\xa0","\\ ");a(n,l,g,"\xa0","~");a(n,l,g,null,"\\,");a(n,l,g,null,"\\:");a(n,l,g,null,"\\;");a(n,l,g,null,"\\enspace");a(n,l,g,null,"\\qquad");a(n,l,g,null,"\\quad");a(n,l,g,"\xa0","\\space");a(n,l,p,",",",");a(n,l,p,";",";");a(n,l,p,":","\\colon");a(n,s,u,"\u22bc","\\barwedge");a(n,s,u,"\u22bb","\\veebar");a(n,l,u,"\u2299","\\odot");a(n,l,u,"\u2295","\\oplus");a(n,l,u,"\u2297","\\otimes");a(n,l,y,"\u2202","\\partial");a(n,l,u,"\u2298","\\oslash");a(n,s,u,"\u229a","\\circledcirc");a(n,s,u,"\u22a1","\\boxdot");a(n,l,u,"\u25b3","\\bigtriangleup");a(n,l,u,"\u25bd","\\bigtriangledown");a(n,l,u,"\u2020","\\dagger");a(n,l,u,"\u22c4","\\diamond");a(n,l,u,"\u22c6","\\star");a(n,l,u,"\u25c3","\\triangleleft");a(n,l,u,"\u25b9","\\triangleright");a(n,l,d,"{","\\{");a(i,l,y,"{","\\{");a(i,l,y,"{","\\textbraceleft");a(n,l,c,"}","\\}");a(i,l,y,"}","\\}");a(i,l,y,"}","\\textbraceright");a(n,l,d,"{","\\lbrace");a(n,l,c,"}","\\rbrace");a(n,l,d,"[","\\lbrack");a(n,l,c,"]","\\rbrack");a(i,l,y,"<","\\textless");a(i,l,y,">","\\textgreater");a(n,l,d,"\u230a","\\lfloor");a(n,l,c,"\u230b","\\rfloor");a(n,l,d,"\u2308","\\lceil");a(n,l,c,"\u2309","\\rceil");a(n,l,y,"\\","\\backslash");a(n,l,y,"\u2223","|");a(n,l,y,"\u2223","\\vert");a(i,l,y,"|","\\textbar");a(n,l,y,"\u2225","\\|");a(n,l,y,"\u2225","\\Vert");a(i,l,y,"\u2225","\\textbardbl");a(n,l,m,"\u2191","\\uparrow");a(n,l,m,"\u21d1","\\Uparrow");a(n,l,m,"\u2193","\\downarrow");a(n,l,m,"\u21d3","\\Downarrow");a(n,l,m,"\u2195","\\updownarrow");a(n,l,m,"\u21d5","\\Updownarrow");a(n,l,v,"\u2210","\\coprod");a(n,l,v,"\u22c1","\\bigvee");a(n,l,v,"\u22c0","\\bigwedge");a(n,l,v,"\u2a04","\\biguplus");a(n,l,v,"\u22c2","\\bigcap");a(n,l,v,"\u22c3","\\bigcup");a(n,l,v,"\u222b","\\int");a(n,l,v,"\u222b","\\intop");a(n,l,v,"\u222c","\\iint");a(n,l,v,"\u222d","\\iiint");a(n,l,v,"\u220f","\\prod");a(n,l,v,"\u2211","\\sum");a(n,l,v,"\u2a02","\\bigotimes");a(n,l,v,"\u2a01","\\bigoplus");a(n,l,v,"\u2a00","\\bigodot");a(n,l,v,"\u222e","\\oint");a(n,l,v,"\u2a06","\\bigsqcup");a(n,l,v,"\u222b","\\smallint");a(i,l,f,"\u2026","\\textellipsis");a(n,l,f,"\u2026","\\mathellipsis");a(i,l,f,"\u2026","\\ldots",true);a(n,l,f,"\u2026","\\ldots",true);a(n,l,f,"\u22ef","\\cdots",true);a(n,l,f,"\u22f1","\\ddots",true);a(n,l,y,"\u22ee","\\vdots",true);a(n,l,o,"\xb4","\\acute");a(n,l,o,"`","\\grave");a(n,l,o,"\xa8","\\ddot");a(n,l,o,"~","\\tilde");a(n,l,o,"\xaf","\\bar");a(n,l,o,"\u02d8","\\breve");a(n,l,o,"\u02c7","\\check");a(n,l,o,"^","\\hat");a(n,l,o,"\u20d7","\\vec");a(n,l,o,"\u02d9","\\dot");a(n,l,h,"\u0131","\\imath");a(n,l,h,"\u0237","\\jmath");a(i,l,o,"\u02ca","\\'");a(i,l,o,"\u02cb","\\`");a(i,l,o,"\u02c6","\\^");a(i,l,o,"\u02dc","\\~");a(i,l,o,"\u02c9","\\=");a(i,l,o,"\u02d8","\\u");a(i,l,o,"\u02d9","\\.");a(i,l,o,"\u02da","\\r");a(i,l,o,"\u02c7","\\v");a(i,l,o,"\xa8",'\\"');a(i,l,o,"\u030b","\\H");a(i,l,y,"\u2013","--");a(i,l,y,"\u2013","\\textendash");a(i,l,y,"\u2014","---");a(i,l,y,"\u2014","\\textemdash");a(i,l,y,"\u2018","`");a(i,l,y,"\u2018","\\textquoteleft");a(i,l,y,"\u2019","'");a(i,l,y,"\u2019","\\textquoteright");a(i,l,y,"\u201c","``");a(i,l,y,"\u201c","\\textquotedblleft");a(i,l,y,"\u201d","''");a(i,l,y,"\u201d","\\textquotedblright");a(n,l,y,"\xb0","\\degree");a(i,l,y,"\xb0","\\degree");a(n,l,h,"\xa3","\\pounds");a(n,l,h,"\xa3","\\mathsterling");a(i,l,h,"\xa3","\\pounds");a(i,l,h,"\xa3","\\textsterling");a(n,s,y,"\u2720","\\maltese");a(i,s,y,"\u2720","\\maltese");a(i,l,g,"\xa0","\\ ");a(i,l,g,"\xa0"," ");a(i,l,g,"\xa0","~");var x='0123456789/@."';for(var w=0;w":">","<":"<",'"':""","'":"'"};var c=/[&><"']/g;function f(e){return u[e]}function h(e){return(""+e).replace(c,f)}var v=void 0;if(typeof document!=="undefined"){var d=document.createElement("span");if("textContent"in d){v=function e(t,r){t.textContent=r}}else{v=function e(t,r){t.innerText=r}}}function p(e){v(e,"")}t.exports={contains:i,deflt:l,escape:h,hyphenate:o,indexOf:n,setTextContent:v,clearNode:p}},{}]},{},[1])(1)}); diff --git a/static/quill/quill.bubble.css b/static/quill/quill.bubble.css new file mode 100644 index 00000000..6da0c7dc --- /dev/null +++ b/static/quill/quill.bubble.css @@ -0,0 +1,952 @@ +/*! + * Quill Editor v1.3.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor > * { + cursor: text; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; +} +.ql-editor li::before { + display: inline-block; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { + padding-left: 1.5em; +} +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-0; +} +.ql-editor ol li:before { + content: counter(list-0, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + left: 15px; + pointer-events: none; + position: absolute; + right: 15px; +} +.ql-bubble.ql-toolbar:after, +.ql-bubble .ql-toolbar:after { + clear: both; + content: ''; + display: table; +} +.ql-bubble.ql-toolbar button, +.ql-bubble .ql-toolbar button { + background: none; + border: none; + cursor: pointer; + display: inline-block; + float: left; + height: 24px; + padding: 3px 5px; + width: 28px; +} +.ql-bubble.ql-toolbar button svg, +.ql-bubble .ql-toolbar button svg { + float: left; + height: 100%; +} +.ql-bubble.ql-toolbar button:active:hover, +.ql-bubble .ql-toolbar button:active:hover { + outline: none; +} +.ql-bubble.ql-toolbar input.ql-image[type=file], +.ql-bubble .ql-toolbar input.ql-image[type=file] { + display: none; +} +.ql-bubble.ql-toolbar button:hover, +.ql-bubble .ql-toolbar button:hover, +.ql-bubble.ql-toolbar button:focus, +.ql-bubble .ql-toolbar button:focus, +.ql-bubble.ql-toolbar button.ql-active, +.ql-bubble .ql-toolbar button.ql-active, +.ql-bubble.ql-toolbar .ql-picker-label:hover, +.ql-bubble .ql-toolbar .ql-picker-label:hover, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active, +.ql-bubble.ql-toolbar .ql-picker-item:hover, +.ql-bubble .ql-toolbar .ql-picker-item:hover, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected { + color: #fff; +} +.ql-bubble.ql-toolbar button:hover .ql-fill, +.ql-bubble .ql-toolbar button:hover .ql-fill, +.ql-bubble.ql-toolbar button:focus .ql-fill, +.ql-bubble .ql-toolbar button:focus .ql-fill, +.ql-bubble.ql-toolbar button.ql-active .ql-fill, +.ql-bubble .ql-toolbar button.ql-active .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-bubble.ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { + fill: #fff; +} +.ql-bubble.ql-toolbar button:hover .ql-stroke, +.ql-bubble .ql-toolbar button:hover .ql-stroke, +.ql-bubble.ql-toolbar button:focus .ql-stroke, +.ql-bubble .ql-toolbar button:focus .ql-stroke, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-bubble.ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar button:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar button:focus .ql-stroke-miter, +.ql-bubble .ql-toolbar button:focus .ql-stroke-miter, +.ql-bubble.ql-toolbar button.ql-active .ql-stroke-miter, +.ql-bubble .ql-toolbar button.ql-active .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-bubble.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, +.ql-bubble .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { + stroke: #fff; +} +@media (pointer: coarse) { + .ql-bubble.ql-toolbar button:hover:not(.ql-active), + .ql-bubble .ql-toolbar button:hover:not(.ql-active) { + color: #ccc; + } + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { + fill: #ccc; + } + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-bubble.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, + .ql-bubble .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { + stroke: #ccc; + } +} +.ql-bubble { + box-sizing: border-box; +} +.ql-bubble * { + box-sizing: border-box; +} +.ql-bubble .ql-hidden { + display: none; +} +.ql-bubble .ql-out-bottom, +.ql-bubble .ql-out-top { + visibility: hidden; +} +.ql-bubble .ql-tooltip { + position: absolute; + transform: translateY(10px); +} +.ql-bubble .ql-tooltip a { + cursor: pointer; + text-decoration: none; +} +.ql-bubble .ql-tooltip.ql-flip { + transform: translateY(-10px); +} +.ql-bubble .ql-formats { + display: inline-block; + vertical-align: middle; +} +.ql-bubble .ql-formats:after { + clear: both; + content: ''; + display: table; +} +.ql-bubble .ql-stroke { + fill: none; + stroke: #ccc; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 2; +} +.ql-bubble .ql-stroke-miter { + fill: none; + stroke: #ccc; + stroke-miterlimit: 10; + stroke-width: 2; +} +.ql-bubble .ql-fill, +.ql-bubble .ql-stroke.ql-fill { + fill: #ccc; +} +.ql-bubble .ql-empty { + fill: none; +} +.ql-bubble .ql-even { + fill-rule: evenodd; +} +.ql-bubble .ql-thin, +.ql-bubble .ql-stroke.ql-thin { + stroke-width: 1; +} +.ql-bubble .ql-transparent { + opacity: 0.4; +} +.ql-bubble .ql-direction svg:last-child { + display: none; +} +.ql-bubble .ql-direction.ql-active svg:last-child { + display: inline; +} +.ql-bubble .ql-direction.ql-active svg:first-child { + display: none; +} +.ql-bubble .ql-editor h1 { + font-size: 2em; +} +.ql-bubble .ql-editor h2 { + font-size: 1.5em; +} +.ql-bubble .ql-editor h3 { + font-size: 1.17em; +} +.ql-bubble .ql-editor h4 { + font-size: 1em; +} +.ql-bubble .ql-editor h5 { + font-size: 0.83em; +} +.ql-bubble .ql-editor h6 { + font-size: 0.67em; +} +.ql-bubble .ql-editor a { + text-decoration: underline; +} +.ql-bubble .ql-editor blockquote { + border-left: 4px solid #ccc; + margin-bottom: 5px; + margin-top: 5px; + padding-left: 16px; +} +.ql-bubble .ql-editor code, +.ql-bubble .ql-editor pre { + background-color: #f0f0f0; + border-radius: 3px; +} +.ql-bubble .ql-editor pre { + white-space: pre-wrap; + margin-bottom: 5px; + margin-top: 5px; + padding: 5px 10px; +} +.ql-bubble .ql-editor code { + font-size: 85%; + padding: 2px 4px; +} +.ql-bubble .ql-editor pre.ql-syntax { + background-color: #23241f; + color: #f8f8f2; + overflow: visible; +} +.ql-bubble .ql-editor img { + max-width: 100%; +} +.ql-bubble .ql-picker { + color: #ccc; + display: inline-block; + float: left; + font-size: 14px; + font-weight: 500; + height: 24px; + position: relative; + vertical-align: middle; +} +.ql-bubble .ql-picker-label { + cursor: pointer; + display: inline-block; + height: 100%; + padding-left: 8px; + padding-right: 2px; + position: relative; + width: 100%; +} +.ql-bubble .ql-picker-label::before { + display: inline-block; + line-height: 22px; +} +.ql-bubble .ql-picker-options { + background-color: #444; + display: none; + min-width: 100%; + padding: 4px 8px; + position: absolute; + white-space: nowrap; +} +.ql-bubble .ql-picker-options .ql-picker-item { + cursor: pointer; + display: block; + padding-bottom: 5px; + padding-top: 5px; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label { + color: #777; + z-index: 2; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-fill { + fill: #777; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-label .ql-stroke { + stroke: #777; +} +.ql-bubble .ql-picker.ql-expanded .ql-picker-options { + display: block; + margin-top: -1px; + top: 100%; + z-index: 1; +} +.ql-bubble .ql-color-picker, +.ql-bubble .ql-icon-picker { + width: 28px; +} +.ql-bubble .ql-color-picker .ql-picker-label, +.ql-bubble .ql-icon-picker .ql-picker-label { + padding: 2px 4px; +} +.ql-bubble .ql-color-picker .ql-picker-label svg, +.ql-bubble .ql-icon-picker .ql-picker-label svg { + right: 4px; +} +.ql-bubble .ql-icon-picker .ql-picker-options { + padding: 4px 0px; +} +.ql-bubble .ql-icon-picker .ql-picker-item { + height: 24px; + width: 24px; + padding: 2px 4px; +} +.ql-bubble .ql-color-picker .ql-picker-options { + padding: 3px 5px; + width: 152px; +} +.ql-bubble .ql-color-picker .ql-picker-item { + border: 1px solid transparent; + float: left; + height: 16px; + margin: 2px; + padding: 0px; + width: 16px; +} +.ql-bubble .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { + position: absolute; + margin-top: -9px; + right: 0; + top: 50%; + width: 18px; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { + content: attr(data-label); +} +.ql-bubble .ql-picker.ql-header { + width: 98px; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item::before { + content: 'Normal'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + content: 'Heading 1'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + content: 'Heading 2'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + content: 'Heading 3'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + content: 'Heading 4'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + content: 'Heading 5'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + content: 'Heading 6'; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + font-size: 2em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + font-size: 1.5em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + font-size: 1.17em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + font-size: 1em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + font-size: 0.83em; +} +.ql-bubble .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + font-size: 0.67em; +} +.ql-bubble .ql-picker.ql-font { + width: 108px; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item::before { + content: 'Sans Serif'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + content: 'Serif'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + content: 'Monospace'; +} +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + font-family: Georgia, Times New Roman, serif; +} +.ql-bubble .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + font-family: Monaco, Courier New, monospace; +} +.ql-bubble .ql-picker.ql-size { + width: 98px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item::before { + content: 'Normal'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=small]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + content: 'Small'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=large]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + content: 'Large'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + content: 'Huge'; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + font-size: 10px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + font-size: 18px; +} +.ql-bubble .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + font-size: 32px; +} +.ql-bubble .ql-color-picker.ql-background .ql-picker-item { + background-color: #fff; +} +.ql-bubble .ql-color-picker.ql-color .ql-picker-item { + background-color: #000; +} +.ql-bubble .ql-toolbar .ql-formats { + margin: 8px 12px 8px 0px; +} +.ql-bubble .ql-toolbar .ql-formats:first-child { + margin-left: 12px; +} +.ql-bubble .ql-color-picker svg { + margin: 1px; +} +.ql-bubble .ql-color-picker .ql-picker-item.ql-selected, +.ql-bubble .ql-color-picker .ql-picker-item:hover { + border-color: #fff; +} +.ql-bubble .ql-tooltip { + background-color: #444; + border-radius: 25px; + color: #fff; +} +.ql-bubble .ql-tooltip-arrow { + border-left: 6px solid transparent; + border-right: 6px solid transparent; + content: " "; + display: block; + left: 50%; + margin-left: -6px; + position: absolute; +} +.ql-bubble .ql-tooltip:not(.ql-flip) .ql-tooltip-arrow { + border-bottom: 6px solid #444; + top: -6px; +} +.ql-bubble .ql-tooltip.ql-flip .ql-tooltip-arrow { + border-top: 6px solid #444; + bottom: -6px; +} +.ql-bubble .ql-tooltip.ql-editing .ql-tooltip-editor { + display: block; +} +.ql-bubble .ql-tooltip.ql-editing .ql-formats { + visibility: hidden; +} +.ql-bubble .ql-tooltip-editor { + display: none; +} +.ql-bubble .ql-tooltip-editor input[type=text] { + background: transparent; + border: none; + color: #fff; + font-size: 13px; + height: 100%; + outline: none; + padding: 10px 20px; + position: absolute; + width: 100%; +} +.ql-bubble .ql-tooltip-editor a { + top: 10px; + position: absolute; + right: 20px; +} +.ql-bubble .ql-tooltip-editor a:before { + color: #ccc; + content: "\D7"; + font-size: 16px; + font-weight: bold; +} +.ql-container.ql-bubble:not(.ql-disabled) a { + position: relative; + white-space: nowrap; +} +.ql-container.ql-bubble:not(.ql-disabled) a::before { + background-color: #444; + border-radius: 15px; + top: -5px; + font-size: 12px; + color: #fff; + content: attr(href); + font-weight: normal; + overflow: hidden; + padding: 5px 15px; + text-decoration: none; + z-index: 1; +} +.ql-container.ql-bubble:not(.ql-disabled) a::after { + border-top: 6px solid #444; + border-left: 6px solid transparent; + border-right: 6px solid transparent; + top: 0; + content: " "; + height: 0; + width: 0; +} +.ql-container.ql-bubble:not(.ql-disabled) a::before, +.ql-container.ql-bubble:not(.ql-disabled) a::after { + left: 0; + margin-left: 50%; + position: absolute; + transform: translate(-50%, -100%); + transition: visibility 0s ease 200ms; + visibility: hidden; +} +.ql-container.ql-bubble:not(.ql-disabled) a:hover::before, +.ql-container.ql-bubble:not(.ql-disabled) a:hover::after { + visibility: visible; +} diff --git a/static/quill/quill.core.css b/static/quill/quill.core.css new file mode 100644 index 00000000..53d8de79 --- /dev/null +++ b/static/quill/quill.core.css @@ -0,0 +1,397 @@ +/*! + * Quill Editor v1.3.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor > * { + cursor: text; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; +} +.ql-editor li::before { + display: inline-block; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { + padding-left: 1.5em; +} +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-0; +} +.ql-editor ol li:before { + content: counter(list-0, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #06c; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #06c; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + left: 15px; + pointer-events: none; + position: absolute; + right: 15px; +} diff --git a/static/quill/quill.core.js b/static/quill/quill.core.js new file mode 100644 index 00000000..bde0b1ed --- /dev/null +++ b/static/quill/quill.core.js @@ -0,0 +1,8519 @@ +/*! + * Quill Editor v1.3.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["Quill"] = factory(); + else + root["Quill"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 110); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var format_1 = __webpack_require__(18); +var leaf_1 = __webpack_require__(19); +var scroll_1 = __webpack_require__(45); +var inline_1 = __webpack_require__(46); +var block_1 = __webpack_require__(47); +var embed_1 = __webpack_require__(48); +var text_1 = __webpack_require__(49); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(31); +var style_1 = __webpack_require__(32); +var store_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default, + }, +}; +exports.default = Parchment; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ParchmentError = /** @class */ (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + var _this = this; + message = '[Parchment] ' + message; + _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _this.constructor.name; + return _this; + } + return ParchmentError; +}(Error)); +exports.ParchmentError = ParchmentError; +var attributes = {}; +var classes = {}; +var tags = {}; +var types = {}; +exports.DATA_KEY = '__blot'; +var Scope; +(function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; +})(Scope = exports.Scope || (exports.Scope = {})); +function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = + // @ts-ignore + input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); + return new BlotClass(node, value); +} +exports.create = create; +function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + // @ts-ignore + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; +} +exports.find = find; +function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + // @ts-ignore + } + else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) + return null; + // @ts-ignore + if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) + return match; + return null; +} +exports.query = query; +function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; +} +exports.register = register; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +var diff = __webpack_require__(51); +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); +var op = __webpack_require__(20); + + +var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + +var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } +}; + + +Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); +}; + +Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; +}; + +Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; +}; + +Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); +}; + +Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); +}; + +Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); +}; + +Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; +}; + +Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); +}; + +Delta.prototype.changeLength = function () { + return this.reduce(function (length, elem) { + if (elem.insert) { + return length + op.length(elem); + } else if (elem.delete) { + return length - elem.delete; + } + return length; + }, 0); +}; + +Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); +}; + +Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); +}; + + +Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); +}; + +Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; +}; + +Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); +}; + +Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + var i = 0; + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var index = typeof thisOp.insert === 'string' ? + thisOp.insert.indexOf(newline, start) - start : -1; + if (index < 0) { + line.push(iter.next()); + } else if (index > 0) { + line.push(iter.next(index)); + } else { + if (predicate(line, iter.next(1).attributes || {}, i) === false) { + return; + } + i += 1; + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}, i); + } +}; + +Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); +}; + +Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; +}; + + +module.exports = Delta; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var NEWLINE_LENGTH = 1; + +var BlockEmbed = function (_Parchment$Embed) { + _inherits(BlockEmbed, _Parchment$Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; +}(_parchment2.default.Embed); + +BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; +// It is important for cursor behavior BlockEmbeds use tags that are block level elements + + +var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; +}(_parchment2.default.Block); + +Block.blotName = 'block'; +Block.tagName = 'P'; +Block.defaultChild = 'break'; +Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; + +function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); +} + +exports.bubbleFormats = bubbleFormats; +exports.BlockEmbed = BlockEmbed; +exports.default = Block; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.overload = exports.expandConfig = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +__webpack_require__(50); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _editor = __webpack_require__(14); + +var _editor2 = _interopRequireDefault(_editor); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _selection = __webpack_require__(15); + +var _selection2 = _interopRequireDefault(_selection); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _theme = __webpack_require__(33); + +var _theme2 = _interopRequireDefault(_theme); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill'); + +var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'find', + value: function find(node) { + return node.__quill || _parchment2.default.find(node); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } else if (path.startsWith('modules') && typeof target.register === 'function') { + target.register(); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.container.__quill = this; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.root.setAttribute('data-gramm', false); + this.scrollingContainer = this.options.scrollingContainer || this.root; + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('
' + html + '


'); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + } + }, { + key: 'focus', + value: function focus() { + var scrollTop = this.scrollingContainer.scrollTop; + this.selection.focus(); + this.scrollingContainer.scrollTop = scrollTop; + this.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var bounds = void 0; + if (typeof index === 'number') { + bounds = this.selection.getBounds(index, length); + } else { + bounds = this.selection.getBounds(index.index, index.length); + } + var containerBounds = this.container.getBoundingClientRect(); + return { + bottom: bounds.bottom - containerBounds.top, + height: bounds.height, + left: bounds.left - containerBounds.left, + right: bounds.right - containerBounds.left, + top: bounds.top - containerBounds.top, + width: bounds.width + }; + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getIndex', + value: function getIndex(blot) { + return blot.offset(this.scroll); + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getLeaf', + value: function getLeaf(index) { + return this.scroll.leaf(index); + } + }, { + key: 'getLine', + value: function getLine(index) { + return this.scroll.line(index); + } + }, { + key: 'getLines', + value: function getLines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + if (typeof index !== 'number') { + return this.scroll.lines(index.index, index.length); + } else { + return this.scroll.lines(index, length); + } + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + this.selection.scrollIntoView(this.scrollingContainer); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + if (source !== _emitter4.default.sources.SILENT) { + this.selection.scrollIntoView(this.scrollingContainer); + } + } + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; +}(); + +Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + scrollingContainer: null, + strict: true, + theme: 'default' +}; +Quill.events = _emitter4.default.events; +Quill.sources = _emitter4.default.sources; +// eslint-disable-next-line no-undef +Quill.version = false ? 'dev' : "1.3.5"; + +Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default +}; + +function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; +} + +// Handle selection preservation and TEXT_CHANGE emission +// common to modification APIs +function modify(modifier, source, index, shift) { + if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; +} + +function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; +} + +function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source !== _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); +} + +exports.expandConfig = expandConfig; +exports.overload = overload; +exports.default = Quill; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; +}(_parchment2.default.Inline); + +Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; +// Lower index means deeper in the DOM tree, since not found (-1) is for embeds +Inline.order = ['cursor', 'inline', // Must be lower +'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher +]; + +exports.default = Inline; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + + function TextBlot() { + _classCallCheck(this, TextBlot); + + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } + + return TextBlot; +}(_parchment2.default.Text); + +exports.default = TextBlot; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _eventemitter = __webpack_require__(54); + +var _eventemitter2 = _interopRequireDefault(_eventemitter); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:events'); + +var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; + +EVENTS.forEach(function (eventName) { + document.addEventListener(eventName, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { + // TODO use WeakMap + if (node.__quill && node.__quill.emitter) { + var _node$__quill$emitter; + + (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); + } + }); + }); +}); + +var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); + + function Emitter() { + _classCallCheck(this, Emitter); + + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); + + _this.listeners = {}; + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }, { + key: 'handleDOM', + value: function handleDOM(event) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + (this.listeners[event.type] || []).forEach(function (_ref) { + var node = _ref.node, + handler = _ref.handler; + + if (event.target === node || node.contains(event.target)) { + handler.apply(undefined, [event].concat(args)); + } + }); + } + }, { + key: 'listenDOM', + value: function listenDOM(eventName, node, handler) { + if (!this.listeners[eventName]) { + this.listeners[eventName] = []; + } + this.listeners[eventName].push({ node: node, handler: handler }); + } + }]); + + return Emitter; +}(_eventemitter2.default); + +Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' +}; +Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' +}; + +exports.default = Emitter; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Module); + + this.quill = quill; + this.options = options; +}; + +Module.DEFAULTS = {}; + +exports.default = Module; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var levels = ['error', 'warn', 'log', 'info']; +var level = 'warn'; + +function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + var _console; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } +} + +function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); +} + +debug.level = namespace.level = function (newLevel) { + level = newLevel; +}; + +exports.default = namespace; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var pSlice = Array.prototype.slice; +var objectKeys = __webpack_require__(52); +var isArguments = __webpack_require__(53); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var Attributor = /** @class */ (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match == null) + return false; + if (this.whitelist == null) + return true; + if (typeof value === 'string') { + return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; + } + else { + return this.whitelist.indexOf(value) > -1; + } + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + var value = node.getAttribute(this.keyName); + if (this.canAdd(node, value) && value) { + return value; + } + return ''; + }; + return Attributor; +}()); +exports.default = Attributor; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Code = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; +}(_inline2.default); + +Code.blotName = 'code'; +Code.tagName = 'CODE'; + +var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(context); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; +}(_block2.default); + +CodeBlock.blotName = 'code-block'; +CodeBlock.tagName = 'PRE'; +CodeBlock.TAB = ' '; + +exports.Code = Code; +exports.default = CodeBlock; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _cursor = __webpack_require__(23); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ASCII = /^[ -~]*$/; + +var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batchStart(); + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batchEnd(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var block = this.scroll.children.head; + if (block.statics.blotName !== _block2.default.blotName) return false; + if (block.children.length > 1) return false; + return block.children.head instanceof _break2.default; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(this.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + this.delta = oldDelta.compose(change); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; +}(); + +function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); +} + +function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); +} + +exports.default = Editor; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Range = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill:selection'); + +var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; +}; + +var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.mouseDown = false; + this.root = this.scroll.domNode; + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + this.handleComposition(); + this.handleDragging(); + this.emitter.listenDOM('selectionchange', document, function () { + if (!_this.mouseDown) { + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); + } + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + if (!_this.hasFocus()) return; + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { + if (context.range) { + var _context$range = context.range, + startNode = _context$range.startNode, + startOffset = _context$range.startOffset, + endNode = _context$range.endNode, + endOffset = _context$range.endOffset; + + _this.setNativeRange(startNode, startOffset, endNode, endOffset); + } + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'handleComposition', + value: function handleComposition() { + var _this2 = this; + + this.root.addEventListener('compositionstart', function () { + _this2.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this2.composing = false; + if (_this2.cursor.parent) { + var range = _this2.cursor.restore(); + if (!range) return; + setTimeout(function () { + _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + }, 1); + } + }); + } + }, { + key: 'handleDragging', + value: function handleDragging() { + var _this3 = this; + + this.emitter.listenDOM('mousedown', document.body, function () { + _this3.mouseDown = true; + }); + this.emitter.listenDOM('mouseup', document.body, function () { + _this3.mouseDown = false; + _this3.update(_emitter4.default.sources.USER); + }); + } + }, { + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + this.root.focus(); + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + return range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + return { + bottom: rect.top + rect.height, + height: rect.height, + left: rect[side], + right: rect[side], + top: rect.top, + width: 0 + }; + } + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + var range = this.normalizeNative(nativeRange); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var normalized = this.getNativeRange(); + if (normalized == null) return [null, null]; + var range = this.normalizedToRange(normalized); + return [range, normalized]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'normalizedToRange', + value: function normalizedToRange(range) { + var _this4 = this; + + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this4.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); + var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); + return new Range(start, end - start); + } + }, { + key: 'normalizeNative', + value: function normalizeNative(nativeRange) { + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + return range; + } + }, { + key: 'rangeToNative', + value: function rangeToNative(range) { + var _this5 = this; + + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = this.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this5.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + return args; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView(scrollingContainer) { + var range = this.lastRange; + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + var limit = this.scroll.length() - 1; + + var _scroll$line = this.scroll.line(Math.min(range.index, limit)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + first = _scroll$line2[0]; + + var last = first; + if (range.length > 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); + + var _scroll$line4 = _slicedToArray(_scroll$line3, 1); + + last = _scroll$line4[0]; + } + if (first == null || last == null) return; + var scrollBounds = scrollingContainer.getBoundingClientRect(); + if (bounds.top < scrollBounds.top) { + scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; + } else if (bounds.bottom > scrollBounds.bottom) { + scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var native = (this.getNativeRange() || {}).native; + if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { + + if (startNode.tagName == "BR") { + startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); + startNode = startNode.parentNode; + } + if (endNode.tagName == "BR") { + endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); + endNode = endNode.parentNode; + } + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + var args = this.rangeToNative(range); + this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var oldRange = this.lastRange; + + var _getRange = this.getRange(), + _getRange2 = _slicedToArray(_getRange, 2), + lastRange = _getRange2[0], + nativeRange = _getRange2[1]; + + this.lastRange = lastRange; + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; +}(); + +function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); +} + +exports.Range = Range; +exports.default = Selection; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Break = function (_Parchment$Embed) { + _inherits(Break, _Parchment$Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; +}(_parchment2.default.Embed); + +Break.blotName = 'break'; +Break.tagName = 'BR'; + +exports.default = Break; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var linked_list_1 = __webpack_require__(44); +var shadow_1 = __webpack_require__(29); +var Registry = __webpack_require__(1); +var ContainerBlot = /** @class */ (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.build(); + return _this; + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.children.forEach(function (child) { + child.attach(); + }); + }; + ContainerBlot.prototype.build = function () { + var _this = this; + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice + .call(this.domNode.childNodes) + .reverse() + .forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head || undefined); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = []; + var lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && + !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(context); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations, context) { + var _this = this; + var addedNodes = []; + var removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + // Check node has actually been removed + // One exception is Chrome does not immediately remove IFRAMEs + // from DOM but MutationRecord is correct in its reported removal + if (node.parentNode != null && + // @ts-ignore + node.tagName !== 'IFRAME' && + document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes + .filter(function (node) { + return node.parentNode == _this.domNode; + }) + .sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }) + .forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot || undefined); + } + }); + }; + return ContainerBlot; +}(shadow_1.default)); +function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + // @ts-ignore + blot.domNode.appendChild(child); + }); + if (node.parentNode) { + node.parentNode.replaceChild(blot.domNode, node); + } + blot.attach(); + } + } + return blot; +} +exports.default = ContainerBlot; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var store_1 = __webpack_require__(30); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var FormatBlot = /** @class */ (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.attributes = new store_1.default(_this.domNode); + return _this; + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations, context) { + var _this = this; + _super.prototype.update.call(this, mutations, context); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; +}(container_1.default)); +exports.default = FormatBlot; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var shadow_1 = __webpack_require__(29); +var Registry = __webpack_require__(1); +var LeafBlot = /** @class */ (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (this.domNode === node || + this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return Math.min(offset, 1); + } + return -1; + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; +}(shadow_1.default)); +exports.default = LeafBlot; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); + + +var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } +}; + + +function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; +}; + +Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; +}; + +Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } +}; + +Iterator.prototype.peek = function () { + return this.ops[this.index]; +}; + +Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } +}; + +Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; +}; + + +module.exports = lib; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +var clone = (function() { +'use strict'; + +function _instanceof(obj, type) { + return type != null && obj instanceof type; +} + +var nativeMap; +try { + nativeMap = Map; +} catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; +} + +var nativeSet; +try { + nativeSet = Set; +} catch(_) { + nativeSet = function() {}; +} + +var nativePromise; +try { + nativePromise = Promise; +} catch(_) { + nativePromise = function() {}; +} + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + * @param `includeNonEnumerable` - set to true if the non-enumerable properties + * should be cloned as well. Non-enumerable properties on the prototype + * chain will be ignored. (optional - false by default) +*/ +function clone(parent, circular, depth, prototype, includeNonEnumerable) { + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + includeNonEnumerable = circular.includeNonEnumerable; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (_instanceof(parent, nativeMap)) { + child = new nativeMap(); + } else if (_instanceof(parent, nativeSet)) { + child = new nativeSet(); + } else if (_instanceof(parent, nativePromise)) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else if (_instanceof(parent, Error)) { + child = Object.create(parent); + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (_instanceof(parent, nativeMap)) { + parent.forEach(function(value, key) { + var keyChild = _clone(key, depth - 1); + var valueChild = _clone(value, depth - 1); + child.set(keyChild, valueChild); + }); + } + if (_instanceof(parent, nativeSet)) { + parent.forEach(function(value) { + var entryChild = _clone(value, depth - 1); + child.add(entryChild); + }); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); + if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { + continue; + } + child[symbol] = _clone(parent[symbol], depth - 1); + if (!descriptor.enumerable) { + Object.defineProperty(child, symbol, { + enumerable: false + }); + } + } + } + + if (includeNonEnumerable) { + var allPropertyNames = Object.getOwnPropertyNames(parent); + for (var i = 0; i < allPropertyNames.length; i++) { + var propertyName = allPropertyNames[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); + if (descriptor && descriptor.enumerable) { + continue; + } + child[propertyName] = _clone(parent[propertyName], depth - 1); + Object.defineProperty(child, propertyName, { + enumerable: false + }); + } + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +} +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +} +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +} +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +} +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +} +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _container = __webpack_require__(24); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; +} + +var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + // Some reason fixes composition issues with character languages in Windows/Chrome, Safari + _this.domNode.addEventListener('DOMNodeInserted', function () {}); + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'batchStart', + value: function batchStart() { + this.batch = true; + } + }, { + key: 'batchEnd', + value: function batchEnd() { + this.batch = false; + this.optimize(); + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0) { + if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { + this.optimize(); + return; + } + if (first instanceof _code2.default) { + var newlineIndex = first.newlineIndex(first.length(), true); + if (newlineIndex > -1) { + first = first.split(newlineIndex + 1); + if (first === last) { + this.optimize(); + return; + } + } + } else if (last instanceof _code2.default) { + var _newlineIndex = last.newlineIndex(0); + if (_newlineIndex > -1) { + last.split(_newlineIndex + 1); + } + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; +}(_parchment2.default.Scroll); + +Scroll.blotName = 'scroll'; +Scroll.className = 'ql-editor'; +Scroll.tagName = 'DIV'; +Scroll.defaultChild = 'block'; +Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; + +exports.default = Scroll; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Cursor = function (_Parchment$Embed) { + _inherits(Cursor, _Parchment$Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + if (this.selection.composing || this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start != null) { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + return { + startNode: restoreText, + startOffset: start, + endNode: restoreText, + endOffset: end + }; + } + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this2.textNode; + })) { + var range = this.restore(); + if (range) context.range = range; + } + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; +}(_parchment2.default.Embed); + +Cursor.blotName = 'cursor'; +Cursor.className = 'ql-cursor'; +Cursor.tagName = 'span'; +Cursor.CONTENTS = '\uFEFF'; // Zero width no break space + + +exports.default = Cursor; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); + + function Container() { + _classCallCheck(this, Container); + + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } + + return Container; +}(_parchment2.default.Container); + +Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; + +exports.default = Container; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); + + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); + + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } + + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); + + return ColorAttributor; +}(_parchment2.default.Attributor.Style); + +var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE +}); +var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.ColorAttributor = ColorAttributor; +exports.ColorClass = ColorClass; +exports.ColorStyle = ColorStyle; + +/***/ }), +/* 26 */, +/* 27 */, +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _container = __webpack_require__(24); + +var _container2 = _interopRequireDefault(_container); + +var _cursor = __webpack_require__(23); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _embed = __webpack_require__(35); + +var _embed2 = _interopRequireDefault(_embed); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _scroll = __webpack_require__(22); + +var _scroll2 = _interopRequireDefault(_scroll); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _clipboard = __webpack_require__(55); + +var _clipboard2 = _interopRequireDefault(_clipboard); + +var _history = __webpack_require__(42); + +var _history2 = _interopRequireDefault(_history); + +var _keyboard = __webpack_require__(34); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, + + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default +}); + +_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); + +exports.default = _quill2.default; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var ShadowBlot = /** @class */ (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + // @ts-ignore + this.domNode[Registry.DATA_KEY] = { blot: this }; + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + if (this.parent != null) { + this.scroll = this.parent.scroll; + } + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(false); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + // @ts-ignore + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent = Registry.create(this.statics.scope); + blot.wrap(parent); + parent.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (refBlot === void 0) { refBlot = null; } + if (this.parent != null) { + this.parent.children.remove(this); + } + var refDomNode = null; + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + refDomNode = refBlot.domNode; + } + if (this.next == null || this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + this.attach(); + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function (context) { + // TODO clean up once we use WeakMap + // @ts-ignore + if (this.domNode[Registry.DATA_KEY] != null) { + // @ts-ignore + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations, context) { + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; +}()); +exports.default = ShadowBlot; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(31); +var style_1 = __webpack_require__(32); +var Registry = __webpack_require__(1); +var AttributorStore = /** @class */ (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + // verb + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes + .concat(classes) + .concat(styles) + .forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; +}()); +exports.default = AttributorStore; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); +} +var ClassAttributor = /** @class */ (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name + .split('-') + .slice(0, -1) + .join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + var value = result.slice(this.keyName.length + 1); // +1 for hyphen + return this.canAdd(node, value) ? value : ''; + }; + return ClassAttributor; +}(attributor_1.default)); +exports.default = ClassAttributor; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function camelize(name) { + var parts = name.split('-'); + var rest = parts + .slice(1) + .map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }) + .join(''); + return parts[0] + rest; +} +var StyleAttributor = /** @class */ (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + // @ts-ignore + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + // @ts-ignore + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + // @ts-ignore + var value = node.style[camelize(this.keyName)]; + return this.canAdd(node, value) ? value : ''; + }; + return StyleAttributor; +}(attributor_1.default)); +exports.default = StyleAttributor; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; +}(); + +Theme.DEFAULTS = { + modules: {} +}; +Theme.themes = { + 'default': Theme +}; + +exports.default = Theme; + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SHORTKEY = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:keyboard'); + +var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + +var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { + return; + } + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + if (/Firefox/i.test(navigator.userAgent)) { + // Need to handle delete and backspace for Firefox in the general case #1171 + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); + } else { + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); + } + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$getLine = _this2.quill.getLine(range.index), + _quill$getLine2 = _slicedToArray(_quill$getLine, 2), + line = _quill$getLine2[0], + offset = _quill$getLine2[1]; + + var _quill$getLeaf = _this2.quill.getLeaf(range.index), + _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), + leafStart = _quill$getLeaf2[0], + offsetStart = _quill$getLeaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; +}(_module2.default); + +Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 +}; + +Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + shiftKey: null, + metaKey: null, + ctrlKey: null, + altKey: null, + format: ['indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range) { + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'checklist enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: { list: 'checked' }, + handler: function handler(range) { + var _quill$getLine3 = this.quill.getLine(range.index), + _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), + line = _quill$getLine4[0], + offset = _quill$getLine4[1]; + + var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); + var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range, context) { + var _quill$getLine5 = this.quill.getLine(range.index), + _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), + line = _quill$getLine6[0], + offset = _quill$getLine6[1]; + + var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, + handler: function handler(range, context) { + var length = context.prefix.length; + + var _quill$getLine7 = this.quill.getLine(range.index), + _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), + line = _quill$getLine8[0], + offset = _quill$getLine8[1]; + + if (offset > length) return true; + var value = void 0; + switch (context.prefix.trim()) { + case '[]':case '[ ]': + value = 'unchecked'; + break; + case '[x]': + value = 'checked'; + break; + case '-':case '*': + value = 'bullet'; + break; + default: + value = 'ordered'; + } + this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + }, + 'code exit': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['code-block'], + prefix: /\n\n$/, + suffix: /^\s+$/, + handler: function handler(range) { + var _quill$getLine9 = this.quill.getLine(range.index), + _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), + line = _quill$getLine10[0], + offset = _quill$getLine10[1]; + + var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); + this.quill.updateContents(delta, _quill2.default.sources.USER); + } + }, + 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), + 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), + 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), + 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) + } +}; + +function makeEmbedArrowHandler(key, shiftKey) { + var _ref3; + + var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; + return _ref3 = { + key: key, + shiftKey: shiftKey, + altKey: null + }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { + var index = range.index; + if (key === Keyboard.keys.RIGHT) { + index += range.length + 1; + } + + var _quill$getLeaf3 = this.quill.getLeaf(index), + _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), + leaf = _quill$getLeaf4[0]; + + if (!(leaf instanceof _parchment2.default.Embed)) return true; + if (key === Keyboard.keys.LEFT) { + if (shiftKey) { + this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); + } + } else { + if (shiftKey) { + this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); + } + } + return false; + }), _ref3; +} + +function handleBackspace(range, context) { + if (range.index === 0 || this.quill.getLength() <= 1) return; + + var _quill$getLine11 = this.quill.getLine(range.index), + _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), + line = _quill$getLine12[0]; + + var formats = {}; + if (context.offset === 0) { + var _quill$getLine13 = this.quill.getLine(range.index - 1), + _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), + prev = _quill$getLine14[0]; + + if (prev != null && prev.length() > 1) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + } + // Check for astral symbols + var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; + this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); + } + this.quill.focus(); +} + +function handleDelete(range, context) { + // Check for astral symbols + var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; + if (range.index >= this.quill.getLength() - length) return; + var formats = {}, + nextLength = 0; + + var _quill$getLine15 = this.quill.getLine(range.index), + _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), + line = _quill$getLine16[0]; + + if (context.offset >= line.length() - 1) { + var _quill$getLine17 = this.quill.getLine(range.index + 1), + _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), + next = _quill$getLine18[0]; + + if (next) { + var curFormats = line.formats(); + var nextFormats = this.quill.getFormat(range.index, 1); + formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; + nextLength = next.length(); + } + } + this.quill.deleteText(range.index, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); + } +} + +function handleDeleteRange(range) { + var lines = this.quill.getLines(range); + var formats = {}; + if (lines.length > 1) { + var firstFormats = lines[0].formats(); + var lastFormats = lines[lines.length - 1].formats(); + formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; + } + this.quill.deleteText(range, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); + } + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.focus(); +} + +function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + // Earlier scroll.deleteAt might have messed up our selection, + // so insertText's built in selection preservation is not reliable + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.focus(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); +} + +function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollIndex = this.quill.getIndex(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollIndex + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; +} + +function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; +} + +function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + if (binding.shortKey) { + binding[SHORTKEY] = binding.shortKey; + delete binding.shortKey; + } + return binding; +} + +exports.default = Keyboard; +exports.SHORTKEY = SHORTKEY; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var GUARD_TEXT = '\uFEFF'; + +var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed(node) { + _classCallCheck(this, Embed); + + var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); + + _this.contentNode = document.createElement('span'); + _this.contentNode.setAttribute('contenteditable', false); + [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { + _this.contentNode.appendChild(childNode); + }); + _this.leftGuard = document.createTextNode(GUARD_TEXT); + _this.rightGuard = document.createTextNode(GUARD_TEXT); + _this.domNode.appendChild(_this.leftGuard); + _this.domNode.appendChild(_this.contentNode); + _this.domNode.appendChild(_this.rightGuard); + return _this; + } + + _createClass(Embed, [{ + key: 'index', + value: function index(node, offset) { + if (node === this.leftGuard) return 0; + if (node === this.rightGuard) return 1; + return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'restore', + value: function restore(node) { + var range = void 0, + textNode = void 0; + var text = node.data.split(GUARD_TEXT).join(''); + if (node === this.leftGuard) { + if (this.prev instanceof _text2.default) { + var prevLength = this.prev.length(); + this.prev.insertAt(prevLength, text); + range = { + startNode: this.prev.domNode, + startOffset: prevLength + text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } else if (node === this.rightGuard) { + if (this.next instanceof _text2.default) { + this.next.insertAt(0, text); + range = { + startNode: this.next.domNode, + startOffset: text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this.next); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } + node.data = GUARD_TEXT; + return range; + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { + var range = _this2.restore(mutation.target); + if (range) context.range = range; + } + }); + } + }]); + + return Embed; +}(_parchment2.default.Embed); + +exports.default = Embed; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] +}; + +var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); +var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); +var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); + +exports.AlignAttribute = AlignAttribute; +exports.AlignClass = AlignClass; +exports.AlignStyle = AlignStyle; + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BackgroundStyle = exports.BackgroundClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _color = __webpack_require__(25); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE +}); +var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.BackgroundClass = BackgroundClass; +exports.BackgroundStyle = BackgroundStyle; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] +}; + +var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); +var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); +var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); + +exports.DirectionAttribute = DirectionAttribute; +exports.DirectionClass = DirectionClass; +exports.DirectionStyle = DirectionStyle; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FontClass = exports.FontStyle = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] +}; + +var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); + +var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); + + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); + + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } + + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); + + return FontStyleAttributor; +}(_parchment2.default.Attributor.Style); + +var FontStyle = new FontStyleAttributor('font', 'font-family', config); + +exports.FontStyle = FontStyle; +exports.FontClass = FontClass; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SizeStyle = exports.SizeClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] +}); +var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] +}); + +exports.SizeClass = SizeClass; +exports.SizeStyle = SizeStyle; + +/***/ }), +/* 41 */, +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getLastChangeIndex = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.stack[dest].push(delta); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'cutoff', + value: function cutoff() { + this.lastRecorded = 0; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; +}(_module2.default); + +History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false +}; + +function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; +} + +function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; +} + +exports.default = History; +exports.getLastChangeIndex = getLastChangeIndex; + +/***/ }), +/* 43 */, +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LinkedList = /** @class */ (function () { + function LinkedList() { + this.head = this.tail = null; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + this.insertBefore(nodes[0], null); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while ((cur = next())) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + if (!node) + return; + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = null; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while ((cur = next())) { + var length = cur.length(); + if (index < length || + (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while ((cur = next())) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while ((cur = next())) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; +}()); +exports.default = LinkedList; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, +}; +var MAX_OPTIMIZE_ITERATIONS = 100; +var ScrollBlot = /** @class */ (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = _super.call(this, node) || this; + _this.scroll = _this; + _this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + _this.observer.observe(_this.domNode, OBSERVER_CONFIG); + _this.attach(); + return _this; + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations, context) { + var _this = this; + if (mutations === void 0) { mutations = []; } + if (context === void 0) { context = {}; } + _super.prototype.optimize.call(this, context); + // We must modify mutations directly, cannot make copy and then modify + var records = [].slice.call(this.observer.takeRecords()); + // Array.push currently seems to be implemented by a non-tail recursive function + // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); + while (records.length > 0) + mutations.push(records.pop()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + // Post-order traversal + if ( + // @ts-ignore + blot.domNode[Registry.DATA_KEY] == null || + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(context); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = [].slice.call(this.observer.takeRecords()); + records = remaining.slice(); + while (records.length > 0) + mutations.push(records.pop()); + } + }; + ScrollBlot.prototype.update = function (mutations, context) { + var _this = this; + if (context === void 0) { context = {}; } + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations + .map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return null; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }) + .forEach(function (blot) { + // @ts-ignore + if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null) + return; + // @ts-ignore + blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); + }); + // @ts-ignore + if (this.domNode[Registry.DATA_KEY].mutations != null) { + // @ts-ignore + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); + } + this.optimize(mutations, context); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; +}(container_1.default)); +exports.default = ScrollBlot; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +// Shallow object comparison +function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + // @ts-ignore + for (var prop in obj1) { + // @ts-ignore + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; +} +var InlineBlot = /** @class */ (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; +}(format_1.default)); +exports.default = InlineBlot; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +var BlockBlot = /** @class */ (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.prototype.update = function (mutations, context) { + if (navigator.userAgent.match(/Trident/)) { + this.build(); + } + else { + _super.prototype.update.call(this, mutations, context); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; +}(format_1.default)); +exports.default = BlockBlot; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var EmbedBlot = /** @class */ (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; +}(leaf_1.default)); +exports.default = EmbedBlot; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var Registry = __webpack_require__(1); +var TextBlot = /** @class */ (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + var _this = _super.call(this, node) || this; + _this.text = _this.statics.value(_this.domNode); + return _this; + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + var text = domNode.data; + // @ts-ignore + if (text['normalize']) + text = text['normalize'](); + return text; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations, context) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; +}(leaf_1.default)); +exports.default = TextBlot; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elem = document.createElement('div'); +elem.classList.toggle('test-class', false); +if (elem.classList.contains('test-class')) { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; +} + +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; +} + +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; +} + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); +} + +document.addEventListener("DOMContentLoaded", function () { + // Disable resizing in Firefox + document.execCommand("enableObjectResizing", false, false); + // Disable automatic linkifying in IE11 + document.execCommand("autoUrlDetect", false, false); +}); + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +var DIFF_INSERT = 1; +var DIFF_EQUAL = 0; + + +/** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ +function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + commonlength = diff_commonSuffix(text1, text2); + var commonsuffix = text1.substring(text1.length - commonlength); + text1 = text1.substring(0, text1.length - commonlength); + text2 = text2.substring(0, text2.length - commonlength); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + diffs = fix_emoji(diffs); + return diffs; +}; + + +/** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ +function diff_compute_(text1, text2) { + var diffs; + + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); +}; + + +/** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ +function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + k2start += 2; + } else if (!front) { + var k1_offset = v_offset + delta - k2; + if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) { + var x1 = v1[k1_offset]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; +}; + + +/** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ +function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); +}; + + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ +function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + text2_a = hm[0]; + text2_b = hm[1]; + text1_a = hm[2]; + text1_b = hm[3]; + } + var mid_common = hm[4]; + return [text1_a, text1_b, text2_a, text2_b, mid_common]; +}; + + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ +function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + switch (diffs[pointer][0]) { + case DIFF_INSERT: + count_insert++; + text_insert += diffs[pointer][1]; + pointer++; + break; + case DIFF_DELETE: + count_delete++; + text_delete += diffs[pointer][1]; + pointer++; + break; + case DIFF_EQUAL: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (commonlength !== 0) { + diffs[pointer][1] = text_insert.substring(text_insert.length - + commonlength) + diffs[pointer][1]; + text_insert = text_insert.substring(0, text_insert.length - + commonlength); + text_delete = text_delete.substring(0, text_delete.length - + commonlength); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + diffs[pointer][1] = diffs[pointer - 1][1] + + diffs[pointer][1].substring(0, diffs[pointer][1].length - + diffs[pointer - 1][1].length); + diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; + diffs.splice(pointer - 1, 1); + changes = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + diffs[pointer - 1][1] += diffs[pointer + 1][1]; + diffs[pointer][1] = + diffs[pointer][1].substring(diffs[pointer + 1][1].length) + + diffs[pointer + 1][1]; + diffs.splice(pointer + 1, 1); + changes = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } +}; + + +var diff = diff_main; +diff.INSERT = DIFF_INSERT; +diff.DELETE = DIFF_DELETE; +diff.EQUAL = DIFF_EQUAL; + +module.exports = diff; + +/* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ +function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') +} + +/* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ +function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } +} + +/* + * Check diff did not split surrogate pairs. + * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] + * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' + * + * @param {Array} diffs Array of diff tuples + * @return {Array} Array of diff tuples + */ +function fix_emoji (diffs) { + var compact = false; + var starts_with_pair_end = function(str) { + return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; + } + var ends_with_pair_start = function(str) { + return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; + } + for (var i = 2; i < diffs.length; i += 1) { + if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && + diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && + diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { + compact = true; + + diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; + diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; + + diffs[i-2][1] = diffs[i-2][1].slice(0, -1); + } + } + if (!compact) { + return diffs; + } + var fixed_diffs = []; + for (var i = 0; i < diffs.length; i += 1) { + if (diffs[i][1].length > 0) { + fixed_diffs.push(diffs[i]); + } + } + return fixed_diffs; +} + +/* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ +function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; +} + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ +EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// This function doesn't apply anymore. +// +EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; +}; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend2 = __webpack_require__(3); + +var _extend3 = _interopRequireDefault(_extend2); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _align = __webpack_require__(36); + +var _background = __webpack_require__(37); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _color = __webpack_require__(25); + +var _direction = __webpack_require__(38); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:clipboard'); + +var DOM_KEY = '__ql-matcher'; + +var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + +var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + selector = _ref2[0], + matcher = _ref2[1]; + + if (!options.matchVisual && matcher === matchSpacing) return; + _this.addMatcher(selector, matcher); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + if (typeof html === 'string') { + this.container.innerHTML = html.replace(/\>\r?\n +\<'); // Remove spaces between tags + return this.convert(); + } + var formats = this.quill.getFormat(this.quill.selection.savedRange.index); + if (formats[_code2.default.blotName]) { + var text = this.container.innerText; + this.container.innerHTML = ''; + return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); + } + + var _prepareMatching = this.prepareMatching(), + _prepareMatching2 = _slicedToArray(_prepareMatching, 2), + elementMatchers = _prepareMatching2[0], + textMatchers = _prepareMatching2[1]; + + var delta = traverse(this.container, elementMatchers, textMatchers); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + this.quill.setContents(this.convert(index), html); + this.quill.setSelection(0, _quill2.default.sources.SILENT); + } else { + var paste = this.convert(html); + this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this2 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index); + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.container.focus(); + this.quill.selection.update(_quill2.default.sources.SILENT); + setTimeout(function () { + delta = delta.concat(_this2.convert()).delete(range.length); + _this2.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + _this2.quill.scrollingContainer.scrollTop = scrollTop; + _this2.quill.focus(); + }, 1); + } + }, { + key: 'prepareMatching', + value: function prepareMatching() { + var _this3 = this; + + var elementMatchers = [], + textMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + return [elementMatchers, textMatchers]; + } + }]); + + return Clipboard; +}(_module2.default); + +Clipboard.DEFAULTS = { + matchers: [], + matchVisual: true +}; + +function applyFormat(delta, format, value) { + if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { + return Object.keys(format).reduce(function (delta, key) { + return applyFormat(delta, key, format[key]); + }, delta); + } else { + return delta.reduce(function (delta, op) { + if (op.attributes && op.attributes[format]) { + return delta.push(op); + } else { + return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); + } + }, new _quillDelta2.default()); + } +} + +function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); +} + +function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; +} + +function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; +} + +function traverse(node, elementMatchers, textMatchers) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode, elementMatchers, textMatchers); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } +} + +function matchAlias(format, node, delta) { + return applyFormat(delta, format, true); +} + +function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + attr = ATTRIBUTE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + formats[attr.attrName] = attr.value(node) || undefined; + } + attr = STYLE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node) || undefined; + } + }); + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + return delta; +} + +function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + delta = applyFormat(delta, match.blotName, match.formats(node)); + } + return delta; +} + +function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; +} + +function matchIgnore() { + return new _quillDelta2.default(); +} + +function matchIndent(node, delta) { + var match = _parchment2.default.query(node); + if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { + return delta; + } + var indent = -1, + parent = node.parentNode; + while (!parent.classList.contains('ql-clipboard')) { + if ((_parchment2.default.query(parent) || {}).blotName === 'list') { + indent += 1; + } + parent = parent.parentNode; + } + if (indent <= 0) return delta; + return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); +} + +function matchNewline(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { + delta.insert('\n'); + } + } + return delta; +} + +function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; +} + +function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { + formats.italic = true; + } + if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; +} + +function matchText(node, delta) { + var text = node.data; + // Word represents empty line with   + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { + return delta; + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); +} + +exports.default = Clipboard; +exports.matchAttributor = matchAttributor; +exports.matchBlot = matchBlot; +exports.matchNewline = matchNewline; +exports.matchSpacing = matchSpacing; +exports.matchText = matchText; + +/***/ }), +/* 56 */, +/* 57 */, +/* 58 */, +/* 59 */, +/* 60 */, +/* 61 */, +/* 62 */, +/* 63 */, +/* 64 */, +/* 65 */, +/* 66 */, +/* 67 */, +/* 68 */, +/* 69 */, +/* 70 */, +/* 71 */, +/* 72 */, +/* 73 */, +/* 74 */, +/* 75 */, +/* 76 */, +/* 77 */, +/* 78 */, +/* 79 */, +/* 80 */, +/* 81 */, +/* 82 */, +/* 83 */, +/* 84 */, +/* 85 */, +/* 86 */, +/* 87 */, +/* 88 */, +/* 89 */, +/* 90 */, +/* 91 */, +/* 92 */, +/* 93 */, +/* 94 */, +/* 95 */, +/* 96 */, +/* 97 */, +/* 98 */, +/* 99 */, +/* 100 */, +/* 101 */, +/* 102 */, +/* 103 */, +/* 104 */, +/* 105 */, +/* 106 */, +/* 107 */, +/* 108 */, +/* 109 */, +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(28); + + +/***/ }) +/******/ ])["default"]; +}); \ No newline at end of file diff --git a/static/quill/quill.icons.js b/static/quill/quill.icons.js new file mode 100644 index 00000000..4d2b8e09 --- /dev/null +++ b/static/quill/quill.icons.js @@ -0,0 +1,15 @@ +(function () { + var icons = Quill.import('ui/icons'); + icons.header[3] = '\n' + + ' \n' + + ''; + icons.header[4] = '\n' + + ' \n' + + ''; + icons.header[5] = '\n' + + ' \n' + + ''; + icons.header[6] = '\n' + + ' \n' + + ''; +})(); \ No newline at end of file diff --git a/static/quill/quill.js b/static/quill/quill.js new file mode 100644 index 00000000..0370f8b5 --- /dev/null +++ b/static/quill/quill.js @@ -0,0 +1,11402 @@ +/*! + * Quill Editor v1.3.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(); + else if(typeof define === 'function' && define.amd) + define([], factory); + else if(typeof exports === 'object') + exports["Quill"] = factory(); + else + root["Quill"] = factory(); +})(this, function() { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 109); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var format_1 = __webpack_require__(18); +var leaf_1 = __webpack_require__(19); +var scroll_1 = __webpack_require__(45); +var inline_1 = __webpack_require__(46); +var block_1 = __webpack_require__(47); +var embed_1 = __webpack_require__(48); +var text_1 = __webpack_require__(49); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(31); +var style_1 = __webpack_require__(32); +var store_1 = __webpack_require__(30); +var Registry = __webpack_require__(1); +var Parchment = { + Scope: Registry.Scope, + create: Registry.create, + find: Registry.find, + query: Registry.query, + register: Registry.register, + Container: container_1.default, + Format: format_1.default, + Leaf: leaf_1.default, + Embed: embed_1.default, + Scroll: scroll_1.default, + Block: block_1.default, + Inline: inline_1.default, + Text: text_1.default, + Attributor: { + Attribute: attributor_1.default, + Class: class_1.default, + Style: style_1.default, + Store: store_1.default, + }, +}; +exports.default = Parchment; + + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var ParchmentError = /** @class */ (function (_super) { + __extends(ParchmentError, _super); + function ParchmentError(message) { + var _this = this; + message = '[Parchment] ' + message; + _this = _super.call(this, message) || this; + _this.message = message; + _this.name = _this.constructor.name; + return _this; + } + return ParchmentError; +}(Error)); +exports.ParchmentError = ParchmentError; +var attributes = {}; +var classes = {}; +var tags = {}; +var types = {}; +exports.DATA_KEY = '__blot'; +var Scope; +(function (Scope) { + Scope[Scope["TYPE"] = 3] = "TYPE"; + Scope[Scope["LEVEL"] = 12] = "LEVEL"; + Scope[Scope["ATTRIBUTE"] = 13] = "ATTRIBUTE"; + Scope[Scope["BLOT"] = 14] = "BLOT"; + Scope[Scope["INLINE"] = 7] = "INLINE"; + Scope[Scope["BLOCK"] = 11] = "BLOCK"; + Scope[Scope["BLOCK_BLOT"] = 10] = "BLOCK_BLOT"; + Scope[Scope["INLINE_BLOT"] = 6] = "INLINE_BLOT"; + Scope[Scope["BLOCK_ATTRIBUTE"] = 9] = "BLOCK_ATTRIBUTE"; + Scope[Scope["INLINE_ATTRIBUTE"] = 5] = "INLINE_ATTRIBUTE"; + Scope[Scope["ANY"] = 15] = "ANY"; +})(Scope = exports.Scope || (exports.Scope = {})); +function create(input, value) { + var match = query(input); + if (match == null) { + throw new ParchmentError("Unable to create " + input + " blot"); + } + var BlotClass = match; + var node = + // @ts-ignore + input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value); + return new BlotClass(node, value); +} +exports.create = create; +function find(node, bubble) { + if (bubble === void 0) { bubble = false; } + if (node == null) + return null; + // @ts-ignore + if (node[exports.DATA_KEY] != null) + return node[exports.DATA_KEY].blot; + if (bubble) + return find(node.parentNode, bubble); + return null; +} +exports.find = find; +function query(query, scope) { + if (scope === void 0) { scope = Scope.ANY; } + var match; + if (typeof query === 'string') { + match = types[query] || attributes[query]; + // @ts-ignore + } + else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) { + match = types['text']; + } + else if (typeof query === 'number') { + if (query & Scope.LEVEL & Scope.BLOCK) { + match = types['block']; + } + else if (query & Scope.LEVEL & Scope.INLINE) { + match = types['inline']; + } + } + else if (query instanceof HTMLElement) { + var names = (query.getAttribute('class') || '').split(/\s+/); + for (var i in names) { + match = classes[names[i]]; + if (match) + break; + } + match = match || tags[query.tagName]; + } + if (match == null) + return null; + // @ts-ignore + if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope) + return match; + return null; +} +exports.query = query; +function register() { + var Definitions = []; + for (var _i = 0; _i < arguments.length; _i++) { + Definitions[_i] = arguments[_i]; + } + if (Definitions.length > 1) { + return Definitions.map(function (d) { + return register(d); + }); + } + var Definition = Definitions[0]; + if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') { + throw new ParchmentError('Invalid definition'); + } + else if (Definition.blotName === 'abstract') { + throw new ParchmentError('Cannot register abstract class'); + } + types[Definition.blotName || Definition.attrName] = Definition; + if (typeof Definition.keyName === 'string') { + attributes[Definition.keyName] = Definition; + } + else { + if (Definition.className != null) { + classes[Definition.className] = Definition; + } + if (Definition.tagName != null) { + if (Array.isArray(Definition.tagName)) { + Definition.tagName = Definition.tagName.map(function (tagName) { + return tagName.toUpperCase(); + }); + } + else { + Definition.tagName = Definition.tagName.toUpperCase(); + } + var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName]; + tagNames.forEach(function (tag) { + if (tags[tag] == null || Definition.className == null) { + tags[tag] = Definition; + } + }); + } + } + return Definition; +} +exports.register = register; + + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +var diff = __webpack_require__(51); +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); +var op = __webpack_require__(20); + + +var NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff() + + +var Delta = function (ops) { + // Assume we are given a well formed ops + if (Array.isArray(ops)) { + this.ops = ops; + } else if (ops != null && Array.isArray(ops.ops)) { + this.ops = ops.ops; + } else { + this.ops = []; + } +}; + + +Delta.prototype.insert = function (text, attributes) { + var newOp = {}; + if (text.length === 0) return this; + newOp.insert = text; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype['delete'] = function (length) { + if (length <= 0) return this; + return this.push({ 'delete': length }); +}; + +Delta.prototype.retain = function (length, attributes) { + if (length <= 0) return this; + var newOp = { retain: length }; + if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) { + newOp.attributes = attributes; + } + return this.push(newOp); +}; + +Delta.prototype.push = function (newOp) { + var index = this.ops.length; + var lastOp = this.ops[index - 1]; + newOp = extend(true, {}, newOp); + if (typeof lastOp === 'object') { + if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') { + this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] }; + return this; + } + // Since it does not matter if we insert before or after deleting at the same index, + // always prefer to insert first + if (typeof lastOp['delete'] === 'number' && newOp.insert != null) { + index -= 1; + lastOp = this.ops[index - 1]; + if (typeof lastOp !== 'object') { + this.ops.unshift(newOp); + return this; + } + } + if (equal(newOp.attributes, lastOp.attributes)) { + if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') { + this.ops[index - 1] = { insert: lastOp.insert + newOp.insert }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') { + this.ops[index - 1] = { retain: lastOp.retain + newOp.retain }; + if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes + return this; + } + } + } + if (index === this.ops.length) { + this.ops.push(newOp); + } else { + this.ops.splice(index, 0, newOp); + } + return this; +}; + +Delta.prototype.chop = function () { + var lastOp = this.ops[this.ops.length - 1]; + if (lastOp && lastOp.retain && !lastOp.attributes) { + this.ops.pop(); + } + return this; +}; + +Delta.prototype.filter = function (predicate) { + return this.ops.filter(predicate); +}; + +Delta.prototype.forEach = function (predicate) { + this.ops.forEach(predicate); +}; + +Delta.prototype.map = function (predicate) { + return this.ops.map(predicate); +}; + +Delta.prototype.partition = function (predicate) { + var passed = [], failed = []; + this.forEach(function(op) { + var target = predicate(op) ? passed : failed; + target.push(op); + }); + return [passed, failed]; +}; + +Delta.prototype.reduce = function (predicate, initial) { + return this.ops.reduce(predicate, initial); +}; + +Delta.prototype.changeLength = function () { + return this.reduce(function (length, elem) { + if (elem.insert) { + return length + op.length(elem); + } else if (elem.delete) { + return length - elem.delete; + } + return length; + }, 0); +}; + +Delta.prototype.length = function () { + return this.reduce(function (length, elem) { + return length + op.length(elem); + }, 0); +}; + +Delta.prototype.slice = function (start, end) { + start = start || 0; + if (typeof end !== 'number') end = Infinity; + var ops = []; + var iter = op.iterator(this.ops); + var index = 0; + while (index < end && iter.hasNext()) { + var nextOp; + if (index < start) { + nextOp = iter.next(start - index); + } else { + nextOp = iter.next(end - index); + ops.push(nextOp); + } + index += op.length(nextOp); + } + return new Delta(ops); +}; + + +Delta.prototype.compose = function (other) { + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else if (thisIter.peekType() === 'delete') { + delta.push(thisIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (typeof otherOp.retain === 'number') { + var newOp = {}; + if (typeof thisOp.retain === 'number') { + newOp.retain = length; + } else { + newOp.insert = thisOp.insert; + } + // Preserve null when composing with a retain, otherwise remove it for inserts + var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number'); + if (attributes) newOp.attributes = attributes; + delta.push(newOp); + // Other op should be delete, we could be an insert or retain + // Insert + delete cancels out + } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') { + delta.push(otherOp); + } + } + } + return delta.chop(); +}; + +Delta.prototype.concat = function (other) { + var delta = new Delta(this.ops.slice()); + if (other.ops.length > 0) { + delta.push(other.ops[0]); + delta.ops = delta.ops.concat(other.ops.slice(1)); + } + return delta; +}; + +Delta.prototype.diff = function (other, index) { + if (this.ops === other.ops) { + return new Delta(); + } + var strings = [this, other].map(function (delta) { + return delta.map(function (op) { + if (op.insert != null) { + return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER; + } + var prep = (delta === other) ? 'on' : 'with'; + throw new Error('diff() called ' + prep + ' non-document'); + }).join(''); + }); + var delta = new Delta(); + var diffResult = diff(strings[0], strings[1], index); + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + diffResult.forEach(function (component) { + var length = component[1].length; + while (length > 0) { + var opLength = 0; + switch (component[0]) { + case diff.INSERT: + opLength = Math.min(otherIter.peekLength(), length); + delta.push(otherIter.next(opLength)); + break; + case diff.DELETE: + opLength = Math.min(length, thisIter.peekLength()); + thisIter.next(opLength); + delta['delete'](opLength); + break; + case diff.EQUAL: + opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length); + var thisOp = thisIter.next(opLength); + var otherOp = otherIter.next(opLength); + if (equal(thisOp.insert, otherOp.insert)) { + delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes)); + } else { + delta.push(otherOp)['delete'](opLength); + } + break; + } + length -= opLength; + } + }); + return delta.chop(); +}; + +Delta.prototype.eachLine = function (predicate, newline) { + newline = newline || '\n'; + var iter = op.iterator(this.ops); + var line = new Delta(); + var i = 0; + while (iter.hasNext()) { + if (iter.peekType() !== 'insert') return; + var thisOp = iter.peek(); + var start = op.length(thisOp) - iter.peekLength(); + var index = typeof thisOp.insert === 'string' ? + thisOp.insert.indexOf(newline, start) - start : -1; + if (index < 0) { + line.push(iter.next()); + } else if (index > 0) { + line.push(iter.next(index)); + } else { + if (predicate(line, iter.next(1).attributes || {}, i) === false) { + return; + } + i += 1; + line = new Delta(); + } + } + if (line.length() > 0) { + predicate(line, {}, i); + } +}; + +Delta.prototype.transform = function (other, priority) { + priority = !!priority; + if (typeof other === 'number') { + return this.transformPosition(other, priority); + } + var thisIter = op.iterator(this.ops); + var otherIter = op.iterator(other.ops); + var delta = new Delta(); + while (thisIter.hasNext() || otherIter.hasNext()) { + if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) { + delta.retain(op.length(thisIter.next())); + } else if (otherIter.peekType() === 'insert') { + delta.push(otherIter.next()); + } else { + var length = Math.min(thisIter.peekLength(), otherIter.peekLength()); + var thisOp = thisIter.next(length); + var otherOp = otherIter.next(length); + if (thisOp['delete']) { + // Our delete either makes their delete redundant or removes their retain + continue; + } else if (otherOp['delete']) { + delta.push(otherOp); + } else { + // We retain either their retain or insert + delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority)); + } + } + } + return delta.chop(); +}; + +Delta.prototype.transformPosition = function (index, priority) { + priority = !!priority; + var thisIter = op.iterator(this.ops); + var offset = 0; + while (thisIter.hasNext() && offset <= index) { + var length = thisIter.peekLength(); + var nextType = thisIter.peekType(); + thisIter.next(); + if (nextType === 'delete') { + index -= Math.min(length, index - offset); + continue; + } else if (nextType === 'insert' && (offset < index || !priority)) { + index += length; + } + offset += length; + } + return index; +}; + + +module.exports = Delta; + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +'use strict'; + +var hasOwn = Object.prototype.hasOwnProperty; +var toStr = Object.prototype.toString; + +var isArray = function isArray(arr) { + if (typeof Array.isArray === 'function') { + return Array.isArray(arr); + } + + return toStr.call(arr) === '[object Array]'; +}; + +var isPlainObject = function isPlainObject(obj) { + if (!obj || toStr.call(obj) !== '[object Object]') { + return false; + } + + var hasOwnConstructor = hasOwn.call(obj, 'constructor'); + var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf'); + // Not own constructor property must be Object + if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + var key; + for (key in obj) { /**/ } + + return typeof key === 'undefined' || hasOwn.call(obj, key); +}; + +module.exports = function extend() { + var options, name, src, copy, copyIsArray, clone; + var target = arguments[0]; + var i = 1; + var length = arguments.length; + var deep = false; + + // Handle a deep copy situation + if (typeof target === 'boolean') { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + if (target == null || (typeof target !== 'object' && typeof target !== 'function')) { + target = {}; + } + + for (; i < length; ++i) { + options = arguments[i]; + // Only deal with non-null/undefined values + if (options != null) { + // Extend the base object + for (name in options) { + src = target[name]; + copy = options[name]; + + // Prevent never-ending loop + if (target !== copy) { + // Recurse if we're merging plain objects or arrays + if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) { + if (copyIsArray) { + copyIsArray = false; + clone = src && isArray(src) ? src : []; + } else { + clone = src && isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[name] = extend(deep, clone, copy); + + // Don't bring in undefined values + } else if (typeof copy !== 'undefined') { + target[name] = copy; + } + } + } + } + } + + // Return the modified object + return target; +}; + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BlockEmbed = exports.bubbleFormats = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var NEWLINE_LENGTH = 1; + +var BlockEmbed = function (_Parchment$Embed) { + _inherits(BlockEmbed, _Parchment$Embed); + + function BlockEmbed() { + _classCallCheck(this, BlockEmbed); + + return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments)); + } + + _createClass(BlockEmbed, [{ + key: 'attach', + value: function attach() { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this); + this.attributes = new _parchment2.default.Attributor.Store(this.domNode); + } + }, { + key: 'delta', + value: function delta() { + return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values())); + } + }, { + key: 'format', + value: function format(name, value) { + var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE); + if (attribute != null) { + this.attributes.attribute(attribute, value); + } + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + this.format(name, value); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (typeof value === 'string' && value.endsWith('\n')) { + var block = _parchment2.default.create(Block.blotName); + this.parent.insertBefore(block, index === 0 ? this : this.next); + block.insertAt(0, value.slice(0, -1)); + } else { + _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def); + } + } + }]); + + return BlockEmbed; +}(_parchment2.default.Embed); + +BlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT; +// It is important for cursor behavior BlockEmbeds use tags that are block level elements + + +var Block = function (_Parchment$Block) { + _inherits(Block, _Parchment$Block); + + function Block(domNode) { + _classCallCheck(this, Block); + + var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode)); + + _this2.cache = {}; + return _this2; + } + + _createClass(Block, [{ + key: 'delta', + value: function delta() { + if (this.cache.delta == null) { + this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) { + if (leaf.length() === 0) { + return delta; + } else { + return delta.insert(leaf.value(), bubbleFormats(leaf)); + } + }, new _quillDelta2.default()).insert('\n', bubbleFormats(this)); + } + return this.cache.delta; + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length); + this.cache = {}; + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length <= 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + if (index + length === this.length()) { + this.format(name, value); + } + } else { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value); + } + this.cache = {}; + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def); + if (value.length === 0) return; + var lines = value.split('\n'); + var text = lines.shift(); + if (text.length > 0) { + if (index < this.length() - 1 || this.children.tail == null) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text); + } else { + this.children.tail.insertAt(this.children.tail.length(), text); + } + this.cache = {}; + } + var block = this; + lines.reduce(function (index, line) { + block = block.split(index, true); + block.insertAt(0, line); + return line.length; + }, index + text.length); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + var head = this.children.head; + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref); + if (head instanceof _break2.default) { + head.remove(); + } + this.cache = {}; + } + }, { + key: 'length', + value: function length() { + if (this.cache.length == null) { + this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH; + } + return this.cache.length; + } + }, { + key: 'moveChildren', + value: function moveChildren(target, ref) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref); + this.cache = {}; + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context); + this.cache = {}; + } + }, { + key: 'path', + value: function path(index) { + return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true); + } + }, { + key: 'removeChild', + value: function removeChild(child) { + _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child); + this.cache = {}; + } + }, { + key: 'split', + value: function split(index) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) { + var clone = this.clone(); + if (index === 0) { + this.parent.insertBefore(clone, this); + return this; + } else { + this.parent.insertBefore(clone, this.next); + return clone; + } + } else { + var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force); + this.cache = {}; + return next; + } + } + }]); + + return Block; +}(_parchment2.default.Block); + +Block.blotName = 'block'; +Block.tagName = 'P'; +Block.defaultChild = 'break'; +Block.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default]; + +function bubbleFormats(blot) { + var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (blot == null) return formats; + if (typeof blot.formats === 'function') { + formats = (0, _extend2.default)(formats, blot.formats()); + } + if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) { + return formats; + } + return bubbleFormats(blot.parent, formats); +} + +exports.bubbleFormats = bubbleFormats; +exports.BlockEmbed = BlockEmbed; +exports.default = Block; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.overload = exports.expandConfig = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +__webpack_require__(50); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _editor = __webpack_require__(14); + +var _editor2 = _interopRequireDefault(_editor); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _selection = __webpack_require__(15); + +var _selection2 = _interopRequireDefault(_selection); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _theme = __webpack_require__(33); + +var _theme2 = _interopRequireDefault(_theme); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill'); + +var Quill = function () { + _createClass(Quill, null, [{ + key: 'debug', + value: function debug(limit) { + if (limit === true) { + limit = 'log'; + } + _logger2.default.level(limit); + } + }, { + key: 'find', + value: function find(node) { + return node.__quill || _parchment2.default.find(node); + } + }, { + key: 'import', + value: function _import(name) { + if (this.imports[name] == null) { + debug.error('Cannot import ' + name + '. Are you sure it was registered?'); + } + return this.imports[name]; + } + }, { + key: 'register', + value: function register(path, target) { + var _this = this; + + var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (typeof path !== 'string') { + var name = path.attrName || path.blotName; + if (typeof name === 'string') { + // register(Blot | Attributor, overwrite) + this.register('formats/' + name, path, target); + } else { + Object.keys(path).forEach(function (key) { + _this.register(key, path[key], target); + }); + } + } else { + if (this.imports[path] != null && !overwrite) { + debug.warn('Overwriting ' + path + ' with', target); + } + this.imports[path] = target; + if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') { + _parchment2.default.register(target); + } else if (path.startsWith('modules') && typeof target.register === 'function') { + target.register(); + } + } + } + }]); + + function Quill(container) { + var _this2 = this; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Quill); + + this.options = expandConfig(container, options); + this.container = this.options.container; + if (this.container == null) { + return debug.error('Invalid Quill container', container); + } + if (this.options.debug) { + Quill.debug(this.options.debug); + } + var html = this.container.innerHTML.trim(); + this.container.classList.add('ql-container'); + this.container.innerHTML = ''; + this.container.__quill = this; + this.root = this.addContainer('ql-editor'); + this.root.classList.add('ql-blank'); + this.root.setAttribute('data-gramm', false); + this.scrollingContainer = this.options.scrollingContainer || this.root; + this.emitter = new _emitter4.default(); + this.scroll = _parchment2.default.create(this.root, { + emitter: this.emitter, + whitelist: this.options.formats + }); + this.editor = new _editor2.default(this.scroll); + this.selection = new _selection2.default(this.scroll, this.emitter); + this.theme = new this.options.theme(this, this.options); + this.keyboard = this.theme.addModule('keyboard'); + this.clipboard = this.theme.addModule('clipboard'); + this.history = this.theme.addModule('history'); + this.theme.init(); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) { + if (type === _emitter4.default.events.TEXT_CHANGE) { + _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank()); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) { + var range = _this2.selection.lastRange; + var index = range && range.length === 0 ? range.index : undefined; + modify.call(_this2, function () { + return _this2.editor.update(null, mutations, index); + }, source); + }); + var contents = this.clipboard.convert('
' + html + '


'); + this.setContents(contents); + this.history.clear(); + if (this.options.placeholder) { + this.root.setAttribute('data-placeholder', this.options.placeholder); + } + if (this.options.readOnly) { + this.disable(); + } + } + + _createClass(Quill, [{ + key: 'addContainer', + value: function addContainer(container) { + var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + if (typeof container === 'string') { + var className = container; + container = document.createElement('div'); + container.classList.add(className); + } + this.container.insertBefore(container, refNode); + return container; + } + }, { + key: 'blur', + value: function blur() { + this.selection.setRange(null); + } + }, { + key: 'deleteText', + value: function deleteText(index, length, source) { + var _this3 = this; + + var _overload = overload(index, length, source); + + var _overload2 = _slicedToArray(_overload, 4); + + index = _overload2[0]; + length = _overload2[1]; + source = _overload2[3]; + + return modify.call(this, function () { + return _this3.editor.deleteText(index, length); + }, source, index, -1 * length); + } + }, { + key: 'disable', + value: function disable() { + this.enable(false); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.scroll.enable(enabled); + this.container.classList.toggle('ql-disabled', !enabled); + } + }, { + key: 'focus', + value: function focus() { + var scrollTop = this.scrollingContainer.scrollTop; + this.selection.focus(); + this.scrollingContainer.scrollTop = scrollTop; + this.scrollIntoView(); + } + }, { + key: 'format', + value: function format(name, value) { + var _this4 = this; + + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + return modify.call(this, function () { + var range = _this4.getSelection(true); + var change = new _quillDelta2.default(); + if (range == null) { + return change; + } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) { + change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value)); + } else if (range.length === 0) { + _this4.selection.format(name, value); + return change; + } else { + change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value)); + } + _this4.setSelection(range, _emitter4.default.sources.SILENT); + return change; + }, source); + } + }, { + key: 'formatLine', + value: function formatLine(index, length, name, value, source) { + var _this5 = this; + + var formats = void 0; + + var _overload3 = overload(index, length, name, value, source); + + var _overload4 = _slicedToArray(_overload3, 4); + + index = _overload4[0]; + length = _overload4[1]; + formats = _overload4[2]; + source = _overload4[3]; + + return modify.call(this, function () { + return _this5.editor.formatLine(index, length, formats); + }, source, index, 0); + } + }, { + key: 'formatText', + value: function formatText(index, length, name, value, source) { + var _this6 = this; + + var formats = void 0; + + var _overload5 = overload(index, length, name, value, source); + + var _overload6 = _slicedToArray(_overload5, 4); + + index = _overload6[0]; + length = _overload6[1]; + formats = _overload6[2]; + source = _overload6[3]; + + return modify.call(this, function () { + return _this6.editor.formatText(index, length, formats); + }, source, index, 0); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var bounds = void 0; + if (typeof index === 'number') { + bounds = this.selection.getBounds(index, length); + } else { + bounds = this.selection.getBounds(index.index, index.length); + } + var containerBounds = this.container.getBoundingClientRect(); + return { + bottom: bounds.bottom - containerBounds.top, + height: bounds.height, + left: bounds.left - containerBounds.left, + right: bounds.right - containerBounds.left, + top: bounds.top - containerBounds.top, + width: bounds.width + }; + } + }, { + key: 'getContents', + value: function getContents() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload7 = overload(index, length); + + var _overload8 = _slicedToArray(_overload7, 2); + + index = _overload8[0]; + length = _overload8[1]; + + return this.editor.getContents(index, length); + } + }, { + key: 'getFormat', + value: function getFormat() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true); + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + if (typeof index === 'number') { + return this.editor.getFormat(index, length); + } else { + return this.editor.getFormat(index.index, index.length); + } + } + }, { + key: 'getIndex', + value: function getIndex(blot) { + return blot.offset(this.scroll); + } + }, { + key: 'getLength', + value: function getLength() { + return this.scroll.length(); + } + }, { + key: 'getLeaf', + value: function getLeaf(index) { + return this.scroll.leaf(index); + } + }, { + key: 'getLine', + value: function getLine(index) { + return this.scroll.line(index); + } + }, { + key: 'getLines', + value: function getLines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + if (typeof index !== 'number') { + return this.scroll.lines(index.index, index.length); + } else { + return this.scroll.lines(index, length); + } + } + }, { + key: 'getModule', + value: function getModule(name) { + return this.theme.modules[name]; + } + }, { + key: 'getSelection', + value: function getSelection() { + var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; + + if (focus) this.focus(); + this.update(); // Make sure we access getRange with editor in consistent state + return this.selection.getRange()[0]; + } + }, { + key: 'getText', + value: function getText() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index; + + var _overload9 = overload(index, length); + + var _overload10 = _slicedToArray(_overload9, 2); + + index = _overload10[0]; + length = _overload10[1]; + + return this.editor.getText(index, length); + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return this.selection.hasFocus(); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + var _this7 = this; + + var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API; + + return modify.call(this, function () { + return _this7.editor.insertEmbed(index, embed, value); + }, source, index); + } + }, { + key: 'insertText', + value: function insertText(index, text, name, value, source) { + var _this8 = this; + + var formats = void 0; + + var _overload11 = overload(index, 0, name, value, source); + + var _overload12 = _slicedToArray(_overload11, 4); + + index = _overload12[0]; + formats = _overload12[2]; + source = _overload12[3]; + + return modify.call(this, function () { + return _this8.editor.insertText(index, text, formats); + }, source, index, text.length); + } + }, { + key: 'isEnabled', + value: function isEnabled() { + return !this.container.classList.contains('ql-disabled'); + } + }, { + key: 'off', + value: function off() { + return this.emitter.off.apply(this.emitter, arguments); + } + }, { + key: 'on', + value: function on() { + return this.emitter.on.apply(this.emitter, arguments); + } + }, { + key: 'once', + value: function once() { + return this.emitter.once.apply(this.emitter, arguments); + } + }, { + key: 'pasteHTML', + value: function pasteHTML(index, html, source) { + this.clipboard.dangerouslyPasteHTML(index, html, source); + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length, source) { + var _this9 = this; + + var _overload13 = overload(index, length, source); + + var _overload14 = _slicedToArray(_overload13, 4); + + index = _overload14[0]; + length = _overload14[1]; + source = _overload14[3]; + + return modify.call(this, function () { + return _this9.editor.removeFormat(index, length); + }, source, index); + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView() { + this.selection.scrollIntoView(this.scrollingContainer); + } + }, { + key: 'setContents', + value: function setContents(delta) { + var _this10 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + var length = _this10.getLength(); + var deleted = _this10.editor.deleteText(0, length); + var applied = _this10.editor.applyDelta(delta); + var lastOp = applied.ops[applied.ops.length - 1]; + if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\n') { + _this10.editor.deleteText(_this10.getLength() - 1, 1); + applied.delete(1); + } + var ret = deleted.compose(applied); + return ret; + }, source); + } + }, { + key: 'setSelection', + value: function setSelection(index, length, source) { + if (index == null) { + this.selection.setRange(null, length || Quill.sources.API); + } else { + var _overload15 = overload(index, length, source); + + var _overload16 = _slicedToArray(_overload15, 4); + + index = _overload16[0]; + length = _overload16[1]; + source = _overload16[3]; + + this.selection.setRange(new _selection.Range(index, length), source); + if (source !== _emitter4.default.sources.SILENT) { + this.selection.scrollIntoView(this.scrollingContainer); + } + } + } + }, { + key: 'setText', + value: function setText(text) { + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + var delta = new _quillDelta2.default().insert(text); + return this.setContents(delta, source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes + this.selection.update(source); + return change; + } + }, { + key: 'updateContents', + value: function updateContents(delta) { + var _this11 = this; + + var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API; + + return modify.call(this, function () { + delta = new _quillDelta2.default(delta); + return _this11.editor.applyDelta(delta, source); + }, source, true); + } + }]); + + return Quill; +}(); + +Quill.DEFAULTS = { + bounds: null, + formats: null, + modules: {}, + placeholder: '', + readOnly: false, + scrollingContainer: null, + strict: true, + theme: 'default' +}; +Quill.events = _emitter4.default.events; +Quill.sources = _emitter4.default.sources; +// eslint-disable-next-line no-undef +Quill.version = false ? 'dev' : "1.3.5"; + +Quill.imports = { + 'delta': _quillDelta2.default, + 'parchment': _parchment2.default, + 'core/module': _module2.default, + 'core/theme': _theme2.default +}; + +function expandConfig(container, userConfig) { + userConfig = (0, _extend2.default)(true, { + container: container, + modules: { + clipboard: true, + keyboard: true, + history: true + } + }, userConfig); + if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) { + userConfig.theme = _theme2.default; + } else { + userConfig.theme = Quill.import('themes/' + userConfig.theme); + if (userConfig.theme == null) { + throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?'); + } + } + var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS); + [themeConfig, userConfig].forEach(function (config) { + config.modules = config.modules || {}; + Object.keys(config.modules).forEach(function (module) { + if (config.modules[module] === true) { + config.modules[module] = {}; + } + }); + }); + var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules)); + var moduleConfig = moduleNames.reduce(function (config, name) { + var moduleClass = Quill.import('modules/' + name); + if (moduleClass == null) { + debug.error('Cannot load ' + name + ' module. Are you sure you registered it?'); + } else { + config[name] = moduleClass.DEFAULTS || {}; + } + return config; + }, {}); + // Special case toolbar shorthand + if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) { + userConfig.modules.toolbar = { + container: userConfig.modules.toolbar + }; + } + userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig); + ['bounds', 'container', 'scrollingContainer'].forEach(function (key) { + if (typeof userConfig[key] === 'string') { + userConfig[key] = document.querySelector(userConfig[key]); + } + }); + userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) { + if (userConfig.modules[name]) { + config[name] = userConfig.modules[name]; + } + return config; + }, {}); + return userConfig; +} + +// Handle selection preservation and TEXT_CHANGE emission +// common to modification APIs +function modify(modifier, source, index, shift) { + if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) { + return new _quillDelta2.default(); + } + var range = index == null ? null : this.getSelection(); + var oldDelta = this.editor.delta; + var change = modifier(); + if (range != null) { + if (index === true) index = range.index; + if (shift == null) { + range = shiftRange(range, change, source); + } else if (shift !== 0) { + range = shiftRange(range, index, shift, source); + } + this.setSelection(range, _emitter4.default.sources.SILENT); + } + if (change.length() > 0) { + var _emitter; + + var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + return change; +} + +function overload(index, length, name, value, source) { + var formats = {}; + if (typeof index.index === 'number' && typeof index.length === 'number') { + // Allow for throwaway end (used by insertText/insertEmbed) + if (typeof length !== 'number') { + source = value, value = name, name = length, length = index.length, index = index.index; + } else { + length = index.length, index = index.index; + } + } else if (typeof length !== 'number') { + source = value, value = name, name = length, length = 0; + } + // Handle format being object, two format name/value strings or excluded + if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { + formats = name; + source = value; + } else if (typeof name === 'string') { + if (value != null) { + formats[name] = value; + } else { + source = name; + } + } + // Handle optional source + source = source || _emitter4.default.sources.API; + return [index, length, formats, source]; +} + +function shiftRange(range, index, length, source) { + if (range == null) return null; + var start = void 0, + end = void 0; + if (index instanceof _quillDelta2.default) { + var _map = [range.index, range.index + range.length].map(function (pos) { + return index.transformPosition(pos, source !== _emitter4.default.sources.USER); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + } else { + var _map3 = [range.index, range.index + range.length].map(function (pos) { + if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos; + if (length >= 0) { + return pos + length; + } else { + return Math.max(index, pos + length); + } + }); + + var _map4 = _slicedToArray(_map3, 2); + + start = _map4[0]; + end = _map4[1]; + } + return new _selection.Range(start, end - start); +} + +exports.expandConfig = expandConfig; +exports.overload = overload; +exports.default = Quill; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Inline = function (_Parchment$Inline) { + _inherits(Inline, _Parchment$Inline); + + function Inline() { + _classCallCheck(this, Inline); + + return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments)); + } + + _createClass(Inline, [{ + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) { + var blot = this.isolate(index, length); + if (value) { + blot.wrap(name, value); + } + } else { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context); + if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) { + var parent = this.parent.isolate(this.offset(), this.length()); + this.moveChildren(parent); + parent.wrap(this); + } + } + }], [{ + key: 'compare', + value: function compare(self, other) { + var selfIndex = Inline.order.indexOf(self); + var otherIndex = Inline.order.indexOf(other); + if (selfIndex >= 0 || otherIndex >= 0) { + return selfIndex - otherIndex; + } else if (self === other) { + return 0; + } else if (self < other) { + return -1; + } else { + return 1; + } + } + }]); + + return Inline; +}(_parchment2.default.Inline); + +Inline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default]; +// Lower index means deeper in the DOM tree, since not found (-1) is for embeds +Inline.order = ['cursor', 'inline', // Must be lower +'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher +]; + +exports.default = Inline; + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TextBlot = function (_Parchment$Text) { + _inherits(TextBlot, _Parchment$Text); + + function TextBlot() { + _classCallCheck(this, TextBlot); + + return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments)); + } + + return TextBlot; +}(_parchment2.default.Text); + +exports.default = TextBlot; + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _eventemitter = __webpack_require__(54); + +var _eventemitter2 = _interopRequireDefault(_eventemitter); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:events'); + +var EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click']; + +EVENTS.forEach(function (eventName) { + document.addEventListener(eventName, function () { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) { + // TODO use WeakMap + if (node.__quill && node.__quill.emitter) { + var _node$__quill$emitter; + + (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args); + } + }); + }); +}); + +var Emitter = function (_EventEmitter) { + _inherits(Emitter, _EventEmitter); + + function Emitter() { + _classCallCheck(this, Emitter); + + var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this)); + + _this.listeners = {}; + _this.on('error', debug.error); + return _this; + } + + _createClass(Emitter, [{ + key: 'emit', + value: function emit() { + debug.log.apply(debug, arguments); + _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments); + } + }, { + key: 'handleDOM', + value: function handleDOM(event) { + for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + (this.listeners[event.type] || []).forEach(function (_ref) { + var node = _ref.node, + handler = _ref.handler; + + if (event.target === node || node.contains(event.target)) { + handler.apply(undefined, [event].concat(args)); + } + }); + } + }, { + key: 'listenDOM', + value: function listenDOM(eventName, node, handler) { + if (!this.listeners[eventName]) { + this.listeners[eventName] = []; + } + this.listeners[eventName].push({ node: node, handler: handler }); + } + }]); + + return Emitter; +}(_eventemitter2.default); + +Emitter.events = { + EDITOR_CHANGE: 'editor-change', + SCROLL_BEFORE_UPDATE: 'scroll-before-update', + SCROLL_OPTIMIZE: 'scroll-optimize', + SCROLL_UPDATE: 'scroll-update', + SELECTION_CHANGE: 'selection-change', + TEXT_CHANGE: 'text-change' +}; +Emitter.sources = { + API: 'api', + SILENT: 'silent', + USER: 'user' +}; + +exports.default = Emitter; + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Module = function Module(quill) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, Module); + + this.quill = quill; + this.options = options; +}; + +Module.DEFAULTS = {}; + +exports.default = Module; + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var levels = ['error', 'warn', 'log', 'info']; +var level = 'warn'; + +function debug(method) { + if (levels.indexOf(method) <= levels.indexOf(level)) { + var _console; + + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + (_console = console)[method].apply(_console, args); // eslint-disable-line no-console + } +} + +function namespace(ns) { + return levels.reduce(function (logger, method) { + logger[method] = debug.bind(console, method, ns); + return logger; + }, {}); +} + +debug.level = namespace.level = function (newLevel) { + level = newLevel; +}; + +exports.default = namespace; + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +var pSlice = Array.prototype.slice; +var objectKeys = __webpack_require__(52); +var isArguments = __webpack_require__(53); + +var deepEqual = module.exports = function (actual, expected, opts) { + if (!opts) opts = {}; + // 7.1. All identical values are equivalent, as determined by ===. + if (actual === expected) { + return true; + + } else if (actual instanceof Date && expected instanceof Date) { + return actual.getTime() === expected.getTime(); + + // 7.3. Other pairs that do not both pass typeof value == 'object', + // equivalence is determined by ==. + } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') { + return opts.strict ? actual === expected : actual == expected; + + // 7.4. For all other Object pairs, including Array objects, equivalence is + // determined by having the same number of owned properties (as verified + // with Object.prototype.hasOwnProperty.call), the same set of keys + // (although not necessarily the same order), equivalent values for every + // corresponding key, and an identical 'prototype' property. Note: this + // accounts for both named and indexed properties on Arrays. + } else { + return objEquiv(actual, expected, opts); + } +} + +function isUndefinedOrNull(value) { + return value === null || value === undefined; +} + +function isBuffer (x) { + if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false; + if (typeof x.copy !== 'function' || typeof x.slice !== 'function') { + return false; + } + if (x.length > 0 && typeof x[0] !== 'number') return false; + return true; +} + +function objEquiv(a, b, opts) { + var i, key; + if (isUndefinedOrNull(a) || isUndefinedOrNull(b)) + return false; + // an identical 'prototype' property. + if (a.prototype !== b.prototype) return false; + //~~~I've managed to break Object.keys through screwy arguments passing. + // Converting to array solves the problem. + if (isArguments(a)) { + if (!isArguments(b)) { + return false; + } + a = pSlice.call(a); + b = pSlice.call(b); + return deepEqual(a, b, opts); + } + if (isBuffer(a)) { + if (!isBuffer(b)) { + return false; + } + if (a.length !== b.length) return false; + for (i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; + } + try { + var ka = objectKeys(a), + kb = objectKeys(b); + } catch (e) {//happens when one is a string literal and the other isn't + return false; + } + // having the same number of owned properties (keys incorporates + // hasOwnProperty) + if (ka.length != kb.length) + return false; + //the same set of keys (although not necessarily the same order), + ka.sort(); + kb.sort(); + //~~~cheap key test + for (i = ka.length - 1; i >= 0; i--) { + if (ka[i] != kb[i]) + return false; + } + //equivalent values for every corresponding key, and + //~~~possibly expensive deep test + for (i = ka.length - 1; i >= 0; i--) { + key = ka[i]; + if (!deepEqual(a[key], b[key], opts)) return false; + } + return typeof a === typeof b; +} + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var Attributor = /** @class */ (function () { + function Attributor(attrName, keyName, options) { + if (options === void 0) { options = {}; } + this.attrName = attrName; + this.keyName = keyName; + var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE; + if (options.scope != null) { + // Ignore type bits, force attribute bit + this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit; + } + else { + this.scope = Registry.Scope.ATTRIBUTE; + } + if (options.whitelist != null) + this.whitelist = options.whitelist; + } + Attributor.keys = function (node) { + return [].map.call(node.attributes, function (item) { + return item.name; + }); + }; + Attributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + node.setAttribute(this.keyName, value); + return true; + }; + Attributor.prototype.canAdd = function (node, value) { + var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE)); + if (match == null) + return false; + if (this.whitelist == null) + return true; + if (typeof value === 'string') { + return this.whitelist.indexOf(value.replace(/["']/g, '')) > -1; + } + else { + return this.whitelist.indexOf(value) > -1; + } + }; + Attributor.prototype.remove = function (node) { + node.removeAttribute(this.keyName); + }; + Attributor.prototype.value = function (node) { + var value = node.getAttribute(this.keyName); + if (this.canAdd(node, value) && value) { + return value; + } + return ''; + }; + return Attributor; +}()); +exports.default = Attributor; + + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Code = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Code = function (_Inline) { + _inherits(Code, _Inline); + + function Code() { + _classCallCheck(this, Code); + + return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments)); + } + + return Code; +}(_inline2.default); + +Code.blotName = 'code'; +Code.tagName = 'CODE'; + +var CodeBlock = function (_Block) { + _inherits(CodeBlock, _Block); + + function CodeBlock() { + _classCallCheck(this, CodeBlock); + + return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments)); + } + + _createClass(CodeBlock, [{ + key: 'delta', + value: function delta() { + var _this3 = this; + + var text = this.domNode.textContent; + if (text.endsWith('\n')) { + // Should always be true + text = text.slice(0, -1); + } + return text.split('\n').reduce(function (delta, frag) { + return delta.insert(frag).insert('\n', _this3.formats()); + }, new _quillDelta2.default()); + } + }, { + key: 'format', + value: function format(name, value) { + if (name === this.statics.blotName && value) return; + + var _descendant = this.descendant(_text2.default, this.length() - 1), + _descendant2 = _slicedToArray(_descendant, 1), + text = _descendant2[0]; + + if (text != null) { + text.deleteAt(text.length() - 1, 1); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, name, value) { + if (length === 0) return; + if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) { + return; + } + var nextNewline = this.newlineIndex(index); + if (nextNewline < 0 || nextNewline >= index + length) return; + var prevNewline = this.newlineIndex(index, true) + 1; + var isolateLength = nextNewline - prevNewline + 1; + var blot = this.isolate(prevNewline, isolateLength); + var next = blot.next; + blot.format(name, value); + if (next instanceof CodeBlock) { + next.formatAt(0, index - prevNewline + length - isolateLength, name, value); + } + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null) return; + + var _descendant3 = this.descendant(_text2.default, index), + _descendant4 = _slicedToArray(_descendant3, 2), + text = _descendant4[0], + offset = _descendant4[1]; + + text.insertAt(offset, value); + } + }, { + key: 'length', + value: function length() { + var length = this.domNode.textContent.length; + if (!this.domNode.textContent.endsWith('\n')) { + return length + 1; + } + return length; + } + }, { + key: 'newlineIndex', + value: function newlineIndex(searchIndex) { + var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + if (!reverse) { + var offset = this.domNode.textContent.slice(searchIndex).indexOf('\n'); + return offset > -1 ? searchIndex + offset : -1; + } else { + return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\n'); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + if (!this.domNode.textContent.endsWith('\n')) { + this.appendChild(_parchment2.default.create('text', '\n')); + } + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) { + next.optimize(context); + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target); + [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) { + var blot = _parchment2.default.find(node); + if (blot == null) { + node.parentNode.removeChild(node); + } else if (blot instanceof _parchment2.default.Embed) { + blot.remove(); + } else { + blot.unwrap(); + } + }); + } + }], [{ + key: 'create', + value: function create(value) { + var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value); + domNode.setAttribute('spellcheck', false); + return domNode; + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return CodeBlock; +}(_block2.default); + +CodeBlock.blotName = 'code-block'; +CodeBlock.tagName = 'PRE'; +CodeBlock.TAB = ' '; + +exports.Code = Code; +exports.default = CodeBlock; + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _cursor = __webpack_require__(23); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var ASCII = /^[ -~]*$/; + +var Editor = function () { + function Editor(scroll) { + _classCallCheck(this, Editor); + + this.scroll = scroll; + this.delta = this.getDelta(); + } + + _createClass(Editor, [{ + key: 'applyDelta', + value: function applyDelta(delta) { + var _this = this; + + var consumeNextNewline = false; + this.scroll.update(); + var scrollLength = this.scroll.length(); + this.scroll.batchStart(); + delta = normalizeDelta(delta); + delta.reduce(function (index, op) { + var length = op.retain || op.delete || op.insert.length || 1; + var attributes = op.attributes || {}; + if (op.insert != null) { + if (typeof op.insert === 'string') { + var text = op.insert; + if (text.endsWith('\n') && consumeNextNewline) { + consumeNextNewline = false; + text = text.slice(0, -1); + } + if (index >= scrollLength && !text.endsWith('\n')) { + consumeNextNewline = true; + } + _this.scroll.insertAt(index, text); + + var _scroll$line = _this.scroll.line(index), + _scroll$line2 = _slicedToArray(_scroll$line, 2), + line = _scroll$line2[0], + offset = _scroll$line2[1]; + + var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line)); + if (line instanceof _block2.default) { + var _line$descendant = line.descendant(_parchment2.default.Leaf, offset), + _line$descendant2 = _slicedToArray(_line$descendant, 1), + leaf = _line$descendant2[0]; + + formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf)); + } + attributes = _op2.default.attributes.diff(formats, attributes) || {}; + } else if (_typeof(op.insert) === 'object') { + var key = Object.keys(op.insert)[0]; // There should only be one key + if (key == null) return index; + _this.scroll.insertAt(index, key, op.insert[key]); + } + scrollLength += length; + } + Object.keys(attributes).forEach(function (name) { + _this.scroll.formatAt(index, length, name, attributes[name]); + }); + return index + length; + }, 0); + delta.reduce(function (index, op) { + if (typeof op.delete === 'number') { + _this.scroll.deleteAt(index, op.delete); + return index; + } + return index + (op.retain || op.insert.length || 1); + }, 0); + this.scroll.batchEnd(); + return this.update(delta); + } + }, { + key: 'deleteText', + value: function deleteText(index, length) { + this.scroll.deleteAt(index, length); + return this.update(new _quillDelta2.default().retain(index).delete(length)); + } + }, { + key: 'formatLine', + value: function formatLine(index, length) { + var _this2 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + this.scroll.update(); + Object.keys(formats).forEach(function (format) { + if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return; + var lines = _this2.scroll.lines(index, Math.max(length, 1)); + var lengthRemaining = length; + lines.forEach(function (line) { + var lineLength = line.length(); + if (!(line instanceof _code2.default)) { + line.format(format, formats[format]); + } else { + var codeIndex = index - line.offset(_this2.scroll); + var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1; + line.formatAt(codeIndex, codeLength, format, formats[format]); + } + lengthRemaining -= lineLength; + }); + }); + this.scroll.optimize(); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'formatText', + value: function formatText(index, length) { + var _this3 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + Object.keys(formats).forEach(function (format) { + _this3.scroll.formatAt(index, length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats))); + } + }, { + key: 'getContents', + value: function getContents(index, length) { + return this.delta.slice(index, index + length); + } + }, { + key: 'getDelta', + value: function getDelta() { + return this.scroll.lines().reduce(function (delta, line) { + return delta.concat(line.delta()); + }, new _quillDelta2.default()); + } + }, { + key: 'getFormat', + value: function getFormat(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var lines = [], + leaves = []; + if (length === 0) { + this.scroll.path(index).forEach(function (path) { + var _path = _slicedToArray(path, 1), + blot = _path[0]; + + if (blot instanceof _block2.default) { + lines.push(blot); + } else if (blot instanceof _parchment2.default.Leaf) { + leaves.push(blot); + } + }); + } else { + lines = this.scroll.lines(index, length); + leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length); + } + var formatsArr = [lines, leaves].map(function (blots) { + if (blots.length === 0) return {}; + var formats = (0, _block.bubbleFormats)(blots.shift()); + while (Object.keys(formats).length > 0) { + var blot = blots.shift(); + if (blot == null) return formats; + formats = combineFormats((0, _block.bubbleFormats)(blot), formats); + } + return formats; + }); + return _extend2.default.apply(_extend2.default, formatsArr); + } + }, { + key: 'getText', + value: function getText(index, length) { + return this.getContents(index, length).filter(function (op) { + return typeof op.insert === 'string'; + }).map(function (op) { + return op.insert; + }).join(''); + } + }, { + key: 'insertEmbed', + value: function insertEmbed(index, embed, value) { + this.scroll.insertAt(index, embed, value); + return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value))); + } + }, { + key: 'insertText', + value: function insertText(index, text) { + var _this4 = this; + + var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + text = text.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + this.scroll.insertAt(index, text); + Object.keys(formats).forEach(function (format) { + _this4.scroll.formatAt(index, text.length, format, formats[format]); + }); + return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats))); + } + }, { + key: 'isBlank', + value: function isBlank() { + if (this.scroll.children.length == 0) return true; + if (this.scroll.children.length > 1) return false; + var block = this.scroll.children.head; + if (block.statics.blotName !== _block2.default.blotName) return false; + if (block.children.length > 1) return false; + return block.children.head instanceof _break2.default; + } + }, { + key: 'removeFormat', + value: function removeFormat(index, length) { + var text = this.getText(index, length); + + var _scroll$line3 = this.scroll.line(index + length), + _scroll$line4 = _slicedToArray(_scroll$line3, 2), + line = _scroll$line4[0], + offset = _scroll$line4[1]; + + var suffixLength = 0, + suffix = new _quillDelta2.default(); + if (line != null) { + if (!(line instanceof _code2.default)) { + suffixLength = line.length() - offset; + } else { + suffixLength = line.newlineIndex(offset) - offset + 1; + } + suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\n'); + } + var contents = this.getContents(index, length + suffixLength); + var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix)); + var delta = new _quillDelta2.default().retain(index).concat(diff); + return this.applyDelta(delta); + } + }, { + key: 'update', + value: function update(change) { + var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + + var oldDelta = this.delta; + if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) { + // Optimization for character changes + var textBlot = _parchment2.default.find(mutations[0].target); + var formats = (0, _block.bubbleFormats)(textBlot); + var index = textBlot.offset(this.scroll); + var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, ''); + var oldText = new _quillDelta2.default().insert(oldValue); + var newText = new _quillDelta2.default().insert(textBlot.value()); + var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex)); + change = diffDelta.reduce(function (delta, op) { + if (op.insert) { + return delta.insert(op.insert, formats); + } else { + return delta.push(op); + } + }, new _quillDelta2.default()); + this.delta = oldDelta.compose(change); + } else { + this.delta = this.getDelta(); + if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) { + change = oldDelta.diff(this.delta, cursorIndex); + } + } + return change; + } + }]); + + return Editor; +}(); + +function combineFormats(formats, combined) { + return Object.keys(combined).reduce(function (merged, name) { + if (formats[name] == null) return merged; + if (combined[name] === formats[name]) { + merged[name] = combined[name]; + } else if (Array.isArray(combined[name])) { + if (combined[name].indexOf(formats[name]) < 0) { + merged[name] = combined[name].concat([formats[name]]); + } + } else { + merged[name] = [combined[name], formats[name]]; + } + return merged; + }, {}); +} + +function normalizeDelta(delta) { + return delta.reduce(function (delta, op) { + if (op.insert === 1) { + var attributes = (0, _clone2.default)(op.attributes); + delete attributes['image']; + return delta.insert({ image: op.attributes.image }, attributes); + } + if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) { + op = (0, _clone2.default)(op); + if (op.attributes.list) { + op.attributes.list = 'ordered'; + } else { + op.attributes.list = 'bullet'; + delete op.attributes.bullet; + } + } + if (typeof op.insert === 'string') { + var text = op.insert.replace(/\r\n/g, '\n').replace(/\r/g, '\n'); + return delta.insert(text, op.attributes); + } + return delta.push(op); + }, new _quillDelta2.default()); +} + +exports.default = Editor; + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.Range = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _emitter3 = __webpack_require__(8); + +var _emitter4 = _interopRequireDefault(_emitter3); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var debug = (0, _logger2.default)('quill:selection'); + +var Range = function Range(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + _classCallCheck(this, Range); + + this.index = index; + this.length = length; +}; + +var Selection = function () { + function Selection(scroll, emitter) { + var _this = this; + + _classCallCheck(this, Selection); + + this.emitter = emitter; + this.scroll = scroll; + this.composing = false; + this.mouseDown = false; + this.root = this.scroll.domNode; + this.cursor = _parchment2.default.create('cursor', this); + // savedRange is last non-null range + this.lastRange = this.savedRange = new Range(0, 0); + this.handleComposition(); + this.handleDragging(); + this.emitter.listenDOM('selectionchange', document, function () { + if (!_this.mouseDown) { + setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1); + } + }); + this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) { + if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) { + _this.update(_emitter4.default.sources.SILENT); + } + }); + this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () { + if (!_this.hasFocus()) return; + var native = _this.getNativeRange(); + if (native == null) return; + if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle + // TODO unclear if this has negative side effects + _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () { + try { + _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset); + } catch (ignored) {} + }); + }); + this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) { + if (context.range) { + var _context$range = context.range, + startNode = _context$range.startNode, + startOffset = _context$range.startOffset, + endNode = _context$range.endNode, + endOffset = _context$range.endOffset; + + _this.setNativeRange(startNode, startOffset, endNode, endOffset); + } + }); + this.update(_emitter4.default.sources.SILENT); + } + + _createClass(Selection, [{ + key: 'handleComposition', + value: function handleComposition() { + var _this2 = this; + + this.root.addEventListener('compositionstart', function () { + _this2.composing = true; + }); + this.root.addEventListener('compositionend', function () { + _this2.composing = false; + if (_this2.cursor.parent) { + var range = _this2.cursor.restore(); + if (!range) return; + setTimeout(function () { + _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset); + }, 1); + } + }); + } + }, { + key: 'handleDragging', + value: function handleDragging() { + var _this3 = this; + + this.emitter.listenDOM('mousedown', document.body, function () { + _this3.mouseDown = true; + }); + this.emitter.listenDOM('mouseup', document.body, function () { + _this3.mouseDown = false; + _this3.update(_emitter4.default.sources.USER); + }); + } + }, { + key: 'focus', + value: function focus() { + if (this.hasFocus()) return; + this.root.focus(); + this.setRange(this.savedRange); + } + }, { + key: 'format', + value: function format(_format, value) { + if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return; + this.scroll.update(); + var nativeRange = this.getNativeRange(); + if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return; + if (nativeRange.start.node !== this.cursor.textNode) { + var blot = _parchment2.default.find(nativeRange.start.node, false); + if (blot == null) return; + // TODO Give blot ability to not split + if (blot instanceof _parchment2.default.Leaf) { + var after = blot.split(nativeRange.start.offset); + blot.parent.insertBefore(this.cursor, after); + } else { + blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen + } + this.cursor.attach(); + } + this.cursor.format(_format, value); + this.scroll.optimize(); + this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length); + this.update(); + } + }, { + key: 'getBounds', + value: function getBounds(index) { + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; + + var scrollLength = this.scroll.length(); + index = Math.min(index, scrollLength - 1); + length = Math.min(index + length, scrollLength - 1) - index; + var node = void 0, + _scroll$leaf = this.scroll.leaf(index), + _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2), + leaf = _scroll$leaf2[0], + offset = _scroll$leaf2[1]; + if (leaf == null) return null; + + var _leaf$position = leaf.position(offset, true); + + var _leaf$position2 = _slicedToArray(_leaf$position, 2); + + node = _leaf$position2[0]; + offset = _leaf$position2[1]; + + var range = document.createRange(); + if (length > 0) { + range.setStart(node, offset); + + var _scroll$leaf3 = this.scroll.leaf(index + length); + + var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2); + + leaf = _scroll$leaf4[0]; + offset = _scroll$leaf4[1]; + + if (leaf == null) return null; + + var _leaf$position3 = leaf.position(offset, true); + + var _leaf$position4 = _slicedToArray(_leaf$position3, 2); + + node = _leaf$position4[0]; + offset = _leaf$position4[1]; + + range.setEnd(node, offset); + return range.getBoundingClientRect(); + } else { + var side = 'left'; + var rect = void 0; + if (node instanceof Text) { + if (offset < node.data.length) { + range.setStart(node, offset); + range.setEnd(node, offset + 1); + } else { + range.setStart(node, offset - 1); + range.setEnd(node, offset); + side = 'right'; + } + rect = range.getBoundingClientRect(); + } else { + rect = leaf.domNode.getBoundingClientRect(); + if (offset > 0) side = 'right'; + } + return { + bottom: rect.top + rect.height, + height: rect.height, + left: rect[side], + right: rect[side], + top: rect.top, + width: 0 + }; + } + } + }, { + key: 'getNativeRange', + value: function getNativeRange() { + var selection = document.getSelection(); + if (selection == null || selection.rangeCount <= 0) return null; + var nativeRange = selection.getRangeAt(0); + if (nativeRange == null) return null; + var range = this.normalizeNative(nativeRange); + debug.info('getNativeRange', range); + return range; + } + }, { + key: 'getRange', + value: function getRange() { + var normalized = this.getNativeRange(); + if (normalized == null) return [null, null]; + var range = this.normalizedToRange(normalized); + return [range, normalized]; + } + }, { + key: 'hasFocus', + value: function hasFocus() { + return document.activeElement === this.root; + } + }, { + key: 'normalizedToRange', + value: function normalizedToRange(range) { + var _this4 = this; + + var positions = [[range.start.node, range.start.offset]]; + if (!range.native.collapsed) { + positions.push([range.end.node, range.end.offset]); + } + var indexes = positions.map(function (position) { + var _position = _slicedToArray(position, 2), + node = _position[0], + offset = _position[1]; + + var blot = _parchment2.default.find(node, true); + var index = blot.offset(_this4.scroll); + if (offset === 0) { + return index; + } else if (blot instanceof _parchment2.default.Container) { + return index + blot.length(); + } else { + return index + blot.index(node, offset); + } + }); + var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1); + var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes))); + return new Range(start, end - start); + } + }, { + key: 'normalizeNative', + value: function normalizeNative(nativeRange) { + if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) { + return null; + } + var range = { + start: { node: nativeRange.startContainer, offset: nativeRange.startOffset }, + end: { node: nativeRange.endContainer, offset: nativeRange.endOffset }, + native: nativeRange + }; + [range.start, range.end].forEach(function (position) { + var node = position.node, + offset = position.offset; + while (!(node instanceof Text) && node.childNodes.length > 0) { + if (node.childNodes.length > offset) { + node = node.childNodes[offset]; + offset = 0; + } else if (node.childNodes.length === offset) { + node = node.lastChild; + offset = node instanceof Text ? node.data.length : node.childNodes.length + 1; + } else { + break; + } + } + position.node = node, position.offset = offset; + }); + return range; + } + }, { + key: 'rangeToNative', + value: function rangeToNative(range) { + var _this5 = this; + + var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length]; + var args = []; + var scrollLength = this.scroll.length(); + indexes.forEach(function (index, i) { + index = Math.min(scrollLength - 1, index); + var node = void 0, + _scroll$leaf5 = _this5.scroll.leaf(index), + _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2), + leaf = _scroll$leaf6[0], + offset = _scroll$leaf6[1]; + var _leaf$position5 = leaf.position(offset, i !== 0); + + var _leaf$position6 = _slicedToArray(_leaf$position5, 2); + + node = _leaf$position6[0]; + offset = _leaf$position6[1]; + + args.push(node, offset); + }); + if (args.length < 2) { + args = args.concat(args); + } + return args; + } + }, { + key: 'scrollIntoView', + value: function scrollIntoView(scrollingContainer) { + var range = this.lastRange; + if (range == null) return; + var bounds = this.getBounds(range.index, range.length); + if (bounds == null) return; + var limit = this.scroll.length() - 1; + + var _scroll$line = this.scroll.line(Math.min(range.index, limit)), + _scroll$line2 = _slicedToArray(_scroll$line, 1), + first = _scroll$line2[0]; + + var last = first; + if (range.length > 0) { + var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit)); + + var _scroll$line4 = _slicedToArray(_scroll$line3, 1); + + last = _scroll$line4[0]; + } + if (first == null || last == null) return; + var scrollBounds = scrollingContainer.getBoundingClientRect(); + if (bounds.top < scrollBounds.top) { + scrollingContainer.scrollTop -= scrollBounds.top - bounds.top; + } else if (bounds.bottom > scrollBounds.bottom) { + scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom; + } + } + }, { + key: 'setNativeRange', + value: function setNativeRange(startNode, startOffset) { + var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode; + var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset; + var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + + debug.info('setNativeRange', startNode, startOffset, endNode, endOffset); + if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) { + return; + } + var selection = document.getSelection(); + if (selection == null) return; + if (startNode != null) { + if (!this.hasFocus()) this.root.focus(); + var native = (this.getNativeRange() || {}).native; + if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) { + + if (startNode.tagName == "BR") { + startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode); + startNode = startNode.parentNode; + } + if (endNode.tagName == "BR") { + endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode); + endNode = endNode.parentNode; + } + var range = document.createRange(); + range.setStart(startNode, startOffset); + range.setEnd(endNode, endOffset); + selection.removeAllRanges(); + selection.addRange(range); + } + } else { + selection.removeAllRanges(); + this.root.blur(); + document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs) + } + } + }, { + key: 'setRange', + value: function setRange(range) { + var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API; + + if (typeof force === 'string') { + source = force; + force = false; + } + debug.info('setRange', range); + if (range != null) { + var args = this.rangeToNative(range); + this.setNativeRange.apply(this, _toConsumableArray(args).concat([force])); + } else { + this.setNativeRange(null); + } + this.update(source); + } + }, { + key: 'update', + value: function update() { + var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER; + + var oldRange = this.lastRange; + + var _getRange = this.getRange(), + _getRange2 = _slicedToArray(_getRange, 2), + lastRange = _getRange2[0], + nativeRange = _getRange2[1]; + + this.lastRange = lastRange; + if (this.lastRange != null) { + this.savedRange = this.lastRange; + } + if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) { + var _emitter; + + if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) { + this.cursor.restore(); + } + var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source]; + (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args)); + if (source !== _emitter4.default.sources.SILENT) { + var _emitter2; + + (_emitter2 = this.emitter).emit.apply(_emitter2, args); + } + } + } + }]); + + return Selection; +}(); + +function contains(parent, descendant) { + try { + // Firefox inserts inaccessible nodes around video elements + descendant.parentNode; + } catch (e) { + return false; + } + // IE11 has bug with Text nodes + // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect + if (descendant instanceof Text) { + descendant = descendant.parentNode; + } + return parent.contains(descendant); +} + +exports.Range = Range; +exports.default = Selection; + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Break = function (_Parchment$Embed) { + _inherits(Break, _Parchment$Embed); + + function Break() { + _classCallCheck(this, Break); + + return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments)); + } + + _createClass(Break, [{ + key: 'insertInto', + value: function insertInto(parent, ref) { + if (parent.children.length === 0) { + _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref); + } else { + this.remove(); + } + } + }, { + key: 'length', + value: function length() { + return 0; + } + }, { + key: 'value', + value: function value() { + return ''; + } + }], [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + return Break; +}(_parchment2.default.Embed); + +Break.blotName = 'break'; +Break.tagName = 'BR'; + +exports.default = Break; + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var linked_list_1 = __webpack_require__(44); +var shadow_1 = __webpack_require__(29); +var Registry = __webpack_require__(1); +var ContainerBlot = /** @class */ (function (_super) { + __extends(ContainerBlot, _super); + function ContainerBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.build(); + return _this; + } + ContainerBlot.prototype.appendChild = function (other) { + this.insertBefore(other); + }; + ContainerBlot.prototype.attach = function () { + _super.prototype.attach.call(this); + this.children.forEach(function (child) { + child.attach(); + }); + }; + ContainerBlot.prototype.build = function () { + var _this = this; + this.children = new linked_list_1.default(); + // Need to be reversed for if DOM nodes already in order + [].slice + .call(this.domNode.childNodes) + .reverse() + .forEach(function (node) { + try { + var child = makeBlot(node); + _this.insertBefore(child, _this.children.head || undefined); + } + catch (err) { + if (err instanceof Registry.ParchmentError) + return; + else + throw err; + } + }); + }; + ContainerBlot.prototype.deleteAt = function (index, length) { + if (index === 0 && length === this.length()) { + return this.remove(); + } + this.children.forEachAt(index, length, function (child, offset, length) { + child.deleteAt(offset, length); + }); + }; + ContainerBlot.prototype.descendant = function (criteria, index) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + return [child, offset]; + } + else if (child instanceof ContainerBlot) { + return child.descendant(criteria, offset); + } + else { + return [null, -1]; + } + }; + ContainerBlot.prototype.descendants = function (criteria, index, length) { + if (index === void 0) { index = 0; } + if (length === void 0) { length = Number.MAX_VALUE; } + var descendants = []; + var lengthLeft = length; + this.children.forEachAt(index, length, function (child, index, length) { + if ((criteria.blotName == null && criteria(child)) || + (criteria.blotName != null && child instanceof criteria)) { + descendants.push(child); + } + if (child instanceof ContainerBlot) { + descendants = descendants.concat(child.descendants(criteria, index, lengthLeft)); + } + lengthLeft -= length; + }); + return descendants; + }; + ContainerBlot.prototype.detach = function () { + this.children.forEach(function (child) { + child.detach(); + }); + _super.prototype.detach.call(this); + }; + ContainerBlot.prototype.formatAt = function (index, length, name, value) { + this.children.forEachAt(index, length, function (child, offset, length) { + child.formatAt(offset, length, name, value); + }); + }; + ContainerBlot.prototype.insertAt = function (index, value, def) { + var _a = this.children.find(index), child = _a[0], offset = _a[1]; + if (child) { + child.insertAt(offset, value, def); + } + else { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + this.appendChild(blot); + } + }; + ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) { + if (this.statics.allowedChildren != null && + !this.statics.allowedChildren.some(function (child) { + return childBlot instanceof child; + })) { + throw new Registry.ParchmentError("Cannot insert " + childBlot.statics.blotName + " into " + this.statics.blotName); + } + childBlot.insertInto(this, refBlot); + }; + ContainerBlot.prototype.length = function () { + return this.children.reduce(function (memo, child) { + return memo + child.length(); + }, 0); + }; + ContainerBlot.prototype.moveChildren = function (targetParent, refNode) { + this.children.forEach(function (child) { + targetParent.insertBefore(child, refNode); + }); + }; + ContainerBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + if (this.children.length === 0) { + if (this.statics.defaultChild != null) { + var child = Registry.create(this.statics.defaultChild); + this.appendChild(child); + child.optimize(context); + } + else { + this.remove(); + } + } + }; + ContainerBlot.prototype.path = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1]; + var position = [[this, index]]; + if (child instanceof ContainerBlot) { + return position.concat(child.path(offset, inclusive)); + } + else if (child != null) { + position.push([child, offset]); + } + return position; + }; + ContainerBlot.prototype.removeChild = function (child) { + this.children.remove(child); + }; + ContainerBlot.prototype.replace = function (target) { + if (target instanceof ContainerBlot) { + target.moveChildren(this); + } + _super.prototype.replace.call(this, target); + }; + ContainerBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = this.clone(); + this.parent.insertBefore(after, this.next); + this.children.forEachAt(index, this.length(), function (child, offset, length) { + child = child.split(offset, force); + after.appendChild(child); + }); + return after; + }; + ContainerBlot.prototype.unwrap = function () { + this.moveChildren(this.parent, this.next); + this.remove(); + }; + ContainerBlot.prototype.update = function (mutations, context) { + var _this = this; + var addedNodes = []; + var removedNodes = []; + mutations.forEach(function (mutation) { + if (mutation.target === _this.domNode && mutation.type === 'childList') { + addedNodes.push.apply(addedNodes, mutation.addedNodes); + removedNodes.push.apply(removedNodes, mutation.removedNodes); + } + }); + removedNodes.forEach(function (node) { + // Check node has actually been removed + // One exception is Chrome does not immediately remove IFRAMEs + // from DOM but MutationRecord is correct in its reported removal + if (node.parentNode != null && + // @ts-ignore + node.tagName !== 'IFRAME' && + document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return; + } + var blot = Registry.find(node); + if (blot == null) + return; + if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) { + blot.detach(); + } + }); + addedNodes + .filter(function (node) { + return node.parentNode == _this.domNode; + }) + .sort(function (a, b) { + if (a === b) + return 0; + if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) { + return 1; + } + return -1; + }) + .forEach(function (node) { + var refBlot = null; + if (node.nextSibling != null) { + refBlot = Registry.find(node.nextSibling); + } + var blot = makeBlot(node); + if (blot.next != refBlot || blot.next == null) { + if (blot.parent != null) { + blot.parent.removeChild(_this); + } + _this.insertBefore(blot, refBlot || undefined); + } + }); + }; + return ContainerBlot; +}(shadow_1.default)); +function makeBlot(node) { + var blot = Registry.find(node); + if (blot == null) { + try { + blot = Registry.create(node); + } + catch (e) { + blot = Registry.create(Registry.Scope.INLINE); + [].slice.call(node.childNodes).forEach(function (child) { + // @ts-ignore + blot.domNode.appendChild(child); + }); + if (node.parentNode) { + node.parentNode.replaceChild(blot.domNode, node); + } + blot.attach(); + } + } + return blot; +} +exports.default = ContainerBlot; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var store_1 = __webpack_require__(30); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var FormatBlot = /** @class */ (function (_super) { + __extends(FormatBlot, _super); + function FormatBlot(domNode) { + var _this = _super.call(this, domNode) || this; + _this.attributes = new store_1.default(_this.domNode); + return _this; + } + FormatBlot.formats = function (domNode) { + if (typeof this.tagName === 'string') { + return true; + } + else if (Array.isArray(this.tagName)) { + return domNode.tagName.toLowerCase(); + } + return undefined; + }; + FormatBlot.prototype.format = function (name, value) { + var format = Registry.query(name); + if (format instanceof attributor_1.default) { + this.attributes.attribute(format, value); + } + else if (value) { + if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) { + this.replaceWith(name, value); + } + } + }; + FormatBlot.prototype.formats = function () { + var formats = this.attributes.values(); + var format = this.statics.formats(this.domNode); + if (format != null) { + formats[this.statics.blotName] = format; + } + return formats; + }; + FormatBlot.prototype.replaceWith = function (name, value) { + var replacement = _super.prototype.replaceWith.call(this, name, value); + this.attributes.copy(replacement); + return replacement; + }; + FormatBlot.prototype.update = function (mutations, context) { + var _this = this; + _super.prototype.update.call(this, mutations, context); + if (mutations.some(function (mutation) { + return mutation.target === _this.domNode && mutation.type === 'attributes'; + })) { + this.attributes.build(); + } + }; + FormatBlot.prototype.wrap = function (name, value) { + var wrapper = _super.prototype.wrap.call(this, name, value); + if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) { + this.attributes.move(wrapper); + } + return wrapper; + }; + return FormatBlot; +}(container_1.default)); +exports.default = FormatBlot; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var shadow_1 = __webpack_require__(29); +var Registry = __webpack_require__(1); +var LeafBlot = /** @class */ (function (_super) { + __extends(LeafBlot, _super); + function LeafBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + LeafBlot.value = function (domNode) { + return true; + }; + LeafBlot.prototype.index = function (node, offset) { + if (this.domNode === node || + this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) { + return Math.min(offset, 1); + } + return -1; + }; + LeafBlot.prototype.position = function (index, inclusive) { + var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode); + if (index > 0) + offset += 1; + return [this.parent.domNode, offset]; + }; + LeafBlot.prototype.value = function () { + return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a; + var _a; + }; + LeafBlot.scope = Registry.Scope.INLINE_BLOT; + return LeafBlot; +}(shadow_1.default)); +exports.default = LeafBlot; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +var equal = __webpack_require__(11); +var extend = __webpack_require__(3); + + +var lib = { + attributes: { + compose: function (a, b, keepNull) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = extend(true, {}, b); + if (!keepNull) { + attributes = Object.keys(attributes).reduce(function (copy, key) { + if (attributes[key] != null) { + copy[key] = attributes[key]; + } + return copy; + }, {}); + } + for (var key in a) { + if (a[key] !== undefined && b[key] === undefined) { + attributes[key] = a[key]; + } + } + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + diff: function(a, b) { + if (typeof a !== 'object') a = {}; + if (typeof b !== 'object') b = {}; + var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) { + if (!equal(a[key], b[key])) { + attributes[key] = b[key] === undefined ? null : b[key]; + } + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + }, + + transform: function (a, b, priority) { + if (typeof a !== 'object') return b; + if (typeof b !== 'object') return undefined; + if (!priority) return b; // b simply overwrites us without priority + var attributes = Object.keys(b).reduce(function (attributes, key) { + if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value + return attributes; + }, {}); + return Object.keys(attributes).length > 0 ? attributes : undefined; + } + }, + + iterator: function (ops) { + return new Iterator(ops); + }, + + length: function (op) { + if (typeof op['delete'] === 'number') { + return op['delete']; + } else if (typeof op.retain === 'number') { + return op.retain; + } else { + return typeof op.insert === 'string' ? op.insert.length : 1; + } + } +}; + + +function Iterator(ops) { + this.ops = ops; + this.index = 0; + this.offset = 0; +}; + +Iterator.prototype.hasNext = function () { + return this.peekLength() < Infinity; +}; + +Iterator.prototype.next = function (length) { + if (!length) length = Infinity; + var nextOp = this.ops[this.index]; + if (nextOp) { + var offset = this.offset; + var opLength = lib.length(nextOp) + if (length >= opLength - offset) { + length = opLength - offset; + this.index += 1; + this.offset = 0; + } else { + this.offset += length; + } + if (typeof nextOp['delete'] === 'number') { + return { 'delete': length }; + } else { + var retOp = {}; + if (nextOp.attributes) { + retOp.attributes = nextOp.attributes; + } + if (typeof nextOp.retain === 'number') { + retOp.retain = length; + } else if (typeof nextOp.insert === 'string') { + retOp.insert = nextOp.insert.substr(offset, length); + } else { + // offset should === 0, length should === 1 + retOp.insert = nextOp.insert; + } + return retOp; + } + } else { + return { retain: Infinity }; + } +}; + +Iterator.prototype.peek = function () { + return this.ops[this.index]; +}; + +Iterator.prototype.peekLength = function () { + if (this.ops[this.index]) { + // Should never return 0 if our index is being managed correctly + return lib.length(this.ops[this.index]) - this.offset; + } else { + return Infinity; + } +}; + +Iterator.prototype.peekType = function () { + if (this.ops[this.index]) { + if (typeof this.ops[this.index]['delete'] === 'number') { + return 'delete'; + } else if (typeof this.ops[this.index].retain === 'number') { + return 'retain'; + } else { + return 'insert'; + } + } + return 'retain'; +}; + + +module.exports = lib; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports) { + +var clone = (function() { +'use strict'; + +function _instanceof(obj, type) { + return type != null && obj instanceof type; +} + +var nativeMap; +try { + nativeMap = Map; +} catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; +} + +var nativeSet; +try { + nativeSet = Set; +} catch(_) { + nativeSet = function() {}; +} + +var nativePromise; +try { + nativePromise = Promise; +} catch(_) { + nativePromise = function() {}; +} + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + * @param `includeNonEnumerable` - set to true if the non-enumerable properties + * should be cloned as well. Non-enumerable properties on the prototype + * chain will be ignored. (optional - false by default) +*/ +function clone(parent, circular, depth, prototype, includeNonEnumerable) { + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + includeNonEnumerable = circular.includeNonEnumerable; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (_instanceof(parent, nativeMap)) { + child = new nativeMap(); + } else if (_instanceof(parent, nativeSet)) { + child = new nativeSet(); + } else if (_instanceof(parent, nativePromise)) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + child = new Buffer(parent.length); + parent.copy(child); + return child; + } else if (_instanceof(parent, Error)) { + child = Object.create(parent); + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (_instanceof(parent, nativeMap)) { + parent.forEach(function(value, key) { + var keyChild = _clone(key, depth - 1); + var valueChild = _clone(value, depth - 1); + child.set(keyChild, valueChild); + }); + } + if (_instanceof(parent, nativeSet)) { + parent.forEach(function(value) { + var entryChild = _clone(value, depth - 1); + child.add(entryChild); + }); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); + if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { + continue; + } + child[symbol] = _clone(parent[symbol], depth - 1); + if (!descriptor.enumerable) { + Object.defineProperty(child, symbol, { + enumerable: false + }); + } + } + } + + if (includeNonEnumerable) { + var allPropertyNames = Object.getOwnPropertyNames(parent); + for (var i = 0; i < allPropertyNames.length; i++) { + var propertyName = allPropertyNames[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); + if (descriptor && descriptor.enumerable) { + continue; + } + child[propertyName] = _clone(parent[propertyName], depth - 1); + Object.defineProperty(child, propertyName, { + enumerable: false + }); + } + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +} +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +} +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +} +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +} +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +} +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _container = __webpack_require__(24); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +function isLine(blot) { + return blot instanceof _block2.default || blot instanceof _block.BlockEmbed; +} + +var Scroll = function (_Parchment$Scroll) { + _inherits(Scroll, _Parchment$Scroll); + + function Scroll(domNode, config) { + _classCallCheck(this, Scroll); + + var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode)); + + _this.emitter = config.emitter; + if (Array.isArray(config.whitelist)) { + _this.whitelist = config.whitelist.reduce(function (whitelist, format) { + whitelist[format] = true; + return whitelist; + }, {}); + } + // Some reason fixes composition issues with character languages in Windows/Chrome, Safari + _this.domNode.addEventListener('DOMNodeInserted', function () {}); + _this.optimize(); + _this.enable(); + return _this; + } + + _createClass(Scroll, [{ + key: 'batchStart', + value: function batchStart() { + this.batch = true; + } + }, { + key: 'batchEnd', + value: function batchEnd() { + this.batch = false; + this.optimize(); + } + }, { + key: 'deleteAt', + value: function deleteAt(index, length) { + var _line = this.line(index), + _line2 = _slicedToArray(_line, 2), + first = _line2[0], + offset = _line2[1]; + + var _line3 = this.line(index + length), + _line4 = _slicedToArray(_line3, 1), + last = _line4[0]; + + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length); + if (last != null && first !== last && offset > 0) { + if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) { + this.optimize(); + return; + } + if (first instanceof _code2.default) { + var newlineIndex = first.newlineIndex(first.length(), true); + if (newlineIndex > -1) { + first = first.split(newlineIndex + 1); + if (first === last) { + this.optimize(); + return; + } + } + } else if (last instanceof _code2.default) { + var _newlineIndex = last.newlineIndex(0); + if (_newlineIndex > -1) { + last.split(_newlineIndex + 1); + } + } + var ref = last.children.head instanceof _break2.default ? null : last.children.head; + first.moveChildren(last, ref); + first.remove(); + } + this.optimize(); + } + }, { + key: 'enable', + value: function enable() { + var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + + this.domNode.setAttribute('contenteditable', enabled); + } + }, { + key: 'formatAt', + value: function formatAt(index, length, format, value) { + if (this.whitelist != null && !this.whitelist[format]) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value); + this.optimize(); + } + }, { + key: 'insertAt', + value: function insertAt(index, value, def) { + if (def != null && this.whitelist != null && !this.whitelist[value]) return; + if (index >= this.length()) { + if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) { + var blot = _parchment2.default.create(this.statics.defaultChild); + this.appendChild(blot); + if (def == null && value.endsWith('\n')) { + value = value.slice(0, -1); + } + blot.insertAt(0, value, def); + } else { + var embed = _parchment2.default.create(value, def); + this.appendChild(embed); + } + } else { + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def); + } + this.optimize(); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) { + var wrapper = _parchment2.default.create(this.statics.defaultChild); + wrapper.appendChild(blot); + blot = wrapper; + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref); + } + }, { + key: 'leaf', + value: function leaf(index) { + return this.path(index).pop() || [null, -1]; + } + }, { + key: 'line', + value: function line(index) { + if (index === this.length()) { + return this.line(index - 1); + } + return this.descendant(isLine, index); + } + }, { + key: 'lines', + value: function lines() { + var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE; + + var getLines = function getLines(blot, index, length) { + var lines = [], + lengthLeft = length; + blot.children.forEachAt(index, length, function (child, index, length) { + if (isLine(child)) { + lines.push(child); + } else if (child instanceof _parchment2.default.Container) { + lines = lines.concat(getLines(child, index, lengthLeft)); + } + lengthLeft -= length; + }); + return lines; + }; + return getLines(this, index, length); + } + }, { + key: 'optimize', + value: function optimize() { + var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (this.batch === true) return; + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context); + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context); + } + } + }, { + key: 'path', + value: function path(index) { + return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self + } + }, { + key: 'update', + value: function update(mutations) { + if (this.batch === true) return; + var source = _emitter2.default.sources.USER; + if (typeof mutations === 'string') { + source = mutations; + } + if (!Array.isArray(mutations)) { + mutations = this.observer.takeRecords(); + } + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations); + } + _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy + if (mutations.length > 0) { + this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations); + } + } + }]); + + return Scroll; +}(_parchment2.default.Scroll); + +Scroll.blotName = 'scroll'; +Scroll.className = 'ql-editor'; +Scroll.tagName = 'DIV'; +Scroll.defaultChild = 'block'; +Scroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default]; + +exports.default = Scroll; + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Cursor = function (_Parchment$Embed) { + _inherits(Cursor, _Parchment$Embed); + + _createClass(Cursor, null, [{ + key: 'value', + value: function value() { + return undefined; + } + }]); + + function Cursor(domNode, selection) { + _classCallCheck(this, Cursor); + + var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode)); + + _this.selection = selection; + _this.textNode = document.createTextNode(Cursor.CONTENTS); + _this.domNode.appendChild(_this.textNode); + _this._length = 0; + return _this; + } + + _createClass(Cursor, [{ + key: 'detach', + value: function detach() { + // super.detach() will also clear domNode.__blot + if (this.parent != null) this.parent.removeChild(this); + } + }, { + key: 'format', + value: function format(name, value) { + if (this._length !== 0) { + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value); + } + var target = this, + index = 0; + while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) { + index += target.offset(target.parent); + target = target.parent; + } + if (target != null) { + this._length = Cursor.CONTENTS.length; + target.optimize(); + target.formatAt(index, Cursor.CONTENTS.length, name, value); + this._length = 0; + } + } + }, { + key: 'index', + value: function index(node, offset) { + if (node === this.textNode) return 0; + return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'length', + value: function length() { + return this._length; + } + }, { + key: 'position', + value: function position() { + return [this.textNode, this.textNode.data.length]; + } + }, { + key: 'remove', + value: function remove() { + _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this); + this.parent = null; + } + }, { + key: 'restore', + value: function restore() { + if (this.selection.composing || this.parent == null) return; + var textNode = this.textNode; + var range = this.selection.getNativeRange(); + var restoreText = void 0, + start = void 0, + end = void 0; + if (range != null && range.start.node === textNode && range.end.node === textNode) { + var _ref = [textNode, range.start.offset, range.end.offset]; + restoreText = _ref[0]; + start = _ref[1]; + end = _ref[2]; + } + // Link format will insert text outside of anchor tag + while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) { + this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode); + } + if (this.textNode.data !== Cursor.CONTENTS) { + var text = this.textNode.data.split(Cursor.CONTENTS).join(''); + if (this.next instanceof _text2.default) { + restoreText = this.next.domNode; + this.next.insertAt(0, text); + this.textNode.data = Cursor.CONTENTS; + } else { + this.textNode.data = text; + this.parent.insertBefore(_parchment2.default.create(this.textNode), this); + this.textNode = document.createTextNode(Cursor.CONTENTS); + this.domNode.appendChild(this.textNode); + } + } + this.remove(); + if (start != null) { + var _map = [start, end].map(function (offset) { + return Math.max(0, Math.min(restoreText.data.length, offset - 1)); + }); + + var _map2 = _slicedToArray(_map, 2); + + start = _map2[0]; + end = _map2[1]; + + return { + startNode: restoreText, + startOffset: start, + endNode: restoreText, + endOffset: end + }; + } + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this2.textNode; + })) { + var range = this.restore(); + if (range) context.range = range; + } + } + }, { + key: 'value', + value: function value() { + return ''; + } + }]); + + return Cursor; +}(_parchment2.default.Embed); + +Cursor.blotName = 'cursor'; +Cursor.className = 'ql-cursor'; +Cursor.tagName = 'span'; +Cursor.CONTENTS = '\uFEFF'; // Zero width no break space + + +exports.default = Cursor; + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Container = function (_Parchment$Container) { + _inherits(Container, _Parchment$Container); + + function Container() { + _classCallCheck(this, Container); + + return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments)); + } + + return Container; +}(_parchment2.default.Container); + +Container.allowedChildren = [_block2.default, _block.BlockEmbed, Container]; + +exports.default = Container; + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorAttributor = function (_Parchment$Attributor) { + _inherits(ColorAttributor, _Parchment$Attributor); + + function ColorAttributor() { + _classCallCheck(this, ColorAttributor); + + return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments)); + } + + _createClass(ColorAttributor, [{ + key: 'value', + value: function value(domNode) { + var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode); + if (!value.startsWith('rgb(')) return value; + value = value.replace(/^[^\d]+/, '').replace(/[^\d]+$/, ''); + return '#' + value.split(',').map(function (component) { + return ('00' + parseInt(component).toString(16)).slice(-2); + }).join(''); + } + }]); + + return ColorAttributor; +}(_parchment2.default.Attributor.Style); + +var ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', { + scope: _parchment2.default.Scope.INLINE +}); +var ColorStyle = new ColorAttributor('color', 'color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.ColorAttributor = ColorAttributor; +exports.ColorClass = ColorClass; +exports.ColorStyle = ColorStyle; + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.sanitize = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Link = function (_Inline) { + _inherits(Link, _Inline); + + function Link() { + _classCallCheck(this, Link); + + return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments)); + } + + _createClass(Link, [{ + key: 'format', + value: function format(name, value) { + if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value); + value = this.constructor.sanitize(value); + this.domNode.setAttribute('href', value); + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value); + value = this.sanitize(value); + node.setAttribute('href', value); + node.setAttribute('target', '_blank'); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return domNode.getAttribute('href'); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL; + } + }]); + + return Link; +}(_inline2.default); + +Link.blotName = 'link'; +Link.tagName = 'A'; +Link.SANITIZED_URL = 'about:blank'; +Link.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel']; + +function _sanitize(url, protocols) { + var anchor = document.createElement('a'); + anchor.href = url; + var protocol = anchor.href.slice(0, anchor.href.indexOf(':')); + return protocols.indexOf(protocol) > -1; +} + +exports.default = Link; +exports.sanitize = _sanitize; + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _dropdown = __webpack_require__(107); + +var _dropdown2 = _interopRequireDefault(_dropdown); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Picker = function () { + function Picker(select) { + var _this = this; + + _classCallCheck(this, Picker); + + this.select = select; + this.container = document.createElement('span'); + this.buildPicker(); + this.select.style.display = 'none'; + this.select.parentNode.insertBefore(this.container, this.select); + this.label.addEventListener('mousedown', function () { + _this.container.classList.toggle('ql-expanded'); + }); + this.select.addEventListener('change', this.update.bind(this)); + } + + _createClass(Picker, [{ + key: 'buildItem', + value: function buildItem(option) { + var _this2 = this; + + var item = document.createElement('span'); + item.classList.add('ql-picker-item'); + if (option.hasAttribute('value')) { + item.setAttribute('data-value', option.getAttribute('value')); + } + if (option.textContent) { + item.setAttribute('data-label', option.textContent); + } + item.addEventListener('click', function () { + _this2.selectItem(item, true); + }); + return item; + } + }, { + key: 'buildLabel', + value: function buildLabel() { + var label = document.createElement('span'); + label.classList.add('ql-picker-label'); + label.innerHTML = _dropdown2.default; + this.container.appendChild(label); + return label; + } + }, { + key: 'buildOptions', + value: function buildOptions() { + var _this3 = this; + + var options = document.createElement('span'); + options.classList.add('ql-picker-options'); + [].slice.call(this.select.options).forEach(function (option) { + var item = _this3.buildItem(option); + options.appendChild(item); + if (option.selected === true) { + _this3.selectItem(item); + } + }); + this.container.appendChild(options); + } + }, { + key: 'buildPicker', + value: function buildPicker() { + var _this4 = this; + + [].slice.call(this.select.attributes).forEach(function (item) { + _this4.container.setAttribute(item.name, item.value); + }); + this.container.classList.add('ql-picker'); + this.label = this.buildLabel(); + this.buildOptions(); + } + }, { + key: 'close', + value: function close() { + this.container.classList.remove('ql-expanded'); + } + }, { + key: 'selectItem', + value: function selectItem(item) { + var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var selected = this.container.querySelector('.ql-selected'); + if (item === selected) return; + if (selected != null) { + selected.classList.remove('ql-selected'); + } + if (item == null) return; + item.classList.add('ql-selected'); + this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item); + if (item.hasAttribute('data-value')) { + this.label.setAttribute('data-value', item.getAttribute('data-value')); + } else { + this.label.removeAttribute('data-value'); + } + if (item.hasAttribute('data-label')) { + this.label.setAttribute('data-label', item.getAttribute('data-label')); + } else { + this.label.removeAttribute('data-label'); + } + if (trigger) { + if (typeof Event === 'function') { + this.select.dispatchEvent(new Event('change')); + } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') { + // IE11 + var event = document.createEvent('Event'); + event.initEvent('change', true, true); + this.select.dispatchEvent(event); + } + this.close(); + } + } + }, { + key: 'update', + value: function update() { + var option = void 0; + if (this.select.selectedIndex > -1) { + var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex]; + option = this.select.options[this.select.selectedIndex]; + this.selectItem(item); + } else { + this.selectItem(null); + } + var isActive = option != null && option !== this.select.querySelector('option[selected]'); + this.label.classList.toggle('ql-active', isActive); + } + }]); + + return Picker; +}(); + +exports.default = Picker; + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _break = __webpack_require__(16); + +var _break2 = _interopRequireDefault(_break); + +var _container = __webpack_require__(24); + +var _container2 = _interopRequireDefault(_container); + +var _cursor = __webpack_require__(23); + +var _cursor2 = _interopRequireDefault(_cursor); + +var _embed = __webpack_require__(35); + +var _embed2 = _interopRequireDefault(_embed); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +var _scroll = __webpack_require__(22); + +var _scroll2 = _interopRequireDefault(_scroll); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +var _clipboard = __webpack_require__(55); + +var _clipboard2 = _interopRequireDefault(_clipboard); + +var _history = __webpack_require__(42); + +var _history2 = _interopRequireDefault(_history); + +var _keyboard = __webpack_require__(34); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_quill2.default.register({ + 'blots/block': _block2.default, + 'blots/block/embed': _block.BlockEmbed, + 'blots/break': _break2.default, + 'blots/container': _container2.default, + 'blots/cursor': _cursor2.default, + 'blots/embed': _embed2.default, + 'blots/inline': _inline2.default, + 'blots/scroll': _scroll2.default, + 'blots/text': _text2.default, + + 'modules/clipboard': _clipboard2.default, + 'modules/history': _history2.default, + 'modules/keyboard': _keyboard2.default +}); + +_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default); + +exports.default = _quill2.default; + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Registry = __webpack_require__(1); +var ShadowBlot = /** @class */ (function () { + function ShadowBlot(domNode) { + this.domNode = domNode; + // @ts-ignore + this.domNode[Registry.DATA_KEY] = { blot: this }; + } + Object.defineProperty(ShadowBlot.prototype, "statics", { + // Hack for accessing inherited static methods + get: function () { + return this.constructor; + }, + enumerable: true, + configurable: true + }); + ShadowBlot.create = function (value) { + if (this.tagName == null) { + throw new Registry.ParchmentError('Blot definition missing tagName'); + } + var node; + if (Array.isArray(this.tagName)) { + if (typeof value === 'string') { + value = value.toUpperCase(); + if (parseInt(value).toString() === value) { + value = parseInt(value); + } + } + if (typeof value === 'number') { + node = document.createElement(this.tagName[value - 1]); + } + else if (this.tagName.indexOf(value) > -1) { + node = document.createElement(value); + } + else { + node = document.createElement(this.tagName[0]); + } + } + else { + node = document.createElement(this.tagName); + } + if (this.className) { + node.classList.add(this.className); + } + return node; + }; + ShadowBlot.prototype.attach = function () { + if (this.parent != null) { + this.scroll = this.parent.scroll; + } + }; + ShadowBlot.prototype.clone = function () { + var domNode = this.domNode.cloneNode(false); + return Registry.create(domNode); + }; + ShadowBlot.prototype.detach = function () { + if (this.parent != null) + this.parent.removeChild(this); + // @ts-ignore + delete this.domNode[Registry.DATA_KEY]; + }; + ShadowBlot.prototype.deleteAt = function (index, length) { + var blot = this.isolate(index, length); + blot.remove(); + }; + ShadowBlot.prototype.formatAt = function (index, length, name, value) { + var blot = this.isolate(index, length); + if (Registry.query(name, Registry.Scope.BLOT) != null && value) { + blot.wrap(name, value); + } + else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) { + var parent = Registry.create(this.statics.scope); + blot.wrap(parent); + parent.format(name, value); + } + }; + ShadowBlot.prototype.insertAt = function (index, value, def) { + var blot = def == null ? Registry.create('text', value) : Registry.create(value, def); + var ref = this.split(index); + this.parent.insertBefore(blot, ref); + }; + ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) { + if (refBlot === void 0) { refBlot = null; } + if (this.parent != null) { + this.parent.children.remove(this); + } + var refDomNode = null; + parentBlot.children.insertBefore(this, refBlot); + if (refBlot != null) { + refDomNode = refBlot.domNode; + } + if (this.next == null || this.domNode.nextSibling != refDomNode) { + parentBlot.domNode.insertBefore(this.domNode, refDomNode); + } + this.parent = parentBlot; + this.attach(); + }; + ShadowBlot.prototype.isolate = function (index, length) { + var target = this.split(index); + target.split(length); + return target; + }; + ShadowBlot.prototype.length = function () { + return 1; + }; + ShadowBlot.prototype.offset = function (root) { + if (root === void 0) { root = this.parent; } + if (this.parent == null || this == root) + return 0; + return this.parent.children.offset(this) + this.parent.offset(root); + }; + ShadowBlot.prototype.optimize = function (context) { + // TODO clean up once we use WeakMap + // @ts-ignore + if (this.domNode[Registry.DATA_KEY] != null) { + // @ts-ignore + delete this.domNode[Registry.DATA_KEY].mutations; + } + }; + ShadowBlot.prototype.remove = function () { + if (this.domNode.parentNode != null) { + this.domNode.parentNode.removeChild(this.domNode); + } + this.detach(); + }; + ShadowBlot.prototype.replace = function (target) { + if (target.parent == null) + return; + target.parent.insertBefore(this, target.next); + target.remove(); + }; + ShadowBlot.prototype.replaceWith = function (name, value) { + var replacement = typeof name === 'string' ? Registry.create(name, value) : name; + replacement.replace(this); + return replacement; + }; + ShadowBlot.prototype.split = function (index, force) { + return index === 0 ? this : this.next; + }; + ShadowBlot.prototype.update = function (mutations, context) { + // Nothing to do by default + }; + ShadowBlot.prototype.wrap = function (name, value) { + var wrapper = typeof name === 'string' ? Registry.create(name, value) : name; + if (this.parent != null) { + this.parent.insertBefore(wrapper, this.next); + } + wrapper.appendChild(this); + return wrapper; + }; + ShadowBlot.blotName = 'abstract'; + return ShadowBlot; +}()); +exports.default = ShadowBlot; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +var class_1 = __webpack_require__(31); +var style_1 = __webpack_require__(32); +var Registry = __webpack_require__(1); +var AttributorStore = /** @class */ (function () { + function AttributorStore(domNode) { + this.attributes = {}; + this.domNode = domNode; + this.build(); + } + AttributorStore.prototype.attribute = function (attribute, value) { + // verb + if (value) { + if (attribute.add(this.domNode, value)) { + if (attribute.value(this.domNode) != null) { + this.attributes[attribute.attrName] = attribute; + } + else { + delete this.attributes[attribute.attrName]; + } + } + } + else { + attribute.remove(this.domNode); + delete this.attributes[attribute.attrName]; + } + }; + AttributorStore.prototype.build = function () { + var _this = this; + this.attributes = {}; + var attributes = attributor_1.default.keys(this.domNode); + var classes = class_1.default.keys(this.domNode); + var styles = style_1.default.keys(this.domNode); + attributes + .concat(classes) + .concat(styles) + .forEach(function (name) { + var attr = Registry.query(name, Registry.Scope.ATTRIBUTE); + if (attr instanceof attributor_1.default) { + _this.attributes[attr.attrName] = attr; + } + }); + }; + AttributorStore.prototype.copy = function (target) { + var _this = this; + Object.keys(this.attributes).forEach(function (key) { + var value = _this.attributes[key].value(_this.domNode); + target.format(key, value); + }); + }; + AttributorStore.prototype.move = function (target) { + var _this = this; + this.copy(target); + Object.keys(this.attributes).forEach(function (key) { + _this.attributes[key].remove(_this.domNode); + }); + this.attributes = {}; + }; + AttributorStore.prototype.values = function () { + var _this = this; + return Object.keys(this.attributes).reduce(function (attributes, name) { + attributes[name] = _this.attributes[name].value(_this.domNode); + return attributes; + }, {}); + }; + return AttributorStore; +}()); +exports.default = AttributorStore; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function match(node, prefix) { + var className = node.getAttribute('class') || ''; + return className.split(/\s+/).filter(function (name) { + return name.indexOf(prefix + "-") === 0; + }); +} +var ClassAttributor = /** @class */ (function (_super) { + __extends(ClassAttributor, _super); + function ClassAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + ClassAttributor.keys = function (node) { + return (node.getAttribute('class') || '').split(/\s+/).map(function (name) { + return name + .split('-') + .slice(0, -1) + .join('-'); + }); + }; + ClassAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + this.remove(node); + node.classList.add(this.keyName + "-" + value); + return true; + }; + ClassAttributor.prototype.remove = function (node) { + var matches = match(node, this.keyName); + matches.forEach(function (name) { + node.classList.remove(name); + }); + if (node.classList.length === 0) { + node.removeAttribute('class'); + } + }; + ClassAttributor.prototype.value = function (node) { + var result = match(node, this.keyName)[0] || ''; + var value = result.slice(this.keyName.length + 1); // +1 for hyphen + return this.canAdd(node, value) ? value : ''; + }; + return ClassAttributor; +}(attributor_1.default)); +exports.default = ClassAttributor; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var attributor_1 = __webpack_require__(12); +function camelize(name) { + var parts = name.split('-'); + var rest = parts + .slice(1) + .map(function (part) { + return part[0].toUpperCase() + part.slice(1); + }) + .join(''); + return parts[0] + rest; +} +var StyleAttributor = /** @class */ (function (_super) { + __extends(StyleAttributor, _super); + function StyleAttributor() { + return _super !== null && _super.apply(this, arguments) || this; + } + StyleAttributor.keys = function (node) { + return (node.getAttribute('style') || '').split(';').map(function (value) { + var arr = value.split(':'); + return arr[0].trim(); + }); + }; + StyleAttributor.prototype.add = function (node, value) { + if (!this.canAdd(node, value)) + return false; + // @ts-ignore + node.style[camelize(this.keyName)] = value; + return true; + }; + StyleAttributor.prototype.remove = function (node) { + // @ts-ignore + node.style[camelize(this.keyName)] = ''; + if (!node.getAttribute('style')) { + node.removeAttribute('style'); + } + }; + StyleAttributor.prototype.value = function (node) { + // @ts-ignore + var value = node.style[camelize(this.keyName)]; + return this.canAdd(node, value) ? value : ''; + }; + return StyleAttributor; +}(attributor_1.default)); +exports.default = StyleAttributor; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Theme = function () { + function Theme(quill, options) { + _classCallCheck(this, Theme); + + this.quill = quill; + this.options = options; + this.modules = {}; + } + + _createClass(Theme, [{ + key: 'init', + value: function init() { + var _this = this; + + Object.keys(this.options.modules).forEach(function (name) { + if (_this.modules[name] == null) { + _this.addModule(name); + } + }); + } + }, { + key: 'addModule', + value: function addModule(name) { + var moduleClass = this.quill.constructor.import('modules/' + name); + this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {}); + return this.modules[name]; + } + }]); + + return Theme; +}(); + +Theme.DEFAULTS = { + modules: {} +}; +Theme.themes = { + 'default': Theme +}; + +exports.default = Theme; + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SHORTKEY = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _clone = __webpack_require__(21); + +var _clone2 = _interopRequireDefault(_clone); + +var _deepEqual = __webpack_require__(11); + +var _deepEqual2 = _interopRequireDefault(_deepEqual); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _op = __webpack_require__(20); + +var _op2 = _interopRequireDefault(_op); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:keyboard'); + +var SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey'; + +var Keyboard = function (_Module) { + _inherits(Keyboard, _Module); + + _createClass(Keyboard, null, [{ + key: 'match', + value: function match(evt, binding) { + binding = normalize(binding); + if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) { + return !!binding[key] !== evt[key] && binding[key] !== null; + })) { + return false; + } + return binding.key === (evt.which || evt.keyCode); + } + }]); + + function Keyboard(quill, options) { + _classCallCheck(this, Keyboard); + + var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options)); + + _this.bindings = {}; + Object.keys(_this.options.bindings).forEach(function (name) { + if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) { + return; + } + if (_this.options.bindings[name]) { + _this.addBinding(_this.options.bindings[name]); + } + }); + _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter); + _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {}); + if (/Firefox/i.test(navigator.userAgent)) { + // Need to handle delete and backspace for Firefox in the general case #1171 + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete); + } else { + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete); + } + _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange); + _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace); + _this.listen(); + return _this; + } + + _createClass(Keyboard, [{ + key: 'addBinding', + value: function addBinding(key) { + var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + var binding = normalize(key); + if (binding == null || binding.key == null) { + return debug.warn('Attempted to add invalid keyboard binding', binding); + } + if (typeof context === 'function') { + context = { handler: context }; + } + if (typeof handler === 'function') { + handler = { handler: handler }; + } + binding = (0, _extend2.default)(binding, context, handler); + this.bindings[binding.key] = this.bindings[binding.key] || []; + this.bindings[binding.key].push(binding); + } + }, { + key: 'listen', + value: function listen() { + var _this2 = this; + + this.quill.root.addEventListener('keydown', function (evt) { + if (evt.defaultPrevented) return; + var which = evt.which || evt.keyCode; + var bindings = (_this2.bindings[which] || []).filter(function (binding) { + return Keyboard.match(evt, binding); + }); + if (bindings.length === 0) return; + var range = _this2.quill.getSelection(); + if (range == null || !_this2.quill.hasFocus()) return; + + var _quill$getLine = _this2.quill.getLine(range.index), + _quill$getLine2 = _slicedToArray(_quill$getLine, 2), + line = _quill$getLine2[0], + offset = _quill$getLine2[1]; + + var _quill$getLeaf = _this2.quill.getLeaf(range.index), + _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2), + leafStart = _quill$getLeaf2[0], + offsetStart = _quill$getLeaf2[1]; + + var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length), + _ref2 = _slicedToArray(_ref, 2), + leafEnd = _ref2[0], + offsetEnd = _ref2[1]; + + var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : ''; + var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : ''; + var curContext = { + collapsed: range.length === 0, + empty: range.length === 0 && line.length() <= 1, + format: _this2.quill.getFormat(range), + offset: offset, + prefix: prefixText, + suffix: suffixText + }; + var prevented = bindings.some(function (binding) { + if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false; + if (binding.empty != null && binding.empty !== curContext.empty) return false; + if (binding.offset != null && binding.offset !== curContext.offset) return false; + if (Array.isArray(binding.format)) { + // any format is present + if (binding.format.every(function (name) { + return curContext.format[name] == null; + })) { + return false; + } + } else if (_typeof(binding.format) === 'object') { + // all formats must match + if (!Object.keys(binding.format).every(function (name) { + if (binding.format[name] === true) return curContext.format[name] != null; + if (binding.format[name] === false) return curContext.format[name] == null; + return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]); + })) { + return false; + } + } + if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false; + if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false; + return binding.handler.call(_this2, range, curContext) !== true; + }); + if (prevented) { + evt.preventDefault(); + } + }); + } + }]); + + return Keyboard; +}(_module2.default); + +Keyboard.keys = { + BACKSPACE: 8, + TAB: 9, + ENTER: 13, + ESCAPE: 27, + LEFT: 37, + UP: 38, + RIGHT: 39, + DOWN: 40, + DELETE: 46 +}; + +Keyboard.DEFAULTS = { + bindings: { + 'bold': makeFormatHandler('bold'), + 'italic': makeFormatHandler('italic'), + 'underline': makeFormatHandler('underline'), + 'indent': { + // highlight tab or tab at beginning of list, indent or blockquote + key: Keyboard.keys.TAB, + format: ['blockquote', 'indent', 'list'], + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '+1', _quill2.default.sources.USER); + } + }, + 'outdent': { + key: Keyboard.keys.TAB, + shiftKey: true, + format: ['blockquote', 'indent', 'list'], + // highlight tab or tab at beginning of list, indent or blockquote + handler: function handler(range, context) { + if (context.collapsed && context.offset !== 0) return true; + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } + }, + 'outdent backspace': { + key: Keyboard.keys.BACKSPACE, + collapsed: true, + shiftKey: null, + metaKey: null, + ctrlKey: null, + altKey: null, + format: ['indent', 'list'], + offset: 0, + handler: function handler(range, context) { + if (context.format.indent != null) { + this.quill.format('indent', '-1', _quill2.default.sources.USER); + } else if (context.format.list != null) { + this.quill.format('list', false, _quill2.default.sources.USER); + } + } + }, + 'indent code-block': makeCodeBlockHandler(true), + 'outdent code-block': makeCodeBlockHandler(false), + 'remove tab': { + key: Keyboard.keys.TAB, + shiftKey: true, + collapsed: true, + prefix: /\t$/, + handler: function handler(range) { + this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER); + } + }, + 'tab': { + key: Keyboard.keys.TAB, + handler: function handler(range) { + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\t'); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + } + }, + 'list empty enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['list'], + empty: true, + handler: function handler(range, context) { + this.quill.format('list', false, _quill2.default.sources.USER); + if (context.format.indent) { + this.quill.format('indent', false, _quill2.default.sources.USER); + } + } + }, + 'checklist enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: { list: 'checked' }, + handler: function handler(range) { + var _quill$getLine3 = this.quill.getLine(range.index), + _quill$getLine4 = _slicedToArray(_quill$getLine3, 2), + line = _quill$getLine4[0], + offset = _quill$getLine4[1]; + + var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' }); + var delta = new _quillDelta2.default().retain(range.index).insert('\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'header enter': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['header'], + suffix: /^$/, + handler: function handler(range, context) { + var _quill$getLine5 = this.quill.getLine(range.index), + _quill$getLine6 = _slicedToArray(_quill$getLine5, 2), + line = _quill$getLine6[0], + offset = _quill$getLine6[1]; + + var delta = new _quillDelta2.default().retain(range.index).insert('\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.scrollIntoView(); + } + }, + 'list autofill': { + key: ' ', + collapsed: true, + format: { list: false }, + prefix: /^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/, + handler: function handler(range, context) { + var length = context.prefix.length; + + var _quill$getLine7 = this.quill.getLine(range.index), + _quill$getLine8 = _slicedToArray(_quill$getLine7, 2), + line = _quill$getLine8[0], + offset = _quill$getLine8[1]; + + if (offset > length) return true; + var value = void 0; + switch (context.prefix.trim()) { + case '[]':case '[ ]': + value = 'unchecked'; + break; + case '[x]': + value = 'checked'; + break; + case '-':case '*': + value = 'bullet'; + break; + default: + value = 'ordered'; + } + this.quill.insertText(range.index, ' ', _quill2.default.sources.USER); + this.quill.history.cutoff(); + var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value }); + this.quill.updateContents(delta, _quill2.default.sources.USER); + this.quill.history.cutoff(); + this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT); + } + }, + 'code exit': { + key: Keyboard.keys.ENTER, + collapsed: true, + format: ['code-block'], + prefix: /\n\n$/, + suffix: /^\s+$/, + handler: function handler(range) { + var _quill$getLine9 = this.quill.getLine(range.index), + _quill$getLine10 = _slicedToArray(_quill$getLine9, 2), + line = _quill$getLine10[0], + offset = _quill$getLine10[1]; + + var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1); + this.quill.updateContents(delta, _quill2.default.sources.USER); + } + }, + 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false), + 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true), + 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false), + 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true) + } +}; + +function makeEmbedArrowHandler(key, shiftKey) { + var _ref3; + + var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix'; + return _ref3 = { + key: key, + shiftKey: shiftKey, + altKey: null + }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) { + var index = range.index; + if (key === Keyboard.keys.RIGHT) { + index += range.length + 1; + } + + var _quill$getLeaf3 = this.quill.getLeaf(index), + _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1), + leaf = _quill$getLeaf4[0]; + + if (!(leaf instanceof _parchment2.default.Embed)) return true; + if (key === Keyboard.keys.LEFT) { + if (shiftKey) { + this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index - 1, _quill2.default.sources.USER); + } + } else { + if (shiftKey) { + this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER); + } else { + this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER); + } + } + return false; + }), _ref3; +} + +function handleBackspace(range, context) { + if (range.index === 0 || this.quill.getLength() <= 1) return; + + var _quill$getLine11 = this.quill.getLine(range.index), + _quill$getLine12 = _slicedToArray(_quill$getLine11, 1), + line = _quill$getLine12[0]; + + var formats = {}; + if (context.offset === 0) { + var _quill$getLine13 = this.quill.getLine(range.index - 1), + _quill$getLine14 = _slicedToArray(_quill$getLine13, 1), + prev = _quill$getLine14[0]; + + if (prev != null && prev.length() > 1) { + var curFormats = line.formats(); + var prevFormats = this.quill.getFormat(range.index - 1, 1); + formats = _op2.default.attributes.diff(curFormats, prevFormats) || {}; + } + } + // Check for astral symbols + var length = /[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(context.prefix) ? 2 : 1; + this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER); + } + this.quill.focus(); +} + +function handleDelete(range, context) { + // Check for astral symbols + var length = /^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(context.suffix) ? 2 : 1; + if (range.index >= this.quill.getLength() - length) return; + var formats = {}, + nextLength = 0; + + var _quill$getLine15 = this.quill.getLine(range.index), + _quill$getLine16 = _slicedToArray(_quill$getLine15, 1), + line = _quill$getLine16[0]; + + if (context.offset >= line.length() - 1) { + var _quill$getLine17 = this.quill.getLine(range.index + 1), + _quill$getLine18 = _slicedToArray(_quill$getLine17, 1), + next = _quill$getLine18[0]; + + if (next) { + var curFormats = line.formats(); + var nextFormats = this.quill.getFormat(range.index, 1); + formats = _op2.default.attributes.diff(curFormats, nextFormats) || {}; + nextLength = next.length(); + } + } + this.quill.deleteText(range.index, length, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER); + } +} + +function handleDeleteRange(range) { + var lines = this.quill.getLines(range); + var formats = {}; + if (lines.length > 1) { + var firstFormats = lines[0].formats(); + var lastFormats = lines[lines.length - 1].formats(); + formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {}; + } + this.quill.deleteText(range, _quill2.default.sources.USER); + if (Object.keys(formats).length > 0) { + this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER); + } + this.quill.setSelection(range.index, _quill2.default.sources.SILENT); + this.quill.focus(); +} + +function handleEnter(range, context) { + var _this3 = this; + + if (range.length > 0) { + this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change + } + var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) { + if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) { + lineFormats[format] = context.format[format]; + } + return lineFormats; + }, {}); + this.quill.insertText(range.index, '\n', lineFormats, _quill2.default.sources.USER); + // Earlier scroll.deleteAt might have messed up our selection, + // so insertText's built in selection preservation is not reliable + this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT); + this.quill.focus(); + Object.keys(context.format).forEach(function (name) { + if (lineFormats[name] != null) return; + if (Array.isArray(context.format[name])) return; + if (name === 'link') return; + _this3.quill.format(name, context.format[name], _quill2.default.sources.USER); + }); +} + +function makeCodeBlockHandler(indent) { + return { + key: Keyboard.keys.TAB, + shiftKey: !indent, + format: { 'code-block': true }, + handler: function handler(range) { + var CodeBlock = _parchment2.default.query('code-block'); + var index = range.index, + length = range.length; + + var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + block = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (block == null) return; + var scrollIndex = this.quill.getIndex(block); + var start = block.newlineIndex(offset, true) + 1; + var end = block.newlineIndex(scrollIndex + offset + length); + var lines = block.domNode.textContent.slice(start, end).split('\n'); + offset = 0; + lines.forEach(function (line, i) { + if (indent) { + block.insertAt(start + offset, CodeBlock.TAB); + offset += CodeBlock.TAB.length; + if (i === 0) { + index += CodeBlock.TAB.length; + } else { + length += CodeBlock.TAB.length; + } + } else if (line.startsWith(CodeBlock.TAB)) { + block.deleteAt(start + offset, CodeBlock.TAB.length); + offset -= CodeBlock.TAB.length; + if (i === 0) { + index -= CodeBlock.TAB.length; + } else { + length -= CodeBlock.TAB.length; + } + } + offset += line.length + 1; + }); + this.quill.update(_quill2.default.sources.USER); + this.quill.setSelection(index, length, _quill2.default.sources.SILENT); + } + }; +} + +function makeFormatHandler(format) { + return { + key: format[0].toUpperCase(), + shortKey: true, + handler: function handler(range, context) { + this.quill.format(format, !context.format[format], _quill2.default.sources.USER); + } + }; +} + +function normalize(binding) { + if (typeof binding === 'string' || typeof binding === 'number') { + return normalize({ key: binding }); + } + if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') { + binding = (0, _clone2.default)(binding, false); + } + if (typeof binding.key === 'string') { + if (Keyboard.keys[binding.key.toUpperCase()] != null) { + binding.key = Keyboard.keys[binding.key.toUpperCase()]; + } else if (binding.key.length === 1) { + binding.key = binding.key.toUpperCase().charCodeAt(0); + } else { + return null; + } + } + if (binding.shortKey) { + binding[SHORTKEY] = binding.shortKey; + delete binding.shortKey; + } + return binding; +} + +exports.default = Keyboard; +exports.SHORTKEY = SHORTKEY; + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _text = __webpack_require__(7); + +var _text2 = _interopRequireDefault(_text); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var GUARD_TEXT = '\uFEFF'; + +var Embed = function (_Parchment$Embed) { + _inherits(Embed, _Parchment$Embed); + + function Embed(node) { + _classCallCheck(this, Embed); + + var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node)); + + _this.contentNode = document.createElement('span'); + _this.contentNode.setAttribute('contenteditable', false); + [].slice.call(_this.domNode.childNodes).forEach(function (childNode) { + _this.contentNode.appendChild(childNode); + }); + _this.leftGuard = document.createTextNode(GUARD_TEXT); + _this.rightGuard = document.createTextNode(GUARD_TEXT); + _this.domNode.appendChild(_this.leftGuard); + _this.domNode.appendChild(_this.contentNode); + _this.domNode.appendChild(_this.rightGuard); + return _this; + } + + _createClass(Embed, [{ + key: 'index', + value: function index(node, offset) { + if (node === this.leftGuard) return 0; + if (node === this.rightGuard) return 1; + return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset); + } + }, { + key: 'restore', + value: function restore(node) { + var range = void 0, + textNode = void 0; + var text = node.data.split(GUARD_TEXT).join(''); + if (node === this.leftGuard) { + if (this.prev instanceof _text2.default) { + var prevLength = this.prev.length(); + this.prev.insertAt(prevLength, text); + range = { + startNode: this.prev.domNode, + startOffset: prevLength + text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } else if (node === this.rightGuard) { + if (this.next instanceof _text2.default) { + this.next.insertAt(0, text); + range = { + startNode: this.next.domNode, + startOffset: text.length + }; + } else { + textNode = document.createTextNode(text); + this.parent.insertBefore(_parchment2.default.create(textNode), this.next); + range = { + startNode: textNode, + startOffset: text.length + }; + } + } + node.data = GUARD_TEXT; + return range; + } + }, { + key: 'update', + value: function update(mutations, context) { + var _this2 = this; + + mutations.forEach(function (mutation) { + if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) { + var range = _this2.restore(mutation.target); + if (range) context.range = range; + } + }); + } + }]); + + return Embed; +}(_parchment2.default.Embed); + +exports.default = Embed; + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['right', 'center', 'justify'] +}; + +var AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config); +var AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config); +var AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config); + +exports.AlignAttribute = AlignAttribute; +exports.AlignClass = AlignClass; +exports.AlignStyle = AlignStyle; + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.BackgroundStyle = exports.BackgroundClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _color = __webpack_require__(25); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', { + scope: _parchment2.default.Scope.INLINE +}); +var BackgroundStyle = new _color.ColorAttributor('background', 'background-color', { + scope: _parchment2.default.Scope.INLINE +}); + +exports.BackgroundClass = BackgroundClass; +exports.BackgroundStyle = BackgroundStyle; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var config = { + scope: _parchment2.default.Scope.BLOCK, + whitelist: ['rtl'] +}; + +var DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config); +var DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config); +var DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config); + +exports.DirectionAttribute = DirectionAttribute; +exports.DirectionClass = DirectionClass; +exports.DirectionStyle = DirectionStyle; + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.FontClass = exports.FontStyle = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var config = { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['serif', 'monospace'] +}; + +var FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config); + +var FontStyleAttributor = function (_Parchment$Attributor) { + _inherits(FontStyleAttributor, _Parchment$Attributor); + + function FontStyleAttributor() { + _classCallCheck(this, FontStyleAttributor); + + return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments)); + } + + _createClass(FontStyleAttributor, [{ + key: 'value', + value: function value(node) { + return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/["']/g, ''); + } + }]); + + return FontStyleAttributor; +}(_parchment2.default.Attributor.Style); + +var FontStyle = new FontStyleAttributor('font', 'font-family', config); + +exports.FontStyle = FontStyle; +exports.FontClass = FontClass; + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.SizeStyle = exports.SizeClass = undefined; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +var SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['small', 'large', 'huge'] +}); +var SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', { + scope: _parchment2.default.Scope.INLINE, + whitelist: ['10px', '18px', '32px'] +}); + +exports.SizeClass = SizeClass; +exports.SizeStyle = SizeStyle; + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = { + 'align': { + '': __webpack_require__(76), + 'center': __webpack_require__(77), + 'right': __webpack_require__(78), + 'justify': __webpack_require__(79) + }, + 'background': __webpack_require__(80), + 'blockquote': __webpack_require__(81), + 'bold': __webpack_require__(82), + 'clean': __webpack_require__(83), + 'code': __webpack_require__(58), + 'code-block': __webpack_require__(58), + 'color': __webpack_require__(84), + 'direction': { + '': __webpack_require__(85), + 'rtl': __webpack_require__(86) + }, + 'float': { + 'center': __webpack_require__(87), + 'full': __webpack_require__(88), + 'left': __webpack_require__(89), + 'right': __webpack_require__(90) + }, + 'formula': __webpack_require__(91), + 'header': { + '1': __webpack_require__(92), + '2': __webpack_require__(93) + }, + 'italic': __webpack_require__(94), + 'image': __webpack_require__(95), + 'indent': { + '+1': __webpack_require__(96), + '-1': __webpack_require__(97) + }, + 'link': __webpack_require__(98), + 'list': { + 'ordered': __webpack_require__(99), + 'bullet': __webpack_require__(100), + 'check': __webpack_require__(101) + }, + 'script': { + 'sub': __webpack_require__(102), + 'super': __webpack_require__(103) + }, + 'strike': __webpack_require__(104), + 'underline': __webpack_require__(105), + 'video': __webpack_require__(106) +}; + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getLastChangeIndex = exports.default = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var History = function (_Module) { + _inherits(History, _Module); + + function History(quill, options) { + _classCallCheck(this, History); + + var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options)); + + _this.lastRecorded = 0; + _this.ignoreChange = false; + _this.clear(); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) { + if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return; + if (!_this.options.userOnly || source === _quill2.default.sources.USER) { + _this.record(delta, oldDelta); + } else { + _this.transform(delta); + } + }); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this)); + _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this)); + if (/Win/i.test(navigator.platform)) { + _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this)); + } + return _this; + } + + _createClass(History, [{ + key: 'change', + value: function change(source, dest) { + if (this.stack[source].length === 0) return; + var delta = this.stack[source].pop(); + this.stack[dest].push(delta); + this.lastRecorded = 0; + this.ignoreChange = true; + this.quill.updateContents(delta[source], _quill2.default.sources.USER); + this.ignoreChange = false; + var index = getLastChangeIndex(delta[source]); + this.quill.setSelection(index); + } + }, { + key: 'clear', + value: function clear() { + this.stack = { undo: [], redo: [] }; + } + }, { + key: 'cutoff', + value: function cutoff() { + this.lastRecorded = 0; + } + }, { + key: 'record', + value: function record(changeDelta, oldDelta) { + if (changeDelta.ops.length === 0) return; + this.stack.redo = []; + var undoDelta = this.quill.getContents().diff(oldDelta); + var timestamp = Date.now(); + if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) { + var delta = this.stack.undo.pop(); + undoDelta = undoDelta.compose(delta.undo); + changeDelta = delta.redo.compose(changeDelta); + } else { + this.lastRecorded = timestamp; + } + this.stack.undo.push({ + redo: changeDelta, + undo: undoDelta + }); + if (this.stack.undo.length > this.options.maxStack) { + this.stack.undo.shift(); + } + } + }, { + key: 'redo', + value: function redo() { + this.change('redo', 'undo'); + } + }, { + key: 'transform', + value: function transform(delta) { + this.stack.undo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + this.stack.redo.forEach(function (change) { + change.undo = delta.transform(change.undo, true); + change.redo = delta.transform(change.redo, true); + }); + } + }, { + key: 'undo', + value: function undo() { + this.change('undo', 'redo'); + } + }]); + + return History; +}(_module2.default); + +History.DEFAULTS = { + delay: 1000, + maxStack: 100, + userOnly: false +}; + +function endsWithNewlineChange(delta) { + var lastOp = delta.ops[delta.ops.length - 1]; + if (lastOp == null) return false; + if (lastOp.insert != null) { + return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\n'); + } + if (lastOp.attributes != null) { + return Object.keys(lastOp.attributes).some(function (attr) { + return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null; + }); + } + return false; +} + +function getLastChangeIndex(delta) { + var deleteLength = delta.reduce(function (length, op) { + length += op.delete || 0; + return length; + }, 0); + var changeIndex = delta.length() - deleteLength; + if (endsWithNewlineChange(delta)) { + changeIndex -= 1; + } + return changeIndex; +} + +exports.default = History; +exports.getLastChangeIndex = getLastChangeIndex; + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BaseTooltip = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _keyboard = __webpack_require__(34); + +var _keyboard2 = _interopRequireDefault(_keyboard); + +var _theme = __webpack_require__(33); + +var _theme2 = _interopRequireDefault(_theme); + +var _colorPicker = __webpack_require__(59); + +var _colorPicker2 = _interopRequireDefault(_colorPicker); + +var _iconPicker = __webpack_require__(60); + +var _iconPicker2 = _interopRequireDefault(_iconPicker); + +var _picker = __webpack_require__(27); + +var _picker2 = _interopRequireDefault(_picker); + +var _tooltip = __webpack_require__(61); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ALIGNS = [false, 'center', 'right', 'justify']; + +var COLORS = ["#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466"]; + +var FONTS = [false, 'serif', 'monospace']; + +var HEADERS = ['1', '2', '3', false]; + +var SIZES = ['small', false, 'large', 'huge']; + +var BaseTheme = function (_Theme) { + _inherits(BaseTheme, _Theme); + + function BaseTheme(quill, options) { + _classCallCheck(this, BaseTheme); + + var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options)); + + var listener = function listener(e) { + if (!document.body.contains(quill.root)) { + return document.body.removeEventListener('click', listener); + } + if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) { + _this.tooltip.hide(); + } + if (_this.pickers != null) { + _this.pickers.forEach(function (picker) { + if (!picker.container.contains(e.target)) { + picker.close(); + } + }); + } + }; + quill.emitter.listenDOM('click', document.body, listener); + return _this; + } + + _createClass(BaseTheme, [{ + key: 'addModule', + value: function addModule(name) { + var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name); + if (name === 'toolbar') { + this.extendToolbar(module); + } + return module; + } + }, { + key: 'buildButtons', + value: function buildButtons(buttons, icons) { + buttons.forEach(function (button) { + var className = button.getAttribute('class') || ''; + className.split(/\s+/).forEach(function (name) { + if (!name.startsWith('ql-')) return; + name = name.slice('ql-'.length); + if (icons[name] == null) return; + if (name === 'direction') { + button.innerHTML = icons[name][''] + icons[name]['rtl']; + } else if (typeof icons[name] === 'string') { + button.innerHTML = icons[name]; + } else { + var value = button.value || ''; + if (value != null && icons[name][value]) { + button.innerHTML = icons[name][value]; + } + } + }); + }); + } + }, { + key: 'buildPickers', + value: function buildPickers(selects, icons) { + var _this2 = this; + + this.pickers = selects.map(function (select) { + if (select.classList.contains('ql-align')) { + if (select.querySelector('option') == null) { + fillSelect(select, ALIGNS); + } + return new _iconPicker2.default(select, icons.align); + } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) { + var format = select.classList.contains('ql-background') ? 'background' : 'color'; + if (select.querySelector('option') == null) { + fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000'); + } + return new _colorPicker2.default(select, icons[format]); + } else { + if (select.querySelector('option') == null) { + if (select.classList.contains('ql-font')) { + fillSelect(select, FONTS); + } else if (select.classList.contains('ql-header')) { + fillSelect(select, HEADERS); + } else if (select.classList.contains('ql-size')) { + fillSelect(select, SIZES); + } + } + return new _picker2.default(select); + } + }); + var update = function update() { + _this2.pickers.forEach(function (picker) { + picker.update(); + }); + }; + this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update); + } + }]); + + return BaseTheme; +}(_theme2.default); + +BaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + formula: function formula() { + this.quill.theme.tooltip.edit('formula'); + }, + image: function image() { + var _this3 = this; + + var fileInput = this.container.querySelector('input.ql-image[type=file]'); + if (fileInput == null) { + fileInput = document.createElement('input'); + fileInput.setAttribute('type', 'file'); + fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon'); + fileInput.classList.add('ql-image'); + fileInput.addEventListener('change', function () { + if (fileInput.files != null && fileInput.files[0] != null) { + var reader = new FileReader(); + reader.onload = function (e) { + var range = _this3.quill.getSelection(true); + _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER); + _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT); + fileInput.value = ""; + }; + reader.readAsDataURL(fileInput.files[0]); + } + }); + this.container.appendChild(fileInput); + } + fileInput.click(); + }, + video: function video() { + this.quill.theme.tooltip.edit('video'); + } + } + } + } +}); + +var BaseTooltip = function (_Tooltip) { + _inherits(BaseTooltip, _Tooltip); + + function BaseTooltip(quill, boundsContainer) { + _classCallCheck(this, BaseTooltip); + + var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer)); + + _this4.textbox = _this4.root.querySelector('input[type="text"]'); + _this4.listen(); + return _this4; + } + + _createClass(BaseTooltip, [{ + key: 'listen', + value: function listen() { + var _this5 = this; + + this.textbox.addEventListener('keydown', function (event) { + if (_keyboard2.default.match(event, 'enter')) { + _this5.save(); + event.preventDefault(); + } else if (_keyboard2.default.match(event, 'escape')) { + _this5.cancel(); + event.preventDefault(); + } + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.hide(); + } + }, { + key: 'edit', + value: function edit() { + var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link'; + var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + + this.root.classList.remove('ql-hidden'); + this.root.classList.add('ql-editing'); + if (preview != null) { + this.textbox.value = preview; + } else if (mode !== this.root.getAttribute('data-mode')) { + this.textbox.value = ''; + } + this.position(this.quill.getBounds(this.quill.selection.savedRange)); + this.textbox.select(); + this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || ''); + this.root.setAttribute('data-mode', mode); + } + }, { + key: 'restoreFocus', + value: function restoreFocus() { + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.quill.focus(); + this.quill.scrollingContainer.scrollTop = scrollTop; + } + }, { + key: 'save', + value: function save() { + var value = this.textbox.value; + switch (this.root.getAttribute('data-mode')) { + case 'link': + { + var scrollTop = this.quill.root.scrollTop; + if (this.linkRange) { + this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER); + delete this.linkRange; + } else { + this.restoreFocus(); + this.quill.format('link', value, _emitter2.default.sources.USER); + } + this.quill.root.scrollTop = scrollTop; + break; + } + case 'video': + { + value = extractVideoUrl(value); + } // eslint-disable-next-line no-fallthrough + case 'formula': + { + if (!value) break; + var range = this.quill.getSelection(true); + if (range != null) { + var index = range.index + range.length; + this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER); + if (this.root.getAttribute('data-mode') === 'formula') { + this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER); + } + this.quill.setSelection(index + 2, _emitter2.default.sources.USER); + } + break; + } + default: + } + this.textbox.value = ''; + this.hide(); + } + }]); + + return BaseTooltip; +}(_tooltip2.default); + +function extractVideoUrl(url) { + var match = url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/); + if (match) { + return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0'; + } + if (match = url.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) { + // eslint-disable-line no-cond-assign + return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/'; + } + return url; +} + +function fillSelect(select, values) { + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + values.forEach(function (value) { + var option = document.createElement('option'); + if (value === defaultValue) { + option.setAttribute('selected', 'selected'); + } else { + option.setAttribute('value', value); + } + select.appendChild(option); + }); +} + +exports.BaseTooltip = BaseTooltip; +exports.default = BaseTheme; + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var LinkedList = /** @class */ (function () { + function LinkedList() { + this.head = this.tail = null; + this.length = 0; + } + LinkedList.prototype.append = function () { + var nodes = []; + for (var _i = 0; _i < arguments.length; _i++) { + nodes[_i] = arguments[_i]; + } + this.insertBefore(nodes[0], null); + if (nodes.length > 1) { + this.append.apply(this, nodes.slice(1)); + } + }; + LinkedList.prototype.contains = function (node) { + var cur, next = this.iterator(); + while ((cur = next())) { + if (cur === node) + return true; + } + return false; + }; + LinkedList.prototype.insertBefore = function (node, refNode) { + if (!node) + return; + node.next = refNode; + if (refNode != null) { + node.prev = refNode.prev; + if (refNode.prev != null) { + refNode.prev.next = node; + } + refNode.prev = node; + if (refNode === this.head) { + this.head = node; + } + } + else if (this.tail != null) { + this.tail.next = node; + node.prev = this.tail; + this.tail = node; + } + else { + node.prev = null; + this.head = this.tail = node; + } + this.length += 1; + }; + LinkedList.prototype.offset = function (target) { + var index = 0, cur = this.head; + while (cur != null) { + if (cur === target) + return index; + index += cur.length(); + cur = cur.next; + } + return -1; + }; + LinkedList.prototype.remove = function (node) { + if (!this.contains(node)) + return; + if (node.prev != null) + node.prev.next = node.next; + if (node.next != null) + node.next.prev = node.prev; + if (node === this.head) + this.head = node.next; + if (node === this.tail) + this.tail = node.prev; + this.length -= 1; + }; + LinkedList.prototype.iterator = function (curNode) { + if (curNode === void 0) { curNode = this.head; } + // TODO use yield when we can + return function () { + var ret = curNode; + if (curNode != null) + curNode = curNode.next; + return ret; + }; + }; + LinkedList.prototype.find = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + var cur, next = this.iterator(); + while ((cur = next())) { + var length = cur.length(); + if (index < length || + (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) { + return [cur, index]; + } + index -= length; + } + return [null, 0]; + }; + LinkedList.prototype.forEach = function (callback) { + var cur, next = this.iterator(); + while ((cur = next())) { + callback(cur); + } + }; + LinkedList.prototype.forEachAt = function (index, length, callback) { + if (length <= 0) + return; + var _a = this.find(index), startNode = _a[0], offset = _a[1]; + var cur, curIndex = index - offset, next = this.iterator(startNode); + while ((cur = next()) && curIndex < index + length) { + var curLength = cur.length(); + if (index > curIndex) { + callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index)); + } + else { + callback(cur, 0, Math.min(curLength, index + length - curIndex)); + } + curIndex += curLength; + } + }; + LinkedList.prototype.map = function (callback) { + return this.reduce(function (memo, cur) { + memo.push(callback(cur)); + return memo; + }, []); + }; + LinkedList.prototype.reduce = function (callback, memo) { + var cur, next = this.iterator(); + while ((cur = next())) { + memo = callback(memo, cur); + } + return memo; + }; + return LinkedList; +}()); +exports.default = LinkedList; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var container_1 = __webpack_require__(17); +var Registry = __webpack_require__(1); +var OBSERVER_CONFIG = { + attributes: true, + characterData: true, + characterDataOldValue: true, + childList: true, + subtree: true, +}; +var MAX_OPTIMIZE_ITERATIONS = 100; +var ScrollBlot = /** @class */ (function (_super) { + __extends(ScrollBlot, _super); + function ScrollBlot(node) { + var _this = _super.call(this, node) || this; + _this.scroll = _this; + _this.observer = new MutationObserver(function (mutations) { + _this.update(mutations); + }); + _this.observer.observe(_this.domNode, OBSERVER_CONFIG); + _this.attach(); + return _this; + } + ScrollBlot.prototype.detach = function () { + _super.prototype.detach.call(this); + this.observer.disconnect(); + }; + ScrollBlot.prototype.deleteAt = function (index, length) { + this.update(); + if (index === 0 && length === this.length()) { + this.children.forEach(function (child) { + child.remove(); + }); + } + else { + _super.prototype.deleteAt.call(this, index, length); + } + }; + ScrollBlot.prototype.formatAt = function (index, length, name, value) { + this.update(); + _super.prototype.formatAt.call(this, index, length, name, value); + }; + ScrollBlot.prototype.insertAt = function (index, value, def) { + this.update(); + _super.prototype.insertAt.call(this, index, value, def); + }; + ScrollBlot.prototype.optimize = function (mutations, context) { + var _this = this; + if (mutations === void 0) { mutations = []; } + if (context === void 0) { context = {}; } + _super.prototype.optimize.call(this, context); + // We must modify mutations directly, cannot make copy and then modify + var records = [].slice.call(this.observer.takeRecords()); + // Array.push currently seems to be implemented by a non-tail recursive function + // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords()); + while (records.length > 0) + mutations.push(records.pop()); + // TODO use WeakMap + var mark = function (blot, markParent) { + if (markParent === void 0) { markParent = true; } + if (blot == null || blot === _this) + return; + if (blot.domNode.parentNode == null) + return; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = []; + } + if (markParent) + mark(blot.parent); + }; + var optimize = function (blot) { + // Post-order traversal + if ( + // @ts-ignore + blot.domNode[Registry.DATA_KEY] == null || + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations == null) { + return; + } + if (blot instanceof container_1.default) { + blot.children.forEach(optimize); + } + blot.optimize(context); + }; + var remaining = mutations; + for (var i = 0; remaining.length > 0; i += 1) { + if (i >= MAX_OPTIMIZE_ITERATIONS) { + throw new Error('[Parchment] Maximum optimize iterations reached'); + } + remaining.forEach(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return; + if (blot.domNode === mutation.target) { + if (mutation.type === 'childList') { + mark(Registry.find(mutation.previousSibling, false)); + [].forEach.call(mutation.addedNodes, function (node) { + var child = Registry.find(node, false); + mark(child, false); + if (child instanceof container_1.default) { + child.children.forEach(function (grandChild) { + mark(grandChild, false); + }); + } + }); + } + else if (mutation.type === 'attributes') { + mark(blot.prev); + } + } + mark(blot); + }); + this.children.forEach(optimize); + remaining = [].slice.call(this.observer.takeRecords()); + records = remaining.slice(); + while (records.length > 0) + mutations.push(records.pop()); + } + }; + ScrollBlot.prototype.update = function (mutations, context) { + var _this = this; + if (context === void 0) { context = {}; } + mutations = mutations || this.observer.takeRecords(); + // TODO use WeakMap + mutations + .map(function (mutation) { + var blot = Registry.find(mutation.target, true); + if (blot == null) + return null; + // @ts-ignore + if (blot.domNode[Registry.DATA_KEY].mutations == null) { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations = [mutation]; + return blot; + } + else { + // @ts-ignore + blot.domNode[Registry.DATA_KEY].mutations.push(mutation); + return null; + } + }) + .forEach(function (blot) { + // @ts-ignore + if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null) + return; + // @ts-ignore + blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context); + }); + // @ts-ignore + if (this.domNode[Registry.DATA_KEY].mutations != null) { + // @ts-ignore + _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context); + } + this.optimize(mutations, context); + }; + ScrollBlot.blotName = 'scroll'; + ScrollBlot.defaultChild = 'block'; + ScrollBlot.scope = Registry.Scope.BLOCK_BLOT; + ScrollBlot.tagName = 'DIV'; + return ScrollBlot; +}(container_1.default)); +exports.default = ScrollBlot; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +// Shallow object comparison +function isEqual(obj1, obj2) { + if (Object.keys(obj1).length !== Object.keys(obj2).length) + return false; + // @ts-ignore + for (var prop in obj1) { + // @ts-ignore + if (obj1[prop] !== obj2[prop]) + return false; + } + return true; +} +var InlineBlot = /** @class */ (function (_super) { + __extends(InlineBlot, _super); + function InlineBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + InlineBlot.formats = function (domNode) { + if (domNode.tagName === InlineBlot.tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + InlineBlot.prototype.format = function (name, value) { + var _this = this; + if (name === this.statics.blotName && !value) { + this.children.forEach(function (child) { + if (!(child instanceof format_1.default)) { + child = child.wrap(InlineBlot.blotName, true); + } + _this.attributes.copy(child); + }); + this.unwrap(); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + InlineBlot.prototype.formatAt = function (index, length, name, value) { + if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) { + var blot = this.isolate(index, length); + blot.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + InlineBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + var formats = this.formats(); + if (Object.keys(formats).length === 0) { + return this.unwrap(); // unformatted span + } + var next = this.next; + if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) { + next.moveChildren(this); + next.remove(); + } + }; + InlineBlot.blotName = 'inline'; + InlineBlot.scope = Registry.Scope.INLINE_BLOT; + InlineBlot.tagName = 'SPAN'; + return InlineBlot; +}(format_1.default)); +exports.default = InlineBlot; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var format_1 = __webpack_require__(18); +var Registry = __webpack_require__(1); +var BlockBlot = /** @class */ (function (_super) { + __extends(BlockBlot, _super); + function BlockBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + BlockBlot.formats = function (domNode) { + var tagName = Registry.query(BlockBlot.blotName).tagName; + if (domNode.tagName === tagName) + return undefined; + return _super.formats.call(this, domNode); + }; + BlockBlot.prototype.format = function (name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) == null) { + return; + } + else if (name === this.statics.blotName && !value) { + this.replaceWith(BlockBlot.blotName); + } + else { + _super.prototype.format.call(this, name, value); + } + }; + BlockBlot.prototype.formatAt = function (index, length, name, value) { + if (Registry.query(name, Registry.Scope.BLOCK) != null) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + BlockBlot.prototype.insertAt = function (index, value, def) { + if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) { + // Insert text or inline + _super.prototype.insertAt.call(this, index, value, def); + } + else { + var after = this.split(index); + var blot = Registry.create(value, def); + after.parent.insertBefore(blot, after); + } + }; + BlockBlot.prototype.update = function (mutations, context) { + if (navigator.userAgent.match(/Trident/)) { + this.build(); + } + else { + _super.prototype.update.call(this, mutations, context); + } + }; + BlockBlot.blotName = 'block'; + BlockBlot.scope = Registry.Scope.BLOCK_BLOT; + BlockBlot.tagName = 'P'; + return BlockBlot; +}(format_1.default)); +exports.default = BlockBlot; + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var EmbedBlot = /** @class */ (function (_super) { + __extends(EmbedBlot, _super); + function EmbedBlot() { + return _super !== null && _super.apply(this, arguments) || this; + } + EmbedBlot.formats = function (domNode) { + return undefined; + }; + EmbedBlot.prototype.format = function (name, value) { + // super.formatAt wraps, which is what we want in general, + // but this allows subclasses to overwrite for formats + // that just apply to particular embeds + _super.prototype.formatAt.call(this, 0, this.length(), name, value); + }; + EmbedBlot.prototype.formatAt = function (index, length, name, value) { + if (index === 0 && length === this.length()) { + this.format(name, value); + } + else { + _super.prototype.formatAt.call(this, index, length, name, value); + } + }; + EmbedBlot.prototype.formats = function () { + return this.statics.formats(this.domNode); + }; + return EmbedBlot; +}(leaf_1.default)); +exports.default = EmbedBlot; + + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var leaf_1 = __webpack_require__(19); +var Registry = __webpack_require__(1); +var TextBlot = /** @class */ (function (_super) { + __extends(TextBlot, _super); + function TextBlot(node) { + var _this = _super.call(this, node) || this; + _this.text = _this.statics.value(_this.domNode); + return _this; + } + TextBlot.create = function (value) { + return document.createTextNode(value); + }; + TextBlot.value = function (domNode) { + var text = domNode.data; + // @ts-ignore + if (text['normalize']) + text = text['normalize'](); + return text; + }; + TextBlot.prototype.deleteAt = function (index, length) { + this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length); + }; + TextBlot.prototype.index = function (node, offset) { + if (this.domNode === node) { + return offset; + } + return -1; + }; + TextBlot.prototype.insertAt = function (index, value, def) { + if (def == null) { + this.text = this.text.slice(0, index) + value + this.text.slice(index); + this.domNode.data = this.text; + } + else { + _super.prototype.insertAt.call(this, index, value, def); + } + }; + TextBlot.prototype.length = function () { + return this.text.length; + }; + TextBlot.prototype.optimize = function (context) { + _super.prototype.optimize.call(this, context); + this.text = this.statics.value(this.domNode); + if (this.text.length === 0) { + this.remove(); + } + else if (this.next instanceof TextBlot && this.next.prev === this) { + this.insertAt(this.length(), this.next.value()); + this.next.remove(); + } + }; + TextBlot.prototype.position = function (index, inclusive) { + if (inclusive === void 0) { inclusive = false; } + return [this.domNode, index]; + }; + TextBlot.prototype.split = function (index, force) { + if (force === void 0) { force = false; } + if (!force) { + if (index === 0) + return this; + if (index === this.length()) + return this.next; + } + var after = Registry.create(this.domNode.splitText(index)); + this.parent.insertBefore(after, this.next); + this.text = this.statics.value(this.domNode); + return after; + }; + TextBlot.prototype.update = function (mutations, context) { + var _this = this; + if (mutations.some(function (mutation) { + return mutation.type === 'characterData' && mutation.target === _this.domNode; + })) { + this.text = this.statics.value(this.domNode); + } + }; + TextBlot.prototype.value = function () { + return this.text; + }; + TextBlot.blotName = 'text'; + TextBlot.scope = Registry.Scope.INLINE_BLOT; + return TextBlot; +}(leaf_1.default)); +exports.default = TextBlot; + + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var elem = document.createElement('div'); +elem.classList.toggle('test-class', false); +if (elem.classList.contains('test-class')) { + var _toggle = DOMTokenList.prototype.toggle; + DOMTokenList.prototype.toggle = function (token, force) { + if (arguments.length > 1 && !this.contains(token) === !force) { + return force; + } else { + return _toggle.call(this, token); + } + }; +} + +if (!String.prototype.startsWith) { + String.prototype.startsWith = function (searchString, position) { + position = position || 0; + return this.substr(position, searchString.length) === searchString; + }; +} + +if (!String.prototype.endsWith) { + String.prototype.endsWith = function (searchString, position) { + var subjectString = this.toString(); + if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + }; +} + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, "find", { + value: function value(predicate) { + if (this === null) { + throw new TypeError('Array.prototype.find called on null or undefined'); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } + var list = Object(this); + var length = list.length >>> 0; + var thisArg = arguments[1]; + var value; + + for (var i = 0; i < length; i++) { + value = list[i]; + if (predicate.call(thisArg, value, i, list)) { + return value; + } + } + return undefined; + } + }); +} + +document.addEventListener("DOMContentLoaded", function () { + // Disable resizing in Firefox + document.execCommand("enableObjectResizing", false, false); + // Disable automatic linkifying in IE11 + document.execCommand("autoUrlDetect", false, false); +}); + +/***/ }), +/* 51 */ +/***/ (function(module, exports) { + +/** + * This library modifies the diff-patch-match library by Neil Fraser + * by removing the patch and match functionality and certain advanced + * options in the diff function. The original license is as follows: + * + * === + * + * Diff Match and Patch + * + * Copyright 2006 Google Inc. + * http://code.google.com/p/google-diff-match-patch/ + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +/** + * The data structure representing a diff is an array of tuples: + * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']] + * which means: delete 'Hello', add 'Goodbye' and keep ' world.' + */ +var DIFF_DELETE = -1; +var DIFF_INSERT = 1; +var DIFF_EQUAL = 0; + + +/** + * Find the differences between two texts. Simplifies the problem by stripping + * any common prefix or suffix off the texts before diffing. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {Int} cursor_pos Expected edit position in text1 (optional) + * @return {Array} Array of diff tuples. + */ +function diff_main(text1, text2, cursor_pos) { + // Check for equality (speedup). + if (text1 == text2) { + if (text1) { + return [[DIFF_EQUAL, text1]]; + } + return []; + } + + // Check cursor_pos within bounds + if (cursor_pos < 0 || text1.length < cursor_pos) { + cursor_pos = null; + } + + // Trim off common prefix (speedup). + var commonlength = diff_commonPrefix(text1, text2); + var commonprefix = text1.substring(0, commonlength); + text1 = text1.substring(commonlength); + text2 = text2.substring(commonlength); + + // Trim off common suffix (speedup). + commonlength = diff_commonSuffix(text1, text2); + var commonsuffix = text1.substring(text1.length - commonlength); + text1 = text1.substring(0, text1.length - commonlength); + text2 = text2.substring(0, text2.length - commonlength); + + // Compute the diff on the middle block. + var diffs = diff_compute_(text1, text2); + + // Restore the prefix and suffix. + if (commonprefix) { + diffs.unshift([DIFF_EQUAL, commonprefix]); + } + if (commonsuffix) { + diffs.push([DIFF_EQUAL, commonsuffix]); + } + diff_cleanupMerge(diffs); + if (cursor_pos != null) { + diffs = fix_cursor(diffs, cursor_pos); + } + diffs = fix_emoji(diffs); + return diffs; +}; + + +/** + * Find the differences between two texts. Assumes that the texts do not + * have any common prefix or suffix. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + */ +function diff_compute_(text1, text2) { + var diffs; + + if (!text1) { + // Just add some text (speedup). + return [[DIFF_INSERT, text2]]; + } + + if (!text2) { + // Just delete some text (speedup). + return [[DIFF_DELETE, text1]]; + } + + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + var i = longtext.indexOf(shorttext); + if (i != -1) { + // Shorter text is inside the longer text (speedup). + diffs = [[DIFF_INSERT, longtext.substring(0, i)], + [DIFF_EQUAL, shorttext], + [DIFF_INSERT, longtext.substring(i + shorttext.length)]]; + // Swap insertions for deletions if diff is reversed. + if (text1.length > text2.length) { + diffs[0][0] = diffs[2][0] = DIFF_DELETE; + } + return diffs; + } + + if (shorttext.length == 1) { + // Single character string. + // After the previous speedup, the character can't be an equality. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; + } + + // Check to see if the problem can be split in two. + var hm = diff_halfMatch_(text1, text2); + if (hm) { + // A half-match was found, sort out the return data. + var text1_a = hm[0]; + var text1_b = hm[1]; + var text2_a = hm[2]; + var text2_b = hm[3]; + var mid_common = hm[4]; + // Send both pairs off for separate processing. + var diffs_a = diff_main(text1_a, text2_a); + var diffs_b = diff_main(text1_b, text2_b); + // Merge the results. + return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b); + } + + return diff_bisect_(text1, text2); +}; + + +/** + * Find the 'middle snake' of a diff, split the problem in two + * and return the recursively constructed diff. + * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @return {Array} Array of diff tuples. + * @private + */ +function diff_bisect_(text1, text2) { + // Cache the text lengths to prevent multiple calls. + var text1_length = text1.length; + var text2_length = text2.length; + var max_d = Math.ceil((text1_length + text2_length) / 2); + var v_offset = max_d; + var v_length = 2 * max_d; + var v1 = new Array(v_length); + var v2 = new Array(v_length); + // Setting all elements to -1 is faster in Chrome & Firefox than mixing + // integers and undefined. + for (var x = 0; x < v_length; x++) { + v1[x] = -1; + v2[x] = -1; + } + v1[v_offset + 1] = 0; + v2[v_offset + 1] = 0; + var delta = text1_length - text2_length; + // If the total number of characters is odd, then the front path will collide + // with the reverse path. + var front = (delta % 2 != 0); + // Offsets for start and end of k loop. + // Prevents mapping of space beyond the grid. + var k1start = 0; + var k1end = 0; + var k2start = 0; + var k2end = 0; + for (var d = 0; d < max_d; d++) { + // Walk the front path one step. + for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) { + var k1_offset = v_offset + k1; + var x1; + if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) { + x1 = v1[k1_offset + 1]; + } else { + x1 = v1[k1_offset - 1] + 1; + } + var y1 = x1 - k1; + while (x1 < text1_length && y1 < text2_length && + text1.charAt(x1) == text2.charAt(y1)) { + x1++; + y1++; + } + v1[k1_offset] = x1; + if (x1 > text1_length) { + // Ran off the right of the graph. + k1end += 2; + } else if (y1 > text2_length) { + // Ran off the bottom of the graph. + k1start += 2; + } else if (front) { + var k2_offset = v_offset + delta - k1; + if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) { + // Mirror x2 onto top-left coordinate system. + var x2 = text1_length - v2[k2_offset]; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + + // Walk the reverse path one step. + for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) { + var k2_offset = v_offset + k2; + var x2; + if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) { + x2 = v2[k2_offset + 1]; + } else { + x2 = v2[k2_offset - 1] + 1; + } + var y2 = x2 - k2; + while (x2 < text1_length && y2 < text2_length && + text1.charAt(text1_length - x2 - 1) == + text2.charAt(text2_length - y2 - 1)) { + x2++; + y2++; + } + v2[k2_offset] = x2; + if (x2 > text1_length) { + // Ran off the left of the graph. + k2end += 2; + } else if (y2 > text2_length) { + // Ran off the top of the graph. + k2start += 2; + } else if (!front) { + var k1_offset = v_offset + delta - k2; + if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) { + var x1 = v1[k1_offset]; + var y1 = v_offset + x1 - k1_offset; + // Mirror x2 onto top-left coordinate system. + x2 = text1_length - x2; + if (x1 >= x2) { + // Overlap detected. + return diff_bisectSplit_(text1, text2, x1, y1); + } + } + } + } + } + // Diff took too long and hit the deadline or + // number of diffs equals number of characters, no commonality at all. + return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]]; +}; + + +/** + * Given the location of the 'middle snake', split the diff in two parts + * and recurse. + * @param {string} text1 Old string to be diffed. + * @param {string} text2 New string to be diffed. + * @param {number} x Index of split point in text1. + * @param {number} y Index of split point in text2. + * @return {Array} Array of diff tuples. + */ +function diff_bisectSplit_(text1, text2, x, y) { + var text1a = text1.substring(0, x); + var text2a = text2.substring(0, y); + var text1b = text1.substring(x); + var text2b = text2.substring(y); + + // Compute both diffs serially. + var diffs = diff_main(text1a, text2a); + var diffsb = diff_main(text1b, text2b); + + return diffs.concat(diffsb); +}; + + +/** + * Determine the common prefix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the start of each + * string. + */ +function diff_commonPrefix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerstart = 0; + while (pointermin < pointermid) { + if (text1.substring(pointerstart, pointermid) == + text2.substring(pointerstart, pointermid)) { + pointermin = pointermid; + pointerstart = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Determine the common suffix of two strings. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {number} The number of characters common to the end of each string. + */ +function diff_commonSuffix(text1, text2) { + // Quick check for common null cases. + if (!text1 || !text2 || + text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) { + return 0; + } + // Binary search. + // Performance analysis: http://neil.fraser.name/news/2007/10/09/ + var pointermin = 0; + var pointermax = Math.min(text1.length, text2.length); + var pointermid = pointermax; + var pointerend = 0; + while (pointermin < pointermid) { + if (text1.substring(text1.length - pointermid, text1.length - pointerend) == + text2.substring(text2.length - pointermid, text2.length - pointerend)) { + pointermin = pointermid; + pointerend = pointermin; + } else { + pointermax = pointermid; + } + pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin); + } + return pointermid; +}; + + +/** + * Do the two texts share a substring which is at least half the length of the + * longer text? + * This speedup can produce non-minimal diffs. + * @param {string} text1 First string. + * @param {string} text2 Second string. + * @return {Array.} Five element Array, containing the prefix of + * text1, the suffix of text1, the prefix of text2, the suffix of + * text2 and the common middle. Or null if there was no match. + */ +function diff_halfMatch_(text1, text2) { + var longtext = text1.length > text2.length ? text1 : text2; + var shorttext = text1.length > text2.length ? text2 : text1; + if (longtext.length < 4 || shorttext.length * 2 < longtext.length) { + return null; // Pointless. + } + + /** + * Does a substring of shorttext exist within longtext such that the substring + * is at least half the length of longtext? + * Closure, but does not reference any external variables. + * @param {string} longtext Longer string. + * @param {string} shorttext Shorter string. + * @param {number} i Start index of quarter length substring within longtext. + * @return {Array.} Five element Array, containing the prefix of + * longtext, the suffix of longtext, the prefix of shorttext, the suffix + * of shorttext and the common middle. Or null if there was no match. + * @private + */ + function diff_halfMatchI_(longtext, shorttext, i) { + // Start with a 1/4 length substring at position i as a seed. + var seed = longtext.substring(i, i + Math.floor(longtext.length / 4)); + var j = -1; + var best_common = ''; + var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b; + while ((j = shorttext.indexOf(seed, j + 1)) != -1) { + var prefixLength = diff_commonPrefix(longtext.substring(i), + shorttext.substring(j)); + var suffixLength = diff_commonSuffix(longtext.substring(0, i), + shorttext.substring(0, j)); + if (best_common.length < suffixLength + prefixLength) { + best_common = shorttext.substring(j - suffixLength, j) + + shorttext.substring(j, j + prefixLength); + best_longtext_a = longtext.substring(0, i - suffixLength); + best_longtext_b = longtext.substring(i + prefixLength); + best_shorttext_a = shorttext.substring(0, j - suffixLength); + best_shorttext_b = shorttext.substring(j + prefixLength); + } + } + if (best_common.length * 2 >= longtext.length) { + return [best_longtext_a, best_longtext_b, + best_shorttext_a, best_shorttext_b, best_common]; + } else { + return null; + } + } + + // First check if the second quarter is the seed for a half-match. + var hm1 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 4)); + // Check again based on the third quarter. + var hm2 = diff_halfMatchI_(longtext, shorttext, + Math.ceil(longtext.length / 2)); + var hm; + if (!hm1 && !hm2) { + return null; + } else if (!hm2) { + hm = hm1; + } else if (!hm1) { + hm = hm2; + } else { + // Both matched. Select the longest. + hm = hm1[4].length > hm2[4].length ? hm1 : hm2; + } + + // A half-match was found, sort out the return data. + var text1_a, text1_b, text2_a, text2_b; + if (text1.length > text2.length) { + text1_a = hm[0]; + text1_b = hm[1]; + text2_a = hm[2]; + text2_b = hm[3]; + } else { + text2_a = hm[0]; + text2_b = hm[1]; + text1_a = hm[2]; + text1_b = hm[3]; + } + var mid_common = hm[4]; + return [text1_a, text1_b, text2_a, text2_b, mid_common]; +}; + + +/** + * Reorder and merge like edit sections. Merge equalities. + * Any edit section can move as long as it doesn't cross an equality. + * @param {Array} diffs Array of diff tuples. + */ +function diff_cleanupMerge(diffs) { + diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end. + var pointer = 0; + var count_delete = 0; + var count_insert = 0; + var text_delete = ''; + var text_insert = ''; + var commonlength; + while (pointer < diffs.length) { + switch (diffs[pointer][0]) { + case DIFF_INSERT: + count_insert++; + text_insert += diffs[pointer][1]; + pointer++; + break; + case DIFF_DELETE: + count_delete++; + text_delete += diffs[pointer][1]; + pointer++; + break; + case DIFF_EQUAL: + // Upon reaching an equality, check for prior redundancies. + if (count_delete + count_insert > 1) { + if (count_delete !== 0 && count_insert !== 0) { + // Factor out any common prefixies. + commonlength = diff_commonPrefix(text_insert, text_delete); + if (commonlength !== 0) { + if ((pointer - count_delete - count_insert) > 0 && + diffs[pointer - count_delete - count_insert - 1][0] == + DIFF_EQUAL) { + diffs[pointer - count_delete - count_insert - 1][1] += + text_insert.substring(0, commonlength); + } else { + diffs.splice(0, 0, [DIFF_EQUAL, + text_insert.substring(0, commonlength)]); + pointer++; + } + text_insert = text_insert.substring(commonlength); + text_delete = text_delete.substring(commonlength); + } + // Factor out any common suffixies. + commonlength = diff_commonSuffix(text_insert, text_delete); + if (commonlength !== 0) { + diffs[pointer][1] = text_insert.substring(text_insert.length - + commonlength) + diffs[pointer][1]; + text_insert = text_insert.substring(0, text_insert.length - + commonlength); + text_delete = text_delete.substring(0, text_delete.length - + commonlength); + } + } + // Delete the offending records and add the merged ones. + if (count_delete === 0) { + diffs.splice(pointer - count_insert, + count_delete + count_insert, [DIFF_INSERT, text_insert]); + } else if (count_insert === 0) { + diffs.splice(pointer - count_delete, + count_delete + count_insert, [DIFF_DELETE, text_delete]); + } else { + diffs.splice(pointer - count_delete - count_insert, + count_delete + count_insert, [DIFF_DELETE, text_delete], + [DIFF_INSERT, text_insert]); + } + pointer = pointer - count_delete - count_insert + + (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1; + } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) { + // Merge this equality with the previous one. + diffs[pointer - 1][1] += diffs[pointer][1]; + diffs.splice(pointer, 1); + } else { + pointer++; + } + count_insert = 0; + count_delete = 0; + text_delete = ''; + text_insert = ''; + break; + } + } + if (diffs[diffs.length - 1][1] === '') { + diffs.pop(); // Remove the dummy entry at the end. + } + + // Second pass: look for single edits surrounded on both sides by equalities + // which can be shifted sideways to eliminate an equality. + // e.g: ABAC -> ABAC + var changes = false; + pointer = 1; + // Intentionally ignore the first and last element (don't need checking). + while (pointer < diffs.length - 1) { + if (diffs[pointer - 1][0] == DIFF_EQUAL && + diffs[pointer + 1][0] == DIFF_EQUAL) { + // This is a single edit surrounded by equalities. + if (diffs[pointer][1].substring(diffs[pointer][1].length - + diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) { + // Shift the edit over the previous equality. + diffs[pointer][1] = diffs[pointer - 1][1] + + diffs[pointer][1].substring(0, diffs[pointer][1].length - + diffs[pointer - 1][1].length); + diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]; + diffs.splice(pointer - 1, 1); + changes = true; + } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) == + diffs[pointer + 1][1]) { + // Shift the edit over the next equality. + diffs[pointer - 1][1] += diffs[pointer + 1][1]; + diffs[pointer][1] = + diffs[pointer][1].substring(diffs[pointer + 1][1].length) + + diffs[pointer + 1][1]; + diffs.splice(pointer + 1, 1); + changes = true; + } + } + pointer++; + } + // If shifts were made, the diff needs reordering and another shift sweep. + if (changes) { + diff_cleanupMerge(diffs); + } +}; + + +var diff = diff_main; +diff.INSERT = DIFF_INSERT; +diff.DELETE = DIFF_DELETE; +diff.EQUAL = DIFF_EQUAL; + +module.exports = diff; + +/* + * Modify a diff such that the cursor position points to the start of a change: + * E.g. + * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1) + * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]] + * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2) + * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]] + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} A tuple [cursor location in the modified diff, modified diff] + */ +function cursor_normalize_diff (diffs, cursor_pos) { + if (cursor_pos === 0) { + return [DIFF_EQUAL, diffs]; + } + for (var current_pos = 0, i = 0; i < diffs.length; i++) { + var d = diffs[i]; + if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) { + var next_pos = current_pos + d[1].length; + if (cursor_pos === next_pos) { + return [i + 1, diffs]; + } else if (cursor_pos < next_pos) { + // copy to prevent side effects + diffs = diffs.slice(); + // split d into two diff changes + var split_pos = cursor_pos - current_pos; + var d_left = [d[0], d[1].slice(0, split_pos)]; + var d_right = [d[0], d[1].slice(split_pos)]; + diffs.splice(i, 1, d_left, d_right); + return [i + 1, diffs]; + } else { + current_pos = next_pos; + } + } + } + throw new Error('cursor_pos is out of bounds!') +} + +/* + * Modify a diff such that the edit position is "shifted" to the proposed edit location (cursor_position). + * + * Case 1) + * Check if a naive shift is possible: + * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X) + * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result + * Case 2) + * Check if the following shifts are possible: + * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix'] + * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix'] + * ^ ^ + * d d_next + * + * @param {Array} diffs Array of diff tuples + * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds! + * @return {Array} Array of diff tuples + */ +function fix_cursor (diffs, cursor_pos) { + var norm = cursor_normalize_diff(diffs, cursor_pos); + var ndiffs = norm[1]; + var cursor_pointer = norm[0]; + var d = ndiffs[cursor_pointer]; + var d_next = ndiffs[cursor_pointer + 1]; + + if (d == null) { + // Text was deleted from end of original string, + // cursor is now out of bounds in new string + return diffs; + } else if (d[0] !== DIFF_EQUAL) { + // A modification happened at the cursor location. + // This is the expected outcome, so we can return the original diff. + return diffs; + } else { + if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) { + // Case 1) + // It is possible to perform a naive shift + ndiffs.splice(cursor_pointer, 2, d_next, d) + return merge_tuples(ndiffs, cursor_pointer, 2) + } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) { + // Case 2) + // d[1] is a prefix of d_next[1] + // We can assume that d_next[0] !== 0, since d[0] === 0 + // Shift edit locations.. + ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]); + var suffix = d_next[1].slice(d[1].length); + if (suffix.length > 0) { + ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]); + } + return merge_tuples(ndiffs, cursor_pointer, 3) + } else { + // Not possible to perform any modification + return diffs; + } + } +} + +/* + * Check diff did not split surrogate pairs. + * Ex. [0, '\uD83D'], [-1, '\uDC36'], [1, '\uDC2F'] -> [-1, '\uD83D\uDC36'], [1, '\uD83D\uDC2F'] + * '\uD83D\uDC36' === '🐶', '\uD83D\uDC2F' === '🐯' + * + * @param {Array} diffs Array of diff tuples + * @return {Array} Array of diff tuples + */ +function fix_emoji (diffs) { + var compact = false; + var starts_with_pair_end = function(str) { + return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF; + } + var ends_with_pair_start = function(str) { + return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF; + } + for (var i = 2; i < diffs.length; i += 1) { + if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) && + diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) && + diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) { + compact = true; + + diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1]; + diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1]; + + diffs[i-2][1] = diffs[i-2][1].slice(0, -1); + } + } + if (!compact) { + return diffs; + } + var fixed_diffs = []; + for (var i = 0; i < diffs.length; i += 1) { + if (diffs[i][1].length > 0) { + fixed_diffs.push(diffs[i]); + } + } + return fixed_diffs; +} + +/* + * Try to merge tuples with their neigbors in a given range. + * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab'] + * + * @param {Array} diffs Array of diff tuples. + * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]). + * @param {Int} length Number of consecutive elements to check. + * @return {Array} Array of merged diff tuples. + */ +function merge_tuples (diffs, start, length) { + // Check from (start-1) to (start+length). + for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) { + if (i + 1 < diffs.length) { + var left_d = diffs[i]; + var right_d = diffs[i+1]; + if (left_d[0] === right_d[1]) { + diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]); + } + } + } + return diffs; +} + + +/***/ }), +/* 52 */ +/***/ (function(module, exports) { + +exports = module.exports = typeof Object.keys === 'function' + ? Object.keys : shim; + +exports.shim = shim; +function shim (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} + + +/***/ }), +/* 53 */ +/***/ (function(module, exports) { + +var supportsArgumentsClass = (function(){ + return Object.prototype.toString.call(arguments) +})() == '[object Arguments]'; + +exports = module.exports = supportsArgumentsClass ? supported : unsupported; + +exports.supported = supported; +function supported(object) { + return Object.prototype.toString.call(object) == '[object Arguments]'; +}; + +exports.unsupported = unsupported; +function unsupported(object){ + return object && + typeof object == 'object' && + typeof object.length == 'number' && + Object.prototype.hasOwnProperty.call(object, 'callee') && + !Object.prototype.propertyIsEnumerable.call(object, 'callee') || + false; +}; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports) { + +'use strict'; + +var has = Object.prototype.hasOwnProperty + , prefix = '~'; + +/** + * Constructor to create a storage for our `EE` objects. + * An `Events` instance is a plain object whose properties are event names. + * + * @constructor + * @api private + */ +function Events() {} + +// +// We try to not inherit from `Object.prototype`. In some engines creating an +// instance in this way is faster than calling `Object.create(null)` directly. +// If `Object.create(null)` is not supported we prefix the event names with a +// character to make sure that the built-in object properties are not +// overridden or used as an attack vector. +// +if (Object.create) { + Events.prototype = Object.create(null); + + // + // This hack is needed because the `__proto__` property is still inherited in + // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. + // + if (!new Events().__proto__) prefix = false; +} + +/** + * Representation of a single event listener. + * + * @param {Function} fn The listener function. + * @param {Mixed} context The context to invoke the listener with. + * @param {Boolean} [once=false] Specify if the listener is a one-time listener. + * @constructor + * @api private + */ +function EE(fn, context, once) { + this.fn = fn; + this.context = context; + this.once = once || false; +} + +/** + * Minimal `EventEmitter` interface that is molded against the Node.js + * `EventEmitter` interface. + * + * @constructor + * @api public + */ +function EventEmitter() { + this._events = new Events(); + this._eventsCount = 0; +} + +/** + * Return an array listing the events for which the emitter has registered + * listeners. + * + * @returns {Array} + * @api public + */ +EventEmitter.prototype.eventNames = function eventNames() { + var names = [] + , events + , name; + + if (this._eventsCount === 0) return names; + + for (name in (events = this._events)) { + if (has.call(events, name)) names.push(prefix ? name.slice(1) : name); + } + + if (Object.getOwnPropertySymbols) { + return names.concat(Object.getOwnPropertySymbols(events)); + } + + return names; +}; + +/** + * Return the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Boolean} exists Only check if there are listeners. + * @returns {Array|Boolean} + * @api public + */ +EventEmitter.prototype.listeners = function listeners(event, exists) { + var evt = prefix ? prefix + event : event + , available = this._events[evt]; + + if (exists) return !!available; + if (!available) return []; + if (available.fn) return [available.fn]; + + for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) { + ee[i] = available[i].fn; + } + + return ee; +}; + +/** + * Calls each of the listeners registered for a given event. + * + * @param {String|Symbol} event The event name. + * @returns {Boolean} `true` if the event had listeners, else `false`. + * @api public + */ +EventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return false; + + var listeners = this._events[evt] + , len = arguments.length + , args + , i; + + if (listeners.fn) { + if (listeners.once) this.removeListener(event, listeners.fn, undefined, true); + + switch (len) { + case 1: return listeners.fn.call(listeners.context), true; + case 2: return listeners.fn.call(listeners.context, a1), true; + case 3: return listeners.fn.call(listeners.context, a1, a2), true; + case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true; + case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true; + case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true; + } + + for (i = 1, args = new Array(len -1); i < len; i++) { + args[i - 1] = arguments[i]; + } + + listeners.fn.apply(listeners.context, args); + } else { + var length = listeners.length + , j; + + for (i = 0; i < length; i++) { + if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true); + + switch (len) { + case 1: listeners[i].fn.call(listeners[i].context); break; + case 2: listeners[i].fn.call(listeners[i].context, a1); break; + case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break; + case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break; + default: + if (!args) for (j = 1, args = new Array(len -1); j < len; j++) { + args[j - 1] = arguments[j]; + } + + listeners[i].fn.apply(listeners[i].context, args); + } + } + } + + return true; +}; + +/** + * Add a listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.on = function on(event, fn, context) { + var listener = new EE(fn, context || this) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Add a one-time listener for a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn The listener function. + * @param {Mixed} [context=this] The context to invoke the listener with. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.once = function once(event, fn, context) { + var listener = new EE(fn, context || this, true) + , evt = prefix ? prefix + event : event; + + if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++; + else if (!this._events[evt].fn) this._events[evt].push(listener); + else this._events[evt] = [this._events[evt], listener]; + + return this; +}; + +/** + * Remove the listeners of a given event. + * + * @param {String|Symbol} event The event name. + * @param {Function} fn Only remove the listeners that match this function. + * @param {Mixed} context Only remove the listeners that have this context. + * @param {Boolean} once Only remove one-time listeners. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) { + var evt = prefix ? prefix + event : event; + + if (!this._events[evt]) return this; + if (!fn) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + return this; + } + + var listeners = this._events[evt]; + + if (listeners.fn) { + if ( + listeners.fn === fn + && (!once || listeners.once) + && (!context || listeners.context === context) + ) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + for (var i = 0, events = [], length = listeners.length; i < length; i++) { + if ( + listeners[i].fn !== fn + || (once && !listeners[i].once) + || (context && listeners[i].context !== context) + ) { + events.push(listeners[i]); + } + } + + // + // Reset the array, or remove it completely if we have no more listeners. + // + if (events.length) this._events[evt] = events.length === 1 ? events[0] : events; + else if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + + return this; +}; + +/** + * Remove all listeners, or those of the specified event. + * + * @param {String|Symbol} [event] The event name. + * @returns {EventEmitter} `this`. + * @api public + */ +EventEmitter.prototype.removeAllListeners = function removeAllListeners(event) { + var evt; + + if (event) { + evt = prefix ? prefix + event : event; + if (this._events[evt]) { + if (--this._eventsCount === 0) this._events = new Events(); + else delete this._events[evt]; + } + } else { + this._events = new Events(); + this._eventsCount = 0; + } + + return this; +}; + +// +// Alias methods names because people roll like that. +// +EventEmitter.prototype.off = EventEmitter.prototype.removeListener; +EventEmitter.prototype.addListener = EventEmitter.prototype.on; + +// +// This function doesn't apply anymore. +// +EventEmitter.prototype.setMaxListeners = function setMaxListeners() { + return this; +}; + +// +// Expose the prefix. +// +EventEmitter.prefixed = prefix; + +// +// Allow `EventEmitter` to be imported as module namespace. +// +EventEmitter.EventEmitter = EventEmitter; + +// +// Expose the module. +// +if ('undefined' !== typeof module) { + module.exports = EventEmitter; +} + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined; + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend2 = __webpack_require__(3); + +var _extend3 = _interopRequireDefault(_extend2); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _align = __webpack_require__(36); + +var _background = __webpack_require__(37); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _color = __webpack_require__(25); + +var _direction = __webpack_require__(38); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:clipboard'); + +var DOM_KEY = '__ql-matcher'; + +var CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]]; + +var ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) { + memo[attr.keyName] = attr; + return memo; +}, {}); + +var Clipboard = function (_Module) { + _inherits(Clipboard, _Module); + + function Clipboard(quill, options) { + _classCallCheck(this, Clipboard); + + var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options)); + + _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this)); + _this.container = _this.quill.addContainer('ql-clipboard'); + _this.container.setAttribute('contenteditable', true); + _this.container.setAttribute('tabindex', -1); + _this.matchers = []; + CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) { + var _ref2 = _slicedToArray(_ref, 2), + selector = _ref2[0], + matcher = _ref2[1]; + + if (!options.matchVisual && matcher === matchSpacing) return; + _this.addMatcher(selector, matcher); + }); + return _this; + } + + _createClass(Clipboard, [{ + key: 'addMatcher', + value: function addMatcher(selector, matcher) { + this.matchers.push([selector, matcher]); + } + }, { + key: 'convert', + value: function convert(html) { + if (typeof html === 'string') { + this.container.innerHTML = html.replace(/\>\r?\n +\<'); // Remove spaces between tags + return this.convert(); + } + var formats = this.quill.getFormat(this.quill.selection.savedRange.index); + if (formats[_code2.default.blotName]) { + var text = this.container.innerText; + this.container.innerHTML = ''; + return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName])); + } + + var _prepareMatching = this.prepareMatching(), + _prepareMatching2 = _slicedToArray(_prepareMatching, 2), + elementMatchers = _prepareMatching2[0], + textMatchers = _prepareMatching2[1]; + + var delta = traverse(this.container, elementMatchers, textMatchers); + // Remove trailing newline + if (deltaEndsWith(delta, '\n') && delta.ops[delta.ops.length - 1].attributes == null) { + delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1)); + } + debug.log('convert', this.container.innerHTML, delta); + this.container.innerHTML = ''; + return delta; + } + }, { + key: 'dangerouslyPasteHTML', + value: function dangerouslyPasteHTML(index, html) { + var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API; + + if (typeof index === 'string') { + this.quill.setContents(this.convert(index), html); + this.quill.setSelection(0, _quill2.default.sources.SILENT); + } else { + var paste = this.convert(html); + this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source); + this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT); + } + } + }, { + key: 'onPaste', + value: function onPaste(e) { + var _this2 = this; + + if (e.defaultPrevented || !this.quill.isEnabled()) return; + var range = this.quill.getSelection(); + var delta = new _quillDelta2.default().retain(range.index); + var scrollTop = this.quill.scrollingContainer.scrollTop; + this.container.focus(); + this.quill.selection.update(_quill2.default.sources.SILENT); + setTimeout(function () { + delta = delta.concat(_this2.convert()).delete(range.length); + _this2.quill.updateContents(delta, _quill2.default.sources.USER); + // range.length contributes to delta.length() + _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT); + _this2.quill.scrollingContainer.scrollTop = scrollTop; + _this2.quill.focus(); + }, 1); + } + }, { + key: 'prepareMatching', + value: function prepareMatching() { + var _this3 = this; + + var elementMatchers = [], + textMatchers = []; + this.matchers.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + selector = _pair[0], + matcher = _pair[1]; + + switch (selector) { + case Node.TEXT_NODE: + textMatchers.push(matcher); + break; + case Node.ELEMENT_NODE: + elementMatchers.push(matcher); + break; + default: + [].forEach.call(_this3.container.querySelectorAll(selector), function (node) { + // TODO use weakmap + node[DOM_KEY] = node[DOM_KEY] || []; + node[DOM_KEY].push(matcher); + }); + break; + } + }); + return [elementMatchers, textMatchers]; + } + }]); + + return Clipboard; +}(_module2.default); + +Clipboard.DEFAULTS = { + matchers: [], + matchVisual: true +}; + +function applyFormat(delta, format, value) { + if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') { + return Object.keys(format).reduce(function (delta, key) { + return applyFormat(delta, key, format[key]); + }, delta); + } else { + return delta.reduce(function (delta, op) { + if (op.attributes && op.attributes[format]) { + return delta.push(op); + } else { + return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes)); + } + }, new _quillDelta2.default()); + } +} + +function computeStyle(node) { + if (node.nodeType !== Node.ELEMENT_NODE) return {}; + var DOM_KEY = '__ql-computed-style'; + return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node)); +} + +function deltaEndsWith(delta, text) { + var endText = ""; + for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) { + var op = delta.ops[i]; + if (typeof op.insert !== 'string') break; + endText = op.insert + endText; + } + return endText.slice(-1 * text.length) === text; +} + +function isLine(node) { + if (node.childNodes.length === 0) return false; // Exclude embed blocks + var style = computeStyle(node); + return ['block', 'list-item'].indexOf(style.display) > -1; +} + +function traverse(node, elementMatchers, textMatchers) { + // Post-order + if (node.nodeType === node.TEXT_NODE) { + return textMatchers.reduce(function (delta, matcher) { + return matcher(node, delta); + }, new _quillDelta2.default()); + } else if (node.nodeType === node.ELEMENT_NODE) { + return [].reduce.call(node.childNodes || [], function (delta, childNode) { + var childrenDelta = traverse(childNode, elementMatchers, textMatchers); + if (childNode.nodeType === node.ELEMENT_NODE) { + childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) { + return matcher(childNode, childrenDelta); + }, childrenDelta); + } + return delta.concat(childrenDelta); + }, new _quillDelta2.default()); + } else { + return new _quillDelta2.default(); + } +} + +function matchAlias(format, node, delta) { + return applyFormat(delta, format, true); +} + +function matchAttributor(node, delta) { + var attributes = _parchment2.default.Attributor.Attribute.keys(node); + var classes = _parchment2.default.Attributor.Class.keys(node); + var styles = _parchment2.default.Attributor.Style.keys(node); + var formats = {}; + attributes.concat(classes).concat(styles).forEach(function (name) { + var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE); + if (attr != null) { + formats[attr.attrName] = attr.value(node); + if (formats[attr.attrName]) return; + } + attr = ATTRIBUTE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + formats[attr.attrName] = attr.value(node) || undefined; + } + attr = STYLE_ATTRIBUTORS[name]; + if (attr != null && (attr.attrName === name || attr.keyName === name)) { + attr = STYLE_ATTRIBUTORS[name]; + formats[attr.attrName] = attr.value(node) || undefined; + } + }); + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + return delta; +} + +function matchBlot(node, delta) { + var match = _parchment2.default.query(node); + if (match == null) return delta; + if (match.prototype instanceof _parchment2.default.Embed) { + var embed = {}; + var value = match.value(node); + if (value != null) { + embed[match.blotName] = value; + delta = new _quillDelta2.default().insert(embed, match.formats(node)); + } + } else if (typeof match.formats === 'function') { + delta = applyFormat(delta, match.blotName, match.formats(node)); + } + return delta; +} + +function matchBreak(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + delta.insert('\n'); + } + return delta; +} + +function matchIgnore() { + return new _quillDelta2.default(); +} + +function matchIndent(node, delta) { + var match = _parchment2.default.query(node); + if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\n')) { + return delta; + } + var indent = -1, + parent = node.parentNode; + while (!parent.classList.contains('ql-clipboard')) { + if ((_parchment2.default.query(parent) || {}).blotName === 'list') { + indent += 1; + } + parent = parent.parentNode; + } + if (indent <= 0) return delta; + return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent })); +} + +function matchNewline(node, delta) { + if (!deltaEndsWith(delta, '\n')) { + if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) { + delta.insert('\n'); + } + } + return delta; +} + +function matchSpacing(node, delta) { + if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\n\n')) { + var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom); + if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) { + delta.insert('\n'); + } + } + return delta; +} + +function matchStyles(node, delta) { + var formats = {}; + var style = node.style || {}; + if (style.fontStyle && computeStyle(node).fontStyle === 'italic') { + formats.italic = true; + } + if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) { + formats.bold = true; + } + if (Object.keys(formats).length > 0) { + delta = applyFormat(delta, formats); + } + if (parseFloat(style.textIndent || 0) > 0) { + // Could be 0.5in + delta = new _quillDelta2.default().insert('\t').concat(delta); + } + return delta; +} + +function matchText(node, delta) { + var text = node.data; + // Word represents empty line with   + if (node.parentNode.tagName === 'O:P') { + return delta.insert(text.trim()); + } + if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) { + return delta; + } + if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) { + // eslint-disable-next-line func-style + var replacer = function replacer(collapse, match) { + match = match.replace(/[^\u00a0]/g, ''); // \u00a0 is nbsp; + return match.length < 1 && collapse ? ' ' : match; + }; + text = text.replace(/\r\n/g, ' ').replace(/\n/g, ' '); + text = text.replace(/\s\s+/g, replacer.bind(replacer, true)); // collapse whitespace + if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) { + text = text.replace(/^\s+/, replacer.bind(replacer, false)); + } + if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) { + text = text.replace(/\s+$/, replacer.bind(replacer, false)); + } + } + return delta.insert(text); +} + +exports.default = Clipboard; +exports.matchAttributor = matchAttributor; +exports.matchBlot = matchBlot; +exports.matchNewline = matchNewline; +exports.matchSpacing = matchSpacing; +exports.matchText = matchText; + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Bold = function (_Inline) { + _inherits(Bold, _Inline); + + function Bold() { + _classCallCheck(this, Bold); + + return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments)); + } + + _createClass(Bold, [{ + key: 'optimize', + value: function optimize(context) { + _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context); + if (this.domNode.tagName !== this.statics.tagName[0]) { + this.replaceWith(this.statics.blotName); + } + } + }], [{ + key: 'create', + value: function create() { + return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this); + } + }, { + key: 'formats', + value: function formats() { + return true; + } + }]); + + return Bold; +}(_inline2.default); + +Bold.blotName = 'bold'; +Bold.tagName = ['STRONG', 'B']; + +exports.default = Bold; + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addControls = exports.default = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _quillDelta = __webpack_require__(2); + +var _quillDelta2 = _interopRequireDefault(_quillDelta); + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _logger = __webpack_require__(10); + +var _logger2 = _interopRequireDefault(_logger); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var debug = (0, _logger2.default)('quill:toolbar'); + +var Toolbar = function (_Module) { + _inherits(Toolbar, _Module); + + function Toolbar(quill, options) { + _classCallCheck(this, Toolbar); + + var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options)); + + if (Array.isArray(_this.options.container)) { + var container = document.createElement('div'); + addControls(container, _this.options.container); + quill.container.parentNode.insertBefore(container, quill.container); + _this.container = container; + } else if (typeof _this.options.container === 'string') { + _this.container = document.querySelector(_this.options.container); + } else { + _this.container = _this.options.container; + } + if (!(_this.container instanceof HTMLElement)) { + var _ret; + + return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret); + } + _this.container.classList.add('ql-toolbar'); + _this.controls = []; + _this.handlers = {}; + Object.keys(_this.options.handlers).forEach(function (format) { + _this.addHandler(format, _this.options.handlers[format]); + }); + [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) { + _this.attach(input); + }); + _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) { + if (type === _quill2.default.events.SELECTION_CHANGE) { + _this.update(range); + } + }); + _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + var _this$quill$selection = _this.quill.selection.getRange(), + _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1), + range = _this$quill$selection2[0]; // quill.getSelection triggers update + + + _this.update(range); + }); + return _this; + } + + _createClass(Toolbar, [{ + key: 'addHandler', + value: function addHandler(format, handler) { + this.handlers[format] = handler; + } + }, { + key: 'attach', + value: function attach(input) { + var _this2 = this; + + var format = [].find.call(input.classList, function (className) { + return className.indexOf('ql-') === 0; + }); + if (!format) return; + format = format.slice('ql-'.length); + if (input.tagName === 'BUTTON') { + input.setAttribute('type', 'button'); + } + if (this.handlers[format] == null) { + if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) { + debug.warn('ignoring attaching to disabled format', format, input); + return; + } + if (_parchment2.default.query(format) == null) { + debug.warn('ignoring attaching to nonexistent format', format, input); + return; + } + } + var eventName = input.tagName === 'SELECT' ? 'change' : 'click'; + input.addEventListener(eventName, function (e) { + var value = void 0; + if (input.tagName === 'SELECT') { + if (input.selectedIndex < 0) return; + var selected = input.options[input.selectedIndex]; + if (selected.hasAttribute('selected')) { + value = false; + } else { + value = selected.value || false; + } + } else { + if (input.classList.contains('ql-active')) { + value = false; + } else { + value = input.value || !input.hasAttribute('value'); + } + e.preventDefault(); + } + _this2.quill.focus(); + + var _quill$selection$getR = _this2.quill.selection.getRange(), + _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1), + range = _quill$selection$getR2[0]; + + if (_this2.handlers[format] != null) { + _this2.handlers[format].call(_this2, value); + } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) { + value = prompt('Enter ' + format); + if (!value) return; + _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER); + } else { + _this2.quill.format(format, value, _quill2.default.sources.USER); + } + _this2.update(range); + }); + // TODO use weakmap + this.controls.push([format, input]); + } + }, { + key: 'update', + value: function update(range) { + var formats = range == null ? {} : this.quill.getFormat(range); + this.controls.forEach(function (pair) { + var _pair = _slicedToArray(pair, 2), + format = _pair[0], + input = _pair[1]; + + if (input.tagName === 'SELECT') { + var option = void 0; + if (range == null) { + option = null; + } else if (formats[format] == null) { + option = input.querySelector('option[selected]'); + } else if (!Array.isArray(formats[format])) { + var value = formats[format]; + if (typeof value === 'string') { + value = value.replace(/\"/g, '\\"'); + } + option = input.querySelector('option[value="' + value + '"]'); + } + if (option == null) { + input.value = ''; // TODO make configurable? + input.selectedIndex = -1; + } else { + option.selected = true; + } + } else { + if (range == null) { + input.classList.remove('ql-active'); + } else if (input.hasAttribute('value')) { + // both being null should match (default values) + // '1' should match with 1 (headers) + var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value'); + input.classList.toggle('ql-active', isActive); + } else { + input.classList.toggle('ql-active', formats[format] != null); + } + } + }); + } + }]); + + return Toolbar; +}(_module2.default); + +Toolbar.DEFAULTS = {}; + +function addButton(container, format, value) { + var input = document.createElement('button'); + input.setAttribute('type', 'button'); + input.classList.add('ql-' + format); + if (value != null) { + input.value = value; + } + container.appendChild(input); +} + +function addControls(container, groups) { + if (!Array.isArray(groups[0])) { + groups = [groups]; + } + groups.forEach(function (controls) { + var group = document.createElement('span'); + group.classList.add('ql-formats'); + controls.forEach(function (control) { + if (typeof control === 'string') { + addButton(group, control); + } else { + var format = Object.keys(control)[0]; + var value = control[format]; + if (Array.isArray(value)) { + addSelect(group, format, value); + } else { + addButton(group, format, value); + } + } + }); + container.appendChild(group); + }); +} + +function addSelect(container, format, values) { + var input = document.createElement('select'); + input.classList.add('ql-' + format); + values.forEach(function (value) { + var option = document.createElement('option'); + if (value !== false) { + option.setAttribute('value', value); + } else { + option.setAttribute('selected', 'selected'); + } + input.appendChild(option); + }); + container.appendChild(input); +} + +Toolbar.DEFAULTS = { + container: null, + handlers: { + clean: function clean() { + var _this3 = this; + + var range = this.quill.getSelection(); + if (range == null) return; + if (range.length == 0) { + var formats = this.quill.getFormat(); + Object.keys(formats).forEach(function (name) { + // Clean functionality in existing apps only clean inline formats + if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) { + _this3.quill.format(name, false); + } + }); + } else { + this.quill.removeFormat(range, _quill2.default.sources.USER); + } + }, + direction: function direction(value) { + var align = this.quill.getFormat()['align']; + if (value === 'rtl' && align == null) { + this.quill.format('align', 'right', _quill2.default.sources.USER); + } else if (!value && align === 'right') { + this.quill.format('align', false, _quill2.default.sources.USER); + } + this.quill.format('direction', value, _quill2.default.sources.USER); + }, + indent: function indent(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + var indent = parseInt(formats.indent || 0); + if (value === '+1' || value === '-1') { + var modifier = value === '+1' ? 1 : -1; + if (formats.direction === 'rtl') modifier *= -1; + this.quill.format('indent', indent + modifier, _quill2.default.sources.USER); + } + }, + link: function link(value) { + if (value === true) { + value = prompt('Enter link URL:'); + } + this.quill.format('link', value, _quill2.default.sources.USER); + }, + list: function list(value) { + var range = this.quill.getSelection(); + var formats = this.quill.getFormat(range); + if (value === 'check') { + if (formats['list'] === 'checked' || formats['list'] === 'unchecked') { + this.quill.format('list', false, _quill2.default.sources.USER); + } else { + this.quill.format('list', 'unchecked', _quill2.default.sources.USER); + } + } else { + this.quill.format('list', value, _quill2.default.sources.USER); + } + } + } +}; + +exports.default = Toolbar; +exports.addControls = addControls; + +/***/ }), +/* 58 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _picker = __webpack_require__(27); + +var _picker2 = _interopRequireDefault(_picker); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ColorPicker = function (_Picker) { + _inherits(ColorPicker, _Picker); + + function ColorPicker(select, label) { + _classCallCheck(this, ColorPicker); + + var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select)); + + _this.label.innerHTML = label; + _this.container.classList.add('ql-color-picker'); + [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) { + item.classList.add('ql-primary'); + }); + return _this; + } + + _createClass(ColorPicker, [{ + key: 'buildItem', + value: function buildItem(option) { + var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option); + item.style.backgroundColor = option.getAttribute('value') || ''; + return item; + } + }, { + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger); + var colorLabel = this.label.querySelector('.ql-color-label'); + var value = item ? item.getAttribute('data-value') || '' : ''; + if (colorLabel) { + if (colorLabel.tagName === 'line') { + colorLabel.style.stroke = value; + } else { + colorLabel.style.fill = value; + } + } + } + }]); + + return ColorPicker; +}(_picker2.default); + +exports.default = ColorPicker; + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _picker = __webpack_require__(27); + +var _picker2 = _interopRequireDefault(_picker); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var IconPicker = function (_Picker) { + _inherits(IconPicker, _Picker); + + function IconPicker(select, icons) { + _classCallCheck(this, IconPicker); + + var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select)); + + _this.container.classList.add('ql-icon-picker'); + [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) { + item.innerHTML = icons[item.getAttribute('data-value') || '']; + }); + _this.defaultItem = _this.container.querySelector('.ql-selected'); + _this.selectItem(_this.defaultItem); + return _this; + } + + _createClass(IconPicker, [{ + key: 'selectItem', + value: function selectItem(item, trigger) { + _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger); + item = item || this.defaultItem; + this.label.innerHTML = item.innerHTML; + } + }]); + + return IconPicker; +}(_picker2.default); + +exports.default = IconPicker; + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var Tooltip = function () { + function Tooltip(quill, boundsContainer) { + var _this = this; + + _classCallCheck(this, Tooltip); + + this.quill = quill; + this.boundsContainer = boundsContainer || document.body; + this.root = quill.addContainer('ql-tooltip'); + this.root.innerHTML = this.constructor.TEMPLATE; + if (this.quill.root === this.quill.scrollingContainer) { + this.quill.root.addEventListener('scroll', function () { + _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px'; + }); + } + this.hide(); + } + + _createClass(Tooltip, [{ + key: 'hide', + value: function hide() { + this.root.classList.add('ql-hidden'); + } + }, { + key: 'position', + value: function position(reference) { + var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2; + // root.scrollTop should be 0 if scrollContainer !== root + var top = reference.bottom + this.quill.root.scrollTop; + this.root.style.left = left + 'px'; + this.root.style.top = top + 'px'; + this.root.classList.remove('ql-flip'); + var containerBounds = this.boundsContainer.getBoundingClientRect(); + var rootBounds = this.root.getBoundingClientRect(); + var shift = 0; + if (rootBounds.right > containerBounds.right) { + shift = containerBounds.right - rootBounds.right; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.left < containerBounds.left) { + shift = containerBounds.left - rootBounds.left; + this.root.style.left = left + shift + 'px'; + } + if (rootBounds.bottom > containerBounds.bottom) { + var height = rootBounds.bottom - rootBounds.top; + var verticalShift = reference.bottom - reference.top + height; + this.root.style.top = top - verticalShift + 'px'; + this.root.classList.add('ql-flip'); + } + return shift; + } + }, { + key: 'show', + value: function show() { + this.root.classList.remove('ql-editing'); + this.root.classList.remove('ql-hidden'); + } + }]); + + return Tooltip; +}(); + +exports.default = Tooltip; + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _base = __webpack_require__(43); + +var _base2 = _interopRequireDefault(_base); + +var _link = __webpack_require__(26); + +var _link2 = _interopRequireDefault(_link); + +var _selection = __webpack_require__(15); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']]; + +var SnowTheme = function (_BaseTheme) { + _inherits(SnowTheme, _BaseTheme); + + function SnowTheme(quill, options) { + _classCallCheck(this, SnowTheme); + + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } + + var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options)); + + _this.quill.container.classList.add('ql-snow'); + return _this; + } + + _createClass(SnowTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + toolbar.container.classList.add('ql-snow'); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + this.tooltip = new SnowTooltip(this.quill, this.options.bounds); + if (toolbar.container.querySelector('.ql-link')) { + this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) { + toolbar.handlers['link'].call(toolbar, !context.format.link); + }); + } + } + }]); + + return SnowTheme; +}(_base2.default); + +SnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (value) { + var range = this.quill.getSelection(); + if (range == null || range.length == 0) return; + var preview = this.quill.getText(range); + if (/^\S+@\S+\.\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) { + preview = 'mailto:' + preview; + } + var tooltip = this.quill.theme.tooltip; + tooltip.edit('link', preview); + } else { + this.quill.format('link', false); + } + } + } + } + } +}); + +var SnowTooltip = function (_BaseTooltip) { + _inherits(SnowTooltip, _BaseTooltip); + + function SnowTooltip(quill, bounds) { + _classCallCheck(this, SnowTooltip); + + var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds)); + + _this2.preview = _this2.root.querySelector('a.ql-preview'); + return _this2; + } + + _createClass(SnowTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('a.ql-action').addEventListener('click', function (event) { + if (_this3.root.classList.contains('ql-editing')) { + _this3.save(); + } else { + _this3.edit('link', _this3.preview.textContent); + } + event.preventDefault(); + }); + this.root.querySelector('a.ql-remove').addEventListener('click', function (event) { + if (_this3.linkRange != null) { + var range = _this3.linkRange; + _this3.restoreFocus(); + _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER); + delete _this3.linkRange; + } + event.preventDefault(); + _this3.hide(); + }); + this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) { + if (range == null) return; + if (range.length === 0 && source === _emitter2.default.sources.USER) { + var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index), + _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2), + link = _quill$scroll$descend2[0], + offset = _quill$scroll$descend2[1]; + + if (link != null) { + _this3.linkRange = new _selection.Range(range.index - offset, link.length()); + var preview = _link2.default.formats(link.domNode); + _this3.preview.textContent = preview; + _this3.preview.setAttribute('href', preview); + _this3.show(); + _this3.position(_this3.quill.getBounds(_this3.linkRange)); + return; + } + } else { + delete _this3.linkRange; + } + _this3.hide(); + }); + } + }, { + key: 'show', + value: function show() { + _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this); + this.root.removeAttribute('data-mode'); + } + }]); + + return SnowTooltip; +}(_base.BaseTooltip); + +SnowTooltip.TEMPLATE = ['', '', '', ''].join(''); + +exports.default = SnowTheme; + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _core = __webpack_require__(28); + +var _core2 = _interopRequireDefault(_core); + +var _align = __webpack_require__(36); + +var _direction = __webpack_require__(38); + +var _indent = __webpack_require__(64); + +var _blockquote = __webpack_require__(65); + +var _blockquote2 = _interopRequireDefault(_blockquote); + +var _header = __webpack_require__(66); + +var _header2 = _interopRequireDefault(_header); + +var _list = __webpack_require__(67); + +var _list2 = _interopRequireDefault(_list); + +var _background = __webpack_require__(37); + +var _color = __webpack_require__(25); + +var _font = __webpack_require__(39); + +var _size = __webpack_require__(40); + +var _bold = __webpack_require__(56); + +var _bold2 = _interopRequireDefault(_bold); + +var _italic = __webpack_require__(68); + +var _italic2 = _interopRequireDefault(_italic); + +var _link = __webpack_require__(26); + +var _link2 = _interopRequireDefault(_link); + +var _script = __webpack_require__(69); + +var _script2 = _interopRequireDefault(_script); + +var _strike = __webpack_require__(70); + +var _strike2 = _interopRequireDefault(_strike); + +var _underline = __webpack_require__(71); + +var _underline2 = _interopRequireDefault(_underline); + +var _image = __webpack_require__(72); + +var _image2 = _interopRequireDefault(_image); + +var _video = __webpack_require__(73); + +var _video2 = _interopRequireDefault(_video); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +var _formula = __webpack_require__(74); + +var _formula2 = _interopRequireDefault(_formula); + +var _syntax = __webpack_require__(75); + +var _syntax2 = _interopRequireDefault(_syntax); + +var _toolbar = __webpack_require__(57); + +var _toolbar2 = _interopRequireDefault(_toolbar); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +var _picker = __webpack_require__(27); + +var _picker2 = _interopRequireDefault(_picker); + +var _colorPicker = __webpack_require__(59); + +var _colorPicker2 = _interopRequireDefault(_colorPicker); + +var _iconPicker = __webpack_require__(60); + +var _iconPicker2 = _interopRequireDefault(_iconPicker); + +var _tooltip = __webpack_require__(61); + +var _tooltip2 = _interopRequireDefault(_tooltip); + +var _bubble = __webpack_require__(108); + +var _bubble2 = _interopRequireDefault(_bubble); + +var _snow = __webpack_require__(62); + +var _snow2 = _interopRequireDefault(_snow); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +_core2.default.register({ + 'attributors/attribute/direction': _direction.DirectionAttribute, + + 'attributors/class/align': _align.AlignClass, + 'attributors/class/background': _background.BackgroundClass, + 'attributors/class/color': _color.ColorClass, + 'attributors/class/direction': _direction.DirectionClass, + 'attributors/class/font': _font.FontClass, + 'attributors/class/size': _size.SizeClass, + + 'attributors/style/align': _align.AlignStyle, + 'attributors/style/background': _background.BackgroundStyle, + 'attributors/style/color': _color.ColorStyle, + 'attributors/style/direction': _direction.DirectionStyle, + 'attributors/style/font': _font.FontStyle, + 'attributors/style/size': _size.SizeStyle +}, true); + +_core2.default.register({ + 'formats/align': _align.AlignClass, + 'formats/direction': _direction.DirectionClass, + 'formats/indent': _indent.IndentClass, + + 'formats/background': _background.BackgroundStyle, + 'formats/color': _color.ColorStyle, + 'formats/font': _font.FontClass, + 'formats/size': _size.SizeClass, + + 'formats/blockquote': _blockquote2.default, + 'formats/code-block': _code2.default, + 'formats/header': _header2.default, + 'formats/list': _list2.default, + + 'formats/bold': _bold2.default, + 'formats/code': _code.Code, + 'formats/italic': _italic2.default, + 'formats/link': _link2.default, + 'formats/script': _script2.default, + 'formats/strike': _strike2.default, + 'formats/underline': _underline2.default, + + 'formats/image': _image2.default, + 'formats/video': _video2.default, + + 'formats/list/item': _list.ListItem, + + 'modules/formula': _formula2.default, + 'modules/syntax': _syntax2.default, + 'modules/toolbar': _toolbar2.default, + + 'themes/bubble': _bubble2.default, + 'themes/snow': _snow2.default, + + 'ui/icons': _icons2.default, + 'ui/picker': _picker2.default, + 'ui/icon-picker': _iconPicker2.default, + 'ui/color-picker': _colorPicker2.default, + 'ui/tooltip': _tooltip2.default +}, true); + +exports.default = _core2.default; + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.IndentClass = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var IdentAttributor = function (_Parchment$Attributor) { + _inherits(IdentAttributor, _Parchment$Attributor); + + function IdentAttributor() { + _classCallCheck(this, IdentAttributor); + + return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments)); + } + + _createClass(IdentAttributor, [{ + key: 'add', + value: function add(node, value) { + if (value === '+1' || value === '-1') { + var indent = this.value(node) || 0; + value = value === '+1' ? indent + 1 : indent - 1; + } + if (value === 0) { + this.remove(node); + return true; + } else { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value); + } + } + }, { + key: 'canAdd', + value: function canAdd(node, value) { + return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value)); + } + }, { + key: 'value', + value: function value(node) { + return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN + } + }]); + + return IdentAttributor; +}(_parchment2.default.Attributor.Class); + +var IndentClass = new IdentAttributor('indent', 'ql-indent', { + scope: _parchment2.default.Scope.BLOCK, + whitelist: [1, 2, 3, 4, 5, 6, 7, 8] +}); + +exports.IndentClass = IndentClass; + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Blockquote = function (_Block) { + _inherits(Blockquote, _Block); + + function Blockquote() { + _classCallCheck(this, Blockquote); + + return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments)); + } + + return Blockquote; +}(_block2.default); + +Blockquote.blotName = 'blockquote'; +Blockquote.tagName = 'blockquote'; + +exports.default = Blockquote; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Header = function (_Block) { + _inherits(Header, _Block); + + function Header() { + _classCallCheck(this, Header); + + return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments)); + } + + _createClass(Header, null, [{ + key: 'formats', + value: function formats(domNode) { + return this.tagName.indexOf(domNode.tagName) + 1; + } + }]); + + return Header; +}(_block2.default); + +Header.blotName = 'header'; +Header.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6']; + +exports.default = Header; + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.ListItem = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _block = __webpack_require__(4); + +var _block2 = _interopRequireDefault(_block); + +var _container = __webpack_require__(24); + +var _container2 = _interopRequireDefault(_container); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ListItem = function (_Block) { + _inherits(ListItem, _Block); + + function ListItem() { + _classCallCheck(this, ListItem); + + return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments)); + } + + _createClass(ListItem, [{ + key: 'format', + value: function format(name, value) { + if (name === List.blotName && !value) { + this.replaceWith(_parchment2.default.create(this.statics.scope)); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value); + } + } + }, { + key: 'remove', + value: function remove() { + if (this.prev == null && this.next == null) { + this.parent.remove(); + } else { + _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this); + } + } + }, { + key: 'replaceWith', + value: function replaceWith(name, value) { + this.parent.isolate(this.offset(this.parent), this.length()); + if (name === this.parent.statics.blotName) { + this.parent.replaceWith(name, value); + return this; + } else { + this.parent.unwrap(); + return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value); + } + } + }], [{ + key: 'formats', + value: function formats(domNode) { + return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode); + } + }]); + + return ListItem; +}(_block2.default); + +ListItem.blotName = 'list-item'; +ListItem.tagName = 'LI'; + +var List = function (_Container) { + _inherits(List, _Container); + + _createClass(List, null, [{ + key: 'create', + value: function create(value) { + var tagName = value === 'ordered' ? 'OL' : 'UL'; + var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName); + if (value === 'checked' || value === 'unchecked') { + node.setAttribute('data-checked', value === 'checked'); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'OL') return 'ordered'; + if (domNode.tagName === 'UL') { + if (domNode.hasAttribute('data-checked')) { + return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked'; + } else { + return 'bullet'; + } + } + return undefined; + } + }]); + + function List(domNode) { + _classCallCheck(this, List); + + var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode)); + + var listEventHandler = function listEventHandler(e) { + if (e.target.parentNode !== domNode) return; + var format = _this2.statics.formats(domNode); + var blot = _parchment2.default.find(e.target); + if (format === 'checked') { + blot.format('list', 'unchecked'); + } else if (format === 'unchecked') { + blot.format('list', 'checked'); + } + }; + + domNode.addEventListener('touchstart', listEventHandler); + domNode.addEventListener('mousedown', listEventHandler); + return _this2; + } + + _createClass(List, [{ + key: 'format', + value: function format(name, value) { + if (this.children.length > 0) { + this.children.tail.format(name, value); + } + } + }, { + key: 'formats', + value: function formats() { + // We don't inherit from FormatBlot + return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode)); + } + }, { + key: 'insertBefore', + value: function insertBefore(blot, ref) { + if (blot instanceof ListItem) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref); + } else { + var index = ref == null ? this.length() : ref.offset(this); + var after = this.split(index); + after.parent.insertBefore(blot, after); + } + } + }, { + key: 'optimize', + value: function optimize(context) { + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context); + var next = this.next; + if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) { + next.moveChildren(this); + next.remove(); + } + } + }, { + key: 'replace', + value: function replace(target) { + if (target.statics.blotName !== this.statics.blotName) { + var item = _parchment2.default.create(this.statics.defaultChild); + target.moveChildren(item); + this.appendChild(item); + } + _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target); + } + }]); + + return List; +}(_container2.default); + +List.blotName = 'list'; +List.scope = _parchment2.default.Scope.BLOCK_BLOT; +List.tagName = ['OL', 'UL']; +List.defaultChild = 'list-item'; +List.allowedChildren = [ListItem]; + +exports.ListItem = ListItem; +exports.default = List; + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _bold = __webpack_require__(56); + +var _bold2 = _interopRequireDefault(_bold); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Italic = function (_Bold) { + _inherits(Italic, _Bold); + + function Italic() { + _classCallCheck(this, Italic); + + return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments)); + } + + return Italic; +}(_bold2.default); + +Italic.blotName = 'italic'; +Italic.tagName = ['EM', 'I']; + +exports.default = Italic; + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Script = function (_Inline) { + _inherits(Script, _Inline); + + function Script() { + _classCallCheck(this, Script); + + return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments)); + } + + _createClass(Script, null, [{ + key: 'create', + value: function create(value) { + if (value === 'super') { + return document.createElement('sup'); + } else if (value === 'sub') { + return document.createElement('sub'); + } else { + return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value); + } + } + }, { + key: 'formats', + value: function formats(domNode) { + if (domNode.tagName === 'SUB') return 'sub'; + if (domNode.tagName === 'SUP') return 'super'; + return undefined; + } + }]); + + return Script; +}(_inline2.default); + +Script.blotName = 'script'; +Script.tagName = ['SUB', 'SUP']; + +exports.default = Script; + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Strike = function (_Inline) { + _inherits(Strike, _Inline); + + function Strike() { + _classCallCheck(this, Strike); + + return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments)); + } + + return Strike; +}(_inline2.default); + +Strike.blotName = 'strike'; +Strike.tagName = 'S'; + +exports.default = Strike; + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _inline = __webpack_require__(6); + +var _inline2 = _interopRequireDefault(_inline); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var Underline = function (_Inline) { + _inherits(Underline, _Inline); + + function Underline() { + _classCallCheck(this, Underline); + + return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments)); + } + + return Underline; +}(_inline2.default); + +Underline.blotName = 'underline'; +Underline.tagName = 'U'; + +exports.default = Underline; + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _link = __webpack_require__(26); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ATTRIBUTES = ['alt', 'height', 'width']; + +var Image = function (_Parchment$Embed) { + _inherits(Image, _Parchment$Embed); + + function Image() { + _classCallCheck(this, Image); + + return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments)); + } + + _createClass(Image, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value); + if (typeof value === 'string') { + node.setAttribute('src', this.sanitize(value)); + } + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'match', + value: function match(url) { + return (/\.(jpe?g|gif|png)$/.test(url) || /^data:image\/.+;base64/.test(url) + ); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0'; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Image; +}(_parchment2.default.Embed); + +Image.blotName = 'image'; +Image.tagName = 'IMG'; + +exports.default = Image; + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _block = __webpack_require__(4); + +var _link = __webpack_require__(26); + +var _link2 = _interopRequireDefault(_link); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var ATTRIBUTES = ['height', 'width']; + +var Video = function (_BlockEmbed) { + _inherits(Video, _BlockEmbed); + + function Video() { + _classCallCheck(this, Video); + + return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments)); + } + + _createClass(Video, [{ + key: 'format', + value: function format(name, value) { + if (ATTRIBUTES.indexOf(name) > -1) { + if (value) { + this.domNode.setAttribute(name, value); + } else { + this.domNode.removeAttribute(name); + } + } else { + _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value); + } + } + }], [{ + key: 'create', + value: function create(value) { + var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value); + node.setAttribute('frameborder', '0'); + node.setAttribute('allowfullscreen', true); + node.setAttribute('src', this.sanitize(value)); + return node; + } + }, { + key: 'formats', + value: function formats(domNode) { + return ATTRIBUTES.reduce(function (formats, attribute) { + if (domNode.hasAttribute(attribute)) { + formats[attribute] = domNode.getAttribute(attribute); + } + return formats; + }, {}); + } + }, { + key: 'sanitize', + value: function sanitize(url) { + return _link2.default.sanitize(url); + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('src'); + } + }]); + + return Video; +}(_block.BlockEmbed); + +Video.blotName = 'video'; +Video.className = 'ql-video'; +Video.tagName = 'IFRAME'; + +exports.default = Video; + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.FormulaBlot = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _embed = __webpack_require__(35); + +var _embed2 = _interopRequireDefault(_embed); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var FormulaBlot = function (_Embed) { + _inherits(FormulaBlot, _Embed); + + function FormulaBlot() { + _classCallCheck(this, FormulaBlot); + + return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments)); + } + + _createClass(FormulaBlot, null, [{ + key: 'create', + value: function create(value) { + var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value); + if (typeof value === 'string') { + window.katex.render(value, node, { + throwOnError: false, + errorColor: '#f00' + }); + node.setAttribute('data-value', value); + } + return node; + } + }, { + key: 'value', + value: function value(domNode) { + return domNode.getAttribute('data-value'); + } + }]); + + return FormulaBlot; +}(_embed2.default); + +FormulaBlot.blotName = 'formula'; +FormulaBlot.className = 'ql-formula'; +FormulaBlot.tagName = 'SPAN'; + +var Formula = function (_Module) { + _inherits(Formula, _Module); + + _createClass(Formula, null, [{ + key: 'register', + value: function register() { + _quill2.default.register(FormulaBlot, true); + } + }]); + + function Formula() { + _classCallCheck(this, Formula); + + var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this)); + + if (window.katex == null) { + throw new Error('Formula module requires KaTeX.'); + } + return _this2; + } + + return Formula; +}(_module2.default); + +exports.FormulaBlot = FormulaBlot; +exports.default = Formula; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.CodeToken = exports.CodeBlock = undefined; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _parchment = __webpack_require__(0); + +var _parchment2 = _interopRequireDefault(_parchment); + +var _quill = __webpack_require__(5); + +var _quill2 = _interopRequireDefault(_quill); + +var _module = __webpack_require__(9); + +var _module2 = _interopRequireDefault(_module); + +var _code = __webpack_require__(13); + +var _code2 = _interopRequireDefault(_code); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var SyntaxCodeBlock = function (_CodeBlock) { + _inherits(SyntaxCodeBlock, _CodeBlock); + + function SyntaxCodeBlock() { + _classCallCheck(this, SyntaxCodeBlock); + + return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments)); + } + + _createClass(SyntaxCodeBlock, [{ + key: 'replaceWith', + value: function replaceWith(block) { + this.domNode.textContent = this.domNode.textContent; + this.attach(); + _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block); + } + }, { + key: 'highlight', + value: function highlight(_highlight) { + var text = this.domNode.textContent; + if (this.cachedText !== text) { + if (text.trim().length > 0 || this.cachedText == null) { + this.domNode.innerHTML = _highlight(text); + this.domNode.normalize(); + this.attach(); + } + this.cachedText = text; + } + } + }]); + + return SyntaxCodeBlock; +}(_code2.default); + +SyntaxCodeBlock.className = 'ql-syntax'; + +var CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', { + scope: _parchment2.default.Scope.INLINE +}); + +var Syntax = function (_Module) { + _inherits(Syntax, _Module); + + _createClass(Syntax, null, [{ + key: 'register', + value: function register() { + _quill2.default.register(CodeToken, true); + _quill2.default.register(SyntaxCodeBlock, true); + } + }]); + + function Syntax(quill, options) { + _classCallCheck(this, Syntax); + + var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options)); + + if (typeof _this2.options.highlight !== 'function') { + throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.'); + } + var timer = null; + _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () { + clearTimeout(timer); + timer = setTimeout(function () { + _this2.highlight(); + timer = null; + }, _this2.options.interval); + }); + _this2.highlight(); + return _this2; + } + + _createClass(Syntax, [{ + key: 'highlight', + value: function highlight() { + var _this3 = this; + + if (this.quill.selection.composing) return; + this.quill.update(_quill2.default.sources.USER); + var range = this.quill.getSelection(); + this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) { + code.highlight(_this3.options.highlight); + }); + this.quill.update(_quill2.default.sources.SILENT); + if (range != null) { + this.quill.setSelection(range, _quill2.default.sources.SILENT); + } + } + }]); + + return Syntax; +}(_module2.default); + +Syntax.DEFAULTS = { + highlight: function () { + if (window.hljs == null) return null; + return function (text) { + var result = window.hljs.highlightAuto(text); + return result.value; + }; + }(), + interval: 1000 +}; + +exports.CodeBlock = SyntaxCodeBlock; +exports.CodeToken = CodeToken; +exports.default = Syntax; + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 77 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 78 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 79 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 80 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 81 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 82 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 83 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 84 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 87 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 88 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 89 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 91 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 92 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 93 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 95 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 97 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 98 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 99 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 100 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 101 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 102 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 103 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 104 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 105 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 106 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 107 */ +/***/ (function(module, exports) { + +module.exports = " "; + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = exports.BubbleTooltip = undefined; + +var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _extend = __webpack_require__(3); + +var _extend2 = _interopRequireDefault(_extend); + +var _emitter = __webpack_require__(8); + +var _emitter2 = _interopRequireDefault(_emitter); + +var _base = __webpack_require__(43); + +var _base2 = _interopRequireDefault(_base); + +var _selection = __webpack_require__(15); + +var _icons = __webpack_require__(41); + +var _icons2 = _interopRequireDefault(_icons); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + +var TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']]; + +var BubbleTheme = function (_BaseTheme) { + _inherits(BubbleTheme, _BaseTheme); + + function BubbleTheme(quill, options) { + _classCallCheck(this, BubbleTheme); + + if (options.modules.toolbar != null && options.modules.toolbar.container == null) { + options.modules.toolbar.container = TOOLBAR_CONFIG; + } + + var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options)); + + _this.quill.container.classList.add('ql-bubble'); + return _this; + } + + _createClass(BubbleTheme, [{ + key: 'extendToolbar', + value: function extendToolbar(toolbar) { + this.tooltip = new BubbleTooltip(this.quill, this.options.bounds); + this.tooltip.root.appendChild(toolbar.container); + this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default); + this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default); + } + }]); + + return BubbleTheme; +}(_base2.default); + +BubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, { + modules: { + toolbar: { + handlers: { + link: function link(value) { + if (!value) { + this.quill.format('link', false); + } else { + this.quill.theme.tooltip.edit(); + } + } + } + } + } +}); + +var BubbleTooltip = function (_BaseTooltip) { + _inherits(BubbleTooltip, _BaseTooltip); + + function BubbleTooltip(quill, bounds) { + _classCallCheck(this, BubbleTooltip); + + var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds)); + + _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) { + if (type !== _emitter2.default.events.SELECTION_CHANGE) return; + if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) { + _this2.show(); + // Lock our width so we will expand beyond our offsetParent boundaries + _this2.root.style.left = '0px'; + _this2.root.style.width = ''; + _this2.root.style.width = _this2.root.offsetWidth + 'px'; + var lines = _this2.quill.getLines(range.index, range.length); + if (lines.length === 1) { + _this2.position(_this2.quill.getBounds(range)); + } else { + var lastLine = lines[lines.length - 1]; + var index = _this2.quill.getIndex(lastLine); + var length = Math.min(lastLine.length() - 1, range.index + range.length - index); + var _bounds = _this2.quill.getBounds(new _selection.Range(index, length)); + _this2.position(_bounds); + } + } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) { + _this2.hide(); + } + }); + return _this2; + } + + _createClass(BubbleTooltip, [{ + key: 'listen', + value: function listen() { + var _this3 = this; + + _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this); + this.root.querySelector('.ql-close').addEventListener('click', function () { + _this3.root.classList.remove('ql-editing'); + }); + this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () { + // Let selection be restored by toolbar handlers before repositioning + setTimeout(function () { + if (_this3.root.classList.contains('ql-hidden')) return; + var range = _this3.quill.getSelection(); + if (range != null) { + _this3.position(_this3.quill.getBounds(range)); + } + }, 1); + }); + } + }, { + key: 'cancel', + value: function cancel() { + this.show(); + } + }, { + key: 'position', + value: function position(reference) { + var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference); + var arrow = this.root.querySelector('.ql-tooltip-arrow'); + arrow.style.marginLeft = ''; + if (shift === 0) return shift; + arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px'; + } + }]); + + return BubbleTooltip; +}(_base.BaseTooltip); + +BubbleTooltip.TEMPLATE = ['', '
', '', '', '
'].join(''); + +exports.BubbleTooltip = BubbleTooltip; +exports.default = BubbleTheme; + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = __webpack_require__(63); + + +/***/ }) +/******/ ])["default"]; +}); \ No newline at end of file diff --git a/static/quill/quill.min.js b/static/quill/quill.min.js new file mode 100644 index 00000000..673c69cf --- /dev/null +++ b/static/quill/quill.min.js @@ -0,0 +1,8 @@ +/*! + * Quill Editor v1.3.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Quill=e():t.Quill=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=45)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),o=n(18),i=n(19),l=n(48),a=n(49),s=n(50),u=n(51),c=n(52),f=n(11),h=n(28),p=n(29),d=n(27),y=n(1),v={Scope:y.Scope,create:y.create,find:y.find,query:y.query,register:y.register,Container:r.default,Format:o.default,Leaf:i.default,Embed:u.default,Scroll:l.default,Block:s.default,Inline:a.default,Text:c.default,Attributor:{Attribute:f.default,Class:h.default,Style:p.default,Store:d.default}};e.default=v},function(t,e,n){"use strict";function r(t,e){var n=i(t);if(null==n)throw new s("Unable to create "+t+" blot");var r=n;return new r(t instanceof Node||t.nodeType===Node.TEXT_NODE?t:r.create(e),e)}function o(t,n){return void 0===n&&(n=!1),null==t?null:null!=t[e.DATA_KEY]?t[e.DATA_KEY].blot:n?o(t.parentNode,n):null}function i(t,e){void 0===e&&(e=p.ANY);var n;if("string"==typeof t)n=h[t]||u[t];else if(t instanceof Text||t.nodeType===Node.TEXT_NODE)n=h.text;else if("number"==typeof t)t&p.LEVEL&p.BLOCK?n=h.block:t&p.LEVEL&p.INLINE&&(n=h.inline);else if(t instanceof HTMLElement){var r=(t.getAttribute("class")||"").split(/\s+/);for(var o in r)if(n=c[r[o]])break;n=n||f[t.tagName]}return null==n?null:e&p.LEVEL&n.scope&&e&p.TYPE&n.scope?n:null}function l(){for(var t=[],e=0;e1)return t.map(function(t){return l(t)});var n=t[0];if("string"!=typeof n.blotName&&"string"!=typeof n.attrName)throw new s("Invalid definition");if("abstract"===n.blotName)throw new s("Cannot register abstract class");if(h[n.blotName||n.attrName]=n,"string"==typeof n.keyName)u[n.keyName]=n;else if(null!=n.className&&(c[n.className]=n),null!=n.tagName){Array.isArray(n.tagName)?n.tagName=n.tagName.map(function(t){return t.toUpperCase()}):n.tagName=n.tagName.toUpperCase();var r=Array.isArray(n.tagName)?n.tagName:[n.tagName];r.forEach(function(t){null!=f[t]&&null!=n.className||(f[t]=n)})}return n}var a=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var s=function(t){function e(e){var n=this;return e="[Parchment] "+e,n=t.call(this,e)||this,n.message=e,n.name=n.constructor.name,n}return a(e,t),e}(Error);e.ParchmentError=s;var u={},c={},f={},h={};e.DATA_KEY="__blot";var p;!function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(p=e.Scope||(e.Scope={})),e.create=r,e.find=o,e.query=i,e.register=l},function(t,e){"use strict";var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,o=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===r.call(t)},i=function(t){if(!t||"[object Object]"!==r.call(t))return!1;var e=n.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!e&&!o)return!1;var i;for(i in t);return void 0===i||n.call(t,i)};t.exports=function t(){var e,n,r,l,a,s,u=arguments[0],c=1,f=arguments.length,h=!1;for("boolean"==typeof u&&(h=u,u=arguments[1]||{},c=2),(null==u||"object"!=typeof u&&"function"!=typeof u)&&(u={});c1&&void 0!==arguments[1]?arguments[1]:{};return null==t?e:("function"==typeof t.formats&&(e=(0,f.default)(e,t.formats())),null==t.parent||"scroll"==t.parent.blotName||t.parent.statics.scope!==t.statics.scope?e:a(t.parent,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BlockEmbed=e.bubbleFormats=void 0;var s=function(){function t(t,e){for(var n=0;n0&&(t1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===t||t>=this.length()-1)){var r=this.clone();return 0===t?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"split",this).call(this,t,n);return this.cache={},o}}]),e}(y.default.Block);x.blotName="block",x.tagName="P",x.defaultChild="break",x.allowedChildren=[m.default,y.default.Embed,O.default],e.bubbleFormats=a,e.BlockEmbed=w,e.default=x},function(t,e,n){var r=n(54),o=n(12),i=n(2),l=n(20),a=String.fromCharCode(0),s=function(t){Array.isArray(t)?this.ops=t:null!=t&&Array.isArray(t.ops)?this.ops=t.ops:this.ops=[]};s.prototype.insert=function(t,e){var n={};return 0===t.length?this:(n.insert=t,null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n))},s.prototype.delete=function(t){return t<=0?this:this.push({delete:t})},s.prototype.retain=function(t,e){if(t<=0)return this;var n={retain:t};return null!=e&&"object"==typeof e&&Object.keys(e).length>0&&(n.attributes=e),this.push(n)},s.prototype.push=function(t){var e=this.ops.length,n=this.ops[e-1];if(t=i(!0,{},t),"object"==typeof n){if("number"==typeof t.delete&&"number"==typeof n.delete)return this.ops[e-1]={delete:n.delete+t.delete},this;if("number"==typeof n.delete&&null!=t.insert&&(e-=1,"object"!=typeof(n=this.ops[e-1])))return this.ops.unshift(t),this;if(o(t.attributes,n.attributes)){if("string"==typeof t.insert&&"string"==typeof n.insert)return this.ops[e-1]={insert:n.insert+t.insert},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this;if("number"==typeof t.retain&&"number"==typeof n.retain)return this.ops[e-1]={retain:n.retain+t.retain},"object"==typeof t.attributes&&(this.ops[e-1].attributes=t.attributes),this}}return e===this.ops.length?this.ops.push(t):this.ops.splice(e,0,t),this},s.prototype.chop=function(){var t=this.ops[this.ops.length-1];return t&&t.retain&&!t.attributes&&this.ops.pop(),this},s.prototype.filter=function(t){return this.ops.filter(t)},s.prototype.forEach=function(t){this.ops.forEach(t)},s.prototype.map=function(t){return this.ops.map(t)},s.prototype.partition=function(t){var e=[],n=[];return this.forEach(function(r){(t(r)?e:n).push(r)}),[e,n]},s.prototype.reduce=function(t,e){return this.ops.reduce(t,e)},s.prototype.changeLength=function(){return this.reduce(function(t,e){return e.insert?t+l.length(e):e.delete?t-e.delete:t},0)},s.prototype.length=function(){return this.reduce(function(t,e){return t+l.length(e)},0)},s.prototype.slice=function(t,e){t=t||0,"number"!=typeof e&&(e=1/0);for(var n=[],r=l.iterator(this.ops),o=0;o0&&(e.push(t.ops[0]),e.ops=e.ops.concat(t.ops.slice(1))),e},s.prototype.diff=function(t,e){if(this.ops===t.ops)return new s;var n=[this,t].map(function(e){return e.map(function(n){if(null!=n.insert)return"string"==typeof n.insert?n.insert:a;var r=e===t?"on":"with";throw new Error("diff() called "+r+" non-document")}).join("")}),i=new s,u=r(n[0],n[1],e),c=l.iterator(this.ops),f=l.iterator(t.ops);return u.forEach(function(t){for(var e=t[1].length;e>0;){var n=0;switch(t[0]){case r.INSERT:n=Math.min(f.peekLength(),e),i.push(f.next(n));break;case r.DELETE:n=Math.min(e,c.peekLength()),c.next(n),i.delete(n);break;case r.EQUAL:n=Math.min(c.peekLength(),f.peekLength(),e);var a=c.next(n),s=f.next(n);o(a.insert,s.insert)?i.retain(n,l.attributes.diff(a.attributes,s.attributes)):i.push(s).delete(n)}e-=n}}),i.chop()},s.prototype.eachLine=function(t,e){e=e||"\n";for(var n=l.iterator(this.ops),r=new s,o=0;n.hasNext();){if("insert"!==n.peekType())return;var i=n.peek(),a=l.length(i)-n.peekLength(),u="string"==typeof i.insert?i.insert.indexOf(e,a)-a:-1;if(u<0)r.push(n.next());else if(u>0)r.push(n.next(u));else{if(!1===t(r,n.next(1).attributes||{},o))return;o+=1,r=new s}}r.length()>0&&t(r,{},o)},s.prototype.transform=function(t,e){if(e=!!e,"number"==typeof t)return this.transformPosition(t,e);for(var n=l.iterator(this.ops),r=l.iterator(t.ops),o=new s;n.hasNext()||r.hasNext();)if("insert"!==n.peekType()||!e&&"insert"===r.peekType())if("insert"===r.peekType())o.push(r.next());else{var i=Math.min(n.peekLength(),r.peekLength()),a=n.next(i),u=r.next(i);if(a.delete)continue;u.delete?o.push(u):o.retain(i,l.attributes.transform(a.attributes,u.attributes,e))}else o.retain(l.length(n.next()));return o.chop()},s.prototype.transformPosition=function(t,e){e=!!e;for(var n=l.iterator(this.ops),r=0;n.hasNext()&&r<=t;){var o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}],[{key:"compare",value:function(t,n){var r=e.order.indexOf(t),o=e.order.indexOf(n);return r>=0||o>=0?r-o:t===n?0:t0){var a,s=[g.default.events.TEXT_CHANGE,l,i,e];if((a=this.emitter).emit.apply(a,[g.default.events.EDITOR_CHANGE].concat(s)),e!==g.default.sources.SILENT){var c;(c=this.emitter).emit.apply(c,s)}}return l}function s(t,e,n,r,o){var i={};return"number"==typeof t.index&&"number"==typeof t.length?"number"!=typeof e?(o=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):"number"!=typeof e&&(o=r,r=n,n=e,e=0),"object"===(void 0===n?"undefined":c(n))?(i=n,o=r):"string"==typeof n&&(null!=r?i[n]=r:o=n),o=o||g.default.sources.API,[t,e,i,o]}function u(t,e,n,r){if(null==t)return null;var o=void 0,i=void 0;if(e instanceof d.default){var l=[t.index,t.index+t.length].map(function(t){return e.transformPosition(t,r!==g.default.sources.USER)}),a=f(l,2);o=a[0],i=a[1]}else{var s=[t.index,t.index+t.length].map(function(t){return t=0?t+n:Math.max(e,t+n)}),u=f(s,2);o=u[0],i=u[1]}return new x.Range(o,i-o)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.overload=e.expandConfig=void 0;var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{};if(i(this,t),this.options=l(e,r),this.container=this.options.container,null==this.container)return S.error("Invalid Quill container",e);this.options.debug&&t.debug(this.options.debug);var o=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",this.container.__quill=this,this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.root.setAttribute("data-gramm",!1),this.scrollingContainer=this.options.scrollingContainer||this.root,this.emitter=new g.default,this.scroll=w.default.create(this.root,{emitter:this.emitter,whitelist:this.options.formats}),this.editor=new v.default(this.scroll),this.selection=new k.default(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.theme.init(),this.emitter.on(g.default.events.EDITOR_CHANGE,function(t){t===g.default.events.TEXT_CHANGE&&n.root.classList.toggle("ql-blank",n.editor.isBlank())}),this.emitter.on(g.default.events.SCROLL_UPDATE,function(t,e){var r=n.selection.lastRange,o=r&&0===r.length?r.index:void 0;a.call(n,function(){return n.editor.update(null,e,o)},t)});var s=this.clipboard.convert("
"+o+"


");this.setContents(s),this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable()}return h(t,null,[{key:"debug",value:function(t){!0===t&&(t="log"),A.default.level(t)}},{key:"find",value:function(t){return t.__quill||w.default.find(t)}},{key:"import",value:function(t){return null==this.imports[t]&&S.error("Cannot import "+t+". Are you sure it was registered?"),this.imports[t]}},{key:"register",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof t){var o=t.attrName||t.blotName;"string"==typeof o?this.register("formats/"+o,t,e):Object.keys(t).forEach(function(r){n.register(r,t[r],e)})}else null==this.imports[t]||r||S.warn("Overwriting "+t+" with",e),this.imports[t]=e,(t.startsWith("blots/")||t.startsWith("formats/"))&&"abstract"!==e.blotName?w.default.register(e):t.startsWith("modules")&&"function"==typeof e.register&&e.register()}}]),h(t,[{key:"addContainer",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof t){var n=t;t=document.createElement("div"),t.classList.add(n)}return this.container.insertBefore(t,e),t}},{key:"blur",value:function(){this.selection.setRange(null)}},{key:"deleteText",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.deleteText(t,e)},n,t,-1*e)}},{key:"disable",value:function(){this.enable(!1)}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.scroll.enable(t),this.container.classList.toggle("ql-disabled",!t)}},{key:"focus",value:function(){var t=this.scrollingContainer.scrollTop;this.selection.focus(),this.scrollingContainer.scrollTop=t,this.scrollIntoView()}},{key:"format",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:g.default.sources.API;return a.call(this,function(){var r=n.getSelection(!0),i=new d.default;if(null==r)return i;if(w.default.query(t,w.default.Scope.BLOCK))i=n.editor.formatLine(r.index,r.length,o({},t,e));else{if(0===r.length)return n.selection.format(t,e),i;i=n.editor.formatText(r.index,r.length,o({},t,e))}return n.setSelection(r,g.default.sources.SILENT),i},r)}},{key:"formatLine",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatLine(t,e,l)},o,t,0)}},{key:"formatText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,e,n,r,o),c=f(u,4);return t=c[0],e=c[1],l=c[2],o=c[3],a.call(this,function(){return i.editor.formatText(t,e,l)},o,t,0)}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=void 0;n="number"==typeof t?this.selection.getBounds(t,e):this.selection.getBounds(t.index,t.length);var r=this.container.getBoundingClientRect();return{bottom:n.bottom-r.top,height:n.height,left:n.left-r.left,right:n.right-r.left,top:n.top-r.top,width:n.width}}},{key:"getContents",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getContents(t,e)}},{key:"getFormat",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.getSelection(!0),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"number"==typeof t?this.editor.getFormat(t,e):this.editor.getFormat(t.index,t.length)}},{key:"getIndex",value:function(t){return t.offset(this.scroll)}},{key:"getLength",value:function(){return this.scroll.length()}},{key:"getLeaf",value:function(t){return this.scroll.leaf(t)}},{key:"getLine",value:function(t){return this.scroll.line(t)}},{key:"getLines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return"number"!=typeof t?this.scroll.lines(t.index,t.length):this.scroll.lines(t,e)}},{key:"getModule",value:function(t){return this.theme.modules[t]}},{key:"getSelection",value:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&this.focus(),this.update(),this.selection.getRange()[0]}},{key:"getText",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getLength()-t,n=s(t,e),r=f(n,2);return t=r[0],e=r[1],this.editor.getText(t,e)}},{key:"hasFocus",value:function(){return this.selection.hasFocus()}},{key:"insertEmbed",value:function(e,n,r){var o=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.sources.API;return a.call(this,function(){return o.editor.insertEmbed(e,n,r)},i,e)}},{key:"insertText",value:function(t,e,n,r,o){var i=this,l=void 0,u=s(t,0,n,r,o),c=f(u,4);return t=c[0],l=c[2],o=c[3],a.call(this,function(){return i.editor.insertText(t,e,l)},o,t,e.length)}},{key:"isEnabled",value:function(){return!this.container.classList.contains("ql-disabled")}},{key:"off",value:function(){return this.emitter.off.apply(this.emitter,arguments)}},{key:"on",value:function(){return this.emitter.on.apply(this.emitter,arguments)}},{key:"once",value:function(){return this.emitter.once.apply(this.emitter,arguments)}},{key:"pasteHTML",value:function(t,e,n){this.clipboard.dangerouslyPasteHTML(t,e,n)}},{key:"removeFormat",value:function(t,e,n){var r=this,o=s(t,e,n),i=f(o,4);return t=i[0],e=i[1],n=i[3],a.call(this,function(){return r.editor.removeFormat(t,e)},n,t)}},{key:"scrollIntoView",value:function(){this.selection.scrollIntoView(this.scrollingContainer)}},{key:"setContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){t=new d.default(t);var n=e.getLength(),r=e.editor.deleteText(0,n),o=e.editor.applyDelta(t),i=o.ops[o.ops.length-1];return null!=i&&"string"==typeof i.insert&&"\n"===i.insert[i.insert.length-1]&&(e.editor.deleteText(e.getLength()-1,1),o.delete(1)),r.compose(o)},n)}},{key:"setSelection",value:function(e,n,r){if(null==e)this.selection.setRange(null,n||t.sources.API);else{var o=s(e,n,r),i=f(o,4);e=i[0],n=i[1],r=i[3],this.selection.setRange(new x.Range(e,n),r),r!==g.default.sources.SILENT&&this.selection.scrollIntoView(this.scrollingContainer)}}},{key:"setText",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API,n=(new d.default).insert(t);return this.setContents(n,e)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:g.default.sources.USER,e=this.scroll.update(t);return this.selection.update(t),e}},{key:"updateContents",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g.default.sources.API;return a.call(this,function(){return t=new d.default(t),e.editor.applyDelta(t,n)},n,!0)}}]),t}();P.DEFAULTS={bounds:null,formats:null,modules:{},placeholder:"",readOnly:!1,scrollingContainer:null,strict:!0,theme:"default"},P.events=g.default.events,P.sources=g.default.sources,P.version="1.3.5",P.imports={delta:d.default,parchment:w.default,"core/module":_.default,"core/theme":T.default},e.expandConfig=l,e.overload=s,e.default=P},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r(this,t),this.quill=e,this.options=n};o.DEFAULTS={},e.default=o},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(0),a=function(t){return t&&t.__esModule?t:{default:t}}(l),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),e}(a.default.Text);e.default=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n1?e-1:0),r=1;r1?n-1:0),o=1;o-1:this.whitelist.indexOf(e)>-1))},t.prototype.remove=function(t){t.removeAttribute(this.keyName)},t.prototype.value=function(t){var e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""},t}();e.default=o},function(t,e,n){function r(t){return null===t||void 0===t}function o(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(t.length>0&&"number"!=typeof t[0]))}function i(t,e,n){var i,c;if(r(t)||r(e))return!1;if(t.prototype!==e.prototype)return!1;if(s(t))return!!s(e)&&(t=l.call(t),e=l.call(e),u(t,e,n));if(o(t)){if(!o(e))return!1;if(t.length!==e.length)return!1;for(i=0;i=0;i--)if(f[i]!=h[i])return!1;for(i=f.length-1;i>=0;i--)if(c=f[i],!u(t[c],e[c],n))return!1;return typeof t==typeof e}var l=Array.prototype.slice,a=n(55),s=n(56),u=t.exports=function(t,e,n){return n||(n={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?n.strict?t===e:t==e:i(t,e,n))}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Code=void 0;var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function(){function t(t,e){for(var n=0;n=t+n)){var l=this.newlineIndex(t,!0)+1,a=i-l+1,s=this.isolate(l,a),u=s.next;s.format(r,o),u instanceof e&&u.formatAt(0,t-l+n-a,r,o)}}}},{key:"insertAt",value:function(t,e,n){if(null==n){var r=this.descendant(m.default,t),o=a(r,2),i=o[0],l=o[1];i.insertAt(l,e)}}},{key:"length",value:function(){var t=this.domNode.textContent.length;return this.domNode.textContent.endsWith("\n")?t:t+1}},{key:"newlineIndex",value:function(t){if(arguments.length>1&&void 0!==arguments[1]&&arguments[1])return this.domNode.textContent.slice(0,t).lastIndexOf("\n");var e=this.domNode.textContent.slice(t).indexOf("\n");return e>-1?t+e:-1}},{key:"optimize",value:function(t){this.domNode.textContent.endsWith("\n")||this.appendChild(p.default.create("text","\n")),u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&this.statics.formats(this.domNode)===n.statics.formats(n.domNode)&&(n.optimize(t),n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t),[].slice.call(this.domNode.querySelectorAll("*")).forEach(function(t){var e=p.default.find(t);null==e?t.parentNode.removeChild(t):e instanceof p.default.Embed?e.remove():e.unwrap()})}}],[{key:"create",value:function(t){var n=u(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("spellcheck",!1),n}},{key:"formats",value:function(){return!0}}]),e}(y.default);O.blotName="code-block",O.tagName="PRE",O.TAB=" ",e.Code=_,e.default=O},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1}Object.defineProperty(e,"__esModule",{value:!0}),e.sanitize=e.default=void 0;var a=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=this.container.querySelector(".ql-selected");if(t!==n&&(null!=n&&n.classList.remove("ql-selected"),null!=t&&(t.classList.add("ql-selected"),this.select.selectedIndex=[].indexOf.call(t.parentNode.children,t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),e))){if("function"==typeof Event)this.select.dispatchEvent(new Event("change"));else if("object"===("undefined"==typeof Event?"undefined":o(Event))){var r=document.createEvent("Event");r.initEvent("change",!0,!0),this.select.dispatchEvent(r)}this.close()}}},{key:"update",value:function(){var t=void 0;if(this.select.selectedIndex>-1){var e=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(e)}else this.selectItem(null);var n=null!=t&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}]),t}();e.default=s},function(t,e,n){"use strict";function r(t){var e=a.find(t);if(null==e)try{e=a.create(t)}catch(n){e=a.create(a.Scope.INLINE),[].slice.call(t.childNodes).forEach(function(t){e.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(e.domNode,t),e.attach()}return e}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(47),l=n(26),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.build(),n}return o(e,t),e.prototype.appendChild=function(t){this.insertBefore(t)},e.prototype.attach=function(){t.prototype.attach.call(this),this.children.forEach(function(t){t.attach()})},e.prototype.build=function(){var t=this;this.children=new i.default,[].slice.call(this.domNode.childNodes).reverse().forEach(function(e){try{var n=r(e);t.insertBefore(n,t.children.head||void 0)}catch(t){if(t instanceof a.ParchmentError)return;throw t}})},e.prototype.deleteAt=function(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,function(t,e,n){t.deleteAt(e,n)})},e.prototype.descendant=function(t,n){var r=this.children.find(n),o=r[0],i=r[1];return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,i]:o instanceof e?o.descendant(t,i):[null,-1]},e.prototype.descendants=function(t,n,r){void 0===n&&(n=0),void 0===r&&(r=Number.MAX_VALUE);var o=[],i=r;return this.children.forEachAt(n,r,function(n,r,l){(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&o.push(n),n instanceof e&&(o=o.concat(n.descendants(t,r,i))),i-=l}),o},e.prototype.detach=function(){this.children.forEach(function(t){t.detach()}),t.prototype.detach.call(this)},e.prototype.formatAt=function(t,e,n,r){this.children.forEachAt(t,e,function(t,e,o){t.formatAt(e,o,n,r)})},e.prototype.insertAt=function(t,e,n){var r=this.children.find(t),o=r[0],i=r[1];if(o)o.insertAt(i,e,n);else{var l=null==n?a.create("text",e):a.create(e,n);this.appendChild(l)}},e.prototype.insertBefore=function(t,e){if(null!=this.statics.allowedChildren&&!this.statics.allowedChildren.some(function(e){return t instanceof e}))throw new a.ParchmentError("Cannot insert "+t.statics.blotName+" into "+this.statics.blotName);t.insertInto(this,e)},e.prototype.length=function(){return this.children.reduce(function(t,e){return t+e.length()},0)},e.prototype.moveChildren=function(t,e){this.children.forEach(function(n){t.insertBefore(n,e)})},e.prototype.optimize=function(e){if(t.prototype.optimize.call(this,e),0===this.children.length)if(null!=this.statics.defaultChild){var n=a.create(this.statics.defaultChild);this.appendChild(n),n.optimize(e)}else this.remove()},e.prototype.path=function(t,n){void 0===n&&(n=!1);var r=this.children.find(t,n),o=r[0],i=r[1],l=[[this,t]];return o instanceof e?l.concat(o.path(i,n)):(null!=o&&l.push([o,i]),l)},e.prototype.removeChild=function(t){this.children.remove(t)},e.prototype.replace=function(n){n instanceof e&&n.moveChildren(this),t.prototype.replace.call(this,n)},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=this.clone();return this.parent.insertBefore(n,this.next),this.children.forEachAt(t,this.length(),function(t,r,o){t=t.split(r,e),n.appendChild(t)}),n},e.prototype.unwrap=function(){this.moveChildren(this.parent,this.next),this.remove()},e.prototype.update=function(t,e){var n=this,o=[],i=[];t.forEach(function(t){t.target===n.domNode&&"childList"===t.type&&(o.push.apply(o,t.addedNodes),i.push.apply(i,t.removedNodes))}),i.forEach(function(t){if(!(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)){var e=a.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==n.domNode||e.detach())}}),o.filter(function(t){return t.parentNode==n.domNode}).sort(function(t,e){return t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1}).forEach(function(t){var e=null;null!=t.nextSibling&&(e=a.find(t.nextSibling));var o=r(t);o.next==e&&null!=o.next||(null!=o.parent&&o.parent.removeChild(n),n.insertBefore(o,e||void 0))})},e}(l.default);e.default=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(11),i=n(27),l=n(17),a=n(1),s=function(t){function e(e){var n=t.call(this,e)||this;return n.attributes=new i.default(n.domNode),n}return r(e,t),e.formats=function(t){return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)},e.prototype.format=function(t,e){var n=a.query(t);n instanceof o.default?this.attributes.attribute(n,e):e&&(null==n||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e))},e.prototype.formats=function(){var t=this.attributes.values(),e=this.statics.formats(this.domNode);return null!=e&&(t[this.statics.blotName]=e),t},e.prototype.replaceWith=function(e,n){var r=t.prototype.replaceWith.call(this,e,n);return this.attributes.copy(r),r},e.prototype.update=function(e,n){var r=this;t.prototype.update.call(this,e,n),e.some(function(t){return t.target===r.domNode&&"attributes"===t.type})&&this.attributes.build()},e.prototype.wrap=function(n,r){var o=t.prototype.wrap.call(this,n,r);return o instanceof e&&o.statics.scope===this.statics.scope&&this.attributes.move(o),o},e}(l.default);e.default=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(26),i=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.value=function(t){return!0},e.prototype.index=function(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1},e.prototype.position=function(t,e){var n=[].indexOf.call(this.parent.domNode.childNodes,this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]},e.prototype.value=function(){return t={},t[this.statics.blotName]=this.statics.value(this.domNode)||!0,t;var t},e.scope=i.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){function r(t){this.ops=t,this.index=0,this.offset=0}var o=n(12),i=n(2),l={attributes:{compose:function(t,e,n){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var r=i(!0,{},e);n||(r=Object.keys(r).reduce(function(t,e){return null!=r[e]&&(t[e]=r[e]),t},{}));for(var o in t)void 0!==t[o]&&void 0===e[o]&&(r[o]=t[o]);return Object.keys(r).length>0?r:void 0},diff:function(t,e){"object"!=typeof t&&(t={}),"object"!=typeof e&&(e={});var n=Object.keys(t).concat(Object.keys(e)).reduce(function(n,r){return o(t[r],e[r])||(n[r]=void 0===e[r]?null:e[r]),n},{});return Object.keys(n).length>0?n:void 0},transform:function(t,e,n){if("object"!=typeof t)return e;if("object"==typeof e){if(!n)return e;var r=Object.keys(e).reduce(function(n,r){return void 0===t[r]&&(n[r]=e[r]),n},{});return Object.keys(r).length>0?r:void 0}}},iterator:function(t){return new r(t)},length:function(t){return"number"==typeof t.delete?t.delete:"number"==typeof t.retain?t.retain:"string"==typeof t.insert?t.insert.length:1}};r.prototype.hasNext=function(){return this.peekLength()<1/0},r.prototype.next=function(t){t||(t=1/0);var e=this.ops[this.index];if(e){var n=this.offset,r=l.length(e);if(t>=r-n?(t=r-n,this.index+=1,this.offset=0):this.offset+=t,"number"==typeof e.delete)return{delete:t};var o={};return e.attributes&&(o.attributes=e.attributes),"number"==typeof e.retain?o.retain=t:"string"==typeof e.insert?o.insert=e.insert.substr(n,t):o.insert=e.insert,o}return{retain:1/0}},r.prototype.peek=function(){return this.ops[this.index]},r.prototype.peekLength=function(){return this.ops[this.index]?l.length(this.ops[this.index])-this.offset:1/0},r.prototype.peekType=function(){return this.ops[this.index]?"number"==typeof this.ops[this.index].delete?"delete":"number"==typeof this.ops[this.index].retain?"retain":"insert":"retain"},t.exports=l},function(t,e){var n=function(){"use strict";function t(t,e){return null!=e&&t instanceof e}function e(n,r,o,i,c){function f(n,o){if(null===n)return null;if(0===o)return n;var y,v;if("object"!=typeof n)return n;if(t(n,a))y=new a;else if(t(n,s))y=new s;else if(t(n,u))y=new u(function(t,e){n.then(function(e){t(f(e,o-1))},function(t){e(f(t,o-1))})});else if(e.__isArray(n))y=[];else if(e.__isRegExp(n))y=new RegExp(n.source,l(n)),n.lastIndex&&(y.lastIndex=n.lastIndex);else if(e.__isDate(n))y=new Date(n.getTime());else{if(d&&Buffer.isBuffer(n))return y=new Buffer(n.length),n.copy(y),y;t(n,Error)?y=Object.create(n):void 0===i?(v=Object.getPrototypeOf(n),y=Object.create(v)):(y=Object.create(i),v=i)}if(r){var b=h.indexOf(n);if(-1!=b)return p[b];h.push(n),p.push(y)}t(n,a)&&n.forEach(function(t,e){var n=f(e,o-1),r=f(t,o-1);y.set(n,r)}),t(n,s)&&n.forEach(function(t){var e=f(t,o-1);y.add(e)});for(var g in n){var m;v&&(m=Object.getOwnPropertyDescriptor(v,g)),m&&null==m.set||(y[g]=f(n[g],o-1))}if(Object.getOwnPropertySymbols)for(var _=Object.getOwnPropertySymbols(n),g=0;g<_.length;g++){var O=_[g],w=Object.getOwnPropertyDescriptor(n,O);(!w||w.enumerable||c)&&(y[O]=f(n[O],o-1),w.enumerable||Object.defineProperty(y,O,{enumerable:!1}))}if(c)for(var x=Object.getOwnPropertyNames(n),g=0;g1&&void 0!==arguments[1]?arguments[1]:0;i(this,t),this.index=e,this.length=n},O=function(){function t(e,n){var r=this;i(this,t),this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=c.default.create("cursor",this),this.lastRange=this.savedRange=new _(0,0),this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,function(){r.mouseDown||setTimeout(r.update.bind(r,v.default.sources.USER),1)}),this.emitter.on(v.default.events.EDITOR_CHANGE,function(t,e){t===v.default.events.TEXT_CHANGE&&e.length()>0&&r.update(v.default.sources.SILENT)}),this.emitter.on(v.default.events.SCROLL_BEFORE_UPDATE,function(){if(r.hasFocus()){var t=r.getNativeRange();null!=t&&t.start.node!==r.cursor.textNode&&r.emitter.once(v.default.events.SCROLL_UPDATE,function(){try{r.setNativeRange(t.start.node,t.start.offset,t.end.node,t.end.offset)}catch(t){}})}}),this.emitter.on(v.default.events.SCROLL_OPTIMIZE,function(t,e){if(e.range){var n=e.range,o=n.startNode,i=n.startOffset,l=n.endNode,a=n.endOffset;r.setNativeRange(o,i,l,a)}}),this.update(v.default.sources.SILENT)}return s(t,[{key:"handleComposition",value:function(){var t=this;this.root.addEventListener("compositionstart",function(){t.composing=!0}),this.root.addEventListener("compositionend",function(){if(t.composing=!1,t.cursor.parent){var e=t.cursor.restore();if(!e)return;setTimeout(function(){t.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}},{key:"handleDragging",value:function(){var t=this;this.emitter.listenDOM("mousedown",document.body,function(){t.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,function(){t.mouseDown=!1,t.update(v.default.sources.USER)})}},{key:"focus",value:function(){this.hasFocus()||(this.root.focus(),this.setRange(this.savedRange))}},{key:"format",value:function(t,e){if(null==this.scroll.whitelist||this.scroll.whitelist[t]){this.scroll.update();var n=this.getNativeRange();if(null!=n&&n.native.collapsed&&!c.default.query(t,c.default.Scope.BLOCK)){if(n.start.node!==this.cursor.textNode){var r=c.default.find(n.start.node,!1);if(null==r)return;if(r instanceof c.default.Leaf){var o=r.split(n.start.offset);r.parent.insertBefore(this.cursor,o)}else r.insertBefore(this.cursor,n.start.node);this.cursor.attach()}this.cursor.format(t,e),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}}},{key:"getBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.scroll.length();t=Math.min(t,n-1),e=Math.min(t+e,n-1)-t;var r=void 0,o=this.scroll.leaf(t),i=a(o,2),l=i[0],s=i[1];if(null==l)return null;var u=l.position(s,!0),c=a(u,2);r=c[0],s=c[1];var f=document.createRange();if(e>0){f.setStart(r,s);var h=this.scroll.leaf(t+e),p=a(h,2);if(l=p[0],s=p[1],null==l)return null;var d=l.position(s,!0),y=a(d,2);return r=y[0],s=y[1],f.setEnd(r,s),f.getBoundingClientRect()}var v="left",b=void 0;return r instanceof Text?(s0&&(v="right")),{bottom:b.top+b.height,height:b.height,left:b[v],right:b[v],top:b.top,width:0}}},{key:"getNativeRange",value:function(){var t=document.getSelection();if(null==t||t.rangeCount<=0)return null;var e=t.getRangeAt(0);if(null==e)return null;var n=this.normalizeNative(e);return m.info("getNativeRange",n),n}},{key:"getRange",value:function(){var t=this.getNativeRange();return null==t?[null,null]:[this.normalizedToRange(t),t]}},{key:"hasFocus",value:function(){return document.activeElement===this.root}},{key:"normalizedToRange",value:function(t){var e=this,n=[[t.start.node,t.start.offset]];t.native.collapsed||n.push([t.end.node,t.end.offset]);var r=n.map(function(t){var n=a(t,2),r=n[0],o=n[1],i=c.default.find(r,!0),l=i.offset(e.scroll);return 0===o?l:i instanceof c.default.Container?l+i.length():l+i.index(r,o)}),i=Math.min(Math.max.apply(Math,o(r)),this.scroll.length()-1),l=Math.min.apply(Math,[i].concat(o(r)));return new _(l,i-l)}},{key:"normalizeNative",value:function(t){if(!l(this.root,t.startContainer)||!t.collapsed&&!l(this.root,t.endContainer))return null;var e={start:{node:t.startContainer,offset:t.startOffset},end:{node:t.endContainer,offset:t.endOffset},native:t};return[e.start,e.end].forEach(function(t){for(var e=t.node,n=t.offset;!(e instanceof Text)&&e.childNodes.length>0;)if(e.childNodes.length>n)e=e.childNodes[n],n=0;else{if(e.childNodes.length!==n)break;e=e.lastChild,n=e instanceof Text?e.data.length:e.childNodes.length+1}t.node=e,t.offset=n}),e}},{key:"rangeToNative",value:function(t){var e=this,n=t.collapsed?[t.index]:[t.index,t.index+t.length],r=[],o=this.scroll.length();return n.forEach(function(t,n){t=Math.min(o-1,t);var i=void 0,l=e.scroll.leaf(t),s=a(l,2),u=s[0],c=s[1],f=u.position(c,0!==n),h=a(f,2);i=h[0],c=h[1],r.push(i,c)}),r.length<2&&(r=r.concat(r)),r}},{key:"scrollIntoView",value:function(t){var e=this.lastRange;if(null!=e){var n=this.getBounds(e.index,e.length);if(null!=n){var r=this.scroll.length()-1,o=this.scroll.line(Math.min(e.index,r)),i=a(o,1),l=i[0],s=l;if(e.length>0){var u=this.scroll.line(Math.min(e.index+e.length,r));s=a(u,1)[0]}if(null!=l&&null!=s){var c=t.getBoundingClientRect();n.topc.bottom&&(t.scrollTop+=n.bottom-c.bottom)}}}}},{key:"setNativeRange",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(m.info("setNativeRange",t,e,n,r),null==t||null!=this.root.parentNode&&null!=t.parentNode&&null!=n.parentNode){var i=document.getSelection();if(null!=i)if(null!=t){this.hasFocus()||this.root.focus();var l=(this.getNativeRange()||{}).native;if(null==l||o||t!==l.startContainer||e!==l.startOffset||n!==l.endContainer||r!==l.endOffset){"BR"==t.tagName&&(e=[].indexOf.call(t.parentNode.childNodes,t),t=t.parentNode),"BR"==n.tagName&&(r=[].indexOf.call(n.parentNode.childNodes,n),n=n.parentNode);var a=document.createRange();a.setStart(t,e),a.setEnd(n,r),i.removeAllRanges(),i.addRange(a)}}else i.removeAllRanges(),this.root.blur(),document.body.focus()}}},{key:"setRange",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.default.sources.API;if("string"==typeof e&&(n=e,e=!1),m.info("setRange",t),null!=t){var r=this.rangeToNative(t);this.setNativeRange.apply(this,o(r).concat([e]))}else this.setNativeRange(null);this.update(n)}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.default.sources.USER,e=this.lastRange,n=this.getRange(),r=a(n,2),o=r[0],i=r[1];if(this.lastRange=o,null!=this.lastRange&&(this.savedRange=this.lastRange),!(0,d.default)(e,this.lastRange)){var l;!this.composing&&null!=i&&i.native.collapsed&&i.start.node!==this.cursor.textNode&&this.cursor.restore();var s=[v.default.events.SELECTION_CHANGE,(0,h.default)(this.lastRange),(0,h.default)(e),t];if((l=this.emitter).emit.apply(l,[v.default.events.EDITOR_CHANGE].concat(s)),t!==v.default.sources.SILENT){var u;(u=this.emitter).emit.apply(u,s)}}}}]),t}();e.Range=_,e.default=O},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=n(0),s=r(a),u=n(3),c=r(u),f=function(t){function e(){return o(this,e),i(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return l(e,t),e}(s.default.Container);f.allowedChildren=[c.default,u.BlockEmbed,f],e.default=f},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.ColorStyle=e.ColorClass=e.ColorAttributor=void 0;var l=function(){function t(t,e){for(var n=0;n-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e},t.prototype.attach=function(){null!=this.parent&&(this.scroll=this.parent.scroll)},t.prototype.clone=function(){var t=this.domNode.cloneNode(!1);return r.create(t)},t.prototype.detach=function(){null!=this.parent&&this.parent.removeChild(this),delete this.domNode[r.DATA_KEY]},t.prototype.deleteAt=function(t,e){this.isolate(t,e).remove()},t.prototype.formatAt=function(t,e,n,o){var i=this.isolate(t,e);if(null!=r.query(n,r.Scope.BLOT)&&o)i.wrap(n,o);else if(null!=r.query(n,r.Scope.ATTRIBUTE)){var l=r.create(this.statics.scope);i.wrap(l),l.format(n,o)}},t.prototype.insertAt=function(t,e,n){var o=null==n?r.create("text",e):r.create(e,n),i=this.split(t);this.parent.insertBefore(o,i)},t.prototype.insertInto=function(t,e){void 0===e&&(e=null),null!=this.parent&&this.parent.children.remove(this);var n=null;t.children.insertBefore(this,e),null!=e&&(n=e.domNode),null!=this.next&&this.domNode.nextSibling==n||t.domNode.insertBefore(this.domNode,n),this.parent=t,this.attach()},t.prototype.isolate=function(t,e){var n=this.split(t);return n.split(e),n},t.prototype.length=function(){return 1},t.prototype.offset=function(t){return void 0===t&&(t=this.parent),null==this.parent||this==t?0:this.parent.children.offset(this)+this.parent.offset(t)},t.prototype.optimize=function(t){null!=this.domNode[r.DATA_KEY]&&delete this.domNode[r.DATA_KEY].mutations},t.prototype.remove=function(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()},t.prototype.replace=function(t){null!=t.parent&&(t.parent.insertBefore(this,t.next),t.remove())},t.prototype.replaceWith=function(t,e){var n="string"==typeof t?r.create(t,e):t;return n.replace(this),n},t.prototype.split=function(t,e){return 0===t?this:this.next},t.prototype.update=function(t,e){},t.prototype.wrap=function(t,e){var n="string"==typeof t?r.create(t,e):t;return null!=this.parent&&this.parent.insertBefore(n,this.next),n.appendChild(this),n},t.blotName="abstract",t}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(11),o=n(28),i=n(29),l=n(1),a=function(){function t(t){this.attributes={},this.domNode=t,this.build()}return t.prototype.attribute=function(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])},t.prototype.build=function(){var t=this;this.attributes={};var e=r.default.keys(this.domNode),n=o.default.keys(this.domNode),a=i.default.keys(this.domNode);e.concat(n).concat(a).forEach(function(e){var n=l.query(e,l.Scope.ATTRIBUTE);n instanceof r.default&&(t.attributes[n.attrName]=n)})},t.prototype.copy=function(t){var e=this;Object.keys(this.attributes).forEach(function(n){var r=e.attributes[n].value(e.domNode);t.format(n,r)})},t.prototype.move=function(t){var e=this;this.copy(t),Object.keys(this.attributes).forEach(function(t){e.attributes[t].remove(e.domNode)}),this.attributes={}},t.prototype.values=function(){var t=this;return Object.keys(this.attributes).reduce(function(e,n){return e[n]=t.attributes[n].value(t.domNode),e},{})},t}();e.default=a},function(t,e,n){"use strict";function r(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(function(t){return 0===t.indexOf(e+"-")})}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("class")||"").split(/\s+/).map(function(t){return t.split("-").slice(0,-1).join("-")})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(this.keyName+"-"+e),!0)},e.prototype.remove=function(t){r(t,this.keyName).forEach(function(e){t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")},e.prototype.value=function(t){var e=r(t,this.keyName)[0]||"",n=e.slice(this.keyName.length+1);return this.canAdd(t,n)?n:""},e}(i.default);e.default=l},function(t,e,n){"use strict";function r(t){var e=t.split("-"),n=e.slice(1).map(function(t){return t[0].toUpperCase()+t.slice(1)}).join("");return e[0]+n}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(11),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.keys=function(t){return(t.getAttribute("style")||"").split(";").map(function(t){return t.split(":")[0].trim()})},e.prototype.add=function(t,e){return!!this.canAdd(t,e)&&(t.style[r(this.keyName)]=e,!0)},e.prototype.remove=function(t){t.style[r(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")},e.prototype.value=function(t){var e=t.style[r(this.keyName)];return this.canAdd(t,e)?e:""},e}(i.default);e.default=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n1){var u=o.formats(),c=this.quill.getFormat(t.index-1,1);i=A.default.attributes.diff(u,c)||{}}}var f=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(e.prefix)?2:1;this.quill.deleteText(t.index-f,f,P.default.sources.USER),Object.keys(i).length>0&&this.quill.formatLine(t.index-f,f,i,P.default.sources.USER),this.quill.focus()}}function c(t,e){var n=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(e.suffix)?2:1;if(!(t.index>=this.quill.getLength()-n)){var r={},o=0,i=this.quill.getLine(t.index),l=b(i,1),a=l[0];if(e.offset>=a.length()-1){var s=this.quill.getLine(t.index+1),u=b(s,1),c=u[0];if(c){var f=a.formats(),h=this.quill.getFormat(t.index,1);r=A.default.attributes.diff(f,h)||{},o=c.length()}}this.quill.deleteText(t.index,n,P.default.sources.USER),Object.keys(r).length>0&&this.quill.formatLine(t.index+o-1,n,r,P.default.sources.USER)}}function f(t){var e=this.quill.getLines(t),n={};if(e.length>1){var r=e[0].formats(),o=e[e.length-1].formats();n=A.default.attributes.diff(o,r)||{}}this.quill.deleteText(t,P.default.sources.USER),Object.keys(n).length>0&&this.quill.formatLine(t.index,1,n,P.default.sources.USER),this.quill.setSelection(t.index,P.default.sources.SILENT),this.quill.focus()}function h(t,e){var n=this;t.length>0&&this.quill.scroll.deleteAt(t.index,t.length);var r=Object.keys(e.format).reduce(function(t,n){return T.default.query(n,T.default.Scope.BLOCK)&&!Array.isArray(e.format[n])&&(t[n]=e.format[n]),t},{});this.quill.insertText(t.index,"\n",r,P.default.sources.USER),this.quill.setSelection(t.index+1,P.default.sources.SILENT),this.quill.focus(),Object.keys(e.format).forEach(function(t){null==r[t]&&(Array.isArray(e.format[t])||"link"!==t&&n.quill.format(t,e.format[t],P.default.sources.USER))})}function p(t){return{key:D.keys.TAB,shiftKey:!t,format:{"code-block":!0},handler:function(e){var n=T.default.query("code-block"),r=e.index,o=e.length,i=this.quill.scroll.descendant(n,r),l=b(i,2),a=l[0],s=l[1];if(null!=a){var u=this.quill.getIndex(a),c=a.newlineIndex(s,!0)+1,f=a.newlineIndex(u+s+o),h=a.domNode.textContent.slice(c,f).split("\n");s=0,h.forEach(function(e,i){t?(a.insertAt(c+s,n.TAB),s+=n.TAB.length,0===i?r+=n.TAB.length:o+=n.TAB.length):e.startsWith(n.TAB)&&(a.deleteAt(c+s,n.TAB.length),s-=n.TAB.length,0===i?r-=n.TAB.length:o-=n.TAB.length),s+=e.length+1}),this.quill.update(P.default.sources.USER),this.quill.setSelection(r,o,P.default.sources.SILENT)}}}}function d(t){return{key:t[0].toUpperCase(),shortKey:!0,handler:function(e,n){this.quill.format(t,!n.format[t],P.default.sources.USER)}}}function y(t){if("string"==typeof t||"number"==typeof t)return y({key:t});if("object"===(void 0===t?"undefined":v(t))&&(t=(0,_.default)(t,!1)),"string"==typeof t.key)if(null!=D.keys[t.key.toUpperCase()])t.key=D.keys[t.key.toUpperCase()];else{if(1!==t.key.length)return null;t.key=t.key.toUpperCase().charCodeAt(0)}return t.shortKey&&(t[B]=t.shortKey,delete t.shortKey),t}Object.defineProperty(e,"__esModule",{value:!0}),e.SHORTKEY=e.default=void 0;var v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},b=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=y(t);if(null==r||null==r.key)return I.warn("Attempted to add invalid keyboard binding",r);"function"==typeof e&&(e={handler:e}),"function"==typeof n&&(n={handler:n}),r=(0,k.default)(r,e,n),this.bindings[r.key]=this.bindings[r.key]||[],this.bindings[r.key].push(r)}},{key:"listen",value:function(){var t=this;this.quill.root.addEventListener("keydown",function(n){if(!n.defaultPrevented){var r=n.which||n.keyCode,o=(t.bindings[r]||[]).filter(function(t){return e.match(n,t)});if(0!==o.length){var i=t.quill.getSelection();if(null!=i&&t.quill.hasFocus()){var l=t.quill.getLine(i.index),a=b(l,2),s=a[0],u=a[1],c=t.quill.getLeaf(i.index),f=b(c,2),h=f[0],p=f[1],d=0===i.length?[h,p]:t.quill.getLeaf(i.index+i.length),y=b(d,2),g=y[0],m=y[1],_=h instanceof T.default.Text?h.value().slice(0,p):"",O=g instanceof T.default.Text?g.value().slice(m):"",x={collapsed:0===i.length,empty:0===i.length&&s.length()<=1,format:t.quill.getFormat(i),offset:u,prefix:_,suffix:O};o.some(function(e){if(null!=e.collapsed&&e.collapsed!==x.collapsed)return!1;if(null!=e.empty&&e.empty!==x.empty)return!1;if(null!=e.offset&&e.offset!==x.offset)return!1;if(Array.isArray(e.format)){if(e.format.every(function(t){return null==x.format[t]}))return!1}else if("object"===v(e.format)&&!Object.keys(e.format).every(function(t){return!0===e.format[t]?null!=x.format[t]:!1===e.format[t]?null==x.format[t]:(0,w.default)(e.format[t],x.format[t])}))return!1;return!(null!=e.prefix&&!e.prefix.test(x.prefix))&&(!(null!=e.suffix&&!e.suffix.test(x.suffix))&&!0!==e.handler.call(t,i,x))})&&n.preventDefault()}}}})}}]),e}(R.default);D.keys={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46},D.DEFAULTS={bindings:{bold:d("bold"),italic:d("italic"),underline:d("underline"),indent:{key:D.keys.TAB,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","+1",P.default.sources.USER)}},outdent:{key:D.keys.TAB,shiftKey:!0,format:["blockquote","indent","list"],handler:function(t,e){if(e.collapsed&&0!==e.offset)return!0;this.quill.format("indent","-1",P.default.sources.USER)}},"outdent backspace":{key:D.keys.BACKSPACE,collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler:function(t,e){null!=e.format.indent?this.quill.format("indent","-1",P.default.sources.USER):null!=e.format.list&&this.quill.format("list",!1,P.default.sources.USER)}},"indent code-block":p(!0),"outdent code-block":p(!1),"remove tab":{key:D.keys.TAB,shiftKey:!0,collapsed:!0,prefix:/\t$/,handler:function(t){this.quill.deleteText(t.index-1,1,P.default.sources.USER)}},tab:{key:D.keys.TAB,handler:function(t){this.quill.history.cutoff();var e=(new N.default).retain(t.index).delete(t.length).insert("\t");this.quill.updateContents(e,P.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,P.default.sources.SILENT)}},"list empty enter":{key:D.keys.ENTER,collapsed:!0,format:["list"],empty:!0,handler:function(t,e){this.quill.format("list",!1,P.default.sources.USER),e.format.indent&&this.quill.format("indent",!1,P.default.sources.USER)}},"checklist enter":{key:D.keys.ENTER,collapsed:!0,format:{list:"checked"},handler:function(t){var e=this.quill.getLine(t.index),n=b(e,2),r=n[0],o=n[1],i=(0,k.default)({},r.formats(),{list:"checked"}),l=(new N.default).retain(t.index).insert("\n",i).retain(r.length()-o-1).retain(1,{list:"unchecked"});this.quill.updateContents(l,P.default.sources.USER),this.quill.setSelection(t.index+1,P.default.sources.SILENT),this.quill.scrollIntoView()}},"header enter":{key:D.keys.ENTER,collapsed:!0,format:["header"],suffix:/^$/,handler:function(t,e){var n=this.quill.getLine(t.index),r=b(n,2),o=r[0],i=r[1],l=(new N.default).retain(t.index).insert("\n",e.format).retain(o.length()-i-1).retain(1,{header:null});this.quill.updateContents(l,P.default.sources.USER),this.quill.setSelection(t.index+1,P.default.sources.SILENT),this.quill.scrollIntoView()}},"list autofill":{key:" ",collapsed:!0,format:{list:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler:function(t,e){var n=e.prefix.length,r=this.quill.getLine(t.index),o=b(r,2),i=o[0],l=o[1];if(l>n)return!0;var a=void 0;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",P.default.sources.USER),this.quill.history.cutoff();var s=(new N.default).retain(t.index-l).delete(n+1).retain(i.length()-2-l).retain(1,{list:a});this.quill.updateContents(s,P.default.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,P.default.sources.SILENT)}},"code exit":{key:D.keys.ENTER,collapsed:!0,format:["code-block"],prefix:/\n\n$/,suffix:/^\s+$/,handler:function(t){var e=this.quill.getLine(t.index),n=b(e,2),r=n[0],o=n[1],i=(new N.default).retain(t.index+r.length()-o-2).retain(1,{"code-block":null}).delete(1);this.quill.updateContents(i,P.default.sources.USER)}},"embed left":s(D.keys.LEFT,!1),"embed left shift":s(D.keys.LEFT,!0),"embed right":s(D.keys.RIGHT,!1),"embed right shift":s(D.keys.RIGHT,!0)}},e.default=D,e.SHORTKEY=B},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n '},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;nr.right&&(i=r.right-o.right,this.root.style.left=e+i+"px"),o.leftr.bottom){var l=o.bottom-o.top,a=t.bottom-t.top+l;this.root.style.top=n-a+"px",this.root.classList.add("ql-flip")}return i}},{key:"show",value:function(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}]),t}();e.default=i},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?(e[1]||"https")+"://www.youtube.com/embed/"+e[2]+"?showinfo=0":(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?(e[1]||"https")+"://player.vimeo.com/video/"+e[2]+"/":t}function s(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach(function(e){var r=document.createElement("option");e===n?r.setAttribute("selected","selected"):r.setAttribute("value",e),t.appendChild(r)})}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BaseTooltip=void 0;var u=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:"link",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),null!=e?this.textbox.value=e:t!==this.root.getAttribute("data-mode")&&(this.textbox.value=""),this.position(this.quill.getBounds(this.quill.selection.savedRange)),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute("data-"+t)||""),this.root.setAttribute("data-mode",t)}},{key:"restoreFocus",value:function(){var t=this.quill.scrollingContainer.scrollTop;this.quill.focus(),this.quill.scrollingContainer.scrollTop=t}},{key:"save",value:function(){var t=this.textbox.value;switch(this.root.getAttribute("data-mode")){case"link":var e=this.quill.root.scrollTop;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,v.default.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,v.default.sources.USER)),this.quill.root.scrollTop=e;break;case"video":t=a(t);case"formula":if(!t)break;var n=this.quill.getSelection(!0);if(null!=n){var r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,v.default.sources.USER),"formula"===this.root.getAttribute("data-mode")&&this.quill.insertText(r+1," ",v.default.sources.USER),this.quill.setSelection(r+2,v.default.sources.USER)}}this.textbox.value="",this.hide()}}]),e}(A.default);e.BaseTooltip=M,e.default=L},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(46),i=r(o),l=n(33),a=n(35),s=n(62),u=n(63),c=r(u),f=n(64),h=r(f),p=n(65),d=r(p),y=n(34),v=n(24),b=n(36),g=n(37),m=n(39),_=r(m),O=n(66),w=r(O),x=n(15),k=r(x),E=n(67),N=r(E),j=n(68),A=r(j),q=n(69),T=r(q),S=n(70),P=r(S),C=n(71),L=r(C),M=n(13),R=r(M),I=n(72),B=r(I),D=n(73),U=r(D),F=n(74),H=r(F),K=n(25),z=r(K),Z=n(16),V=r(Z),W=n(41),G=r(W),Y=n(42),X=r(Y),$=n(43),Q=r($),J=n(107),tt=r(J),et=n(108),nt=r(et);i.default.register({"attributors/attribute/direction":a.DirectionAttribute,"attributors/class/align":l.AlignClass,"attributors/class/background":y.BackgroundClass,"attributors/class/color":v.ColorClass,"attributors/class/direction":a.DirectionClass,"attributors/class/font":b.FontClass,"attributors/class/size":g.SizeClass,"attributors/style/align":l.AlignStyle,"attributors/style/background":y.BackgroundStyle,"attributors/style/color":v.ColorStyle,"attributors/style/direction":a.DirectionStyle,"attributors/style/font":b.FontStyle,"attributors/style/size":g.SizeStyle},!0),i.default.register({"formats/align":l.AlignClass,"formats/direction":a.DirectionClass,"formats/indent":s.IndentClass,"formats/background":y.BackgroundStyle,"formats/color":v.ColorStyle,"formats/font":b.FontClass,"formats/size":g.SizeClass,"formats/blockquote":c.default,"formats/code-block":R.default,"formats/header":h.default,"formats/list":d.default,"formats/bold":_.default,"formats/code":M.Code,"formats/italic":w.default,"formats/link":k.default,"formats/script":N.default,"formats/strike":A.default,"formats/underline":T.default,"formats/image":P.default,"formats/video":L.default,"formats/list/item":p.ListItem,"modules/formula":B.default,"modules/syntax":U.default,"modules/toolbar":H.default,"themes/bubble":tt.default,"themes/snow":nt.default,"ui/icons":z.default,"ui/picker":V.default,"ui/icon-picker":X.default,"ui/color-picker":G.default,"ui/tooltip":Q.default},!0),e.default=i.default},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),i=r(o),l=n(6),a=r(l),s=n(3),u=r(s),c=n(14),f=r(c),h=n(23),p=r(h),d=n(30),y=r(d),v=n(32),b=r(v),g=n(5),m=r(g),_=n(59),O=r(_),w=n(8),x=r(w),k=n(60),E=r(k),N=n(61),j=r(N),A=n(38),q=r(A);a.default.register({"blots/block":u.default,"blots/block/embed":s.BlockEmbed,"blots/break":f.default,"blots/container":p.default,"blots/cursor":y.default,"blots/embed":b.default,"blots/inline":m.default,"blots/scroll":O.default,"blots/text":x.default,"modules/clipboard":E.default,"modules/history":j.default,"modules/keyboard":q.default}),i.default.register(u.default,f.default,y.default,m.default,O.default,x.default),e.default=a.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(){this.head=this.tail=null,this.length=0}return t.prototype.append=function(){for(var t=[],e=0;e1&&this.append.apply(this,t.slice(1))},t.prototype.contains=function(t){for(var e,n=this.iterator();e=n();)if(e===t)return!0;return!1},t.prototype.insertBefore=function(t,e){t&&(t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)},t.prototype.offset=function(t){for(var e=0,n=this.head;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1},t.prototype.remove=function(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)},t.prototype.iterator=function(t){return void 0===t&&(t=this.head),function(){var e=t;return null!=t&&(t=t.next),e}},t.prototype.find=function(t,e){void 0===e&&(e=!1);for(var n,r=this.iterator();n=r();){var o=n.length();if(ta?n(r,t-a,Math.min(e,a+u-t)):n(r,0,Math.min(u,t+e-a)),a+=u}},t.prototype.map=function(t){return this.reduce(function(e,n){return e.push(t(n)),e},[])},t.prototype.reduce=function(t,e){for(var n,r=this.iterator();n=r();)e=t(e,n);return e},t}();e.default=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(17),i=n(1),l={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},a=function(t){function e(e){var n=t.call(this,e)||this;return n.scroll=n,n.observer=new MutationObserver(function(t){n.update(t)}),n.observer.observe(n.domNode,l),n.attach(),n}return r(e,t),e.prototype.detach=function(){t.prototype.detach.call(this),this.observer.disconnect()},e.prototype.deleteAt=function(e,n){this.update(),0===e&&n===this.length()?this.children.forEach(function(t){t.remove()}):t.prototype.deleteAt.call(this,e,n)},e.prototype.formatAt=function(e,n,r,o){this.update(),t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){this.update(),t.prototype.insertAt.call(this,e,n,r)},e.prototype.optimize=function(e,n){var r=this;void 0===e&&(e=[]),void 0===n&&(n={}),t.prototype.optimize.call(this,n);for(var l=[].slice.call(this.observer.takeRecords());l.length>0;)e.push(l.pop());for(var a=function(t,e){void 0===e&&(e=!0),null!=t&&t!==r&&null!=t.domNode.parentNode&&(null==t.domNode[i.DATA_KEY].mutations&&(t.domNode[i.DATA_KEY].mutations=[]),e&&a(t.parent))},s=function(t){null!=t.domNode[i.DATA_KEY]&&null!=t.domNode[i.DATA_KEY].mutations&&(t instanceof o.default&&t.children.forEach(s),t.optimize(n))},u=e,c=0;u.length>0;c+=1){if(c>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(function(t){var e=i.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(a(i.find(t.previousSibling,!1)),[].forEach.call(t.addedNodes,function(t){var e=i.find(t,!1);a(e,!1),e instanceof o.default&&e.children.forEach(function(t){a(t,!1)})})):"attributes"===t.type&&a(e.prev)),a(e))}),this.children.forEach(s),u=[].slice.call(this.observer.takeRecords()),l=u.slice();l.length>0;)e.push(l.pop())}},e.prototype.update=function(e,n){var r=this;void 0===n&&(n={}),e=e||this.observer.takeRecords(),e.map(function(t){var e=i.find(t.target,!0);return null==e?null:null==e.domNode[i.DATA_KEY].mutations?(e.domNode[i.DATA_KEY].mutations=[t],e):(e.domNode[i.DATA_KEY].mutations.push(t),null)}).forEach(function(t){null!=t&&t!==r&&null!=t.domNode[i.DATA_KEY]&&t.update(t.domNode[i.DATA_KEY].mutations||[],n)}),null!=this.domNode[i.DATA_KEY].mutations&&t.prototype.update.call(this,this.domNode[i.DATA_KEY].mutations,n),this.optimize(e,n)},e.blotName="scroll",e.defaultChild="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="DIV",e}(o.default);e.default=a},function(t,e,n){"use strict";function r(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(t[n]!==e[n])return!1;return!0}var o=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var i=n(18),l=n(1),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.formats=function(n){if(n.tagName!==e.tagName)return t.formats.call(this,n)},e.prototype.format=function(n,r){var o=this;n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):(this.children.forEach(function(t){t instanceof i.default||(t=t.wrap(e.blotName,!0)),o.attributes.copy(t)}),this.unwrap())},e.prototype.formatAt=function(e,n,r,o){if(null!=this.formats()[r]||l.query(r,l.Scope.ATTRIBUTE)){this.isolate(e,n).format(r,o)}else t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n);var o=this.formats();if(0===Object.keys(o).length)return this.unwrap();var i=this.next;i instanceof e&&i.prev===this&&r(o,i.formats())&&(i.moveChildren(this),i.remove())},e.blotName="inline",e.scope=l.Scope.INLINE_BLOT,e.tagName="SPAN",e}(i.default);e.default=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(18),i=n(1),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(n){var r=i.query(e.blotName).tagName;if(n.tagName!==r)return t.formats.call(this,n)},e.prototype.format=function(n,r){null!=i.query(n,i.Scope.BLOCK)&&(n!==this.statics.blotName||r?t.prototype.format.call(this,n,r):this.replaceWith(e.blotName))},e.prototype.formatAt=function(e,n,r,o){null!=i.query(r,i.Scope.BLOCK)?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.insertAt=function(e,n,r){if(null==r||null!=i.query(n,i.Scope.INLINE))t.prototype.insertAt.call(this,e,n,r);else{var o=this.split(e),l=i.create(n,r);o.parent.insertBefore(l,o)}},e.prototype.update=function(e,n){navigator.userAgent.match(/Trident/)?this.build():t.prototype.update.call(this,e,n)},e.blotName="block",e.scope=i.Scope.BLOCK_BLOT,e.tagName="P",e}(o.default);e.default=l},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.formats=function(t){},e.prototype.format=function(e,n){t.prototype.formatAt.call(this,0,this.length(),e,n)},e.prototype.formatAt=function(e,n,r,o){0===e&&n===this.length()?this.format(r,o):t.prototype.formatAt.call(this,e,n,r,o)},e.prototype.formats=function(){return this.statics.formats(this.domNode)},e}(o.default);e.default=i},function(t,e,n){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(19),i=n(1),l=function(t){function e(e){var n=t.call(this,e)||this;return n.text=n.statics.value(n.domNode),n}return r(e,t),e.create=function(t){return document.createTextNode(t)},e.value=function(t){var e=t.data;return e.normalize&&(e=e.normalize()),e},e.prototype.deleteAt=function(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)},e.prototype.index=function(t,e){return this.domNode===t?e:-1},e.prototype.insertAt=function(e,n,r){null==r?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):t.prototype.insertAt.call(this,e,n,r)},e.prototype.length=function(){return this.text.length},e.prototype.optimize=function(n){t.prototype.optimize.call(this,n),this.text=this.statics.value(this.domNode),0===this.text.length?this.remove():this.next instanceof e&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())},e.prototype.position=function(t,e){return void 0===e&&(e=!1),[this.domNode,t]},e.prototype.split=function(t,e){if(void 0===e&&(e=!1),!e){if(0===t)return this;if(t===this.length())return this.next}var n=i.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next),this.text=this.statics.value(this.domNode),n},e.prototype.update=function(t,e){var n=this;t.some(function(t){return"characterData"===t.type&&t.target===n.domNode})&&(this.text=this.statics.value(this.domNode))},e.prototype.value=function(){return this.text},e.blotName="text",e.scope=i.Scope.INLINE_BLOT,e}(o.default);e.default=l},function(t,e,n){"use strict";var r=document.createElement("div");if(r.classList.toggle("test-class",!1),r.classList.contains("test-class")){var o=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return arguments.length>1&&!this.contains(t)==!e?e:o.call(this,t)}}String.prototype.startsWith||(String.prototype.startsWith=function(t,e){return e=e||0,this.substr(e,t.length)===t}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){var n=this.toString();("number"!=typeof e||!isFinite(e)||Math.floor(e)!==e||e>n.length)&&(e=n.length),e-=t.length;var r=n.indexOf(t,e);return-1!==r&&r===e}),Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(t){if(null===this)throw new TypeError("Array.prototype.find called on null or undefined");if("function"!=typeof t)throw new TypeError("predicate must be a function");for(var e,n=Object(this),r=n.length>>>0,o=arguments[1],i=0;ie.length?t:e,l=t.length>e.length?e:t,a=i.indexOf(l);if(-1!=a)return r=[[y,i.substring(0,a)],[v,l],[y,i.substring(a+l.length)]],t.length>e.length&&(r[0][0]=r[2][0]=d),r;if(1==l.length)return[[d,t],[y,e]];var u=s(t,e);if(u){var c=u[0],f=u[1],h=u[2],p=u[3],b=u[4],g=n(c,h),m=n(f,p);return g.concat([[v,b]],m)}return o(t,e)}function o(t,e){for(var n=t.length,r=e.length,o=Math.ceil((n+r)/2),l=o,a=2*o,s=new Array(a),u=new Array(a),c=0;cn)v+=2;else if(x>r)p+=2;else if(h){var k=l+f-_;if(k>=0&&k=E)return i(t,e,O,x)}}}for(var N=-m+b;N<=m-g;N+=2){var E,k=l+N;E=N==-m||N!=m&&u[k-1]n)g+=2;else if(j>r)b+=2;else if(!h){var w=l+f-N;if(w>=0&&w=E)return i(t,e,O,x)}}}}return[[d,t],[y,e]]}function i(t,e,r,o){var i=t.substring(0,r),l=e.substring(0,o),a=t.substring(r),s=e.substring(o),u=n(i,l),c=n(a,s);return u.concat(c)}function l(t,e){if(!t||!e||t.charAt(0)!=e.charAt(0))return 0;for(var n=0,r=Math.min(t.length,e.length),o=r,i=0;n=t.length?[r,o,i,s,f]:null}var r=t.length>e.length?t:e,o=t.length>e.length?e:t;if(r.length<4||2*o.lengthu[4].length?s:u:s;var c,f,h,p;return t.length>e.length?(c=i[0],f=i[1],h=i[2],p=i[3]):(h=i[0],p=i[1],c=i[2],f=i[3]),[c,f,h,p,i[4]]}function u(t){t.push([v,""]);for(var e,n=0,r=0,o=0,i="",s="";n1?(0!==r&&0!==o&&(e=l(s,i),0!==e&&(n-r-o>0&&t[n-r-o-1][0]==v?t[n-r-o-1][1]+=s.substring(0,e):(t.splice(0,0,[v,s.substring(0,e)]),n++),s=s.substring(e),i=i.substring(e)),0!==(e=a(s,i))&&(t[n][1]=s.substring(s.length-e)+t[n][1],s=s.substring(0,s.length-e),i=i.substring(0,i.length-e))),0===r?t.splice(n-o,r+o,[y,s]):0===o?t.splice(n-r,r+o,[d,i]):t.splice(n-r-o,r+o,[d,i],[y,s]),n=n-r-o+(r?1:0)+(o?1:0)+1):0!==n&&t[n-1][0]==v?(t[n-1][1]+=t[n][1],t.splice(n,1)):n++,o=0,r=0,i="",s=""}""===t[t.length-1][1]&&t.pop();var c=!1;for(n=1;n0&&r.splice(o+2,0,[l[0],a]),p(r,o,3)}return t}function h(t){for(var e=!1,n=function(t){return t.charCodeAt(0)>=56320&&t.charCodeAt(0)<=57343},r=2;r=55296&&t.charCodeAt(t.length-1)<=56319}(t[r-2][1])&&t[r-1][0]===d&&n(t[r-1][1])&&t[r][0]===y&&n(t[r][1])&&(e=!0,t[r-1][1]=t[r-2][1].slice(-1)+t[r-1][1],t[r][1]=t[r-2][1].slice(-1)+t[r][1],t[r-2][1]=t[r-2][1].slice(0,-1));if(!e)return t;for(var o=[],r=0;r0&&o.push(t[r]);return o}function p(t,e,n){for(var r=e+n-1;r>=0&&r>=e-1;r--)if(r+1=r&&!a.endsWith("\n")&&(n=!0),e.scroll.insertAt(t,a);var c=e.scroll.line(t),f=u(c,2),h=f[0],p=f[1],y=(0,T.default)({},(0,O.bubbleFormats)(h));if(h instanceof w.default){var b=h.descendant(v.default.Leaf,p),g=u(b,1),m=g[0];y=(0,T.default)(y,(0,O.bubbleFormats)(m))}l=d.default.attributes.diff(y,l)||{}}else if("object"===s(o.insert)){var _=Object.keys(o.insert)[0];if(null==_)return t;e.scroll.insertAt(t,_,o.insert[_])}r+=i}return Object.keys(l).forEach(function(n){e.scroll.formatAt(t,i,n,l[n])}),t+i},0),t.reduce(function(t,n){return"number"==typeof n.delete?(e.scroll.deleteAt(t,n.delete),t):t+(n.retain||n.insert.length||1)},0),this.scroll.batchEnd(),this.update(t)}},{key:"deleteText",value:function(t,e){return this.scroll.deleteAt(t,e),this.update((new h.default).retain(t).delete(e))}},{key:"formatLine",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.scroll.update(),Object.keys(r).forEach(function(o){if(null==n.scroll.whitelist||n.scroll.whitelist[o]){var i=n.scroll.lines(t,Math.max(e,1)),l=e;i.forEach(function(e){var i=e.length();if(e instanceof g.default){var a=t-e.offset(n.scroll),s=e.newlineIndex(a+l)-a+1;e.formatAt(a,s,o,r[o])}else e.format(o,r[o]);l-=i})}}),this.scroll.optimize(),this.update((new h.default).retain(t).retain(e,(0,N.default)(r)))}},{key:"formatText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e,o,r[o])}),this.update((new h.default).retain(t).retain(e,(0,N.default)(r)))}},{key:"getContents",value:function(t,e){return this.delta.slice(t,t+e)}},{key:"getDelta",value:function(){return this.scroll.lines().reduce(function(t,e){return t.concat(e.delta())},new h.default)}},{key:"getFormat",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[],r=[];0===e?this.scroll.path(t).forEach(function(t){var e=u(t,1),o=e[0];o instanceof w.default?n.push(o):o instanceof v.default.Leaf&&r.push(o)}):(n=this.scroll.lines(t,e),r=this.scroll.descendants(v.default.Leaf,t,e));var o=[n,r].map(function(t){if(0===t.length)return{};for(var e=(0,O.bubbleFormats)(t.shift());Object.keys(e).length>0;){var n=t.shift();if(null==n)return e;e=l((0,O.bubbleFormats)(n),e)}return e});return T.default.apply(T.default,o)}},{key:"getText",value:function(t,e){return this.getContents(t,e).filter(function(t){return"string"==typeof t.insert}).map(function(t){return t.insert}).join("")}},{key:"insertEmbed",value:function(t,e,n){return this.scroll.insertAt(t,e,n),this.update((new h.default).retain(t).insert(o({},e,n)))}},{key:"insertText",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),this.scroll.insertAt(t,e),Object.keys(r).forEach(function(o){n.scroll.formatAt(t,e.length,o,r[o])}),this.update((new h.default).retain(t).insert(e,(0,N.default)(r)))}},{key:"isBlank",value:function(){if(0==this.scroll.children.length)return!0;if(this.scroll.children.length>1)return!1;var t=this.scroll.children.head;return t.statics.blotName===w.default.blotName&&(!(t.children.length>1)&&t.children.head instanceof k.default)}},{key:"removeFormat",value:function(t,e){var n=this.getText(t,e),r=this.scroll.line(t+e),o=u(r,2),i=o[0],l=o[1],a=0,s=new h.default;null!=i&&(a=i instanceof g.default?i.newlineIndex(l)-l+1:i.length()-l,s=i.delta().slice(l,l+a-1).insert("\n"));var c=this.getContents(t,e+a),f=c.diff((new h.default).insert(n).concat(s)),p=(new h.default).retain(t).concat(f);return this.applyDelta(p)}},{key:"update",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=this.delta;if(1===e.length&&"characterData"===e[0].type&&e[0].target.data.match(S)&&v.default.find(e[0].target)){var o=v.default.find(e[0].target),i=(0,O.bubbleFormats)(o),l=o.offset(this.scroll),a=e[0].oldValue.replace(_.default.CONTENTS,""),s=(new h.default).insert(a),u=(new h.default).insert(o.value());t=(new h.default).retain(l).concat(s.diff(u,n)).reduce(function(t,e){return e.insert?t.insert(e.insert,i):t.push(e)},new h.default),this.delta=r.compose(t)}else this.delta=this.getDelta(),t&&(0,A.default)(r.compose(t),this.delta)||(t=r.diff(this.delta,n));return t}}]),t}();e.default=P},function(t,e){"use strict";function n(){}function r(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(){this._events=new n,this._eventsCount=0}var i=Object.prototype.hasOwnProperty,l="~";Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(l=!1)),o.prototype.eventNames=function(){var t,e,n=[];if(0===this._eventsCount)return n;for(e in t=this._events)i.call(t,e)&&n.push(l?e.slice(1):e);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t,e){var n=l?l+t:t,r=this._events[n];if(e)return!!r;if(!r)return[];if(r.fn)return[r.fn];for(var o=0,i=r.length,a=new Array(i);o0){if(i instanceof y.BlockEmbed||f instanceof y.BlockEmbed)return void this.optimize();if(i instanceof _.default){var h=i.newlineIndex(i.length(),!0);if(h>-1&&(i=i.split(h+1))===f)return void this.optimize()}else if(f instanceof _.default){var p=f.newlineIndex(0);p>-1&&f.split(p+1)}var d=f.children.head instanceof g.default?null:f.children.head;i.moveChildren(f,d),i.remove()}this.optimize()}},{key:"enable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.domNode.setAttribute("contenteditable",t)}},{key:"formatAt",value:function(t,n,r,o){(null==this.whitelist||this.whitelist[r])&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"formatAt",this).call(this,t,n,r,o),this.optimize())}},{key:"insertAt",value:function(t,n,r){if(null==r||null==this.whitelist||this.whitelist[n]){if(t>=this.length())if(null==r||null==h.default.query(n,h.default.Scope.BLOCK)){var o=h.default.create(this.statics.defaultChild);this.appendChild(o),null==r&&n.endsWith("\n")&&(n=n.slice(0,-1)),o.insertAt(0,n,r)}else{var i=h.default.create(n,r);this.appendChild(i)}else c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertAt",this).call(this,t,n,r);this.optimize()}}},{key:"insertBefore",value:function(t,n){if(t.statics.scope===h.default.Scope.INLINE_BLOT){var r=h.default.create(this.statics.defaultChild);r.appendChild(t),t=r}c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n)}},{key:"leaf",value:function(t){return this.path(t).pop()||[null,-1]}},{key:"line",value:function(t){return t===this.length()?this.line(t-1):this.descendant(a,t)}},{key:"lines",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.MAX_VALUE;return function t(e,n,r){var o=[],i=r;return e.children.forEachAt(n,r,function(e,n,r){a(e)?o.push(e):e instanceof h.default.Container&&(o=o.concat(t(e,n,i))),i-=r}),o}(this,t,e)}},{key:"optimize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!0!==this.batch&&(c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t,n),t.length>0&&this.emitter.emit(d.default.events.SCROLL_OPTIMIZE,t,n))}},{key:"path",value:function(t){return c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"path",this).call(this,t).slice(1)}},{key:"update",value:function(t){if(!0!==this.batch){var n=d.default.sources.USER;"string"==typeof t&&(n=t),Array.isArray(t)||(t=this.observer.takeRecords()),t.length>0&&this.emitter.emit(d.default.events.SCROLL_BEFORE_UPDATE,n,t),c(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"update",this).call(this,t.concat([])),t.length>0&&this.emitter.emit(d.default.events.SCROLL_UPDATE,n,t)}}}]),e}(h.default.Scroll);x.blotName="scroll",x.className="ql-editor",x.tagName="DIV",x.defaultChild="block",x.allowedChildren=[v.default,y.BlockEmbed,w.default],e.default=x},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){return"object"===(void 0===e?"undefined":x(e))?Object.keys(e).reduce(function(t,n){return s(t,n,e[n])},t):t.reduce(function(t,r){return r.attributes&&r.attributes[e]?t.push(r):t.insert(r.insert,(0,j.default)({},o({},e,n),r.attributes))},new q.default)}function u(t){if(t.nodeType!==Node.ELEMENT_NODE)return{};return t["__ql-computed-style"]||(t["__ql-computed-style"]=window.getComputedStyle(t))}function c(t,e){for(var n="",r=t.ops.length-1;r>=0&&n.length-1}function h(t,e,n){return t.nodeType===t.TEXT_NODE?n.reduce(function(e,n){return n(t,e)},new q.default):t.nodeType===t.ELEMENT_NODE?[].reduce.call(t.childNodes||[],function(r,o){var i=h(o,e,n);return o.nodeType===t.ELEMENT_NODE&&(i=e.reduce(function(t,e){return e(o,t)},i),i=(o[W]||[]).reduce(function(t,e){return e(o,t)},i)),r.concat(i)},new q.default):new q.default}function p(t,e,n){return s(n,t,!0)}function d(t,e){var n=S.default.Attributor.Attribute.keys(t),r=S.default.Attributor.Class.keys(t),o=S.default.Attributor.Style.keys(t),i={};return n.concat(r).concat(o).forEach(function(e){var n=S.default.query(e,S.default.Scope.ATTRIBUTE);null!=n&&(i[n.attrName]=n.value(t),i[n.attrName])||(n=Y[e],null==n||n.attrName!==e&&n.keyName!==e||(i[n.attrName]=n.value(t)||void 0),null==(n=X[e])||n.attrName!==e&&n.keyName!==e||(n=X[e],i[n.attrName]=n.value(t)||void 0))}),Object.keys(i).length>0&&(e=s(e,i)),e}function y(t,e){var n=S.default.query(t);if(null==n)return e;if(n.prototype instanceof S.default.Embed){var r={},o=n.value(t);null!=o&&(r[n.blotName]=o,e=(new q.default).insert(r,n.formats(t)))}else"function"==typeof n.formats&&(e=s(e,n.blotName,n.formats(t)));return e}function v(t,e){return c(e,"\n")||e.insert("\n"),e}function b(){return new q.default}function g(t,e){var n=S.default.query(t);if(null==n||"list-item"!==n.blotName||!c(e,"\n"))return e;for(var r=-1,o=t.parentNode;!o.classList.contains("ql-clipboard");)"list"===(S.default.query(o)||{}).blotName&&(r+=1),o=o.parentNode;return r<=0?e:e.compose((new q.default).retain(e.length()-1).retain(1,{indent:r}))}function m(t,e){return c(e,"\n")||(f(t)||e.length()>0&&t.nextSibling&&f(t.nextSibling))&&e.insert("\n"),e}function _(t,e){if(f(t)&&null!=t.nextElementSibling&&!c(e,"\n\n")){var n=t.offsetHeight+parseFloat(u(t).marginTop)+parseFloat(u(t).marginBottom);t.nextElementSibling.offsetTop>t.offsetTop+1.5*n&&e.insert("\n")}return e}function O(t,e){var n={},r=t.style||{};return r.fontStyle&&"italic"===u(t).fontStyle&&(n.italic=!0),r.fontWeight&&(u(t).fontWeight.startsWith("bold")||parseInt(u(t).fontWeight)>=700)&&(n.bold=!0),Object.keys(n).length>0&&(e=s(e,n)),parseFloat(r.textIndent||0)>0&&(e=(new q.default).insert("\t").concat(e)),e}function w(t,e){var n=t.data;if("O:P"===t.parentNode.tagName)return e.insert(n.trim());if(0===n.trim().length&&t.parentNode.classList.contains("ql-clipboard"))return e;if(!u(t.parentNode).whiteSpace.startsWith("pre")){var r=function(t,e){return e=e.replace(/[^\u00a0]/g,""),e.length<1&&t?" ":e};n=n.replace(/\r\n/g," ").replace(/\n/g," "),n=n.replace(/\s\s+/g,r.bind(r,!0)),(null==t.previousSibling&&f(t.parentNode)||null!=t.previousSibling&&f(t.previousSibling))&&(n=n.replace(/^\s+/,r.bind(r,!1))),(null==t.nextSibling&&f(t.parentNode)||null!=t.nextSibling&&f(t.nextSibling))&&(n=n.replace(/\s+$/,r.bind(r,!1)))}return e.insert(n)}Object.defineProperty(e,"__esModule",{value:!0}),e.matchText=e.matchSpacing=e.matchNewline=e.matchBlot=e.matchAttributor=e.default=void 0;var x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),E=function(){function t(t,e){for(var n=0;n\r?\n +\<"),this.convert();var e=this.quill.getFormat(this.quill.selection.savedRange.index);if(e[F.default.blotName]){var n=this.container.innerText;return this.container.innerHTML="",(new q.default).insert(n,o({},F.default.blotName,e[F.default.blotName]))}var r=this.prepareMatching(),i=k(r,2),l=i[0],a=i[1],s=h(this.container,l,a);return c(s,"\n")&&null==s.ops[s.ops.length-1].attributes&&(s=s.compose((new q.default).retain(s.length()-1).delete(1))),V.log("convert",this.container.innerHTML,s),this.container.innerHTML="",s}},{key:"dangerouslyPasteHTML",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:C.default.sources.API;if("string"==typeof t)this.quill.setContents(this.convert(t),e),this.quill.setSelection(0,C.default.sources.SILENT);else{var r=this.convert(e);this.quill.updateContents((new q.default).retain(t).concat(r),n),this.quill.setSelection(t+r.length(),C.default.sources.SILENT)}}},{key:"onPaste",value:function(t){var e=this;if(!t.defaultPrevented&&this.quill.isEnabled()){var n=this.quill.getSelection(),r=(new q.default).retain(n.index),o=this.quill.scrollingContainer.scrollTop;this.container.focus(),this.quill.selection.update(C.default.sources.SILENT),setTimeout(function(){r=r.concat(e.convert()).delete(n.length),e.quill.updateContents(r,C.default.sources.USER),e.quill.setSelection(r.length()-n.length,C.default.sources.SILENT),e.quill.scrollingContainer.scrollTop=o,e.quill.focus()},1)}}},{key:"prepareMatching",value:function(){var t=this,e=[],n=[];return this.matchers.forEach(function(r){var o=k(r,2),i=o[0],l=o[1];switch(i){case Node.TEXT_NODE:n.push(l);break;case Node.ELEMENT_NODE:e.push(l);break;default:[].forEach.call(t.container.querySelectorAll(i),function(t){t[W]=t[W]||[],t[W].push(l)})}}),[e,n]}}]),e}(I.default);$.DEFAULTS={matchers:[],matchVisual:!0},e.default=$,e.matchAttributor=d,e.matchBlot=y,e.matchNewline=m,e.matchSpacing=_,e.matchText=w},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function a(t){var e=t.ops[t.ops.length-1];return null!=e&&(null!=e.insert?"string"==typeof e.insert&&e.insert.endsWith("\n"):null!=e.attributes&&Object.keys(e.attributes).some(function(t){return null!=f.default.query(t,f.default.Scope.BLOCK)}))}function s(t){var e=t.reduce(function(t,e){return t+=e.delete||0},0),n=t.length()-e;return a(t)&&(n-=1),n}Object.defineProperty(e,"__esModule",{value:!0}),e.getLastChangeIndex=e.default=void 0;var u=function(){function t(t,e){for(var n=0;nr&&this.stack.undo.length>0){var o=this.stack.undo.pop();n=n.compose(o.undo),t=o.redo.compose(t)}else this.lastRecorded=r;this.stack.undo.push({redo:t,undo:n}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift()}}},{key:"redo",value:function(){this.change("redo","undo")}},{key:"transform",value:function(t){this.stack.undo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)}),this.stack.redo.forEach(function(e){e.undo=t.transform(e.undo,!0),e.redo=t.transform(e.redo,!0)})}},{key:"undo",value:function(){this.change("undo","redo")}}]),e}(y.default);v.DEFAULTS={delay:1e3,maxStack:100,userOnly:!1},e.default=v,e.getLastChangeIndex=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.IndentClass=void 0;var l=function(){function t(t,e){for(var n=0;n0&&this.children.tail.format(t,e)}},{key:"formats",value:function(){return o({},this.statics.blotName,this.statics.formats(this.domNode))}},{key:"insertBefore",value:function(t,n){if(t instanceof v)u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"insertBefore",this).call(this,t,n);else{var r=null==n?this.length():n.offset(this),o=this.split(r);o.parent.insertBefore(t,o)}}},{key:"optimize",value:function(t){u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"optimize",this).call(this,t);var n=this.next;null!=n&&n.prev===this&&n.statics.blotName===this.statics.blotName&&n.domNode.tagName===this.domNode.tagName&&n.domNode.getAttribute("data-checked")===this.domNode.getAttribute("data-checked")&&(n.moveChildren(this),n.remove())}},{key:"replace",value:function(t){if(t.statics.blotName!==this.statics.blotName){var n=f.default.create(this.statics.defaultChild);t.moveChildren(n),this.appendChild(n)}u(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"replace",this).call(this,t)}}]),e}(y.default);b.blotName="list",b.scope=f.default.Scope.BLOCK_BLOT,b.tagName=["OL","UL"],b.defaultChild="list-item",b.allowedChildren=[v],e.ListItem=v,e.default=b},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=n(39),a=function(t){return t&&t.__esModule?t:{default:t}}(l),s=function(t){function e(){return r(this,e),o(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return i(e,t),e}(a.default);s.blotName="italic",s.tagName=["EM","I"],e.default=s},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=a(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return"string"==typeof t&&n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"match",value:function(t){return/\.(jpe?g|gif|png)$/.test(t)||/^data:image\/.+;base64/.test(t)}},{key:"sanitize",value:function(t){return(0,c.sanitize)(t,["http","https","data"])?t:"//:0"}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(u.default.Embed);h.blotName="image",h.tagName="IMG",e.default=h},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var l=function(){function t(t,e){for(var n=0;n-1?n?this.domNode.setAttribute(t,n):this.domNode.removeAttribute(t):a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"format",this).call(this,t,n)}}],[{key:"create",value:function(t){var n=a(e.__proto__||Object.getPrototypeOf(e),"create",this).call(this,t);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",!0),n.setAttribute("src",this.sanitize(t)),n}},{key:"formats",value:function(t){return f.reduce(function(e,n){return t.hasAttribute(n)&&(e[n]=t.getAttribute(n)),e},{})}},{key:"sanitize",value:function(t){return c.default.sanitize(t)}},{key:"value",value:function(t){return t.getAttribute("src")}}]),e}(s.BlockEmbed);h.blotName="video",h.className="ql-video",h.tagName="IFRAME",e.default=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.FormulaBlot=void 0;var a=function(){function t(t,e){for(var n=0;n0||null==this.cachedText)&&(this.domNode.innerHTML=t(e),this.domNode.normalize(),this.attach()),this.cachedText=e)}}]),e}(v.default);b.className="ql-syntax";var g=new c.default.Attributor.Class("token","hljs",{scope:c.default.Scope.INLINE}),m=function(t){function e(t,n){o(this,e);var r=i(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if("function"!=typeof r.options.highlight)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");var l=null;return r.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){clearTimeout(l),l=setTimeout(function(){r.highlight(),l=null},r.options.interval)}),r.highlight(),r}return l(e,t),a(e,null,[{key:"register",value:function(){h.default.register(g,!0),h.default.register(b,!0)}}]),a(e,[{key:"highlight",value:function(){var t=this;if(!this.quill.selection.composing){this.quill.update(h.default.sources.USER);var e=this.quill.getSelection();this.quill.scroll.descendants(b).forEach(function(e){e.highlight(t.options.highlight)}),this.quill.update(h.default.sources.SILENT),null!=e&&this.quill.setSelection(e,h.default.sources.SILENT)}}}]),e}(d.default);m.DEFAULTS={highlight:function(){return null==window.hljs?null:function(t){return window.hljs.highlightAuto(t).value}}(),interval:1e3},e.CodeBlock=b,e.CodeToken=g,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e,n){var r=document.createElement("button");r.setAttribute("type","button"),r.classList.add("ql-"+e),null!=n&&(r.value=n),t.appendChild(r)}function u(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(function(e){var n=document.createElement("span");n.classList.add("ql-formats"),e.forEach(function(t){if("string"==typeof t)s(n,t);else{var e=Object.keys(t)[0],r=t[e];Array.isArray(r)?c(n,e,r):s(n,e,r)}}),t.appendChild(n)})}function c(t,e,n){var r=document.createElement("select");r.classList.add("ql-"+e),n.forEach(function(t){var e=document.createElement("option");!1!==t?e.setAttribute("value",t):e.setAttribute("selected","selected"),r.appendChild(e)}),t.appendChild(r)}Object.defineProperty(e,"__esModule",{value:!0}),e.addControls=e.default=void 0;var f=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),h=function(){function t(t,e){for(var n=0;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=' '},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=' '},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,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.BubbleTooltip=void 0;var a=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},s=function(){function t(t,e){for(var n=0;n0&&o===h.default.sources.USER){r.show(),r.root.style.left="0px",r.root.style.width="",r.root.style.width=r.root.offsetWidth+"px";var i=r.quill.getLines(e.index,e.length);if(1===i.length)r.position(r.quill.getBounds(e));else{var l=i[i.length-1],a=r.quill.getIndex(l),s=Math.min(l.length()-1,e.index+e.length-a),u=r.quill.getBounds(new y.Range(a,s));r.position(u)}}else document.activeElement!==r.textbox&&r.quill.hasFocus()&&r.hide()}),r}return l(e,t),s(e,[{key:"listen",value:function(){var t=this;a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"listen",this).call(this),this.root.querySelector(".ql-close").addEventListener("click",function(){t.root.classList.remove("ql-editing")}),this.quill.on(h.default.events.SCROLL_OPTIMIZE,function(){setTimeout(function(){if(!t.root.classList.contains("ql-hidden")){var e=t.quill.getSelection();null!=e&&t.position(t.quill.getBounds(e))}},1)})}},{key:"cancel",value:function(){this.show()}},{key:"position",value:function(t){var n=a(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"position",this).call(this,t),r=this.root.querySelector(".ql-tooltip-arrow");if(r.style.marginLeft="",0===n)return n;r.style.marginLeft=-1*n-r.offsetWidth/2+"px"}}]),e}(p.BaseTooltip);_.TEMPLATE=['','
','','',"
"].join(""),e.BubbleTooltip=_,e.default=m},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var l,a=t[Symbol.iterator]();!(r=(l=a.next()).done)&&(n.push(l.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&a.return&&a.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),s=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var l=o.get;if(void 0!==l)return l.call(r)},u=function(){function t(t,e){for(var n=0;n','','',''].join(""),e.default=w}]).default}); +//# sourceMappingURL=quill.min.js.map \ No newline at end of file diff --git a/static/quill/quill.min.js.map b/static/quill/quill.min.js.map new file mode 100644 index 00000000..afd1d10b --- /dev/null +++ b/static/quill/quill.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///quill.min.js","webpack:///webpack/bootstrap 00e590d85b41be113db0","webpack:///../parchment/src/parchment.ts","webpack:///../parchment/src/registry.ts","webpack:///./node_modules/extend/index.js","webpack:///./blots/block.js","webpack:///./node_modules/quill-delta/lib/delta.js","webpack:///./blots/inline.js","webpack:///./core/quill.js","webpack:///./core/module.js","webpack:///./blots/text.js","webpack:///./core/emitter.js","webpack:///./core/logger.js","webpack:///../parchment/src/attributor/attributor.ts","webpack:///./node_modules/deep-equal/index.js","webpack:///./formats/code.js","webpack:///./blots/break.js","webpack:///./formats/link.js","webpack:///./ui/picker.js","webpack:///../parchment/src/blot/abstract/container.ts","webpack:///../parchment/src/blot/abstract/format.ts","webpack:///../parchment/src/blot/abstract/leaf.ts","webpack:///./node_modules/quill-delta/lib/op.js","webpack:///./node_modules/clone/clone.js","webpack:///./core/selection.js","webpack:///./blots/container.js","webpack:///./formats/color.js","webpack:///./ui/icons.js","webpack:///../parchment/src/blot/abstract/shadow.ts","webpack:///../parchment/src/attributor/store.ts","webpack:///../parchment/src/attributor/class.ts","webpack:///../parchment/src/attributor/style.ts","webpack:///./blots/cursor.js","webpack:///./core/theme.js","webpack:///./blots/embed.js","webpack:///./formats/align.js","webpack:///./formats/background.js","webpack:///./formats/direction.js","webpack:///./formats/font.js","webpack:///./formats/size.js","webpack:///./modules/keyboard.js","webpack:///./formats/bold.js","webpack:///./assets/icons/code.svg","webpack:///./ui/color-picker.js","webpack:///./ui/icon-picker.js","webpack:///./ui/tooltip.js","webpack:///./themes/base.js","webpack:///./quill.js","webpack:///./core.js","webpack:///../parchment/src/collection/linked-list.ts","webpack:///../parchment/src/blot/scroll.ts","webpack:///../parchment/src/blot/inline.ts","webpack:///../parchment/src/blot/block.ts","webpack:///../parchment/src/blot/embed.ts","webpack:///../parchment/src/blot/text.ts","webpack:///./core/polyfill.js","webpack:///./node_modules/fast-diff/diff.js","webpack:///./node_modules/deep-equal/lib/keys.js","webpack:///./node_modules/deep-equal/lib/is_arguments.js","webpack:///./core/editor.js","webpack:///./node_modules/eventemitter3/index.js","webpack:///./blots/scroll.js","webpack:///./modules/clipboard.js","webpack:///./modules/history.js","webpack:///./formats/indent.js","webpack:///./formats/blockquote.js","webpack:///./formats/header.js","webpack:///./formats/list.js","webpack:///./formats/italic.js","webpack:///./formats/script.js","webpack:///./formats/strike.js","webpack:///./formats/underline.js","webpack:///./formats/image.js","webpack:///./formats/video.js","webpack:///./modules/formula.js","webpack:///./modules/syntax.js","webpack:///./modules/toolbar.js","webpack:///./assets/icons/align-left.svg","webpack:///./assets/icons/align-center.svg","webpack:///./assets/icons/align-right.svg","webpack:///./assets/icons/align-justify.svg","webpack:///./assets/icons/background.svg","webpack:///./assets/icons/blockquote.svg","webpack:///./assets/icons/bold.svg","webpack:///./assets/icons/clean.svg","webpack:///./assets/icons/color.svg","webpack:///./assets/icons/direction-ltr.svg","webpack:///./assets/icons/direction-rtl.svg","webpack:///./assets/icons/float-center.svg","webpack:///./assets/icons/float-full.svg","webpack:///./assets/icons/float-left.svg","webpack:///./assets/icons/float-right.svg","webpack:///./assets/icons/formula.svg","webpack:///./assets/icons/header.svg","webpack:///./assets/icons/header-2.svg","webpack:///./assets/icons/italic.svg","webpack:///./assets/icons/image.svg","webpack:///./assets/icons/indent.svg","webpack:///./assets/icons/outdent.svg","webpack:///./assets/icons/link.svg","webpack:///./assets/icons/list-ordered.svg","webpack:///./assets/icons/list-bullet.svg","webpack:///./assets/icons/list-check.svg","webpack:///./assets/icons/subscript.svg","webpack:///./assets/icons/superscript.svg","webpack:///./assets/icons/strike.svg","webpack:///./assets/icons/underline.svg","webpack:///./assets/icons/video.svg","webpack:///./assets/icons/dropdown.svg","webpack:///./themes/bubble.js","webpack:///./themes/snow.js"],"names":["root","factory","exports","module","define","amd","this","modules","__webpack_require__","moduleId","installedModules","i","l","call","m","c","d","name","getter","o","Object","defineProperty","configurable","enumerable","get","n","__esModule","object","property","prototype","hasOwnProperty","p","s","value","container_1","format_1","leaf_1","scroll_1","inline_1","block_1","embed_1","text_1","attributor_1","class_1","style_1","store_1","Registry","Parchment","Scope","create","find","query","register","Container","default","Format","Leaf","Embed","Scroll","Block","Inline","Text","Attributor","Attribute","Class","Style","Store","input","match","ParchmentError","BlotClass","Node","TEXT_NODE","node","bubble","DATA_KEY","blot","parentNode","scope","ANY","types","attributes","LEVEL","BLOCK","INLINE","HTMLElement","names","getAttribute","split","classes","tags","tagName","TYPE","Definitions","_i","arguments","length","map","Definition","blotName","attrName","keyName","className","Array","isArray","toUpperCase","tagNames","forEach","tag","__extends","extendStatics","setPrototypeOf","__proto__","b","__","constructor","_super","message","_this","Error","hasOwn","toStr","toString","arr","isPlainObject","obj","hasOwnConstructor","hasIsPrototypeOf","key","extend","options","src","copy","copyIsArray","clone","target","deep","_interopRequireDefault","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","writable","bubbleFormats","formats","undefined","_extend2","parent","statics","BlockEmbed","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_get","receiver","Function","desc","getOwnPropertyDescriptor","getPrototypeOf","_extend","_quillDelta","_quillDelta2","_parchment","_parchment2","_break","_break2","_inline","_inline2","_text","_text2","_Parchment$Embed","apply","domNode","insert","values","attribute","BLOCK_ATTRIBUTE","index","format","def","endsWith","block","insertBefore","next","insertAt","slice","BLOCK_BLOT","_Parchment$Block","_this2","cache","delta","descendants","reduce","leaf","Math","min","lines","text","shift","children","tail","line","ref","head","remove","context","child","force","defaultChild","allowedChildren","diff","equal","op","NULL_CHARACTER","String","fromCharCode","Delta","ops","newOp","keys","push","delete","retain","lastOp","unshift","splice","chop","pop","filter","predicate","partition","passed","failed","initial","changeLength","elem","start","end","Infinity","iter","iterator","hasNext","nextOp","compose","other","thisIter","otherIter","peekType","peekLength","thisOp","otherOp","concat","strings","prep","join","diffResult","component","opLength","INSERT","DELETE","EQUAL","eachLine","newline","peek","indexOf","transform","priority","transformPosition","offset","nextType","_Parchment$Inline","compare","BLOT","isolate","wrap","moveChildren","selfIndex","order","otherIndex","_defineProperty","expandConfig","container","userConfig","clipboard","keyboard","history","theme","Quill","DEFAULTS","import","_theme2","themeConfig","config","moduleNames","moduleConfig","moduleClass","debug","error","toolbar","document","querySelector","modify","modifier","source","strict","isEnabled","_emitter4","sources","USER","range","getSelection","oldDelta","editor","change","shiftRange","setSelection","SILENT","_emitter","args","events","TEXT_CHANGE","emitter","emit","EDITOR_CHANGE","_emitter2","overload","_typeof","API","_map","pos","_map2","_slicedToArray","_map3","max","_map4","_selection","Range","Symbol","sliceIterator","_arr","_n","_d","_e","_s","done","err","_editor","_editor2","_emitter3","_module","_module2","_selection2","_logger","_logger2","_theme","html","innerHTML","trim","classList","add","__quill","addContainer","setAttribute","scrollingContainer","scroll","whitelist","selection","addModule","init","on","type","toggle","isBlank","SCROLL_UPDATE","mutations","lastRange","update","contents","convert","setContents","clear","placeholder","readOnly","disable","limit","level","imports","path","overwrite","warn","startsWith","refNode","createElement","setRange","_this3","_overload","_overload2","deleteText","enable","enabled","scrollTop","focus","scrollIntoView","_this4","formatLine","formatText","_this5","_overload3","_overload4","_this6","_overload5","_overload6","bounds","getBounds","containerBounds","getBoundingClientRect","bottom","top","height","left","right","width","getLength","_overload7","_overload8","getContents","getFormat","Number","MAX_VALUE","getRange","_overload9","_overload10","getText","hasFocus","embed","_this7","insertEmbed","_this8","_overload11","_overload12","insertText","contains","off","once","dangerouslyPasteHTML","_this9","_overload13","_overload14","removeFormat","_this10","deleted","applied","applyDelta","_overload15","_overload16","_this11","version","parchment","core/module","core/theme","Module","quill","TextBlot","_Parchment$Text","_eventemitter","_eventemitter2","eventName","addEventListener","_len","_key","querySelectorAll","_node$__quill$emitter","handleDOM","Emitter","_EventEmitter","listeners","log","event","_len2","_key2","_ref","handler","SCROLL_BEFORE_UPDATE","SCROLL_OPTIMIZE","SELECTION_CHANGE","method","levels","_console","console","namespace","ns","logger","bind","newLevel","attributeBit","ATTRIBUTE","item","canAdd","replace","removeAttribute","isUndefinedOrNull","isBuffer","x","objEquiv","a","opts","isArguments","pSlice","deepEqual","ka","objectKeys","kb","e","sort","actual","expected","Date","getTime","Code","_block","_block2","_Inline","CodeBlock","_Block","textContent","frag","_descendant","descendant","_descendant2","deleteAt","nextNewline","newlineIndex","prevNewline","isolateLength","formatAt","_descendant3","_descendant4","searchIndex","lastIndexOf","appendChild","prev","optimize","removeChild","unwrap","TAB","Break","sanitize","url","protocols","anchor","href","protocol","Link","PROTOCOL_WHITELIST","SANITIZED_URL","_dropdown","_dropdown2","Picker","select","buildPicker","style","display","label","option","hasAttribute","selectItem","buildItem","selected","buildLabel","buildOptions","trigger","selectedIndex","Event","dispatchEvent","createEvent","initEvent","close","isActive","makeBlot","childNodes","replaceChild","attach","linked_list_1","shadow_1","ContainerBlot","build","reverse","forEachAt","criteria","_a","lengthLeft","detach","childBlot","refBlot","some","insertInto","memo","targetParent","inclusive","position","after","addedNodes","removedNodes","mutation","body","compareDocumentPosition","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_FOLLOWING","nextSibling","FormatBlot","toLowerCase","replaceWith","replacement","wrapper","move","LeafBlot","INLINE_BLOT","Iterator","lib","keepNull","retOp","substr","_instanceof","circular","depth","includeNonEnumerable","_clone","proto","nativeMap","nativeSet","nativePromise","resolve","reject","then","__isArray","__isRegExp","RegExp","__getRegExpFlags","lastIndex","__isDate","useBuffer","Buffer","allParents","allChildren","keyChild","valueChild","set","entryChild","attrs","getOwnPropertySymbols","symbols","symbol","allPropertyNames","getOwnPropertyNames","propertyName","__objToStr","re","flags","global","ignoreCase","multiline","Map","_","Set","Promise","clonePrototype","_toConsumableArray","arr2","from","_clone2","_deepEqual","_deepEqual2","Selection","composing","mouseDown","cursor","savedRange","handleComposition","handleDragging","listenDOM","setTimeout","native","getNativeRange","textNode","setNativeRange","ignored","_context$range","startNode","startOffset","endNode","endOffset","restore","nativeRange","collapsed","data","scrollLength","_scroll$leaf","_scroll$leaf2","_leaf$position","_leaf$position2","createRange","setStart","_scroll$leaf3","_scroll$leaf4","_leaf$position3","_leaf$position4","setEnd","side","rect","rangeCount","getRangeAt","normalizeNative","info","normalized","normalizedToRange","activeElement","positions","indexes","_position","startContainer","endContainer","lastChild","_scroll$leaf5","_scroll$leaf6","_leaf$position5","_leaf$position6","_scroll$line","_scroll$line2","first","last","_scroll$line3","scrollBounds","removeAllRanges","addRange","blur","rangeToNative","oldRange","_getRange","_getRange2","_Parchment$Container","ColorStyle","ColorClass","ColorAttributor","_Parchment$Attributor","parseInt","align","","center","justify","background","blockquote","bold","clean","code","code-block","color","direction","rtl","float","full","formula","header","1","2","italic","image","indent","+1","-1","link","list","ordered","bullet","check","script","sub","super","strike","underline","video","ShadowBlot","cloneNode","parentBlot","refDomNode","AttributorStore","styles","attr","prefix","ClassAttributor","result","camelize","parts","rest","part","StyleAttributor","Cursor","createTextNode","CONTENTS","_length","restoreText","Theme","themes","GUARD_TEXT","contentNode","childNode","leftGuard","rightGuard","prevLength","AlignStyle","AlignClass","AlignAttribute","BackgroundStyle","BackgroundClass","_color","DirectionStyle","DirectionClass","DirectionAttribute","FontClass","FontStyle","FontStyleAttributor","SizeStyle","SizeClass","makeEmbedArrowHandler","shiftKey","_ref3","where","Keyboard","LEFT","altKey","RIGHT","_quill$getLeaf3","getLeaf","_quill2","handleBackspace","_quill$getLine11","getLine","_quill$getLine12","_quill$getLine13","_quill$getLine14","curFormats","prevFormats","_op2","test","handleDelete","suffix","nextLength","_quill$getLine15","_quill$getLine16","_quill$getLine17","_quill$getLine18","nextFormats","handleDeleteRange","getLines","firstFormats","lastFormats","handleEnter","lineFormats","makeCodeBlockHandler","_quill$scroll$descend","_quill$scroll$descend2","scrollIndex","getIndex","makeFormatHandler","shortKey","normalize","binding","charCodeAt","SHORTKEY","_op","_quill","navigator","platform","_Module","bindings","addBinding","ENTER","metaKey","ctrlKey","userAgent","BACKSPACE","listen","evt","which","keyCode","defaultPrevented","_quill$getLine","_quill$getLine2","_quill$getLeaf","_quill$getLeaf2","leafStart","offsetStart","_ref2","leafEnd","offsetEnd","prefixText","suffixText","curContext","empty","every","preventDefault","ESCAPE","UP","DOWN","outdent","outdent backspace","indent code-block","outdent code-block","remove tab","tab","cutoff","updateContents","list empty enter","checklist enter","_quill$getLine3","_quill$getLine4","header enter","_quill$getLine5","_quill$getLine6","list autofill","_quill$getLine7","_quill$getLine8","code exit","_quill$getLine9","_quill$getLine10","embed left","embed left shift","embed right","embed right shift","Bold","_picker","_picker2","ColorPicker","_Picker","backgroundColor","colorLabel","stroke","fill","IconPicker","icons","defaultItem","Tooltip","boundsContainer","TEMPLATE","marginTop","hide","reference","offsetWidth","rootBounds","verticalShift","extractVideoUrl","fillSelect","defaultValue","BaseTooltip","_keyboard","_keyboard2","_colorPicker","_colorPicker2","_iconPicker","_iconPicker2","_tooltip","_tooltip2","ALIGNS","COLORS","FONTS","HEADERS","SIZES","BaseTheme","_Theme","listener","removeEventListener","tooltip","textbox","pickers","picker","extendToolbar","buttons","button","selects","handlers","edit","fileInput","files","reader","FileReader","onload","readAsDataURL","click","_Tooltip","save","cancel","mode","preview","linkRange","restoreFocus","_core","_core2","_align","_direction","_indent","_blockquote","_blockquote2","_header","_header2","_list","_list2","_background","_font","_size","_bold","_bold2","_italic","_italic2","_link","_link2","_script","_script2","_strike","_strike2","_underline","_underline2","_image","_image2","_video","_video2","_code","_code2","_formula","_formula2","_syntax","_syntax2","_toolbar","_toolbar2","_icons","_icons2","_bubble","_bubble2","_snow","_snow2","attributors/attribute/direction","attributors/class/align","attributors/class/background","attributors/class/color","attributors/class/direction","attributors/class/font","attributors/class/size","attributors/style/align","attributors/style/background","attributors/style/color","attributors/style/direction","attributors/style/font","attributors/style/size","formats/align","formats/direction","formats/indent","IndentClass","formats/background","formats/color","formats/font","formats/size","formats/blockquote","formats/code-block","formats/header","formats/list","formats/bold","formats/code","formats/italic","formats/link","formats/script","formats/strike","formats/underline","formats/image","formats/video","formats/list/item","ListItem","modules/formula","modules/syntax","modules/toolbar","themes/bubble","themes/snow","ui/icons","ui/picker","ui/icon-picker","ui/color-picker","ui/tooltip","_container","_container2","_cursor","_cursor2","_embed","_embed2","_scroll","_scroll2","_clipboard","_clipboard2","_history","_history2","blots/block","blots/block/embed","blots/break","blots/container","blots/cursor","blots/embed","blots/inline","blots/scroll","blots/text","modules/clipboard","modules/history","modules/keyboard","LinkedList","append","nodes","cur","curNode","ret","callback","curIndex","curLength","OBSERVER_CONFIG","characterData","characterDataOldValue","childList","subtree","ScrollBlot","observer","MutationObserver","observe","disconnect","records","takeRecords","mark","markParent","remaining","previousSibling","grandChild","isEqual","obj1","obj2","prop","InlineBlot","BlockBlot","EmbedBlot","splitText","_toggle","DOMTokenList","token","searchString","subjectString","isFinite","floor","thisArg","execCommand","diff_main","text1","text2","cursor_pos","DIFF_EQUAL","commonlength","diff_commonPrefix","commonprefix","substring","diff_commonSuffix","commonsuffix","diffs","diff_compute_","diff_cleanupMerge","fix_cursor","fix_emoji","DIFF_INSERT","DIFF_DELETE","longtext","shorttext","hm","diff_halfMatch_","text1_a","text1_b","text2_a","text2_b","mid_common","diffs_a","diffs_b","diff_bisect_","text1_length","text2_length","max_d","ceil","v_offset","v_length","v1","v2","front","k1start","k1end","k2start","k2end","k1","x1","k1_offset","y1","charAt","k2_offset","x2","diff_bisectSplit_","k2","y2","y","text1a","text2a","text1b","text2b","diffsb","pointermin","pointermax","pointermid","pointerstart","pointerend","diff_halfMatchI_","best_longtext_a","best_longtext_b","best_shorttext_a","best_shorttext_b","seed","j","best_common","prefixLength","suffixLength","hm1","hm2","pointer","count_delete","count_insert","text_delete","text_insert","changes","cursor_normalize_diff","current_pos","next_pos","split_pos","d_left","d_right","norm","ndiffs","cursor_pointer","d_next","merge_tuples","compact","starts_with_pair_end","str","fixed_diffs","left_d","right_d","shim","supported","unsupported","propertyIsEnumerable","supportsArgumentsClass","combineFormats","combined","merged","normalizeDelta","ASCII","Editor","getDelta","consumeNextNewline","batchStart","_line$descendant","_line$descendant2","batchEnd","lengthRemaining","lineLength","codeIndex","codeLength","leaves","_path","formatsArr","blots","_scroll$line4","cursorIndex","textBlot","oldValue","oldText","newText","Events","EE","fn","EventEmitter","_events","_eventsCount","has","eventNames","exists","available","ee","a1","a2","a3","a4","a5","len","removeListener","removeAllListeners","addListener","setMaxListeners","prefixed","isLine","_Parchment$Scroll","batch","_line","_line2","_line3","_line4","applyFormat","_extend3","computeStyle","nodeType","ELEMENT_NODE","window","getComputedStyle","deltaEndsWith","endText","traverse","elementMatchers","textMatchers","matcher","childrenDelta","DOM_KEY","matchAlias","matchAttributor","ATTRIBUTE_ATTRIBUTORS","STYLE_ATTRIBUTORS","matchBlot","matchBreak","matchIgnore","matchIndent","matchNewline","matchSpacing","nextElementSibling","nodeHeight","offsetHeight","parseFloat","marginBottom","offsetTop","matchStyles","fontStyle","fontWeight","textIndent","matchText","whiteSpace","replacer","collapse","CLIPBOARD_CONFIG","Clipboard","onPaste","matchers","selector","matchVisual","addMatcher","innerText","_prepareMatching","prepareMatching","_prepareMatching2","paste","pair","_pair","endsWithNewlineChange","getLastChangeIndex","deleteLength","changeIndex","History","lastRecorded","ignoreChange","userOnly","record","undo","redo","dest","stack","changeDelta","undoDelta","timestamp","now","delay","maxStack","IdentAttributor","Blockquote","Header","List","_Container","listEventHandler","Italic","_Bold","Script","Strike","Underline","ATTRIBUTES","Image","Video","_BlockEmbed","FormulaBlot","_Embed","katex","render","throwOnError","errorColor","Formula","CodeToken","SyntaxCodeBlock","_CodeBlock","highlight","cachedText","Syntax","timer","clearTimeout","interval","hljs","highlightAuto","addButton","addControls","groups","controls","group","control","addSelect","Toolbar","_ret","addHandler","_this$quill$selection","_this$quill$selection2","_quill$selection$getR","_quill$selection$getR2","prompt","BubbleTooltip","_base","_base2","TOOLBAR_CONFIG","BubbleTheme","_BaseTheme","buildButtons","buildPickers","_BaseTooltip","show","lastLine","arrow","marginLeft","SnowTheme","SnowTooltip"],"mappings":";;;;;;CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,IACA,kBAAAG,gBAAAC,IACAD,UAAAH,GACA,gBAAAC,SACAA,QAAA,MAAAD,IAEAD,EAAA,MAAAC,KACCK,KAAA,WACD,MCMgB,UAAUC,GCZ1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAP,OAGA,IAAAC,GAAAO,EAAAD,IACAE,EAAAF,EACAG,GAAA,EACAV,WAUA,OANAK,GAAAE,GAAAI,KAAAV,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAAS,GAAA,EAGAT,EAAAD,QAvBA,GAAAQ,KA4DA,OAhCAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,SAAAd,EAAAe,EAAAC,GACAV,EAAAW,EAAAjB,EAAAe,IACAG,OAAAC,eAAAnB,EAAAe,GACAK,cAAA,EACAC,YAAA,EACAC,IAAAN,KAMAV,EAAAiB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B,EAD8C+kB,EAAA,EAEzD,IAAY,MAAR1F,EAAc,CAChBvX,EAAKslB,UAAY,GAAAjpB,GAAAC,MAAU3B,EAAMpI,MAAQ2F,EAAQqf,EAAK1qB,SACtD,IAAIw4B,GAAUsB,EAAAx8B,QAASgG,QAAQonB,EAAKrlB,QAKpC,OAJA8N,GAAKqlB,QAAQnd,YAAcmd,EAC3BrlB,EAAKqlB,QAAQrnB,aAAa,OAAQqnB,GAClCrlB,EAAKqhC,WACLrhC,GAAK6M,SAAS7M,EAAKmE,MAAMhD,UAAUnB,EAAKslB,wBAInCtlB,GAAKslB,SAEdtlB,GAAKsiB,a9G4gWPzzB,IAAK,OACL/F,MAAO,W8GxgWPiI,EAAA2wC,EAAAh5C,UAAAmF,WAAA5F,OAAAmJ,eAAAswC,EAAAh5C,WAAA,OAAAvB,MAAAO,KAAAP,MACAA,KAAKN,KAAK4f,gBAAgB,iB9G6gWrBi7B,GACPb,EAAM/d,Y8G3gWR4e,GAAYtf,UACV,gEACA,mGACA,4BACA,6BACAhrB,KAAK,I9G0gWPrQ,EAAQoD,Q8GvgWOs3C,K9G0gWM","file":"quill.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","/*!\n * Quill Editor v1.3.5\n * https://quilljs.com/\n * Copyright (c) 2014, Jason Chen\n * Copyright (c) 2013, salesforce.com\n */\n(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"Quill\"] = factory();\n\telse\n\t\troot[\"Quill\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 45);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __webpack_require__(17);\nvar format_1 = __webpack_require__(18);\nvar leaf_1 = __webpack_require__(19);\nvar scroll_1 = __webpack_require__(48);\nvar inline_1 = __webpack_require__(49);\nvar block_1 = __webpack_require__(50);\nvar embed_1 = __webpack_require__(51);\nvar text_1 = __webpack_require__(52);\nvar attributor_1 = __webpack_require__(11);\nvar class_1 = __webpack_require__(28);\nvar style_1 = __webpack_require__(29);\nvar store_1 = __webpack_require__(27);\nvar Registry = __webpack_require__(1);\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BlockEmbed = exports.bubbleFormats = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar NEWLINE_LENGTH = 1;\n\nvar BlockEmbed = function (_Parchment$Embed) {\n _inherits(BlockEmbed, _Parchment$Embed);\n\n function BlockEmbed() {\n _classCallCheck(this, BlockEmbed);\n\n return _possibleConstructorReturn(this, (BlockEmbed.__proto__ || Object.getPrototypeOf(BlockEmbed)).apply(this, arguments));\n }\n\n _createClass(BlockEmbed, [{\n key: 'attach',\n value: function attach() {\n _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'attach', this).call(this);\n this.attributes = new _parchment2.default.Attributor.Store(this.domNode);\n }\n }, {\n key: 'delta',\n value: function delta() {\n return new _quillDelta2.default().insert(this.value(), (0, _extend2.default)(this.formats(), this.attributes.values()));\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n var attribute = _parchment2.default.query(name, _parchment2.default.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n this.format(name, value);\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n var block = _parchment2.default.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n _get(BlockEmbed.prototype.__proto__ || Object.getPrototypeOf(BlockEmbed.prototype), 'insertAt', this).call(this, index, value, def);\n }\n }\n }]);\n\n return BlockEmbed;\n}(_parchment2.default.Embed);\n\nBlockEmbed.scope = _parchment2.default.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nvar Block = function (_Parchment$Block) {\n _inherits(Block, _Parchment$Block);\n\n function Block(domNode) {\n _classCallCheck(this, Block);\n\n var _this2 = _possibleConstructorReturn(this, (Block.__proto__ || Object.getPrototypeOf(Block)).call(this, domNode));\n\n _this2.cache = {};\n return _this2;\n }\n\n _createClass(Block, [{\n key: 'delta',\n value: function delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(_parchment2.default.Leaf).reduce(function (delta, leaf) {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new _quillDelta2.default()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n }, {\n key: 'deleteAt',\n value: function deleteAt(index, length) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'deleteAt', this).call(this, index, length);\n this.cache = {};\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'formatAt', this).call(this, index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null) return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, index, value, def);\n if (value.length === 0) return;\n var lines = value.split('\\n');\n var text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertAt', this).call(this, Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n var block = this;\n lines.reduce(function (index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n var head = this.children.head;\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'insertBefore', this).call(this, blot, ref);\n if (head instanceof _break2.default) {\n head.remove();\n }\n this.cache = {};\n }\n }, {\n key: 'length',\n value: function length() {\n if (this.cache.length == null) {\n this.cache.length = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'length', this).call(this) + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n }, {\n key: 'moveChildren',\n value: function moveChildren(target, ref) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'moveChildren', this).call(this, target, ref);\n this.cache = {};\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'optimize', this).call(this, context);\n this.cache = {};\n }\n }, {\n key: 'path',\n value: function path(index) {\n return _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'path', this).call(this, index, true);\n }\n }, {\n key: 'removeChild',\n value: function removeChild(child) {\n _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'removeChild', this).call(this, child);\n this.cache = {};\n }\n }, {\n key: 'split',\n value: function split(index) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n var clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n var next = _get(Block.prototype.__proto__ || Object.getPrototypeOf(Block.prototype), 'split', this).call(this, index, force);\n this.cache = {};\n return next;\n }\n }\n }]);\n\n return Block;\n}(_parchment2.default.Block);\n\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [_inline2.default, _parchment2.default.Embed, _text2.default];\n\nfunction bubbleFormats(blot) {\n var formats = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = (0, _extend2.default)(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\nexports.bubbleFormats = bubbleFormats;\nexports.BlockEmbed = BlockEmbed;\nexports.default = Block;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar diff = __webpack_require__(54);\nvar equal = __webpack_require__(12);\nvar extend = __webpack_require__(2);\nvar op = __webpack_require__(20);\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Inline = function (_Parchment$Inline) {\n _inherits(Inline, _Parchment$Inline);\n\n function Inline() {\n _classCallCheck(this, Inline);\n\n return _possibleConstructorReturn(this, (Inline.__proto__ || Object.getPrototypeOf(Inline)).apply(this, arguments));\n }\n\n _createClass(Inline, [{\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && _parchment2.default.query(name, _parchment2.default.Scope.BLOT)) {\n var blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'formatAt', this).call(this, index, length, name, value);\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(Inline.prototype.__proto__ || Object.getPrototypeOf(Inline.prototype), 'optimize', this).call(this, context);\n if (this.parent instanceof Inline && Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n var parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n }], [{\n key: 'compare',\n value: function compare(self, other) {\n var selfIndex = Inline.order.indexOf(self);\n var otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n }]);\n\n return Inline;\n}(_parchment2.default.Inline);\n\nInline.allowedChildren = [Inline, _parchment2.default.Embed, _text2.default];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = ['cursor', 'inline', // Must be lower\n'underline', 'strike', 'italic', 'bold', 'script', 'link', 'code' // Must be higher\n];\n\nexports.default = Inline;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.overload = exports.expandConfig = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\n__webpack_require__(53);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _editor = __webpack_require__(57);\n\nvar _editor2 = _interopRequireDefault(_editor);\n\nvar _emitter3 = __webpack_require__(9);\n\nvar _emitter4 = _interopRequireDefault(_emitter3);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _selection = __webpack_require__(22);\n\nvar _selection2 = _interopRequireDefault(_selection);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _theme = __webpack_require__(31);\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar debug = (0, _logger2.default)('quill');\n\nvar Quill = function () {\n _createClass(Quill, null, [{\n key: 'debug',\n value: function debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n _logger2.default.level(limit);\n }\n }, {\n key: 'find',\n value: function find(node) {\n return node.__quill || _parchment2.default.find(node);\n }\n }, {\n key: 'import',\n value: function _import(name) {\n if (this.imports[name] == null) {\n debug.error('Cannot import ' + name + '. Are you sure it was registered?');\n }\n return this.imports[name];\n }\n }, {\n key: 'register',\n value: function register(path, target) {\n var _this = this;\n\n var overwrite = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n if (typeof path !== 'string') {\n var name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach(function (key) {\n _this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn('Overwriting ' + path + ' with', target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) && target.blotName !== 'abstract') {\n _parchment2.default.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n }]);\n\n function Quill(container) {\n var _this2 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Quill);\n\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n var html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new _emitter4.default();\n this.scroll = _parchment2.default.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new _editor2.default(this.scroll);\n this.selection = new _selection2.default(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type) {\n if (type === _emitter4.default.events.TEXT_CHANGE) {\n _this2.root.classList.toggle('ql-blank', _this2.editor.isBlank());\n }\n });\n this.emitter.on(_emitter4.default.events.SCROLL_UPDATE, function (source, mutations) {\n var range = _this2.selection.lastRange;\n var index = range && range.length === 0 ? range.index : undefined;\n modify.call(_this2, function () {\n return _this2.editor.update(null, mutations, index);\n }, source);\n });\n var contents = this.clipboard.convert('
' + html + '


');\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n _createClass(Quill, [{\n key: 'addContainer',\n value: function addContainer(container) {\n var refNode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (typeof container === 'string') {\n var className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n }, {\n key: 'blur',\n value: function blur() {\n this.selection.setRange(null);\n }\n }, {\n key: 'deleteText',\n value: function deleteText(index, length, source) {\n var _this3 = this;\n\n var _overload = overload(index, length, source);\n\n var _overload2 = _slicedToArray(_overload, 4);\n\n index = _overload2[0];\n length = _overload2[1];\n source = _overload2[3];\n\n return modify.call(this, function () {\n return _this3.editor.deleteText(index, length);\n }, source, index, -1 * length);\n }\n }, {\n key: 'disable',\n value: function disable() {\n this.enable(false);\n }\n }, {\n key: 'enable',\n value: function enable() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n }, {\n key: 'focus',\n value: function focus() {\n var scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n var _this4 = this;\n\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n var range = _this4.getSelection(true);\n var change = new _quillDelta2.default();\n if (range == null) {\n return change;\n } else if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK)) {\n change = _this4.editor.formatLine(range.index, range.length, _defineProperty({}, name, value));\n } else if (range.length === 0) {\n _this4.selection.format(name, value);\n return change;\n } else {\n change = _this4.editor.formatText(range.index, range.length, _defineProperty({}, name, value));\n }\n _this4.setSelection(range, _emitter4.default.sources.SILENT);\n return change;\n }, source);\n }\n }, {\n key: 'formatLine',\n value: function formatLine(index, length, name, value, source) {\n var _this5 = this;\n\n var formats = void 0;\n\n var _overload3 = overload(index, length, name, value, source);\n\n var _overload4 = _slicedToArray(_overload3, 4);\n\n index = _overload4[0];\n length = _overload4[1];\n formats = _overload4[2];\n source = _overload4[3];\n\n return modify.call(this, function () {\n return _this5.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n }, {\n key: 'formatText',\n value: function formatText(index, length, name, value, source) {\n var _this6 = this;\n\n var formats = void 0;\n\n var _overload5 = overload(index, length, name, value, source);\n\n var _overload6 = _slicedToArray(_overload5, 4);\n\n index = _overload6[0];\n length = _overload6[1];\n formats = _overload6[2];\n source = _overload6[3];\n\n return modify.call(this, function () {\n return _this6.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n }, {\n key: 'getBounds',\n value: function getBounds(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var bounds = void 0;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n var containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n }, {\n key: 'getContents',\n value: function getContents() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload7 = overload(index, length);\n\n var _overload8 = _slicedToArray(_overload7, 2);\n\n index = _overload8[0];\n length = _overload8[1];\n\n return this.editor.getContents(index, length);\n }\n }, {\n key: 'getFormat',\n value: function getFormat() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getSelection(true);\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n }, {\n key: 'getIndex',\n value: function getIndex(blot) {\n return blot.offset(this.scroll);\n }\n }, {\n key: 'getLength',\n value: function getLength() {\n return this.scroll.length();\n }\n }, {\n key: 'getLeaf',\n value: function getLeaf(index) {\n return this.scroll.leaf(index);\n }\n }, {\n key: 'getLine',\n value: function getLine(index) {\n return this.scroll.line(index);\n }\n }, {\n key: 'getLines',\n value: function getLines() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n }, {\n key: 'getModule',\n value: function getModule(name) {\n return this.theme.modules[name];\n }\n }, {\n key: 'getSelection',\n value: function getSelection() {\n var focus = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n }, {\n key: 'getText',\n value: function getText() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getLength() - index;\n\n var _overload9 = overload(index, length);\n\n var _overload10 = _slicedToArray(_overload9, 2);\n\n index = _overload10[0];\n length = _overload10[1];\n\n return this.editor.getText(index, length);\n }\n }, {\n key: 'hasFocus',\n value: function hasFocus() {\n return this.selection.hasFocus();\n }\n }, {\n key: 'insertEmbed',\n value: function insertEmbed(index, embed, value) {\n var _this7 = this;\n\n var source = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : Quill.sources.API;\n\n return modify.call(this, function () {\n return _this7.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n }, {\n key: 'insertText',\n value: function insertText(index, text, name, value, source) {\n var _this8 = this;\n\n var formats = void 0;\n\n var _overload11 = overload(index, 0, name, value, source);\n\n var _overload12 = _slicedToArray(_overload11, 4);\n\n index = _overload12[0];\n formats = _overload12[2];\n source = _overload12[3];\n\n return modify.call(this, function () {\n return _this8.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n }, {\n key: 'isEnabled',\n value: function isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n }, {\n key: 'off',\n value: function off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n }, {\n key: 'on',\n value: function on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n }, {\n key: 'once',\n value: function once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n }, {\n key: 'pasteHTML',\n value: function pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n }, {\n key: 'removeFormat',\n value: function removeFormat(index, length, source) {\n var _this9 = this;\n\n var _overload13 = overload(index, length, source);\n\n var _overload14 = _slicedToArray(_overload13, 4);\n\n index = _overload14[0];\n length = _overload14[1];\n source = _overload14[3];\n\n return modify.call(this, function () {\n return _this9.editor.removeFormat(index, length);\n }, source, index);\n }\n }, {\n key: 'scrollIntoView',\n value: function scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }, {\n key: 'setContents',\n value: function setContents(delta) {\n var _this10 = this;\n\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n delta = new _quillDelta2.default(delta);\n var length = _this10.getLength();\n var deleted = _this10.editor.deleteText(0, length);\n var applied = _this10.editor.applyDelta(delta);\n var lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof lastOp.insert === 'string' && lastOp.insert[lastOp.insert.length - 1] === '\\n') {\n _this10.editor.deleteText(_this10.getLength() - 1, 1);\n applied.delete(1);\n }\n var ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n }, {\n key: 'setSelection',\n value: function setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n var _overload15 = overload(index, length, source);\n\n var _overload16 = _slicedToArray(_overload15, 4);\n\n index = _overload16[0];\n length = _overload16[1];\n source = _overload16[3];\n\n this.selection.setRange(new _selection.Range(index, length), source);\n if (source !== _emitter4.default.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n }, {\n key: 'setText',\n value: function setText(text) {\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n var delta = new _quillDelta2.default().insert(text);\n return this.setContents(delta, source);\n }\n }, {\n key: 'update',\n value: function update() {\n var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\n var change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n }, {\n key: 'updateContents',\n value: function updateContents(delta) {\n var _this11 = this;\n\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _emitter4.default.sources.API;\n\n return modify.call(this, function () {\n delta = new _quillDelta2.default(delta);\n return _this11.editor.applyDelta(delta, source);\n }, source, true);\n }\n }]);\n\n return Quill;\n}();\n\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = _emitter4.default.events;\nQuill.sources = _emitter4.default.sources;\n// eslint-disable-next-line no-undef\nQuill.version = false ? 'dev' : \"1.3.5\";\n\nQuill.imports = {\n 'delta': _quillDelta2.default,\n 'parchment': _parchment2.default,\n 'core/module': _module2.default,\n 'core/theme': _theme2.default\n};\n\nfunction expandConfig(container, userConfig) {\n userConfig = (0, _extend2.default)(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = _theme2.default;\n } else {\n userConfig.theme = Quill.import('themes/' + userConfig.theme);\n if (userConfig.theme == null) {\n throw new Error('Invalid theme ' + userConfig.theme + '. Did you register it?');\n }\n }\n var themeConfig = (0, _extend2.default)(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function (config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function (module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n var moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n var moduleConfig = moduleNames.reduce(function (config, name) {\n var moduleClass = Quill.import('modules/' + name);\n if (moduleClass == null) {\n debug.error('Cannot load ' + name + ' module. Are you sure you registered it?');\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar && userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = (0, _extend2.default)(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function (key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function (config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === _emitter4.default.sources.USER) {\n return new _quillDelta2.default();\n }\n var range = index == null ? null : this.getSelection();\n var oldDelta = this.editor.delta;\n var change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, _emitter4.default.sources.SILENT);\n }\n if (change.length() > 0) {\n var _emitter;\n\n var args = [_emitter4.default.events.TEXT_CHANGE, change, oldDelta, source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n var formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || _emitter4.default.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n var start = void 0,\n end = void 0;\n if (index instanceof _quillDelta2.default) {\n var _map = [range.index, range.index + range.length].map(function (pos) {\n return index.transformPosition(pos, source !== _emitter4.default.sources.USER);\n });\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n } else {\n var _map3 = [range.index, range.index + range.length].map(function (pos) {\n if (pos < index || pos === index && source === _emitter4.default.sources.USER) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n\n var _map4 = _slicedToArray(_map3, 2);\n\n start = _map4[0];\n end = _map4[1];\n }\n return new _selection.Range(start, end - start);\n}\n\nexports.expandConfig = expandConfig;\nexports.overload = overload;\nexports.default = Quill;\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Module = function Module(quill) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Module);\n\n this.quill = quill;\n this.options = options;\n};\n\nModule.DEFAULTS = {};\n\nexports.default = Module;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TextBlot = function (_Parchment$Text) {\n _inherits(TextBlot, _Parchment$Text);\n\n function TextBlot() {\n _classCallCheck(this, TextBlot);\n\n return _possibleConstructorReturn(this, (TextBlot.__proto__ || Object.getPrototypeOf(TextBlot)).apply(this, arguments));\n }\n\n return TextBlot;\n}(_parchment2.default.Text);\n\nexports.default = TextBlot;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _eventemitter = __webpack_require__(58);\n\nvar _eventemitter2 = _interopRequireDefault(_eventemitter);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:events');\n\nvar EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(function (eventName) {\n document.addEventListener(eventName, function () {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n [].slice.call(document.querySelectorAll('.ql-container')).forEach(function (node) {\n // TODO use WeakMap\n if (node.__quill && node.__quill.emitter) {\n var _node$__quill$emitter;\n\n (_node$__quill$emitter = node.__quill.emitter).handleDOM.apply(_node$__quill$emitter, args);\n }\n });\n });\n});\n\nvar Emitter = function (_EventEmitter) {\n _inherits(Emitter, _EventEmitter);\n\n function Emitter() {\n _classCallCheck(this, Emitter);\n\n var _this = _possibleConstructorReturn(this, (Emitter.__proto__ || Object.getPrototypeOf(Emitter)).call(this));\n\n _this.listeners = {};\n _this.on('error', debug.error);\n return _this;\n }\n\n _createClass(Emitter, [{\n key: 'emit',\n value: function emit() {\n debug.log.apply(debug, arguments);\n _get(Emitter.prototype.__proto__ || Object.getPrototypeOf(Emitter.prototype), 'emit', this).apply(this, arguments);\n }\n }, {\n key: 'handleDOM',\n value: function handleDOM(event) {\n for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n (this.listeners[event.type] || []).forEach(function (_ref) {\n var node = _ref.node,\n handler = _ref.handler;\n\n if (event.target === node || node.contains(event.target)) {\n handler.apply(undefined, [event].concat(args));\n }\n });\n }\n }, {\n key: 'listenDOM',\n value: function listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node: node, handler: handler });\n }\n }]);\n\n return Emitter;\n}(_eventemitter2.default);\n\nEmitter.events = {\n EDITOR_CHANGE: 'editor-change',\n SCROLL_BEFORE_UPDATE: 'scroll-before-update',\n SCROLL_OPTIMIZE: 'scroll-optimize',\n SCROLL_UPDATE: 'scroll-update',\n SELECTION_CHANGE: 'selection-change',\n TEXT_CHANGE: 'text-change'\n};\nEmitter.sources = {\n API: 'api',\n SILENT: 'silent',\n USER: 'user'\n};\n\nexports.default = Emitter;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nvar levels = ['error', 'warn', 'log', 'info'];\nvar level = 'warn';\n\nfunction debug(method) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n var _console;\n\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n (_console = console)[method].apply(_console, args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function (logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function (newLevel) {\n level = newLevel;\n};\n\nexports.default = namespace;\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = __webpack_require__(1);\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar pSlice = Array.prototype.slice;\nvar objectKeys = __webpack_require__(55);\nvar isArguments = __webpack_require__(56);\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Code = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Code = function (_Inline) {\n _inherits(Code, _Inline);\n\n function Code() {\n _classCallCheck(this, Code);\n\n return _possibleConstructorReturn(this, (Code.__proto__ || Object.getPrototypeOf(Code)).apply(this, arguments));\n }\n\n return Code;\n}(_inline2.default);\n\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\nvar CodeBlock = function (_Block) {\n _inherits(CodeBlock, _Block);\n\n function CodeBlock() {\n _classCallCheck(this, CodeBlock);\n\n return _possibleConstructorReturn(this, (CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock)).apply(this, arguments));\n }\n\n _createClass(CodeBlock, [{\n key: 'delta',\n value: function delta() {\n var _this3 = this;\n\n var text = this.domNode.textContent;\n if (text.endsWith('\\n')) {\n // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce(function (delta, frag) {\n return delta.insert(frag).insert('\\n', _this3.formats());\n }, new _quillDelta2.default());\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n if (name === this.statics.blotName && value) return;\n\n var _descendant = this.descendant(_text2.default, this.length() - 1),\n _descendant2 = _slicedToArray(_descendant, 1),\n text = _descendant2[0];\n\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'format', this).call(this, name, value);\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, name, value) {\n if (length === 0) return;\n if (_parchment2.default.query(name, _parchment2.default.Scope.BLOCK) == null || name === this.statics.blotName && value === this.statics.formats(this.domNode)) {\n return;\n }\n var nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n var prevNewline = this.newlineIndex(index, true) + 1;\n var isolateLength = nextNewline - prevNewline + 1;\n var blot = this.isolate(prevNewline, isolateLength);\n var next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null) return;\n\n var _descendant3 = this.descendant(_text2.default, index),\n _descendant4 = _slicedToArray(_descendant3, 2),\n text = _descendant4[0],\n offset = _descendant4[1];\n\n text.insertAt(offset, value);\n }\n }, {\n key: 'length',\n value: function length() {\n var length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n }, {\n key: 'newlineIndex',\n value: function newlineIndex(searchIndex) {\n var reverse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n if (!reverse) {\n var offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(_parchment2.default.create('text', '\\n'));\n }\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'optimize', this).call(this, context);\n var next = this.next;\n if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n }, {\n key: 'replace',\n value: function replace(target) {\n _get(CodeBlock.prototype.__proto__ || Object.getPrototypeOf(CodeBlock.prototype), 'replace', this).call(this, target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function (node) {\n var blot = _parchment2.default.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof _parchment2.default.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var domNode = _get(CodeBlock.__proto__ || Object.getPrototypeOf(CodeBlock), 'create', this).call(this, value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n }, {\n key: 'formats',\n value: function formats() {\n return true;\n }\n }]);\n\n return CodeBlock;\n}(_block2.default);\n\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\nexports.Code = Code;\nexports.default = CodeBlock;\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Break = function (_Parchment$Embed) {\n _inherits(Break, _Parchment$Embed);\n\n function Break() {\n _classCallCheck(this, Break);\n\n return _possibleConstructorReturn(this, (Break.__proto__ || Object.getPrototypeOf(Break)).apply(this, arguments));\n }\n\n _createClass(Break, [{\n key: 'insertInto',\n value: function insertInto(parent, ref) {\n if (parent.children.length === 0) {\n _get(Break.prototype.__proto__ || Object.getPrototypeOf(Break.prototype), 'insertInto', this).call(this, parent, ref);\n } else {\n this.remove();\n }\n }\n }, {\n key: 'length',\n value: function length() {\n return 0;\n }\n }, {\n key: 'value',\n value: function value() {\n return '';\n }\n }], [{\n key: 'value',\n value: function value() {\n return undefined;\n }\n }]);\n\n return Break;\n}(_parchment2.default.Embed);\n\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\nexports.default = Break;\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.sanitize = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Link = function (_Inline) {\n _inherits(Link, _Inline);\n\n function Link() {\n _classCallCheck(this, Link);\n\n return _possibleConstructorReturn(this, (Link.__proto__ || Object.getPrototypeOf(Link)).apply(this, arguments));\n }\n\n _createClass(Link, [{\n key: 'format',\n value: function format(name, value) {\n if (name !== this.statics.blotName || !value) return _get(Link.prototype.__proto__ || Object.getPrototypeOf(Link.prototype), 'format', this).call(this, name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Link.__proto__ || Object.getPrototypeOf(Link), 'create', this).call(this, value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return domNode.getAttribute('href');\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return _sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n }]);\n\n return Link;\n}(_inline2.default);\n\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\nfunction _sanitize(url, protocols) {\n var anchor = document.createElement('a');\n anchor.href = url;\n var protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\nexports.default = Link;\nexports.sanitize = _sanitize;\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _dropdown = __webpack_require__(106);\n\nvar _dropdown2 = _interopRequireDefault(_dropdown);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Picker = function () {\n function Picker(select) {\n var _this = this;\n\n _classCallCheck(this, Picker);\n\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n this.label.addEventListener('mousedown', function () {\n _this.container.classList.toggle('ql-expanded');\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n _createClass(Picker, [{\n key: 'buildItem',\n value: function buildItem(option) {\n var _this2 = this;\n\n var item = document.createElement('span');\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', function () {\n _this2.selectItem(item, true);\n });\n return item;\n }\n }, {\n key: 'buildLabel',\n value: function buildLabel() {\n var label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = _dropdown2.default;\n this.container.appendChild(label);\n return label;\n }\n }, {\n key: 'buildOptions',\n value: function buildOptions() {\n var _this3 = this;\n\n var options = document.createElement('span');\n options.classList.add('ql-picker-options');\n [].slice.call(this.select.options).forEach(function (option) {\n var item = _this3.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n _this3.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n }, {\n key: 'buildPicker',\n value: function buildPicker() {\n var _this4 = this;\n\n [].slice.call(this.select.attributes).forEach(function (item) {\n _this4.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n }, {\n key: 'close',\n value: function close() {\n this.container.classList.remove('ql-expanded');\n }\n }, {\n key: 'selectItem',\n value: function selectItem(item) {\n var trigger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n\n var selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if ((typeof Event === 'undefined' ? 'undefined' : _typeof(Event)) === 'object') {\n // IE11\n var event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n }\n }, {\n key: 'update',\n value: function update() {\n var option = void 0;\n if (this.select.selectedIndex > -1) {\n var item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n var isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n }]);\n\n return Picker;\n}();\n\nexports.default = Picker;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = __webpack_require__(47);\nvar shadow_1 = __webpack_require__(26);\nvar Registry = __webpack_require__(1);\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nvar store_1 = __webpack_require__(27);\nvar container_1 = __webpack_require__(17);\nvar Registry = __webpack_require__(1);\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = __webpack_require__(26);\nvar Registry = __webpack_require__(1);\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar equal = __webpack_require__(12);\nvar extend = __webpack_require__(2);\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\n\nmodule.exports = lib;\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\nvar clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.Range = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _emitter3 = __webpack_require__(9);\n\nvar _emitter4 = _interopRequireDefault(_emitter3);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar debug = (0, _logger2.default)('quill:selection');\n\nvar Range = function Range(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n _classCallCheck(this, Range);\n\n this.index = index;\n this.length = length;\n};\n\nvar Selection = function () {\n function Selection(scroll, emitter) {\n var _this = this;\n\n _classCallCheck(this, Selection);\n\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = _parchment2.default.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, function () {\n if (!_this.mouseDown) {\n setTimeout(_this.update.bind(_this, _emitter4.default.sources.USER), 1);\n }\n });\n this.emitter.on(_emitter4.default.events.EDITOR_CHANGE, function (type, delta) {\n if (type === _emitter4.default.events.TEXT_CHANGE && delta.length() > 0) {\n _this.update(_emitter4.default.sources.SILENT);\n }\n });\n this.emitter.on(_emitter4.default.events.SCROLL_BEFORE_UPDATE, function () {\n if (!_this.hasFocus()) return;\n var native = _this.getNativeRange();\n if (native == null) return;\n if (native.start.node === _this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n _this.emitter.once(_emitter4.default.events.SCROLL_UPDATE, function () {\n try {\n _this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.emitter.on(_emitter4.default.events.SCROLL_OPTIMIZE, function (mutations, context) {\n if (context.range) {\n var _context$range = context.range,\n startNode = _context$range.startNode,\n startOffset = _context$range.startOffset,\n endNode = _context$range.endNode,\n endOffset = _context$range.endOffset;\n\n _this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(_emitter4.default.sources.SILENT);\n }\n\n _createClass(Selection, [{\n key: 'handleComposition',\n value: function handleComposition() {\n var _this2 = this;\n\n this.root.addEventListener('compositionstart', function () {\n _this2.composing = true;\n });\n this.root.addEventListener('compositionend', function () {\n _this2.composing = false;\n if (_this2.cursor.parent) {\n var range = _this2.cursor.restore();\n if (!range) return;\n setTimeout(function () {\n _this2.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n }, {\n key: 'handleDragging',\n value: function handleDragging() {\n var _this3 = this;\n\n this.emitter.listenDOM('mousedown', document.body, function () {\n _this3.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, function () {\n _this3.mouseDown = false;\n _this3.update(_emitter4.default.sources.USER);\n });\n }\n }, {\n key: 'focus',\n value: function focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n }, {\n key: 'format',\n value: function format(_format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[_format]) return;\n this.scroll.update();\n var nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || _parchment2.default.query(_format, _parchment2.default.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n var blot = _parchment2.default.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof _parchment2.default.Leaf) {\n var after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(_format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n }, {\n key: 'getBounds',\n value: function getBounds(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n var node = void 0,\n _scroll$leaf = this.scroll.leaf(index),\n _scroll$leaf2 = _slicedToArray(_scroll$leaf, 2),\n leaf = _scroll$leaf2[0],\n offset = _scroll$leaf2[1];\n if (leaf == null) return null;\n\n var _leaf$position = leaf.position(offset, true);\n\n var _leaf$position2 = _slicedToArray(_leaf$position, 2);\n\n node = _leaf$position2[0];\n offset = _leaf$position2[1];\n\n var range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n\n var _scroll$leaf3 = this.scroll.leaf(index + length);\n\n var _scroll$leaf4 = _slicedToArray(_scroll$leaf3, 2);\n\n leaf = _scroll$leaf4[0];\n offset = _scroll$leaf4[1];\n\n if (leaf == null) return null;\n\n var _leaf$position3 = leaf.position(offset, true);\n\n var _leaf$position4 = _slicedToArray(_leaf$position3, 2);\n\n node = _leaf$position4[0];\n offset = _leaf$position4[1];\n\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n var side = 'left';\n var rect = void 0;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n }, {\n key: 'getNativeRange',\n value: function getNativeRange() {\n var selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n var nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n var range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n }, {\n key: 'getRange',\n value: function getRange() {\n var normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n var range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n }, {\n key: 'hasFocus',\n value: function hasFocus() {\n return document.activeElement === this.root;\n }\n }, {\n key: 'normalizedToRange',\n value: function normalizedToRange(range) {\n var _this4 = this;\n\n var positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n var indexes = positions.map(function (position) {\n var _position = _slicedToArray(position, 2),\n node = _position[0],\n offset = _position[1];\n\n var blot = _parchment2.default.find(node, true);\n var index = blot.offset(_this4.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof _parchment2.default.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n var end = Math.min(Math.max.apply(Math, _toConsumableArray(indexes)), this.scroll.length() - 1);\n var start = Math.min.apply(Math, [end].concat(_toConsumableArray(indexes)));\n return new Range(start, end - start);\n }\n }, {\n key: 'normalizeNative',\n value: function normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) || !nativeRange.collapsed && !contains(this.root, nativeRange.endContainer)) {\n return null;\n }\n var range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function (position) {\n var node = position.node,\n offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n }, {\n key: 'rangeToNative',\n value: function rangeToNative(range) {\n var _this5 = this;\n\n var indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n var args = [];\n var scrollLength = this.scroll.length();\n indexes.forEach(function (index, i) {\n index = Math.min(scrollLength - 1, index);\n var node = void 0,\n _scroll$leaf5 = _this5.scroll.leaf(index),\n _scroll$leaf6 = _slicedToArray(_scroll$leaf5, 2),\n leaf = _scroll$leaf6[0],\n offset = _scroll$leaf6[1];\n var _leaf$position5 = leaf.position(offset, i !== 0);\n\n var _leaf$position6 = _slicedToArray(_leaf$position5, 2);\n\n node = _leaf$position6[0];\n offset = _leaf$position6[1];\n\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n }, {\n key: 'scrollIntoView',\n value: function scrollIntoView(scrollingContainer) {\n var range = this.lastRange;\n if (range == null) return;\n var bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n var limit = this.scroll.length() - 1;\n\n var _scroll$line = this.scroll.line(Math.min(range.index, limit)),\n _scroll$line2 = _slicedToArray(_scroll$line, 1),\n first = _scroll$line2[0];\n\n var last = first;\n if (range.length > 0) {\n var _scroll$line3 = this.scroll.line(Math.min(range.index + range.length, limit));\n\n var _scroll$line4 = _slicedToArray(_scroll$line3, 1);\n\n last = _scroll$line4[0];\n }\n if (first == null || last == null) return;\n var scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= scrollBounds.top - bounds.top;\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += bounds.bottom - scrollBounds.bottom;\n }\n }\n }, {\n key: 'setNativeRange',\n value: function setNativeRange(startNode, startOffset) {\n var endNode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : startNode;\n var endOffset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : startOffset;\n var force = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n var selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n var native = (this.getNativeRange() || {}).native;\n if (native == null || force || startNode !== native.startContainer || startOffset !== native.startOffset || endNode !== native.endContainer || endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n var range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n }, {\n key: 'setRange',\n value: function setRange(range) {\n var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _emitter4.default.sources.API;\n\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n var args = this.rangeToNative(range);\n this.setNativeRange.apply(this, _toConsumableArray(args).concat([force]));\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n }, {\n key: 'update',\n value: function update() {\n var source = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _emitter4.default.sources.USER;\n\n var oldRange = this.lastRange;\n\n var _getRange = this.getRange(),\n _getRange2 = _slicedToArray(_getRange, 2),\n lastRange = _getRange2[0],\n nativeRange = _getRange2[1];\n\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!(0, _deepEqual2.default)(oldRange, this.lastRange)) {\n var _emitter;\n\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n var args = [_emitter4.default.events.SELECTION_CHANGE, (0, _clone2.default)(this.lastRange), (0, _clone2.default)(oldRange), source];\n (_emitter = this.emitter).emit.apply(_emitter, [_emitter4.default.events.EDITOR_CHANGE].concat(args));\n if (source !== _emitter4.default.sources.SILENT) {\n var _emitter2;\n\n (_emitter2 = this.emitter).emit.apply(_emitter2, args);\n }\n }\n }\n }]);\n\n return Selection;\n}();\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\nexports.Range = Range;\nexports.default = Selection;\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Container = function (_Parchment$Container) {\n _inherits(Container, _Parchment$Container);\n\n function Container() {\n _classCallCheck(this, Container);\n\n return _possibleConstructorReturn(this, (Container.__proto__ || Object.getPrototypeOf(Container)).apply(this, arguments));\n }\n\n return Container;\n}(_parchment2.default.Container);\n\nContainer.allowedChildren = [_block2.default, _block.BlockEmbed, Container];\n\nexports.default = Container;\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ColorStyle = exports.ColorClass = exports.ColorAttributor = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ColorAttributor = function (_Parchment$Attributor) {\n _inherits(ColorAttributor, _Parchment$Attributor);\n\n function ColorAttributor() {\n _classCallCheck(this, ColorAttributor);\n\n return _possibleConstructorReturn(this, (ColorAttributor.__proto__ || Object.getPrototypeOf(ColorAttributor)).apply(this, arguments));\n }\n\n _createClass(ColorAttributor, [{\n key: 'value',\n value: function value(domNode) {\n var value = _get(ColorAttributor.prototype.__proto__ || Object.getPrototypeOf(ColorAttributor.prototype), 'value', this).call(this, domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function (component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n }]);\n\n return ColorAttributor;\n}(_parchment2.default.Attributor.Style);\n\nvar ColorClass = new _parchment2.default.Attributor.Class('color', 'ql-color', {\n scope: _parchment2.default.Scope.INLINE\n});\nvar ColorStyle = new ColorAttributor('color', 'color', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nexports.ColorAttributor = ColorAttributor;\nexports.ColorClass = ColorClass;\nexports.ColorStyle = ColorStyle;\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nmodule.exports = {\n 'align': {\n '': __webpack_require__(75),\n 'center': __webpack_require__(76),\n 'right': __webpack_require__(77),\n 'justify': __webpack_require__(78)\n },\n 'background': __webpack_require__(79),\n 'blockquote': __webpack_require__(80),\n 'bold': __webpack_require__(81),\n 'clean': __webpack_require__(82),\n 'code': __webpack_require__(40),\n 'code-block': __webpack_require__(40),\n 'color': __webpack_require__(83),\n 'direction': {\n '': __webpack_require__(84),\n 'rtl': __webpack_require__(85)\n },\n 'float': {\n 'center': __webpack_require__(86),\n 'full': __webpack_require__(87),\n 'left': __webpack_require__(88),\n 'right': __webpack_require__(89)\n },\n 'formula': __webpack_require__(90),\n 'header': {\n '1': __webpack_require__(91),\n '2': __webpack_require__(92)\n },\n 'italic': __webpack_require__(93),\n 'image': __webpack_require__(94),\n 'indent': {\n '+1': __webpack_require__(95),\n '-1': __webpack_require__(96)\n },\n 'link': __webpack_require__(97),\n 'list': {\n 'ordered': __webpack_require__(98),\n 'bullet': __webpack_require__(99),\n 'check': __webpack_require__(100)\n },\n 'script': {\n 'sub': __webpack_require__(101),\n 'super': __webpack_require__(102)\n },\n 'strike': __webpack_require__(103),\n 'underline': __webpack_require__(104),\n 'video': __webpack_require__(105)\n};\n\n/***/ }),\n/* 26 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = __webpack_require__(1);\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent = Registry.create(this.statics.scope);\n blot.wrap(parent);\n parent.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.next == null || this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n/***/ }),\n/* 27 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nvar class_1 = __webpack_require__(28);\nvar style_1 = __webpack_require__(29);\nvar Registry = __webpack_require__(1);\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n/***/ }),\n/* 28 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n/***/ }),\n/* 29 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = __webpack_require__(11);\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Cursor = function (_Parchment$Embed) {\n _inherits(Cursor, _Parchment$Embed);\n\n _createClass(Cursor, null, [{\n key: 'value',\n value: function value() {\n return undefined;\n }\n }]);\n\n function Cursor(domNode, selection) {\n _classCallCheck(this, Cursor);\n\n var _this = _possibleConstructorReturn(this, (Cursor.__proto__ || Object.getPrototypeOf(Cursor)).call(this, domNode));\n\n _this.selection = selection;\n _this.textNode = document.createTextNode(Cursor.CONTENTS);\n _this.domNode.appendChild(_this.textNode);\n _this._length = 0;\n return _this;\n }\n\n _createClass(Cursor, [{\n key: 'detach',\n value: function detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n }, {\n key: 'format',\n value: function format(name, value) {\n if (this._length !== 0) {\n return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'format', this).call(this, name, value);\n }\n var target = this,\n index = 0;\n while (target != null && target.statics.scope !== _parchment2.default.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n }, {\n key: 'index',\n value: function index(node, offset) {\n if (node === this.textNode) return 0;\n return _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'index', this).call(this, node, offset);\n }\n }, {\n key: 'length',\n value: function length() {\n return this._length;\n }\n }, {\n key: 'position',\n value: function position() {\n return [this.textNode, this.textNode.data.length];\n }\n }, {\n key: 'remove',\n value: function remove() {\n _get(Cursor.prototype.__proto__ || Object.getPrototypeOf(Cursor.prototype), 'remove', this).call(this);\n this.parent = null;\n }\n }, {\n key: 'restore',\n value: function restore() {\n if (this.selection.composing || this.parent == null) return;\n var textNode = this.textNode;\n var range = this.selection.getNativeRange();\n var restoreText = void 0,\n start = void 0,\n end = void 0;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n var _ref = [textNode, range.start.offset, range.end.offset];\n restoreText = _ref[0];\n start = _ref[1];\n end = _ref[2];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n var text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof _text2.default) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(_parchment2.default.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n var _map = [start, end].map(function (offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n\n var _map2 = _slicedToArray(_map, 2);\n\n start = _map2[0];\n end = _map2[1];\n\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n }, {\n key: 'update',\n value: function update(mutations, context) {\n var _this2 = this;\n\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this2.textNode;\n })) {\n var range = this.restore();\n if (range) context.range = range;\n }\n }\n }, {\n key: 'value',\n value: function value() {\n return '';\n }\n }]);\n\n return Cursor;\n}(_parchment2.default.Embed);\n\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = '\\uFEFF'; // Zero width no break space\n\n\nexports.default = Cursor;\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Theme = function () {\n function Theme(quill, options) {\n _classCallCheck(this, Theme);\n\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n _createClass(Theme, [{\n key: 'init',\n value: function init() {\n var _this = this;\n\n Object.keys(this.options.modules).forEach(function (name) {\n if (_this.modules[name] == null) {\n _this.addModule(name);\n }\n });\n }\n }, {\n key: 'addModule',\n value: function addModule(name) {\n var moduleClass = this.quill.constructor.import('modules/' + name);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n }]);\n\n return Theme;\n}();\n\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\nexports.default = Theme;\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar GUARD_TEXT = '\\uFEFF';\n\nvar Embed = function (_Parchment$Embed) {\n _inherits(Embed, _Parchment$Embed);\n\n function Embed(node) {\n _classCallCheck(this, Embed);\n\n var _this = _possibleConstructorReturn(this, (Embed.__proto__ || Object.getPrototypeOf(Embed)).call(this, node));\n\n _this.contentNode = document.createElement('span');\n _this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(_this.domNode.childNodes).forEach(function (childNode) {\n _this.contentNode.appendChild(childNode);\n });\n _this.leftGuard = document.createTextNode(GUARD_TEXT);\n _this.rightGuard = document.createTextNode(GUARD_TEXT);\n _this.domNode.appendChild(_this.leftGuard);\n _this.domNode.appendChild(_this.contentNode);\n _this.domNode.appendChild(_this.rightGuard);\n return _this;\n }\n\n _createClass(Embed, [{\n key: 'index',\n value: function index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return _get(Embed.prototype.__proto__ || Object.getPrototypeOf(Embed.prototype), 'index', this).call(this, node, offset);\n }\n }, {\n key: 'restore',\n value: function restore(node) {\n var range = void 0,\n textNode = void 0;\n var text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof _text2.default) {\n var prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(_parchment2.default.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof _text2.default) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(_parchment2.default.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n }, {\n key: 'update',\n value: function update(mutations, context) {\n var _this2 = this;\n\n mutations.forEach(function (mutation) {\n if (mutation.type === 'characterData' && (mutation.target === _this2.leftGuard || mutation.target === _this2.rightGuard)) {\n var range = _this2.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n }]);\n\n return Embed;\n}(_parchment2.default.Embed);\n\nexports.default = Embed;\n\n/***/ }),\n/* 33 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.AlignStyle = exports.AlignClass = exports.AlignAttribute = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar config = {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nvar AlignAttribute = new _parchment2.default.Attributor.Attribute('align', 'align', config);\nvar AlignClass = new _parchment2.default.Attributor.Class('align', 'ql-align', config);\nvar AlignStyle = new _parchment2.default.Attributor.Style('align', 'text-align', config);\n\nexports.AlignAttribute = AlignAttribute;\nexports.AlignClass = AlignClass;\nexports.AlignStyle = AlignStyle;\n\n/***/ }),\n/* 34 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.BackgroundStyle = exports.BackgroundClass = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _color = __webpack_require__(24);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar BackgroundClass = new _parchment2.default.Attributor.Class('background', 'ql-bg', {\n scope: _parchment2.default.Scope.INLINE\n});\nvar BackgroundStyle = new _color.ColorAttributor('background', 'background-color', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nexports.BackgroundClass = BackgroundClass;\nexports.BackgroundStyle = BackgroundStyle;\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DirectionStyle = exports.DirectionClass = exports.DirectionAttribute = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar config = {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nvar DirectionAttribute = new _parchment2.default.Attributor.Attribute('direction', 'dir', config);\nvar DirectionClass = new _parchment2.default.Attributor.Class('direction', 'ql-direction', config);\nvar DirectionStyle = new _parchment2.default.Attributor.Style('direction', 'direction', config);\n\nexports.DirectionAttribute = DirectionAttribute;\nexports.DirectionClass = DirectionClass;\nexports.DirectionStyle = DirectionStyle;\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FontClass = exports.FontStyle = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar config = {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nvar FontClass = new _parchment2.default.Attributor.Class('font', 'ql-font', config);\n\nvar FontStyleAttributor = function (_Parchment$Attributor) {\n _inherits(FontStyleAttributor, _Parchment$Attributor);\n\n function FontStyleAttributor() {\n _classCallCheck(this, FontStyleAttributor);\n\n return _possibleConstructorReturn(this, (FontStyleAttributor.__proto__ || Object.getPrototypeOf(FontStyleAttributor)).apply(this, arguments));\n }\n\n _createClass(FontStyleAttributor, [{\n key: 'value',\n value: function value(node) {\n return _get(FontStyleAttributor.prototype.__proto__ || Object.getPrototypeOf(FontStyleAttributor.prototype), 'value', this).call(this, node).replace(/[\"']/g, '');\n }\n }]);\n\n return FontStyleAttributor;\n}(_parchment2.default.Attributor.Style);\n\nvar FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexports.FontStyle = FontStyle;\nexports.FontClass = FontClass;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SizeStyle = exports.SizeClass = undefined;\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar SizeClass = new _parchment2.default.Attributor.Class('size', 'ql-size', {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nvar SizeStyle = new _parchment2.default.Attributor.Style('size', 'font-size', {\n scope: _parchment2.default.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexports.SizeClass = SizeClass;\nexports.SizeStyle = SizeStyle;\n\n/***/ }),\n/* 38 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.SHORTKEY = exports.default = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _op = __webpack_require__(20);\n\nvar _op2 = _interopRequireDefault(_op);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:keyboard');\n\nvar SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\nvar Keyboard = function (_Module) {\n _inherits(Keyboard, _Module);\n\n _createClass(Keyboard, null, [{\n key: 'match',\n value: function match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function (key) {\n return !!binding[key] !== evt[key] && binding[key] !== null;\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n }]);\n\n function Keyboard(quill, options) {\n _classCallCheck(this, Keyboard);\n\n var _this = _possibleConstructorReturn(this, (Keyboard.__proto__ || Object.getPrototypeOf(Keyboard)).call(this, quill, options));\n\n _this.bindings = {};\n Object.keys(_this.options.bindings).forEach(function (name) {\n if (name === 'list autofill' && quill.scroll.whitelist != null && !quill.scroll.whitelist['list']) {\n return;\n }\n if (_this.options.bindings[name]) {\n _this.addBinding(_this.options.bindings[name]);\n }\n });\n _this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n _this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function () {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n _this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n _this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n _this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null }, { collapsed: true, offset: 0 }, handleBackspace);\n _this.listen();\n return _this;\n }\n\n _createClass(Keyboard, [{\n key: 'addBinding',\n value: function addBinding(key) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var handler = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n var binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = (0, _extend2.default)(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n }, {\n key: 'listen',\n value: function listen() {\n var _this2 = this;\n\n this.quill.root.addEventListener('keydown', function (evt) {\n if (evt.defaultPrevented) return;\n var which = evt.which || evt.keyCode;\n var bindings = (_this2.bindings[which] || []).filter(function (binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n var range = _this2.quill.getSelection();\n if (range == null || !_this2.quill.hasFocus()) return;\n\n var _quill$getLine = _this2.quill.getLine(range.index),\n _quill$getLine2 = _slicedToArray(_quill$getLine, 2),\n line = _quill$getLine2[0],\n offset = _quill$getLine2[1];\n\n var _quill$getLeaf = _this2.quill.getLeaf(range.index),\n _quill$getLeaf2 = _slicedToArray(_quill$getLeaf, 2),\n leafStart = _quill$getLeaf2[0],\n offsetStart = _quill$getLeaf2[1];\n\n var _ref = range.length === 0 ? [leafStart, offsetStart] : _this2.quill.getLeaf(range.index + range.length),\n _ref2 = _slicedToArray(_ref, 2),\n leafEnd = _ref2[0],\n offsetEnd = _ref2[1];\n\n var prefixText = leafStart instanceof _parchment2.default.Text ? leafStart.value().slice(0, offsetStart) : '';\n var suffixText = leafEnd instanceof _parchment2.default.Text ? leafEnd.value().slice(offsetEnd) : '';\n var curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: _this2.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n var prevented = bindings.some(function (binding) {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function (name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (_typeof(binding.format) === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function (name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return (0, _deepEqual2.default)(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(_this2, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n }]);\n\n return Keyboard;\n}(_module2.default);\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold': makeFormatHandler('bold'),\n 'italic': makeFormatHandler('italic'),\n 'underline': makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', _quill2.default.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function handler(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', _quill2.default.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function handler(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', _quill2.default.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, _quill2.default.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function handler(range) {\n this.quill.deleteText(range.index - 1, 1, _quill2.default.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function handler(range) {\n this.quill.history.cutoff();\n var delta = new _quillDelta2.default().retain(range.index).delete(range.length).insert('\\t');\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function handler(range, context) {\n this.quill.format('list', false, _quill2.default.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, _quill2.default.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function handler(range) {\n var _quill$getLine3 = this.quill.getLine(range.index),\n _quill$getLine4 = _slicedToArray(_quill$getLine3, 2),\n line = _quill$getLine4[0],\n offset = _quill$getLine4[1];\n\n var formats = (0, _extend2.default)({}, line.formats(), { list: 'checked' });\n var delta = new _quillDelta2.default().retain(range.index).insert('\\n', formats).retain(line.length() - offset - 1).retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function handler(range, context) {\n var _quill$getLine5 = this.quill.getLine(range.index),\n _quill$getLine6 = _slicedToArray(_quill$getLine5, 2),\n line = _quill$getLine6[0],\n offset = _quill$getLine6[1];\n\n var delta = new _quillDelta2.default().retain(range.index).insert('\\n', context.format).retain(line.length() - offset - 1).retain(1, { header: null });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function handler(range, context) {\n var length = context.prefix.length;\n\n var _quill$getLine7 = this.quill.getLine(range.index),\n _quill$getLine8 = _slicedToArray(_quill$getLine7, 2),\n line = _quill$getLine8[0],\n offset = _quill$getLine8[1];\n\n if (offset > length) return true;\n var value = void 0;\n switch (context.prefix.trim()) {\n case '[]':case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-':case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', _quill2.default.sources.USER);\n this.quill.history.cutoff();\n var delta = new _quillDelta2.default().retain(range.index - offset).delete(length + 1).retain(line.length() - 2 - offset).retain(1, { list: value });\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, _quill2.default.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function handler(range) {\n var _quill$getLine9 = this.quill.getLine(range.index),\n _quill$getLine10 = _slicedToArray(_quill$getLine9, 2),\n line = _quill$getLine10[0],\n offset = _quill$getLine10[1];\n\n var delta = new _quillDelta2.default().retain(range.index + line.length() - offset - 2).retain(1, { 'code-block': null }).delete(1);\n this.quill.updateContents(delta, _quill2.default.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n var _ref3;\n\n var where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return _ref3 = {\n key: key,\n shiftKey: shiftKey,\n altKey: null\n }, _defineProperty(_ref3, where, /^$/), _defineProperty(_ref3, 'handler', function handler(range) {\n var index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += range.length + 1;\n }\n\n var _quill$getLeaf3 = this.quill.getLeaf(index),\n _quill$getLeaf4 = _slicedToArray(_quill$getLeaf3, 1),\n leaf = _quill$getLeaf4[0];\n\n if (!(leaf instanceof _parchment2.default.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, _quill2.default.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, _quill2.default.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, _quill2.default.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, _quill2.default.sources.USER);\n }\n }\n return false;\n }), _ref3;\n}\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n\n var _quill$getLine11 = this.quill.getLine(range.index),\n _quill$getLine12 = _slicedToArray(_quill$getLine11, 1),\n line = _quill$getLine12[0];\n\n var formats = {};\n if (context.offset === 0) {\n var _quill$getLine13 = this.quill.getLine(range.index - 1),\n _quill$getLine14 = _slicedToArray(_quill$getLine13, 1),\n prev = _quill$getLine14[0];\n\n if (prev != null && prev.length() > 1) {\n var curFormats = line.formats();\n var prevFormats = this.quill.getFormat(range.index - 1, 1);\n formats = _op2.default.attributes.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n var length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index - length, length, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index - length, length, formats, _quill2.default.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n var length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n var formats = {},\n nextLength = 0;\n\n var _quill$getLine15 = this.quill.getLine(range.index),\n _quill$getLine16 = _slicedToArray(_quill$getLine15, 1),\n line = _quill$getLine16[0];\n\n if (context.offset >= line.length() - 1) {\n var _quill$getLine17 = this.quill.getLine(range.index + 1),\n _quill$getLine18 = _slicedToArray(_quill$getLine17, 1),\n next = _quill$getLine18[0];\n\n if (next) {\n var curFormats = line.formats();\n var nextFormats = this.quill.getFormat(range.index, 1);\n formats = _op2.default.attributes.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, _quill2.default.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n var lines = this.quill.getLines(range);\n var formats = {};\n if (lines.length > 1) {\n var firstFormats = lines[0].formats();\n var lastFormats = lines[lines.length - 1].formats();\n formats = _op2.default.attributes.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, _quill2.default.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, _quill2.default.sources.USER);\n }\n this.quill.setSelection(range.index, _quill2.default.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n var _this3 = this;\n\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n var lineFormats = Object.keys(context.format).reduce(function (lineFormats, format) {\n if (_parchment2.default.query(format, _parchment2.default.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, _quill2.default.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, _quill2.default.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach(function (name) {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n _this3.quill.format(name, context.format[name], _quill2.default.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: { 'code-block': true },\n handler: function handler(range) {\n var CodeBlock = _parchment2.default.query('code-block');\n var index = range.index,\n length = range.length;\n\n var _quill$scroll$descend = this.quill.scroll.descendant(CodeBlock, index),\n _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n block = _quill$scroll$descend2[0],\n offset = _quill$scroll$descend2[1];\n\n if (block == null) return;\n var scrollIndex = this.quill.getIndex(block);\n var start = block.newlineIndex(offset, true) + 1;\n var end = block.newlineIndex(scrollIndex + offset + length);\n var lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach(function (line, i) {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(_quill2.default.sources.USER);\n this.quill.setSelection(index, length, _quill2.default.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function handler(range, context) {\n this.quill.format(format, !context.format[format], _quill2.default.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if ((typeof binding === 'undefined' ? 'undefined' : _typeof(binding)) === 'object') {\n binding = (0, _clone2.default)(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\nexports.default = Keyboard;\nexports.SHORTKEY = SHORTKEY;\n\n/***/ }),\n/* 39 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Bold = function (_Inline) {\n _inherits(Bold, _Inline);\n\n function Bold() {\n _classCallCheck(this, Bold);\n\n return _possibleConstructorReturn(this, (Bold.__proto__ || Object.getPrototypeOf(Bold)).apply(this, arguments));\n }\n\n _createClass(Bold, [{\n key: 'optimize',\n value: function optimize(context) {\n _get(Bold.prototype.__proto__ || Object.getPrototypeOf(Bold.prototype), 'optimize', this).call(this, context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n }], [{\n key: 'create',\n value: function create() {\n return _get(Bold.__proto__ || Object.getPrototypeOf(Bold), 'create', this).call(this);\n }\n }, {\n key: 'formats',\n value: function formats() {\n return true;\n }\n }]);\n\n return Bold;\n}(_inline2.default);\n\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexports.default = Bold;\n\n/***/ }),\n/* 40 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 41 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ColorPicker = function (_Picker) {\n _inherits(ColorPicker, _Picker);\n\n function ColorPicker(select, label) {\n _classCallCheck(this, ColorPicker);\n\n var _this = _possibleConstructorReturn(this, (ColorPicker.__proto__ || Object.getPrototypeOf(ColorPicker)).call(this, select));\n\n _this.label.innerHTML = label;\n _this.container.classList.add('ql-color-picker');\n [].slice.call(_this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function (item) {\n item.classList.add('ql-primary');\n });\n return _this;\n }\n\n _createClass(ColorPicker, [{\n key: 'buildItem',\n value: function buildItem(option) {\n var item = _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'buildItem', this).call(this, option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n }, {\n key: 'selectItem',\n value: function selectItem(item, trigger) {\n _get(ColorPicker.prototype.__proto__ || Object.getPrototypeOf(ColorPicker.prototype), 'selectItem', this).call(this, item, trigger);\n var colorLabel = this.label.querySelector('.ql-color-label');\n var value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n }]);\n\n return ColorPicker;\n}(_picker2.default);\n\nexports.default = ColorPicker;\n\n/***/ }),\n/* 42 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IconPicker = function (_Picker) {\n _inherits(IconPicker, _Picker);\n\n function IconPicker(select, icons) {\n _classCallCheck(this, IconPicker);\n\n var _this = _possibleConstructorReturn(this, (IconPicker.__proto__ || Object.getPrototypeOf(IconPicker)).call(this, select));\n\n _this.container.classList.add('ql-icon-picker');\n [].forEach.call(_this.container.querySelectorAll('.ql-picker-item'), function (item) {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n _this.defaultItem = _this.container.querySelector('.ql-selected');\n _this.selectItem(_this.defaultItem);\n return _this;\n }\n\n _createClass(IconPicker, [{\n key: 'selectItem',\n value: function selectItem(item, trigger) {\n _get(IconPicker.prototype.__proto__ || Object.getPrototypeOf(IconPicker.prototype), 'selectItem', this).call(this, item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n }]);\n\n return IconPicker;\n}(_picker2.default);\n\nexports.default = IconPicker;\n\n/***/ }),\n/* 43 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Tooltip = function () {\n function Tooltip(quill, boundsContainer) {\n var _this = this;\n\n _classCallCheck(this, Tooltip);\n\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', function () {\n _this.root.style.marginTop = -1 * _this.quill.root.scrollTop + 'px';\n });\n }\n this.hide();\n }\n\n _createClass(Tooltip, [{\n key: 'hide',\n value: function hide() {\n this.root.classList.add('ql-hidden');\n }\n }, {\n key: 'position',\n value: function position(reference) {\n var left = reference.left + reference.width / 2 - this.root.offsetWidth / 2;\n // root.scrollTop should be 0 if scrollContainer !== root\n var top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n this.root.classList.remove('ql-flip');\n var containerBounds = this.boundsContainer.getBoundingClientRect();\n var rootBounds = this.root.getBoundingClientRect();\n var shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = left + shift + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = left + shift + 'px';\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n var height = rootBounds.bottom - rootBounds.top;\n var verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = top - verticalShift + 'px';\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n }, {\n key: 'show',\n value: function show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n }]);\n\n return Tooltip;\n}();\n\nexports.default = Tooltip;\n\n/***/ }),\n/* 44 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BaseTooltip = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _keyboard = __webpack_require__(38);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nvar _theme = __webpack_require__(31);\n\nvar _theme2 = _interopRequireDefault(_theme);\n\nvar _colorPicker = __webpack_require__(41);\n\nvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\nvar _iconPicker = __webpack_require__(42);\n\nvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nvar _tooltip = __webpack_require__(43);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ALIGNS = [false, 'center', 'right', 'justify'];\n\nvar COLORS = [\"#000000\", \"#e60000\", \"#ff9900\", \"#ffff00\", \"#008a00\", \"#0066cc\", \"#9933ff\", \"#ffffff\", \"#facccc\", \"#ffebcc\", \"#ffffcc\", \"#cce8cc\", \"#cce0f5\", \"#ebd6ff\", \"#bbbbbb\", \"#f06666\", \"#ffc266\", \"#ffff66\", \"#66b966\", \"#66a3e0\", \"#c285ff\", \"#888888\", \"#a10000\", \"#b26b00\", \"#b2b200\", \"#006100\", \"#0047b2\", \"#6b24b2\", \"#444444\", \"#5c0000\", \"#663d00\", \"#666600\", \"#003700\", \"#002966\", \"#3d1466\"];\n\nvar FONTS = [false, 'serif', 'monospace'];\n\nvar HEADERS = ['1', '2', '3', false];\n\nvar SIZES = ['small', false, 'large', 'huge'];\n\nvar BaseTheme = function (_Theme) {\n _inherits(BaseTheme, _Theme);\n\n function BaseTheme(quill, options) {\n _classCallCheck(this, BaseTheme);\n\n var _this = _possibleConstructorReturn(this, (BaseTheme.__proto__ || Object.getPrototypeOf(BaseTheme)).call(this, quill, options));\n\n var listener = function listener(e) {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (_this.tooltip != null && !_this.tooltip.root.contains(e.target) && document.activeElement !== _this.tooltip.textbox && !_this.quill.hasFocus()) {\n _this.tooltip.hide();\n }\n if (_this.pickers != null) {\n _this.pickers.forEach(function (picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n return _this;\n }\n\n _createClass(BaseTheme, [{\n key: 'addModule',\n value: function addModule(name) {\n var module = _get(BaseTheme.prototype.__proto__ || Object.getPrototypeOf(BaseTheme.prototype), 'addModule', this).call(this, name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n }, {\n key: 'buildButtons',\n value: function buildButtons(buttons, icons) {\n buttons.forEach(function (button) {\n var className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach(function (name) {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n var value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n }, {\n key: 'buildPickers',\n value: function buildPickers(selects, icons) {\n var _this2 = this;\n\n this.pickers = selects.map(function (select) {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new _iconPicker2.default(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n var format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new _colorPicker2.default(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new _picker2.default(select);\n }\n });\n var update = function update() {\n _this2.pickers.forEach(function (picker) {\n picker.update();\n });\n };\n this.quill.on(_emitter2.default.events.EDITOR_CHANGE, update);\n }\n }]);\n\n return BaseTheme;\n}(_theme2.default);\n\nBaseTheme.DEFAULTS = (0, _extend2.default)(true, {}, _theme2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function formula() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function image() {\n var _this3 = this;\n\n var fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', function () {\n if (fileInput.files != null && fileInput.files[0] != null) {\n var reader = new FileReader();\n reader.onload = function (e) {\n var range = _this3.quill.getSelection(true);\n _this3.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert({ image: e.target.result }), _emitter2.default.sources.USER);\n _this3.quill.setSelection(range.index + 1, _emitter2.default.sources.SILENT);\n fileInput.value = \"\";\n };\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function video() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\nvar BaseTooltip = function (_Tooltip) {\n _inherits(BaseTooltip, _Tooltip);\n\n function BaseTooltip(quill, boundsContainer) {\n _classCallCheck(this, BaseTooltip);\n\n var _this4 = _possibleConstructorReturn(this, (BaseTooltip.__proto__ || Object.getPrototypeOf(BaseTooltip)).call(this, quill, boundsContainer));\n\n _this4.textbox = _this4.root.querySelector('input[type=\"text\"]');\n _this4.listen();\n return _this4;\n }\n\n _createClass(BaseTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this5 = this;\n\n this.textbox.addEventListener('keydown', function (event) {\n if (_keyboard2.default.match(event, 'enter')) {\n _this5.save();\n event.preventDefault();\n } else if (_keyboard2.default.match(event, 'escape')) {\n _this5.cancel();\n event.preventDefault();\n }\n });\n }\n }, {\n key: 'cancel',\n value: function cancel() {\n this.hide();\n }\n }, {\n key: 'edit',\n value: function edit() {\n var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'link';\n var preview = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute('data-' + mode) || '');\n this.root.setAttribute('data-mode', mode);\n }\n }, {\n key: 'restoreFocus',\n value: function restoreFocus() {\n var scrollTop = this.quill.scrollingContainer.scrollTop;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n }, {\n key: 'save',\n value: function save() {\n var value = this.textbox.value;\n switch (this.root.getAttribute('data-mode')) {\n case 'link':\n {\n var scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, _emitter2.default.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, _emitter2.default.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video':\n {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula':\n {\n if (!value) break;\n var range = this.quill.getSelection(true);\n if (range != null) {\n var index = range.index + range.length;\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, _emitter2.default.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', _emitter2.default.sources.USER);\n }\n this.quill.setSelection(index + 2, _emitter2.default.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n }]);\n\n return BaseTooltip;\n}(_tooltip2.default);\n\nfunction extractVideoUrl(url) {\n var match = url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) || url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';\n }\n if (match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/)) {\n // eslint-disable-line no-cond-assign\n return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';\n }\n return url;\n}\n\nfunction fillSelect(select, values) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n values.forEach(function (value) {\n var option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\nexports.BaseTooltip = BaseTooltip;\nexports.default = BaseTheme;\n\n/***/ }),\n/* 45 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _core = __webpack_require__(46);\n\nvar _core2 = _interopRequireDefault(_core);\n\nvar _align = __webpack_require__(33);\n\nvar _direction = __webpack_require__(35);\n\nvar _indent = __webpack_require__(62);\n\nvar _blockquote = __webpack_require__(63);\n\nvar _blockquote2 = _interopRequireDefault(_blockquote);\n\nvar _header = __webpack_require__(64);\n\nvar _header2 = _interopRequireDefault(_header);\n\nvar _list = __webpack_require__(65);\n\nvar _list2 = _interopRequireDefault(_list);\n\nvar _background = __webpack_require__(34);\n\nvar _color = __webpack_require__(24);\n\nvar _font = __webpack_require__(36);\n\nvar _size = __webpack_require__(37);\n\nvar _bold = __webpack_require__(39);\n\nvar _bold2 = _interopRequireDefault(_bold);\n\nvar _italic = __webpack_require__(66);\n\nvar _italic2 = _interopRequireDefault(_italic);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nvar _script = __webpack_require__(67);\n\nvar _script2 = _interopRequireDefault(_script);\n\nvar _strike = __webpack_require__(68);\n\nvar _strike2 = _interopRequireDefault(_strike);\n\nvar _underline = __webpack_require__(69);\n\nvar _underline2 = _interopRequireDefault(_underline);\n\nvar _image = __webpack_require__(70);\n\nvar _image2 = _interopRequireDefault(_image);\n\nvar _video = __webpack_require__(71);\n\nvar _video2 = _interopRequireDefault(_video);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _formula = __webpack_require__(72);\n\nvar _formula2 = _interopRequireDefault(_formula);\n\nvar _syntax = __webpack_require__(73);\n\nvar _syntax2 = _interopRequireDefault(_syntax);\n\nvar _toolbar = __webpack_require__(74);\n\nvar _toolbar2 = _interopRequireDefault(_toolbar);\n\nvar _icons = __webpack_require__(25);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nvar _picker = __webpack_require__(16);\n\nvar _picker2 = _interopRequireDefault(_picker);\n\nvar _colorPicker = __webpack_require__(41);\n\nvar _colorPicker2 = _interopRequireDefault(_colorPicker);\n\nvar _iconPicker = __webpack_require__(42);\n\nvar _iconPicker2 = _interopRequireDefault(_iconPicker);\n\nvar _tooltip = __webpack_require__(43);\n\nvar _tooltip2 = _interopRequireDefault(_tooltip);\n\nvar _bubble = __webpack_require__(107);\n\nvar _bubble2 = _interopRequireDefault(_bubble);\n\nvar _snow = __webpack_require__(108);\n\nvar _snow2 = _interopRequireDefault(_snow);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_core2.default.register({\n 'attributors/attribute/direction': _direction.DirectionAttribute,\n\n 'attributors/class/align': _align.AlignClass,\n 'attributors/class/background': _background.BackgroundClass,\n 'attributors/class/color': _color.ColorClass,\n 'attributors/class/direction': _direction.DirectionClass,\n 'attributors/class/font': _font.FontClass,\n 'attributors/class/size': _size.SizeClass,\n\n 'attributors/style/align': _align.AlignStyle,\n 'attributors/style/background': _background.BackgroundStyle,\n 'attributors/style/color': _color.ColorStyle,\n 'attributors/style/direction': _direction.DirectionStyle,\n 'attributors/style/font': _font.FontStyle,\n 'attributors/style/size': _size.SizeStyle\n}, true);\n\n_core2.default.register({\n 'formats/align': _align.AlignClass,\n 'formats/direction': _direction.DirectionClass,\n 'formats/indent': _indent.IndentClass,\n\n 'formats/background': _background.BackgroundStyle,\n 'formats/color': _color.ColorStyle,\n 'formats/font': _font.FontClass,\n 'formats/size': _size.SizeClass,\n\n 'formats/blockquote': _blockquote2.default,\n 'formats/code-block': _code2.default,\n 'formats/header': _header2.default,\n 'formats/list': _list2.default,\n\n 'formats/bold': _bold2.default,\n 'formats/code': _code.Code,\n 'formats/italic': _italic2.default,\n 'formats/link': _link2.default,\n 'formats/script': _script2.default,\n 'formats/strike': _strike2.default,\n 'formats/underline': _underline2.default,\n\n 'formats/image': _image2.default,\n 'formats/video': _video2.default,\n\n 'formats/list/item': _list.ListItem,\n\n 'modules/formula': _formula2.default,\n 'modules/syntax': _syntax2.default,\n 'modules/toolbar': _toolbar2.default,\n\n 'themes/bubble': _bubble2.default,\n 'themes/snow': _snow2.default,\n\n 'ui/icons': _icons2.default,\n 'ui/picker': _picker2.default,\n 'ui/icon-picker': _iconPicker2.default,\n 'ui/color-picker': _colorPicker2.default,\n 'ui/tooltip': _tooltip2.default\n}, true);\n\nexports.default = _core2.default;\n\n/***/ }),\n/* 46 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nvar _cursor = __webpack_require__(30);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _embed = __webpack_require__(32);\n\nvar _embed2 = _interopRequireDefault(_embed);\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nvar _scroll = __webpack_require__(59);\n\nvar _scroll2 = _interopRequireDefault(_scroll);\n\nvar _text = __webpack_require__(8);\n\nvar _text2 = _interopRequireDefault(_text);\n\nvar _clipboard = __webpack_require__(60);\n\nvar _clipboard2 = _interopRequireDefault(_clipboard);\n\nvar _history = __webpack_require__(61);\n\nvar _history2 = _interopRequireDefault(_history);\n\nvar _keyboard = __webpack_require__(38);\n\nvar _keyboard2 = _interopRequireDefault(_keyboard);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n_quill2.default.register({\n 'blots/block': _block2.default,\n 'blots/block/embed': _block.BlockEmbed,\n 'blots/break': _break2.default,\n 'blots/container': _container2.default,\n 'blots/cursor': _cursor2.default,\n 'blots/embed': _embed2.default,\n 'blots/inline': _inline2.default,\n 'blots/scroll': _scroll2.default,\n 'blots/text': _text2.default,\n\n 'modules/clipboard': _clipboard2.default,\n 'modules/history': _history2.default,\n 'modules/keyboard': _keyboard2.default\n});\n\n_parchment2.default.register(_block2.default, _break2.default, _cursor2.default, _inline2.default, _scroll2.default, _text2.default);\n\nexports.default = _quill2.default;\n\n/***/ }),\n/* 47 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length = cur.length();\n if (index < length ||\n (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n/***/ }),\n/* 48 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = __webpack_require__(17);\nvar Registry = __webpack_require__(1);\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n // @ts-ignore\n if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n/***/ }),\n/* 49 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = __webpack_require__(18);\nvar Registry = __webpack_require__(1);\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n/***/ }),\n/* 50 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = __webpack_require__(18);\nvar Registry = __webpack_require__(1);\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n/***/ }),\n/* 51 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = __webpack_require__(19);\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n/***/ }),\n/* 52 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = __webpack_require__(19);\nvar Registry = __webpack_require__(1);\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n/***/ }),\n/* 53 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n var _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function (token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function (searchString, position) {\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function (searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function value(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function () {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n\n/***/ }),\n/* 54 */\n/***/ (function(module, exports) {\n\n/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n diffs = fix_emoji(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n}\n\n/*\n * Check diff did not split surrogate pairs.\n * Ex. [0, '\\uD83D'], [-1, '\\uDC36'], [1, '\\uDC2F'] -> [-1, '\\uD83D\\uDC36'], [1, '\\uD83D\\uDC2F']\n * '\\uD83D\\uDC36' === '🐶', '\\uD83D\\uDC2F' === '🐯'\n *\n * @param {Array} diffs Array of diff tuples\n * @return {Array} Array of diff tuples\n */\nfunction fix_emoji (diffs) {\n var compact = false;\n var starts_with_pair_end = function(str) {\n return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;\n }\n var ends_with_pair_start = function(str) {\n return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF;\n }\n for (var i = 2; i < diffs.length; i += 1) {\n if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) &&\n diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) &&\n diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {\n compact = true;\n\n diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1];\n diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1];\n\n diffs[i-2][1] = diffs[i-2][1].slice(0, -1);\n }\n }\n if (!compact) {\n return diffs;\n }\n var fixed_diffs = [];\n for (var i = 0; i < diffs.length; i += 1) {\n if (diffs[i][1].length > 0) {\n fixed_diffs.push(diffs[i]);\n }\n }\n return fixed_diffs;\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n/***/ }),\n/* 55 */\n/***/ (function(module, exports) {\n\nexports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n/***/ }),\n/* 56 */\n/***/ (function(module, exports) {\n\nvar supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n/***/ }),\n/* 57 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _op = __webpack_require__(20);\n\nvar _op2 = _interopRequireDefault(_op);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _cursor = __webpack_require__(30);\n\nvar _cursor2 = _interopRequireDefault(_cursor);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _clone = __webpack_require__(21);\n\nvar _clone2 = _interopRequireDefault(_clone);\n\nvar _deepEqual = __webpack_require__(12);\n\nvar _deepEqual2 = _interopRequireDefault(_deepEqual);\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar ASCII = /^[ -~]*$/;\n\nvar Editor = function () {\n function Editor(scroll) {\n _classCallCheck(this, Editor);\n\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n _createClass(Editor, [{\n key: 'applyDelta',\n value: function applyDelta(delta) {\n var _this = this;\n\n var consumeNextNewline = false;\n this.scroll.update();\n var scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce(function (index, op) {\n var length = op.retain || op.delete || op.insert.length || 1;\n var attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n var text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n _this.scroll.insertAt(index, text);\n\n var _scroll$line = _this.scroll.line(index),\n _scroll$line2 = _slicedToArray(_scroll$line, 2),\n line = _scroll$line2[0],\n offset = _scroll$line2[1];\n\n var formats = (0, _extend2.default)({}, (0, _block.bubbleFormats)(line));\n if (line instanceof _block2.default) {\n var _line$descendant = line.descendant(_parchment2.default.Leaf, offset),\n _line$descendant2 = _slicedToArray(_line$descendant, 1),\n leaf = _line$descendant2[0];\n\n formats = (0, _extend2.default)(formats, (0, _block.bubbleFormats)(leaf));\n }\n attributes = _op2.default.attributes.diff(formats, attributes) || {};\n } else if (_typeof(op.insert) === 'object') {\n var key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n _this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach(function (name) {\n _this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce(function (index, op) {\n if (typeof op.delete === 'number') {\n _this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n }, {\n key: 'deleteText',\n value: function deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new _quillDelta2.default().retain(index).delete(length));\n }\n }, {\n key: 'formatLine',\n value: function formatLine(index, length) {\n var _this2 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n this.scroll.update();\n Object.keys(formats).forEach(function (format) {\n if (_this2.scroll.whitelist != null && !_this2.scroll.whitelist[format]) return;\n var lines = _this2.scroll.lines(index, Math.max(length, 1));\n var lengthRemaining = length;\n lines.forEach(function (line) {\n var lineLength = line.length();\n if (!(line instanceof _code2.default)) {\n line.format(format, formats[format]);\n } else {\n var codeIndex = index - line.offset(_this2.scroll);\n var codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'formatText',\n value: function formatText(index, length) {\n var _this3 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n Object.keys(formats).forEach(function (format) {\n _this3.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new _quillDelta2.default().retain(index).retain(length, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'getContents',\n value: function getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n }, {\n key: 'getDelta',\n value: function getDelta() {\n return this.scroll.lines().reduce(function (delta, line) {\n return delta.concat(line.delta());\n }, new _quillDelta2.default());\n }\n }, {\n key: 'getFormat',\n value: function getFormat(index) {\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n var lines = [],\n leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function (path) {\n var _path = _slicedToArray(path, 1),\n blot = _path[0];\n\n if (blot instanceof _block2.default) {\n lines.push(blot);\n } else if (blot instanceof _parchment2.default.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(_parchment2.default.Leaf, index, length);\n }\n var formatsArr = [lines, leaves].map(function (blots) {\n if (blots.length === 0) return {};\n var formats = (0, _block.bubbleFormats)(blots.shift());\n while (Object.keys(formats).length > 0) {\n var blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats((0, _block.bubbleFormats)(blot), formats);\n }\n return formats;\n });\n return _extend2.default.apply(_extend2.default, formatsArr);\n }\n }, {\n key: 'getText',\n value: function getText(index, length) {\n return this.getContents(index, length).filter(function (op) {\n return typeof op.insert === 'string';\n }).map(function (op) {\n return op.insert;\n }).join('');\n }\n }, {\n key: 'insertEmbed',\n value: function insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new _quillDelta2.default().retain(index).insert(_defineProperty({}, embed, value)));\n }\n }, {\n key: 'insertText',\n value: function insertText(index, text) {\n var _this4 = this;\n\n var formats = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach(function (format) {\n _this4.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new _quillDelta2.default().retain(index).insert(text, (0, _clone2.default)(formats)));\n }\n }, {\n key: 'isBlank',\n value: function isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n var block = this.scroll.children.head;\n if (block.statics.blotName !== _block2.default.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof _break2.default;\n }\n }, {\n key: 'removeFormat',\n value: function removeFormat(index, length) {\n var text = this.getText(index, length);\n\n var _scroll$line3 = this.scroll.line(index + length),\n _scroll$line4 = _slicedToArray(_scroll$line3, 2),\n line = _scroll$line4[0],\n offset = _scroll$line4[1];\n\n var suffixLength = 0,\n suffix = new _quillDelta2.default();\n if (line != null) {\n if (!(line instanceof _code2.default)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n var contents = this.getContents(index, length + suffixLength);\n var diff = contents.diff(new _quillDelta2.default().insert(text).concat(suffix));\n var delta = new _quillDelta2.default().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n }, {\n key: 'update',\n value: function update(change) {\n var mutations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var cursorIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n\n var oldDelta = this.delta;\n if (mutations.length === 1 && mutations[0].type === 'characterData' && mutations[0].target.data.match(ASCII) && _parchment2.default.find(mutations[0].target)) {\n // Optimization for character changes\n var textBlot = _parchment2.default.find(mutations[0].target);\n var formats = (0, _block.bubbleFormats)(textBlot);\n var index = textBlot.offset(this.scroll);\n var oldValue = mutations[0].oldValue.replace(_cursor2.default.CONTENTS, '');\n var oldText = new _quillDelta2.default().insert(oldValue);\n var newText = new _quillDelta2.default().insert(textBlot.value());\n var diffDelta = new _quillDelta2.default().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function (delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new _quillDelta2.default());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !(0, _deepEqual2.default)(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n }]);\n\n return Editor;\n}();\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function (merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function (delta, op) {\n if (op.insert === 1) {\n var attributes = (0, _clone2.default)(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = (0, _clone2.default)(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n var text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new _quillDelta2.default());\n}\n\nexports.default = Editor;\n\n/***/ }),\n/* 58 */\n/***/ (function(module, exports) {\n\n'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n/***/ }),\n/* 59 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _break = __webpack_require__(14);\n\nvar _break2 = _interopRequireDefault(_break);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nfunction isLine(blot) {\n return blot instanceof _block2.default || blot instanceof _block.BlockEmbed;\n}\n\nvar Scroll = function (_Parchment$Scroll) {\n _inherits(Scroll, _Parchment$Scroll);\n\n function Scroll(domNode, config) {\n _classCallCheck(this, Scroll);\n\n var _this = _possibleConstructorReturn(this, (Scroll.__proto__ || Object.getPrototypeOf(Scroll)).call(this, domNode));\n\n _this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n _this.whitelist = config.whitelist.reduce(function (whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n // Some reason fixes composition issues with character languages in Windows/Chrome, Safari\n _this.domNode.addEventListener('DOMNodeInserted', function () {});\n _this.optimize();\n _this.enable();\n return _this;\n }\n\n _createClass(Scroll, [{\n key: 'batchStart',\n value: function batchStart() {\n this.batch = true;\n }\n }, {\n key: 'batchEnd',\n value: function batchEnd() {\n this.batch = false;\n this.optimize();\n }\n }, {\n key: 'deleteAt',\n value: function deleteAt(index, length) {\n var _line = this.line(index),\n _line2 = _slicedToArray(_line, 2),\n first = _line2[0],\n offset = _line2[1];\n\n var _line3 = this.line(index + length),\n _line4 = _slicedToArray(_line3, 1),\n last = _line4[0];\n\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'deleteAt', this).call(this, index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof _block.BlockEmbed || last instanceof _block.BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof _code2.default) {\n var newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof _code2.default) {\n var _newlineIndex = last.newlineIndex(0);\n if (_newlineIndex > -1) {\n last.split(_newlineIndex + 1);\n }\n }\n var ref = last.children.head instanceof _break2.default ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n }, {\n key: 'enable',\n value: function enable() {\n var enabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n this.domNode.setAttribute('contenteditable', enabled);\n }\n }, {\n key: 'formatAt',\n value: function formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'formatAt', this).call(this, index, length, format, value);\n this.optimize();\n }\n }, {\n key: 'insertAt',\n value: function insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || _parchment2.default.query(value, _parchment2.default.Scope.BLOCK) == null) {\n var blot = _parchment2.default.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n var embed = _parchment2.default.create(value, def);\n this.appendChild(embed);\n }\n } else {\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertAt', this).call(this, index, value, def);\n }\n this.optimize();\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n if (blot.statics.scope === _parchment2.default.Scope.INLINE_BLOT) {\n var wrapper = _parchment2.default.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'insertBefore', this).call(this, blot, ref);\n }\n }, {\n key: 'leaf',\n value: function leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n }, {\n key: 'line',\n value: function line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n }, {\n key: 'lines',\n value: function lines() {\n var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var length = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Number.MAX_VALUE;\n\n var getLines = function getLines(blot, index, length) {\n var lines = [],\n lengthLeft = length;\n blot.children.forEachAt(index, length, function (child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof _parchment2.default.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n }, {\n key: 'optimize',\n value: function optimize() {\n var mutations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (this.batch === true) return;\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'optimize', this).call(this, mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n }, {\n key: 'path',\n value: function path(index) {\n return _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'path', this).call(this, index).slice(1); // Exclude self\n }\n }, {\n key: 'update',\n value: function update(mutations) {\n if (this.batch === true) return;\n var source = _emitter2.default.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n _get(Scroll.prototype.__proto__ || Object.getPrototypeOf(Scroll.prototype), 'update', this).call(this, mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(_emitter2.default.events.SCROLL_UPDATE, source, mutations);\n }\n }\n }]);\n\n return Scroll;\n}(_parchment2.default.Scroll);\n\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [_block2.default, _block.BlockEmbed, _container2.default];\n\nexports.default = Scroll;\n\n/***/ }),\n/* 60 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.matchText = exports.matchSpacing = exports.matchNewline = exports.matchBlot = exports.matchAttributor = exports.default = undefined;\n\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend2 = __webpack_require__(2);\n\nvar _extend3 = _interopRequireDefault(_extend2);\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _align = __webpack_require__(33);\n\nvar _background = __webpack_require__(34);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nvar _color = __webpack_require__(24);\n\nvar _direction = __webpack_require__(35);\n\nvar _font = __webpack_require__(36);\n\nvar _size = __webpack_require__(37);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:clipboard');\n\nvar DOM_KEY = '__ql-matcher';\n\nvar CLIPBOARD_CONFIG = [[Node.TEXT_NODE, matchText], [Node.TEXT_NODE, matchNewline], ['br', matchBreak], [Node.ELEMENT_NODE, matchNewline], [Node.ELEMENT_NODE, matchBlot], [Node.ELEMENT_NODE, matchSpacing], [Node.ELEMENT_NODE, matchAttributor], [Node.ELEMENT_NODE, matchStyles], ['li', matchIndent], ['b', matchAlias.bind(matchAlias, 'bold')], ['i', matchAlias.bind(matchAlias, 'italic')], ['style', matchIgnore]];\n\nvar ATTRIBUTE_ATTRIBUTORS = [_align.AlignAttribute, _direction.DirectionAttribute].reduce(function (memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nvar STYLE_ATTRIBUTORS = [_align.AlignStyle, _background.BackgroundStyle, _color.ColorStyle, _direction.DirectionStyle, _font.FontStyle, _size.SizeStyle].reduce(function (memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nvar Clipboard = function (_Module) {\n _inherits(Clipboard, _Module);\n\n function Clipboard(quill, options) {\n _classCallCheck(this, Clipboard);\n\n var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this, quill, options));\n\n _this.quill.root.addEventListener('paste', _this.onPaste.bind(_this));\n _this.container = _this.quill.addContainer('ql-clipboard');\n _this.container.setAttribute('contenteditable', true);\n _this.container.setAttribute('tabindex', -1);\n _this.matchers = [];\n CLIPBOARD_CONFIG.concat(_this.options.matchers).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n selector = _ref2[0],\n matcher = _ref2[1];\n\n if (!options.matchVisual && matcher === matchSpacing) return;\n _this.addMatcher(selector, matcher);\n });\n return _this;\n }\n\n _createClass(Clipboard, [{\n key: 'addMatcher',\n value: function addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n }, {\n key: 'convert',\n value: function convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\<'); // Remove spaces between tags\n return this.convert();\n }\n var formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[_code2.default.blotName]) {\n var text = this.container.innerText;\n this.container.innerHTML = '';\n return new _quillDelta2.default().insert(text, _defineProperty({}, _code2.default.blotName, formats[_code2.default.blotName]));\n }\n\n var _prepareMatching = this.prepareMatching(),\n _prepareMatching2 = _slicedToArray(_prepareMatching, 2),\n elementMatchers = _prepareMatching2[0],\n textMatchers = _prepareMatching2[1];\n\n var delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new _quillDelta2.default().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n }, {\n key: 'dangerouslyPasteHTML',\n value: function dangerouslyPasteHTML(index, html) {\n var source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _quill2.default.sources.API;\n\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, _quill2.default.sources.SILENT);\n } else {\n var paste = this.convert(html);\n this.quill.updateContents(new _quillDelta2.default().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), _quill2.default.sources.SILENT);\n }\n }\n }, {\n key: 'onPaste',\n value: function onPaste(e) {\n var _this2 = this;\n\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n var range = this.quill.getSelection();\n var delta = new _quillDelta2.default().retain(range.index);\n var scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(_quill2.default.sources.SILENT);\n setTimeout(function () {\n delta = delta.concat(_this2.convert()).delete(range.length);\n _this2.quill.updateContents(delta, _quill2.default.sources.USER);\n // range.length contributes to delta.length()\n _this2.quill.setSelection(delta.length() - range.length, _quill2.default.sources.SILENT);\n _this2.quill.scrollingContainer.scrollTop = scrollTop;\n _this2.quill.focus();\n }, 1);\n }\n }, {\n key: 'prepareMatching',\n value: function prepareMatching() {\n var _this3 = this;\n\n var elementMatchers = [],\n textMatchers = [];\n this.matchers.forEach(function (pair) {\n var _pair = _slicedToArray(pair, 2),\n selector = _pair[0],\n matcher = _pair[1];\n\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(_this3.container.querySelectorAll(selector), function (node) {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n }]);\n\n return Clipboard;\n}(_module2.default);\n\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: true\n};\n\nfunction applyFormat(delta, format, value) {\n if ((typeof format === 'undefined' ? 'undefined' : _typeof(format)) === 'object') {\n return Object.keys(format).reduce(function (delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function (delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, (0, _extend3.default)({}, _defineProperty({}, format, value), op.attributes));\n }\n }, new _quillDelta2.default());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n var DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n var endText = \"\";\n for (var i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n var op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1 * text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n var style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) {\n // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function (delta, matcher) {\n return matcher(node, delta);\n }, new _quillDelta2.default());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], function (delta, childNode) {\n var childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function (childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function (childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new _quillDelta2.default());\n } else {\n return new _quillDelta2.default();\n }\n}\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n var attributes = _parchment2.default.Attributor.Attribute.keys(node);\n var classes = _parchment2.default.Attributor.Class.keys(node);\n var styles = _parchment2.default.Attributor.Style.keys(node);\n var formats = {};\n attributes.concat(classes).concat(styles).forEach(function (name) {\n var attr = _parchment2.default.query(name, _parchment2.default.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n var match = _parchment2.default.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof _parchment2.default.Embed) {\n var embed = {};\n var value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new _quillDelta2.default().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new _quillDelta2.default();\n}\n\nfunction matchIndent(node, delta) {\n var match = _parchment2.default.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n var indent = -1,\n parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((_parchment2.default.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new _quillDelta2.default().retain(delta.length() - 1).retain(1, { indent: indent }));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || delta.length() > 0 && node.nextSibling && isLine(node.nextSibling)) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n var nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight * 1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n var formats = {};\n var style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') || parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) {\n // Could be 0.5in\n delta = new _quillDelta2.default().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n var text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n var replacer = function replacer(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if (node.previousSibling == null && isLine(node.parentNode) || node.previousSibling != null && isLine(node.previousSibling)) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if (node.nextSibling == null && isLine(node.parentNode) || node.nextSibling != null && isLine(node.nextSibling)) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\nexports.default = Clipboard;\nexports.matchAttributor = matchAttributor;\nexports.matchBlot = matchBlot;\nexports.matchNewline = matchNewline;\nexports.matchSpacing = matchSpacing;\nexports.matchText = matchText;\n\n/***/ }),\n/* 61 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getLastChangeIndex = exports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar History = function (_Module) {\n _inherits(History, _Module);\n\n function History(quill, options) {\n _classCallCheck(this, History);\n\n var _this = _possibleConstructorReturn(this, (History.__proto__ || Object.getPrototypeOf(History)).call(this, quill, options));\n\n _this.lastRecorded = 0;\n _this.ignoreChange = false;\n _this.clear();\n _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (eventName, delta, oldDelta, source) {\n if (eventName !== _quill2.default.events.TEXT_CHANGE || _this.ignoreChange) return;\n if (!_this.options.userOnly || source === _quill2.default.sources.USER) {\n _this.record(delta, oldDelta);\n } else {\n _this.transform(delta);\n }\n });\n _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, _this.undo.bind(_this));\n _this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, _this.redo.bind(_this));\n if (/Win/i.test(navigator.platform)) {\n _this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, _this.redo.bind(_this));\n }\n return _this;\n }\n\n _createClass(History, [{\n key: 'change',\n value: function change(source, dest) {\n if (this.stack[source].length === 0) return;\n var delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], _quill2.default.sources.USER);\n this.ignoreChange = false;\n var index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.stack = { undo: [], redo: [] };\n }\n }, {\n key: 'cutoff',\n value: function cutoff() {\n this.lastRecorded = 0;\n }\n }, {\n key: 'record',\n value: function record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n var undoDelta = this.quill.getContents().diff(oldDelta);\n var timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n var delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n }, {\n key: 'redo',\n value: function redo() {\n this.change('redo', 'undo');\n }\n }, {\n key: 'transform',\n value: function transform(delta) {\n this.stack.undo.forEach(function (change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function (change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n }, {\n key: 'undo',\n value: function undo() {\n this.change('undo', 'redo');\n }\n }]);\n\n return History;\n}(_module2.default);\n\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n var lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function (attr) {\n return _parchment2.default.query(attr, _parchment2.default.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n var deleteLength = delta.reduce(function (length, op) {\n length += op.delete || 0;\n return length;\n }, 0);\n var changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\nexports.default = History;\nexports.getLastChangeIndex = getLastChangeIndex;\n\n/***/ }),\n/* 62 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.IndentClass = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar IdentAttributor = function (_Parchment$Attributor) {\n _inherits(IdentAttributor, _Parchment$Attributor);\n\n function IdentAttributor() {\n _classCallCheck(this, IdentAttributor);\n\n return _possibleConstructorReturn(this, (IdentAttributor.__proto__ || Object.getPrototypeOf(IdentAttributor)).apply(this, arguments));\n }\n\n _createClass(IdentAttributor, [{\n key: 'add',\n value: function add(node, value) {\n if (value === '+1' || value === '-1') {\n var indent = this.value(node) || 0;\n value = value === '+1' ? indent + 1 : indent - 1;\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'add', this).call(this, node, value);\n }\n }\n }, {\n key: 'canAdd',\n value: function canAdd(node, value) {\n return _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, value) || _get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'canAdd', this).call(this, node, parseInt(value));\n }\n }, {\n key: 'value',\n value: function value(node) {\n return parseInt(_get(IdentAttributor.prototype.__proto__ || Object.getPrototypeOf(IdentAttributor.prototype), 'value', this).call(this, node)) || undefined; // Don't return NaN\n }\n }]);\n\n return IdentAttributor;\n}(_parchment2.default.Attributor.Class);\n\nvar IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: _parchment2.default.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexports.IndentClass = IndentClass;\n\n/***/ }),\n/* 63 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Blockquote = function (_Block) {\n _inherits(Blockquote, _Block);\n\n function Blockquote() {\n _classCallCheck(this, Blockquote);\n\n return _possibleConstructorReturn(this, (Blockquote.__proto__ || Object.getPrototypeOf(Blockquote)).apply(this, arguments));\n }\n\n return Blockquote;\n}(_block2.default);\n\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\nexports.default = Blockquote;\n\n/***/ }),\n/* 64 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Header = function (_Block) {\n _inherits(Header, _Block);\n\n function Header() {\n _classCallCheck(this, Header);\n\n return _possibleConstructorReturn(this, (Header.__proto__ || Object.getPrototypeOf(Header)).apply(this, arguments));\n }\n\n _createClass(Header, null, [{\n key: 'formats',\n value: function formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n }]);\n\n return Header;\n}(_block2.default);\n\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\nexports.default = Header;\n\n/***/ }),\n/* 65 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.ListItem = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _block = __webpack_require__(3);\n\nvar _block2 = _interopRequireDefault(_block);\n\nvar _container = __webpack_require__(23);\n\nvar _container2 = _interopRequireDefault(_container);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ListItem = function (_Block) {\n _inherits(ListItem, _Block);\n\n function ListItem() {\n _classCallCheck(this, ListItem);\n\n return _possibleConstructorReturn(this, (ListItem.__proto__ || Object.getPrototypeOf(ListItem)).apply(this, arguments));\n }\n\n _createClass(ListItem, [{\n key: 'format',\n value: function format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(_parchment2.default.create(this.statics.scope));\n } else {\n _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'format', this).call(this, name, value);\n }\n }\n }, {\n key: 'remove',\n value: function remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'remove', this).call(this);\n }\n }\n }, {\n key: 'replaceWith',\n value: function replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return _get(ListItem.prototype.__proto__ || Object.getPrototypeOf(ListItem.prototype), 'replaceWith', this).call(this, name, value);\n }\n }\n }], [{\n key: 'formats',\n value: function formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : _get(ListItem.__proto__ || Object.getPrototypeOf(ListItem), 'formats', this).call(this, domNode);\n }\n }]);\n\n return ListItem;\n}(_block2.default);\n\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\nvar List = function (_Container) {\n _inherits(List, _Container);\n\n _createClass(List, null, [{\n key: 'create',\n value: function create(value) {\n var tagName = value === 'ordered' ? 'OL' : 'UL';\n var node = _get(List.__proto__ || Object.getPrototypeOf(List), 'create', this).call(this, tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n }]);\n\n function List(domNode) {\n _classCallCheck(this, List);\n\n var _this2 = _possibleConstructorReturn(this, (List.__proto__ || Object.getPrototypeOf(List)).call(this, domNode));\n\n var listEventHandler = function listEventHandler(e) {\n if (e.target.parentNode !== domNode) return;\n var format = _this2.statics.formats(domNode);\n var blot = _parchment2.default.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if (format === 'unchecked') {\n blot.format('list', 'checked');\n }\n };\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n return _this2;\n }\n\n _createClass(List, [{\n key: 'format',\n value: function format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n }, {\n key: 'formats',\n value: function formats() {\n // We don't inherit from FormatBlot\n return _defineProperty({}, this.statics.blotName, this.statics.formats(this.domNode));\n }\n }, {\n key: 'insertBefore',\n value: function insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'insertBefore', this).call(this, blot, ref);\n } else {\n var index = ref == null ? this.length() : ref.offset(this);\n var after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n }, {\n key: 'optimize',\n value: function optimize(context) {\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'optimize', this).call(this, context);\n var next = this.next;\n if (next != null && next.prev === this && next.statics.blotName === this.statics.blotName && next.domNode.tagName === this.domNode.tagName && next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n }, {\n key: 'replace',\n value: function replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n var item = _parchment2.default.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n _get(List.prototype.__proto__ || Object.getPrototypeOf(List.prototype), 'replace', this).call(this, target);\n }\n }]);\n\n return List;\n}(_container2.default);\n\nList.blotName = 'list';\nList.scope = _parchment2.default.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\nexports.ListItem = ListItem;\nexports.default = List;\n\n/***/ }),\n/* 66 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _bold = __webpack_require__(39);\n\nvar _bold2 = _interopRequireDefault(_bold);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Italic = function (_Bold) {\n _inherits(Italic, _Bold);\n\n function Italic() {\n _classCallCheck(this, Italic);\n\n return _possibleConstructorReturn(this, (Italic.__proto__ || Object.getPrototypeOf(Italic)).apply(this, arguments));\n }\n\n return Italic;\n}(_bold2.default);\n\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexports.default = Italic;\n\n/***/ }),\n/* 67 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Script = function (_Inline) {\n _inherits(Script, _Inline);\n\n function Script() {\n _classCallCheck(this, Script);\n\n return _possibleConstructorReturn(this, (Script.__proto__ || Object.getPrototypeOf(Script)).apply(this, arguments));\n }\n\n _createClass(Script, null, [{\n key: 'create',\n value: function create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return _get(Script.__proto__ || Object.getPrototypeOf(Script), 'create', this).call(this, value);\n }\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n }]);\n\n return Script;\n}(_inline2.default);\n\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexports.default = Script;\n\n/***/ }),\n/* 68 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Strike = function (_Inline) {\n _inherits(Strike, _Inline);\n\n function Strike() {\n _classCallCheck(this, Strike);\n\n return _possibleConstructorReturn(this, (Strike.__proto__ || Object.getPrototypeOf(Strike)).apply(this, arguments));\n }\n\n return Strike;\n}(_inline2.default);\n\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexports.default = Strike;\n\n/***/ }),\n/* 69 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _inline = __webpack_require__(5);\n\nvar _inline2 = _interopRequireDefault(_inline);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Underline = function (_Inline) {\n _inherits(Underline, _Inline);\n\n function Underline() {\n _classCallCheck(this, Underline);\n\n return _possibleConstructorReturn(this, (Underline.__proto__ || Object.getPrototypeOf(Underline)).apply(this, arguments));\n }\n\n return Underline;\n}(_inline2.default);\n\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexports.default = Underline;\n\n/***/ }),\n/* 70 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _link = __webpack_require__(15);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ATTRIBUTES = ['alt', 'height', 'width'];\n\nvar Image = function (_Parchment$Embed) {\n _inherits(Image, _Parchment$Embed);\n\n function Image() {\n _classCallCheck(this, Image);\n\n return _possibleConstructorReturn(this, (Image.__proto__ || Object.getPrototypeOf(Image)).apply(this, arguments));\n }\n\n _createClass(Image, [{\n key: 'format',\n value: function format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n _get(Image.prototype.__proto__ || Object.getPrototypeOf(Image.prototype), 'format', this).call(this, name, value);\n }\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Image.__proto__ || Object.getPrototypeOf(Image), 'create', this).call(this, value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return ATTRIBUTES.reduce(function (formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n }, {\n key: 'match',\n value: function match(url) {\n return (/\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url)\n );\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return (0, _link.sanitize)(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('src');\n }\n }]);\n\n return Image;\n}(_parchment2.default.Embed);\n\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\nexports.default = Image;\n\n/***/ }),\n/* 71 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _block = __webpack_require__(3);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar ATTRIBUTES = ['height', 'width'];\n\nvar Video = function (_BlockEmbed) {\n _inherits(Video, _BlockEmbed);\n\n function Video() {\n _classCallCheck(this, Video);\n\n return _possibleConstructorReturn(this, (Video.__proto__ || Object.getPrototypeOf(Video)).apply(this, arguments));\n }\n\n _createClass(Video, [{\n key: 'format',\n value: function format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n _get(Video.prototype.__proto__ || Object.getPrototypeOf(Video.prototype), 'format', this).call(this, name, value);\n }\n }\n }], [{\n key: 'create',\n value: function create(value) {\n var node = _get(Video.__proto__ || Object.getPrototypeOf(Video), 'create', this).call(this, value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n }, {\n key: 'formats',\n value: function formats(domNode) {\n return ATTRIBUTES.reduce(function (formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n }, {\n key: 'sanitize',\n value: function sanitize(url) {\n return _link2.default.sanitize(url);\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('src');\n }\n }]);\n\n return Video;\n}(_block.BlockEmbed);\n\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\nexports.default = Video;\n\n/***/ }),\n/* 72 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.FormulaBlot = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _embed = __webpack_require__(32);\n\nvar _embed2 = _interopRequireDefault(_embed);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar FormulaBlot = function (_Embed) {\n _inherits(FormulaBlot, _Embed);\n\n function FormulaBlot() {\n _classCallCheck(this, FormulaBlot);\n\n return _possibleConstructorReturn(this, (FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot)).apply(this, arguments));\n }\n\n _createClass(FormulaBlot, null, [{\n key: 'create',\n value: function create(value) {\n var node = _get(FormulaBlot.__proto__ || Object.getPrototypeOf(FormulaBlot), 'create', this).call(this, value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00'\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n }, {\n key: 'value',\n value: function value(domNode) {\n return domNode.getAttribute('data-value');\n }\n }]);\n\n return FormulaBlot;\n}(_embed2.default);\n\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\nvar Formula = function (_Module) {\n _inherits(Formula, _Module);\n\n _createClass(Formula, null, [{\n key: 'register',\n value: function register() {\n _quill2.default.register(FormulaBlot, true);\n }\n }]);\n\n function Formula() {\n _classCallCheck(this, Formula);\n\n var _this2 = _possibleConstructorReturn(this, (Formula.__proto__ || Object.getPrototypeOf(Formula)).call(this));\n\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n return _this2;\n }\n\n return Formula;\n}(_module2.default);\n\nexports.FormulaBlot = FormulaBlot;\nexports.default = Formula;\n\n/***/ }),\n/* 73 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.CodeToken = exports.CodeBlock = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nvar _code = __webpack_require__(13);\n\nvar _code2 = _interopRequireDefault(_code);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar SyntaxCodeBlock = function (_CodeBlock) {\n _inherits(SyntaxCodeBlock, _CodeBlock);\n\n function SyntaxCodeBlock() {\n _classCallCheck(this, SyntaxCodeBlock);\n\n return _possibleConstructorReturn(this, (SyntaxCodeBlock.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock)).apply(this, arguments));\n }\n\n _createClass(SyntaxCodeBlock, [{\n key: 'replaceWith',\n value: function replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n _get(SyntaxCodeBlock.prototype.__proto__ || Object.getPrototypeOf(SyntaxCodeBlock.prototype), 'replaceWith', this).call(this, block);\n }\n }, {\n key: 'highlight',\n value: function highlight(_highlight) {\n var text = this.domNode.textContent;\n if (this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n this.domNode.innerHTML = _highlight(text);\n this.domNode.normalize();\n this.attach();\n }\n this.cachedText = text;\n }\n }\n }]);\n\n return SyntaxCodeBlock;\n}(_code2.default);\n\nSyntaxCodeBlock.className = 'ql-syntax';\n\nvar CodeToken = new _parchment2.default.Attributor.Class('token', 'hljs', {\n scope: _parchment2.default.Scope.INLINE\n});\n\nvar Syntax = function (_Module) {\n _inherits(Syntax, _Module);\n\n _createClass(Syntax, null, [{\n key: 'register',\n value: function register() {\n _quill2.default.register(CodeToken, true);\n _quill2.default.register(SyntaxCodeBlock, true);\n }\n }]);\n\n function Syntax(quill, options) {\n _classCallCheck(this, Syntax);\n\n var _this2 = _possibleConstructorReturn(this, (Syntax.__proto__ || Object.getPrototypeOf(Syntax)).call(this, quill, options));\n\n if (typeof _this2.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n var timer = null;\n _this2.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n clearTimeout(timer);\n timer = setTimeout(function () {\n _this2.highlight();\n timer = null;\n }, _this2.options.interval);\n });\n _this2.highlight();\n return _this2;\n }\n\n _createClass(Syntax, [{\n key: 'highlight',\n value: function highlight() {\n var _this3 = this;\n\n if (this.quill.selection.composing) return;\n this.quill.update(_quill2.default.sources.USER);\n var range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach(function (code) {\n code.highlight(_this3.options.highlight);\n });\n this.quill.update(_quill2.default.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, _quill2.default.sources.SILENT);\n }\n }\n }]);\n\n return Syntax;\n}(_module2.default);\n\nSyntax.DEFAULTS = {\n highlight: function () {\n if (window.hljs == null) return null;\n return function (text) {\n var result = window.hljs.highlightAuto(text);\n return result.value;\n };\n }(),\n interval: 1000\n};\n\nexports.CodeBlock = SyntaxCodeBlock;\nexports.CodeToken = CodeToken;\nexports.default = Syntax;\n\n/***/ }),\n/* 74 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.addControls = exports.default = undefined;\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _quillDelta = __webpack_require__(4);\n\nvar _quillDelta2 = _interopRequireDefault(_quillDelta);\n\nvar _parchment = __webpack_require__(0);\n\nvar _parchment2 = _interopRequireDefault(_parchment);\n\nvar _quill = __webpack_require__(6);\n\nvar _quill2 = _interopRequireDefault(_quill);\n\nvar _logger = __webpack_require__(10);\n\nvar _logger2 = _interopRequireDefault(_logger);\n\nvar _module = __webpack_require__(7);\n\nvar _module2 = _interopRequireDefault(_module);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar debug = (0, _logger2.default)('quill:toolbar');\n\nvar Toolbar = function (_Module) {\n _inherits(Toolbar, _Module);\n\n function Toolbar(quill, options) {\n _classCallCheck(this, Toolbar);\n\n var _this = _possibleConstructorReturn(this, (Toolbar.__proto__ || Object.getPrototypeOf(Toolbar)).call(this, quill, options));\n\n if (Array.isArray(_this.options.container)) {\n var container = document.createElement('div');\n addControls(container, _this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n _this.container = container;\n } else if (typeof _this.options.container === 'string') {\n _this.container = document.querySelector(_this.options.container);\n } else {\n _this.container = _this.options.container;\n }\n if (!(_this.container instanceof HTMLElement)) {\n var _ret;\n\n return _ret = debug.error('Container required for toolbar', _this.options), _possibleConstructorReturn(_this, _ret);\n }\n _this.container.classList.add('ql-toolbar');\n _this.controls = [];\n _this.handlers = {};\n Object.keys(_this.options.handlers).forEach(function (format) {\n _this.addHandler(format, _this.options.handlers[format]);\n });\n [].forEach.call(_this.container.querySelectorAll('button, select'), function (input) {\n _this.attach(input);\n });\n _this.quill.on(_quill2.default.events.EDITOR_CHANGE, function (type, range) {\n if (type === _quill2.default.events.SELECTION_CHANGE) {\n _this.update(range);\n }\n });\n _this.quill.on(_quill2.default.events.SCROLL_OPTIMIZE, function () {\n var _this$quill$selection = _this.quill.selection.getRange(),\n _this$quill$selection2 = _slicedToArray(_this$quill$selection, 1),\n range = _this$quill$selection2[0]; // quill.getSelection triggers update\n\n\n _this.update(range);\n });\n return _this;\n }\n\n _createClass(Toolbar, [{\n key: 'addHandler',\n value: function addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n }, {\n key: 'attach',\n value: function attach(input) {\n var _this2 = this;\n\n var format = [].find.call(input.classList, function (className) {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (_parchment2.default.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n var eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, function (e) {\n var value = void 0;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n var selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n _this2.quill.focus();\n\n var _quill$selection$getR = _this2.quill.selection.getRange(),\n _quill$selection$getR2 = _slicedToArray(_quill$selection$getR, 1),\n range = _quill$selection$getR2[0];\n\n if (_this2.handlers[format] != null) {\n _this2.handlers[format].call(_this2, value);\n } else if (_parchment2.default.query(format).prototype instanceof _parchment2.default.Embed) {\n value = prompt('Enter ' + format);\n if (!value) return;\n _this2.quill.updateContents(new _quillDelta2.default().retain(range.index).delete(range.length).insert(_defineProperty({}, format, value)), _quill2.default.sources.USER);\n } else {\n _this2.quill.format(format, value, _quill2.default.sources.USER);\n }\n _this2.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n }, {\n key: 'update',\n value: function update(range) {\n var formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function (pair) {\n var _pair = _slicedToArray(pair, 2),\n format = _pair[0],\n input = _pair[1];\n\n if (input.tagName === 'SELECT') {\n var option = void 0;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n var value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector('option[value=\"' + value + '\"]');\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n var isActive = formats[format] === input.getAttribute('value') || formats[format] != null && formats[format].toString() === input.getAttribute('value') || formats[format] == null && !input.getAttribute('value');\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n }]);\n\n return Toolbar;\n}(_module2.default);\n\nToolbar.DEFAULTS = {};\n\nfunction addButton(container, format, value) {\n var input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function (controls) {\n var group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function (control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n var format = Object.keys(control)[0];\n var value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n var input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function (value) {\n var option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function clean() {\n var _this3 = this;\n\n var range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n var formats = this.quill.getFormat();\n Object.keys(formats).forEach(function (name) {\n // Clean functionality in existing apps only clean inline formats\n if (_parchment2.default.query(name, _parchment2.default.Scope.INLINE) != null) {\n _this3.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, _quill2.default.sources.USER);\n }\n },\n direction: function direction(value) {\n var align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', _quill2.default.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, _quill2.default.sources.USER);\n }\n this.quill.format('direction', value, _quill2.default.sources.USER);\n },\n indent: function indent(value) {\n var range = this.quill.getSelection();\n var formats = this.quill.getFormat(range);\n var indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n var modifier = value === '+1' ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, _quill2.default.sources.USER);\n }\n },\n link: function link(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, _quill2.default.sources.USER);\n },\n list: function list(value) {\n var range = this.quill.getSelection();\n var formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, _quill2.default.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', _quill2.default.sources.USER);\n }\n } else {\n this.quill.format('list', value, _quill2.default.sources.USER);\n }\n }\n }\n};\n\nexports.default = Toolbar;\nexports.addControls = addControls;\n\n/***/ }),\n/* 75 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 76 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 77 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 78 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 79 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 80 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 81 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 82 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 83 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 84 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 85 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 86 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 87 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 88 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 89 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 90 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 91 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 92 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 93 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 94 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 95 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 96 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 97 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 98 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 99 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 100 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 101 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 102 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 103 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 104 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 105 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 106 */\n/***/ (function(module, exports) {\n\nmodule.exports = \" \";\n\n/***/ }),\n/* 107 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.BubbleTooltip = undefined;\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _base = __webpack_require__(44);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _selection = __webpack_require__(22);\n\nvar _icons = __webpack_require__(25);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TOOLBAR_CONFIG = [['bold', 'italic', 'link'], [{ header: 1 }, { header: 2 }, 'blockquote']];\n\nvar BubbleTheme = function (_BaseTheme) {\n _inherits(BubbleTheme, _BaseTheme);\n\n function BubbleTheme(quill, options) {\n _classCallCheck(this, BubbleTheme);\n\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n\n var _this = _possibleConstructorReturn(this, (BubbleTheme.__proto__ || Object.getPrototypeOf(BubbleTheme)).call(this, quill, options));\n\n _this.quill.container.classList.add('ql-bubble');\n return _this;\n }\n\n _createClass(BubbleTheme, [{\n key: 'extendToolbar',\n value: function extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n }\n }]);\n\n return BubbleTheme;\n}(_base2.default);\n\nBubbleTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function link(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\nvar BubbleTooltip = function (_BaseTooltip) {\n _inherits(BubbleTooltip, _BaseTooltip);\n\n function BubbleTooltip(quill, bounds) {\n _classCallCheck(this, BubbleTooltip);\n\n var _this2 = _possibleConstructorReturn(this, (BubbleTooltip.__proto__ || Object.getPrototypeOf(BubbleTooltip)).call(this, quill, bounds));\n\n _this2.quill.on(_emitter2.default.events.EDITOR_CHANGE, function (type, range, oldRange, source) {\n if (type !== _emitter2.default.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0 && source === _emitter2.default.sources.USER) {\n _this2.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n _this2.root.style.left = '0px';\n _this2.root.style.width = '';\n _this2.root.style.width = _this2.root.offsetWidth + 'px';\n var lines = _this2.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n _this2.position(_this2.quill.getBounds(range));\n } else {\n var lastLine = lines[lines.length - 1];\n var index = _this2.quill.getIndex(lastLine);\n var length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n var _bounds = _this2.quill.getBounds(new _selection.Range(index, length));\n _this2.position(_bounds);\n }\n } else if (document.activeElement !== _this2.textbox && _this2.quill.hasFocus()) {\n _this2.hide();\n }\n });\n return _this2;\n }\n\n _createClass(BubbleTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this3 = this;\n\n _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'listen', this).call(this);\n this.root.querySelector('.ql-close').addEventListener('click', function () {\n _this3.root.classList.remove('ql-editing');\n });\n this.quill.on(_emitter2.default.events.SCROLL_OPTIMIZE, function () {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(function () {\n if (_this3.root.classList.contains('ql-hidden')) return;\n var range = _this3.quill.getSelection();\n if (range != null) {\n _this3.position(_this3.quill.getBounds(range));\n }\n }, 1);\n });\n }\n }, {\n key: 'cancel',\n value: function cancel() {\n this.show();\n }\n }, {\n key: 'position',\n value: function position(reference) {\n var shift = _get(BubbleTooltip.prototype.__proto__ || Object.getPrototypeOf(BubbleTooltip.prototype), 'position', this).call(this, reference);\n var arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = -1 * shift - arrow.offsetWidth / 2 + 'px';\n }\n }]);\n\n return BubbleTooltip;\n}(_base.BaseTooltip);\n\nBubbleTooltip.TEMPLATE = ['', '
', '', '', '
'].join('');\n\nexports.BubbleTooltip = BubbleTooltip;\nexports.default = BubbleTheme;\n\n/***/ }),\n/* 108 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"]) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); } }; }();\n\nvar _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if (\"value\" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nvar _extend = __webpack_require__(2);\n\nvar _extend2 = _interopRequireDefault(_extend);\n\nvar _emitter = __webpack_require__(9);\n\nvar _emitter2 = _interopRequireDefault(_emitter);\n\nvar _base = __webpack_require__(44);\n\nvar _base2 = _interopRequireDefault(_base);\n\nvar _link = __webpack_require__(15);\n\nvar _link2 = _interopRequireDefault(_link);\n\nvar _selection = __webpack_require__(22);\n\nvar _icons = __webpack_require__(25);\n\nvar _icons2 = _interopRequireDefault(_icons);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar TOOLBAR_CONFIG = [[{ header: ['1', '2', '3', false] }], ['bold', 'italic', 'underline', 'link'], [{ list: 'ordered' }, { list: 'bullet' }], ['clean']];\n\nvar SnowTheme = function (_BaseTheme) {\n _inherits(SnowTheme, _BaseTheme);\n\n function SnowTheme(quill, options) {\n _classCallCheck(this, SnowTheme);\n\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n\n var _this = _possibleConstructorReturn(this, (SnowTheme.__proto__ || Object.getPrototypeOf(SnowTheme)).call(this, quill, options));\n\n _this.quill.container.classList.add('ql-snow');\n return _this;\n }\n\n _createClass(SnowTheme, [{\n key: 'extendToolbar',\n value: function extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), _icons2.default);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), _icons2.default);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function (range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n }]);\n\n return SnowTheme;\n}(_base2.default);\n\nSnowTheme.DEFAULTS = (0, _extend2.default)(true, {}, _base2.default.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function link(value) {\n if (value) {\n var range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n var preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n var tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\nvar SnowTooltip = function (_BaseTooltip) {\n _inherits(SnowTooltip, _BaseTooltip);\n\n function SnowTooltip(quill, bounds) {\n _classCallCheck(this, SnowTooltip);\n\n var _this2 = _possibleConstructorReturn(this, (SnowTooltip.__proto__ || Object.getPrototypeOf(SnowTooltip)).call(this, quill, bounds));\n\n _this2.preview = _this2.root.querySelector('a.ql-preview');\n return _this2;\n }\n\n _createClass(SnowTooltip, [{\n key: 'listen',\n value: function listen() {\n var _this3 = this;\n\n _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'listen', this).call(this);\n this.root.querySelector('a.ql-action').addEventListener('click', function (event) {\n if (_this3.root.classList.contains('ql-editing')) {\n _this3.save();\n } else {\n _this3.edit('link', _this3.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', function (event) {\n if (_this3.linkRange != null) {\n var range = _this3.linkRange;\n _this3.restoreFocus();\n _this3.quill.formatText(range, 'link', false, _emitter2.default.sources.USER);\n delete _this3.linkRange;\n }\n event.preventDefault();\n _this3.hide();\n });\n this.quill.on(_emitter2.default.events.SELECTION_CHANGE, function (range, oldRange, source) {\n if (range == null) return;\n if (range.length === 0 && source === _emitter2.default.sources.USER) {\n var _quill$scroll$descend = _this3.quill.scroll.descendant(_link2.default, range.index),\n _quill$scroll$descend2 = _slicedToArray(_quill$scroll$descend, 2),\n link = _quill$scroll$descend2[0],\n offset = _quill$scroll$descend2[1];\n\n if (link != null) {\n _this3.linkRange = new _selection.Range(range.index - offset, link.length());\n var preview = _link2.default.formats(link.domNode);\n _this3.preview.textContent = preview;\n _this3.preview.setAttribute('href', preview);\n _this3.show();\n _this3.position(_this3.quill.getBounds(_this3.linkRange));\n return;\n }\n } else {\n delete _this3.linkRange;\n }\n _this3.hide();\n });\n }\n }, {\n key: 'show',\n value: function show() {\n _get(SnowTooltip.prototype.__proto__ || Object.getPrototypeOf(SnowTooltip.prototype), 'show', this).call(this);\n this.root.removeAttribute('data-mode');\n }\n }]);\n\n return SnowTooltip;\n}(_base.BaseTooltip);\n\nSnowTooltip.TEMPLATE = ['', '', '', ''].join('');\n\nexports.default = SnowTheme;\n\n/***/ })\n/******/ ])[\"default\"];\n});\n\n\n// WEBPACK FOOTER //\n// quill.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 45);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 00e590d85b41be113db0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./blot/abstract/container\");\nvar format_1 = require(\"./blot/abstract/format\");\nvar leaf_1 = require(\"./blot/abstract/leaf\");\nvar scroll_1 = require(\"./blot/scroll\");\nvar inline_1 = require(\"./blot/inline\");\nvar block_1 = require(\"./blot/block\");\nvar embed_1 = require(\"./blot/embed\");\nvar text_1 = require(\"./blot/text\");\nvar attributor_1 = require(\"./attributor/attributor\");\nvar class_1 = require(\"./attributor/class\");\nvar style_1 = require(\"./attributor/style\");\nvar store_1 = require(\"./attributor/store\");\nvar Registry = require(\"./registry\");\nvar Parchment = {\n Scope: Registry.Scope,\n create: Registry.create,\n find: Registry.find,\n query: Registry.query,\n register: Registry.register,\n Container: container_1.default,\n Format: format_1.default,\n Leaf: leaf_1.default,\n Embed: embed_1.default,\n Scroll: scroll_1.default,\n Block: block_1.default,\n Inline: inline_1.default,\n Text: text_1.default,\n Attributor: {\n Attribute: attributor_1.default,\n Class: class_1.default,\n Style: style_1.default,\n Store: store_1.default,\n },\n};\nexports.default = Parchment;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/parchment.ts\n// module id = 0\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ParchmentError = /** @class */ (function (_super) {\n __extends(ParchmentError, _super);\n function ParchmentError(message) {\n var _this = this;\n message = '[Parchment] ' + message;\n _this = _super.call(this, message) || this;\n _this.message = message;\n _this.name = _this.constructor.name;\n return _this;\n }\n return ParchmentError;\n}(Error));\nexports.ParchmentError = ParchmentError;\nvar attributes = {};\nvar classes = {};\nvar tags = {};\nvar types = {};\nexports.DATA_KEY = '__blot';\nvar Scope;\n(function (Scope) {\n Scope[Scope[\"TYPE\"] = 3] = \"TYPE\";\n Scope[Scope[\"LEVEL\"] = 12] = \"LEVEL\";\n Scope[Scope[\"ATTRIBUTE\"] = 13] = \"ATTRIBUTE\";\n Scope[Scope[\"BLOT\"] = 14] = \"BLOT\";\n Scope[Scope[\"INLINE\"] = 7] = \"INLINE\";\n Scope[Scope[\"BLOCK\"] = 11] = \"BLOCK\";\n Scope[Scope[\"BLOCK_BLOT\"] = 10] = \"BLOCK_BLOT\";\n Scope[Scope[\"INLINE_BLOT\"] = 6] = \"INLINE_BLOT\";\n Scope[Scope[\"BLOCK_ATTRIBUTE\"] = 9] = \"BLOCK_ATTRIBUTE\";\n Scope[Scope[\"INLINE_ATTRIBUTE\"] = 5] = \"INLINE_ATTRIBUTE\";\n Scope[Scope[\"ANY\"] = 15] = \"ANY\";\n})(Scope = exports.Scope || (exports.Scope = {}));\nfunction create(input, value) {\n var match = query(input);\n if (match == null) {\n throw new ParchmentError(\"Unable to create \" + input + \" blot\");\n }\n var BlotClass = match;\n var node = \n // @ts-ignore\n input instanceof Node || input['nodeType'] === Node.TEXT_NODE ? input : BlotClass.create(value);\n return new BlotClass(node, value);\n}\nexports.create = create;\nfunction find(node, bubble) {\n if (bubble === void 0) { bubble = false; }\n if (node == null)\n return null;\n // @ts-ignore\n if (node[exports.DATA_KEY] != null)\n return node[exports.DATA_KEY].blot;\n if (bubble)\n return find(node.parentNode, bubble);\n return null;\n}\nexports.find = find;\nfunction query(query, scope) {\n if (scope === void 0) { scope = Scope.ANY; }\n var match;\n if (typeof query === 'string') {\n match = types[query] || attributes[query];\n // @ts-ignore\n }\n else if (query instanceof Text || query['nodeType'] === Node.TEXT_NODE) {\n match = types['text'];\n }\n else if (typeof query === 'number') {\n if (query & Scope.LEVEL & Scope.BLOCK) {\n match = types['block'];\n }\n else if (query & Scope.LEVEL & Scope.INLINE) {\n match = types['inline'];\n }\n }\n else if (query instanceof HTMLElement) {\n var names = (query.getAttribute('class') || '').split(/\\s+/);\n for (var i in names) {\n match = classes[names[i]];\n if (match)\n break;\n }\n match = match || tags[query.tagName];\n }\n if (match == null)\n return null;\n // @ts-ignore\n if (scope & Scope.LEVEL & match.scope && scope & Scope.TYPE & match.scope)\n return match;\n return null;\n}\nexports.query = query;\nfunction register() {\n var Definitions = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n Definitions[_i] = arguments[_i];\n }\n if (Definitions.length > 1) {\n return Definitions.map(function (d) {\n return register(d);\n });\n }\n var Definition = Definitions[0];\n if (typeof Definition.blotName !== 'string' && typeof Definition.attrName !== 'string') {\n throw new ParchmentError('Invalid definition');\n }\n else if (Definition.blotName === 'abstract') {\n throw new ParchmentError('Cannot register abstract class');\n }\n types[Definition.blotName || Definition.attrName] = Definition;\n if (typeof Definition.keyName === 'string') {\n attributes[Definition.keyName] = Definition;\n }\n else {\n if (Definition.className != null) {\n classes[Definition.className] = Definition;\n }\n if (Definition.tagName != null) {\n if (Array.isArray(Definition.tagName)) {\n Definition.tagName = Definition.tagName.map(function (tagName) {\n return tagName.toUpperCase();\n });\n }\n else {\n Definition.tagName = Definition.tagName.toUpperCase();\n }\n var tagNames = Array.isArray(Definition.tagName) ? Definition.tagName : [Definition.tagName];\n tagNames.forEach(function (tag) {\n if (tags[tag] == null || Definition.className == null) {\n tags[tag] = Definition;\n }\n });\n }\n }\n return Definition;\n}\nexports.register = register;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/registry.ts\n// module id = 1\n// module chunks = 0","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = target[name];\n\t\t\t\tcopy = options[name];\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\ttarget[name] = extend(deep, clone, copy);\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\ttarget[name] = copy;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/extend/index.js\n// module id = 2\n// module chunks = 0","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Break from './break';\nimport Inline from './inline';\nimport TextBlot from './text';\n\n\nconst NEWLINE_LENGTH = 1;\n\n\nclass BlockEmbed extends Parchment.Embed {\n attach() {\n super.attach();\n this.attributes = new Parchment.Attributor.Store(this.domNode);\n }\n\n delta() {\n return new Delta().insert(this.value(), extend(this.formats(), this.attributes.values()));\n }\n\n format(name, value) {\n let attribute = Parchment.query(name, Parchment.Scope.BLOCK_ATTRIBUTE);\n if (attribute != null) {\n this.attributes.attribute(attribute, value);\n }\n }\n\n formatAt(index, length, name, value) {\n this.format(name, value);\n }\n\n insertAt(index, value, def) {\n if (typeof value === 'string' && value.endsWith('\\n')) {\n let block = Parchment.create(Block.blotName);\n this.parent.insertBefore(block, index === 0 ? this : this.next);\n block.insertAt(0, value.slice(0, -1));\n } else {\n super.insertAt(index, value, def);\n }\n }\n}\nBlockEmbed.scope = Parchment.Scope.BLOCK_BLOT;\n// It is important for cursor behavior BlockEmbeds use tags that are block level elements\n\n\nclass Block extends Parchment.Block {\n constructor(domNode) {\n super(domNode);\n this.cache = {};\n }\n\n delta() {\n if (this.cache.delta == null) {\n this.cache.delta = this.descendants(Parchment.Leaf).reduce((delta, leaf) => {\n if (leaf.length() === 0) {\n return delta;\n } else {\n return delta.insert(leaf.value(), bubbleFormats(leaf));\n }\n }, new Delta()).insert('\\n', bubbleFormats(this));\n }\n return this.cache.delta;\n }\n\n deleteAt(index, length) {\n super.deleteAt(index, length);\n this.cache = {};\n }\n\n formatAt(index, length, name, value) {\n if (length <= 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n if (index + length === this.length()) {\n this.format(name, value);\n }\n } else {\n super.formatAt(index, Math.min(length, this.length() - index - 1), name, value);\n }\n this.cache = {};\n }\n\n insertAt(index, value, def) {\n if (def != null) return super.insertAt(index, value, def);\n if (value.length === 0) return;\n let lines = value.split('\\n');\n let text = lines.shift();\n if (text.length > 0) {\n if (index < this.length() - 1 || this.children.tail == null) {\n super.insertAt(Math.min(index, this.length() - 1), text);\n } else {\n this.children.tail.insertAt(this.children.tail.length(), text);\n }\n this.cache = {};\n }\n let block = this;\n lines.reduce(function(index, line) {\n block = block.split(index, true);\n block.insertAt(0, line);\n return line.length;\n }, index + text.length);\n }\n\n insertBefore(blot, ref) {\n let head = this.children.head;\n super.insertBefore(blot, ref);\n if (head instanceof Break) {\n head.remove();\n }\n this.cache = {};\n }\n\n length() {\n if (this.cache.length == null) {\n this.cache.length = super.length() + NEWLINE_LENGTH;\n }\n return this.cache.length;\n }\n\n moveChildren(target, ref) {\n super.moveChildren(target, ref);\n this.cache = {};\n }\n\n optimize(context) {\n super.optimize(context);\n this.cache = {};\n }\n\n path(index) {\n return super.path(index, true);\n }\n\n removeChild(child) {\n super.removeChild(child);\n this.cache = {};\n }\n\n split(index, force = false) {\n if (force && (index === 0 || index >= this.length() - NEWLINE_LENGTH)) {\n let clone = this.clone();\n if (index === 0) {\n this.parent.insertBefore(clone, this);\n return this;\n } else {\n this.parent.insertBefore(clone, this.next);\n return clone;\n }\n } else {\n let next = super.split(index, force);\n this.cache = {};\n return next;\n }\n }\n}\nBlock.blotName = 'block';\nBlock.tagName = 'P';\nBlock.defaultChild = 'break';\nBlock.allowedChildren = [Inline, Parchment.Embed, TextBlot];\n\n\nfunction bubbleFormats(blot, formats = {}) {\n if (blot == null) return formats;\n if (typeof blot.formats === 'function') {\n formats = extend(formats, blot.formats());\n }\n if (blot.parent == null || blot.parent.blotName == 'scroll' || blot.parent.statics.scope !== blot.statics.scope) {\n return formats;\n }\n return bubbleFormats(blot.parent, formats);\n}\n\n\nexport { bubbleFormats, BlockEmbed, Block as default };\n\n\n\n// WEBPACK FOOTER //\n// ./blots/block.js","var diff = require('fast-diff');\nvar equal = require('deep-equal');\nvar extend = require('extend');\nvar op = require('./op');\n\n\nvar NULL_CHARACTER = String.fromCharCode(0); // Placeholder char for embed in diff()\n\n\nvar Delta = function (ops) {\n // Assume we are given a well formed ops\n if (Array.isArray(ops)) {\n this.ops = ops;\n } else if (ops != null && Array.isArray(ops.ops)) {\n this.ops = ops.ops;\n } else {\n this.ops = [];\n }\n};\n\n\nDelta.prototype.insert = function (text, attributes) {\n var newOp = {};\n if (text.length === 0) return this;\n newOp.insert = text;\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype['delete'] = function (length) {\n if (length <= 0) return this;\n return this.push({ 'delete': length });\n};\n\nDelta.prototype.retain = function (length, attributes) {\n if (length <= 0) return this;\n var newOp = { retain: length };\n if (attributes != null && typeof attributes === 'object' && Object.keys(attributes).length > 0) {\n newOp.attributes = attributes;\n }\n return this.push(newOp);\n};\n\nDelta.prototype.push = function (newOp) {\n var index = this.ops.length;\n var lastOp = this.ops[index - 1];\n newOp = extend(true, {}, newOp);\n if (typeof lastOp === 'object') {\n if (typeof newOp['delete'] === 'number' && typeof lastOp['delete'] === 'number') {\n this.ops[index - 1] = { 'delete': lastOp['delete'] + newOp['delete'] };\n return this;\n }\n // Since it does not matter if we insert before or after deleting at the same index,\n // always prefer to insert first\n if (typeof lastOp['delete'] === 'number' && newOp.insert != null) {\n index -= 1;\n lastOp = this.ops[index - 1];\n if (typeof lastOp !== 'object') {\n this.ops.unshift(newOp);\n return this;\n }\n }\n if (equal(newOp.attributes, lastOp.attributes)) {\n if (typeof newOp.insert === 'string' && typeof lastOp.insert === 'string') {\n this.ops[index - 1] = { insert: lastOp.insert + newOp.insert };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n } else if (typeof newOp.retain === 'number' && typeof lastOp.retain === 'number') {\n this.ops[index - 1] = { retain: lastOp.retain + newOp.retain };\n if (typeof newOp.attributes === 'object') this.ops[index - 1].attributes = newOp.attributes\n return this;\n }\n }\n }\n if (index === this.ops.length) {\n this.ops.push(newOp);\n } else {\n this.ops.splice(index, 0, newOp);\n }\n return this;\n};\n\nDelta.prototype.chop = function () {\n var lastOp = this.ops[this.ops.length - 1];\n if (lastOp && lastOp.retain && !lastOp.attributes) {\n this.ops.pop();\n }\n return this;\n};\n\nDelta.prototype.filter = function (predicate) {\n return this.ops.filter(predicate);\n};\n\nDelta.prototype.forEach = function (predicate) {\n this.ops.forEach(predicate);\n};\n\nDelta.prototype.map = function (predicate) {\n return this.ops.map(predicate);\n};\n\nDelta.prototype.partition = function (predicate) {\n var passed = [], failed = [];\n this.forEach(function(op) {\n var target = predicate(op) ? passed : failed;\n target.push(op);\n });\n return [passed, failed];\n};\n\nDelta.prototype.reduce = function (predicate, initial) {\n return this.ops.reduce(predicate, initial);\n};\n\nDelta.prototype.changeLength = function () {\n return this.reduce(function (length, elem) {\n if (elem.insert) {\n return length + op.length(elem);\n } else if (elem.delete) {\n return length - elem.delete;\n }\n return length;\n }, 0);\n};\n\nDelta.prototype.length = function () {\n return this.reduce(function (length, elem) {\n return length + op.length(elem);\n }, 0);\n};\n\nDelta.prototype.slice = function (start, end) {\n start = start || 0;\n if (typeof end !== 'number') end = Infinity;\n var ops = [];\n var iter = op.iterator(this.ops);\n var index = 0;\n while (index < end && iter.hasNext()) {\n var nextOp;\n if (index < start) {\n nextOp = iter.next(start - index);\n } else {\n nextOp = iter.next(end - index);\n ops.push(nextOp);\n }\n index += op.length(nextOp);\n }\n return new Delta(ops);\n};\n\n\nDelta.prototype.compose = function (other) {\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else if (thisIter.peekType() === 'delete') {\n delta.push(thisIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (typeof otherOp.retain === 'number') {\n var newOp = {};\n if (typeof thisOp.retain === 'number') {\n newOp.retain = length;\n } else {\n newOp.insert = thisOp.insert;\n }\n // Preserve null when composing with a retain, otherwise remove it for inserts\n var attributes = op.attributes.compose(thisOp.attributes, otherOp.attributes, typeof thisOp.retain === 'number');\n if (attributes) newOp.attributes = attributes;\n delta.push(newOp);\n // Other op should be delete, we could be an insert or retain\n // Insert + delete cancels out\n } else if (typeof otherOp['delete'] === 'number' && typeof thisOp.retain === 'number') {\n delta.push(otherOp);\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.concat = function (other) {\n var delta = new Delta(this.ops.slice());\n if (other.ops.length > 0) {\n delta.push(other.ops[0]);\n delta.ops = delta.ops.concat(other.ops.slice(1));\n }\n return delta;\n};\n\nDelta.prototype.diff = function (other, index) {\n if (this.ops === other.ops) {\n return new Delta();\n }\n var strings = [this, other].map(function (delta) {\n return delta.map(function (op) {\n if (op.insert != null) {\n return typeof op.insert === 'string' ? op.insert : NULL_CHARACTER;\n }\n var prep = (delta === other) ? 'on' : 'with';\n throw new Error('diff() called ' + prep + ' non-document');\n }).join('');\n });\n var delta = new Delta();\n var diffResult = diff(strings[0], strings[1], index);\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n diffResult.forEach(function (component) {\n var length = component[1].length;\n while (length > 0) {\n var opLength = 0;\n switch (component[0]) {\n case diff.INSERT:\n opLength = Math.min(otherIter.peekLength(), length);\n delta.push(otherIter.next(opLength));\n break;\n case diff.DELETE:\n opLength = Math.min(length, thisIter.peekLength());\n thisIter.next(opLength);\n delta['delete'](opLength);\n break;\n case diff.EQUAL:\n opLength = Math.min(thisIter.peekLength(), otherIter.peekLength(), length);\n var thisOp = thisIter.next(opLength);\n var otherOp = otherIter.next(opLength);\n if (equal(thisOp.insert, otherOp.insert)) {\n delta.retain(opLength, op.attributes.diff(thisOp.attributes, otherOp.attributes));\n } else {\n delta.push(otherOp)['delete'](opLength);\n }\n break;\n }\n length -= opLength;\n }\n });\n return delta.chop();\n};\n\nDelta.prototype.eachLine = function (predicate, newline) {\n newline = newline || '\\n';\n var iter = op.iterator(this.ops);\n var line = new Delta();\n var i = 0;\n while (iter.hasNext()) {\n if (iter.peekType() !== 'insert') return;\n var thisOp = iter.peek();\n var start = op.length(thisOp) - iter.peekLength();\n var index = typeof thisOp.insert === 'string' ?\n thisOp.insert.indexOf(newline, start) - start : -1;\n if (index < 0) {\n line.push(iter.next());\n } else if (index > 0) {\n line.push(iter.next(index));\n } else {\n if (predicate(line, iter.next(1).attributes || {}, i) === false) {\n return;\n }\n i += 1;\n line = new Delta();\n }\n }\n if (line.length() > 0) {\n predicate(line, {}, i);\n }\n};\n\nDelta.prototype.transform = function (other, priority) {\n priority = !!priority;\n if (typeof other === 'number') {\n return this.transformPosition(other, priority);\n }\n var thisIter = op.iterator(this.ops);\n var otherIter = op.iterator(other.ops);\n var delta = new Delta();\n while (thisIter.hasNext() || otherIter.hasNext()) {\n if (thisIter.peekType() === 'insert' && (priority || otherIter.peekType() !== 'insert')) {\n delta.retain(op.length(thisIter.next()));\n } else if (otherIter.peekType() === 'insert') {\n delta.push(otherIter.next());\n } else {\n var length = Math.min(thisIter.peekLength(), otherIter.peekLength());\n var thisOp = thisIter.next(length);\n var otherOp = otherIter.next(length);\n if (thisOp['delete']) {\n // Our delete either makes their delete redundant or removes their retain\n continue;\n } else if (otherOp['delete']) {\n delta.push(otherOp);\n } else {\n // We retain either their retain or insert\n delta.retain(length, op.attributes.transform(thisOp.attributes, otherOp.attributes, priority));\n }\n }\n }\n return delta.chop();\n};\n\nDelta.prototype.transformPosition = function (index, priority) {\n priority = !!priority;\n var thisIter = op.iterator(this.ops);\n var offset = 0;\n while (thisIter.hasNext() && offset <= index) {\n var length = thisIter.peekLength();\n var nextType = thisIter.peekType();\n thisIter.next();\n if (nextType === 'delete') {\n index -= Math.min(length, index - offset);\n continue;\n } else if (nextType === 'insert' && (offset < index || !priority)) {\n index += length;\n }\n offset += length;\n }\n return index;\n};\n\n\nmodule.exports = Delta;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/quill-delta/lib/delta.js\n// module id = 4\n// module chunks = 0","import Text from './text';\nimport Parchment from 'parchment';\n\n\nclass Inline extends Parchment.Inline {\n static compare(self, other) {\n let selfIndex = Inline.order.indexOf(self);\n let otherIndex = Inline.order.indexOf(other);\n if (selfIndex >= 0 || otherIndex >= 0) {\n return selfIndex - otherIndex;\n } else if (self === other) {\n return 0;\n } else if (self < other) {\n return -1;\n } else {\n return 1;\n }\n }\n\n formatAt(index, length, name, value) {\n if (Inline.compare(this.statics.blotName, name) < 0 && Parchment.query(name, Parchment.Scope.BLOT)) {\n let blot = this.isolate(index, length);\n if (value) {\n blot.wrap(name, value);\n }\n } else {\n super.formatAt(index, length, name, value);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.parent instanceof Inline &&\n Inline.compare(this.statics.blotName, this.parent.statics.blotName) > 0) {\n let parent = this.parent.isolate(this.offset(), this.length());\n this.moveChildren(parent);\n parent.wrap(this);\n }\n }\n}\nInline.allowedChildren = [Inline, Parchment.Embed, Text];\n// Lower index means deeper in the DOM tree, since not found (-1) is for embeds\nInline.order = [\n 'cursor', 'inline', // Must be lower\n 'underline', 'strike', 'italic', 'bold', 'script',\n 'link', 'code' // Must be higher\n];\n\n\nexport default Inline;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/inline.js","import './polyfill';\nimport Delta from 'quill-delta';\nimport Editor from './editor';\nimport Emitter from './emitter';\nimport Module from './module';\nimport Parchment from 'parchment';\nimport Selection, { Range } from './selection';\nimport extend from 'extend';\nimport logger from './logger';\nimport Theme from './theme';\n\nlet debug = logger('quill');\n\n\nclass Quill {\n static debug(limit) {\n if (limit === true) {\n limit = 'log';\n }\n logger.level(limit);\n }\n\n static find(node) {\n return node.__quill || Parchment.find(node);\n }\n\n static import(name) {\n if (this.imports[name] == null) {\n debug.error(`Cannot import ${name}. Are you sure it was registered?`);\n }\n return this.imports[name];\n }\n\n static register(path, target, overwrite = false) {\n if (typeof path !== 'string') {\n let name = path.attrName || path.blotName;\n if (typeof name === 'string') {\n // register(Blot | Attributor, overwrite)\n this.register('formats/' + name, path, target);\n } else {\n Object.keys(path).forEach((key) => {\n this.register(key, path[key], target);\n });\n }\n } else {\n if (this.imports[path] != null && !overwrite) {\n debug.warn(`Overwriting ${path} with`, target);\n }\n this.imports[path] = target;\n if ((path.startsWith('blots/') || path.startsWith('formats/')) &&\n target.blotName !== 'abstract') {\n Parchment.register(target);\n } else if (path.startsWith('modules') && typeof target.register === 'function') {\n target.register();\n }\n }\n }\n\n constructor(container, options = {}) {\n this.options = expandConfig(container, options);\n this.container = this.options.container;\n if (this.container == null) {\n return debug.error('Invalid Quill container', container);\n }\n if (this.options.debug) {\n Quill.debug(this.options.debug);\n }\n let html = this.container.innerHTML.trim();\n this.container.classList.add('ql-container');\n this.container.innerHTML = '';\n this.container.__quill = this;\n this.root = this.addContainer('ql-editor');\n this.root.classList.add('ql-blank');\n this.root.setAttribute('data-gramm', false);\n this.scrollingContainer = this.options.scrollingContainer || this.root;\n this.emitter = new Emitter();\n this.scroll = Parchment.create(this.root, {\n emitter: this.emitter,\n whitelist: this.options.formats\n });\n this.editor = new Editor(this.scroll);\n this.selection = new Selection(this.scroll, this.emitter);\n this.theme = new this.options.theme(this, this.options);\n this.keyboard = this.theme.addModule('keyboard');\n this.clipboard = this.theme.addModule('clipboard');\n this.history = this.theme.addModule('history');\n this.theme.init();\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type) => {\n if (type === Emitter.events.TEXT_CHANGE) {\n this.root.classList.toggle('ql-blank', this.editor.isBlank());\n }\n });\n this.emitter.on(Emitter.events.SCROLL_UPDATE, (source, mutations) => {\n let range = this.selection.lastRange;\n let index = range && range.length === 0 ? range.index : undefined;\n modify.call(this, () => {\n return this.editor.update(null, mutations, index);\n }, source);\n });\n let contents = this.clipboard.convert(`
${html}


`);\n this.setContents(contents);\n this.history.clear();\n if (this.options.placeholder) {\n this.root.setAttribute('data-placeholder', this.options.placeholder);\n }\n if (this.options.readOnly) {\n this.disable();\n }\n }\n\n addContainer(container, refNode = null) {\n if (typeof container === 'string') {\n let className = container;\n container = document.createElement('div');\n container.classList.add(className);\n }\n this.container.insertBefore(container, refNode);\n return container;\n }\n\n blur() {\n this.selection.setRange(null);\n }\n\n deleteText(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.deleteText(index, length);\n }, source, index, -1*length);\n }\n\n disable() {\n this.enable(false);\n }\n\n enable(enabled = true) {\n this.scroll.enable(enabled);\n this.container.classList.toggle('ql-disabled', !enabled);\n }\n\n focus() {\n let scrollTop = this.scrollingContainer.scrollTop;\n this.selection.focus();\n this.scrollingContainer.scrollTop = scrollTop;\n this.scrollIntoView();\n }\n\n format(name, value, source = Emitter.sources.API) {\n return modify.call(this, () => {\n let range = this.getSelection(true);\n let change = new Delta();\n if (range == null) {\n return change;\n } else if (Parchment.query(name, Parchment.Scope.BLOCK)) {\n change = this.editor.formatLine(range.index, range.length, { [name]: value });\n } else if (range.length === 0) {\n this.selection.format(name, value);\n return change;\n } else {\n change = this.editor.formatText(range.index, range.length, { [name]: value });\n }\n this.setSelection(range, Emitter.sources.SILENT);\n return change;\n }, source);\n }\n\n formatLine(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatLine(index, length, formats);\n }, source, index, 0);\n }\n\n formatText(index, length, name, value, source) {\n let formats;\n [index, length, formats, source] = overload(index, length, name, value, source);\n return modify.call(this, () => {\n return this.editor.formatText(index, length, formats);\n }, source, index, 0);\n }\n\n getBounds(index, length = 0) {\n let bounds;\n if (typeof index === 'number') {\n bounds = this.selection.getBounds(index, length);\n } else {\n bounds = this.selection.getBounds(index.index, index.length);\n }\n let containerBounds = this.container.getBoundingClientRect();\n return {\n bottom: bounds.bottom - containerBounds.top,\n height: bounds.height,\n left: bounds.left - containerBounds.left,\n right: bounds.right - containerBounds.left,\n top: bounds.top - containerBounds.top,\n width: bounds.width\n };\n }\n\n getContents(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getContents(index, length);\n }\n\n getFormat(index = this.getSelection(true), length = 0) {\n if (typeof index === 'number') {\n return this.editor.getFormat(index, length);\n } else {\n return this.editor.getFormat(index.index, index.length);\n }\n }\n\n getIndex(blot) {\n return blot.offset(this.scroll);\n }\n\n getLength() {\n return this.scroll.length();\n }\n\n getLeaf(index) {\n return this.scroll.leaf(index);\n }\n\n getLine(index) {\n return this.scroll.line(index);\n }\n\n getLines(index = 0, length = Number.MAX_VALUE) {\n if (typeof index !== 'number') {\n return this.scroll.lines(index.index, index.length);\n } else {\n return this.scroll.lines(index, length);\n }\n }\n\n getModule(name) {\n return this.theme.modules[name];\n }\n\n getSelection(focus = false) {\n if (focus) this.focus();\n this.update(); // Make sure we access getRange with editor in consistent state\n return this.selection.getRange()[0];\n }\n\n getText(index = 0, length = this.getLength() - index) {\n [index, length] = overload(index, length);\n return this.editor.getText(index, length);\n }\n\n hasFocus() {\n return this.selection.hasFocus();\n }\n\n insertEmbed(index, embed, value, source = Quill.sources.API) {\n return modify.call(this, () => {\n return this.editor.insertEmbed(index, embed, value);\n }, source, index);\n }\n\n insertText(index, text, name, value, source) {\n let formats;\n [index, , formats, source] = overload(index, 0, name, value, source);\n return modify.call(this, () => {\n return this.editor.insertText(index, text, formats);\n }, source, index, text.length);\n }\n\n isEnabled() {\n return !this.container.classList.contains('ql-disabled');\n }\n\n off() {\n return this.emitter.off.apply(this.emitter, arguments);\n }\n\n on() {\n return this.emitter.on.apply(this.emitter, arguments);\n }\n\n once() {\n return this.emitter.once.apply(this.emitter, arguments);\n }\n\n pasteHTML(index, html, source) {\n this.clipboard.dangerouslyPasteHTML(index, html, source);\n }\n\n removeFormat(index, length, source) {\n [index, length, , source] = overload(index, length, source);\n return modify.call(this, () => {\n return this.editor.removeFormat(index, length);\n }, source, index);\n }\n\n scrollIntoView() {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n\n setContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n let length = this.getLength();\n let deleted = this.editor.deleteText(0, length);\n let applied = this.editor.applyDelta(delta);\n let lastOp = applied.ops[applied.ops.length - 1];\n if (lastOp != null && typeof(lastOp.insert) === 'string' && lastOp.insert[lastOp.insert.length-1] === '\\n') {\n this.editor.deleteText(this.getLength() - 1, 1);\n applied.delete(1);\n }\n let ret = deleted.compose(applied);\n return ret;\n }, source);\n }\n\n setSelection(index, length, source) {\n if (index == null) {\n this.selection.setRange(null, length || Quill.sources.API);\n } else {\n [index, length, , source] = overload(index, length, source);\n this.selection.setRange(new Range(index, length), source);\n if (source !== Emitter.sources.SILENT) {\n this.selection.scrollIntoView(this.scrollingContainer);\n }\n }\n }\n\n setText(text, source = Emitter.sources.API) {\n let delta = new Delta().insert(text);\n return this.setContents(delta, source);\n }\n\n update(source = Emitter.sources.USER) {\n let change = this.scroll.update(source); // Will update selection before selection.update() does if text changes\n this.selection.update(source);\n return change;\n }\n\n updateContents(delta, source = Emitter.sources.API) {\n return modify.call(this, () => {\n delta = new Delta(delta);\n return this.editor.applyDelta(delta, source);\n }, source, true);\n }\n}\nQuill.DEFAULTS = {\n bounds: null,\n formats: null,\n modules: {},\n placeholder: '',\n readOnly: false,\n scrollingContainer: null,\n strict: true,\n theme: 'default'\n};\nQuill.events = Emitter.events;\nQuill.sources = Emitter.sources;\n// eslint-disable-next-line no-undef\nQuill.version = typeof(QUILL_VERSION) === 'undefined' ? 'dev' : QUILL_VERSION;\n\nQuill.imports = {\n 'delta' : Delta,\n 'parchment' : Parchment,\n 'core/module' : Module,\n 'core/theme' : Theme\n};\n\n\nfunction expandConfig(container, userConfig) {\n userConfig = extend(true, {\n container: container,\n modules: {\n clipboard: true,\n keyboard: true,\n history: true\n }\n }, userConfig);\n if (!userConfig.theme || userConfig.theme === Quill.DEFAULTS.theme) {\n userConfig.theme = Theme;\n } else {\n userConfig.theme = Quill.import(`themes/${userConfig.theme}`);\n if (userConfig.theme == null) {\n throw new Error(`Invalid theme ${userConfig.theme}. Did you register it?`);\n }\n }\n let themeConfig = extend(true, {}, userConfig.theme.DEFAULTS);\n [themeConfig, userConfig].forEach(function(config) {\n config.modules = config.modules || {};\n Object.keys(config.modules).forEach(function(module) {\n if (config.modules[module] === true) {\n config.modules[module] = {};\n }\n });\n });\n let moduleNames = Object.keys(themeConfig.modules).concat(Object.keys(userConfig.modules));\n let moduleConfig = moduleNames.reduce(function(config, name) {\n let moduleClass = Quill.import(`modules/${name}`);\n if (moduleClass == null) {\n debug.error(`Cannot load ${name} module. Are you sure you registered it?`);\n } else {\n config[name] = moduleClass.DEFAULTS || {};\n }\n return config;\n }, {});\n // Special case toolbar shorthand\n if (userConfig.modules != null && userConfig.modules.toolbar &&\n userConfig.modules.toolbar.constructor !== Object) {\n userConfig.modules.toolbar = {\n container: userConfig.modules.toolbar\n };\n }\n userConfig = extend(true, {}, Quill.DEFAULTS, { modules: moduleConfig }, themeConfig, userConfig);\n ['bounds', 'container', 'scrollingContainer'].forEach(function(key) {\n if (typeof userConfig[key] === 'string') {\n userConfig[key] = document.querySelector(userConfig[key]);\n }\n });\n userConfig.modules = Object.keys(userConfig.modules).reduce(function(config, name) {\n if (userConfig.modules[name]) {\n config[name] = userConfig.modules[name];\n }\n return config;\n }, {});\n return userConfig;\n}\n\n// Handle selection preservation and TEXT_CHANGE emission\n// common to modification APIs\nfunction modify(modifier, source, index, shift) {\n if (this.options.strict && !this.isEnabled() && source === Emitter.sources.USER) {\n return new Delta();\n }\n let range = index == null ? null : this.getSelection();\n let oldDelta = this.editor.delta;\n let change = modifier();\n if (range != null) {\n if (index === true) index = range.index;\n if (shift == null) {\n range = shiftRange(range, change, source);\n } else if (shift !== 0) {\n range = shiftRange(range, index, shift, source);\n }\n this.setSelection(range, Emitter.sources.SILENT);\n }\n if (change.length() > 0) {\n let args = [Emitter.events.TEXT_CHANGE, change, oldDelta, source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n return change;\n}\n\nfunction overload(index, length, name, value, source) {\n let formats = {};\n if (typeof index.index === 'number' && typeof index.length === 'number') {\n // Allow for throwaway end (used by insertText/insertEmbed)\n if (typeof length !== 'number') {\n source = value, value = name, name = length, length = index.length, index = index.index;\n } else {\n length = index.length, index = index.index;\n }\n } else if (typeof length !== 'number') {\n source = value, value = name, name = length, length = 0;\n }\n // Handle format being object, two format name/value strings or excluded\n if (typeof name === 'object') {\n formats = name;\n source = value;\n } else if (typeof name === 'string') {\n if (value != null) {\n formats[name] = value;\n } else {\n source = name;\n }\n }\n // Handle optional source\n source = source || Emitter.sources.API;\n return [index, length, formats, source];\n}\n\nfunction shiftRange(range, index, length, source) {\n if (range == null) return null;\n let start, end;\n if (index instanceof Delta) {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n return index.transformPosition(pos, source !== Emitter.sources.USER);\n });\n } else {\n [start, end] = [range.index, range.index + range.length].map(function(pos) {\n if (pos < index || (pos === index && source === Emitter.sources.USER)) return pos;\n if (length >= 0) {\n return pos + length;\n } else {\n return Math.max(index, pos + length);\n }\n });\n }\n return new Range(start, end - start);\n}\n\n\nexport { expandConfig, overload, Quill as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/quill.js","class Module {\n constructor(quill, options = {}) {\n this.quill = quill;\n this.options = options;\n }\n}\nModule.DEFAULTS = {};\n\n\nexport default Module;\n\n\n\n// WEBPACK FOOTER //\n// ./core/module.js","import Parchment from 'parchment';\n\nclass TextBlot extends Parchment.Text { }\n\nexport default TextBlot;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/text.js","import EventEmitter from 'eventemitter3';\nimport logger from './logger';\n\nlet debug = logger('quill:events');\n\nconst EVENTS = ['selectionchange', 'mousedown', 'mouseup', 'click'];\n\nEVENTS.forEach(function(eventName) {\n document.addEventListener(eventName, (...args) => {\n [].slice.call(document.querySelectorAll('.ql-container')).forEach((node) => {\n // TODO use WeakMap\n if (node.__quill && node.__quill.emitter) {\n node.__quill.emitter.handleDOM(...args);\n }\n });\n });\n});\n\n\nclass Emitter extends EventEmitter {\n constructor() {\n super();\n this.listeners = {};\n this.on('error', debug.error);\n }\n\n emit() {\n debug.log.apply(debug, arguments);\n super.emit.apply(this, arguments);\n }\n\n handleDOM(event, ...args) {\n (this.listeners[event.type] || []).forEach(function({ node, handler }) {\n if (event.target === node || node.contains(event.target)) {\n handler(event, ...args);\n }\n });\n }\n\n listenDOM(eventName, node, handler) {\n if (!this.listeners[eventName]) {\n this.listeners[eventName] = [];\n }\n this.listeners[eventName].push({ node, handler })\n }\n}\n\nEmitter.events = {\n EDITOR_CHANGE : 'editor-change',\n SCROLL_BEFORE_UPDATE : 'scroll-before-update',\n SCROLL_OPTIMIZE : 'scroll-optimize',\n SCROLL_UPDATE : 'scroll-update',\n SELECTION_CHANGE : 'selection-change',\n TEXT_CHANGE : 'text-change'\n};\nEmitter.sources = {\n API : 'api',\n SILENT : 'silent',\n USER : 'user'\n};\n\n\nexport default Emitter;\n\n\n\n// WEBPACK FOOTER //\n// ./core/emitter.js","let levels = ['error', 'warn', 'log', 'info'];\nlet level = 'warn';\n\nfunction debug(method, ...args) {\n if (levels.indexOf(method) <= levels.indexOf(level)) {\n console[method](...args); // eslint-disable-line no-console\n }\n}\n\nfunction namespace(ns) {\n return levels.reduce(function(logger, method) {\n logger[method] = debug.bind(console, method, ns);\n return logger;\n }, {});\n}\n\ndebug.level = namespace.level = function(newLevel) {\n level = newLevel;\n};\n\n\nexport default namespace;\n\n\n\n// WEBPACK FOOTER //\n// ./core/logger.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../registry\");\nvar Attributor = /** @class */ (function () {\n function Attributor(attrName, keyName, options) {\n if (options === void 0) { options = {}; }\n this.attrName = attrName;\n this.keyName = keyName;\n var attributeBit = Registry.Scope.TYPE & Registry.Scope.ATTRIBUTE;\n if (options.scope != null) {\n // Ignore type bits, force attribute bit\n this.scope = (options.scope & Registry.Scope.LEVEL) | attributeBit;\n }\n else {\n this.scope = Registry.Scope.ATTRIBUTE;\n }\n if (options.whitelist != null)\n this.whitelist = options.whitelist;\n }\n Attributor.keys = function (node) {\n return [].map.call(node.attributes, function (item) {\n return item.name;\n });\n };\n Attributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n node.setAttribute(this.keyName, value);\n return true;\n };\n Attributor.prototype.canAdd = function (node, value) {\n var match = Registry.query(node, Registry.Scope.BLOT & (this.scope | Registry.Scope.TYPE));\n if (match == null)\n return false;\n if (this.whitelist == null)\n return true;\n if (typeof value === 'string') {\n return this.whitelist.indexOf(value.replace(/[\"']/g, '')) > -1;\n }\n else {\n return this.whitelist.indexOf(value) > -1;\n }\n };\n Attributor.prototype.remove = function (node) {\n node.removeAttribute(this.keyName);\n };\n Attributor.prototype.value = function (node) {\n var value = node.getAttribute(this.keyName);\n if (this.canAdd(node, value) && value) {\n return value;\n }\n return '';\n };\n return Attributor;\n}());\nexports.default = Attributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/attributor.ts\n// module id = 11\n// module chunks = 0","var pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n if (!opts) opts = {};\n // 7.1. All identical values are equivalent, as determined by ===.\n if (actual === expected) {\n return true;\n\n } else if (actual instanceof Date && expected instanceof Date) {\n return actual.getTime() === expected.getTime();\n\n // 7.3. Other pairs that do not both pass typeof value == 'object',\n // equivalence is determined by ==.\n } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n return opts.strict ? actual === expected : actual == expected;\n\n // 7.4. For all other Object pairs, including Array objects, equivalence is\n // determined by having the same number of owned properties (as verified\n // with Object.prototype.hasOwnProperty.call), the same set of keys\n // (although not necessarily the same order), equivalent values for every\n // corresponding key, and an identical 'prototype' property. Note: this\n // accounts for both named and indexed properties on Arrays.\n } else {\n return objEquiv(actual, expected, opts);\n }\n}\n\nfunction isUndefinedOrNull(value) {\n return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n return false;\n }\n if (x.length > 0 && typeof x[0] !== 'number') return false;\n return true;\n}\n\nfunction objEquiv(a, b, opts) {\n var i, key;\n if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n return false;\n // an identical 'prototype' property.\n if (a.prototype !== b.prototype) return false;\n //~~~I've managed to break Object.keys through screwy arguments passing.\n // Converting to array solves the problem.\n if (isArguments(a)) {\n if (!isArguments(b)) {\n return false;\n }\n a = pSlice.call(a);\n b = pSlice.call(b);\n return deepEqual(a, b, opts);\n }\n if (isBuffer(a)) {\n if (!isBuffer(b)) {\n return false;\n }\n if (a.length !== b.length) return false;\n for (i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }\n try {\n var ka = objectKeys(a),\n kb = objectKeys(b);\n } catch (e) {//happens when one is a string literal and the other isn't\n return false;\n }\n // having the same number of owned properties (keys incorporates\n // hasOwnProperty)\n if (ka.length != kb.length)\n return false;\n //the same set of keys (although not necessarily the same order),\n ka.sort();\n kb.sort();\n //~~~cheap key test\n for (i = ka.length - 1; i >= 0; i--) {\n if (ka[i] != kb[i])\n return false;\n }\n //equivalent values for every corresponding key, and\n //~~~possibly expensive deep test\n for (i = ka.length - 1; i >= 0; i--) {\n key = ka[i];\n if (!deepEqual(a[key], b[key], opts)) return false;\n }\n return typeof a === typeof b;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/index.js\n// module id = 12\n// module chunks = 0","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Inline from '../blots/inline';\nimport TextBlot from '../blots/text';\n\n\nclass Code extends Inline {}\nCode.blotName = 'code';\nCode.tagName = 'CODE';\n\n\nclass CodeBlock extends Block {\n static create(value) {\n let domNode = super.create(value);\n domNode.setAttribute('spellcheck', false);\n return domNode;\n }\n\n static formats() {\n return true;\n }\n\n delta() {\n let text = this.domNode.textContent;\n if (text.endsWith('\\n')) { // Should always be true\n text = text.slice(0, -1);\n }\n return text.split('\\n').reduce((delta, frag) => {\n return delta.insert(frag).insert('\\n', this.formats());\n }, new Delta());\n }\n\n format(name, value) {\n if (name === this.statics.blotName && value) return;\n let [text, ] = this.descendant(TextBlot, this.length() - 1);\n if (text != null) {\n text.deleteAt(text.length() - 1, 1);\n }\n super.format(name, value);\n }\n\n formatAt(index, length, name, value) {\n if (length === 0) return;\n if (Parchment.query(name, Parchment.Scope.BLOCK) == null ||\n (name === this.statics.blotName && value === this.statics.formats(this.domNode))) {\n return;\n }\n let nextNewline = this.newlineIndex(index);\n if (nextNewline < 0 || nextNewline >= index + length) return;\n let prevNewline = this.newlineIndex(index, true) + 1;\n let isolateLength = nextNewline - prevNewline + 1;\n let blot = this.isolate(prevNewline, isolateLength);\n let next = blot.next;\n blot.format(name, value);\n if (next instanceof CodeBlock) {\n next.formatAt(0, index - prevNewline + length - isolateLength, name, value);\n }\n }\n\n insertAt(index, value, def) {\n if (def != null) return;\n let [text, offset] = this.descendant(TextBlot, index);\n text.insertAt(offset, value);\n }\n\n length() {\n let length = this.domNode.textContent.length;\n if (!this.domNode.textContent.endsWith('\\n')) {\n return length + 1;\n }\n return length;\n }\n\n newlineIndex(searchIndex, reverse = false) {\n if (!reverse) {\n let offset = this.domNode.textContent.slice(searchIndex).indexOf('\\n');\n return offset > -1 ? searchIndex + offset : -1;\n } else {\n return this.domNode.textContent.slice(0, searchIndex).lastIndexOf('\\n');\n }\n }\n\n optimize(context) {\n if (!this.domNode.textContent.endsWith('\\n')) {\n this.appendChild(Parchment.create('text', '\\n'));\n }\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n this.statics.formats(this.domNode) === next.statics.formats(next.domNode)) {\n next.optimize(context);\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n super.replace(target);\n [].slice.call(this.domNode.querySelectorAll('*')).forEach(function(node) {\n let blot = Parchment.find(node);\n if (blot == null) {\n node.parentNode.removeChild(node);\n } else if (blot instanceof Parchment.Embed) {\n blot.remove();\n } else {\n blot.unwrap();\n }\n });\n }\n}\nCodeBlock.blotName = 'code-block';\nCodeBlock.tagName = 'PRE';\nCodeBlock.TAB = ' ';\n\n\nexport { Code, CodeBlock as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/code.js","import Parchment from 'parchment';\n\n\nclass Break extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n insertInto(parent, ref) {\n if (parent.children.length === 0) {\n super.insertInto(parent, ref);\n } else {\n this.remove();\n }\n }\n\n length() {\n return 0;\n }\n\n value() {\n return '';\n }\n}\nBreak.blotName = 'break';\nBreak.tagName = 'BR';\n\n\nexport default Break;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/break.js","import Inline from '../blots/inline';\n\n\nclass Link extends Inline {\n static create(value) {\n let node = super.create(value);\n value = this.sanitize(value);\n node.setAttribute('href', value);\n node.setAttribute('target', '_blank');\n return node;\n }\n\n static formats(domNode) {\n return domNode.getAttribute('href');\n }\n\n static sanitize(url) {\n return sanitize(url, this.PROTOCOL_WHITELIST) ? url : this.SANITIZED_URL;\n }\n\n format(name, value) {\n if (name !== this.statics.blotName || !value) return super.format(name, value);\n value = this.constructor.sanitize(value);\n this.domNode.setAttribute('href', value);\n }\n}\nLink.blotName = 'link';\nLink.tagName = 'A';\nLink.SANITIZED_URL = 'about:blank';\nLink.PROTOCOL_WHITELIST = ['http', 'https', 'mailto', 'tel'];\n\n\nfunction sanitize(url, protocols) {\n let anchor = document.createElement('a');\n anchor.href = url;\n let protocol = anchor.href.slice(0, anchor.href.indexOf(':'));\n return protocols.indexOf(protocol) > -1;\n}\n\n\nexport { Link as default, sanitize };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/link.js","import DropdownIcon from '../assets/icons/dropdown.svg';\n\n\nclass Picker {\n constructor(select) {\n this.select = select;\n this.container = document.createElement('span');\n this.buildPicker();\n this.select.style.display = 'none';\n this.select.parentNode.insertBefore(this.container, this.select);\n this.label.addEventListener('mousedown', () => {\n this.container.classList.toggle('ql-expanded');\n });\n this.select.addEventListener('change', this.update.bind(this));\n }\n\n buildItem(option) {\n let item = document.createElement('span');\n item.classList.add('ql-picker-item');\n if (option.hasAttribute('value')) {\n item.setAttribute('data-value', option.getAttribute('value'));\n }\n if (option.textContent) {\n item.setAttribute('data-label', option.textContent);\n }\n item.addEventListener('click', () => {\n this.selectItem(item, true);\n });\n return item;\n }\n\n buildLabel() {\n let label = document.createElement('span');\n label.classList.add('ql-picker-label');\n label.innerHTML = DropdownIcon;\n this.container.appendChild(label);\n return label;\n }\n\n buildOptions() {\n let options = document.createElement('span');\n options.classList.add('ql-picker-options');\n [].slice.call(this.select.options).forEach((option) => {\n let item = this.buildItem(option);\n options.appendChild(item);\n if (option.selected === true) {\n this.selectItem(item);\n }\n });\n this.container.appendChild(options);\n }\n\n buildPicker() {\n [].slice.call(this.select.attributes).forEach((item) => {\n this.container.setAttribute(item.name, item.value);\n });\n this.container.classList.add('ql-picker');\n this.label = this.buildLabel();\n this.buildOptions();\n }\n\n close() {\n this.container.classList.remove('ql-expanded');\n }\n\n selectItem(item, trigger = false) {\n let selected = this.container.querySelector('.ql-selected');\n if (item === selected) return;\n if (selected != null) {\n selected.classList.remove('ql-selected');\n }\n if (item == null) return;\n item.classList.add('ql-selected');\n this.select.selectedIndex = [].indexOf.call(item.parentNode.children, item);\n if (item.hasAttribute('data-value')) {\n this.label.setAttribute('data-value', item.getAttribute('data-value'));\n } else {\n this.label.removeAttribute('data-value');\n }\n if (item.hasAttribute('data-label')) {\n this.label.setAttribute('data-label', item.getAttribute('data-label'));\n } else {\n this.label.removeAttribute('data-label');\n }\n if (trigger) {\n if (typeof Event === 'function') {\n this.select.dispatchEvent(new Event('change'));\n } else if (typeof Event === 'object') { // IE11\n let event = document.createEvent('Event');\n event.initEvent('change', true, true);\n this.select.dispatchEvent(event);\n }\n this.close();\n }\n }\n\n update() {\n let option;\n if (this.select.selectedIndex > -1) {\n let item = this.container.querySelector('.ql-picker-options').children[this.select.selectedIndex];\n option = this.select.options[this.select.selectedIndex];\n this.selectItem(item);\n } else {\n this.selectItem(null);\n }\n let isActive = option != null && option !== this.select.querySelector('option[selected]');\n this.label.classList.toggle('ql-active', isActive);\n }\n}\n\n\nexport default Picker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/picker.js","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar linked_list_1 = require(\"../../collection/linked-list\");\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar ContainerBlot = /** @class */ (function (_super) {\n __extends(ContainerBlot, _super);\n function ContainerBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.build();\n return _this;\n }\n ContainerBlot.prototype.appendChild = function (other) {\n this.insertBefore(other);\n };\n ContainerBlot.prototype.attach = function () {\n _super.prototype.attach.call(this);\n this.children.forEach(function (child) {\n child.attach();\n });\n };\n ContainerBlot.prototype.build = function () {\n var _this = this;\n this.children = new linked_list_1.default();\n // Need to be reversed for if DOM nodes already in order\n [].slice\n .call(this.domNode.childNodes)\n .reverse()\n .forEach(function (node) {\n try {\n var child = makeBlot(node);\n _this.insertBefore(child, _this.children.head || undefined);\n }\n catch (err) {\n if (err instanceof Registry.ParchmentError)\n return;\n else\n throw err;\n }\n });\n };\n ContainerBlot.prototype.deleteAt = function (index, length) {\n if (index === 0 && length === this.length()) {\n return this.remove();\n }\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.deleteAt(offset, length);\n });\n };\n ContainerBlot.prototype.descendant = function (criteria, index) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n return [child, offset];\n }\n else if (child instanceof ContainerBlot) {\n return child.descendant(criteria, offset);\n }\n else {\n return [null, -1];\n }\n };\n ContainerBlot.prototype.descendants = function (criteria, index, length) {\n if (index === void 0) { index = 0; }\n if (length === void 0) { length = Number.MAX_VALUE; }\n var descendants = [];\n var lengthLeft = length;\n this.children.forEachAt(index, length, function (child, index, length) {\n if ((criteria.blotName == null && criteria(child)) ||\n (criteria.blotName != null && child instanceof criteria)) {\n descendants.push(child);\n }\n if (child instanceof ContainerBlot) {\n descendants = descendants.concat(child.descendants(criteria, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return descendants;\n };\n ContainerBlot.prototype.detach = function () {\n this.children.forEach(function (child) {\n child.detach();\n });\n _super.prototype.detach.call(this);\n };\n ContainerBlot.prototype.formatAt = function (index, length, name, value) {\n this.children.forEachAt(index, length, function (child, offset, length) {\n child.formatAt(offset, length, name, value);\n });\n };\n ContainerBlot.prototype.insertAt = function (index, value, def) {\n var _a = this.children.find(index), child = _a[0], offset = _a[1];\n if (child) {\n child.insertAt(offset, value, def);\n }\n else {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n this.appendChild(blot);\n }\n };\n ContainerBlot.prototype.insertBefore = function (childBlot, refBlot) {\n if (this.statics.allowedChildren != null &&\n !this.statics.allowedChildren.some(function (child) {\n return childBlot instanceof child;\n })) {\n throw new Registry.ParchmentError(\"Cannot insert \" + childBlot.statics.blotName + \" into \" + this.statics.blotName);\n }\n childBlot.insertInto(this, refBlot);\n };\n ContainerBlot.prototype.length = function () {\n return this.children.reduce(function (memo, child) {\n return memo + child.length();\n }, 0);\n };\n ContainerBlot.prototype.moveChildren = function (targetParent, refNode) {\n this.children.forEach(function (child) {\n targetParent.insertBefore(child, refNode);\n });\n };\n ContainerBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n if (this.children.length === 0) {\n if (this.statics.defaultChild != null) {\n var child = Registry.create(this.statics.defaultChild);\n this.appendChild(child);\n child.optimize(context);\n }\n else {\n this.remove();\n }\n }\n };\n ContainerBlot.prototype.path = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var _a = this.children.find(index, inclusive), child = _a[0], offset = _a[1];\n var position = [[this, index]];\n if (child instanceof ContainerBlot) {\n return position.concat(child.path(offset, inclusive));\n }\n else if (child != null) {\n position.push([child, offset]);\n }\n return position;\n };\n ContainerBlot.prototype.removeChild = function (child) {\n this.children.remove(child);\n };\n ContainerBlot.prototype.replace = function (target) {\n if (target instanceof ContainerBlot) {\n target.moveChildren(this);\n }\n _super.prototype.replace.call(this, target);\n };\n ContainerBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = this.clone();\n this.parent.insertBefore(after, this.next);\n this.children.forEachAt(index, this.length(), function (child, offset, length) {\n child = child.split(offset, force);\n after.appendChild(child);\n });\n return after;\n };\n ContainerBlot.prototype.unwrap = function () {\n this.moveChildren(this.parent, this.next);\n this.remove();\n };\n ContainerBlot.prototype.update = function (mutations, context) {\n var _this = this;\n var addedNodes = [];\n var removedNodes = [];\n mutations.forEach(function (mutation) {\n if (mutation.target === _this.domNode && mutation.type === 'childList') {\n addedNodes.push.apply(addedNodes, mutation.addedNodes);\n removedNodes.push.apply(removedNodes, mutation.removedNodes);\n }\n });\n removedNodes.forEach(function (node) {\n // Check node has actually been removed\n // One exception is Chrome does not immediately remove IFRAMEs\n // from DOM but MutationRecord is correct in its reported removal\n if (node.parentNode != null &&\n // @ts-ignore\n node.tagName !== 'IFRAME' &&\n document.body.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return;\n }\n var blot = Registry.find(node);\n if (blot == null)\n return;\n if (blot.domNode.parentNode == null || blot.domNode.parentNode === _this.domNode) {\n blot.detach();\n }\n });\n addedNodes\n .filter(function (node) {\n return node.parentNode == _this.domNode;\n })\n .sort(function (a, b) {\n if (a === b)\n return 0;\n if (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING) {\n return 1;\n }\n return -1;\n })\n .forEach(function (node) {\n var refBlot = null;\n if (node.nextSibling != null) {\n refBlot = Registry.find(node.nextSibling);\n }\n var blot = makeBlot(node);\n if (blot.next != refBlot || blot.next == null) {\n if (blot.parent != null) {\n blot.parent.removeChild(_this);\n }\n _this.insertBefore(blot, refBlot || undefined);\n }\n });\n };\n return ContainerBlot;\n}(shadow_1.default));\nfunction makeBlot(node) {\n var blot = Registry.find(node);\n if (blot == null) {\n try {\n blot = Registry.create(node);\n }\n catch (e) {\n blot = Registry.create(Registry.Scope.INLINE);\n [].slice.call(node.childNodes).forEach(function (child) {\n // @ts-ignore\n blot.domNode.appendChild(child);\n });\n if (node.parentNode) {\n node.parentNode.replaceChild(blot.domNode, node);\n }\n blot.attach();\n }\n }\n return blot;\n}\nexports.default = ContainerBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/container.ts\n// module id = 17\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"../../attributor/attributor\");\nvar store_1 = require(\"../../attributor/store\");\nvar container_1 = require(\"./container\");\nvar Registry = require(\"../../registry\");\nvar FormatBlot = /** @class */ (function (_super) {\n __extends(FormatBlot, _super);\n function FormatBlot(domNode) {\n var _this = _super.call(this, domNode) || this;\n _this.attributes = new store_1.default(_this.domNode);\n return _this;\n }\n FormatBlot.formats = function (domNode) {\n if (typeof this.tagName === 'string') {\n return true;\n }\n else if (Array.isArray(this.tagName)) {\n return domNode.tagName.toLowerCase();\n }\n return undefined;\n };\n FormatBlot.prototype.format = function (name, value) {\n var format = Registry.query(name);\n if (format instanceof attributor_1.default) {\n this.attributes.attribute(format, value);\n }\n else if (value) {\n if (format != null && (name !== this.statics.blotName || this.formats()[name] !== value)) {\n this.replaceWith(name, value);\n }\n }\n };\n FormatBlot.prototype.formats = function () {\n var formats = this.attributes.values();\n var format = this.statics.formats(this.domNode);\n if (format != null) {\n formats[this.statics.blotName] = format;\n }\n return formats;\n };\n FormatBlot.prototype.replaceWith = function (name, value) {\n var replacement = _super.prototype.replaceWith.call(this, name, value);\n this.attributes.copy(replacement);\n return replacement;\n };\n FormatBlot.prototype.update = function (mutations, context) {\n var _this = this;\n _super.prototype.update.call(this, mutations, context);\n if (mutations.some(function (mutation) {\n return mutation.target === _this.domNode && mutation.type === 'attributes';\n })) {\n this.attributes.build();\n }\n };\n FormatBlot.prototype.wrap = function (name, value) {\n var wrapper = _super.prototype.wrap.call(this, name, value);\n if (wrapper instanceof FormatBlot && wrapper.statics.scope === this.statics.scope) {\n this.attributes.move(wrapper);\n }\n return wrapper;\n };\n return FormatBlot;\n}(container_1.default));\nexports.default = FormatBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/format.ts\n// module id = 18\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar shadow_1 = require(\"./shadow\");\nvar Registry = require(\"../../registry\");\nvar LeafBlot = /** @class */ (function (_super) {\n __extends(LeafBlot, _super);\n function LeafBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LeafBlot.value = function (domNode) {\n return true;\n };\n LeafBlot.prototype.index = function (node, offset) {\n if (this.domNode === node ||\n this.domNode.compareDocumentPosition(node) & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n return Math.min(offset, 1);\n }\n return -1;\n };\n LeafBlot.prototype.position = function (index, inclusive) {\n var offset = [].indexOf.call(this.parent.domNode.childNodes, this.domNode);\n if (index > 0)\n offset += 1;\n return [this.parent.domNode, offset];\n };\n LeafBlot.prototype.value = function () {\n return _a = {}, _a[this.statics.blotName] = this.statics.value(this.domNode) || true, _a;\n var _a;\n };\n LeafBlot.scope = Registry.Scope.INLINE_BLOT;\n return LeafBlot;\n}(shadow_1.default));\nexports.default = LeafBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/leaf.ts\n// module id = 19\n// module chunks = 0","var equal = require('deep-equal');\nvar extend = require('extend');\n\n\nvar lib = {\n attributes: {\n compose: function (a, b, keepNull) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = extend(true, {}, b);\n if (!keepNull) {\n attributes = Object.keys(attributes).reduce(function (copy, key) {\n if (attributes[key] != null) {\n copy[key] = attributes[key];\n }\n return copy;\n }, {});\n }\n for (var key in a) {\n if (a[key] !== undefined && b[key] === undefined) {\n attributes[key] = a[key];\n }\n }\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n diff: function(a, b) {\n if (typeof a !== 'object') a = {};\n if (typeof b !== 'object') b = {};\n var attributes = Object.keys(a).concat(Object.keys(b)).reduce(function (attributes, key) {\n if (!equal(a[key], b[key])) {\n attributes[key] = b[key] === undefined ? null : b[key];\n }\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n },\n\n transform: function (a, b, priority) {\n if (typeof a !== 'object') return b;\n if (typeof b !== 'object') return undefined;\n if (!priority) return b; // b simply overwrites us without priority\n var attributes = Object.keys(b).reduce(function (attributes, key) {\n if (a[key] === undefined) attributes[key] = b[key]; // null is a valid value\n return attributes;\n }, {});\n return Object.keys(attributes).length > 0 ? attributes : undefined;\n }\n },\n\n iterator: function (ops) {\n return new Iterator(ops);\n },\n\n length: function (op) {\n if (typeof op['delete'] === 'number') {\n return op['delete'];\n } else if (typeof op.retain === 'number') {\n return op.retain;\n } else {\n return typeof op.insert === 'string' ? op.insert.length : 1;\n }\n }\n};\n\n\nfunction Iterator(ops) {\n this.ops = ops;\n this.index = 0;\n this.offset = 0;\n};\n\nIterator.prototype.hasNext = function () {\n return this.peekLength() < Infinity;\n};\n\nIterator.prototype.next = function (length) {\n if (!length) length = Infinity;\n var nextOp = this.ops[this.index];\n if (nextOp) {\n var offset = this.offset;\n var opLength = lib.length(nextOp)\n if (length >= opLength - offset) {\n length = opLength - offset;\n this.index += 1;\n this.offset = 0;\n } else {\n this.offset += length;\n }\n if (typeof nextOp['delete'] === 'number') {\n return { 'delete': length };\n } else {\n var retOp = {};\n if (nextOp.attributes) {\n retOp.attributes = nextOp.attributes;\n }\n if (typeof nextOp.retain === 'number') {\n retOp.retain = length;\n } else if (typeof nextOp.insert === 'string') {\n retOp.insert = nextOp.insert.substr(offset, length);\n } else {\n // offset should === 0, length should === 1\n retOp.insert = nextOp.insert;\n }\n return retOp;\n }\n } else {\n return { retain: Infinity };\n }\n};\n\nIterator.prototype.peek = function () {\n return this.ops[this.index];\n};\n\nIterator.prototype.peekLength = function () {\n if (this.ops[this.index]) {\n // Should never return 0 if our index is being managed correctly\n return lib.length(this.ops[this.index]) - this.offset;\n } else {\n return Infinity;\n }\n};\n\nIterator.prototype.peekType = function () {\n if (this.ops[this.index]) {\n if (typeof this.ops[this.index]['delete'] === 'number') {\n return 'delete';\n } else if (typeof this.ops[this.index].retain === 'number') {\n return 'retain';\n } else {\n return 'insert';\n }\n }\n return 'retain';\n};\n\n\nmodule.exports = lib;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/quill-delta/lib/op.js\n// module id = 20\n// module chunks = 0","var clone = (function() {\n'use strict';\n\nfunction _instanceof(obj, type) {\n return type != null && obj instanceof type;\n}\n\nvar nativeMap;\ntry {\n nativeMap = Map;\n} catch(_) {\n // maybe a reference error because no `Map`. Give it a dummy value that no\n // value will ever be an instanceof.\n nativeMap = function() {};\n}\n\nvar nativeSet;\ntry {\n nativeSet = Set;\n} catch(_) {\n nativeSet = function() {};\n}\n\nvar nativePromise;\ntry {\n nativePromise = Promise;\n} catch(_) {\n nativePromise = function() {};\n}\n\n/**\n * Clones (copies) an Object using deep copying.\n *\n * This function supports circular references by default, but if you are certain\n * there are no circular references in your object, you can save some CPU time\n * by calling clone(obj, false).\n *\n * Caution: if `circular` is false and `parent` contains circular references,\n * your program may enter an infinite loop and crash.\n *\n * @param `parent` - the object to be cloned\n * @param `circular` - set to true if the object to be cloned may contain\n * circular references. (optional - true by default)\n * @param `depth` - set to a number if the object is only to be cloned to\n * a particular depth. (optional - defaults to Infinity)\n * @param `prototype` - sets the prototype to be used when cloning an object.\n * (optional - defaults to parent prototype).\n * @param `includeNonEnumerable` - set to true if the non-enumerable properties\n * should be cloned as well. Non-enumerable properties on the prototype\n * chain will be ignored. (optional - false by default)\n*/\nfunction clone(parent, circular, depth, prototype, includeNonEnumerable) {\n if (typeof circular === 'object') {\n depth = circular.depth;\n prototype = circular.prototype;\n includeNonEnumerable = circular.includeNonEnumerable;\n circular = circular.circular;\n }\n // maintain two arrays for circular references, where corresponding parents\n // and children have the same index\n var allParents = [];\n var allChildren = [];\n\n var useBuffer = typeof Buffer != 'undefined';\n\n if (typeof circular == 'undefined')\n circular = true;\n\n if (typeof depth == 'undefined')\n depth = Infinity;\n\n // recurse this function so we don't reset allParents and allChildren\n function _clone(parent, depth) {\n // cloning null always returns null\n if (parent === null)\n return null;\n\n if (depth === 0)\n return parent;\n\n var child;\n var proto;\n if (typeof parent != 'object') {\n return parent;\n }\n\n if (_instanceof(parent, nativeMap)) {\n child = new nativeMap();\n } else if (_instanceof(parent, nativeSet)) {\n child = new nativeSet();\n } else if (_instanceof(parent, nativePromise)) {\n child = new nativePromise(function (resolve, reject) {\n parent.then(function(value) {\n resolve(_clone(value, depth - 1));\n }, function(err) {\n reject(_clone(err, depth - 1));\n });\n });\n } else if (clone.__isArray(parent)) {\n child = [];\n } else if (clone.__isRegExp(parent)) {\n child = new RegExp(parent.source, __getRegExpFlags(parent));\n if (parent.lastIndex) child.lastIndex = parent.lastIndex;\n } else if (clone.__isDate(parent)) {\n child = new Date(parent.getTime());\n } else if (useBuffer && Buffer.isBuffer(parent)) {\n child = new Buffer(parent.length);\n parent.copy(child);\n return child;\n } else if (_instanceof(parent, Error)) {\n child = Object.create(parent);\n } else {\n if (typeof prototype == 'undefined') {\n proto = Object.getPrototypeOf(parent);\n child = Object.create(proto);\n }\n else {\n child = Object.create(prototype);\n proto = prototype;\n }\n }\n\n if (circular) {\n var index = allParents.indexOf(parent);\n\n if (index != -1) {\n return allChildren[index];\n }\n allParents.push(parent);\n allChildren.push(child);\n }\n\n if (_instanceof(parent, nativeMap)) {\n parent.forEach(function(value, key) {\n var keyChild = _clone(key, depth - 1);\n var valueChild = _clone(value, depth - 1);\n child.set(keyChild, valueChild);\n });\n }\n if (_instanceof(parent, nativeSet)) {\n parent.forEach(function(value) {\n var entryChild = _clone(value, depth - 1);\n child.add(entryChild);\n });\n }\n\n for (var i in parent) {\n var attrs;\n if (proto) {\n attrs = Object.getOwnPropertyDescriptor(proto, i);\n }\n\n if (attrs && attrs.set == null) {\n continue;\n }\n child[i] = _clone(parent[i], depth - 1);\n }\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(parent);\n for (var i = 0; i < symbols.length; i++) {\n // Don't need to worry about cloning a symbol because it is a primitive,\n // like a number or string.\n var symbol = symbols[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, symbol);\n if (descriptor && !descriptor.enumerable && !includeNonEnumerable) {\n continue;\n }\n child[symbol] = _clone(parent[symbol], depth - 1);\n if (!descriptor.enumerable) {\n Object.defineProperty(child, symbol, {\n enumerable: false\n });\n }\n }\n }\n\n if (includeNonEnumerable) {\n var allPropertyNames = Object.getOwnPropertyNames(parent);\n for (var i = 0; i < allPropertyNames.length; i++) {\n var propertyName = allPropertyNames[i];\n var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName);\n if (descriptor && descriptor.enumerable) {\n continue;\n }\n child[propertyName] = _clone(parent[propertyName], depth - 1);\n Object.defineProperty(child, propertyName, {\n enumerable: false\n });\n }\n }\n\n return child;\n }\n\n return _clone(parent, depth);\n}\n\n/**\n * Simple flat clone using prototype, accepts only objects, usefull for property\n * override on FLAT configuration object (no nested props).\n *\n * USE WITH CAUTION! This may not behave as you wish if you do not know how this\n * works.\n */\nclone.clonePrototype = function clonePrototype(parent) {\n if (parent === null)\n return null;\n\n var c = function () {};\n c.prototype = parent;\n return new c();\n};\n\n// private utility functions\n\nfunction __objToStr(o) {\n return Object.prototype.toString.call(o);\n}\nclone.__objToStr = __objToStr;\n\nfunction __isDate(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Date]';\n}\nclone.__isDate = __isDate;\n\nfunction __isArray(o) {\n return typeof o === 'object' && __objToStr(o) === '[object Array]';\n}\nclone.__isArray = __isArray;\n\nfunction __isRegExp(o) {\n return typeof o === 'object' && __objToStr(o) === '[object RegExp]';\n}\nclone.__isRegExp = __isRegExp;\n\nfunction __getRegExpFlags(re) {\n var flags = '';\n if (re.global) flags += 'g';\n if (re.ignoreCase) flags += 'i';\n if (re.multiline) flags += 'm';\n return flags;\n}\nclone.__getRegExpFlags = __getRegExpFlags;\n\nreturn clone;\n})();\n\nif (typeof module === 'object' && module.exports) {\n module.exports = clone;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/clone/clone.js\n// module id = 21\n// module chunks = 0","import Parchment from 'parchment';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport Emitter from './emitter';\nimport logger from './logger';\n\nlet debug = logger('quill:selection');\n\n\nclass Range {\n constructor(index, length = 0) {\n this.index = index;\n this.length = length;\n }\n}\n\n\nclass Selection {\n constructor(scroll, emitter) {\n this.emitter = emitter;\n this.scroll = scroll;\n this.composing = false;\n this.mouseDown = false;\n this.root = this.scroll.domNode;\n this.cursor = Parchment.create('cursor', this);\n // savedRange is last non-null range\n this.lastRange = this.savedRange = new Range(0, 0);\n this.handleComposition();\n this.handleDragging();\n this.emitter.listenDOM('selectionchange', document, () => {\n if (!this.mouseDown) {\n setTimeout(this.update.bind(this, Emitter.sources.USER), 1);\n }\n });\n this.emitter.on(Emitter.events.EDITOR_CHANGE, (type, delta) => {\n if (type === Emitter.events.TEXT_CHANGE && delta.length() > 0) {\n this.update(Emitter.sources.SILENT);\n }\n });\n this.emitter.on(Emitter.events.SCROLL_BEFORE_UPDATE, () => {\n if (!this.hasFocus()) return;\n let native = this.getNativeRange();\n if (native == null) return;\n if (native.start.node === this.cursor.textNode) return; // cursor.restore() will handle\n // TODO unclear if this has negative side effects\n this.emitter.once(Emitter.events.SCROLL_UPDATE, () => {\n try {\n this.setNativeRange(native.start.node, native.start.offset, native.end.node, native.end.offset);\n } catch (ignored) {}\n });\n });\n this.emitter.on(Emitter.events.SCROLL_OPTIMIZE, (mutations, context) => {\n if (context.range) {\n const { startNode, startOffset, endNode, endOffset } = context.range;\n this.setNativeRange(startNode, startOffset, endNode, endOffset);\n }\n });\n this.update(Emitter.sources.SILENT);\n }\n\n handleComposition() {\n this.root.addEventListener('compositionstart', () => {\n this.composing = true;\n });\n this.root.addEventListener('compositionend', () => {\n this.composing = false;\n if (this.cursor.parent) {\n const range = this.cursor.restore();\n if (!range) return;\n setTimeout(() => {\n this.setNativeRange(range.startNode, range.startOffset, range.endNode, range.endOffset);\n }, 1);\n }\n });\n }\n\n handleDragging() {\n this.emitter.listenDOM('mousedown', document.body, () => {\n this.mouseDown = true;\n });\n this.emitter.listenDOM('mouseup', document.body, () => {\n this.mouseDown = false;\n this.update(Emitter.sources.USER);\n });\n }\n\n focus() {\n if (this.hasFocus()) return;\n this.root.focus();\n this.setRange(this.savedRange);\n }\n\n format(format, value) {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n this.scroll.update();\n let nativeRange = this.getNativeRange();\n if (nativeRange == null || !nativeRange.native.collapsed || Parchment.query(format, Parchment.Scope.BLOCK)) return;\n if (nativeRange.start.node !== this.cursor.textNode) {\n let blot = Parchment.find(nativeRange.start.node, false);\n if (blot == null) return;\n // TODO Give blot ability to not split\n if (blot instanceof Parchment.Leaf) {\n let after = blot.split(nativeRange.start.offset);\n blot.parent.insertBefore(this.cursor, after);\n } else {\n blot.insertBefore(this.cursor, nativeRange.start.node); // Should never happen\n }\n this.cursor.attach();\n }\n this.cursor.format(format, value);\n this.scroll.optimize();\n this.setNativeRange(this.cursor.textNode, this.cursor.textNode.data.length);\n this.update();\n }\n\n getBounds(index, length = 0) {\n let scrollLength = this.scroll.length();\n index = Math.min(index, scrollLength - 1);\n length = Math.min(index + length, scrollLength - 1) - index;\n let node, [leaf, offset] = this.scroll.leaf(index);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n let range = document.createRange();\n if (length > 0) {\n range.setStart(node, offset);\n [leaf, offset] = this.scroll.leaf(index + length);\n if (leaf == null) return null;\n [node, offset] = leaf.position(offset, true);\n range.setEnd(node, offset);\n return range.getBoundingClientRect();\n } else {\n let side = 'left';\n let rect;\n if (node instanceof Text) {\n if (offset < node.data.length) {\n range.setStart(node, offset);\n range.setEnd(node, offset + 1);\n } else {\n range.setStart(node, offset - 1);\n range.setEnd(node, offset);\n side = 'right';\n }\n rect = range.getBoundingClientRect();\n } else {\n rect = leaf.domNode.getBoundingClientRect();\n if (offset > 0) side = 'right';\n }\n return {\n bottom: rect.top + rect.height,\n height: rect.height,\n left: rect[side],\n right: rect[side],\n top: rect.top,\n width: 0\n };\n }\n }\n\n getNativeRange() {\n let selection = document.getSelection();\n if (selection == null || selection.rangeCount <= 0) return null;\n let nativeRange = selection.getRangeAt(0);\n if (nativeRange == null) return null;\n let range = this.normalizeNative(nativeRange);\n debug.info('getNativeRange', range);\n return range;\n }\n\n getRange() {\n let normalized = this.getNativeRange();\n if (normalized == null) return [null, null];\n let range = this.normalizedToRange(normalized);\n return [range, normalized];\n }\n\n hasFocus() {\n return document.activeElement === this.root;\n }\n\n normalizedToRange(range) {\n let positions = [[range.start.node, range.start.offset]];\n if (!range.native.collapsed) {\n positions.push([range.end.node, range.end.offset]);\n }\n let indexes = positions.map((position) => {\n let [node, offset] = position;\n let blot = Parchment.find(node, true);\n let index = blot.offset(this.scroll);\n if (offset === 0) {\n return index;\n } else if (blot instanceof Parchment.Container) {\n return index + blot.length();\n } else {\n return index + blot.index(node, offset);\n }\n });\n let end = Math.min(Math.max(...indexes), this.scroll.length() - 1);\n let start = Math.min(end, ...indexes);\n return new Range(start, end-start);\n }\n\n normalizeNative(nativeRange) {\n if (!contains(this.root, nativeRange.startContainer) ||\n (!nativeRange.collapsed && !contains(this.root, nativeRange.endContainer))) {\n return null;\n }\n let range = {\n start: { node: nativeRange.startContainer, offset: nativeRange.startOffset },\n end: { node: nativeRange.endContainer, offset: nativeRange.endOffset },\n native: nativeRange\n };\n [range.start, range.end].forEach(function(position) {\n let node = position.node, offset = position.offset;\n while (!(node instanceof Text) && node.childNodes.length > 0) {\n if (node.childNodes.length > offset) {\n node = node.childNodes[offset];\n offset = 0;\n } else if (node.childNodes.length === offset) {\n node = node.lastChild;\n offset = node instanceof Text ? node.data.length : node.childNodes.length + 1;\n } else {\n break;\n }\n }\n position.node = node, position.offset = offset;\n });\n return range;\n }\n\n rangeToNative(range) {\n let indexes = range.collapsed ? [range.index] : [range.index, range.index + range.length];\n let args = [];\n let scrollLength = this.scroll.length();\n indexes.forEach((index, i) => {\n index = Math.min(scrollLength - 1, index);\n let node, [leaf, offset] = this.scroll.leaf(index);\n [node, offset] = leaf.position(offset, i !== 0);\n args.push(node, offset);\n });\n if (args.length < 2) {\n args = args.concat(args);\n }\n return args;\n }\n\n scrollIntoView(scrollingContainer) {\n let range = this.lastRange;\n if (range == null) return;\n let bounds = this.getBounds(range.index, range.length);\n if (bounds == null) return;\n let limit = this.scroll.length()-1;\n let [first, ] = this.scroll.line(Math.min(range.index, limit));\n let last = first;\n if (range.length > 0) {\n [last, ] = this.scroll.line(Math.min(range.index + range.length, limit));\n }\n if (first == null || last == null) return;\n let scrollBounds = scrollingContainer.getBoundingClientRect();\n if (bounds.top < scrollBounds.top) {\n scrollingContainer.scrollTop -= (scrollBounds.top - bounds.top);\n } else if (bounds.bottom > scrollBounds.bottom) {\n scrollingContainer.scrollTop += (bounds.bottom - scrollBounds.bottom);\n }\n }\n\n setNativeRange(startNode, startOffset, endNode = startNode, endOffset = startOffset, force = false) {\n debug.info('setNativeRange', startNode, startOffset, endNode, endOffset);\n if (startNode != null && (this.root.parentNode == null || startNode.parentNode == null || endNode.parentNode == null)) {\n return;\n }\n let selection = document.getSelection();\n if (selection == null) return;\n if (startNode != null) {\n if (!this.hasFocus()) this.root.focus();\n let native = (this.getNativeRange() || {}).native;\n if (native == null || force ||\n startNode !== native.startContainer ||\n startOffset !== native.startOffset ||\n endNode !== native.endContainer ||\n endOffset !== native.endOffset) {\n\n if (startNode.tagName == \"BR\") {\n startOffset = [].indexOf.call(startNode.parentNode.childNodes, startNode);\n startNode = startNode.parentNode;\n }\n if (endNode.tagName == \"BR\") {\n endOffset = [].indexOf.call(endNode.parentNode.childNodes, endNode);\n endNode = endNode.parentNode;\n }\n let range = document.createRange();\n range.setStart(startNode, startOffset);\n range.setEnd(endNode, endOffset);\n selection.removeAllRanges();\n selection.addRange(range);\n }\n } else {\n selection.removeAllRanges();\n this.root.blur();\n document.body.focus(); // root.blur() not enough on IE11+Travis+SauceLabs (but not local VMs)\n }\n }\n\n setRange(range, force = false, source = Emitter.sources.API) {\n if (typeof force === 'string') {\n source = force;\n force = false;\n }\n debug.info('setRange', range);\n if (range != null) {\n let args = this.rangeToNative(range);\n this.setNativeRange(...args, force);\n } else {\n this.setNativeRange(null);\n }\n this.update(source);\n }\n\n update(source = Emitter.sources.USER) {\n let oldRange = this.lastRange;\n let [lastRange, nativeRange] = this.getRange();\n this.lastRange = lastRange;\n if (this.lastRange != null) {\n this.savedRange = this.lastRange;\n }\n if (!equal(oldRange, this.lastRange)) {\n if (!this.composing && nativeRange != null && nativeRange.native.collapsed && nativeRange.start.node !== this.cursor.textNode) {\n this.cursor.restore();\n }\n let args = [Emitter.events.SELECTION_CHANGE, clone(this.lastRange), clone(oldRange), source];\n this.emitter.emit(Emitter.events.EDITOR_CHANGE, ...args);\n if (source !== Emitter.sources.SILENT) {\n this.emitter.emit(...args);\n }\n }\n }\n}\n\n\nfunction contains(parent, descendant) {\n try {\n // Firefox inserts inaccessible nodes around video elements\n descendant.parentNode;\n } catch (e) {\n return false;\n }\n // IE11 has bug with Text nodes\n // https://connect.microsoft.com/IE/feedback/details/780874/node-contains-is-incorrect\n if (descendant instanceof Text) {\n descendant = descendant.parentNode;\n }\n return parent.contains(descendant);\n}\n\n\nexport { Range, Selection as default };\n\n\n\n// WEBPACK FOOTER //\n// ./core/selection.js","import Parchment from 'parchment';\nimport Block, { BlockEmbed } from './block';\n\n\nclass Container extends Parchment.Container { }\nContainer.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Container;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/container.js","import Parchment from 'parchment';\n\nclass ColorAttributor extends Parchment.Attributor.Style {\n value(domNode) {\n let value = super.value(domNode);\n if (!value.startsWith('rgb(')) return value;\n value = value.replace(/^[^\\d]+/, '').replace(/[^\\d]+$/, '');\n return '#' + value.split(',').map(function(component) {\n return ('00' + parseInt(component).toString(16)).slice(-2);\n }).join('');\n }\n}\n\nlet ColorClass = new Parchment.Attributor.Class('color', 'ql-color', {\n scope: Parchment.Scope.INLINE\n});\nlet ColorStyle = new ColorAttributor('color', 'color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { ColorAttributor, ColorClass, ColorStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/color.js","module.exports = {\n 'align': {\n '' : require('../assets/icons/align-left.svg'),\n 'center' : require('../assets/icons/align-center.svg'),\n 'right' : require('../assets/icons/align-right.svg'),\n 'justify' : require('../assets/icons/align-justify.svg')\n },\n 'background': require('../assets/icons/background.svg'),\n 'blockquote': require('../assets/icons/blockquote.svg'),\n 'bold' : require('../assets/icons/bold.svg'),\n 'clean' : require('../assets/icons/clean.svg'),\n 'code' : require('../assets/icons/code.svg'),\n 'code-block': require('../assets/icons/code.svg'),\n 'color' : require('../assets/icons/color.svg'),\n 'direction' : {\n '' : require('../assets/icons/direction-ltr.svg'),\n 'rtl' : require('../assets/icons/direction-rtl.svg')\n },\n 'float': {\n 'center' : require('../assets/icons/float-center.svg'),\n 'full' : require('../assets/icons/float-full.svg'),\n 'left' : require('../assets/icons/float-left.svg'),\n 'right' : require('../assets/icons/float-right.svg')\n },\n 'formula' : require('../assets/icons/formula.svg'),\n 'header': {\n '1' : require('../assets/icons/header.svg'),\n '2' : require('../assets/icons/header-2.svg')\n },\n 'italic' : require('../assets/icons/italic.svg'),\n 'image' : require('../assets/icons/image.svg'),\n 'indent': {\n '+1' : require('../assets/icons/indent.svg'),\n '-1' : require('../assets/icons/outdent.svg')\n },\n 'link' : require('../assets/icons/link.svg'),\n 'list': {\n 'ordered' : require('../assets/icons/list-ordered.svg'),\n 'bullet' : require('../assets/icons/list-bullet.svg'),\n 'check' : require('../assets/icons/list-check.svg')\n },\n 'script': {\n 'sub' : require('../assets/icons/subscript.svg'),\n 'super' : require('../assets/icons/superscript.svg'),\n },\n 'strike' : require('../assets/icons/strike.svg'),\n 'underline' : require('../assets/icons/underline.svg'),\n 'video' : require('../assets/icons/video.svg')\n};\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icons.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Registry = require(\"../../registry\");\nvar ShadowBlot = /** @class */ (function () {\n function ShadowBlot(domNode) {\n this.domNode = domNode;\n // @ts-ignore\n this.domNode[Registry.DATA_KEY] = { blot: this };\n }\n Object.defineProperty(ShadowBlot.prototype, \"statics\", {\n // Hack for accessing inherited static methods\n get: function () {\n return this.constructor;\n },\n enumerable: true,\n configurable: true\n });\n ShadowBlot.create = function (value) {\n if (this.tagName == null) {\n throw new Registry.ParchmentError('Blot definition missing tagName');\n }\n var node;\n if (Array.isArray(this.tagName)) {\n if (typeof value === 'string') {\n value = value.toUpperCase();\n if (parseInt(value).toString() === value) {\n value = parseInt(value);\n }\n }\n if (typeof value === 'number') {\n node = document.createElement(this.tagName[value - 1]);\n }\n else if (this.tagName.indexOf(value) > -1) {\n node = document.createElement(value);\n }\n else {\n node = document.createElement(this.tagName[0]);\n }\n }\n else {\n node = document.createElement(this.tagName);\n }\n if (this.className) {\n node.classList.add(this.className);\n }\n return node;\n };\n ShadowBlot.prototype.attach = function () {\n if (this.parent != null) {\n this.scroll = this.parent.scroll;\n }\n };\n ShadowBlot.prototype.clone = function () {\n var domNode = this.domNode.cloneNode(false);\n return Registry.create(domNode);\n };\n ShadowBlot.prototype.detach = function () {\n if (this.parent != null)\n this.parent.removeChild(this);\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY];\n };\n ShadowBlot.prototype.deleteAt = function (index, length) {\n var blot = this.isolate(index, length);\n blot.remove();\n };\n ShadowBlot.prototype.formatAt = function (index, length, name, value) {\n var blot = this.isolate(index, length);\n if (Registry.query(name, Registry.Scope.BLOT) != null && value) {\n blot.wrap(name, value);\n }\n else if (Registry.query(name, Registry.Scope.ATTRIBUTE) != null) {\n var parent = Registry.create(this.statics.scope);\n blot.wrap(parent);\n parent.format(name, value);\n }\n };\n ShadowBlot.prototype.insertAt = function (index, value, def) {\n var blot = def == null ? Registry.create('text', value) : Registry.create(value, def);\n var ref = this.split(index);\n this.parent.insertBefore(blot, ref);\n };\n ShadowBlot.prototype.insertInto = function (parentBlot, refBlot) {\n if (refBlot === void 0) { refBlot = null; }\n if (this.parent != null) {\n this.parent.children.remove(this);\n }\n var refDomNode = null;\n parentBlot.children.insertBefore(this, refBlot);\n if (refBlot != null) {\n refDomNode = refBlot.domNode;\n }\n if (this.next == null || this.domNode.nextSibling != refDomNode) {\n parentBlot.domNode.insertBefore(this.domNode, refDomNode);\n }\n this.parent = parentBlot;\n this.attach();\n };\n ShadowBlot.prototype.isolate = function (index, length) {\n var target = this.split(index);\n target.split(length);\n return target;\n };\n ShadowBlot.prototype.length = function () {\n return 1;\n };\n ShadowBlot.prototype.offset = function (root) {\n if (root === void 0) { root = this.parent; }\n if (this.parent == null || this == root)\n return 0;\n return this.parent.children.offset(this) + this.parent.offset(root);\n };\n ShadowBlot.prototype.optimize = function (context) {\n // TODO clean up once we use WeakMap\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY] != null) {\n // @ts-ignore\n delete this.domNode[Registry.DATA_KEY].mutations;\n }\n };\n ShadowBlot.prototype.remove = function () {\n if (this.domNode.parentNode != null) {\n this.domNode.parentNode.removeChild(this.domNode);\n }\n this.detach();\n };\n ShadowBlot.prototype.replace = function (target) {\n if (target.parent == null)\n return;\n target.parent.insertBefore(this, target.next);\n target.remove();\n };\n ShadowBlot.prototype.replaceWith = function (name, value) {\n var replacement = typeof name === 'string' ? Registry.create(name, value) : name;\n replacement.replace(this);\n return replacement;\n };\n ShadowBlot.prototype.split = function (index, force) {\n return index === 0 ? this : this.next;\n };\n ShadowBlot.prototype.update = function (mutations, context) {\n // Nothing to do by default\n };\n ShadowBlot.prototype.wrap = function (name, value) {\n var wrapper = typeof name === 'string' ? Registry.create(name, value) : name;\n if (this.parent != null) {\n this.parent.insertBefore(wrapper, this.next);\n }\n wrapper.appendChild(this);\n return wrapper;\n };\n ShadowBlot.blotName = 'abstract';\n return ShadowBlot;\n}());\nexports.default = ShadowBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/abstract/shadow.ts\n// module id = 26\n// module chunks = 0","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nvar class_1 = require(\"./class\");\nvar style_1 = require(\"./style\");\nvar Registry = require(\"../registry\");\nvar AttributorStore = /** @class */ (function () {\n function AttributorStore(domNode) {\n this.attributes = {};\n this.domNode = domNode;\n this.build();\n }\n AttributorStore.prototype.attribute = function (attribute, value) {\n // verb\n if (value) {\n if (attribute.add(this.domNode, value)) {\n if (attribute.value(this.domNode) != null) {\n this.attributes[attribute.attrName] = attribute;\n }\n else {\n delete this.attributes[attribute.attrName];\n }\n }\n }\n else {\n attribute.remove(this.domNode);\n delete this.attributes[attribute.attrName];\n }\n };\n AttributorStore.prototype.build = function () {\n var _this = this;\n this.attributes = {};\n var attributes = attributor_1.default.keys(this.domNode);\n var classes = class_1.default.keys(this.domNode);\n var styles = style_1.default.keys(this.domNode);\n attributes\n .concat(classes)\n .concat(styles)\n .forEach(function (name) {\n var attr = Registry.query(name, Registry.Scope.ATTRIBUTE);\n if (attr instanceof attributor_1.default) {\n _this.attributes[attr.attrName] = attr;\n }\n });\n };\n AttributorStore.prototype.copy = function (target) {\n var _this = this;\n Object.keys(this.attributes).forEach(function (key) {\n var value = _this.attributes[key].value(_this.domNode);\n target.format(key, value);\n });\n };\n AttributorStore.prototype.move = function (target) {\n var _this = this;\n this.copy(target);\n Object.keys(this.attributes).forEach(function (key) {\n _this.attributes[key].remove(_this.domNode);\n });\n this.attributes = {};\n };\n AttributorStore.prototype.values = function () {\n var _this = this;\n return Object.keys(this.attributes).reduce(function (attributes, name) {\n attributes[name] = _this.attributes[name].value(_this.domNode);\n return attributes;\n }, {});\n };\n return AttributorStore;\n}());\nexports.default = AttributorStore;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/store.ts\n// module id = 27\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction match(node, prefix) {\n var className = node.getAttribute('class') || '';\n return className.split(/\\s+/).filter(function (name) {\n return name.indexOf(prefix + \"-\") === 0;\n });\n}\nvar ClassAttributor = /** @class */ (function (_super) {\n __extends(ClassAttributor, _super);\n function ClassAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n ClassAttributor.keys = function (node) {\n return (node.getAttribute('class') || '').split(/\\s+/).map(function (name) {\n return name\n .split('-')\n .slice(0, -1)\n .join('-');\n });\n };\n ClassAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n this.remove(node);\n node.classList.add(this.keyName + \"-\" + value);\n return true;\n };\n ClassAttributor.prototype.remove = function (node) {\n var matches = match(node, this.keyName);\n matches.forEach(function (name) {\n node.classList.remove(name);\n });\n if (node.classList.length === 0) {\n node.removeAttribute('class');\n }\n };\n ClassAttributor.prototype.value = function (node) {\n var result = match(node, this.keyName)[0] || '';\n var value = result.slice(this.keyName.length + 1); // +1 for hyphen\n return this.canAdd(node, value) ? value : '';\n };\n return ClassAttributor;\n}(attributor_1.default));\nexports.default = ClassAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/class.ts\n// module id = 28\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar attributor_1 = require(\"./attributor\");\nfunction camelize(name) {\n var parts = name.split('-');\n var rest = parts\n .slice(1)\n .map(function (part) {\n return part[0].toUpperCase() + part.slice(1);\n })\n .join('');\n return parts[0] + rest;\n}\nvar StyleAttributor = /** @class */ (function (_super) {\n __extends(StyleAttributor, _super);\n function StyleAttributor() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n StyleAttributor.keys = function (node) {\n return (node.getAttribute('style') || '').split(';').map(function (value) {\n var arr = value.split(':');\n return arr[0].trim();\n });\n };\n StyleAttributor.prototype.add = function (node, value) {\n if (!this.canAdd(node, value))\n return false;\n // @ts-ignore\n node.style[camelize(this.keyName)] = value;\n return true;\n };\n StyleAttributor.prototype.remove = function (node) {\n // @ts-ignore\n node.style[camelize(this.keyName)] = '';\n if (!node.getAttribute('style')) {\n node.removeAttribute('style');\n }\n };\n StyleAttributor.prototype.value = function (node) {\n // @ts-ignore\n var value = node.style[camelize(this.keyName)];\n return this.canAdd(node, value) ? value : '';\n };\n return StyleAttributor;\n}(attributor_1.default));\nexports.default = StyleAttributor;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/attributor/style.ts\n// module id = 29\n// module chunks = 0","import Parchment from 'parchment';\nimport TextBlot from './text';\n\n\nclass Cursor extends Parchment.Embed {\n static value() {\n return undefined;\n }\n\n constructor(domNode, selection) {\n super(domNode);\n this.selection = selection;\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n this._length = 0;\n }\n\n detach() {\n // super.detach() will also clear domNode.__blot\n if (this.parent != null) this.parent.removeChild(this);\n }\n\n format(name, value) {\n if (this._length !== 0) {\n return super.format(name, value);\n }\n let target = this, index = 0;\n while (target != null && target.statics.scope !== Parchment.Scope.BLOCK_BLOT) {\n index += target.offset(target.parent);\n target = target.parent;\n }\n if (target != null) {\n this._length = Cursor.CONTENTS.length;\n target.optimize();\n target.formatAt(index, Cursor.CONTENTS.length, name, value);\n this._length = 0;\n }\n }\n\n index(node, offset) {\n if (node === this.textNode) return 0;\n return super.index(node, offset);\n }\n\n length() {\n return this._length;\n }\n\n position() {\n return [this.textNode, this.textNode.data.length];\n }\n\n remove() {\n super.remove();\n this.parent = null;\n }\n\n restore() {\n if (this.selection.composing || this.parent == null) return;\n let textNode = this.textNode;\n let range = this.selection.getNativeRange();\n let restoreText, start, end;\n if (range != null && range.start.node === textNode && range.end.node === textNode) {\n [restoreText, start, end] = [textNode, range.start.offset, range.end.offset];\n }\n // Link format will insert text outside of anchor tag\n while (this.domNode.lastChild != null && this.domNode.lastChild !== this.textNode) {\n this.domNode.parentNode.insertBefore(this.domNode.lastChild, this.domNode);\n }\n if (this.textNode.data !== Cursor.CONTENTS) {\n let text = this.textNode.data.split(Cursor.CONTENTS).join('');\n if (this.next instanceof TextBlot) {\n restoreText = this.next.domNode;\n this.next.insertAt(0, text);\n this.textNode.data = Cursor.CONTENTS;\n } else {\n this.textNode.data = text;\n this.parent.insertBefore(Parchment.create(this.textNode), this);\n this.textNode = document.createTextNode(Cursor.CONTENTS);\n this.domNode.appendChild(this.textNode);\n }\n }\n this.remove();\n if (start != null) {\n [start, end] = [start, end].map(function(offset) {\n return Math.max(0, Math.min(restoreText.data.length, offset - 1));\n });\n return {\n startNode: restoreText,\n startOffset: start,\n endNode: restoreText,\n endOffset: end\n };\n }\n }\n\n update(mutations, context) {\n if (mutations.some((mutation) => {\n return mutation.type === 'characterData' && mutation.target === this.textNode;\n })) {\n let range = this.restore();\n if (range) context.range = range;\n }\n }\n\n value() {\n return '';\n }\n}\nCursor.blotName = 'cursor';\nCursor.className = 'ql-cursor';\nCursor.tagName = 'span';\nCursor.CONTENTS = \"\\uFEFF\"; // Zero width no break space\n\n\nexport default Cursor;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/cursor.js","class Theme {\n constructor(quill, options) {\n this.quill = quill;\n this.options = options;\n this.modules = {};\n }\n\n init() {\n Object.keys(this.options.modules).forEach((name) => {\n if (this.modules[name] == null) {\n this.addModule(name);\n }\n });\n }\n\n addModule(name) {\n let moduleClass = this.quill.constructor.import(`modules/${name}`);\n this.modules[name] = new moduleClass(this.quill, this.options.modules[name] || {});\n return this.modules[name];\n }\n}\nTheme.DEFAULTS = {\n modules: {}\n};\nTheme.themes = {\n 'default': Theme\n};\n\n\nexport default Theme;\n\n\n\n// WEBPACK FOOTER //\n// ./core/theme.js","import Parchment from 'parchment';\nimport TextBlot from './text';\n\nconst GUARD_TEXT = \"\\uFEFF\";\n\n\nclass Embed extends Parchment.Embed {\n constructor(node) {\n super(node);\n this.contentNode = document.createElement('span');\n this.contentNode.setAttribute('contenteditable', false);\n [].slice.call(this.domNode.childNodes).forEach((childNode) => {\n this.contentNode.appendChild(childNode);\n });\n this.leftGuard = document.createTextNode(GUARD_TEXT);\n this.rightGuard = document.createTextNode(GUARD_TEXT);\n this.domNode.appendChild(this.leftGuard);\n this.domNode.appendChild(this.contentNode);\n this.domNode.appendChild(this.rightGuard);\n }\n\n index(node, offset) {\n if (node === this.leftGuard) return 0;\n if (node === this.rightGuard) return 1;\n return super.index(node, offset);\n }\n\n restore(node) {\n let range, textNode;\n let text = node.data.split(GUARD_TEXT).join('');\n if (node === this.leftGuard) {\n if (this.prev instanceof TextBlot) {\n let prevLength = this.prev.length();\n this.prev.insertAt(prevLength, text);\n range = {\n startNode: this.prev.domNode,\n startOffset: prevLength + text.length\n };\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n } else if (node === this.rightGuard) {\n if (this.next instanceof TextBlot) {\n this.next.insertAt(0, text);\n range = {\n startNode: this.next.domNode,\n startOffset: text.length\n }\n } else {\n textNode = document.createTextNode(text);\n this.parent.insertBefore(Parchment.create(textNode), this.next);\n range = {\n startNode: textNode,\n startOffset: text.length\n };\n }\n }\n node.data = GUARD_TEXT;\n return range;\n }\n\n update(mutations, context) {\n mutations.forEach((mutation) => {\n if (mutation.type === 'characterData' &&\n (mutation.target === this.leftGuard || mutation.target === this.rightGuard)) {\n let range = this.restore(mutation.target);\n if (range) context.range = range;\n }\n });\n }\n}\n\n\nexport default Embed;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/embed.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['right', 'center', 'justify']\n};\n\nlet AlignAttribute = new Parchment.Attributor.Attribute('align', 'align', config);\nlet AlignClass = new Parchment.Attributor.Class('align', 'ql-align', config);\nlet AlignStyle = new Parchment.Attributor.Style('align', 'text-align', config);\n\nexport { AlignAttribute, AlignClass, AlignStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/align.js","import Parchment from 'parchment';\nimport { ColorAttributor } from './color';\n\nlet BackgroundClass = new Parchment.Attributor.Class('background', 'ql-bg', {\n scope: Parchment.Scope.INLINE\n});\nlet BackgroundStyle = new ColorAttributor('background', 'background-color', {\n scope: Parchment.Scope.INLINE\n});\n\nexport { BackgroundClass, BackgroundStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/background.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.BLOCK,\n whitelist: ['rtl']\n};\n\nlet DirectionAttribute = new Parchment.Attributor.Attribute('direction', 'dir', config);\nlet DirectionClass = new Parchment.Attributor.Class('direction', 'ql-direction', config);\nlet DirectionStyle = new Parchment.Attributor.Style('direction', 'direction', config);\n\nexport { DirectionAttribute, DirectionClass, DirectionStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/direction.js","import Parchment from 'parchment';\n\nlet config = {\n scope: Parchment.Scope.INLINE,\n whitelist: ['serif', 'monospace']\n};\n\nlet FontClass = new Parchment.Attributor.Class('font', 'ql-font', config);\n\nclass FontStyleAttributor extends Parchment.Attributor.Style {\n value(node) {\n return super.value(node).replace(/[\"']/g, '');\n }\n}\n\nlet FontStyle = new FontStyleAttributor('font', 'font-family', config);\n\nexport { FontStyle, FontClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/font.js","import Parchment from 'parchment';\n\nlet SizeClass = new Parchment.Attributor.Class('size', 'ql-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['small', 'large', 'huge']\n});\nlet SizeStyle = new Parchment.Attributor.Style('size', 'font-size', {\n scope: Parchment.Scope.INLINE,\n whitelist: ['10px', '18px', '32px']\n});\n\nexport { SizeClass, SizeStyle };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/size.js","import clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\nimport Delta from 'quill-delta';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:keyboard');\n\nconst SHORTKEY = /Mac/i.test(navigator.platform) ? 'metaKey' : 'ctrlKey';\n\n\nclass Keyboard extends Module {\n static match(evt, binding) {\n binding = normalize(binding);\n if (['altKey', 'ctrlKey', 'metaKey', 'shiftKey'].some(function(key) {\n return (!!binding[key] !== evt[key] && binding[key] !== null);\n })) {\n return false;\n }\n return binding.key === (evt.which || evt.keyCode);\n }\n\n constructor(quill, options) {\n super(quill, options);\n this.bindings = {};\n Object.keys(this.options.bindings).forEach((name) => {\n if (name === 'list autofill' &&\n quill.scroll.whitelist != null &&\n !quill.scroll.whitelist['list']) {\n return;\n }\n if (this.options.bindings[name]) {\n this.addBinding(this.options.bindings[name]);\n }\n });\n this.addBinding({ key: Keyboard.keys.ENTER, shiftKey: null }, handleEnter);\n this.addBinding({ key: Keyboard.keys.ENTER, metaKey: null, ctrlKey: null, altKey: null }, function() {});\n if (/Firefox/i.test(navigator.userAgent)) {\n // Need to handle delete and backspace for Firefox in the general case #1171\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true }, handleDelete);\n } else {\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: true, prefix: /^.?$/ }, handleBackspace);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: true, suffix: /^.?$/ }, handleDelete);\n }\n this.addBinding({ key: Keyboard.keys.BACKSPACE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.DELETE }, { collapsed: false }, handleDeleteRange);\n this.addBinding({ key: Keyboard.keys.BACKSPACE, altKey: null, ctrlKey: null, metaKey: null, shiftKey: null },\n { collapsed: true, offset: 0 },\n handleBackspace);\n this.listen();\n }\n\n addBinding(key, context = {}, handler = {}) {\n let binding = normalize(key);\n if (binding == null || binding.key == null) {\n return debug.warn('Attempted to add invalid keyboard binding', binding);\n }\n if (typeof context === 'function') {\n context = { handler: context };\n }\n if (typeof handler === 'function') {\n handler = { handler: handler };\n }\n binding = extend(binding, context, handler);\n this.bindings[binding.key] = this.bindings[binding.key] || [];\n this.bindings[binding.key].push(binding);\n }\n\n listen() {\n this.quill.root.addEventListener('keydown', (evt) => {\n if (evt.defaultPrevented) return;\n let which = evt.which || evt.keyCode;\n let bindings = (this.bindings[which] || []).filter(function(binding) {\n return Keyboard.match(evt, binding);\n });\n if (bindings.length === 0) return;\n let range = this.quill.getSelection();\n if (range == null || !this.quill.hasFocus()) return;\n let [line, offset] = this.quill.getLine(range.index);\n let [leafStart, offsetStart] = this.quill.getLeaf(range.index);\n let [leafEnd, offsetEnd] = range.length === 0 ? [leafStart, offsetStart] : this.quill.getLeaf(range.index + range.length);\n let prefixText = leafStart instanceof Parchment.Text ? leafStart.value().slice(0, offsetStart) : '';\n let suffixText = leafEnd instanceof Parchment.Text ? leafEnd.value().slice(offsetEnd) : '';\n let curContext = {\n collapsed: range.length === 0,\n empty: range.length === 0 && line.length() <= 1,\n format: this.quill.getFormat(range),\n offset: offset,\n prefix: prefixText,\n suffix: suffixText\n };\n let prevented = bindings.some((binding) => {\n if (binding.collapsed != null && binding.collapsed !== curContext.collapsed) return false;\n if (binding.empty != null && binding.empty !== curContext.empty) return false;\n if (binding.offset != null && binding.offset !== curContext.offset) return false;\n if (Array.isArray(binding.format)) {\n // any format is present\n if (binding.format.every(function(name) {\n return curContext.format[name] == null;\n })) {\n return false;\n }\n } else if (typeof binding.format === 'object') {\n // all formats must match\n if (!Object.keys(binding.format).every(function(name) {\n if (binding.format[name] === true) return curContext.format[name] != null;\n if (binding.format[name] === false) return curContext.format[name] == null;\n return equal(binding.format[name], curContext.format[name]);\n })) {\n return false;\n }\n }\n if (binding.prefix != null && !binding.prefix.test(curContext.prefix)) return false;\n if (binding.suffix != null && !binding.suffix.test(curContext.suffix)) return false;\n return binding.handler.call(this, range, curContext) !== true;\n });\n if (prevented) {\n evt.preventDefault();\n }\n });\n }\n}\n\nKeyboard.keys = {\n BACKSPACE: 8,\n TAB: 9,\n ENTER: 13,\n ESCAPE: 27,\n LEFT: 37,\n UP: 38,\n RIGHT: 39,\n DOWN: 40,\n DELETE: 46\n};\n\nKeyboard.DEFAULTS = {\n bindings: {\n 'bold' : makeFormatHandler('bold'),\n 'italic' : makeFormatHandler('italic'),\n 'underline' : makeFormatHandler('underline'),\n 'indent': {\n // highlight tab or tab at beginning of list, indent or blockquote\n key: Keyboard.keys.TAB,\n format: ['blockquote', 'indent', 'list'],\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '+1', Quill.sources.USER);\n }\n },\n 'outdent': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n format: ['blockquote', 'indent', 'list'],\n // highlight tab or tab at beginning of list, indent or blockquote\n handler: function(range, context) {\n if (context.collapsed && context.offset !== 0) return true;\n this.quill.format('indent', '-1', Quill.sources.USER);\n }\n },\n 'outdent backspace': {\n key: Keyboard.keys.BACKSPACE,\n collapsed: true,\n shiftKey: null,\n metaKey: null,\n ctrlKey: null,\n altKey: null,\n format: ['indent', 'list'],\n offset: 0,\n handler: function(range, context) {\n if (context.format.indent != null) {\n this.quill.format('indent', '-1', Quill.sources.USER);\n } else if (context.format.list != null) {\n this.quill.format('list', false, Quill.sources.USER);\n }\n }\n },\n 'indent code-block': makeCodeBlockHandler(true),\n 'outdent code-block': makeCodeBlockHandler(false),\n 'remove tab': {\n key: Keyboard.keys.TAB,\n shiftKey: true,\n collapsed: true,\n prefix: /\\t$/,\n handler: function(range) {\n this.quill.deleteText(range.index - 1, 1, Quill.sources.USER);\n }\n },\n 'tab': {\n key: Keyboard.keys.TAB,\n handler: function(range) {\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index)\n .delete(range.length)\n .insert('\\t');\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n }\n },\n 'list empty enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['list'],\n empty: true,\n handler: function(range, context) {\n this.quill.format('list', false, Quill.sources.USER);\n if (context.format.indent) {\n this.quill.format('indent', false, Quill.sources.USER);\n }\n }\n },\n 'checklist enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: { list: 'checked' },\n handler: function(range) {\n let [line, offset] = this.quill.getLine(range.index);\n let formats = extend({}, line.formats(), { list: 'checked' });\n let delta = new Delta().retain(range.index)\n .insert('\\n', formats)\n .retain(line.length() - offset - 1)\n .retain(1, { list: 'unchecked' });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'header enter': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['header'],\n suffix: /^$/,\n handler: function(range, context) {\n let [line, offset] = this.quill.getLine(range.index);\n let delta = new Delta().retain(range.index)\n .insert('\\n', context.format)\n .retain(line.length() - offset - 1)\n .retain(1, { header: null });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.scrollIntoView();\n }\n },\n 'list autofill': {\n key: ' ',\n collapsed: true,\n format: { list: false },\n prefix: /^\\s*?(\\d+\\.|-|\\*|\\[ ?\\]|\\[x\\])$/,\n handler: function(range, context) {\n let length = context.prefix.length;\n let [line, offset] = this.quill.getLine(range.index);\n if (offset > length) return true;\n let value;\n switch (context.prefix.trim()) {\n case '[]': case '[ ]':\n value = 'unchecked';\n break;\n case '[x]':\n value = 'checked';\n break;\n case '-': case '*':\n value = 'bullet';\n break;\n default:\n value = 'ordered';\n }\n this.quill.insertText(range.index, ' ', Quill.sources.USER);\n this.quill.history.cutoff();\n let delta = new Delta().retain(range.index - offset)\n .delete(length + 1)\n .retain(line.length() - 2 - offset)\n .retain(1, { list: value });\n this.quill.updateContents(delta, Quill.sources.USER);\n this.quill.history.cutoff();\n this.quill.setSelection(range.index - length, Quill.sources.SILENT);\n }\n },\n 'code exit': {\n key: Keyboard.keys.ENTER,\n collapsed: true,\n format: ['code-block'],\n prefix: /\\n\\n$/,\n suffix: /^\\s+$/,\n handler: function(range) {\n const [line, offset] = this.quill.getLine(range.index);\n const delta = new Delta()\n .retain(range.index + line.length() - offset - 2)\n .retain(1, { 'code-block': null })\n .delete(1);\n this.quill.updateContents(delta, Quill.sources.USER);\n }\n },\n 'embed left': makeEmbedArrowHandler(Keyboard.keys.LEFT, false),\n 'embed left shift': makeEmbedArrowHandler(Keyboard.keys.LEFT, true),\n 'embed right': makeEmbedArrowHandler(Keyboard.keys.RIGHT, false),\n 'embed right shift': makeEmbedArrowHandler(Keyboard.keys.RIGHT, true)\n }\n};\n\nfunction makeEmbedArrowHandler(key, shiftKey) {\n const where = key === Keyboard.keys.LEFT ? 'prefix' : 'suffix';\n return {\n key,\n shiftKey,\n altKey: null,\n [where]: /^$/,\n handler: function(range) {\n let index = range.index;\n if (key === Keyboard.keys.RIGHT) {\n index += (range.length + 1);\n }\n const [leaf, ] = this.quill.getLeaf(index);\n if (!(leaf instanceof Parchment.Embed)) return true;\n if (key === Keyboard.keys.LEFT) {\n if (shiftKey) {\n this.quill.setSelection(range.index - 1, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index - 1, Quill.sources.USER);\n }\n } else {\n if (shiftKey) {\n this.quill.setSelection(range.index, range.length + 1, Quill.sources.USER);\n } else {\n this.quill.setSelection(range.index + range.length + 1, Quill.sources.USER);\n }\n }\n return false;\n }\n };\n}\n\n\nfunction handleBackspace(range, context) {\n if (range.index === 0 || this.quill.getLength() <= 1) return;\n let [line, ] = this.quill.getLine(range.index);\n let formats = {};\n if (context.offset === 0) {\n let [prev, ] = this.quill.getLine(range.index - 1);\n if (prev != null && prev.length() > 1) {\n let curFormats = line.formats();\n let prevFormats = this.quill.getFormat(range.index-1, 1);\n formats = DeltaOp.attributes.diff(curFormats, prevFormats) || {};\n }\n }\n // Check for astral symbols\n let length = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]$/.test(context.prefix) ? 2 : 1;\n this.quill.deleteText(range.index-length, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index-length, length, formats, Quill.sources.USER);\n }\n this.quill.focus();\n}\n\nfunction handleDelete(range, context) {\n // Check for astral symbols\n let length = /^[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/.test(context.suffix) ? 2 : 1;\n if (range.index >= this.quill.getLength() - length) return;\n let formats = {}, nextLength = 0;\n let [line, ] = this.quill.getLine(range.index);\n if (context.offset >= line.length() - 1) {\n let [next, ] = this.quill.getLine(range.index + 1);\n if (next) {\n let curFormats = line.formats();\n let nextFormats = this.quill.getFormat(range.index, 1);\n formats = DeltaOp.attributes.diff(curFormats, nextFormats) || {};\n nextLength = next.length();\n }\n }\n this.quill.deleteText(range.index, length, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index + nextLength - 1, length, formats, Quill.sources.USER);\n }\n}\n\nfunction handleDeleteRange(range) {\n let lines = this.quill.getLines(range);\n let formats = {};\n if (lines.length > 1) {\n let firstFormats = lines[0].formats();\n let lastFormats = lines[lines.length - 1].formats();\n formats = DeltaOp.attributes.diff(lastFormats, firstFormats) || {};\n }\n this.quill.deleteText(range, Quill.sources.USER);\n if (Object.keys(formats).length > 0) {\n this.quill.formatLine(range.index, 1, formats, Quill.sources.USER);\n }\n this.quill.setSelection(range.index, Quill.sources.SILENT);\n this.quill.focus();\n}\n\nfunction handleEnter(range, context) {\n if (range.length > 0) {\n this.quill.scroll.deleteAt(range.index, range.length); // So we do not trigger text-change\n }\n let lineFormats = Object.keys(context.format).reduce(function(lineFormats, format) {\n if (Parchment.query(format, Parchment.Scope.BLOCK) && !Array.isArray(context.format[format])) {\n lineFormats[format] = context.format[format];\n }\n return lineFormats;\n }, {});\n this.quill.insertText(range.index, '\\n', lineFormats, Quill.sources.USER);\n // Earlier scroll.deleteAt might have messed up our selection,\n // so insertText's built in selection preservation is not reliable\n this.quill.setSelection(range.index + 1, Quill.sources.SILENT);\n this.quill.focus();\n Object.keys(context.format).forEach((name) => {\n if (lineFormats[name] != null) return;\n if (Array.isArray(context.format[name])) return;\n if (name === 'link') return;\n this.quill.format(name, context.format[name], Quill.sources.USER);\n });\n}\n\nfunction makeCodeBlockHandler(indent) {\n return {\n key: Keyboard.keys.TAB,\n shiftKey: !indent,\n format: {'code-block': true },\n handler: function(range) {\n let CodeBlock = Parchment.query('code-block');\n let index = range.index, length = range.length;\n let [block, offset] = this.quill.scroll.descendant(CodeBlock, index);\n if (block == null) return;\n let scrollIndex = this.quill.getIndex(block);\n let start = block.newlineIndex(offset, true) + 1;\n let end = block.newlineIndex(scrollIndex + offset + length);\n let lines = block.domNode.textContent.slice(start, end).split('\\n');\n offset = 0;\n lines.forEach((line, i) => {\n if (indent) {\n block.insertAt(start + offset, CodeBlock.TAB);\n offset += CodeBlock.TAB.length;\n if (i === 0) {\n index += CodeBlock.TAB.length;\n } else {\n length += CodeBlock.TAB.length;\n }\n } else if (line.startsWith(CodeBlock.TAB)) {\n block.deleteAt(start + offset, CodeBlock.TAB.length);\n offset -= CodeBlock.TAB.length;\n if (i === 0) {\n index -= CodeBlock.TAB.length;\n } else {\n length -= CodeBlock.TAB.length;\n }\n }\n offset += line.length + 1;\n });\n this.quill.update(Quill.sources.USER);\n this.quill.setSelection(index, length, Quill.sources.SILENT);\n }\n };\n}\n\nfunction makeFormatHandler(format) {\n return {\n key: format[0].toUpperCase(),\n shortKey: true,\n handler: function(range, context) {\n this.quill.format(format, !context.format[format], Quill.sources.USER);\n }\n };\n}\n\nfunction normalize(binding) {\n if (typeof binding === 'string' || typeof binding === 'number') {\n return normalize({ key: binding });\n }\n if (typeof binding === 'object') {\n binding = clone(binding, false);\n }\n if (typeof binding.key === 'string') {\n if (Keyboard.keys[binding.key.toUpperCase()] != null) {\n binding.key = Keyboard.keys[binding.key.toUpperCase()];\n } else if (binding.key.length === 1) {\n binding.key = binding.key.toUpperCase().charCodeAt(0);\n } else {\n return null;\n }\n }\n if (binding.shortKey) {\n binding[SHORTKEY] = binding.shortKey;\n delete binding.shortKey;\n }\n return binding;\n}\n\n\nexport { Keyboard as default, SHORTKEY };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/keyboard.js","import Inline from '../blots/inline';\n\nclass Bold extends Inline {\n static create() {\n return super.create();\n }\n\n static formats() {\n return true;\n }\n\n optimize(context) {\n super.optimize(context);\n if (this.domNode.tagName !== this.statics.tagName[0]) {\n this.replaceWith(this.statics.blotName);\n }\n }\n}\nBold.blotName = 'bold';\nBold.tagName = ['STRONG', 'B'];\n\nexport default Bold;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/bold.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/code.svg\n// module id = 40\n// module chunks = 0","import Picker from './picker';\n\n\nclass ColorPicker extends Picker {\n constructor(select, label) {\n super(select);\n this.label.innerHTML = label;\n this.container.classList.add('ql-color-picker');\n [].slice.call(this.container.querySelectorAll('.ql-picker-item'), 0, 7).forEach(function(item) {\n item.classList.add('ql-primary');\n });\n }\n\n buildItem(option) {\n let item = super.buildItem(option);\n item.style.backgroundColor = option.getAttribute('value') || '';\n return item;\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n let colorLabel = this.label.querySelector('.ql-color-label');\n let value = item ? item.getAttribute('data-value') || '' : '';\n if (colorLabel) {\n if (colorLabel.tagName === 'line') {\n colorLabel.style.stroke = value;\n } else {\n colorLabel.style.fill = value;\n }\n }\n }\n}\n\n\nexport default ColorPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/color-picker.js","import Picker from './picker';\n\n\nclass IconPicker extends Picker {\n constructor(select, icons) {\n super(select);\n this.container.classList.add('ql-icon-picker');\n [].forEach.call(this.container.querySelectorAll('.ql-picker-item'), (item) => {\n item.innerHTML = icons[item.getAttribute('data-value') || ''];\n });\n this.defaultItem = this.container.querySelector('.ql-selected');\n this.selectItem(this.defaultItem);\n }\n\n selectItem(item, trigger) {\n super.selectItem(item, trigger);\n item = item || this.defaultItem;\n this.label.innerHTML = item.innerHTML;\n }\n}\n\n\nexport default IconPicker;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/icon-picker.js","class Tooltip {\n constructor(quill, boundsContainer) {\n this.quill = quill;\n this.boundsContainer = boundsContainer || document.body;\n this.root = quill.addContainer('ql-tooltip');\n this.root.innerHTML = this.constructor.TEMPLATE;\n if (this.quill.root === this.quill.scrollingContainer) {\n this.quill.root.addEventListener('scroll', () => {\n this.root.style.marginTop = (-1*this.quill.root.scrollTop) + 'px';\n });\n }\n this.hide();\n }\n\n hide() {\n this.root.classList.add('ql-hidden');\n }\n\n position(reference) {\n let left = reference.left + reference.width/2 - this.root.offsetWidth/2;\n // root.scrollTop should be 0 if scrollContainer !== root\n let top = reference.bottom + this.quill.root.scrollTop;\n this.root.style.left = left + 'px';\n this.root.style.top = top + 'px';\n this.root.classList.remove('ql-flip');\n let containerBounds = this.boundsContainer.getBoundingClientRect();\n let rootBounds = this.root.getBoundingClientRect();\n let shift = 0;\n if (rootBounds.right > containerBounds.right) {\n shift = containerBounds.right - rootBounds.right;\n this.root.style.left = (left + shift) + 'px';\n }\n if (rootBounds.left < containerBounds.left) {\n shift = containerBounds.left - rootBounds.left;\n this.root.style.left = (left + shift) + 'px';\n }\n if (rootBounds.bottom > containerBounds.bottom) {\n let height = rootBounds.bottom - rootBounds.top;\n let verticalShift = reference.bottom - reference.top + height;\n this.root.style.top = (top - verticalShift) + 'px';\n this.root.classList.add('ql-flip');\n }\n return shift;\n }\n\n show() {\n this.root.classList.remove('ql-editing');\n this.root.classList.remove('ql-hidden');\n }\n}\n\n\nexport default Tooltip;\n\n\n\n// WEBPACK FOOTER //\n// ./ui/tooltip.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Emitter from '../core/emitter';\nimport Keyboard from '../modules/keyboard';\nimport Theme from '../core/theme';\nimport ColorPicker from '../ui/color-picker';\nimport IconPicker from '../ui/icon-picker';\nimport Picker from '../ui/picker';\nimport Tooltip from '../ui/tooltip';\n\n\nconst ALIGNS = [ false, 'center', 'right', 'justify' ];\n\nconst COLORS = [\n \"#000000\", \"#e60000\", \"#ff9900\", \"#ffff00\", \"#008a00\", \"#0066cc\", \"#9933ff\",\n \"#ffffff\", \"#facccc\", \"#ffebcc\", \"#ffffcc\", \"#cce8cc\", \"#cce0f5\", \"#ebd6ff\",\n \"#bbbbbb\", \"#f06666\", \"#ffc266\", \"#ffff66\", \"#66b966\", \"#66a3e0\", \"#c285ff\",\n \"#888888\", \"#a10000\", \"#b26b00\", \"#b2b200\", \"#006100\", \"#0047b2\", \"#6b24b2\",\n \"#444444\", \"#5c0000\", \"#663d00\", \"#666600\", \"#003700\", \"#002966\", \"#3d1466\"\n];\n\nconst FONTS = [ false, 'serif', 'monospace' ];\n\nconst HEADERS = [ '1', '2', '3', false ];\n\nconst SIZES = [ 'small', false, 'large', 'huge' ];\n\n\nclass BaseTheme extends Theme {\n constructor(quill, options) {\n super(quill, options);\n let listener = (e) => {\n if (!document.body.contains(quill.root)) {\n return document.body.removeEventListener('click', listener);\n }\n if (this.tooltip != null && !this.tooltip.root.contains(e.target) &&\n document.activeElement !== this.tooltip.textbox && !this.quill.hasFocus()) {\n this.tooltip.hide();\n }\n if (this.pickers != null) {\n this.pickers.forEach(function(picker) {\n if (!picker.container.contains(e.target)) {\n picker.close();\n }\n });\n }\n };\n quill.emitter.listenDOM('click', document.body, listener);\n }\n\n addModule(name) {\n let module = super.addModule(name);\n if (name === 'toolbar') {\n this.extendToolbar(module);\n }\n return module;\n }\n\n buildButtons(buttons, icons) {\n buttons.forEach((button) => {\n let className = button.getAttribute('class') || '';\n className.split(/\\s+/).forEach((name) => {\n if (!name.startsWith('ql-')) return;\n name = name.slice('ql-'.length);\n if (icons[name] == null) return;\n if (name === 'direction') {\n button.innerHTML = icons[name][''] + icons[name]['rtl'];\n } else if (typeof icons[name] === 'string') {\n button.innerHTML = icons[name];\n } else {\n let value = button.value || '';\n if (value != null && icons[name][value]) {\n button.innerHTML = icons[name][value];\n }\n }\n });\n });\n }\n\n buildPickers(selects, icons) {\n this.pickers = selects.map((select) => {\n if (select.classList.contains('ql-align')) {\n if (select.querySelector('option') == null) {\n fillSelect(select, ALIGNS);\n }\n return new IconPicker(select, icons.align);\n } else if (select.classList.contains('ql-background') || select.classList.contains('ql-color')) {\n let format = select.classList.contains('ql-background') ? 'background' : 'color';\n if (select.querySelector('option') == null) {\n fillSelect(select, COLORS, format === 'background' ? '#ffffff' : '#000000');\n }\n return new ColorPicker(select, icons[format]);\n } else {\n if (select.querySelector('option') == null) {\n if (select.classList.contains('ql-font')) {\n fillSelect(select, FONTS);\n } else if (select.classList.contains('ql-header')) {\n fillSelect(select, HEADERS);\n } else if (select.classList.contains('ql-size')) {\n fillSelect(select, SIZES);\n }\n }\n return new Picker(select);\n }\n });\n let update = () => {\n this.pickers.forEach(function(picker) {\n picker.update();\n });\n };\n this.quill.on(Emitter.events.EDITOR_CHANGE, update);\n }\n}\nBaseTheme.DEFAULTS = extend(true, {}, Theme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n formula: function() {\n this.quill.theme.tooltip.edit('formula');\n },\n image: function() {\n let fileInput = this.container.querySelector('input.ql-image[type=file]');\n if (fileInput == null) {\n fileInput = document.createElement('input');\n fileInput.setAttribute('type', 'file');\n fileInput.setAttribute('accept', 'image/png, image/gif, image/jpeg, image/bmp, image/x-icon');\n fileInput.classList.add('ql-image');\n fileInput.addEventListener('change', () => {\n if (fileInput.files != null && fileInput.files[0] != null) {\n let reader = new FileReader();\n reader.onload = (e) => {\n let range = this.quill.getSelection(true);\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ image: e.target.result })\n , Emitter.sources.USER);\n this.quill.setSelection(range.index + 1, Emitter.sources.SILENT);\n fileInput.value = \"\";\n }\n reader.readAsDataURL(fileInput.files[0]);\n }\n });\n this.container.appendChild(fileInput);\n }\n fileInput.click();\n },\n video: function() {\n this.quill.theme.tooltip.edit('video');\n }\n }\n }\n }\n});\n\n\nclass BaseTooltip extends Tooltip {\n constructor(quill, boundsContainer) {\n super(quill, boundsContainer);\n this.textbox = this.root.querySelector('input[type=\"text\"]');\n this.listen();\n }\n\n listen() {\n this.textbox.addEventListener('keydown', (event) => {\n if (Keyboard.match(event, 'enter')) {\n this.save();\n event.preventDefault();\n } else if (Keyboard.match(event, 'escape')) {\n this.cancel();\n event.preventDefault();\n }\n });\n }\n\n cancel() {\n this.hide();\n }\n\n edit(mode = 'link', preview = null) {\n this.root.classList.remove('ql-hidden');\n this.root.classList.add('ql-editing');\n if (preview != null) {\n this.textbox.value = preview;\n } else if (mode !== this.root.getAttribute('data-mode')) {\n this.textbox.value = '';\n }\n this.position(this.quill.getBounds(this.quill.selection.savedRange));\n this.textbox.select();\n this.textbox.setAttribute('placeholder', this.textbox.getAttribute(`data-${mode}`) || '');\n this.root.setAttribute('data-mode', mode);\n }\n\n restoreFocus() {\n let scrollTop = this.quill.scrollingContainer.scrollTop;\n this.quill.focus();\n this.quill.scrollingContainer.scrollTop = scrollTop;\n }\n\n save() {\n let value = this.textbox.value;\n switch(this.root.getAttribute('data-mode')) {\n case 'link': {\n let scrollTop = this.quill.root.scrollTop;\n if (this.linkRange) {\n this.quill.formatText(this.linkRange, 'link', value, Emitter.sources.USER);\n delete this.linkRange;\n } else {\n this.restoreFocus();\n this.quill.format('link', value, Emitter.sources.USER);\n }\n this.quill.root.scrollTop = scrollTop;\n break;\n }\n case 'video': {\n value = extractVideoUrl(value);\n } // eslint-disable-next-line no-fallthrough\n case 'formula': {\n if (!value) break;\n let range = this.quill.getSelection(true);\n if (range != null) {\n let index = range.index + range.length;\n this.quill.insertEmbed(index, this.root.getAttribute('data-mode'), value, Emitter.sources.USER);\n if (this.root.getAttribute('data-mode') === 'formula') {\n this.quill.insertText(index + 1, ' ', Emitter.sources.USER);\n }\n this.quill.setSelection(index + 2, Emitter.sources.USER);\n }\n break;\n }\n default:\n }\n this.textbox.value = '';\n this.hide();\n }\n}\n\n\nfunction extractVideoUrl(url) {\n let match = url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtube\\.com\\/watch.*v=([a-zA-Z0-9_-]+)/) ||\n url.match(/^(?:(https?):\\/\\/)?(?:(?:www|m)\\.)?youtu\\.be\\/([a-zA-Z0-9_-]+)/);\n if (match) {\n return (match[1] || 'https') + '://www.youtube.com/embed/' + match[2] + '?showinfo=0';\n }\n if (match = url.match(/^(?:(https?):\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/)) { // eslint-disable-line no-cond-assign\n return (match[1] || 'https') + '://player.vimeo.com/video/' + match[2] + '/';\n }\n return url;\n}\n\nfunction fillSelect(select, values, defaultValue = false) {\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value === defaultValue) {\n option.setAttribute('selected', 'selected');\n } else {\n option.setAttribute('value', value);\n }\n select.appendChild(option);\n });\n}\n\n\nexport { BaseTooltip, BaseTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/base.js","import Quill from './core';\n\nimport { AlignClass, AlignStyle } from './formats/align';\nimport { DirectionAttribute, DirectionClass, DirectionStyle } from './formats/direction';\nimport { IndentClass as Indent } from './formats/indent';\n\nimport Blockquote from './formats/blockquote';\nimport Header from './formats/header';\nimport List, { ListItem } from './formats/list';\n\nimport { BackgroundClass, BackgroundStyle } from './formats/background';\nimport { ColorClass, ColorStyle } from './formats/color';\nimport { FontClass, FontStyle } from './formats/font';\nimport { SizeClass, SizeStyle } from './formats/size';\n\nimport Bold from './formats/bold';\nimport Italic from './formats/italic';\nimport Link from './formats/link';\nimport Script from './formats/script';\nimport Strike from './formats/strike';\nimport Underline from './formats/underline';\n\nimport Image from './formats/image';\nimport Video from './formats/video';\n\nimport CodeBlock, { Code as InlineCode } from './formats/code';\n\nimport Formula from './modules/formula';\nimport Syntax from './modules/syntax';\nimport Toolbar from './modules/toolbar';\n\nimport Icons from './ui/icons';\nimport Picker from './ui/picker';\nimport ColorPicker from './ui/color-picker';\nimport IconPicker from './ui/icon-picker';\nimport Tooltip from './ui/tooltip';\n\nimport BubbleTheme from './themes/bubble';\nimport SnowTheme from './themes/snow';\n\n\nQuill.register({\n 'attributors/attribute/direction': DirectionAttribute,\n\n 'attributors/class/align': AlignClass,\n 'attributors/class/background': BackgroundClass,\n 'attributors/class/color': ColorClass,\n 'attributors/class/direction': DirectionClass,\n 'attributors/class/font': FontClass,\n 'attributors/class/size': SizeClass,\n\n 'attributors/style/align': AlignStyle,\n 'attributors/style/background': BackgroundStyle,\n 'attributors/style/color': ColorStyle,\n 'attributors/style/direction': DirectionStyle,\n 'attributors/style/font': FontStyle,\n 'attributors/style/size': SizeStyle\n}, true);\n\n\nQuill.register({\n 'formats/align': AlignClass,\n 'formats/direction': DirectionClass,\n 'formats/indent': Indent,\n\n 'formats/background': BackgroundStyle,\n 'formats/color': ColorStyle,\n 'formats/font': FontClass,\n 'formats/size': SizeClass,\n\n 'formats/blockquote': Blockquote,\n 'formats/code-block': CodeBlock,\n 'formats/header': Header,\n 'formats/list': List,\n\n 'formats/bold': Bold,\n 'formats/code': InlineCode,\n 'formats/italic': Italic,\n 'formats/link': Link,\n 'formats/script': Script,\n 'formats/strike': Strike,\n 'formats/underline': Underline,\n\n 'formats/image': Image,\n 'formats/video': Video,\n\n 'formats/list/item': ListItem,\n\n 'modules/formula': Formula,\n 'modules/syntax': Syntax,\n 'modules/toolbar': Toolbar,\n\n 'themes/bubble': BubbleTheme,\n 'themes/snow': SnowTheme,\n\n 'ui/icons': Icons,\n 'ui/picker': Picker,\n 'ui/icon-picker': IconPicker,\n 'ui/color-picker': ColorPicker,\n 'ui/tooltip': Tooltip\n}, true);\n\n\nexport default Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./quill.js","import Parchment from 'parchment';\nimport Quill from './core/quill';\n\nimport Block, { BlockEmbed } from './blots/block';\nimport Break from './blots/break';\nimport Container from './blots/container';\nimport Cursor from './blots/cursor';\nimport Embed from './blots/embed';\nimport Inline from './blots/inline';\nimport Scroll from './blots/scroll';\nimport TextBlot from './blots/text';\n\nimport Clipboard from './modules/clipboard';\nimport History from './modules/history';\nimport Keyboard from './modules/keyboard';\n\nQuill.register({\n 'blots/block' : Block,\n 'blots/block/embed' : BlockEmbed,\n 'blots/break' : Break,\n 'blots/container' : Container,\n 'blots/cursor' : Cursor,\n 'blots/embed' : Embed,\n 'blots/inline' : Inline,\n 'blots/scroll' : Scroll,\n 'blots/text' : TextBlot,\n\n 'modules/clipboard' : Clipboard,\n 'modules/history' : History,\n 'modules/keyboard' : Keyboard\n});\n\nParchment.register(Block, Break, Cursor, Inline, Scroll, TextBlot);\n\n\nexport default Quill;\n\n\n\n// WEBPACK FOOTER //\n// ./core.js","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedList = /** @class */ (function () {\n function LinkedList() {\n this.head = this.tail = null;\n this.length = 0;\n }\n LinkedList.prototype.append = function () {\n var nodes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n nodes[_i] = arguments[_i];\n }\n this.insertBefore(nodes[0], null);\n if (nodes.length > 1) {\n this.append.apply(this, nodes.slice(1));\n }\n };\n LinkedList.prototype.contains = function (node) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n if (cur === node)\n return true;\n }\n return false;\n };\n LinkedList.prototype.insertBefore = function (node, refNode) {\n if (!node)\n return;\n node.next = refNode;\n if (refNode != null) {\n node.prev = refNode.prev;\n if (refNode.prev != null) {\n refNode.prev.next = node;\n }\n refNode.prev = node;\n if (refNode === this.head) {\n this.head = node;\n }\n }\n else if (this.tail != null) {\n this.tail.next = node;\n node.prev = this.tail;\n this.tail = node;\n }\n else {\n node.prev = null;\n this.head = this.tail = node;\n }\n this.length += 1;\n };\n LinkedList.prototype.offset = function (target) {\n var index = 0, cur = this.head;\n while (cur != null) {\n if (cur === target)\n return index;\n index += cur.length();\n cur = cur.next;\n }\n return -1;\n };\n LinkedList.prototype.remove = function (node) {\n if (!this.contains(node))\n return;\n if (node.prev != null)\n node.prev.next = node.next;\n if (node.next != null)\n node.next.prev = node.prev;\n if (node === this.head)\n this.head = node.next;\n if (node === this.tail)\n this.tail = node.prev;\n this.length -= 1;\n };\n LinkedList.prototype.iterator = function (curNode) {\n if (curNode === void 0) { curNode = this.head; }\n // TODO use yield when we can\n return function () {\n var ret = curNode;\n if (curNode != null)\n curNode = curNode.next;\n return ret;\n };\n };\n LinkedList.prototype.find = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n var cur, next = this.iterator();\n while ((cur = next())) {\n var length = cur.length();\n if (index < length ||\n (inclusive && index === length && (cur.next == null || cur.next.length() !== 0))) {\n return [cur, index];\n }\n index -= length;\n }\n return [null, 0];\n };\n LinkedList.prototype.forEach = function (callback) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n callback(cur);\n }\n };\n LinkedList.prototype.forEachAt = function (index, length, callback) {\n if (length <= 0)\n return;\n var _a = this.find(index), startNode = _a[0], offset = _a[1];\n var cur, curIndex = index - offset, next = this.iterator(startNode);\n while ((cur = next()) && curIndex < index + length) {\n var curLength = cur.length();\n if (index > curIndex) {\n callback(cur, index - curIndex, Math.min(length, curIndex + curLength - index));\n }\n else {\n callback(cur, 0, Math.min(curLength, index + length - curIndex));\n }\n curIndex += curLength;\n }\n };\n LinkedList.prototype.map = function (callback) {\n return this.reduce(function (memo, cur) {\n memo.push(callback(cur));\n return memo;\n }, []);\n };\n LinkedList.prototype.reduce = function (callback, memo) {\n var cur, next = this.iterator();\n while ((cur = next())) {\n memo = callback(memo, cur);\n }\n return memo;\n };\n return LinkedList;\n}());\nexports.default = LinkedList;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/collection/linked-list.ts\n// module id = 47\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar container_1 = require(\"./abstract/container\");\nvar Registry = require(\"../registry\");\nvar OBSERVER_CONFIG = {\n attributes: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n};\nvar MAX_OPTIMIZE_ITERATIONS = 100;\nvar ScrollBlot = /** @class */ (function (_super) {\n __extends(ScrollBlot, _super);\n function ScrollBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.scroll = _this;\n _this.observer = new MutationObserver(function (mutations) {\n _this.update(mutations);\n });\n _this.observer.observe(_this.domNode, OBSERVER_CONFIG);\n _this.attach();\n return _this;\n }\n ScrollBlot.prototype.detach = function () {\n _super.prototype.detach.call(this);\n this.observer.disconnect();\n };\n ScrollBlot.prototype.deleteAt = function (index, length) {\n this.update();\n if (index === 0 && length === this.length()) {\n this.children.forEach(function (child) {\n child.remove();\n });\n }\n else {\n _super.prototype.deleteAt.call(this, index, length);\n }\n };\n ScrollBlot.prototype.formatAt = function (index, length, name, value) {\n this.update();\n _super.prototype.formatAt.call(this, index, length, name, value);\n };\n ScrollBlot.prototype.insertAt = function (index, value, def) {\n this.update();\n _super.prototype.insertAt.call(this, index, value, def);\n };\n ScrollBlot.prototype.optimize = function (mutations, context) {\n var _this = this;\n if (mutations === void 0) { mutations = []; }\n if (context === void 0) { context = {}; }\n _super.prototype.optimize.call(this, context);\n // We must modify mutations directly, cannot make copy and then modify\n var records = [].slice.call(this.observer.takeRecords());\n // Array.push currently seems to be implemented by a non-tail recursive function\n // so we cannot just mutations.push.apply(mutations, this.observer.takeRecords());\n while (records.length > 0)\n mutations.push(records.pop());\n // TODO use WeakMap\n var mark = function (blot, markParent) {\n if (markParent === void 0) { markParent = true; }\n if (blot == null || blot === _this)\n return;\n if (blot.domNode.parentNode == null)\n return;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [];\n }\n if (markParent)\n mark(blot.parent);\n };\n var optimize = function (blot) {\n // Post-order traversal\n if (\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY] == null ||\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations == null) {\n return;\n }\n if (blot instanceof container_1.default) {\n blot.children.forEach(optimize);\n }\n blot.optimize(context);\n };\n var remaining = mutations;\n for (var i = 0; remaining.length > 0; i += 1) {\n if (i >= MAX_OPTIMIZE_ITERATIONS) {\n throw new Error('[Parchment] Maximum optimize iterations reached');\n }\n remaining.forEach(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return;\n if (blot.domNode === mutation.target) {\n if (mutation.type === 'childList') {\n mark(Registry.find(mutation.previousSibling, false));\n [].forEach.call(mutation.addedNodes, function (node) {\n var child = Registry.find(node, false);\n mark(child, false);\n if (child instanceof container_1.default) {\n child.children.forEach(function (grandChild) {\n mark(grandChild, false);\n });\n }\n });\n }\n else if (mutation.type === 'attributes') {\n mark(blot.prev);\n }\n }\n mark(blot);\n });\n this.children.forEach(optimize);\n remaining = [].slice.call(this.observer.takeRecords());\n records = remaining.slice();\n while (records.length > 0)\n mutations.push(records.pop());\n }\n };\n ScrollBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (context === void 0) { context = {}; }\n mutations = mutations || this.observer.takeRecords();\n // TODO use WeakMap\n mutations\n .map(function (mutation) {\n var blot = Registry.find(mutation.target, true);\n if (blot == null)\n return null;\n // @ts-ignore\n if (blot.domNode[Registry.DATA_KEY].mutations == null) {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations = [mutation];\n return blot;\n }\n else {\n // @ts-ignore\n blot.domNode[Registry.DATA_KEY].mutations.push(mutation);\n return null;\n }\n })\n .forEach(function (blot) {\n // @ts-ignore\n if (blot == null || blot === _this || blot.domNode[Registry.DATA_KEY] == null)\n return;\n // @ts-ignore\n blot.update(blot.domNode[Registry.DATA_KEY].mutations || [], context);\n });\n // @ts-ignore\n if (this.domNode[Registry.DATA_KEY].mutations != null) {\n // @ts-ignore\n _super.prototype.update.call(this, this.domNode[Registry.DATA_KEY].mutations, context);\n }\n this.optimize(mutations, context);\n };\n ScrollBlot.blotName = 'scroll';\n ScrollBlot.defaultChild = 'block';\n ScrollBlot.scope = Registry.Scope.BLOCK_BLOT;\n ScrollBlot.tagName = 'DIV';\n return ScrollBlot;\n}(container_1.default));\nexports.default = ScrollBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/scroll.ts\n// module id = 48\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\n// Shallow object comparison\nfunction isEqual(obj1, obj2) {\n if (Object.keys(obj1).length !== Object.keys(obj2).length)\n return false;\n // @ts-ignore\n for (var prop in obj1) {\n // @ts-ignore\n if (obj1[prop] !== obj2[prop])\n return false;\n }\n return true;\n}\nvar InlineBlot = /** @class */ (function (_super) {\n __extends(InlineBlot, _super);\n function InlineBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n InlineBlot.formats = function (domNode) {\n if (domNode.tagName === InlineBlot.tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n InlineBlot.prototype.format = function (name, value) {\n var _this = this;\n if (name === this.statics.blotName && !value) {\n this.children.forEach(function (child) {\n if (!(child instanceof format_1.default)) {\n child = child.wrap(InlineBlot.blotName, true);\n }\n _this.attributes.copy(child);\n });\n this.unwrap();\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n InlineBlot.prototype.formatAt = function (index, length, name, value) {\n if (this.formats()[name] != null || Registry.query(name, Registry.Scope.ATTRIBUTE)) {\n var blot = this.isolate(index, length);\n blot.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n InlineBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n var formats = this.formats();\n if (Object.keys(formats).length === 0) {\n return this.unwrap(); // unformatted span\n }\n var next = this.next;\n if (next instanceof InlineBlot && next.prev === this && isEqual(formats, next.formats())) {\n next.moveChildren(this);\n next.remove();\n }\n };\n InlineBlot.blotName = 'inline';\n InlineBlot.scope = Registry.Scope.INLINE_BLOT;\n InlineBlot.tagName = 'SPAN';\n return InlineBlot;\n}(format_1.default));\nexports.default = InlineBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/inline.ts\n// module id = 49\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar format_1 = require(\"./abstract/format\");\nvar Registry = require(\"../registry\");\nvar BlockBlot = /** @class */ (function (_super) {\n __extends(BlockBlot, _super);\n function BlockBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n BlockBlot.formats = function (domNode) {\n var tagName = Registry.query(BlockBlot.blotName).tagName;\n if (domNode.tagName === tagName)\n return undefined;\n return _super.formats.call(this, domNode);\n };\n BlockBlot.prototype.format = function (name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) == null) {\n return;\n }\n else if (name === this.statics.blotName && !value) {\n this.replaceWith(BlockBlot.blotName);\n }\n else {\n _super.prototype.format.call(this, name, value);\n }\n };\n BlockBlot.prototype.formatAt = function (index, length, name, value) {\n if (Registry.query(name, Registry.Scope.BLOCK) != null) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n BlockBlot.prototype.insertAt = function (index, value, def) {\n if (def == null || Registry.query(value, Registry.Scope.INLINE) != null) {\n // Insert text or inline\n _super.prototype.insertAt.call(this, index, value, def);\n }\n else {\n var after = this.split(index);\n var blot = Registry.create(value, def);\n after.parent.insertBefore(blot, after);\n }\n };\n BlockBlot.prototype.update = function (mutations, context) {\n if (navigator.userAgent.match(/Trident/)) {\n this.build();\n }\n else {\n _super.prototype.update.call(this, mutations, context);\n }\n };\n BlockBlot.blotName = 'block';\n BlockBlot.scope = Registry.Scope.BLOCK_BLOT;\n BlockBlot.tagName = 'P';\n return BlockBlot;\n}(format_1.default));\nexports.default = BlockBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/block.ts\n// module id = 50\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar EmbedBlot = /** @class */ (function (_super) {\n __extends(EmbedBlot, _super);\n function EmbedBlot() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n EmbedBlot.formats = function (domNode) {\n return undefined;\n };\n EmbedBlot.prototype.format = function (name, value) {\n // super.formatAt wraps, which is what we want in general,\n // but this allows subclasses to overwrite for formats\n // that just apply to particular embeds\n _super.prototype.formatAt.call(this, 0, this.length(), name, value);\n };\n EmbedBlot.prototype.formatAt = function (index, length, name, value) {\n if (index === 0 && length === this.length()) {\n this.format(name, value);\n }\n else {\n _super.prototype.formatAt.call(this, index, length, name, value);\n }\n };\n EmbedBlot.prototype.formats = function () {\n return this.statics.formats(this.domNode);\n };\n return EmbedBlot;\n}(leaf_1.default));\nexports.default = EmbedBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/embed.ts\n// module id = 51\n// module chunks = 0","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar leaf_1 = require(\"./abstract/leaf\");\nvar Registry = require(\"../registry\");\nvar TextBlot = /** @class */ (function (_super) {\n __extends(TextBlot, _super);\n function TextBlot(node) {\n var _this = _super.call(this, node) || this;\n _this.text = _this.statics.value(_this.domNode);\n return _this;\n }\n TextBlot.create = function (value) {\n return document.createTextNode(value);\n };\n TextBlot.value = function (domNode) {\n var text = domNode.data;\n // @ts-ignore\n if (text['normalize'])\n text = text['normalize']();\n return text;\n };\n TextBlot.prototype.deleteAt = function (index, length) {\n this.domNode.data = this.text = this.text.slice(0, index) + this.text.slice(index + length);\n };\n TextBlot.prototype.index = function (node, offset) {\n if (this.domNode === node) {\n return offset;\n }\n return -1;\n };\n TextBlot.prototype.insertAt = function (index, value, def) {\n if (def == null) {\n this.text = this.text.slice(0, index) + value + this.text.slice(index);\n this.domNode.data = this.text;\n }\n else {\n _super.prototype.insertAt.call(this, index, value, def);\n }\n };\n TextBlot.prototype.length = function () {\n return this.text.length;\n };\n TextBlot.prototype.optimize = function (context) {\n _super.prototype.optimize.call(this, context);\n this.text = this.statics.value(this.domNode);\n if (this.text.length === 0) {\n this.remove();\n }\n else if (this.next instanceof TextBlot && this.next.prev === this) {\n this.insertAt(this.length(), this.next.value());\n this.next.remove();\n }\n };\n TextBlot.prototype.position = function (index, inclusive) {\n if (inclusive === void 0) { inclusive = false; }\n return [this.domNode, index];\n };\n TextBlot.prototype.split = function (index, force) {\n if (force === void 0) { force = false; }\n if (!force) {\n if (index === 0)\n return this;\n if (index === this.length())\n return this.next;\n }\n var after = Registry.create(this.domNode.splitText(index));\n this.parent.insertBefore(after, this.next);\n this.text = this.statics.value(this.domNode);\n return after;\n };\n TextBlot.prototype.update = function (mutations, context) {\n var _this = this;\n if (mutations.some(function (mutation) {\n return mutation.type === 'characterData' && mutation.target === _this.domNode;\n })) {\n this.text = this.statics.value(this.domNode);\n }\n };\n TextBlot.prototype.value = function () {\n return this.text;\n };\n TextBlot.blotName = 'text';\n TextBlot.scope = Registry.Scope.INLINE_BLOT;\n return TextBlot;\n}(leaf_1.default));\nexports.default = TextBlot;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../parchment/src/blot/text.ts\n// module id = 52\n// module chunks = 0","let elem = document.createElement('div');\nelem.classList.toggle('test-class', false);\nif (elem.classList.contains('test-class')) {\n let _toggle = DOMTokenList.prototype.toggle;\n DOMTokenList.prototype.toggle = function(token, force) {\n if (arguments.length > 1 && !this.contains(token) === !force) {\n return force;\n } else {\n return _toggle.call(this, token);\n }\n };\n}\n\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n\nif (!String.prototype.endsWith) {\n String.prototype.endsWith = function(searchString, position) {\n var subjectString = this.toString();\n if (typeof position !== 'number' || !isFinite(position) || Math.floor(position) !== position || position > subjectString.length) {\n position = subjectString.length;\n }\n position -= searchString.length;\n var lastIndex = subjectString.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n };\n}\n\nif (!Array.prototype.find) {\n Object.defineProperty(Array.prototype, \"find\", {\n value: function(predicate) {\n if (this === null) {\n throw new TypeError('Array.prototype.find called on null or undefined');\n }\n if (typeof predicate !== 'function') {\n throw new TypeError('predicate must be a function');\n }\n var list = Object(this);\n var length = list.length >>> 0;\n var thisArg = arguments[1];\n var value;\n\n for (var i = 0; i < length; i++) {\n value = list[i];\n if (predicate.call(thisArg, value, i, list)) {\n return value;\n }\n }\n return undefined;\n }\n });\n}\n\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n // Disable resizing in Firefox\n document.execCommand(\"enableObjectResizing\", false, false);\n // Disable automatic linkifying in IE11\n document.execCommand(\"autoUrlDetect\", false, false);\n});\n\n\n\n// WEBPACK FOOTER //\n// ./core/polyfill.js","/**\n * This library modifies the diff-patch-match library by Neil Fraser\n * by removing the patch and match functionality and certain advanced\n * options in the diff function. The original license is as follows:\n *\n * ===\n *\n * Diff Match and Patch\n *\n * Copyright 2006 Google Inc.\n * http://code.google.com/p/google-diff-match-patch/\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n/**\n * The data structure representing a diff is an array of tuples:\n * [[DIFF_DELETE, 'Hello'], [DIFF_INSERT, 'Goodbye'], [DIFF_EQUAL, ' world.']]\n * which means: delete 'Hello', add 'Goodbye' and keep ' world.'\n */\nvar DIFF_DELETE = -1;\nvar DIFF_INSERT = 1;\nvar DIFF_EQUAL = 0;\n\n\n/**\n * Find the differences between two texts. Simplifies the problem by stripping\n * any common prefix or suffix off the texts before diffing.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {Int} cursor_pos Expected edit position in text1 (optional)\n * @return {Array} Array of diff tuples.\n */\nfunction diff_main(text1, text2, cursor_pos) {\n // Check for equality (speedup).\n if (text1 == text2) {\n if (text1) {\n return [[DIFF_EQUAL, text1]];\n }\n return [];\n }\n\n // Check cursor_pos within bounds\n if (cursor_pos < 0 || text1.length < cursor_pos) {\n cursor_pos = null;\n }\n\n // Trim off common prefix (speedup).\n var commonlength = diff_commonPrefix(text1, text2);\n var commonprefix = text1.substring(0, commonlength);\n text1 = text1.substring(commonlength);\n text2 = text2.substring(commonlength);\n\n // Trim off common suffix (speedup).\n commonlength = diff_commonSuffix(text1, text2);\n var commonsuffix = text1.substring(text1.length - commonlength);\n text1 = text1.substring(0, text1.length - commonlength);\n text2 = text2.substring(0, text2.length - commonlength);\n\n // Compute the diff on the middle block.\n var diffs = diff_compute_(text1, text2);\n\n // Restore the prefix and suffix.\n if (commonprefix) {\n diffs.unshift([DIFF_EQUAL, commonprefix]);\n }\n if (commonsuffix) {\n diffs.push([DIFF_EQUAL, commonsuffix]);\n }\n diff_cleanupMerge(diffs);\n if (cursor_pos != null) {\n diffs = fix_cursor(diffs, cursor_pos);\n }\n diffs = fix_emoji(diffs);\n return diffs;\n};\n\n\n/**\n * Find the differences between two texts. Assumes that the texts do not\n * have any common prefix or suffix.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_compute_(text1, text2) {\n var diffs;\n\n if (!text1) {\n // Just add some text (speedup).\n return [[DIFF_INSERT, text2]];\n }\n\n if (!text2) {\n // Just delete some text (speedup).\n return [[DIFF_DELETE, text1]];\n }\n\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n var i = longtext.indexOf(shorttext);\n if (i != -1) {\n // Shorter text is inside the longer text (speedup).\n diffs = [[DIFF_INSERT, longtext.substring(0, i)],\n [DIFF_EQUAL, shorttext],\n [DIFF_INSERT, longtext.substring(i + shorttext.length)]];\n // Swap insertions for deletions if diff is reversed.\n if (text1.length > text2.length) {\n diffs[0][0] = diffs[2][0] = DIFF_DELETE;\n }\n return diffs;\n }\n\n if (shorttext.length == 1) {\n // Single character string.\n // After the previous speedup, the character can't be an equality.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n }\n\n // Check to see if the problem can be split in two.\n var hm = diff_halfMatch_(text1, text2);\n if (hm) {\n // A half-match was found, sort out the return data.\n var text1_a = hm[0];\n var text1_b = hm[1];\n var text2_a = hm[2];\n var text2_b = hm[3];\n var mid_common = hm[4];\n // Send both pairs off for separate processing.\n var diffs_a = diff_main(text1_a, text2_a);\n var diffs_b = diff_main(text1_b, text2_b);\n // Merge the results.\n return diffs_a.concat([[DIFF_EQUAL, mid_common]], diffs_b);\n }\n\n return diff_bisect_(text1, text2);\n};\n\n\n/**\n * Find the 'middle snake' of a diff, split the problem in two\n * and return the recursively constructed diff.\n * See Myers 1986 paper: An O(ND) Difference Algorithm and Its Variations.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @return {Array} Array of diff tuples.\n * @private\n */\nfunction diff_bisect_(text1, text2) {\n // Cache the text lengths to prevent multiple calls.\n var text1_length = text1.length;\n var text2_length = text2.length;\n var max_d = Math.ceil((text1_length + text2_length) / 2);\n var v_offset = max_d;\n var v_length = 2 * max_d;\n var v1 = new Array(v_length);\n var v2 = new Array(v_length);\n // Setting all elements to -1 is faster in Chrome & Firefox than mixing\n // integers and undefined.\n for (var x = 0; x < v_length; x++) {\n v1[x] = -1;\n v2[x] = -1;\n }\n v1[v_offset + 1] = 0;\n v2[v_offset + 1] = 0;\n var delta = text1_length - text2_length;\n // If the total number of characters is odd, then the front path will collide\n // with the reverse path.\n var front = (delta % 2 != 0);\n // Offsets for start and end of k loop.\n // Prevents mapping of space beyond the grid.\n var k1start = 0;\n var k1end = 0;\n var k2start = 0;\n var k2end = 0;\n for (var d = 0; d < max_d; d++) {\n // Walk the front path one step.\n for (var k1 = -d + k1start; k1 <= d - k1end; k1 += 2) {\n var k1_offset = v_offset + k1;\n var x1;\n if (k1 == -d || (k1 != d && v1[k1_offset - 1] < v1[k1_offset + 1])) {\n x1 = v1[k1_offset + 1];\n } else {\n x1 = v1[k1_offset - 1] + 1;\n }\n var y1 = x1 - k1;\n while (x1 < text1_length && y1 < text2_length &&\n text1.charAt(x1) == text2.charAt(y1)) {\n x1++;\n y1++;\n }\n v1[k1_offset] = x1;\n if (x1 > text1_length) {\n // Ran off the right of the graph.\n k1end += 2;\n } else if (y1 > text2_length) {\n // Ran off the bottom of the graph.\n k1start += 2;\n } else if (front) {\n var k2_offset = v_offset + delta - k1;\n if (k2_offset >= 0 && k2_offset < v_length && v2[k2_offset] != -1) {\n // Mirror x2 onto top-left coordinate system.\n var x2 = text1_length - v2[k2_offset];\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n\n // Walk the reverse path one step.\n for (var k2 = -d + k2start; k2 <= d - k2end; k2 += 2) {\n var k2_offset = v_offset + k2;\n var x2;\n if (k2 == -d || (k2 != d && v2[k2_offset - 1] < v2[k2_offset + 1])) {\n x2 = v2[k2_offset + 1];\n } else {\n x2 = v2[k2_offset - 1] + 1;\n }\n var y2 = x2 - k2;\n while (x2 < text1_length && y2 < text2_length &&\n text1.charAt(text1_length - x2 - 1) ==\n text2.charAt(text2_length - y2 - 1)) {\n x2++;\n y2++;\n }\n v2[k2_offset] = x2;\n if (x2 > text1_length) {\n // Ran off the left of the graph.\n k2end += 2;\n } else if (y2 > text2_length) {\n // Ran off the top of the graph.\n k2start += 2;\n } else if (!front) {\n var k1_offset = v_offset + delta - k2;\n if (k1_offset >= 0 && k1_offset < v_length && v1[k1_offset] != -1) {\n var x1 = v1[k1_offset];\n var y1 = v_offset + x1 - k1_offset;\n // Mirror x2 onto top-left coordinate system.\n x2 = text1_length - x2;\n if (x1 >= x2) {\n // Overlap detected.\n return diff_bisectSplit_(text1, text2, x1, y1);\n }\n }\n }\n }\n }\n // Diff took too long and hit the deadline or\n // number of diffs equals number of characters, no commonality at all.\n return [[DIFF_DELETE, text1], [DIFF_INSERT, text2]];\n};\n\n\n/**\n * Given the location of the 'middle snake', split the diff in two parts\n * and recurse.\n * @param {string} text1 Old string to be diffed.\n * @param {string} text2 New string to be diffed.\n * @param {number} x Index of split point in text1.\n * @param {number} y Index of split point in text2.\n * @return {Array} Array of diff tuples.\n */\nfunction diff_bisectSplit_(text1, text2, x, y) {\n var text1a = text1.substring(0, x);\n var text2a = text2.substring(0, y);\n var text1b = text1.substring(x);\n var text2b = text2.substring(y);\n\n // Compute both diffs serially.\n var diffs = diff_main(text1a, text2a);\n var diffsb = diff_main(text1b, text2b);\n\n return diffs.concat(diffsb);\n};\n\n\n/**\n * Determine the common prefix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the start of each\n * string.\n */\nfunction diff_commonPrefix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 || text1.charAt(0) != text2.charAt(0)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerstart = 0;\n while (pointermin < pointermid) {\n if (text1.substring(pointerstart, pointermid) ==\n text2.substring(pointerstart, pointermid)) {\n pointermin = pointermid;\n pointerstart = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Determine the common suffix of two strings.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {number} The number of characters common to the end of each string.\n */\nfunction diff_commonSuffix(text1, text2) {\n // Quick check for common null cases.\n if (!text1 || !text2 ||\n text1.charAt(text1.length - 1) != text2.charAt(text2.length - 1)) {\n return 0;\n }\n // Binary search.\n // Performance analysis: http://neil.fraser.name/news/2007/10/09/\n var pointermin = 0;\n var pointermax = Math.min(text1.length, text2.length);\n var pointermid = pointermax;\n var pointerend = 0;\n while (pointermin < pointermid) {\n if (text1.substring(text1.length - pointermid, text1.length - pointerend) ==\n text2.substring(text2.length - pointermid, text2.length - pointerend)) {\n pointermin = pointermid;\n pointerend = pointermin;\n } else {\n pointermax = pointermid;\n }\n pointermid = Math.floor((pointermax - pointermin) / 2 + pointermin);\n }\n return pointermid;\n};\n\n\n/**\n * Do the two texts share a substring which is at least half the length of the\n * longer text?\n * This speedup can produce non-minimal diffs.\n * @param {string} text1 First string.\n * @param {string} text2 Second string.\n * @return {Array.} Five element Array, containing the prefix of\n * text1, the suffix of text1, the prefix of text2, the suffix of\n * text2 and the common middle. Or null if there was no match.\n */\nfunction diff_halfMatch_(text1, text2) {\n var longtext = text1.length > text2.length ? text1 : text2;\n var shorttext = text1.length > text2.length ? text2 : text1;\n if (longtext.length < 4 || shorttext.length * 2 < longtext.length) {\n return null; // Pointless.\n }\n\n /**\n * Does a substring of shorttext exist within longtext such that the substring\n * is at least half the length of longtext?\n * Closure, but does not reference any external variables.\n * @param {string} longtext Longer string.\n * @param {string} shorttext Shorter string.\n * @param {number} i Start index of quarter length substring within longtext.\n * @return {Array.} Five element Array, containing the prefix of\n * longtext, the suffix of longtext, the prefix of shorttext, the suffix\n * of shorttext and the common middle. Or null if there was no match.\n * @private\n */\n function diff_halfMatchI_(longtext, shorttext, i) {\n // Start with a 1/4 length substring at position i as a seed.\n var seed = longtext.substring(i, i + Math.floor(longtext.length / 4));\n var j = -1;\n var best_common = '';\n var best_longtext_a, best_longtext_b, best_shorttext_a, best_shorttext_b;\n while ((j = shorttext.indexOf(seed, j + 1)) != -1) {\n var prefixLength = diff_commonPrefix(longtext.substring(i),\n shorttext.substring(j));\n var suffixLength = diff_commonSuffix(longtext.substring(0, i),\n shorttext.substring(0, j));\n if (best_common.length < suffixLength + prefixLength) {\n best_common = shorttext.substring(j - suffixLength, j) +\n shorttext.substring(j, j + prefixLength);\n best_longtext_a = longtext.substring(0, i - suffixLength);\n best_longtext_b = longtext.substring(i + prefixLength);\n best_shorttext_a = shorttext.substring(0, j - suffixLength);\n best_shorttext_b = shorttext.substring(j + prefixLength);\n }\n }\n if (best_common.length * 2 >= longtext.length) {\n return [best_longtext_a, best_longtext_b,\n best_shorttext_a, best_shorttext_b, best_common];\n } else {\n return null;\n }\n }\n\n // First check if the second quarter is the seed for a half-match.\n var hm1 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 4));\n // Check again based on the third quarter.\n var hm2 = diff_halfMatchI_(longtext, shorttext,\n Math.ceil(longtext.length / 2));\n var hm;\n if (!hm1 && !hm2) {\n return null;\n } else if (!hm2) {\n hm = hm1;\n } else if (!hm1) {\n hm = hm2;\n } else {\n // Both matched. Select the longest.\n hm = hm1[4].length > hm2[4].length ? hm1 : hm2;\n }\n\n // A half-match was found, sort out the return data.\n var text1_a, text1_b, text2_a, text2_b;\n if (text1.length > text2.length) {\n text1_a = hm[0];\n text1_b = hm[1];\n text2_a = hm[2];\n text2_b = hm[3];\n } else {\n text2_a = hm[0];\n text2_b = hm[1];\n text1_a = hm[2];\n text1_b = hm[3];\n }\n var mid_common = hm[4];\n return [text1_a, text1_b, text2_a, text2_b, mid_common];\n};\n\n\n/**\n * Reorder and merge like edit sections. Merge equalities.\n * Any edit section can move as long as it doesn't cross an equality.\n * @param {Array} diffs Array of diff tuples.\n */\nfunction diff_cleanupMerge(diffs) {\n diffs.push([DIFF_EQUAL, '']); // Add a dummy entry at the end.\n var pointer = 0;\n var count_delete = 0;\n var count_insert = 0;\n var text_delete = '';\n var text_insert = '';\n var commonlength;\n while (pointer < diffs.length) {\n switch (diffs[pointer][0]) {\n case DIFF_INSERT:\n count_insert++;\n text_insert += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_DELETE:\n count_delete++;\n text_delete += diffs[pointer][1];\n pointer++;\n break;\n case DIFF_EQUAL:\n // Upon reaching an equality, check for prior redundancies.\n if (count_delete + count_insert > 1) {\n if (count_delete !== 0 && count_insert !== 0) {\n // Factor out any common prefixies.\n commonlength = diff_commonPrefix(text_insert, text_delete);\n if (commonlength !== 0) {\n if ((pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] ==\n DIFF_EQUAL) {\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert.substring(0, commonlength);\n } else {\n diffs.splice(0, 0, [DIFF_EQUAL,\n text_insert.substring(0, commonlength)]);\n pointer++;\n }\n text_insert = text_insert.substring(commonlength);\n text_delete = text_delete.substring(commonlength);\n }\n // Factor out any common suffixies.\n commonlength = diff_commonSuffix(text_insert, text_delete);\n if (commonlength !== 0) {\n diffs[pointer][1] = text_insert.substring(text_insert.length -\n commonlength) + diffs[pointer][1];\n text_insert = text_insert.substring(0, text_insert.length -\n commonlength);\n text_delete = text_delete.substring(0, text_delete.length -\n commonlength);\n }\n }\n // Delete the offending records and add the merged ones.\n if (count_delete === 0) {\n diffs.splice(pointer - count_insert,\n count_delete + count_insert, [DIFF_INSERT, text_insert]);\n } else if (count_insert === 0) {\n diffs.splice(pointer - count_delete,\n count_delete + count_insert, [DIFF_DELETE, text_delete]);\n } else {\n diffs.splice(pointer - count_delete - count_insert,\n count_delete + count_insert, [DIFF_DELETE, text_delete],\n [DIFF_INSERT, text_insert]);\n }\n pointer = pointer - count_delete - count_insert +\n (count_delete ? 1 : 0) + (count_insert ? 1 : 0) + 1;\n } else if (pointer !== 0 && diffs[pointer - 1][0] == DIFF_EQUAL) {\n // Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1];\n diffs.splice(pointer, 1);\n } else {\n pointer++;\n }\n count_insert = 0;\n count_delete = 0;\n text_delete = '';\n text_insert = '';\n break;\n }\n }\n if (diffs[diffs.length - 1][1] === '') {\n diffs.pop(); // Remove the dummy entry at the end.\n }\n\n // Second pass: look for single edits surrounded on both sides by equalities\n // which can be shifted sideways to eliminate an equality.\n // e.g: ABAC -> ABAC\n var changes = false;\n pointer = 1;\n // Intentionally ignore the first and last element (don't need checking).\n while (pointer < diffs.length - 1) {\n if (diffs[pointer - 1][0] == DIFF_EQUAL &&\n diffs[pointer + 1][0] == DIFF_EQUAL) {\n // This is a single edit surrounded by equalities.\n if (diffs[pointer][1].substring(diffs[pointer][1].length -\n diffs[pointer - 1][1].length) == diffs[pointer - 1][1]) {\n // Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] +\n diffs[pointer][1].substring(0, diffs[pointer][1].length -\n diffs[pointer - 1][1].length);\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1];\n diffs.splice(pointer - 1, 1);\n changes = true;\n } else if (diffs[pointer][1].substring(0, diffs[pointer + 1][1].length) ==\n diffs[pointer + 1][1]) {\n // Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1];\n diffs[pointer][1] =\n diffs[pointer][1].substring(diffs[pointer + 1][1].length) +\n diffs[pointer + 1][1];\n diffs.splice(pointer + 1, 1);\n changes = true;\n }\n }\n pointer++;\n }\n // If shifts were made, the diff needs reordering and another shift sweep.\n if (changes) {\n diff_cleanupMerge(diffs);\n }\n};\n\n\nvar diff = diff_main;\ndiff.INSERT = DIFF_INSERT;\ndiff.DELETE = DIFF_DELETE;\ndiff.EQUAL = DIFF_EQUAL;\n\nmodule.exports = diff;\n\n/*\n * Modify a diff such that the cursor position points to the start of a change:\n * E.g.\n * cursor_normalize_diff([[DIFF_EQUAL, 'abc']], 1)\n * => [1, [[DIFF_EQUAL, 'a'], [DIFF_EQUAL, 'bc']]]\n * cursor_normalize_diff([[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xyz']], 2)\n * => [2, [[DIFF_INSERT, 'new'], [DIFF_DELETE, 'xy'], [DIFF_DELETE, 'z']]]\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} A tuple [cursor location in the modified diff, modified diff]\n */\nfunction cursor_normalize_diff (diffs, cursor_pos) {\n if (cursor_pos === 0) {\n return [DIFF_EQUAL, diffs];\n }\n for (var current_pos = 0, i = 0; i < diffs.length; i++) {\n var d = diffs[i];\n if (d[0] === DIFF_DELETE || d[0] === DIFF_EQUAL) {\n var next_pos = current_pos + d[1].length;\n if (cursor_pos === next_pos) {\n return [i + 1, diffs];\n } else if (cursor_pos < next_pos) {\n // copy to prevent side effects\n diffs = diffs.slice();\n // split d into two diff changes\n var split_pos = cursor_pos - current_pos;\n var d_left = [d[0], d[1].slice(0, split_pos)];\n var d_right = [d[0], d[1].slice(split_pos)];\n diffs.splice(i, 1, d_left, d_right);\n return [i + 1, diffs];\n } else {\n current_pos = next_pos;\n }\n }\n }\n throw new Error('cursor_pos is out of bounds!')\n}\n\n/*\n * Modify a diff such that the edit position is \"shifted\" to the proposed edit location (cursor_position).\n *\n * Case 1)\n * Check if a naive shift is possible:\n * [0, X], [ 1, Y] -> [ 1, Y], [0, X] (if X + Y === Y + X)\n * [0, X], [-1, Y] -> [-1, Y], [0, X] (if X + Y === Y + X) - holds same result\n * Case 2)\n * Check if the following shifts are possible:\n * [0, 'pre'], [ 1, 'prefix'] -> [ 1, 'pre'], [0, 'pre'], [ 1, 'fix']\n * [0, 'pre'], [-1, 'prefix'] -> [-1, 'pre'], [0, 'pre'], [-1, 'fix']\n * ^ ^\n * d d_next\n *\n * @param {Array} diffs Array of diff tuples\n * @param {Int} cursor_pos Suggested edit position. Must not be out of bounds!\n * @return {Array} Array of diff tuples\n */\nfunction fix_cursor (diffs, cursor_pos) {\n var norm = cursor_normalize_diff(diffs, cursor_pos);\n var ndiffs = norm[1];\n var cursor_pointer = norm[0];\n var d = ndiffs[cursor_pointer];\n var d_next = ndiffs[cursor_pointer + 1];\n\n if (d == null) {\n // Text was deleted from end of original string,\n // cursor is now out of bounds in new string\n return diffs;\n } else if (d[0] !== DIFF_EQUAL) {\n // A modification happened at the cursor location.\n // This is the expected outcome, so we can return the original diff.\n return diffs;\n } else {\n if (d_next != null && d[1] + d_next[1] === d_next[1] + d[1]) {\n // Case 1)\n // It is possible to perform a naive shift\n ndiffs.splice(cursor_pointer, 2, d_next, d)\n return merge_tuples(ndiffs, cursor_pointer, 2)\n } else if (d_next != null && d_next[1].indexOf(d[1]) === 0) {\n // Case 2)\n // d[1] is a prefix of d_next[1]\n // We can assume that d_next[0] !== 0, since d[0] === 0\n // Shift edit locations..\n ndiffs.splice(cursor_pointer, 2, [d_next[0], d[1]], [0, d[1]]);\n var suffix = d_next[1].slice(d[1].length);\n if (suffix.length > 0) {\n ndiffs.splice(cursor_pointer + 2, 0, [d_next[0], suffix]);\n }\n return merge_tuples(ndiffs, cursor_pointer, 3)\n } else {\n // Not possible to perform any modification\n return diffs;\n }\n }\n}\n\n/*\n * Check diff did not split surrogate pairs.\n * Ex. [0, '\\uD83D'], [-1, '\\uDC36'], [1, '\\uDC2F'] -> [-1, '\\uD83D\\uDC36'], [1, '\\uD83D\\uDC2F']\n * '\\uD83D\\uDC36' === '🐶', '\\uD83D\\uDC2F' === '🐯'\n *\n * @param {Array} diffs Array of diff tuples\n * @return {Array} Array of diff tuples\n */\nfunction fix_emoji (diffs) {\n var compact = false;\n var starts_with_pair_end = function(str) {\n return str.charCodeAt(0) >= 0xDC00 && str.charCodeAt(0) <= 0xDFFF;\n }\n var ends_with_pair_start = function(str) {\n return str.charCodeAt(str.length-1) >= 0xD800 && str.charCodeAt(str.length-1) <= 0xDBFF;\n }\n for (var i = 2; i < diffs.length; i += 1) {\n if (diffs[i-2][0] === DIFF_EQUAL && ends_with_pair_start(diffs[i-2][1]) &&\n diffs[i-1][0] === DIFF_DELETE && starts_with_pair_end(diffs[i-1][1]) &&\n diffs[i][0] === DIFF_INSERT && starts_with_pair_end(diffs[i][1])) {\n compact = true;\n\n diffs[i-1][1] = diffs[i-2][1].slice(-1) + diffs[i-1][1];\n diffs[i][1] = diffs[i-2][1].slice(-1) + diffs[i][1];\n\n diffs[i-2][1] = diffs[i-2][1].slice(0, -1);\n }\n }\n if (!compact) {\n return diffs;\n }\n var fixed_diffs = [];\n for (var i = 0; i < diffs.length; i += 1) {\n if (diffs[i][1].length > 0) {\n fixed_diffs.push(diffs[i]);\n }\n }\n return fixed_diffs;\n}\n\n/*\n * Try to merge tuples with their neigbors in a given range.\n * E.g. [0, 'a'], [0, 'b'] -> [0, 'ab']\n *\n * @param {Array} diffs Array of diff tuples.\n * @param {Int} start Position of the first element to merge (diffs[start] is also merged with diffs[start - 1]).\n * @param {Int} length Number of consecutive elements to check.\n * @return {Array} Array of merged diff tuples.\n */\nfunction merge_tuples (diffs, start, length) {\n // Check from (start-1) to (start+length).\n for (var i = start + length - 1; i >= 0 && i >= start - 1; i--) {\n if (i + 1 < diffs.length) {\n var left_d = diffs[i];\n var right_d = diffs[i+1];\n if (left_d[0] === right_d[1]) {\n diffs.splice(i, 2, [left_d[0], left_d[1] + right_d[1]]);\n }\n }\n }\n return diffs;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/fast-diff/diff.js\n// module id = 54\n// module chunks = 0","exports = module.exports = typeof Object.keys === 'function'\n ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n var keys = [];\n for (var key in obj) keys.push(key);\n return keys;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/lib/keys.js\n// module id = 55\n// module chunks = 0","var supportsArgumentsClass = (function(){\n return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n return object &&\n typeof object == 'object' &&\n typeof object.length == 'number' &&\n Object.prototype.hasOwnProperty.call(object, 'callee') &&\n !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n false;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/deep-equal/lib/is_arguments.js\n// module id = 56\n// module chunks = 0","import Delta from 'quill-delta';\nimport DeltaOp from 'quill-delta/lib/op';\nimport Parchment from 'parchment';\nimport CodeBlock from '../formats/code';\nimport CursorBlot from '../blots/cursor';\nimport Block, { bubbleFormats } from '../blots/block';\nimport Break from '../blots/break';\nimport clone from 'clone';\nimport equal from 'deep-equal';\nimport extend from 'extend';\n\n\nconst ASCII = /^[ -~]*$/;\n\n\nclass Editor {\n constructor(scroll) {\n this.scroll = scroll;\n this.delta = this.getDelta();\n }\n\n applyDelta(delta) {\n let consumeNextNewline = false;\n this.scroll.update();\n let scrollLength = this.scroll.length();\n this.scroll.batchStart();\n delta = normalizeDelta(delta);\n delta.reduce((index, op) => {\n let length = op.retain || op.delete || op.insert.length || 1;\n let attributes = op.attributes || {};\n if (op.insert != null) {\n if (typeof op.insert === 'string') {\n let text = op.insert;\n if (text.endsWith('\\n') && consumeNextNewline) {\n consumeNextNewline = false;\n text = text.slice(0, -1);\n }\n if (index >= scrollLength && !text.endsWith('\\n')) {\n consumeNextNewline = true;\n }\n this.scroll.insertAt(index, text);\n let [line, offset] = this.scroll.line(index);\n let formats = extend({}, bubbleFormats(line));\n if (line instanceof Block) {\n let [leaf, ] = line.descendant(Parchment.Leaf, offset);\n formats = extend(formats, bubbleFormats(leaf));\n }\n attributes = DeltaOp.attributes.diff(formats, attributes) || {};\n } else if (typeof op.insert === 'object') {\n let key = Object.keys(op.insert)[0]; // There should only be one key\n if (key == null) return index;\n this.scroll.insertAt(index, key, op.insert[key]);\n }\n scrollLength += length;\n }\n Object.keys(attributes).forEach((name) => {\n this.scroll.formatAt(index, length, name, attributes[name]);\n });\n return index + length;\n }, 0);\n delta.reduce((index, op) => {\n if (typeof op.delete === 'number') {\n this.scroll.deleteAt(index, op.delete);\n return index;\n }\n return index + (op.retain || op.insert.length || 1);\n }, 0);\n this.scroll.batchEnd();\n return this.update(delta);\n }\n\n deleteText(index, length) {\n this.scroll.deleteAt(index, length);\n return this.update(new Delta().retain(index).delete(length));\n }\n\n formatLine(index, length, formats = {}) {\n this.scroll.update();\n Object.keys(formats).forEach((format) => {\n if (this.scroll.whitelist != null && !this.scroll.whitelist[format]) return;\n let lines = this.scroll.lines(index, Math.max(length, 1));\n let lengthRemaining = length;\n lines.forEach((line) => {\n let lineLength = line.length();\n if (!(line instanceof CodeBlock)) {\n line.format(format, formats[format]);\n } else {\n let codeIndex = index - line.offset(this.scroll);\n let codeLength = line.newlineIndex(codeIndex + lengthRemaining) - codeIndex + 1;\n line.formatAt(codeIndex, codeLength, format, formats[format]);\n }\n lengthRemaining -= lineLength;\n });\n });\n this.scroll.optimize();\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n formatText(index, length, formats = {}) {\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).retain(length, clone(formats)));\n }\n\n getContents(index, length) {\n return this.delta.slice(index, index + length);\n }\n\n getDelta() {\n return this.scroll.lines().reduce((delta, line) => {\n return delta.concat(line.delta());\n }, new Delta());\n }\n\n getFormat(index, length = 0) {\n let lines = [], leaves = [];\n if (length === 0) {\n this.scroll.path(index).forEach(function(path) {\n let [blot, ] = path;\n if (blot instanceof Block) {\n lines.push(blot);\n } else if (blot instanceof Parchment.Leaf) {\n leaves.push(blot);\n }\n });\n } else {\n lines = this.scroll.lines(index, length);\n leaves = this.scroll.descendants(Parchment.Leaf, index, length);\n }\n let formatsArr = [lines, leaves].map(function(blots) {\n if (blots.length === 0) return {};\n let formats = bubbleFormats(blots.shift());\n while (Object.keys(formats).length > 0) {\n let blot = blots.shift();\n if (blot == null) return formats;\n formats = combineFormats(bubbleFormats(blot), formats);\n }\n return formats;\n });\n return extend.apply(extend, formatsArr);\n }\n\n getText(index, length) {\n return this.getContents(index, length).filter(function(op) {\n return typeof op.insert === 'string';\n }).map(function(op) {\n return op.insert;\n }).join('');\n }\n\n insertEmbed(index, embed, value) {\n this.scroll.insertAt(index, embed, value);\n return this.update(new Delta().retain(index).insert({ [embed]: value }));\n }\n\n insertText(index, text, formats = {}) {\n text = text.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n this.scroll.insertAt(index, text);\n Object.keys(formats).forEach((format) => {\n this.scroll.formatAt(index, text.length, format, formats[format]);\n });\n return this.update(new Delta().retain(index).insert(text, clone(formats)));\n }\n\n isBlank() {\n if (this.scroll.children.length == 0) return true;\n if (this.scroll.children.length > 1) return false;\n let block = this.scroll.children.head;\n if (block.statics.blotName !== Block.blotName) return false;\n if (block.children.length > 1) return false;\n return block.children.head instanceof Break;\n }\n\n removeFormat(index, length) {\n let text = this.getText(index, length);\n let [line, offset] = this.scroll.line(index + length);\n let suffixLength = 0, suffix = new Delta();\n if (line != null) {\n if (!(line instanceof CodeBlock)) {\n suffixLength = line.length() - offset;\n } else {\n suffixLength = line.newlineIndex(offset) - offset + 1;\n }\n suffix = line.delta().slice(offset, offset + suffixLength - 1).insert('\\n');\n }\n let contents = this.getContents(index, length + suffixLength);\n let diff = contents.diff(new Delta().insert(text).concat(suffix));\n let delta = new Delta().retain(index).concat(diff);\n return this.applyDelta(delta);\n }\n\n update(change, mutations = [], cursorIndex = undefined) {\n let oldDelta = this.delta;\n if (mutations.length === 1 &&\n mutations[0].type === 'characterData' &&\n mutations[0].target.data.match(ASCII) &&\n Parchment.find(mutations[0].target)) {\n // Optimization for character changes\n let textBlot = Parchment.find(mutations[0].target);\n let formats = bubbleFormats(textBlot);\n let index = textBlot.offset(this.scroll);\n let oldValue = mutations[0].oldValue.replace(CursorBlot.CONTENTS, '');\n let oldText = new Delta().insert(oldValue);\n let newText = new Delta().insert(textBlot.value());\n let diffDelta = new Delta().retain(index).concat(oldText.diff(newText, cursorIndex));\n change = diffDelta.reduce(function(delta, op) {\n if (op.insert) {\n return delta.insert(op.insert, formats);\n } else {\n return delta.push(op);\n }\n }, new Delta());\n this.delta = oldDelta.compose(change);\n } else {\n this.delta = this.getDelta();\n if (!change || !equal(oldDelta.compose(change), this.delta)) {\n change = oldDelta.diff(this.delta, cursorIndex);\n }\n }\n return change;\n }\n}\n\n\nfunction combineFormats(formats, combined) {\n return Object.keys(combined).reduce(function(merged, name) {\n if (formats[name] == null) return merged;\n if (combined[name] === formats[name]) {\n merged[name] = combined[name];\n } else if (Array.isArray(combined[name])) {\n if (combined[name].indexOf(formats[name]) < 0) {\n merged[name] = combined[name].concat([formats[name]]);\n }\n } else {\n merged[name] = [combined[name], formats[name]];\n }\n return merged;\n }, {});\n}\n\nfunction normalizeDelta(delta) {\n return delta.reduce(function(delta, op) {\n if (op.insert === 1) {\n let attributes = clone(op.attributes);\n delete attributes['image'];\n return delta.insert({ image: op.attributes.image }, attributes);\n }\n if (op.attributes != null && (op.attributes.list === true || op.attributes.bullet === true)) {\n op = clone(op);\n if (op.attributes.list) {\n op.attributes.list = 'ordered';\n } else {\n op.attributes.list = 'bullet';\n delete op.attributes.bullet;\n }\n }\n if (typeof op.insert === 'string') {\n let text = op.insert.replace(/\\r\\n/g, '\\n').replace(/\\r/g, '\\n');\n return delta.insert(text, op.attributes);\n }\n return delta.push(op);\n }, new Delta());\n}\n\n\nexport default Editor;\n\n\n\n// WEBPACK FOOTER //\n// ./core/editor.js","'use strict';\n\nvar has = Object.prototype.hasOwnProperty\n , prefix = '~';\n\n/**\n * Constructor to create a storage for our `EE` objects.\n * An `Events` instance is a plain object whose properties are event names.\n *\n * @constructor\n * @api private\n */\nfunction Events() {}\n\n//\n// We try to not inherit from `Object.prototype`. In some engines creating an\n// instance in this way is faster than calling `Object.create(null)` directly.\n// If `Object.create(null)` is not supported we prefix the event names with a\n// character to make sure that the built-in object properties are not\n// overridden or used as an attack vector.\n//\nif (Object.create) {\n Events.prototype = Object.create(null);\n\n //\n // This hack is needed because the `__proto__` property is still inherited in\n // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5.\n //\n if (!new Events().__proto__) prefix = false;\n}\n\n/**\n * Representation of a single event listener.\n *\n * @param {Function} fn The listener function.\n * @param {Mixed} context The context to invoke the listener with.\n * @param {Boolean} [once=false] Specify if the listener is a one-time listener.\n * @constructor\n * @api private\n */\nfunction EE(fn, context, once) {\n this.fn = fn;\n this.context = context;\n this.once = once || false;\n}\n\n/**\n * Minimal `EventEmitter` interface that is molded against the Node.js\n * `EventEmitter` interface.\n *\n * @constructor\n * @api public\n */\nfunction EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}\n\n/**\n * Return an array listing the events for which the emitter has registered\n * listeners.\n *\n * @returns {Array}\n * @api public\n */\nEventEmitter.prototype.eventNames = function eventNames() {\n var names = []\n , events\n , name;\n\n if (this._eventsCount === 0) return names;\n\n for (name in (events = this._events)) {\n if (has.call(events, name)) names.push(prefix ? name.slice(1) : name);\n }\n\n if (Object.getOwnPropertySymbols) {\n return names.concat(Object.getOwnPropertySymbols(events));\n }\n\n return names;\n};\n\n/**\n * Return the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Boolean} exists Only check if there are listeners.\n * @returns {Array|Boolean}\n * @api public\n */\nEventEmitter.prototype.listeners = function listeners(event, exists) {\n var evt = prefix ? prefix + event : event\n , available = this._events[evt];\n\n if (exists) return !!available;\n if (!available) return [];\n if (available.fn) return [available.fn];\n\n for (var i = 0, l = available.length, ee = new Array(l); i < l; i++) {\n ee[i] = available[i].fn;\n }\n\n return ee;\n};\n\n/**\n * Calls each of the listeners registered for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @returns {Boolean} `true` if the event had listeners, else `false`.\n * @api public\n */\nEventEmitter.prototype.emit = function emit(event, a1, a2, a3, a4, a5) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return false;\n\n var listeners = this._events[evt]\n , len = arguments.length\n , args\n , i;\n\n if (listeners.fn) {\n if (listeners.once) this.removeListener(event, listeners.fn, undefined, true);\n\n switch (len) {\n case 1: return listeners.fn.call(listeners.context), true;\n case 2: return listeners.fn.call(listeners.context, a1), true;\n case 3: return listeners.fn.call(listeners.context, a1, a2), true;\n case 4: return listeners.fn.call(listeners.context, a1, a2, a3), true;\n case 5: return listeners.fn.call(listeners.context, a1, a2, a3, a4), true;\n case 6: return listeners.fn.call(listeners.context, a1, a2, a3, a4, a5), true;\n }\n\n for (i = 1, args = new Array(len -1); i < len; i++) {\n args[i - 1] = arguments[i];\n }\n\n listeners.fn.apply(listeners.context, args);\n } else {\n var length = listeners.length\n , j;\n\n for (i = 0; i < length; i++) {\n if (listeners[i].once) this.removeListener(event, listeners[i].fn, undefined, true);\n\n switch (len) {\n case 1: listeners[i].fn.call(listeners[i].context); break;\n case 2: listeners[i].fn.call(listeners[i].context, a1); break;\n case 3: listeners[i].fn.call(listeners[i].context, a1, a2); break;\n case 4: listeners[i].fn.call(listeners[i].context, a1, a2, a3); break;\n default:\n if (!args) for (j = 1, args = new Array(len -1); j < len; j++) {\n args[j - 1] = arguments[j];\n }\n\n listeners[i].fn.apply(listeners[i].context, args);\n }\n }\n }\n\n return true;\n};\n\n/**\n * Add a listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.on = function on(event, fn, context) {\n var listener = new EE(fn, context || this)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Add a one-time listener for a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn The listener function.\n * @param {Mixed} [context=this] The context to invoke the listener with.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.once = function once(event, fn, context) {\n var listener = new EE(fn, context || this, true)\n , evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) this._events[evt] = listener, this._eventsCount++;\n else if (!this._events[evt].fn) this._events[evt].push(listener);\n else this._events[evt] = [this._events[evt], listener];\n\n return this;\n};\n\n/**\n * Remove the listeners of a given event.\n *\n * @param {String|Symbol} event The event name.\n * @param {Function} fn Only remove the listeners that match this function.\n * @param {Mixed} context Only remove the listeners that have this context.\n * @param {Boolean} once Only remove one-time listeners.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeListener = function removeListener(event, fn, context, once) {\n var evt = prefix ? prefix + event : event;\n\n if (!this._events[evt]) return this;\n if (!fn) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n return this;\n }\n\n var listeners = this._events[evt];\n\n if (listeners.fn) {\n if (\n listeners.fn === fn\n && (!once || listeners.once)\n && (!context || listeners.context === context)\n ) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n for (var i = 0, events = [], length = listeners.length; i < length; i++) {\n if (\n listeners[i].fn !== fn\n || (once && !listeners[i].once)\n || (context && listeners[i].context !== context)\n ) {\n events.push(listeners[i]);\n }\n }\n\n //\n // Reset the array, or remove it completely if we have no more listeners.\n //\n if (events.length) this._events[evt] = events.length === 1 ? events[0] : events;\n else if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n\n return this;\n};\n\n/**\n * Remove all listeners, or those of the specified event.\n *\n * @param {String|Symbol} [event] The event name.\n * @returns {EventEmitter} `this`.\n * @api public\n */\nEventEmitter.prototype.removeAllListeners = function removeAllListeners(event) {\n var evt;\n\n if (event) {\n evt = prefix ? prefix + event : event;\n if (this._events[evt]) {\n if (--this._eventsCount === 0) this._events = new Events();\n else delete this._events[evt];\n }\n } else {\n this._events = new Events();\n this._eventsCount = 0;\n }\n\n return this;\n};\n\n//\n// Alias methods names because people roll like that.\n//\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\nEventEmitter.prototype.addListener = EventEmitter.prototype.on;\n\n//\n// This function doesn't apply anymore.\n//\nEventEmitter.prototype.setMaxListeners = function setMaxListeners() {\n return this;\n};\n\n//\n// Expose the prefix.\n//\nEventEmitter.prefixed = prefix;\n\n//\n// Allow `EventEmitter` to be imported as module namespace.\n//\nEventEmitter.EventEmitter = EventEmitter;\n\n//\n// Expose the module.\n//\nif ('undefined' !== typeof module) {\n module.exports = EventEmitter;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./node_modules/eventemitter3/index.js\n// module id = 58\n// module chunks = 0","import Parchment from 'parchment';\nimport Emitter from '../core/emitter';\nimport Block, { BlockEmbed } from './block';\nimport Break from './break';\nimport CodeBlock from '../formats/code';\nimport Container from './container';\n\n\nfunction isLine(blot) {\n return (blot instanceof Block || blot instanceof BlockEmbed);\n}\n\n\nclass Scroll extends Parchment.Scroll {\n constructor(domNode, config) {\n super(domNode);\n this.emitter = config.emitter;\n if (Array.isArray(config.whitelist)) {\n this.whitelist = config.whitelist.reduce(function(whitelist, format) {\n whitelist[format] = true;\n return whitelist;\n }, {});\n }\n // Some reason fixes composition issues with character languages in Windows/Chrome, Safari\n this.domNode.addEventListener('DOMNodeInserted', function() {});\n this.optimize();\n this.enable();\n }\n\n batchStart() {\n this.batch = true;\n }\n\n batchEnd() {\n this.batch = false;\n this.optimize();\n }\n\n deleteAt(index, length) {\n let [first, offset] = this.line(index);\n let [last, ] = this.line(index + length);\n super.deleteAt(index, length);\n if (last != null && first !== last && offset > 0) {\n if (first instanceof BlockEmbed || last instanceof BlockEmbed) {\n this.optimize();\n return;\n }\n if (first instanceof CodeBlock) {\n let newlineIndex = first.newlineIndex(first.length(), true);\n if (newlineIndex > -1) {\n first = first.split(newlineIndex + 1);\n if (first === last) {\n this.optimize();\n return;\n }\n }\n } else if (last instanceof CodeBlock) {\n let newlineIndex = last.newlineIndex(0);\n if (newlineIndex > -1) {\n last.split(newlineIndex + 1);\n }\n }\n let ref = last.children.head instanceof Break ? null : last.children.head;\n first.moveChildren(last, ref);\n first.remove();\n }\n this.optimize();\n }\n\n enable(enabled = true) {\n this.domNode.setAttribute('contenteditable', enabled);\n }\n\n formatAt(index, length, format, value) {\n if (this.whitelist != null && !this.whitelist[format]) return;\n super.formatAt(index, length, format, value);\n this.optimize();\n }\n\n insertAt(index, value, def) {\n if (def != null && this.whitelist != null && !this.whitelist[value]) return;\n if (index >= this.length()) {\n if (def == null || Parchment.query(value, Parchment.Scope.BLOCK) == null) {\n let blot = Parchment.create(this.statics.defaultChild);\n this.appendChild(blot);\n if (def == null && value.endsWith('\\n')) {\n value = value.slice(0, -1);\n }\n blot.insertAt(0, value, def);\n } else {\n let embed = Parchment.create(value, def);\n this.appendChild(embed);\n }\n } else {\n super.insertAt(index, value, def);\n }\n this.optimize();\n }\n\n insertBefore(blot, ref) {\n if (blot.statics.scope === Parchment.Scope.INLINE_BLOT) {\n let wrapper = Parchment.create(this.statics.defaultChild);\n wrapper.appendChild(blot);\n blot = wrapper;\n }\n super.insertBefore(blot, ref);\n }\n\n leaf(index) {\n return this.path(index).pop() || [null, -1];\n }\n\n line(index) {\n if (index === this.length()) {\n return this.line(index - 1);\n }\n return this.descendant(isLine, index);\n }\n\n lines(index = 0, length = Number.MAX_VALUE) {\n let getLines = (blot, index, length) => {\n let lines = [], lengthLeft = length;\n blot.children.forEachAt(index, length, function(child, index, length) {\n if (isLine(child)) {\n lines.push(child);\n } else if (child instanceof Parchment.Container) {\n lines = lines.concat(getLines(child, index, lengthLeft));\n }\n lengthLeft -= length;\n });\n return lines;\n };\n return getLines(this, index, length);\n }\n\n optimize(mutations = [], context = {}) {\n if (this.batch === true) return;\n super.optimize(mutations, context);\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_OPTIMIZE, mutations, context);\n }\n }\n\n path(index) {\n return super.path(index).slice(1); // Exclude self\n }\n\n update(mutations) {\n if (this.batch === true) return;\n let source = Emitter.sources.USER;\n if (typeof mutations === 'string') {\n source = mutations;\n }\n if (!Array.isArray(mutations)) {\n mutations = this.observer.takeRecords();\n }\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_BEFORE_UPDATE, source, mutations);\n }\n super.update(mutations.concat([])); // pass copy\n if (mutations.length > 0) {\n this.emitter.emit(Emitter.events.SCROLL_UPDATE, source, mutations);\n }\n }\n}\nScroll.blotName = 'scroll';\nScroll.className = 'ql-editor';\nScroll.tagName = 'DIV';\nScroll.defaultChild = 'block';\nScroll.allowedChildren = [Block, BlockEmbed, Container];\n\n\nexport default Scroll;\n\n\n\n// WEBPACK FOOTER //\n// ./blots/scroll.js","import extend from 'extend';\nimport Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nimport { AlignAttribute, AlignStyle } from '../formats/align';\nimport { BackgroundStyle } from '../formats/background';\nimport CodeBlock from '../formats/code';\nimport { ColorStyle } from '../formats/color';\nimport { DirectionAttribute, DirectionStyle } from '../formats/direction';\nimport { FontStyle } from '../formats/font';\nimport { SizeStyle } from '../formats/size';\n\nlet debug = logger('quill:clipboard');\n\n\nconst DOM_KEY = '__ql-matcher';\n\nconst CLIPBOARD_CONFIG = [\n [Node.TEXT_NODE, matchText],\n [Node.TEXT_NODE, matchNewline],\n ['br', matchBreak],\n [Node.ELEMENT_NODE, matchNewline],\n [Node.ELEMENT_NODE, matchBlot],\n [Node.ELEMENT_NODE, matchSpacing],\n [Node.ELEMENT_NODE, matchAttributor],\n [Node.ELEMENT_NODE, matchStyles],\n ['li', matchIndent],\n ['b', matchAlias.bind(matchAlias, 'bold')],\n ['i', matchAlias.bind(matchAlias, 'italic')],\n ['style', matchIgnore]\n];\n\nconst ATTRIBUTE_ATTRIBUTORS = [\n AlignAttribute,\n DirectionAttribute\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\nconst STYLE_ATTRIBUTORS = [\n AlignStyle,\n BackgroundStyle,\n ColorStyle,\n DirectionStyle,\n FontStyle,\n SizeStyle\n].reduce(function(memo, attr) {\n memo[attr.keyName] = attr;\n return memo;\n}, {});\n\n\nclass Clipboard extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.quill.root.addEventListener('paste', this.onPaste.bind(this));\n this.container = this.quill.addContainer('ql-clipboard');\n this.container.setAttribute('contenteditable', true);\n this.container.setAttribute('tabindex', -1);\n this.matchers = [];\n CLIPBOARD_CONFIG.concat(this.options.matchers).forEach(([selector, matcher]) => {\n if (!options.matchVisual && matcher === matchSpacing) return;\n this.addMatcher(selector, matcher);\n });\n }\n\n addMatcher(selector, matcher) {\n this.matchers.push([selector, matcher]);\n }\n\n convert(html) {\n if (typeof html === 'string') {\n this.container.innerHTML = html.replace(/\\>\\r?\\n +\\<'); // Remove spaces between tags\n return this.convert();\n }\n const formats = this.quill.getFormat(this.quill.selection.savedRange.index);\n if (formats[CodeBlock.blotName]) {\n const text = this.container.innerText;\n this.container.innerHTML = '';\n return new Delta().insert(text, { [CodeBlock.blotName]: formats[CodeBlock.blotName] });\n }\n let [elementMatchers, textMatchers] = this.prepareMatching();\n let delta = traverse(this.container, elementMatchers, textMatchers);\n // Remove trailing newline\n if (deltaEndsWith(delta, '\\n') && delta.ops[delta.ops.length - 1].attributes == null) {\n delta = delta.compose(new Delta().retain(delta.length() - 1).delete(1));\n }\n debug.log('convert', this.container.innerHTML, delta);\n this.container.innerHTML = '';\n return delta;\n }\n\n dangerouslyPasteHTML(index, html, source = Quill.sources.API) {\n if (typeof index === 'string') {\n this.quill.setContents(this.convert(index), html);\n this.quill.setSelection(0, Quill.sources.SILENT);\n } else {\n let paste = this.convert(html);\n this.quill.updateContents(new Delta().retain(index).concat(paste), source);\n this.quill.setSelection(index + paste.length(), Quill.sources.SILENT);\n }\n }\n\n onPaste(e) {\n if (e.defaultPrevented || !this.quill.isEnabled()) return;\n let range = this.quill.getSelection();\n let delta = new Delta().retain(range.index);\n let scrollTop = this.quill.scrollingContainer.scrollTop;\n this.container.focus();\n this.quill.selection.update(Quill.sources.SILENT);\n setTimeout(() => {\n delta = delta.concat(this.convert()).delete(range.length);\n this.quill.updateContents(delta, Quill.sources.USER);\n // range.length contributes to delta.length()\n this.quill.setSelection(delta.length() - range.length, Quill.sources.SILENT);\n this.quill.scrollingContainer.scrollTop = scrollTop;\n this.quill.focus();\n }, 1);\n }\n\n prepareMatching() {\n let elementMatchers = [], textMatchers = [];\n this.matchers.forEach((pair) => {\n let [selector, matcher] = pair;\n switch (selector) {\n case Node.TEXT_NODE:\n textMatchers.push(matcher);\n break;\n case Node.ELEMENT_NODE:\n elementMatchers.push(matcher);\n break;\n default:\n [].forEach.call(this.container.querySelectorAll(selector), (node) => {\n // TODO use weakmap\n node[DOM_KEY] = node[DOM_KEY] || [];\n node[DOM_KEY].push(matcher);\n });\n break;\n }\n });\n return [elementMatchers, textMatchers];\n }\n}\nClipboard.DEFAULTS = {\n matchers: [],\n matchVisual: true\n};\n\n\nfunction applyFormat(delta, format, value) {\n if (typeof format === 'object') {\n return Object.keys(format).reduce(function(delta, key) {\n return applyFormat(delta, key, format[key]);\n }, delta);\n } else {\n return delta.reduce(function(delta, op) {\n if (op.attributes && op.attributes[format]) {\n return delta.push(op);\n } else {\n return delta.insert(op.insert, extend({}, {[format]: value}, op.attributes));\n }\n }, new Delta());\n }\n}\n\nfunction computeStyle(node) {\n if (node.nodeType !== Node.ELEMENT_NODE) return {};\n const DOM_KEY = '__ql-computed-style';\n return node[DOM_KEY] || (node[DOM_KEY] = window.getComputedStyle(node));\n}\n\nfunction deltaEndsWith(delta, text) {\n let endText = \"\";\n for (let i = delta.ops.length - 1; i >= 0 && endText.length < text.length; --i) {\n let op = delta.ops[i];\n if (typeof op.insert !== 'string') break;\n endText = op.insert + endText;\n }\n return endText.slice(-1*text.length) === text;\n}\n\nfunction isLine(node) {\n if (node.childNodes.length === 0) return false; // Exclude embed blocks\n let style = computeStyle(node);\n return ['block', 'list-item'].indexOf(style.display) > -1;\n}\n\nfunction traverse(node, elementMatchers, textMatchers) { // Post-order\n if (node.nodeType === node.TEXT_NODE) {\n return textMatchers.reduce(function(delta, matcher) {\n return matcher(node, delta);\n }, new Delta());\n } else if (node.nodeType === node.ELEMENT_NODE) {\n return [].reduce.call(node.childNodes || [], (delta, childNode) => {\n let childrenDelta = traverse(childNode, elementMatchers, textMatchers);\n if (childNode.nodeType === node.ELEMENT_NODE) {\n childrenDelta = elementMatchers.reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n childrenDelta = (childNode[DOM_KEY] || []).reduce(function(childrenDelta, matcher) {\n return matcher(childNode, childrenDelta);\n }, childrenDelta);\n }\n return delta.concat(childrenDelta);\n }, new Delta());\n } else {\n return new Delta();\n }\n}\n\n\nfunction matchAlias(format, node, delta) {\n return applyFormat(delta, format, true);\n}\n\nfunction matchAttributor(node, delta) {\n let attributes = Parchment.Attributor.Attribute.keys(node);\n let classes = Parchment.Attributor.Class.keys(node);\n let styles = Parchment.Attributor.Style.keys(node);\n let formats = {};\n attributes.concat(classes).concat(styles).forEach((name) => {\n let attr = Parchment.query(name, Parchment.Scope.ATTRIBUTE);\n if (attr != null) {\n formats[attr.attrName] = attr.value(node);\n if (formats[attr.attrName]) return;\n }\n attr = ATTRIBUTE_ATTRIBUTORS[name];\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n attr = STYLE_ATTRIBUTORS[name]\n if (attr != null && (attr.attrName === name || attr.keyName === name)) {\n attr = STYLE_ATTRIBUTORS[name];\n formats[attr.attrName] = attr.value(node) || undefined;\n }\n });\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n return delta;\n}\n\nfunction matchBlot(node, delta) {\n let match = Parchment.query(node);\n if (match == null) return delta;\n if (match.prototype instanceof Parchment.Embed) {\n let embed = {};\n let value = match.value(node);\n if (value != null) {\n embed[match.blotName] = value;\n delta = new Delta().insert(embed, match.formats(node));\n }\n } else if (typeof match.formats === 'function') {\n delta = applyFormat(delta, match.blotName, match.formats(node));\n }\n return delta;\n}\n\nfunction matchBreak(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n delta.insert('\\n');\n }\n return delta;\n}\n\nfunction matchIgnore() {\n return new Delta();\n}\n\nfunction matchIndent(node, delta) {\n let match = Parchment.query(node);\n if (match == null || match.blotName !== 'list-item' || !deltaEndsWith(delta, '\\n')) {\n return delta;\n }\n let indent = -1, parent = node.parentNode;\n while (!parent.classList.contains('ql-clipboard')) {\n if ((Parchment.query(parent) || {}).blotName === 'list') {\n indent += 1;\n }\n parent = parent.parentNode;\n }\n if (indent <= 0) return delta;\n return delta.compose(new Delta().retain(delta.length() - 1).retain(1, { indent: indent}));\n}\n\nfunction matchNewline(node, delta) {\n if (!deltaEndsWith(delta, '\\n')) {\n if (isLine(node) || (delta.length() > 0 && node.nextSibling && isLine(node.nextSibling))) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchSpacing(node, delta) {\n if (isLine(node) && node.nextElementSibling != null && !deltaEndsWith(delta, '\\n\\n')) {\n let nodeHeight = node.offsetHeight + parseFloat(computeStyle(node).marginTop) + parseFloat(computeStyle(node).marginBottom);\n if (node.nextElementSibling.offsetTop > node.offsetTop + nodeHeight*1.5) {\n delta.insert('\\n');\n }\n }\n return delta;\n}\n\nfunction matchStyles(node, delta) {\n let formats = {};\n let style = node.style || {};\n if (style.fontStyle && computeStyle(node).fontStyle === 'italic') {\n formats.italic = true;\n }\n if (style.fontWeight && (computeStyle(node).fontWeight.startsWith('bold') ||\n parseInt(computeStyle(node).fontWeight) >= 700)) {\n formats.bold = true;\n }\n if (Object.keys(formats).length > 0) {\n delta = applyFormat(delta, formats);\n }\n if (parseFloat(style.textIndent || 0) > 0) { // Could be 0.5in\n delta = new Delta().insert('\\t').concat(delta);\n }\n return delta;\n}\n\nfunction matchText(node, delta) {\n let text = node.data;\n // Word represents empty line with  \n if (node.parentNode.tagName === 'O:P') {\n return delta.insert(text.trim());\n }\n if (text.trim().length === 0 && node.parentNode.classList.contains('ql-clipboard')) {\n return delta;\n }\n if (!computeStyle(node.parentNode).whiteSpace.startsWith('pre')) {\n // eslint-disable-next-line func-style\n let replacer = function(collapse, match) {\n match = match.replace(/[^\\u00a0]/g, ''); // \\u00a0 is nbsp;\n return match.length < 1 && collapse ? ' ' : match;\n };\n text = text.replace(/\\r\\n/g, ' ').replace(/\\n/g, ' ');\n text = text.replace(/\\s\\s+/g, replacer.bind(replacer, true)); // collapse whitespace\n if ((node.previousSibling == null && isLine(node.parentNode)) ||\n (node.previousSibling != null && isLine(node.previousSibling))) {\n text = text.replace(/^\\s+/, replacer.bind(replacer, false));\n }\n if ((node.nextSibling == null && isLine(node.parentNode)) ||\n (node.nextSibling != null && isLine(node.nextSibling))) {\n text = text.replace(/\\s+$/, replacer.bind(replacer, false));\n }\n }\n return delta.insert(text);\n}\n\n\nexport { Clipboard as default, matchAttributor, matchBlot, matchNewline, matchSpacing, matchText };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/clipboard.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass History extends Module {\n constructor(quill, options) {\n super(quill, options);\n this.lastRecorded = 0;\n this.ignoreChange = false;\n this.clear();\n this.quill.on(Quill.events.EDITOR_CHANGE, (eventName, delta, oldDelta, source) => {\n if (eventName !== Quill.events.TEXT_CHANGE || this.ignoreChange) return;\n if (!this.options.userOnly || source === Quill.sources.USER) {\n this.record(delta, oldDelta);\n } else {\n this.transform(delta);\n }\n });\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true }, this.undo.bind(this));\n this.quill.keyboard.addBinding({ key: 'Z', shortKey: true, shiftKey: true }, this.redo.bind(this));\n if (/Win/i.test(navigator.platform)) {\n this.quill.keyboard.addBinding({ key: 'Y', shortKey: true }, this.redo.bind(this));\n }\n }\n\n change(source, dest) {\n if (this.stack[source].length === 0) return;\n let delta = this.stack[source].pop();\n this.stack[dest].push(delta);\n this.lastRecorded = 0;\n this.ignoreChange = true;\n this.quill.updateContents(delta[source], Quill.sources.USER);\n this.ignoreChange = false;\n let index = getLastChangeIndex(delta[source]);\n this.quill.setSelection(index);\n }\n\n clear() {\n this.stack = { undo: [], redo: [] };\n }\n\n cutoff() {\n this.lastRecorded = 0;\n }\n\n record(changeDelta, oldDelta) {\n if (changeDelta.ops.length === 0) return;\n this.stack.redo = [];\n let undoDelta = this.quill.getContents().diff(oldDelta);\n let timestamp = Date.now();\n if (this.lastRecorded + this.options.delay > timestamp && this.stack.undo.length > 0) {\n let delta = this.stack.undo.pop();\n undoDelta = undoDelta.compose(delta.undo);\n changeDelta = delta.redo.compose(changeDelta);\n } else {\n this.lastRecorded = timestamp;\n }\n this.stack.undo.push({\n redo: changeDelta,\n undo: undoDelta\n });\n if (this.stack.undo.length > this.options.maxStack) {\n this.stack.undo.shift();\n }\n }\n\n redo() {\n this.change('redo', 'undo');\n }\n\n transform(delta) {\n this.stack.undo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n this.stack.redo.forEach(function(change) {\n change.undo = delta.transform(change.undo, true);\n change.redo = delta.transform(change.redo, true);\n });\n }\n\n undo() {\n this.change('undo', 'redo');\n }\n}\nHistory.DEFAULTS = {\n delay: 1000,\n maxStack: 100,\n userOnly: false\n};\n\nfunction endsWithNewlineChange(delta) {\n let lastOp = delta.ops[delta.ops.length - 1];\n if (lastOp == null) return false;\n if (lastOp.insert != null) {\n return typeof lastOp.insert === 'string' && lastOp.insert.endsWith('\\n');\n }\n if (lastOp.attributes != null) {\n return Object.keys(lastOp.attributes).some(function(attr) {\n return Parchment.query(attr, Parchment.Scope.BLOCK) != null;\n });\n }\n return false;\n}\n\nfunction getLastChangeIndex(delta) {\n let deleteLength = delta.reduce(function(length, op) {\n length += (op.delete || 0);\n return length;\n }, 0);\n let changeIndex = delta.length() - deleteLength;\n if (endsWithNewlineChange(delta)) {\n changeIndex -= 1;\n }\n return changeIndex;\n}\n\n\nexport { History as default, getLastChangeIndex };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/history.js","import Parchment from 'parchment';\n\nclass IdentAttributor extends Parchment.Attributor.Class {\n add(node, value) {\n if (value === '+1' || value === '-1') {\n let indent = this.value(node) || 0;\n value = (value === '+1' ? (indent + 1) : (indent - 1));\n }\n if (value === 0) {\n this.remove(node);\n return true;\n } else {\n return super.add(node, value);\n }\n }\n\n canAdd(node, value) {\n return super.canAdd(node, value) || super.canAdd(node, parseInt(value));\n }\n\n value(node) {\n return parseInt(super.value(node)) || undefined; // Don't return NaN\n }\n}\n\nlet IndentClass = new IdentAttributor('indent', 'ql-indent', {\n scope: Parchment.Scope.BLOCK,\n whitelist: [1, 2, 3, 4, 5, 6, 7, 8]\n});\n\nexport { IndentClass };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/indent.js","import Block from '../blots/block';\n\n\nclass Blockquote extends Block {}\nBlockquote.blotName = 'blockquote';\nBlockquote.tagName = 'blockquote';\n\n\nexport default Blockquote;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/blockquote.js","import Block from '../blots/block';\n\n\nclass Header extends Block {\n static formats(domNode) {\n return this.tagName.indexOf(domNode.tagName) + 1;\n }\n}\nHeader.blotName = 'header';\nHeader.tagName = ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'];\n\n\nexport default Header;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/header.js","import Parchment from 'parchment';\nimport Block from '../blots/block';\nimport Container from '../blots/container';\n\n\nclass ListItem extends Block {\n static formats(domNode) {\n return domNode.tagName === this.tagName ? undefined : super.formats(domNode);\n }\n\n format(name, value) {\n if (name === List.blotName && !value) {\n this.replaceWith(Parchment.create(this.statics.scope));\n } else {\n super.format(name, value);\n }\n }\n\n remove() {\n if (this.prev == null && this.next == null) {\n this.parent.remove();\n } else {\n super.remove();\n }\n }\n\n replaceWith(name, value) {\n this.parent.isolate(this.offset(this.parent), this.length());\n if (name === this.parent.statics.blotName) {\n this.parent.replaceWith(name, value);\n return this;\n } else {\n this.parent.unwrap();\n return super.replaceWith(name, value);\n }\n }\n}\nListItem.blotName = 'list-item';\nListItem.tagName = 'LI';\n\n\nclass List extends Container {\n static create(value) {\n let tagName = value === 'ordered' ? 'OL' : 'UL';\n let node = super.create(tagName);\n if (value === 'checked' || value === 'unchecked') {\n node.setAttribute('data-checked', value === 'checked');\n }\n return node;\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'OL') return 'ordered';\n if (domNode.tagName === 'UL') {\n if (domNode.hasAttribute('data-checked')) {\n return domNode.getAttribute('data-checked') === 'true' ? 'checked' : 'unchecked';\n } else {\n return 'bullet';\n }\n }\n return undefined;\n }\n\n constructor(domNode) {\n super(domNode);\n const listEventHandler = (e) => {\n if (e.target.parentNode !== domNode) return;\n let format = this.statics.formats(domNode);\n let blot = Parchment.find(e.target);\n if (format === 'checked') {\n blot.format('list', 'unchecked');\n } else if(format === 'unchecked') {\n blot.format('list', 'checked');\n }\n }\n\n domNode.addEventListener('touchstart', listEventHandler);\n domNode.addEventListener('mousedown', listEventHandler);\n }\n\n format(name, value) {\n if (this.children.length > 0) {\n this.children.tail.format(name, value);\n }\n }\n\n formats() {\n // We don't inherit from FormatBlot\n return { [this.statics.blotName]: this.statics.formats(this.domNode) };\n }\n\n insertBefore(blot, ref) {\n if (blot instanceof ListItem) {\n super.insertBefore(blot, ref);\n } else {\n let index = ref == null ? this.length() : ref.offset(this);\n let after = this.split(index);\n after.parent.insertBefore(blot, after);\n }\n }\n\n optimize(context) {\n super.optimize(context);\n let next = this.next;\n if (next != null && next.prev === this &&\n next.statics.blotName === this.statics.blotName &&\n next.domNode.tagName === this.domNode.tagName &&\n next.domNode.getAttribute('data-checked') === this.domNode.getAttribute('data-checked')) {\n next.moveChildren(this);\n next.remove();\n }\n }\n\n replace(target) {\n if (target.statics.blotName !== this.statics.blotName) {\n let item = Parchment.create(this.statics.defaultChild);\n target.moveChildren(item);\n this.appendChild(item);\n }\n super.replace(target);\n }\n}\nList.blotName = 'list';\nList.scope = Parchment.Scope.BLOCK_BLOT;\nList.tagName = ['OL', 'UL'];\nList.defaultChild = 'list-item';\nList.allowedChildren = [ListItem];\n\n\nexport { ListItem, List as default };\n\n\n\n// WEBPACK FOOTER //\n// ./formats/list.js","import Bold from './bold';\n\nclass Italic extends Bold { }\nItalic.blotName = 'italic';\nItalic.tagName = ['EM', 'I'];\n\nexport default Italic;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/italic.js","import Inline from '../blots/inline';\n\nclass Script extends Inline {\n static create(value) {\n if (value === 'super') {\n return document.createElement('sup');\n } else if (value === 'sub') {\n return document.createElement('sub');\n } else {\n return super.create(value);\n }\n }\n\n static formats(domNode) {\n if (domNode.tagName === 'SUB') return 'sub';\n if (domNode.tagName === 'SUP') return 'super';\n return undefined;\n }\n}\nScript.blotName = 'script';\nScript.tagName = ['SUB', 'SUP'];\n\nexport default Script;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/script.js","import Inline from '../blots/inline';\n\nclass Strike extends Inline { }\nStrike.blotName = 'strike';\nStrike.tagName = 'S';\n\nexport default Strike;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/strike.js","import Inline from '../blots/inline';\n\nclass Underline extends Inline { }\nUnderline.blotName = 'underline';\nUnderline.tagName = 'U';\n\nexport default Underline;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/underline.js","import Parchment from 'parchment';\nimport { sanitize } from '../formats/link';\n\nconst ATTRIBUTES = [\n 'alt',\n 'height',\n 'width'\n];\n\n\nclass Image extends Parchment.Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n node.setAttribute('src', this.sanitize(value));\n }\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static match(url) {\n return /\\.(jpe?g|gif|png)$/.test(url) || /^data:image\\/.+;base64/.test(url);\n }\n\n static sanitize(url) {\n return sanitize(url, ['http', 'https', 'data']) ? url : '//:0';\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nImage.blotName = 'image';\nImage.tagName = 'IMG';\n\n\nexport default Image;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/image.js","import { BlockEmbed } from '../blots/block';\nimport Link from '../formats/link';\n\nconst ATTRIBUTES = [\n 'height',\n 'width'\n];\n\n\nclass Video extends BlockEmbed {\n static create(value) {\n let node = super.create(value);\n node.setAttribute('frameborder', '0');\n node.setAttribute('allowfullscreen', true);\n node.setAttribute('src', this.sanitize(value));\n return node;\n }\n\n static formats(domNode) {\n return ATTRIBUTES.reduce(function(formats, attribute) {\n if (domNode.hasAttribute(attribute)) {\n formats[attribute] = domNode.getAttribute(attribute);\n }\n return formats;\n }, {});\n }\n\n static sanitize(url) {\n return Link.sanitize(url);\n }\n\n static value(domNode) {\n return domNode.getAttribute('src');\n }\n\n format(name, value) {\n if (ATTRIBUTES.indexOf(name) > -1) {\n if (value) {\n this.domNode.setAttribute(name, value);\n } else {\n this.domNode.removeAttribute(name);\n }\n } else {\n super.format(name, value);\n }\n }\n}\nVideo.blotName = 'video';\nVideo.className = 'ql-video';\nVideo.tagName = 'IFRAME';\n\n\nexport default Video;\n\n\n\n// WEBPACK FOOTER //\n// ./formats/video.js","import Embed from '../blots/embed';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\n\n\nclass FormulaBlot extends Embed {\n static create(value) {\n let node = super.create(value);\n if (typeof value === 'string') {\n window.katex.render(value, node, {\n throwOnError: false,\n errorColor: '#f00'\n });\n node.setAttribute('data-value', value);\n }\n return node;\n }\n\n static value(domNode) {\n return domNode.getAttribute('data-value');\n }\n}\nFormulaBlot.blotName = 'formula';\nFormulaBlot.className = 'ql-formula';\nFormulaBlot.tagName = 'SPAN';\n\n\nclass Formula extends Module {\n static register() {\n Quill.register(FormulaBlot, true);\n }\n\n constructor() {\n super();\n if (window.katex == null) {\n throw new Error('Formula module requires KaTeX.');\n }\n }\n}\n\n\nexport { FormulaBlot, Formula as default };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/formula.js","import Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport Module from '../core/module';\nimport CodeBlock from '../formats/code';\n\n\nclass SyntaxCodeBlock extends CodeBlock {\n replaceWith(block) {\n this.domNode.textContent = this.domNode.textContent;\n this.attach();\n super.replaceWith(block);\n }\n\n highlight(highlight) {\n let text = this.domNode.textContent;\n if (this.cachedText !== text) {\n if (text.trim().length > 0 || this.cachedText == null) {\n this.domNode.innerHTML = highlight(text);\n this.domNode.normalize();\n this.attach();\n }\n this.cachedText = text;\n }\n }\n}\nSyntaxCodeBlock.className = 'ql-syntax';\n\n\nlet CodeToken = new Parchment.Attributor.Class('token', 'hljs', {\n scope: Parchment.Scope.INLINE\n});\n\n\nclass Syntax extends Module {\n static register() {\n Quill.register(CodeToken, true);\n Quill.register(SyntaxCodeBlock, true);\n }\n\n constructor(quill, options) {\n super(quill, options);\n if (typeof this.options.highlight !== 'function') {\n throw new Error('Syntax module requires highlight.js. Please include the library on the page before Quill.');\n }\n let timer = null;\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n this.highlight();\n timer = null;\n }, this.options.interval);\n });\n this.highlight();\n }\n\n highlight() {\n if (this.quill.selection.composing) return;\n this.quill.update(Quill.sources.USER);\n let range = this.quill.getSelection();\n this.quill.scroll.descendants(SyntaxCodeBlock).forEach((code) => {\n code.highlight(this.options.highlight);\n });\n this.quill.update(Quill.sources.SILENT);\n if (range != null) {\n this.quill.setSelection(range, Quill.sources.SILENT);\n }\n }\n}\nSyntax.DEFAULTS = {\n highlight: (function() {\n if (window.hljs == null) return null;\n return function(text) {\n let result = window.hljs.highlightAuto(text);\n return result.value;\n };\n })(),\n interval: 1000\n};\n\n\nexport { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default};\n\n\n\n// WEBPACK FOOTER //\n// ./modules/syntax.js","import Delta from 'quill-delta';\nimport Parchment from 'parchment';\nimport Quill from '../core/quill';\nimport logger from '../core/logger';\nimport Module from '../core/module';\n\nlet debug = logger('quill:toolbar');\n\n\nclass Toolbar extends Module {\n constructor(quill, options) {\n super(quill, options);\n if (Array.isArray(this.options.container)) {\n let container = document.createElement('div');\n addControls(container, this.options.container);\n quill.container.parentNode.insertBefore(container, quill.container);\n this.container = container;\n } else if (typeof this.options.container === 'string') {\n this.container = document.querySelector(this.options.container);\n } else {\n this.container = this.options.container;\n }\n if (!(this.container instanceof HTMLElement)) {\n return debug.error('Container required for toolbar', this.options);\n }\n this.container.classList.add('ql-toolbar');\n this.controls = [];\n this.handlers = {};\n Object.keys(this.options.handlers).forEach((format) => {\n this.addHandler(format, this.options.handlers[format]);\n });\n [].forEach.call(this.container.querySelectorAll('button, select'), (input) => {\n this.attach(input);\n });\n this.quill.on(Quill.events.EDITOR_CHANGE, (type, range) => {\n if (type === Quill.events.SELECTION_CHANGE) {\n this.update(range);\n }\n });\n this.quill.on(Quill.events.SCROLL_OPTIMIZE, () => {\n let [range, ] = this.quill.selection.getRange(); // quill.getSelection triggers update\n this.update(range);\n });\n }\n\n addHandler(format, handler) {\n this.handlers[format] = handler;\n }\n\n attach(input) {\n let format = [].find.call(input.classList, (className) => {\n return className.indexOf('ql-') === 0;\n });\n if (!format) return;\n format = format.slice('ql-'.length);\n if (input.tagName === 'BUTTON') {\n input.setAttribute('type', 'button');\n }\n if (this.handlers[format] == null) {\n if (this.quill.scroll.whitelist != null && this.quill.scroll.whitelist[format] == null) {\n debug.warn('ignoring attaching to disabled format', format, input);\n return;\n }\n if (Parchment.query(format) == null) {\n debug.warn('ignoring attaching to nonexistent format', format, input);\n return;\n }\n }\n let eventName = input.tagName === 'SELECT' ? 'change' : 'click';\n input.addEventListener(eventName, (e) => {\n let value;\n if (input.tagName === 'SELECT') {\n if (input.selectedIndex < 0) return;\n let selected = input.options[input.selectedIndex];\n if (selected.hasAttribute('selected')) {\n value = false;\n } else {\n value = selected.value || false;\n }\n } else {\n if (input.classList.contains('ql-active')) {\n value = false;\n } else {\n value = input.value || !input.hasAttribute('value');\n }\n e.preventDefault();\n }\n this.quill.focus();\n let [range, ] = this.quill.selection.getRange();\n if (this.handlers[format] != null) {\n this.handlers[format].call(this, value);\n } else if (Parchment.query(format).prototype instanceof Parchment.Embed) {\n value = prompt(`Enter ${format}`);\n if (!value) return;\n this.quill.updateContents(new Delta()\n .retain(range.index)\n .delete(range.length)\n .insert({ [format]: value })\n , Quill.sources.USER);\n } else {\n this.quill.format(format, value, Quill.sources.USER);\n }\n this.update(range);\n });\n // TODO use weakmap\n this.controls.push([format, input]);\n }\n\n update(range) {\n let formats = range == null ? {} : this.quill.getFormat(range);\n this.controls.forEach(function(pair) {\n let [format, input] = pair;\n if (input.tagName === 'SELECT') {\n let option;\n if (range == null) {\n option = null;\n } else if (formats[format] == null) {\n option = input.querySelector('option[selected]');\n } else if (!Array.isArray(formats[format])) {\n let value = formats[format];\n if (typeof value === 'string') {\n value = value.replace(/\\\"/g, '\\\\\"');\n }\n option = input.querySelector(`option[value=\"${value}\"]`);\n }\n if (option == null) {\n input.value = ''; // TODO make configurable?\n input.selectedIndex = -1;\n } else {\n option.selected = true;\n }\n } else {\n if (range == null) {\n input.classList.remove('ql-active');\n } else if (input.hasAttribute('value')) {\n // both being null should match (default values)\n // '1' should match with 1 (headers)\n let isActive = formats[format] === input.getAttribute('value') ||\n (formats[format] != null && formats[format].toString() === input.getAttribute('value')) ||\n (formats[format] == null && !input.getAttribute('value'));\n input.classList.toggle('ql-active', isActive);\n } else {\n input.classList.toggle('ql-active', formats[format] != null);\n }\n }\n });\n }\n}\nToolbar.DEFAULTS = {};\n\n\nfunction addButton(container, format, value) {\n let input = document.createElement('button');\n input.setAttribute('type', 'button');\n input.classList.add('ql-' + format);\n if (value != null) {\n input.value = value;\n }\n container.appendChild(input);\n}\n\nfunction addControls(container, groups) {\n if (!Array.isArray(groups[0])) {\n groups = [groups];\n }\n groups.forEach(function(controls) {\n let group = document.createElement('span');\n group.classList.add('ql-formats');\n controls.forEach(function(control) {\n if (typeof control === 'string') {\n addButton(group, control);\n } else {\n let format = Object.keys(control)[0];\n let value = control[format];\n if (Array.isArray(value)) {\n addSelect(group, format, value);\n } else {\n addButton(group, format, value);\n }\n }\n });\n container.appendChild(group);\n });\n}\n\nfunction addSelect(container, format, values) {\n let input = document.createElement('select');\n input.classList.add('ql-' + format);\n values.forEach(function(value) {\n let option = document.createElement('option');\n if (value !== false) {\n option.setAttribute('value', value);\n } else {\n option.setAttribute('selected', 'selected');\n }\n input.appendChild(option);\n });\n container.appendChild(input);\n}\n\nToolbar.DEFAULTS = {\n container: null,\n handlers: {\n clean: function() {\n let range = this.quill.getSelection();\n if (range == null) return;\n if (range.length == 0) {\n let formats = this.quill.getFormat();\n Object.keys(formats).forEach((name) => {\n // Clean functionality in existing apps only clean inline formats\n if (Parchment.query(name, Parchment.Scope.INLINE) != null) {\n this.quill.format(name, false);\n }\n });\n } else {\n this.quill.removeFormat(range, Quill.sources.USER);\n }\n },\n direction: function(value) {\n let align = this.quill.getFormat()['align'];\n if (value === 'rtl' && align == null) {\n this.quill.format('align', 'right', Quill.sources.USER);\n } else if (!value && align === 'right') {\n this.quill.format('align', false, Quill.sources.USER);\n }\n this.quill.format('direction', value, Quill.sources.USER);\n },\n indent: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n let indent = parseInt(formats.indent || 0);\n if (value === '+1' || value === '-1') {\n let modifier = (value === '+1') ? 1 : -1;\n if (formats.direction === 'rtl') modifier *= -1;\n this.quill.format('indent', indent + modifier, Quill.sources.USER);\n }\n },\n link: function(value) {\n if (value === true) {\n value = prompt('Enter link URL:');\n }\n this.quill.format('link', value, Quill.sources.USER);\n },\n list: function(value) {\n let range = this.quill.getSelection();\n let formats = this.quill.getFormat(range);\n if (value === 'check') {\n if (formats['list'] === 'checked' || formats['list'] === 'unchecked') {\n this.quill.format('list', false, Quill.sources.USER);\n } else {\n this.quill.format('list', 'unchecked', Quill.sources.USER);\n }\n } else {\n this.quill.format('list', value, Quill.sources.USER);\n }\n }\n }\n}\n\n\nexport { Toolbar as default, addControls };\n\n\n\n// WEBPACK FOOTER //\n// ./modules/toolbar.js","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-left.svg\n// module id = 75\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-center.svg\n// module id = 76\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-right.svg\n// module id = 77\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/align-justify.svg\n// module id = 78\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/background.svg\n// module id = 79\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/blockquote.svg\n// module id = 80\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/bold.svg\n// module id = 81\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/clean.svg\n// module id = 82\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/color.svg\n// module id = 83\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-ltr.svg\n// module id = 84\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/direction-rtl.svg\n// module id = 85\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-center.svg\n// module id = 86\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-full.svg\n// module id = 87\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-left.svg\n// module id = 88\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/float-right.svg\n// module id = 89\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/formula.svg\n// module id = 90\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header.svg\n// module id = 91\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/header-2.svg\n// module id = 92\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/italic.svg\n// module id = 93\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/image.svg\n// module id = 94\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/indent.svg\n// module id = 95\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/outdent.svg\n// module id = 96\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/link.svg\n// module id = 97\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-ordered.svg\n// module id = 98\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-bullet.svg\n// module id = 99\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/list-check.svg\n// module id = 100\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/subscript.svg\n// module id = 101\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/superscript.svg\n// module id = 102\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/strike.svg\n// module id = 103\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/underline.svg\n// module id = 104\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/video.svg\n// module id = 105\n// module chunks = 0","module.exports = \" \";\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./assets/icons/dropdown.svg\n// module id = 106\n// module chunks = 0","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n ['bold', 'italic', 'link'],\n [{ header: 1 }, { header: 2 }, 'blockquote']\n];\n\nclass BubbleTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-bubble');\n }\n\n extendToolbar(toolbar) {\n this.tooltip = new BubbleTooltip(this.quill, this.options.bounds);\n this.tooltip.root.appendChild(toolbar.container);\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n }\n}\nBubbleTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (!value) {\n this.quill.format('link', false);\n } else {\n this.quill.theme.tooltip.edit();\n }\n }\n }\n }\n }\n});\n\n\nclass BubbleTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.quill.on(Emitter.events.EDITOR_CHANGE, (type, range, oldRange, source) => {\n if (type !== Emitter.events.SELECTION_CHANGE) return;\n if (range != null && range.length > 0 && source === Emitter.sources.USER) {\n this.show();\n // Lock our width so we will expand beyond our offsetParent boundaries\n this.root.style.left = '0px';\n this.root.style.width = '';\n this.root.style.width = this.root.offsetWidth + 'px';\n let lines = this.quill.getLines(range.index, range.length);\n if (lines.length === 1) {\n this.position(this.quill.getBounds(range));\n } else {\n let lastLine = lines[lines.length - 1];\n let index = this.quill.getIndex(lastLine);\n let length = Math.min(lastLine.length() - 1, range.index + range.length - index);\n let bounds = this.quill.getBounds(new Range(index, length));\n this.position(bounds);\n }\n } else if (document.activeElement !== this.textbox && this.quill.hasFocus()) {\n this.hide();\n }\n });\n }\n\n listen() {\n super.listen();\n this.root.querySelector('.ql-close').addEventListener('click', () => {\n this.root.classList.remove('ql-editing');\n });\n this.quill.on(Emitter.events.SCROLL_OPTIMIZE, () => {\n // Let selection be restored by toolbar handlers before repositioning\n setTimeout(() => {\n if (this.root.classList.contains('ql-hidden')) return;\n let range = this.quill.getSelection();\n if (range != null) {\n this.position(this.quill.getBounds(range));\n }\n }, 1);\n });\n }\n\n cancel() {\n this.show();\n }\n\n position(reference) {\n let shift = super.position(reference);\n let arrow = this.root.querySelector('.ql-tooltip-arrow');\n arrow.style.marginLeft = '';\n if (shift === 0) return shift;\n arrow.style.marginLeft = (-1*shift - arrow.offsetWidth/2) + 'px';\n }\n}\nBubbleTooltip.TEMPLATE = [\n '',\n '
',\n '',\n '',\n '
'\n].join('');\n\n\nexport { BubbleTooltip, BubbleTheme as default };\n\n\n\n// WEBPACK FOOTER //\n// ./themes/bubble.js","import extend from 'extend';\nimport Emitter from '../core/emitter';\nimport BaseTheme, { BaseTooltip } from './base';\nimport LinkBlot from '../formats/link';\nimport { Range } from '../core/selection';\nimport icons from '../ui/icons';\n\n\nconst TOOLBAR_CONFIG = [\n [{ header: ['1', '2', '3', false] }],\n ['bold', 'italic', 'underline', 'link'],\n [{ list: 'ordered' }, { list: 'bullet' }],\n ['clean']\n];\n\nclass SnowTheme extends BaseTheme {\n constructor(quill, options) {\n if (options.modules.toolbar != null && options.modules.toolbar.container == null) {\n options.modules.toolbar.container = TOOLBAR_CONFIG;\n }\n super(quill, options);\n this.quill.container.classList.add('ql-snow');\n }\n\n extendToolbar(toolbar) {\n toolbar.container.classList.add('ql-snow');\n this.buildButtons([].slice.call(toolbar.container.querySelectorAll('button')), icons);\n this.buildPickers([].slice.call(toolbar.container.querySelectorAll('select')), icons);\n this.tooltip = new SnowTooltip(this.quill, this.options.bounds);\n if (toolbar.container.querySelector('.ql-link')) {\n this.quill.keyboard.addBinding({ key: 'K', shortKey: true }, function(range, context) {\n toolbar.handlers['link'].call(toolbar, !context.format.link);\n });\n }\n }\n}\nSnowTheme.DEFAULTS = extend(true, {}, BaseTheme.DEFAULTS, {\n modules: {\n toolbar: {\n handlers: {\n link: function(value) {\n if (value) {\n let range = this.quill.getSelection();\n if (range == null || range.length == 0) return;\n let preview = this.quill.getText(range);\n if (/^\\S+@\\S+\\.\\S+$/.test(preview) && preview.indexOf('mailto:') !== 0) {\n preview = 'mailto:' + preview;\n }\n let tooltip = this.quill.theme.tooltip;\n tooltip.edit('link', preview);\n } else {\n this.quill.format('link', false);\n }\n }\n }\n }\n }\n});\n\n\nclass SnowTooltip extends BaseTooltip {\n constructor(quill, bounds) {\n super(quill, bounds);\n this.preview = this.root.querySelector('a.ql-preview');\n }\n\n listen() {\n super.listen();\n this.root.querySelector('a.ql-action').addEventListener('click', (event) => {\n if (this.root.classList.contains('ql-editing')) {\n this.save();\n } else {\n this.edit('link', this.preview.textContent);\n }\n event.preventDefault();\n });\n this.root.querySelector('a.ql-remove').addEventListener('click', (event) => {\n if (this.linkRange != null) {\n let range = this.linkRange;\n this.restoreFocus();\n this.quill.formatText(range, 'link', false, Emitter.sources.USER);\n delete this.linkRange;\n }\n event.preventDefault();\n this.hide();\n });\n this.quill.on(Emitter.events.SELECTION_CHANGE, (range, oldRange, source) => {\n if (range == null) return;\n if (range.length === 0 && source === Emitter.sources.USER) {\n let [link, offset] = this.quill.scroll.descendant(LinkBlot, range.index);\n if (link != null) {\n this.linkRange = new Range(range.index - offset, link.length());\n let preview = LinkBlot.formats(link.domNode);\n this.preview.textContent = preview;\n this.preview.setAttribute('href', preview);\n this.show();\n this.position(this.quill.getBounds(this.linkRange));\n return;\n }\n } else {\n delete this.linkRange;\n }\n this.hide();\n });\n }\n\n show() {\n super.show();\n this.root.removeAttribute('data-mode');\n }\n}\nSnowTooltip.TEMPLATE = [\n '',\n '',\n '',\n ''\n].join('');\n\n\nexport default SnowTheme;\n\n\n\n// WEBPACK FOOTER //\n// ./themes/snow.js"],"sourceRoot":""} \ No newline at end of file diff --git a/static/quill/quill.snow.css b/static/quill/quill.snow.css new file mode 100644 index 00000000..184ae7b1 --- /dev/null +++ b/static/quill/quill.snow.css @@ -0,0 +1,945 @@ +/*! + * Quill Editor v1.3.5 + * https://quilljs.com/ + * Copyright (c) 2014, Jason Chen + * Copyright (c) 2013, salesforce.com + */ +.ql-container { + box-sizing: border-box; + font-family: Helvetica, Arial, sans-serif; + font-size: 13px; + height: 100%; + margin: 0px; + position: relative; +} +.ql-container.ql-disabled .ql-tooltip { + visibility: hidden; +} +.ql-container.ql-disabled .ql-editor ul[data-checked] > li::before { + pointer-events: none; +} +.ql-clipboard { + left: -100000px; + height: 1px; + overflow-y: hidden; + position: absolute; + top: 50%; +} +.ql-clipboard p { + margin: 0; + padding: 0; +} +.ql-editor { + box-sizing: border-box; + line-height: 1.42; + height: 100%; + outline: none; + overflow-y: auto; + padding: 12px 15px; + tab-size: 4; + -moz-tab-size: 4; + text-align: left; + white-space: pre-wrap; + word-wrap: break-word; +} +.ql-editor > * { + cursor: text; +} +.ql-editor p, +.ql-editor ol, +.ql-editor ul, +.ql-editor pre, +.ql-editor blockquote, +.ql-editor h1, +.ql-editor h2, +.ql-editor h3, +.ql-editor h4, +.ql-editor h5, +.ql-editor h6 { + margin: 0; + padding: 0; + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol, +.ql-editor ul { + padding-left: 1.5em; +} +.ql-editor ol > li, +.ql-editor ul > li { + list-style-type: none; +} +.ql-editor ul > li::before { + content: '\2022'; +} +.ql-editor ul[data-checked=true], +.ql-editor ul[data-checked=false] { + pointer-events: none; +} +.ql-editor ul[data-checked=true] > li *, +.ql-editor ul[data-checked=false] > li * { + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before, +.ql-editor ul[data-checked=false] > li::before { + color: #777; + cursor: pointer; + pointer-events: all; +} +.ql-editor ul[data-checked=true] > li::before { + content: '\2611'; +} +.ql-editor ul[data-checked=false] > li::before { + content: '\2610'; +} +.ql-editor li::before { + display: inline-block; + white-space: nowrap; + width: 1.2em; +} +.ql-editor li:not(.ql-direction-rtl)::before { + margin-left: -1.5em; + margin-right: 0.3em; + text-align: right; +} +.ql-editor li.ql-direction-rtl::before { + margin-left: 0.3em; + margin-right: -1.5em; +} +.ql-editor ol li:not(.ql-direction-rtl), +.ql-editor ul li:not(.ql-direction-rtl) { + padding-left: 1.5em; +} +.ql-editor ol li.ql-direction-rtl, +.ql-editor ul li.ql-direction-rtl { + padding-right: 1.5em; +} +.ql-editor ol li { + counter-reset: list-1 list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; + counter-increment: list-0; +} +.ql-editor ol li:before { + content: counter(list-0, decimal) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-increment: list-1; +} +.ql-editor ol li.ql-indent-1:before { + content: counter(list-1, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-1 { + counter-reset: list-2 list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-2 { + counter-increment: list-2; +} +.ql-editor ol li.ql-indent-2:before { + content: counter(list-2, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-2 { + counter-reset: list-3 list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-3 { + counter-increment: list-3; +} +.ql-editor ol li.ql-indent-3:before { + content: counter(list-3, decimal) '. '; +} +.ql-editor ol li.ql-indent-3 { + counter-reset: list-4 list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-4 { + counter-increment: list-4; +} +.ql-editor ol li.ql-indent-4:before { + content: counter(list-4, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-4 { + counter-reset: list-5 list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-5 { + counter-increment: list-5; +} +.ql-editor ol li.ql-indent-5:before { + content: counter(list-5, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-5 { + counter-reset: list-6 list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-6 { + counter-increment: list-6; +} +.ql-editor ol li.ql-indent-6:before { + content: counter(list-6, decimal) '. '; +} +.ql-editor ol li.ql-indent-6 { + counter-reset: list-7 list-8 list-9; +} +.ql-editor ol li.ql-indent-7 { + counter-increment: list-7; +} +.ql-editor ol li.ql-indent-7:before { + content: counter(list-7, lower-alpha) '. '; +} +.ql-editor ol li.ql-indent-7 { + counter-reset: list-8 list-9; +} +.ql-editor ol li.ql-indent-8 { + counter-increment: list-8; +} +.ql-editor ol li.ql-indent-8:before { + content: counter(list-8, lower-roman) '. '; +} +.ql-editor ol li.ql-indent-8 { + counter-reset: list-9; +} +.ql-editor ol li.ql-indent-9 { + counter-increment: list-9; +} +.ql-editor ol li.ql-indent-9:before { + content: counter(list-9, decimal) '. '; +} +.ql-editor .ql-indent-1:not(.ql-direction-rtl) { + padding-left: 3em; +} +.ql-editor li.ql-indent-1:not(.ql-direction-rtl) { + padding-left: 4.5em; +} +.ql-editor .ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 3em; +} +.ql-editor li.ql-indent-1.ql-direction-rtl.ql-align-right { + padding-right: 4.5em; +} +.ql-editor .ql-indent-2:not(.ql-direction-rtl) { + padding-left: 6em; +} +.ql-editor li.ql-indent-2:not(.ql-direction-rtl) { + padding-left: 7.5em; +} +.ql-editor .ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 6em; +} +.ql-editor li.ql-indent-2.ql-direction-rtl.ql-align-right { + padding-right: 7.5em; +} +.ql-editor .ql-indent-3:not(.ql-direction-rtl) { + padding-left: 9em; +} +.ql-editor li.ql-indent-3:not(.ql-direction-rtl) { + padding-left: 10.5em; +} +.ql-editor .ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 9em; +} +.ql-editor li.ql-indent-3.ql-direction-rtl.ql-align-right { + padding-right: 10.5em; +} +.ql-editor .ql-indent-4:not(.ql-direction-rtl) { + padding-left: 12em; +} +.ql-editor li.ql-indent-4:not(.ql-direction-rtl) { + padding-left: 13.5em; +} +.ql-editor .ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 12em; +} +.ql-editor li.ql-indent-4.ql-direction-rtl.ql-align-right { + padding-right: 13.5em; +} +.ql-editor .ql-indent-5:not(.ql-direction-rtl) { + padding-left: 15em; +} +.ql-editor li.ql-indent-5:not(.ql-direction-rtl) { + padding-left: 16.5em; +} +.ql-editor .ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 15em; +} +.ql-editor li.ql-indent-5.ql-direction-rtl.ql-align-right { + padding-right: 16.5em; +} +.ql-editor .ql-indent-6:not(.ql-direction-rtl) { + padding-left: 18em; +} +.ql-editor li.ql-indent-6:not(.ql-direction-rtl) { + padding-left: 19.5em; +} +.ql-editor .ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 18em; +} +.ql-editor li.ql-indent-6.ql-direction-rtl.ql-align-right { + padding-right: 19.5em; +} +.ql-editor .ql-indent-7:not(.ql-direction-rtl) { + padding-left: 21em; +} +.ql-editor li.ql-indent-7:not(.ql-direction-rtl) { + padding-left: 22.5em; +} +.ql-editor .ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 21em; +} +.ql-editor li.ql-indent-7.ql-direction-rtl.ql-align-right { + padding-right: 22.5em; +} +.ql-editor .ql-indent-8:not(.ql-direction-rtl) { + padding-left: 24em; +} +.ql-editor li.ql-indent-8:not(.ql-direction-rtl) { + padding-left: 25.5em; +} +.ql-editor .ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 24em; +} +.ql-editor li.ql-indent-8.ql-direction-rtl.ql-align-right { + padding-right: 25.5em; +} +.ql-editor .ql-indent-9:not(.ql-direction-rtl) { + padding-left: 27em; +} +.ql-editor li.ql-indent-9:not(.ql-direction-rtl) { + padding-left: 28.5em; +} +.ql-editor .ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 27em; +} +.ql-editor li.ql-indent-9.ql-direction-rtl.ql-align-right { + padding-right: 28.5em; +} +.ql-editor .ql-video { + display: block; + max-width: 100%; +} +.ql-editor .ql-video.ql-align-center { + margin: 0 auto; +} +.ql-editor .ql-video.ql-align-right { + margin: 0 0 0 auto; +} +.ql-editor .ql-bg-black { + background-color: #000; +} +.ql-editor .ql-bg-red { + background-color: #e60000; +} +.ql-editor .ql-bg-orange { + background-color: #f90; +} +.ql-editor .ql-bg-yellow { + background-color: #ff0; +} +.ql-editor .ql-bg-green { + background-color: #008a00; +} +.ql-editor .ql-bg-blue { + background-color: #4b4b4b; +} +.ql-editor .ql-bg-purple { + background-color: #93f; +} +.ql-editor .ql-color-white { + color: #fff; +} +.ql-editor .ql-color-red { + color: #e60000; +} +.ql-editor .ql-color-orange { + color: #f90; +} +.ql-editor .ql-color-yellow { + color: #ff0; +} +.ql-editor .ql-color-green { + color: #008a00; +} +.ql-editor .ql-color-blue { + color: #4b4b4b; +} +.ql-editor .ql-color-purple { + color: #93f; +} +.ql-editor .ql-font-serif { + font-family: Georgia, Times New Roman, serif; +} +.ql-editor .ql-font-monospace { + font-family: Monaco, Courier New, monospace; +} +.ql-editor .ql-size-small { + font-size: 0.75em; +} +.ql-editor .ql-size-large { + font-size: 1.5em; +} +.ql-editor .ql-size-huge { + font-size: 2.5em; +} +.ql-editor .ql-direction-rtl { + direction: rtl; + text-align: inherit; +} +.ql-editor .ql-align-center { + text-align: center; +} +.ql-editor .ql-align-justify { + text-align: justify; +} +.ql-editor .ql-align-right { + text-align: right; +} +.ql-editor.ql-blank::before { + color: rgba(0,0,0,0.6); + content: attr(data-placeholder); + font-style: italic; + left: 15px; + pointer-events: none; + position: absolute; + right: 15px; +} +.ql-snow.ql-toolbar:after, +.ql-snow .ql-toolbar:after { + clear: both; + content: ''; + display: table; +} +.ql-snow.ql-toolbar button, +.ql-snow .ql-toolbar button { + background: none; + border: none; + cursor: pointer; + display: inline-block; + float: left; + height: 24px; + padding: 3px 5px; + width: 28px; +} +.ql-snow.ql-toolbar button svg, +.ql-snow .ql-toolbar button svg { + float: left; + height: 100%; +} +.ql-snow.ql-toolbar button:active:hover, +.ql-snow .ql-toolbar button:active:hover { + outline: none; +} +.ql-snow.ql-toolbar input.ql-image[type=file], +.ql-snow .ql-toolbar input.ql-image[type=file] { + display: none; +} +.ql-snow.ql-toolbar button:hover, +.ql-snow .ql-toolbar button:hover, +.ql-snow.ql-toolbar button:focus, +.ql-snow .ql-toolbar button:focus, +.ql-snow.ql-toolbar button.ql-active, +.ql-snow .ql-toolbar button.ql-active, +.ql-snow.ql-toolbar .ql-picker-label:hover, +.ql-snow .ql-toolbar .ql-picker-label:hover, +.ql-snow.ql-toolbar .ql-picker-label.ql-active, +.ql-snow .ql-toolbar .ql-picker-label.ql-active, +.ql-snow.ql-toolbar .ql-picker-item:hover, +.ql-snow .ql-toolbar .ql-picker-item:hover, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected { + color: #4b4b4b; +} +.ql-snow.ql-toolbar button:hover .ql-fill, +.ql-snow .ql-toolbar button:hover .ql-fill, +.ql-snow.ql-toolbar button:focus .ql-fill, +.ql-snow .ql-toolbar button:focus .ql-fill, +.ql-snow.ql-toolbar button.ql-active .ql-fill, +.ql-snow .ql-toolbar button.ql-active .ql-fill, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-fill, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-fill, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-fill, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-fill, +.ql-snow.ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button:focus .ql-stroke.ql-fill, +.ql-snow.ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-snow .ql-toolbar button.ql-active .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke.ql-fill, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke.ql-fill { + fill: #4b4b4b; +} +.ql-snow.ql-toolbar button:hover .ql-stroke, +.ql-snow .ql-toolbar button:hover .ql-stroke, +.ql-snow.ql-toolbar button:focus .ql-stroke, +.ql-snow .ql-toolbar button:focus .ql-stroke, +.ql-snow.ql-toolbar button.ql-active .ql-stroke, +.ql-snow .ql-toolbar button.ql-active .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke, +.ql-snow.ql-toolbar button:hover .ql-stroke-miter, +.ql-snow .ql-toolbar button:hover .ql-stroke-miter, +.ql-snow.ql-toolbar button:focus .ql-stroke-miter, +.ql-snow .ql-toolbar button:focus .ql-stroke-miter, +.ql-snow.ql-toolbar button.ql-active .ql-stroke-miter, +.ql-snow .ql-toolbar button.ql-active .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-label:hover .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-label.ql-active .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-item:hover .ql-stroke-miter, +.ql-snow.ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter, +.ql-snow .ql-toolbar .ql-picker-item.ql-selected .ql-stroke-miter { + stroke: #4b4b4b; +} +@media (pointer: coarse) { + .ql-snow.ql-toolbar button:hover:not(.ql-active), + .ql-snow .ql-toolbar button:hover:not(.ql-active) { + color: #444; + } + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-fill, + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke.ql-fill { + fill: #444; + } + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke, + .ql-snow.ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter, + .ql-snow .ql-toolbar button:hover:not(.ql-active) .ql-stroke-miter { + stroke: #444; + } +} +.ql-snow { + box-sizing: border-box; +} +.ql-snow * { + box-sizing: border-box; +} +.ql-snow .ql-hidden { + display: none; +} +.ql-snow .ql-out-bottom, +.ql-snow .ql-out-top { + visibility: hidden; +} +.ql-snow .ql-tooltip { + position: absolute; + transform: translateY(10px); +} +.ql-snow .ql-tooltip a { + cursor: pointer; + text-decoration: none; +} +.ql-snow .ql-tooltip.ql-flip { + transform: translateY(-10px); +} +.ql-snow .ql-formats { + display: inline-block; + vertical-align: middle; +} +.ql-snow .ql-formats:after { + clear: both; + content: ''; + display: table; +} +.ql-snow .ql-stroke { + fill: none; + stroke: #444; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 2; +} +.ql-snow .ql-stroke-miter { + fill: none; + stroke: #444; + stroke-miterlimit: 10; + stroke-width: 2; +} +.ql-snow .ql-fill, +.ql-snow .ql-stroke.ql-fill { + fill: #444; +} +.ql-snow .ql-empty { + fill: none; +} +.ql-snow .ql-even { + fill-rule: evenodd; +} +.ql-snow .ql-thin, +.ql-snow .ql-stroke.ql-thin { + stroke-width: 1; +} +.ql-snow .ql-transparent { + opacity: 0.4; +} +.ql-snow .ql-direction svg:last-child { + display: none; +} +.ql-snow .ql-direction.ql-active svg:last-child { + display: inline; +} +.ql-snow .ql-direction.ql-active svg:first-child { + display: none; +} +.ql-snow .ql-editor h1 { + font-size: 2em; +} +.ql-snow .ql-editor h2 { + font-size: 1.5em; +} +.ql-snow .ql-editor h3 { + font-size: 1.17em; +} +.ql-snow .ql-editor h4 { + font-size: 1em; +} +.ql-snow .ql-editor h5 { + font-size: 0.83em; +} +.ql-snow .ql-editor h6 { + font-size: 0.67em; +} +.ql-snow .ql-editor a { + text-decoration: underline; +} +.ql-snow .ql-editor blockquote { + border-left: 4px solid #ccc; + margin-bottom: 5px; + margin-top: 5px; + padding-left: 16px; +} +.ql-snow .ql-editor code, +.ql-snow .ql-editor pre { + background-color: #f0f0f0; + border-radius: 3px; +} +.ql-snow .ql-editor pre { + white-space: pre-wrap; + margin-bottom: 5px; + margin-top: 5px; + padding: 5px 10px; +} +.ql-snow .ql-editor code { + font-size: 85%; + padding: 2px 4px; +} +.ql-snow .ql-editor pre.ql-syntax { + background-color: #23241f; + color: #f8f8f2; + overflow: visible; +} +.ql-snow .ql-editor img { + max-width: 100%; +} +.ql-snow .ql-picker { + color: #444; + display: inline-block; + float: left; + font-size: 14px; + font-weight: 500; + height: 24px; + position: relative; + vertical-align: middle; +} +.ql-snow .ql-picker-label { + cursor: pointer; + display: inline-block; + height: 100%; + padding-left: 8px; + padding-right: 2px; + position: relative; + width: 100%; +} +.ql-snow .ql-picker-label::before { + display: inline-block; + line-height: 22px; +} +.ql-snow .ql-picker-options { + background-color: #fff; + display: none; + min-width: 100%; + padding: 4px 8px; + position: absolute; + white-space: nowrap; +} +.ql-snow .ql-picker-options .ql-picker-item { + cursor: pointer; + display: block; + padding-bottom: 5px; + padding-top: 5px; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label { + color: #ccc; + z-index: 2; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill { + fill: #ccc; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke { + stroke: #ccc; +} +.ql-snow .ql-picker.ql-expanded .ql-picker-options { + display: block; + margin-top: -1px; + top: 100%; + z-index: 1; +} +.ql-snow .ql-color-picker, +.ql-snow .ql-icon-picker { + width: 28px; +} +.ql-snow .ql-color-picker .ql-picker-label, +.ql-snow .ql-icon-picker .ql-picker-label { + padding: 2px 4px; +} +.ql-snow .ql-color-picker .ql-picker-label svg, +.ql-snow .ql-icon-picker .ql-picker-label svg { + right: 4px; +} +.ql-snow .ql-icon-picker .ql-picker-options { + padding: 4px 0px; +} +.ql-snow .ql-icon-picker .ql-picker-item { + height: 24px; + width: 24px; + padding: 2px 4px; +} +.ql-snow .ql-color-picker .ql-picker-options { + padding: 3px 5px; + width: 152px; +} +.ql-snow .ql-color-picker .ql-picker-item { + border: 1px solid transparent; + float: left; + height: 16px; + margin: 2px; + padding: 0px; + width: 16px; +} +.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg { + position: absolute; + margin-top: -9px; + right: 0; + top: 50%; + width: 18px; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-font .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-size .ql-picker-label[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-label]:not([data-label=''])::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-label]:not([data-label=''])::before { + content: attr(data-label); +} +.ql-snow .ql-picker.ql-header { + width: 98px; +} +.ql-snow .ql-picker.ql-header .ql-picker-label::before, +.ql-snow .ql-picker.ql-header .ql-picker-item::before { + content: 'Normal'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + content: 'Heading 1'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + content: 'Heading 2'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + content: 'Heading 3'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + content: 'Heading 4'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="5"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + content: 'Heading 5'; +} +.ql-snow .ql-picker.ql-header .ql-picker-label[data-value="6"]::before, +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + content: 'Heading 6'; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { + font-size: 2em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { + font-size: 1.5em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { + font-size: 1.17em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { + font-size: 1em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="5"]::before { + font-size: 0.83em; +} +.ql-snow .ql-picker.ql-header .ql-picker-item[data-value="6"]::before { + font-size: 0.67em; +} +.ql-snow .ql-picker.ql-font { + width: 108px; +} +.ql-snow .ql-picker.ql-font .ql-picker-label::before, +.ql-snow .ql-picker.ql-font .ql-picker-item::before { + content: 'Sans Serif'; +} +.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=serif]::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + content: 'Serif'; +} +.ql-snow .ql-picker.ql-font .ql-picker-label[data-value=monospace]::before, +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + content: 'Monospace'; +} +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=serif]::before { + font-family: Georgia, Times New Roman, serif; +} +.ql-snow .ql-picker.ql-font .ql-picker-item[data-value=monospace]::before { + font-family: Monaco, Courier New, monospace; +} +.ql-snow .ql-picker.ql-size { + width: 98px; +} +.ql-snow .ql-picker.ql-size .ql-picker-label::before, +.ql-snow .ql-picker.ql-size .ql-picker-item::before { + content: 'Normal'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + content: 'Small'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + content: 'Large'; +} +.ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before, +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + content: 'Huge'; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { + font-size: 10px; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { + font-size: 18px; +} +.ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { + font-size: 32px; +} +.ql-snow .ql-color-picker.ql-background .ql-picker-item { + background-color: #fff; +} +.ql-snow .ql-color-picker.ql-color .ql-picker-item { + background-color: #000; +} +.ql-toolbar.ql-snow { + border: 1px solid #ccc; + box-sizing: border-box; + font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif; + padding: 8px; +} +.ql-toolbar.ql-snow .ql-formats { + margin-right: 15px; +} +.ql-toolbar.ql-snow .ql-picker-label { + border: 1px solid transparent; +} +.ql-toolbar.ql-snow .ql-picker-options { + border: 1px solid transparent; + box-shadow: rgba(0,0,0,0.2) 0 2px 8px; +} +.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label { + border-color: #ccc; +} +.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options { + border-color: #ccc; +} +.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item.ql-selected, +.ql-toolbar.ql-snow .ql-color-picker .ql-picker-item:hover { + border-color: #000; +} +.ql-toolbar.ql-snow + .ql-container.ql-snow { + border-top: 0px; +} +.ql-snow .ql-tooltip { + background-color: #fff; + border: 1px solid #ccc; + box-shadow: 0px 0px 5px #ddd; + color: #444; + padding: 5px 12px; + white-space: nowrap; +} +.ql-snow .ql-tooltip::before { + content: "Visit URL:"; + line-height: 26px; + margin-right: 8px; +} +.ql-snow .ql-tooltip input[type=text] { + display: none; + border: 1px solid #ccc; + font-size: 13px; + height: 26px; + margin: 0px; + padding: 3px 5px; + width: 170px; +} +.ql-snow .ql-tooltip a.ql-preview { + display: inline-block; + max-width: 200px; + overflow-x: hidden; + text-overflow: ellipsis; + vertical-align: top; +} +.ql-snow .ql-tooltip a.ql-action::after { + border-right: 1px solid #ccc; + content: 'Edit'; + margin-left: 16px; + padding-right: 8px; +} +.ql-snow .ql-tooltip a.ql-remove::before { + content: 'Remove'; + margin-left: 8px; +} +.ql-snow .ql-tooltip a { + line-height: 26px; +} +.ql-snow .ql-tooltip.ql-editing a.ql-preview, +.ql-snow .ql-tooltip.ql-editing a.ql-remove { + display: none; +} +.ql-snow .ql-tooltip.ql-editing input[type=text] { + display: inline-block; +} +.ql-snow .ql-tooltip.ql-editing a.ql-action::after { + border-right: 0px; + content: 'Save'; + padding-right: 0px; +} +.ql-snow .ql-tooltip[data-mode=link]::before { + content: "Enter link:"; +} +.ql-snow .ql-tooltip[data-mode=formula]::before { + content: "Enter formula:"; +} +.ql-snow .ql-tooltip[data-mode=video]::before { + content: "Enter video:"; +} +.ql-snow a { + color: #4b4b4b; +} +.ql-container.ql-snow { + border: 1px solid #ccc; +} diff --git a/views/document/new_html_edit_template.tpl b/views/document/new_html_edit_template.tpl index 5bb91341..0d8b1449 100644 --- a/views/document/new_html_edit_template.tpl +++ b/views/document/new_html_edit_template.tpl @@ -30,7 +30,10 @@ - + {{/**/}} + + +