UNPKG

morning-ui

Version:

modern efficient user interface, using human-friendly HTML

1 lines 2.83 MB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.morning=e():t.morning=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/dist",n(n.s=484)}([function(t,e,n){"use strict";function r(t,e,n,r,i,o,a,s){var c,u="function"==typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),o&&(u._scopeId="data-v-"+o),a?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):i&&(c=s?function(){i.call(this,this.$root.$options.shadowRoot)}:i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(t,e){return c.call(e),l(t,e)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:u}}n.d(e,"a",(function(){return r}))},function(t,e,n){var r=n(286),i={};r.merge(i,r,{mixin:function(t,e){var n=t.CFG?"CFG":"ATTRS";if(t&&e){t._mixins=e,t[n]=t[n]||{};var r={};i.each(e,(function(e){i.augment(t,e);var o=e[n];o&&i.merge(r,o)})),t[n]=i.merge(r,t[n])}}}),t.exports=i},function(t,e,n){"use strict";var r=n(23),i=n(435),o=n(52),a=n(740),s=n(43);function c(t){return t}function u(t,e){for(var n=0;n<t.length;++n)e[n]=255&t.charCodeAt(n);return e}e.newBlob=function(t,n){e.checkSupport("blob");try{return new Blob([t],{type:n})}catch(e){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(t),r.getBlob(n)}catch(t){throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(t,e,n){var r=[],i=0,o=t.length;if(o<=n)return String.fromCharCode.apply(null,t);for(;i<o;)"array"===e||"nodebuffer"===e?r.push(String.fromCharCode.apply(null,t.slice(i,Math.min(i+n,o)))):r.push(String.fromCharCode.apply(null,t.subarray(i,Math.min(i+n,o)))),i+=n;return r.join("")},stringifyByChar:function(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t[n]);return e},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(t){return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(t){return!1}}()}};function d(t){var n=65536,r=e.getTypeOf(t),i=!0;if("uint8array"===r?i=l.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=l.applyCanBeUsed.nodebuffer),i)for(;n>1;)try{return l.stringifyByChunk(t,r,n)}catch(t){n=Math.floor(n/2)}return l.stringifyByChar(t)}function f(t,e){for(var n=0;n<t.length;n++)e[n]=t[n];return e}e.applyFromCharCode=d;var h={};h.string={string:c,array:function(t){return u(t,new Array(t.length))},arraybuffer:function(t){return h.string.uint8array(t).buffer},uint8array:function(t){return u(t,new Uint8Array(t.length))},nodebuffer:function(t){return u(t,o.allocBuffer(t.length))}},h.array={string:d,array:c,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return o.newBufferFrom(t)}},h.arraybuffer={string:function(t){return d(new Uint8Array(t))},array:function(t){return f(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:c,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return o.newBufferFrom(new Uint8Array(t))}},h.uint8array={string:d,array:function(t){return f(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:c,nodebuffer:function(t){return o.newBufferFrom(t)}},h.nodebuffer={string:d,array:function(t){return f(t,new Array(t.length))},arraybuffer:function(t){return h.nodebuffer.uint8array(t).buffer},uint8array:function(t){return f(t,new Uint8Array(t.length))},nodebuffer:c},e.transformTo=function(t,n){if(n||(n=""),!t)return n;e.checkSupport(t);var r=e.getTypeOf(n);return h[r][t](n)},e.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":r.nodebuffer&&o.isBuffer(t)?"nodebuffer":r.uint8array&&t instanceof Uint8Array?"uint8array":r.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(t){if(!r[t.toLowerCase()])throw new Error(t+" is not supported by this platform")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(t){var e,n,r="";for(n=0;n<(t||"").length;n++)r+="\\x"+((e=t.charCodeAt(n))<16?"0":"")+e.toString(16).toUpperCase();return r},e.delay=function(t,e,n){a((function(){t.apply(n||null,e||[])}))},e.inherits=function(t,e){var n=function(){};n.prototype=e.prototype,t.prototype=new n},e.extend=function(){var t,e,n={};for(t=0;t<arguments.length;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&void 0===n[e]&&(n[e]=arguments[t][e]);return n},e.prepareContent=function(t,n,o,a,c){return s.Promise.resolve(n).then((function(t){return r.blob&&(t instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(t)))&&"undefined"!=typeof FileReader?new s.Promise((function(e,n){var r=new FileReader;r.onload=function(t){e(t.target.result)},r.onerror=function(t){n(t.target.error)},r.readAsArrayBuffer(t)})):t})).then((function(n){var l,d=e.getTypeOf(n);return d?("arraybuffer"===d?n=e.transformTo("uint8array",n):"string"===d&&(c?n=i.decode(n):o&&!0!==a&&(n=u(l=n,r.uint8array?new Uint8Array(l.length):new Array(l.length)))),n):s.Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},function(t,e,n){"use strict";var r=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Object.defineProperty,a=Object.getOwnPropertyDescriptor,s=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"[object Array]"===i.call(t)},c=function(t){if(!t||"[object Object]"!==i.call(t))return!1;var e,n=r.call(t,"constructor"),o=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!o)return!1;for(e in t);return void 0===e||r.call(t,e)},u=function(t,e){o&&"__proto__"===e.name?o(t,e.name,{enumerable:!0,configurable:!0,value:e.newValue,writable:!0}):t[e.name]=e.newValue},l=function(t,e){if("__proto__"===e){if(!r.call(t,e))return;if(a)return a(t,e).value}return t[e]};t.exports=function t(){var e,n,r,i,o,a,d=arguments[0],f=1,h=arguments.length,p=!1;for("boolean"==typeof d&&(p=d,d=arguments[1]||{},f=2),(null==d||"object"!=typeof d&&"function"!=typeof d)&&(d={});f<h;++f)if(null!=(e=arguments[f]))for(n in e)r=l(d,n),d!==(i=l(e,n))&&(p&&i&&(c(i)||(o=s(i)))?(o?(o=!1,a=r&&s(r)?r:[]):a=r&&c(r)?r:{},u(d,{name:n,newValue:t(p,a,i)})):void 0!==i&&u(d,{name:n,newValue:i}));return d}},function(t,e,n){window,t.exports=function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){"use strict";var r;n.r(e),function(t){t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY"}(r||(r={}));var i=r,o=class{constructor(){this.head=null,this.tail=null,this.length=0}append(...t){this.insertBefore(t[0],null),t.length>1&&this.append.apply(this,t.slice(1))}at(t){const e=this.iterator();let n=e();for(;n&&t>0;)t-=1,n=e();return n}contains(t){const e=this.iterator();let n=e();for(;n;){if(n===t)return!0;n=e()}return!1}indexOf(t){const e=this.iterator();let n=e(),r=0;for(;n;){if(n===t)return r;r+=1,n=e()}return-1}insertBefore(t,e){null!=t&&(this.remove(t),t.next=e,null!=e?(t.prev=e.prev,null!=e.prev&&(e.prev.next=t),e.prev=t,e===this.head&&(this.head=t)):null!=this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):(t.prev=null,this.head=this.tail=t),this.length+=1)}offset(t){let e=0,n=this.head;for(;null!=n;){if(n===t)return e;e+=n.length(),n=n.next}return-1}remove(t){this.contains(t)&&(null!=t.prev&&(t.prev.next=t.next),null!=t.next&&(t.next.prev=t.prev),t===this.head&&(this.head=t.next),t===this.tail&&(this.tail=t.prev),this.length-=1)}iterator(t=this.head){return()=>{const e=t;return null!=t&&(t=t.next),e}}find(t,e=!1){const n=this.iterator();let r=n();for(;r;){const i=r.length();if(t<i||e&&t===i&&(null==r.next||0!==r.next.length()))return[r,t];t-=i,r=n()}return[null,0]}forEach(t){const e=this.iterator();let n=e();for(;n;)t(n),n=e()}forEachAt(t,e,n){if(e<=0)return;const[r,i]=this.find(t);let o=t-i;const a=this.iterator(r);let s=a();for(;s&&o<t+e;){const r=s.length();t>o?n(s,t-o,Math.min(e,o+r-t)):n(s,0,Math.min(r,t+e-o)),o+=r,s=a()}}map(t){return this.reduce((e,n)=>(e.push(t(n)),e),[])}reduce(t,e){const n=this.iterator();let r=n();for(;r;)e=t(e,r),r=n();return e}};class a extends Error{constructor(t){super(t="[Parchment] "+t),this.message=t,this.name=this.constructor.name}}class s{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(t,e=!1){return null==t?null:this.blots.has(t)?this.blots.get(t)||null:e?this.find(t.parentNode,e):null}create(t,e,n){const r=this.query(e);if(null==r)throw new a(`Unable to create ${e} blot`);const i=r,o=new i(t,e instanceof Node||e.nodeType===Node.TEXT_NODE?e:i.create(n),n);return s.blots.set(o.domNode,o),o}find(t,e=!1){return s.find(t,e)}query(t,e=i.ANY){let n;return"string"==typeof t?n=this.types[t]||this.attributes[t]:t instanceof Text||t.nodeType===Node.TEXT_NODE?n=this.types.text:"number"==typeof t?t&i.LEVEL&i.BLOCK?n=this.types.block:t&i.LEVEL&i.INLINE&&(n=this.types.inline):t instanceof HTMLElement&&((t.getAttribute("class")||"").split(/\s+/).some(t=>!!(n=this.classes[t])),n=n||this.tags[t.tagName]),null==n?null:e&i.LEVEL&n.scope&&e&i.TYPE&n.scope?n:null}register(...t){if(t.length>1)return t.map(t=>this.register(t));const e=t[0];if("string"!=typeof e.blotName&&"string"!=typeof e.attrName)throw new a("Invalid definition");if("abstract"===e.blotName)throw new a("Cannot register abstract class");return this.types[e.blotName||e.attrName]=e,"string"==typeof e.keyName?this.attributes[e.keyName]=e:(null!=e.className&&(this.classes[e.className]=e),null!=e.tagName&&(Array.isArray(e.tagName)?e.tagName=e.tagName.map(t=>t.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;class c{constructor(t,e){this.scroll=t,this.domNode=e,s.blots.set(e,this),this.prev=null,this.next=null}static create(t){if(null==this.tagName)throw new a("Blot definition missing tagName");let e;return Array.isArray(this.tagName)?("string"==typeof t&&(t=t.toUpperCase(),parseInt(t,10).toString()===t&&(t=parseInt(t,10))),e="number"==typeof t?document.createElement(this.tagName[t-1]):this.tagName.indexOf(t)>-1?document.createElement(t):document.createElement(this.tagName[0])):e=document.createElement(this.tagName),this.className&&e.classList.add(this.className),e}get statics(){return this.constructor}attach(){}clone(){const t=this.domNode.cloneNode(!1);return this.scroll.create(t)}detach(){null!=this.parent&&this.parent.removeChild(this),s.blots.delete(this.domNode)}deleteAt(t,e){this.isolate(t,e).remove()}formatAt(t,e,n,r){const o=this.isolate(t,e);if(null!=this.scroll.query(n,i.BLOT)&&r)o.wrap(n,r);else if(null!=this.scroll.query(n,i.ATTRIBUTE)){const t=this.scroll.create(this.statics.scope);o.wrap(t),t.format(n,r)}}insertAt(t,e,n){const r=null==n?this.scroll.create("text",e):this.scroll.create(e,n),i=this.split(t);this.parent.insertBefore(r,i||void 0)}isolate(t,e){const n=this.split(t);if(null==n)throw new Error("Attempt to isolate at end");return n.split(e),n}length(){return 1}offset(t=this.parent){return null==this.parent||this===t?0:this.parent.children.offset(this)+this.parent.offset(t)}optimize(t){!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(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;return null!=this.parent&&(this.parent.insertBefore(n,this.next||void 0),this.remove()),n}split(t,e){return 0===t?this:this.next}update(t,e){}wrap(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;if(null!=this.parent&&this.parent.insertBefore(n,this.next||void 0),"function"!=typeof n.appendChild)throw new a(`Cannot wrap ${t}`);return n.appendChild(this),n}}c.blotName="abstract";var u=c;class l extends u{constructor(t,e){super(t,e),this.uiNode=null,this.build()}appendChild(t){this.insertBefore(t)}attach(){super.attach(),this.children.forEach(t=>{t.attach()})}attachUI(t){null!=this.uiNode&&this.uiNode.remove(),this.uiNode=t,l.uiClass&&this.uiNode.classList.add(l.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new o,Array.from(this.domNode.childNodes).filter(t=>t!==this.uiNode).reverse().forEach(t=>{try{const e=d(t,this.scroll);this.insertBefore(e,this.children.head||void 0)}catch(t){if(t instanceof a)return;throw t}})}deleteAt(t,e){if(0===t&&e===this.length())return this.remove();this.children.forEachAt(t,e,(t,e,n)=>{t.deleteAt(e,n)})}descendant(t,e=0){const[n,r]=this.children.find(e);return null==t.blotName&&t(n)||null!=t.blotName&&n instanceof t?[n,r]:n instanceof l?n.descendant(t,r):[null,-1]}descendants(t,e=0,n=Number.MAX_VALUE){let r=[],i=n;return this.children.forEachAt(e,n,(e,n,o)=>{(null==t.blotName&&t(e)||null!=t.blotName&&e instanceof t)&&r.push(e),e instanceof l&&(r=r.concat(e.descendants(t,n,i))),i-=o}),r}detach(){this.children.forEach(t=>{t.detach()}),super.detach()}enforceAllowedChildren(){let t=!1;this.children.forEach(e=>{t||this.statics.allowedChildren.some(t=>e instanceof t)||(e.statics.scope===i.BLOCK_BLOT?(null!=e.next&&this.splitAfter(e),null!=e.prev&&this.splitAfter(e.prev),e.parent.unwrap(),t=!0):e instanceof l?e.unwrap():e.remove())})}formatAt(t,e,n,r){this.children.forEachAt(t,e,(t,e,i)=>{t.formatAt(e,i,n,r)})}insertAt(t,e,n){const[r,i]=this.children.find(t);if(r)r.insertAt(i,e,n);else{const t=null==n?this.scroll.create("text",e):this.scroll.create(e,n);this.appendChild(t)}}insertBefore(t,e){null!=t.parent&&t.parent.children.remove(t);let n=null;this.children.insertBefore(t,e||null),null!=e&&(n=e.domNode),this.domNode.parentNode===t.domNode&&this.domNode.nextSibling===n||this.domNode.insertBefore(t.domNode,n),t.parent=this,t.attach()}length(){return this.children.reduce((t,e)=>t+e.length(),0)}moveChildren(t,e){this.children.forEach(n=>{t.insertBefore(n,e)})}optimize(t){if(super.optimize(t),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 t=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(t)}else this.remove()}path(t,e=!1){const[n,r]=this.children.find(t,e),i=[[this,t]];return n instanceof l?i.concat(n.path(r,e)):(null!=n&&i.push([n,r]),i)}removeChild(t){this.children.remove(t)}replaceWith(t,e){const n="string"==typeof t?this.scroll.create(t,e):t;return n instanceof l&&this.moveChildren(n),super.replaceWith(n)}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const n=this.clone();return this.parent&&this.parent.insertBefore(n,this.next||void 0),this.children.forEachAt(t,this.length(),(t,r,i)=>{const o=t.split(r,e);null!=o&&n.appendChild(o)}),n}splitAfter(t){const e=this.clone();for(;null!=t.next;)e.appendChild(t.next);return this.parent&&this.parent.insertBefore(e,this.next||void 0),e}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(t,e){const n=[],r=[];t.forEach(t=>{t.target===this.domNode&&"childList"===t.type&&(n.push.apply(n,t.addedNodes),r.push.apply(r,t.removedNodes))}),r.forEach(t=>{if(null!=t.parentNode&&"IFRAME"!==t.tagName&&document.body.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const e=this.scroll.find(t);null!=e&&(null!=e.domNode.parentNode&&e.domNode.parentNode!==this.domNode||e.detach())}),n.filter(t=>t.parentNode===this.domNode||t===this.uiNode).sort((t,e)=>t===e?0:t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(t=>{let e=null;null!=t.nextSibling&&(e=this.scroll.find(t.nextSibling));const n=d(t,this.scroll);n.next===e&&null!=n.next||(null!=n.parent&&n.parent.removeChild(this),this.insertBefore(n,e||void 0))}),this.enforceAllowedChildren()}}function d(t,e){let n=e.find(t);if(null==n)try{n=e.create(t)}catch(r){n=e.create(i.INLINE),Array.from(t.childNodes).forEach(t=>{n.domNode.appendChild(t)}),t.parentNode&&t.parentNode.replaceChild(n.domNode,t),n.attach()}return n}l.uiClass="";var f=l;class h extends f{checkMerge(){return null!==this.next&&this.next.statics.blotName===this.statics.blotName}deleteAt(t,e){super.deleteAt(t,e),this.enforceAllowedChildren()}formatAt(t,e,n,r){super.formatAt(t,e,n,r),this.enforceAllowedChildren()}insertAt(t,e,n){super.insertAt(t,e,n),this.enforceAllowedChildren()}optimize(t){super.optimize(t),this.children.length>0&&null!=this.next&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}}h.blotName="container",h.scope=i.BLOCK_BLOT;var p=h;class m extends u{static value(t){return!0}index(t,e){return this.domNode===t||this.domNode.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(e,1):-1}position(t,e){let n=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return t>0&&(n+=1),[this.parent.domNode,n]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}}m.scope=i.INLINE_BLOT;var g=m;class v{static keys(t){return Array.from(t.attributes).map(t=>t.name)}constructor(t,e,n={}){this.attrName=t,this.keyName=e;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)}add(t,e){return!!this.canAdd(t,e)&&(t.setAttribute(this.keyName,e),!0)}canAdd(t,e){return null==this.whitelist||("string"==typeof e?this.whitelist.indexOf(e.replace(/["']/g,""))>-1:this.whitelist.indexOf(e)>-1)}remove(t){t.removeAttribute(this.keyName)}value(t){const e=t.getAttribute(this.keyName);return this.canAdd(t,e)&&e?e:""}}function y(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(t=>0===t.indexOf(`${e}-`))}var _=class extends v{static keys(t){return(t.getAttribute("class")||"").split(/\s+/).map(t=>t.split("-").slice(0,-1).join("-"))}add(t,e){return!!this.canAdd(t,e)&&(this.remove(t),t.classList.add(`${this.keyName}-${e}`),!0)}remove(t){y(t,this.keyName).forEach(e=>{t.classList.remove(e)}),0===t.classList.length&&t.removeAttribute("class")}value(t){const e=(y(t,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(t,e)?e:""}};function b(t){const e=t.split("-"),n=e.slice(1).map(t=>t[0].toUpperCase()+t.slice(1)).join("");return e[0]+n}var x=class extends v{static keys(t){return(t.getAttribute("style")||"").split(";").map(t=>t.split(":")[0].trim())}add(t,e){return!!this.canAdd(t,e)&&(t.style[b(this.keyName)]=e,!0)}remove(t){t.style[b(this.keyName)]="",t.getAttribute("style")||t.removeAttribute("style")}value(t){const e=t.style[b(this.keyName)];return this.canAdd(t,e)?e:""}},w=class{constructor(t){this.attributes={},this.domNode=t,this.build()}attribute(t,e){e?t.add(this.domNode,e)&&(null!=t.value(this.domNode)?this.attributes[t.attrName]=t:delete this.attributes[t.attrName]):(t.remove(this.domNode),delete this.attributes[t.attrName])}build(){this.attributes={};const t=s.find(this.domNode);if(null==t)return;const e=v.keys(this.domNode),n=_.keys(this.domNode),r=x.keys(this.domNode);e.concat(n).concat(r).forEach(e=>{const n=t.scroll.query(e,i.ATTRIBUTE);n instanceof v&&(this.attributes[n.attrName]=n)})}copy(t){Object.keys(this.attributes).forEach(e=>{const n=this.attributes[e].value(this.domNode);t.format(e,n)})}move(t){this.copy(t),Object.keys(this.attributes).forEach(t=>{this.attributes[t].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((t,e)=>(t[e]=this.attributes[e].value(this.domNode),t),{})}};class k extends f{constructor(t,e){super(t,e),this.attributes=new w(this.domNode)}static formats(t,e){const n=e.query(k.blotName);if(null==n||t.tagName!==n.tagName)return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)}format(t,e){if(t!==this.statics.blotName||e){const n=this.scroll.query(t,i.INLINE);if(null==n)return;n instanceof v?this.attributes.attribute(n,e):!e||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e)}else this.children.forEach(t=>{t instanceof k||(t=t.wrap(k.blotName,!0)),this.attributes.copy(t)}),this.unwrap()}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,r){null!=this.formats()[n]||this.scroll.query(n,i.ATTRIBUTE)?this.isolate(t,e).format(n,r):super.formatAt(t,e,n,r)}optimize(t){super.optimize(t);const e=this.formats();if(0===Object.keys(e).length)return this.unwrap();const n=this.next;n instanceof k&&n.prev===this&&function(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}(e,n.formats())&&(n.moveChildren(this),n.remove())}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}wrap(t,e){const n=super.wrap(t,e);return n instanceof k&&this.attributes.move(n),n}}k.allowedChildren=[k,g],k.blotName="inline",k.scope=i.INLINE_BLOT,k.tagName="SPAN";var S=k;class E extends f{constructor(t,e){super(t,e),this.attributes=new w(this.domNode)}static formats(t,e){const n=e.query(E.blotName);if(null==n||t.tagName!==n.tagName)return"string"==typeof this.tagName||(Array.isArray(this.tagName)?t.tagName.toLowerCase():void 0)}format(t,e){const n=this.scroll.query(t,i.BLOCK);null!=n&&(n instanceof v?this.attributes.attribute(n,e):t!==this.statics.blotName||e?!e||t===this.statics.blotName&&this.formats()[t]===e||this.replaceWith(t,e):this.replaceWith(E.blotName))}formats(){const t=this.attributes.values(),e=this.statics.formats(this.domNode,this.scroll);return null!=e&&(t[this.statics.blotName]=e),t}formatAt(t,e,n,r){null!=this.scroll.query(n,i.BLOCK)?this.format(n,r):super.formatAt(t,e,n,r)}insertAt(t,e,n){if(null==n||null!=this.scroll.query(e,i.INLINE))super.insertAt(t,e,n);else{const r=this.split(t);if(null==r)throw new Error("Attempt to insertAt after block boundaries");{const t=this.scroll.create(e,n);r.parent.insertBefore(t,r)}}}replaceWith(t,e){const n=super.replaceWith(t,e);return this.attributes.copy(n),n}update(t,e){super.update(t,e),t.some(t=>t.target===this.domNode&&"attributes"===t.type)&&this.attributes.build()}}E.blotName="block",E.scope=i.BLOCK_BLOT,E.tagName="P",E.allowedChildren=[S,E,g];var C=E,M=class extends g{static formats(t,e){}format(t,e){super.formatAt(0,this.length(),t,e)}formatAt(t,e,n,r){0===t&&e===this.length()?this.format(n,r):super.formatAt(t,e,n,r)}formats(){return this.statics.formats(this.domNode,this.scroll)}};const T={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},O=100;class A extends f{constructor(t,e){super(null,e),this.registry=t,this.scroll=this,this.build(),this.observer=new MutationObserver(t=>{this.update(t)}),this.observer.observe(this.domNode,T),this.attach()}create(t,e){return this.registry.create(this,t,e)}find(t,e=!1){return this.registry.find(t,e)}query(t,e=i.ANY){return this.registry.query(t,e)}register(...t){return this.registry.register(...t)}build(){null!=this.scroll&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(t,e){this.update(),0===t&&e===this.length()?this.children.forEach(t=>{t.remove()}):super.deleteAt(t,e)}formatAt(t,e,n,r){this.update(),super.formatAt(t,e,n,r)}insertAt(t,e,n){this.update(),super.insertAt(t,e,n)}optimize(t=[],e={}){super.optimize(e);const n=e.mutationsMap||new WeakMap;let r=Array.from(this.observer.takeRecords());for(;r.length>0;)t.push(r.pop());const i=(t,e=!0)=>{null!=t&&t!==this&&null!=t.domNode.parentNode&&(n.has(t.domNode)||n.set(t.domNode,[]),e&&i(t.parent))},o=t=>{n.has(t.domNode)&&(t instanceof f&&t.children.forEach(o),n.delete(t.domNode),t.optimize(e))};let a=t;for(let e=0;a.length>0;e+=1){if(e>=O)throw new Error("[Parchment] Maximum optimize iterations reached");for(a.forEach(t=>{const e=this.find(t.target,!0);null!=e&&(e.domNode===t.target&&("childList"===t.type?(i(this.find(t.previousSibling,!1)),Array.from(t.addedNodes).forEach(t=>{const e=this.find(t,!1);i(e,!1),e instanceof f&&e.children.forEach(t=>{i(t,!1)})})):"attributes"===t.type&&i(e.prev)),i(e))}),this.children.forEach(o),r=(a=Array.from(this.observer.takeRecords())).slice();r.length>0;)t.push(r.pop())}}update(t,e={}){t=t||this.observer.takeRecords();const n=new WeakMap;t.map(t=>{const e=s.find(t.target,!0);return null==e?null:n.has(e.domNode)?(n.get(e.domNode).push(t),null):(n.set(e.domNode,[t]),e)}).forEach(t=>{null!=t&&t!==this&&n.has(t.domNode)&&t.update(n.get(t.domNode)||[],e)}),e.mutationsMap=n,n.has(this.domNode)&&super.update(n.get(this.domNode),e),this.optimize(t,e)}}A.blotName="scroll",A.defaultChild=C,A.allowedChildren=[C,p],A.scope=i.BLOCK_BLOT,A.tagName="DIV";var N=A;class P extends g{constructor(t,e){super(t,e),this.text=this.statics.value(this.domNode)}static create(t){return document.createTextNode(t)}static value(t){return t.data}deleteAt(t,e){this.domNode.data=this.text=this.text.slice(0,t)+this.text.slice(t+e)}index(t,e){return this.domNode===t?e:-1}insertAt(t,e,n){null==n?(this.text=this.text.slice(0,t)+e+this.text.slice(t),this.domNode.data=this.text):super.insertAt(t,e,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 P&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(t,e=!1){return[this.domNode,t]}split(t,e=!1){if(!e){if(0===t)return this;if(t===this.length())return this.next}const n=this.scroll.create(this.domNode.splitText(t));return this.parent.insertBefore(n,this.next||void 0),this.text=this.statics.value(this.domNode),n}update(t,e){t.some(t=>"characterData"===t.type&&t.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}}P.blotName="text",P.scope=i.INLINE_BLOT;var j=P;n.d(e,"ParentBlot",(function(){return f})),n.d(e,"ContainerBlot",(function(){return p})),n.d(e,"LeafBlot",(function(){return g})),n.d(e,"EmbedBlot",(function(){return M})),n.d(e,"ScrollBlot",(function(){return N})),n.d(e,"BlockBlot",(function(){return C})),n.d(e,"InlineBlot",(function(){return S})),n.d(e,"TextBlot",(function(){return j})),n.d(e,"Attributor",(function(){return v})),n.d(e,"ClassAttributor",(function(){return _})),n.d(e,"StyleAttributor",(function(){return x})),n.d(e,"AttributorStore",(function(){return w})),n.d(e,"Registry",(function(){return s})),n.d(e,"Scope",(function(){return i}))}])},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.convertFieldsError=a,e.format=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var r=1,i=e[0],a=e.length;if("function"==typeof i)return i.apply(null,e.slice(1));if("string"==typeof i){for(var s=String(i).replace(o,(function(t){if("%%"===t)return"%";if(r>=a)return t;switch(t){case"%s":return String(e[r++]);case"%d":return Number(e[r++]);case"%j":try{return JSON.stringify(e[r++])}catch(t){return"[Circular]"}break;default:return t}})),c=e[r];r<a;c=e[++r])s+=" "+c;return s}return i},e.isEmptyValue=function(t,e){if(null==t)return!0;if("array"===e&&Array.isArray(t)&&!t.length)return!0;if(function(t){return"string"===t||"url"===t||"hex"===t||"email"===t||"pattern"===t}(e)&&"string"==typeof t&&!t)return!0;return!1},e.isEmptyObject=function(t){return 0===Object.keys(t).length},e.asyncMap=function(t,e,n,r){if(e.first){return s(function(t){var e=[];return Object.keys(t).forEach((function(n){e.push.apply(e,t[n])})),e}(t),n,r)}var i=e.firstFields||[];!0===i&&(i=Object.keys(t));var o=Object.keys(t),c=o.length,u=0,l=[],d=new Promise((function(e,d){var f=function(t){if(l.push.apply(l,t),++u===c)return r(l),l.length?d({errors:l,fields:a(l)}):e()};o.forEach((function(e){var r=t[e];-1!==i.indexOf(e)?s(r,n,f):function(t,e,n){var r=[],i=0,o=t.length;function a(t){r.push.apply(r,t),++i===o&&n(r)}t.forEach((function(t){e(t,a)}))}(r,n,f)}))}));return d.catch((function(t){return t})),d},e.complementError=function(t){return function(e){return e&&e.message?(e.field=e.field||t.fullField,e):{message:"function"==typeof e?e():e,field:e.field||t.fullField}}},e.deepMerge=function(t,e){if(e)for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];"object"===(void 0===o?"undefined":i(o))&&"object"===i(t[n])?t[n]=r({},t[n],o):t[n]=o}return t};var o=/%[sdj%]/g;e.warning=function(){};function a(t){if(!t||!t.length)return null;var e={};return t.forEach((function(t){var n=t.field;e[n]=e[n]||[],e[n].push(t)})),e}function s(t,e,n){var r=0,i=t.length;!function o(a){if(a&&a.length)n(a);else{var s=r;r+=1,s<i?e(t[s],o):n([])}}([])}"undefined"!=typeof window&&"undefined"!=typeof document&&(e.warning=function(t,e){"undefined"!=typeof console&&console.warn&&e.every((function(t){return"string"==typeof t}))&&console.warn(t,e)})},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r=n(1),i=n(798),o=n(468),a=n(295),s=["zIndex","capture","visible"],c=function t(e){t.superclass.constructor.call(this,e)};c.ATTRS={},r.extend(c,o);var u={matrix:"matrix",path:"path",points:"points",lineDash:"lineDash"};r.augment(c,i,{isShape:!0,drawInner:function(t){var e=this._attrs;this.createPath(t);var n=t.globalAlpha;if(this.hasFill()){var i=e.fillOpacity;r.isNil(i)||1===i?t.fill():(t.globalAlpha=i,t.fill(),t.globalAlpha=n)}if(this.hasStroke()&&this._attrs.lineWidth>0){var o=e.strokeOpacity;r.isNil(o)||1===o||(t.globalAlpha=o),t.stroke()}this.afterPath(t)},afterPath:function(){},isHitBox:function(){return!0},isHit:function(t,e){var n=[t,e,1];if(this.invert(n),this.isHitBox()){var r=this.getBBox();if(r&&!a.box(r.minX,r.maxX,r.minY,r.maxY,n[0],n[1]))return!1}var i=this._attrs.clip;return i?(i.invert(n,this.get("canvas")),!!i.isPointInPath(n[0],n[1])&&this.isPointInPath(n[0],n[1])):this.isPointInPath(n[0],n[1])},calculateBox:function(){return null},getHitLineWidth:function(){var t=this._attrs,e=t.lineAppendWidth||0;return(t.lineWidth||0)+e},clearTotalMatrix:function(){this._cfg.totalMatrix=null,this._cfg.region=null},clearBBox:function(){this._cfg.box=null,this._cfg.region=null},getBBox:function(){var t=this._cfg.box;return t||((t=this.calculateBox())&&(t.x=t.minX,t.y=t.minY,t.width=t.maxX-t.minX,t.height=t.maxY-t.minY),this._cfg.box=t),t},clone:function(){var t=this,e=null,n=t._attrs,i={};return r.each(n,(function(t,e){u[e]&&r.isArray(n[e])?i[e]=function(t){for(var e=[],n=0;n<t.length;n++)r.isArray(t[n])?e.push([].concat(t[n])):e.push(t[n]);return e}(n[e]):i[e]=n[e]})),e=new t.constructor({attrs:i}),r.each(s,(function(n){e._cfg[n]=t._cfg[n]})),e}}),t.exports=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=u(n(427)),i=u(n(705)),o=u(n(706)),a=u(n(707)),s=u(n(708)),c=u(n(709));function u(t){return t&&t.__esModule?t:{default:t}}e.default={required:r.default,whitespace:i.default,type:o.default,range:a.default,enum:s.default,pattern:c.default}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(14),o=(r=i)&&r.__esModule?r:{default:r};var a=function(){var t=!0,e=!1,n=void 0;try{for(var r,i=this.vms[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){var o=r.value;o[this.method].apply(o,arguments)}}catch(t){e=!0,n=t}finally{try{!t&&i.return&&i.return()}finally{if(e)throw n}}},s={data:function(){return{}},methods:{_globalEventAdd:function(t,e,n){var r=this.morning;void 0===r._globalEventListener[t]&&(r._globalEventListener[t]={}),void 0===r._globalEventListener[t][this.$options.name+"."+e]&&(r._globalEventListener[t][this.$options.name+"."+e]={vms:[],method:e,handler:null});var i=r._globalEventListener[t][this.$options.name+"."+e];return i.vms.push(this),i.vms=(0,o.default)(i.vms),null===i.handler&&(i.handler=a.bind(i),"hashchange"===t?window.addEventListener(t,i.handler,n):document.addEventListener(t,i.handler,n)),this},_globalEventRemove:function(t,e){var n=this.morning;if(!n._globalEventListener[t]||!n._globalEventListener[t][this.$options.name+"."+e])return this;var r=n._globalEventListener[t][this.$options.name+"."+e],i=r.vms.indexOf(this);-1!==i&&r.vms.splice(i,1),0===r.vms.length&&("hashchange"===t?window.removeEventListener(t,r.handler):document.removeEventListener(t,r.handler),delete n._globalEventListener[t][this.$options.name+"."+e],0===Object.keys(n._globalEventListener[t]).length&&delete n._globalEventListener[t])}}};e.default=s,t.exports=e.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=v(n(18)),i=n(19),o=v(i),a=v(n(27)),s=v(n(40)),c=v(n(48)),u=v(n(596)),l=v(n(20)),d=v(n(597)),f=v(n(21)),h=v(n(269)),p=v(n(600)),m=v(n(601)),g=v(n(602));function v(t){return t&&t.__esModule?t:{default:t}}r.default.register({"blots/block":o.default,"blots/block/embed":i.BlockEmbed,"blots/break":a.default,"blots/container":s.default,"blots/cursor":c.default,"blots/embed":u.default,"blots/inline":l.default,"blots/scroll":d.default,"blots/text":f.default,"modules/clipboard":h.default,"modules/history":p.default,"modules/keyboard":m.default,"modules/uploader":g.default}),e.default=r.default,t.exports=e.default},function(t,e,n){"use strict";function r(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var n=0;n<this._listeners[t].length;n++)this._listeners[t][n].call(this,e)},pipe:function(t){return t.registerPrevious(this)},registerPrevious:function(t){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=t.streamInfo,this.mergeStreamInfo(),this.previous=t;var e=this;return t.on("data",(function(t){e.processChunk(t)})),t.on("end",(function(){e.end()})),t.on("error",(function(t){e.error(t)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var t=!1;return this.generatedError&&(this.error(this.generatedError),t=!0),this.previous&&this.previous.resume(),!t},flush:function(){},processChunk:function(t){this.push(t)},withStreamInfo:function(t,e){return this.extraStreamInfo[t]=e,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var t in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(t)&&(this.streamInfo[t]=this.extraStreamInfo[t])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var t="Worker "+this.name;return this.previous?this.previous+" -> "+t:t}},t.exports=r},function(t,e,n){"use strict";function r(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=i.width?String(i.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{var s=t.defaultWidth,c=i.width?String(i.width):t.defaultWidth;r=t.values[c]||t.values[s]}return r[t.argumentCallback?t.argumentCallback(e):e]}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t){return function(e,n){var r=String(e),i=n||{},o=i.width,a=o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth],s=r.match(a);if(!s)return null;var c,u=s[0],l=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth];return c="[object Array]"===Object.prototype.toString.call(l)?function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n}(l,(function(t){return t.test(r)})):function(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}(l,(function(t){return t.test(r)})),c=t.valueCallback?t.valueCallback(c):c,{value:c=i.valueCallback?i.valueCallback(c):c,rest:r.slice(u.length)}}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";(function(e){var n;"Set"in e?"function"==typeof Set.prototype.forEach&&(n=!1,new Set([!0]).forEach((function(t){n=t})),!0===n)?t.exports=function(t){var e=[];return new Set(t).forEach((function(t){e.push(t)})),e}:t.exports=function(t){var e=new Set;return t.filter((function(t){return!e.has(t)&&(e.add(t),!0)}))}:t.exports=function(t){for(var e=[],n=0;n<t.length;n++)-1===e.indexOf(t[n])&&e.push(t[n]);return e}}).call(this,n(6))},function(t,e,n){"use strict";function r(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=Object.prototype.toString.call(t);return t instanceof Date||"object"==typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function i(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=r(t).getDay();return 0===e||6===e}function o(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function a(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),a=o(e);if(isNaN(a))return new Date(NaN);var s=n.getHours(),c=a<0?-1:1;n.setDate(n.getDate()+7*o(a/5)),a%=5;for(var u=Math.abs(a);u>0||i(n);)i(n)||(u-=1),n.setDate(n.getDate()+c);return n.setHours(s),n}function s(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=o(e);return n.setDate(n.getDate()+i),n}function c(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t).getTime(),i=o(e);return new Date(n+i)}n.r(e);var u=36e5;function l(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return c(t,o(e)*u)}function d(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var n=e||{},i=n.locale,a=i&&i.options&&i.options.weekStartsOn,s=null==a?0:o(a),c=null==n.weekStartsOn?s:o(n.weekStartsOn);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=r(t),l=u.getDay(),d=(l<c?7:0)+l-c;return u.setDate(u.getDate()-d),u.setHours(0,0,0,0),u}function f(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");return d(t,{weekStartsOn:1})}function h(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=r(t),n=e.getFullYear(),i=new Date(0);i.setFullYear(n+1,0,4),i.setHours(0,0,0,0);var o=f(i),a=new Date(0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);var s=f(a);return e.getTime()>=o.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function p(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=h(t),n=new Date(0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),f(n)}var m=6e4;function g(t){var e=new Date(t.getTime()),n=e.getTimezoneOffset();e.setSeconds(0,0);var r=e.getTime()%m;return n*m+r}function v(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=r(t);return e.setHours(0,0,0,0),e}var y=864e5;function _(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=v(t),r=v(e),i=n.getTime()-g(n),o=r.getTime()-g(r);return Math.round((i-o)/y)}function b(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=o(e),a=_(n,p(n)),s=new Date(0);return s.setFullYear(i,0,4),s.setHours(0,0,0,0),(n=p(s)).setDate(n.getDate()+a),n}function x(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=o(e);return b(t,h(t)+n)}var w=6e4;function k(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return c(t,o(e)*w)}function S(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=r(t),n=e.getFullYear(),i=e.getMonth(),o=new Date(0);return o.setFullYear(n,i+1,0),o.setHours(0,0,0,0),o.getDate()}function E(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=o(e),a=n.getMonth()+i,s=new Date(0);s.setFullYear(n.getFullYear(),a,1),s.setHours(0,0,0,0);var c=S(s);return n.setMonth(a,Math.min(c,n.getDate())),n}function C(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return E(t,3*o(e))}function M(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return c(t,1e3*o(e))}function T(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return s(t,7*o(e))}function O(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return E(t,12*o(e))}function A(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=t||{},i=e||{},o=r(n.start).getTime(),a=r(n.end).getTime(),s=r(i.start).getTime(),c=r(i.end).getTime();if(!(o<=a&&s<=c))throw new RangeError("Invalid interval");return o<c&&s<a}function N(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t);if(isNaN(n))return NaN;var i,o,a=n.getTime();return(null==e?[]:"function"==typeof e.forEach?e:Array.prototype.slice.call(e)).forEach((function(t,e){var n=r(t);if(isNaN(n))return i=NaN,void(o=NaN);var s=Math.abs(a-n.getTime());(null==i||s<o)&&(i=e,o=s)})),i}function P(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t);if(isNaN(n))return new Date(NaN);var i,o,a=n.getTime();return(null==e?[]:"function"==typeof e.forEach?e:Array.prototype.slice.call(e)).forEach((function(t){var e=r(t);if(isNaN(e))return i=new Date(NaN),void(o=NaN);var n=Math.abs(a-e.getTime());(null==i||n<o)&&(i=e,o=n)})),i}function j(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e),o=n.getTime()-i.getTime();return o<0?-1:o>0?1:o}function I(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e),o=n.getTime()-i.getTime();return o>0?-1:o<0?1:o}function L(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=r(t);return!isNaN(e)}function R(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=v(t),r=v(e);return n.getTime()===r.getTime()}function D(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),a=r(e);if(!L(n)||!L(a))return new Date(NaN);var c=_(n,a),u=c<0?-1:1,l=o(c/7),d=5*l;for(a=s(a,7*l);!R(n,a);)d+=i(a)?0:u,a=s(a,u);return 0===d?0:d}function B(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return h(t)-h(e)}var F=6048e5;function q(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=f(t),r=f(e),i=n.getTime()-g(n),o=r.getTime()-g(r);return Math.round((i-o)/F)}function z(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e);return 12*(n.getFullYear()-i.getFullYear())+(n.getMonth()-i.getMonth())}function $(t){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");var e=r(t);return Math.floor(e.getMonth()/3)+1}function U(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e);return 4*(n.getFullYear()-i.getFullYear())+($(n)-$(i))}var H=6048e5;function Y(t,e,n){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var r=d(t,n),i=d(e,n),o=r.getTime()-g(r),a=i.getTime()-g(i);return Math.round((o-a)/H)}function V(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e);return n.getFullYear()-i.getFullYear()}function W(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e),o=j(n,i),a=Math.abs(_(n,i));n.setDate(n.getDate()-o*a);var s=o*(a-(j(n,i)===-o));return 0===s?0:s}function G(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e);return n.getTime()-i.getTime()}var X=36e5;function Z(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=G(t,e)/X;return n>0?Math.floor(n):Math.ceil(n)}function K(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");return x(t,-o(e))}function Q(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e),o=j(n,i),a=Math.abs(B(n,i)),s=o*(a-(j(n=K(n,o*a),i)===-o));return 0===s?0:s}var J=6e4;function tt(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=G(t,e)/J;return n>0?Math.floor(n):Math.ceil(n)}function et(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=r(t),i=r(e),o=j(n,i),a=Math.abs(z(n,i));n.setMonth(n.getMonth()-o*a);var s=o*(a-(j(n,i)===-o));return 0===s?0:s}function nt(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=et(t,e)/3;return n>0?Math.floor(n):Math.ceil(n)}function rt(t,e){if(arguments.length<2)throw new TypeError("2 arguments required, but only "+arguments.length+" present");var n=G(t,e)/1e3;return n>0?Math.floor(n):Math.ceil(n)}function it(t,e){if(