| 123456789101112131415161718192021 |
- /*
- @license
- dhtmlxRichtext v.1.1.1 GPL
- This software is covered by GPL license.
- To use it in non-GPL project, you need obtain Commercial or Enterprise license
- Please contact sales@dhtmlx.com. Usage without proper license is prohibited.
- (c) Dinamenta, UAB.
- */
- if(window.dhx&&(window.dhx_legacy=dhx,delete window.dhx),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.dhx=e():t.dhx=e()}(window,function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},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 i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},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="/codebase/",n(n.s=36)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(39);e.el=i.defineElement,e.sv=i.defineSvgElement,e.view=i.defineView,e.create=i.createView,e.inject=i.injectView,e.disableHelp=function(){i.DEVMODE.mutations=!1,i.DEVMODE.warnings=!1,i.DEVMODE.verbose=!1,i.DEVMODE.UNKEYED_INPUT=!1},e.resizer=function(t){var n=window.ResizeObserver,i=function(e){var n=e.el.offsetHeight,i=e.el.offsetWidth;t(i,n)};return n?e.el("div.dhx-resize-observer",{_hooks:{didInsert:function(t){new n(function(){return i(t)}).observe(t.el)}}}):e.el("iframe.dhx-resize-observer",{_hooks:{didInsert:function(t){t.el.contentWindow.onresize=function(){return i(t)},i(t)}}})}},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function o(t,e){for(void 0===e&&(e="dhx_id"),t instanceof Event&&(t=t.target);t;){if(t.getAttribute&&t.getAttribute(e))return t;t=t.parentNode}}Object.defineProperty(e,"__esModule",{value:!0}),n(40),e.toNode=function(t){return"string"==typeof t&&(t=document.getElementById(t)||document.querySelector(t)),t||document.body},e.eventHandler=function(t,e){var n=Object.keys(e);return function(i){for(var o=t(i),r=i.target;r;){var s=r.getAttribute&&r.getAttribute("class")||"";if(s.length)for(var a=s.split(" "),l=0;l<n.length;l++)if(a.indexOf(n[l])>-1)return e[n[l]](i,o);r=r.parentNode}return!0}},e.locate=function(t,e){void 0===e&&(e="dhx_id");var n=o(t,e);return n?n.getAttribute(e):""},e.locateNode=o,e.getBox=function(t){var e=t.getBoundingClientRect(),n=document.body,i=window.pageYOffset||n.scrollTop,o=window.pageXOffset||n.scrollLeft;return{top:e.top+i,left:e.left+o,right:n.offsetWidth-e.right,bottom:n.offsetHeight-e.bottom,width:e.right-e.left,height:e.bottom-e.top}};var r,s=-1;function a(t){var e=t.getBoundingClientRect();return{left:e.left+window.pageXOffset,right:e.right+window.pageXOffset,top:e.top+window.pageYOffset,bottom:e.bottom+window.pageYOffset}}function l(t,e){var n=e.mode===r.bottom||e.mode===r.top?function(t,e){var n,o,s=c(),a=s.rightBorder,l=s.bottomBorder-t.bottom-e.height,d=t.top-e.height;e.mode===r.bottom?l>=0?o=t.bottom:d>=0&&(o=d):d>=0?o=d:l>=0&&(o=t.bottom);if(l<0&&d<0){if(e.auto)return u(t,i({},e,{mode:r.right,auto:!1}));o=l>d?t.bottom:d}if(e.centering)n=function(t,e,n){var i=t.right-t.left,o=(e-i)/2,r=t.left-o,s=t.right+o;if(r>=0&&s<=n)return r;if(r<0)return 0;return n-e}(t,e.width,a);else{var h=a-t.left-e.width,f=t.right-e.width;n=h>=0?t.left:f>=0?f:f>h?t.left:f}return{left:n,top:o}}(t,e):u(t,e);return{left:n.left+"px",top:n.top+"px",minWidth:e.width+"px",position:"absolute"}}function c(){return{rightBorder:window.pageXOffset+window.innerWidth,bottomBorder:window.pageYOffset+window.innerHeight}}function u(t,e){var n,o,s=c(),a=s.rightBorder,l=s.bottomBorder,d=a-t.right-e.width,h=t.left-e.width;if(e.mode===r.right?d>=0?n=t.right:h>=0&&(n=h):h>=0?n=h:d>=0&&(n=t.right),h<0&&d<0){if(e.auto)return u(t,i({},e,{mode:r.bottom,auto:!1}));n=h>d?h:t.right}if(e.centering)o=function(t,e,n){var i=(e-(t.bottom-t.top))/2,o=t.top-i,r=t.bottom+i;return o>=0&&r<=n?o:o<0?0:n-e}(t,e.width,a);else{var f=t.bottom-e.height,p=l-t.top-e.height;o=p>=0?t.top:f>0?f:f>p?f:t.top}return{left:n,top:o}}e.getScrollbarWidth=function(){if(s>-1)return s;var t=document.createElement("div");return document.body.appendChild(t),t.style.cssText="position: absolute;left: -99999px;overflow:scroll;width: 100px;height: 100px;",s=t.offsetWidth-t.clientWidth,document.body.removeChild(t),s},e.fitPosition=function(t,e){return l(a(t),e)},e.isIE=function(){var t=window.navigator.userAgent;return t.indexOf("MSIE ")>-1||t.indexOf("Trident/")>-1},e.getRealPosition=a,function(t){t.left="left",t.right="right",t.bottom="bottom",t.top="top"}(r=e.Position||(e.Position={})),e.calculatePosition=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.none=0]="none",t.style="style",t.align="align",t.blockquote="blockquote",t.bold="bold",t.italic="italic",t.strike="strike",t.fontSize="font-size",t.fontFamily="font-family",t.underline="underline",t.color="color",t.background="background",t.link="link"}(e.Modifier||(e.Modifier={})),function(t){t.add="add",t.innerAdd="innerAdd",t.remove="remove",t.update="update",t.undo="undo",t.paste="paste",t.copy="copy",t.cut="cut",t.redo="redo",t.clear="clear",t.parse="parse",t.selectAll="selectAll"}(e.Action||(e.Action={})),function(t){t.default="default",t.undo="undo",t.style="style",t.decoration="decoration",t.color="colors",t.align="align",t.link="link",t.clear="clear",t.fullscreen="fullscreen",t.stats="stats"}(e.RTEToolbarBlock||(e.RTEToolbarBlock={})),function(t){t.change="change",t.action="action",t.selectionChange="selectionchange",t.selectionRefresh="selectionrefresh",t.showLinkEditor="showlinkeditor",t.compositionStart="compositionstart",t.compositionUpdate="compositionupdate",t.compositionEnd="compositionend"}(e.RichTextEvents||(e.RichTextEvents={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=(new Date).valueOf();e.uid=function(){return"u"+i++},e.extend=function t(e,n,i){if(void 0===i&&(i=!0),n)for(var o in n){var r=n[o],s=e[o];!i||"object"!=typeof s||s instanceof Date||s instanceof Array?e[o]=r:t(s,r)}return e},e.copy=function(t){var e={};for(var n in t)e[n]=t[n];return e},e.naturalSort=function(t){return t.sort(function(t,e){return"string"==typeof t?t.localeCompare(e):t-e})},e.findIndex=function(t,e){for(var n=t.length,i=0;i<n;i++)if(e(t[i]))return i;return-1},e.isEqualString=function(t,e){if(t.length>e.length)return!1;for(var n=0;n<t.length;n++)if(t[n].toLowerCase()!==e[n].toLowerCase())return!1;return!0},e.singleOuterClick=function(t){var e=function(n){t(n)&&document.removeEventListener("click",e)};document.addEventListener("click",e)}},function(t,e,n){"use strict";function i(t){return null!==t&&"object"==typeof t&&!(t instanceof Date)}Object.defineProperty(e,"__esModule",{value:!0}),e.getTextHash=function(t,e){return t+"_"+e},e.getLinkRefer=function(){var t=0;return function(){return"link_ref_"+t++}},e.hashToInfo=function(t){return void 0===t&&(t=""),t?t.split("_").map(function(t){return parseInt(t,10)}):[]},e.actionIdToModifierValue=function(t){return t.split("-").pop()},e.textColor=function(t){return'<span class="dxi dhx_button__icon dxi-format-color-text dhx_richtext__text-color" style="border-color: '+t+';"></span>'},e.textSelectColor=function(t){return'<span class="dxi dhx_button__icon dxi-format-color-fill dhx_richtext__background-color" style="border-color: '+t+';"></span>'},e.isEqual=function t(e,n,o){void 0===o&&(o=!1);var r=Object.keys(e),s=Object.keys(n);if(r.length!==s.length)return!1;for(var a=0,l=r;a<l.length;a++){var c=l[a];if(o&&i(e[c])&&i(n[c])){if(!t(e[c],n[c],o))return!1}else if(e[c]!==n[c])return!1}return!0},e.copyWithout=function(t,e){var n={};for(var i in t)e.hasOwnProperty(i)||(n[i]=t[i]);return n},e.startsWith=function(t,e){if(t.length<e.length)return!1;for(var n=0;n<e.length;n++)if(t[n]!==e[n])return!1;return!0}},function(t,e,n){"use strict";var i;Object.defineProperty(e,"__esModule",{value:!0});var o=n(21),r=n(4),s=n(11),a=n(2);e.getToolbarData=function(t,n){var i,l=((i={})[a.RTEToolbarBlock.undo]=[{id:"undo",tooltip:s.default.undo,type:o.ItemType.button,icon:"dxi-undo",multiClick:!0,$disabled:!0},{id:"redo",tooltip:s.default.redo,type:o.ItemType.button,icon:"dxi-redo",multiClick:!0,$disabled:!0}],i[a.RTEToolbarBlock.style]=[{id:a.Modifier.fontFamily,value:n[a.Modifier.fontFamily],tooltip:s.default.selectFontFamily,css:"dhx_richtext__dropdown dhx_richtext__dropdown--force_max-width dhx_richtext__dropdown--mw_50",type:o.ItemType.button,items:function(){var t=[];for(var n in e.fonts)t.push({id:"font-"+n,value:n});return t}()},{id:a.Modifier.fontSize,value:n[a.Modifier.fontSize],tooltip:s.default.selectFontSize,css:"dhx_richtext__dropdown dhx_richtext__dropdown--force_max-width dhx_richtext__dropdown--mw_35",type:o.ItemType.button,items:function(){var t=[];for(var n in e.fontSizes){var i=parseInt(n,10);t.push({id:"font-size-"+i,value:n})}return t}()},{id:a.Modifier.style,tooltip:s.default.selectFormat,value:s.default[n[a.Modifier.style]],css:"dhx_richtext__dropdown dhx_richtext__dropdown--force_max-width dhx_richtext__dropdown--mw_75",type:o.ItemType.button,items:[{id:"style-p",value:s.default.p},{id:"style-h1",css:"dhx_richtext__menu-text--h1",value:s.default.h1},{id:"style-h2",css:"dhx_richtext__menu-text--h2",value:s.default.h2},{id:"style-h3",css:"dhx_richtext__menu-text--h3",value:s.default.h3},{id:"style-h4",css:"dhx_richtext__menu-text--h4",value:s.default.h4},{id:"style-h5",css:"dhx_richtext__menu-text--h5",value:s.default.h5},{id:"style-h6",css:"dhx_richtext__menu-text--h6",value:s.default.h6}]},{id:a.Modifier.blockquote,tooltip:s.default.blockquote,active:n[a.Modifier.blockquote],type:o.ItemType.button,icon:"dxi-format-quote-open"}],i[a.RTEToolbarBlock.color]=[{id:a.Modifier.color,tooltip:s.default.selectTextColor,type:o.ItemType.customHTMLButton,css:"dhx_toolbar__button dhx_toolbar-button dhx_toolbar-button--icon ",html:r.textColor(n[a.Modifier.color])},{id:a.Modifier.background,tooltip:s.default.selectTextBackground,type:o.ItemType.customHTMLButton,css:"dhx_toolbar__button dhx_toolbar-button dhx_toolbar-button--icon ",html:r.textSelectColor(n[a.Modifier.background])}],i[a.RTEToolbarBlock.decoration]=[{id:a.Modifier.bold,tooltip:s.default.markBold,icon:"dxi-format-bold",type:o.ItemType.button,hotkey:"ctrl+b",active:n[a.Modifier.bold]},{id:a.Modifier.italic,tooltip:s.default.markItalic,icon:"dxi-format-italic",type:o.ItemType.button,hotkey:"ctrl+i",active:n[a.Modifier.italic]},{id:a.Modifier.strike,tooltip:s.default.markStrike,icon:"dxi-format-strikethrough",type:o.ItemType.button,active:n[a.Modifier.strike]},{id:a.Modifier.underline,tooltip:s.default.markUnderline,icon:"dxi-format-underline",type:o.ItemType.button,hotkey:"ctrl+u",active:n[a.Modifier.underline]}],i[a.RTEToolbarBlock.align]=[{id:"align-left",tooltip:s.default.alignLeft,type:o.ItemType.button,icon:"dxi-format-align-left",active:"left"===n[a.Modifier.align]},{id:"align-center",tooltip:s.default.alignCenter,type:o.ItemType.button,icon:"dxi-format-align-center",active:"center"===n[a.Modifier.align]},{id:"align-right",tooltip:s.default.alignRight,type:o.ItemType.button,icon:"dxi-format-align-right",active:"right"===n[a.Modifier.align]}],i[a.RTEToolbarBlock.link]=[{id:a.Modifier.link,tooltip:s.default.addLink,type:o.ItemType.button,icon:"dxi-link-variant"}],i[a.RTEToolbarBlock.clear]=[{id:"clear-style",tooltip:s.default.clearFormat,type:o.ItemType.button,icon:"dxi-eraser"}],i[a.RTEToolbarBlock.stats]=[{id:"stats",tooltip:s.default.stats,type:o.ItemType.button,icon:"dxi-information-outline"}],i[a.RTEToolbarBlock.fullscreen]=[{id:"fullscreen",$fullscreen:!1,tooltip:s.default.fullscreen,type:o.ItemType.button,icon:"dxi-arrow-expand"}],i);return t.reduce(function(e,n,i){return e.push.apply(e,l[n]),i!==t.length-1&&e.push({type:o.ItemType.separator}),e},[])},e.fonts={Roboto:!0,Arial:!0,Georgia:!0,Tahoma:!0,"Times New Roman":!0,Verdana:!0},e.fontSizes={"12px":!0,"14px":!0,"16px":!0,"18px":!0,"20px":!0,"24px":!0,"28px":!0,"32px":!0,"36px":!0},e.emptyStyle={},e.defaultBlocks=[a.RTEToolbarBlock.undo,a.RTEToolbarBlock.style,a.RTEToolbarBlock.decoration,a.RTEToolbarBlock.color,a.RTEToolbarBlock.align,a.RTEToolbarBlock.link],e.defaultFontSizeByBlock={p:"14px",h1:"36px",h2:"32px",h3:"28px",h4:"24px",h5:"20px",h6:"16px"},e.defaultDiffrentStyle=((i={})[a.Modifier.fontSize]="",i[a.Modifier.fontFamily]="",i[a.Modifier.style]="",i[a.Modifier.bold]=!1,i[a.Modifier.underline]=!1,i[a.Modifier.bold]=!1,i[a.Modifier.italic]=!1,i[a.Modifier.strike]=!1,i[a.Modifier.color]="#4c4c4c",i[a.Modifier.background]="#FFFFFF",i[a.Modifier.align]=!1,i)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0);e.getCss=function(t){var e="";return t.active&&(e+=" dhx_toolbar-button--active"),t.css&&(Array.isArray(t.css)?e+=t.css.join(" "):e+=" "+t.css),e},e.getIconButtonClass=function(t){return!t.value&&t.icon?"dhx_toolbar-button--icon ":""},e.counter=function(t){if(t.count)return i.el(".dhx_toolbar-counter",parseInt(t.count,10)>99?"99+":t.count)},e.icon=function(t,e){return void 0===t&&(t=""),"dxi"===t.slice(0,3)&&(t="dxi "+t),i.el("span",{class:"dhx_"+e+"__icon "+t})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t){this.events={},this.context=t||this}return t.prototype.on=function(t,e,n){var i=t.toLowerCase();this.events[i]=this.events[i]||[],this.events[i].push({callback:e,context:n||this.context})},t.prototype.detach=function(t,e){var n=t.toLowerCase(),i=this.events[n];if(e)for(var o=i.length-1;o>=0;o--)i[o].context===e&&i.splice(o,1);else this.events[n]=[]},t.prototype.fire=function(t,e){void 0===e&&(e=[]);var n=t.toLowerCase();return!this.events[n]||this.events[n].map(function(t){return t.callback.apply(t.context,e)}).indexOf(!1)<0},t}();e.EventSystem=i,e.EventsMixin=function(t){var e=new i(t=t||{});t.detachEvent=e.detach.bind(e),t.attachEvent=e.on.bind(e),t.callEvent=e.fire.bind(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(1),r=function(){function t(t,e){this._uid=i.uid(),this.config=e||{}}return t.prototype.mount=function(t,e){e&&(this._view=e),t&&this._view&&this._view.mount&&(this._container=o.toNode(t),this._container.tagName?this._view.mount(this._container):this._container.attach&&this._container.attach(this))},t.prototype.getRootView=function(){return this._view},t.prototype.paint=function(){this._view&&(this._view.node||this._container)&&(this._doNotRepaint=!1,this._view.redraw())},t}();e.View=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(12);e.DataEvents=i.DataEvents,e.DragBehaviour=i.DragBehaviour,e.DragMode=i.DragMode,function(t){t[t.all=1]="all",t[t.specific=2]="specific",t[t.leafs=3]="leafs"}(e.TreeFilterType||(e.TreeFilterType={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(15),o=n(24),r=n(25);e.isEqualObj=function(t,e){for(var n in t)if(t[n]!==e[n])return!1;return!0},e.naturalCompare=function(t,e){var n=[],i=[];for(t.replace(/(\d+)|(\D+)/g,function(t,e,i){n.push([e||1/0,i||""])}),e.replace(/(\d+)|(\D+)/g,function(t,e,n){i.push([e||1/0,n||""])});n.length&&i.length;){var o=n.shift(),r=i.shift(),s=o[0]-r[0]||o[1].localeCompare(r[1]);if(s)return s}return n.length-i.length},e.findByConf=function(t,e){if("function"==typeof e){if(e.call(this,t))return t}else if(e.by&&e.match&&t[e.by]===e.match)return t},e.isDebug=function(){var t=window.dhx;if(void 0!==t)return void 0!==t.debug&&t.debug},e.dhxWarning=function(t){console.warn(t)},e.dhxError=function(t){throw new Error(t)},e.toProxy=function(t){var e=typeof t;return"string"===e?new i.DataProxy(t):"object"===e?t:void 0},e.toDataDriver=function(t){if("string"==typeof t)switch(t){case"csv":return new o.CsvDriver;case"json":return new r.JsonDriver;default:console.warn("incorrect driver type",t)}else if("object"==typeof t)return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={apply:"Apply",undo:"Undo",redo:"Redo",selectFontFamily:"Font",selectFontSize:"Font size",selectFormat:"Style",selectTextColor:"Text color",selectTextBackground:"Background color",markBold:"Bold",markItalic:"Italic",markStrike:"Strike",markUnderline:"Underline",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",addLink:"Add link",clearFormat:"Clear formatting",fullscreen:"Fullscreen",stats:"Statistics",removeLink:"Remove link",edit:"Edit",h1:"Heading 1",h2:"Heading 2",h3:"Heading 3",h4:"Heading 4",h5:"Heading 5",h6:"Heading 6",p:"Normal text",blockquote:"Block quote",chars:"chars",charsExlSpace:"Characters without spaces",words:"words"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.afterAdd="afteradd",t.beforeAdd="beforeadd",t.removeAll="removeall",t.beforeRemove="beforeremove",t.afterRemove="afterremove",t.change="change",t.load="load"}(e.DataEvents||(e.DataEvents={})),function(t){t.beforeDrag="beforedrag",t.beforeDrop="beforeDrop",t.dragStart="dragstart",t.dragEnd="dragend",t.canDrop="candrop",t.cancelDrop="canceldrop",t.dropComplete="dropcomplete",t.dragOut="dragOut",t.dragIn="dragIn"}(e.DragEvents||(e.DragEvents={})),function(t){t.target="target",t.both="both",t.source="source"}(e.DragMode||(e.DragMode={})),function(t){t.child="child",t.sibling="sibling",t.complex="complex"}(e.DragBehaviour||(e.DragBehaviour={})),function(t){t.beforeUnSelect="beforeunselect",t.afterUnSelect="afterunselect",t.beforeSelect="beforeselect",t.afterSelect="afterselect"}(e.SelectionEvents||(e.SelectionEvents={}))},function(t,e,n){(function(e,n){!function(){var i=1,o={},r=!1;function s(t){e.setImmediate?n(t):e.importScripts?setTimeout(t):(o[++i]=t,e.postMessage(i,"*"))}function a(t){"use strict";if("function"!=typeof t&&void 0!=t)throw TypeError();if("object"!=typeof this||this&&this.then)throw TypeError();var e,n,i=this,o=0,r=0,l=[];i.promise=i,i.resolve=function(t){return e=i.fn,n=i.er,o||(r=t,o=1,s(d)),i},i.reject=function(t){return e=i.fn,n=i.er,o||(r=t,o=2,s(d)),i},i._d=1,i.then=function(t,e){if(1!=this._d)throw TypeError();var n=new a;return n.fn=t,n.er=e,3==o?n.resolve(r):4==o?n.reject(r):l.push(n),n},i.catch=function(t){return i.then(null,t)};var c=function(t){o=t||4,l.map(function(t){3==o&&t.resolve(r)||t.reject(r)})};try{"function"==typeof t&&t(i.resolve,i.reject)}catch(t){i.reject(t)}return i;function u(t,e,n,i){if(2==o)return i();if("object"!=typeof r&&"function"!=typeof r||"function"!=typeof t)i();else try{var s=0;t.call(r,function(t){s++||(r=t,e())},function(t){s++||(r=t,n())})}catch(t){r=t,n()}}function d(){var t;try{t=r&&r.then}catch(t){return r=t,o=2,d()}u(t,function(){o=1,d()},function(){o=2,d()},function(){try{1==o&&"function"==typeof e?r=e(r):2==o&&"function"==typeof n&&(r=n(r),o=1)}catch(t){return r=t,c()}r==i?(r=TypeError(),c()):u(t,function(){c(3)},c,function(){c(1==o&&3)})})}}(e=this).setImmediate||e.addEventListener("message",function(t){if(t.source==e)if(r)s(o[t.data]);else{r=!0;try{o[t.data]()}catch(t){}delete o[t.data],r=!1}}),a.resolve=function(t){if(1!=this._d)throw TypeError();return t instanceof a?t:new a(function(e){e(t)})},a.reject=function(t){if(1!=this._d)throw TypeError();return new a(function(e,n){n(t)})},a.all=function(t){if(1!=this._d)throw TypeError();if(!(t instanceof Array))return a.reject(TypeError());var e=new a;return function n(i,o){return o?e.resolve(o):i?e.reject(i):(0==t.reduce(function(t,e){return e&&e.then?t+1:t},0)&&e.resolve(t),void t.map(function(e,i){e&&e.then&&e.then(function(e){return t[i]=e,n(),e},n)}))}(),e},a.race=function(t){if(1!=this._d)throw TypeError();if(!(t instanceof Array))return a.reject(TypeError());if(0==t.length)return new a;var e=new a;return function n(i,o){return o?e.resolve(o):i?e.reject(i):(0==t.reduce(function(t,e){return e&&e.then?t+1:t},0)&&e.resolve(t),void t.map(function(t,e){t&&t.then&&t.then(function(t){n(null,t)},n)}))}(),e},a._d=1,t.exports=a}()}).call(this,n(14),n(49).setImmediate)},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){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function e(t){this.url=t}return e.prototype.load=function(){return this._ajax(this.url)},e.prototype.save=function(t,e){return this._ajax(this.url,t,{insert:"POST",delete:"DELETE",update:"POST"}[e]||"POST")},e.prototype._ajax=function(e,n,i){return void 0===i&&(i="GET"),new t(function(t,o){var r=new XMLHttpRequest;switch(r.onload=function(){r.status>=200&&r.status<300?t(r.response||r.responseText):o({status:r.status,statusText:r.statusText})},r.onerror=function(){o({status:r.status,statusText:r.statusText})},r.open(i,e),r.setRequestHeader("Content-Type","application/json"),i){case"POST":case"DELETE":case"PUT":r.send(JSON.stringify(n));break;case"GET":default:r.send()}})},e}();e.DataProxy=n}).call(this,n(13))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(12);e.DataEvents=i.DataEvents,function(t){t.button="button",t.dhxButton="dhxButton",t.imageButton="imageButton",t.selectButton="selectButton",t.input="input",t.separator="separator",t.text="text",t.spacer="spacer",t.menuItem="menuItem",t.block="block",t.customHTMLButton="customButton"}(e.ItemType||(e.ItemType={})),function(t){t.inputCreated="inputcreated",t.click="click",t.openMenu="openmenu"}(e.NavigationBarEvents||(e.NavigationBarEvents={})),function(t){t.pointer="pointer",t.click="click"}(e.NavigationType||(e.NavigationType={}))},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),s=n(0),a=n(7),l=n(1),c=n(46),u=n(8),d=n(47),h=n(27),f=n(16),p=function(t){function e(e,n){var i=t.call(this,e,r.extend({},n))||this;return i._isContextMenu=!1,i._documentHaveListener=!1,i._rootItem={},i.events=new a.EventSystem,i.data=new d.TreeCollection({},i.events),i._documentClick=function(t){l.locate(t,"dhx_widget_id")!==i._uid&&i._documentHaveListener&&(document.removeEventListener("click",i._documentClick),i._documentHaveListener=!1,i._close())},i._currentRoot=i.data.getRoot(),i._factory=h.createFactory(f.ItemType.menuItem),i._init(),i._initHandlers(),i._initEvents(),i}return i(e,t),e.prototype.paint=function(){t.prototype.paint.call(this),this._vpopups.redraw()},e.prototype.disable=function(t){this._setProp(t,"$disabled",!0)},e.prototype.enable=function(t){this._setProp(t,"$disabled",!1)},e.prototype.show=function(t){this._setProp(t,"$hidden",!1)},e.prototype.hide=function(t){this._setProp(t,"$hidden",!0)},e.prototype.destructor=function(){c.keyManager.removeHotKey(null,this)},e.prototype._close=function(){this.config.navigationType===f.NavigationType.click&&(this._isActive=!1),clearTimeout(this._currentTimeout),this._activeMenu=null,this.paint()},e.prototype._init=function(){var t=this;this._vpopups=s.create({render:function(){return s.el("div",o({dhx_widget_id:t._uid,class:"menu-popups"+(t._isContextMenu?" context-menu":"")},t._handlers),t._drawPopups())}}),this._vpopups.mount(document.body)},e.prototype._initHandlers=function(){var t=this;this._isActive=this.config.navigationType!==f.NavigationType.click,this._handlers={onmousemove:function(e){if(t._isActive){var n=l.locateNode(e);if(n){var i=n.getAttribute("dhx_id");if(t._activeMenu!==i){if(t._activeMenu=i,t.data.haveItems(i)){var o=l.getRealPosition(n);t.data.update(i,{$position:o},!1)}t._activeItemChange(i)}}else t._activeItemChange(null)}},onmouseleave:function(){t.config.navigationType!==f.NavigationType.click&&t._activeItemChange(null)},onclick:function(e){var n=l.locateNode(e);if(n){var i=n.getAttribute("dhx_id"),o=t.data.getItem(i);if(!o.multiClick)if(t.data.haveItems(i)){if(i===t._currentRoot)return void t._close();t._isActive||(t._isActive=!0),t._setRoot(i),t._activeMenu=i;var r=l.getRealPosition(n);t.data.update(i,{$position:r},!1),t._activeItemChange(i)}else switch(o.type){case f.ItemType.input:case f.ItemType.text:break;case f.ItemType.menuItem:case f.ItemType.selectButton:t._onMenuItemClick(i,e);break;case f.ItemType.imageButton:case f.ItemType.dhxButton:case f.ItemType.button:case f.ItemType.customHTMLButton:o.twoState&&t.data.update(o.id,{active:!o.active}),t.events.fire(f.NavigationBarEvents.click,[i,e]);default:t._close()}}},onmousedown:function(e){var n=l.locateNode(e);if(n){var i=n.getAttribute("dhx_id");if(t.data.getItem(i).multiClick){var o,r=365,s=function(){t.events.fire(f.NavigationBarEvents.click,[i,e]),r>50&&(r-=55),o=setTimeout(s,r)},a=function(){clearTimeout(o),document.removeEventListener("mouseup",a)};s(),document.addEventListener("mouseup",a)}}}}},e.prototype._initEvents=function(){var t=this,e=null;this.data.events.on(f.DataEvents.change,function(){t.paint(),e&&clearTimeout(e),e=setTimeout(function(){t._normalizeData(),t._resetHotkeys(),e=null,t.paint()},100)}),this.events.on(f.NavigationBarEvents.click,function(e){var n=t.data.getItem(e),i=t.data.getItem(n.parent);if(i&&i.type===f.ItemType.selectButton&&t.data.update(n.parent,{value:n.value,icon:n.icon}),n.group){var o=t._groups[n.group];o.active&&t.data.update(o.active,{active:!1}),o.active=n.id,t.data.update(n.id,{active:!0})}})},e.prototype._drawPopups=function(){var t=this,e=this._activeMenu;if(!this._isContextMenu&&!e)return null;var n=this._currentRoot;return this._isContextMenu&&!this._activePosition?null:this._getParents(e,n).map(function(e){if(!t.data.haveItems(e))return null;var i=t.data.getItem(e)||t._rootItem;return s.el("ul",{class:"dhx_menu",_key:e,_hooks:{didInsert:function(o){var r=o.el.getBoundingClientRect(),s=r.width,a=r.height,c=t._isContextMenu&&t._activePosition&&e===n?t._activePosition:i.$position,u=t._getMode(i,n,c===t._activePosition),d=l.calculatePosition(c,{mode:u,width:s,height:a});i.$style=d,o.patch({style:d})}},tabindex:0,style:i.$style||{position:"absolute"}},t._drawMenuItems(e))}).reverse()},e.prototype._onMenuItemClick=function(t,e){var n=this.data.getItem(t);n.$disabled||(n.twoState&&this.data.update(n.id,{active:!n.active}),this.events.fire(f.NavigationBarEvents.click,[t,e]),this._close())},e.prototype._activeItemChange=function(t){var e=this;t&&!this._documentHaveListener&&this._listenOuterClick(),t&&this.data.haveItems(t)?(this.events.fire(f.NavigationBarEvents.openMenu),this._activeMenu=t,clearTimeout(this._currentTimeout),this.paint()):(this._activeMenu=t,clearTimeout(this._currentTimeout),this._currentTimeout=setTimeout(function(){return e.paint()},400))},e.prototype._resetHotkeys=function(){var t=this;c.keyManager.removeHotKey(null,this),this.data.map(function(e){e.hotkey&&c.keyManager.addHotKey(e.hotkey,function(){return t._onMenuItemClick(e.id,null)},t)})},e.prototype._listenOuterClick=function(){document.addEventListener("click",this._documentClick),this._documentHaveListener=!0},e.prototype._getMode=function(t,e,n){return void 0===n&&(n=!1),t.parent===e?"bottom":"right"},e.prototype._drawMenuItems=function(t){var e=this;return this.data.map(function(t){return e._factory(t,e.events)},t,!1)},e.prototype._normalizeData=function(){var t=this,e=this.data.getRoot(),n={};this.data.eachChild(e,function(e){t.data.haveItems(e.id)&&e.parent!==t.data.getRoot()&&(e.$openIcon="right"),e.group&&function(t,e){t[e.group]?(e.active&&(t[e.group].active=e.id),t[e.group].elements.push(e.id)):t[e.group]={active:e.active?e.id:null,elements:[e.id]}}(n,e)},!0),this._groups=n},e.prototype._setRoot=function(t){},e.prototype._getParents=function(t,e){var n=[],i=!1,o=this.data.getItem(t),r=o&&o.$disabled;return this.data.eachParent(t,function(t){t.id===e?(n.push(t.id),i=!0):i||n.push(t.id)},!r),this._isContextMenu&&this._activePosition&&n.push(e),n},e.prototype._setProp=function(t,e,n){var i,o=this;Array.isArray(t)?t.forEach(function(t){var i;return o.data.update(t,((i={})[e]=n,i))}):this.data.update(t,((i={})[e]=n,i))},e}(u.View);e.MenuBase=p},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(71)),i(n(30))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(5),r=n(2);e.calcTextNodeStyle=function(t){var e={};for(var n in t)if(t[n])switch(n){case r.Modifier.bold:e["font-weight"]="bold";break;case r.Modifier.italic:e["font-style"]="italic";break;case r.Modifier.underline:e["text-decoration"]?e["text-decoration"]+=" underline":e["text-decoration"]="underline";break;case r.Modifier.strike:e["text-decoration"]?e["text-decoration"]+=" line-through":e["text-decoration"]="line-through";break;case r.Modifier.color:e.color=t[n];break;case r.Modifier.background:e.background=t[n];break;case r.Modifier.fontFamily:e["font-family"]=t[n];break;case r.Modifier.fontSize:e["font-size"]=t[n]}return e},e.calcBlockStyle=function(t){var e={};for(var n in t)if(t[n])switch(n){case r.Modifier.align:e["text-align"]=t[n]}return e},e.blockStyleToTag=function(t){return t[r.Modifier.style]?t[r.Modifier.style]:"p"},e.blockquoteWrapper=function(t,e){return t[r.Modifier.blockquote]?function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return i.el("blockquote",{dhx_offset:e},[i.el.apply(void 0,t)])}:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return i.el.apply(void 0,t)}},e.getComputedNodeStyle=function(t,e,n){var i={};for(var s in t.style)i[s]=t.style[s];return i[r.Modifier.fontSize]||(e.style[r.Modifier.style]&&"p"!==e.style[r.Modifier.style]?i[r.Modifier.fontSize]=o.defaultFontSizeByBlock[e.style[r.Modifier.style]]:i[r.Modifier.fontSize]=n[r.Modifier.fontSize]),i[r.Modifier.fontFamily]||(i[r.Modifier.fontFamily]=n[r.Modifier.fontFamily]),i},e.getComputedBlockStyle=function(t,e){var n={};for(var i in t.style)n[i]=t.style[i];return n[r.Modifier.style]||(n[r.Modifier.style]=e[r.Modifier.style]),n[r.Modifier.align]||(n[r.Modifier.align]=e[r.Modifier.align]),n[r.Modifier.blockquote]||(n[r.Modifier.blockquote]=e[r.Modifier.blockquote]),n},e.isEmptyBlockStyle=function(t){return!t[r.Modifier.blockquote]&&!t[r.Modifier.align]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=n(5);!function(t){t[t.textIsEmpty=0]="textIsEmpty",t[t.complete=1]="complete",t[t.nullTextLength=2]="nullTextLength",t[t.forceRemovePrevious=3]="forceRemovePrevious",t[t.forceRemoveNext=4]="forceRemoveNext"}(i=e.RemoveTextResult||(e.RemoveTextResult={}));var r=function(){function t(t,e){this.text=t,this.style=e||o.emptyStyle}return t.prototype.isEmpty=function(){return 0===this.text.length},t.prototype.insert=function(t,e){this.text=this.text.slice(0,e)+t+this.text.slice(e)},t.prototype.remove=function(t,e){return this.isEmpty()?i.textIsEmpty:0===t&&e?i.forceRemovePrevious:t!==this.text.length||e?(this.text=e?this.text.slice(0,t-1)+this.text.slice(t):this.text.slice(0,t)+this.text.slice(t+1),0===this.text.length?i.nullTextLength:i.complete):i.forceRemoveNext},t}();e.TextNode=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(44));var i=n(22);e.ItemType=i.ItemType,e.NavigationBarEvents=i.NavigationBarEvents},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(45)),i(n(65)),i(n(17)),i(n(27)),i(n(16))},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=n(7),r=n(48),s=n(52),a=n(15),l=n(10),c=n(9),u=n(3),d=function(){function t(t,e){this.config=t||{},this._order=[],this._pull={},this._changes={order:[]},this._initOrder=null,this._sort=new s.Sort,this._loader=new r.Loader(this,this._changes),this.events=e||new o.EventSystem(this)}return t.prototype.add=function(t,e){if(this.events.fire(c.DataEvents.beforeAdd,[t])){var n=this._addCore(t,e);return this._onChange("add",t.id,t),this.events.fire(c.DataEvents.afterAdd,[t]),n}},t.prototype.remove=function(t){var e=this._pull[t];if(e){if(!this.events.fire(c.DataEvents.beforeRemove,[e]))return;this._removeCore(e.id),this._onChange("remove",t,e)}this.events.fire(c.DataEvents.afterRemove,[e])},t.prototype.removeAll=function(){this._removeAll(),this.events.fire(c.DataEvents.removeAll),this.events.fire(c.DataEvents.change)},t.prototype.exists=function(t){return!!this._pull[t]},t.prototype.getNearId=function(t){if(!this._pull[t])return this._order[0].id||""},t.prototype.getItem=function(t){return this._pull[t]},t.prototype.update=function(t,e,n){var i=this.getItem(t);if(i){if(l.isEqualObj(e,i))return;e.id&&t!==e.id?(l.dhxWarning("this method doesn't allow change id"),l.isDebug()):(u.extend(this._pull[t],e,!1),this.config.update&&this.config.update(this._pull[t]),n||this._onChange("update",t,this._pull[t]))}else l.dhxWarning("item not found")},t.prototype.getIndex=function(t){var e=u.findIndex(this._order,function(e){return e.id===t});return this._pull[t]&&e>=0?e:-1},t.prototype.getId=function(t){if(this._order[t])return this._order[t].id},t.prototype.getLength=function(){return this._order.length},t.prototype.filter=function(t,e){var n=this;if((e=u.extend({add:!1,multiple:!0},e)).add||(this._order=this._initOrder||this._order,this._initOrder=null),this._filters=this._filters||{},e.multiple&&t||(this._filters={}),t){if("function"==typeof t){this._filters._={match:"_",compare:t}}else t.match?(t.compare=t.compare||function(t,e){return t===e},this._filters[t.by]=t):delete this._filters[t.by];var i=this._order.filter(function(t){return Object.keys(n._filters).every(function(e){return t[e]?n._filters[e].compare(t[e],n._filters[e].match,t):n._filters[e].compare(t)})});this._initOrder||(this._initOrder=this._order,this._order=i)}this.events.fire(c.DataEvents.change)},t.prototype.find=function(t){for(var e in this._pull){var n=l.findByConf(this._pull[e],t);if(n)return n}return null},t.prototype.findAll=function(t){var e=[];for(var n in this._pull){var i=l.findByConf(this._pull[n],t);i&&e.push(i)}return e},t.prototype.sort=function(t){this._sort.sort(this._order,t),this._initOrder&&this._initOrder.length&&this._sort.sort(this._initOrder,t),this.events.fire(c.DataEvents.change)},t.prototype.copy=function(t,e,n,o){if(!this.exists(t))return null;var r=u.uid();return n?o?void n.add(i({},this.getItem(t)),e,o):n.exists(t)?(n.add(i({},this.getItem(t),{id:r}),e),r):(n.add(this.getItem(t),e),t):(this.add(i({},this.getItem(t),{id:r}),e),r)},t.prototype.move=function(t,e,n,i){if(n&&n!==this&&this.exists(t)){var o=this.getItem(t);return n.exists(t)&&(o.id=u.uid()),i&&(o.parent=i),n.add(o,e),this.remove(o.id),o.id}if(this.getIndex(t)===e)return null;var r=this._order.splice(this.getIndex(t),1)[0];return-1===e&&(e=this._order.length),this._order.splice(e,0,r),this.events.fire(c.DataEvents.change),t},t.prototype.load=function(t,e){return"string"==typeof t&&(t=new a.DataProxy(t)),this._loader.load(t,e)},t.prototype.parse=function(t,e){return this._removeAll(),this._loader.parse(t,e)},t.prototype.$parse=function(t){var e=this.config.approximate;e&&(t=this._approximate(t,e.value,e.maxNum)),this._parse_data(t),this.events.fire(c.DataEvents.change),this.events.fire(c.DataEvents.load)},t.prototype.save=function(t){this._loader.save(t)},t.prototype.isSaved=function(){return!this._changes.order.length},t.prototype.map=function(t){for(var e=[],n=0;n<this._order.length;n++)e.push(t.call(this,this._order[n],n));return e},t.prototype.mapRange=function(t,e,n){t<0&&(t=0),e>this._order.length-1&&(e=this._order.length-1);for(var i=[],o=t;o<=e;o++)i.push(n.call(this,this._order[o],o));return i},t.prototype.reduce=function(t,e){for(var n=0;n<this._order.length;n++)e=t.call(this,e,this._order[n],n);return e},t.prototype.serialize=function(){return this.map(function(t){var e=i({},t);return Object.keys(e).forEach(function(t){"$"===t[0]&&delete e[t]}),e})},t.prototype.getInitialData=function(){return this._initOrder},t.prototype._removeAll=function(){this._pull={},this._order=[],this._changes.order=[],this._initOrder=null},t.prototype._addCore=function(t,e){return this.config.init&&(t=this.config.init(t)),t.id=t.id?t.id.toString():u.uid(),this._pull[t.id]&&l.dhxError("Item already exist"),this._initOrder&&this._initOrder.length&&this._addToOrder(this._initOrder,t,e),this._addToOrder(this._order,t,e),t.id},t.prototype._removeCore=function(t){this.getIndex(t)>=0&&(this._order=this._order.filter(function(e){return e.id!==t}),delete this._pull[t]),this._initOrder&&this._initOrder.length&&(this._initOrder=this._initOrder.filter(function(e){return e.id!==t}))},t.prototype._parse_data=function(t){var e=this._order.length;this.config.prep&&(t=this.config.prep(t));for(var n=0,i=t;n<i.length;n++){var o=i[n];this.config.init&&(o=this.config.init(o)),o.id=o.id||0===o.id?o.id:u.uid(),this._pull[o.id]=o,this._order[e++]=o}},t.prototype._approximate=function(t,e,n){for(var i=t.length,o=e.length,r=Math.floor(i/n),s=Array(Math.ceil(i/r)),a=0,l=0;l<i;l+=r){for(var c=u.copy(t[l]),d=Math.min(i,l+r),h=0;h<o;h++){for(var f=0,p=l;p<d;p++)f+=t[p][e[h]];c[e[h]]=f/(d-l)}s[a++]=c}return s},t.prototype._onChange=function(t,e,n){for(var o=0,r=this._changes.order;o<r.length;o++){var s=r[o];if(s.id===e&&!s.saving)return s.error&&(s.error=!1),s=i({},s,{obj:n,status:t}),void this.events.fire(c.DataEvents.change,[e,t,n])}this._changes.order.push({id:e,status:t,obj:i({},n),saving:!1}),this.events.fire(c.DataEvents.change,[e,t,n])},t.prototype._addToOrder=function(t,e,n){n>=0&&t[n]?(this._pull[e.id]=e,t.splice(n,0,e)):(this._pull[e.id]=e,t.push(e))},t}();e.DataCollection=d},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){void 0===t&&(t={});this.config=i({},{skipHeader:0,nameByHeader:!1,row:"\n",column:","},t),this.config.nameByHeader&&(this.config.skipHeader=1)}return t.prototype.getFields=function(t,e){for(var n=t.trim().split(this.config.column),i={},o=0;o<n.length;o++)i[e?e[o]:o+1]=n[o];return i},t.prototype.getRows=function(t){return t.trim().split(this.config.row)},t.prototype.toJsonArray=function(t){var e=this,n=this.getRows(t),i=this.config.names;if(this.config.skipHeader){var o=n.splice(0,this.config.skipHeader);this.config.nameByHeader&&(i=o[0].trim().split(this.config.column))}return n.map(function(t){return e.getFields(t,i)})},t}();e.CsvDriver=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){}return t.prototype.toJsonArray=function(t){return this.getRows(t)},t.prototype.getFields=function(t){return t},t.prototype.getRows=function(t){return"string"==typeof t?JSON.parse(t):t},t}();e.JsonDriver=i},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),s=n(23),a=n(15),l=n(10),c=n(9);function u(t,e,n,i){void 0!==i&&-1!==i&&t[n]&&t[n][i]?t[n].splice(i,0,e):(t[n]||(t[n]=[]),t[n].push(e))}var d=function(t){function e(e,n){var i,o=t.call(this,e,n)||this,s=o._root="_ROOT_"+r.uid();return o._childs=((i={})[s]=[],i),o._initChilds=null,o}return i(e,t),e.prototype.add=function(e,n,i){void 0===n&&(n=-1),void 0===i&&(i=this._root),"object"!=typeof e&&(e={value:e}),e.parent=e.parent?e.parent.toString():i;var o=t.prototype.add.call(this,e,n);if(Array.isArray(e.items))for(var r=0,s=e.items;r<s.length;r++){var a=s[r];this.add(a,-1,e.id)}return o},e.prototype.getRoot=function(){return this._root},e.prototype.getParent=function(t,e){if(void 0===e&&(e=!1),!this._pull[t])return null;var n=this._pull[t].parent;return e?this._pull[n]:n},e.prototype.getItems=function(t){return this._childs&&this._childs[t]?this._childs[t]:[]},e.prototype.getLength=function(t){return void 0===t&&(t=this._root),this._childs[t]?this._childs[t].length:null},e.prototype.removeAll=function(e){var n;if(e)for(var i=0,o=this._childs[e].slice();i<o.length;i++){var r=o[i];this.remove(r.id)}else{t.prototype.removeAll.call(this);var s=this._root;this._initChilds=null,this._childs=((n={})[s]=[],n)}},e.prototype.getIndex=function(t){var e=this.getParent(t);return e&&this._childs[e]?r.findIndex(this._childs[e],function(e){return e.id===t}):-1},e.prototype.sort=function(t){var e=this._childs;for(var n in e)this._sort.sort(e[n],t);this.events.fire(c.DataEvents.change)},e.prototype.map=function(t,e,n){void 0===e&&(e=this._root),void 0===n&&(n=!0);var i=[];if(!this.haveItems(e))return i;for(var o=0;o<this._childs[e].length;o++)if(i.push(t.call(this,this._childs[e][o],o)),n){var r=this.map(t,this._childs[e][o].id,n);i=i.concat(r)}return i},e.prototype.filter=function(t){if(t){this._initChilds||(this._initChilds=this._childs),t.type=t.type||c.TreeFilterType.all;var e={};this._recursiveFilter(t,this._root,0,e),this._childs=e,this.events.fire(c.DataEvents.change)}else this.restoreOrder()},e.prototype.restoreOrder=function(){this._initChilds&&(this._childs=this._initChilds,this._initChilds=null),this.events.fire(c.DataEvents.change)},e.prototype.copy=function(t,n,i,s){if(void 0===i&&(i=this),void 0===s&&(s=this._root),!this.exists(t))return null;var a=this._childs[t];if(i===this&&!this.canCopy(t,s))return null;if(i instanceof e){if(this.exists(t)){var l=o({},this.getItem(t));i.exists(t)?l.id=r.uid():l.id=t,l.parent=s,i.add(l,n),t=l.id}if(a)for(var c=0,u=a;c<u.length;c++){var d=u[c].id,h=this.getIndex(d);this.copy(d,h,i,t)}return t}i.add(this._pull[t])},e.prototype.move=function(t,n,i,o){if(void 0===i&&(i=this),void 0===o&&(o=this._root),!this.exists(t))return null;if(i!==this){if(!(i instanceof e))return i.add(this._pull[t]),void this.remove(t);var r=this.copy(t,n,i,o);return this.remove(t),r}if(!this.canCopy(t,o))return null;var s=this.getParent(t),a=this.getIndex(t),l=this._childs[s].splice(a,1)[0];return l.parent=o,this._childs[s].length||delete this._childs[s],this.haveItems(o)||(this._childs[o]=[]),-1===n?n=this._childs[o].push(l):this._childs[o].splice(n,0,l),this.events.fire(c.DataEvents.change),t},e.prototype.eachChild=function(t,e,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=function(){return!0}),this.haveItems(t))for(var o=0;o<this._childs[t].length;o++)e.call(this,this._childs[t][o],o),n&&i(this._childs[t][o])&&this.eachChild(this._childs[t][o].id,e,n,i)},e.prototype.getNearId=function(t){return t},e.prototype.loadItems=function(t,e){var n=this;void 0===e&&(e="json");var i=this.config.autoload+"?id="+t;new a.DataProxy(i).load().then(function(i){i=(e=l.toDataDriver(e)).toJsonArray(i),n._parse_data(i,t),n.events.fire(c.DataEvents.change)})},e.prototype.refreshItems=function(t,e){void 0===e&&(e="json"),this.removeAll(t),this.loadItems(t,e)},e.prototype.eachParent=function(t,e,n){void 0===n&&(n=!1);var i=this.getItem(t);if(i&&(n&&e.call(this,i),i.parent!==this._root)){var o=this.getItem(i.parent);e.call(this,o),this.eachParent(i.parent,e)}},e.prototype.haveItems=function(t){return t in this._childs},e.prototype.canCopy=function(t,e){if(t===e)return!1;var n=!0;return this.eachParent(e,function(e){return e.id===t?n=!1:null}),n},e.prototype.serialize=function(t){return this._serialize(this._root,t)},e.prototype.getId=function(t,e){if(void 0===e&&(e=this._root),this._childs[e]&&this._childs[e][t])return this._childs[e][t].id},e.prototype._removeAll=function(e){var n;if(e)for(var i=0,o=this._childs[e].slice();i<o.length;i++){var r=o[i];this.remove(r.id)}else{t.prototype._removeAll.call(this);var s=this._root;this._initChilds=null,this._childs=((n={})[s]=[],n)}},e.prototype._removeCore=function(t){if(this._pull[t]){var e=this.getParent(t);this._childs[e]=this._childs[e].filter(function(e){return e.id!==t}),e===this._root||this._childs[e].length||delete this._childs[e],this._initChilds&&this._initChilds[e]&&(this._initChilds[e]=this._initChilds[e].filter(function(e){return e.id!==t}),e===this._root||this._initChilds[e].length||delete this._initChilds[e]),this._fastDeleteChilds(this._childs,t),this._initChilds&&this._fastDeleteChilds(this._initChilds,t)}},e.prototype._addToOrder=function(t,e,n){var i=this._childs,o=this._initChilds,r=e.parent;this._pull[e.id]=e,u(i,e,r,n),o&&u(o,e,r,n)},e.prototype._parse_data=function(t,e){void 0===e&&(e=this._root);for(var n=0,i=t;n<i.length;n++){var o=i[n];this.config.init&&(o=this.config.init(o)),"object"!=typeof o&&(o={value:o}),o.id=o.id?o.id.toString():r.uid(),o.parent=o.parent?o.parent.toString():e,this._pull[o.id]=o,this._childs[o.parent]||(this._childs[o.parent]=[]),this._childs[o.parent].push(o),o.items&&o.items instanceof Object&&this._parse_data(o.items,o.id)}},e.prototype._fastDeleteChilds=function(t,e){if(this._pull[e]&&delete this._pull[e],t[e]){for(var n=0;n<t[e].length;n++)this._fastDeleteChilds(t,t[e][n].id);delete t[e]}},e.prototype._recursiveFilter=function(t,e,n,i){var o=this,r=this._childs[e];if(r){var s=function(e){switch(t.type){case c.TreeFilterType.all:return!0;case c.TreeFilterType.specific:return n===t.specific;case c.TreeFilterType.leafs:return!o.haveItems(e.id)}};if(t.by&&t.match){var a=function(e){return!s(e)||-1!==e[t.by].toString().toLowerCase().indexOf(t.match.toString().toLowerCase())};i[e]=r.filter(a)}else if(t.rule&&"function"==typeof t.rule){a=function(e){return!s(e)||t.rule(e)};var l=r.filter(a);l.length&&(i[e]=l)}for(var u=0,d=r;u<d.length;u++){var h=d[u];this._recursiveFilter(t,h.id,n+1,i)}}},e.prototype._serialize=function(t,e){var n=this;return void 0===t&&(t=this._root),this.map(function(t){var i={};for(var o in t)"parent"!==o&&"childs"!==o&&(i[o]=t[o]);return e&&(i=e(i)),n.haveItems(t.id)&&(i.childs=n._serialize(t.id,e)),i},t,!1)},e}(s.DataCollection);e.TreeCollection=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(56),o=n(57),r=n(58),s=n(59),a=n(60),l=n(61),c=n(62),u=n(63),d=n(64),h=n(16);function f(t,e){if(t.$hidden)return null;switch(t.type){case h.ItemType.button:return i.button(t);case h.ItemType.text:return d.text(t);case h.ItemType.separator:return c.separator(t);case h.ItemType.spacer:return u.spacer(t);case h.ItemType.input:return a.input(t,e);case h.ItemType.imageButton:return s.imageButton(t);case h.ItemType.selectButton:case h.ItemType.menuItem:return l.menuItem(t);case h.ItemType.dhxButton:return r.dhxButton(t);case h.ItemType.customHTMLButton:return o.customHTMLButton(t);case h.ItemType.block:default:throw new Error("unknown item type "+t.type)}}e.itemfactory=f,e.createFactory=function(t,e){void 0===e&&(e=[]);var n={};return e.forEach(function(t){return n[t]=!0}),function(e,i){return e.type=e.type||t,n[e.type]&&(e.type=t),f(e,i)}}},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(29)),i(n(66)),i(n(68))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1);!function(t){t.right="right",t.bottom="bottom",t.center="center"}(e.Position||(e.Position={})),function(t){t.topLeft="top-left",t.topRight="top-right",t.bottomLeft="bottom-left",t.bottomRight="bottom-right"}(e.MessageContainerPosition||(e.MessageContainerPosition={}));var o=new WeakMap,r=new Map;function s(t,e){e&&clearTimeout(o.get(t));var n=t.parentNode.parentNode,i=r.get(n),s=i.stack,a=i.container,l=s.indexOf(t);if(-1!==l)return a.removeChild(t),s.splice(l,1),void(0===s.length&&n.removeChild(a))}e.message=function(t){"string"==typeof t&&(t={text:t});var e=document.createElement("div");e.className="dhx_message "+(t.css||""),e.innerHTML='<span class="dhx_message__text">'+t.text+'</span>\n\t<span class="dhx_message__icon dxi '+t.icon+'"></span>';var n=t.node?i.toNode(t.node):document.body;if("static"===getComputedStyle(n).position&&(n.style.position="relative"),!r.has(n)){var a=document.createElement("div");a.className="dhx-message-container "+(t.position?"dhx-message-container--"+t.position:"dhx-message-container--top-right")+(n===document.body?" dhx-message-container--in-body":""),r.set(n,{stack:[],container:a})}var l=r.get(n),c=l.stack,u=l.container;if(0===c.length&&n.appendChild(u),c.push(e),u.appendChild(e),t.expire){var d=setTimeout(function(){return s(e)},t.expire);o.set(e,d)}e.onclick=function(){return s(e,!0)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.beforeHide="beforehide",t.beforeShow="beforeshow",t.afterHide="afterhide",t.afterShow="aftershow"}(e.PopupEvents||(e.PopupEvents={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=n(2);!function(t){t[t.backspace=8]="backspace",t[t.enter=13]="enter",t[t.tab=9]="tab",t[t.esc=27]="esc",t[t.space=32]="space",t[t.left=37]="left",t[t.up=38]="up",t[t.right=39]="right",t[t.down=40]="down",t[t.insert=45]="insert",t[t.del=46]="del",t[t.ctrl=17]="ctrl",t[t.a=65]="a",t[t.b=66]="b",t[t.c=67]="c",t[t.s=83]="s",t[t.u=85]="u",t[t.v=86]="v",t[t.x=88]="x",t[t.y=89]="y",t[t.z=90]="z",t[t.i=73]="i"}(i=e.Key||(e.Key={})),e.keyToOperation=function(t){if(t.shiftKey&&t.which===i.enter)return t.preventDefault(),{action:o.Action.add,data:"\n"};switch(t.which){case i.insert:return void t.preventDefault();case i.left:case i.right:case i.down:case i.up:return;case i.backspace:return t.preventDefault(),{action:o.Action.remove,data:!0};case i.del:return t.preventDefault(),{action:o.Action.remove,data:!1};case i.space:return t.preventDefault(),{action:o.Action.add,data:" "};case i.enter:return t.preventDefault(),{action:o.Action.add,data:{newBlock:!0}}}if(t.ctrlKey||t.metaKey)return function(t){switch(t.which){case i.z:return{action:t.shiftKey?o.Action.redo:o.Action.undo};case i.y:return{action:o.Action.redo};case i.a:return{action:o.Action.selectAll};case i.v:case i.x:case i.c:return;case i.u:case i.i:case i.b:return void t.preventDefault()}}(t);var e=t.key;return e.length>1||t.altKey?void 0:(t.preventDefault(),{action:o.Action.add,data:e})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(11);var r={words:function(t){return t.split(/[\n !.?,:;]+/g).filter(function(t){return t.length>0}).length},chars:function(t){return t.replace(/[\n]/g,"").length},charsExlSpace:function(t){return t.replace(/[\n ]/g,"").length}};e.getStats=function(t,e){if(e){for(var n={},i=0,o=e;i<o.length;i++){var s=o[i],a=s.cb,l=s.name;"function"==typeof a?n[l]=a(t):!a&&l in r?n[l]=r[l](t):"string"==typeof a&&a in r&&(n[l]=r[a](t))}return n}return{chars:r.chars(t),words:r.words(t),charsExlSpace:r.charsExlSpace(t)}},e.statsRenderer=function(t,e){return void 0===e&&(e=[{name:"chars"},{name:"charsExlSpace"},{name:"words"}]),function(){return i.el("ul.dhx_richtext-stat",e.map(function(e){return i.el("li.dhx_richtext-stat__item",[i.el("span.dhx_richtext-stat__name",o.default[e.name]||e.name),i.el("span.dhx_richtext-stat__value",t[e.name])])}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.colorChange="colorChange"}(e.ColorpickerEvents||(e.ColorpickerEvents={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=n(5),r=n(4),s=n(20);!function(t){t[t.invalidNode=0]="invalidNode",t[t.offsetStart=1]="offsetStart",t[t.offsetEnd=2]="offsetEnd",t[t.complete=3]="complete"}(i=e.SplitResult||(e.SplitResult={}));var a=function(){function t(t,e){this.style=e||o.emptyStyle,t&&0!==t.length?this.textNodes=t:this.clear()}return t.prototype.clear=function(){this.textNodes=[new s.TextNode("",o.emptyStyle)]},t.prototype.isEmpty=function(){return 1===this.textNodes.length&&this.textNodes[0].isEmpty()},t.prototype.splitTextNode=function(t,e){var n=this.textNodes[t];if(!n)return i.invalidNode;if(0===e)return i.offsetStart;if(e>=n.text.length)return i.offsetEnd;var o=n.text.slice(0,e),r=n.text.slice(e),a=new s.TextNode(r,n.style);return n.text=o,this.textNodes.splice(t+1,0,a),i.complete},t.prototype.removeNodes=function(t,e){return e?0===t||(this.textNodes=this.textNodes.slice(0,t),!1):t===this.textNodes.length-1||(this.textNodes=this.textNodes.slice(t+1),!1)},t.prototype.offsetToNodePosition=function(t){if(0===t)return{textIndex:0,offset:0};for(var e=this.textNodes,n=0;n<e.length;n++){var i=e[n].text.length;if(t<=i)return{textIndex:n,offset:t};t-=i}},t.prototype.nodePositionToOffset=function(t,e){for(var n=0;n<t;n++)e+=this.textNodes[n].text.length;return e},t.prototype.getBlockEnd=function(){return{textIndex:this.textNodes.length-1,offset:this.textNodes[this.textNodes.length-1].text.length}},t.prototype.balance=function(){for(var t=this.textNodes,e=t.length,n=1;n<t.length;)r.isEqual(t[n-1].style,t[n].style)?(t[n-1].text+=t[n].text,t.splice(n,1)):n++;return e!==t.length},t}();e.Block=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);function o(t,e){void 0===e&&(e=!1);var n=t.style,o=t.text,l=[];if(n[i.Modifier.underline]&&l.push("u"),n[i.Modifier.strike]&&l.push("s"),n[i.Modifier.bold]&&l.push("strong"),n[i.Modifier.italic]&&l.push("i"),e)return{tags:l,inline:r(n,!0),text:a(o)};var c=r(n);return c&&0===l.length&&l.push("span"),s(l,c,a(o))}function r(t,e){void 0===e&&(e=!1);var n="";for(var o in t)switch(o){case i.Modifier.background:n+="background: "+t[o]+";";break;case i.Modifier.color:n+="color: "+t[o]+";";break;case i.Modifier.fontFamily:n+="font-family: "+t[o]+";";break;case i.Modifier.fontSize:n+="font-size: "+t[o]+";"}return e?n:n?' style="'+n+'"':""}function s(t,e,n){return 0===t.length&&""===n.trim()&&t.push("span"),t.reduce(function(t,n,i){return t+(0===i?"<"+n+e+">":"<"+n+">")},"")+n+t.reduceRight(function(t,e){return t+"</"+e+">"},"")}function a(t){return t.replace(/</g,"<").replace(/>/g,">").replace(/\n/g,"<br>").replace(/[ ]{2,}/g,function(t){return" "+function(t,e){for(var n="";e--;)n+=t;return n}(" ",t.length-1)})}e.serializer=function(t){return t.reduce(function(t,e){return t+function(t){var e="",n=t.style,r=t.textNodes,a=[];t.style[i.Modifier.blockquote]&&a.push("blockquote"),a.push(n[i.Modifier.style]||"p");var l=n[i.Modifier.align]?"text-align: "+n[i.Modifier.align]+";":"";if(1===r.length&&!r[0].style[i.Modifier.link]){var c=o(r[0],!0);a.push.apply(a,c.tags);var u=c.inline;return(u||l)&&(e=' style="'+u+l+'"'),s(a,e,c.text)}return l&&(e=' style="'+l+'"'),s(a,e,function(t){for(var e,n="",i="",r="",a=0,l=t;a<l.length;a++){var c=l[a];c.style.link?e===c.style.link?(i+=o(c),r+=c.text.replace(/\"/g,"'")):(i=o(c),r=c.text.replace(/\"/g,"'")):(e&&(n+=s(["a"],' href="'+e+'" title="'+r+'"',i)),n+=o(c)),e=c.style.link}return e&&(n+=s(["a"],' href="'+e+'" title="'+r+'"',i)),n}(r))}(e)},"")}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(37);var i=n(38);e.Richtext=i.Richtext;var o=n(11),r=window;e.i18n=r.dhx&&r.dhx.i18n?r.dhx.i18:{},e.i18n.setLocale=function(t,n){var i=e.i18n[t];for(var o in n)i[o]=n[o]},e.i18n.richtext=e.i18n.richtext||o.default},function(t,e,n){},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),s=n(0),a=n(7),l=n(1),c=n(8),u=n(41),d=n(5),h=n(69),f=n(70),p=n(4),_=n(72),v=n(32),g=n(19),x=n(73),y=n(31),m=n(79),b=n(2),k=function(t){function e(e,n){var i,o=t.call(this,e,r.extend({mode:"classic",toolbarBlocks:[b.RTEToolbarBlock.undo,b.RTEToolbarBlock.style,b.RTEToolbarBlock.decoration,b.RTEToolbarBlock.color,b.RTEToolbarBlock.align,b.RTEToolbarBlock.link]},n))||this,s=o.config.toolbarBlocks.indexOf(b.RTEToolbarBlock.default);-1!==s&&(i=o.config.toolbarBlocks).splice.apply(i,[s,1].concat(d.defaultBlocks)),o._initContainer=l.toNode(e),o.events=new a.EventSystem;var c=function(){return o.getRootView()};return o._composition={active:!1,initSelection:null},o._compositionEventsDestructor=h.listenCompositionEvents(o.events,function(){return o._editor.selection.isActive()}),o._editor=new m.Editor({events:o.events,uid:o._uid,getRootView:c,repaint:function(){return o.paint()}}),o._toolbarHelper=new x.RichTextToolbarHelper(o,o._editor),o.toolbar=o._toolbarHelper.toolbar,o._linkEditor=new f.LinkEditor(null,{events:o.events,editor:o._editor,getRootView:c}),o._initHandlers(),o._initUI(o._initContainer),o._initEvents(),o}return i(e,t),e.prototype.setValue=function(t,e){void 0===e&&(e="html"),this.events.fire(b.RichTextEvents.action,[b.Action.parse,{value:t,mode:e},!1])},e.prototype.getValue=function(t){return void 0===t&&(t="html"),this._editor.serialize(t)},e.prototype.getStats=function(t){var e=t?this._editor.selection.getSelectedText():this.getValue("text");return v.getStats(e,this.config.customStats)},e.prototype.destructor=function(){this._compositionEventsDestructor(),this._editor.selection.destructor(),this.toolbar.destructor(),this._layout.getRootView().unmount()},e.prototype.fullScreen=function(){this.toolbar.data.exists("fullscreen")&&this.toolbar.data.update("fullscreen",{icon:"dxi-arrow-collapse",$fullscreen:!0}),document.body.classList.add("dhx_richtext--fullscreen","dhx_widget--fullscreen"),this._layout.getRootView().mount(document.body)},e.prototype.exitFullScreen=function(){this.toolbar.data.exists("fullscreen")&&this.toolbar.data.update("fullscreen",{icon:"dxi-arrow-expand",$fullscreen:!1}),document.body.classList.remove("dhx_richtext--fullscreen","dhx_widget--fullscreen"),this._layout.getRootView().mount(this._initContainer)},e.prototype.getEditorAPI=function(){var t=this;return{getSelection:function(){return t._editor.selection.get()},setSelection:function(e){t._editor.selection.set(e),t._restoreFocus()},getPosition:function(e){return t._editor.selection.getPosition(e)},getModel:function(){return t._editor.blocks.map(function(t){return{style:o({},t.style),textNodes:t.textNodes.map(function(t){return{style:o({},t.style),text:t.text}})}})},setModel:function(e,n){t.events.fire(b.RichTextEvents.action,[b.Action.parse,{value:e,mode:"inner"},!1]),n&&t._editor.selection.set(n)},add:function(e,n){n&&t._editor.selection.set(n),t.events.fire(b.RichTextEvents.action,[b.Action.innerAdd,e,!0])},remove:function(e){e&&t._editor.selection.set(e),t.events.fire(b.RichTextEvents.action,[b.Action.remove,!0,!0])},update:function(e,n){n&&t._editor.selection.set(n),t.events.fire(b.RichTextEvents.action,[b.Action.update,{modifier:e.modifier,modifierValue:e.value}])}}},e.prototype._initUI=function(t){var e=this,n=this._layout=new u.Layout(t,{css:"dhx_richtext dhx_richtext--mode_"+this.config.mode,cols:[{css:"dhx_toolbar__height-holder",rows:[{id:"toolbar",on:{click:function(){return e._restoreFocus()}},css:"dhx_richtext__toolbar-holder"},{id:"editor",css:"dhx_richtext__editor-holder"}]}]});this.mount(null,s.create({render:function(){return e._draw()},hooks:{didRedraw:function(){e._editor.selection.isActive()&&(e._editor.selection.update()||e._restoreFocus())}}})),n.cell("editor").attach(this),n.cell("toolbar").attach(this.toolbar)},e.prototype._initHandlers=function(){var t=this;this._handlers={onkeydown:function(e){if(!(t._composition.active||t._linkEditor.isVisible()&&!t._editor.selection.isActive())){var n=y.keyToOperation(e);n&&t.events.fire(b.RichTextEvents.action,[n.action,n.data])}},onpaste:function(e){t.events.fire(b.RichTextEvents.action,[b.Action.paste,e,!1])},oncut:function(e){t.events.fire(b.RichTextEvents.action,[b.Action.cut,e,!1])},oncopy:function(e){t.events.fire(b.RichTextEvents.action,[b.Action.copy,e,!1])},ondrop:function(t){t.preventDefault()},ondragstart:function(t){t.preventDefault()}}},e.prototype._initEvents=function(){var t=this;this.events.on(b.RichTextEvents.selectionRefresh,function(){return t._scrollHelper.update()}),this.events.on(b.RichTextEvents.action,function(e,n,i){t._editor.manager.execute({action:e,data:n})&&(t.events.fire(b.RichTextEvents.change,[e,t._editor.manager.canUndo(),t._editor.manager.canRedo()]),t.paint()),i&&t._restoreFocus()}),this.events.on(b.RichTextEvents.compositionStart,function(){t._composition.active=!0,t._composition.initSelection=t._editor.selection.get()}),this.events.on(b.RichTextEvents.compositionEnd,function(e){t._editor.selection.set(t._composition.initSelection),t.events.fire(b.RichTextEvents.action,[b.Action.add,e,!0]),t._composition.active=!1,t._composition.initSelection=null})},e.prototype._restoreFocus=function(){var t=this;this._restoreFocusTimeout&&clearTimeout(this._restoreFocusTimeout),this._restoreFocusTimeout=setTimeout(function(){t._scrollHelper.saveScrollTop(),t.getRootView().refs.editor.el.focus(),t._scrollHelper.restoreScrollTop();var e=t._editor.selection.refresh();t._restoreFocusTimeout=null,e||t._restoreFocus()},25)},e.prototype._draw=function(){var t=this,e=this._linkEditor.getCurrentLinkRef(),n=p.getLinkRefer(),i=null,r=[];return s.el(".dhx_richtext__overflow-wrapper",{_hooks:"document"===this.config.mode&&{didInsert:function(e){t._scrollHelper=_.createScrollHelper(e.el)}}},[s.el(".dhx_richtext__editor.dhx_richtext-editor",o({dhx_widget_id:this._uid,_ref:"editor",contentEditable:"true",role:"textbox","data-gramm":"false",spellcheck:"false",_hooks:"document"!==this.config.mode&&{didInsert:function(e){t._scrollHelper=_.createScrollHelper(e.el)}}},this._handlers),this._editor.blocks.map(function(o,a){return r.length&&(r=[],i=null),g.blockquoteWrapper(o.style,a)(g.blockStyleToTag(o.style),{style:g.calcBlockStyle(o.style),dhx_offset:a},o.textNodes.map(function(l,c){var u=p.getTextHash(a,c),d=c===o.textNodes.length-1;if(!l.style.link)return i=l.style.link,t._renderTextNode(l,u,d);if(i!==l.style.link){r=[t._renderTextNode(l,u,d)],i=l.style.link;var h=n();return s.el("a",{href:l.style.link,class:h===e?"dhx--link_edited":"",_ref:h},r)}r.push(t._renderTextNode(l,u,d))}))}))])},e.prototype._renderTextNode=function(t,e,n){var i=t.text,o="\n"===i[i.length-1]&&n;return s.el("span",{_ref:e,dhx_offset:e,style:g.calcTextNodeStyle(t.style)},0===i.length?[s.el("br")]:o?[i+"\n"]:i)},e}(c.View);e.Richtext=k},function(t,e,n){
- /**
- * Copyright (c) 2017, Leon Sorokin
- * All rights reserved. (MIT Licensed)
- *
- * domvm.js (DOM ViewModel)
- * A thin, fast, dependency-free vdom view layer
- * @preserve https://github.com/leeoniya/domvm (v3.2.6, micro build)
- */
- t.exports=function(){"use strict";var t=1,e=2,n=3,i=4,o=5,r="undefined"!=typeof window,s=(r?window:{}).requestAnimationFrame,a={};function l(){}var c=Array.isArray;function u(t){return null!=t}function d(t){return null!=t&&t.constructor===Object}function h(t,e,n,i){t.splice.apply(t,[n,i].concat(e))}function f(t){var e=typeof t;return"string"===e||"number"===e}function p(t){return"function"==typeof t}function _(t){for(var e=arguments,n=1;n<e.length;n++)for(var i in e[n])t[i]=e[n][i];return t}function v(t,e){for(var n=[],i=e;i<t.length;i++)n.push(t[i]);return n}function g(t,e){for(var n in t)if(t[n]!==e[n])return!1;return!0}function x(t,e){var n=t.length;if(e.length!==n)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function y(t){if(!s)return t;var e,n,i;function o(){e=0,t.apply(n,i)}return function(){n=this,i=arguments,e||(e=s(o))}}function m(t){return"o"===t[0]&&"n"===t[1]}function b(t){return"_"===t[0]}function k(t){return"style"===t}function w(t){t&&t.el&&t.el.offsetHeight}function I(t){return null!=t.node&&null!=t.node.el}function T(t,e){switch(e){case"value":case"checked":case"selected":return!0}return!1}function M(t){for(t=t||a;null==t.vm&&t.parent;)t=t.parent;return t.vm}function E(){}var S=E.prototype={constructor:E,type:null,vm:null,key:null,ref:null,data:null,hooks:null,ns:null,el:null,tag:null,attrs:null,body:null,flags:0,_class:null,_diff:null,_dead:!1,_lis:!1,idx:null,parent:null};function C(t){var n=new E;return n.type=e,n.body=t,n}var O={},R=/\[(\w+)(?:=(\w+))?\]/g,P=1,D=2,N=4,A=8;function B(e,n,i,o){var r=new E;r.type=t,u(o)&&(r.flags=o),r.attrs=n;var s=function(t){var e,n,i,o,r=O[t];if(null==r)for(O[t]=r={tag:(e=t.match(/^[-\w]+/))?e[0]:"div",id:(n=t.match(/#([-\w]+)/))?n[1]:null,class:(i=t.match(/\.([-\w.]+)/))?i[1].replace(/\./g," "):null,attrs:null};o=R.exec(t);)null==r.attrs&&(r.attrs={}),r.attrs[o[1]]=o[2]||"";return r}(e);if(r.tag=s.tag,s.id||s.class||s.attrs){var a=r.attrs||{};if(s.id&&!u(a.id)&&(a.id=s.id),s.class&&(r._class=s.class,a.class=s.class+(u(a.class)?" "+a.class:"")),s.attrs)for(var l in s.attrs)u(a[l])||(a[l]=s.attrs[l]);r.attrs=a}var c=r.attrs;return u(c)&&(u(c._key)&&(r.key=c._key),u(c._ref)&&(r.ref=c._ref),u(c._hooks)&&(r.hooks=c._hooks),u(c._data)&&(r.data=c._data),u(c._flags)&&(r.flags=c._flags),u(r.key)||(u(r.ref)?r.key=r.ref:u(c.id)?r.key=c.id:u(c.name)&&(r.key=c.name+("radio"===c.type||"checkbox"===c.type?c.value:"")))),null!=i&&(r.body=i),r}function j(t,n,r,s){if(t.type!==o&&t.type!==i){t.parent=n,t.idx=r,t.vm=s,null!=t.ref&&function(t,e,n){var i=["refs"].concat(e.split("."));!function(t,e,n){for(var i;i=e.shift();)0===e.length?t[i]=n:t[i]=t=t[i]||{}}(t,i,n)}(M(t),t.ref,t);var a=t.hooks,l=s&&s.hooks;(a&&(a.willRemove||a.didRemove)||l&&(l.willUnmount||l.didUnmount))&&function(t){for(;t=t.parent;)t.flags|=P}(t),c(t.body)&&function(t){for(var n=t.body,i=0;i<n.length;i++){var o=n[i];!1===o||null==o?n.splice(i--,1):c(o)?h(n,o,i--,1):(null==o.type&&(n[i]=o=C(""+o)),o.type===e?null==o.body||""===o.body?n.splice(i--,1):i>0&&n[i-1].type===e?(n[i-1].body+=o.body,n.splice(i--,1)):j(o,t,i,null):j(o,t,i,null))}}(t)}}var L={animationIterationCount:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,order:!0,lineClamp:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function z(t,e){return isNaN(e)||L[t]?e:e+"px"}function F(t,e){var n=(t.attrs||a).style,i=e?(e.attrs||a).style:null;if(null==n||f(n))t.el.style.cssText=n;else{for(var o in n){var r=n[o];(null==i||null!=r&&r!==i[o])&&(t.el.style[o]=z(o,r))}if(i)for(var s in i)null==n[s]&&(t.el.style[s]="")}}var V=[];function H(t,e,n,i,o){if(null!=t){var r=n.hooks[e];if(r){if("d"!==e[0]||"i"!==e[1]||"d"!==e[2])return r(n,i);o?w(n.parent)&&r(n,i):V.push([r,n,i])}}}function $(t){var e;if(V.length)for(w(t.node);e=V.shift();)e[0](e[1],e[2])}var q=r?document:null;function U(t){return t.nextSibling}function W(t,e,n){var i=e._node,o=i.vm;if(c(i.body))if((i.flags&P)===P)for(var r=0;r<i.body.length;r++)W(e,i.body[r].el);else G(i);delete e._node,t.removeChild(e),H(i.hooks,"didRemove",i,null,n),null!=o&&(H(o.hooks,"didUnmount",o,o.data,n),o.node=null)}function X(t,e){var n=e._node;if(!n._dead){var i=function t(e){var n=e.vm,i=null!=n&&H(n.hooks,"willUnmount",n,n.data),o=H(e.hooks,"willRemove",e);if((e.flags&P)===P&&c(e.body))for(var r=0;r<e.body.length;r++)t(e.body[r]);return i||o}(n);null!=i&&function(t){return"object"==typeof t&&p(t.then)}(i)?(n._dead=!0,i.then(function(t,e,n){return function(){return t.apply(n,e)}}(W,[t,e,!0]))):W(t,e)}}function G(t){for(var e=t.body,n=0;n<e.length;n++){var i=e[n];delete i.el._node,null!=i.vm&&(i.vm.node=null),c(i.body)&&G(i)}}function Y(t){var e=t.el;if(0==(t.flags&P))c(t.body)&&G(t),e.textContent=null;else{var n=e.firstChild;do{var i=U(n);X(e,n)}while(n=i)}}function K(t,e,n){var i=e._node,o=null!=e.parentNode,r=e!==n&&o?null:i.vm;null!=r&&H(r.hooks,"willMount",r,r.data),H(i.hooks,o?"willReinsert":"willInsert",i),t.insertBefore(e,n),H(i.hooks,o?"didReinsert":"didInsert",i),null!=r&&H(r.hooks,"didMount",r,r.data)}function Z(t,e,n){K(t,e,n?U(n):null)}var J={},Q=l;function tt(t,e,n){t[e]=n}function et(t,e,n,i,o){var r=t.apply(o,e.concat([n,i,o,o.data]));o.onevent(n,i,o,o.data,e),Q.call(null,n,i,o,o.data,e),!1===r&&(n.preventDefault(),n.stopPropagation())}function nt(t){var e,n,i=function(t){for(;null==t._node;)t=t.parentNode;return t._node}(t.target),o=M(i),r=t.currentTarget._node.attrs["on"+t.type];if(c(r))e=r[0],n=r.slice(1),et(e,n,t,i,o);else for(var s in r)if(t.target.matches(s)){var a=r[s];c(a)?(e=a[0],n=a.slice(1)):(e=a,n=[]),et(e,n,t,i,o)}}function it(t,e,n,i){if(n!==i){var o=t.el;null==n||p(n)?tt(o,e,n):null==i&&tt(o,e,nt)}}function ot(t,e,n){"."===e[0]&&(e=e.substr(1),n=!0),n?t.el[e]="":t.el.removeAttribute(e)}function rt(t,e,n,i,o){var r=t.el;null==n?!o&&ot(t,e,!1):null!=t.ns?r.setAttribute(e,n):"class"===e?r.className=n:"id"===e||"boolean"==typeof n||i?r[e]=n:"."===e[0]?r[e.substr(1)]=n:r.setAttribute(e,n)}function st(t,e,n){var i=t.attrs||a,o=e.attrs||a;if(i===o);else{for(var r in i){var s=i[r],l=T(t.tag,r),c=l?t.el[r]:o[r];s===c||(k(r)?F(t,e):b(r)||(m(r)?it(t,r,s,c):rt(t,r,s,l,n)))}for(var r in o)!(r in i)&&!b(r)&&ot(t,r,T(t.tag,r)||m(r))}}function at(t,e,n,o){return t.type===i&&(e=t.data,n=t.key,o=t.opts,t=t.view),new kt(t,e,n,o)}function lt(t){for(var e=0;e<t.body.length;e++){var r=t.body[e],s=r.type;if(s<=n)K(t.el,ct(r));else if(s===i){var a=at(r.view,r.data,r.key,r.opts)._redraw(t,e,!1);s=a.node.type,K(t.el,ct(a.node))}else if(s===o){var a=r.vm;a._redraw(t,e),s=a.node.type,K(t.el,a.node.el)}}}function ct(i,o){return null==i.el&&(i.type===t?(i.el=o||function(t,e){return null!=e?q.createElementNS(e,t):q.createElement(t)}(i.tag,i.ns),null!=i.attrs&&st(i,a,!0),(i.flags&A)===A&&i.body.body(i),c(i.body)?lt(i):null!=i.body&&""!==i.body&&(i.el.textContent=i.body)):i.type===e?i.el=o||function(t){return q.createTextNode(t)}(i.body):i.type===n&&(i.el=o||function(t){return q.createComment(t)}(i.body))),i.el._node=i,i.el}window.lisMove=ft;var ut=1,dt=2;function ht(t,e,n,i,o,r,s,a){return function(l,c,u,d,h,f){var p,_;if(null!=d[i]){if(null==(p=d[i]._node))return void(d[i]=t(d[i]));if(function(t){return t.parent}(p)!==l)return _=t(d[i]),null!=p.vm?p.vm.unmount(!0):X(c,d[i]),void(d[i]=_)}if(d[o]==h)return dt;if(null==d[o].el)n(c,ct(d[o]),d[i]),d[o]=e(d[o],u);else if(d[o].el===d[i])d[o]=e(d[o],u),d[i]=t(d[i]);else{if(f||p!==d[s])return f&&null!=d[i]?ft(t,e,n,i,o,c,u,p,d):ut;_=d[i],d[i]=t(_),a(c,_,d[r]),d[r]=_}}}function ft(t,e,n,i,o,r,s,a,l){if(a._lis)n(r,l[o].el,l[i]),l[o]=e(l[o],s);else{var c=function(t,e){var n,i=0,o=e.length-1;if(o<=2147483647)for(;i<=o;){if(e[n=i+o>>1]===t)return n;e[n]<t?i=n+1:o=n-1}else for(;i<=o;){if(n=Math.floor((i+o)/2),e[n]===t)return n;e[n]<t?i=n+1:o=n-1}return i==e.length?null:i}(a.idx,l.tombs);a._lis=!0;var u=t(l[i]);n(r,l[i],null!=c?s[l.tombs[c]].el:c),null==c?l.tombs.push(a.idx):l.tombs.splice(c,0,a.idx),l[i]=u}}var pt=ht(U,function(t,e){return e[t.idx+1]},K,"lftSib","lftNode","rgtSib","rgtNode",Z),_t=ht(function(t){return t.previousSibling},function(t,e){return e[t.idx-1]},Z,"rgtSib","rgtNode","lftSib","lftNode",K);function vt(t,e,n,i){for(var o=Array.prototype.slice.call(e.childNodes),r=[],s=0;s<o.length;s++){var a=o[s]._node;a.parent===t&&r.push(a.idx)}for(var l=function(t){var e,n,i=t.slice(),o=[];o.push(0);for(var r=0,s=t.length;r<s;++r){var a=o[o.length-1];if(t[a]<t[r])i[r]=a,o.push(r);else{for(e=0,n=o.length-1;e<n;){var l=(e+n)/2|0;t[o[l]]<t[r]?e=l+1:n=l}t[r]<t[o[e]]&&(e>0&&(i[r]=o[e-1]),o[e]=r)}}for(e=o.length,n=o[e-1];e-- >0;)o[e]=n,n=i[n];return o}(r).map(function(t){return r[t]}),c=0;c<l.length;c++)n[l[c]]._lis=!0;for(i.tombs=l;;){var u=pt(t,e,n,i,null,!0);if(u===dt)break}}function gt(t){return t.el._node.parent!==t.parent}function xt(t,e,n){return e[n]}function yt(t,e,n){for(;n<e.length;n++){var r=e[n];if(null!=r.vm){if(t.type===i&&r.vm.view===t.view&&r.vm.key===t.key||t.type===o&&r.vm===t.vm)return r}else if(!gt(r)&&t.tag===r.tag&&t.type===r.type&&t.key===r.key&&(t.flags&~P)==(r.flags&~P))return r}return null}function mt(t,e,n){return e[e._keys[t.key]]}function bt(r,s){H(s.hooks,"willRecycle",s,r);var l=r.el=s.el,u=s.body,d=r.body;if(l._node=r,r.type!==e||d===u){null==r.attrs&&null==s.attrs||st(r,s,!1);var h=c(u),f=c(d),p=(r.flags&A)===A;h?f||p?function(e,r){var s=e.body,l=s.length,c=r.body,u=c.length,d=(e.flags&A)===A,h=(e.flags&D)===D,f=(e.flags&N)===N,p=!h&&e.type===t,_=!0,v=f?mt:h||d?xt:yt;if(f){for(var g={},x=0;x<c.length;x++)g[c[x].key]=x;c._keys=g}if(p&&0===l)return Y(r),void(d&&(e.body=[]));var y,m,b=0,k=!1,w=0;if(d)var T={key:null},M=Array(l);for(var x=0;x<l;x++){if(d){var E=!1,S=null;_&&(f&&(T.key=s.key(x)),y=v(T,c,w)),null!=y?(m=y.idx,!0===(S=s.diff(x,y))?((C=y).parent=e,C.idx=x,C._lis=!1):E=!0):E=!0,E&&(j(C=s.tpl(x),e,x),C._diff=null!=S?S:s.diff(x),null!=y&&bt(C,y)),M[x]=C}else{var C=s[x],O=C.type;if(O<=n)(y=_&&v(C,c,w))&&(bt(C,y),m=y.idx);else if(O===i){if(y=_&&v(C,c,w)){m=y.idx;var R=y.vm._update(C.data,e,x)}else var R=at(C.view,C.data,C.key,C.opts)._redraw(e,x,!1);O=R.node.type}else if(O===o){var P=I(C.vm),R=C.vm._update(C.data,e,x,P);O=R.node.type}}if(!f&&null!=y&&(m===w?++w===u&&l>u&&(y=null,_=!1):k=!0,u>100&&k&&++b%10==0))for(;w<u&>(c[w]);)w++}d&&(e.body=M),p&&function(t,e){var n=e.body,i=t.el,o=t.body,r={lftNode:o[0],rgtNode:o[o.length-1],lftSib:(n[0]||a).el,rgtSib:(n[n.length-1]||a).el};t:for(;;){for(;;){var s=pt(t,i,o,r,null,!1);if(s===ut)break;if(s===dt)break t}for(;;){var l=_t(t,i,o,r,r.lftNode,!1);if(l===ut)break;if(l===dt)break t}vt(t,i,o,r);break}}(e,r)}(r,s):d!==u&&(null!=d?l.textContent=d:Y(s)):f?(Y(s),lt(r)):d!==u&&(l.firstChild?l.firstChild.nodeValue=d:l.textContent=d),H(s.hooks,"didRecycle",s,r)}else l.nodeValue=d}function kt(t,e,n,i){var o=this;o.view=t,o.data=e,o.key=n,i&&(o.opts=i,o.config(i));var r=d(t)?t:t.call(o,o,e,n,i);p(r)?o.render=r:(o.render=r.render,o.config(r)),o._redrawAsync=y(function(t){return o.redraw(!0)}),o._updateAsync=y(function(t){return o.update(t,!0)}),o.init&&o.init.call(o,o,o.data,o.key,i)}var wt=kt.prototype={constructor:kt,_diff:null,init:null,view:null,key:null,data:null,state:null,api:null,opts:null,node:null,hooks:null,onevent:l,refs:null,render:null,mount:function(t,e){var n=this;return e?(Y({el:t,flags:0}),n._redraw(null,null,!1),t.nodeName.toLowerCase()!==n.node.tag?(ct(n.node),K(t.parentNode,n.node.el,t),t.parentNode.removeChild(t)):K(t.parentNode,ct(n.node,t),t)):(n._redraw(null,null),t&&K(t,n.node.el)),t&&$(n),n},unmount:function(t){var e=this.node;X(e.el.parentNode,e.el),t||$(this)},config:function(t){var e=this;t.init&&(e.init=t.init),t.diff&&(e.diff=t.diff),t.onevent&&(e.onevent=t.onevent),t.hooks&&(e.hooks=_(e.hooks||{},t.hooks)),t.onemit&&(e.onemit=_(e.onemit||{},t.onemit))},parent:function(){return M(this.node.parent)},root:function(){for(var t=this.node;t.parent;)t=t.parent;return t.vm},redraw:function(t){return t?this._redraw(null,null,I(this)):this._redrawAsync(),this},update:function(t,e){return e?this._update(t,null,null,I(this)):this._updateAsync(t),this},_update:function(t,e,n,i){var o=this;return null!=t&&o.data!==t&&(H(o.hooks,"willUpdate",o,t),o.data=t),o._redraw(e,n,i)},_redraw:function(t,e,n){var i,o,r=null==t,s=this,a=s.node&&s.node.el&&s.node.el.parentNode,l=s.node;if(null!=s.diff&&(i=s._diff,s._diff=o=s.diff(s,s.data),null!=l)){var u=c(i)?x:g,d=i===o||u(i,o);if(d)return It(s,l,t,e)}a&&H(s.hooks,"willRedraw",s,s.data);var h=s.render.call(s,s,s.data,i,o);if(h===l)return It(s,l,t,e);if(s.refs=null,null!=s.key&&h.key!==s.key&&(h.key=s.key),s.node=h,t?(j(h,t,e,s),t.body[e]=h):l&&l.parent?(j(h,l.parent,l.idx,s),l.parent.body[l.idx]=h):j(h,null,null,s),!1!==n)if(l)if(l.tag!==h.tag||l.key!==h.key){l.vm=h.vm=null;var f=l.el.parentNode,p=U(l.el);X(f,l.el),K(f,ct(h),p),l.el=h.el,h.vm=s}else bt(h,l);else ct(h);return a&&H(s.hooks,"didRedraw",s,s.data),r&&a&&$(s),s},_redrawAsync:null,_updateAsync:null};function It(t,e,n,i){return null!=n&&(n.body[i]=e,e.idx=i,e.parent=n,e._lis=!1),t}function Tt(t,e,n,i){var o,r;return null==n?d(e)?o=e:r=e:(o=e,r=n),B(t,o,r,i)}var Mt="http://www.w3.org/2000/svg";function Et(t,e,n,i){this.view=t,this.data=e,this.key=n,this.opts=i}function St(t){this.vm=t}Et.prototype={constructor:Et,type:i,view:null,data:null,key:null,opts:null},St.prototype={constructor:St,type:o,vm:null};var Ct={config:function(t){Q=t.onevent||Q,t.onemit&&function(t){_(J,t)}(t.onemit)},ViewModel:kt,VNode:E,createView:at,defineElement:Tt,defineSvgElement:function(t,e,n,i){var o=Tt(t,e,n,i);return o.ns=Mt,o},defineText:C,defineComment:function(t){var e=new E;return e.type=n,e.body=t,e},defineView:function(t,e,n,i){return new Et(t,e,n,i)},injectView:function(t){return new St(t)},injectElement:function(e){var n=new E;return n.type=t,n.el=n.key=e,n},lazyList:function(t,e){var n=t.length,i={items:t,length:n,key:function(n){return e.key(t[n],n)},diff:function(n,i){var o=e.diff(t[n],n);if(null==i)return o;var r=i._diff,s=o===r||c(r)?x(o,r):g(o,r);return s||o},tpl:function(n){return e.tpl(t[n],n)},map:function(t){return e.tpl=t,i},body:function(t){for(var e=Array(n),o=0;o<n;o++){var r=i.tpl(o);r._diff=i.diff(o),e[o]=r,j(r,t,o)}t.body=e}};return i},FIXED_BODY:D,DEEP_REMOVE:P,KEYED_LIST:N,LAZY_LIST:A};function Ot(t){var e,n,i=arguments,o=i.length;if(o>1){var r=1;d(i[1])&&(n=i[1],r=2),e=o===r+1&&(f(i[r])||c(i[r])||n&&(n._flags&A)===A)?i[r]:v(i,r)}return B(t,n,e)}return S.patch=function(t,e){!function(t,e,n){if(null!=e.type){if(null!=t.vm)return;j(e,t.parent,t.idx,null),t.parent.body[t.idx]=e,bt(e,t),n&&w(e),$(M(e))}else{var i=Object.create(t);i.attrs=_({},t.attrs);var o=_(t.attrs,e);if(null!=t._class){var r=o.class;o.class=null!=r&&""!==r?t._class+" "+r:t._class}st(t,i),n&&w(t)}}(this,t,e)},wt.emit=function(t){var e=this,n=e,i=v(arguments,1).concat(n,n.data);do{var o=e.onemit,r=o?o[t]:null;if(r){r.apply(e,i);break}}while(e=e.parent());J[t]&&J[t].apply(e,i)},wt.onemit=null,wt.body=function(){return function t(e,n){var i=e.body;if(c(i))for(var o=0;o<i.length;o++){var r=i[o];null!=r.vm?n.push(r.vm):t(r,n)}return n}(this.node,[])},Ct.defineElementSpread=Ot,Ct.defineSvgElementSpread=function(){var t=Ot.apply(null,arguments);return t.ns=Mt,t},Ct}()},function(t,e){if(Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(42))},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(43),r=n(0),s=function(t){function e(e,n){var i=t.call(this,e,n)||this;if(i._root=i.config.parent||i,i._all={},i._parseConfig(),i.config.views&&(i.config.activeView=i.config.activeView||i._cells[0].id,i._isViewLayout=!0),!n.parent){var o=r.create({render:function(){return i.toVDOM()}},i);i.mount(e,o)}return i}return i(e,t),e.prototype.cell=function(t){return this._root._all[t]},e.prototype.toVDOM=function(){if(this._isViewLayout){var e=[this.cell(this.config.activeView).toVDOM()];return t.prototype.toVDOM.call(this,e)}var n=[];return this._cells.forEach(function(t){var e=t.toVDOM();Array.isArray(e)?n=n.concat(e):n.push(e)}),t.prototype.toVDOM.call(this,n)},e.prototype.removeCell=function(t){var e=this.config.parent||this;if(e!==this)return e.removeCell(t);var n=this.cell(t);if(n){var i=n.getParent();delete this._all[t],i._cells=i._cells.filter(function(e){return e.id!==t}),i.paint()}},e.prototype.addCell=function(t,e){void 0===e&&(e=-1);var n=this._createCell(t);e<0&&(e=this._cells.length+e+1),this._cells.splice(e,0,n),this.paint()},e.prototype.getId=function(t){return t<0&&(t=this._cells.length+t),this._cells[t]?this._cells[t].id:void 0},e.prototype.getRefs=function(t){return this._root.getRootView().refs[t]},e.prototype._getCss=function(e){return e?this._xLayout?" dhx_layout-columns":" dhx_layout-rows":(this.config.parent?t.prototype._getCss.call(this):"dhx_widget dhx_layout")+(this.config.full?this.config.parent?"":" dhx_layout-cell":this._xLayout?" dhx_layout-columns":" dhx_layout-rows")},e.prototype._parseConfig=function(){var t=this,e=this.config,n=e.rows||e.cols||e.views;this._xLayout=!e.rows,this._cells=n.map(function(e){return t._createCell(e)})},e.prototype._createCell=function(t){var n;return t.rows||t.cols||t.views?(t.parent=this._root,n=new e(this,t)):n=new o.Cell(this,t),this._root._all[n.id]=n,n},e}(o.Cell);e.Layout=s},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r,s=n(3),a=n(0),l=n(8);!function(t){t[t.unknown=0]="unknown",t[t.percents=1]="percents",t[t.pixels=2]="pixels",t[t.mixedpx1=3]="mixedpx1",t[t.mixedpx2=4]="mixedpx2",t[t.mixedperc1=5]="mixedperc1",t[t.mixedperc2=6]="mixedperc2"}(r||(r={}));var c=function(t){function e(e,n){var i=t.call(this,e,n)||this,o=e;return o&&o.isVisible&&(i._parent=o),i.config.full=void 0===i.config.full?Boolean(i.config.header||i.config.footer):i.config.full,i._initHandlers(),i.id=i.config.id||s.uid(),i}return i(e,t),e.prototype.paint=function(){if(this.isVisible()){var t=this.getRootView();t?t.redraw():this._parent.paint()}},e.prototype.isVisible=function(){if(!this._parent)return!(!this._container||!this._container.tagName);var t=this._parent.config.activeView;return(!t||t===this.id)&&(!this.config.hidden&&(!this._parent||this._parent.isVisible()))},e.prototype.hide=function(){this.config.hidden=!0,this._parent&&this._parent.paint&&this._parent.paint()},e.prototype.show=function(){this._parent&&this._parent.config.activeView?this._parent.config.activeView=this.id:this.config.hidden=!1,this._parent&&!this._parent.isVisible()&&this._parent.show(),this.paint()},e.prototype.getParent=function(){return this._parent},e.prototype.destructor=function(){this.config=null},e.prototype.getWidget=function(){return this._ui},e.prototype.getCellView=function(){return this._parent&&this._parent.getRefs(this._uid)},e.prototype.attach=function(t,e){return"object"==typeof t?(t._container=this,this._ui=t):"string"==typeof t?this._ui=new window.dhx[t](null,e):"function"==typeof t&&(t.prototype instanceof l.View?this._ui=new t(null,e):this._ui={getRootView:function(){return t(e)}}),this.paint(),this._ui},e.prototype.toVDOM=function(t){var e;if(!this.config.hidden){var n,i=this._calculateStyle();if(this.config.html)n=[a.el(".dhx_inner-html-content",{".innerHTML":this.config.html})];else if(this._ui){var r=this._ui.getRootView();r.render&&(r=a.inject(r)),n=[r]}else n=t||null;var s=this.config.canResize&&!this._isLastCell()?a.el(".dhx_layout-resizer."+(this._isXDirection()?"dhx_layout-resizer--x":"dhx_layout-resizer--y"),o({},this._resizerHandlers,{_ref:"resizer_"+this._uid}),[a.el("span.dhx_layout-resizer__icon",{class:"dxi "+(this._isXDirection()?"dxi-dots-vertical":"dxi-dots-horizontal")})]):null,l={};if(this.config.on)for(var c in this.config.on)l["on"+c]=this.config.on[c];var u=a.el("div",o(((e={_key:this._uid,style:i,_ref:this._uid,id:this.config.id||this._uid})["aria-labelledby"]=this.config.id?"tab-content-"+this.config.id:null,e),l,{class:this._getCss(!1)+(this.config.css?" "+this.config.css:"")}),this.config.full?[this.config.header?a.el("div",{class:"dhx_layout-cell-header"+(this.config.collapsed?" dhx_layout-cell-header--collapsed":"")+(this.config.canCollapse?" dhx_layout-cell-header--collapseble":""),onclick:this._handlers.collapse},[this.config.headerIcon&&a.el("span.dhx_layout-cell-header__icon.dxi."+this.config.headerIcon),a.el(".dhx_layout-cell-header__title",this.config.header),this.config.canCollapse?a.el("div.dhx_layout-cell-header__collapse-icon",{tabindex:"0",role:"button","aria-label":"collapse",class:"dxi dxi-chevron-down"}):null]):null,this.config.collapsed?null:a.el("div",{class:"dhx_layout-cell--content"+this._getCss(!0)},n)]:n);return s?[u,s]:u}},e.prototype._getCss=function(t){return"dhx_layout-cell "},e.prototype._initHandlers=function(){var t=this,e={left:null,top:null,isActive:!1,range:null,xLayout:null,nextCell:null,size:null,resizerLength:null,mode:null,percentsum:null},n=function(){e.isActive=!1,document.body.classList.remove("dhx_no-select"),document.removeEventListener("mouseup",n),document.removeEventListener("mousemove",i)},i=function(n){if(e.isActive&&e.mode!==r.unknown){var i=e.xLayout?n.x-e.range.min-window.pageXOffset:n.y-e.range.min-window.pageYOffset,o=e.xLayout?"width":"height";switch(i<0?i=e.resizerLength/2:i>e.size&&(i=e.size-e.resizerLength),e.mode){case r.pixels:t.config[o]=i-e.resizerLength/2+"px",e.nextCell.config[o]=e.size-i-e.resizerLength/2+"px";break;case r.mixedpx1:t.config[o]=i-e.resizerLength/2+"px";break;case r.mixedpx2:e.nextCell.config[o]=e.size-i-e.resizerLength/2+"px";break;case r.percents:t.config[o]=i/e.size*e.percentsum+"%",e.nextCell.config[o]=(e.size-i)/e.size*e.percentsum+"%";break;case r.mixedperc1:t.config[o]=i/e.size*e.percentsum+"%";break;case r.mixedperc2:e.nextCell.config[o]=(e.size-i)/e.size*e.percentsum+"%"}t.paint()}};this._handlers={collapse:function(){t.config.canCollapse&&(t.config.collapsed=!t.config.collapsed,t.paint())}},this._resizerHandlers={onmousedown:function(o){if(3!==o.which){e.isActive&&n(),document.body.classList.add("dhx_no-select");var s=t.getCellView(),a=t._getNextCell(),l=a.getCellView(),c=t._getResizerView(),u=s.el.getBoundingClientRect(),d=c.el.getBoundingClientRect(),h=l.el.getBoundingClientRect();if(e.xLayout=t._isXDirection(),e.left=u.left+window.pageXOffset,e.top=u.top+window.pageYOffset,e.range=function(t,e,n){return void 0===n&&(n=!0),n?{min:t.left+window.pageXOffset,max:e.right+window.pageXOffset}:{min:t.top+window.pageYOffset,max:e.bottom+window.pageYOffset}}(u,h,e.xLayout),e.size=e.range.max-e.range.min,e.isActive=!0,e.nextCell=a,e.resizerLength=e.xLayout?d.width:d.height,e.mode=function(t,e,n){var i=t?"width":"height",o=e[i]&&-1!==e[i].indexOf("%"),s=n[i]&&-1!==n[i].indexOf("%"),a=e[i]&&-1!==e[i].indexOf("px"),l=n[i]&&-1!==n[i].indexOf("px");return o&&s?r.percents:a&&l?r.pixels:a&&!l?r.mixedpx1:l&&!a?r.mixedpx2:o?r.mixedperc1:s?r.mixedperc2:r.unknown}(e.xLayout,t.config,a.config),e.mode===r.percents){var f=e.xLayout?"width":"height";e.percentsum=parseFloat(t.config[f])+parseFloat(a.config[f])}if(e.mode===r.mixedperc1){f=e.xLayout?"width":"height";e.percentsum=1/(u[f]/(e.size-e.resizerLength))*parseFloat(t.config[f])}if(e.mode===r.mixedperc2){f=e.xLayout?"width":"height";e.percentsum=1/(h[f]/(e.size-e.resizerLength))*parseFloat(a.config[f])}document.addEventListener("mouseup",n),document.addEventListener("mousemove",i)}},ondragstart:function(t){return t.preventDefault()}}},e.prototype._isLastCell=function(){var t=this._parent;return t&&t._cells.indexOf(this)===t._cells.length-1},e.prototype._getNextCell=function(){var t=this._parent,e=t._cells.indexOf(this);return t._cells[e+1]},e.prototype._getResizerView=function(){return this._parent.getRefs("resizer_"+this._uid)},e.prototype._isXDirection=function(){return this._parent&&this._parent._xLayout},e.prototype._calculateStyle=function(){var t=this.config,e={};return this._isXDirection()?(void 0!==this.config.width&&(e.flexBasis=t.width),void 0!==t.height&&(e.height=t.height)):(void 0!==this.config.height&&(e.flexBasis=t.height),void 0!==t.width&&(e.width=t.width)),e},e}(l.View);e.Cell=c},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),r=n(0),s=n(1),a=n(22),l=n(28);var c=function(t){function e(e,n){var i=t.call(this,e,o.extend({navigationType:"click"},n))||this;i._listeners={input:function(t){var e=s.locate(t);i.data.update(e,{value:t.target.value})},tooltip:function(t){var e=s.locateNode(t);if(e){var n=e.getAttribute("dhx_id"),o=i.data.getItem(n);o.tooltip&&l.tooltip(o.tooltip,{node:e,position:l.Position.bottom})}}},i._currentRoot=null,i._factory=a.createFactory(a.ItemType.button);return i.mount(e,r.create({render:function(){return i._draw()}})),i}return i(e,t),e.prototype.getValues=function(){var t={};for(var e in this.data.eachChild(this.data.getRoot(),function(e){e.twoState?t[e.id]=e.active:e.type===a.ItemType.input&&(t[e.id]=e.value)},!1),this._groups)this._groups[e].active&&(t[e]=this._groups[e].active);return t},e.prototype.setValues=function(t){for(var e in t){if(this._groups[e])this._groups[e].active&&(this.data.update(this._groups[e].active,{active:!1}),this._groups[e].active=t[e],this.data.update(t[e],{active:!0}));else this.data.getItem(e).type===a.ItemType.input?this.data.update(e,{value:t[e]}):this.data.update(e,{active:t[e]})}},e.prototype._draw=function(){var t=this;return r.el("nav.dhx_toolbar.dhx_widget"+(this.config.css?"."+this.config.css:""),[r.el("ul.dhx_toolbar__list",{dhx_widget_id:this._uid,tabindex:0,onclick:this._handlers.onclick,onmousedown:this._handlers.onmousedown,oninput:this._listeners.input,onmouseover:this._listeners.tooltip,_hooks:{didInsert:function(e){e.el.addEventListener("keyup",function(e){if(9===e.which){var n=s.locateNode(document.activeElement);if(n){var i=n.getAttribute("dhx_id"),o=t.data.getItem(i);o.tooltip&&l.tooltip(o.tooltip,{node:n,position:l.Position.bottom,force:!0})}}},!0)}}},this.data.map(function(e){return t._factory(e,t.events)},this.data.getRoot(),!1))])},e.prototype._getMode=function(t,e){return t.id===e?"bottom":"right"},e.prototype._close=function(){this._activePosition=null,this._currentRoot=null,t.prototype._close.call(this)},e.prototype._normalizeData=function(){var t=this,e=this.data.getRoot(),n={};this.data.eachChild(e,function(i){i.type===a.ItemType.separator&&(i.$menuSeparator=i.parent!==t.data.getRoot()),t.data.haveItems(i.id)&&(t.data.eachChild(i.id,function(t){return t.type=t.type||a.ItemType.menuItem},!1),i.parent!==e?i.$openIcon="right":i.$openIcon="bot"),i.group&&function(t,e){t[e.group]?(e.active&&(t[e.group].active=e.id),t[e.group].elements.push(e.id)):t[e.group]={active:e.active?e.id:null,elements:[e.id]}}(n,i)},!0),this._groups=n},e.prototype._setRoot=function(t){this.data.getParent(t)===this.data.getRoot()&&(this._currentRoot=t)},e}(a.MenuBase);e.Toolbar=c},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._isContextMenu=!0,e}return i(e,t),e.prototype.showAt=function(t,e){if(void 0===e&&(e="bottom"),t instanceof MouseEvent)this._changeActivePosition({left:window.pageXOffset+t.x+1,right:window.pageXOffset+t.x+1,top:window.pageYOffset+t.y,bottom:window.pageYOffset+t.y},e);else{var n=o.toNode(t);this._changeActivePosition(o.getRealPosition(n),e)}},e.prototype._close=function(){this._activeMenu=null,this._changeActivePosition(null,null)},e.prototype._normalizeData=function(){var t=this,e=this.data.getRoot();this.data.eachChild(e,function(e){t.data.haveItems(e.id)&&(e.$openIcon="right")},!0)},e.prototype._getMode=function(t,e,n){return n?this._mode:"right"},e.prototype._changeActivePosition=function(t,e){this._activePosition=t,this._mode=e,this._listenOuterClick(),this.paint()},e}(n(17).MenuBase);e.ContextMenu=r},function(t,e,n){"use strict";function i(t){for(var e=t.toLowerCase().match(/\w+/g),n=0,i="",o=0;o<e.length;o++){var r=e[o];"ctrl"===r?n+=4:"shift"===r?n+=2:"alt"===r?n+=1:i=r}return n+i}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){var t=this;this._keysStorage={},document.addEventListener("keydown",function(e){var n=(e.ctrlKey||e.metaKey?4:0)+(e.shiftKey?2:0)+(e.altKey?1:0)+(e.which>=48&&e.which<=57||e.which>=65&&e.which<=90?String.fromCharCode(e.which):e.key).toLowerCase(),i=t._keysStorage[n];if(i)for(var o=0;o<i.length;o++)i[o].handler(e)})}return t.prototype.addHotKey=function(t,e,n){var o=i(t);this._keysStorage[o]||(this._keysStorage[o]=[]),this._keysStorage[o].push({handler:e,scope:n})},t.prototype.removeHotKey=function(t,e){var n=this._keysStorage;t&&delete n[o=i(t)];if(e)for(var o in n){for(var r=[],s=0;s<n[o].length;s++)n[o][s].scope===e&&r.push(s);if(n[o].length===r.length)delete n[o];else for(s=r.length-1;s>=0;s--)n[o].splice(r[s],1)}},t.prototype.exist=function(t){var e=i(t);return!!this._keysStorage[e]},t}();e.keyManager=new o,e.addHotkeys=function(t,n){var i=new Date,o=function(t){return function(e){n&&!1===n()||t(e)}};for(var r in t)e.keyManager.addHotKey(r,o(t[r]),i);return function(){return e.keyManager.removeHotKey(void 0,i)}}},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(9)),i(n(23)),i(n(26)),i(n(53)),i(n(15)),i(n(10)),i(n(24)),i(n(25)),i(n(55))},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),o=function(){function e(t,e){this._parent=t,this._changes=e}return e.prototype.load=function(t,e){var n=this;return this._parent.loadData=t.load().then(function(t){n._parent.removeAll(),n.parse(t,e)})},e.prototype.parse=function(t,e){void 0===e&&(e="json"),t=(e=i.toDataDriver(e)).toJsonArray(t),this._parent.$parse(t)},e.prototype.save=function(e){for(var n=this,o=function(o){if(o.saving||o.pending)i.dhxWarning("item is saving");else{var s=r._findPrevState(o.id);if(s&&s.saving){var a=new t(function(t,r){s.promise.then(function(){o.pending=!1,t(n._setPromise(o,e))}).catch(function(t){n._removeFromOrder(s),n._setPromise(o,e),i.dhxWarning(t),r(t)})});r._addToChain(a),o.pending=!0}else r._setPromise(o,e)}},r=this,s=0,a=this._changes.order;s<a.length;s++){o(a[s])}this._parent.saveData.then(function(){n._saving=!1})},e.prototype._setPromise=function(t,e){var n=this;return t.promise=e.save(t.obj,t.status),t.promise.then(function(){n._removeFromOrder(t)}).catch(function(e){t.saving=!1,t.error=!0,i.dhxError(e)}),t.saving=!0,this._saving=!0,this._addToChain(t.promise),t.promise},e.prototype._addToChain=function(t){this._parent.saveData&&this._saving?this._parent.saveData=this._parent.saveData.then(function(){return t}):this._parent.saveData=t},e.prototype._findPrevState=function(t){for(var e=0,n=this._changes.order;e<n.length;e++){var i=n[e];if(i.id===t)return i}return null},e.prototype._removeFromOrder=function(t){this._changes.order=this._changes.order.filter(function(e){return!i.isEqualObj(e,t)})},e}();e.Loader=o}).call(this,n(13))},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,o=Function.prototype.apply;function r(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new r(o.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new r(o.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(50),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(14))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,o=1,r={},s=!1,a=t.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(t);l=l&&l.setTimeout?l:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){u(t)})}:function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?function(){var e="setImmediate$"+Math.random()+"$",n=function(n){n.source===t&&"string"==typeof n.data&&0===n.data.indexOf(e)&&u(+n.data.slice(e.length))};t.addEventListener?t.addEventListener("message",n,!1):t.attachEvent("onmessage",n),i=function(n){t.postMessage(e+n,"*")}}():t.MessageChannel?function(){var t=new MessageChannel;t.port1.onmessage=function(t){u(t.data)},i=function(e){t.port2.postMessage(e)}}():a&&"onreadystatechange"in a.createElement("script")?function(){var t=a.documentElement;i=function(e){var n=a.createElement("script");n.onreadystatechange=function(){u(e),n.onreadystatechange=null,t.removeChild(n),n=null},t.appendChild(n)}}():i=function(t){setTimeout(u,0,t)},l.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var s={callback:t,args:e};return r[o]=s,i(o),o++},l.clearImmediate=c}function c(t){delete r[t]}function u(t){if(s)setTimeout(u,0,t);else{var e=r[t];if(e){s=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(n,i)}}(e)}finally{c(t),s=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(14),n(51))},function(t,e){var n,i,o=t.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===r||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:r}catch(t){n=r}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var l,c=[],u=!1,d=-1;function h(){u&&l&&(u=!1,l.length?c=l.concat(c):d=-1,c.length&&f())}function f(){if(!u){var t=a(h);u=!0;for(var e=c.length;e;){for(l=c,c=[];++d<e;)l&&l[d].run();d=-1,e=c.length}l=null,u=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function _(){}o.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];c.push(new p(t,e)),1!==c.length||u||a(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=_,o.addListener=_,o.once=_,o.off=_,o.removeListener=_,o.removeAllListeners=_,o.emit=_,o.prependListener=_,o.prependOnceListener=_,o.listeners=function(t){return[]},o.binding=function(t){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(t){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),o=function(){function t(){}return t.prototype.sort=function(t,e){var n=this;e.rule&&"function"==typeof e.rule?this._sort(t,e):e.by&&(e.rule=function(t,o){var r=n._checkVal(e.as,t[e.by]),s=n._checkVal(e.as,o[e.by]);return i.naturalCompare(r.toString(),s.toString())},this._sort(t,e))},t.prototype._checkVal=function(t,e){return t?t.call(this,e):e},t.prototype._sort=function(t,e){var n=this,i={asc:1,desc:-1};return t.sort(function(t,o){return e.rule.call(n,t,o)*(i[e.dir]||i.asc)})},t}();e.Sort=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=n(1),r=n(12),s=n(54),a=n(26),l=n(9);!function(t){t[t.top=0]="top",t[t.bot=1]="bot",t[t.in=2]="in"}(i||(i={}));var c=function(){function t(){var t=this;this._transferData={},this._canMove=!0,this._ghostTopPadding=-17,this._onMouseMove=function(e){if(t._transferData.id){var n=e.pageX,i=e.pageY;if(!t._transferData.ghost){if(Math.abs(t._transferData.x-n)<3&&Math.abs(t._transferData.y-i)<3)return;var o=t._onDragStart(t._transferData.id,t._transferData.targetId);if(!o)return void t._endDrop();t._transferData.ghost=o,document.body.appendChild(t._transferData.ghost)}t._moveGhost(n,i),t._onDrag(e)}},this._onMouseUp=function(){t._transferData.x&&(t._transferData.ghost?(t._removeGhost(),t._onDrop()):t._endDrop(),document.removeEventListener("mousemove",t._onMouseMove),document.removeEventListener("mouseup",t._onMouseUp))}}return t.prototype.setItem=function(t,e,n){s.collectionStore.setItem(t,e,n)},t.prototype.onMouseDown=function(t){if(1===t.which){document.addEventListener("mousemove",this._onMouseMove),document.addEventListener("mouseup",this._onMouseUp);var e=o.locate(t,"dhx_id"),n=o.locate(t,"dhx_collection_id");e&&n&&(this._transferData.x=t.x,this._transferData.y=t.y,this._transferData.targetId=n,this._transferData.id=e)}},t.prototype._moveGhost=function(t,e){if(this._transferData.ghost){var n=this._transferData.ghost.offsetWidth/2;this._transferData.ghost.style.left=t-n+"px",this._transferData.ghost.style.top=e+this._ghostTopPadding+"px"}},t.prototype._removeGhost=function(){document.body.removeChild(this._transferData.ghost)},t.prototype._onDrop=function(){if(this._canMove){var t=s.collectionStore.getItem(this._lastCollectionId),e=s.collectionStore.getItemConfig(this._lastCollectionId);if(t&&e.mode!==l.DragMode.source){var n={id:this._lastId,target:t},i={id:this._transferData.id,target:this._transferData.target};i.target.events.fire(r.DragEvents.beforeDrop,[i,n])&&(this._move(i,n),n.target.events.fire(r.DragEvents.dropComplete,[n.id,this._transferData.dropPosition])),this._endDrop()}else this._endDrop()}else this._endDrop()},t.prototype._onDragStart=function(t,e){var n=s.collectionStore.getItem(e),i=s.collectionStore.getItemConfig(e);if(i.dragMode===l.DragMode.target)return null;var o=n.data.getItem(t);n.events.fire(r.DragEvents.dragStart);var a=function(t){var e=document.createElement("div");return e.textContent=t.value||t.text,e.className="dhx_drag-ghost",e.style.pointerEvents="none",e}(o);return n.events.fire(r.DragEvents.beforeDrag,[o,a])&&t?(this._toggleTextSelection(!0),this._transferData.target=n,this._transferData.dragConfig=i,a):null},t.prototype._onDrag=function(t){var e=t.x,n=t.y,c=document.elementFromPoint(e,n),u=o.locate(c,"dhx_id");if(u){var d,h,f=o.locate(c,"dhx_collection_id");if(this._transferData.dragConfig.behaviour===l.DragBehaviour.complex){var p=function(t){var e=t.clientY,n=o.locateNode(t);if(!n)return null;var i=n.childNodes[0].getBoundingClientRect();return(e-i.top)/i.height}(t);this._transferData.dropPosition=p<=.25?i.top:p>=.75?i.bot:i.in}else if(this._lastId===u&&this._lastCollectionId===f)return;if(u&&f||!this._canMove)if(d=[h={id:this._transferData.id,target:this._transferData.target},{id:u,target:s.collectionStore.getItem(f)}],h.target.events.fire(r.DragEvents.dragOut,d),f!==this._transferData.targetId||!(h.target.data instanceof a.TreeCollection)||h.target.data instanceof a.TreeCollection&&h.target.data.canCopy(h.id,u))this._cancelCanDrop(),this._lastId=u,this._lastCollectionId=f,d.push(this._transferData.dropPosition),h.target.events.fire(r.DragEvents.dragIn,d)&&this._canDrop();else this._cancelCanDrop();else this._cancelCanDrop()}else this._cancelCanDrop()},t.prototype._move=function(t,e){var n=t.target.data,o=e.target.data,r=0,s=e.id;switch(this._transferData.dragConfig.behaviour){case l.DragBehaviour.child:break;case l.DragBehaviour.sibling:s=o.getParent(s),r=o.getIndex(e.id)+1;break;case l.DragBehaviour.complex:var a=this._transferData.dropPosition;a===i.top?(s=o.getParent(s),r=o.getIndex(e.id)):a===i.bot&&(s=o.getParent(s),r=o.getIndex(e.id)+1)}this._transferData.dragConfig.copy?n.copy(t.id,r,o,s):n.move(t.id,r,o,s)},t.prototype._endDrop=function(){this._toggleTextSelection(!1),this._transferData.target&&this._transferData.target.events.fire(r.DragEvents.dragEnd),this._cancelCanDrop(),this._canMove=!0,this._transferData={},this._lastId=null,this._lastCollectionId=null},t.prototype._cancelCanDrop=function(){this._canMove=!1;var t=s.collectionStore.getItem(this._lastCollectionId);t&&this._lastId&&t.events.fire(r.DragEvents.cancelDrop,[this._lastId])},t.prototype._canDrop=function(){this._canMove=!0;var t=s.collectionStore.getItem(this._lastCollectionId);t&&this._lastId&&t.events.fire(r.DragEvents.canDrop,[this._lastId,this._transferData.dropPosition])},t.prototype._toggleTextSelection=function(t){t?document.body.classList.add("dhx_no-select"):document.body.classList.remove("dhx_no-select")},t}();e.dragManager=new c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(){this._store={}}return t.prototype.setItem=function(t,e,n){this._store[t]={target:e,config:n}},t.prototype.getItem=function(t){return this._store[t]?this._store[t].target:null},t.prototype.getItemConfig=function(t){return this._store[t]?this._store[t].config:null},t}();e.collectionStore=new i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(7),o=n(12),r=n(9),s=function(){function t(t,e,n){var o=this;this.events=n||new i.EventSystem,this._data=e,this._data.events.on(r.DataEvents.removeAll,function(){o._selected=null}),this._data.events.on(r.DataEvents.change,function(){if(o._selected){var t=o._data.getNearId(o._selected);t!==o._selected&&(o._selected=null,t&&o.add(t))}})}return t.prototype.getId=function(){return this._selected},t.prototype.getItem=function(){return this._selected?this._data.getItem(this._selected):null},t.prototype.remove=function(t){return!(t=t||this._selected)||!!this.events.fire(o.SelectionEvents.beforeUnSelect,[t])&&(this._data.update(t,{$selected:!1}),this._selected=null,this.events.fire(o.SelectionEvents.afterUnSelect,[t]),!0)},t.prototype.add=function(t){this._selected!==t&&(this.remove(),this.events.fire(o.SelectionEvents.beforeSelect,[t])&&(this._selected=t,this._data.update(t,{$selected:!0}),this.events.fire(o.SelectionEvents.afterSelect,[t])))},t}();e.Selection=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.button=function(t){return i.el("li.dhx_toolbar__item",[i.el("button",{class:"dhx_toolbar-button dhx_button dhx_toolbar__button "+o.getIconButtonClass(t)+o.getCss(t),dhx_id:t.id,disabled:t.$disabled},[o.counter(t),t.icon?o.icon(t.icon,"button"):null,i.el("span.dhx_button__text",t.value),t.$openIcon?i.el("span.dhx_button__icon.dhx_button__icon--menu-down.dxi.dxi-menu-down"):null])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.customHTMLButton=function(t){return i.el("li.dhx_toolbar__item",[i.el("button",{class:"dhx_button dhx_toolbar__button--custom_html"+o.getCss(t),dhx_id:t.id},[o.counter(t),i.el(".dhx_toolbar-button__html-wrapper",{".innerHTML":t.html}),t.value?i.el("span.dhx_button__text",t.value):null])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.dhxButton=function(t){return i.el("li.dhx_toolbar__item",[i.el("button",{class:"dhx_button dhx_toolbar__button"+o.getCss(t)+(!t.value&&t.icon?" dhx_button--icon":""),dhx_id:t.id,disabled:t.$disabled},[o.counter(t),t.icon?o.icon(t.icon,"button"):null,t.value?i.el("span.dhx_button__text",t.value):null,t.$openIcon?i.el("span.dhx_button__icon.dhx_button__icon--menu-down.dxi.dxi-menu-down"):null])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.imageButton=function(t){return i.el("li.dhx_toolbar__item",[i.el("button",{class:"dhx_button dhx_toolbar__button dhx_toolbar-img-button"+o.getCss(t),dhx_id:t.id},[o.counter(t),i.el("div.dhx_toolbar-img-button__text",t.value),i.el("img.dhx_toolbar-img-button__image",{src:t.src})])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(16),r=n(6);e.input=function(t,e){return i.el("li.dhx_toolbar__item",{},[i.el(".dhx_form-group.dhx_form-group--no-message-holder.dhx_form-group--label_sr",{class:r.getCss(t)+t.icon},[i.el("input.dhx_input",{placeholder:t.placeholder,value:t.value,dhx_id:t.id,style:{width:t.width?t.width:null},_hooks:{didInsert:function(n){e&&e.fire(o.NavigationBarEvents.inputCreated,[t.id,n.el])}},_key:t.id}),i.el("label.dhx_label",{for:t.id},t.label),i.el(".input-animation")])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.menuItem=function(t){return i.el("li.dhx_menu__item",[i.el("button",{class:"dhx_menu__button dhx_button dhx_button--type_link dhx_button--color_secondary dhx_button--width_full"+o.getCss(t),dhx_id:t.id},[t.icon?o.icon(t.icon,"menu"):null,t.value?i.el("span.dhx_menu__text",t.value):null,t.$openIcon?i.el("span.dhx_menu__icon.dhx_menu__icon--submenu.dxi.dxi-menu-right"):null,t.hotkey?i.el("span.span.dhx_menu__hotkey",t.hotkey):null])])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0);e.separator=function(t){var e=t.$menuSeparator?"dhx_menu__item dhx_menu__separator":"dhx_toolbar__item dhx_toolbar__separator";return i.el("li",{class:e,"aria-hidden":"true"})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0);e.spacer=function(t){return i.el("li",{class:"dhx_toolbar__item dhx_toolbar__spacer","aria-hidden":"true"})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(0),o=n(6);e.text=function(t){return i.el("li.dhx_toolbar__item",[i.el("span",{class:"dhx_toolbar__text"+o.getCss(t)},t.value)])}},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.mount(e,r.create({render:function(){return i._draw()}})),i}return i(e,t),e.prototype._draw=function(){return r.el("div",o({dhx_widget_id:this._uid,class:"main-menu"},this._handlers),this._drawMenuItems(this.data.getRoot()))},e}(n(17).MenuBase);e.Menu=s},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=n(67);function o(t){var e=document.activeElement;e.classList.contains("dhx_alert__confirm-reject")||e.classList.contains("dhx_alert__confirm-aply")||t.preventDefault()}function r(t){var e=document.createElement("div");return e.className="dhx_alert__overlay "+(t||""),document.body.appendChild(e),document.addEventListener("keydown",o),function(){document.body.removeChild(e),document.removeEventListener("keydown",o)}}e.blockScreen=r,e.alert=function(e){var n=e.buttons&&e.buttons[0]?e.buttons[0]:i.default.apply,o=r(e.blockerCss);return new t(function(t){var i=document.createElement("div");i.className="dhx_alert "+(e.css||""),i.innerHTML='\n\t\t\t<div class="dhx_alert__header">\n\t\t\t\t'+e.header+'\n\t\t\t</div>\n\t\t\t<div class="dhx_alert__content">'+e.text+'</div>\n\t\t\t<div class="dhx_alert__footer '+(e.buttonsAlignment?"dhx_alert__footer--"+e.buttonsAlignment:"")+'">\n\t\t\t\t<button class="dhx_alert__apply-button dhx_button dhx_button--type_flat dhx_button--color_primary dhx_button--size_medium">'+n+"</button>\n\t\t\t</div>",document.body.appendChild(i),i.querySelector(".dhx_alert__apply-button").focus(),i.querySelector("button").addEventListener("click",function(){o(),document.body.removeChild(i),t(!0)})})},e.confirm=function(e){var n=e.buttons&&e.buttons[1]?e.buttons[1]:i.default.apply,o=e.buttons&&e.buttons[0]?e.buttons[0]:i.default.reject,s=r(e.blockerCss);return new t(function(t){var i=document.createElement("div");i.className="dhx_alert dhx_alert--confirm"+(e.css||""),i.innerHTML='\n\t\t\t<div class="dhx_alert__header">\n\t\t\t\t'+e.header+'\n\t\t\t</div>\n\t\t\t<div class="dhx_alert__content">'+e.text+'</div>\n\t\t\t<div class="dhx_alert__footer '+(e.buttonsAlignment?"dhx_alert__footer--"+e.buttonsAlignment:"")+'">\n\t\t\t\t<button class="dhx_alert__confirm-reject dhx_button dhx_button--type_link dhx_button--color_primary dhx_button--size_medium">'+o+'</button>\n\t\t\t\t<button class="dhx_alert__confirm-aply dhx_button dhx_button--type_flat dhx_button--color_primary dhx_button--size_medium">'+n+"</button>\n\t\t\t</div>",document.body.appendChild(i),i.querySelector(".dhx_alert__confirm-reject").focus();var r=function(e){"BUTTON"===e.target.tagName&&function(e){s(),i.removeEventListener("click",r),document.body.removeChild(i),t(e)}(e.target.classList.contains("dhx_alert__confirm-aply"))};i.addEventListener("click",r)})}}).call(this,n(13))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={apply:"apply",reject:"reject"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=n(1),r=n(29),s=750,a=200;function l(t,e,n,o){var s,a,l;switch(e){case r.Position.center:return(a=t.left+window.pageXOffset+(t.width-n)/2)+8<window.pageXOffset&&(a=t.left+window.pageXOffset),{left:a,top:l=t.top+window.pageYOffset+(t.height-o)/2,pos:s=i.center};case r.Position.right:return s=i.right,(a=t.right+window.pageXOffset)+n+8>window.innerWidth+window.pageXOffset&&(a=window.pageXOffset+t.left-n,s=i.left),{left:a,top:l=window.pageYOffset+t.top+(t.height-o)/2,pos:s};case r.Position.bottom:return(a=window.pageXOffset+t.left+(t.width-n)/2)+n>window.innerWidth+window.pageXOffset?a=window.innerWidth+window.pageXOffset-n:a<0&&(a=0),s=i.bottom,(l=window.pageYOffset+t.bottom)+o+8>window.innerHeight+window.pageYOffset&&(l=window.pageYOffset+t.top-o,s=i.top),{left:a,top:l,pos:s}}}!function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.center="center"}(i=e.RealPosition||(e.RealPosition={})),e.findPosition=l;var c=document.createElement("div"),u=document.createElement("span");u.className="dhx_tooltip__text",c.appendChild(u),c.style.position="absolute";var d,h=null,f=!1,p=null,_=null;function v(t,e,n,o,r){void 0===r&&(r=!1);var s=t.getBoundingClientRect();u.textContent=e,document.body.appendChild(c),c.className="dhx_tooltip"+(r?" dhx_tooltip--forced":"");var a=c.getBoundingClientRect(),d=l(s,n,a.width,a.height),h=d.left,p=d.top,_=d.pos;switch(_){case i.bottom:case i.top:case i.left:case i.right:case i.center:c.style.left=h+"px",c.style.top=p+"px"}c.className+=" dhx_tooltip--"+_+" "+(o||""),f=!0,r||setTimeout(function(){c.className+=" dhx_tooltip--animate"})}function g(t,e,n,i,o){void 0===o&&(o=!1),o||(_=setTimeout(function(){v(t,e,n,i)},s));var r=function(){f&&h&&(p=setTimeout(function(){document.body.removeChild(c),f=!1,p=null},a)),clearTimeout(_),t.removeEventListener("mouseleave",r),t.removeEventListener("blur",r),document.removeEventListener("mousedown",r),h=null,d=null};o&&v(t,e,n,i,o),t.addEventListener("mouseleave",r),t.addEventListener("blur",r),document.addEventListener("mousedown",r),d=r}function x(t,e){var n=o.toNode(e.node);n!==h&&(d&&(d(),d=null),h=n,p?(clearTimeout(p),p=null,g(n,t,e.position,e.css,!0)):g(n,t,e.position||r.Position.bottom,e.css,e.force))}function y(t){var e=o.locateNode(t,"dhx_tooltip_text");e&&x(e.getAttribute("dhx_tooltip_text"),{position:e.getAttribute("dhx_tooltip_position")||r.Position.bottom,node:e})}e.tooltip=x,e.enableTooltip=function(){document.addEventListener("mousemove",y)},e.disableTooltip=function(){document.removeEventListener("mousemove",y)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);e.listenCompositionEvents=function(t,e){var n=function(n){e()&&t.fire(i.RichTextEvents.compositionStart)},o=function(n){e()&&t.fire(i.RichTextEvents.compositionEnd,[n.data])},r=function(n){e()&&t.fire(i.RichTextEvents.compositionUpdate,[n.data])};return document.addEventListener("compositionstart",n),document.addEventListener("compositionend",o),document.addEventListener("compositionupdate",r),function(){document.removeEventListener("compositionstart",n),document.removeEventListener("compositionend",o),document.removeEventListener("compositionupdate",r)}}},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),s=n(1),a=n(8),l=n(28),c=n(18),u=n(31),d=n(11),h=n(2),f=n(4),p=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i._events=n.events,i._editor=n.editor,i._getParentView=n.getRootView,i._popup=new c.Popup,i._initEvents(),i._handlers={onclick:{".dhx_richtext-linkeditor--handler_apply":function(){return i._apply()},".dhx_richtext-linkeditor--handler_unlink, .dhx_richtext-linkeditor--handler_unlink *":function(){i._events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.link,modifierValue:void 0},!0]),i._popup.hide()},".dhx_richtext-linkeditor--handler_edit, .dhx_richtext-linkeditor--handler_edit *":function(){i._editMode=!0,i.paint(),setTimeout(function(){return i.focus()},10)}},onmouseover:function(t){var e=s.locateNode(t,"dhx_id");e&&l.tooltip(d.default[e.getAttribute("dhx_id")],{node:e,position:l.Position.bottom})},oninput:function(t){var e=t.target.value;t.target.classList.contains("link-input")?!i._link&&e?(i._link=e,i.paint()):e?i._link=e:(i._link=e,i.paint()):i._text=e},onkeydown:function(t){t.which===u.Key.enter&&i._link&&i._apply(),t.which===u.Key.esc&&i._popup.hide()}},i.mount(null,r.create({render:function(){return i._draw()}})),i._popup.attach(i),i}return i(e,t),e.prototype.isVisible=function(){return this._popup.isVisible()},e.prototype.show=function(t,e){var n=this;this._popup.show(t,{mode:e,centering:!0}),setTimeout(function(){return n.focus()},10)},e.prototype.hide=function(){this._popup.hide()},e.prototype.get=function(){return{link:this._link,text:this._text}},e.prototype.getCurrentLinkRef=function(){return this._currentLinkRef},e.prototype.set=function(t,e){this._editMode=!t,this._link=t||"",this._text=e||"",this._initText=this._text,this.paint()},e.prototype.focus=function(){var t=this.getRootView().refs;t&&t.linkInput&&t.linkInput.el.focus()},e.prototype._destroyCurrentLinkRef=function(){this._currentLinkRef&&(this._getParentView().refs[this._currentLinkRef].patch({class:""}),this._currentLinkRef=null)},e.prototype._initEvents=function(){var t=this;this._popup.events.on(c.PopupEvents.beforeHide,function(e,n){return!e||!t._getParentView().node.el.contains(n.target)}),this._popup.events.on(c.PopupEvents.afterHide,function(){return t._destroyCurrentLinkRef()}),this._popup.events.on(c.PopupEvents.afterShow,function(){var e=t._editor.selection.get().left,n=f.getTextHash(e.blockIndex,e.textIndex),i=t._getParentView().refs[n];i.parent.patch({class:"dhx--link_edited"}),t._currentLinkRef=i.parent.ref}),this._events.on(h.RichTextEvents.selectionChange,function(e){var n=e.range,i=e.left,o=t._editor.blocks[i.blockIndex].textNodes[i.textIndex];t.isVisible()&&t.hide(),o.style.link&&!n&&t._show()}),this._events.on(h.RichTextEvents.showLinkEditor,function(){return t._show()}),this._events.on(h.RichTextEvents.change,function(){if(t.isVisible()){var e=t._editor.selection.get(),n=e.left,i=e.range;if(!t._editor.blocks[n.blockIndex].textNodes[n.textIndex].style.link||i)t.hide();else{var o=t._editor.getLinkInfo(),r=o.link,s=o.text;t.set(r,s)}}})},e.prototype._draw=function(){return r.el(".dhx_richtext-linkeditor "+(this._drawViewMode()?".dhx_richtext-linkeditor--mode_view":""),o({},this._handlers),this._editMode?this._drawEditMode():this._drawViewMode())},e.prototype._drawEditMode=function(){return[r.el(".dhx_richtext-linkeditor__inputs",[r.el(".dhx_form-group.dhx_form-group--type_inline.dhx_richtext-linkeditor__input",[r.el(".dhx_label","Text"),r.el("input.dhx_input.text-input",{value:this._text,_key:"textInput",_ref:"textInput"})]),r.el(".dhx_form-group.dhx_form-group--type_inline.dhx_richtext-linkeditor__input",[r.el(".dhx_label","Link"),r.el("input.dhx_input.link-input",{value:this._link,_key:"linkInput",_ref:"linkInput"})])]),r.el(".dhx_richtext-linkeditor__controls",[r.el("button.dhx_richtext-linkeditor--handler_apply.dhx_button.dhx_button--size_medium.dhx_button--type_flat.dhx_button--color_primary",{disabled:!this._link},d.default.apply)])]},e.prototype._drawViewMode=function(){return[r.el("a.dhx_richtext-linkeditor__link",{href:this._link,target:"_blank"},this._link),r.el(".dhx_richtext-linkeditor__controls",[r.el("button.dhx_richtext-linkeditor--handler_edit.dhx_button.dhx_button--icon.dhx_button--size_medium.dhx_button--type_link.dhx_button--color_secondary",{dhx_id:"edit"},[r.el("span.dhx_button__icon.dxi.dxi-pencil")]),r.el("button.dhx_richtext-linkeditor--handler_unlink.dhx_button.dhx_button--icon.dhx_button--size_medium.dhx_button--type_link.dhx_button--color_secondary",{dhx_id:"removeLink"},[r.el("span.dhx_button__icon.dxi.dxi-link-variant-off")])])]},e.prototype._modifyLink=function(t){return"#"===t[0]?t:"http"===t.slice(0,4).toLowerCase()?t:"http://"+t},e.prototype._apply=function(){var t=this._modifyLink(this._link),e=this._text,n=!e.trim();(this._initText!==this._text||n)&&this._editor.updateLinkText(n?t:e),t&&this._events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.link,modifierValue:t},!0]),this.hide()},e.prototype._show=function(){var t=this._editor.getLinkInfo(),e=t.link,n=t.text,i=this._editor.selection.get().left,o=f.getTextHash(i.blockIndex,i.textIndex),r=this._getParentView().refs[o];if(e){if(r.parent.ref===this._currentLinkRef)return;this.set(e,n),this.show(r.parent.el,l.Position.bottom)}else this.set(null,this._editor.selection.getSelectedText()),this.show(r.el,l.Position.bottom)},e}(a.View);e.LinkEditor=p},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),s=n(0),a=n(7),l=n(1),c=n(8),u=n(30),d=function(t){function e(e){void 0===e&&(e={});var n=t.call(this,null,r.extend({},e))||this,i=n._popup=document.createElement("div");return i.className="dhx_popup dhx_widget",i.style.position="absolute",n.mount(i,s.create({render:function(){return n.toVDOM()}})),n.events=e.events||new a.EventSystem,n._isActive=!1,n}return i(e,t),e.prototype.show=function(t,e,n){var i=this;void 0===e&&(e={}),!1!==this.events.fire(u.PopupEvents.beforeShow)&&(this._isActive?this._setPopupSize(t,e):(n&&this.attach(n),setTimeout(function(){document.body.appendChild(i._popup),i._setPopupSize(t,e),i._isActive=!0,i.events.fire(u.PopupEvents.afterShow),i._outerClickDestructor=i._detectOuterClick(t)})))},e.prototype.hide=function(){this._hide(!1,null)},e.prototype.isVisible=function(){return this._isActive},e.prototype.attach=function(t,e){return this._html=null,"object"==typeof t?this._ui=t:"string"==typeof t?this._ui=new window.dhx[t](null,e):"function"==typeof t&&(t.prototype instanceof c.View?this._ui=new t(null,e):this._ui={getRootView:function(){return t(e)}}),this.paint(),this._ui},e.prototype.attachHTML=function(t){this._html=t,this.paint()},e.prototype.getWidget=function(){return this._ui},e.prototype.getContainer=function(){return this.getRootView().refs.content.el},e.prototype.toVDOM=function(){var t;return this._html?t=s.el(".dhx_popup__inner-html-content",{".innerHTML":this._html}):(t=this._ui?this._ui.getRootView():null)&&t.render&&(t=s.inject(t)),s.el("div",{class:"dhx_popup-content "+(this.config.css||""),_key:this._uid,_ref:"content"},[t])},e.prototype._setPopupSize=function(t,e){var n=this,i=this._popup.getBoundingClientRect(),r=i.width,s=i.height;0!==r&&0!==s||(this._timeout&&clearTimeout(this._timeout),this._timeout=setTimeout(function(){n._isActive&&(n._setPopupSize(t,e),n._timeout=null)}));var a=l.fitPosition(t,o({},e,{width:r,height:s})),c=a.left,u=a.top;this._popup.style.left=c,this._popup.style.top=u},e.prototype._detectOuterClick=function(t){var e=this,n=function(i){for(var o=i.target;o;){if(o===t||o===e._popup)return;o=o.parentNode}e._hide(!0,i)&&document.removeEventListener("click",n)};return document.addEventListener("click",n),function(){return document.removeEventListener("click",n)}},e.prototype._hide=function(t,e){if(this._isActive)return!1!==this.events.fire(u.PopupEvents.beforeHide,[t,e])&&(document.body.removeChild(this._popup),this._isActive=!1,this._outerClickDestructor&&(this._outerClickDestructor(),this._outerClickDestructor=null),this.events.fire(u.PopupEvents.afterHide),!0)},e}(c.View);e.Popup=d},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.createScrollHelper=function(t){var e=t.scrollHeight,n=t.scrollTop;return{update:function(){var n=t.scrollHeight;n>e&&(t.scrollTop+=n-e),e=n},saveScrollTop:function(){n=t.scrollTop},restoreScrollTop:function(){t.scrollTop=n}}}},function(t,e,n){"use strict";var i,o=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var r=n(74),s=n(1),a=n(18),l=n(21),c=n(5),u=n(4),d=n(11),h=n(2),f=n(32),p=n(19),_=((i={})[h.Modifier.fontFamily]="Roboto",i[h.Modifier.fontSize]="14px",i[h.Modifier.color]="#4D4D4D",i[h.Modifier.background]="#FFFFFF",i[h.Modifier.bold]=!1,i[h.Modifier.italic]=!1,i[h.Modifier.strike]=!1,i[h.Modifier.underline]=!1,i[h.Modifier.style]="p",i[h.Modifier.blockquote]=!1,i[h.Modifier.align]="left",i),v=function(){function t(t,e){var n=this;this._parent=t,this._editor=e,this.colorpicker=new r.Colorpicker,this._statsPopup=new a.Popup,this._parent.events.on(h.RichTextEvents.change,function(){n._statsPopup.isVisible()&&n._statsPopup.hide()});var i=t.config.toolbarBlocks;this.toolbar=new l.Toolbar(null,{css:"dhx_toolbar--bordered.dhx_toolbar--bg_gray"}),this.toolbar.data.parse(c.getToolbarData(i,_)),this._defaultToolbarState={};for(var o=0,s=i;o<s.length;o++){switch(s[o]){case h.RTEToolbarBlock.align:this._defaultToolbarState[h.Modifier.align]=_[h.Modifier.align];break;case h.RTEToolbarBlock.color:this._defaultToolbarState[h.Modifier.color]=_[h.Modifier.color],this._defaultToolbarState[h.Modifier.background]=_[h.Modifier.background];break;case h.RTEToolbarBlock.decoration:this._defaultToolbarState[h.Modifier.bold]=_[h.Modifier.bold],this._defaultToolbarState[h.Modifier.italic]=_[h.Modifier.italic],this._defaultToolbarState[h.Modifier.underline]=_[h.Modifier.underline],this._defaultToolbarState[h.Modifier.strike]=_[h.Modifier.strike];break;case h.RTEToolbarBlock.style:this._defaultToolbarState[h.Modifier.style]=_[h.Modifier.style],this._defaultToolbarState[h.Modifier.fontFamily]=_[h.Modifier.fontFamily],this._defaultToolbarState[h.Modifier.fontSize]=_[h.Modifier.fontSize],this._defaultToolbarState[h.Modifier.blockquote]=_[h.Modifier.blockquote]}}this._initEvents()}return t.prototype._initEvents=function(){var t=this;this._parent.events.on(h.RichTextEvents.selectionChange,function(){t._updateState()}),this._parent.events.on(h.RichTextEvents.change,function(e,n,i){-1!==t._parent.config.toolbarBlocks.indexOf(h.RTEToolbarBlock.undo)&&t._updateUndoRedoState(n,i),e!==h.Action.update&&t._updateState()}),this.colorpicker.events.on(r.ColorpickerEvents.colorChange,function(e){t._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:t._colorpickerTarget,modifierValue:e},!0]),t.toolbar.data.update(t._colorpickerTarget,{html:t._colorpickerTarget===h.Modifier.color?u.textColor(e):u.textSelectColor(e)})}),this.toolbar.events.on(l.NavigationBarEvents.click,function(e,n){return t._toolbarAction(e,n)})},t.prototype._toolbarAction=function(t,e){var n=this.toolbar.data.getItem(t),i=!n.active;switch(t){case"bold":this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.bold,modifierValue:i},!0]),this.toolbar.data.update("bold",{active:i});break;case"underline":this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.underline,modifierValue:i},!0]),this.toolbar.data.update("underline",{active:i});break;case"italic":this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.italic,modifierValue:i},!0]),this.toolbar.data.update("italic",{active:i});break;case"strike":this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.strike,modifierValue:i},!0]),this.toolbar.data.update("strike",{active:i});break;case"color":case"background":this._colorpickerTarget=t===h.Modifier.background?h.Modifier.background:h.Modifier.color;var o=this._getColorState(this._colorpickerTarget);this.colorpicker.setValue(o),this.colorpicker.paint(),this.colorpicker.show(s.locateNode(e.target,"dhx_id"),s.Position.bottom);break;case"link":e.stopPropagation(),this._parent.events.fire(h.RichTextEvents.showLinkEditor);break;case"redo":this._parent.events.fire(h.RichTextEvents.action,[h.Action.redo,null,!0]);break;case"undo":this._parent.events.fire(h.RichTextEvents.action,[h.Action.undo,null,!0]);break;case"clear-style":this._parent.events.fire(h.RichTextEvents.action,[h.Action.clear,null,!0]);break;case"blockquote":this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.blockquote,modifierValue:i},!0]),this.toolbar.data.update("blockquote",{active:i});break;case"fullscreen":n.$fullscreen?this._parent.exitFullScreen():this._parent.fullScreen();break;case"stats":var r=s.locateNode(e),a=this._editor.selection.get().range;this._statsPopup.attach(f.statsRenderer(this._parent.getStats(a),this._parent.config.customStats)),this._statsPopup.show(r,{mode:s.Position.bottom,centering:!0});break;default:var l=u.actionIdToModifierValue(t);switch(!0){case u.startsWith(t,"font-size"):this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.fontSize,modifierValue:l+"px"},!0]),this.toolbar.data.update(h.Modifier.fontSize,{value:l+"px"});break;case u.startsWith(t,"align"):this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.align,modifierValue:l},!0]),this.toolbar.data.update("align-left",{active:"left"===l}),this.toolbar.data.update("align-right",{active:"right"===l}),this.toolbar.data.update("align-center",{active:"center"===l});break;case u.startsWith(t,"style"):this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.style,modifierValue:l},!0]),this.toolbar.data.update(h.Modifier.style,{value:d.default[l]});break;case u.startsWith(t,"font"):this._parent.events.fire(h.RichTextEvents.action,[h.Action.update,{modifier:h.Modifier.fontFamily,modifierValue:u.actionIdToModifierValue(t)},!0]),this.toolbar.data.update(h.Modifier.fontFamily,{value:l})}}},t.prototype._updateState=function(){var t=this._getCommonModifiers();for(var e in t)switch(e){case h.Modifier.align:this.toolbar.data.update("align-left",{active:"left"===t[e]}),this.toolbar.data.update("align-right",{active:"right"===t[e]}),this.toolbar.data.update("align-center",{active:"center"===t[e]});break;case h.Modifier.style:-1!==this._parent.config.toolbarBlocks.indexOf(h.RTEToolbarBlock.style)&&this.toolbar.data.update(e,{value:d.default[t[e]]});break;case h.Modifier.blockquote:this.toolbar.data.update("blockquote",{active:t[e]});break;case h.Modifier.color:this.toolbar.data.update(e,{html:u.textColor(t[e])});break;case h.Modifier.background:this.toolbar.data.update(e,{html:u.textSelectColor(t[e])});break;case h.Modifier.fontFamily:case h.Modifier.fontSize:this.toolbar.data.update(e,{value:t[e]});break;case h.Modifier.italic:case h.Modifier.bold:case h.Modifier.underline:case h.Modifier.strike:this.toolbar.data.update(e,{active:t[e]})}},t.prototype._updateUndoRedoState=function(t,e){t?this.toolbar.enable("undo"):this.toolbar.disable("undo"),e?this.toolbar.enable("redo"):this.toolbar.disable("redo")},t.prototype._getCommonModifiers=function(){var t,e,n=this;return this._editor.eachSelectedNode(function(e,i){if(t){var o=p.getComputedNodeStyle(e,i,n._defaultToolbarState);for(var r in t)t[r]!==o[r]&&delete t[r]}else t=p.getComputedNodeStyle(e,i,n._defaultToolbarState)}),this._editor.eachSelectedBlock(function(t){if(e){var i=p.getComputedBlockStyle(t,n._defaultToolbarState);for(var o in e)e[o]!==i[o]&&delete e[o]}else e=p.getComputedBlockStyle(t,n._defaultToolbarState)}),o({},c.defaultDiffrentStyle,e,t)},t.prototype._getColorState=function(t){var e,n=_[t],i=!0;return this._editor.eachSelectedNode(function(o){var r=o.style[t]||n;e?i=i&&e===r:e=r}),i?e:n},t}();e.RichTextToolbarHelper=v},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}Object.defineProperty(e,"__esModule",{value:!0}),i(n(75)),i(n(33))},function(t,e,n){"use strict";var i=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};return function(e,n){function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),r=n(7),s=n(1),a=n(8),l=n(18),c=n(3),u=n(76),d=n(77),h=n(78),f=n(33),p=function(t){function e(e){var n=t.call(this,null,e)||this;n._handleGripMove=function(t){var e=n.getRootView().refs.picker_palette.el.getBoundingClientRect(),i=t.clientY-e.top,o=t.clientX-e.left;n._calculatePaletteGrip(i,o),n.paint()},n._handleRangeMove=function(t){var e=n.getRootView().refs.hue_range.el.getBoundingClientRect(),i=t.clientX-e.left-3;n._calculateRangeGrip(i),n.paint()},n.config=c.extend({css:"",customColors:!0},n.config),n._popup=new l.Popup({css:" dhx_colorpicker-popup "+n.config.css}),n.events=new r.EventSystem(n),n._pickerState={hsv:{h:0,s:1,v:1},currentView:"palette",customColors:[],customHex:""},n._handlers={click:{".dhx_palette__cell":n._onColorClick.bind(n)},mousedown:function(t){var e=s.locate(t);n._pickerState.customHex="";var i=n.getRootView().refs[e].el.getBoundingClientRect();"picker_palette"===e?n._calculatePaletteGrip(t.clientY-i.top,t.clientX-i.left):n._calculateRangeGrip(t.clientX-i.left);var o="picker_palette"===e?n._handleGripMove:n._handleRangeMove;document.addEventListener("mousemove",o),document.addEventListener("mouseup",function(){document.removeEventListener("mousemove",o)}),n.paint()},buttonsClick:function(t){n._pickerState.currentView="palette",n.paint(),"cancel"!==t&&("apply"===t&&-1===n._pickerState.customColors.indexOf(n._pickerState.background)&&n._pickerState.customColors.push(n._pickerState.background),n._selected=n._pickerState.background,n.events.fire(f.ColorpickerEvents.colorChange,[n._selected]),setTimeout(function(){n._popup.hide()},1))},customColorClick:function(){n._pickerState.currentView="picker",n.paint()},oninput:function(t){n._inputTimeout&&clearTimeout(n._inputTimeout),n._inputTimeout=setTimeout(function(){var e=t.target.value;-1===e.indexOf("#")&&(e="#"+e),n._pickerState.customHex=e,u.isHex(e)&&(n._pickerState.hsv=u.HexToHSV(e),n.paint())},100)},contextmenu:{".dhx_palette__cell":function(t,e){t.preventDefault();var i=n._pickerState.customColors.indexOf(e.data.color);-1!==i&&n._pickerState.customColors.splice(i,1),n.paint()}}},n._popup.events.on(l.PopupEvents.afterHide,function(){n._pickerState.currentView="palette"});var i=o.create({render:function(){return n._getContent()}});return n.mount(n._popup,i),n}return i(e,t),e.prototype.setValue=function(t){this._selected=t||null},e.prototype.getValue=function(){return this._selected},e.prototype.show=function(t,e){void 0===e&&(e="bottom"),this._popup.show(s.toNode(t),{mode:e,centering:!0}),this.paint()},e.prototype.hide=function(){this._popup.hide()},e.prototype._calculatePaletteGrip=function(t,e){var n=this.getRootView().refs.picker_palette.el.getBoundingClientRect(),i=n.height,o=n.width;t=t<0?0:t>i?i:t,e=e<0?0:e>o?o:e;var r=Math.round(e/(o/100)),s=100-Math.round(t/(i/100));this._pickerState.hsv.s=r/100,this._pickerState.hsv.v=s/100},e.prototype._calculateRangeGrip=function(t){var e=this.getRootView().refs.hue_range.el.getBoundingClientRect().width;t=t<0?0:t>e?e:t,this._pickerState.rangeLeft=t,this._pickerState.hsv.h=Math.round(t/e*360)},e.prototype._getCells=function(t,e){var n=this;return void 0===e&&(e=""),t.reduce(function(t,i){var r=n._selected===i?"dhx_palette__cell--selected":"";return t.push(o.el(".dhx_palette__cell",{class:r+" "+e,_data:{color:i},style:"background:"+i})),t},[])},e.prototype._onColorClick=function(t,e){this._selected=e.data.color,this.events.fire(f.ColorpickerEvents.colorChange,[this._selected]),this._popup.hide()},e.prototype._getGrayShades=function(){return o.el(".dhx_palette__row",this._getCells(d.grayShades))},e.prototype._getPalette=function(){var t=this;return d.palette.reduce(function(e,n){return e.push(o.el(".dhx_palette__col",t._getCells(n.colors))),e},[])},e.prototype._getPicker=function(){var t=u.HSVtoRGB(this._pickerState.hsv);this._pickerState.background=u.RGBToHex(t);var e=u.RGBToHex(u.HSVtoRGB({h:this._pickerState.hsv.h,s:1,v:1})),n=this.getRootView(),i=n.refs?n.refs.picker_palette.el.getBoundingClientRect():{height:200,width:218,x:0,y:0},r=i.height-2,s=i.width-2,a=r-this._pickerState.hsv.v*r-4,l=this._pickerState.hsv.s*s-4,c=i.width-6,d=c-(360-this._pickerState.hsv.h)/360*c,f=this._pickerState.customHex?this._pickerState.customHex.replace("#",""):this._pickerState.background.replace("#","");return o.el(".dhx_colorpicker-picker",{},[o.el(".dhx_colorpicker-picker__palette",{style:{height:132,background:e},onmousedown:this._handlers.mousedown,dhx_id:"picker_palette",_ref:"picker_palette"},[o.el(".dhx_palette_grip",{style:{top:a,left:l}})]),o.el(".dhx_colorpicker-hue-range",{style:{height:16},onmousedown:this._handlers.mousedown,dhx_id:"hue_range",_key:"hue_range",_ref:"hue_range"},[o.el(".dhx_colorpicker-hue-range__grip",{style:{left:d}})]),o.el(".dhx_colorpicker-value",[o.el(".dhx_colorpicker-value__color",{style:{background:this._pickerState.background}}),o.el(".dhx_colorpicker-value__input-wrapper",[o.el("input",{class:"dhx_colorpicker-value__input",value:f,oninput:this._handlers.oninput,maxlength:"7",_key:"hex_input"})])]),o.el(".dhx_colorpicker-picker__buttons",[o.el("button",{class:"dhx_button dhx_button--size_medium dhx_button--type_link dhx_button--color_primary",onclick:[this._handlers.buttonsClick,"cancel"]},h.default.cancel),o.el("button",{class:"dhx_button dhx_button--size_medium dhx_button--type_flat dhx_button--color_primary",onclick:[this._handlers.buttonsClick,"apply"]},h.default.select)])])},e.prototype._getContent=function(){var t="palette"===this._pickerState.currentView?[this._getGrayShades()].concat(this._getPalette(),[this.config.customColors&&o.el(".dhx_colorpicker-custom-colors",[o.el(".dhx_colorpicker-custom-colors__header",[h.default.customColors,o.el("span.dhx_colorpicker-custom-colors__hint"," ("+h.default.rightClickToDelete+")")]),o.el(".dhx_palette--custom.dhx_palette__row",this._getCells(this._pickerState.customColors,"dhx_custom-color__cell").concat([o.el(".dhx_colorpicker-custom-colors__picker",{class:"dxi dxi-plus",onclick:this._handlers.customColorClick})]))])]):[this._getPicker()];return o.el(".dhx_colorpicker",[o.el(".dhx_palette",{onclick:this._handlers.click,oncontextmenu:this._handlers.contextmenu},t)])},e}(a.View);e.Colorpicker=p},function(t,e,n){"use strict";function i(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,n,i){return e+e+n+n+i+i});var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null}function o(t){var e,n,i=t.r/255,o=t.g/255,r=t.b/255,s=Math.max(i,o,r),a=s-Math.min(i,o,r),l=function(t){return(s-t)/6/a+.5};if(0===a)e=n=0;else{n=a/s;var c=l(i),u=l(o),d=l(r);i===s?e=d-u:o===s?e=1/3+c-d:r===s&&(e=2/3+u-c),e<0?e+=1:e>1&&(e-=1)}return{h:Math.floor(360*e),s:n,v:s}}Object.defineProperty(e,"__esModule",{value:!0}),e.HSVtoRGB=function(t){var e={r:0,g:0,b:0},n=t.h/60,i=t.s,o=t.v,r=Math.floor(n)%6,s=n-Math.floor(n),a=255*o*(1-i),l=255*o*(1-i*s),c=255*o*(1-i*(1-s));switch(o*=255,r){case 0:e.r=o,e.g=c,e.b=a;break;case 1:e.r=l,e.g=o,e.b=a;break;case 2:e.r=a,e.g=o,e.b=c;break;case 3:e.r=a,e.g=l,e.b=o;break;case 4:e.r=c,e.g=a,e.b=o;break;case 5:e.r=o,e.g=a,e.b=l}for(var u in e)e[u]=Math.round(e[u]);return e},e.RGBToHex=function(t){return Object.keys(t).reduce(function(e,n){var i=t[n].toString(16).toUpperCase();return e+(i=1===i.length?"0"+i:i)},"#")},e.HexToRGB=i,e.RGBToHSV=o,e.HexToHSV=function(t){return o(i(t))},e.isHex=function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.grayShades=["#000000","#4C4C4C","#666666","#808080","#999999","#B3B3B3","#CCCCCC","#E6E6E6","#F2F2F2","#FFFFFF"],e.palette=[{colors:["#D4DAE4","#B0B8CD","#949DB1","#727A8C","#5E6677","#3F4757","#1D2534"]},{colors:["#FFCDD2","#FE9998","#F35C4E","#E94633","#D73C2D","#CA3626","#BB2B1A"]},{colors:["#F9E6AD","#F4D679","#EDB90F","#EAA100","#EA8F00","#EA7E00","#EA5D00"]},{colors:["#BCE4CE","#90D2AF","#33B579","#36955F","#247346","#1D5B38","#17492D"]},{colors:["#BDF0E9","#92E7DC","#02D7C5","#11B3A5","#018B80","#026B60","#024F43"]},{colors:["#B3E5FC","#81D4FA","#29B6F6","#039BE5","#0288D1","#0277BD","#01579B"]},{colors:["#AEC1FF","#88A3F9","#5874CD","#2349AE","#163FA2","#083596","#002381"]},{colors:["#C5C0DA","#9F97C1","#7E6BAD","#584A8F","#4F4083","#473776","#3A265F"]},{colors:["#D6BDCC","#C492AC","#A9537C","#963A64","#81355A","#6E3051","#4C2640"]},{colors:["#D2C5C1","#B4A09A","#826358","#624339","#5D4037","#4E342E","#3E2723"]}]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={cancel:"Cancel",select:"Select",rightClickToDelete:"Right click to delete",customColors:"Custom colors"}},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=n(5),r=n(80),s=n(81),a=n(4),l=n(82),c=n(35),u=n(84),d=n(2),h=n(86),f=n(34),p=n(20),_=n(19),v=function(){function t(t){var e=t.events,n=t.uid,i=t.getRootView,o=t.repaint,r=this;this.getTextElement=function(t,e){var n=a.getTextHash(t,e),i=r._getRootView();return i.refs&&i.refs[n]&&i.refs[n].el&&i.refs[n].el.childNodes[0]},this._events=e,this._repaint=o,this._getRootView=i,this.selection=new h.SelectionHelper(this,n,e),this.clear(),this.manager=new u.Manager(this),this._events.on(d.RichTextEvents.change,function(t){t!==d.Action.update&&(r._tempNode=null)}),this._events.on(d.RichTextEvents.selectionChange,function(){r._tempNode=null})}return t.prototype.clear=function(){this.blocks=[new f.Block([new p.TextNode("",o.emptyStyle)])],this.selection.clear()},t.prototype.getState=function(){return JSON.stringify({b:this.blocks.map(function(t){return{s:s.minimizeBlockStyle(t.style),n:t.textNodes.map(function(t){return{s:s.minimizeTextNodeStyle(t.style),t:t.text}})}}),s:this.selection.getCompact()})},t.prototype.setState=function(t){var e=JSON.parse(t);this.blocks=e.b.map(function(t){var e=t.s,n=t.n.map(function(t){return new p.TextNode(t.t,s.textNodeStyleFromMinimize(t.s))});return new f.Block(n,s.blockStyleFromMinimize(e))}),this.selection.setCompact(e.s)},t.prototype.parse=function(t,e){if(void 0===e&&(e="html"),"html"===e||"markdown"===e){var n=l.parser(t,e);this.blocks=n}else this.blocks=t.map(function(t){return new f.Block(t.textNodes.map(function(t){return new p.TextNode(t.text,t.style)}),t.style)});return this.selection.set({range:!1,left:i({blockIndex:this.blocks.length-1},this.blocks[this.blocks.length-1].getBlockEnd())}),!0},t.prototype.serialize=function(t){return void 0===t&&(t="html"),this.balance(),"markdown"===t?r.markdownSerializer(this.blocks):"html"===t?c.serializer(this.blocks):"text"===t?this.blocks.reduce(function(t,e,n){return t+(n>0?"\n":"")+e.textNodes.reduce(function(t,e){return t+e.text},"")},""):void 0},t.prototype.removeBlock=function(t){this.blocks.splice(t,1),0===this.blocks.length&&this.clear()},t.prototype.insertBlock=function(){this._splitCarret();var t=this.selection.get(),e=t.range,n=t.left;if(!e){var i=this.blocks[n.blockIndex].textNodes,o=i.splice(n.textIndex+(n.offset?1:0),1/0),r=this.blocks[n.blockIndex].style;if(0===o.length){var s=this.blocks[n.blockIndex].textNodes[n.textIndex].style;o=[new p.TextNode("",a.copyWithout(s,{link:!0}))],(r=a.copyWithout(r,{blockquote:!0,style:!0}))[d.Modifier.style]="p"}else{var l=i[i.length-1]&&i[i.length-1].style.link;if(l)for(var c=0,u=o;c<u.length;c++){var h=u[c];if(h.style.link!==l)break;h.style=a.copyWithout(h.style,{link:!0})}}0===i.length&&this.blocks[n.blockIndex].clear();var _=new f.Block(o,r);this.blocks.splice(n.blockIndex+1,0,_),this.selection.set({range:e,left:{offset:0,textIndex:0,blockIndex:n.blockIndex+1}})}},t.prototype.eachSelectedNode=function(t){var e=this.selection.get(),n=e.range,i=e.left,o=e.right;if(n)for(var r=i.blockIndex;r<=o.blockIndex;r++){var s=0,a=this.blocks[r].textNodes.length-1;r===i.blockIndex&&(s=i.textIndex),r===o.blockIndex&&(a=o.textIndex);for(var l=s;l<=a;l++)t(this.blocks[r].textNodes[l],this.blocks[r])}else i&&t(this.blocks[i.blockIndex].textNodes[i.textIndex],this.blocks[i.blockIndex])},t.prototype.eachSelectedBlock=function(t){var e=this.selection.get(),n=e.range,i=e.left,o=e.right;if(n)for(var r=i.blockIndex;r<=o.blockIndex;r++)t(this.blocks[r],r);else t(this.blocks[i.blockIndex])},t.prototype.copy=function(){if(!this.selection.get().range)return!1;this._splitRange();var t=[],e="",n=this.selection.get(),i=n.left,o=n.right;return this.eachSelectedBlock(function(n,r){var s=0,a=n.textNodes.length-1,l=[];t.push({style:n.style,textNodes:l}),r===i.blockIndex&&(s=i.textIndex),r===o.blockIndex&&(a=o.textIndex);for(var c=s;c<=a;c++){var u=n.textNodes[c];l.push({style:u.style,text:u.text}),e+=u.text}r<o.blockIndex&&(e+="\n")}),{content:t,raw:e}},t.prototype.cut=function(){var t=this.copy();return this._splitRange(),this._removeRange(),t},t.prototype.paste=function(t,e){var n,o,r;if(void 0===e&&(e="text"),"text"===e)return this.add(t);this.selection.get().range&&(this._splitRange(),this._removeRange());var s=this.selection.get().left,a="inner"===e?JSON.parse(t):l.parser(t,"html"),c=a[0],u=a.slice(1),d=void 0;if(this.blocks[s.blockIndex].isEmpty())this.blocks[s.blockIndex].textNodes=[],this.blocks[s.blockIndex].style=c.style;else switch(this.blocks[s.blockIndex].splitTextNode(s.textIndex,s.offset)){case f.SplitResult.offsetStart:d=s.textIndex;break;case f.SplitResult.offsetEnd:case f.SplitResult.complete:d=s.textIndex+1}var h=void 0,_=void 0;d>0?(h=this.blocks[s.blockIndex].textNodes.slice(0,d),_=this.blocks[s.blockIndex].textNodes.slice(d,1/0)):(h=[],_=this.blocks[s.blockIndex].textNodes);for(var v=0,g=c.textNodes;v<g.length;v++){var x=g[v];h.push(new p.TextNode(x.text,x.style))}if(this.blocks[s.blockIndex].textNodes=h,u.length){var y=u.map(function(t){return new f.Block(t.textNodes.map(function(t){return new p.TextNode(t.text,t.style)}),t.style)});(n=this.blocks).splice.apply(n,[s.blockIndex+1,0].concat(y));var m=this.blocks[s.blockIndex+u.length].getBlockEnd();(o=this.blocks[s.blockIndex+u.length].textNodes).push.apply(o,_),this.selection.set({range:!1,left:i({blockIndex:s.blockIndex+u.length},m)})}else{m=this.blocks[s.blockIndex].getBlockEnd();(r=this.blocks[s.blockIndex].textNodes).push.apply(r,_),this.selection.set({range:!1,left:i({blockIndex:s.blockIndex},m)})}return!0},t.prototype.add=function(t){if(this.selection.get().range&&(this._splitRange(),this._removeRange()),t.newBlock)return this.insertBlock(),!0;var e=this.selection.get().left,n=e.offset,i=e.blockIndex,o=e.textIndex;if(this._tempNode&&this._tempNode.offset===n&&this._tempNode.blockIndex===i&&this._tempNode.textIndex===o)return this._createNodeFromTemp(t);var r=this.blocks[i].textNodes,s=r[o];if(!s.style.link||s.text.length!==n||r[o+1]&&r[o+1].style.link)if(s.style.link&&0===n){l=new p.TextNode(t,a.copyWithout(s.style,{link:!0}));r.splice(o,0,l),this.selection.set({range:!1,left:{offset:t.length,blockIndex:i,textIndex:o}})}else r[o].insert(t,n),this.selection.set({range:!1,left:{offset:n+t.length,blockIndex:i,textIndex:o}});else{var l=new p.TextNode(t,a.copyWithout(s.style,{link:!0}));r.splice(o+1,0,l),this.selection.set({range:!1,left:{offset:t.length,blockIndex:i,textIndex:o+1}})}return!0},t.prototype.remove=function(t){return this.selection.get().range?(this._splitRange(),this._removeRange(),!0):this._removeSymbol(t)},t.prototype.update=function(t){var e=t.modifier,n=t.modifierValue,o=this.selection.get(),r=o.range,s=o.left;switch(e){case d.Modifier.align:case d.Modifier.style:case d.Modifier.blockquote:return this.eachSelectedBlock(function(t){var o;t.style=i({},t.style,((o={})[e]=n,o)),e===d.Modifier.style&&"p"!==n&&t.textNodes.forEach(function(t){var e;t.style=a.copyWithout(t.style,((e={})[d.Modifier.fontSize]=!0,e))})}),!0;case d.Modifier.strike:case d.Modifier.underline:case d.Modifier.italic:case d.Modifier.bold:case d.Modifier.color:case d.Modifier.background:case d.Modifier.fontFamily:case d.Modifier.fontSize:return r?(this._splitRange(),this.eachSelectedNode(function(t){var o;t.style=i({},t.style,((o={})[e]=n,o))}),!0):(this._createTempTextNode({modifier:e,modifierValue:n}),!1);case d.Modifier.link:var l=this.blocks[s.blockIndex].textNodes[s.textIndex];return void 0===e||void 0!==l.style.link?this._eachLink(function(t){var o;t.style=i({},t.style,((o={})[e]=n,o))}):(r&&this._splitRange(),this.eachSelectedNode(function(t){var o;t.style=i({},t.style,((o={})[e]=n,o))})),!0}},t.prototype.clearStyles=function(){return!!this.selection.get().range&&(this._splitRange(),this.eachSelectedNode(function(t){t.style=o.emptyStyle}),!0)},t.prototype.balance=function(){var t,e=this.selection.get(),n=e.left,o=e.right,r=e.range,s=this.blocks[n.blockIndex].nodePositionToOffset(n.textIndex,n.offset);r&&(t=this.blocks[o.blockIndex].nodePositionToOffset(o.textIndex,o.offset));var a=!0;this.blocks.forEach(function(t){t.balance()&&(a=!1)}),a||(this.selection.set({range:r,left:i({blockIndex:n.blockIndex},this.blocks[n.blockIndex].offsetToNodePosition(s)),right:t&&i({blockIndex:o.blockIndex},this.blocks[o.blockIndex].offsetToNodePosition(t))}),this._repaint())},t.prototype.getLinkInfo=function(){var t,e="";return this._eachLink(function(n){e+=n.text,t=n.style.link}),{text:e,link:t}},t.prototype.updateLinkText=function(t){var e=this.selection.get(),n=e.left,i=e.range,o=this.blocks[n.blockIndex].textNodes,r=o[n.textIndex].style.link,s=new p.TextNode(t,{});if(r){for(var a=n.textIndex,l=n.textIndex;o[a-1]&&o[a-1].style.link===r;)a--;for(;o[l+1]&&o[l+1].style.link===r;)l++;o.splice(a,l-a+1,s),this.selection.set({range:!0,left:{blockIndex:n.blockIndex,textIndex:a,offset:0},right:{blockIndex:n.blockIndex,textIndex:a,offset:t.length}})}else if(i){this._splitRange(),this._removeRange();var c=this.selection.get().left,u=c.blockIndex,d=c.textIndex;this.blocks[u].textNodes.splice(d+1,0,s),this.selection.set({range:!0,left:{blockIndex:u,textIndex:d+1,offset:0},right:{blockIndex:u,textIndex:d+1,offset:t.length}})}else{var h=void 0;if(this.blocks[n.blockIndex].isEmpty())o.splice(0,1),h=0;else h=this.blocks[n.blockIndex].splitTextNode(n.textIndex,n.offset)===f.SplitResult.offsetStart?n.textIndex:n.textIndex+1;o.splice(h,0,s),this.selection.set({range:!0,left:{blockIndex:n.blockIndex,textIndex:h,offset:0},right:{blockIndex:n.blockIndex,textIndex:h,offset:t.length}})}},t.prototype._splitRange=function(){var t=this.selection.get(),e=t.range,n=t.left,i=t.right;if(e)if(n.blockIndex!==i.blockIndex||n.textIndex!==i.textIndex)if(n.blockIndex!==i.blockIndex){if(n.blockIndex!==i.blockIndex){r=n.textIndex;var o=n.blockIndex;a=this.blocks[n.blockIndex].splitTextNode(n.textIndex,n.offset);this.blocks[i.blockIndex].splitTextNode(i.textIndex,i.offset),a===f.SplitResult.offsetEnd&&(this.blocks[o].textNodes[r+1]?r+=1:(r=0,o+=1)),a===f.SplitResult.complete&&(r+=1);s={range:e,left:{blockIndex:o,textIndex:r,offset:0},right:{blockIndex:i.blockIndex,textIndex:i.textIndex,offset:i.offset}};this.selection.set(s)}}else{var r=n.textIndex;l=i.textIndex;(a=this.blocks[n.blockIndex].splitTextNode(r,n.offset))===f.SplitResult.offsetEnd&&(r+=1),a===f.SplitResult.complete&&(l+=1,r+=1),this.blocks[i.blockIndex].splitTextNode(l,i.offset);var s={range:e,left:{blockIndex:n.blockIndex,textIndex:r,offset:0},right:{blockIndex:i.blockIndex,textIndex:l,offset:i.offset}};this.selection.set(s)}else{var a,l=n.textIndex,c=i.offset;(a=this.blocks[n.blockIndex].splitTextNode(n.textIndex,n.offset))===f.SplitResult.complete&&(l+=1,c-=n.offset),this.blocks[i.blockIndex].splitTextNode(l,c);var s={range:e,left:{blockIndex:n.blockIndex,textIndex:l,offset:0},right:{blockIndex:i.blockIndex,textIndex:l,offset:c}};this.selection.set(s)}},t.prototype._splitCarret=function(){var t=this.selection.get(),e=t.range,n=t.left;if(!e&&this.blocks[n.blockIndex].splitTextNode(n.textIndex,n.offset)===f.SplitResult.complete){var i={range:e,left:{blockIndex:n.blockIndex,textIndex:n.textIndex+1,offset:0}};this.selection.set(i)}},t.prototype._removeRange=function(){var t,e=this.selection.get(),n=e.left,o=e.right;if(o)if(this.selection.isFull())this.clear();else if(n.blockIndex===o.blockIndex)0===n.textIndex&&o.textIndex===this.blocks[o.blockIndex].textNodes.length-1?(this.blocks[n.blockIndex].clear(),this.selection.set({range:!1,left:i({},n,{offset:0})})):(this.blocks[n.blockIndex].textNodes.splice(n.textIndex,o.textIndex-n.textIndex+1),0===n.textIndex?this.selection.set({range:!1,left:{blockIndex:n.blockIndex,textIndex:0,offset:0}}):this.selection.set({range:!1,left:{blockIndex:n.blockIndex,textIndex:n.textIndex-1,offset:this.blocks[n.blockIndex].textNodes[n.textIndex-1].text.length}}));else{var r=this.blocks[n.blockIndex].removeNodes(n.textIndex,!0),s=this.blocks[o.blockIndex].removeNodes(o.textIndex,!1),a=this.blocks[n.blockIndex].getBlockEnd();switch(!0){case r&&s:this.blocks[n.blockIndex].clear();break;case r&&!s:this.blocks[n.blockIndex].textNodes=this.blocks[o.blockIndex].textNodes;break;case!r&&!s:(t=this.blocks[n.blockIndex].textNodes).push.apply(t,this.blocks[o.blockIndex].textNodes)}for(var l=o.blockIndex;l>n.blockIndex;l--)this.removeBlock(l);r?this.selection.set({range:!1,left:{blockIndex:n.blockIndex,textIndex:n.textIndex,offset:0}}):this.selection.set({range:!1,left:i({blockIndex:n.blockIndex},a)})}},t.prototype._removeSymbol=function(t){var e=this.selection.get().left,n=e.offset,r=e.blockIndex,s=e.textIndex,a={range:!1,left:{offset:n,blockIndex:r,textIndex:s}},l=this.blocks[r].getBlockEnd(),c=this.blocks[r].textNodes,u=c[s],d=!1;switch(!0){case this.blocks[r].isEmpty():if(0===r&&t)return!_.isEmptyBlockStyle(this.blocks[0].style)&&(this.blocks[0].style=o.emptyStyle,!0);if(!t&&!this.blocks[r+1])return!1;this.removeBlock(r),0===r?(a.left.offset=0,a.left.textIndex=0):t&&(a.left=i({blockIndex:r-1},this.blocks[r-1].getBlockEnd()));break;case 0===n&&0===s&&t:if(0===r)return!1;if(this.blocks[r-1].isEmpty())this.blocks[r-1].textNodes=c,this.removeBlock(r),a.left={blockIndex:r-1,textIndex:0,offset:0};else{var h=this.blocks[r-1].getBlockEnd();this.blocks[r-1].textNodes=this.blocks[r-1].textNodes.concat(c),this.removeBlock(r),a.left=i({blockIndex:r-1},h)}break;case l.offset===n&&l.textIndex===s&&!t:var f=this.blocks[r+1];if(!f)return;if(f.isEmpty())return this.removeBlock(r+1),!0;this.blocks[r].textNodes=this.blocks[r].textNodes.concat(f.textNodes),this.removeBlock(r+1);break;default:switch(u.remove(n,t)){case p.RemoveTextResult.nullTextLength:c.length>1?(c.splice(s,1),a.left=0===s?{blockIndex:r,textIndex:0,offset:0}:{blockIndex:r,textIndex:s-1,offset:c[s-1].text.length}):(u.style=o.emptyStyle,a.left={textIndex:s,blockIndex:r,offset:0});break;case p.RemoveTextResult.complete:t&&(a.left={blockIndex:r,textIndex:s,offset:n-1});break;case p.RemoveTextResult.forceRemoveNext:a.left={blockIndex:r,textIndex:s+1,offset:0},d=!0;break;case p.RemoveTextResult.forceRemovePrevious:a.left={blockIndex:r,textIndex:s-1,offset:c[s-1].text.length},d=!0}}return this.selection.set(a),!d||this._removeSymbol(t)},t.prototype._eachLink=function(t){var e=this.selection.get().left,n=this.blocks[e.blockIndex].textNodes[e.textIndex].style.link;if(n){for(var i=this.blocks[e.blockIndex].textNodes,o=[],r=e.textIndex;r>=0&&i[r].style.link===n;r--)o.unshift(i[r]);for(r=e.textIndex+1;r<i.length&&i[r].style.link===n;r++)o.push(i[r]);o.forEach(t)}},t.prototype._createTempTextNode=function(t){var e,n,o=t.modifier,r=t.modifierValue,s=this.selection.get().left,a=s.offset,l=s.blockIndex,c=s.textIndex;n=this._tempNode&&this._tempNode.offset===a&&this._tempNode.blockIndex===l&&this._tempNode.textIndex===c?this._tempNode.style:this.blocks[l].textNodes[c].style;var u=i({},n,((e={})[o]=r,e)),d=this.blocks[l].textNodes;!u.link||d[c+1]&&d[c+1].style.link||delete u.link,this._tempNode={style:u,blockIndex:l,textIndex:c,offset:a}},t.prototype._createNodeFromTemp=function(t){var e=this._tempNode,n=e.style,i=e.blockIndex,o=e.textIndex,r=e.offset,s=this.blocks[i].splitTextNode(o,r)===f.SplitResult.offsetStart?o:o+1,a=new p.TextNode(t,n);return this.blocks[i].isEmpty()?this.blocks[i].textNodes=[a]:this.blocks[i].textNodes.splice(s,0,a),this.selection.set({range:!1,left:{blockIndex:i,textIndex:s,offset:t.length}}),this._tempNode=null,!0},t}();e.Editor=v},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,o=n(2);function r(t,e){for(var n="",r=[],a=0,l=t;a<l.length;a++){var c=l[a],u=[],d=c.style;d[o.Modifier.bold]&&u.push(i.bold),d[o.Modifier.italic]&&u.push(i.italic),n+=s(r,u).join("")+c.text,r=u}return n+=r.join(""),e&&(n="["+n+"]("+e+")"),n}function s(t,e){var n=e.filter(function(e){return-1===t.indexOf(e)}),i=t.filter(function(t){return-1===e.indexOf(t)});return n.concat(i)}e.markdownSerializer=function(t){return t.reduce(function(t,e,n){return t+(n?"\n\n":"")+function(t){switch(t.style[o.Modifier.style]){case"h1":return"# ";case"h2":return"## ";case"h3":return"### ";case"h4":return"#### ";case"h5":return"##### ";case"h6":return"###### ";default:return""}}(e)+function(t){for(var e,n="",i=[],o=0,s=t.textNodes;o<s.length;o++){var a=s[o];a.style.link?e===a.style.link?i.push(a):(i.length&&(n+=r(i,e)),i=[a]):e?(i.length&&(n+=r(i,e)),i=[a]):i.push(a),e=a.style.link}return n+=r(i,e)}(e)},"")},function(t){t.bold="**",t.italic="*"}(i||(i={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(2);e.minimizeTextNodeStyle=function(t){var e=t[i.Modifier.bold]|t[i.Modifier.italic]<<1|t[i.Modifier.underline]<<2|t[i.Modifier.strike]<<3,n={};return 0!==e&&(n.f=e),t[i.Modifier.fontSize]&&(n.s=parseInt(t[i.Modifier.fontSize],10)),t[i.Modifier.fontFamily]&&(n.t=t[i.Modifier.fontFamily]),t[i.Modifier.color]&&(n.c=t[i.Modifier.color]),t[i.Modifier.background]&&(n.b=t[i.Modifier.background]),t[i.Modifier.link]&&(n.a=t[i.Modifier.link]),n},e.textNodeStyleFromMinimize=function(t){var e={};return t.f&&(1&t.f&&(e[i.Modifier.bold]=!0),2&t.f&&(e[i.Modifier.italic]=!0),4&t.f&&(e[i.Modifier.underline]=!0),8&t.f&&(e[i.Modifier.strike]=!0)),t.s&&(e[i.Modifier.fontSize]=t.s+"px"),t.t&&(e[i.Modifier.fontFamily]=t.t),t.c&&(e[i.Modifier.color]=t.c),t.b&&(e[i.Modifier.background]=t.b),t.a&&(e[i.Modifier.link]=t.a),e};var o={left:1,center:2,right:3},r={1:"left",2:"center",3:"right"},s={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},a={1:"h1",2:"h2",3:"h3",4:"h4",5:"h5",6:"h6"};e.minimizeBlockStyle=function(t){var e={};if(t[i.Modifier.blockquote]&&(e.b=1),t[i.Modifier.style]){var n=s[t[i.Modifier.style]];n&&(e.s=n)}return t[i.Modifier.align]&&(e.a=o[t[i.Modifier.align]]),e},e.blockStyleFromMinimize=function(t){var e={};return t.a&&(e[i.Modifier.align]=r[t.a]),t.b&&(e[i.Modifier.blockquote]=!0),e[i.Modifier.style]=a[t.s]||"p",e}},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=n(83),r=n(5),s=n(34),a=n(20),l=n(2);e.parser=function(t,e){var n;void 0===e&&(e="html"),"markdown"===e&&(t=o(t));var r=document.createElement("div");r.innerHTML=t.replace(/<br\s*[\/]?>/g,"\n");var a=[];if(function t(e,n,o){var r;if(void 0===o&&(o={}),o=i({},o,d(e)),c[e.nodeName]){var a=[];u(e,a);var h=new s.Block(a,i({},o,((r={})[l.Modifier.style]=c[e.nodeName],r)));n.push(h)}else for(var f=e.childNodes,p=0;p<f.length;p++)t(f[p],n,o)}(r,a),0===a.length){var h=i(((n={})[l.Modifier.style]=c[r.nodeName]||"p",n),d(r)),f=[];return u(r,f),[new s.Block(f,h)]}return a};var c={P:"p",H1:"h1",H2:"h2",H3:"h3",H4:"h4",H5:"h5",H6:"h6"};function u(t,e,n){if(void 0===n&&(n={}),t.nodeType!==t.TEXT_NODE){var o={},s=t.style||{},c=s.fontSize,d=s.fontWeight,h=s.fontFamily,f=s.color,p=s.background,_=s.backgroundColor,v=s.textDecoration,g=s.fontStyle,x=function(t){var e,n,i,o,r;switch(t.nodeName){case"B":case"STRONG":return(e={})[l.Modifier.bold]=!0,e;case"I":case"EM":return(n={})[l.Modifier.italic]=!0,n;case"U":return(i={})[l.Modifier.underline]=!0,i;case"STRIKE":case"S":return(o={})[l.Modifier.strike]=!0,o;case"A":return(r={})[l.Modifier.link]=t.href,r;default:return{}}}(t);c&&(o[l.Modifier.fontSize]=r.fontSizes[c]?c:"14px"),d&&(o[l.Modifier.bold]="bold"===d||parseInt(d,10)>=600),h&&(o[l.Modifier.fontFamily]=r.fonts[h]?h:"Roboto"),f&&(o[l.Modifier.color]=f),(p||_)&&(o[l.Modifier.background]=p||_),"underline"===v&&(o[l.Modifier.underline]=!0),"line-through"===v&&(o[l.Modifier.strike]=!0),g&&(o[l.Modifier.italic]="italic"===g);for(var y=i({},n,x,o),m=t.childNodes,b=0;b<m.length;b++)u(m[b],e,y)}else{var k=t.textContent.replace(/ /g," ").replace(/</g,"<").replace(/>/g,">");if(0===k.replace(/\n/g,"").length)return;var w=new a.TextNode(k,n);e.push(w)}}function d(t){if(!t||!t.style)return{};var e={};return t.style.textAlign&&(e[l.Modifier.align]=t.style.textAlign),"BLOCKQUOTE"===t.nodeName&&(e[l.Modifier.blockquote]=!0),e}},function(t,e,n){(function(e){!function(e){"use strict";var n={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:_,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:_,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=\\h*\\n)[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:_,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function i(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||y.defaults,this.rules=n.normal,this.options.pedantic?this.rules=n.pedantic:this.options.gfm&&(this.options.tables?this.rules=n.tables:this.rules=n.gfm)}n._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,n._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,n.def=d(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d+\.)/,n.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,n.item=d(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=d(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",n._comment=/<!--(?!-?>)[\s\S]*?-->/,n.html=d(n.html,"i").replace("comment",n._comment).replace("tag",n._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),n.paragraph=d(n.paragraph).replace("hr",n.hr).replace("heading",n.heading).replace("lheading",n.lheading).replace("tag",n._tag).getRegex(),n.blockquote=d(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=v({},n),n.gfm=v({},n.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\n? *\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),n.gfm.paragraph=d(n.paragraph).replace("(?!","(?!"+n.gfm.fences.source.replace("\\1","\\2")+"|"+n.list.source.replace("\\1","\\3")+"|").getRegex(),n.tables=v({},n.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),n.pedantic=v({},n.normal,{html:d("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",n._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),i.rules=n,i.lex=function(t,e){return new i(e).lex(t)},i.prototype.lex=function(t){return t=t.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(t,!0)},i.prototype.token=function(t,e){var i,o,r,s,a,l,c,u,d,h,f,p,_,v,y,m;for(t=t.replace(/^ +$/gm,"");t;)if((r=this.rules.newline.exec(t))&&(t=t.substring(r[0].length),r[0].length>1&&this.tokens.push({type:"space"})),r=this.rules.code.exec(t))t=t.substring(r[0].length),r=r[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?r:x(r,"\n")});else if(r=this.rules.fences.exec(t))t=t.substring(r[0].length),this.tokens.push({type:"code",lang:r[2],text:r[3]||""});else if(r=this.rules.heading.exec(t))t=t.substring(r[0].length),this.tokens.push({type:"heading",depth:r[1].length,text:r[2]});else if(e&&(r=this.rules.nptable.exec(t))&&(l={type:"table",header:g(r[1].replace(/^ *| *\| *$/g,"")),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:r[3]?r[3].replace(/\n$/,"").split("\n"):[]}).header.length===l.align.length){for(t=t.substring(r[0].length),f=0;f<l.align.length;f++)/^ *-+: *$/.test(l.align[f])?l.align[f]="right":/^ *:-+: *$/.test(l.align[f])?l.align[f]="center":/^ *:-+ *$/.test(l.align[f])?l.align[f]="left":l.align[f]=null;for(f=0;f<l.cells.length;f++)l.cells[f]=g(l.cells[f],l.header.length);this.tokens.push(l)}else if(r=this.rules.hr.exec(t))t=t.substring(r[0].length),this.tokens.push({type:"hr"});else if(r=this.rules.blockquote.exec(t))t=t.substring(r[0].length),this.tokens.push({type:"blockquote_start"}),r=r[0].replace(/^ *> ?/gm,""),this.token(r,e),this.tokens.push({type:"blockquote_end"});else if(r=this.rules.list.exec(t)){for(t=t.substring(r[0].length),c={type:"list_start",ordered:v=(s=r[2]).length>1,start:v?+s:"",loose:!1},this.tokens.push(c),u=[],i=!1,_=(r=r[0].match(this.rules.item)).length,f=0;f<_;f++)h=(l=r[f]).length,~(l=l.replace(/^ *([*+-]|\d+\.) +/,"")).indexOf("\n ")&&(h-=l.length,l=this.options.pedantic?l.replace(/^ {1,4}/gm,""):l.replace(new RegExp("^ {1,"+h+"}","gm"),"")),this.options.smartLists&&f!==_-1&&(s===(a=n.bullet.exec(r[f+1])[0])||s.length>1&&a.length>1||(t=r.slice(f+1).join("\n")+t,f=_-1)),o=i||/\n\n(?!\s*$)/.test(l),f!==_-1&&(i="\n"===l.charAt(l.length-1),o||(o=i)),o&&(c.loose=!0),m=void 0,(y=/^\[[ xX]\] /.test(l))&&(m=" "!==l[1],l=l.replace(/^\[[ xX]\] +/,"")),d={type:"list_item_start",task:y,checked:m,loose:o},u.push(d),this.tokens.push(d),this.token(l,!1),this.tokens.push({type:"list_item_end"});if(c.loose)for(_=u.length,f=0;f<_;f++)u[f].loose=!0;this.tokens.push({type:"list_end"})}else if(r=this.rules.html.exec(t))t=t.substring(r[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===r[1]||"script"===r[1]||"style"===r[1]),text:r[0]});else if(e&&(r=this.rules.def.exec(t)))t=t.substring(r[0].length),r[3]&&(r[3]=r[3].substring(1,r[3].length-1)),p=r[1].toLowerCase().replace(/\s+/g," "),this.tokens.links[p]||(this.tokens.links[p]={href:r[2],title:r[3]});else if(e&&(r=this.rules.table.exec(t))&&(l={type:"table",header:g(r[1].replace(/^ *| *\| *$/g,"")),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:r[3]?r[3].replace(/(?: *\| *)?\n$/,"").split("\n"):[]}).header.length===l.align.length){for(t=t.substring(r[0].length),f=0;f<l.align.length;f++)/^ *-+: *$/.test(l.align[f])?l.align[f]="right":/^ *:-+: *$/.test(l.align[f])?l.align[f]="center":/^ *:-+ *$/.test(l.align[f])?l.align[f]="left":l.align[f]=null;for(f=0;f<l.cells.length;f++)l.cells[f]=g(l.cells[f].replace(/^ *\| *| *\| *$/g,""),l.header.length);this.tokens.push(l)}else if(r=this.rules.lheading.exec(t))t=t.substring(r[0].length),this.tokens.push({type:"heading",depth:"="===r[2]?1:2,text:r[1]});else if(e&&(r=this.rules.paragraph.exec(t)))t=t.substring(r[0].length),this.tokens.push({type:"paragraph",text:"\n"===r[1].charAt(r[1].length-1)?r[1].slice(0,-1):r[1]});else if(r=this.rules.text.exec(t))t=t.substring(r[0].length),this.tokens.push({type:"text",text:r[0]});else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0));return this.tokens};var o={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:_,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s])__(?!_)|^\*\*([^\s])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*"<\[])\*(?!\*)|^_([^\s][\s\S]*?[^\s_])_(?!_|[^\s.])|^_([^\s_][\s\S]*?[^\s])_(?!_|[^\s.])|^\*([^\s"<\[][\s\S]*?[^\s*])\*(?!\*)|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:_,text:/^(`+|[^`])[\s\S]*?(?=[\\<!\[`*]|\b_| {2,}\n|$)/};function r(t,e){if(this.options=e||y.defaults,this.links=t,this.rules=o.normal,this.renderer=this.options.renderer||new s,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.pedantic?this.rules=o.pedantic:this.options.gfm&&(this.options.breaks?this.rules=o.breaks:this.rules=o.gfm)}function s(t){this.options=t||y.defaults}function a(){}function l(t){this.tokens=[],this.token=null,this.options=t||y.defaults,this.options.renderer=this.options.renderer||new s,this.renderer=this.options.renderer,this.renderer.options=this.options}function c(t,e){if(e){if(c.escapeTest.test(t))return t.replace(c.escapeReplace,function(t){return c.replacements[t]})}else if(c.escapeTestNoEncode.test(t))return t.replace(c.escapeReplaceNoEncode,function(t){return c.replacements[t]});return t}function u(t){return t.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,function(t,e){return"colon"===(e=e.toLowerCase())?":":"#"===e.charAt(0)?"x"===e.charAt(1)?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1)):""})}function d(t,e){return t=t.source||t,e=e||"",{replace:function(e,n){return n=(n=n.source||n).replace(/(^|[^\[])\^/g,"$1"),t=t.replace(e,n),this},getRegex:function(){return new RegExp(t,e)}}}function h(t,e,n){if(t){try{var i=decodeURIComponent(u(n)).replace(/[^\w:]/g,"").toLowerCase()}catch(t){return null}if(0===i.indexOf("javascript:")||0===i.indexOf("vbscript:")||0===i.indexOf("data:"))return null}e&&!p.test(n)&&(n=function(t,e){f[" "+t]||(/^[^:]+:\/*[^/]*$/.test(t)?f[" "+t]=t+"/":f[" "+t]=x(t,"/",!0));return t=f[" "+t],"//"===e.slice(0,2)?t.replace(/:[\s\S]*/,":")+e:"/"===e.charAt(0)?t.replace(/(:\/*[^/]*)[\s\S]*/,"$1")+e:t+e}(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(t){return null}return n}o._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,o._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,o._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,o.autolink=d(o.autolink).replace("scheme",o._scheme).replace("email",o._email).getRegex(),o._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,o.tag=d(o.tag).replace("comment",n._comment).replace("attribute",o._attribute).getRegex(),o._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/,o._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s\x00-\x1f\\]*\)|[^\s\x00-\x1f()\\])*?)/,o._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,o.link=d(o.link).replace("label",o._label).replace("href",o._href).replace("title",o._title).getRegex(),o.reflink=d(o.reflink).replace("label",o._label).getRegex(),o.normal=v({},o),o.pedantic=v({},o.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:d(/^!?\[(label)\]\((.*?)\)/).replace("label",o._label).getRegex(),reflink:d(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",o._label).getRegex()}),o.gfm=v({},o.normal,{escape:d(o.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:d(o.text).replace("]|","~]|").replace("|$","|https?://|ftp://|www\\.|[a-zA-Z0-9.!#$%&'*+/=?^_`{\\|}~-]+@|$").getRegex()}),o.gfm.url=d(o.gfm.url).replace("email",o.gfm._extended_email).getRegex(),o.breaks=v({},o.gfm,{br:d(o.br).replace("{2,}","*").getRegex(),text:d(o.gfm.text).replace("{2,}","*").getRegex()}),r.rules=o,r.output=function(t,e,n){return new r(e,n).output(t)},r.prototype.output=function(t){for(var e,n,i,o,s,a,l="";t;)if(s=this.rules.escape.exec(t))t=t.substring(s[0].length),l+=s[1];else if(s=this.rules.autolink.exec(t))t=t.substring(s[0].length),i="@"===s[2]?"mailto:"+(n=c(this.mangle(s[1]))):n=c(s[1]),l+=this.renderer.link(i,null,n);else if(this.inLink||!(s=this.rules.url.exec(t))){if(s=this.rules.tag.exec(t))!this.inLink&&/^<a /i.test(s[0])?this.inLink=!0:this.inLink&&/^<\/a>/i.test(s[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(s[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(s[0])&&(this.inRawBlock=!1),t=t.substring(s[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(s[0]):c(s[0]):s[0];else if(s=this.rules.link.exec(t))t=t.substring(s[0].length),this.inLink=!0,i=s[2],this.options.pedantic?(e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i))?(i=e[1],o=e[3]):o="":o=s[3]?s[3].slice(1,-1):"",i=i.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=this.outputLink(s,{href:r.escapes(i),title:r.escapes(o)}),this.inLink=!1;else if((s=this.rules.reflink.exec(t))||(s=this.rules.nolink.exec(t))){if(t=t.substring(s[0].length),e=(s[2]||s[1]).replace(/\s+/g," "),!(e=this.links[e.toLowerCase()])||!e.href){l+=s[0].charAt(0),t=s[0].substring(1)+t;continue}this.inLink=!0,l+=this.outputLink(s,e),this.inLink=!1}else if(s=this.rules.strong.exec(t))t=t.substring(s[0].length),l+=this.renderer.strong(this.output(s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.em.exec(t))t=t.substring(s[0].length),l+=this.renderer.em(this.output(s[6]||s[5]||s[4]||s[3]||s[2]||s[1]));else if(s=this.rules.code.exec(t))t=t.substring(s[0].length),l+=this.renderer.codespan(c(s[2].trim(),!0));else if(s=this.rules.br.exec(t))t=t.substring(s[0].length),l+=this.renderer.br();else if(s=this.rules.del.exec(t))t=t.substring(s[0].length),l+=this.renderer.del(this.output(s[1]));else if(s=this.rules.text.exec(t))t=t.substring(s[0].length),this.inRawBlock?l+=this.renderer.text(s[0]):l+=this.renderer.text(c(this.smartypants(s[0])));else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}else{if("@"===s[2])i="mailto:"+(n=c(s[0]));else{do{a=s[0],s[0]=this.rules._backpedal.exec(s[0])[0]}while(a!==s[0]);n=c(s[0]),i="www."===s[1]?"http://"+n:n}t=t.substring(s[0].length),l+=this.renderer.link(i,null,n)}return l},r.escapes=function(t){return t?t.replace(r.rules._escapes,"$1"):t},r.prototype.outputLink=function(t,e){var n=e.href,i=e.title?c(e.title):null;return"!"!==t[0].charAt(0)?this.renderer.link(n,i,this.output(t[1])):this.renderer.image(n,i,c(t[1]))},r.prototype.smartypants=function(t){return this.options.smartypants?t.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):t},r.prototype.mangle=function(t){if(!this.options.mangle)return t;for(var e,n="",i=t.length,o=0;o<i;o++)e=t.charCodeAt(o),Math.random()>.5&&(e="x"+e.toString(16)),n+="&#"+e+";";return n},s.prototype.code=function(t,e,n){if(this.options.highlight){var i=this.options.highlight(t,e);null!=i&&i!==t&&(n=!0,t=i)}return e?'<pre><code class="'+this.options.langPrefix+c(e,!0)+'">'+(n?t:c(t,!0))+"</code></pre>\n":"<pre><code>"+(n?t:c(t,!0))+"</code></pre>"},s.prototype.blockquote=function(t){return"<blockquote>\n"+t+"</blockquote>\n"},s.prototype.html=function(t){return t},s.prototype.heading=function(t,e,n){return this.options.headerIds?"<h"+e+' id="'+this.options.headerPrefix+n.toLowerCase().replace(/[^\w]+/g,"-")+'">'+t+"</h"+e+">\n":"<h"+e+">"+t+"</h"+e+">\n"},s.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},s.prototype.list=function(t,e,n){var i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+t+"</"+i+">\n"},s.prototype.listitem=function(t){return"<li>"+t+"</li>\n"},s.prototype.checkbox=function(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},s.prototype.paragraph=function(t){return"<p>"+t+"</p>\n"},s.prototype.table=function(t,e){return e&&(e="<tbody>"+e+"</tbody>"),"<table>\n<thead>\n"+t+"</thead>\n"+e+"</table>\n"},s.prototype.tablerow=function(t){return"<tr>\n"+t+"</tr>\n"},s.prototype.tablecell=function(t,e){var n=e.header?"th":"td";return(e.align?"<"+n+' align="'+e.align+'">':"<"+n+">")+t+"</"+n+">\n"},s.prototype.strong=function(t){return"<strong>"+t+"</strong>"},s.prototype.em=function(t){return"<em>"+t+"</em>"},s.prototype.codespan=function(t){return"<code>"+t+"</code>"},s.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"},s.prototype.del=function(t){return"<del>"+t+"</del>"},s.prototype.link=function(t,e,n){if(null===(t=h(this.options.sanitize,this.options.baseUrl,t)))return n;var i='<a href="'+c(t)+'"';return e&&(i+=' title="'+e+'"'),i+=">"+n+"</a>"},s.prototype.image=function(t,e,n){if(null===(t=h(this.options.sanitize,this.options.baseUrl,t)))return n;var i='<img src="'+t+'" alt="'+n+'"';return e&&(i+=' title="'+e+'"'),i+=this.options.xhtml?"/>":">"},s.prototype.text=function(t){return t},a.prototype.strong=a.prototype.em=a.prototype.codespan=a.prototype.del=a.prototype.text=function(t){return t},a.prototype.link=a.prototype.image=function(t,e,n){return""+n},a.prototype.br=function(){return""},l.parse=function(t,e){return new l(e).parse(t)},l.prototype.parse=function(t){this.inline=new r(t.links,this.options),this.inlineText=new r(t.links,v({},this.options,{renderer:new a})),this.tokens=t.reverse();for(var e="";this.next();)e+=this.tok();return e},l.prototype.next=function(){return this.token=this.tokens.pop()},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var t=this.token.text;"text"===this.peek().type;)t+="\n"+this.next().text;return this.inline.output(t)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,u(this.inlineText.output(this.token.text)));case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var t,e,n,i,o="",r="";for(n="",t=0;t<this.token.header.length;t++)n+=this.renderer.tablecell(this.inline.output(this.token.header[t]),{header:!0,align:this.token.align[t]});for(o+=this.renderer.tablerow(n),t=0;t<this.token.cells.length;t++){for(e=this.token.cells[t],n="",i=0;i<e.length;i++)n+=this.renderer.tablecell(this.inline.output(e[i]),{header:!1,align:this.token.align[i]});r+=this.renderer.tablerow(n)}return this.renderer.table(o,r);case"blockquote_start":for(r="";"blockquote_end"!==this.next().type;)r+=this.tok();return this.renderer.blockquote(r);case"list_start":r="";for(var s=this.token.ordered,a=this.token.start;"list_end"!==this.next().type;)r+=this.tok();return this.renderer.list(r,s,a);case"list_item_start":r="";var l=this.token.loose;for(this.token.task&&(r+=this.renderer.checkbox(this.token.checked));"list_item_end"!==this.next().type;)r+=l||"text"!==this.token.type?this.tok():this.parseText();return this.renderer.listitem(r);case"html":return this.renderer.html(this.token.text);case"paragraph":return this.renderer.paragraph(this.inline.output(this.token.text));case"text":return this.renderer.paragraph(this.parseText())}},c.escapeTest=/[&<>"']/,c.escapeReplace=/[&<>"']/g,c.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},c.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,c.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var f={},p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(){}function v(t){for(var e,n,i=1;i<arguments.length;i++)for(n in e=arguments[i])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function g(t,e){var n=t.replace(/\|/g,function(t,e,n){for(var i=!1,o=e;--o>=0&&"\\"===n[o];)i=!i;return i?"|":" |"}).split(/ \|/),i=0;if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(/\\\|/g,"|");return n}function x(t,e,n){if(0===t.length)return"";for(var i=0;i<t.length;){var o=t.charAt(t.length-i-1);if(o!==e||n){if(o===e||!n)break;i++}else i++}return t.substr(0,t.length-i)}function y(t,e,n){if(void 0===t||null===t)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof t)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected");if(n||"function"==typeof e){n||(n=e,e=null);var o,r,s=(e=v({},y.defaults,e||{})).highlight,a=0;try{o=i.lex(t,e)}catch(t){return n(t)}r=o.length;var u=function(t){if(t)return e.highlight=s,n(t);var i;try{i=l.parse(o,e)}catch(e){t=e}return e.highlight=s,t?n(t):n(null,i)};if(!s||s.length<3)return u();if(delete e.highlight,!r)return u();for(;a<o.length;a++)!function(t){"code"!==t.type?--r||u():s(t.text,t.lang,function(e,n){return e?u(e):null==n||n===t.text?--r||u():(t.text=n,t.escaped=!0,void(--r||u()))})}(o[a])}else try{return e&&(e=v({},y.defaults,e)),l.parse(i.lex(t,e),e)}catch(t){if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",(e||y.defaults).silent)return"<p>An error occurred:</p><pre>"+c(t.message+"",!0)+"</pre>";throw t}}_.exec=_,y.options=y.setOptions=function(t){return v(y.defaults,t),y},y.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new s,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},y.defaults=y.getDefaults(),y.Parser=l,y.parser=l.parse,y.Renderer=s,y.TextRenderer=a,y.Lexer=i,y.lexer=i.lex,y.InlineLexer=r,y.inlineLexer=r.output,y.parse=y,t.exports=y}(this||"undefined"!=typeof window&&window)}).call(this,n(14))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(85),o=n(2),r=function(){function t(t){this._editor=t,this.clearChanges(),this._buffer=new i.TextBuffer(this._editor)}return t.prototype.execute=function(t){var e,n=this;switch(this._inactionTimer&&(clearTimeout(this._inactionTimer),this._inactionTimer=null),this._inactionTimer=setTimeout(function(){n._editor.selection.isActive()&&n._editor.balance(),n._inactionTimer=null},5e3),t.action){case o.Action.parse:return e=this._editor.parse(t.data.value,t.data.mode),this.clearChanges(),!0;case o.Action.add:e=this._editor.add(t.data);break;case o.Action.innerAdd:if("string"==typeof t.data)e=this._editor.add(t.data);else{var i=t.data,r=i.data;switch(i.type){case"text":e=this._editor.add(r);break;case"full":e=this._editor.paste(JSON.stringify(r),"inner");break;case"textnode":e=this._editor.paste(JSON.stringify([{textNodes:[r],style:{}}]),"inner")}}break;case o.Action.remove:e=this._editor.remove(t.data);break;case o.Action.update:e=this._editor.update(t.data);break;case o.Action.clear:e=this._editor.clearStyles();break;case o.Action.paste:e=this._buffer.paste(t.data);break;case o.Action.cut:e=this._buffer.cut(t.data);break;case o.Action.copy:return this._buffer.copy(t.data),!0;case o.Action.selectAll:}return e?(this._change(),!0):t.action===o.Action.undo?this.undo():t.action===o.Action.redo&&this.redo()},t.prototype.canUndo=function(){return null!==this._changes.prev},t.prototype.canRedo=function(){return null!==this._changes.next},t.prototype.undo=function(){var t=this._changes.prev;return!!t&&(this._editor.setState(t.state),this._changes=t,!0)},t.prototype.redo=function(){var t=this._changes.next;return!!t&&(this._editor.setState(t.state),this._changes=t,!0)},t.prototype.clearChanges=function(){this._changes={prev:null,next:null,state:this._editor.getState()}},t.prototype._change=function(){var t={prev:this._changes,next:null,state:this._editor.getState()};this._changes.next=t,this._changes=t},t}();e.Manager=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(35),o=function(){function t(t){this._editor=t}return t.prototype.copy=function(t){t.preventDefault();var e=this._editor.copy();return this._setBuffer(t,e)},t.prototype.cut=function(t){t.preventDefault();var e=this._editor.cut();return this._setBuffer(t,e)},t.prototype.paste=function(t){var e;if(t.preventDefault(),(e=t.clipboardData?t.clipboardData.getData("text/plain"):window.clipboardData.getData("text"))===this._rawText)return this._editor.paste(this._editorContent,"inner");var n=function(t){if(!t.clipboardData)return;if(-1!==t.clipboardData.types.indexOf("text/html"))return t.clipboardData.getData("text/html")}(t);return n?this._editor.paste(n,"html"):this._editor.paste(e,"text")},t.prototype._setBuffer=function(t,e){return!!e&&(this._rawText=e.raw,this._editorContent=JSON.stringify(e.content),t.clipboardData?(t.clipboardData.setData("text/plain",e.raw),t.clipboardData.setData("text/html",i.serializer(e.content))):window.clipboardData.setData("text",e.raw),!0)},t}();e.TextBuffer=o},function(t,e,n){"use strict";(function(t){var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(4),s=n(87),a=n(2),l=function(){function e(t,e,n){var i=this;this._selectionChange=function(){if(i.isActive()){if(i._selectedText=window.getSelection().toString(),i._ignoreSelection)return;var t=s.stateFromDom(i._editor);if(r.isEqual(t,i._state,!0))return;i._state=t,i._events.fire(a.RichTextEvents.selectionChange,[t])}},this._events=n,this._uid=e,this._editor=t,this.clear(),this._initEvents()}return e.prototype.clear=function(){this._state={range:!1,left:{blockIndex:0,textIndex:0,offset:0}},this._waitUpdate=!0},e.prototype.set=function(t){this._state=t,this._waitUpdate=!0},e.prototype.get=function(){return this._state},e.prototype.getCompact=function(){var t=this._state,e=[[t.left.blockIndex,t.left.textIndex,t.left.offset]];return this._state.range&&e.push([t.right.blockIndex,t.right.textIndex,t.right.offset]),e},e.prototype.setCompact=function(t){var e={left:{blockIndex:t[0][0],textIndex:t[0][1],offset:t[0][2]},range:2===t.length};e.range&&(e.right={blockIndex:t[1][0],textIndex:t[1][1],offset:t[1][2]}),this.set(e)},e.prototype.getPosition=function(e){var n=this;return new t(function(t){if(!n._waitUpdate){var i=n._createRange(e);t(c(i))}var o=new Date;n._events.on(a.RichTextEvents.selectionRefresh,function(){n._events.detach(a.RichTextEvents.selectionRefresh,o);var i=n._createRange(e);t(c(i))},o)})},e.prototype.destructor=function(){document.removeEventListener("selectionchange",this._selectionChange)},e.prototype.isActive=function(){var t=window.getSelection().anchorNode;return o.locate(t,"dhx_widget_id")===this._uid},e.prototype.isFull=function(){var t=this._state,e=t.left,n=t.right;if(!t.range)return!1;var i=this._editor.blocks.length-1,o=this._editor.blocks[i].getBlockEnd();return 0===e.blockIndex&&0===e.textIndex&&0===e.offset&&n.blockIndex===i&&n.textIndex===o.textIndex&&n.offset===o.offset},e.prototype.update=function(){return!this._waitUpdate||this.refresh()},e.prototype.getSelectedText=function(){return this._selectedText},e.prototype.selectAll=function(){var t=this._editor.blocks;this._state={range:!0,left:{blockIndex:0,textIndex:0,offset:0},right:i({blockIndex:t.length-1},t[t.length-1].getBlockEnd())}},e.prototype.refresh=function(){var t,e=this,n=this._state,i=n.left,o=n.right,r=n.range,s=window.getSelection();if(!s)return!1;this._ignoreSelectionTimeout&&clearTimeout(this._ignoreSelectionTimeout),this._ignoreSelection=!0,this._ignoreSelectionTimeout=setTimeout(function(){e._ignoreSelection=!1,e._ignoreSelectionTimeout=null},5),s.rangeCount>0?(t=s.getRangeAt(0),s.removeAllRanges()):t=document.createRange();var l,c=this._editor.getTextElement(i.blockIndex,i.textIndex);if(!c)return!1;if(t.setStart(c,Math.min(i.offset,c.length)),r){if(!(l=this._editor.getTextElement(o.blockIndex,o.textIndex)))return!1;t.setEnd(l,Math.min(o.offset,l.length))}else t.setEnd(c,Math.min(i.offset,c.length));return s.addRange(t),this._waitUpdate=!1,this._events.fire(a.RichTextEvents.selectionRefresh,[]),!0},e.prototype._initEvents=function(){document.addEventListener("selectionchange",this._selectionChange)},e.prototype._createRange=function(t){var e=t.left,n=t.right,i=document.createRange(),o=this._editor.getTextElement(e.blockIndex,e.textIndex);if(i.setStart(o,e.offset),t.range){var r=this._editor.getTextElement(n.blockIndex,n.textIndex);i.setEnd(r,n.offset)}else i.setEnd(o,e.offset);return i},e}();function c(t){var e={},n=t.getBoundingClientRect();return 0===n.height&&(n=t.getClientRects()[0]),e.xStart=n.left+window.pageXOffset,e.yStart=n.top+window.pageYOffset,t.collapse(!1),n=t.getClientRects()[0],e.xEnd=n.left+window.pageXOffset,e.yEnd=n.top+window.pageYOffset,e}e.SelectionHelper=l}).call(this,n(13))},function(t,e,n){"use strict";var i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};Object.defineProperty(e,"__esModule",{value:!0});var o=n(1),r=n(4);e.stateFromDom=function(t){var e,n,s=window.getSelection(),a=s.anchorNode,l=s.anchorOffset,c=s.focusNode,u=s.focusOffset,d=s.isCollapsed,h=a,f=c,p=l,_=u;(function(){var t=window.getSelection(),e=t.anchorNode,n=t.focusNode,i=t.anchorOffset,o=t.focusOffset,r=document.createRange();return r.setStart(e,i),r.setEnd(n,o),r.collapsed})()&&(h=(e=[f,h])[0],f=e[1],p=(n=[_,p])[0],_=n[1]);var v,g=o.locate(h,"dhx_offset"),x=o.locate(f,"dhx_offset"),y=r.hashToInfo(g),m=r.hashToInfo(x);return v=2===y.length?3===h.nodeType?{blockIndex:y[0],textIndex:y[1],offset:p}:{blockIndex:y[0],textIndex:y[1],offset:t.blocks[y[0]].textNodes[y[1]].text.length}:1===y.length?t.blocks[y[0]].textNodes[p]?{blockIndex:y[0],textIndex:p,offset:0}:{blockIndex:y[0],textIndex:p-1,offset:t.blocks[y[0]].textNodes[p-1].text.length}:{blockIndex:p,textIndex:0,offset:0},d?{range:!1,left:v}:{left:v,right:2===m.length?3===f.nodeType?{blockIndex:m[0],textIndex:m[1],offset:_}:{blockIndex:m[0],textIndex:m[1],offset:t.blocks[m[0]].textNodes[m[1]].text.length}:1===m.length?0===_?i({blockIndex:m[0]-1},t.blocks[m[0]-1].getBlockEnd()):{blockIndex:m[0],textIndex:_-1,offset:t.blocks[m[0]].textNodes[_-1].text.length}:i({blockIndex:_-1},t.blocks[_-1].getBlockEnd()),range:!0}}}])}),window.dhx_legacy){if(window.dhx)for(var key in dhx)dhx_legacy[key]=dhx[key];window.dhx=dhx_legacy,delete window.dhx_legacy}
|