diff --git a/README.md b/README.md index 5addbf385..2b09c5952 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Pure javscript based WYSIWYG web editor, with no dependencies - [Load only what you want](#1-load-only-what-you-want) - [Load all plugins](#2-load-all-plugins) - [Plugins can be used directly in the button list](#3-plugins-can-be-used-directly-in-the-button-list) + - [Plugins list](#4-plugins-list) - [Init function](#init-function) - [Use CodeMirror](#use-codemirror) - [Options](#options) @@ -55,13 +56,13 @@ Pure javscript based WYSIWYG web editor, with no dependencies | Yes | Yes | Yes | Yes | Yes | 11+ | ## Install -#### npm +#### Npm ``` sh -$ npm install --save suneditor +$ npm install suneditor --save ``` -#### bower +#### Bower ``` sh -$ bower install --save suneditor +$ bower install suneditor --save ``` #### CDN ``` html @@ -72,32 +73,20 @@ $ bower install --save suneditor ``` [jsdelivr/suneditor](https://www.jsdelivr.com/package/npm/suneditor) -[jsdelivr/suneditor-languages-list](https://www.jsdelivr.com/package/npm/suneditor?path=src%2Flang) - - ## Getting Started -### 1. Include -```html - - - - - -``` - -### 2. Target Element +### 1. Target Element ```html ``` -### 3. Create +### 2. Create ```javascript /** * ID : 'suneditor_sample' * ClassName : 'sun-eidtor' */ // ID or DOM object -const suneditor = SUNEDITOR.create((document.getElementById('sample') || 'sample'),{ +const editor = SUNEDITOR.create((document.getElementById('sample') || 'sample'),{ // All of the plugins are loaded in the "window.SUNEDITOR" object in dist/suneditor.min.js file // Insert options // Language global object (default: en) @@ -105,8 +94,8 @@ const suneditor = SUNEDITOR.create((document.getElementById('sample') || 'sample }); ``` -### 4. Contents display -```text +### 3. Contents display +```java When you display a document created by suneditor You need to include "src/assets/css/suneditor-contents.css" or "dist/css/suneditor.min.css" file. Then add "sun-editor-editable" to the class name of the Tag element that displays the content. @@ -119,26 +108,21 @@ In "suneditor-contents.css", you can define the style of all the tags created in ```javascript import 'suneditor/dist/css/suneditor.min.css' import suneditor from 'suneditor' -import {font, fontSize, fontColor, horizontalRule, list, image} from 'suneditor/src/plugins' + +// How to import plugins +import image from 'suneditor/src/plugins/dialog/link' +import list from 'suneditor/src/plugins/submenu/list' +import {font, video} from 'suneditor/src/plugins' + // How to import language files (default: en) import lang from 'suneditor/src/lang' -import {en, ko} from 'suneditor/src/lang' +import {ko} from 'suneditor/src/lang' import de from 'suneditor/src/lang/de' suneditor.create('sample', { - plugins: [ - font, - fontSize, - fontColor, - horizontalRule, - link, - image, - ], + plugins: [font, video, image, list], buttonList: [ - ['font', 'fontSize'], - ['fontColor'], - ['horizontalRule'], - ['link', 'image'] + ['font', 'video', 'image', 'list'] ], lang: lang.ko }); @@ -160,8 +144,8 @@ suneditor.create('sample', { '/', // Line break ['fontColor', 'hiliteColor'], ['outdent', 'indent'], - ['align', 'horizontalRule', 'list', 'table'], - ['link', 'image', 'video'], + ['align', 'horizontalRule', 'list', 'lineHeight'], + ['table', 'link', 'image', 'video'], ['fullScreen', 'showBlocks', 'codeView'], ['preview', 'print'], ['save', 'template'] @@ -170,14 +154,10 @@ suneditor.create('sample', { // You can also load what you want suneditor.create('sample', { - plugins: [ - plugins.font - plugins.fontSize - ], + plugins: [plugins.font], + // Plugins can be used directly in the button list buttonList: [ - ['font', 'fontSize'], - // Plugins can be used directly in the button list - [plugins.formatBlock] + ['font', plugins.image] ] }) ``` @@ -187,25 +167,27 @@ suneditor.create('sample', { import 'suneditor/dist/css/suneditor.min.css' import suneditor from 'suneditor' import {align, font, fontSize, fontColor, hiliteColor, horizontalRule, - list, table, template, formatBlock, link, image, video} from 'suneditor/src/plugins' + list, lineHeight, table, template, formatBlock, link, image, video} from 'suneditor/src/plugins' suneditor.create('sample', { buttonList: [ - ['undo', 'redo'], + ['undo', 'redo', 'removeFormat'], [font, fontSize, formatBlock], - ['bold', 'underline', 'italic', 'strike', 'subscript', 'superscript'], - ['removeFormat'], [fontColor, hiliteColor], - ['outdent', 'indent'], - [align, horizontalRule, list, table], - [link, image, video], - ['fullScreen', 'showBlocks', 'codeView'], - ['preview', 'print'], - ['save', template] + [align, horizontalRule, list, lineHeight], + [table, link, image, video, template] ], }) ``` +### 4. Plugins list +```javascript +'suneditor/src/plugins/dialog/...' +// image, video, link +'suneditor/src/plugins/submenu/...' +// align, font, fontColor, fontSize, formatBlock, hiliteColor, horizontalRule, lineHeight, list, table, template +``` + ## Init function ```text The init function can be used by predefining options and calling the create function on the returned object. @@ -227,8 +209,8 @@ const initEditor = suneditor.init({ 'removeFormat', 'fontColor', 'hiliteColor', 'outdent', 'indent', - 'align', 'horizontalRule', 'list', 'table', - 'link', 'image', 'video', + 'align', 'horizontalRule', 'list', 'lineHeight', + 'table', 'link', 'image', 'video', 'fullScreen', 'showBlocks', 'codeView', 'preview', 'print', 'save', 'template'] ] @@ -284,6 +266,7 @@ suneditor.create('sample', { ## Options ```java plugins: [ + // Submenu font, fontSize, formatBlock, @@ -294,6 +277,7 @@ plugins: [ list, table, template, + // Dialog link, image, video @@ -363,15 +347,16 @@ fontSize : Change default font-size array. default: [.. Default value: [ 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 ] +fontSizeUnit : The font size unit. default: 'px' {String} formats : Change default formatBlock array. default: [...] {Array} Default value: [ - 'p', 'div', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' + 'p', 'div', 'blockquote', 'pre', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ], Custom: [{ - tag: 'div', // Tag name - class: '__se__xxx' || null, // Class names must always begin with "__se__" - title: 'Custom div' || null, // default: tag name - command: 'replace' || 'range' // default: "replace" + tag: 'div', // Tag name + class: '__se__xxx' || null, // Class names must always begin with "__se__" + title: 'Custom div' || null, // default: tag name + command: 'replace' || 'range' // default: "replace" }] colorList : Change default color array of color picker. default: [..[..]..] {Array} Default value: [ @@ -386,6 +371,17 @@ colorList : Change default color array of color picker. default: [.. ['#ccc', '#dedede', 'OrangeRed', 'Orange', 'RoyalBlue', 'SaddleBrown'], // Line break ['SlateGray', 'BurlyWood', 'DeepPink', 'FireBrick', 'Gold', 'SeaGreen'] ] +lineHeights : Change default line-height array. default: [{}..] {Array} + Default value: [ + {text: '1', value: 1}, + {text: '1.15', value: 1.15}, + {text: '1.5', value: 1.5}, + {text: '2', value: 2} + ] + ex) [ + {text: 'Single', value: 1}, + {text: 'Double', value: 2} + ] // Image--------------------------------------------------------------------------------------------------------- imageResizing : Can resize the image. default: true {Boolean} @@ -450,8 +446,8 @@ buttonList : Defines button list to array {Array} // '/', Line break // ['fontColor', 'hiliteColor'], ['outdent', 'indent'], - // ['align', 'horizontalRule', 'list', 'table'], - // ['link', 'image', 'video'], + // ['align', 'horizontalRule', 'list', 'lineHeight'], + // ['table', 'link', 'image', 'video'], ['fullScreen', 'showBlocks', 'codeView'], ['preview', 'print'], // ['save', 'template'], diff --git a/bower.json b/bower.json index 8cdf677d2..e7f1edbd6 100644 --- a/bower.json +++ b/bower.json @@ -1,20 +1,21 @@ { "name": "suneditor", - "version": "2.20.1", + "version": "2.21.0", "description": "Pure JavaScript based WYSIWYG web editor", "main": "src/suneditor.js", "keywords": [ "wysiwyg", - "editor", "wysiwyg editor", + "wysiwyg html editor", "rich text", "rich editor", "rich text editor", - "web", "html", + "text", + "editor", "contenteditable", - "suneditor", - "javascript" + "javascript", + "vanillajs" ], "author": "JiHong.Lee", "license": "MIT", diff --git a/dist/css/suneditor.min.css b/dist/css/suneditor.min.css index 7871bd160..298807236 100644 --- a/dist/css/suneditor.min.css +++ b/dist/css/suneditor.min.css @@ -1 +1 @@ -.sun-editor{width:auto;height:auto;box-sizing:border-box;font-family:Helvetica Neue,sans-serif;border:1px solid #dadada;text-align:left;background-color:#fff;color:#000;user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor *{box-sizing:border-box;-webkit-user-drag:none;overflow:visible}.sun-editor-common button,.sun-editor-common input,.sun-editor-common select,.sun-editor-common textarea{font-size:14px;line-height:1.5}.sun-editor-common blockquote,.sun-editor-common body,.sun-editor-common button,.sun-editor-common code,.sun-editor-common dd,.sun-editor-common div,.sun-editor-common dl,.sun-editor-common dt,.sun-editor-common fieldset,.sun-editor-common form,.sun-editor-common h1,.sun-editor-common h2,.sun-editor-common h3,.sun-editor-common h4,.sun-editor-common h5,.sun-editor-common h6,.sun-editor-common input,.sun-editor-common legend,.sun-editor-common li,.sun-editor-common ol,.sun-editor-common p,.sun-editor-common pre,.sun-editor-common select,.sun-editor-common td,.sun-editor-common textarea,.sun-editor-common th,.sun-editor-common ul{margin:0;padding:0;border:0}.sun-editor-common dl,.sun-editor-common li,.sun-editor-common menu,.sun-editor-common ol,.sun-editor-common ul{list-style:none!important}.sun-editor-common hr{margin:6px 0!important}.sun-editor textarea{resize:none!important;border:0!important}.sun-editor button{border:0;background-color:transparent;touch-action:manipulation;cursor:pointer;outline:none}.sun-editor button,.sun-editor input,.sun-editor select,.sun-editor textarea{vertical-align:middle}.sun-editor button span{display:block;margin:0;padding:0}.sun-editor button .txt{display:block;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@font-face{font-family:Suneditor-icon;src:url(../fonts/655623c4c2d6d9092ba9f381e4042e8f.eot);src:url(../fonts/655623c4c2d6d9092ba9f381e4042e8f.eot?#iefix) format("embedded-opentype"),url(../fonts/688522218ec6987e6fada6a165d490d7.woff2) format("woff2"),url(../fonts/8a2aa4c9fcb1e8fbf45305679b8f7a0e.woff) format("woff"),url(../fonts/d314a75b315393089036e8be6f1e5965.ttf) format("truetype"),url(../fonts/52b28fecb3b9616a5154d0226058600e.svg#Glyphter) format("svg");font-weight:400;font-style:normal}.sun-editor [class*=se-icon-]:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Suneditor-icon;display:inline-block;font-style:normal;font-variant:normal;font-weight:400;text-rendering:auto;font-size:15px}.sun-editor .se-toolbar [class*=se-icon-]:before{line-height:2.1}.sun-editor .se-icon-align-justify:before{content:"A"}.sun-editor .se-icon-align-left:before{content:"B"}.sun-editor .se-icon-align-right:before{content:"C"}.sun-editor .se-icon-align-center:before{content:"D"}.sun-editor .se-icon-underline:before{content:"E"}.sun-editor .se-icon-bold:before{content:"F"}.sun-editor .se-icon-italic:before{content:"G"}.sun-editor .se-icon-strokethrough:before{content:"H"}.sun-editor .se-icon-subscript:before{content:"I"}.sun-editor .se-icon-superscript:before{content:"J"}.sun-editor .se-icon-redo:before{content:"K"}.sun-editor .se-icon-undo:before{content:"L"}.sun-editor .se-icon-erase:before{content:"M"}.sun-editor .se-icon-fontColor:before{content:"N"}.sun-editor .se-icon-hiliteColor:before{content:"O"}.sun-editor .se-icon-indent-left:before{content:"P"}.sun-editor .se-icon-indent-right:before{content:"Q"}.sun-editor .se-icon-list-bullets:before{content:"R"}.sun-editor .se-icon-list-number:before{content:"S"}.sun-editor .se-icon-grid:before{content:"T"}.sun-editor .se-icon-code-view:before{content:"U"}.sun-editor .se-icon-preview:before{content:"V"}.sun-editor .se-icon-showBlocks:before{content:"W"}.sun-editor .se-icon-expansion:before{content:"X"}.sun-editor .se-icon-reduction:before{content:"Y"}.sun-editor .se-icon-image:before{content:"Z"}.sun-editor .se-icon-link:before{content:"a"}.sun-editor .se-icon-sun:before{content:"b"}.sun-editor .se-icon-print:before{content:"c"}.sun-editor .se-icon-modify:before{content:"d"}.sun-editor .se-icon-revert:before{content:"e"}.sun-editor .se-icon-arrow-down:before{content:"f";font-size:10px}.sun-editor .se-icon-video:before{content:"g"}.sun-editor .se-icon-cancel:before{content:"h";font-size:10px}.sun-editor .se-icon-warning:before{content:"i"}.sun-editor .se-icon-insert-column-right:before{content:"j"}.sun-editor .se-icon-insert-row-below:before{content:"k"}.sun-editor .se-icon-insert-row-above:before{content:"l"}.sun-editor .se-icon-insert-column-left:before{content:"m"}.sun-editor .se-icon-delete-row:before{content:"n"}.sun-editor .se-icon-delete-column:before{content:"o"}.sun-editor .se-icon-quote:before{content:"p"}.sun-editor .se-icon-empty-file:before{content:"q"}.sun-editor .se-icon-paragraph:before{content:"r"}.sun-editor .se-icon-delete:before{content:"s"}.sun-editor .se-icon-rotate-left:before{content:"t"}.sun-editor .se-icon-rotate-right:before{content:"u"}.sun-editor .se-icon-mirror-horizontal:before{content:"v"}.sun-editor .se-icon-mirror-vertical:before{content:"w"}.sun-editor .se-icon-save:before{content:"x"}.sun-editor .se-icon-hr:before{content:"y"}.sun-editor .se-icon-checked:before{content:"z"}.sun-editor .se-icon-table-header:before{content:"0"}.sun-editor .se-icon-merge-cell:before{content:"1"}.sun-editor .se-icon-split-cell:before{content:"2"}.sun-editor .se-icon-caption:before{content:"3"}.sun-editor .se-icon-edit:before{content:"4"}.sun-editor .se-icon-question:before{content:"5"}.sun-editor .se-icon-attachment:before{content:"6"}.sun-editor .se-icon-add:before{content:"7"}.sun-editor .se-icon-more-vertical:before{content:"8"}.sun-editor .se-icon-more-horizontal:before{content:"9"}.sun-editor .se-icon-map-pin:before{content:"!"}.sun-editor .se-icon-magic-stick:before{content:'"'}.sun-editor .se-icon-math:before{content:"#"}.sun-editor .se-icon-audio:before{content:"$"}.sun-editor .se-icon-emoji:before{content:"%"}.sun-editor .se-icon-template:before{content:"&"}.sun-editor .se-arrow,.sun-editor .se-arrow:after{position:absolute;display:block;width:0;height:0;border:11px solid transparent}.sun-editor .se-arrow.se-arrow-up{top:-11px;left:20px;margin-left:-11px;border-top-width:0;border-bottom-color:rgba(0,0,0,.25)}.sun-editor .se-arrow.se-arrow-up:after{top:1px;margin-left:-11px;content:" ";border-top-width:0;border-bottom-color:#fff}.sun-editor .se-toolbar .se-arrow.se-arrow-up:after{border-bottom-color:#fafafa}.sun-editor .se-arrow.se-arrow-down{top:0;left:0;margin-left:-11px;border-bottom-width:0;border-top-color:rgba(0,0,0,.25)}.sun-editor .se-arrow.se-arrow-down:after{top:-12px;margin-left:-11px;content:" ";border-bottom-width:0;border-top-color:#fff}.sun-editor .se-toolbar .se-arrow.se-arrow-down:after{border-top-color:#fafafa}.sun-editor .se-container{position:relative;width:100%;height:100%}.sun-editor button{color:#000}.sun-editor .se-btn{float:left;width:35px;height:35px;border:0;border-radius:2px;margin:1px!important;padding:0;font-size:12px;line-height:27px}.sun-editor .se-btn:enabled:focus,.sun-editor .se-btn:enabled:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-btn-primary{color:#000;background-color:#c7deff;border:1px solid #80bdff;border-radius:2px}.sun-editor .se-btn-primary:focus,.sun-editor .se-btn-primary:hover{color:#000;background-color:#80bdff;border-color:#3f9dff;outline:0 none}.sun-editor .se-btn-primary:active{color:#fff;background-color:#3f9dff;border-color:#4592ff;-webkit-box-shadow:inset 0 3px 5px #4592ff;box-shadow:inset 0 3px 5px #4592ff}.sun-editor .se-btn:enabled.active{color:#4592ff;outline:0 none}.sun-editor .se-btn:enabled.active:focus,.sun-editor .se-btn:enabled.active:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled.active:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-btn:enabled.on{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled.on:focus,.sun-editor .se-btn:enabled.on:hover{background-color:#d1d1d1;border-color:#c1c1c1;outline:0 none}.sun-editor .se-btn:enabled.on:active{background-color:#c1c1c1;border-color:#b1b1b1;-webkit-box-shadow:inset 0 3px 5px #b1b1b1;box-shadow:inset 0 3px 5px #b1b1b1}.sun-editor .se-btn-list:disabled,.sun-editor .se-btn:disabled,.sun-editor :disabled [class*=se-icon-]:before{cursor:default;background-color:inherit;color:#bdbdbd}.sun-editor .se-loading-box{position:absolute;display:none;width:100%;height:100%;top:0;left:0;background-color:#fff;opacity:.7;filter:alpha(opacity=70);z-index:2147483647}.sun-editor .se-loading-box .se-loading-effect{position:absolute;display:block;top:50%;left:50%;height:25px;width:25px;border-top:2px solid #07d;border-right:2px solid transparent;border-radius:50%;animation:spinner .8s linear infinite;margin:-25px 0 0 -25px}.sun-editor .se-toolbar{display:block;position:relative;height:auto;width:100%;overflow:visible;padding:4px 3px 0;margin:0;background-color:#fafafa;outline:1px solid #dadada;z-index:5}.sun-editor .se-toolbar-cover{position:absolute;display:none;font-size:36px;width:100%;height:100%;top:0;left:0;background-color:#fefefe;opacity:.5;filter:alpha(opacity=50);cursor:not-allowed;z-index:4}.sun-editor .se-toolbar-separator-vertical{display:inline-block;height:31px;width:1px;margin:2px;vertical-align:top}.sun-editor .se-toolbar.se-toolbar-balloon,.sun-editor .se-toolbar.se-toolbar-inline{display:none;position:absolute;z-index:2147483647;box-shadow:0 3px 9px rgba(0,0,0,.5);-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5)}.sun-editor .se-toolbar.se-toolbar-balloon{width:auto}.sun-editor .se-toolbar.se-toolbar-sticky{position:fixed;top:0}.sun-editor .se-toolbar-sticky-dummy{display:none;position:static;z-index:-1}.sun-editor .se-btn-module{display:inline-block}.sun-editor .se-btn-module-border{border:1px solid #dadada;border-radius:2px}.sun-editor .se-btn-module-enter{display:block;width:100%;height:1px;margin-bottom:5px;background-color:transparent}.sun-editor .se-menu-list,.sun-editor .se-menu-list li{float:left;padding:0;margin:0}.sun-editor .se-menu-list li{position:relative}.sun-editor .se-btn-select{width:auto;display:flex;text-align:left;padding:4px 6px}.sun-editor .se-btn-select .txt{flex:5;float:left;text-align:left}.sun-editor .se-btn-select .se-icon-arrow-down{flex:1;float:right}.sun-editor .se-btn-select.se-btn-tool-font{width:100px}.sun-editor .se-btn-select.se-btn-tool-format,.sun-editor .se-btn-select.se-btn-tool-size{width:80px}.sun-editor .se-list-layer{display:none;position:absolute;top:37px;z-index:4;left:1px;border:1px solid #bababa;border-radius:2px;background-color:#fff;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0 none}.sun-editor .se-list-layer .se-list-inner{padding:0;margin:0;overflow-x:initial;overflow-y:initial;overflow:visible}.sun-editor .se-list-layer button{margin:0;width:100%}.sun-editor .se-list-inner .se-list-basic{width:100%;padding:0}.sun-editor .se-list-inner .se-list-basic li{width:100%}.sun-editor .se-list-inner .se-list-basic li>button{min-width:100%;width:max-content}.sun-editor .se-list-inner .se-list-basic li button.active{background-color:#80bdff;border:1px solid #3f9dff;border-left:0;border-right:0}.sun-editor .se-list-inner .se-list-basic li button.active:active{background-color:#3f9dff;border:1px solid #4592ff;border-left:0;border-right:0;-webkit-box-shadow:inset 0 3px 5px #4592ff;box-shadow:inset 0 3px 5px #4592ff}.sun-editor .se-btn-list{width:100%;height:32px;padding:0 14px;cursor:pointer;font-size:12px;line-height:22px;text-indent:0;text-decoration:none;text-align:left}.sun-editor .se-btn-list.default_value{background-color:#f3f3f3;border-top:1px dotted #b1b1b1;border-bottom:1px dotted #b1b1b1}.sun-editor .se-btn-list:focus,.sun-editor .se-btn-list:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn-list:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-list-layer .se-list-font-family{min-width:156px}.sun-editor .se-list-layer .se-list-font-family .default{border-bottom:1px solid #ccc}.sun-editor .se-list-layer .se-list-format{min-width:156px}.sun-editor .se-list-layer .se-list-format li{padding:0;width:100%}.sun-editor .se-list-layer .se-list-format .se-btn-list{height:auto;min-height:32px;line-height:100%}.sun-editor .se-list-layer .se-list-format .se-btn-list[data-value=h1]{height:40px}.sun-editor .se-list-layer .se-list-format .se-btn-list[data-value=h2]{height:34px}.sun-editor .se-list-layer .se-list-format div,.sun-editor .se-list-layer .se-list-format p{font-size:13px;margin:0;padding:0}.sun-editor .se-list-layer .se-list-format h1{font-size:2em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h2{font-size:1.5em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h3{font-size:1.17em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h4{font-size:1em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h5{font-size:.83em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h6{font-size:.67em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format blockquote{font-size:13px;color:#999;height:22px;margin:0;background-color:transparent;line-height:1.5;border-color:#b1b1b1;padding:0 0 0 7px;border-left:5px #b1b1b1;border-style:solid}.sun-editor .se-list-layer .se-list-format pre{font-size:13px;color:#666;padding:4px 11px;margin:0;background-color:#f9f9f9;border:1px solid #e1e1e1;border-radius:2px}.sun-editor .se-list-layer .se-list-font-size{min-width:140px;max-height:300px;overflow-x:hidden;overflow-y:auto}.sun-editor .se-list-layer .se-list-font-size .se-btn-list{height:auto;min-height:32px;line-height:normal}.sun-editor .se-list-layer .se-list-line{width:125px}.sun-editor .se-list-layer .se-list-align{left:9px;width:125px}.sun-editor .se-list-layer .se-list-align .se-btn-align>span{display:inline-block;width:14px;height:32px;margin:-1px 10px 0 0;vertical-align:middle}.sun-editor .se-selector-table{display:none;position:absolute;top:34px;left:1px;z-index:4;padding:5px 0;float:left;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border-radius:2px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.sun-editor .se-selector-table .se-table-size{font-size:18px;padding:0 5px}.sun-editor .se-selector-table .se-table-size-picker{position:absolute!important;z-index:3;font-size:18px;width:10em;height:10em;cursor:pointer}.sun-editor .se-selector-table .se-table-size-highlighted{position:absolute!important;z-index:2;font-size:18px;width:1em;height:1em;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADJmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo4QTZCNzMzN0I3RUYxMUU4ODcwQ0QwMjM1NTgzRTJDNyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo4QTZCNzMzNkI3RUYxMUU4ODcwQ0QwMjM1NTgzRTJDNyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MzYyNEUxRUI3RUUxMUU4ODZGQzgwRjNBODgyNTdFOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MzYyNEUxRkI3RUUxMUU4ODZGQzgwRjNBODgyNTdFOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pl0yAuwAAABBSURBVDhPY/wPBAxUAGCDGvdBeWSAeicIDTfIXREiQArYeR9hEBOEohyMGkQYjBpEGAxjg6ib+yFMygCVvMbAAABj0hwMTNeKJwAAAABJRU5ErkJggg==") repeat}.sun-editor .se-selector-table .se-table-size-unhighlighted{position:relative!important;z-index:1;font-size:18px;width:5em;height:5em;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC") repeat}.sun-editor .se-selector-table .se-table-size-display{padding-left:5px}.sun-editor .se-list-layer .se-selector-color{display:flex;width:max-content;max-width:270px;height:auto;padding:0;margin:auto}.sun-editor .se-list-layer .se-selector-color .se-color-pallet{width:100%;height:100%;padding:0}.sun-editor .se-list-layer .se-selector-color .se-color-pallet li{display:flex;float:left;position:relative;margin:0}.sun-editor .se-list-layer .se-selector-color .se-color-pallet button{display:block;cursor:default;width:30px;height:30px;text-indent:-9999px}.sun-editor .se-list-layer .se-selector-color .se-color-pallet button.active,.sun-editor .se-list-layer .se-selector-color .se-color-pallet button:focus,.sun-editor .se-list-layer .se-selector-color .se-color-pallet button:hover{border:3px solid #fff}.sun-editor .se-submenu-form-group{display:flex;width:100%;height:auto;padding:4px}.sun-editor .se-submenu-form-group input{flex:auto;display:inline-block;width:72px;height:33px;color:#555;font-size:12px;margin:1px 0;padding:0;border-radius:.25rem;border-bottom:2px solid #b1b1b1;outline:none;text-transform:uppercase}.sun-editor .se-submenu-form-group input:focus{outline:none;border-bottom:3px solid #b1b1b1}.sun-editor .se-submenu-form-group button{float:right;width:35px;height:35px;padding:0;margin:0 0 0 4px!important}.sun-editor .se-submenu-form-group button.se-btn{border:1px solid #ccc}.sun-editor .se-wrapper{position:relative!important;width:100%;height:auto;overflow:hidden;z-index:1}.sun-editor .se-wrapper .se-wrapper-inner{width:100%;height:100%;overflow-y:auto;overflow-x:auto;-webkit-overflow-scrolling:touch;user-select:text;-o-user-select:text;-moz-user-select:text;-khtml-user-select:text;-webkit-user-select:text;-ms-user-select:text}.sun-editor .se-wrapper .se-wrapper-inner:focus{outline:none}.sun-editor .se-wrapper .se-wrapper-code{background-color:#191919;color:#fff;font-size:13px;word-break:break-all;padding:0;margin:0}.sun-editor .se-wrapper .se-wrapper-wysiwyg{background-color:#fff}.sun-editor .se-wrapper .se-wrapper-code-mirror{font-size:13px}.sun-editor .se-wrapper .se-placeholder{position:absolute;display:none;white-space:nowrap;text-overflow:ellipsis;z-index:1;color:#b1b1b1;font-size:13px;line-height:1.5;top:0;left:0;right:0;overflow:hidden;margin-top:0;padding-top:16px;padding-left:16px;margin-left:0;padding-right:16px;margin-right:0;pointer-events:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden}.sun-editor .se-resizing-bar{display:flex;width:auto;height:auto;min-height:16px;border-top:1px solid #dadada;padding:0 4px;background-color:#fafafa;cursor:ns-resize}.sun-editor .se-resizing-bar.se-resizing-none{cursor:default}.sun-editor .se-resizing-back{position:absolute;display:none;cursor:ns-resize;top:0;left:0;width:100%;height:100%;z-index:2147483647}.sun-editor .se-resizing-bar .se-navigation{flex:auto;position:relative;width:auto;height:auto;color:#666;margin:0;padding:0;font-size:10px;font-weight:700;line-height:1.5;background:transparent}.sun-editor .se-resizing-bar .se-char-counter-wrapper{flex:none;position:relative;display:block;width:auto;height:auto;margin:0;padding:0;font-size:10px;background:transparent}.sun-editor .se-resizing-bar .se-char-counter-wrapper span{color:#999;font-size:13px;font-family:Helvetica Neue,sans-serif}.sun-editor .se-resizing-bar .se-char-counter.se-blink{color:#b94a48;animation:blinker .2s linear infinite}.sun-editor .se-dialog{position:absolute;display:none;top:0;left:0;width:100%;height:100%;z-index:2147483647}.sun-editor .se-dialog button,.sun-editor .se-dialog input,.sun-editor .se-dialog label{font-size:14px;line-height:1.5;color:#111;margin:0}.sun-editor .se-dialog .se-dialog-back{background-color:#222;opacity:.5}.sun-editor .se-dialog .se-dialog-back,.sun-editor .se-dialog .se-dialog-inner{position:absolute;width:100%;height:100%;top:0;left:0}.sun-editor .se-dialog .se-dialog-inner .se-modal-title{font-size:14px;font-weight:700;margin:0;padding:0;line-height:1.5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content{position:relative;width:500px;margin:20px auto;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:2px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}@media screen and (max-width:509px){.sun-editor .se-dialog .se-dialog-inner .se-dialog-content{width:100%}}.sun-editor .se-dialog .se-dialog-inner .se-dialog-header{height:50px;padding:15px 15px 5px;border-bottom:1px solid #e5e5e5}.sun-editor .se-dialog .se-dialog-inner button.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#666;padding:0!important;margin:0!important;background:transparent;border:0;text-shadow:0 1px 0 #fff;-webkit-appearance:none;filter:alpha(opacity=100);opacity:1}.sun-editor .se-dialog .se-dialog-inner button.close:focus,.sun-editor .se-dialog .se-dialog-inner button.close:hover{color:#000}.sun-editor .se-dialog .se-dialog-inner .se-dialog-body{position:relative;padding:15px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form{margin-bottom:10px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer{margin-top:10px}.sun-editor .se-dialog .se-dialog-inner input:disabled{background-color:#f3f3f3}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text{width:100%}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text .size-h,.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text .size-w{width:70px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-x{margin:0 8px;width:25px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content .se-btn-primary{display:inline-block;padding:6px 12px;margin:0 0 10px!important;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;border-radius:2px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer{padding:10px 15px 0;text-align:right;border-top:1px solid #e5e5e5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer>div{float:left}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer>div>label{margin-top:5px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-radio{margin-left:12px;margin-right:6px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-check{margin-left:12px;margin-right:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer .se-dialog-btn-check{margin-left:0;margin-right:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-control{display:inline-block;width:70px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-control,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form{height:34px;font-size:14px;line-height:1.42857143;color:#555;border:1px solid #ccc;border-radius:2px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form{display:block;width:100%;padding:0 4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-control:focus,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form:focus{border-color:#80bdff;outline:0;-webkit-box-shadow:0 0 0 .2rem #c7deff;box-shadow:0 0 0 .2rem #c7deff}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert{border:1px solid #ccc}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-dialog-tabs{width:100%;height:25px;border-bottom:1px solid #e5e5e5}.sun-editor .se-dialog-tabs button{background-color:#e5e5e5;border-right:1px solid #e5e5e5;float:left;outline:none;padding:2px 13px;transition:.3s}.sun-editor .se-dialog-tabs button:hover{background-color:#fff}.sun-editor .se-dialog-tabs button.active{background-color:#fff;border-bottom:0}.sun-editor .se-controller .se-arrow.se-arrow-up{border-bottom-color:rgba(0,0,0,.25)}.sun-editor .se-controller{position:absolute;display:none;overflow:visible;z-index:6;border:1px solid rgba(0,0,0,.25);border-radius:2px;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.sun-editor .se-controller .se-btn-group{position:relative;display:flex;vertical-align:middle;padding:2px 2px 2px 0;top:0;left:0}.sun-editor .se-controller .se-btn-group .se-btn-group-sub{left:50%;min-width:auto;width:max-content;display:none}.sun-editor .se-controller .se-btn-group .se-btn-group-sub button{margin:0;min-width:72px}.sun-editor .se-controller .se-btn-group button{position:relative;min-height:35px;height:auto;border:none;border-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;margin:0 0 0 2px;padding:5px 10px;font-size:12px;line-height:1.5;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation}.sun-editor .se-controller .se-btn-group button:focus:enabled,.sun-editor .se-controller .se-btn-group button:hover:enabled{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:active:enabled{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-controller .se-btn-group button span{display:block;padding:0;margin:0}.sun-editor .se-controller .se-btn-group button:enabled.active{color:#4592ff;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.active:focus,.sun-editor .se-controller .se-btn-group button:enabled.active:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.active:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-controller .se-btn-group button:enabled.on{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.on:focus,.sun-editor .se-controller .se-btn-group button:enabled.on:hover{background-color:#d1d1d1;border-color:#c1c1c1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.on:active{background-color:#c1c1c1;border-color:#b1b1b1;-webkit-box-shadow:inset 0 3px 5px #b1b1b1;box-shadow:inset 0 3px 5px #b1b1b1}.sun-editor .se-controller-resizing{margin-top:-50px!important;padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-controller-resizing .se-btn-group .se-btn-group-sub.se-resizing-align-list{left:57px}.sun-editor .se-resizing-container{position:absolute;display:none;z-index:6;border:1px solid #80bdff}.sun-editor .se-resizing-container .se-modal-resize{position:absolute;display:inline-block;background-color:#3f9dff;opacity:.3}.sun-editor .se-resizing-container .se-resize-dot{position:absolute;top:0;left:0;width:100%;height:100%}.sun-editor .se-resizing-container .se-resize-dot>span{position:absolute;width:7px;height:7px;background-color:#3f9dff;border:1px solid #4592ff}.sun-editor .se-resizing-container .se-resize-dot>span.tl{top:-5px;left:-5px;cursor:nw-resize}.sun-editor .se-resizing-container .se-resize-dot>span.tr{top:-5px;right:-5px;cursor:ne-resize}.sun-editor .se-resizing-container .se-resize-dot>span.bl{bottom:-5px;left:-5px;cursor:sw-resize}.sun-editor .se-resizing-container .se-resize-dot>span.br{right:-5px;bottom:-5px;cursor:se-resize}.sun-editor .se-resizing-container .se-resize-dot>span.lw{left:-7px;bottom:50%;cursor:w-resize}.sun-editor .se-resizing-container .se-resize-dot>span.th{left:50%;top:-7px;cursor:n-resize}.sun-editor .se-resizing-container .se-resize-dot>span.rw{right:-7px;bottom:50%;cursor:e-resize}.sun-editor .se-resizing-container .se-resize-dot>span.bh{right:50%;bottom:-7px;cursor:s-resize}.sun-editor .se-resizing-container .se-resize-display{position:absolute;right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;border-radius:2px}.sun-editor .se-controller-table,.sun-editor .se-controller-table-cell{width:auto}.sun-editor .se-controller-link,.sun-editor .se-controller-table,.sun-editor .se-controller-table-cell{padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-controller-link:after,.sun-editor .se-controller-link:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sun-editor .se-controller-link .link-content{padding:0;margin:0}.sun-editor .se-controller-link .link-content a{display:inline-block;color:#4592ff;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;margin-left:5px}.sun-editor .se-notice{position:relative;display:none;width:100%;height:auto;word-break:break-all;font-size:13px;color:#b94a48;background-color:#f2dede;padding:15px;margin:0;border:1px solid #eed3d7;user-select:text;-o-user-select:text;-moz-user-select:text;-khtml-user-select:text;-webkit-user-select:text;-ms-user-select:text}.sun-editor .se-notice button{float:right}.sun-editor .se-tooltip{position:relative;overflow:visible}.sun-editor .se-tooltip .se-tooltip-inner{visibility:hidden;position:absolute;display:block;width:auto;top:120%;left:50%;background:transparent;opacity:0;z-index:1;line-height:1.5;transition:opacity .5s;margin:0;padding:0;bottom:auto;float:none;pointer-events:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden}.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text{position:relative;display:inline-block;width:auto;left:-50%;font-size:.9em;margin:0;padding:4px 6px;border-radius:2px;background-color:#333;color:#fff;text-align:center;line-height:unset;white-space:nowrap;cursor:auto}.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text:after{content:"";position:absolute;bottom:100%;left:50%;margin-left:-5px;border:5px solid transparent;border-bottom-color:#333}.sun-editor .se-tooltip:hover .se-tooltip-inner{visibility:visible;opacity:1}.se-show-block div,.se-show-block h1,.se-show-block h2,.se-show-block h3,.se-show-block h4,.se-show-block h5,.se-show-block h6,.se-show-block p{border:1px dashed #3f9dff;padding:10px 8px 8px}.se-show-block p{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPAQMAAAAF7dc0AAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAaSURBVAjXY/j/gwGCPvxg+F4BQiAGDP1HQQByxxw0gqOzIwAAAABJRU5ErkJggg==") no-repeat}.se-show-block div{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAPAQMAAAAxlBYoAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAmSURBVAjXY/j//wcDDH+8XsHwDYi/hwNx1A8w/nYLKH4XoQYJAwCXnSgcl2MOPgAAAABJRU5ErkJggg==") no-repeat}.se-show-block h1{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAfSURBVAjXY/j/v4EBhr+9B+LzEPrDeygfhI8j1CBhAEhmJGY4Rf6uAAAAAElFTkSuQmCC") no-repeat}.se-show-block h2{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAmSURBVAjXY/j/v4EBhr+dB+LtQPy9geEDEH97D8T3gbgdoQYJAwA51iPuD2haEAAAAABJRU5ErkJggg==") no-repeat}.se-show-block h3{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j/v4EBhr+dB+LtQPy9geHDeQgN5p9HqEHCADeWI+69VG2MAAAAAElFTkSuQmCC") no-repeat}.se-show-block h4{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPAQMAAADTSA1RAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j//wADDH97DsTXIfjDdiDdDMTfIRhZHRQDAKJOJ6L+K3y7AAAAAElFTkSuQmCC") no-repeat}.se-show-block h5{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAlSURBVAjXY/j/v4EBhr+1A/F+IO5vYPiwHUh/B2IQfR6hBgkDABlWIy5uM+9GAAAAAElFTkSuQmCC") no-repeat}.se-show-block h6{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j/v4EBhr+dB+LtQLy/geFDP5S9HSKOrA6KAR9GIza1ptJnAAAAAElFTkSuQmCC") no-repeat}.sun-editor-editable table td.se-table-selected-cell,.sun-editor-editable table th.se-table-selected-cell{border:1px double #4592ff;background-color:#f1f7ff}.sun-editor-editable.se-disabled{user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor-editable[contenteditable=true] figure:after{position:absolute;content:"";z-index:1;top:0;left:0;right:0;bottom:0;cursor:default;display:block;background:transparent}.sun-editor-editable[contenteditable=true] figure a,.sun-editor .se-wrapper .sun-editor-editable[contenteditable=true] figure img{z-index:0}.sun-editor-editable[contenteditable=true] figure figcaption{z-index:2}@keyframes blinker{50%{opacity:0}}@keyframes spinner{to{transform:rotate(1turn)}}.sun-editor-editable{font-family:Helvetica Neue,sans-serif;font-size:13px;line-height:1.5;color:#333;text-align:left;background-color:#fff;word-break:normal;word-wrap:break-word;padding:16px;margin:0}.sun-editor-editable *{font-family:inherit;font-size:inherit;color:inherit;background-color:inherit;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sun-editor-editable audio,.sun-editor-editable figcaption,.sun-editor-editable figure,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable td,.sun-editor-editable th,.sun-editor-editable video{position:relative}.sun-editor-editable audio,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable video{display:block;margin:0;padding:0;max-width:100%}.sun-editor-editable .__se__float-left{float:left}.sun-editor-editable .__se__float-right{float:right}.sun-editor-editable .__se__float-center{float:center}.sun-editor-editable .__se__float-none{float:none}.sun-editor-editable span{display:inline;vertical-align:baseline;margin:0;padding:0}.sun-editor-editable a{color:#004cff;text-decoration:none}.sun-editor-editable a:focus,.sun-editor-editable a:hover{cursor:pointer;color:#0093ff;text-decoration:underline}.sun-editor-editable pre{display:block;padding:8px;margin:0 0 10px;line-height:1.45;color:#666;background-color:#f9f9f9;border:1px solid #e1e1e1;border-radius:2px;overflow:auto}.sun-editor-editable ol{list-style-type:decimal}.sun-editor-editable ol,.sun-editor-editable ul{display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0;margin-inline-end:0;padding-inline-start:40px}.sun-editor-editable ul{list-style-type:disc}.sun-editor-editable li{display:list-item;text-align:-webkit-match-parent;margin-bottom:5px}.sun-editor-editable sub,.sun-editor-editable sup{font-size:75%;line-height:0}.sun-editor-editable sub{vertical-align:sub}.sun-editor-editable sup{vertical-align:super}.sun-editor-editable p{display:block;margin:0 0 10px}.sun-editor-editable div{display:block;margin:0;padding:0}.sun-editor-editable blockquote{display:block;color:#999;margin-block-start:1em;margin-block-end:1em;margin-inline-start:40px;margin-inline-end:40px;border-style:solid;padding:0 5px 0 20px;border-width:0 0 0 5px;border-color:#b1b1b1}.sun-editor-editable blockquote blockquote{border-color:#c1c1c1}.sun-editor-editable blockquote blockquote blockquote{border-color:#d1d1d1}.sun-editor-editable blockquote blockquote blockquote blockquote{border-color:#e1e1e1}.sun-editor-editable h1{font-size:2em;margin-block-start:.67em;margin-block-end:.67em}.sun-editor-editable h1,.sun-editor-editable h2{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h2{font-size:1.5em;margin-block-start:.83em;margin-block-end:.83em}.sun-editor-editable h3{font-size:1.17em;margin-block-start:1em;margin-block-end:1em}.sun-editor-editable h3,.sun-editor-editable h4{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h4{font-size:1em;margin-block-start:1.33em;margin-block-end:1.33em}.sun-editor-editable h5{font-size:.83em;margin-block-start:1.67em;margin-block-end:1.67em}.sun-editor-editable h5,.sun-editor-editable h6{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h6{font-size:.67em;margin-block-start:2.33em;margin-block-end:2.33em}.sun-editor-editable hr{display:block;border-width:1px 0 0;border-color:#000;border-image:initial;height:1px}.sun-editor-editable hr.__se__solid{border-style:solid none none}.sun-editor-editable hr.__se__dotted{border-style:dotted none none}.sun-editor-editable hr.__se__dashed{border-style:dashed none none}.sun-editor-editable table{display:table;table-layout:auto;border:1px solid #ccc;width:100%;max-width:100%;margin:0 0 10px;background-color:transparent;border-spacing:0;border-collapse:collapse}.sun-editor-editable table thead{border-bottom:2px solid #333}.sun-editor-editable table tr{border:1px solid #efefef}.sun-editor-editable table th{background-color:#f3f3f3}.sun-editor-editable table td,.sun-editor-editable table th{border:1px solid #e1e1e1;padding:.4em;background-clip:padding-box}.sun-editor-editable .se-component{display:flex;padding:1px;margin:0 0 10px}.sun-editor-editable[contenteditable=true] .se-component{outline:1px dashed #e1e1e1;user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor-editable figure{display:block;outline:none;margin:0;padding:0}.sun-editor-editable figure figcaption{padding:1em .5em;margin:0;background-color:#f9f9f9;outline:none}.sun-editor-editable figure figcaption p{line-height:2;margin:0}.sun-editor-editable .se-image-container a img{padding:1px;margin:1px;outline:1px solid #4592ff}.sun-editor-editable .se-video-container iframe{outline:1px solid #9e9e9e} \ No newline at end of file +.sun-editor{width:auto;height:auto;box-sizing:border-box;font-family:Helvetica Neue,sans-serif;border:1px solid #dadada;text-align:left;background-color:#fff;color:#000;user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor *{box-sizing:border-box;-webkit-user-drag:none;overflow:visible}.sun-editor-common button,.sun-editor-common input,.sun-editor-common select,.sun-editor-common textarea{font-size:14px;line-height:1.5}.sun-editor-common blockquote,.sun-editor-common body,.sun-editor-common button,.sun-editor-common code,.sun-editor-common dd,.sun-editor-common div,.sun-editor-common dl,.sun-editor-common dt,.sun-editor-common fieldset,.sun-editor-common form,.sun-editor-common h1,.sun-editor-common h2,.sun-editor-common h3,.sun-editor-common h4,.sun-editor-common h5,.sun-editor-common h6,.sun-editor-common input,.sun-editor-common legend,.sun-editor-common li,.sun-editor-common ol,.sun-editor-common p,.sun-editor-common pre,.sun-editor-common select,.sun-editor-common td,.sun-editor-common textarea,.sun-editor-common th,.sun-editor-common ul{margin:0;padding:0;border:0}.sun-editor-common dl,.sun-editor-common li,.sun-editor-common menu,.sun-editor-common ol,.sun-editor-common ul{list-style:none!important}.sun-editor-common hr{margin:6px 0!important}.sun-editor textarea{resize:none!important;border:0!important}.sun-editor button{border:0;background-color:transparent;touch-action:manipulation;cursor:pointer;outline:none}.sun-editor button,.sun-editor input,.sun-editor select,.sun-editor textarea{vertical-align:middle}.sun-editor button span{display:block;margin:0;padding:0}.sun-editor button .txt{display:block;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@font-face{font-family:Suneditor-icon;src:url(../fonts/8f8e3d2dab572c888a49d78de853d9db.eot);src:url(../fonts/8f8e3d2dab572c888a49d78de853d9db.eot?#iefix) format("embedded-opentype"),url(../fonts/35346ad776d5c48035b37d1ed3db6492.woff2) format("woff2"),url(../fonts/88c6360b19028a854eba4c2d5cfb047e.woff) format("woff"),url(../fonts/cb906337984d7f7c6d821fe2f77acad5.ttf) format("truetype"),url(../fonts/3dcfeab0340f382515dd099d58904434.svg#Suneditor-icon) format("svg");font-weight:400;font-style:normal}.sun-editor [class*=se-icon-]:before{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Suneditor-icon;display:inline-block;font-style:normal;font-variant:normal;font-weight:400;text-rendering:auto;font-size:15px}.sun-editor .se-toolbar [class*=se-icon-]:before{line-height:2.1}.sun-editor .se-icon-align-justify:before{content:"A"}.sun-editor .se-icon-align-left:before{content:"B"}.sun-editor .se-icon-align-right:before{content:"C"}.sun-editor .se-icon-align-center:before{content:"D"}.sun-editor .se-icon-underline:before{content:"E"}.sun-editor .se-icon-bold:before{content:"F"}.sun-editor .se-icon-italic:before{content:"G"}.sun-editor .se-icon-strokethrough:before{content:"H"}.sun-editor .se-icon-subscript:before{content:"I"}.sun-editor .se-icon-superscript:before{content:"J"}.sun-editor .se-icon-redo:before{content:"K"}.sun-editor .se-icon-undo:before{content:"L"}.sun-editor .se-icon-erase:before{content:"M"}.sun-editor .se-icon-fontColor:before{content:"N"}.sun-editor .se-icon-hiliteColor:before{content:"O"}.sun-editor .se-icon-indent-left:before{content:"P"}.sun-editor .se-icon-indent-right:before{content:"Q"}.sun-editor .se-icon-list-bullets:before{content:"R"}.sun-editor .se-icon-list-number:before{content:"S"}.sun-editor .se-icon-grid:before{content:"T"}.sun-editor .se-icon-code-view:before{content:"U"}.sun-editor .se-icon-preview:before{content:"V"}.sun-editor .se-icon-showBlocks:before{content:"W"}.sun-editor .se-icon-expansion:before{content:"X"}.sun-editor .se-icon-reduction:before{content:"Y"}.sun-editor .se-icon-image:before{content:"Z"}.sun-editor .se-icon-link:before{content:"a"}.sun-editor .se-icon-sun:before{content:"b"}.sun-editor .se-icon-print:before{content:"c"}.sun-editor .se-icon-modify:before{content:"d"}.sun-editor .se-icon-revert:before{content:"e"}.sun-editor .se-icon-arrow-down:before{content:"f";font-size:10px}.sun-editor .se-icon-video:before{content:"g"}.sun-editor .se-icon-cancel:before{content:"h";font-size:10px}.sun-editor .se-icon-warning:before{content:"i"}.sun-editor .se-icon-insert-column-right:before{content:"j"}.sun-editor .se-icon-insert-row-below:before{content:"k"}.sun-editor .se-icon-insert-row-above:before{content:"l"}.sun-editor .se-icon-insert-column-left:before{content:"m"}.sun-editor .se-icon-delete-row:before{content:"n"}.sun-editor .se-icon-delete-column:before{content:"o"}.sun-editor .se-icon-quote:before{content:"p"}.sun-editor .se-icon-empty-file:before{content:"q"}.sun-editor .se-icon-paragraph:before{content:"r"}.sun-editor .se-icon-delete:before{content:"s"}.sun-editor .se-icon-rotate-left:before{content:"t"}.sun-editor .se-icon-rotate-right:before{content:"u"}.sun-editor .se-icon-mirror-horizontal:before{content:"v"}.sun-editor .se-icon-mirror-vertical:before{content:"w"}.sun-editor .se-icon-save:before{content:"x"}.sun-editor .se-icon-hr:before{content:"y"}.sun-editor .se-icon-checked:before{content:"z"}.sun-editor .se-icon-table-header:before{content:"0"}.sun-editor .se-icon-merge-cell:before{content:"1"}.sun-editor .se-icon-split-cell:before{content:"2"}.sun-editor .se-icon-caption:before{content:"3"}.sun-editor .se-icon-edit:before{content:"4"}.sun-editor .se-icon-question:before{content:"5"}.sun-editor .se-icon-attachment:before{content:"6"}.sun-editor .se-icon-add:before{content:"7"}.sun-editor .se-icon-more-vertical:before{content:"8"}.sun-editor .se-icon-more-horizontal:before{content:"9"}.sun-editor .se-icon-map-pin:before{content:"!"}.sun-editor .se-icon-magic-stick:before{content:'"'}.sun-editor .se-icon-math:before{content:"#"}.sun-editor .se-icon-audio:before{content:"$"}.sun-editor .se-icon-emoji:before{content:"%"}.sun-editor .se-icon-template:before{content:"&"}.sun-editor .se-icon-line-height:before{content:"'"}.sun-editor .se-arrow,.sun-editor .se-arrow:after{position:absolute;display:block;width:0;height:0;border:11px solid transparent}.sun-editor .se-arrow.se-arrow-up{top:-11px;left:20px;margin-left:-11px;border-top-width:0;border-bottom-color:rgba(0,0,0,.25)}.sun-editor .se-arrow.se-arrow-up:after{top:1px;margin-left:-11px;content:" ";border-top-width:0;border-bottom-color:#fff}.sun-editor .se-toolbar .se-arrow.se-arrow-up:after{border-bottom-color:#fafafa}.sun-editor .se-arrow.se-arrow-down{top:0;left:0;margin-left:-11px;border-bottom-width:0;border-top-color:rgba(0,0,0,.25)}.sun-editor .se-arrow.se-arrow-down:after{top:-12px;margin-left:-11px;content:" ";border-bottom-width:0;border-top-color:#fff}.sun-editor .se-toolbar .se-arrow.se-arrow-down:after{border-top-color:#fafafa}.sun-editor .se-container{position:relative;width:100%;height:100%}.sun-editor button{color:#000}.sun-editor .se-btn{float:left;width:35px;height:35px;border:0;border-radius:2px;margin:1px!important;padding:0;font-size:12px;line-height:27px}.sun-editor .se-btn:enabled:focus,.sun-editor .se-btn:enabled:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-btn-primary{color:#000;background-color:#c7deff;border:1px solid #80bdff;border-radius:2px}.sun-editor .se-btn-primary:focus,.sun-editor .se-btn-primary:hover{color:#000;background-color:#80bdff;border-color:#3f9dff;outline:0 none}.sun-editor .se-btn-primary:active{color:#fff;background-color:#3f9dff;border-color:#4592ff;-webkit-box-shadow:inset 0 3px 5px #4592ff;box-shadow:inset 0 3px 5px #4592ff}.sun-editor .se-btn:enabled.active{color:#4592ff;outline:0 none}.sun-editor .se-btn:enabled.active:focus,.sun-editor .se-btn:enabled.active:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled.active:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-btn:enabled.on{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn:enabled.on:focus,.sun-editor .se-btn:enabled.on:hover{background-color:#d1d1d1;border-color:#c1c1c1;outline:0 none}.sun-editor .se-btn:enabled.on:active{background-color:#c1c1c1;border-color:#b1b1b1;-webkit-box-shadow:inset 0 3px 5px #b1b1b1;box-shadow:inset 0 3px 5px #b1b1b1}.sun-editor .se-btn-list:disabled,.sun-editor .se-btn:disabled,.sun-editor :disabled [class*=se-icon-]:before{cursor:default;background-color:inherit;color:#bdbdbd}.sun-editor .se-loading-box{position:absolute;display:none;width:100%;height:100%;top:0;left:0;background-color:#fff;opacity:.7;filter:alpha(opacity=70);z-index:2147483647}.sun-editor .se-loading-box .se-loading-effect{position:absolute;display:block;top:50%;left:50%;height:25px;width:25px;border-top:2px solid #07d;border-right:2px solid transparent;border-radius:50%;animation:spinner .8s linear infinite;margin:-25px 0 0 -25px}.sun-editor .se-toolbar{display:block;position:relative;height:auto;width:100%;overflow:visible;padding:4px 3px 0;margin:0;background-color:#fafafa;outline:1px solid #dadada;z-index:5}.sun-editor .se-toolbar-cover{position:absolute;display:none;font-size:36px;width:100%;height:100%;top:0;left:0;background-color:#fefefe;opacity:.5;filter:alpha(opacity=50);cursor:not-allowed;z-index:4}.sun-editor .se-toolbar-separator-vertical{display:inline-block;height:31px;width:1px;margin:2px;vertical-align:top}.sun-editor .se-toolbar.se-toolbar-balloon,.sun-editor .se-toolbar.se-toolbar-inline{display:none;position:absolute;z-index:2147483647;box-shadow:0 3px 9px rgba(0,0,0,.5);-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5)}.sun-editor .se-toolbar.se-toolbar-balloon{width:auto}.sun-editor .se-toolbar.se-toolbar-sticky{position:fixed;top:0}.sun-editor .se-toolbar-sticky-dummy{display:none;position:static;z-index:-1}.sun-editor .se-btn-module{display:inline-block}.sun-editor .se-btn-module-border{border:1px solid #dadada;border-radius:2px}.sun-editor .se-btn-module-enter{display:block;width:100%;height:1px;margin-bottom:5px;background-color:transparent}.sun-editor .se-menu-list,.sun-editor .se-menu-list li{float:left;padding:0;margin:0}.sun-editor .se-menu-list li{position:relative}.sun-editor .se-btn-select{width:auto;display:flex;text-align:left;padding:4px 6px}.sun-editor .se-btn-select .txt{flex:5;float:left;text-align:left}.sun-editor .se-btn-select .se-icon-arrow-down{flex:1;float:right}.sun-editor .se-btn-select.se-btn-tool-font{width:100px}.sun-editor .se-btn-select.se-btn-tool-format,.sun-editor .se-btn-select.se-btn-tool-size{width:80px}.sun-editor .se-list-layer{display:none;position:absolute;top:37px;z-index:4;left:1px;border:1px solid #bababa;border-radius:2px;background-color:#fff;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0 none}.sun-editor .se-list-layer .se-list-inner{padding:0;margin:0;overflow-x:initial;overflow-y:initial;overflow:visible}.sun-editor .se-list-layer button{margin:0;width:100%}.sun-editor .se-list-inner .se-list-basic{width:100%;padding:0}.sun-editor .se-list-inner .se-list-basic li{width:100%}.sun-editor .se-list-inner .se-list-basic li>button{min-width:100%;width:max-content}.sun-editor .se-list-inner .se-list-basic li button.active{background-color:#80bdff;border:1px solid #3f9dff;border-left:0;border-right:0}.sun-editor .se-list-inner .se-list-basic li button.active:active{background-color:#3f9dff;border:1px solid #4592ff;border-left:0;border-right:0;-webkit-box-shadow:inset 0 3px 5px #4592ff;box-shadow:inset 0 3px 5px #4592ff}.sun-editor .se-btn-list{width:100%;height:32px;padding:0 14px;cursor:pointer;font-size:12px;line-height:22px;text-indent:0;text-decoration:none;text-align:left}.sun-editor .se-btn-list.default_value{background-color:#f3f3f3;border-top:1px dotted #b1b1b1;border-bottom:1px dotted #b1b1b1}.sun-editor .se-btn-list:focus,.sun-editor .se-btn-list:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-btn-list:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-list-layer .se-list-font-family{min-width:156px}.sun-editor .se-list-layer .se-list-font-family .default{border-bottom:1px solid #ccc}.sun-editor .se-list-layer .se-list-format{min-width:156px}.sun-editor .se-list-layer .se-list-format li{padding:0;width:100%}.sun-editor .se-list-layer .se-list-format .se-btn-list{height:auto;min-height:32px;line-height:100%}.sun-editor .se-list-layer .se-list-format .se-btn-list[data-value=h1]{height:40px}.sun-editor .se-list-layer .se-list-format .se-btn-list[data-value=h2]{height:34px}.sun-editor .se-list-layer .se-list-format div,.sun-editor .se-list-layer .se-list-format p{font-size:13px;margin:0;padding:0}.sun-editor .se-list-layer .se-list-format h1{font-size:2em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h2{font-size:1.5em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h3{font-size:1.17em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h4{font-size:1em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h5{font-size:.83em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format h6{font-size:.67em;font-weight:700;margin:0;padding:0;color:#333}.sun-editor .se-list-layer .se-list-format blockquote{font-size:13px;color:#999;height:22px;margin:0;background-color:transparent;line-height:1.5;border-color:#b1b1b1;padding:0 0 0 7px;border-left:5px #b1b1b1;border-style:solid}.sun-editor .se-list-layer .se-list-format pre{font-size:13px;color:#666;padding:4px 11px;margin:0;background-color:#f9f9f9;border:1px solid #e1e1e1;border-radius:2px}.sun-editor .se-list-layer .se-list-font-size{min-width:140px;max-height:300px;overflow-x:hidden;overflow-y:auto}.sun-editor .se-list-layer .se-list-font-size .se-btn-list{height:auto;min-height:32px;line-height:normal}.sun-editor .se-list-layer .se-list-line{width:125px}.sun-editor .se-list-layer .se-list-align{left:9px;width:125px}.sun-editor .se-list-layer .se-list-align .se-btn-align>span{display:inline-block;width:14px;height:32px;margin:-1px 10px 0 0;vertical-align:middle}.sun-editor .se-selector-table{display:none;position:absolute;top:34px;left:1px;z-index:4;padding:5px 0;float:left;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border-radius:2px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.sun-editor .se-selector-table .se-table-size{font-size:18px;padding:0 5px}.sun-editor .se-selector-table .se-table-size-picker{position:absolute!important;z-index:3;font-size:18px;width:10em;height:10em;cursor:pointer}.sun-editor .se-selector-table .se-table-size-highlighted{position:absolute!important;z-index:2;font-size:18px;width:1em;height:1em;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADJmlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDIgNzkuMTYwOTI0LCAyMDE3LzA3LzEzLTAxOjA2OjM5ICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo4QTZCNzMzN0I3RUYxMUU4ODcwQ0QwMjM1NTgzRTJDNyIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo4QTZCNzMzNkI3RUYxMUU4ODcwQ0QwMjM1NTgzRTJDNyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOCAoV2luZG93cykiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo0MzYyNEUxRUI3RUUxMUU4ODZGQzgwRjNBODgyNTdFOSIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo0MzYyNEUxRkI3RUUxMUU4ODZGQzgwRjNBODgyNTdFOSIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pl0yAuwAAABBSURBVDhPY/wPBAxUAGCDGvdBeWSAeicIDTfIXREiQArYeR9hEBOEohyMGkQYjBpEGAxjg6ib+yFMygCVvMbAAABj0hwMTNeKJwAAAABJRU5ErkJggg==") repeat}.sun-editor .se-selector-table .se-table-size-unhighlighted{position:relative!important;z-index:1;font-size:18px;width:5em;height:5em;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASAgMAAAAroGbEAAAACVBMVEUAAIj4+Pjp6ekKlAqjAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfYAR0BKhmnaJzPAAAAG0lEQVQI12NgAAOtVatWMTCohoaGUY+EmIkEAEruEzK2J7tvAAAAAElFTkSuQmCC") repeat}.sun-editor .se-selector-table .se-table-size-display{padding-left:5px}.sun-editor .se-list-layer .se-selector-color{display:flex;width:max-content;max-width:270px;height:auto;padding:0;margin:auto}.sun-editor .se-list-layer .se-selector-color .se-color-pallet{width:100%;height:100%;padding:0}.sun-editor .se-list-layer .se-selector-color .se-color-pallet li{display:flex;float:left;position:relative;margin:0}.sun-editor .se-list-layer .se-selector-color .se-color-pallet button{display:block;cursor:default;width:30px;height:30px;text-indent:-9999px}.sun-editor .se-list-layer .se-selector-color .se-color-pallet button.active,.sun-editor .se-list-layer .se-selector-color .se-color-pallet button:focus,.sun-editor .se-list-layer .se-selector-color .se-color-pallet button:hover{border:3px solid #fff}.sun-editor .se-submenu-form-group{display:flex;width:100%;height:auto;padding:4px}.sun-editor .se-submenu-form-group input{flex:auto;display:inline-block;width:72px;height:33px;color:#555;font-size:12px;margin:1px 0;padding:0;border-radius:.25rem;border-bottom:2px solid #b1b1b1;outline:none;text-transform:uppercase}.sun-editor .se-submenu-form-group input:focus{outline:none;border-bottom:3px solid #b1b1b1}.sun-editor .se-submenu-form-group button{float:right;width:35px;height:35px;padding:0;margin:0 0 0 4px!important}.sun-editor .se-submenu-form-group button.se-btn{border:1px solid #ccc}.sun-editor .se-wrapper{position:relative!important;width:100%;height:auto;overflow:hidden;z-index:1}.sun-editor .se-wrapper .se-wrapper-inner{width:100%;height:100%;overflow-y:auto;overflow-x:auto;-webkit-overflow-scrolling:touch;user-select:text;-o-user-select:text;-moz-user-select:text;-khtml-user-select:text;-webkit-user-select:text;-ms-user-select:text}.sun-editor .se-wrapper .se-wrapper-inner:focus{outline:none}.sun-editor .se-wrapper .se-wrapper-code{background-color:#191919;color:#fff;font-size:13px;word-break:break-all;padding:0;margin:0}.sun-editor .se-wrapper .se-wrapper-wysiwyg{background-color:#fff}.sun-editor .se-wrapper .se-wrapper-code-mirror{font-size:13px}.sun-editor .se-wrapper .se-placeholder{position:absolute;display:none;white-space:nowrap;text-overflow:ellipsis;z-index:1;color:#b1b1b1;font-size:13px;line-height:1.5;top:0;left:0;right:0;overflow:hidden;margin-top:0;padding-top:16px;padding-left:16px;margin-left:0;padding-right:16px;margin-right:0;pointer-events:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden}.sun-editor .se-resizing-bar{display:flex;width:auto;height:auto;min-height:16px;border-top:1px solid #dadada;padding:0 4px;background-color:#fafafa;cursor:ns-resize}.sun-editor .se-resizing-bar.se-resizing-none{cursor:default}.sun-editor .se-resizing-back{position:absolute;display:none;cursor:ns-resize;top:0;left:0;width:100%;height:100%;z-index:2147483647}.sun-editor .se-resizing-bar .se-navigation{flex:auto;position:relative;width:auto;height:auto;color:#666;margin:0;padding:0;font-size:10px;font-weight:700;line-height:1.5;background:transparent}.sun-editor .se-resizing-bar .se-char-counter-wrapper{flex:none;position:relative;display:block;width:auto;height:auto;margin:0;padding:0;font-size:10px;background:transparent}.sun-editor .se-resizing-bar .se-char-counter-wrapper span{color:#999;font-size:13px;font-family:Helvetica Neue,sans-serif}.sun-editor .se-resizing-bar .se-char-counter.se-blink{color:#b94a48;animation:blinker .2s linear infinite}.sun-editor .se-dialog{position:absolute;display:none;top:0;left:0;width:100%;height:100%;z-index:2147483647}.sun-editor .se-dialog button,.sun-editor .se-dialog input,.sun-editor .se-dialog label{font-size:14px;line-height:1.5;color:#111;margin:0}.sun-editor .se-dialog .se-dialog-back{background-color:#222;opacity:.5}.sun-editor .se-dialog .se-dialog-back,.sun-editor .se-dialog .se-dialog-inner{position:absolute;width:100%;height:100%;top:0;left:0}.sun-editor .se-dialog .se-dialog-inner .se-modal-title{font-size:14px;font-weight:700;margin:0;padding:0;line-height:1.5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content{position:relative;width:500px;margin:20px auto;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid rgba(0,0,0,.2);border-radius:2px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}@media screen and (max-width:509px){.sun-editor .se-dialog .se-dialog-inner .se-dialog-content{width:100%}}.sun-editor .se-dialog .se-dialog-inner .se-dialog-header{height:50px;padding:15px 15px 5px;border-bottom:1px solid #e5e5e5}.sun-editor .se-dialog .se-dialog-inner button.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#666;padding:0!important;margin:0!important;background:transparent;border:0;text-shadow:0 1px 0 #fff;-webkit-appearance:none;filter:alpha(opacity=100);opacity:1}.sun-editor .se-dialog .se-dialog-inner button.close:focus,.sun-editor .se-dialog .se-dialog-inner button.close:hover{color:#000}.sun-editor .se-dialog .se-dialog-inner .se-dialog-body{position:relative;padding:15px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form{margin-bottom:10px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer{margin-top:10px}.sun-editor .se-dialog .se-dialog-inner input:disabled{background-color:#f3f3f3}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text{width:100%}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text .size-h,.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-text .size-w{width:70px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-size-x{margin:0 8px;width:25px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}.sun-editor .se-dialog .se-dialog-inner .se-dialog-content .se-btn-primary{display:inline-block;padding:6px 12px;margin:0 0 10px!important;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;border-radius:2px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer{padding:10px 15px 0;text-align:right;border-top:1px solid #e5e5e5}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer>div{float:left}.sun-editor .se-dialog .se-dialog-inner .se-dialog-footer>div>label{margin-top:5px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-radio{margin-left:12px;margin-right:6px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-check{margin-left:12px;margin-right:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer .se-dialog-btn-check{margin-left:0;margin-right:4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-control{display:inline-block;width:70px;text-align:center}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-control,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form{height:34px;font-size:14px;line-height:1.42857143;color:#555;border:1px solid #ccc;border-radius:2px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form{display:block;width:100%;padding:0 4px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-control:focus,.sun-editor .se-dialog .se-dialog-inner .se-dialog-form .se-input-form:focus{border-color:#80bdff;outline:0;-webkit-box-shadow:0 0 0 .2rem #c7deff;box-shadow:0 0 0 .2rem #c7deff}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert{border:1px solid #ccc}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-revert:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-dialog-tabs{width:100%;height:25px;border-bottom:1px solid #e5e5e5}.sun-editor .se-dialog-tabs button{background-color:#e5e5e5;border-right:1px solid #e5e5e5;float:left;outline:none;padding:2px 13px;transition:.3s}.sun-editor .se-dialog-tabs button:hover{background-color:#fff}.sun-editor .se-dialog-tabs button.active{background-color:#fff;border-bottom:0}.sun-editor .se-controller .se-arrow.se-arrow-up{border-bottom-color:rgba(0,0,0,.25)}.sun-editor .se-controller{position:absolute;display:none;overflow:visible;z-index:6;border:1px solid rgba(0,0,0,.25);border-radius:2px;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-break:normal;word-spacing:normal;word-wrap:normal;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2);line-break:auto}.sun-editor .se-controller .se-btn-group{position:relative;display:flex;vertical-align:middle;padding:2px 2px 2px 0;top:0;left:0}.sun-editor .se-controller .se-btn-group .se-btn-group-sub{left:50%;min-width:auto;width:max-content;display:none}.sun-editor .se-controller .se-btn-group .se-btn-group-sub button{margin:0;min-width:72px}.sun-editor .se-controller .se-btn-group button{position:relative;min-height:35px;height:auto;border:none;border-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;margin:0 0 0 2px;padding:5px 10px;font-size:12px;line-height:1.5;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation}.sun-editor .se-controller .se-btn-group button:focus:enabled,.sun-editor .se-controller .se-btn-group button:hover:enabled{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:active:enabled{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-controller .se-btn-group button span{display:block;padding:0;margin:0}.sun-editor .se-controller .se-btn-group button:enabled.active{color:#4592ff;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.active:focus,.sun-editor .se-controller .se-btn-group button:enabled.active:hover{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.active:active{background-color:#d1d1d1;border-color:#c1c1c1;-webkit-box-shadow:inset 0 3px 5px #c1c1c1;box-shadow:inset 0 3px 5px #c1c1c1}.sun-editor .se-controller .se-btn-group button:enabled.on{background-color:#e1e1e1;border-color:#d1d1d1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.on:focus,.sun-editor .se-controller .se-btn-group button:enabled.on:hover{background-color:#d1d1d1;border-color:#c1c1c1;outline:0 none}.sun-editor .se-controller .se-btn-group button:enabled.on:active{background-color:#c1c1c1;border-color:#b1b1b1;-webkit-box-shadow:inset 0 3px 5px #b1b1b1;box-shadow:inset 0 3px 5px #b1b1b1}.sun-editor .se-controller-resizing{margin-top:-50px!important;padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-controller-resizing .se-btn-group .se-btn-group-sub.se-resizing-align-list{left:57px}.sun-editor .se-resizing-container{position:absolute;display:none;z-index:6;border:1px solid #80bdff}.sun-editor .se-resizing-container .se-modal-resize{position:absolute;display:inline-block;background-color:#3f9dff;opacity:.3}.sun-editor .se-resizing-container .se-resize-dot{position:absolute;top:0;left:0;width:100%;height:100%}.sun-editor .se-resizing-container .se-resize-dot>span{position:absolute;width:7px;height:7px;background-color:#3f9dff;border:1px solid #4592ff}.sun-editor .se-resizing-container .se-resize-dot>span.tl{top:-5px;left:-5px;cursor:nw-resize}.sun-editor .se-resizing-container .se-resize-dot>span.tr{top:-5px;right:-5px;cursor:ne-resize}.sun-editor .se-resizing-container .se-resize-dot>span.bl{bottom:-5px;left:-5px;cursor:sw-resize}.sun-editor .se-resizing-container .se-resize-dot>span.br{right:-5px;bottom:-5px;cursor:se-resize}.sun-editor .se-resizing-container .se-resize-dot>span.lw{left:-7px;bottom:50%;cursor:w-resize}.sun-editor .se-resizing-container .se-resize-dot>span.th{left:50%;top:-7px;cursor:n-resize}.sun-editor .se-resizing-container .se-resize-dot>span.rw{right:-7px;bottom:50%;cursor:e-resize}.sun-editor .se-resizing-container .se-resize-dot>span.bh{right:50%;bottom:-7px;cursor:s-resize}.sun-editor .se-resizing-container .se-resize-display{position:absolute;right:0;bottom:0;padding:5px;margin:5px;font-size:12px;color:#fff;background-color:#000;border-radius:2px}.sun-editor .se-controller-table,.sun-editor .se-controller-table-cell{width:auto}.sun-editor .se-controller-link,.sun-editor .se-controller-table,.sun-editor .se-controller-table-cell{padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-controller-link:after,.sun-editor .se-controller-link:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sun-editor .se-controller-link .link-content{padding:0;margin:0}.sun-editor .se-controller-link .link-content a{display:inline-block;color:#4592ff;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle;margin-left:5px}.sun-editor .se-notice{position:relative;display:none;width:100%;height:auto;word-break:break-all;font-size:13px;color:#b94a48;background-color:#f2dede;padding:15px;margin:0;border:1px solid #eed3d7;user-select:text;-o-user-select:text;-moz-user-select:text;-khtml-user-select:text;-webkit-user-select:text;-ms-user-select:text}.sun-editor .se-notice button{float:right}.sun-editor .se-tooltip{position:relative;overflow:visible}.sun-editor .se-tooltip .se-tooltip-inner{visibility:hidden;position:absolute;display:block;width:auto;top:120%;left:50%;background:transparent;opacity:0;z-index:1;line-height:1.5;transition:opacity .5s;margin:0;padding:0;bottom:auto;float:none;pointer-events:none;backface-visibility:hidden;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden}.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text{position:relative;display:inline-block;width:auto;left:-50%;font-size:.9em;margin:0;padding:4px 6px;border-radius:2px;background-color:#333;color:#fff;text-align:center;line-height:unset;white-space:nowrap;cursor:auto}.sun-editor .se-tooltip .se-tooltip-inner .se-tooltip-text:after{content:"";position:absolute;bottom:100%;left:50%;margin-left:-5px;border:5px solid transparent;border-bottom-color:#333}.sun-editor .se-tooltip:hover .se-tooltip-inner{visibility:visible;opacity:1}.se-show-block div,.se-show-block h1,.se-show-block h2,.se-show-block h3,.se-show-block h4,.se-show-block h5,.se-show-block h6,.se-show-block p{border:1px dashed #3f9dff;padding:10px 8px 8px}.se-show-block p{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPAQMAAAAF7dc0AAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAaSURBVAjXY/j/gwGCPvxg+F4BQiAGDP1HQQByxxw0gqOzIwAAAABJRU5ErkJggg==") no-repeat}.se-show-block div{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAPAQMAAAAxlBYoAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAmSURBVAjXY/j//wcDDH+8XsHwDYi/hwNx1A8w/nYLKH4XoQYJAwCXnSgcl2MOPgAAAABJRU5ErkJggg==") no-repeat}.se-show-block h1{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAfSURBVAjXY/j/v4EBhr+9B+LzEPrDeygfhI8j1CBhAEhmJGY4Rf6uAAAAAElFTkSuQmCC") no-repeat}.se-show-block h2{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAmSURBVAjXY/j/v4EBhr+dB+LtQPy9geEDEH97D8T3gbgdoQYJAwA51iPuD2haEAAAAABJRU5ErkJggg==") no-repeat}.se-show-block h3{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j/v4EBhr+dB+LtQPy9geHDeQgN5p9HqEHCADeWI+69VG2MAAAAAElFTkSuQmCC") no-repeat}.se-show-block h4{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAPAQMAAADTSA1RAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j//wADDH97DsTXIfjDdiDdDMTfIRhZHRQDAKJOJ6L+K3y7AAAAAElFTkSuQmCC") no-repeat}.se-show-block h5{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAlSURBVAjXY/j/v4EBhr+1A/F+IO5vYPiwHUh/B2IQfR6hBgkDABlWIy5uM+9GAAAAAElFTkSuQmCC") no-repeat}.se-show-block h6{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAPAQMAAAA4f7ZSAAAABlBMVEWAgID////n1o2sAAAAAnRSTlP/AOW3MEoAAAAiSURBVAjXY/j/v4EBhr+dB+LtQLy/geFDP5S9HSKOrA6KAR9GIza1ptJnAAAAAElFTkSuQmCC") no-repeat}.sun-editor-editable table td.se-table-selected-cell,.sun-editor-editable table th.se-table-selected-cell{border:1px double #4592ff;background-color:#f1f7ff}.sun-editor-editable.se-disabled{user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor-editable[contenteditable=true] figure:after{position:absolute;content:"";z-index:1;top:0;left:0;right:0;bottom:0;cursor:default;display:block;background:transparent}.sun-editor-editable[contenteditable=true] figure a,.sun-editor .se-wrapper .sun-editor-editable[contenteditable=true] figure img{z-index:0}.sun-editor-editable[contenteditable=true] figure figcaption{z-index:2}@keyframes blinker{50%{opacity:0}}@keyframes spinner{to{transform:rotate(1turn)}}.sun-editor-editable{font-family:Helvetica Neue,sans-serif;font-size:13px;line-height:1.5;color:#333;text-align:left;background-color:#fff;word-break:normal;word-wrap:break-word;padding:16px;margin:0}.sun-editor-editable *{font-family:inherit;font-size:inherit;color:inherit;background-color:inherit;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.sun-editor-editable audio,.sun-editor-editable figcaption,.sun-editor-editable figure,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable td,.sun-editor-editable th,.sun-editor-editable video{position:relative}.sun-editor-editable audio,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable video{display:block;margin:0;padding:0;max-width:100%}.sun-editor-editable .__se__float-left{float:left}.sun-editor-editable .__se__float-right{float:right}.sun-editor-editable .__se__float-center{float:center}.sun-editor-editable .__se__float-none{float:none}.sun-editor-editable span{display:inline;vertical-align:baseline;margin:0;padding:0}.sun-editor-editable a{color:#004cff;text-decoration:none}.sun-editor-editable a:focus,.sun-editor-editable a:hover{cursor:pointer;color:#0093ff;text-decoration:underline}.sun-editor-editable pre{display:block;padding:8px;margin:0 0 10px;line-height:1.45;color:#666;background-color:#f9f9f9;border:1px solid #e1e1e1;border-radius:2px;overflow:auto}.sun-editor-editable ol{list-style-type:decimal}.sun-editor-editable ol,.sun-editor-editable ul{display:block;margin-block-start:1em;margin-block-end:1em;margin-inline-start:0;margin-inline-end:0;padding-inline-start:40px}.sun-editor-editable ul{list-style-type:disc}.sun-editor-editable li{display:list-item;text-align:-webkit-match-parent;margin-bottom:5px}.sun-editor-editable sub,.sun-editor-editable sup{font-size:75%;line-height:0}.sun-editor-editable sub{vertical-align:sub}.sun-editor-editable sup{vertical-align:super}.sun-editor-editable p{display:block;margin:0 0 10px}.sun-editor-editable div{display:block;margin:0;padding:0}.sun-editor-editable blockquote{display:block;color:#999;margin-block-start:1em;margin-block-end:1em;margin-inline-start:40px;margin-inline-end:40px;border-style:solid;padding:0 5px 0 20px;border-width:0 0 0 5px;border-color:#b1b1b1}.sun-editor-editable blockquote blockquote{border-color:#c1c1c1}.sun-editor-editable blockquote blockquote blockquote{border-color:#d1d1d1}.sun-editor-editable blockquote blockquote blockquote blockquote{border-color:#e1e1e1}.sun-editor-editable h1{font-size:2em;margin-block-start:.67em;margin-block-end:.67em}.sun-editor-editable h1,.sun-editor-editable h2{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h2{font-size:1.5em;margin-block-start:.83em;margin-block-end:.83em}.sun-editor-editable h3{font-size:1.17em;margin-block-start:1em;margin-block-end:1em}.sun-editor-editable h3,.sun-editor-editable h4{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h4{font-size:1em;margin-block-start:1.33em;margin-block-end:1.33em}.sun-editor-editable h5{font-size:.83em;margin-block-start:1.67em;margin-block-end:1.67em}.sun-editor-editable h5,.sun-editor-editable h6{display:block;margin-inline-start:0;margin-inline-end:0;font-weight:700}.sun-editor-editable h6{font-size:.67em;margin-block-start:2.33em;margin-block-end:2.33em}.sun-editor-editable hr{display:block;border-width:1px 0 0;border-color:#000;border-image:initial;height:1px}.sun-editor-editable hr.__se__solid{border-style:solid none none}.sun-editor-editable hr.__se__dotted{border-style:dotted none none}.sun-editor-editable hr.__se__dashed{border-style:dashed none none}.sun-editor-editable table{display:table;table-layout:auto;border:1px solid #ccc;width:100%;max-width:100%;margin:0 0 10px;background-color:transparent;border-spacing:0;border-collapse:collapse}.sun-editor-editable table thead{border-bottom:2px solid #333}.sun-editor-editable table tr{border:1px solid #efefef}.sun-editor-editable table th{background-color:#f3f3f3}.sun-editor-editable table td,.sun-editor-editable table th{border:1px solid #e1e1e1;padding:.4em;background-clip:padding-box}.sun-editor-editable .se-component{display:flex;padding:1px;margin:0 0 10px}.sun-editor-editable[contenteditable=true] .se-component{outline:1px dashed #e1e1e1;user-select:none;-o-user-select:none;-moz-user-select:none;-khtml-user-select:none;-webkit-user-select:none;-ms-user-select:none}.sun-editor-editable figure{display:block;outline:none;margin:0;padding:0}.sun-editor-editable figure figcaption{padding:1em .5em;margin:0;background-color:#f9f9f9;outline:none}.sun-editor-editable figure figcaption p{line-height:2;margin:0}.sun-editor-editable .se-image-container a img{padding:1px;margin:1px;outline:1px solid #4592ff}.sun-editor-editable .se-video-container iframe{outline:1px solid #9e9e9e} \ No newline at end of file diff --git a/dist/fonts/35346ad776d5c48035b37d1ed3db6492.woff2 b/dist/fonts/35346ad776d5c48035b37d1ed3db6492.woff2 new file mode 100644 index 000000000..2524c57e4 Binary files /dev/null and b/dist/fonts/35346ad776d5c48035b37d1ed3db6492.woff2 differ diff --git a/dist/fonts/52b28fecb3b9616a5154d0226058600e.svg b/dist/fonts/3dcfeab0340f382515dd099d58904434.svg similarity index 58% rename from dist/fonts/52b28fecb3b9616a5154d0226058600e.svg rename to dist/fonts/3dcfeab0340f382515dd099d58904434.svg index 3a42d2dcb..bf3cd1efb 100644 --- a/dist/fonts/52b28fecb3b9616a5154d0226058600e.svg +++ b/dist/fonts/3dcfeab0340f382515dd099d58904434.svg @@ -1 +1 @@ -Generated by Glyphter \ No newline at end of file +Generated by Glyphter \ No newline at end of file diff --git a/dist/fonts/688522218ec6987e6fada6a165d490d7.woff2 b/dist/fonts/688522218ec6987e6fada6a165d490d7.woff2 deleted file mode 100644 index 7e38205a1..000000000 Binary files a/dist/fonts/688522218ec6987e6fada6a165d490d7.woff2 and /dev/null differ diff --git a/dist/fonts/88c6360b19028a854eba4c2d5cfb047e.woff b/dist/fonts/88c6360b19028a854eba4c2d5cfb047e.woff new file mode 100644 index 000000000..78c76c125 Binary files /dev/null and b/dist/fonts/88c6360b19028a854eba4c2d5cfb047e.woff differ diff --git a/dist/fonts/8a2aa4c9fcb1e8fbf45305679b8f7a0e.woff b/dist/fonts/8a2aa4c9fcb1e8fbf45305679b8f7a0e.woff deleted file mode 100644 index 55abbc503..000000000 Binary files a/dist/fonts/8a2aa4c9fcb1e8fbf45305679b8f7a0e.woff and /dev/null differ diff --git a/dist/fonts/655623c4c2d6d9092ba9f381e4042e8f.eot b/dist/fonts/8f8e3d2dab572c888a49d78de853d9db.eot similarity index 82% rename from dist/fonts/655623c4c2d6d9092ba9f381e4042e8f.eot rename to dist/fonts/8f8e3d2dab572c888a49d78de853d9db.eot index 9df8427b5..aa9312db7 100644 Binary files a/dist/fonts/655623c4c2d6d9092ba9f381e4042e8f.eot and b/dist/fonts/8f8e3d2dab572c888a49d78de853d9db.eot differ diff --git a/dist/fonts/d314a75b315393089036e8be6f1e5965.ttf b/dist/fonts/cb906337984d7f7c6d821fe2f77acad5.ttf similarity index 82% rename from dist/fonts/d314a75b315393089036e8be6f1e5965.ttf rename to dist/fonts/cb906337984d7f7c6d821fe2f77acad5.ttf index a2b1745de..00f19869a 100644 Binary files a/dist/fonts/d314a75b315393089036e8be6f1e5965.ttf and b/dist/fonts/cb906337984d7f7c6d821fe2f77acad5.ttf differ diff --git a/dist/suneditor.min.js b/dist/suneditor.min.js index 60ad2a19c..23562e93a 100644 --- a/dist/suneditor.min.js +++ b/dist/suneditor.min.js @@ -1 +1 @@ -!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="XJR1")}({"3FqI":function(e,t,i){},P6u4:function(e,t,i){"use strict";var n,o;n="undefined"!=typeof window?window:this,o=function(e,t){const i={toolbar:{default:"Default",save:"Save",font:"Font",formats:"Formats",fontSize:"Size",bold:"Bold",underline:"Underline",italic:"Italic",strike:"Strike",subscript:"Subscript",superscript:"Superscript",removeFormat:"Remove Format",fontColor:"Font Color",hiliteColor:"Highlight Color",indent:"Indent",outdent:"Outdent",align:"Align",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Align center",alignJustify:"Align justify",list:"list",orderList:"Ordered list",unorderList:"Unordered list",horizontalRule:"horizontal line",hr_solid:"solid",hr_dotted:"dotted",hr_dashed:"dashed",table:"Table",link:"Link",image:"Image",video:"Video",fullScreen:"Full screen",showBlocks:"Show blocks",codeView:"Code view",undo:"Undo",redo:"Redo",preview:"Preview",print:"print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Quote",tag_pre:"Code",template:"Template"},dialogBox:{linkBox:{title:"Insert Link",url:"URL to link",text:"Text to display",newWindowCheck:"Open in new window"},imageBox:{title:"Insert image",file:"Select from files",url:"Image URL",altText:"Alternative text"},videoBox:{title:"Insert Video",url:"Media embed URL, YouTube"},caption:"Insert description",close:"Close",submitButton:"Submit",revertButton:"Revert",proportion:"constrain proportions",width:"Width",height:"Height",basic:"Basic",left:"Left",right:"Right",center:"Center"},controller:{edit:"Edit",remove:"Remove",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",insertColumnBefore:"Insert column before",insertColumnAfter:"Insert column after",deleteColumn:"Delete column",resize100:"Resize 100%",resize75:"Resize 75%",resize50:"Resize 50%",resize25:"Resize 25%",mirrorHorizontal:"Mirror, Horizontal",mirrorVertical:"Mirror, Vertical",rotateLeft:"Rotate left",rotateRight:"Rotate right",maxSize:"Max size",minSize:"Min size",tableHeader:"Table header",mergeCells:"Merge cells",splitCells:"Split Cells",HorizontalSplit:"Horizontal split",VerticalSplit:"Vertical split"}};return void 0===t&&(e.SUNEDITOR_LANG||(e.SUNEDITOR_LANG={}),e.SUNEDITOR_LANG.en=i),i},"object"==typeof e.exports?e.exports=n.document?o(n,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return o(e)}:o(n)},WUQj:function(e,t,i){},XJR1:function(e,t,i){"use strict";i.r(t);i("3FqI"),i("WUQj");var n={name:"colorPicker",add:function(e){const t=e.context;t.colorPicker={colorListHTML:"",_colorInput:"",_defaultColor:"#000",_styleProperty:"color",_currentColor:"",_colorList:[]};let i=this.createColorList(e.context.option,e.lang,this._makeColorList);t.colorPicker.colorListHTML=i,i=null},createColorList:function(e,t,i){const n=e.colorList&&0!==e.colorList.length?e.colorList:["#ff0000","#ff5e00","#ffe400","#abf200","#00d8ff","#0055ff","#6600ff","#ff00dd","#000000","#ffd8d8","#fae0d4","#faf4c0","#e4f7ba","#d4f4fa","#d9e5ff","#e8d9ff","#ffd9fa","#f1f1f1","#ffa7a7","#ffc19e","#faed7d","#cef279","#b2ebf4","#b2ccff","#d1b2ff","#ffb2f5","#bdbdbd","#f15f5f","#f29661","#e5d85c","#bce55c","#5cd1e5","#6699ff","#a366ff","#f261df","#8c8c8c","#980000","#993800","#998a00","#6b9900","#008299","#003399","#3d0099","#990085","#353535","#670000","#662500","#665c00","#476600","#005766","#002266","#290066","#660058","#222222"];let o=[],l='
';for(let e=0,t=n.length;e0&&(l+='
'+i(o)+"
",o=[]),"object"==typeof n[e]&&(l+='
'+i(n[e])+"
"));return l+='
"},_makeColorList:function(e){let t="";t+='"},init:function(e,t){const i=this.plugins.colorPicker;let n=t||(i.getColorInNode.call(this,e)||this.context.colorPicker._defaultColor);n=i.isHexColor(n)?n:i.rgb2hex(n)||n;const o=this.context.colorPicker._colorList;if(o)for(let e=0,t=o.length;e=3&&"#"+((1<<24)+(i[0]<<16)+(i[1]<<8)+i[2]).toString(16).substr(1)}},o={name:"dialog",add:function(e){const t=e.context;t.dialog={};let i=e.util.createElement("DIV");i.className="se-dialog sun-editor-common";let n=e.util.createElement("DIV");n.className="se-dialog-back",n.style.display="none";let o=e.util.createElement("DIV");o.className="se-dialog-inner",o.style.display="none",i.appendChild(n),i.appendChild(o),t.dialog.modalArea=i,t.dialog.back=n,t.dialog.modal=o,t.dialog.modal.addEventListener("click",this.onClick_dialog.bind(e)),t.element.relative.appendChild(i),i=null,n=null,o=null},onClick_dialog:function(e){e.stopPropagation(),(/se-dialog-inner/.test(e.target.className)||/close/.test(e.target.getAttribute("data-command")))&&this.plugins.dialog.close.call(this)},open:function(e,t){if(this.modalForm)return!1;this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.plugins.dialog._bindClose=function(e){/27/.test(e.keyCode)&&this.plugins.dialog.close.call(this)}.bind(this),this._d.addEventListener("keydown",this.plugins.dialog._bindClose),this.context.dialog.updateModal=t,"full"===this.context.option.popupDisplay?this.context.dialog.modalArea.style.position="fixed":this.context.dialog.modalArea.style.position="absolute",this.context.dialog.kind=e,this.modalForm=this.context[e].modal;const i=this.context[e].focusElement;"function"==typeof this.plugins[e].on&&this.plugins[e].on.call(this,t),this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",i&&i.focus()},_bindClose:null,close:function(){this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.modalForm=null,this.context.dialog.updateModal=!1,this.plugins[this.context.dialog.kind].init.call(this)}},l={name:"resizing",add:function(e){const t=e.context;t.resizing={_resizeClientX:0,_resizeClientY:0,_resize_plugin:"",_resize_w:0,_resize_h:0,_origin_w:0,_origin_h:0,_rotateVertical:!1,_resize_direction:"",_move_path:null,_isChange:!1};let i=this.setController_resize.call(e);t.resizing.resizeContainer=i,t.resizing.resizeDiv=i.querySelector(".se-modal-resize"),t.resizing.resizeDot=i.querySelector(".se-resize-dot"),t.resizing.resizeDisplay=i.querySelector(".se-resize-display");let n=this.setController_button.call(e);t.resizing.resizeButton=n,n.addEventListener("mousedown",function(e){e.stopPropagation()},!1);let o=t.resizing.resizeHandles=t.resizing.resizeDot.querySelectorAll("span");t.resizing.resizeButtonGroup=n.querySelector("._se_resizing_btn_group"),t.resizing.alignMenu=n.querySelector(".se-resizing-align-list"),t.resizing.alignMenuList=t.resizing.alignMenu.querySelectorAll("button"),t.resizing.alignButton=n.querySelector("._se_resizing_align_button"),t.resizing.alignButtonIcon=t.resizing.alignButton.querySelector("i"),t.resizing.captionButton=n.querySelector("._se_resizing_caption_button"),o[0].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),o[1].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),o[2].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),o[3].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),o[4].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),o[5].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),o[6].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),o[7].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),n.addEventListener("click",this.onClick_resizeButton.bind(e)),t.element.relative.appendChild(i),t.element.relative.appendChild(n),i=null,n=null,o=null},setController_resize:function(){const e=this.util.createElement("DIV");return e.className="se-resizing-container",e.style.display="none",e.innerHTML='
',e},setController_button:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-resizing",t.innerHTML='
",t},call_controller_resize:function(e,t){const i=this.context.resizing;i._resize_plugin=t;const n=i.resizeContainer,o=i.resizeDiv,l=this.util.getOffset(e,this.context.element.wysiwygFrame),s=i._rotateVertical=/^(90|270)$/.test(Math.abs(e.getAttribute("data-rotate")).toString()),a=s?e.offsetHeight:e.offsetWidth,r=s?e.offsetWidth:e.offsetHeight,c=l.top,d=l.left-this.context.element.wysiwygFrame.scrollLeft;n.style.top=c+"px",n.style.left=d+"px",n.style.width=a+"px",n.style.height=r+"px",o.style.top="0px",o.style.left="0px",o.style.width=a+"px",o.style.height=r+"px";let u=e.getAttribute("data-align")||"basic";u="none"===u?"basic":u,this.util.changeTxt(i.resizeDisplay,this.lang.dialogBox[u]+" ("+a+" x "+r+")");const h=this.context[t]._resizing?"flex":"none",g=i.resizeHandles;i.resizeButtonGroup.style.display=h;for(let e=0,t=g.length;e",e},set_cover:function(e){const t=this.util.createElement("FIGURE");return t.appendChild(e),t},set_container:function(e,t){const i=this.util.createElement("DIV");return i.className="se-component "+t,i.setAttribute("contenteditable",!1),i.appendChild(e),i},onClick_resizeButton:function(e){e.stopPropagation();const t=e.target,i=t.getAttribute("data-command")||t.parentNode.getAttribute("data-command");if(!i)return;const n=t.getAttribute("data-value")||t.parentNode.getAttribute("data-value"),o=this.context.resizing._resize_plugin,l=this.context[o],s=l._element,a=this.plugins[o];if(e.preventDefault(),"function"!=typeof this.plugins.resizing._closeAlignMenu||(this.plugins.resizing._closeAlignMenu(),"onalign"!==i)){switch(i){case"percent":this.plugins.resizing.resetTransform.call(this,s),a.setPercentSize.call(this,100*n+"%","auto"),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,o));break;case"mirror":const e=s.getAttribute("data-rotate")||"0";let t=s.getAttribute("data-rotateX")||"",r=s.getAttribute("data-rotateY")||"";"h"===n&&!this.context.resizing._rotateVertical||"v"===n&&this.context.resizing._rotateVertical?r=r?"":"180":t=t?"":"180",s.setAttribute("data-rotateX",t),s.setAttribute("data-rotateY",r),this.plugins.resizing._setTransForm(s,e,t,r);break;case"rotate":const c=this.context.resizing,d=1*s.getAttribute("data-rotate")+1*n,u=this._w.Math.abs(d)>=360?0:d;s.setAttribute("data-rotate",u),c._rotateVertical=/^(90|270)$/.test(this._w.Math.abs(u).toString()),this.plugins.resizing.setTransformSize.call(this,s,null,null),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,c._resize_plugin));break;case"onalign":this.plugins.resizing.openAlignMenu.call(this);break;case"align":const h="basic"===n?"none":n;l._cover.style.margin=h&&"none"!==h?"auto":"0",this.util.removeClass(l._container,l._floatClassRegExp),this.util.addClass(l._container,"__se__float-"+h),s.setAttribute("data-align",h),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,o));break;case"caption":const g=!l._captionChecked;if(a.openModify.call(this,!0),l._captionChecked=l.captionCheckEl.checked=g,"image"===o?a.update_image.call(this,!1,!1):"video"===o&&(this.context.dialog.updateModal=!0,a.submitAction.call(this)),g){const e=this.util.getChildElement(l._caption,function(e){return 3===e.nodeType});e?this.setRange(e,0,e,e.textContent.length):l._caption.focus(),this.controllersOff()}else a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,o)),a.openModify.call(this,!0);break;case"revert":a.setAutoSize?a.setAutoSize.call(this):(a.resetAlign.call(this),this.plugins.resizing.resetTransform.call(this,s)),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,o));break;case"update":a.openModify.call(this),this.controllersOff();break;case"delete":a.destroy.call(this)}this.history.push()}},resetTransform:function(e){const t=(e.getAttribute("data-origin")||"").split(",");this.context.resizing._rotateVertical=!1,e.style.transform="",e.style.transformOrigin="",e.setAttribute("data-rotate",""),e.setAttribute("data-rotateX",""),e.setAttribute("data-rotateY",""),e.style.width=t[0]?t[0]+"px":"auto",e.style.height=t[1]?t[1]+"px":"",this.plugins.resizing.setTransformSize.call(this,e,null,null)},setTransformSize:function(e,t,i){const n=this.util.getParentElement(e,"FIGURE"),o=this.context.resizing._rotateVertical,l=1*e.getAttribute("data-rotate"),s=t||e.offsetWidth,a=i||e.offsetHeight,r=o?a:s,c=o?s:a;this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,s,a),n.style.width=r+"px",n.style.height=this.context[this.context.resizing._resize_plugin]._caption?"":c+"px";let d="";if(o){let e=s/2+"px "+s/2+"px 0",t=a/2+"px "+a/2+"px 0";d=90===l||-270===l?t:e}e.style.transformOrigin=d,this.plugins.resizing._setTransForm(e,l.toString(),e.getAttribute("data-rotateX")||"",e.getAttribute("data-rotateY")||""),this.plugins.resizing._setCaptionPosition.call(this,e,this.util.getChildElement(this.util.getParentElement(e,"FIGURE"),"FIGCAPTION"))},_setTransForm:function(e,t,i,n){let o=(e.offsetWidth-e.offsetHeight)*(/-/.test(t)?1:-1),l="";if(/[1-9]/.test(t)&&(i||n))switch(l=i?"Y":"X",t){case"90":l=i&&n?"X":n?l:"";break;case"270":o*=-1,l=i&&n?"Y":i?l:"";break;case"-90":l=i&&n?"Y":i?l:"";break;case"-270":o*=-1,l=i&&n?"X":n?l:"";break;default:l=""}t%180==0&&(e.style.maxWidth="100%"),e.style.transform="rotate("+t+"deg)"+(i?" rotateX("+i+"deg)":"")+(n?" rotateY("+n+"deg)":"")+(l?" translate"+l+"("+o+"px)":"")},_setCaptionPosition:function(e,t){t&&(t.style.marginTop=(this.context.resizing._rotateVertical?e.offsetWidth-e.offsetHeight:0)+"px")},onMouseDown_resize_handle:function(e){const t=this.context.resizing,i=t._resize_direction=e.target.classList[0];e.stopPropagation(),e.preventDefault(),t._resizeClientX=e.clientX,t._resizeClientY=e.clientY,this.context.element.resizeBackground.style.display="block",t.resizeButton.style.display="none",t.resizeDiv.style.float=/l/.test(i)?"right":/r/.test(i)?"left":"none";const n=function(){const e=t._isChange;t._isChange=!1,document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",n),this.plugins.resizing.cancel_controller_resize.call(this),e&&this.history.push()}.bind(this),o=this.plugins.resizing.resizing_element.bind(this,t,i,this.context[t._resize_plugin]);document.addEventListener("mousemove",o),document.addEventListener("mouseup",n)},resizing_element:function(e,t,i,n){const o=n.clientX,l=n.clientY;let s=i._element_w,a=i._element_h;const r=i._element_w+(/r/.test(t)?o-e._resizeClientX:e._resizeClientX-o),c=i._element_h+(/b/.test(t)?l-e._resizeClientY:e._resizeClientY-l),d=i._element_h/i._element_w*r;/t/.test(t)&&(e.resizeDiv.style.top=i._element_h-(/h/.test(t)?c:d)+"px"),/l/.test(t)&&(e.resizeDiv.style.left=i._element_w-r+"px"),/r|l/.test(t)&&(e.resizeDiv.style.width=r+"px",s=r),/^(t|b)[^h]$/.test(t)?(e.resizeDiv.style.height=d+"px",a=d):/^(t|b)h$/.test(t)&&(e.resizeDiv.style.height=c+"px",a=c),e._resize_w=s,e._resize_h=a,this.util.changeTxt(e.resizeDisplay,this._w.Math.round(s)+" x "+this._w.Math.round(a)),e._isChange=!0},cancel_controller_resize:function(){const e=this.context.resizing._rotateVertical;this.controllersOff(),this.context.element.resizeBackground.style.display="none";let t=this._w.Math.round(e?this.context.resizing._resize_h:this.context.resizing._resize_w),i=this._w.Math.round(e?this.context.resizing._resize_w:this.context.resizing._resize_h);if(!e&&!/^\d+%$/.test(t)){const e=16,n=this.context.element.wysiwygFrame.clientWidth-2*e-2;t.toString().match(/\d+/)[0]>n&&(t=n,i="video"===this.context.resizing._resize_plugin?i/t*n:"auto")}this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t,i),this.plugins.resizing.setTransformSize.call(this,this.context[this.context.resizing._resize_plugin]._element,t,i),this.plugins[this.context.resizing._resize_plugin].init.call(this)}},s={name:"notice",add:function(e){const t=e.context;t.notice={};let i=e.util.createElement("DIV"),n=e.util.createElement("SPAN"),o=e.util.createElement("BUTTON");i.className="se-notice",o.className="close",o.setAttribute("aria-label","Close"),o.setAttribute("title",e.lang.dialogBox.close),o.innerHTML='',i.appendChild(n),i.appendChild(o),t.notice.modal=i,t.notice.message=n,o.addEventListener("click",this.onClick_cancel.bind(e)),t.element.editorArea.insertBefore(i,t.element.wysiwygFrame),i=null},onClick_cancel:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.notice.close.call(this)},open:function(e){this.context.notice.message.textContent=e,this.context.notice.modal.style.display="block"},close:function(){this.context.notice.modal.style.display="none"}},a={align:{name:"align",add:function(e,t){const i=e.context;i.align={_alignList:null,currentAlign:""};let n=this.setSubmenu.call(e),o=n.querySelector("ul");o.addEventListener("click",this.pickup.bind(e)),i.align._alignList=o.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null,o=null},setSubmenu:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-list-layer",t.innerHTML='
",t},on:function(){const e=this.context.align,t=e._alignList,i=this.commandMap.ALIGN.getAttribute("data-focus")||"left";if(i!==e.currentAlign){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(l=0,s=a.length;l";return r+=" ",r+="",i.innerHTML=r,i},on:function(){const e=this.context.font,t=e._fontList,i=this.commandMap.FONT.textContent;if(i!==e.currentFont){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(let e=0,t=n.length;e"}return o+=" ",i.innerHTML=o,i},on:function(){const e=this.context.fontSize,t=e._sizeList,i=(this.commandMap.SIZE.textContent.match(/\d+/)||[""])[0];if(i!==e.currentSize){for(let e=0,n=t.length;e
  • ",t},appendHr:function(e){const t=this.util.createElement("HR");t.className=e,this.focus();let i=this.insertComponent(t);this.setRange(i,0,i,0)},horizontalRulePick:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=null;for(;!i&&!/UL/i.test(t.tagName);)i=t.getAttribute("data-value"),t=t.parentNode;i&&(this.plugins.horizontalRule.appendHr.call(this,"__se__"+i),this.submenuOff())}},list:{name:"list",add:function(e,t){const i=e.context;i.list={_list:null,currentList:""};let n=this.setSubmenu.call(e),o=n.querySelector("ul");o.addEventListener("click",this.pickup.bind(e)),i.list._list=o.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null,o=null},setSubmenu:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-submenu se-list-layer",t.innerHTML='
    ",t},on:function(){const e=this.context.list,t=e._list,i=this.commandMap.LI.getAttribute("data-focus")||"";if(i!==e.currentList){for(let e=0,n=t.length;e"),e.innerHTML+=t.outerHTML,i&&(e.innerHTML+="
    ")}else e.innerHTML=t.innerHTML;r.appendChild(e),s||(h=r),s&&d===c&&!this.util.isRangeFormatElement(p)||(u||(u=r),o&&s&&d===c||s&&this.util.isList(c)&&c===a||r.parentNode!==d&&d.insertBefore(r,p)),this.util.removeItem(t),o&&null===g&&(g=r.children.length-1),s&&this.util.getRangeFormatElement(c,m)!==this.util.getRangeFormatElement(a,m)&&(r=this.util.createElement(i)),f&&0===f.children.length&&this.util.removeItem(f)}else this.util.removeItem(t);g&&(u=u.children[g]),a&&(p=r.children.length-1,r.innerHTML+=d.innerHTML,h=r.children[p],this.util.removeItem(d)),l=s=this.util.getEdgeChildNodes(u.firstChild,h.lastChild)}else{const e=this.util.getRangeFormatElement(this.getSelectionNode()),t=e&&e.tagName===i;let o,a;const r=function(e){return!this.isComponent(e)}.bind(this.util);t||(a=this.util.createElement(i));for(let e,c,d=0,u=n.length;d1?this.setRange(l.sc,0,s.ec,s.ec.textContent.length):this.setRange(l.ec,l.ec.textContent.length,s.ec,s.ec.textContent.length),this.submenuOff()}},table:{name:"table",add:function(e,t){const i=e.context;i.table={_element:null,_tdElement:null,_trElement:null,_trElements:null,_tableXY:[],_maxWidth:!0,resizeIcon:null,resizeText:null,headerButton:null,mergeButton:null,splitButton:null,splitMenu:null,maxText:e.lang.controller.maxSize,minText:e.lang.controller.minSize,_physical_cellCnt:0,_logical_cellCnt:0,_rowCnt:0,_rowIndex:0,_physical_cellIndex:0,_logical_cellIndex:0,_current_colSpan:0,_current_rowSpan:0};let n=this.setSubmenu.call(e),o=n.querySelector(".se-controller-table-picker");i.table.tableHighlight=n.querySelector(".se-table-size-highlighted"),i.table.tableUnHighlight=n.querySelector(".se-table-size-unhighlighted"),i.table.tableDisplay=n.querySelector(".se-table-size-display");let l=this.setController_table.call(e);i.table.tableController=l,i.table.resizeIcon=l.querySelector("._se_table_resize > i"),i.table.resizeText=l.querySelector("._se_table_resize > span > span"),i.table.headerButton=l.querySelector("._se_table_header"),l.addEventListener("mousedown",function(e){e.stopPropagation()},!1);let s=this.setController_tableEditor.call(e);i.table.resizeDiv=s,i.table.splitMenu=s.querySelector(".se-btn-group-sub"),i.table.mergeButton=s.querySelector("._se_table_merge_button"),i.table.splitButton=s.querySelector("._se_table_split_button"),s.addEventListener("mousedown",function(e){e.stopPropagation()},!1),o.addEventListener("mousemove",this.onMouseMove_tablePicker.bind(e)),o.addEventListener("click",this.appendTable.bind(e)),s.addEventListener("click",this.onClick_tableController.bind(e)),l.addEventListener("click",this.onClick_tableController.bind(e)),t.parentNode.appendChild(n),i.element.relative.appendChild(s),i.element.relative.appendChild(l),n=null,o=null,s=null,l=null},setSubmenu:function(){const e=this.util.createElement("DIV");return e.className="se-submenu se-selector-table",e.innerHTML='
    1 x 1
    ',e},setController_table:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-table",t.innerHTML='
    ",t},setController_tableEditor:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-table-cell",t.innerHTML='
    • '+e.controller.VerticalSplit+'
    • '+e.controller.HorizontalSplit+"
    ",t},appendTable:function(){const e=this.util.createElement("TABLE"),t=this.plugins.table.createCells,i=this.context.table._tableXY[0];let n=this.context.table._tableXY[1],o="";for(;n>0;)o+=""+t.call(this,"td",i)+"",--n;o+="",e.innerHTML=o,this.insertComponent(e),this.focus(),this.plugins.table.reset_table_picker.call(this)},createCells:function(e,t,i){if(e=e.toLowerCase(),i){const t=this.util.createElement(e);return t.innerHTML="
    ",t}{let i="";for(;t>0;)i+="<"+e+">
    ",t--;return i}},onMouseMove_tablePicker:function(e){e.stopPropagation();let t=this._w.Math.ceil(e.offsetX/18),i=this._w.Math.ceil(e.offsetY/18);t=t<1?1:t,i=i<1?1:i,this.context.table.tableHighlight.style.width=t+"em",this.context.table.tableHighlight.style.height=i+"em";let n=t<5?5:t>9?10:t+1,o=i<5?5:i>9?10:i+1;this.context.table.tableUnHighlight.style.width=n+"em",this.context.table.tableUnHighlight.style.height=o+"em",this.util.changeTxt(this.context.table.tableDisplay,t+" x "+i),this.context.table._tableXY=[t,i]},reset_table_picker:function(){if(!this.context.table.tableHighlight)return;const e=this.context.table.tableHighlight.style,t=this.context.table.tableUnHighlight.style;e.width="1em",e.height="1em",t.width="5em",t.height="5em",this.util.changeTxt(this.context.table.tableDisplay,"1 x 1"),this.submenuOff()},init:function(){const e=this.context.table,t=this.plugins.table;if(t._removeEvents.call(this),t._selectedTable){const e=t._selectedTable.querySelectorAll(".se-table-selected-cell");for(let t=0,i=e.length;t0)for(let e,t=0;tl||(u>=e.index?(n+=e.cs,u+=e.cs,e.rs-=1,e.row=l+1,e.rs<1&&(r.splice(t,1),t--)):h===g-1&&(e.rs-=1,e.row=l+1,e.rs<1&&(r.splice(t,1),t--)));if(l===s&&h===o){i._logical_cellIndex=u;break}d>0&&a.push({index:u,cs:c+1,rs:d,row:-1}),n+=c}r=r.concat(a).sort(function(e,t){return e.index-t.index}),a=[]}a=null,r=null}},editTable:function(e,t){const i=this.plugins.table,n=this.context.table,o=n._element,l="row"===e;if(l){const e=n._trElement.parentNode;if(/^THEAD$/i.test(e.nodeName)){if("up"===t)return;if(!e.nextElementSibling||!/^TBODY$/i.test(e.nextElementSibling.nodeName))return void(o.innerHTML+=""+i.createCells.call(this,"td",n._logical_cellCnt,!1)+"")}}if(i._ref){const e=n._tdElement,o=i._selectedCells;if(l)if(t)i.setCellInfo.call(this,"up"===t?o[0]:o[o.length-1],!0),i.editRow.call(this,t,e);else{let e=o[0].parentNode;const n=[o[0]];for(let t,i=1,l=o.length;is&&s>t&&(e[o].rowSpan=i+a,c-=n)}if(n){const e=r[l+1];if(e){const t=[];let i=r[l].cells,n=0;for(let e,o,l=0,s=i.length;l1&&(e.rowSpan-=1,t.push({cell:e.cloneNode(!1),index:o}));if(t.length>0){let o=t.shift();i=e.cells,n=0;for(let l,s,a=0,r=i.length;a=o.index)||(a--,n--,n+=o.cell.colSpan-1,e.insertBefore(o.cell,l),o=t.shift()));a++);if(o){e.appendChild(o.cell);for(let i=0,n=t.length;i0){const e=!l[b+1];for(let t,i=0;i_||(p>=t.index?(p=b+(f+=t.cs),t.rs-=1,t.row=_+1,t.rs<1&&(d.splice(i,1),i--)):e&&(t.rs-=1,t.row=_+1,t.rs<1&&(d.splice(i,1),i--)))}i>0&&c.push({rs:i,cs:r+1,index:p,row:-1}),p>=t&&p+r<=t+s?h.push(e):p<=t+s&&p+r>=t?e.colSpan-=n.getOverlapRangeAtIndex(a,a+s,p,p+r):i>0&&(pt+s)&&g.push({cell:e,i:_,rs:_+i}),f+=r}else{if(b>=t)break;if(r>0){if(u<1&&r+b>=t){e.colSpan+=1,t=null,u=i+1;break}t-=r}if(!m){for(let e,i=0;i0){u-=1;continue}null!==t&&l.length>0&&(p=this.plugins.table.createCells.call(this,l[0].nodeName,0,!0),p=e.insertBefore(p,l[t]))}}if(o){let e,t;for(let i,o=0,l=h.length;o1)c.colSpan=this._w.Math.floor(e/2),o.colSpan=e-c.colSpan,s.insertBefore(c,o.nextElementSibling);else{let t=[],i=[];for(let s,r,c=0,d=n._rowCnt;c0)for(let e,t=0;tc||(u>=e.index?(r+=e.cs,u+=e.cs,e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)):h===g-1&&(e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)));if(u<=a&&d>0&&t.push({index:u,cs:l+1,rs:d,row:-1}),n!==o&&u<=a&&u+l>=a+e-1){n.colSpan+=1;break}if(u>a)break;r+=l}i=i.concat(t).sort(function(e,t){return e.index-t.index}),t=[]}s.insertBefore(c,o.nextElementSibling)}}else{const e=o.rowSpan;if(c.colSpan=o.colSpan,e>1){c.rowSpan=this._w.Math.floor(e/2);const i=e-c.rowSpan,n=[],r=t.getArrayIndex(l,s)+i;for(let e,t,i=0;i=a);c++)(l=(o=e[c]).rowSpan-1)>0&&l+i>=r&&s=h.index&&(r+=h.cs,o+=h.cs,h=n.shift()),o>=a||l===s-1){d.insertBefore(c,e.nextElementSibling);break}r+=t}o.rowSpan=i}else{c.rowSpan=o.rowSpan;const e=t.createElement("TR");e.appendChild(c);for(let e,t=0;t=r&&(e[i].rowSpan+=1)}const i=n._physical_cellIndex,a=s.cells;for(let e=0,t=a.length;e0&&s+l>=n&&(e.rowSpan-=i.getOverlapRangeAtIndex(n,o,s,s+l));else l.push(e[s]);for(let e=0,t=l.length;e"+this.plugins.table.createCells.call(this,"th",this.context.table._logical_cellCnt,!1)+"",n.insertBefore(t,n.firstElementChild)}e.toggleClass(t,"active"),/TH/i.test(this.context.table._tdElement.nodeName)?this.controllersOff():this.plugins.table.setPositionControllerDiv.call(this,this.context.table._tdElement,!1)},resizeTable:function(){const e=this.context.table,t=e.resizeIcon,i=e.resizeText;let n="se-icon-expansion",o="se-icon-reduction",l=e.minText,s="100%";e._maxWidth||(n="se-icon-reduction",o="se-icon-expansion",l=e.maxText,s="auto"),this.util.removeClass(t,n),this.util.addClass(t,o),this.util.changeTxt(i,l),e._element.style.width=s},setActiveButton:function(e,t){const i=this.context.table;t&&e!==t?(i.splitButton.setAttribute("disabled",!0),i.mergeButton.removeAttribute("disabled")):(i.splitButton.removeAttribute("disabled"),i.mergeButton.setAttribute("disabled",!0))},_bindOnSelect:null,_bindOffSelect:null,_bindOffShift:null,_selectedCells:null,_shift:!1,_fixedCell:null,_fixedCellName:null,_selectedCell:null,_selectedTable:null,_ref:null,_toggleEditor:function(e){this.context.element.wysiwyg.setAttribute("contenteditable",e),e?this.util.removeClass(this.context.element.wysiwyg,"se-disabled"):this.util.addClass(this.context.element.wysiwyg,"se-disabled")},_offCellMultiSelect:function(e){e.stopPropagation();const t=this.plugins.table;t._shift?t._initBind&&(this._wd.removeEventListener("touchmove",t._initBind),t._initBind=null):(t._removeEvents.call(this),t._toggleEditor.call(this,!0)),t._fixedCell&&t._selectedTable&&(t.setActiveButton.call(this,t._fixedCell,t._selectedCell),t.call_controller_tableEdit.call(this,t._selectedCell||t._fixedCell),t._selectedCells=t._selectedTable.querySelectorAll(".se-table-selected-cell"),t._shift||(t._fixedCell=null,t._selectedCell=null,t._fixedCellName=null),this._editorRange(),this.focus())},_onCellMultiSelect:function(e){const t=this.plugins.table,i=this.util.getParentElement(e.target,this.util.isCell);if(t._shift)i===t._fixedCell?t._toggleEditor.call(this,!0):t._toggleEditor.call(this,!1);else if(!t._ref){if(i===t._fixedCell)return;t._toggleEditor.call(this,!1)}i&&i!==t._selectedCell&&t._fixedCellName===i.nodeName&&t._selectedTable===this.util.getParentElement(i,"TABLE")&&(t._selectedCell=i,t._setMultiCells.call(this,t._fixedCell,i))},_setMultiCells:function(e,t){const i=this.plugins.table,n=i._selectedTable.rows,o=this.util,l=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=l.length;e0)for(let e,t=0;td||(u>=e.index?(l+=e.cs,u+=e.cs,e.rs-=1,e.row=d+1,e.rs<1&&(a.splice(t,1),t--)):p===m-1&&(e.rs-=1,e.row=d+1,e.rs<1&&(a.splice(t,1),t--)));if(s){if(n!==e&&n!==t||(c.cs=null!==c.cs&&c.csu+h?c.ce:u+h,c.rs=null!==c.rs&&c.rsd+g?c.re:d+g,c._i+=1),2===c._i){s=!1,a=[],r=[],d=-1;break}}else if(o.getOverlapRangeAtIndex(c.cs,c.ce,u,u+h)&&o.getOverlapRangeAtIndex(c.rs,c.re,d,d+g)){const e=c.csu+h?c.ce:u+h,i=c.rsd+g?c.re:d+g;if(c.cs!==e||c.ce!==t||c.rs!==i||c.re!==l){c.cs=e,c.ce=t,c.rs=i,c.re=l,d=-1,a=[],r=[];break}o.addClass(n,"se-table-selected-cell")}g>0&&r.push({index:u,cs:h+1,rs:g,row:-1}),l+=n.colSpan-1}a=a.concat(r).sort(function(e,t){return e.index-t.index}),r=[]}},_removeEvents:function(){const e=this.plugins.table;e._initBind&&(this._wd.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._wd.removeEventListener("mousedown",e._bindOnSelect),this._wd.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._wd.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._wd.removeEventListener("keyup",e._bindOffShift),e._bindOffShift=null)},_initBind:null,onTableCellMultiSelect:function(e,t){const i=this.plugins.table;i._removeEvents.call(this),this.controllersOff(),i._shift=t,i._fixedCell=e,i._fixedCellName=e.nodeName,i._selectedTable=this.util.getParentElement(e,"TABLE");const n=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=n.length;e<'+e+a+">"+l+"";return o+="",i.innerHTML=o,i},on:function(){const e=this.context.formatBlock,t=e._formatList,i=(this.commandMap.FORMAT.getAttribute("data-focus")||"P").toLowerCase();if(i!==e.currentFormat){for(let e=0,n=t.length;e";return i+=" ",i+="",t.innerHTML=i,t},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation();const t=this.context.option.templates[e.target.getAttribute("data-value")];if(!t.html)throw this.submenuOff(),Error('[SUNEDITOR.template.fail] cause : "templates[i].html not found"');this.setContents(t.html),this.submenuOff()}},link:{name:"link",add:function(e){e.addModule([o]);const t=e.context;t.link={focusElement:null,linkNewWindowCheck:null,linkAnchorText:null,_linkAnchor:null};let i=this.setDialog.call(e);t.link.modal=i,t.link.focusElement=i.querySelector("._se_link_url"),t.link.linkAnchorText=i.querySelector("._se_link_text"),t.link.linkNewWindowCheck=i.querySelector("._se_link_check");let n=this.setController_LinkButton.call(e);t.link.linkBtn=n,t.link._linkAnchor=null,n.addEventListener("mousedown",function(e){e.stopPropagation()},!1),i.querySelector(".se-btn-primary").addEventListener("click",this.submit.bind(e)),n.addEventListener("click",this.onClick_linkBtn.bind(e)),t.dialog.modal.appendChild(i),t.element.relative.appendChild(n),i=null,n=null},setDialog:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-dialog-content",t.style.display="none",t.innerHTML='",t},setController_LinkButton:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-link",t.innerHTML='
    ",t},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=function(){if(0===this.context.link.focusElement.value.trim().length)return!1;const e=this.context.link,t=e.focusElement.value,i=e.linkAnchorText,n=0===i.value.length?t:i.value;if(this.context.dialog.updateModal)e._linkAnchor.href=t,e._linkAnchor.textContent=n,e._linkAnchor.target=e.linkNewWindowCheck.checked?"_blank":"",this.history.push(),this.setRange(e._linkAnchor.childNodes[0],0,e._linkAnchor.childNodes[0],e._linkAnchor.textContent.length);else{const i=this.util.createElement("A");i.href=t,i.textContent=n,i.target=e.linkNewWindowCheck.checked?"_blank":"",this.insertNode(i),this.setRange(i.childNodes[0],0,i.childNodes[0],i.textContent.length)}e.focusElement.value="",e.linkAnchorText.value=""}.bind(this);try{t()}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.focus()}return!1},on:function(e){e||(this.context.link.linkAnchorText.value=this.getSelection().toString())},call_controller_linkButton:function(e){this.editLink=this.context.link._linkAnchor=e;const t=this.context.link.linkBtn,i=t.querySelector("a");i.href=e.href,i.title=e.textContent,i.textContent=e.textContent;const n=this.util.getOffset(e,this.context.element.wysiwygFrame);t.style.top=n.top+e.offsetHeight+10+"px",t.style.left=n.left-this.context.element.wysiwygFrame.scrollLeft+"px",t.style.display="block";const o=this.context.element.wysiwygFrame.offsetWidth-(t.offsetLeft+t.offsetWidth);o<0?(t.style.left=t.offsetLeft+o+"px",t.firstElementChild.style.left=20-o+"px"):t.firstElementChild.style.left="20px",this.controllersOn(t)},onClick_linkBtn:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");t&&(e.preventDefault(),/update/.test(t)?(this.context.link.focusElement.value=this.context.link._linkAnchor.href,this.context.link.linkAnchorText.value=this.context.link._linkAnchor.textContent,this.context.link.linkNewWindowCheck.checked=!!/_blank/i.test(this.context.link._linkAnchor.target),this.plugins.dialog.open.call(this,"link",!0)):(this.util.removeItem(this.context.link._linkAnchor),this.context.link._linkAnchor=null,this.focus()),this.controllersOff(),this.history.push())},init:function(){const e=this.context.link;e.linkBtn.style.display="none",e._linkAnchor=null,e.focusElement.value="",e.linkAnchorText.value="",e.linkNewWindowCheck.checked=!1}},image:{name:"image",add:function(e){e.addModule([o,l,s]);const t=e.context;t.image={_linkElement:null,_container:null,_cover:null,_element:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_origin_w:"auto"===t.option.imageWidth?"":t.option.imageWidth,_origin_h:"",_altText:"",_caption:null,captionCheckEl:null,_linkValue:"",_align:"none",_captionChecked:!1,_proportionChecked:!0,_floatClassRegExp:"__se__float\\-[a-z]+",_xmlHttp:null,_resizing:t.option.imageResizing,_defaultAuto:"auto"===t.option.imageWidth,_uploadFileLength:0};let i=this.setDialog.call(e);t.image.modal=i,t.image.imgUrlFile=i.querySelector("._se_image_url"),t.image.imgInputFile=t.image.focusElement=i.querySelector("._se_image_file"),t.image.altText=i.querySelector("._se_image_alt"),t.image.imgLink=i.querySelector("._se_image_link"),t.image.imgLinkNewWindowCheck=i.querySelector("._se_image_link_check"),t.image.captionCheckEl=i.querySelector("._se_image_check_caption"),t.image.modal.querySelector(".se-dialog-tabs").addEventListener("click",this.openTab.bind(e)),t.image.modal.querySelector(".se-btn-primary").addEventListener("click",this.submit.bind(e)),t.image.imageX={},t.image.imageY={},t.option.imageResizing&&(t.image.proportion=i.querySelector("._se_image_check_proportion"),t.image.imageX=i.querySelector("._se_image_size_x"),t.image.imageY=i.querySelector("._se_image_size_y"),t.image.imageX.value=t.option.imageWidth,t.image.imageX.addEventListener("change",this.setInputSize.bind(e,"x")),t.image.imageY.addEventListener("change",this.setInputSize.bind(e,"y")),i.querySelector(".se-dialog-btn-revert").addEventListener("click",this.sizeRevert.bind(e))),t.dialog.modal.appendChild(i),i=null},setDialog:function(){const e=this.context.option,t=this.lang,i=this.util.createElement("DIV");i.className="se-dialog-content",i.style.display="none";let n='
    '+t.dialogBox.imageBox.title+'
    ';return e.imageFileInput&&(n+='
    '),e.imageUrlInput&&(n+='
    '),n+='
    ',e.imageResizing&&(n+='
    '),n+='
    ",i.innerHTML=n,i},openTab:function(e){const t=this.context.image.modal,i="init"===e?t.querySelector("._se_tab_link"):e.target;if(!/^BUTTON$/i.test(i.tagName))return!1;const n=i.getAttribute("data-tab-link");let o,l,s;for(l=t.getElementsByClassName("_se_tab_content"),o=0;o0){let t=0;const i=[];for(let n=0,o=e.length;n0){let e=0;const i=this._variable._imagesInfo;for(let t=0,n=i.length;tn){const i="[SUNEDITOR.imageUpload.fail] Size of uploadable total images: "+n/1e3+"KB";return this._imageUploadError(i,{limitSize:n,currentSize:e,uploadSize:t})&&s.open.call(this,i),void this.closeLoading()}}this.context.image._uploadFileLength=i.length;const o=this.context.option.imageUploadUrl,l=this.context.option.imageUploadHeader,a=this.context.dialog.updateModal?1:i.length;if("string"==typeof o&&o.length>0){const e=new FormData;for(let t=0;t0)for(let e in l)this.context.image._xmlHttp.setRequestHeader(e,l[e]);this.context.image._xmlHttp.send(e)}else for(let e=0;e0){const n=this.util.createElement("A");return n.href=/^https?:\/\//.test(t)?t:"http://"+t,n.target=i?"_blank":"",n.setAttribute("data-image-link","image"),e.setAttribute("data-image-link",t),n.appendChild(e),n}return e},setInputSize:function(e){if(!this.context.dialog.updateModal)return;const t=this.context.image;t.proportion.checked&&("x"===e?t.imageY.value=Math.round(t._element_h/t._element_w*t.imageX.value):t.imageX.value=Math.round(t._element_w/t._element_h*t.imageY.value))},submit:function(e){const t=this.context.image,i=this.plugins.image;this.showLoading(),e.preventDefault(),e.stopPropagation(),t._linkValue=t.imgLink.value,t._altText=t.altText.value,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked,t._resizing&&(t._proportionChecked=t.proportion.checked);try{this.context.dialog.updateModal&&i.update_image.call(this,!1,!1),t.imgInputFile&&t.imgInputFile.files.length>0?i.onRender_imgInput.call(this):t.imgUrlFile&&t.imgUrlFile.value.trim().length>0?i.onRender_imgUrl.call(this):this.closeLoading()}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.image.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},setImagesInfo:function(e,t){const i=this._variable._imagesInfo;let n=e.getAttribute("data-index"),o=null,l="";if(n){l="update",n*=1;for(let e=0,t=i.length;e-1||(t.splice(i,1),this._imageUpload(null,e,"delete",null,0),i--)},_onload_image:function(e,t){t&&this.plugins.image.setImagesInfo.call(this,e,t)},create_image:function(e,t,i,n,o,l){const s=this.context.image;let a=this.util.createElement("IMG");a.addEventListener("load",this.plugins.image._onload_image.bind(this,a,l)),a.src=e,a.setAttribute("data-align",o),a.alt=s._altText,(a=this.plugins.image.onRender_link.call(this,a,t,i)).setAttribute("data-rotate","0"),s._resizing&&(/\d+/.test(n)&&((n=1*n.match(/\d+/)[0])>0?a.style.width=n+"px":n=""),a.setAttribute("data-proportion",s._proportionChecked));const r=this.plugins.resizing.set_cover.call(this,a),c=this.plugins.resizing.set_container.call(this,r,"se-image-container");s._captionChecked&&(s._caption=this.plugins.resizing.create_caption.call(this),s._caption.setAttribute("contenteditable",!1),r.appendChild(s._caption)),r.style.margin="none"!==o?"auto":"0",this.util.removeClass(c,s._floatClassRegExp),this.util.addClass(c,"__se__float-"+o),s._resizing&&/\d+/.test(n)||(this.context.resizing._resize_plugin="image",s._element=a,s._cover=r,s._container=c,this.plugins.image.setAutoSize.call(this)),this.insertComponent(c)},update_image:function(e,t){const i=this.context.image,n=i._linkValue;let o=i._element,l=i._cover,s=i._container,a=!1;const r=1*i.imageX.value!==o.offsetWidth||1*i.imageY.value!==o.offsetHeight;if(null===l&&(a=!0,o=i._element.cloneNode(!0),l=this.plugins.resizing.set_cover.call(this,o)),null===s&&(l=l.cloneNode(!0),a=!0,s=this.plugins.resizing.set_container.call(this,l,"se-image-container")),a&&(s.innerHTML="",s.appendChild(l)),o.alt=i._altText,i._resizing&&(o.setAttribute("data-proportion",i._proportionChecked),r&&this.plugins.image.setSize.call(this,i.imageX.value,i.imageY.value)),i._captionChecked?i._caption||(i._caption=this.plugins.resizing.create_caption.call(this),l.appendChild(i._caption)):i._caption&&(this.util.removeItem(i._caption),i._caption=null),i._align&&"none"!==i._align?l.style.margin="auto":l.style.margin="0",this.util.removeClass(s,this.context.image._floatClassRegExp),this.util.addClass(s,"__se__float-"+i._align),o.setAttribute("data-align",i._align),n.trim().length>0)if(null!==i._linkElement)i._linkElement.href=n,i._linkElement.target=i.imgLinkNewWindowCheck.checked?"_blank":"",o.setAttribute("data-image-link",n);else{let e=this.plugins.image.onRender_link.call(this,o,n,this.context.image.imgLinkNewWindowCheck.checked);l.insertBefore(e,i._caption)}else if(null!==i._linkElement){const e=o;e.setAttribute("data-image-link","");let t=e.cloneNode(!0);l.removeChild(i._linkElement),l.insertBefore(t,i._caption),o=t}if(a){const e=this.util.isRangeFormatElement(i._element.parentNode)||this.util.isWysiwygDiv(i._element.parentNode)?i._element:/^A$/i.test(i._element.parentNode.nodeName)?i._element.parentNode:this.util.getFormatElement(i._element)||i._element;e.parentNode.insertBefore(s,e),this.util.removeItem(e),o=s.querySelector("img")}if(!e&&(/\d+/.test(o.style.height)||i._resizing&&r||this.context.resizing._rotateVertical&&i._captionChecked)&&this.plugins.resizing.setTransformSize.call(this,o,null,null),e&&this.plugins.image.setImagesInfo.call(this,o,{name:o.getAttribute("data-file-name")||o.src.split("/").pop(),size:o.getAttribute("data-file-size")||0}),t){this.plugins.image.init.call(this);const e=this.plugins.resizing.call_controller_resize.call(this,o,"image");this.plugins.image.onModifyMode.call(this,o,e)}this.history.push()},update_src:function(e,t,i){t.src=e,this._w.setTimeout(this.plugins.image.setImagesInfo.bind(this,t,i))},sizeRevert:function(){const e=this.context.image;e._origin_w&&(e.imageX.value=e._element_w=e._origin_w,e.imageY.value=e._element_h=e._origin_h)},onModifyMode:function(e,t){const i=this.context.image;i._linkElement=/^A$/i.test(e.parentNode.nodeName)?e.parentNode:null,i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,".se-image-container"),i._caption=this.util.getChildElement(i._cover,"FIGCAPTION"),i._align=e.getAttribute("data-align")||"none",t&&(i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l);let n=i._element.getAttribute("data-origin");n?(n=n.split(","),i._origin_w=1*n[0],i._origin_h=1*n[1]):t&&(i._origin_w=t.w,i._origin_h=t.h,i._element.setAttribute("data-origin",t.w+","+t.h))},openModify:function(e){const t=this.context.image;t.imgUrlFile.value=t._element.src,t._altText=t.altText.value=t._element.alt,t._linkValue=t.imgLink.value=null===t._linkElement?"":t._linkElement.href,t.imgLinkNewWindowCheck.checked=t._linkElement&&"_blank"===t._linkElement.target,t.modal.querySelector('input[name="suneditor_image_radio"][value="'+t._align+'"]').checked=!0,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked=!!t._caption,t._resizing&&(t.proportion.checked=t._proportionChecked="false"!==t._element.getAttribute("data-proportion"),t.imageX.value=t._element.offsetWidth,t.imageY.value=t._element.offsetHeight,t.imageX.disabled=!1,t.imageY.disabled=!1,t.proportion.disabled=!1),e||this.plugins.dialog.open.call(this,"image",!0)},on:function(e){if(!e){const e=this.context.image;e.imageX.value=e._origin_w=e._defaultAuto?"":this.context.option.imageWidth,e.imageY.value=e._origin_h=""}},setSize:function(e,t){const i=this.context.image;i._element.style.width=/^\d+$/.test(e)?e+"px":e,i._element.style.height=/^\d+$/.test(t)?t+"px":t},setAutoSize:function(){const e=this.context.image;this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this);const t=(e._element.getAttribute("data-origin")||"").split(",");e._element.style.maxWidth="100%",e._element.style.width=t[0]?t[0]+"px":"100%",e._element.style.height="",e._cover.style.width="",e._cover.style.height=""},setPercentSize:function(e){const t=this.context.image;t._element.style.maxWidth="100%",t._container.style.width=e,t._container.style.height="",t._cover.style.width="100%",t._cover.style.height="",t._element.style.width="100%",t._element.style.height="",/100/.test(e)&&(this.util.removeClass(t._container,this.context.image._floatClassRegExp),this.util.addClass(t._container,"__se__float-center"))},cancelPercentAttr:function(){const e=this.context.image;e._element.style.maxWidth="none",e._cover.style.width="",e._cover.style.height="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.image._floatClassRegExp),this.util.addClass(e._container,"__se__float-"+e._align)},resetAlign:function(){const e=this.context.image;e._element.setAttribute("data-align",""),e._align="none",e._cover.style.margin="0",this.util.removeClass(e._container,e._floatClassRegExp)},destroy:function(e){const t=e||this.context.image._element,i=this.util.getParentElement(t,".se-image-container")||t,n=1*t.getAttribute("data-index");if(this.util.removeItem(i),this.plugins.image.init.call(this),this.controllersOff(),this.history.push(),n>=0){const e=this._variable._imagesInfo;for(let t=0,i=e.length;t '+t.dialogBox.videoBox.title+'
    ';return e.videoResizing&&(n+='
    '),n+='
    ",i.innerHTML=n,i},setInputSize:function(e){this.context.video.proportion.checked&&("x"===e?this.context.video.videoHeight.value=Math.round(this.context.video._element_h/this.context.video._element_w*this.context.video.videoWidth.value):this.context.video.videoWidth.value=Math.round(this.context.video._element_w/this.context.video._element_h*this.context.video.videoHeight.value))},submitAction:function(){if(0===this.context.video.focusElement.value.trim().length)return!1;const e=this.context.video,t=/^\d+$/.test(e.videoWidth.value)?e.videoWidth.value:this.context.option.videoWidth,i=/^\d+$/.test(e.videoHeight.value)?e.videoHeight.value:this.context.option.videoHeight;let n=null,o=null,l=null,s=e.focusElement.value.trim();if(e._align=e.modal.querySelector('input[name="suneditor_video_radio"]:checked').value,/^$/.test(s))n=(new this._w.DOMParser).parseFromString(s,"text/html").querySelector("iframe");else{if(n=this.util.createElement("IFRAME"),/youtu\.?be/.test(s)&&(s=s.replace("watch?v=",""),/^\/\/.+\/embed\//.test(s)||(s=s.replace(s.match(/\/\/.+\//)[0],"//www.youtube.com/embed/")),e._youtubeQuery.length>0))if(/\?/.test(s)){const t=s.split("?");s=t[0]+"?"+e._youtubeQuery+"&"+t[1]}else s+="?"+e._youtubeQuery;n.src=s}this.context.dialog.updateModal?(e._element.src=n.src,l=e._container,o=this.util.getParentElement(e._element,"FIGURE"),n=e._element):(n.frameBorder="0",n.allowFullscreen=!0,n.onload=function(){this.setAttribute("origin-size",this.offsetWidth+","+this.offsetHeight),this.setAttribute("data-origin",this.offsetWidth+","+this.offsetHeight),this.style.height=this.offsetHeight+"px"}.bind(n),e._element=n,o=this.plugins.resizing.set_cover.call(this,n),l=this.plugins.resizing.set_container.call(this,o,"se-video-container"),this._variable._videosCnt++),e._cover=o,e._container=l;const a=1*t!==n.offsetWidth||1*i!==n.offsetHeight;e._resizing&&(this.context.video._proportionChecked=e.proportion.checked,n.setAttribute("data-proportion",e._proportionChecked)),e._captionChecked?e._caption||(e._caption=this.plugins.resizing.create_caption.call(this),o.appendChild(e._caption)):e._caption&&(this.util.removeItem(e._caption),e._caption=null),a&&this.plugins.video.setSize.call(this,t,i),e._align&&"none"!==e._align?o.style.margin="auto":o.style.margin="0",this.util.removeClass(l,this.context.video._floatClassRegExp),this.util.addClass(l,"__se__float-"+e._align),n.setAttribute("data-align",e._align),this.context.dialog.updateModal?(/\d+/.test(o.style.height)||e._resizing&&a||this.context.resizing._rotateVertical&&e._captionChecked)&&this.plugins.resizing.setTransformSize.call(this,n,null,null):this.insertComponent(l),this.history.push()},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation(),this.context.video._captionChecked=this.context.video.captionCheckEl.checked;try{this.plugins.video.submitAction.call(this)}finally{this.plugins.dialog.close.call(this),this.closeLoading()}return this.focus(),!1},_update_videoCover:function(e){const t=this.context.video;e.frameBorder="0",e.allowFullscreen=!0,e.onload=function(){this.setAttribute("origin-size",this.offsetWidth+","+this.offsetHeight),this.setAttribute("data-origin",this.offsetWidth+","+this.offsetHeight),this.style.height=this.offsetHeight+"px"}.bind(e);const i=this.util.getParentElement(e,this.util.isComponent)||this.util.getParentElement(e,function(e){return this.isWysiwygDiv(e.parentNode)}.bind(this.util));t._element=e=e.cloneNode(!1);const n=this.plugins.resizing.set_cover.call(this,e),o=this.plugins.resizing.set_container.call(this,n,"se-video-container"),l=i.getElementsByTagName("FIGCAPTION")[0];if(l){const e=this.plugins.resizing.create_caption.call(this);e.innerHTML=l.innerHTML,n.appendChild(e)}const s=(e.getAttribute("origin-size")||"").split(","),a=s[0]||this.context.option.videoWidth,r=s[1]||this.context.option.videoHeight;this.plugins.video.setSize.call(this,a,r),i.parentNode.insertBefore(o,i),this.util.removeItem(i)},sizeRevert:function(){const e=this.context.video;e._origin_w&&(e.videoWidth.value=e._element_w=e._origin_w,e.videoHeight.value=e._element_h=e._origin_h)},onModifyMode:function(e,t){const i=this.context.video;i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,".se-video-container"),i._caption=this.util.getChildElement(i._cover,"FIGCAPTION"),i._align=e.getAttribute("data-align")||"none",i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l;let n=i._element.getAttribute("data-origin");n?(n=n.split(","),i._origin_w=1*n[0],i._origin_h=1*n[1]):(i._origin_w=t.w,i._origin_h=t.h,i._element.setAttribute("data-origin",t.w+","+t.h))},openModify:function(e){const t=this.context.video;t.focusElement.value=t._element.src,t.videoWidth.value=t._element.offsetWidth,t.videoHeight.value=t._element.offsetHeight,t._captionChecked=t.captionCheckEl.checked=!!t._caption,t.modal.querySelector('input[name="suneditor_video_radio"][value="'+t._align+'"]').checked=!0,t._resizing&&(t.proportion.checked=t._proportionChecked="false"!==t._element.getAttribute("data-proportion"),t.proportion.disabled=!1),e||this.plugins.dialog.open.call(this,"video",!0)},checkVideosInfo:function(){const e=this.context.element.wysiwyg.getElementsByTagName("IFRAME");if(e.length===this._variable._videosCnt)return;const t=this.plugins.video;this._variable._videosCnt=e.length;for(let i,n=0,o=this._variable._videosCnt;n^<]+)?\s*(?=>)/gi,function(e,i,n){return i+("string"==typeof t[n]?t[n]:n)})},zeroWidthSpace:"​",onlyZeroWidthSpace:function(e){return"string"!=typeof e&&(e=e.textContent),""===e||this._onlyZeroWidthRegExp.test(e)},getXMLHttpRequest:function(){if(!this._w.ActiveXObject)return this._w.XMLHttpRequest?new XMLHttpRequest:null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}},createElement:function(e){return this._d.createElement(e)},createTextNode:function(e){return this._d.createTextNode(e||"")},getIncludePath:function(e,t){let i="";const n=[],o="js"===t?"script":"link",l="js"===t?"src":"href";let s="(?:";for(let t=0,i=e.length;t0?n[0][l]:""),-1===i.indexOf(":/")&&"//"!==i.slice(0,2)&&(i=0===i.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+i:location.href.match(/^[^\?]*\/(?:)/)[0]+i),!i)throw"[SUNEDITOR.util.getIncludePath.fail] The SUNEDITOR installation path could not be automatically detected. (name: +"+name+", extension: "+t+")";return i},getPageStyle:function(){let e="";const t=this._d.styleSheets;for(let i,n=0,o=t.length;n0&&(n+="

    "+t+"

    ")}else n+=i;const o={"&":"&"," ":" ","'":""","<":"&lt;",">":"&gt;"};return e=e.replace(/&|\u00A0|'|<|>/g,function(e){return"string"==typeof o[e]?o[e]:e}),0===n.length&&(n="

    "+(e.length>0?e:"
    ")+"

    "),this._tagConvertor(n.replace(this._deleteExclusionTags,""))},convertHTMLForCodeView:function(e){let t="";const i=this._w.RegExp;return function e(n){const o=n.childNodes;for(let n,l=0,s=o.length;l]*>","i"))[0]+"\n",e(n),t+="\n"}else t+=3===n.nodeType?/^\n+$/.test(n.data)?"":n.data:n.outerHTML+"\n"}(e),t},isWysiwygDiv:function(e){return!(!e||1!==e.nodeType||!this.hasClass(e,"se-wrapper-wysiwyg")&&!/^BODY$/i.test(e.nodeName))},isFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(P|DIV|H[1-6]|LI|TH|TD)$/i.test(e.nodeName)||this.isComponent(e)||this.isWysiwygDiv(e))},isRangeFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(BLOCKQUOTE|OL|UL|PRE|FIGCAPTION|TABLE|THEAD|TBODY|TR|TH|TD)$/i.test(e.nodeName)&&"range"!==e.getAttribute("data-format"))},isComponent:function(e){return e&&(/se-component/.test(e.className)||/^(TABLE|HR)$/.test(e.nodeName))},getFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&e.firstElementChild,this.isFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getRangeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&!/^(THEAD|TBODY|TR)$/i.test(e.nodeName)&&t(e))return e;e=e.parentNode}return null},getArrayIndex:function(e,t){let i=-1;for(let n=0,o=e.length;n0&&!this.isBreak(e);)e=e.firstChild;for(;t&&1===t.nodeType&&t.childNodes.length>0&&!this.isBreak(t);)t=t.lastChild;return{sc:e,ec:t||e}}},getOffset:function(e,t){let i=0,n=0,o=3===e.nodeType?e.parentElement:e;const l=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;o&&!this.hasClass(o,"se-container")&&o!==l;)i+=o.offsetLeft,n+=o.offsetTop,o=o.offsetParent;const s=t&&/iframe/i.test(t.nodeName);return{left:i+(s?t.parentElement.offsetLeft:0),top:n-l.scrollTop+(s?t.parentElement.offsetTop:0)}},getOverlapRangeAtIndex:function(e,t,i,n){if(e<=n?ti)return 0;const o=(e>i?e:i)-(t")},isIgnoreNodeChange:function(e){return 3!==e.nodeType&&!/^(span|font|b|strong|var|i|em|u|ins|s|strike|del|sub|sup|mark)$/i.test(e.nodeName)},cleanHTML:function(e){const t=new this._w.RegExp("^(meta|script|link|style|[a-z]+:[a-z]+)$","i"),i=this._d.createRange().createContextualFragment(e).childNodes;let n="";for(let e=0,o=i.length;e(\n|.)*<\/([a-zA-Z]+\:[a-zA-Z]+|script|style)>/g,"").replace(/(<[a-zA-Z0-9]+)[^>]*(?=>)/g,function(e,t){const i=e.match(/((?:colspan|rowspan|target|href|src|class|data-file-size|data-file-name|data-origin|origin-size|data-format)\s*=\s*"[^"]*")/gi);if(i)for(let e=0,n=i.length;e^<]*)>/g,"").replace(this._deleteExclusionTags,""),this._tagConvertor(n||e)},_deleteExclusionTags:function(){const e="br|p|div|pre|blockquote|h[1-6]|ol|ul|dl|li|hr|figure|figcaption|img|iframe|audio|video|table|thead|tbody|tr|th|td|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|mark".split("|");let t="<\\/?(";for(let i=0,n=e.length;i';return n}()+("auto"===e.height?"":"");l.allowFullscreen=!0,l.frameBorder=0,l.addEventListener("load",function(){this.setAttribute("scrolling","auto"),this.contentDocument.head.innerHTML=''+t,this.contentDocument.body.className="sun-editor-editable",this.contentDocument.body.setAttribute("contenteditable",!0),this.contentDocument.body.innerHTML=o})}else l.setAttribute("contenteditable",!0),l.setAttribute("scrolling","auto"),l.className+=" sun-editor-editable",l.innerHTML=o;l.style.height=e.height,l.style.minHeight=e.minHeight,l.style.maxHeight=e.maxHeight;const s=document.createElement("TEXTAREA");s.className="se-wrapper-inner se-wrapper-code",s.style.display="none",s.style.height=e.height,s.style.minHeight=e.minHeight,s.style.maxHeight=e.maxHeight,"auto"===e.height&&(s.style.overflow="hidden");let a=null,r=null,c=null;if(e.resizingBar&&((a=document.createElement("DIV")).className="se-resizing-bar sun-editor-common",(r=document.createElement("DIV")).className="se-navigation sun-editor-common",a.appendChild(r),e.charCounter)){const t=document.createElement("DIV");if(t.className="se-char-counter-wrapper",(c=document.createElement("SPAN")).className="se-char-counter",c.textContent="0",t.appendChild(c),e.maxCharCount>0){const i=document.createElement("SPAN");i.textContent=" / "+e.maxCharCount,t.appendChild(i)}a.appendChild(t)}let d=null;return e.placeholder&&((d=document.createElement("SPAN")).className="se-placeholder",d.innerText=e.placeholder),{bottomBar:{resizingBar:a,navigation:r,charCounter:c},wysiwygFrame:l,codeView:s,placeholder:d}},_initOptions:function(e,t){t.lang=t.lang||c.a,t.mode=t.mode||"classic",t.toolbarWidth=t.toolbarWidth?/^\d+$/.test(t.toolbarWidth)?t.toolbarWidth+"px":t.toolbarWidth:"auto",t.stickyToolbar=/balloon/i.test(t.mode)?-1:void 0===t.stickyToolbar?0:/^\d+/.test(t.stickyToolbar)?1*t.stickyToolbar.toString().match(/\d+/)[0]:-1,t.iframe=t.fullPage||t.iframe,t.codeMirror=t.codeMirror?t.codeMirror.src?t.codeMirror:{src:t.codeMirror}:null,t.display=t.display||("none"!==e.style.display&&e.style.display?e.style.display:"block"),t.popupDisplay=t.popupDisplay||"full",t.resizingBar=void 0===t.resizingBar?!/inline|balloon/i.test(t.mode):t.resizingBar,t.showPathLabel=!!t.resizingBar&&("boolean"!=typeof t.showPathLabel||t.showPathLabel),t.charCounter=t.maxCharCount>0||"boolean"==typeof t.charCounter&&t.charCounter,t.maxCharCount=/^\d+$/.test(t.maxCharCount)&&t.maxCharCount>-1?1*t.maxCharCount:null,t.width=t.width?/^\d+$/.test(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=(/^\d+$/.test(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=(/^\d+$/.test(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?/^\d+$/.test(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=(/^\d+$/.test(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=(/^\d+$/.test(t.maxHeight)?t.maxHeight+"px":t.maxHeight)||"",t.font=t.font||null,t.fontSize=t.fontSize||null,t.formats=t.formats||null,t.colorList=t.colorList||null,t.imageResizing=void 0===t.imageResizing||t.imageResizing,t.imageWidth=t.imageWidth&&/\d+/.test(t.imageWidth)?t.imageWidth.toString().match(/\d+/)[0]:"auto",t.imageFileInput=void 0===t.imageFileInput||t.imageFileInput,t.imageUrlInput=void 0===t.imageUrlInput||!t.imageFileInput||t.imageUrlInput,t.imageUploadHeader=t.imageUploadHeader||null,t.imageUploadUrl=t.imageUploadUrl||null,t.imageUploadSizeLimit=/\d+/.test(t.imageUploadSizeLimit)?1*t.imageUploadSizeLimit.toString().match(/\d+/)[0]:null,t.videoResizing=void 0===t.videoResizing||t.videoResizing,t.videoWidth=t.videoWidth&&/\d+/.test(t.videoWidth)?t.videoWidth.toString().match(/\d+/)[0]:560,t.videoHeight=t.videoHeight&&/\d+/.test(t.videoHeight)?t.videoHeight.toString().match(/\d+/)[0]:315,t.youtubeQuery=(t.youtubeQuery||"").replace("?",""),t.placeholder="string"==typeof t.placeholder?t.placeholder:null,t.buttonList=t.buttonList||[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]]},_defaultButtons:function(e){return{bold:["_se_command_bold",e.toolbar.bold+" (CTRL+B)","STRONG","",''],underline:["_se_command_underline",e.toolbar.underline+" (CTRL+U)","INS","",''],italic:["_se_command_italic",e.toolbar.italic+" (CTRL+I)","EM","",''],strike:["_se_command_strike",e.toolbar.strike+" (CTRL+SHIFT+S)","DEL","",''],subscript:["_se_command_subscript",e.toolbar.subscript,"SUB","",''],superscript:["_se_command_superscript",e.toolbar.superscript,"SUP","",''],removeFormat:["",e.toolbar.removeFormat,"removeFormat","",''],indent:["",e.toolbar.indent+" (CTRL+])","indent","",''],outdent:["_se_command_outdent",e.toolbar.outdent+" (CTRL+[)","outdent","",''],fullScreen:["code-view-enabled",e.toolbar.fullScreen,"fullScreen","",''],showBlocks:["",e.toolbar.showBlocks,"showBlocks","",''],codeView:["code-view-enabled",e.toolbar.codeView,"codeView","",''],undo:["_se_command_undo",e.toolbar.undo+" (CTRL+Z)","undo","",'',!0],redo:["_se_command_redo",e.toolbar.redo+" (CTRL+Y / CTRL+SHIFT+Z)","redo","",'',!0],preview:["",e.toolbar.preview,"preview","",''],print:["",e.toolbar.print,"print","",''],save:["_se_command_save",e.toolbar.save,"save","",'',!0],font:["se-btn-select se-btn-tool-font _se_command_font_family",e.toolbar.font,"font","submenu",''+e.toolbar.font+''],formatBlock:["se-btn-select se-btn-tool-format",e.toolbar.formats,"formatBlock","submenu",''+e.toolbar.formats+''],fontSize:["se-btn-select se-btn-tool-size",e.toolbar.fontSize,"fontSize","submenu",''+e.toolbar.fontSize+''],fontColor:["",e.toolbar.fontColor,"fontColor","submenu",''],hiliteColor:["",e.toolbar.hiliteColor,"hiliteColor","submenu",''],align:["se-btn-align",e.toolbar.align,"align","submenu",''],list:["_se_command_list",e.toolbar.list,"list","submenu",''],horizontalRule:["btn_line",e.toolbar.horizontalRule,"horizontalRule","submenu",''],table:["",e.toolbar.table,"table","submenu",''],template:["",e.toolbar.template,"template","submenu",''],link:["",e.toolbar.link,"link","dialog",''],image:["",e.toolbar.image,"image","dialog",''],video:["",e.toolbar.video,"video","dialog",'']}},_createModuleGroup:function(e){const t=u.createElement("DIV");t.className="se-btn-module"+(e?"":" se-btn-module-border");const i=u.createElement("UL");return i.className="se-menu-list",t.appendChild(i),{div:t,ul:i}},_createButton:function(e,t,i,n,o,l){const s=u.createElement("LI"),a=u.createElement("BUTTON");return a.setAttribute("type","button"),a.setAttribute("class","se-btn"+(e?" "+e:"")+" se-tooltip"),a.setAttribute("data-command",i),a.setAttribute("data-display",n),o+=''+t+"",l&&a.setAttribute("disabled",!0),a.innerHTML=o,s.appendChild(a),{li:s,button:a}},_createToolBar:function(e,t,i,n){const o=e.createElement("DIV");o.className="se-toolbar-separator-vertical";const l=e.createElement("DIV");l.className="se-toolbar sun-editor-common";const s=this._defaultButtons(n),a={},r={};if(i){const e=i.length?i:Object.keys(i).map(function(e){return i[e]});for(let t=0,i=e.length;tr&&(c=c.slice(0,r),s&&s.setAttribute("disabled",!0)),c[r]={contents:i,s:{path:o.getNodePath(n.startContainer),offset:n.startOffset},e:{path:o.getNodePath(n.endContainer),offset:n.endOffset}},1===r&&l&&l.removeAttribute("disabled"),e._checkComponents(),e._charCount(0,!1),t()}()},500)},undo:function(){r>0&&(r--,d())},redo:function(){c.length-1>r&&(r++,d())},reset:function(){c=c[r=0]}}},m={init:function(e){return{create:function(t,i){return this.create(t,i,e)}.bind(this)}},create:function(e,t,i){"object"!=typeof t&&(t={}),i&&(t=[i,t].reduce(function(e,t){return Object.keys(t).forEach(function(i){if("plugins"===i&&t[i]&&e[i]){let n=e[i],o=t[i];n=n.length?n:Object.keys(n).map(function(e){return n[e]}),o=o.length?o:Object.keys(o).map(function(e){return o[e]}),e[i]=o.filter(function(e){return-1===n.indexOf(e)}).concat(n)}else e[i]=t[i]}),e},{}));const n="string"==typeof e?document.getElementById(e):e;if(!n){if("string"==typeof e)throw Error('[SUNEDITOR.create.fail] The element for that id was not found (ID:"'+e+'")');throw Error("[SUNEDITOR.create.fail] suneditor requires textarea's element or id value")}const o=h.init(n,t);if(o.constructed._top.id&&document.getElementById(o.constructed._top.id))throw Error('[SUNEDITOR.create.fail] The ID of the suneditor you are trying to create already exists (ID:"'+o.constructed._top.id+'")');return n.style.display="none",o.constructed._top.style.display="block","object"==typeof n.nextElementSibling?n.parentNode.insertBefore(o.constructed._top,n.nextElementSibling):n.parentNode.appendChild(o.constructed._top),function(e,t,i,n,o){const l=e.element.originElement.ownerDocument||document,a=l.defaultView||window,r=u,c={_d:l,_w:a,context:e,plugins:i||{},util:r,initPlugins:{},lang:n,submenu:null,_resizingName:"",_submenuName:"",_bindedSubmenuOff:null,submenuActiveButton:null,controllerArray:[],codeViewDisabledButtons:null,history:null,_bindControllersOff:null,_isInline:null,_isBalloon:null,_inlineToolbarAttr:{width:0,height:0,isShow:!1},_notHideToolbar:!1,_sticky:!1,_imageUpload:function(e,t,i,n,o){"function"==typeof m.onImageUpload&&m.onImageUpload(e,1*t,i,n,o)},_imageUploadError:function(e,t){return"function"!=typeof m.onImageUploadError||m.onImageUploadError(e,t)},commandMap:null,_variable:{wysiwygActive:!0,isFullScreen:!1,innerHeight_fullScreen:0,resizeClientY:0,tabSize:4,minResizingSize:65,currentNodes:[],_range:null,_selectionNode:null,_originCssText:e.element.topArea.style.cssText,_bodyOverflow:"",_editorAreaOriginCssText:"",_wysiwygOriginCssText:"",_codeOriginCssText:"",_fullScreenSticky:!1,_imagesInfo:[],_imageIndex:0,_videosCnt:0},callPlugin:function(e,i){if(!this.plugins[e])throw Error('[SUNEDITOR.core.callPlugin.fail] The called plugin does not exist or is in an invalid format. (pluginName:"'+e+'")');this.initPlugins[e]||(this.plugins[e].add(this,t[e]),this.initPlugins[e]=!0),"function"==typeof i&&i()},addModule:function(e){for(let t,i=0,n=e.length;i0){for(let t=0;t":i),this.history.push()},focus:function(){if("none"===e.element.wysiwygFrame.style.display)return;const t=r.getParentElement(this.getSelectionNode(),"figcaption");t?t.focus():e.element.wysiwyg.focus(),this._editorRange(),d._findButtonEffectTag()},setRange:function(e,t,i,n){if(!e||!i)return;t>e.textContent.length&&(t=e.textContent.length),n>i.textContent.length&&(n=i.textContent.length);const o=this._wd.createRange();o.setStart(e,t),o.setEnd(i,n);const l=this.getSelection();l.removeAllRanges&&l.removeAllRanges(),l.addRange(o),this._editorRange()},getRange:function(){return this._variable._range||this._createDefaultRange()},getSelection:function(){return this._ww.getSelection()},getSelectionNode:function(){return this._variable._selectionNode&&!r.isWysiwygDiv(this._variable._selectionNode)||this._editorRange(),this._variable._selectionNode||e.element.wysiwyg.firstChild},_editorRange:function(){const e=this.getSelection();let t=null,i=null;t=e.rangeCount>0?e.getRangeAt(0):this._createDefaultRange(),this._variable._range=t,i=t.collapsed?t.commonAncestorContainer:e.extentNode||e.anchorNode,this._variable._selectionNode=i},_createDefaultRange:function(){const t=this._wd.createRange();return e.element.wysiwyg.firstChild||this.execCommand("formatBlock",!1,"P"),t.setStart(e.element.wysiwyg.firstChild,0),t.setEnd(e.element.wysiwyg.firstChild,0),t},getSelectedElements:function(t){let i=this.getRange();if(r.isWysiwygDiv(i.startContainer)){const t=e.element.wysiwyg.children;if(0===t.length)return null;this.setRange(t[0],0,t[t.length-1],t[t.length-1].textContent.trim().length),i=this.getRange()}const n=i.startContainer,o=i.endContainer,l=i.commonAncestorContainer,s=r.getListChildren(l,function(e){return t?t(e):r.isFormatElement(e)});if(r.isWysiwygDiv(l)||r.isRangeFormatElement(l)||s.unshift(r.getFormatElement(l)),n===o||1===s.length)return s;let a=r.getFormatElement(n),c=r.getFormatElement(o),d=null,u=null;const h=function(e){return!r.isTable(e)||/^TABLE$/i.test(e.nodeName)},g=r.getRangeFormatElement(a,h),p=r.getRangeFormatElement(c,h),m=g===p;for(let e,t=0,i=s.length;t=0;e--)c[e]===n.parentNode&&c[e].firstChild===n&&0===i&&(d=e,n=n.parentNode);for(let e=u-1,t=n;e>d;e--)c[e]===t.parentNode&&1===c[e].nodeType&&(c.splice(e,1),t=t.parentNode,--u);for(let e=d;e<=u;e++){const l=c[e];0===l.length||3===l.nodeType&&void 0===l.data?r.removeItem(l):l!==t?l!==n?(r.removeItem(l),this.history.push()):(a=1===n.nodeType?r.createTextNode(n.textContent):r.createTextNode(n.substringData(o,n.length-o))).length>0?n.data=a.data:r.removeItem(n):(s=1===t.nodeType?r.createTextNode(t.textContent):r.createTextNode(t.substringData(0,i))).length>0?t.data=s.data:r.removeItem(t)}},applyRangeFormatElement:function(e){const t=this.getSelectedElementsAndComponents();if(!t||0===t.length)return;let i,n,o,l=t[t.length-1];i=r.isRangeFormatElement(l)||r.isFormatElement(l)?l:r.getRangeFormatElement(l)||r.getFormatElement(l),r.isCell(i)?(n=null,o=i):(n=i.nextSibling,o=i.parentNode);let s=r.getElementDepth(i),a=null;const c=[],d=function(e,t,i){let n=null;return e===t||r.isTable(t)||(n=r.removeItemAllParents(t)),n?n.ec:i};for(let i,l,u,h,g=0,p=t.length;g=u?(s=u,(n=d(o=t.cc,l,t.ec))&&(o=n.parentNode)):o===t.cc&&(n=t.ec),o!==t.cc&&void 0!==(h=d(o,t.cc))&&(n=h),e.appendChild(a),a=null}}else s>=u&&(s=u,o=l,n=i.nextSibling),e.appendChild(i),o!==l&&void 0!==(h=d(o,l))&&(n=h);o.insertBefore(e,n),d(e,n),this.history.push();const u=this.util.getEdgeChildNodes(e.firstElementChild,e.lastElementChild);t.length>1?this.setRange(u.sc,0,u.ec,u.ec.textContent.length):this.setRange(u.ec,u.ec.textContent.length,u.ec,u.ec.textContent.length)},detachRangeFormatElement:function(e,t,i,n,o){const l=this.getRange(),s=l.startOffset,a=l.endOffset,c=e.childNodes,u=e.parentNode;let h=null,g=null,p=e.cloneNode(!1);const m=r.isList(i);let f=!1;function _(e,t,i){if(r.onlyZeroWidthSpace(t)&&(t.innerHTML=r.zeroWidthSpace),3===t.nodeType)return e.insertBefore(t,i),t;const n=t.childNodes;let o=t.cloneNode(!1),l=null,s=null;for(;n[0];)s=n[0],r.isIgnoreNodeChange(s)&&!r.isListCell(o)?(o.childNodes.length>0&&(l||(l=o),e.insertBefore(o,i),o=t.cloneNode(!1)),e.insertBefore(s,i),l||(l=s)):o.appendChild(s);return o.childNodes.length>0&&(e.insertBefore(o,i),l||(l=o)),l}for(let o,l=0,s=c.length;l0&&(u.insertBefore(p,e),p=null),!m&&r.isListCell(o)){const t=o.innerHTML;(o=r.isCell(e.parentNode)?r.createElement("DIV"):r.createElement("P")).innerHTML=t}else o=o.cloneNode(!0);n||(i?(f||(u.insertBefore(i,e),f=!0),o=_(i,o,null)):o=_(u,o,e),t?(g=o,h||(h=o)):h||(h=g=o))}const b=e.parentNode,y=e.nextSibling;p&&p.children.length>0&&b.insertBefore(p,y),r.removeItem(e);const v=n?{cc:b,sc:h,ec:h&&h.parentNode?h.nextSibling:p&&p.children.length>0?p:y||null}:this.util.getEdgeChildNodes(h,g);if(o)return v;this.history.push(),!n&&v&&(t?this.setRange(v.sc,s,v.ec,a):this.setRange(v.sc,0,v.sc,0)),d._findButtonEffectTag()},nodeChange:function(t,i,n){const o=this.getRange();i=!!(i&&i.length>0)&&i,n=!!(n&&n.length>0)&&n;const l=!t,s=l&&!n&&!i;let c,d,u,h=o.startContainer,g=o.startOffset,p=o.endContainer,m=o.endOffset;if(s&&o.collapsed&&r.isFormatElement(h.parentNode)&&r.isFormatElement(p.parentNode))return;if(l&&(t=this.util.createElement("DIV")),!s&&h===p){let e=h;if(s){if(r.getFormatElement(e)===e.parentNode)return}else if(i.length>0){let n=0;for(let o=0;o=i.length)return;if(l&&0===n)return}}if(c=r.isWysiwygDiv(h)?e.element.wysiwyg.firstChild:h,d=g,r.isBreak(c)||1===c.nodeType&&c.childNodes.length>0){const e=r.isBreak(c);if(!e){for(;c&&!r.isBreak(c)&&1===c.nodeType;)c=c.childNodes[d]||c.nextElementSibling||c.nextSibling,d=0;let e=r.getFormatElement(c);e===r.getRangeFormatElement(e)&&(e=r.createElement(r.isCell(c)?"DIV":"P"),c.parentNode.insertBefore(e,c),e.appendChild(c))}if(r.isBreak(c)){const t=r.createTextNode(r.zeroWidthSpace);c.parentNode.insertBefore(t,c),c=t,e&&(h===p&&(p=c,m=1),r.removeItem(h))}}if(h=c,g=d,c=r.isWysiwygDiv(p)?e.element.wysiwyg.lastChild:p,d=m,r.isBreak(c)||1===c.nodeType&&c.childNodes.length>0){const e=r.isBreak(c);if(!e){for(;c&&!r.isBreak(c)&&1===c.nodeType;)c=(u=c.childNodes)[d>0?d-1:d]||!/FIGURE/i.test(u[0].nodeName)?u[0]:c.previousElementSibling||c.previousSibling||h,d=d>0?c.textContent.length:d;let e=r.getFormatElement(c);e===r.getRangeFormatElement(e)&&(e=r.createElement(r.isCell(e)?"DIV":"P"),c.parentNode.insertBefore(e,c),e.appendChild(c))}if(r.isBreak(c)){const t=r.createTextNode(r.zeroWidthSpace);c.parentNode.insertBefore(t,c),c=t,d=0,e&&r.removeItem(p)}}p=c,m=d;const f=t.nodeName;this.setRange(h,g,p,m);let _,b,y,v={},C={};if(i){b="(?:;|^|\\s)(?:"+i[0];for(let e=1;e0&&(i=t.replace(b,"").trim()),l){if(b&&y&&!i&&y.test(e.nodeName))return!1;if(b&&!i&&t)return!1;if(y&&y.test(e.nodeName))return!1}return!(!i&&e.nodeName===f||(b&&t.length>0&&(e.style.cssText=i),0))},w=this.getSelectedElements();r.getFormatElement(h)||(h=r.getChildElement(w[0],function(e){return 3===e.nodeType}),g=0),r.getFormatElement(p)||(m=(p=r.getChildElement(w[w.length-1],function(e){return 3===e.nodeType})).textContent.length);const E=r.getFormatElement(h)===r.getFormatElement(p),k=w.length-(E?0:1);if(_=t.cloneNode(!1),E){const e=this._nodeChange_oneLine(w[0],_,x,h,g,p,m,s,l,o.collapsed);v.container=e.startContainer,v.offset=e.startOffset,C.container=e.endContainer,C.offset=e.endOffset}else v=this._nodeChange_startLine(w[0],_,x,h,g,s,l);for(let e=1;e0&&!E?(_=t.cloneNode(!1),C=this._nodeChange_endLine(w[k],_,x,p,m,s,l)):E||(C=v),this.setRange(v.container,v.offset,C.container,C.offset),this.history.push()},_stripRemoveNode:function(e,t){if(!t||3===t.nodeType)return;const i=t.childNodes;for(;i[0];)e.insertBefore(i[0],t);e.removeChild(t)},_nodeChange_oneLine:function(e,t,i,n,o,l,s,c,d,u){const h=e,g=t,p=[t],m=e.cloneNode(!1),f=n===l;let _,b,y,v,C=n,x=o,w=l,E=s,k=!1,S=!1;function T(e){const t=new a.RegExp("(?:;|^|\\s)(?:"+v+"null)\\s*:[^;]*\\s*(?:;|$)","ig");let i="";return t&&e.style.cssText.length>0&&(i=t.test(e.style.cssText)),!i}if(function e(n,o){const l=n.childNodes;for(let n=0,s=l.length;n=x?E-x:C.data.length-x));for(e.data.length>0&&o.appendChild(e),b=s,_=[],v="";b!==m&&b!==h&&null!==b;)i(b)&&1===b.nodeType&&T(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;const l=_.pop()||n;for(y=b=l;_.length>0;)b=_.pop(),y.appendChild(b),y=b;if(t.appendChild(l),m.appendChild(t),C=n,x=0,k=!0,b!==n&&b.appendChild(C),!f)continue}if(S||s!==w){if(k){if(1===s.nodeType&&!r.isBreak(s)){r.isIgnoreNodeChange(s)?(t=t.cloneNode(!1),m.appendChild(s),m.appendChild(t),p.push(t),n--):e(s,s);continue}for(b=s,_=[],v="";null!==b.parentNode&&b!==h&&b!==t;)1===b.nodeType&&!r.isBreak(s)&&(S||i(b))&&T(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;const l=_.pop()||s;for(y=b=l;_.length>0;)b=_.pop(),y.appendChild(b),y=b;l===s?o=S?m:t:S?(m.appendChild(l),o=b):(t.appendChild(l),o=b)}a=s.cloneNode(!1),o.appendChild(a),1!==s.nodeType||r.isBreak(s)||(d=a),e(s,d)}else{const e=r.createTextNode(1===w.nodeType?"":w.substringData(E,w.length-E)),n=r.createTextNode(f||1===w.nodeType?"":w.substringData(0,E));if(e.data.length>0){for(b=s,v="",_=[];b!==m&&b!==h&&null!==b;)1===b.nodeType&&T(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;for(a=y=b=_.pop()||e;_.length>0;)b=_.pop(),y.appendChild(b),y=b;m.appendChild(a),b.textContent=e.data}for(b=s,_=[],v="";b!==m&&b!==h&&null!==b;)i(b)&&1===b.nodeType&&T(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;const o=_.pop()||n;for(y=b=o;_.length>0;)b=_.pop(),y.appendChild(b),y=b;t.appendChild(o),w=n,E=n.data.length,S=!0,!c&&u&&(t=n,n.textContent=r.zeroWidthSpace),b!==n&&b.appendChild(w)}}}(e,m),c=c&&d)for(let e=0;e0){const e=u.pop();for(g=h=e;u.length>0;)h=u.pop(),g.appendChild(h),g=h;t.appendChild(e),o=h}else o=t}if(f||s!==p){if(!f||i(s)){const e=s.cloneNode(!1);o.appendChild(e),1!==s.nodeType||r.isBreak(s)||(_=e)}e(s,_)}else{const e=r.createTextNode(1===p.nodeType?"":p.substringData(0,m)),n=r.createTextNode(1===p.nodeType?"":p.substringData(m,p.length-m));for(e.data.length>0&&o.appendChild(e),h=o,u=[];h!==d&&null!==h;)1===h.nodeType&&i(h)&&u.push(h.cloneNode(!1)),h=h.parentNode;const l=u.pop()||o;for(g=h=l;u.length>0;)h=u.pop(),g.appendChild(h),g=h;l!==o?(t.appendChild(l),o=h):o=t,r.isBreak(s)&&t.appendChild(s.cloneNode(!1)),d.appendChild(t),p=n,m=0,f=!0,o.appendChild(p)}}}(e,d),l=l&&s)for(let e=0;e0){const e=u.pop();for(g=h=e;u.length>0;)h=u.pop(),g.appendChild(h),g=h;t.insertBefore(e,t.firstChild),o=h}else o=t}if(f||s!==p){if(!f||i(s)){const e=s.cloneNode(!1);o.insertBefore(e,o.firstChild),1!==s.nodeType||r.isBreak(s)||(_=e)}e(s,_)}else{const e=r.createTextNode(1===p.nodeType?"":p.substringData(m,p.length-m)),n=r.createTextNode(1===p.nodeType?"":p.substringData(0,m));for(e.data.length>0&&o.insertBefore(e,o.firstChild),h=o,u=[];h!==d&&null!==h;)i(h)&&1===h.nodeType&&u.push(h.cloneNode(!1)),h=h.parentNode;const l=u.pop()||o;for(g=h=l;u.length>0;)h=u.pop(),g.appendChild(h),g=h;l!==o?(t.insertBefore(l,t.firstChild),o=h):o=t,r.isBreak(s)&&t.appendChild(s.cloneNode(!1)),d.insertBefore(t,d.firstChild),p=n,m=n.data.length,f=!0,o.insertBefore(p,o.firstChild)}}}(e,d),l=l&&s)for(let e=0;e\n\n"+this._wd.head.outerHTML.match(/^]*>\B/)[0]+"\n"+n+"\n"+this._wd.body.outerHTML.match(/^]*>\B/)[0]+"\n"+r.convertHTMLForCodeView(e.element.wysiwyg)+"\n"}else t=r.convertHTMLForCodeView(e.element.wysiwyg);e.element.code.style.display="block",e.element.wysiwygFrame.style.display="none",this._setCodeView(t),this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),"auto"!==e.option.height||e.option.codeMirrorEditor||(e.element.code.style.height=e.element.code.scrollHeight>0?e.element.code.scrollHeight+"px":"auto"),e.option.codeMirrorEditor&&e.option.codeMirrorEditor.refresh(),this._variable.wysiwygActive=!1,e.element.code.focus()}else{const t=this._getCodeView();if(e.option.fullPage){const e=(new this._w.DOMParser).parseFromString(t,"text/html"),i=e.head.children;for(let t=0,n=i.length;t0?r.convertContentsForEditor(t):"


    ";e.element.wysiwygFrame.scrollTop=0,e.element.code.style.display="none",e.element.wysiwygFrame.style.display="block",this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),"auto"!==e.option.height||e.option.codeMirrorEditor||(e.element.code.style.height="0px"),this._variable.wysiwygActive=!0,this.focus()}},toggleFullScreen:function(t){const i=e.element.topArea,n=e.element.toolbar,o=e.element.editorArea,s=e.element.wysiwyg,c=e.element.code;this._variable.isFullScreen?(this._variable.isFullScreen=!1,s.style.cssText=this._variable._wysiwygOriginCssText,c.style.cssText=this._variable._codeOriginCssText,n.style.cssText="",o.style.cssText=this._variable._editorAreaOriginCssText,i.style.cssText=this._variable._originCssText,l.body.style.overflow=this._variable._bodyOverflow,e.option.stickyToolbar>-1&&(r.removeClass(n,"se-toolbar-sticky"),d.onScroll_window()),this._variable._fullScreenSticky&&(this._variable._fullScreenSticky=!1,e.element._stickyDummy.style.display="block",r.addClass(n,"se-toolbar-sticky")),r.removeClass(t.firstElementChild,"se-icon-reduction"),r.addClass(t.firstElementChild,"se-icon-expansion")):(this._variable.isFullScreen=!0,i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%",i.style.zIndex="2147483647","none"!==e.element._stickyDummy.style.display&&(this._variable._fullScreenSticky=!0,e.element._stickyDummy.style.display="none",r.removeClass(n,"se-toolbar-sticky")),this._variable._bodyOverflow=l.body.style.overflow,l.body.style.overflow="hidden",this._variable._editorAreaOriginCssText=o.style.cssText,this._variable._wysiwygOriginCssText=s.style.cssText,this._variable._codeOriginCssText=c.style.cssText,o.style.cssText=n.style.cssText="",s.style.cssText=s.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)[0],c.style.cssText=c.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)[0],n.style.width=s.style.height=c.style.height="100%",n.style.position="relative",this._variable.innerHeight_fullScreen=a.innerHeight-n.offsetHeight,o.style.height=this._variable.innerHeight_fullScreen+"px",r.removeClass(t.firstElementChild,"se-icon-expansion"),r.addClass(t.firstElementChild,"se-icon-reduction"))},print:function(){const e=r.createElement("IFRAME");e.style.display="none";const t=r.createElement("DIV"),i=r.createElement("STYLE");i.innerHTML=r.getPageStyle(),t.className="sun-editor-editable",t.innerHTML=this.getContents(),l.body.appendChild(e);let n=e.contentWindow||e.contentDocument;n.document&&(n=n.document),n.head.appendChild(i),n.body.appendChild(t);try{if(e.focus(),-1!==a.navigator.userAgent.indexOf("MSIE")||l.documentMode||a.StyleMedia)try{e.contentWindow.document.execCommand("print",!1,null)}catch(t){e.contentWindow.print()}else e.contentWindow.print()}catch(e){throw Error("[SUNEDITOR.core.print.fail] error: "+e)}finally{r.removeItem(e)}},preview:function(){const t=r.getPageStyle(),i=this.getContents(),o=a.open("","_blank");o.mimeType="text/html",e.option.fullPage?o.document.write(""+this._wd.head.outerHTML+this._wd.body.outerHTML+""):o.document.write(''+n.toolbar.preview+"'+i+"")},setContents:function(t){if(c._variable.wysiwygActive){const i=r.convertContentsForEditor(t);i!==e.element.wysiwyg.innerHTML&&(e.element.wysiwyg.innerHTML=i,c.history.push())}else{const e=r.convertHTMLForCodeView(t);e!==c._getCodeView()&&c._setCodeView(e)}},getContents:function(){const t=e.element.wysiwyg.innerHTML,i=r.createElement("DIV");i.innerHTML=t;const n=r.getListChildren(i,function(e){return/FIGCAPTION/i.test(e.nodeName)});for(let e=0,t=n.length;e"+this._wd.head.outerHTML+this._wd.body.outerHTML+"":i.innerHTML},addDocEvent:function(t,i,n){l.addEventListener(t,i,n),e.option.iframe&&this._wd.addEventListener(t,i)},removeDocEvent:function(t,i){l.removeEventListener(t,i),e.option.iframe&&this._wd.removeEventListener(t,i)},_charCount:function(t,i){const n=e.element.charCounter;if(!n)return!0;(!t||t<0)&&(t=0);const o=e.option.maxCharCount;if(a.setTimeout(function(){n.textContent=e.element.wysiwyg.textContent.length}),o>0){let l=!1;const s=e.element.wysiwyg.textContent.length;if(s>o){c._editorRange();const e=c.getRange(),t=e.endOffset-1,i=c.getSelectionNode().textContent;c.getSelectionNode().textContent=i.slice(0,e.endOffset-1)+i.slice(e.endOffset,i.length),c.setRange(e.endContainer,t,e.endContainer,t),l=!0}else s+t>o&&(l=!0);if(l)return i&&!r.hasClass(n,"se-blink")&&(r.addClass(n,"se-blink"),a.setTimeout(function(){r.removeClass(n,"se-blink")},600)),!1}return!0},_checkComponents:function(){this.plugins.image&&(this.initPlugins.image?this.plugins.image.checkImagesInfo.call(this):this.callPlugin("image",this.plugins.image.checkImagesInfo.bind(this))),this.plugins.video&&(this.initPlugins.video?this.plugins.video.checkVideosInfo.call(this):this.callPlugin("video",this.plugins.video.checkVideosInfo.bind(this)))},_setCodeView:function(t){e.option.codeMirrorEditor?e.option.codeMirrorEditor.getDoc().setValue(t):e.element.code.value=t},_getCodeView:function(){return e.option.codeMirrorEditor?e.option.codeMirrorEditor.getDoc().getValue():e.element.code.value},_init:function(){this._ww=e.option.iframe?e.element.wysiwygFrame.contentWindow:a,this._wd=l,a.setTimeout(function(){o.iframe&&(this._wd=e.element.wysiwygFrame.contentDocument,e.element.wysiwyg=this._wd.body,"auto"===o.height&&(this._iframeAuto=this._wd.body)),this._placeholder=e.element.placeholder,this._resourcesStateChange(),this._checkComponents(),this.history=p(this,d._onChange_historyStack)}.bind(this)),this.codeViewDisabledButtons=e.element.toolbar.querySelectorAll('.se-toolbar button:not([class~="code-view-enabled"])'),this._isInline=/inline/i.test(e.option.mode),this._isBalloon=/balloon/i.test(e.option.mode),this.commandMap={FORMAT:e.tool.format,FONT:e.tool.font,FONT_TOOLTIP:e.tool.fontTooltip,SIZE:e.tool.fontSize,ALIGN:e.tool.align,LI:e.tool.list,LI_ICON:e.tool.list&&e.tool.list.querySelector("i"),STRONG:e.tool.bold,INS:e.tool.underline,EM:e.tool.italic,DEL:e.tool.strike,SUB:e.tool.subscript,SUP:e.tool.superscript,OUTDENT:e.tool.outdent},this._variable._originCssText=e.element.topArea.style.cssText},_resourcesStateChange:function(){c._iframeAutoHeight(),c._togglePlaceholder()},_iframeAutoHeight:function(){this._iframeAuto&&(e.element.wysiwygFrame.style.height=this._iframeAuto.offsetHeight+"px")},_togglePlaceholder:function(){if(this._placeholder){const t=e.element.wysiwyg;!r.onlyZeroWidthSpace(t.textContent)||t.querySelector(".se-component, pre, blockquote, hr, li, table, img, iframe, video")||(t.innerText.match(/\n/g)||"").length>1?this._placeholder.style.display="none":this._placeholder.style.display="block"}}},d={_directionKeyKeyCode:new a.RegExp("^(8|13|32|46|33|34|35|36|37|38|39|40|46|98|100|102|104)$"),_historyIgnoreKeycode:new a.RegExp("^(9|1[6-8]|20|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new a.RegExp("^(STRONG|INS|EM|DEL|SUB|SUP|LI)$"),_keyCodeShortcut:{65:"A",66:"B",83:"S",85:"U",73:"I",89:"Y",90:"Z",219:"[",221:"]"},_shortcutCommand:function(e,t){let i=null;switch(d._keyCodeShortcut[e]){case"A":i="selectAll";break;case"B":i="STRONG";break;case"S":t&&(i="DEL");break;case"U":i="INS";break;case"I":i="EM";break;case"Z":i=t?"redo":"undo";break;case"Y":i="redo";break;case"[":i="outdent";break;case"]":i="indent"}return!!i&&(c.commandHandler(c.commandMap[i],i),!0)},_findButtonEffectTag:function(){const t=c.commandMap,i=this._onButtonsCheck,o=[],l=[];let s=!0,a=!0,d=!0,u=!0,h=!0,g=!0,p=!0,m="";for(let f=c.getSelectionNode();!r.isWysiwygDiv(f)&&f;f=f.parentNode)if(1===f.nodeType&&!r.isBreak(f))if(m=f.nodeName.toUpperCase(),l.push(m),r.isFormatElement(f)){s&&t.FORMAT&&(o.push("FORMAT"),r.changeTxt(t.FORMAT,m),t.FORMAT.setAttribute("data-focus",m),s=!1);const e=f.style.textAlign;a&&e&&t.ALIGN&&(o.push("ALIGN"),t.ALIGN.className="se-icon-align-"+e,t.ALIGN.setAttribute("data-focus",e),a=!1),g&&f.style.marginLeft&&1*(f.style.marginLeft.match(/\d+/)||[0])[0]>0&&t.OUTDENT&&(o.push("OUTDENT"),t.OUTDENT.removeAttribute("disabled"),g=!1)}else{if(d&&r.isList(m)&&t.LI&&(o.push("LI"),t.LI.setAttribute("data-focus",m),/UL/i.test(m)?(r.removeClass(t.LI_ICON,"se-icon-list-number"),r.addClass(t.LI_ICON,"se-icon-list-bullets")):(r.removeClass(t.LI_ICON,"se-icon-list-bullets"),r.addClass(t.LI_ICON,"se-icon-list-number")),d=!1),u&&f.style.fontFamily.length>0&&t.FONT){o.push("FONT");const e=(f.style.fontFamily||f.face||n.toolbar.font).replace(/["']/g,"");r.changeTxt(t.FONT,e),r.changeTxt(t.FONT_TOOLTIP,e),u=!1}h&&f.style.fontSize.length>0&&t.SIZE&&(o.push("SIZE"),r.changeTxt(t.SIZE,f.style.fontSize),h=!1),p&&/^A$/.test(m)&&null===f.getAttribute("data-image-link")&&c.plugins.link?(e.link&&c.controllerArray[0]===e.link.linkBtn||c.callPlugin("link",function(){c.plugins.link.call_controller_linkButton.call(c,f)}),p=!1):p&&e.link&&c.controllerArray[0]===e.link.linkBtn&&c.controllersOff(),i.test(m)&&o.push(m)}for(let e=0;e-1||(t.FONT&&/^FONT$/i.test(e)?(r.changeTxt(t.FONT,n.toolbar.font),r.changeTxt(t.FONT_TOOLTIP,n.toolbar.font)):t.SIZE&&/^SIZE$/i.test(e)?r.changeTxt(t.SIZE,n.toolbar.fontSize):t.ALIGN&&/^ALIGN$/i.test(e)?(t.ALIGN.className="se-icon-align-left",t.ALIGN.removeAttribute("data-focus")):t.OUTDENT&&/^OUTDENT$/i.test(e)?t.OUTDENT.setAttribute("disabled",!0):t.LI&&r.isListCell(e)?(t.LI.removeAttribute("data-focus"),r.removeClass(t.LI_ICON,"se-icon-list-bullets"),r.addClass(t.LI_ICON,"se-icon-list-number"),r.removeClass(t.LI,"active")):r.removeClass(t[e],"active"));c._variable.currentNodes=l.reverse(),e.option.showPathLabel&&(e.element.navigation.textContent=c._variable.currentNodes.join(" > "))},_cancelCaptionEdit:function(){this.setAttribute("contenteditable",!1),this.removeEventListener("blur",d._cancelCaptionEdit)},onMouseDown_toolbar:function(e){let t=e.target;if(r.getParentElement(t,".se-submenu"))e.stopPropagation(),c._notHideToolbar=!0;else{e.preventDefault();let i=t.getAttribute("data-command"),n=t.className;for(;!i&&!/se-menu-list/.test(n)&&!/se-toolbar/.test(n);)i=(t=t.parentNode).getAttribute("data-command"),n=t.className;i===c._submenuName&&e.stopPropagation()}},onClick_toolbar:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=t.getAttribute("data-display"),n=t.getAttribute("data-command"),o=t.className;for(;!n&&!/se-menu-list/.test(o)&&!/se-toolbar/.test(o);)t=t.parentNode,n=t.getAttribute("data-command"),i=t.getAttribute("data-display"),o=t.className;if((n||i)&&!t.disabled){if(c.focus(),i)return!/submenu/.test(i)||null!==t.nextElementSibling&&t===c.submenuActiveButton?/dialog/.test(i)?void c.callPlugin(n,function(){c.plugins.dialog.open.call(c,n,!1)}):void c.submenuOff():void c.callPlugin(n,function(){c.submenuOn(t)});n&&c.commandHandler(t,n)}},onMouseDown_wysiwyg:function(e){c._isBalloon&&d._hideToolbar();const t=r.getParentElement(e.target,r.isCell);if(!t)return;const i=c.plugins.table;t===i._fixedCell||i._shift||c.callPlugin("table",function(){i.onTableCellMultiSelect.call(c,t,!1)})},onClick_wysiwyg:function(t){const i=t.target;if("false"===e.element.wysiwyg.getAttribute("contenteditable"))return;if(t.stopPropagation(),/^FIGURE$/i.test(i.nodeName)){const e=i.querySelector("IMG"),n=i.querySelector("IFRAME");if(e){if(t.preventDefault(),!c.plugins.image)return;return void c.callPlugin("image",function(){const t=c.plugins.resizing.call_controller_resize.call(c,e,"image");c.plugins.image.onModifyMode.call(c,e,t),r.getParentElement(e,".se-image-container")||(c.plugins.image.openModify.call(c,!0),c.plugins.image.update_image.call(c,!0,!0))})}if(n){if(t.preventDefault(),!c.plugins.video)return;return void c.callPlugin("video",function(){const e=c.plugins.resizing.call_controller_resize.call(c,n,"video");c.plugins.video.onModifyMode.call(c,n,e)})}}const n=r.getParentElement(i,"FIGCAPTION");if(n&&"ture"!==n.getAttribute("contenteditable")&&(t.preventDefault(),n.setAttribute("contenteditable",!0),n.focus(),c._isInline&&!c._inlineToolbarAttr.isShow)){d._showToolbarInline();const e=function(){d._hideToolbar(),n.removeEventListener("blur",e)};n.addEventListener("blur",e)}const o=r.getFormatElement(c.getSelectionNode()),l=r.getRangeFormatElement(c.getSelectionNode());if(!c.getRange().collapsed||o&&o!==l||"false"===i.getAttribute("contenteditable")||(c.execCommand("formatBlock",!1,r.isRangeFormatElement(l)?"DIV":"P"),c.focus()),c._editorRange(),d._findButtonEffectTag(),c._isBalloon){const e=c.getRange();e.collapsed?d._hideToolbar():d._showToolbarBalloon(e)}m.onClick&&m.onClick(t)},_showToolbarBalloon:function(t){const i=t||c.getRange(),n=e.element.toolbar,o=c.getSelection();let s;if(o.focusNode===o.anchorNode)s=o.focusOffsetn.offsetWidth?n.offsetWidth-u:b",n.parentNode.insertBefore(l,n),c.callPlugin(g,function(){c.controllersOff();const e=c.plugins.resizing.call_controller_resize.call(c,i._element,g);c.plugins[g].onModifyMode.call(c,i._element,e)}),c.history.push()}}if(n&&/16/.test(i)){t.preventDefault(),t.stopPropagation();const e=c.plugins.table;if(e&&!e._shift&&!e._ref){const t=r.getParentElement(p,r.isCell);if(t)return void e.onTableCellMultiSelect.call(c,t,!0)}}const _=!o&&!l&&1===t.key.length;if(!c._charCount(1,_)&&_)return t.preventDefault(),t.stopPropagation(),!1;m.onKeyDown&&m.onKeyDown(t)},onKeyUp_wysiwyg:function(e){c._editorRange();const t=e.keyCode;let i=c.getSelectionNode();if(c._isBalloon&&!c.getRange().collapsed)return void d._showToolbarBalloon();if(8===t&&r.isWysiwygDiv(i)&&""===i.textContent){e.preventDefault(),e.stopPropagation(),i.innerHTML="";const t=r.createElement(r.isFormatElement(c._variable.currentNodes[0])?c._variable.currentNodes[0]:"P");return t.innerHTML="
    ",i.appendChild(t),c.setRange(t,0,t,0),d._findButtonEffectTag(),void c._checkComponents()}const n=r.getFormatElement(i),o=r.getRangeFormatElement(i);if(n&&n!==o||(c.execCommand("formatBlock",!1,r.isRangeFormatElement(o)?"DIV":"P"),c.focus(),i=c.getSelectionNode()),d._directionKeyKeyCode.test(t)&&d._findButtonEffectTag(),c._checkComponents(),!c._charCount(1,1===e.key.length)&&1===e.key.length)return e.preventDefault(),e.stopPropagation(),!1;d._historyIgnoreKeycode.test(t)||c.history.push(),m.onKeyUp&&m.onKeyUp(e)},onScroll_wysiwyg:function(e){c.controllersOff(),c._isBalloon&&d._hideToolbar(),m.onScroll&&m.onScroll(e)},onMouseDown_resizingBar:function(t){t.stopPropagation(),c._variable.resizeClientY=t.clientY,e.element.resizeBackground.style.display="block",l.addEventListener("mousemove",d._resize_editor),l.addEventListener("mouseup",function t(){e.element.resizeBackground.style.display="none",l.removeEventListener("mousemove",d._resize_editor),l.removeEventListener("mouseup",t)})},_resize_editor:function(t){const i=e.element.editorArea.offsetHeight+(t.clientY-c._variable.resizeClientY);e.element.wysiwygFrame.style.height=e.element.code.style.height=(i=i+o?(c._sticky||d._onStickyToolbar(),t.toolbar.style.top=i+o+e.option.stickyToolbar-n-c._variable.minResizingSize+"px"):n>=o&&d._onStickyToolbar()},_getStickyOffsetTop:function(){let t=e.element.topArea,i=0;for(;t;)i+=t.offsetTop,t=t.offsetParent;return i},_onStickyToolbar:function(){const t=e.element;c._isInline||(t._stickyDummy.style.height=t.toolbar.offsetHeight+"px",t._stickyDummy.style.display="block"),t.toolbar.style.top=e.option.stickyToolbar+"px",t.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:t.toolbar.offsetWidth+"px",r.addClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!0},_offStickyToolbar:function(){const t=e.element;t._stickyDummy.style.display="none",t.toolbar.style.top=c._isInline?c._inlineToolbarAttr.top:"",t.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:"",t.editorArea.style.marginTop="",r.removeClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!1},_codeViewAutoHeight:function(){e.element.code.style.height=e.element.code.scrollHeight+"px"},onPaste_wysiwyg:function(e){const t=e.clipboardData;if(!t)return!0;const i=c._charCount(t.getData("text/plain").length,!0),n=r.cleanHTML(t.getData("text/html"));return("function"!=typeof m.onPaste||m.onPaste(e,n,i))&&i?void(n&&(e.stopPropagation(),e.preventDefault(),c.execCommand("insertHTML",!1,n))):(e.preventDefault(),e.stopPropagation(),!1)},onCut_wysiwyg:function(){a.setTimeout(function(){c._resourcesStateChange(),c._charCount(0,!1),c.history.push()})},onDragOver_wysiwyg:function(e){e.preventDefault()},onDrop_wysiwyg:function(t){const i=t.dataTransfer;if(!i)return!0;const n=i.files;if(n.length>0&&c.plugins.image)d._setDropLocationSelection(t),c.callPlugin("image",function(){e.image.imgInputFile.files=n,c.plugins.image.onRender_imgInput.call(c),e.image.imgInputFile.files=null});else{if(!c._charCount(i.getData("text/plain").length,!0))return t.preventDefault(),t.stopPropagation(),!1;{const e=r.cleanHTML(i.getData("text/html"));e&&(d._setDropLocationSelection(t),c.execCommand("insertHTML",!1,e))}}m.onDrop&&m.onDrop(t)},_setDropLocationSelection:function(e){e.stopPropagation(),e.preventDefault();const t=c.getRange();c.setRange(t.startContainer,t.startOffset,t.endContainer,t.endOffset)},_onChange_historyStack:function(){e.tool.save&&e.tool.save.removeAttribute("disabled"),m.onChange&&m.onChange(c.getContents())},_addEvent:function(){const t=o.iframe?c._ww:e.element.wysiwyg;e.element.toolbar.addEventListener("mousedown",d.onMouseDown_toolbar,!1),e.element.toolbar.addEventListener("click",d.onClick_toolbar,!1),t.addEventListener("click",d.onClick_wysiwyg,!1),t.addEventListener("keydown",d.onKeyDown_wysiwyg,!1),t.addEventListener("keyup",d.onKeyUp_wysiwyg,!1),t.addEventListener("paste",d.onPaste_wysiwyg,!1),t.addEventListener("cut",d.onCut_wysiwyg,!1),t.addEventListener("dragover",d.onDragOver_wysiwyg,!1),t.addEventListener("drop",d.onDrop_wysiwyg,!1),t.addEventListener("scroll",d.onScroll_wysiwyg,!1),(c._isBalloon||c.plugins.table)&&t.addEventListener("mousedown",d.onMouseDown_wysiwyg,!1),c.plugins.table&&t.addEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),"auto"!==e.option.height||e.option.codeMirrorEditor||(e.element.code.addEventListener("keydown",d._codeViewAutoHeight,!1),e.element.code.addEventListener("keyup",d._codeViewAutoHeight,!1),e.element.code.addEventListener("paste",d._codeViewAutoHeight,!1)),e.element.resizingBar&&(/\d+/.test(e.option.height)?e.element.resizingBar.addEventListener("mousedown",d.onMouseDown_resizingBar,!1):r.addClass(e.element.resizingBar,"se-resizing-none")),c._isInline&&t.addEventListener("focus",d._showToolbarInline,!1),(c._isInline||c._isBalloon)&&t.addEventListener("blur",d._hideToolbar,!1),a.removeEventListener("resize",d.onResize_window),a.removeEventListener("scroll",d.onScroll_window),a.addEventListener("resize",d.onResize_window,!1),e.option.stickyToolbar>-1&&a.addEventListener("scroll",d.onScroll_window,!1)},_removeEvent:function(){const t=o.iframe?c._ww:e.element.wysiwyg;e.element.toolbar.removeEventListener("mousedown",d.onMouseDown_toolbar),e.element.toolbar.removeEventListener("click",d.onClick_toolbar),t.removeEventListener("click",d.onClick_wysiwyg),t.removeEventListener("keydown",d.onKeyDown_wysiwyg),t.removeEventListener("keyup",d.onKeyUp_wysiwyg),t.removeEventListener("paste",d.onPaste_wysiwyg),t.removeEventListener("cut",d.onCut_wysiwyg),t.removeEventListener("dragover",d.onDragOver_wysiwyg),t.removeEventListener("drop",d.onDrop_wysiwyg),t.removeEventListener("scroll",d.onScroll_wysiwyg),t.removeEventListener("mousedown",d.onMouseDown_wysiwyg),t.removeEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),t.removeEventListener("focus",d._showToolbarInline),t.removeEventListener("blur",d._hideToolbar),e.element.code.removeEventListener("keydown",d._codeViewAutoHeight),e.element.code.removeEventListener("keyup",d._codeViewAutoHeight),e.element.code.removeEventListener("paste",d._codeViewAutoHeight),e.element.resizingBar&&e.element.resizingBar.removeEventListener("mousedown",d.onMouseDown_resizingBar),a.removeEventListener("resize",d.onResize_window),a.removeEventListener("scroll",d.onScroll_window)}},m={onScroll:null,onClick:null,onKeyDown:null,onKeyUp:null,onDrop:null,onChange:null,onPaste:null,showInline:null,onImageUpload:null,onImageUploadError:null,setOptions:function(l){d._removeEvent(),c.plugins=l.plugins||c.plugins;const s=[e.option,l].reduce(function(e,t){return Object.keys(t).forEach(function(i){e[i]=t[i]}),e},{}),a=h._setOptions(s,e,c.plugins,e.option);a.callButtons&&(t=a.callButtons,c.initPlugins={}),a.plugins&&(c.plugins=i=a.plugins);const r=e.element,u={_top:r.topArea,_relative:r.relative,_toolBar:r.toolbar,_editorArea:r.editorArea,_wysiwygArea:r.wysiwygFrame,_codeArea:r.code,_placeholder:r.placeholder,_resizingBar:r.resizingBar,_navigation:r.navigation,_charCounter:r.charCounter,_loading:r.loading,_resizeBack:r.resizeBackground,_stickyDummy:r._stickyDummy,_arrow:r._arrow};o=s,c.lang=n=o.lang,c.context=e=g(e.element.originElement,u,o),c._init(),d._addEvent(),d._offStickyToolbar(),d.onResize_window(),c._checkComponents(),c.history=p(c,d._onChange_historyStack),c._charCount(0,!1),c.focus()},noticeOpen:function(e){c.addModule([s]),s.open.call(c,e)},noticeClose:function(){c.addModule([s]),s.close.call(c)},save:function(){e.element.originElement.value=c.getContents()},getContext:function(){return e},getContents:function(){return c.getContents()},getImagesInfo:function(){return c._variable._imagesInfo},insertImage:function(e){c.plugins.image&&e&&(c.initPlugins.image?c.plugins.image.submitAction.call(c,e):c.callPlugin("image",c.plugins.image.submitAction.bind(c,e)),c.focus())},insertHTML:function(e){if(!e.nodeType||1!==e.nodeType){const t=r.createElement("DIV");t.innerHTML=e,e=t.firstChild||t.content.firstChild}let t=null;(r.isFormatElement(e)||/^(IMG|IFRAME)$/i.test(e.nodeName))&&(t=r.getFormatElement(c.getSelectionNode())),c.insertNode(e,t),c.focus()},setContents:function(e){c.setContents(e)},appendContents:function(t){c._variable.wysiwygActive?e.element.wysiwyg.innerHTML+=r.convertContentsForEditor(t):c._setCodeView(c._getCodeView()+r.convertHTMLForCodeView(t)),c.history.push()},disabled:function(){e.tool.cover.style.display="block",e.element.wysiwyg.setAttribute("contenteditable",!1),e.option.codeMirrorEditor?e.option.codeMirrorEditor.setOption("readOnly",!0):e.element.code.setAttribute("disabled","disabled")},enabled:function(){e.tool.cover.style.display="none",e.element.wysiwyg.setAttribute("contenteditable",!0),e.option.codeMirrorEditor?e.option.codeMirrorEditor.setOption("readOnly",!1):e.element.code.removeAttribute("disabled")},show:function(){const t=e.element.topArea.style;"none"===t.display&&(t.display=e.option.display)},hide:function(){e.element.topArea.style.display="none"},destroy:function(){d._removeEvent(),r.removeItem(e.element.topArea),a.Object.keys(c).forEach(function(e){delete c[e]}),a.Object.keys(d).forEach(function(e){delete d[e]}),a.Object.keys(e).forEach(function(t){delete e[t]}),a.Object.keys(t).forEach(function(e){delete t[e]}),a.Object.keys(this).forEach(function(e){delete this[e]}.bind(this))}};return c._init(),d._addEvent(),c._charCount(0,!1),m}(g(n,o.constructed,o.options),o.pluginCallButtons,o.plugins,o.options.lang,t)}};window.SUNEDITOR=m.init({plugins:a})}}); \ No newline at end of file +!function(e){var t={};function i(n){if(t[n])return t[n].exports;var l=t[n]={i:n,l:!1,exports:{}};return e[n].call(l.exports,l,l.exports,i),l.l=!0,l.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)i.d(n,l,function(t){return e[t]}.bind(null,l));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="XJR1")}({"3FqI":function(e,t,i){},P6u4:function(e,t,i){"use strict";var n,l;n="undefined"!=typeof window?window:this,l=function(e,t){const i={toolbar:{default:"Default",save:"Save",font:"Font",formats:"Formats",fontSize:"Size",bold:"Bold",underline:"Underline",italic:"Italic",strike:"Strike",subscript:"Subscript",superscript:"Superscript",removeFormat:"Remove Format",fontColor:"Font Color",hiliteColor:"Highlight Color",indent:"Indent",outdent:"Outdent",align:"Align",alignLeft:"Align left",alignRight:"Align right",alignCenter:"Align center",alignJustify:"Align justify",list:"list",orderList:"Ordered list",unorderList:"Unordered list",horizontalRule:"horizontal line",hr_solid:"solid",hr_dotted:"dotted",hr_dashed:"dashed",table:"Table",link:"Link",image:"Image",video:"Video",fullScreen:"Full screen",showBlocks:"Show blocks",codeView:"Code view",undo:"Undo",redo:"Redo",preview:"Preview",print:"print",tag_p:"Paragraph",tag_div:"Normal (DIV)",tag_h:"Header",tag_blockquote:"Quote",tag_pre:"Code",template:"Template",lineHeight:"Line height"},dialogBox:{linkBox:{title:"Insert Link",url:"URL to link",text:"Text to display",newWindowCheck:"Open in new window"},imageBox:{title:"Insert image",file:"Select from files",url:"Image URL",altText:"Alternative text"},videoBox:{title:"Insert Video",url:"Media embed URL, YouTube"},caption:"Insert description",close:"Close",submitButton:"Submit",revertButton:"Revert",proportion:"constrain proportions",width:"Width",height:"Height",basic:"Basic",left:"Left",right:"Right",center:"Center"},controller:{edit:"Edit",remove:"Remove",insertRowAbove:"Insert row above",insertRowBelow:"Insert row below",deleteRow:"Delete row",insertColumnBefore:"Insert column before",insertColumnAfter:"Insert column after",deleteColumn:"Delete column",resize100:"Resize 100%",resize75:"Resize 75%",resize50:"Resize 50%",resize25:"Resize 25%",mirrorHorizontal:"Mirror, Horizontal",mirrorVertical:"Mirror, Vertical",rotateLeft:"Rotate left",rotateRight:"Rotate right",maxSize:"Max size",minSize:"Min size",tableHeader:"Table header",mergeCells:"Merge cells",splitCells:"Split Cells",HorizontalSplit:"Horizontal split",VerticalSplit:"Vertical split"}};return void 0===t&&(e.SUNEDITOR_LANG||(e.SUNEDITOR_LANG={}),e.SUNEDITOR_LANG.en=i),i},"object"==typeof e.exports?e.exports=n.document?l(n,!0):function(e){if(!e.document)throw new Error("SUNEDITOR_LANG a window with a document");return l(e)}:l(n)},WUQj:function(e,t,i){},XJR1:function(e,t,i){"use strict";i.r(t);i("3FqI"),i("WUQj");var n={name:"colorPicker",add:function(e){const t=e.context;t.colorPicker={colorListHTML:"",_colorInput:"",_defaultColor:"#000",_styleProperty:"color",_currentColor:"",_colorList:[]};let i=this.createColorList(e.context.option,e.lang,this._makeColorList);t.colorPicker.colorListHTML=i,i=null},createColorList:function(e,t,i){const n=e.colorList&&0!==e.colorList.length?e.colorList:["#ff0000","#ff5e00","#ffe400","#abf200","#00d8ff","#0055ff","#6600ff","#ff00dd","#000000","#ffd8d8","#fae0d4","#faf4c0","#e4f7ba","#d4f4fa","#d9e5ff","#e8d9ff","#ffd9fa","#f1f1f1","#ffa7a7","#ffc19e","#faed7d","#cef279","#b2ebf4","#b2ccff","#d1b2ff","#ffb2f5","#bdbdbd","#f15f5f","#f29661","#e5d85c","#bce55c","#5cd1e5","#6699ff","#a366ff","#f261df","#8c8c8c","#980000","#993800","#998a00","#6b9900","#008299","#003399","#3d0099","#990085","#353535","#670000","#662500","#665c00","#476600","#005766","#002266","#290066","#660058","#222222"];let l=[],o='
    ';for(let e=0,t=n.length;e0&&(o+='
    '+i(l)+"
    ",l=[]),"object"==typeof n[e]&&(o+='
    '+i(n[e])+"
    "));return o+='
    "},_makeColorList:function(e){let t="";t+='
      ';for(let i,n=0,l=e.length;n ');return t+="
    "},init:function(e,t){const i=this.plugins.colorPicker;let n=t||(i.getColorInNode.call(this,e)||this.context.colorPicker._defaultColor);n=i.isHexColor(n)?n:i.rgb2hex(n)||n;const l=this.context.colorPicker._colorList;if(l)for(let e=0,t=l.length;e=3&&"#"+((1<<24)+(i[0]<<16)+(i[1]<<8)+i[2]).toString(16).substr(1)}},l={name:"dialog",add:function(e){const t=e.context;t.dialog={};let i=e.util.createElement("DIV");i.className="se-dialog sun-editor-common";let n=e.util.createElement("DIV");n.className="se-dialog-back",n.style.display="none";let l=e.util.createElement("DIV");l.className="se-dialog-inner",l.style.display="none",i.appendChild(n),i.appendChild(l),t.dialog.modalArea=i,t.dialog.back=n,t.dialog.modal=l,t.dialog.modal.addEventListener("click",this.onClick_dialog.bind(e)),t.element.relative.appendChild(i),i=null,n=null,l=null},onClick_dialog:function(e){e.stopPropagation(),(/se-dialog-inner/.test(e.target.className)||/close/.test(e.target.getAttribute("data-command")))&&this.plugins.dialog.close.call(this)},open:function(e,t){if(this.modalForm)return!1;this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.plugins.dialog._bindClose=function(e){/27/.test(e.keyCode)&&this.plugins.dialog.close.call(this)}.bind(this),this._d.addEventListener("keydown",this.plugins.dialog._bindClose),this.context.dialog.updateModal=t,"full"===this.context.option.popupDisplay?this.context.dialog.modalArea.style.position="fixed":this.context.dialog.modalArea.style.position="absolute",this.context.dialog.kind=e,this.modalForm=this.context[e].modal;const i=this.context[e].focusElement;"function"==typeof this.plugins[e].on&&this.plugins[e].on.call(this,t),this.context.dialog.modalArea.style.display="block",this.context.dialog.back.style.display="block",this.context.dialog.modal.style.display="block",this.modalForm.style.display="block",i&&i.focus()},_bindClose:null,close:function(){this.plugins.dialog._bindClose&&(this._d.removeEventListener("keydown",this.plugins.dialog._bindClose),this.plugins.dialog._bindClose=null),this.modalForm.style.display="none",this.context.dialog.back.style.display="none",this.context.dialog.modalArea.style.display="none",this.modalForm=null,this.context.dialog.updateModal=!1,this.plugins[this.context.dialog.kind].init.call(this)}},o={name:"resizing",add:function(e){const t=e.context;t.resizing={_resizeClientX:0,_resizeClientY:0,_resize_plugin:"",_resize_w:0,_resize_h:0,_origin_w:0,_origin_h:0,_rotateVertical:!1,_resize_direction:"",_move_path:null,_isChange:!1};let i=this.setController_resize.call(e);t.resizing.resizeContainer=i,t.resizing.resizeDiv=i.querySelector(".se-modal-resize"),t.resizing.resizeDot=i.querySelector(".se-resize-dot"),t.resizing.resizeDisplay=i.querySelector(".se-resize-display");let n=this.setController_button.call(e);t.resizing.resizeButton=n,n.addEventListener("mousedown",function(e){e.stopPropagation()},!1);let l=t.resizing.resizeHandles=t.resizing.resizeDot.querySelectorAll("span");t.resizing.resizeButtonGroup=n.querySelector("._se_resizing_btn_group"),t.resizing.alignMenu=n.querySelector(".se-resizing-align-list"),t.resizing.alignMenuList=t.resizing.alignMenu.querySelectorAll("button"),t.resizing.alignButton=n.querySelector("._se_resizing_align_button"),t.resizing.alignButtonIcon=t.resizing.alignButton.querySelector("i"),t.resizing.captionButton=n.querySelector("._se_resizing_caption_button"),l[0].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[1].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[2].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[3].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[4].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[5].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[6].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),l[7].addEventListener("mousedown",this.onMouseDown_resize_handle.bind(e)),n.addEventListener("click",this.onClick_resizeButton.bind(e)),t.element.relative.appendChild(i),t.element.relative.appendChild(n),i=null,n=null,l=null},setController_resize:function(){const e=this.util.createElement("DIV");return e.className="se-resizing-container",e.style.display="none",e.innerHTML='
    ',e},setController_button:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-resizing",t.innerHTML='
    ",t},call_controller_resize:function(e,t){const i=this.context.resizing;i._resize_plugin=t;const n=i.resizeContainer,l=i.resizeDiv,o=this.util.getOffset(e,this.context.element.wysiwygFrame),s=i._rotateVertical=/^(90|270)$/.test(Math.abs(e.getAttribute("data-rotate")).toString()),a=s?e.offsetHeight:e.offsetWidth,r=s?e.offsetWidth:e.offsetHeight,c=o.top,d=o.left-this.context.element.wysiwygFrame.scrollLeft;n.style.top=c+"px",n.style.left=d+"px",n.style.width=a+"px",n.style.height=r+"px",l.style.top="0px",l.style.left="0px",l.style.width=a+"px",l.style.height=r+"px";let u=e.getAttribute("data-align")||"basic";u="none"===u?"basic":u,this.util.changeTxt(i.resizeDisplay,this.lang.dialogBox[u]+" ("+a+" x "+r+")");const h=this.context[t]._resizing?"flex":"none",g=i.resizeHandles;i.resizeButtonGroup.style.display=h;for(let e=0,t=g.length;e",e},set_cover:function(e){const t=this.util.createElement("FIGURE");return t.appendChild(e),t},set_container:function(e,t){const i=this.util.createElement("DIV");return i.className="se-component "+t,i.setAttribute("contenteditable",!1),i.appendChild(e),i},onClick_resizeButton:function(e){e.stopPropagation();const t=e.target,i=t.getAttribute("data-command")||t.parentNode.getAttribute("data-command");if(!i)return;const n=t.getAttribute("data-value")||t.parentNode.getAttribute("data-value"),l=this.context.resizing._resize_plugin,o=this.context[l],s=o._element,a=this.plugins[l];if(e.preventDefault(),"function"!=typeof this.plugins.resizing._closeAlignMenu||(this.plugins.resizing._closeAlignMenu(),"onalign"!==i)){switch(i){case"percent":this.plugins.resizing.resetTransform.call(this,s),a.setPercentSize.call(this,100*n+"%","auto"),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l));break;case"mirror":const e=s.getAttribute("data-rotate")||"0";let t=s.getAttribute("data-rotateX")||"",r=s.getAttribute("data-rotateY")||"";"h"===n&&!this.context.resizing._rotateVertical||"v"===n&&this.context.resizing._rotateVertical?r=r?"":"180":t=t?"":"180",s.setAttribute("data-rotateX",t),s.setAttribute("data-rotateY",r),this.plugins.resizing._setTransForm(s,e,t,r);break;case"rotate":const c=this.context.resizing,d=1*s.getAttribute("data-rotate")+1*n,u=this._w.Math.abs(d)>=360?0:d;s.setAttribute("data-rotate",u),c._rotateVertical=/^(90|270)$/.test(this._w.Math.abs(u).toString()),this.plugins.resizing.setTransformSize.call(this,s,null,null),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,c._resize_plugin));break;case"onalign":this.plugins.resizing.openAlignMenu.call(this);break;case"align":const h="basic"===n?"none":n;o._cover.style.margin=h&&"none"!==h?"auto":"0",this.util.removeClass(o._container,o._floatClassRegExp),this.util.addClass(o._container,"__se__float-"+h),s.setAttribute("data-align",h),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l));break;case"caption":const g=!o._captionChecked;if(a.openModify.call(this,!0),o._captionChecked=o.captionCheckEl.checked=g,"image"===l?a.update_image.call(this,!1,!1):"video"===l&&(this.context.dialog.updateModal=!0,a.submitAction.call(this)),g){const e=this.util.getChildElement(o._caption,function(e){return 3===e.nodeType});e?this.setRange(e,0,e,e.textContent.length):o._caption.focus(),this.controllersOff()}else a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l)),a.openModify.call(this,!0);break;case"revert":a.setAutoSize?a.setAutoSize.call(this):(a.resetAlign.call(this),this.plugins.resizing.resetTransform.call(this,s)),a.onModifyMode.call(this,s,this.plugins.resizing.call_controller_resize.call(this,s,l));break;case"update":a.openModify.call(this),this.controllersOff();break;case"delete":a.destroy.call(this)}this.history.push()}},resetTransform:function(e){const t=(e.getAttribute("data-origin")||"").split(",");this.context.resizing._rotateVertical=!1,e.style.transform="",e.style.transformOrigin="",e.setAttribute("data-rotate",""),e.setAttribute("data-rotateX",""),e.setAttribute("data-rotateY",""),e.style.width=t[0]?t[0]+"px":"auto",e.style.height=t[1]?t[1]+"px":"",this.plugins.resizing.setTransformSize.call(this,e,null,null)},setTransformSize:function(e,t,i){const n=this.util.getParentElement(e,"FIGURE"),l=this.context.resizing._rotateVertical,o=1*e.getAttribute("data-rotate"),s=t||e.offsetWidth,a=i||e.offsetHeight,r=l?a:s,c=l?s:a;this.plugins[this.context.resizing._resize_plugin].cancelPercentAttr.call(this),this.plugins[this.context.resizing._resize_plugin].setSize.call(this,s,a),n.style.width=r+"px",n.style.height=this.context[this.context.resizing._resize_plugin]._caption?"":c+"px";let d="";if(l){let e=s/2+"px "+s/2+"px 0",t=a/2+"px "+a/2+"px 0";d=90===o||-270===o?t:e}e.style.transformOrigin=d,this.plugins.resizing._setTransForm(e,o.toString(),e.getAttribute("data-rotateX")||"",e.getAttribute("data-rotateY")||""),this.plugins.resizing._setCaptionPosition.call(this,e,this.util.getChildElement(this.util.getParentElement(e,"FIGURE"),"FIGCAPTION"))},_setTransForm:function(e,t,i,n){let l=(e.offsetWidth-e.offsetHeight)*(/-/.test(t)?1:-1),o="";if(/[1-9]/.test(t)&&(i||n))switch(o=i?"Y":"X",t){case"90":o=i&&n?"X":n?o:"";break;case"270":l*=-1,o=i&&n?"Y":i?o:"";break;case"-90":o=i&&n?"Y":i?o:"";break;case"-270":l*=-1,o=i&&n?"X":n?o:"";break;default:o=""}t%180==0&&(e.style.maxWidth="100%"),e.style.transform="rotate("+t+"deg)"+(i?" rotateX("+i+"deg)":"")+(n?" rotateY("+n+"deg)":"")+(o?" translate"+o+"("+l+"px)":"")},_setCaptionPosition:function(e,t){t&&(t.style.marginTop=(this.context.resizing._rotateVertical?e.offsetWidth-e.offsetHeight:0)+"px")},onMouseDown_resize_handle:function(e){const t=this.context.resizing,i=t._resize_direction=e.target.classList[0];e.stopPropagation(),e.preventDefault(),t._resizeClientX=e.clientX,t._resizeClientY=e.clientY,this.context.element.resizeBackground.style.display="block",t.resizeButton.style.display="none",t.resizeDiv.style.float=/l/.test(i)?"right":/r/.test(i)?"left":"none";const n=function(){const e=t._isChange;t._isChange=!1,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",n),this.plugins.resizing.cancel_controller_resize.call(this),e&&this.history.push()}.bind(this),l=this.plugins.resizing.resizing_element.bind(this,t,i,this.context[t._resize_plugin]);document.addEventListener("mousemove",l),document.addEventListener("mouseup",n)},resizing_element:function(e,t,i,n){const l=n.clientX,o=n.clientY;let s=i._element_w,a=i._element_h;const r=i._element_w+(/r/.test(t)?l-e._resizeClientX:e._resizeClientX-l),c=i._element_h+(/b/.test(t)?o-e._resizeClientY:e._resizeClientY-o),d=i._element_h/i._element_w*r;/t/.test(t)&&(e.resizeDiv.style.top=i._element_h-(/h/.test(t)?c:d)+"px"),/l/.test(t)&&(e.resizeDiv.style.left=i._element_w-r+"px"),/r|l/.test(t)&&(e.resizeDiv.style.width=r+"px",s=r),/^(t|b)[^h]$/.test(t)?(e.resizeDiv.style.height=d+"px",a=d):/^(t|b)h$/.test(t)&&(e.resizeDiv.style.height=c+"px",a=c),e._resize_w=s,e._resize_h=a,this.util.changeTxt(e.resizeDisplay,this._w.Math.round(s)+" x "+this._w.Math.round(a)),e._isChange=!0},cancel_controller_resize:function(){const e=this.context.resizing._rotateVertical;this.controllersOff(),this.context.element.resizeBackground.style.display="none";let t=this._w.Math.round(e?this.context.resizing._resize_h:this.context.resizing._resize_w),i=this._w.Math.round(e?this.context.resizing._resize_w:this.context.resizing._resize_h);if(!e&&!/^\d+%$/.test(t)){const e=16,n=this.context.element.wysiwygFrame.clientWidth-2*e-2;t.toString().match(/\d+/)[0]>n&&(t=n,i="video"===this.context.resizing._resize_plugin?i/t*n:"auto")}this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t,i),this.plugins.resizing.setTransformSize.call(this,this.context[this.context.resizing._resize_plugin]._element,t,i),this.plugins[this.context.resizing._resize_plugin].init.call(this)}},s={name:"notice",add:function(e){const t=e.context;t.notice={};let i=e.util.createElement("DIV"),n=e.util.createElement("SPAN"),l=e.util.createElement("BUTTON");i.className="se-notice",l.className="close",l.setAttribute("aria-label","Close"),l.setAttribute("title",e.lang.dialogBox.close),l.innerHTML='',i.appendChild(n),i.appendChild(l),t.notice.modal=i,t.notice.message=n,l.addEventListener("click",this.onClick_cancel.bind(e)),t.element.editorArea.insertBefore(i,t.element.wysiwygFrame),i=null},onClick_cancel:function(e){e.preventDefault(),e.stopPropagation(),this.plugins.notice.close.call(this)},open:function(e){this.context.notice.message.textContent=e,this.context.notice.modal.style.display="block"},close:function(){this.context.notice.modal.style.display="none"}},a={align:{name:"align",add:function(e,t){const i=e.context;i.align={_alignList:null,currentAlign:""};let n=this.setSubmenu.call(e),l=n.querySelector("ul");l.addEventListener("click",this.pickup.bind(e)),i.align._alignList=l.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null,l=null},setSubmenu:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-list-layer",t.innerHTML='
    ",t},on:function(){const e=this.context.align,t=e._alignList,i=this.commandMap.ALIGN.getAttribute("data-focus")||"left";if(i!==e.currentAlign){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(o=0,s=a.length;o";return r+=" ",r+="",i.innerHTML=r,i},on:function(){const e=this.context.font,t=e._fontList,i=this.commandMap.FONT.textContent;if(i!==e.currentFont){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(let t,i=0,o=e.fontSizeUnit,s=n.length;i";return l+=" ",i.innerHTML=l,i},on:function(){const e=this.context.fontSize,t=e._sizeList,i=this.commandMap.SIZE.textContent;if(i!==e.currentSize){for(let e=0,n=t.length;e
  • ",t},appendHr:function(e){const t=this.util.createElement("HR");t.className=e,this.focus();let i=this.insertComponent(t);this.setRange(i,0,i,0)},horizontalRulePick:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=null;for(;!i&&!/UL/i.test(t.tagName);)i=t.getAttribute("data-value"),t=t.parentNode;i&&(this.plugins.horizontalRule.appendHr.call(this,"__se__"+i),this.submenuOff())}},list:{name:"list",add:function(e,t){const i=e.context;i.list={_list:null,currentList:""};let n=this.setSubmenu.call(e),l=n.querySelector("ul");l.addEventListener("click",this.pickup.bind(e)),i.list._list=l.querySelectorAll("li button"),t.parentNode.appendChild(n),n=null,l=null},setSubmenu:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-submenu se-list-layer",t.innerHTML='
    ",t},on:function(){const e=this.context.list,t=e._list,i=this.commandMap.LI.getAttribute("data-focus")||"";if(i!==e.currentList){for(let e=0,n=t.length;e"),e.innerHTML+=t.outerHTML,i&&(e.innerHTML+="
    ")}else e.innerHTML=t.innerHTML;r.appendChild(e),s||(h=r),s&&d===c&&!this.util.isRangeFormatElement(p)||(u||(u=r),l&&s&&d===c||s&&this.util.isList(c)&&c===a||r.parentNode!==d&&d.insertBefore(r,p)),this.util.removeItem(t),l&&null===g&&(g=r.children.length-1),s&&this.util.getRangeFormatElement(c,m)!==this.util.getRangeFormatElement(a,m)&&(r=this.util.createElement(i)),f&&0===f.children.length&&this.util.removeItem(f)}else this.util.removeItem(t);g&&(u=u.children[g]),a&&(p=r.children.length-1,r.innerHTML+=d.innerHTML,h=r.children[p],this.util.removeItem(d)),o=s=this.util.getEdgeChildNodes(u.firstChild,h.lastChild)}else{const e=this.util.getRangeFormatElement(this.getSelectionNode()),t=e&&e.tagName===i;let l,a;const r=function(e){return!this.isComponent(e)}.bind(this.util);t||(a=this.util.createElement(i));for(let e,c,d=0,u=n.length;d1?this.setRange(o.sc,0,s.ec,s.ec.textContent.length):this.setRange(o.ec,o.ec.textContent.length,s.ec,s.ec.textContent.length),this.submenuOff()}},table:{name:"table",add:function(e,t){const i=e.context;i.table={_element:null,_tdElement:null,_trElement:null,_trElements:null,_tableXY:[],_maxWidth:!0,resizeIcon:null,resizeText:null,headerButton:null,mergeButton:null,splitButton:null,splitMenu:null,maxText:e.lang.controller.maxSize,minText:e.lang.controller.minSize,_physical_cellCnt:0,_logical_cellCnt:0,_rowCnt:0,_rowIndex:0,_physical_cellIndex:0,_logical_cellIndex:0,_current_colSpan:0,_current_rowSpan:0};let n=this.setSubmenu.call(e),l=n.querySelector(".se-controller-table-picker");i.table.tableHighlight=n.querySelector(".se-table-size-highlighted"),i.table.tableUnHighlight=n.querySelector(".se-table-size-unhighlighted"),i.table.tableDisplay=n.querySelector(".se-table-size-display");let o=this.setController_table.call(e);i.table.tableController=o,i.table.resizeIcon=o.querySelector("._se_table_resize > i"),i.table.resizeText=o.querySelector("._se_table_resize > span > span"),i.table.headerButton=o.querySelector("._se_table_header"),o.addEventListener("mousedown",function(e){e.stopPropagation()},!1);let s=this.setController_tableEditor.call(e);i.table.resizeDiv=s,i.table.splitMenu=s.querySelector(".se-btn-group-sub"),i.table.mergeButton=s.querySelector("._se_table_merge_button"),i.table.splitButton=s.querySelector("._se_table_split_button"),s.addEventListener("mousedown",function(e){e.stopPropagation()},!1),l.addEventListener("mousemove",this.onMouseMove_tablePicker.bind(e)),l.addEventListener("click",this.appendTable.bind(e)),s.addEventListener("click",this.onClick_tableController.bind(e)),o.addEventListener("click",this.onClick_tableController.bind(e)),t.parentNode.appendChild(n),i.element.relative.appendChild(s),i.element.relative.appendChild(o),n=null,l=null,s=null,o=null},setSubmenu:function(){const e=this.util.createElement("DIV");return e.className="se-submenu se-selector-table",e.innerHTML='
    1 x 1
    ',e},setController_table:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-table",t.innerHTML='
    ",t},setController_tableEditor:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-table-cell",t.innerHTML='
    • '+e.controller.VerticalSplit+'
    • '+e.controller.HorizontalSplit+"
    ",t},appendTable:function(){const e=this.util.createElement("TABLE"),t=this.plugins.table.createCells,i=this.context.table._tableXY[0];let n=this.context.table._tableXY[1],l="";for(;n>0;)l+=""+t.call(this,"td",i)+"",--n;l+="",e.innerHTML=l,this.insertComponent(e),this.focus(),this.plugins.table.reset_table_picker.call(this)},createCells:function(e,t,i){if(e=e.toLowerCase(),i){const t=this.util.createElement(e);return t.innerHTML="
    ",t}{let i="";for(;t>0;)i+="<"+e+">
    ",t--;return i}},onMouseMove_tablePicker:function(e){e.stopPropagation();let t=this._w.Math.ceil(e.offsetX/18),i=this._w.Math.ceil(e.offsetY/18);t=t<1?1:t,i=i<1?1:i,this.context.table.tableHighlight.style.width=t+"em",this.context.table.tableHighlight.style.height=i+"em";let n=t<5?5:t>9?10:t+1,l=i<5?5:i>9?10:i+1;this.context.table.tableUnHighlight.style.width=n+"em",this.context.table.tableUnHighlight.style.height=l+"em",this.util.changeTxt(this.context.table.tableDisplay,t+" x "+i),this.context.table._tableXY=[t,i]},reset_table_picker:function(){if(!this.context.table.tableHighlight)return;const e=this.context.table.tableHighlight.style,t=this.context.table.tableUnHighlight.style;e.width="1em",e.height="1em",t.width="5em",t.height="5em",this.util.changeTxt(this.context.table.tableDisplay,"1 x 1"),this.submenuOff()},init:function(){const e=this.context.table,t=this.plugins.table;if(t._removeEvents.call(this),t._selectedTable){const e=t._selectedTable.querySelectorAll(".se-table-selected-cell");for(let t=0,i=e.length;t0)for(let e,t=0;to||(u>=e.index?(n+=e.cs,u+=e.cs,e.rs-=1,e.row=o+1,e.rs<1&&(r.splice(t,1),t--)):h===g-1&&(e.rs-=1,e.row=o+1,e.rs<1&&(r.splice(t,1),t--)));if(o===s&&h===l){i._logical_cellIndex=u;break}d>0&&a.push({index:u,cs:c+1,rs:d,row:-1}),n+=c}r=r.concat(a).sort(function(e,t){return e.index-t.index}),a=[]}a=null,r=null}},editTable:function(e,t){const i=this.plugins.table,n=this.context.table,l=n._element,o="row"===e;if(o){const e=n._trElement.parentNode;if(/^THEAD$/i.test(e.nodeName)){if("up"===t)return;if(!e.nextElementSibling||!/^TBODY$/i.test(e.nextElementSibling.nodeName))return void(l.innerHTML+=""+i.createCells.call(this,"td",n._logical_cellCnt,!1)+"")}}if(i._ref){const e=n._tdElement,l=i._selectedCells;if(o)if(t)i.setCellInfo.call(this,"up"===t?l[0]:l[l.length-1],!0),i.editRow.call(this,t,e);else{let e=l[0].parentNode;const n=[l[0]];for(let t,i=1,o=l.length;is&&s>t&&(e[l].rowSpan=i+a,c-=n)}if(n){const e=r[o+1];if(e){const t=[];let i=r[o].cells,n=0;for(let e,l,o=0,s=i.length;o1&&(e.rowSpan-=1,t.push({cell:e.cloneNode(!1),index:l}));if(t.length>0){let l=t.shift();i=e.cells,n=0;for(let o,s,a=0,r=i.length;a=l.index)||(a--,n--,n+=l.cell.colSpan-1,e.insertBefore(l.cell,o),l=t.shift()));a++);if(l){e.appendChild(l.cell);for(let i=0,n=t.length;i0){const e=!o[b+1];for(let t,i=0;i_||(p>=t.index?(p=b+(f+=t.cs),t.rs-=1,t.row=_+1,t.rs<1&&(d.splice(i,1),i--)):e&&(t.rs-=1,t.row=_+1,t.rs<1&&(d.splice(i,1),i--)))}i>0&&c.push({rs:i,cs:r+1,index:p,row:-1}),p>=t&&p+r<=t+s?h.push(e):p<=t+s&&p+r>=t?e.colSpan-=n.getOverlapRangeAtIndex(a,a+s,p,p+r):i>0&&(pt+s)&&g.push({cell:e,i:_,rs:_+i}),f+=r}else{if(b>=t)break;if(r>0){if(u<1&&r+b>=t){e.colSpan+=1,t=null,u=i+1;break}t-=r}if(!m){for(let e,i=0;i0){u-=1;continue}null!==t&&o.length>0&&(p=this.plugins.table.createCells.call(this,o[0].nodeName,0,!0),p=e.insertBefore(p,o[t]))}}if(l){let e,t;for(let i,l=0,o=h.length;l1)c.colSpan=this._w.Math.floor(e/2),l.colSpan=e-c.colSpan,s.insertBefore(c,l.nextElementSibling);else{let t=[],i=[];for(let s,r,c=0,d=n._rowCnt;c0)for(let e,t=0;tc||(u>=e.index?(r+=e.cs,u+=e.cs,e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)):h===g-1&&(e.rs-=1,e.row=c+1,e.rs<1&&(i.splice(t,1),t--)));if(u<=a&&d>0&&t.push({index:u,cs:o+1,rs:d,row:-1}),n!==l&&u<=a&&u+o>=a+e-1){n.colSpan+=1;break}if(u>a)break;r+=o}i=i.concat(t).sort(function(e,t){return e.index-t.index}),t=[]}s.insertBefore(c,l.nextElementSibling)}}else{const e=l.rowSpan;if(c.colSpan=l.colSpan,e>1){c.rowSpan=this._w.Math.floor(e/2);const i=e-c.rowSpan,n=[],r=t.getArrayIndex(o,s)+i;for(let e,t,i=0;i=a);c++)(o=(l=e[c]).rowSpan-1)>0&&o+i>=r&&s=h.index&&(r+=h.cs,l+=h.cs,h=n.shift()),l>=a||o===s-1){d.insertBefore(c,e.nextElementSibling);break}r+=t}l.rowSpan=i}else{c.rowSpan=l.rowSpan;const e=t.createElement("TR");e.appendChild(c);for(let e,t=0;t=r&&(e[i].rowSpan+=1)}const i=n._physical_cellIndex,a=s.cells;for(let e=0,t=a.length;e0&&s+o>=n&&(e.rowSpan-=i.getOverlapRangeAtIndex(n,l,s,s+o));else o.push(e[s]);for(let e=0,t=o.length;e"+this.plugins.table.createCells.call(this,"th",this.context.table._logical_cellCnt,!1)+"",n.insertBefore(t,n.firstElementChild)}e.toggleClass(t,"active"),/TH/i.test(this.context.table._tdElement.nodeName)?this.controllersOff():this.plugins.table.setPositionControllerDiv.call(this,this.context.table._tdElement,!1)},resizeTable:function(){const e=this.context.table,t=e.resizeIcon,i=e.resizeText;let n="se-icon-expansion",l="se-icon-reduction",o=e.minText,s="100%";e._maxWidth||(n="se-icon-reduction",l="se-icon-expansion",o=e.maxText,s="auto"),this.util.removeClass(t,n),this.util.addClass(t,l),this.util.changeTxt(i,o),e._element.style.width=s},setActiveButton:function(e,t){const i=this.context.table;t&&e!==t?(i.splitButton.setAttribute("disabled",!0),i.mergeButton.removeAttribute("disabled")):(i.splitButton.removeAttribute("disabled"),i.mergeButton.setAttribute("disabled",!0))},_bindOnSelect:null,_bindOffSelect:null,_bindOffShift:null,_selectedCells:null,_shift:!1,_fixedCell:null,_fixedCellName:null,_selectedCell:null,_selectedTable:null,_ref:null,_toggleEditor:function(e){this.context.element.wysiwyg.setAttribute("contenteditable",e),e?this.util.removeClass(this.context.element.wysiwyg,"se-disabled"):this.util.addClass(this.context.element.wysiwyg,"se-disabled")},_offCellMultiSelect:function(e){e.stopPropagation();const t=this.plugins.table;t._shift?t._initBind&&(this._wd.removeEventListener("touchmove",t._initBind),t._initBind=null):(t._removeEvents.call(this),t._toggleEditor.call(this,!0)),t._fixedCell&&t._selectedTable&&(t.setActiveButton.call(this,t._fixedCell,t._selectedCell),t.call_controller_tableEdit.call(this,t._selectedCell||t._fixedCell),t._selectedCells=t._selectedTable.querySelectorAll(".se-table-selected-cell"),t._shift||(t._fixedCell=null,t._selectedCell=null,t._fixedCellName=null),this._editorRange(),this.focus())},_onCellMultiSelect:function(e){const t=this.plugins.table,i=this.util.getParentElement(e.target,this.util.isCell);if(t._shift)i===t._fixedCell?t._toggleEditor.call(this,!0):t._toggleEditor.call(this,!1);else if(!t._ref){if(i===t._fixedCell)return;t._toggleEditor.call(this,!1)}i&&i!==t._selectedCell&&t._fixedCellName===i.nodeName&&t._selectedTable===this.util.getParentElement(i,"TABLE")&&(t._selectedCell=i,t._setMultiCells.call(this,t._fixedCell,i))},_setMultiCells:function(e,t){const i=this.plugins.table,n=i._selectedTable.rows,l=this.util,o=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=o.length;e0)for(let e,t=0;td||(u>=e.index?(o+=e.cs,u+=e.cs,e.rs-=1,e.row=d+1,e.rs<1&&(a.splice(t,1),t--)):p===m-1&&(e.rs-=1,e.row=d+1,e.rs<1&&(a.splice(t,1),t--)));if(s){if(n!==e&&n!==t||(c.cs=null!==c.cs&&c.csu+h?c.ce:u+h,c.rs=null!==c.rs&&c.rsd+g?c.re:d+g,c._i+=1),2===c._i){s=!1,a=[],r=[],d=-1;break}}else if(l.getOverlapRangeAtIndex(c.cs,c.ce,u,u+h)&&l.getOverlapRangeAtIndex(c.rs,c.re,d,d+g)){const e=c.csu+h?c.ce:u+h,i=c.rsd+g?c.re:d+g;if(c.cs!==e||c.ce!==t||c.rs!==i||c.re!==o){c.cs=e,c.ce=t,c.rs=i,c.re=o,d=-1,a=[],r=[];break}l.addClass(n,"se-table-selected-cell")}g>0&&r.push({index:u,cs:h+1,rs:g,row:-1}),o+=n.colSpan-1}a=a.concat(r).sort(function(e,t){return e.index-t.index}),r=[]}},_removeEvents:function(){const e=this.plugins.table;e._initBind&&(this._wd.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._wd.removeEventListener("mousedown",e._bindOnSelect),this._wd.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._wd.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._wd.removeEventListener("keyup",e._bindOffShift),e._bindOffShift=null)},_initBind:null,onTableCellMultiSelect:function(e,t){const i=this.plugins.table;i._removeEvents.call(this),this.controllersOff(),i._shift=t,i._fixedCell=e,i._fixedCellName=e.nodeName,i._selectedTable=this.util.getParentElement(e,"TABLE");const n=i._selectedTable.querySelectorAll(".se-table-selected-cell");for(let e=0,t=n.length;e<'+e+a+">"+o+"";return l+="",i.innerHTML=l,i},on:function(){const e=this.context.formatBlock,t=e._formatList,i=(this.commandMap.FORMAT.getAttribute("data-focus")||"P").toLowerCase();if(i!==e.currentFormat){for(let e=0,n=t.length;e('+t.toolbar.default+")";for(let e,t=0,i=n.length;t";return l+=" ",i.innerHTML=l,i},on:function(){const e=this.context.lineHeight,t=e._sizeList,i=this.util.getFormatElement(this.getSelectionNode()).style.lineHeight+"";if(i!==e.currentSize){for(let e=0,n=t.length;e";return i+=" ",i+="",t.innerHTML=i,t},pickup:function(e){if(!/^BUTTON$/i.test(e.target.tagName))return!1;e.preventDefault(),e.stopPropagation();const t=this.context.option.templates[e.target.getAttribute("data-value")];if(!t.html)throw this.submenuOff(),Error('[SUNEDITOR.template.fail] cause : "templates[i].html not found"');this.setContents(t.html),this.submenuOff()}},link:{name:"link",add:function(e){e.addModule([l]);const t=e.context;t.link={focusElement:null,linkNewWindowCheck:null,linkAnchorText:null,_linkAnchor:null};let i=this.setDialog.call(e);t.link.modal=i,t.link.focusElement=i.querySelector("._se_link_url"),t.link.linkAnchorText=i.querySelector("._se_link_text"),t.link.linkNewWindowCheck=i.querySelector("._se_link_check");let n=this.setController_LinkButton.call(e);t.link.linkBtn=n,t.link._linkAnchor=null,n.addEventListener("mousedown",function(e){e.stopPropagation()},!1),i.querySelector(".se-btn-primary").addEventListener("click",this.submit.bind(e)),n.addEventListener("click",this.onClick_linkBtn.bind(e)),t.dialog.modal.appendChild(i),t.element.relative.appendChild(n),i=null,n=null},setDialog:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-dialog-content",t.style.display="none",t.innerHTML='",t},setController_LinkButton:function(){const e=this.lang,t=this.util.createElement("DIV");return t.className="se-controller se-controller-link",t.innerHTML='
    ",t},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation();const t=function(){if(0===this.context.link.focusElement.value.trim().length)return!1;const e=this.context.link,t=e.focusElement.value,i=e.linkAnchorText,n=0===i.value.length?t:i.value;if(this.context.dialog.updateModal)e._linkAnchor.href=t,e._linkAnchor.textContent=n,e._linkAnchor.target=e.linkNewWindowCheck.checked?"_blank":"",this.history.push(),this.setRange(e._linkAnchor.childNodes[0],0,e._linkAnchor.childNodes[0],e._linkAnchor.textContent.length);else{const i=this.util.createElement("A");i.href=t,i.textContent=n,i.target=e.linkNewWindowCheck.checked?"_blank":"",this.insertNode(i),this.setRange(i.childNodes[0],0,i.childNodes[0],i.textContent.length)}e.focusElement.value="",e.linkAnchorText.value=""}.bind(this);try{t()}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.focus()}return!1},on:function(e){e||(this.context.link.linkAnchorText.value=this.getSelection().toString())},call_controller_linkButton:function(e){this.editLink=this.context.link._linkAnchor=e;const t=this.context.link.linkBtn,i=t.querySelector("a");i.href=e.href,i.title=e.textContent,i.textContent=e.textContent;const n=this.util.getOffset(e,this.context.element.wysiwygFrame);t.style.top=n.top+e.offsetHeight+10+"px",t.style.left=n.left-this.context.element.wysiwygFrame.scrollLeft+"px",t.style.display="block";const l=this.context.element.wysiwygFrame.offsetWidth-(t.offsetLeft+t.offsetWidth);l<0?(t.style.left=t.offsetLeft+l+"px",t.firstElementChild.style.left=20-l+"px"):t.firstElementChild.style.left="20px",this.controllersOn(t)},onClick_linkBtn:function(e){e.stopPropagation();const t=e.target.getAttribute("data-command")||e.target.parentNode.getAttribute("data-command");t&&(e.preventDefault(),/update/.test(t)?(this.context.link.focusElement.value=this.context.link._linkAnchor.href,this.context.link.linkAnchorText.value=this.context.link._linkAnchor.textContent,this.context.link.linkNewWindowCheck.checked=!!/_blank/i.test(this.context.link._linkAnchor.target),this.plugins.dialog.open.call(this,"link",!0)):(this.util.removeItem(this.context.link._linkAnchor),this.context.link._linkAnchor=null,this.focus()),this.controllersOff(),this.history.push())},init:function(){const e=this.context.link;e.linkBtn.style.display="none",e._linkAnchor=null,e.focusElement.value="",e.linkAnchorText.value="",e.linkNewWindowCheck.checked=!1}},image:{name:"image",add:function(e){e.addModule([l,o,s]);const t=e.context;t.image={_linkElement:null,_container:null,_cover:null,_element:null,_element_w:1,_element_h:1,_element_l:0,_element_t:0,_origin_w:"auto"===t.option.imageWidth?"":t.option.imageWidth,_origin_h:"",_altText:"",_caption:null,captionCheckEl:null,_linkValue:"",_align:"none",_captionChecked:!1,_proportionChecked:!0,_floatClassRegExp:"__se__float\\-[a-z]+",_xmlHttp:null,_resizing:t.option.imageResizing,_defaultAuto:"auto"===t.option.imageWidth,_uploadFileLength:0};let i=this.setDialog.call(e);t.image.modal=i,t.image.imgUrlFile=i.querySelector("._se_image_url"),t.image.imgInputFile=t.image.focusElement=i.querySelector("._se_image_file"),t.image.altText=i.querySelector("._se_image_alt"),t.image.imgLink=i.querySelector("._se_image_link"),t.image.imgLinkNewWindowCheck=i.querySelector("._se_image_link_check"),t.image.captionCheckEl=i.querySelector("._se_image_check_caption"),t.image.modal.querySelector(".se-dialog-tabs").addEventListener("click",this.openTab.bind(e)),t.image.modal.querySelector(".se-btn-primary").addEventListener("click",this.submit.bind(e)),t.image.imageX={},t.image.imageY={},t.option.imageResizing&&(t.image.proportion=i.querySelector("._se_image_check_proportion"),t.image.imageX=i.querySelector("._se_image_size_x"),t.image.imageY=i.querySelector("._se_image_size_y"),t.image.imageX.value=t.option.imageWidth,t.image.imageX.addEventListener("change",this.setInputSize.bind(e,"x")),t.image.imageY.addEventListener("change",this.setInputSize.bind(e,"y")),i.querySelector(".se-dialog-btn-revert").addEventListener("click",this.sizeRevert.bind(e))),t.dialog.modal.appendChild(i),i=null},setDialog:function(){const e=this.context.option,t=this.lang,i=this.util.createElement("DIV");i.className="se-dialog-content",i.style.display="none";let n='
    '+t.dialogBox.imageBox.title+'
    ';return e.imageFileInput&&(n+='
    '),e.imageUrlInput&&(n+='
    '),n+='
    ',e.imageResizing&&(n+='
    '),n+='
    ",i.innerHTML=n,i},openTab:function(e){const t=this.context.image.modal,i="init"===e?t.querySelector("._se_tab_link"):e.target;if(!/^BUTTON$/i.test(i.tagName))return!1;const n=i.getAttribute("data-tab-link");let l,o,s;for(o=t.getElementsByClassName("_se_tab_content"),l=0;l0){let t=0;const i=[];for(let n=0,l=e.length;n0){let e=0;const i=this._variable._imagesInfo;for(let t=0,n=i.length;tn){const i="[SUNEDITOR.imageUpload.fail] Size of uploadable total images: "+n/1e3+"KB";return this._imageUploadError(i,{limitSize:n,currentSize:e,uploadSize:t})&&s.open.call(this,i),void this.closeLoading()}}this.context.image._uploadFileLength=i.length;const l=this.context.option.imageUploadUrl,o=this.context.option.imageUploadHeader,a=this.context.dialog.updateModal?1:i.length;if("string"==typeof l&&l.length>0){const e=new FormData;for(let t=0;t0)for(let e in o)this.context.image._xmlHttp.setRequestHeader(e,o[e]);this.context.image._xmlHttp.send(e)}else for(let e=0;e0){const n=this.util.createElement("A");return n.href=/^https?:\/\//.test(t)?t:"http://"+t,n.target=i?"_blank":"",n.setAttribute("data-image-link","image"),e.setAttribute("data-image-link",t),n.appendChild(e),n}return e},setInputSize:function(e){if(!this.context.dialog.updateModal)return;const t=this.context.image;t.proportion.checked&&("x"===e?t.imageY.value=Math.round(t._element_h/t._element_w*t.imageX.value):t.imageX.value=Math.round(t._element_w/t._element_h*t.imageY.value))},submit:function(e){const t=this.context.image,i=this.plugins.image;this.showLoading(),e.preventDefault(),e.stopPropagation(),t._linkValue=t.imgLink.value,t._altText=t.altText.value,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked,t._resizing&&(t._proportionChecked=t.proportion.checked);try{this.context.dialog.updateModal&&i.update_image.call(this,!1,!1),t.imgInputFile&&t.imgInputFile.files.length>0?i.onRender_imgInput.call(this):t.imgUrlFile&&t.imgUrlFile.value.trim().length>0?i.onRender_imgUrl.call(this):this.closeLoading()}catch(e){throw this.closeLoading(),Error('[SUNEDITOR.image.submit.fail] cause : "'+e.message+'"')}finally{this.plugins.dialog.close.call(this)}return!1},setImagesInfo:function(e,t){const i=this._variable._imagesInfo;let n=e.getAttribute("data-index"),l=null,o="";if(n){o="update",n*=1;for(let e=0,t=i.length;e-1||(t.splice(i,1),this._imageUpload(null,e,"delete",null,0),i--)},_onload_image:function(e,t){t&&this.plugins.image.setImagesInfo.call(this,e,t)},create_image:function(e,t,i,n,l,o){const s=this.context.image;let a=this.util.createElement("IMG");a.addEventListener("load",this.plugins.image._onload_image.bind(this,a,o)),a.src=e,a.setAttribute("data-align",l),a.alt=s._altText,(a=this.plugins.image.onRender_link.call(this,a,t,i)).setAttribute("data-rotate","0"),s._resizing&&(/\d+/.test(n)&&((n=1*n.match(/\d+/)[0])>0?a.style.width=n+"px":n=""),a.setAttribute("data-proportion",s._proportionChecked));const r=this.plugins.resizing.set_cover.call(this,a),c=this.plugins.resizing.set_container.call(this,r,"se-image-container");s._captionChecked&&(s._caption=this.plugins.resizing.create_caption.call(this),s._caption.setAttribute("contenteditable",!1),r.appendChild(s._caption)),r.style.margin="none"!==l?"auto":"0",this.util.removeClass(c,s._floatClassRegExp),this.util.addClass(c,"__se__float-"+l),s._resizing&&/\d+/.test(n)||(this.context.resizing._resize_plugin="image",s._element=a,s._cover=r,s._container=c,this.plugins.image.setAutoSize.call(this)),this.insertComponent(c)},update_image:function(e,t){const i=this.context.image,n=i._linkValue;let l=i._element,o=i._cover,s=i._container,a=!1;const r=1*i.imageX.value!==l.offsetWidth||1*i.imageY.value!==l.offsetHeight;if(null===o&&(a=!0,l=i._element.cloneNode(!0),o=this.plugins.resizing.set_cover.call(this,l)),null===s&&(o=o.cloneNode(!0),a=!0,s=this.plugins.resizing.set_container.call(this,o,"se-image-container")),a&&(s.innerHTML="",s.appendChild(o)),l.alt=i._altText,i._resizing&&(l.setAttribute("data-proportion",i._proportionChecked),r&&this.plugins.image.setSize.call(this,i.imageX.value,i.imageY.value)),i._captionChecked?i._caption||(i._caption=this.plugins.resizing.create_caption.call(this),o.appendChild(i._caption)):i._caption&&(this.util.removeItem(i._caption),i._caption=null),i._align&&"none"!==i._align?o.style.margin="auto":o.style.margin="0",this.util.removeClass(s,this.context.image._floatClassRegExp),this.util.addClass(s,"__se__float-"+i._align),l.setAttribute("data-align",i._align),n.trim().length>0)if(null!==i._linkElement)i._linkElement.href=n,i._linkElement.target=i.imgLinkNewWindowCheck.checked?"_blank":"",l.setAttribute("data-image-link",n);else{let e=this.plugins.image.onRender_link.call(this,l,n,this.context.image.imgLinkNewWindowCheck.checked);o.insertBefore(e,i._caption)}else if(null!==i._linkElement){const e=l;e.setAttribute("data-image-link","");let t=e.cloneNode(!0);o.removeChild(i._linkElement),o.insertBefore(t,i._caption),l=t}if(a){const e=this.util.isRangeFormatElement(i._element.parentNode)||this.util.isWysiwygDiv(i._element.parentNode)?i._element:/^A$/i.test(i._element.parentNode.nodeName)?i._element.parentNode:this.util.getFormatElement(i._element)||i._element;e.parentNode.insertBefore(s,e),this.util.removeItem(e),l=s.querySelector("img")}if(!e&&(/\d+/.test(l.style.height)||i._resizing&&r||this.context.resizing._rotateVertical&&i._captionChecked)&&this.plugins.resizing.setTransformSize.call(this,l,null,null),e&&this.plugins.image.setImagesInfo.call(this,l,{name:l.getAttribute("data-file-name")||l.src.split("/").pop(),size:l.getAttribute("data-file-size")||0}),t){this.plugins.image.init.call(this);const e=this.plugins.resizing.call_controller_resize.call(this,l,"image");this.plugins.image.onModifyMode.call(this,l,e)}this.history.push()},update_src:function(e,t,i){t.src=e,this._w.setTimeout(this.plugins.image.setImagesInfo.bind(this,t,i))},sizeRevert:function(){const e=this.context.image;e._origin_w&&(e.imageX.value=e._element_w=e._origin_w,e.imageY.value=e._element_h=e._origin_h)},onModifyMode:function(e,t){const i=this.context.image;i._linkElement=/^A$/i.test(e.parentNode.nodeName)?e.parentNode:null,i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,".se-image-container"),i._caption=this.util.getChildElement(i._cover,"FIGCAPTION"),i._align=e.getAttribute("data-align")||"none",t&&(i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l);let n=i._element.getAttribute("data-origin");n?(n=n.split(","),i._origin_w=1*n[0],i._origin_h=1*n[1]):t&&(i._origin_w=t.w,i._origin_h=t.h,i._element.setAttribute("data-origin",t.w+","+t.h))},openModify:function(e){const t=this.context.image;t.imgUrlFile.value=t._element.src,t._altText=t.altText.value=t._element.alt,t._linkValue=t.imgLink.value=null===t._linkElement?"":t._linkElement.href,t.imgLinkNewWindowCheck.checked=t._linkElement&&"_blank"===t._linkElement.target,t.modal.querySelector('input[name="suneditor_image_radio"][value="'+t._align+'"]').checked=!0,t._align=t.modal.querySelector('input[name="suneditor_image_radio"]:checked').value,t._captionChecked=t.captionCheckEl.checked=!!t._caption,t._resizing&&(t.proportion.checked=t._proportionChecked="false"!==t._element.getAttribute("data-proportion"),t.imageX.value=t._element.offsetWidth,t.imageY.value=t._element.offsetHeight,t.imageX.disabled=!1,t.imageY.disabled=!1,t.proportion.disabled=!1),e||this.plugins.dialog.open.call(this,"image",!0)},on:function(e){if(!e){const e=this.context.image;e.imageX.value=e._origin_w=e._defaultAuto?"":this.context.option.imageWidth,e.imageY.value=e._origin_h=""}},setSize:function(e,t){const i=this.context.image;i._element.style.width=/^\d+$/.test(e)?e+"px":e,i._element.style.height=/^\d+$/.test(t)?t+"px":t},setAutoSize:function(){const e=this.context.image;this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this);const t=(e._element.getAttribute("data-origin")||"").split(",");e._element.style.maxWidth="100%",e._element.style.width=t[0]?t[0]+"px":"100%",e._element.style.height="",e._cover.style.width="",e._cover.style.height=""},setPercentSize:function(e){const t=this.context.image;t._element.style.maxWidth="100%",t._container.style.width=e,t._container.style.height="",t._cover.style.width="100%",t._cover.style.height="",t._element.style.width="100%",t._element.style.height="",/100/.test(e)&&(this.util.removeClass(t._container,this.context.image._floatClassRegExp),this.util.addClass(t._container,"__se__float-center"))},cancelPercentAttr:function(){const e=this.context.image;e._element.style.maxWidth="none",e._cover.style.width="",e._cover.style.height="",e._container.style.width="",e._container.style.height="",this.util.removeClass(e._container,this.context.image._floatClassRegExp),this.util.addClass(e._container,"__se__float-"+e._align)},resetAlign:function(){const e=this.context.image;e._element.setAttribute("data-align",""),e._align="none",e._cover.style.margin="0",this.util.removeClass(e._container,e._floatClassRegExp)},destroy:function(e){const t=e||this.context.image._element,i=this.util.getParentElement(t,".se-image-container")||t,n=1*t.getAttribute("data-index");if(this.util.removeItem(i),this.plugins.image.init.call(this),this.controllersOff(),this.history.push(),n>=0){const e=this._variable._imagesInfo;for(let t=0,i=e.length;t '+t.dialogBox.videoBox.title+'
    ';return e.videoResizing&&(n+='
    '),n+='
    ",i.innerHTML=n,i},setInputSize:function(e){this.context.video.proportion.checked&&("x"===e?this.context.video.videoHeight.value=Math.round(this.context.video._element_h/this.context.video._element_w*this.context.video.videoWidth.value):this.context.video.videoWidth.value=Math.round(this.context.video._element_w/this.context.video._element_h*this.context.video.videoHeight.value))},submitAction:function(){if(0===this.context.video.focusElement.value.trim().length)return!1;const e=this.context.video,t=/^\d+$/.test(e.videoWidth.value)?e.videoWidth.value:this.context.option.videoWidth,i=/^\d+$/.test(e.videoHeight.value)?e.videoHeight.value:this.context.option.videoHeight;let n=null,l=null,o=null,s=e.focusElement.value.trim();if(e._align=e.modal.querySelector('input[name="suneditor_video_radio"]:checked').value,/^$/.test(s))n=(new this._w.DOMParser).parseFromString(s,"text/html").querySelector("iframe");else{if(n=this.util.createElement("IFRAME"),/youtu\.?be/.test(s)&&(s=s.replace("watch?v=",""),/^\/\/.+\/embed\//.test(s)||(s=s.replace(s.match(/\/\/.+\//)[0],"//www.youtube.com/embed/")),e._youtubeQuery.length>0))if(/\?/.test(s)){const t=s.split("?");s=t[0]+"?"+e._youtubeQuery+"&"+t[1]}else s+="?"+e._youtubeQuery;n.src=s}this.context.dialog.updateModal?(e._element.src=n.src,o=e._container,l=this.util.getParentElement(e._element,"FIGURE"),n=e._element):(n.frameBorder="0",n.allowFullscreen=!0,n.onload=function(){this.setAttribute("origin-size",this.offsetWidth+","+this.offsetHeight),this.setAttribute("data-origin",this.offsetWidth+","+this.offsetHeight),this.style.height=this.offsetHeight+"px"}.bind(n),e._element=n,l=this.plugins.resizing.set_cover.call(this,n),o=this.plugins.resizing.set_container.call(this,l,"se-video-container"),this._variable._videosCnt++),e._cover=l,e._container=o;const a=1*t!==n.offsetWidth||1*i!==n.offsetHeight;e._resizing&&(this.context.video._proportionChecked=e.proportion.checked,n.setAttribute("data-proportion",e._proportionChecked)),e._captionChecked?e._caption||(e._caption=this.plugins.resizing.create_caption.call(this),l.appendChild(e._caption)):e._caption&&(this.util.removeItem(e._caption),e._caption=null),a&&this.plugins.video.setSize.call(this,t,i),e._align&&"none"!==e._align?l.style.margin="auto":l.style.margin="0",this.util.removeClass(o,this.context.video._floatClassRegExp),this.util.addClass(o,"__se__float-"+e._align),n.setAttribute("data-align",e._align),this.context.dialog.updateModal?(/\d+/.test(l.style.height)||e._resizing&&a||this.context.resizing._rotateVertical&&e._captionChecked)&&this.plugins.resizing.setTransformSize.call(this,n,null,null):this.insertComponent(o),this.history.push()},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation(),this.context.video._captionChecked=this.context.video.captionCheckEl.checked;try{this.plugins.video.submitAction.call(this)}finally{this.plugins.dialog.close.call(this),this.closeLoading()}return this.focus(),!1},_update_videoCover:function(e){const t=this.context.video;e.frameBorder="0",e.allowFullscreen=!0,e.onload=function(){this.setAttribute("origin-size",this.offsetWidth+","+this.offsetHeight),this.setAttribute("data-origin",this.offsetWidth+","+this.offsetHeight),this.style.height=this.offsetHeight+"px"}.bind(e);const i=this.util.getParentElement(e,this.util.isComponent)||this.util.getParentElement(e,function(e){return this.isWysiwygDiv(e.parentNode)}.bind(this.util));t._element=e=e.cloneNode(!1);const n=this.plugins.resizing.set_cover.call(this,e),l=this.plugins.resizing.set_container.call(this,n,"se-video-container"),o=i.getElementsByTagName("FIGCAPTION")[0];if(o){const e=this.plugins.resizing.create_caption.call(this);e.innerHTML=o.innerHTML,n.appendChild(e)}const s=(e.getAttribute("origin-size")||"").split(","),a=s[0]||this.context.option.videoWidth,r=s[1]||this.context.option.videoHeight;this.plugins.video.setSize.call(this,a,r),i.parentNode.insertBefore(l,i),this.util.removeItem(i)},sizeRevert:function(){const e=this.context.video;e._origin_w&&(e.videoWidth.value=e._element_w=e._origin_w,e.videoHeight.value=e._element_h=e._origin_h)},onModifyMode:function(e,t){const i=this.context.video;i._element=e,i._cover=this.util.getParentElement(e,"FIGURE"),i._container=this.util.getParentElement(e,".se-video-container"),i._caption=this.util.getChildElement(i._cover,"FIGCAPTION"),i._align=e.getAttribute("data-align")||"none",i._element_w=t.w,i._element_h=t.h,i._element_t=t.t,i._element_l=t.l;let n=i._element.getAttribute("data-origin");n?(n=n.split(","),i._origin_w=1*n[0],i._origin_h=1*n[1]):(i._origin_w=t.w,i._origin_h=t.h,i._element.setAttribute("data-origin",t.w+","+t.h))},openModify:function(e){const t=this.context.video;t.focusElement.value=t._element.src,t.videoWidth.value=t._element.offsetWidth,t.videoHeight.value=t._element.offsetHeight,t._captionChecked=t.captionCheckEl.checked=!!t._caption,t.modal.querySelector('input[name="suneditor_video_radio"][value="'+t._align+'"]').checked=!0,t._resizing&&(t.proportion.checked=t._proportionChecked="false"!==t._element.getAttribute("data-proportion"),t.proportion.disabled=!1),e||this.plugins.dialog.open.call(this,"video",!0)},checkVideosInfo:function(){const e=this.context.element.wysiwyg.getElementsByTagName("IFRAME");if(e.length===this._variable._videosCnt)return;const t=this.plugins.video;this._variable._videosCnt=e.length;for(let i,n=0,l=this._variable._videosCnt;n^<]+)?\s*(?=>)/gi,function(e,i,n){return i+("string"==typeof t[n]?t[n]:n)})},zeroWidthSpace:"​",onlyZeroWidthSpace:function(e){return"string"!=typeof e&&(e=e.textContent),""===e||this._onlyZeroWidthRegExp.test(e)},getXMLHttpRequest:function(){if(!this._w.ActiveXObject)return this._w.XMLHttpRequest?new XMLHttpRequest:null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){return null}}},createElement:function(e){return this._d.createElement(e)},createTextNode:function(e){return this._d.createTextNode(e||"")},getIncludePath:function(e,t){let i="";const n=[],l="js"===t?"script":"link",o="js"===t?"src":"href";let s="(?:";for(let t=0,i=e.length;t0?n[0][o]:""),-1===i.indexOf(":/")&&"//"!==i.slice(0,2)&&(i=0===i.indexOf("/")?location.href.match(/^.*?:\/\/[^\/]*/)[0]+i:location.href.match(/^[^\?]*\/(?:)/)[0]+i),!i)throw"[SUNEDITOR.util.getIncludePath.fail] The SUNEDITOR installation path could not be automatically detected. (name: +"+name+", extension: "+t+")";return i},getPageStyle:function(){let e="";const t=this._d.styleSheets;for(let i,n=0,l=t.length;n0&&(n+="

    "+t+"

    ")}else n+=i;const l={"&":"&"," ":" ","'":""","<":"&lt;",">":"&gt;"};return e=e.replace(/&|\u00A0|'|<|>/g,function(e){return"string"==typeof l[e]?l[e]:e}),0===n.length&&(n="

    "+(e.length>0?e:"
    ")+"

    "),this._tagConvertor(n.replace(this._deleteExclusionTags,""))},convertHTMLForCodeView:function(e){let t="";const i=this._w.RegExp;return function e(n){const l=n.childNodes;for(let n,o=0,s=l.length;o]*>","i"))[0]+"\n",e(n),t+="\n"}else t+=3===n.nodeType?/^\n+$/.test(n.data)?"":n.data:n.outerHTML+"\n"}(e),t},isWysiwygDiv:function(e){return!(!e||1!==e.nodeType||!this.hasClass(e,"se-wrapper-wysiwyg")&&!/^BODY$/i.test(e.nodeName))},isFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(P|DIV|H[1-6]|LI|TH|TD)$/i.test(e.nodeName)||this.isComponent(e)||this.isWysiwygDiv(e))},isRangeFormatElement:function(e){return!(!e||1!==e.nodeType||!/^(BLOCKQUOTE|OL|UL|PRE|FIGCAPTION|TABLE|THEAD|TBODY|TR|TH|TD)$/i.test(e.nodeName)&&"range"!==e.getAttribute("data-format"))},isComponent:function(e){return e&&(/se-component/.test(e.className)||/^(TABLE|HR)$/.test(e.nodeName))},getFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&e.firstElementChild,this.isFormatElement(e)&&t(e))return e;e=e.parentNode}return null},getRangeFormatElement:function(e,t){if(!e)return null;for(t||(t=function(){return!0});e;){if(this.isWysiwygDiv(e))return null;if(this.isRangeFormatElement(e)&&!/^(THEAD|TBODY|TR)$/i.test(e.nodeName)&&t(e))return e;e=e.parentNode}return null},getArrayIndex:function(e,t){let i=-1;for(let n=0,l=e.length;n0&&!this.isBreak(e);)e=e.firstChild;for(;t&&1===t.nodeType&&t.childNodes.length>0&&!this.isBreak(t);)t=t.lastChild;return{sc:e,ec:t||e}}},getOffset:function(e,t){let i=0,n=0,l=3===e.nodeType?e.parentElement:e;const o=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;l&&!this.hasClass(l,"se-container")&&l!==o;)i+=l.offsetLeft,n+=l.offsetTop,l=l.offsetParent;const s=t&&/iframe/i.test(t.nodeName);return{left:i+(s?t.parentElement.offsetLeft:0),top:n-o.scrollTop+(s?t.parentElement.offsetTop:0)}},getOverlapRangeAtIndex:function(e,t,i,n){if(e<=n?ti)return 0;const l=(e>i?e:i)-(t")},isIgnoreNodeChange:function(e){return 3!==e.nodeType&&!/^(span|font|b|strong|var|i|em|u|ins|s|strike|del|sub|sup|mark)$/i.test(e.nodeName)},cleanHTML:function(e){const t=new this._w.RegExp("^(meta|script|link|style|[a-z]+:[a-z]+)$","i"),i=this._d.createRange().createContextualFragment(e).childNodes;let n="";for(let e=0,l=i.length;e(\n|.)*<\/([a-zA-Z]+\:[a-zA-Z]+|script|style)>/g,"").replace(/(<[a-zA-Z0-9]+)[^>]*(?=>)/g,function(e,t){const i=e.match(/((?:colspan|rowspan|target|href|src|class|data-file-size|data-file-name|data-origin|origin-size|data-format)\s*=\s*"[^"]*")/gi);if(i)for(let e=0,n=i.length;e^<]*)>/g,"").replace(this._deleteExclusionTags,""),this._tagConvertor(n||e)},_deleteExclusionTags:function(){const e="br|p|div|pre|blockquote|h[1-6]|ol|ul|dl|li|hr|figure|figcaption|img|iframe|audio|video|table|thead|tbody|tr|th|td|a|b|strong|var|i|em|u|ins|s|span|strike|del|sub|sup|mark".split("|");let t="<\\/?(";for(let i=0,n=e.length;i';return n}()+("auto"===e.height?"":"");o.allowFullscreen=!0,o.frameBorder=0,o.addEventListener("load",function(){this.setAttribute("scrolling","auto"),this.contentDocument.head.innerHTML=''+t,this.contentDocument.body.className="sun-editor-editable",this.contentDocument.body.setAttribute("contenteditable",!0),this.contentDocument.body.innerHTML=l})}else o.setAttribute("contenteditable",!0),o.setAttribute("scrolling","auto"),o.className+=" sun-editor-editable",o.innerHTML=l;o.style.height=e.height,o.style.minHeight=e.minHeight,o.style.maxHeight=e.maxHeight;const s=document.createElement("TEXTAREA");s.className="se-wrapper-inner se-wrapper-code",s.style.display="none",s.style.height=e.height,s.style.minHeight=e.minHeight,s.style.maxHeight=e.maxHeight,"auto"===e.height&&(s.style.overflow="hidden");let a=null,r=null,c=null;if(e.resizingBar&&((a=document.createElement("DIV")).className="se-resizing-bar sun-editor-common",(r=document.createElement("DIV")).className="se-navigation sun-editor-common",a.appendChild(r),e.charCounter)){const t=document.createElement("DIV");if(t.className="se-char-counter-wrapper",(c=document.createElement("SPAN")).className="se-char-counter",c.textContent="0",t.appendChild(c),e.maxCharCount>0){const i=document.createElement("SPAN");i.textContent=" / "+e.maxCharCount,t.appendChild(i)}a.appendChild(t)}let d=null;return e.placeholder&&((d=document.createElement("SPAN")).className="se-placeholder",d.innerText=e.placeholder),{bottomBar:{resizingBar:a,navigation:r,charCounter:c},wysiwygFrame:o,codeView:s,placeholder:d}},_initOptions:function(e,t){t.lang=t.lang||c.a,t.mode=t.mode||"classic",t.toolbarWidth=t.toolbarWidth?/^\d+$/.test(t.toolbarWidth)?t.toolbarWidth+"px":t.toolbarWidth:"auto",t.stickyToolbar=/balloon/i.test(t.mode)?-1:void 0===t.stickyToolbar?0:/^\d+/.test(t.stickyToolbar)?1*t.stickyToolbar.toString().match(/\d+/)[0]:-1,t.iframe=t.fullPage||t.iframe,t.codeMirror=t.codeMirror?t.codeMirror.src?t.codeMirror:{src:t.codeMirror}:null,t.display=t.display||("none"!==e.style.display&&e.style.display?e.style.display:"block"),t.popupDisplay=t.popupDisplay||"full",t.resizingBar=void 0===t.resizingBar?!/inline|balloon/i.test(t.mode):t.resizingBar,t.showPathLabel=!!t.resizingBar&&("boolean"!=typeof t.showPathLabel||t.showPathLabel),t.charCounter=t.maxCharCount>0||"boolean"==typeof t.charCounter&&t.charCounter,t.maxCharCount=/^\d+$/.test(t.maxCharCount)&&t.maxCharCount>-1?1*t.maxCharCount:null,t.width=t.width?/^\d+$/.test(t.width)?t.width+"px":t.width:e.clientWidth?e.clientWidth+"px":"100%",t.minWidth=(/^\d+$/.test(t.minWidth)?t.minWidth+"px":t.minWidth)||"",t.maxWidth=(/^\d+$/.test(t.maxWidth)?t.maxWidth+"px":t.maxWidth)||"",t.height=t.height?/^\d+$/.test(t.height)?t.height+"px":t.height:e.clientHeight?e.clientHeight+"px":"auto",t.minHeight=(/^\d+$/.test(t.minHeight)?t.minHeight+"px":t.minHeight)||"",t.maxHeight=(/^\d+$/.test(t.maxHeight)?t.maxHeight+"px":t.maxHeight)||"",t.fontSizeUnit="string"==typeof t.fontSizeUnit&&t.fontSizeUnit.trim()||"px",t.imageResizing=void 0===t.imageResizing||t.imageResizing,t.imageWidth=t.imageWidth&&/\d+/.test(t.imageWidth)?t.imageWidth.toString().match(/\d+/)[0]:"auto",t.imageFileInput=void 0===t.imageFileInput||t.imageFileInput,t.imageUrlInput=void 0===t.imageUrlInput||!t.imageFileInput||t.imageUrlInput,t.imageUploadHeader=t.imageUploadHeader||null,t.imageUploadUrl=t.imageUploadUrl||null,t.imageUploadSizeLimit=/\d+/.test(t.imageUploadSizeLimit)?1*t.imageUploadSizeLimit.toString().match(/\d+/)[0]:null,t.videoResizing=void 0===t.videoResizing||t.videoResizing,t.videoWidth=t.videoWidth&&/\d+/.test(t.videoWidth)?t.videoWidth.toString().match(/\d+/)[0]:560,t.videoHeight=t.videoHeight&&/\d+/.test(t.videoHeight)?t.videoHeight.toString().match(/\d+/)[0]:315,t.youtubeQuery=(t.youtubeQuery||"").replace("?",""),t.placeholder="string"==typeof t.placeholder?t.placeholder:null,t.buttonList=t.buttonList||[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]]},_defaultButtons:function(e){return{bold:["_se_command_bold",e.toolbar.bold+" (CTRL+B)","STRONG","",''],underline:["_se_command_underline",e.toolbar.underline+" (CTRL+U)","INS","",''],italic:["_se_command_italic",e.toolbar.italic+" (CTRL+I)","EM","",''],strike:["_se_command_strike",e.toolbar.strike+" (CTRL+SHIFT+S)","DEL","",''],subscript:["_se_command_subscript",e.toolbar.subscript,"SUB","",''],superscript:["_se_command_superscript",e.toolbar.superscript,"SUP","",''],removeFormat:["",e.toolbar.removeFormat,"removeFormat","",''],indent:["",e.toolbar.indent+" (CTRL+])","indent","",''],outdent:["_se_command_outdent",e.toolbar.outdent+" (CTRL+[)","outdent","",''],fullScreen:["code-view-enabled",e.toolbar.fullScreen,"fullScreen","",''],showBlocks:["",e.toolbar.showBlocks,"showBlocks","",''],codeView:["code-view-enabled",e.toolbar.codeView,"codeView","",''],undo:["_se_command_undo",e.toolbar.undo+" (CTRL+Z)","undo","",'',!0],redo:["_se_command_redo",e.toolbar.redo+" (CTRL+Y / CTRL+SHIFT+Z)","redo","",'',!0],preview:["",e.toolbar.preview,"preview","",''],print:["",e.toolbar.print,"print","",''],save:["_se_command_save",e.toolbar.save,"save","",'',!0],font:["se-btn-select se-btn-tool-font _se_command_font_family",e.toolbar.font,"font","submenu",''+e.toolbar.font+''],formatBlock:["se-btn-select se-btn-tool-format",e.toolbar.formats,"formatBlock","submenu",''+e.toolbar.formats+''],fontSize:["se-btn-select se-btn-tool-size",e.toolbar.fontSize,"fontSize","submenu",''+e.toolbar.fontSize+''],fontColor:["",e.toolbar.fontColor,"fontColor","submenu",''],hiliteColor:["",e.toolbar.hiliteColor,"hiliteColor","submenu",''],align:["se-btn-align",e.toolbar.align,"align","submenu",''],list:["_se_command_list",e.toolbar.list,"list","submenu",''],horizontalRule:["btn_line",e.toolbar.horizontalRule,"horizontalRule","submenu",''],table:["",e.toolbar.table,"table","submenu",''],lineHeight:["",e.toolbar.lineHeight,"lineHeight","submenu",''],template:["",e.toolbar.template,"template","submenu",''],link:["",e.toolbar.link,"link","dialog",''],image:["",e.toolbar.image,"image","dialog",''],video:["",e.toolbar.video,"video","dialog",'']}},_createModuleGroup:function(e){const t=u.createElement("DIV");t.className="se-btn-module"+(e?"":" se-btn-module-border");const i=u.createElement("UL");return i.className="se-menu-list",t.appendChild(i),{div:t,ul:i}},_createButton:function(e,t,i,n,l,o){const s=u.createElement("LI"),a=u.createElement("BUTTON");return a.setAttribute("type","button"),a.setAttribute("class","se-btn"+(e?" "+e:"")+" se-tooltip"),a.setAttribute("data-command",i),a.setAttribute("data-display",n),l+=''+t+"",o&&a.setAttribute("disabled",!0),a.innerHTML=l,s.appendChild(a),{li:s,button:a}},_createToolBar:function(e,t,i,n){const l=e.createElement("DIV");l.className="se-toolbar-separator-vertical";const o=e.createElement("DIV");o.className="se-toolbar sun-editor-common";const s=this._defaultButtons(n),a={},r={};if(i){const e=i.length?i:Object.keys(i).map(function(e){return i[e]});for(let t=0,i=e.length;tr&&(c=c.slice(0,r),s&&s.setAttribute("disabled",!0)),c[r]={contents:i,s:{path:l.getNodePath(n.startContainer),offset:n.startOffset},e:{path:l.getNodePath(n.endContainer),offset:n.endOffset}},1===r&&o&&o.removeAttribute("disabled"),e._checkComponents(),e._charCount(0,!1),t()}()},500)},undo:function(){r>0&&(r--,d())},redo:function(){c.length-1>r&&(r++,d())},reset:function(){c=c[r=0]}}},m={init:function(e){return{create:function(t,i){return this.create(t,i,e)}.bind(this)}},create:function(e,t,i){"object"!=typeof t&&(t={}),i&&(t=[i,t].reduce(function(e,t){return Object.keys(t).forEach(function(i){if("plugins"===i&&t[i]&&e[i]){let n=e[i],l=t[i];n=n.length?n:Object.keys(n).map(function(e){return n[e]}),l=l.length?l:Object.keys(l).map(function(e){return l[e]}),e[i]=l.filter(function(e){return-1===n.indexOf(e)}).concat(n)}else e[i]=t[i]}),e},{}));const n="string"==typeof e?document.getElementById(e):e;if(!n){if("string"==typeof e)throw Error('[SUNEDITOR.create.fail] The element for that id was not found (ID:"'+e+'")');throw Error("[SUNEDITOR.create.fail] suneditor requires textarea's element or id value")}const l=h.init(n,t);if(l.constructed._top.id&&document.getElementById(l.constructed._top.id))throw Error('[SUNEDITOR.create.fail] The ID of the suneditor you are trying to create already exists (ID:"'+l.constructed._top.id+'")');return n.style.display="none",l.constructed._top.style.display="block","object"==typeof n.nextElementSibling?n.parentNode.insertBefore(l.constructed._top,n.nextElementSibling):n.parentNode.appendChild(l.constructed._top),function(e,t,i,n,l){const o=e.element.originElement.ownerDocument||document,a=o.defaultView||window,r=u,c={_d:o,_w:a,context:e,pluginCallButtons:t,plugins:i||{},util:r,initPlugins:{},lang:n,submenu:null,_resizingName:"",_submenuName:"",_bindedSubmenuOff:null,submenuActiveButton:null,controllerArray:[],codeViewDisabledButtons:null,history:null,_bindControllersOff:null,_isInline:null,_isBalloon:null,_inlineToolbarAttr:{width:0,height:0,isShow:!1},_notHideToolbar:!1,_sticky:!1,_imageUpload:function(e,t,i,n,l){"function"==typeof m.onImageUpload&&m.onImageUpload(e,1*t,i,n,l)},_imageUploadError:function(e,t){return"function"!=typeof m.onImageUploadError||m.onImageUploadError(e,t)},commandMap:null,_variable:{wysiwygActive:!0,isFullScreen:!1,innerHeight_fullScreen:0,resizeClientY:0,tabSize:4,minResizingSize:65,currentNodes:[],_range:null,_selectionNode:null,_originCssText:e.element.topArea.style.cssText,_bodyOverflow:"",_editorAreaOriginCssText:"",_wysiwygOriginCssText:"",_codeOriginCssText:"",_fullScreenSticky:!1,_imagesInfo:[],_imageIndex:0,_videosCnt:0},callPlugin:function(e,i){if(!this.plugins[e])throw Error('[SUNEDITOR.core.callPlugin.fail] The called plugin does not exist or is in an invalid format. (pluginName:"'+e+'")');this.initPlugins[e]||(this.plugins[e].add(this,t[e]),this.initPlugins[e]=!0),"function"==typeof i&&i()},addModule:function(e){for(let t,i=0,n=e.length;i0){for(let t=0;t":i),this.history.push()},focus:function(){if("none"===e.element.wysiwygFrame.style.display)return;const t=r.getParentElement(this.getSelectionNode(),"figcaption");t?t.focus():e.element.wysiwyg.focus(),this._editorRange(),d._findButtonEffectTag()},setRange:function(e,t,i,n){if(!e||!i)return;t>e.textContent.length&&(t=e.textContent.length),n>i.textContent.length&&(n=i.textContent.length);const l=this._wd.createRange();l.setStart(e,t),l.setEnd(i,n);const o=this.getSelection();o.removeAllRanges&&o.removeAllRanges(),o.addRange(l),this._editorRange()},getRange:function(){return this._variable._range||this._createDefaultRange()},getSelection:function(){return this._ww.getSelection()},getSelectionNode:function(){return this._variable._selectionNode&&!r.isWysiwygDiv(this._variable._selectionNode)||this._editorRange(),this._variable._selectionNode||e.element.wysiwyg.firstChild},_editorRange:function(){const e=this.getSelection();let t=null,i=null;t=e.rangeCount>0?e.getRangeAt(0):this._createDefaultRange(),this._variable._range=t,i=t.collapsed?t.commonAncestorContainer:e.extentNode||e.anchorNode,this._variable._selectionNode=i},_createDefaultRange:function(){const t=this._wd.createRange();return e.element.wysiwyg.firstChild||this.execCommand("formatBlock",!1,"P"),t.setStart(e.element.wysiwyg.firstChild,0),t.setEnd(e.element.wysiwyg.firstChild,0),t},getSelectedElements:function(t){let i=this.getRange();if(r.isWysiwygDiv(i.startContainer)){const t=e.element.wysiwyg.children;if(0===t.length)return null;this.setRange(t[0],0,t[t.length-1],t[t.length-1].textContent.trim().length),i=this.getRange()}const n=i.startContainer,l=i.endContainer,o=i.commonAncestorContainer,s=r.getListChildren(o,function(e){return t?t(e):r.isFormatElement(e)});if(r.isWysiwygDiv(o)||r.isRangeFormatElement(o)||s.unshift(r.getFormatElement(o)),n===l||1===s.length)return s;let a=r.getFormatElement(n),c=r.getFormatElement(l),d=null,u=null;const h=function(e){return!r.isTable(e)||/^TABLE$/i.test(e.nodeName)},g=r.getRangeFormatElement(a,h),p=r.getRangeFormatElement(c,h),m=g===p;for(let e,t=0,i=s.length;t=0;e--)c[e]===n.parentNode&&c[e].firstChild===n&&0===i&&(d=e,n=n.parentNode);for(let e=u-1,t=n;e>d;e--)c[e]===t.parentNode&&1===c[e].nodeType&&(c.splice(e,1),t=t.parentNode,--u);for(let e=d;e<=u;e++){const o=c[e];0===o.length||3===o.nodeType&&void 0===o.data?r.removeItem(o):o!==t?o!==n?(r.removeItem(o),this.history.push()):(a=1===n.nodeType?r.createTextNode(n.textContent):r.createTextNode(n.substringData(l,n.length-l))).length>0?n.data=a.data:r.removeItem(n):(s=1===t.nodeType?r.createTextNode(t.textContent):r.createTextNode(t.substringData(0,i))).length>0?t.data=s.data:r.removeItem(t)}},applyRangeFormatElement:function(e){const t=this.getSelectedElementsAndComponents();if(!t||0===t.length)return;let i,n,l,o=t[t.length-1];i=r.isRangeFormatElement(o)||r.isFormatElement(o)?o:r.getRangeFormatElement(o)||r.getFormatElement(o),r.isCell(i)?(n=null,l=i):(n=i.nextSibling,l=i.parentNode);let s=r.getElementDepth(i),a=null;const c=[],d=function(e,t,i){let n=null;return e===t||r.isTable(t)||(n=r.removeItemAllParents(t)),n?n.ec:i};for(let i,o,u,h,g=0,p=t.length;g=u?(s=u,(n=d(l=t.cc,o,t.ec))&&(l=n.parentNode)):l===t.cc&&(n=t.ec),l!==t.cc&&void 0!==(h=d(l,t.cc))&&(n=h),e.appendChild(a),a=null}}else s>=u&&(s=u,l=o,n=i.nextSibling),e.appendChild(i),l!==o&&void 0!==(h=d(l,o))&&(n=h);l.insertBefore(e,n),d(e,n),this.history.push();const u=this.util.getEdgeChildNodes(e.firstElementChild,e.lastElementChild);t.length>1?this.setRange(u.sc,0,u.ec,u.ec.textContent.length):this.setRange(u.ec,u.ec.textContent.length,u.ec,u.ec.textContent.length)},detachRangeFormatElement:function(e,t,i,n,l){const o=this.getRange(),s=o.startOffset,a=o.endOffset,c=e.childNodes,u=e.parentNode;let h=null,g=null,p=e.cloneNode(!1);const m=r.isList(i);let f=!1;function _(e,t,i){if(r.onlyZeroWidthSpace(t)&&(t.innerHTML=r.zeroWidthSpace),3===t.nodeType)return e.insertBefore(t,i),t;const n=t.childNodes;let l=t.cloneNode(!1),o=null,s=null;for(;n[0];)s=n[0],r.isIgnoreNodeChange(s)&&!r.isListCell(l)?(l.childNodes.length>0&&(o||(o=l),e.insertBefore(l,i),l=t.cloneNode(!1)),e.insertBefore(s,i),o||(o=s)):l.appendChild(s);return l.childNodes.length>0&&(e.insertBefore(l,i),o||(o=l)),o}for(let l,o=0,s=c.length;o0&&(u.insertBefore(p,e),p=null),!m&&r.isListCell(l)){const t=l.innerHTML;(l=r.isCell(e.parentNode)?r.createElement("DIV"):r.createElement("P")).innerHTML=t}else l=l.cloneNode(!0);n||(i?(f||(u.insertBefore(i,e),f=!0),l=_(i,l,null)):l=_(u,l,e),t?(g=l,h||(h=l)):h||(h=g=l))}const b=e.parentNode,y=e.nextSibling;p&&p.children.length>0&&b.insertBefore(p,y),r.removeItem(e);const v=n?{cc:b,sc:h,ec:h&&h.parentNode?h.nextSibling:p&&p.children.length>0?p:y||null}:this.util.getEdgeChildNodes(h,g);if(l)return v;this.history.push(),!n&&v&&(t?this.setRange(v.sc,s,v.ec,a):this.setRange(v.sc,0,v.sc,0)),d._findButtonEffectTag()},nodeChange:function(t,i,n){const l=this.getRange();i=!!(i&&i.length>0)&&i,n=!!(n&&n.length>0)&&n;const o=!t,s=o&&!n&&!i;let c,d,u,h=l.startContainer,g=l.startOffset,p=l.endContainer,m=l.endOffset;if(s&&l.collapsed&&r.isFormatElement(h.parentNode)&&r.isFormatElement(p.parentNode))return;if(o&&(t=this.util.createElement("DIV")),!s&&h===p){let e=h;if(s){if(r.getFormatElement(e)===e.parentNode)return}else if(i.length>0){let n=0;for(let l=0;l=i.length)return;if(o&&0===n)return}}if(c=r.isWysiwygDiv(h)?e.element.wysiwyg.firstChild:h,d=g,r.isBreak(c)||1===c.nodeType&&c.childNodes.length>0){const e=r.isBreak(c);if(!e){for(;c&&!r.isBreak(c)&&1===c.nodeType;)c=c.childNodes[d]||c.nextElementSibling||c.nextSibling,d=0;let e=r.getFormatElement(c);e===r.getRangeFormatElement(e)&&(e=r.createElement(r.isCell(c)?"DIV":"P"),c.parentNode.insertBefore(e,c),e.appendChild(c))}if(r.isBreak(c)){const t=r.createTextNode(r.zeroWidthSpace);c.parentNode.insertBefore(t,c),c=t,e&&(h===p&&(p=c,m=1),r.removeItem(h))}}if(h=c,g=d,c=r.isWysiwygDiv(p)?e.element.wysiwyg.lastChild:p,d=m,r.isBreak(c)||1===c.nodeType&&c.childNodes.length>0){const e=r.isBreak(c);if(!e){for(;c&&!r.isBreak(c)&&1===c.nodeType;)c=(u=c.childNodes)[d>0?d-1:d]||!/FIGURE/i.test(u[0].nodeName)?u[0]:c.previousElementSibling||c.previousSibling||h,d=d>0?c.textContent.length:d;let e=r.getFormatElement(c);e===r.getRangeFormatElement(e)&&(e=r.createElement(r.isCell(e)?"DIV":"P"),c.parentNode.insertBefore(e,c),e.appendChild(c))}if(r.isBreak(c)){const t=r.createTextNode(r.zeroWidthSpace);c.parentNode.insertBefore(t,c),c=t,d=0,e&&r.removeItem(p)}}p=c,m=d;const f=t.nodeName;this.setRange(h,g,p,m);let _,b,y,v={},C={};if(i){b="(?:;|^|\\s)(?:"+i[0];for(let e=1;e0&&(i=t.replace(b,"").trim()),o){if(b&&y&&!i&&y.test(e.nodeName))return!1;if(b&&!i&&t)return!1;if(y&&y.test(e.nodeName))return!1}return!(!i&&e.nodeName===f||(b&&t.length>0&&(e.style.cssText=i),0))},w=this.getSelectedElements();r.getFormatElement(h)||(h=r.getChildElement(w[0],function(e){return 3===e.nodeType}),g=0),r.getFormatElement(p)||(m=(p=r.getChildElement(w[w.length-1],function(e){return 3===e.nodeType})).textContent.length);const E=r.getFormatElement(h)===r.getFormatElement(p),k=w.length-(E?0:1);if(_=t.cloneNode(!1),E){const e=this._nodeChange_oneLine(w[0],_,x,h,g,p,m,s,o,l.collapsed);v.container=e.startContainer,v.offset=e.startOffset,C.container=e.endContainer,C.offset=e.endOffset}else v=this._nodeChange_startLine(w[0],_,x,h,g,s,o);for(let e=1;e0&&!E?(_=t.cloneNode(!1),C=this._nodeChange_endLine(w[k],_,x,p,m,s,o)):E||(C=v),this.setRange(v.container,v.offset,C.container,C.offset),this.history.push()},_stripRemoveNode:function(e,t){if(!t||3===t.nodeType)return;const i=t.childNodes;for(;i[0];)e.insertBefore(i[0],t);e.removeChild(t)},_nodeChange_oneLine:function(e,t,i,n,l,o,s,c,d,u){const h=e,g=t,p=[t],m=e.cloneNode(!1),f=n===o;let _,b,y,v,C=n,x=l,w=o,E=s,k=!1,S=!1;function T(e){const t=new a.RegExp("(?:;|^|\\s)(?:"+v+"null)\\s*:[^;]*\\s*(?:;|$)","ig");let i="";return t&&e.style.cssText.length>0&&(i=t.test(e.style.cssText)),!i}if(function e(n,l){const o=n.childNodes;for(let n=0,s=o.length;n=x?E-x:C.data.length-x));for(e.data.length>0&&l.appendChild(e),b=s,_=[],v="";b!==m&&b!==h&&null!==b;)i(b)&&1===b.nodeType&&T(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;const o=_.pop()||n;for(y=b=o;_.length>0;)b=_.pop(),y.appendChild(b),y=b;if(t.appendChild(o),m.appendChild(t),C=n,x=0,k=!0,b!==n&&b.appendChild(C),!f)continue}if(S||s!==w){if(k){if(1===s.nodeType&&!r.isBreak(s)){!u&&r.isIgnoreNodeChange(s)?(t=t.cloneNode(!1),m.appendChild(s),m.appendChild(t),p.push(t),n--):e(s,s);continue}for(b=s,_=[],v="";null!==b.parentNode&&b!==h&&b!==t;)1===b.nodeType&&!r.isBreak(s)&&(S||i(b))&&T(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;const o=_.pop()||s;for(y=b=o;_.length>0;)b=_.pop(),y.appendChild(b),y=b;o===s?l=S?m:t:S?(m.appendChild(o),l=b):(t.appendChild(o),l=b)}a=s.cloneNode(!1),l.appendChild(a),1!==s.nodeType||r.isBreak(s)||(d=a),e(s,d)}else{const e=r.createTextNode(1===w.nodeType?"":w.substringData(E,w.length-E)),n=r.createTextNode(f||1===w.nodeType?"":w.substringData(0,E));if(e.data.length>0){for(b=s,v="",_=[];b!==m&&b!==h&&null!==b;)1===b.nodeType&&T(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;for(a=y=b=_.pop()||e;_.length>0;)b=_.pop(),y.appendChild(b),y=b;m.appendChild(a),b.textContent=e.data}for(b=s,_=[],v="";b!==m&&b!==h&&null!==b;)i(b)&&1===b.nodeType&&T(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;const l=_.pop()||n;for(y=b=l;_.length>0;)b=_.pop(),y.appendChild(b),y=b;t.appendChild(l),w=n,E=n.data.length,S=!0,!c&&u&&(t=n,n.textContent=r.zeroWidthSpace),b!==n&&b.appendChild(w)}}}(e,m),c=c&&d)for(let e=0;e0){const e=u.pop();for(g=h=e;u.length>0;)h=u.pop(),g.appendChild(h),g=h;t.appendChild(e),l=h}else l=t}if(f||s!==p){if(!f||i(s)){const e=s.cloneNode(!1);l.appendChild(e),1!==s.nodeType||r.isBreak(s)||(_=e)}e(s,_)}else{const e=r.createTextNode(1===p.nodeType?"":p.substringData(0,m)),n=r.createTextNode(1===p.nodeType?"":p.substringData(m,p.length-m));for(e.data.length>0&&l.appendChild(e),h=l,u=[];h!==d&&null!==h;)1===h.nodeType&&i(h)&&u.push(h.cloneNode(!1)),h=h.parentNode;const o=u.pop()||l;for(g=h=o;u.length>0;)h=u.pop(),g.appendChild(h),g=h;o!==l?(t.appendChild(o),l=h):l=t,r.isBreak(s)&&t.appendChild(s.cloneNode(!1)),d.appendChild(t),p=n,m=0,f=!0,l.appendChild(p)}}}(e,d),o=o&&s)for(let e=0;e0){const e=u.pop();for(g=h=e;u.length>0;)h=u.pop(),g.appendChild(h),g=h;t.insertBefore(e,t.firstChild),l=h}else l=t}if(f||s!==p){if(!f||i(s)){const e=s.cloneNode(!1);l.insertBefore(e,l.firstChild),1!==s.nodeType||r.isBreak(s)||(_=e)}e(s,_)}else{const e=r.createTextNode(1===p.nodeType?"":p.substringData(m,p.length-m)),n=r.createTextNode(1===p.nodeType?"":p.substringData(0,m));for(e.data.length>0&&l.insertBefore(e,l.firstChild),h=l,u=[];h!==d&&null!==h;)i(h)&&1===h.nodeType&&u.push(h.cloneNode(!1)),h=h.parentNode;const o=u.pop()||l;for(g=h=o;u.length>0;)h=u.pop(),g.appendChild(h),g=h;o!==l?(t.insertBefore(o,t.firstChild),l=h):l=t,r.isBreak(s)&&t.appendChild(s.cloneNode(!1)),d.insertBefore(t,d.firstChild),p=n,m=n.data.length,f=!0,l.insertBefore(p,l.firstChild)}}}(e,d),o=o&&s)for(let e=0;e0?e.element.code.scrollHeight+"px":"auto"),e.option.codeMirrorEditor&&e.option.codeMirrorEditor.refresh(),this._variable.wysiwygActive=!1,e.element.code.focus()):(this._setCodeDataToEditor(),e.element.wysiwygFrame.scrollTop=0,e.element.code.style.display="none",e.element.wysiwygFrame.style.display="block",this._variable._codeOriginCssText=this._variable._codeOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: none"),this._variable._wysiwygOriginCssText=this._variable._wysiwygOriginCssText.replace(/(\s?display(\s+)?:(\s+)?)[a-zA-Z]+(?=;)/,"display: block"),"auto"!==e.option.height||e.option.codeMirrorEditor||(e.element.code.style.height="0px"),this._variable.wysiwygActive=!0,this.focus()),this._checkPlaceholder()},_setCodeDataToEditor:function(){const t=this._getCodeView();if(e.option.fullPage){const e=(new this._w.DOMParser).parseFromString(t,"text/html"),i=e.head.children;for(let t=0,n=i.length;t0?r.convertContentsForEditor(t):"


    "},_setEditorDataToCodeView:function(){let t="";if(e.option.fullPage){const i=this._wd.head.children;let n="";for(let e=0,t=i.length;e\n\n"+this._wd.head.outerHTML.match(/^]*>/)[0]+"\n"+n+"\n"+this._wd.body.outerHTML.match(/^]*>/)[0]+"\n"+r.convertHTMLForCodeView(e.element.wysiwyg)+"\n"}else t=r.convertHTMLForCodeView(e.element.wysiwyg);e.element.code.style.display="block",e.element.wysiwygFrame.style.display="none",this._setCodeView(t)},toggleFullScreen:function(t){const i=e.element.topArea,n=e.element.toolbar,l=e.element.editorArea,s=e.element.wysiwygFrame,c=e.element.code;this._variable.isFullScreen?(this._variable.isFullScreen=!1,s.style.cssText=this._variable._wysiwygOriginCssText,c.style.cssText=this._variable._codeOriginCssText,n.style.cssText="",l.style.cssText=this._variable._editorAreaOriginCssText,i.style.cssText=this._variable._originCssText,o.body.style.overflow=this._variable._bodyOverflow,e.option.stickyToolbar>-1&&r.removeClass(n,"se-toolbar-sticky"),this._variable._fullScreenSticky&&(this._variable._fullScreenSticky=!1,e.element._stickyDummy.style.display="block",r.addClass(n,"se-toolbar-sticky")),d.onScroll_window(),r.removeClass(t.firstElementChild,"se-icon-reduction"),r.addClass(t.firstElementChild,"se-icon-expansion")):(this._variable.isFullScreen=!0,i.style.position="fixed",i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%",i.style.zIndex="2147483647","none"!==e.element._stickyDummy.style.display&&(this._variable._fullScreenSticky=!0,e.element._stickyDummy.style.display="none",r.removeClass(n,"se-toolbar-sticky")),this._variable._bodyOverflow=o.body.style.overflow,o.body.style.overflow="hidden",this._variable._editorAreaOriginCssText=l.style.cssText,this._variable._wysiwygOriginCssText=s.style.cssText,this._variable._codeOriginCssText=c.style.cssText,l.style.cssText=n.style.cssText="",s.style.cssText=(s.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],c.style.cssText=(c.style.cssText.match(/\s?display(\s+)?:(\s+)?[a-zA-Z]+;/)||[""])[0],n.style.width=s.style.height=c.style.height="100%",n.style.position="relative",this._variable.innerHeight_fullScreen=a.innerHeight-n.offsetHeight,l.style.height=this._variable.innerHeight_fullScreen+"px",r.removeClass(t.firstElementChild,"se-icon-expansion"),r.addClass(t.firstElementChild,"se-icon-reduction"),e.option.iframe&&"auto"===e.option.height&&(l.style.overflow="auto",this._iframeAutoHeight()))},print:function(){const e=r.createElement("IFRAME");e.style.display="none";const t=r.createElement("DIV"),i=r.createElement("STYLE");i.innerHTML=r.getPageStyle(),t.className="sun-editor-editable",t.innerHTML=this.getContents(),o.body.appendChild(e);let n=e.contentWindow||e.contentDocument;n.document&&(n=n.document),n.head.appendChild(i),n.body.appendChild(t);try{if(e.focus(),-1!==a.navigator.userAgent.indexOf("MSIE")||o.documentMode||a.StyleMedia)try{e.contentWindow.document.execCommand("print",!1,null)}catch(t){e.contentWindow.print()}else e.contentWindow.print()}catch(e){throw Error("[SUNEDITOR.core.print.fail] error: "+e)}finally{r.removeItem(e)}},preview:function(){const t=r.getPageStyle(),i=this.getContents(),l=a.open("","_blank");l.mimeType="text/html",e.option.fullPage?l.document.write(""+this._wd.head.outerHTML+this._wd.body.outerHTML+""):l.document.write(''+n.toolbar.preview+"'+i+"")},setContents:function(t){if(c._variable.wysiwygActive){const i=r.convertContentsForEditor(t);i!==e.element.wysiwyg.innerHTML&&(e.element.wysiwyg.innerHTML=i,c.history.push())}else{const e=r.convertHTMLForCodeView(t);e!==c._getCodeView()&&c._setCodeView(e)}},getContents:function(){const t=e.element.wysiwyg.innerHTML,i=r.createElement("DIV");i.innerHTML=t;const n=r.getListChildren(i,function(e){return/FIGCAPTION/i.test(e.nodeName)});for(let e=0,t=n.length;e"+this._wd.head.outerHTML+this._wd.body.outerHTML+"":i.innerHTML},addDocEvent:function(t,i,n){o.addEventListener(t,i,n),e.option.iframe&&this._wd.addEventListener(t,i)},removeDocEvent:function(t,i){o.removeEventListener(t,i),e.option.iframe&&this._wd.removeEventListener(t,i)},_charCount:function(t,i){const n=e.element.charCounter;if(!n)return!0;(!t||t<0)&&(t=0);const l=e.option.maxCharCount;if(a.setTimeout(function(){n.textContent=e.element.wysiwyg.textContent.length}),l>0){let o=!1;const s=e.element.wysiwyg.textContent.length;if(s>l){c._editorRange();const e=c.getRange(),t=e.endOffset-1,i=c.getSelectionNode().textContent;c.getSelectionNode().textContent=i.slice(0,e.endOffset-1)+i.slice(e.endOffset,i.length),c.setRange(e.endContainer,t,e.endContainer,t),o=!0}else s+t>l&&(o=!0);if(o)return i&&!r.hasClass(n,"se-blink")&&(r.addClass(n,"se-blink"),a.setTimeout(function(){r.removeClass(n,"se-blink")},600)),!1}return!0},_checkComponents:function(){this.plugins.image&&(this.initPlugins.image?this.plugins.image.checkImagesInfo.call(this):this.callPlugin("image",this.plugins.image.checkImagesInfo.bind(this))),this.plugins.video&&(this.initPlugins.video?this.plugins.video.checkVideosInfo.call(this):this.callPlugin("video",this.plugins.video.checkVideosInfo.bind(this)))},_setCodeView:function(t){e.option.codeMirrorEditor?e.option.codeMirrorEditor.getDoc().setValue(t):e.element.code.value=t},_getCodeView:function(){return e.option.codeMirrorEditor?e.option.codeMirrorEditor.getDoc().getValue():e.element.code.value},_init:function(){this._ww=e.option.iframe?e.element.wysiwygFrame.contentWindow:a,this._wd=o,a.setTimeout(function(){l.iframe&&(this._wd=e.element.wysiwygFrame.contentDocument,e.element.wysiwyg=this._wd.body,"auto"===l.height&&(this._iframeAuto=this._wd.body)),this._placeholder=e.element.placeholder,this._resourcesStateChange(),this._checkComponents(),this.history=p(this,d._onChange_historyStack)}.bind(this)),this.codeViewDisabledButtons=e.element.toolbar.querySelectorAll('.se-toolbar button:not([class~="code-view-enabled"])'),this._isInline=/inline/i.test(e.option.mode),this._isBalloon=/balloon/i.test(e.option.mode),this.commandMap={FORMAT:e.tool.format,FONT:e.tool.font,FONT_TOOLTIP:e.tool.fontTooltip,SIZE:e.tool.fontSize,ALIGN:e.tool.align,LI:e.tool.list,LI_ICON:e.tool.list&&e.tool.list.querySelector("i"),STRONG:e.tool.bold,INS:e.tool.underline,EM:e.tool.italic,DEL:e.tool.strike,SUB:e.tool.subscript,SUP:e.tool.superscript,OUTDENT:e.tool.outdent},this._variable._originCssText=e.element.topArea.style.cssText},_resourcesStateChange:function(){c._iframeAutoHeight(),c._checkPlaceholder()},_iframeAutoHeight:function(){this._iframeAuto&&(e.element.wysiwygFrame.style.height=this._iframeAuto.offsetHeight+"px")},_checkPlaceholder:function(){if(this._placeholder){if(!this._variable.wysiwygActive)return void(this._placeholder.style.display="none");const t=e.element.wysiwyg;!r.onlyZeroWidthSpace(t.textContent)||t.querySelector(".se-component, pre, blockquote, hr, li, table, img, iframe, video")||(t.innerText.match(/\n/g)||"").length>1?this._placeholder.style.display="none":this._placeholder.style.display="block"}}},d={_directionKeyKeyCode:new a.RegExp("^(8|13|32|46|33|34|35|36|37|38|39|40|46|98|100|102|104)$"),_historyIgnoreKeycode:new a.RegExp("^(9|1[6-8]|20|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new a.RegExp("^(STRONG|INS|EM|DEL|SUB|SUP|LI)$"),_keyCodeShortcut:{65:"A",66:"B",83:"S",85:"U",73:"I",89:"Y",90:"Z",219:"[",221:"]"},_shortcutCommand:function(e,t){let i=null;switch(d._keyCodeShortcut[e]){case"A":i="selectAll";break;case"B":i="STRONG";break;case"S":t&&(i="DEL");break;case"U":i="INS";break;case"I":i="EM";break;case"Z":i=t?"redo":"undo";break;case"Y":i="redo";break;case"[":i="outdent";break;case"]":i="indent"}return!!i&&(c.commandHandler(c.commandMap[i],i),!0)},_findButtonEffectTag:function(){const t=c.commandMap,i=this._onButtonsCheck,l=[],o=[];let s=!0,a=!0,d=!0,u=!0,h=!0,g=!0,p=!0,m="";for(let f=c.getSelectionNode();!r.isWysiwygDiv(f)&&f;f=f.parentNode)if(1===f.nodeType&&!r.isBreak(f))if(m=f.nodeName.toUpperCase(),o.push(m),r.isFormatElement(f)){s&&t.FORMAT&&(l.push("FORMAT"),r.changeTxt(t.FORMAT,m),t.FORMAT.setAttribute("data-focus",m),s=!1);const e=f.style.textAlign;a&&e&&t.ALIGN&&(l.push("ALIGN"),t.ALIGN.className="se-icon-align-"+e,t.ALIGN.setAttribute("data-focus",e),a=!1),g&&f.style.marginLeft&&1*(f.style.marginLeft.match(/\d+/)||[0])[0]>0&&t.OUTDENT&&(l.push("OUTDENT"),t.OUTDENT.removeAttribute("disabled"),g=!1)}else{if(d&&r.isList(m)&&t.LI&&(l.push("LI"),t.LI.setAttribute("data-focus",m),/UL/i.test(m)?(r.removeClass(t.LI_ICON,"se-icon-list-number"),r.addClass(t.LI_ICON,"se-icon-list-bullets")):(r.removeClass(t.LI_ICON,"se-icon-list-bullets"),r.addClass(t.LI_ICON,"se-icon-list-number")),d=!1),u&&f.style.fontFamily.length>0&&t.FONT){l.push("FONT");const e=(f.style.fontFamily||f.face||n.toolbar.font).replace(/["']/g,"");r.changeTxt(t.FONT,e),r.changeTxt(t.FONT_TOOLTIP,e),u=!1}h&&f.style.fontSize.length>0&&t.SIZE&&(l.push("SIZE"),r.changeTxt(t.SIZE,f.style.fontSize),h=!1),p&&/^A$/.test(m)&&null===f.getAttribute("data-image-link")&&c.plugins.link?(e.link&&c.controllerArray[0]===e.link.linkBtn||c.callPlugin("link",function(){c.plugins.link.call_controller_linkButton.call(c,f)}),p=!1):p&&e.link&&c.controllerArray[0]===e.link.linkBtn&&c.controllersOff(),i.test(m)&&l.push(m)}for(let e=0;e-1||(t.FONT&&/^FONT$/i.test(e)?(r.changeTxt(t.FONT,n.toolbar.font),r.changeTxt(t.FONT_TOOLTIP,n.toolbar.font)):t.SIZE&&/^SIZE$/i.test(e)?r.changeTxt(t.SIZE,n.toolbar.fontSize):t.ALIGN&&/^ALIGN$/i.test(e)?(t.ALIGN.className="se-icon-align-left",t.ALIGN.removeAttribute("data-focus")):t.OUTDENT&&/^OUTDENT$/i.test(e)?t.OUTDENT.setAttribute("disabled",!0):t.LI&&r.isListCell(e)?(t.LI.removeAttribute("data-focus"),r.removeClass(t.LI_ICON,"se-icon-list-bullets"),r.addClass(t.LI_ICON,"se-icon-list-number"),r.removeClass(t.LI,"active")):r.removeClass(t[e],"active"));c._variable.currentNodes=o.reverse(),e.option.showPathLabel&&(e.element.navigation.textContent=c._variable.currentNodes.join(" > "))},_cancelCaptionEdit:function(){this.setAttribute("contenteditable",!1),this.removeEventListener("blur",d._cancelCaptionEdit)},onMouseDown_toolbar:function(e){let t=e.target;if(r.getParentElement(t,".se-submenu"))e.stopPropagation(),c._notHideToolbar=!0;else{e.preventDefault();let i=t.getAttribute("data-command"),n=t.className;for(;!i&&!/se-menu-list/.test(n)&&!/se-toolbar/.test(n);)i=(t=t.parentNode).getAttribute("data-command"),n=t.className;i===c._submenuName&&e.stopPropagation()}},onClick_toolbar:function(e){e.preventDefault(),e.stopPropagation();let t=e.target,i=t.getAttribute("data-display"),n=t.getAttribute("data-command"),l=t.className;for(;!n&&!/se-menu-list/.test(l)&&!/se-toolbar/.test(l);)t=t.parentNode,n=t.getAttribute("data-command"),i=t.getAttribute("data-display"),l=t.className;if((n||i)&&!t.disabled){if(c.focus(),i)return!/submenu/.test(i)||null!==t.nextElementSibling&&t===c.submenuActiveButton?/dialog/.test(i)?void c.callPlugin(n,function(){c.plugins.dialog.open.call(c,n,!1)}):void c.submenuOff():void c.callPlugin(n,function(){c.submenuOn(t)});n&&c.commandHandler(t,n)}},onMouseDown_wysiwyg:function(e){c._isBalloon&&d._hideToolbar();const t=r.getParentElement(e.target,r.isCell);if(!t)return;const i=c.plugins.table;t===i._fixedCell||i._shift||c.callPlugin("table",function(){i.onTableCellMultiSelect.call(c,t,!1)})},onClick_wysiwyg:function(t){const i=t.target;if("false"===e.element.wysiwyg.getAttribute("contenteditable"))return;if(t.stopPropagation(),/^FIGURE$/i.test(i.nodeName)){const e=i.querySelector("IMG"),n=i.querySelector("IFRAME");if(e){if(t.preventDefault(),!c.plugins.image)return;return void c.callPlugin("image",function(){const t=c.plugins.resizing.call_controller_resize.call(c,e,"image");c.plugins.image.onModifyMode.call(c,e,t),r.getParentElement(e,".se-image-container")||(c.plugins.image.openModify.call(c,!0),c.plugins.image.update_image.call(c,!0,!0))})}if(n){if(t.preventDefault(),!c.plugins.video)return;return void c.callPlugin("video",function(){const e=c.plugins.resizing.call_controller_resize.call(c,n,"video");c.plugins.video.onModifyMode.call(c,n,e)})}}const n=r.getParentElement(i,"FIGCAPTION");if(n&&"ture"!==n.getAttribute("contenteditable")&&(t.preventDefault(),n.setAttribute("contenteditable",!0),n.focus(),c._isInline&&!c._inlineToolbarAttr.isShow)){d._showToolbarInline();const e=function(){d._hideToolbar(),n.removeEventListener("blur",e)};n.addEventListener("blur",e)}const l=r.getFormatElement(c.getSelectionNode()),o=r.getRangeFormatElement(c.getSelectionNode());if(!c.getRange().collapsed||l&&l!==o||"false"===i.getAttribute("contenteditable")||(c.execCommand("formatBlock",!1,r.isRangeFormatElement(o)?"DIV":"P"),c.focus()),c._editorRange(),d._findButtonEffectTag(),c._isBalloon){const e=c.getRange();e.collapsed?d._hideToolbar():d._showToolbarBalloon(e)}m.onClick&&m.onClick(t)},_showToolbarBalloon:function(t){const i=t||c.getRange(),n=e.element.toolbar,l=c.getSelection();let s;if(l.focusNode===l.anchorNode)s=l.focusOffsetn.offsetWidth?n.offsetWidth-u:b",n.parentNode.insertBefore(o,n),c.callPlugin(g,function(){c.controllersOff();const e=c.plugins.resizing.call_controller_resize.call(c,i._element,g);c.plugins[g].onModifyMode.call(c,i._element,e)}),c.history.push()}}if(n&&/16/.test(i)){t.preventDefault(),t.stopPropagation();const e=c.plugins.table;if(e&&!e._shift&&!e._ref){const t=r.getParentElement(p,r.isCell);if(t)return void e.onTableCellMultiSelect.call(c,t,!0)}}const _=!l&&!o&&1===t.key.length;if(!c._charCount(1,_)&&_)return t.preventDefault(),t.stopPropagation(),!1;m.onKeyDown&&m.onKeyDown(t)},onKeyUp_wysiwyg:function(e){c._editorRange();const t=e.keyCode;let i=c.getSelectionNode();if(c._isBalloon&&!c.getRange().collapsed)return void d._showToolbarBalloon();if(8===t&&r.isWysiwygDiv(i)&&""===i.textContent){e.preventDefault(),e.stopPropagation(),i.innerHTML="";const t=r.createElement(r.isFormatElement(c._variable.currentNodes[0])?c._variable.currentNodes[0]:"P");return t.innerHTML="
    ",i.appendChild(t),c.setRange(t,0,t,0),d._findButtonEffectTag(),void c._checkComponents()}const n=r.getFormatElement(i),l=r.getRangeFormatElement(i);if(n&&n!==l||(c.execCommand("formatBlock",!1,r.isRangeFormatElement(l)?"DIV":"P"),c.focus(),i=c.getSelectionNode()),d._directionKeyKeyCode.test(t)&&d._findButtonEffectTag(),c._checkComponents(),!c._charCount(1,1===e.key.length)&&1===e.key.length)return e.preventDefault(),e.stopPropagation(),!1;d._historyIgnoreKeycode.test(t)||c.history.push(),m.onKeyUp&&m.onKeyUp(e)},onScroll_wysiwyg:function(e){c.controllersOff(),c._isBalloon&&d._hideToolbar(),m.onScroll&&m.onScroll(e)},onMouseDown_resizingBar:function(t){t.stopPropagation(),c._variable.resizeClientY=t.clientY,e.element.resizeBackground.style.display="block",o.addEventListener("mousemove",d._resize_editor),o.addEventListener("mouseup",function t(){e.element.resizeBackground.style.display="none",o.removeEventListener("mousemove",d._resize_editor),o.removeEventListener("mouseup",t)})},_resize_editor:function(t){const i=e.element.editorArea.offsetHeight+(t.clientY-c._variable.resizeClientY);e.element.wysiwygFrame.style.height=e.element.code.style.height=(i=i+l?(c._sticky||d._onStickyToolbar(),t.toolbar.style.top=i+l+e.option.stickyToolbar-n-c._variable.minResizingSize+"px"):n>=l&&d._onStickyToolbar()},_getStickyOffsetTop:function(){let t=e.element.topArea,i=0;for(;t;)i+=t.offsetTop,t=t.offsetParent;return i},_onStickyToolbar:function(){const t=e.element;c._isInline||(t._stickyDummy.style.height=t.toolbar.offsetHeight+"px",t._stickyDummy.style.display="block"),t.toolbar.style.top=e.option.stickyToolbar+"px",t.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:t.toolbar.offsetWidth+"px",r.addClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!0},_offStickyToolbar:function(){const t=e.element;t._stickyDummy.style.display="none",t.toolbar.style.top=c._isInline?c._inlineToolbarAttr.top:"",t.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:"",t.editorArea.style.marginTop="",r.removeClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!1},_codeViewAutoHeight:function(){e.element.code.style.height=e.element.code.scrollHeight+"px"},onPaste_wysiwyg:function(e){const t=e.clipboardData;if(!t)return!0;const i=c._charCount(t.getData("text/plain").length,!0),n=r.cleanHTML(t.getData("text/html"));return("function"!=typeof m.onPaste||m.onPaste(e,n,i))&&i?void(n?(e.stopPropagation(),e.preventDefault(),c.execCommand("insertHTML",!1,n)):c.history.push()):(e.preventDefault(),e.stopPropagation(),!1)},onCut_wysiwyg:function(){a.setTimeout(function(){c._resourcesStateChange(),c._charCount(0,!1),c.history.push()})},onDragOver_wysiwyg:function(e){e.preventDefault()},onDrop_wysiwyg:function(t){const i=t.dataTransfer;if(!i)return!0;const n=i.files;if(n.length>0&&c.plugins.image)d._setDropLocationSelection(t),c.callPlugin("image",function(){e.image.imgInputFile.files=n,c.plugins.image.onRender_imgInput.call(c),e.image.imgInputFile.files=null});else{if(!c._charCount(i.getData("text/plain").length,!0))return t.preventDefault(),t.stopPropagation(),!1;{const e=r.cleanHTML(i.getData("text/html"));e&&(d._setDropLocationSelection(t),c.execCommand("insertHTML",!1,e))}}m.onDrop&&m.onDrop(t)},_setDropLocationSelection:function(e){e.stopPropagation(),e.preventDefault();const t=c.getRange();c.setRange(t.startContainer,t.startOffset,t.endContainer,t.endOffset)},_onChange_historyStack:function(){e.tool.save&&e.tool.save.removeAttribute("disabled"),m.onChange&&m.onChange(c.getContents())},_addEvent:function(){const t=l.iframe?c._ww:e.element.wysiwyg;e.element.toolbar.addEventListener("mousedown",d.onMouseDown_toolbar,!1),e.element.toolbar.addEventListener("click",d.onClick_toolbar,!1),t.addEventListener("click",d.onClick_wysiwyg,!1),t.addEventListener("keydown",d.onKeyDown_wysiwyg,!1),t.addEventListener("keyup",d.onKeyUp_wysiwyg,!1),t.addEventListener("paste",d.onPaste_wysiwyg,!1),t.addEventListener("cut",d.onCut_wysiwyg,!1),t.addEventListener("dragover",d.onDragOver_wysiwyg,!1),t.addEventListener("drop",d.onDrop_wysiwyg,!1),t.addEventListener("scroll",d.onScroll_wysiwyg,!1),(c._isBalloon||c.plugins.table)&&t.addEventListener("mousedown",d.onMouseDown_wysiwyg,!1),c.plugins.table&&t.addEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),"auto"!==e.option.height||e.option.codeMirrorEditor||(e.element.code.addEventListener("keydown",d._codeViewAutoHeight,!1),e.element.code.addEventListener("keyup",d._codeViewAutoHeight,!1),e.element.code.addEventListener("paste",d._codeViewAutoHeight,!1)),e.element.resizingBar&&(/\d+/.test(e.option.height)?e.element.resizingBar.addEventListener("mousedown",d.onMouseDown_resizingBar,!1):r.addClass(e.element.resizingBar,"se-resizing-none")),c._isInline&&t.addEventListener("focus",d._showToolbarInline,!1),(c._isInline||c._isBalloon)&&t.addEventListener("blur",d._hideToolbar,!1),a.removeEventListener("resize",d.onResize_window),a.removeEventListener("scroll",d.onScroll_window),a.addEventListener("resize",d.onResize_window,!1),e.option.stickyToolbar>-1&&a.addEventListener("scroll",d.onScroll_window,!1)},_removeEvent:function(){const t=l.iframe?c._ww:e.element.wysiwyg;e.element.toolbar.removeEventListener("mousedown",d.onMouseDown_toolbar),e.element.toolbar.removeEventListener("click",d.onClick_toolbar),t.removeEventListener("click",d.onClick_wysiwyg),t.removeEventListener("keydown",d.onKeyDown_wysiwyg),t.removeEventListener("keyup",d.onKeyUp_wysiwyg),t.removeEventListener("paste",d.onPaste_wysiwyg),t.removeEventListener("cut",d.onCut_wysiwyg),t.removeEventListener("dragover",d.onDragOver_wysiwyg),t.removeEventListener("drop",d.onDrop_wysiwyg),t.removeEventListener("scroll",d.onScroll_wysiwyg),t.removeEventListener("mousedown",d.onMouseDown_wysiwyg),t.removeEventListener("touchstart",d.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),t.removeEventListener("focus",d._showToolbarInline),t.removeEventListener("blur",d._hideToolbar),e.element.code.removeEventListener("keydown",d._codeViewAutoHeight),e.element.code.removeEventListener("keyup",d._codeViewAutoHeight),e.element.code.removeEventListener("paste",d._codeViewAutoHeight),e.element.resizingBar&&e.element.resizingBar.removeEventListener("mousedown",d.onMouseDown_resizingBar),a.removeEventListener("resize",d.onResize_window),a.removeEventListener("scroll",d.onScroll_window)}},m={core:c,util:r,onScroll:null,onClick:null,onKeyDown:null,onKeyUp:null,onDrop:null,onChange:null,onPaste:null,showInline:null,onImageUpload:null,onImageUploadError:null,setOptions:function(o){d._removeEvent(),c.plugins=o.plugins||c.plugins;const s=[e.option,o].reduce(function(e,t){return Object.keys(t).forEach(function(i){e[i]=t[i]}),e},{}),a=h._setOptions(s,e,c.plugins,e.option);a.callButtons&&(t=a.callButtons,c.initPlugins={}),a.plugins&&(c.plugins=i=a.plugins);const r=e.element,u={_top:r.topArea,_relative:r.relative,_toolBar:r.toolbar,_editorArea:r.editorArea,_wysiwygArea:r.wysiwygFrame,_codeArea:r.code,_placeholder:r.placeholder,_resizingBar:r.resizingBar,_navigation:r.navigation,_charCounter:r.charCounter,_loading:r.loading,_resizeBack:r.resizeBackground,_stickyDummy:r._stickyDummy,_arrow:r._arrow};l=s,c.lang=n=l.lang,c.context=e=g(e.element.originElement,u,l),c._init(),d._addEvent(),d._offStickyToolbar(),d.onResize_window(),c._checkComponents(),c.history=p(c,d._onChange_historyStack),c._charCount(0,!1),c.focus()},noticeOpen:function(e){c.addModule([s]),s.open.call(c,e)},noticeClose:function(){c.addModule([s]),s.close.call(c)},save:function(){e.element.originElement.value=c.getContents()},getContext:function(){return e},getContents:function(){return c.getContents()},getImagesInfo:function(){return c._variable._imagesInfo},insertImage:function(e){c.plugins.image&&e&&(c.initPlugins.image?c.plugins.image.submitAction.call(c,e):c.callPlugin("image",c.plugins.image.submitAction.bind(c,e)),c.focus())},insertHTML:function(e){if(!e.nodeType||1!==e.nodeType){const t=r.createElement("DIV");t.innerHTML=e,e=t.firstChild||t.content.firstChild}let t=null;(r.isFormatElement(e)||/^(IMG|IFRAME)$/i.test(e.nodeName))&&(t=r.getFormatElement(c.getSelectionNode())),c.insertNode(e,t),c.focus()},setContents:function(e){c.setContents(e)},appendContents:function(t){c._variable.wysiwygActive?e.element.wysiwyg.innerHTML+=r.convertContentsForEditor(t):c._setCodeView(c._getCodeView()+r.convertHTMLForCodeView(t)),c.history.push()},disabled:function(){e.tool.cover.style.display="block",e.element.wysiwyg.setAttribute("contenteditable",!1),e.option.codeMirrorEditor?e.option.codeMirrorEditor.setOption("readOnly",!0):e.element.code.setAttribute("disabled","disabled")},enabled:function(){e.tool.cover.style.display="none",e.element.wysiwyg.setAttribute("contenteditable",!0),e.option.codeMirrorEditor?e.option.codeMirrorEditor.setOption("readOnly",!1):e.element.code.removeAttribute("disabled")},show:function(){const t=e.element.topArea.style;"none"===t.display&&(t.display=e.option.display)},hide:function(){e.element.topArea.style.display="none"},destroy:function(){d._removeEvent(),r.removeItem(e.element.topArea),a.Object.keys(c).forEach(function(e){delete c[e]}),a.Object.keys(d).forEach(function(e){delete d[e]}),a.Object.keys(e).forEach(function(t){delete e[t]}),a.Object.keys(t).forEach(function(e){delete t[e]}),a.Object.keys(this).forEach(function(e){delete this[e]}.bind(this))}};return c._init(),d._addEvent(),c._charCount(0,!1),m}(g(n,l.constructed,l.options),l.pluginCallButtons,l.plugins,l.options.lang,t)}};window.SUNEDITOR=m.init({plugins:a})}}); \ No newline at end of file diff --git a/package.json b/package.json index 9e6bf98e3..57f30ec87 100644 --- a/package.json +++ b/package.json @@ -3,21 +3,22 @@ "sideEffects": [ "./src/assets/css/*.css" ], - "version": "2.20.1", + "version": "2.21.0", "description": "Pure JavaScript based WYSIWYG web editor", "main": "src/suneditor.js", "keywords": [ "wysiwyg", - "editor", "wysiwyg editor", + "wysiwyg html editor", "rich text", "rich editor", "rich text editor", - "web", "html", + "text", + "editor", "contenteditable", - "suneditor", - "javascript" + "javascript", + "vanillajs" ], "author": "JiHong.Lee", "license": "MIT", diff --git a/sample/css/sample.css b/sample/css/sample.css index 9ac597af6..de357087c 100644 --- a/sample/css/sample.css +++ b/sample/css/sample.css @@ -30,6 +30,7 @@ footer { /** badge */ .badge { + width: 230px; padding: 10px 0; background-color: inherit; } diff --git a/sample/html/customPlugins.html b/sample/html/customPlugins.html index e71bdb94d..639d02ffe 100644 --- a/sample/html/customPlugins.html +++ b/sample/html/customPlugins.html @@ -11,8 +11,6 @@ - -