@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 • 767 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[26,6,20,21,31,83],{1565:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AttributeMap=t.OpIterator=t.Op=void 0;const r=n(1675),o=n(1620),i=n(1621),a=n(1676);t.AttributeMap=a.default;const l=n(1622);t.Op=l.default;const s=n(1677);t.OpIterator=s.default;const c=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 f{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=o(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(r=>{(e(r)?t:n).push(r)}),[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=[],r=new s.default(this.ops);let o=0;for(;o<t&&r.hasNext();){let i;o<e?i=r.next(e-o):(i=r.next(t-o),n.push(i)),o+=l.default.length(i)}return new f(n)}compose(e){const t=new s.default(this.ops),n=new s.default(e.ops),r=[],o=n.peek();if(null!=o&&"number"==typeof o.retain&&null==o.attributes){let e=o.retain;for(;"insert"===t.peekType()&&t.peekLength()<=e;)e-=t.peekLength(),r.push(t.next());o.retain-e>0&&n.next(o.retain-e)}const l=new f(r);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()),r=t.next(e),o=n.next(e);if(o.retain){const s={};if("number"==typeof r.retain)s.retain="number"==typeof o.retain?e:o.retain;else if("number"==typeof o.retain)null==r.retain?s.insert=r.insert:s.retain=r.retain;else{const e=null==r.retain?"insert":"retain",[t,n,i]=u(r[e],o.retain),a=f.getHandler(t);s[e]={[t]:a.compose(n,i,"retain"===e)}}const c=a.default.compose(r.attributes,o.attributes,"number"==typeof r.retain);if(c&&(s.attributes=c),l.push(s),!n.hasNext()&&i(l.ops[l.ops.length-1],s)){const e=new f(t.rest());return l.concat(e).chop()}}else"number"==typeof o.delete&&("number"==typeof r.retain||"object"==typeof r.retain&&null!==r.retain)&&l.push(o)}return l.chop()}concat(e){const t=new f(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 f;const n=[this,e].map(t=>t.map(n=>{if(null!=n.insert)return"string"==typeof n.insert?n.insert:c;throw new Error("diff() called "+(t===e?"on":"with")+" non-document")}).join("")),o=new f,l=r(n[0],n[1],t,!0),u=new s.default(this.ops),d=new s.default(e.ops);return l.forEach(e=>{let t=e[1].length;for(;t>0;){let n=0;switch(e[0]){case r.INSERT:n=Math.min(d.peekLength(),t),o.push(d.next(n));break;case r.DELETE:n=Math.min(t,u.peekLength()),u.next(n),o.delete(n);break;case r.EQUAL:n=Math.min(u.peekLength(),d.peekLength(),t);const e=u.next(n),l=d.next(n);i(e.insert,l.insert)?o.retain(n,a.default.diff(e.attributes,l.attributes)):o.push(l).delete(n)}t-=n}}),o.chop()}eachLine(e,t="\n"){const n=new s.default(this.ops);let r=new f,o=0;for(;n.hasNext();){if("insert"!==n.peekType())return;const i=n.peek(),a=l.default.length(i)-n.peekLength(),s="string"==typeof i.insert?i.insert.indexOf(t,a)-a:-1;if(s<0)r.push(n.next());else if(s>0)r.push(n.next(s));else{if(!1===e(r,n.next(1).attributes||{},o))return;o+=1,r=new f}}r.length()>0&&e(r,{},o)}invert(e){const t=new f;return this.reduce((n,r)=>{if(r.insert)t.delete(l.default.length(r));else{if("number"==typeof r.retain&&null==r.attributes)return t.retain(r.retain),n+r.retain;if(r.delete||"number"==typeof r.retain){const o=r.delete||r.retain;return e.slice(n,n+o).forEach(e=>{r.delete?t.push(e):r.retain&&r.attributes&&t.retain(l.default.length(e),a.default.invert(r.attributes,e.attributes))}),n+o}if("object"==typeof r.retain&&null!==r.retain){const o=e.slice(n,n+1),i=new s.default(o.ops).next(),[l,c,d]=u(r.retain,i.insert),p=f.getHandler(l);return t.retain({[l]:p.invert(c,d)},a.default.invert(r.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,r=new s.default(this.ops),o=new s.default(n.ops),i=new f;for(;r.hasNext()||o.hasNext();)if("insert"!==r.peekType()||!t&&"insert"===o.peekType())if("insert"===o.peekType())i.push(o.next());else{const e=Math.min(r.peekLength(),o.peekLength()),n=r.next(e),l=o.next(e);if(n.delete)continue;if(l.delete)i.push(l);else{const r=n.retain,o=l.retain;let s="object"==typeof o&&null!==o?o:e;if("object"==typeof r&&null!==r&&"object"==typeof o&&null!==o){const e=Object.keys(r)[0];if(e===Object.keys(o)[0]){const n=f.getHandler(e);n&&(s={[e]:n.transform(r[e],o[e],t)})}}i.retain(s,a.default.transform(n.attributes,l.attributes,t))}}else i.retain(l.default.length(r.next()));return i.chop()}transformPosition(e,t=!1){t=!!t;const n=new s.default(this.ops);let r=0;for(;n.hasNext()&&r<=e;){const o=n.peekLength(),i=n.peekType();n.next(),"delete"!==i?("insert"===i&&(r<e||!t)&&(e+=o),r+=o):e-=Math.min(o,e-r)}return e}}f.Op=l.default,f.OpIterator=s.default,f.AttributeMap=a.default,f.handlers={},t.default=f,e.exports=f,e.exports.default=f},1571:function(e,t,n){"use strict";var r=n(0),o=n.n(r).a.createContext();t.a=o},1582:function(e,t,n){"use strict";var r={};n.r(r),n.d(r,"Attributor",(function(){return a})),n.d(r,"AttributorStore",(function(){return h})),n.d(r,"BlockBlot",(function(){return _})),n.d(r,"ClassAttributor",(function(){return f})),n.d(r,"ContainerBlot",(function(){return A})),n.d(r,"EmbedBlot",(function(){return T})),n.d(r,"InlineBlot",(function(){return E})),n.d(r,"LeafBlot",(function(){return v})),n.d(r,"ParentBlot",(function(){return S})),n.d(r,"Registry",(function(){return c})),n.d(r,"Scope",(function(){return i})),n.d(r,"ScrollBlot",(function(){return N})),n.d(r,"StyleAttributor",(function(){return p})),n.d(r,"TextBlot",(function(){return R}));n(9),n(10),n(14),n(21),n(76),n(20),n(22),n(18),n(16),n(48),n(24),n(47),n(49),n(17),n(19),n(11),n(13),n(30),n(38),n(34),n(81),n(27),n(12),n(44),n(118),n(31),n(28),n(228),n(627),n(37),n(8),n(181),n(153),n(29);var o=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 r=i.TYPE&i.ATTRIBUTE;this.scope=null!=n.scope?n.scope&i.LEVEL|r: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 s=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,r){const o=this.query(n);if(null==o)throw new l(`Unable to create ${n} blot`);const i=o,a=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:i.create(r),s=new i(t,a,r);return e.blots.set(s.domNode,s),s}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 r=t?e.blotName:n?e.attrName:void 0;return this.types[r]=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})}};s.blots=new WeakMap;let c=s;function u(e,t){return(e.getAttribute("class")||"").split(/\s+/).filter(e=>0===e.indexOf(t+"-"))}const f=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 d(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[d(this.keyName)]=t,!0)}remove(e){e.style[d(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const t=e.style[d(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=c.find(this.domNode);if(null==e)return;const t=a.keys(this.domNode),n=f.keys(this.domNode),r=p.keys(this.domNode);t.concat(n).concat(r).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,c.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),c.blots.delete(this.domNode)}deleteAt(e,t){this.isolate(e,t).remove()}formatAt(e,t,n,r){const o=this.isolate(e,t);if(null!=this.scroll.query(n,i.BLOT)&&r)o.wrap(n,r);else if(null!=this.scroll.query(n,i.ATTRIBUTE)){const e=this.scroll.create(this.statics.scope);o.wrap(e),e.format(n,r)}}insertAt(e,t,n){const r=null==n?this.scroll.create("text",t):this.scroll.create(t,n),o=this.split(e);this.parent.insertBefore(r,o||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 y=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}}};y.scope=i.INLINE_BLOT;const v=y;class g{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(),r=0;for(;n;){if(n===e)return r;r+=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 r=n();for(;r;){const o=r.length();if(e<o||t&&e===o&&(null==r.next||0!==r.next.length()))return[r,e];e-=o,r=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[r,o]=this.find(e);let i=e-o;const a=this.iterator(r);let l=a();for(;l&&i<e+t;){const r=l.length();e>i?n(l,e-i,Math.min(t,i+r-e)):n(l,0,Math.min(r,e+t-i)),i+=r,l=a()}}map(e){return this.reduce((t,n)=>(t.push(e(n)),t),[])}reduce(e,t){const n=this.iterator();let r=n();for(;r;)t=e(t,r),r=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 g,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[r,o]=this.children.find(n);return null==t.blotName&&t(r)||null!=t.blotName&&r instanceof t?[r,o]:r instanceof e?r.descendant(t,o):[null,-1]}descendants(t,n=0,r=Number.MAX_VALUE){let o=[],i=r;return this.children.forEachAt(n,r,(n,r,a)=>{(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-=a}),o}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,r){this.children.forEachAt(e,t,(e,t,o)=>{e.formatAt(t,o,n,r)})}insertAt(e,t,n){const[r,o]=this.children.find(e);if(r)r.insertAt(o,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[r,o]=this.children.find(t,n),i=[[this,t]];return r instanceof e?i.concat(r.path(o,n)):(null!=r&&i.push([r,o]),i)}removeChild(e){this.children.remove(e)}replaceWith(t,n){const r="string"==typeof t?this.scroll.create(t,n):t;return r instanceof e&&this.moveChildren(r),super.replaceWith(r)}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,r,o)=>{const i=e.split(r,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=[],r=[];e.forEach(e=>{e.target===this.domNode&&"childList"===e.type&&(n.push(...e.addedNodes),r.push(...e.removedNodes))}),r.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 S=x;const O=class e extends S{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.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,r){null!=this.formats()[n]||this.scroll.query(n,i.ATTRIBUTE)?this.isolate(e,t).format(n,r):super.formatAt(e,t,n,r)}optimize(t){super.optimize(t);const n=this.formats();if(0===Object.keys(n).length)return this.unwrap();const r=this.next;r instanceof e&&r.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,r.formats())&&(r.moveChildren(this),r.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 r=super.wrap(t,n);return r instanceof e&&this.attributes.move(r),r}};O.allowedChildren=[O,v],O.blotName="inline",O.scope=i.INLINE_BLOT,O.tagName="SPAN";const E=O,k=class e extends S{static create(e){return super.create(e)}static formats(t,n){const r=n.query(e.blotName);if(null==r||t.tagName!==r.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 r=this.scroll.query(t,i.BLOCK);null!=r&&(r instanceof a?this.attributes.attribute(r,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,r){null!=this.scroll.query(n,i.BLOCK)?this.format(n,r):super.formatAt(e,t,n,r)}insertAt(e,t,n){if(null==n||null!=this.scroll.query(t,i.INLINE))super.insertAt(e,t,n);else{const r=this.split(e);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const e=this.scroll.create(t,n);r.parent.insertBefore(e,r)}}}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()}};k.blotName="block",k.scope=i.BLOCK_BLOT,k.tagName="P",k.allowedChildren=[E,k,v];const _=k,C=class extends S{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,r){super.formatAt(e,t,n,r),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())}};C.blotName="container",C.scope=i.BLOCK_BLOT;const A=C;const T=class extends v{static formats(e,t){}format(e,t){super.formatAt(0,this.length(),e,t)}formatAt(e,t,n,r){0===e&&t===this.length()?this.format(n,r):super.formatAt(e,t,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}},j={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},q=class extends S{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,j),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,r){this.update(),super.formatAt(e,t,n,r)}insertAt(e,t,n){this.update(),super.insertAt(e,t,n)}optimize(e=[],t={}){super.optimize(t);const n=t.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)e.push(r.pop());const o=(e,t=!0)=>{null==e||e===this||null!=e.domNode.parentNode&&(n.has(e.domNode)||n.set(e.domNode,[]),t&&o(e.parent))},i=e=>{n.has(e.domNode)&&(e instanceof S&&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?(o(this.find(e.previousSibling,!1)),Array.from(e.addedNodes).forEach(e=>{const t=this.find(e,!1);o(t,!1),t instanceof S&&t.children.forEach(e=>{o(e,!1)})})):"attributes"===e.type&&o(t.prev)),o(t))}),this.children.forEach(i),a=Array.from(this.observer.takeRecords()),r=a.slice();r.length>0;)e.push(r.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)}};q.blotName="scroll",q.defaultChild=_,q.allowedChildren=[_,A],q.scope=i.BLOCK_BLOT,q.tagName="DIV";const N=q,P=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}};P.blotName="text",P.scope=i.INLINE_BLOT;const R=P;var I=n(1565),M=n.n(I),L=(n(85),n(470),n(180),n(115),n(618),n(1605));var D=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},z=n(1647),B=n(1578),F=n(1604),H=Object(F.a)(Object.keys,Object);var U=function(e,t){return e&&Object(B.a)(t,H(t),e)},W=n(1590);var G=function(e,t){return e&&Object(B.a)(t,Object(W.a)(t),e)},V=n(1645),K=n(1644);var $=function(){return[]};var Y=function(e,t){return Object(B.a)(e,$(e),t)};var Z=function(){return[]};var X=function(e,t){return Object(B.a)(e,Z(e),t)},Q=n(1625);var J=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t},ee=n(1623),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 re=function(e){return e},oe=n(1657),ie=n(1587),ae=n(1603);var le=function(){return!1},se=n(1580);var ce=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 fe=function e(t,n,r,o,i,a){var l,s=1&n,c=2&n,u=4&n;if(r&&(l=i?r(t,o,i,a):r(t)),void 0!==l)return l;if(!Object(se.a)(t))return t;var f=Object(ie.a)(t);if(f){if(l=ne(t),!s)return Object(K.a)(t,l)}else{var d=Object(ee.a)(t),p="[object Function]"==d||"[object GeneratorFunction]"==d;if(Object(ae.a)(t))return Object(V.a)(t,s);if("[object Object]"==d||"[object Arguments]"==d||p&&!i){if(l=c||p?{}:Object(oe.a)(t),!s)return c?X(t,G(l,t)):Y(t,U(l,t))}else{if(!ue[d])return i?t:{};l=re(t,d,s)}}a||(a=new L.a);var h=a.get(t);if(h)return h;a.set(t,l),ce(t)?t.forEach((function(o){l.add(e(o,n,r,o,t,a))})):le(t)&&t.forEach((function(o,i){l.set(i,e(o,n,r,i,t,a))}));var m=u?c?J:Q.a:c?W.a:H,b=f?void 0:m(t);return D(b||t,(function(o,i){b&&(o=t[i=o]),Object(z.a)(l,i,e(o,n,r,i,t,a))})),l};var de=function(e){return fe(e,5)},pe=n(1844);n(26),n(40),n(42),n(43),n(84),n(615),n(467);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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ye(r.key),r)}}function ye(e){var t=function(e,t){if("object"!=he(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=he(r))return r;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=ge(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||[],ge(e).constructor):t.apply(e,n))}function ge(e){return(ge=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,o=[{key:"value",value:function(){}}],(r=[{key:"optimize",value:function(){(this.prev||this.next)&&this.remove()}},{key:"length",value:function(){return 0}},{key:"value",value:function(){return""}}])&&be(n.prototype,r),o&&be(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(T);xe.blotName="break",xe.tagName="BR";var Se=xe;function Oe(e){return(Oe="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 Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ke(r.key),r)}}function ke(e){var t=function(e,t){if("object"!=Oe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Oe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Oe(t)?t:t+""}function _e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ce(e,t,n){return t=Ae(t),function(e,t){if(t&&("object"==Oe(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||[],Ae(e).constructor):t.apply(e,n))}function Ae(e){return(Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Te(e,t){return(Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var je=function(e){function t(){return _e(this,t),Ce(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&&Te(e,t)}(t,e),n=t,r&&Ee(n.prototype,r),o&&Ee(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(R),qe={"&":"&","<":"<",">":">",'"':""","'":"'"};function Ne(e){return e.replace(/[&<>"']/g,(function(e){return qe[e]}))}function Pe(e){return(Pe="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 Ie(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ue(r.key),r)}}function Me(e,t,n){return t=Be(t),function(e,t){if(t&&("object"==Pe(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||[],Be(e).constructor):t.apply(e,n))}function Le(e,t,n,r){var o=De(Be(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function De(){return(De="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=ze(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(null,arguments)}function ze(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Be(e)););return e}function Be(e){return(Be=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"!=Pe(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=Pe(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Pe(t)?t:t+""}var We=function(e){function t(){return Re(this,t),Me(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,o=[{key:"compare",value:function(e,n){var r=t.order.indexOf(e),o=t.order.indexOf(n);return r>=0||o>=0?r-o:e===n?0:e<n?-1:1}}],(r=[{key:"formatAt",value:function(e,n,r,o){if(t.compare(this.statics.blotName,r)<0&&this.scroll.query(r,i.BLOT)){var a=this.isolate(e,n);o&&a.wrap(r,o)}else Le(t,"formatAt",this,3)([e,n,r,o])}},{key:"optimize",value:function(e){if(Le(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)}}}])&&Ie(n.prototype,r),o&&Ie(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(E);He(We,"allowedChildren",[We,Se,T,je]),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 r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}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 r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,at(r.key),r)}}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,r){var o=et(nt(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function et(){return(et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=tt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.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 rt(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&&ot(e,t)}function ot(e,t){return(ot=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 r=n.call(e,t||"default");if("object"!=Ve(r))return r;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,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return it(e=Qe(this,t,[].concat(r)),"cache",{}),e}return rt(t,e),Xe(t,[{key:"delta",value:function(){return null==this.cache.delta&&(this.cache.delta=ct(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,r,o){n<=0||(this.scroll.query(r,i.BLOCK)?e+n===this.length()&&this.format(r,o):Je(t,"formatAt",this,3)([e,Math.min(n,this.length()-e-1),r,o]),this.cache={})}},{key:"insertAt",value:function(e,n,r){if(null!=r)return Je(t,"insertAt",this,3)([e,n,r]),void(this.cache={});if(0!==n.length){var o=n.split("\n"),i=o.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;o.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 r=this.children.head;Je(t,"insertBefore",this,3)([e,n]),r instanceof Se&&r.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 r=this.clone();return 0===e?(this.parent.insertBefore(r,this),this):(this.parent.insertBefore(r,this.next),r)}var o=Je(t,"split",this,3)([e,n]);return this.cache={},o}}])}(_);lt.blotName="block",lt.tagName="P",lt.defaultChild=Se,lt.allowedChildren=[Se,Ge,T,je];var st=function(e){function t(){return Ye(this,t),Qe(this,t,arguments)}return rt(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 M.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,r){this.format(n,r)}},{key:"insertAt",value:function(e,n,r){var o=this;if(null==r){var i=n.split("\n"),a=i.pop(),l=i.map((function(e){var t=o.scroll.create(lt.blotName);return t.insertAt(0,e),t})),s=this.split(e);l.forEach((function(e){o.parent.insertBefore(e,s)})),a&&this.parent.insertBefore(this.scroll.create("text",a),s)}else Je(t,"insertAt",this,3)([e,n,r])}}])}(T);function ct(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 M.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))}st.scope=i.BLOCK_BLOT;n(99);function ft(e){return(ft="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 dt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,wt(r.key),r)}}function pt(e,t,n){return t=yt(t),function(e,t){if(t&&("object"==ft(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||[],yt(e).constructor):t.apply(e,n))}function ht(e,t,n,r){var o=mt(yt(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function mt(){return(mt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=bt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(null,arguments)}function bt(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=yt(e)););return e}function yt(e){return(yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function vt(e,t){return(vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function gt(e,t,n){return(t=wt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wt(e){var t=function(e,t){if("object"!=ft(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=ft(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ft(t)?t:t+""}var xt=function(e){function t(e,n,r){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(o=pt(this,t,[e,n])).selection=r,o.textNode=document.createTextNode(t.CONTENTS),o.domNode.appendChild(o.textNode),o.savedLength=0,o}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&&vt(e,t)}(t,e),n=t,o=[{key:"value",value:function(){}}],(r=[{key:"detach",value:function(){null!=this.parent&&this.parent.removeChild(this)}},{key:"format",value:function(e,n){if(0===this.savedLength){for(var r=this,o=0;null!=r&&r.statics.scope!==i.BLOCK_BLOT;)o+=r.offset(r.parent),r=r.parent;null!=r&&(this.savedLength=t.CONTENTS.length,r.optimize(),r.formatAt(o,t.CONTENTS.length,e,n),this.savedLength=0)}else ht(t,"format",this,3)([e,n])}},{key:"index",value:function(e,n){return e===this.textNode?0:ht(t,"index",this,3)([e,n])}},{key:"length",value:function(){return this.savedLength}},{key:"position",value:function(){return[this.textNode,this.textNode.data.length]}},{key:"remove",value:function(){ht(t,"remove",this,3)([]),this.parent=null}},{key:"restore",value:function(){if(this.selection.composing||null==this.parent)return null;for(var e=this.selection.getNativeRange();null!=this.domNode.lastChild&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);var n,r=this.prev instanceof je?this.prev:null,o=r?r.length():0,i=this.next instanceof je?this.next:null,a=i?i.text:"",l=this.textNode,s=l.data.split(t.CONTENTS).join("");if(l.data=t.CONTENTS,r)n=r,(s||i)&&(r.insertAt(r.length(),s+a),i&&i.remove());else if(i)n=i,i.insertAt(0,s);else{var c=document.createTextNode(s);n=this.scroll.create(c),this.parent.insertBefore(n,this)}if(this.remove(),e){var u=function(e,t){return r&&e===r.domNode?t:e===l?o+t-1:i&&e===i.domNode?o+s.length+t:null},f=u(e.start.node,e.start.offset),d=u(e.end.node,e.end.offset);if(null!==f&&null!==d)return{startNode:n.domNode,startOffset:f,endNode:n.domNode,endOffset:d}}return null}},{key:"update",value:function(e,t){var n=this;if(e.some((function(e){return"characterData"===e.type&&e.target===n.textNode}))){var r=this.restore();r&&(t.range=r)}}},{key:"optimize",value:function(e){ht(t,"optimize",this,3)([e]);for(var n=this.parent;n;){if("A"===n.domNode.tagName){this.savedLength=t.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}},{key:"value",value:function(){return""}}])&&dt(n.prototype,r),o&&dt(n,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,o}(T);gt(xt,"blotName","cursor"),gt(xt,"className","ql-cursor"),gt(xt,"tagName","span"),gt(xt,"CONTENTS","\ufeff");var St=xt,Ot=(n(94),n(1678)),Et=(n(1594),new WeakMap),kt=["error","warn","log","inf