UNPKG

@pdftron/webviewer

Version:

[WebViewer](https://www.apryse.com/webviewer) is a powerful JavaScript Document SDK and UI Component Library that is a part of the [Apryse PDF SDK](https://www.apryse.com). It provides a slick, out-of-the-box responsive UI that interacts with the core lib

1 lines • 1.1 MB
(window.webpackJsonpWebViewerUI=window.webpackJsonpWebViewerUI||[]).push([[26,2,4,6,7,8,10,14,18,19,22,23,27,31,35,39,41,46,55,63,82],{1569:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const o=n(1670),r=n(1612),i=n(1613),a=n(1671);t.AttributeMap=a.default;const l=n(1614);t.Op=l.default;const c=n(1672);t.OpIterator=c.default;const s=String.fromCharCode(0),u=(e,t)=>{if("object"!=typeof e||null===e)throw new Error("cannot retain a "+typeof e);if("object"!=typeof t||null===t)throw new Error("cannot retain a "+typeof t);const n=Object.keys(e)[0];if(!n||n!==Object.keys(t)[0])throw new Error(`embed types not matched: ${n} != ${Object.keys(t)[0]}`);return[n,e[n],t[n]]};class d{constructor(e){Array.isArray(e)?this.ops=e:null!=e&&Array.isArray(e.ops)?this.ops=e.ops:this.ops=[]}static registerEmbed(e,t){this.handlers[e]=t}static unregisterEmbed(e){delete this.handlers[e]}static getHandler(e){const t=this.handlers[e];if(!t)throw new Error(`no handlers for embed type "${e}"`);return t}insert(e,t){const n={};return"string"==typeof e&&0===e.length?this:(n.insert=e,null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n))}delete(e){return e<=0?this:this.push({delete:e})}retain(e,t){if("number"==typeof e&&e<=0)return this;const n={retain:e};return null!=t&&"object"==typeof t&&Object.keys(t).length>0&&(n.attributes=t),this.push(n)}push(e){let t=this.ops.length,n=this.ops[t-1];if(e=r(e),"object"==typeof n){if("number"==typeof e.delete&&"number"==typeof n.delete)return this.ops[t-1]={delete:n.delete+e.delete},this;if("number"==typeof n.delete&&null!=e.insert&&(t-=1,n=this.ops[t-1],"object"!=typeof n))return this.ops.unshift(e),this;if(i(e.attributes,n.attributes)){if("string"==typeof e.insert&&"string"==typeof n.insert)return this.ops[t-1]={insert:n.insert+e.insert},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this;if("number"==typeof e.retain&&"number"==typeof n.retain)return this.ops[t-1]={retain:n.retain+e.retain},"object"==typeof e.attributes&&(this.ops[t-1].attributes=e.attributes),this}}return t===this.ops.length?this.ops.push(e):this.ops.splice(t,0,e),this}chop(){const e=this.ops[this.ops.length-1];return e&&"number"==typeof e.retain&&!e.attributes&&this.ops.pop(),this}filter(e){return this.ops.filter(e)}forEach(e){this.ops.forEach(e)}map(e){return this.ops.map(e)}partition(e){const t=[],n=[];return this.forEach(o=>{(e(o)?t:n).push(o)}),[t,n]}reduce(e,t){return this.ops.reduce(e,t)}changeLength(){return this.reduce((e,t)=>t.insert?e+l.default.length(t):t.delete?e-t.delete:e,0)}length(){return this.reduce((e,t)=>e+l.default.length(t),0)}slice(e=0,t=1/0){const n=[],o=new c.default(this.ops);let r=0;for(;r<t&&o.hasNext();){let i;r<e?i=o.next(e-r):(i=o.next(t-r),n.push(i)),r+=l.default.length(i)}return new d(n)}compose(e){const t=new c.default(this.ops),n=new c.default(e.ops),o=[],r=n.peek();if(null!=r&&"number"==typeof r.retain&&null==r.attributes){let e=r.retain;for(;"insert"===t.peekType()&&t.peekLength()<=e;)e-=t.peekLength(),o.push(t.next());r.retain-e>0&&n.next(r.retain-e)}const l=new d(o);for(;t.hasNext()||n.hasNext();)if("insert"===n.peekType())l.push(n.next());else if("delete"===t.peekType())l.push(t.next());else{const e=Math.min(t.peekLength(),n.peekLength()),o=t.next(e),r=n.next(e);if(r.retain){const c={};if("number"==typeof o.retain)c.retain="number"==typeof r.retain?e:r.retain;else if("number"==typeof r.retain)null==o.retain?c.insert=o.insert:c.retain=o.retain;else{const e=null==o.retain?"insert":"retain",[t,n,i]=u(o[e],r.retain),a=d.getHandler(t);c[e]={[t]:a.compose(n,i,"retain"===e)}}const s=a.default.compose(o.attributes,r.attributes,"number"==typeof o.retain);if(s&&(c.attributes=s),l.push(c),!n.hasNext()&&i(l.ops[l.ops.length-1],c)){const e=new d(t.rest());return l.concat(e).chop()}}else"number"==typeof r.delete&&("number"==typeof o.retain||"object"==typeof o.retain&&null!==o.retain)&&l.push(r)}return l.chop()}concat(e){const t=new d(this.ops.slice());return e.ops.length>0&&(t.push(e.ops[0]),t.ops=t.ops.concat(e.ops.slice(1))),t}diff(e,t){if(this.ops===e.ops)return new d;const n=[this,e].map(t=>t.map(n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:s;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")),r=new d,l=o(n[0],n[1],t,!0),u=new c.default(this.ops),f=new c.default(e.ops);return l.forEach(e=>{let t=e[1].length;for(;t>0;){let n=0;switch(e[0]){case o.INSERT:n=Math.min(f.peekLength(),t),r.push(f.next(n));break;case o.DELETE:n=Math.min(t,u.peekLength()),u.next(n),r.delete(n);break;case o.EQUAL:n=Math.min(u.peekLength(),f.peekLength(),t);const e=u.next(n),l=f.next(n);i(e.insert,l.insert)?r.retain(n,a.default.diff(e.attributes,l.attributes)):r.push(l).delete(n)}t-=n}}),r.chop()}eachLine(e,t="\n"){const n=new c.default(this.ops);let o=new d,r=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const i=n.peek(),a=l.default.length(i)-n.peekLength(),c="string"==typeof i.insert?i.insert.indexOf(t,a)-a:-1;if(c<0)o.push(n.next());else if(c>0)o.push(n.next(c));else{if(!1===e(o,n.next(1).attributes||{},r))return;r+=1,o=new d}}o.length()>0&&e(o,{},r)}invert(e){const t=new d;return this.reduce((n,o)=>{if(o.insert)t.delete(l.default.length(o));else{if("number"==typeof o.retain&&null==o.attributes)return t.retain(o.retain),n+o.retain;if(o.delete||"number"==typeof o.retain){const r=o.delete||o.retain;return e.slice(n,n+r).forEach(e=>{o.delete?t.push(e):o.retain&&o.attributes&&t.retain(l.default.length(e),a.default.invert(o.attributes,e.attributes))}),n+r}if("object"==typeof o.retain&&null!==o.retain){const r=e.slice(n,n+1),i=new c.default(r.ops).next(),[l,s,f]=u(o.retain,i.insert),p=d.getHandler(l);return t.retain({[l]:p.invert(s,f)},a.default.invert(o.attributes,i.attributes)),n+1}}return n},0),t.chop()}transform(e,t=!1){if(t=!!t,"number"==typeof e)return this.transformPosition(e,t);const n=e,o=new c.default(this.ops),r=new c.default(n.ops),i=new d;for(;o.hasNext()||r.hasNext();)if("insert"!==o.peekType()||!t&&"insert"===r.peekType())if("insert"===r.peekType())i.push(r.next());else{const e=Math.min(o.peekLength(),r.peekLength()),n=o.next(e),l=r.next(e);if(n.delete)continue;if(l.delete)i.push(l);else{const o=n.retain,r=l.retain;let c="object"==typeof r&&null!==r?r:e;if("object"==typeof o&&null!==o&&"object"==typeof r&&null!==r){const e=Object.keys(o)[0];if(e===Object.keys(r)[0]){const n=d.getHandler(e);n&&(c={[e]:n.transform(o[e],r[e],t)})}}i.retain(c,a.default.transform(n.attributes,l.attributes,t))}}else i.retain(l.default.length(o.next()));return i.chop()}transformPosition(e,t=!1){t=!!t;const n=new c.default(this.ops);let o=0;for(;n.hasNext()&&o<=e;){const r=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(o<e||!t)&&(e+=r),o+=r):e-=Math.min(r,e-o)}return e}}d.Op=l.default,d.OpIterator=c.default,d.AttributeMap=a.default,d.handlers={},t.default=d,e.exports=d,e.exports.default=d},1574:function(e,t,n){"use strict";var o=n(0),r=n.n(o).a.createContext();t.a=r},1576:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"e",(function(){return i})),n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return l})),n.d(t,"g",(function(){return c})),n.d(t,"d",(function(){return s})),n.d(t,"f",(function(){return u}));n(9),n(10),n(14),n(38),n(117),n(20),n(12),n(18),n(41),n(8),n(19),n(11),n(13);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e){var t=e.current;return null==t?null:t.decoratedRef?t.decoratedRef.current:t}function i(e){return(t=e)&&t.prototype&&"function"==typeof t.prototype.render||function(e){var t,n=e;return"Symbol(react.forward_ref)"===(null==n||null===(t=n.$$typeof)||void 0===t?void 0:t.toString())}(e);var t}function a(e,t){}function l(e){return"function"==typeof e}function c(){}function s(e){if(!function(e){return"object"===o(e)&&null!==e}(e))return!1;if(null===Object.getPrototypeOf(e))return!0;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function u(e,t){return"string"==typeof e||"symbol"===o(e)||!!t&&Array.isArray(e)&&e.every((function(e){return u(e,!1)}))}},1578:function(e,t,n){var o=n(36),r=n(1643);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[e.i,r,""]]);var i={insert:function(e){if(!window.isApryseWebViewerWebComponent)return void document.head.appendChild(e);let t;t=document.getElementsByTagName("apryse-webviewer"),t.length||(t=function e(t,n=document){const o=[];return n.querySelectorAll(t).forEach(e=>o.push(e)),n.querySelectorAll("*").forEach(n=>{n.shadowRoot&&o.push(...e(t,n.shadowRoot))}),o}("apryse-webviewer"));const n=[];for(let o=0;o<t.length;o++){const r=t[o];if(0===o)r.shadowRoot.appendChild(e),e.onload=function(){n.length>0&&n.forEach(t=>{t.innerHTML=e.innerHTML})};else{const t=e.cloneNode(!0);r.shadowRoot.appendChild(t),n.push(t)}}},singleton:!1};o(r,i);e.exports=r.locals||{}},1579:function(e,t,n){"use strict";function o(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);null!=e&&this.setState(e)}function r(e){this.setState(function(t){var n=this.constructor.getDerivedStateFromProps(e,t);return null!=n?n:null}.bind(this))}function i(e,t){try{var n=this.props,o=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,o)}finally{this.props=n,this.state=o}}function a(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if("function"!=typeof e.getDerivedStateFromProps&&"function"!=typeof t.getSnapshotBeforeUpdate)return e;var n=null,a=null,l=null;if("function"==typeof t.componentWillMount?n="componentWillMount":"function"==typeof t.UNSAFE_componentWillMount&&(n="UNSAFE_componentWillMount"),"function"==typeof t.componentWillReceiveProps?a="componentWillReceiveProps":"function"==typeof t.UNSAFE_componentWillReceiveProps&&(a="UNSAFE_componentWillReceiveProps"),"function"==typeof t.componentWillUpdate?l="componentWillUpdate":"function"==typeof t.UNSAFE_componentWillUpdate&&(l="UNSAFE_componentWillUpdate"),null!==n||null!==a||null!==l){var c=e.displayName||e.name,s="function"==typeof e.getDerivedStateFromProps?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n"+c+" uses "+s+" but also contains the following legacy lifecycles:"+(null!==n?"\n "+n:"")+(null!==a?"\n "+a:"")+(null!==l?"\n "+l:"")+"\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks")}if("function"==typeof e.getDerivedStateFromProps&&(t.componentWillMount=o,t.componentWillReceiveProps=r),"function"==typeof t.getSnapshotBeforeUpdate){if("function"!=typeof t.componentDidUpdate)throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=i;var u=t.componentDidUpdate;t.componentDidUpdate=function(e,t,n){var o=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:n;u.call(this,e,t,o)}}return e}n.r(t),n.d(t,"polyfill",(function(){return a})),o.__suppressDeprecationWarning=!0,r.__suppressDeprecationWarning=!0,i.__suppressDeprecationWarning=!0},1580:function(e,t,n){"use strict";var o=n(1638),r=n(1622);t.a=function(e,t,n,i){var a=!n;n||(n={});for(var l=-1,c=t.length;++l<c;){var s=t[l],u=i?i(n[s],e[s],s,n,e):void 0;void 0===u&&(u=e[s]),a?Object(r.a)(n,s,u):Object(o.a)(n,s,u)}return n}},1581:function(e,t,n){"use strict";t.a=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},1583:function(e,t,n){"use strict";var o={};n.r(o),n.d(o,"Attributor",(function(){return a})),n.d(o,"AttributorStore",(function(){return h})),n.d(o,"BlockBlot",(function(){return C})),n.d(o,"ClassAttributor",(function(){return d})),n.d(o,"ContainerBlot",(function(){return T})),n.d(o,"EmbedBlot",(function(){return j})),n.d(o,"InlineBlot",(function(){return k})),n.d(o,"LeafBlot",(function(){return v})),n.d(o,"ParentBlot",(function(){return O})),n.d(o,"Registry",(function(){return s})),n.d(o,"Scope",(function(){return i})),n.d(o,"ScrollBlot",(function(){return N})),n.d(o,"StyleAttributor",(function(){return p})),n.d(o,"TextBlot",(function(){return R}));n(9),n(10),n(14),n(21),n(77),n(20),n(22),n(18),n(16),n(49),n(24),n(48),n(50),n(17),n(19),n(11),n(13),n(32),n(38),n(34),n(83),n(27),n(12),n(44),n(119),n(33),n(29),n(163),n(483),n(35),n(8),n(173),n(136),n(31);var r=n(1591),i=(e=>(e[e.TYPE=3]="TYPE",e[e.LEVEL=12]="LEVEL",e[e.ATTRIBUTE=13]="ATTRIBUTE",e[e.BLOT=14]="BLOT",e[e.INLINE=7]="INLINE",e[e.BLOCK=11]="BLOCK",e[e.BLOCK_BLOT=10]="BLOCK_BLOT",e[e.INLINE_BLOT=6]="INLINE_BLOT",e[e.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",e[e.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",e[e.ANY=15]="ANY",e))(i||{});class a{constructor(e,t,n={}){this.attrName=e,this.keyName=t;const o=i.TYPE&i.ATTRIBUTE;this.scope=null!=n.scope?n.scope&i.LEVEL|o:i.ATTRIBUTE,null!=n.whitelist&&(this.whitelist=n.whitelist)}static keys(e){return Array.from(e.attributes).map(e=>e.name)}add(e,t){return!!this.canAdd(e,t)&&(e.setAttribute(this.keyName,t),!0)}canAdd(e,t){return null==this.whitelist||("string"==typeof t?this.whitelist.indexOf(t.replace(/["']/g,""))>-1:this.whitelist.indexOf(t)>-1)}remove(e){e.removeAttribute(this.keyName)}value(e){const t=e.getAttribute(this.keyName);return this.canAdd(e,t)&&t?t:""}}class l extends Error{constructor(e){super(e="[Parchment] "+e),this.message=e,this.name=this.constructor.name}}const c=class e{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,t=!1){if(null==e)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(t){let n=null;try{n=e.parentNode}catch{return null}return this.find(n,t)}return null}create(t,n,o){const r=this.query(n);if(null==r)throw new l(`Unable to create ${n} blot`);const i=r,a=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:i.create(o),c=new i(t,a,o);return e.blots.set(c.domNode,c),c}find(t,n=!1){return e.find(t,n)}query(e,t=i.ANY){let n;return"string"==typeof e?n=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof e?e&i.LEVEL&i.BLOCK?n=this.types.block:e&i.LEVEL&i.INLINE&&(n=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(e=>(n=this.classes[e],!!n)),n=n||this.tags[e.tagName]),null==n?null:"scope"in n&&t&i.LEVEL&n.scope&&t&i.TYPE&n.scope?n:null}register(...e){return e.map(e=>{const t="blotName"in e,n="attrName"in e;if(!t&&!n)throw new l("Invalid definition");if(t&&"abstract"===e.blotName)throw new l("Cannot register abstract class");const o=t?e.blotName:n?e.attrName:void 0;return this.types[o]=e,n?"string"==typeof e.keyName&&(this.attributes[e.keyName]=e):t&&(e.className&&(this.classes[e.className]=e),e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(e=>e.toUpperCase()):e.tagName=e.tagName.toUpperCase(),(Array.isArray(e.tagName)?e.tagName:[e.tagName]).forEach(t=>{(null==this.tags[t]||null==e.className)&&(this.tags[t]=e)}))),e})}};c.blots=new WeakMap;let s=c;function u(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(e=>0===e.indexOf(t+"-"))}const d=class extends a{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(e=>e.split("-").slice(0,-1).join("-"))}add(e,t){return!!this.canAdd(e,t)&&(this.remove(e),e.classList.add(`${this.keyName}-${t}`),!0)}remove(e){u(e,this.keyName).forEach(t=>{e.classList.remove(t)}),0===e.classList.length&&e.removeAttribute("class")}value(e){const t=(u(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,t)?t:""}};function f(e){const t=e.split("-"),n=t.slice(1).map(e=>e[0].toUpperCase()+e.slice(1)).join("");return t[0]+n}const p=class extends a{static keys(e){return(e.getAttribute("style")||"").split(";").map(e=>e.split(":")[0].trim())}add(e,t){return!!this.canAdd(e,t)&&(e.style[f(this.keyName)]=t,!0)}remove(e){e.style[f(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[f(this.keyName)];return this.canAdd(e,t)?t:""}};const h=class{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,t){t?e.add(this.domNode,t)&&(null!=e.value(this.domNode)?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=s.find(this.domNode);if(null==e)return;const t=a.keys(this.domNode),n=d.keys(this.domNode),o=p.keys(this.domNode);t.concat(n).concat(o).forEach(t=>{const n=e.scroll.query(t,i.ATTRIBUTE);n instanceof a&&(this.attributes[n.attrName]=n)})}copy(e){Object.keys(this.attributes).forEach(t=>{const n=this.attributes[t].value(this.domNode);e.format(t,n)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(e=>{this.attributes[e].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,t)=>(e[t]=this.attributes[t].value(this.domNode),e),{})}},m=class{constructor(e,t){this.scroll=e,this.domNode=t,s.blots.set(t,this),this.prev=null,this.next=null}static create(e){if(null==this.tagName)throw new l("Blot definition missing tagName");let t,n;return Array.isArray(this.tagName)?("string"==typeof e?(n=e.toUpperCase(),parseInt(n,10).toString()===n&&(n=parseInt(n,10))):"number"==typeof e&&(n=e),t="number"==typeof n?document.createElement(this.tagName[n-1]):n&&this.tagName.indexOf(n)>-1?document.createElement(n):document.createElement(this.tagName[0])):t=document.createElement(this.tagName),this.className&&t.classList.add(this.className),t}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){null!=this.parent&&this.parent.removeChild(this),s.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,o){const r=this.isolate(e,t);if(null!=this.scroll.query(n,i.BLOT)&&o)r.wrap(n,o);else if(null!=this.scroll.query(n,i.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);r.wrap(e),e.format(n,o)}}insertAt(e,t,n){const o=null==n?this.scroll.create("text",t):this.scroll.create(t,n),r=this.split(e);this.parent.insertBefore(o,r||void 0)}isolate(e,t){const n=this.split(e);if(null==n)throw new Error("Attempt to isolate at end");return n.split(t),n}length(){return 1}offset(e=this.parent){return null==this.parent||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){null!=this.domNode.parentNode&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(e,t){return 0===e?this:this.next}update(e,t){}wrap(e,t){const n="string"==typeof e?this.scroll.create(e,t):e;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new l("Cannot wrap "+e);return n.appendChild(this),n}};m.blotName="abstract";let b=m;const g=class extends b{static value(e){return!0}index(e,t){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(t,1):-1}position(e,t){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};g.scope=i.INLINE_BLOT;const v=g;class y{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const t=e.slice(1);this.append(...t)}}at(e){const t=this.iterator();let n=t();for(;n&&e>0;)e-=1,n=t();return n}contains(e){const t=this.iterator();let n=t();for(;n;){if(n===e)return!0;n=t()}return!1}indexOf(e){const t=this.iterator();let n=t(),o=0;for(;n;){if(n===e)return o;o+=1,n=t()}return-1}insertBefore(e,t){null!=e&&(this.remove(e),e.next=t,null!=t?(e.prev=t.prev,null!=t.prev&&(t.prev.next=e),t.prev=e,t===this.head&&(this.head=e)):null!=this.tail?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let t=0,n=this.head;for(;null!=n;){if(n===e)return t;t+=n.length(),n=n.next}return-1}remove(e){this.contains(e)&&(null!=e.prev&&(e.prev.next=e.next),null!=e.next&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const t=e;return null!=e&&(e=e.next),t}}find(e,t=!1){const n=this.iterator();let o=n();for(;o;){const r=o.length();if(e<r||t&&e===r&&(null==o.next||0!==o.next.length()))return[o,e];e-=r,o=n()}return[null,0]}forEach(e){const t=this.iterator();let n=t();for(;n;)e(n),n=t()}forEachAt(e,t,n){if(t<=0)return;const[o,r]=this.find(e);let i=e-r;const a=this.iterator(o);let l=a();for(;l&&i<e+t;){const o=l.length();e>i?n(l,e-i,Math.min(t,i+o-e)):n(l,0,Math.min(o,e+t-i)),i+=o,l=a()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){const n=this.iterator();let o=n();for(;o;)t=e(t,o),o=n();return t}}function w(e,t){const n=t.find(e);if(n)return n;try{return t.create(e)}catch{const n=t.create(i.INLINE);return Array.from(e.childNodes).forEach(e=>{n.domNode.appendChild(e)}),e.parentNode&&e.parentNode.replaceChild(n.domNode,e),n.attach(),n}}const x=class e extends b{constructor(e,t){super(e,t),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,e.uiClass&&this.uiNode.classList.add(e.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new y,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const t=w(e,this.scroll);this.insertBefore(t,this.children.head||void 0)}catch(e){if(e instanceof l)return;throw e}})}deleteAt(e,t){if(0===e&&t===this.length())return this.remove();this.children.forEachAt(e,t,(e,t,n)=>{e.deleteAt(t,n)})}descendant(t,n=0){const[o,r]=this.children.find(n);return null==t.blotName&&t(o)||null!=t.blotName&&o instanceof t?[o,r]:o instanceof e?o.descendant(t,r):[null,-1]}descendants(t,n=0,o=Number.MAX_VALUE){let r=[],i=o;return this.children.forEachAt(n,o,(n,o,a)=>{(null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t)&&r.push(n),n instanceof e&&(r=r.concat(n.descendants(t,o,i))),i-=a}),r}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(n=>{t||this.statics.allowedChildren.some(e=>n instanceof e)||(n.statics.scope===i.BLOCK_BLOT?(null!=n.next&&this.splitAfter(n),null!=n.prev&&this.splitAfter(n.prev),n.parent.unwrap(),t=!0):n instanceof e?n.unwrap():n.remove())})}formatAt(e,t,n,o){this.children.forEachAt(e,t,(e,t,r)=>{e.formatAt(t,r,n,o)})}insertAt(e,t,n){const[o,r]=this.children.find(e);if(o)o.insertAt(r,t,n);else{const e=null==n?this.scroll.create("text",t):this.scroll.create(t,n);this.appendChild(e)}}insertBefore(e,t){null!=e.parent&&e.parent.children.remove(e);let n=null;this.children.insertBefore(e,t||null),e.parent=this,null!=t&&(n=t.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==n)&&this.domNode.insertBefore(e.domNode,n),e.attach()}length(){return this.children.reduce((e,t)=>e+t.length(),0)}moveChildren(e,t){this.children.forEach(n=>{e.insertBefore(n,t)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),null!=this.uiNode&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),0===this.children.length)if(null!=this.statics.defaultChild){const e=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(e)}else this.remove()}path(t,n=!1){const[o,r]=this.children.find(t,n),i=[[this,t]];return o instanceof e?i.concat(o.path(r,n)):(null!=o&&i.push([o,r]),i)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const o="string"==typeof t?this.scroll.create(t,n):t;return o instanceof e&&this.moveChildren(o),super.replaceWith(o)}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(e,this.length(),(e,o,r)=>{const i=e.split(o,t);null!=i&&n.appendChild(i)}),n}splitAfter(e){const t=this.clone();for(;null!=e.next;)t.appendChild(e.next);return this.parent&&this.parent.insertBefore(t,this.next||void 0),t}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,t){const n=[],o=[];e.forEach(e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),o.push(...e.removedNodes))}),o.forEach(e=>{if(null!=e.parentNode&&"IFRAME"!==e.tagName&&document.body.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const t=this.scroll.find(e);null!=t&&(null==t.domNode.parentNode||t.domNode.parentNode===this.domNode)&&t.detach()}),n.filter(e=>e.parentNode===this.domNode&&e!==this.uiNode).sort((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(e=>{let t=null;null!=e.nextSibling&&(t=this.scroll.find(e.nextSibling));const n=w(e,this.scroll);(n.next!==t||null==n.next)&&(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,t||void 0))}),this.enforceAllowedChildren()}};x.uiClass="";const O=x;const S=class e extends O{static create(e){return super.create(e)}static formats(t,n){const o=n.query(e.blotName);if(null==o||t.tagName!==o.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new h(this.domNode)}format(t,n){if(t!==this.statics.blotName||n){const e=this.scroll.query(t,i.INLINE);if(null==e)return;e instanceof a?this.attributes.attribute(e,n):n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n)}else this.children.forEach(t=>{t instanceof e||(t=t.wrap(e.blotName,!0)),this.attributes.copy(t)}),this.unwrap()}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,o){null!=this.formats()[n]||this.scroll.query(n,i.ATTRIBUTE)?this.isolate(e,t).format(n,o):super.formatAt(e,t,n,o)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const o=this.next;o instanceof e&&o.prev===this&&function(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}(n,o.formats())&&(o.moveChildren(this),o.remove())}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&"attributes"===e.type)&&this.attributes.build()}wrap(t,n){const o=super.wrap(t,n);return o instanceof e&&this.attributes.move(o),o}};S.allowedChildren=[S,v],S.blotName="inline",S.scope=i.INLINE_BLOT,S.tagName="SPAN";const k=S,E=class e extends O{static create(e){return super.create(e)}static formats(t,n){const o=n.query(e.blotName);if(null==o||t.tagName!==o.tagName){if("string"==typeof this.tagName)return!0;if(Array.isArray(this.tagName))return t.tagName.toLowerCase()}}constructor(e,t){super(e,t),this.attributes=new h(this.domNode)}format(t,n){const o=this.scroll.query(t,i.BLOCK);null!=o&&(o instanceof a?this.attributes.attribute(o,n):t!==this.statics.blotName||n?n&&(t!==this.statics.blotName||this.formats()[t]!==n)&&this.replaceWith(t,n):this.replaceWith(e.blotName))}formats(){const e=this.attributes.values(),t=this.statics.formats(this.domNode,this.scroll);return null!=t&&(e[this.statics.blotName]=t),e}formatAt(e,t,n,o){null!=this.scroll.query(n,i.BLOCK)?this.format(n,o):super.formatAt(e,t,n,o)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,i.INLINE))super.insertAt(e,t,n);else{const o=this.split(e);if(null==o)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);o.parent.insertBefore(e,o)}}}replaceWith(e,t){const n=super.replaceWith(e,t);return this.attributes.copy(n),n}update(e,t){super.update(e,t),e.some(e=>e.target===this.domNode&&"attributes"===e.type)&&this.attributes.build()}};E.blotName="block",E.scope=i.BLOCK_BLOT,E.tagName="P",E.allowedChildren=[k,E,v];const C=E,A=class extends O{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,t){super.deleteAt(e,t),this.enforceAllowedChildren()}formatAt(e,t,n,o){super.formatAt(e,t,n,o),this.enforceAllowedChildren()}insertAt(e,t,n){super.insertAt(e,t,n),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};A.blotName="container",A.scope=i.BLOCK_BLOT;const T=A;const j=class extends v{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,o){0===e&&t===this.length()?this.format(n,o):super.formatAt(e,t,n,o)}formats(){return this.statics.formats(this.domNode,this.scroll)}},_={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},P=class extends O{constructor(e,t){super(null,t),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(e=>{this.update(e)}),this.observer.observe(this.domNode,_),this.attach()}create(e,t){return this.registry.create(this,e,t)}find(e,t=!1){const n=this.registry.find(e,t);return n?n.scroll===this?n:t?this.find(n.scroll.domNode.parentNode,!0):null:null}query(e,t=i.ANY){return this.registry.query(e,t)}register(...e){return this.registry.register(...e)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,t){this.update(),0===e&&t===this.length()?this.children.forEach(e=>{e.remove()}):super.deleteAt(e,t)}formatAt(e,t,n,o){this.update(),super.formatAt(e,t,n,o)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let o=Array.from(this.observer.takeRecords());for(;o.length>0;)e.push(o.pop());const r=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&r(e.parent))},i=e=>{n.has(e.domNode)&&(e instanceof O&&e.children.forEach(i),n.delete(e.domNode),e.optimize(t))};let a=e;for(let t=0;a.length>0;t+=1){if(t>=100)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(e=>{const t=this.find(e.target,!0);null!=t&&(t.domNode===e.target&&("childList"===e.type?(r(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach(e=>{const t=this.find(e,!1);r(t,!1),t instanceof O&&t.children.forEach(e=>{r(e,!1)})})):"attributes"===e.type&&r(t.prev)),r(t))}),this.children.forEach(i),a=Array.from(this.observer.takeRecords()),o=a.slice();o.length>0;)e.push(o.pop())}}update(e,t={}){e=e||this.observer.takeRecords();const n=new WeakMap;e.map(e=>{const t=this.find(e.target,!0);return null==t?null:n.has(t.domNode)?(n.get(t.domNode).push(e),null):(n.set(t.domNode,[e]),t)}).forEach(e=>{null!=e&&e!==this&&n.has(e.domNode)&&e.update(n.get(e.domNode)||[],t)}),t.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),t),this.optimize(e,t)}};P.blotName="scroll",P.defaultChild=C,P.allowedChildren=[C,T],P.scope=i.BLOCK_BLOT,P.tagName="DIV";const N=P,I=class e extends v{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,t){super(e,t),this.text=this.statics.value(this.domNode)}deleteAt(e,t){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+t)}index(e,t){return this.domNode===e?t:-1}insertAt(e,t,n){null==n?(this.text=this.text.slice(0,e)+t+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,t,n)}length(){return this.text.length}optimize(t){super.optimize(t),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())}position(e,t=!1){return[this.domNode,e]}split(e,t=!1){if(!t){if(0===e)return this;if(e===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(e,t){e.some(e=>"characterData"===e.type&&e.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};I.blotName="text",I.scope=i.INLINE_BLOT;const R=I;var q=n(1569),L=n.n(q),M=(n(82),n(308),n(182),n(115),n(384),n(1603));var D=function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););return e},B=n(1638),z=n(1580),F=n(1602),H=Object(F.a)(Object.keys,Object);var U=function(e,t){return e&&Object(z.a)(t,H(t),e)},W=n(1590);var G=function(e,t){return e&&Object(z.a)(t,Object(W.a)(t),e)},V=n(1636),K=n(1635);var $=function(){return[]};var Y=function(e,t){return Object(z.a)(e,$(e),t)};var Z=function(){return[]};var X=function(e,t){return Object(z.a)(e,Z(e),t)},Q=n(1617);var J=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},ee=n(1615),te=Object.prototype.hasOwnProperty;var ne=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&te.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var oe=function(e){return e},re=n(1648),ie=n(1588),ae=n(1601);var le=function(){return!1},ce=n(1581);var se=function(){return!1},ue={};ue["[object Arguments]"]=ue["[object Array]"]=ue["[object ArrayBuffer]"]=ue["[object DataView]"]=ue["[object Boolean]"]=ue["[object Date]"]=ue["[object Float32Array]"]=ue["[object Float64Array]"]=ue["[object Int8Array]"]=ue["[object Int16Array]"]=ue["[object Int32Array]"]=ue["[object Map]"]=ue["[object Number]"]=ue["[object Object]"]=ue["[object RegExp]"]=ue["[object Set]"]=ue["[object String]"]=ue["[object Symbol]"]=ue["[object Uint8Array]"]=ue["[object Uint8ClampedArray]"]=ue["[object Uint16Array]"]=ue["[object Uint32Array]"]=!0,ue["[object Error]"]=ue["[object Function]"]=ue["[object WeakMap]"]=!1;var de=function e(t,n,o,r,i,a){var l,c=1&n,s=2&n,u=4&n;if(o&&(l=i?o(t,r,i,a):o(t)),void 0!==l)return l;if(!Object(ce.a)(t))return t;var d=Object(ie.a)(t);if(d){if(l=ne(t),!c)return Object(K.a)(t,l)}else{var f=Object(ee.a)(t),p="[object Function]"==f||"[object GeneratorFunction]"==f;if(Object(ae.a)(t))return Object(V.a)(t,c);if("[object Object]"==f||"[object Arguments]"==f||p&&!i){if(l=s||p?{}:Object(re.a)(t),!c)return s?X(t,G(l,t)):Y(t,U(l,t))}else{if(!ue[f])return i?t:{};l=oe(t,f,c)}}a||(a=new M.a);var h=a.get(t);if(h)return h;a.set(t,l),se(t)?t.forEach((function(r){l.add(e(r,n,o,r,t,a))})):le(t)&&t.forEach((function(r,i){l.set(i,e(r,n,o,i,t,a))}));var m=u?s?J:Q.a:s?W.a:H,b=d?void 0:m(t);return D(b||t,(function(r,i){b&&(r=t[i=r]),Object(B.a)(l,i,e(r,n,o,i,t,a))})),l};var fe=function(e){return de(e,5)},pe=n(1853);n(26),n(40),n(41),n(42),n(86),n(624),n(473);function he(e){return(he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function me(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function be(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,ge(o.key),o)}}function ge(e){var t=function(e,t){if("object"!=he(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=he(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==he(t)?t:t+""}function ve(e,t,n){return t=ye(t),function(e,t){if(t&&("object"==he(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,n||[],ye(e).constructor):t.apply(e,n))}function ye(e){return(ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function we(e,t){return(we=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var xe=function(e){function t(){return me(this,t),ve(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&we(e,t)}(t,e),n=t,r=[{key:"value",value:function(){}}],(o=[{key:"optimize",value:function(){(this.prev||this.next)&&this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}])&&be(n.prototype,o),r&&be(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,r}(j);xe.blotName="break",xe.tagName="BR";var Oe=xe;function Se(e){return(Se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ke(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Ee(o.key),o)}}function Ee(e){var t=function(e,t){if("object"!=Se(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Se(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Se(t)?t:t+""}function Ce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ae(e,t,n){return t=Te(t),function(e,t){if(t&&("object"==Se(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,n||[],Te(e).constructor):t.apply(e,n))}function Te(e){return(Te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function je(e,t){return(je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var _e=function(e){function t(){return Ce(this,t),Ae(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&je(e,t)}(t,e),n=t,o&&ke(n.prototype,o),r&&ke(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,r}(R),Pe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Ne(e){return e.replace(/[&<>"']/g,(function(e){return Pe[e]}))}function Ie(e){return(Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Re(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qe(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,Ue(o.key),o)}}function Le(e,t,n){return t=ze(t),function(e,t){if(t&&("object"==Ie(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,n||[],ze(e).constructor):t.apply(e,n))}function Me(e,t,n,o){var r=De(ze(1&o?e.prototype:e),t,n);return 2&o&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function De(){return(De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=Be(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}}).apply(null,arguments)}function Be(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ze(e)););return e}function ze(e){return(ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Fe(e,t){return(Fe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function He(e,t,n){return(t=Ue(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ue(e){var t=function(e,t){if("object"!=Ie(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ie(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ie(t)?t:t+""}var We=function(e){function t(){return Re(this,t),Le(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fe(e,t)}(t,e),n=t,r=[{key:"compare",value:function(e,n){var o=t.order.indexOf(e),r=t.order.indexOf(n);return o>=0||r>=0?o-r:e===n?0:e<n?-1:1}}],(o=[{key:"formatAt",value:function(e,n,o,r){if(t.compare(this.statics.blotName,o)<0&&this.scroll.query(o,i.BLOT)){var a=this.isolate(e,n);r&&a.wrap(o,r)}else Me(t,"formatAt",this,3)([e,n,o,r])}},{key:"optimize",value:function(e){if(Me(t,"optimize",this,3)([e]),this.parent instanceof t&&t.compare(this.statics.blotName,this.parent.statics.blotName)>0){var n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}}])&&qe(n.prototype,o),r&&qe(n,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o,r}(k);He(We,"allowedChildren",[We,Oe,j,_e]),He(We,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);var Ge=We;function Ve(e){return(Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ke(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function $e(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(n),!0).forEach((function(t){it(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ke(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ze(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,at(o.key),o)}}function Xe(e,t,n){return t&&Ze(e.prototype,t),n&&Ze(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qe(e,t,n){return t=nt(t),function(e,t){if(t&&("object"==Ve(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,function(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return function(){return!!e}()}()?Reflect.construct(t,n||[],nt(e).constructor):t.apply(e,n))}function Je(e,t,n,o){var r=et(nt(1&o?e.prototype:e),t,n);return 2&o&&"function"==typeof r?function(e){return r.apply(n,e)}:r}function et(){return(et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=tt(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}}).apply(null,arguments)}function tt(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=nt(e)););return e}function nt(e){return(nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ot(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rt(e,t)}function rt(e,t){return(rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function it(e,t,n){return(t=at(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function at(e){var t=function(e,t){if("object"!=Ve(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ve(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ve(t)?t:t+""}var lt=function(e){function t(){var e;Ye(this,t);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return it(e=Qe(this,t,[].concat(o)),"cache",{}),e}return ot(t,e),Xe(t,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=st(this)),this.cache.delta}},{key:"deleteAt",value:function(e,n){Je(t,"deleteAt",this,3)([e,n]),this.cache={}}},{key:"formatAt",value:function(e,n,o,r){n<=0||(this.scroll.query(o,i.BLOCK)?e+n===this.length()&&this.format(o,r):Je(t,"formatAt",this,3)([e,Math.min(n,this.length()-e-1),o,r]),this.cache={})}},{key:"insertAt",value:function(e,n,o){if(null!=o)return Je(t,"insertAt",this,3)([e,n,o]),void(this.cache={});if(0!==n.length){var r=n.split("\n"),i=r.shift();i.length>0&&(e<this.length()-1||null==this.children.tail?Je(t,"insertAt",this,3)([Math.min(e,this.length()-1),i]):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});var a=this;r.reduce((function(e,t){return(a=a.split(e,!0)).insertAt(0,t),t.length}),e+i.length)}}},{key:"insertBefore",value:function(e,n){var o=this.children.head;Je(t,"insertBefore",this,3)([e,n]),o instanceof Oe&&o.remove(),this.cache={}}},{key:"length",value:function(){return null==this.cache.length&&(this.cache.length=Je(t,"length",this,3)([])+1),this.cache.length}},{key:"moveChildren",value:function(e,n){Je(t,"moveChildren",this,3)([e,n]),this.cache={}}},{key:"optimize",value:function(e){Je(t,"optimize",this,3)([e]),this.cache={}}},{key:"path",value:function(e){return Je(t,"path",this,3)([e,!0])}},{key:"removeChild",value:function(e){Je(t,"removeChild",this,3)([e]),this.cache={}}},{key:"split",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(n&&(0===e||e>=this.length()-1)){var o=this.clone();return 0===e?(this.parent.insertBefore(o,this),this):(this.parent.insertBefore(o,this.next),o)}var r=Je(t,"split",this,3)([e,n]);return this.cache={},r}}])}(C);lt.blotName="block",lt.tagName="P",lt.defaultChild=Oe,lt.allowedChildren=[Oe,Ge,j,_e];var ct=function(e){function t(){return Ye(this,t),Qe(this,t,arguments)}return ot(t,e),Xe(t,[{key:"attach",value:function(){Je(t,"attach",this,3)([]),this.attributes=new h(this.domNode)}},{key:"delta",value:function(){return(new L.a).insert(this.value(),$e($e({},this.formats()),this.attributes.values()))}},{key:"format",value:function(e,t){var n=this.scroll.query(e,i.BLOCK_ATTRIBUTE);null!=n&&this.attributes.attribute(n,t)}},{key:"formatAt",value:function(e,t,n,o){this.format(n,o)}},{key:"insertAt",value:function(e,n,o){var r=this;if(null==o){var i=n.split("\n"),a=i.pop(),l=i.map((function(e){var t=r.scroll.create(lt.blotName);return t.insertAt(0,e),t})),c=this.split(e);l.forEach((function(e){r.parent.insertBefore(e,c)})),a&&this.parent.insertBefore(this.scroll.create("text",a),c)}else Je(t,"insertAt",this,3)([e,n,o])}}])}(j);function st(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.descendants(v).reduce((function(e,n){return 0===n.length()?e:e.insert(n.value(),ut(n,{},t))}),new L.a).insert("\n",ut(e))}function ut(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return null==e?t:("formats"in e&&"function"==typeof e.formats&&(t=$e($e({},t),e.formats()),n&&delete t["code-token"]),null==e.parent||"scroll"===e.parent.statics.blotName||e.parent.statics.scope!==e.statics.scope?t:ut(e.parent,t,n))}ct.scope=i.BLOCK_BLOT;n(94);function dt(e){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prot