UNPKG

tui-editor

Version:

GFM Markdown Wysiwyg Editor - Productive and Extensible

7 lines 472 kB
/*! * tui-editor * @version 1.4.10 * @author NHN FE Development Lab <dl_javascript@nhn.com> (https://nhn.github.io/tui.editor/) * @license MIT */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("jquery"),require("tui-code-snippet"),require("codemirror"),require("to-mark"),require("tui-chart"),require("squire-rte"),require("markdown-it"),require("highlight.js"),require("tui-color-picker"),require("plantuml-encoder")):"function"==typeof define&&define.amd?define(["jquery","tui-code-snippet","codemirror","to-mark","tui-chart","squire-rte","markdown-it","highlight.js","tui-color-picker","plantuml-encoder"],t):"object"==typeof exports?exports.Editor=t(require("jquery"),require("tui-code-snippet"),require("codemirror"),require("to-mark"),require("tui-chart"),require("squire-rte"),require("markdown-it"),require("highlight.js"),require("tui-color-picker"),require("plantuml-encoder")):(e.tui=e.tui||{},e.tui.Editor=t(e.$,e.tui.util,e.CodeMirror,e.toMark,e.tui.chart,e.Squire,e.markdownit,e.hljs,e.tui.colorPicker,e.plantumlEncoder))}(window,(function(e,t,n,r,i,o,a,l,s,u){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist",n(n.s=55)}([function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(0)),o=l(n(1)),a=l(n(84));function l(e){return e&&e.__esModule?e:{default:e}}var s=n(39).isMac?1:0,u=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._command=new o.default.Map,this._mdCommand=new o.default.Map,this._wwCommand=new o.default.Map,this._options=i.default.extend({useCommandShortcut:!0},n),this.base=t,this.keyMapCommand={},this._initEvent()}return r(e,[{key:"_addCommandBefore",value:function(e){var t={command:e};return this.base.eventManager.emit("addCommandBefore",t),t.command||e}},{key:"addCommand",value:function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];r.length&&(t=e.command.apply(e,[t].concat(r)));var o=(t=this._addCommandBefore(t)).getName(),a=void 0;return t.isMDType()?a=this._mdCommand:t.isWWType()?a=this._wwCommand:t.isGlobalType()&&(a=this._command),a.set(o,t),t.keyMap&&(this.keyMapCommand[t.keyMap[s]]=o),t}},{key:"_initEvent",value:function(){var e=this;this.base.eventManager.listen("command",(function(){e.exec.apply(e,arguments)})),this.base.eventManager.listen("keyMap",(function(t){if(e._options.useCommandShortcut){var n=e.keyMapCommand[t.keyMap];n&&(t.data.preventDefault(),e.exec(n))}}))}},{key:"exec",value:function(e){var t=void 0,n=void 0,r=this.base;if((t=this._command.get(e))||(this.base.isMarkdownMode()?(t=this._mdCommand.get(e),r=this.base.mdEditor):(t=this._wwCommand.get(e),r=this.base.wwEditor)),t){for(var i,o=arguments.length,a=Array(o>1?o-1:0),l=1;l<o;l++)a[l-1]=arguments[l];a.unshift(r),n=(i=t).exec.apply(i,a)}return n}}]),e}();u.command=function(e,t){var n=a.default.factory(e,t.name,t.keyMap);return o.default.extend(n,t),n},t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.I18n=void 0;var r,i=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=(r=o)&&r.__esModule?r:{default:r};var l=void 0,s="en_US",u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._code=s,this._langs=new a.default.Map}return i(e,[{key:"setCode",value:function(e){this._code=e}},{key:"setLanguage",value:function(e,t){var n=this;(e=[].concat(e)).forEach((function(e){if(n._langs.has(e)){var r=n._langs.get(e);n._langs.set(e,a.default.extend(r,t))}else n._langs.set(e,t)}))}},{key:"get",value:function(e,t){t||(t=this._code);var n=this._langs.get(t);n||(n=this._langs.get(s));var r=n[e];if(!r)throw new Error('There is no text key "'+e+'" in '+t);return r}}],[{key:"getSharedInstance",value:function(){return l||(l=new e),l}}]),e}();t.I18n=u,t.default=new u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var a=/\u200B/g,l=function(e){return e&&e.nodeType===Node.TEXT_NODE},s=function(e){return e&&e.nodeType===Node.ELEMENT_NODE},u=function(e){return s(e)?e.tagName:"TEXT"},c=function(e){var t=void 0;return s(e)?t=e.textContent.replace(a,"").length:l(e)&&(t=e.nodeValue.replace(a,"").length),t},d=function(e){var t,n=e.parentNode.childNodes,r=void 0,i=void 0;for(r=0,t=n.length;r<t;r+=1)if(n[r]===e){i=r;break}return i},f=function(e,t){var n=void 0;return l(e)?n=e:e.childNodes.length&&t>=0&&(n=e.childNodes[t]),n},h=function(e,t,n){for(var r=e+"Sibling",i=void 0,o=void 0;t&&!t[r]&&(i=u(t.parentNode))!==n&&"BODY"!==i;)t=t.parentNode;return t[r]&&(o=t[r]),o},g=function(e,t,n){for(var r=void 0;e.parentNode&&!t(e.parentNode)&&(e=e.parentNode,!n||!n(e.parentNode)););return t(e.parentNode)&&(r=e),r},p=function(e,t){return i.default.isString(t)?g(e,(function(e){return t===u(e)})):g(e,(function(e){return t===e}))},v=function(e,t,n){var r=e+"Sibling",i=void 0;return(t=p(t,n))&&t[r]&&(i=t[r]),i},m=function(e){var t={};t.tagName=e.nodeName,e.id&&(t.id=e.id);var n=e.className.trim();return n&&(t.className=n),t},y=function(e,t,n){var r=t;if(r&&e===r.parentNode)for(;r!==n;){var i=r.nextSibling;e.removeChild(r),r=i}},b=function(e){return!!e&&("UL"===e.nodeName||"OL"===e.nodeName)},_=function(e,t){e.hasChildNodes()&&(i.default.forEachArray(e.childNodes,(function(){t.appendChild(e.firstChild)})),t.normalize()),e.parentNode&&e.parentNode.removeChild(e)},w=function(e,t){if("SPAN"!==e.nodeName)for(var n=e.parentNode,r=e;r.childNodes&&1===r.childNodes.length&&!l(r.firstChild)&&"SPAN"!==(r=r.firstChild).nodeName;)if(r.nodeName===t){var i=document.createElement(t);return _(r,r.parentNode),n.replaceChild(i,e),i.appendChild(e),i}return e},k=function(e,t,n){var r=w(e,n);if(r.nodeName===n)for(var i=w(t,n),o=r,a=r.nextSibling;a;){var l=a.nextSibling;if((a=w(a,n)).nodeName===n?o?_(a,o):o=a:o=null,a===i)break;a=l}};t.default={getNodeName:u,isTextNode:l,isElemNode:s,isBlockNode:function(e){return/^(ADDRESS|ARTICLE|ASIDE|BLOCKQUOTE|DETAILS|DIALOG|DD|DIV|DL|DT|FIELDSET|FIGCAPTION|FIGURE|FOOTER|FORM|H[\d]|HEADER|HGROUP|HR|LI|MAIN|NAV|OL|P|PRE|SECTION|UL)$/gi.test(this.getNodeName(e))},getTextLength:c,getOffsetLength:function(e){var t=void 0;return s(e)?t=e.childNodes.length:l(e)&&(t=e.nodeValue.replace(a,"").length),t},getPrevOffsetNodeUntil:function(e,t,n){return t>0?f(e,t-1):h("previous",e,n)},getNodeOffsetOfParent:d,getChildNodeByOffset:f,getNodeWithDirectionUntil:h,containsNode:function(e,t){for(var n=document.createTreeWalker(e,4,null,!1),r=e===t;!r&&n.nextNode();)r=n.currentNode===t;return r},getTopPrevNodeUnder:function(e,t){return v("previous",e,t)},getTopNextNodeUnder:function(e,t){return v("next",e,t)},getParentUntilBy:g,getParentUntil:p,getTopBlockNode:function(e){return p(e,"BODY")},getPrevTextNode:function(e){for(e=e.previousSibling||e.parentNode;!l(e)&&"BODY"!==u(e);)if(e.previousSibling)for(e=e.previousSibling;e.lastChild;)e=e.lastChild;else e=e.parentNode;return"BODY"===u(e)&&(e=null),e},findOffsetNode:function(e,t,n){var r=[],o="",a=0,l=void 0;if(!t.length)return r;for(var s=t.shift(),u=document.createTreeWalker(e,4,null,!1);u.nextNode();){for(o=u.currentNode.nodeValue||"",n&&(o=n(o)),l=a+o.length;l>=s;){if(r.push({container:u.currentNode,offsetInContainer:s-a,offset:s}),!t.length)return r;s=t.shift()}a=l}do{r.push({container:u.currentNode,offsetInContainer:o.length,offset:s}),s=t.shift()}while(!i.default.isUndefined(s));return r},getPath:function(e,t){for(var n=[];e&&e!==t;)s(e)&&n.unshift(m(e)),e=e.parentNode;return n},getNodeInfo:m,getTableCellByDirection:function(e,t){var n=null;return i.default.isUndefined(t)||"next"!==t&&"previous"!==t||(n="next"===t?e.nextElementSibling:e.previousElementSibling),n},getSiblingRowCellByDirection:function(e,t,n){var o=null,a=void 0,l=void 0,s=void 0,c=void 0,f=void 0,h=void 0;return i.default.isUndefined(t)||"next"!==t&&"previous"!==t||e&&(a=(0,r.default)(e),"next"===t?(s=a.parent().next(),h=(f=(c=a.parents("thead"))[0]&&c.next())&&"TBODY"===u(f[0]),l=0):(s=a.parent().prev(),h=(f=(c=a.parents("tbody"))[0]&&c.prev())&&"THEAD"===u(f[0]),l=e.parentNode.childNodes.length-1),!i.default.isUndefined(n)&&n||(l=d(e)),s[0]?o=s.children("td,th")[l]:c[0]&&h&&(o=f.find("td,th")[l])),o},isMDSupportInlineNode:function(e){return/^(A|B|BR|CODE|DEL|EM|I|IMG|S|SPAN|STRONG)$/gi.test(e.nodeName)},isStyledNode:function(e){return/^(A|ABBR|ACRONYM|B|BDI|BDO|BIG|CITE|CODE|DEL|DFN|EM|I|INS|KBD|MARK|Q|S|SAMP|SMALL|SPAN|STRONG|SUB|SUP|U|VAR)$/gi.test(e.nodeName)},removeChildFromStartToEndNode:y,removeNodesByDirection:function(e,t,n){for(var r=t;r!==e;){var i=r.parentNode,o=r,a=o.nextSibling,l=o.previousSibling;!n&&a?y(i,a,null):n&&l&&y(i,i.childNodes[0],r),r=i}},getLeafNode:function(e){for(var t=e;t.childNodes&&t.childNodes.length;){var n=t.firstChild;t=l(n)&&!c(n)&&n.nextSibling||n}return t},isInsideTaskBox:function(e,t,n){var r=parseInt(e.left,10),i=parseInt(e.top,10),o=parseInt(e.width,10),a=parseInt(e.height,10);return t>=r&&t<=r+o&&n>=i&&n<=i+a},isListNode:b,isFirstListItem:function(e){var t=e.nodeName,n=e.parentNode;return"LI"===t&&e===n.firstChild},isFirstLevelListItem:function(e){var t=e.nodeName,n=e.parentNode.parentNode;return"LI"===t&&!b(n)},mergeNode:_,createHorizontalRule:function(){var e=document.createElement("div"),t=document.createElement("hr");return e.setAttribute("contenteditable",!1),t.setAttribute("contenteditable",!1),e.appendChild(t),e},createEmptyLine:function(){var e=document.createElement("div");return e.appendChild(document.createElement("br")),e},changeTagOrder:w,mergeSameNodes:k,optimizeRange:function(e,t){var n=e.collapsed,r=e.commonAncestorContainer,i=e.startContainer,o=e.endContainer;if(!n){var a=null;if(i!==o?(k(p(i,r),p(o,r),t),a=r):l(i)&&(a=i.parentNode),a&&a.nodeName===t){var s=a.previousSibling,u=void 0;s&&(u=w(s)).nodeName===t&&_(a,u);var c=a.nextSibling;c&&(u=w(c)).nodeName===t&&_(u,a)}}},getAllTextNode:function(e){for(var t=document.createTreeWalker(e,4,null,!1),n=[];t.nextNode();){var r=t.currentNode;l(r)&&n.push(r)}return n},isCellNode:function(e){return!!e&&("TD"===e.nodeName||"TH"===e.nodeName)},getLastNodeBy:function(e,t){for(var n=e&&e.lastChild;n&&t(n);)n=n.lastChild;return n},getParentNodeBy:function(e,t){for(;e&&t(e.parentNode,e);)e=e.parentNode;return e},getSiblingNodeBy:function(e,t,n){for(var r=t+"Sibling";e&&n(e[r],e);)e=e[r];return e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=void 0;try{r=n(30)}catch(e){}if(!r)try{r=n(!function(){var e=new Error("Cannot find module '../viewer'");throw e.code="MODULE_NOT_FOUND",e}())}catch(e){}t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTableData=a,t.createCellIndexData=l;var r=o(n(0)),i=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=[];return e.find("tr").each((function(e,n){var o=0;t[e]=t[e]||[],(0,r.default)(n).children().each((function(n,a){var l=function(e,t,n){var i=(0,r.default)(e),o=i.attr("colspan"),a=i.attr("rowspan"),l=e.nodeName;if("TH"!==l&&"TD"!==l)return null;var s={nodeName:e.nodeName,colspan:o?parseInt(o,10):1,rowspan:a?parseInt(a,10):1,content:i.html(),elementIndex:{rowIndex:t,colIndex:n}};return"TH"===e.nodeName&&e.align&&(s.align=e.align),s}(a,e,n);if(l){for(var s=n+o;t[e][s];)s+=1,o+=1;t[e][s]=l,function(e,t,n,r){var o=t.colspan,a=t.rowspan,l=t.nodeName,s=o>1,u=a>1;if(s||u){var c=n+a,d=r+o;i.default.range(n,c).forEach((function(t){e[t]=e[t]||[],i.default.range(r,d).forEach((function(i){var o={nodeName:l};t===n&&i===r||(s&&(o.colMergeWith=r),u&&(o.rowMergeWith=n),e[t][i]=o)}))}))}}(t,l,e,s)}}))})),e[0].className&&(t.className=e[0].className),t}function l(e){var t=[];return e.forEach((function(e,n){var r=[];e.forEach((function(e,t){i.default.isUndefined(e.colMergeWith)&&i.default.isUndefined(e.rowMergeWith)&&r.push({rowIndex:n,colIndex:t})})),t.push(r)})),t}var s=i.default.browser.msie?"":"<br>";function u(e,t,n){return{nodeName:n||"TD",colspan:1,rowspan:1,content:s,elementIndex:{rowIndex:e,colIndex:t}}}function c(e){var t=e.closest("tr"),n=t.prevAll().length;return"TBODY"===t.parent()[0].nodeName&&(n+=1),n}function d(e){return e.closest("td, th").prevAll().length}t.default={createTableData:a,createCellIndexData:l,createRenderData:function(e,t){var n=function(e){var t=e[0];return t.map((function(e){return i.default.isExisty(e.colMergeWith)?t[e.colMergeWith].align:e.align}))}(e),r=t.map((function(t){return t.map((function(t){var r=t.rowIndex,o=t.colIndex;return i.default.extend({align:n[o]},e[r][o])}))}));return e.className&&(r.className=e.className),r},findElementRowIndex:c,findElementColIndex:d,findCellIndex:function(e,t){var n=c(t),r=d(t);return e[n][r]},createBasicCell:u,findRowMergedLastIndex:function(e,t,n){var r=e[t][n],i=t;return r.rowspan>1&&(i+=r.rowspan-1),i},findColMergedLastIndex:function(e,t,n){var r=e[t][n],i=n;return r.colspan>1&&(i+=r.colspan-1),i},findElementIndex:function(e,t,n){var r=e[t][n];return t=i.default.isExisty(r.rowMergeWith)?r.rowMergeWith:t,n=i.default.isExisty(r.colMergeWith)?r.colMergeWith:n,e[t][n].elementIndex},stuffCellsIntoIncompleteRow:function(e,t){e.forEach((function(e,n){var r=e.length;if(r){var o=e[0].nodeName;i.default.range(r,t).forEach((function(t){e.push(u(n,t,o))}))}}))},addTbodyOrTheadIfNeed:function(e){var t=e[0],n=t.length,r=!0;if(!n&&e[1])i.default.range(0,e[1].length).forEach((function(e){t.push(u(0,e,"TH"))}));else if("TH"!==e[0][0].nodeName){var o,a=i.default.range(0,n).map((function(e){return u(0,e,"TH")}));(o=[]).concat.apply(o,e).forEach((function(e){e.elementIndex&&(e.elementIndex.rowIndex+=1)})),e.unshift(a)}else if(1===e.length){var l=i.default.range(0,n).map((function(e){return u(1,e,"TD")}));e.push(l)}else r=!1;return r}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=l(n(0)),o=l(n(1)),a=l(n(14));function l(e){return e&&e.__esModule?e:{default:e}}var s="tui-popup-",u='<div class="'+s+'header">\n <span class="'+s+'title"></span>\n <div class="'+s+'header-buttons">\n <button type="button" class="'+s+'close-button"></button>\n </div>\n </div>\n <div class="'+s+'body"></div>',c='<div class="'+s+'wrapper">\n <div class="'+s+'header">\n <span class="'+s+'title"></span>\n <div class="'+s+'header-buttons">\n <button type="button" class="'+s+'close-button"></button>\n </div>\n </div>\n <div class="'+s+'body"></div>\n </div>',d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=o.default.extend({header:!0,$target:(0,i.default)("body"),textContent:""},e);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{tagName:"div",className:e.modal?s+"modal-background":s+"wrapper",rootElement:e.$el}));return n._initInstance(e),n._initDOM(e),n._initDOMEvent(e),n._initEditorEvent(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"_initInstance",value:function(e){this._$target=e.$target,e.$el&&(this.$el=e.$el,this._isExternalHtmlUse=!0),e.content?this.$content=(0,i.default)(e.content):this.$content=e.textContent,this.options=e}},{key:"_initDOM",value:function(){this._initLayout(),this._isExternalHtmlUse||(o.default.isExisty(this.options.title)&&this.setTitle(this.options.title),this.setContent(this.$content));var e=this.options.headerButtons;if(e){this.$el.find("."+s+"close-button").remove();var t=this.$el.find("."+s+"header-buttons");t.empty(),t.append((0,i.default)(e))}this.options.css&&this.$el.css(this.options.css)}},{key:"_initDOMEvent",value:function(){var e=this,t=this.options,n=t.openerCssQuery,r=t.closerCssQuery;n&&(0,i.default)(n).on("click."+this._id,(function(){return e.show()})),r&&(0,i.default)(r).on("click."+this._id,(function(){return e.hide()})),this.on("click ."+s+"close-button",(function(){return e.hide()}))}},{key:"_initEditorEvent",value:function(){}},{key:"_initLayout",value:function(){var e=this.options;if(this._isExternalHtmlUse)this.hide(),this._$target.append(this.$el);else{var t=e.modal?c:u;this.$el.html(t),this.$el.addClass(e.className),this.hide(),this._$target.append(this.$el),this.$body=this.$el.find("."+s+"body"),e.header||this.$el.find("."+s+"header").remove()}}},{key:"setContent",value:function(e){this.$body.empty(),this.$body.append(e)}},{key:"setTitle",value:function(e){var t=this.$el.find("."+s+"title");t.empty(),t.append(e)}},{key:"getTitleElement",value:function(){return this.$el.find("."+s+"title").get(0)}},{key:"hide",value:function(){this.$el.css("display","none"),this._isShow=!1,this.trigger("hidden",this)}},{key:"show",value:function(){this.$el.css("display","block"),this._isShow=!0,this.trigger("shown",this)}},{key:"isShow",value:function(){return this._isShow}},{key:"remove",value:function(){var e=this.options,t=e.openerCssQuery,n=e.closerCssQuery;this.trigger("remove",this),this.off(),t&&(0,i.default)(t).off("."+this._id),n&&(0,i.default)(n).off("."+this._id),this.$el.remove(),this.$el=null}},{key:"setFitToWindow",value:function(e){this.$el.toggleClass("fit-window",e)}},{key:"isFitToWindow",value:function(){return this.$el.hasClass("fit-window")}},{key:"toggleFitToWindow",value:function(){var e=!this.isFitToWindow();return this.setFitToWindow(e),e}}]),t}(a.default);t.default=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(6));function o(e){return e&&e.__esModule?e:{default:e}}function a(e){var t=e.colspan>1?' colspan="'+e.colspan+'"':"";return t+=e.rowspan>1?' rowspan="'+e.rowspan+'"':"",t+=e.align?' align="'+e.align+'"':"","<"+e.nodeName+t+">"+e.content+"</"+e.nodeName+">"}function l(e,t){var n="";return e.length&&(n="<"+t+">"+(n=e.map((function(e){return"<tr>"+e.map(a).join("")+"</tr>"})).join(""))+"</"+t+">"),n}function s(e){var t=e[0]?[e[0]]:[],n=e.slice(1),r=l(t,"THEAD"),i=l(n,"TBODY");return"<table"+(e.className?' class="'+e.className+'"':"")+">"+(r+i)+"</table>"}t.default={createTableHtml:s,replaceTable:function(e,t){var n=i.default.createCellIndexData(t),o=i.default.createRenderData(t,n),a=(0,r.default)(s(o));return e.replaceWith(a),a},focusToCell:function(e,t,n){t.selectNodeContents(n),t.collapse(!0),e.setSelection(t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a(n(0)),i=a(n(1)),o=a(n(6));function a(e){return e&&e.__esModule?e:{default:e}}function l(e,t,n){var r=t[n].rowIndex,o=e[r];i.default.range(t.start.colIndex,t.end.colIndex+1).forEach((function(n){var a=o[n],l=a.rowMergeWith,s=-1;i.default.isExisty(l)?(l<t.start.rowIndex&&(t.start.rowIndex=l),s=l+e[l][n].rowspan-1):a.rowspan>1&&(s=r+a.rowspan-1),s>t.end.rowIndex&&(t.end.rowIndex=s)}))}function s(e,t,n,r){var o=e[n],a=o[r],l=a.colMergeWith,s=-1;i.default.isExisty(l)?(l<t.start.colIndex&&(t.start.colIndex=l),s=l+o[l].colspan-1):a.colspan>1&&(s=r+a.colspan-1),s>t.end.colIndex&&(t.end.colIndex=s)}t.default={findSelectionRange:function(e,t,n){return function(e,t){for(var n="";n!==JSON.stringify(t);)n=JSON.stringify(t),l(e,t,"start"),l(e,t,"end"),i.default.range(t.start.rowIndex,t.end.rowIndex+1).forEach((function(n){s(e,t,n,t.start.colIndex),s(e,t,n,t.end.colIndex)}));return t}(e,function(e,t,n){var r=o.default.createCellIndexData(e),i=o.default.findCellIndex(r,t),a=o.default.findCellIndex(r,n),l=void 0,s=void 0,u=void 0,c=void 0;return i.rowIndex>a.rowIndex?(l=a.rowIndex,s=i.rowIndex):(l=i.rowIndex,s=a.rowIndex),i.colIndex>a.colIndex?(u=a.colIndex,c=i.colIndex):(u=i.colIndex,c=a.colIndex),{start:{rowIndex:l,colIndex:u},end:{rowIndex:s,colIndex:c}}}(e,t,n))},getTableSelectionRange:function(e,t,n){var a=o.default.createCellIndexData(e),l={};if(t.length){var s=o.default.findCellIndex(a,t.first()),u=i.default.extend({},s);t.each((function(t,n){var i=o.default.findCellIndex(a,(0,r.default)(n)),l=e[i.rowIndex][i.colIndex],s=i.rowIndex+l.rowspan-1,c=i.colIndex+l.colspan-1;u.rowIndex=Math.max(u.rowIndex,s),u.colIndex=Math.max(u.colIndex,c)})),l.start=s,l.end=u}else{var c=o.default.findCellIndex(a,n);l.start=c,l.end=i.default.extend({},c)}return l}}},function(e,t){e.exports=n},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";var r=n(19),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=d;var o=n(16);o.inherits=n(13);var a=n(48),l=n(29);o.inherits(d,a);for(var s=i(l.prototype),u=0;u<s.length;u++){var c=s[u];d.prototype[c]||(d.prototype[c]=l.prototype[c])}function d(e){if(!(this instanceof d))return new d(e);a.call(this,e),l.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",f)}function f(){this.allowHalfOpen||this._writableState.ended||r.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(0)),o=a(n(1));function a(e){return e&&e.__esModule?e:{default:e}}var l=-1;var s=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t=o.default.extend({tagName:"div"},t),this.tagName=t.tagName,this.className=t.className,this._id=l+=1,this._setRootElement(t.rootElement)}return r(e,[{key:"on",value:function(e,t){var n=this;o.default.isObject(e)?o.default.forEach(e,(function(e,t){n._addEvent(t,e)})):this._addEvent(e,t)}},{key:"_addEvent",value:function(e,t){var n=this._parseEventType(e),r=n.event,i=n.selector;i?this.$el.on(r,i,t):this.$el.on(r,t)}},{key:"off",value:function(e,t){if(e){var n=this._parseEventType(e),r=n.event,i=n.selector;i?this.$el.off(r,i,t):this.$el.off(r,t)}else this.$el.off()}},{key:"_parseEventType",value:function(e){var t=e.split(" ");return{event:t.shift(),selector:t.join(" ")}}},{key:"_setRootElement",value:function(e){var t=this.tagName,n=this.className;e||(n=n||"uic"+this._id,e=(0,i.default)("<"+t+' class="'+n+'"/>')),this.$el=e}},{key:"trigger",value:function(){var e;(e=this.$el).trigger.apply(e,arguments)}},{key:"_getEventNameWithNamespace",value:function(e){var t=e.split(" ");return t[0]+=".uicEvent"+this._id,t.join(" ")}},{key:"remove",value:function(){this.$el&&this.$el.remove()}},{key:"destroy",value:function(){var e=this;this.remove(),o.default.forEachOwnProperties(this,(function(t,n){e[n]=null}))}}]),e}();t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(1),a=(r=o)&&r.__esModule?r:{default:r};var l=/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})(\/([^\s]*))?$/g,s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.eventManager=t,this._initEvent(),this._initDefaultImageImporter()}return i(e,[{key:"_initEvent",value:function(){var e=this;this.eventManager.listen("drop",(function(t){var n=t.data.dataTransfer&&t.data.dataTransfer.files;e._processBlobItems(n,t.data)})),this.eventManager.listen("willPaste",(function(t){var n=t.data.fragment.querySelectorAll("*");if(1===n.length&&"IMG"===n[0].tagName&&/^data:image/.test(n[0].src)){t.data.preventDefault();var r=function(e){for(var t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(t.length),i=new Uint8Array(r),o=0;o<t.length;o+=1)i[o]=t.charCodeAt(o);return new Blob([r],{type:n})}(n[0].src);e._emitAddImageBlobHook(r,"paste")}})),this.eventManager.listen("paste",(function(t){e._processClipboard(t.data)})),this.eventManager.listen("pasteBefore",(function(t){e._decodeURL(t)}))}},{key:"_initDefaultImageImporter",value:function(){this.eventManager.listen("addImageBlobHook",(function(e,t){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.readAsDataURL(e)}))}},{key:"_emitAddImageBlobHook",value:function(e,t){var n=this;this.eventManager.emit("addImageBlobHook",e,(function(t,r){n.eventManager.emit("command","AddImage",{imageUrl:t,altText:r||e.name||"image"})}),t)}},{key:"_decodeURL",value:function(t){var n=e.decodeURIGraceful,r=e.encodeMarkdownCharacters;if("markdown"===t.source&&t.data.text){var i=t.data.text,o=i[0];1===i.length&&o.match(l)&&(o=r(o=n(o)),t.data.update(null,null,[o]))}else if("wysiwyg"===t.source){var a=t.$clipboardContainer.get(0),s=a.childNodes[0],u=s.innerText;1===a.childNodes.length&&"A"===s.tagName&&u.match(l)&&(s.innerText=n(u),s.href=r(s.href))}}},{key:"_processClipboard",value:function(e){var t=e.clipboardData||window.clipboardData,n=t&&t.items,r=t.types;n&&r&&1===r.length&&-1!==a.default.inArray("Files",[].slice.call(r))&&this._processBlobItems(n,e)}},{key:"_processBlobItems",value:function(e,t){var n=this;e&&a.default.forEachArray(e,(function(e){if(-1!==e.type.indexOf("image")){t.preventDefault(),t.stopPropagation(),t.codemirrorIgnore=!0;var r=e.name?e:e.getAsFile();return n._emitAddImageBlobHook(r,t.type),!1}return!0}))}}],[{key:"decodeURIGraceful",value:function(e){var t=e.split(" "),n=[],r=void 0;return a.default.forEachArray(t,(function(e){try{r=(r=decodeURIComponent(e)).replace(/ /g,"%20")}catch(t){r=e}return n.push(r)})),n.join(" ")}},{key:"encodeMarkdownCharacters",value:function(e){return e.replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\[/g,"%5B").replace(/\]/g,"%5D").replace(/</g,"%3C").replace(/>/g,"%3E")}},{key:"escapeMarkdownCharacters",value:function(e){return e.replace(/\(/g,"\\(").replace(/\)/g,"\\)").replace(/\[/g,"\\[").replace(/\]/g,"\\]").replace(/</g,"\\<").replace(/>/g,"\\>")}}]),e}();t.default=s},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(51).Buffer)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var a=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:t.name};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,i.default.extend({className:t.className},e)));return n._name=e.name,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"getName",value:function(){return this._name}}]),t}(o(n(14)).default);Object.defineProperty(a,"name",{enumerable:!0,writable:!0,value:"item"}),Object.defineProperty(a,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-item"}),t.default=a},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function l(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var s,u=[],c=!1,d=-1;function f(){c&&s&&(c=!1,s.length?u=s.concat(u):d=-1,u.length&&h())}function h(){if(!c){var e=l(f);c=!0;for(var t=u.length;t;){for(s=u,u=[];++d<t;)s&&s[d].run();d=-1,t=u.length}s=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new g(e,t)),1!==u.length||c||l(h)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";(function(t){void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?e.exports={nextTick:function(e,n,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,l=arguments.length;switch(l){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,n)}));case 3:return t.nextTick((function(){e.call(null,n,r)}));case 4:return t.nextTick((function(){e.call(null,n,r,i)}));default:for(o=new Array(l-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick((function(){e.apply(null,o)}))}}}:e.exports=t}).call(this,n(18))},function(e,t,n){var r=n(51),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),i=a(n(17)),o=a(n(31));function a(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{tagName:"button",name:t.name};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,{name:e.name,tagName:"button",className:e.className+" "+t.className,rootElement:e.$el}));return n._setOptions(e),n._render(),n.on("click",n._onClick.bind(n)),e.tooltip&&(n.on("mouseover",n._onOver.bind(n)),n.on("mouseout",n._onOut.bind(n))),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),r(t,[{key:"setTooltip",value:function(e){this._tooltip=e}},{key:"_setOptions",value:function(e){this._command=e.command,this._event=e.event,this._text=e.text,this._tooltip=e.tooltip,this._style=e.style,this._state=e.state}},{key:"_render",value:function(){this.$el.text(this._text),this.$el.attr("type","button"),this._style&&this.$el.attr("style",this._style)}},{key:"_onClick",value:function(){this.isEnabled()&&(this._command?this.trigger("command",this._command):this._event&&this.trigger("event",this._event),this.trigger("clicked"))}},{key:"_onOver",value:function(){this.isEnabled()&&o.default.show(this.$el,this._tooltip)}},{key:"_onOut",value:function(){o.default.hide()}},{key:"enable",value:function(){this.$el.attr("disabled",!1)}},{key:"disable",value:function(){this.$el.attr("disabled",!0)}},{key:"isEnabled",value:function(){return!this.$el.attr("disabled")}}]),t}(i.default);Object.defineProperty(l,"name",{enumerable:!0,writable:!0,value:"button"}),Object.defineProperty(l,"className",{enumerable:!0,writable:!0,value:"tui-toolbar-icons"}),t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();var i=["","","","CANCEL","","","HELP","","BACK_SPACE","TAB","","","CLEAR","ENTER","ENTER_SPECIAL","","","","","PAUSE","CAPS_LOCK","KANA","EISU","JUNJA","FINAL","HANJA","","ESCAPE","CONVERT","NONCONVERT","ACCEPT","MODECHANGE","SPACE","PAGE_UP","PAGE_DOWN","END","HOME","LEFT","UP","RIGHT","DOWN","SELECT","PRINT","EXECUTE","PRINTSCREEN","INSERT","DELETE","","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","AT","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","","","CONTEXT_MENU","","SLEEP","NUMPAD0","NUMPAD1","NUMPAD2","NUMPAD3","NUMPAD4","NUMPAD5","NUMPAD6","NUMPAD7","NUMPAD8","NUMPAD9","MULTIPLY","ADD","SEPARATOR","SUBTRACT","DECIMAL","DIVIDE","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","F13","F14","F15","F16","F17","F18","F19","F20","F21","F22","F23","F24","","","","","","","","","NUM_LOCK","SCROLL_LOCK","WIN_OEM_FJ_JISHO","WIN_OEM_FJ_MASSHOU","WIN_OEM_FJ_TOUROKU","WIN_OEM_FJ_LOYA","WIN_OEM_FJ_ROYA","","","","","","","","","","@","!",'"',"#","$","%","&","_","(",")","*","+","|","-","{","}","~","","","","","VOLUME_MUTE","VOLUME_DOWN","VOLUME_UP","","",";","=",",","-",".","/","`","","","","","","","","","","","","","","","","","","","","","","","","","","","[","\\","]","'","","META","ALTGR","","WIN_ICO_HELP","WIN_ICO_00","","WIN_ICO_CLEAR","","","WIN_OEM_RESET","WIN_OEM_JUMP","WIN_OEM_PA1","WIN_OEM_PA2","WIN_OEM_PA3","WIN_OEM_WSCTRL","WIN_OEM_CUSEL","WIN_OEM_ATTN","WIN_OEM_FINISH","WIN_OEM_COPY","WIN_OEM_AUTO","WIN_OEM_ENLW","WIN_OEM_BACKTAB","ATTN","CRSEL","EXSEL","EREOF","PLAY","ZOOM","","PA1","WIN_OEM_CLEAR",""],o=void 0,a=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._setSplitter(t)}return r(e,[{key:"_setSplitter",value:function(e){var t=e?e.splitter:"+";this._splitter=t}},{key:"convert",value:function(e){var t=[];e.shiftKey&&t.push("SHIFT"),e.ctrlKey&&t.push("CTRL"),e.metaKey&&t.push("META"),e.altKey&&t.push("ALT");var n=this._getKeyCodeChar(e.keyCode);return n&&t.push(n),t.join(this._splitter)}},{key:"_getKeyCodeChar",value:function(e){return i[e]}}],[{key:"getSharedInstance",value:function(){return o||(o=new e),o}},{key:"keyCode",value:function(e){return i.indexOf(e)}}]),e}();t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=o(n(0)),i=o(n(1));function o(e){return e&&e.__esModule?e:{default:e}}var a=new RegExp("^(abbr|align|alt|axis|bgcolor|border|cellpadding|cellspacing|class|clear|color|cols|compact|coords|dir|face|headers|height|hreflang|hspace|ismap|lang|language|nohref|nowrap|rel|rev|rows|rules|scope|scrolling|shape|size|span|start|summary|tabindex|target|title|type|valign|value|vspace|width|checked|mathvariant|encoding|id|name|background|cite|href|longdesc|src|usemap|xlink:href|data-+|checked|style)","g"),l=new RegExp("^(accent-height|accumulate|additive|alphabetic|arabic-form|ascent|baseProfile|bbox|begin|by|calcMode|cap-height|class|color|color-rendering|content|cx|cy|d|dx|dy|descent|display|dur|end|fill|fill-rule|font-family|font-size|font-stretch|font-style|font-variant|font-weight|from|fx|fy|g1|g2|glyph-name|gradientUnits|hanging|height|horiz-adv-x|horiz-origin-x|ideographic|k|keyPoints|keySplines|keyTimes|lang|marker-end|marker-mid|marker-start|markerHeight|markerUnits|markerWidth|mathematical|max|min|offset|opacity|orient|origin|overline-position|overline-thickness|panose-1|path|pathLength|points|preserveAspectRatio|r|refX|refY|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|rotate|rx|ry|slope|stemh|stemv|stop-color|stop-opacity|strikethrough-position|strikethrough-thickness|stroke|stroke-dasharray|stroke-dashoffset|stroke-linecap|stroke-linejoin|stroke-miterlimit|stroke-opacity|stroke-width|systemLanguage|target|text-anchor|to|transform|type|u1|u2|underline-position|underline-thickness|unicode|unicode-range|units-per-em|values|version|viewBox|visibility|width|widths|x|x-height|x1|x2|xlink:actuate|xlink:arcrole|xlink:role|xlink:show|xlink:title|xlink:type|xml:base|xml:lang|xml:space|xmlns|xmlns:xlink|y|y1|y2|zoomAndPan)","g"),s={href:/^(javascript:).*/g};t.default=function(e,t){var n=(0,r.default)("<div />");return e=e.replace(/<!--[\s\S]*?-->/g,""),n.append(e),function(e){e.find("script, iframe, textarea, form, button, select, meta, style, link, title, embed, object, details, summary").remove()}(n),function(e){e.find("*").each((function(e,t){var n=t.attributes,r=i.default.toArray(n).filter((function(e){var t=e.name.match(a),n=e.name.match(l);return!t&&!n}));i.default.forEachArray(r,(function(e){n.getNamedItem(e.name)&&n.removeNamedItem(e.name)}))}))}(n),function(e){var t=function(t){s.hasOwnProperty(t)&&e.find("["+t+"]").each((function(e,n){var r=n.attributes,i=s[t],o=r.getNamedItem(t);i&&o&&o.value.toLowerCase().match(i)&&r.removeNamedItem(t)}))};for(var n in s)t(n)}(n),function(e,t){var n=void 0;if(t)n=e[0].innerHTML;else{for(var r=document.createDocumentFragment(),o=i.default.toArray(e[0].childNodes),a=o.length,l=0;l<a;l+=1)r.appendChild(o[l]);n=r}return n}(n,t)}},function(e,t){e.exports=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeBlockManager=void 0;var r,i=function(){function e(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,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(94),a=(r=o)&&r.__esModule?r:{default:r};var l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._replacers={}}return i(e,[{key:"setReplacer",value:function(e,t){this._replacers[e]=t}},{key:"getReplacer",value:function(e){return this._replacers[e]}},{key:"createCodeBlockHtml",value:function(e,t){var n=this.getReplacer(e);return n?n(t,e):a.default.getLanguage(e)?a.default.highlight(e,t).value:function(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}(t,!1)}}],[{key:"getHighlightJSLanguages",value:function(){return a.default.listLanguages()}}]),e}();t.CodeBlockManager=l,t.default=new l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=t.removeSyntax=function(e,t){var n=t.length;return e.substr(n,e.length-2*n)},i=t.appendSyntax=function(e,t){return""+t+e+t},o=t.expandReplace=function(e,t,n,r,i){var o=function(e,t){var n=e.start,r=e.end,i=void 0;n.ch>=t&&(i={from:{line:n.line,ch:n.ch-t},to:{line:r.line,ch:r.ch+t}});return i}(t,n),a=!1;if(o){var l=o.from,s=o.to,u=e.getRange(l,s);r(u)&&(e.setSelection(l,s),e.replaceSelection(i(u),"around"),a=!0)}return a},a=t.replace=function(e,t,n,r){var i=!1;return n(t)&&(e.replaceSelection(r(t),"around"),i=!0),i};t.changeSyntax=function(e,t,n,l,s){var u=e.getCursor(),c=u.line,d=u.ch,f=e.getSelection(),h=n.length,g=function(e){return l.test(e)};if(!o(e,t,h,g,(function(e){return r(e,n)}))&&!a(e,f,g,(function(e){return r(e,n)}))){var p=f.replace(s,"$1");e.replaceSelection(i(p,n),"around")}var v=e.getSelection(),m=d;f||(g(v)?m+=h:m-=h,e.setCursor(c,m))}},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function l(){l.init.call(this)}e.exports=l,l.EventEmitter=l,l.prototype._events=void 0,l.prototype._eventsCount=0,l.prototype._maxListeners=void 0;var s=10;function u(e){return void 0===e._maxListeners?l.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,o,a,l;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]),void 0===a)a=o[t]=n,++e._eventsCount;else if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),(i=u(e))>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,l=s,console&&console.warn&&console.warn(l)}return e}function d(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,e))}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function g(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(l,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),l.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},l.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},l.prototype.getMaxListeners=function(){return u(this)},l.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)o(s,this,t);else{var u=s.length,c=p(s,u);for(n=0;n<u;++n)o(c[n],this,t)}return!0},l.prototype.addListener=function(e,t){return c(this,e,t,!1)},l.prototype.on=l.prototype.addListener,l.prototype.prependListener=function(e,t){return c(this,e,t,!0)},l.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,f(this,e,t)),this},l.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,f(this,e,t)),this},l.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},l.prototype.off=l.prototype.removeListener,l.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),t