diff --git a/bower.json b/bower.json index e391f544a..d1a69a3d2 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "suneditor", - "version": "2.17.2", + "version": "2.17.3", "description": "Pure JavaScript based WYSIWYG web editor", "main": "src/suneditor.js", "keywords": [ diff --git a/dist/css/suneditor.min.css b/dist/css/suneditor.min.css index 4933314fd..faec386ec 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 .txt{display:block;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@font-face{font-family:Suneditor-icon;src:url(../fonts/7c81266083cb7a81c54e213163cadd72.eot);src:url(../fonts/7c81266083cb7a81c54e213163cadd72.eot?#iefix) format("embedded-opentype"),url(../fonts/d07f59ffeba30aa8f492b152fb23245a.woff2) format("woff2"),url(../fonts/85dfdf8d9e9f850dd1eacea7fe2eeca4.woff) format("woff"),url(../fonts/17435b7f0a586ee9a54236f65fec7b8c.ttf) format("truetype"),url(../fonts/231d952cf3fe333ca4ce80a62ae256ef.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-pdf:before{content:"3"}.sun-editor .se-icon-file: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-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 .se-container .se-wrapper-wysiwyg.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 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-input-control{display:inline-block;width:70px;text-align:center}.sun-editor .se-input-control,.sun-editor .se-input-form{height:34px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:2px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.sun-editor .se-input-form{display:block;width:100%;padding:0 4px}.sun-editor .se-input-control:focus,.sun-editor .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-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:3}.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;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.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{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{width:175px}.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{max-height:300px;overflow-x:hidden;overflow-y:auto}.sun-editor .se-list-layer .se-list-font-size-inner{width:140px}.sun-editor .se-list-layer .se-list-font-size-inner .se-btn-list{height:auto;min-height:32px;line-height:normal}.sun-editor .se-list-layer .se-list-line{width:158px}.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;font-size:12px;margin:1px 0;padding:0;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:static;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[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 .se-wrapper .se-wrapper-wysiwyg[contenteditable=true] figure a,.sun-editor .se-wrapper .se-wrapper-wysiwyg[contenteditable=true] figure img{z-index:0}.sun-editor .se-wrapper .se-wrapper-wysiwyg[contenteditable=true] figure figcaption{z-index:2}.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-bar .se-resizing-back{position:absolute;display:none;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;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-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:15px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer{margin-top:15px}.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:72px;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-footer{padding:10px 15px 0;text-align:right;border-top:1px solid #e5e5e5}.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;background-image:none;border-radius:2px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-radio{margin-left:12px;margin-right:5px}.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:3;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%;width:max-content;display:none}.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: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-resizing-container{position:absolute;display:none;z-index:3;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;padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-wrapper-wysiwyg table td.se-table-selected-cell,.sun-editor .se-wrapper-wysiwyg table th.se-table-selected-cell{border:1px double #4592ff;background-color:#f1f7ff}.sun-editor .se-controller-link{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}.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}@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 figcaption,.sun-editor-editable figure,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable td,.sun-editor-editable th{position:relative}.sun-editor-editable iframe,.sun-editor-editable img{display:block;margin:0;padding:0;max-width:100%}.sun-editor-editable .float-left{float:left}.sun-editor-editable .float-right{float:right}.sun-editor-editable .float-center{float:center}.sun-editor-editable .float-none{float:none}.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.solid{border-style:solid none none}.sun-editor-editable hr.dotted{border-style:dotted none none}.sun-editor-editable hr.dashed{border-style:dashed none none}.sun-editor-editable img.inner-link{padding:1px;margin:1px;outline:1px solid #d1d1d1}.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}.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 .txt{display:block;margin-top:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}@font-face{font-family:Suneditor-icon;src:url(../fonts/7c81266083cb7a81c54e213163cadd72.eot);src:url(../fonts/7c81266083cb7a81c54e213163cadd72.eot?#iefix) format("embedded-opentype"),url(../fonts/d07f59ffeba30aa8f492b152fb23245a.woff2) format("woff2"),url(../fonts/85dfdf8d9e9f850dd1eacea7fe2eeca4.woff) format("woff"),url(../fonts/17435b7f0a586ee9a54236f65fec7b8c.ttf) format("truetype"),url(../fonts/231d952cf3fe333ca4ce80a62ae256ef.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-pdf:before{content:"3"}.sun-editor .se-icon-file: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-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 .se-container .se-wrapper-wysiwyg.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 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-input-control{display:inline-block;width:70px;text-align:center}.sun-editor .se-input-control,.sun-editor .se-input-form{height:34px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:2px;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.sun-editor .se-input-form{display:block;width:100%;padding:0 4px}.sun-editor .se-input-control:focus,.sun-editor .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-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:3}.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;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.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{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{width:175px}.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{max-height:300px;overflow-x:hidden;overflow-y:auto}.sun-editor .se-list-layer .se-list-font-size-inner{width:140px}.sun-editor .se-list-layer .se-list-font-size-inner .se-btn-list{height:auto;min-height:32px;line-height:normal}.sun-editor .se-list-layer .se-list-line{width:158px}.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;font-size:12px;margin:1px 0;padding:0;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:static;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[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 .se-wrapper .se-wrapper-wysiwyg[contenteditable=true] figure a,.sun-editor .se-wrapper .se-wrapper-wysiwyg[contenteditable=true] figure img{z-index:0}.sun-editor .se-wrapper .se-wrapper-wysiwyg[contenteditable=true] figure figcaption{z-index:2}.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-bar .se-resizing-back{position:absolute;display:none;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;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-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:15px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-form-footer{margin-top:15px}.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:72px;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-footer{padding:10px 15px 0;text-align:right;border-top:1px solid #e5e5e5}.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;background-image:none;border-radius:2px}.sun-editor .se-dialog .se-dialog-inner .se-dialog-btn-radio{margin-left:12px;margin-right:5px}.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:4;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%;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: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-resizing-container{position:absolute;display:none;z-index:4;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;padding:0;font-size:14px;font-style:normal;font-weight:400;line-height:1.42857143}.sun-editor .se-wrapper-wysiwyg table td.se-table-selected-cell,.sun-editor .se-wrapper-wysiwyg table th.se-table-selected-cell{border:1px double #4592ff;background-color:#f1f7ff}.sun-editor .se-controller-link{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}.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}@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 figcaption,.sun-editor-editable figure,.sun-editor-editable iframe,.sun-editor-editable img,.sun-editor-editable td,.sun-editor-editable th{position:relative}.sun-editor-editable iframe,.sun-editor-editable img{display:block;margin:0;padding:0;max-width:100%}.sun-editor-editable .float-left{float:left}.sun-editor-editable .float-right{float:right}.sun-editor-editable .float-center{float:center}.sun-editor-editable .float-none{float:none}.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.solid{border-style:solid none none}.sun-editor-editable hr.dotted{border-style:dotted none none}.sun-editor-editable hr.dashed{border-style:dashed none none}.sun-editor-editable img.inner-link{padding:1px;margin:1px;outline:1px solid #d1d1d1}.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}.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/suneditor.min.js b/dist/suneditor.min.js index c825d855f..8be9e148c 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 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:"Hilite 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"},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+='"},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;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"),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),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.wysiwyg.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[this.context.resizing._resize_plugin]._element,o=this.plugins[this.context.resizing._resize_plugin];if(e.preventDefault(),/percent/.test(i)){this.plugins.resizing.resetTransform.call(this,l),o.setPercentSize.call(this,100*n+"%","auto");const e=this.plugins.resizing.call_controller_resize.call(this,l,this.context.resizing._resize_plugin);o.onModifyMode.call(this,l,e)}else if(/mirror/.test(i)){const e=l.getAttribute("data-rotate")||"0";let t=l.getAttribute("data-rotateX")||"",i=l.getAttribute("data-rotateY")||"";"h"===n&&!this.context.resizing._rotateVertical||"v"===n&&this.context.resizing._rotateVertical?i=i?"":"180":t=t?"":"180",l.setAttribute("data-rotateX",t),l.setAttribute("data-rotateY",i),this.plugins.resizing._setTransForm(l,e,t,i)}else if(/rotate/.test(i)){const e=this.context.resizing,t=1*l.getAttribute("data-rotate")+1*n,i=Math.abs(t)>=360?0:t;l.setAttribute("data-rotate",i),e._rotateVertical=/^(90|270)$/.test(Math.abs(i).toString()),this.plugins.resizing.setTransformSize.call(this,l,null,null);const s=this.plugins.resizing.call_controller_resize.call(this,l,e._resize_plugin);o.onModifyMode.call(this,l,s)}else if(/revert/.test(i)){o.setAutoSize?o.setAutoSize.call(this):(o.resetAlign.call(this),this.plugins.resizing.resetTransform.call(this,l));const e=this.plugins.resizing.call_controller_resize.call(this,l,this.context.resizing._resize_plugin);o.onModifyMode.call(this,l,e)}else/update/.test(i)?(o.openModify.call(this),this.controllersOff()):/delete/.test(i)&&o.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]+"px"||!1,e.style.height=t[1]+"px"||!1,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=""}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";const 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);this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t,i,e),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.wysiwyg),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 e=0,t=n.length;e"}return l+=" ",i.innerHTML=l,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,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)));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>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)));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._d.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.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)));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._d.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._d.removeEventListener("mousedown",e._bindOnSelect),this._d.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._d.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._d.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";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},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.focusElement.value,t=this.context.link.linkAnchorText,i=0===t.value.length?e:t.value;if(this.context.dialog.updateModal)this.context.link._linkAnchor.href=e,this.context.link._linkAnchor.textContent=i,this.context.link._linkAnchor.target=this.context.link.linkNewWindowCheck.checked?"_blank":"",this.history.push(),this.setRange(this.context.link._linkAnchor.childNodes[0],0,this.context.link._linkAnchor.childNodes[0],this.context.link._linkAnchor.textContent.length);else{const t=this.util.createElement("A");t.href=e,t.textContent=i,t.target=this.context.link.linkNewWindowCheck.checked?"_blank":"",this.insertNode(t),this.setRange(t.childNodes[0],0,t.childNodes[0],t.textContent.length)}this.context.link.focusElement.value="",this.context.link.linkAnchorText.value=""}.bind(this);try{t()}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.focus()}return!1},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);t.style.top=n.top+e.offsetHeight+10+"px",t.style.left=n.left-this.context.element.wysiwyg.scrollLeft+"px",t.style.display="block";const l=this.context.element.wysiwyg.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:"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='
    ';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)&&(a.style.width=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,"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,"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)},setSize:function(e,t){const i=this.context.image;i._element.style.width=e+"px",i._element.style.height=t+"px"},setAutoSize:function(){const e=this.context.image;this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this),e._element.style.maxWidth="100%",e._element.style.width="100%",e._element.style.height="",e._cover.style.width="",e._cover.style.height=""},setPercentSize:function(e){const t=this.context.image;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,"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,"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
    ';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))},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation(),this.context.video._captionChecked=this.context.video.captionCheckEl.checked;const t=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++);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,"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()}.bind(this);try{t()}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(){const e=this.context.video;e.focusElement.value=e._element.src,e.videoWidth.value=e._element.offsetWidth,e.videoHeight.value=e._element.offsetHeight,e._captionChecked=e.captionCheckEl.checked=!!e._caption,e.modal.querySelector('input[name="suneditor_video_radio"][value="'+e._align+'"]').checked=!0,e._resizing&&(e.proportion.checked=e._proportionChecked="false"!==e._element.getAttribute("data-proportion"),e.proportion.disabled=!1),this.plugins.dialog.open.call(this,"video",!0)},checkVideos: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;nr&&(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"),t()}()},500)},undo:function(){r>0&&(r--,d())},redo:function(){c.length-1>r&&(r++,d())},reset:function(){c=c[r=0]}}};const c={_d:document,_w:window,_onlyZeroWidthRegExp:new RegExp("^"+String.fromCharCode(8203)+"+$"),_tagConvertor:function(e){const t={b:"strong",i:"em",var:"em",u:"ins",strike:"del",s:"del"};return e.replace(/(<\/?)(pre|blockquote|h[1-6]|ol|ul|dl|li|hr|b|strong|var|i|em|u|ins|s|strike|del|sub|sup)\b\s*(?:[^>^<]+)?\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={"&":"&"," ":" ","'":""","<":"<",">":">"};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"))},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))},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){let t=0,i=0,n=3===e.nodeType?e.parentElement:e;const l=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;n&&!this.hasClass(n,"se-container")&&n!==l;)t+=n.offsetLeft,i+=n.offsetTop,n=n.offsetParent;return{left:t,top:i-l.scrollTop}},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).children;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|data-file-size|data-file-name|data-origin|origin-size)\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-1?1*t.maxCharCount:null,t.charCounter=t.maxCharCount>0||"boolean"==typeof t.charCounter&&t.charCounter,t.popupDisplay=t.popupDisplay||"full",t.display=t.display||("none"!==e.style.display&&e.style.display?e.style.display:"block"),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||"",t.buttonList=t.buttonList||[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]];const l=document,o=l.createElement("DIV");o.className="sun-editor",e.id&&(o.id="suneditor_"+e.id),o.style.width=t.width,o.style.minWidth=t.minWidth,o.style.maxWidth=t.maxWidth,o.style.display=t.display;const s=l.createElement("DIV");s.className="se-container";const a=this._createToolBar(l,t.buttonList,n,i);let r=null;/inline/i.test(t.mode)?(a.element.className+=" se-toolbar-inline",a.element.style.width=t.toolbarWidth):/balloon/i.test(t.mode)&&(a.element.className+=" se-toolbar-balloon",(r=l.createElement("DIV")).className="se-arrow",a.element.appendChild(r));const c=l.createElement("DIV");c.className="se-toolbar-sticky-dummy";const u=l.createElement("DIV");u.className="se-wrapper";const h=l.createElement("DIV");h.setAttribute("contenteditable",!0),h.setAttribute("scrolling","auto"),h.className="se-wrapper-inner se-wrapper-wysiwyg sun-editor-editable",h.style.display="block",h.innerHTML=d.convertContentsForEditor(e.value),h.style.height=t.height,h.style.minHeight=t.minHeight,h.style.maxHeight=t.maxHeight;const g=l.createElement("TEXTAREA");g.className="se-wrapper-inner se-wrapper-code",g.style.display="none",g.style.height=t.height,g.style.minHeight=t.minHeight,g.style.maxHeight=t.maxHeight;let p=null,m=null,f=null;if(t.resizingBar&&((p=l.createElement("DIV")).className="se-resizing-bar sun-editor-common",(m=l.createElement("DIV")).className="se-navigation sun-editor-common",p.appendChild(m),t.charCounter)){const e=l.createElement("DIV");if(e.className="se-char-counter-wrapper",(f=l.createElement("SPAN")).className="se-char-counter",f.textContent="0",e.appendChild(f),t.maxCharCount>0){const i=l.createElement("SPAN");i.textContent=" / "+t.maxCharCount,e.appendChild(i)}p.appendChild(e)}const _=l.createElement("DIV");_.className="se-loading-box sun-editor-common",_.innerHTML='
    ';const b=l.createElement("DIV");return b.className="se-resizing-back",u.appendChild(h),u.appendChild(g),s.appendChild(a.element),s.appendChild(c),s.appendChild(u),s.appendChild(b),s.appendChild(_),p&&s.appendChild(p),o.appendChild(s),{constructed:{_top:o,_relative:s,_toolBar:a.element,_editorArea:u,_wysiwygArea:h,_codeArea:g,_resizingBar:p,_navigation:m,_charCounter:f,_loading:_,_resizeBack:b,_stickyDummy:c,_arrow:r},options:t,plugins:a.plugins,pluginCallButtons:a.pluginCallButtons}},_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",''],link:["",e.toolbar.link,"link","dialog",''],image:["",e.toolbar.image,"image","dialog",''],video:["",e.toolbar.video,"video","dialog",'']}},_createModuleGroup:function(e){const t=d.createElement("DIV");t.className="se-btn-module"+(e?"":" se-btn-module-border");const i=d.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=d.createElement("LI"),a=d.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;t0){for(let t=0;t":i),this.history.push()},focus:function(){if("none"===e.element.wysiwyg.style.display)return;const t=a.getParentElement(this.getSelectionNode(),"figcaption");t?t.focus():e.element.wysiwyg.focus(),this._editorRange(),u._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 s=l.createRange();s.setStart(e,t),s.setEnd(i,n);const a=o.getSelection();a.removeAllRanges&&a.removeAllRanges(),a.addRange(s),this._editorRange()},getRange:function(){return this._variable._range||this._createDefaultRange()},getSelectionNode:function(){return this._variable._selectionNode||e.element.wysiwyg.firstChild},_editorRange:function(){const e=o.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=l.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(a.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=a.getListChildren(o,function(e){return t?t(e):a.isFormatElement(e)});if(a.isWysiwygDiv(o)||a.isRangeFormatElement(o)||s.unshift(a.getFormatElement(o)),n===l||1===s.length)return s;let r=a.getFormatElement(n),c=a.getFormatElement(l),d=null,u=null;const h=function(e){return!a.isTable(e)||/^TABLE$/i.test(e.nodeName)},g=a.getRangeFormatElement(r,h),p=a.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?a.removeItem(o):o!==t?o!==n?(a.removeItem(o),this.history.push()):(r=1===n.nodeType?a.createTextNode(n.textContent):a.createTextNode(n.substringData(l,n.length-l))).length>0?n.data=r.data:a.removeItem(n):(s=1===t.nodeType?a.createTextNode(t.textContent):a.createTextNode(t.substringData(0,i))).length>0?t.data=s.data:a.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=a.isRangeFormatElement(o)||a.isFormatElement(o)?o:a.getRangeFormatElement(o)||a.getFormatElement(o),a.isCell(i)?(n=null,l=i):(n=i.nextSibling,l=i.parentNode);let s=a.getElementDepth(i),r=null;const c=[],d=function(e,t,i){let n=null;return e===t||a.isTable(t)||(n=a.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(r),r=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,r=o.endOffset,c=e.children,d=e.parentNode;let h=null,g=null,p=e.cloneNode(!1);const m=a.isList(i);let f=!1;function _(e,t,i){a.onlyZeroWidthSpace(t)&&(t.innerHTML=a.zeroWidthSpace);const n=t.childNodes;let l=t.cloneNode(!1),o=null,s=null;for(;n[0];)s=n[0],a.isIgnoreNodeChange(s)&&!a.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&&(d.insertBefore(p,e),p=null),!m&&a.isListCell(l)){const t=l.innerHTML;(l=a.isCell(e.parentNode)?a.createElement("DIV"):a.createElement("P")).innerHTML=t}else l=l.cloneNode(!0);n||(i?(f||(d.insertBefore(i,e),f=!0),l=_(i,l,null)):l=_(d,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),a.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,r):this.setRange(v.sc,0,v.sc,0)),u._findButtonEffectTag()},nodeChange:function(t,i,n){const l=this.getRange();i=!!(i&&i.length>0)&&i,n=!!(n&&n.length>0)&&n,this._editorRange();const s=!t,r=s&&!n&&!i;let c,d,u,h=l.startContainer,g=l.startOffset,p=l.endContainer,m=l.endOffset;if(r&&l.collapsed&&a.isFormatElement(h.parentNode)&&a.isFormatElement(p.parentNode))return;if(s&&(t=this.util.createElement("DIV")),!r&&h===p){let e=h;if(r){if(a.getFormatElement(e)===e.parentNode)return}else if(i.length>0){let n=0;for(let l=0;l=i.length)return;if(s&&0===n)return}}if(c=a.isWysiwygDiv(h)?e.element.wysiwyg.firstChild:h,d=g,a.isBreak(c)||1===c.nodeType&&c.childNodes.length>0){const e=a.isBreak(c);if(!e){for(;c&&!a.isBreak(c)&&1===c.nodeType;)c=c.childNodes[d]||c.nextElementSibling||c.nextSibling,d=0;let e=a.getFormatElement(c);e===a.getRangeFormatElement(e)&&(e=a.createElement(a.isCell(c)?"DIV":"P"),c.parentNode.insertBefore(e,c),e.appendChild(c))}if(a.isBreak(c)){const t=a.createTextNode(a.zeroWidthSpace);c.parentNode.insertBefore(t,c),c=t,e&&(h===p&&(p=c,m=1),a.removeItem(h))}}if(h=c,g=d,c=a.isWysiwygDiv(p)?e.element.wysiwyg.lastChild:p,d=m,a.isBreak(c)||1===c.nodeType&&c.childNodes.length>0){const e=a.isBreak(c);if(!e){for(;c&&!a.isBreak(c)&&1===c.nodeType;)d=(c=(u=c.childNodes)[d-1]||!/FIGURE/i.test(u[0].nodeName)?u[0]:c.previousElementSibling||c.previousSibling||h).textContent.length;let e=a.getFormatElement(c);e===a.getRangeFormatElement(e)&&(e=a.createElement(a.isCell(e)?"DIV":"P"),c.parentNode.insertBefore(e,c),e.appendChild(c))}if(a.isBreak(c)){const t=a.createTextNode(a.zeroWidthSpace);c.parentNode.insertBefore(t,c),c=t,d=0,e&&a.removeItem(p)}}p=c,m=d;const f=t.nodeName;this.setRange(h,g,p,m);let _,b,y,v={},x={};if(i){b="(?:;|^|\\s)(?:"+i[0];for(let e=1;e0&&(i=t.replace(b,"").trim()),s){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();a.getFormatElement(h)||(h=a.getChildElement(w[0],function(e){return 3===e.nodeType}),g=0),a.getFormatElement(p)||(m=(p=a.getChildElement(w[w.length-1],function(e){return 3===e.nodeType})).textContent.length);const k=a.getFormatElement(h)===a.getFormatElement(p),E=w.length-(k?0:1);if(_=t.cloneNode(!1),k){const e=this._nodeChange_oneLine(w[0],_,C,h,g,p,m,r,s,l.collapsed);v.container=e.startContainer,v.offset=e.startOffset,x.container=e.endContainer,x.offset=e.endOffset}else v=this._nodeChange_startLine(w[0],_,C,h,g,r,s);for(let e=1;e0&&!k?(_=t.cloneNode(!1),x=this._nodeChange_endLine(w[E],_,C,p,m,r,s)):k||(x=v),this.setRange(v.container,v.offset,x.container,x.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,s,r,c,d,u){const h=e,g=t,p=[t],m=e.cloneNode(!1),f=n===s;let _,b,y,v,x=n,C=l,w=s,k=r,E=!1,S=!1;function N(e){const t=new o.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=C?k-C:x.data.length-C));for(e.data.length>0&&l.appendChild(e),b=s,_=[],v="";b!==m&&b!==h&&null!==b;)i(b)&&1===b.nodeType&&N(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),x=n,C=0,E=!0,b!==n&&b.appendChild(x),!f)continue;if(r===C||r===n.data.length){w=n,k=n.data.length,S=!0;continue}}if(S||s!==w){if(E){if(1===s.nodeType&&!a.isBreak(s)){a.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&&!a.isBreak(s)&&(S||i(b))&&N(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)}d=s.cloneNode(!1),l.appendChild(d),1!==s.nodeType||a.isBreak(s)||(g=d),e(s,g)}else{const e=a.createTextNode(1===w.nodeType?"":w.substringData(k,w.length-k)),n=a.createTextNode(f||1===w.nodeType?"":w.substringData(0,k));if(e.data.length>0){for(b=s,v="",_=[];b!==m&&b!==h&&null!==b;)1===b.nodeType&&N(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;for(d=y=b=_.pop()||e;_.length>0;)b=_.pop(),y.appendChild(b),y=b;m.appendChild(d),b.textContent=e.data}for(b=s,_=[],v="";b!==m&&b!==h&&null!==b;)i(b)&&1===b.nodeType&&N(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,k=n.data.length,S=!0,!c&&u&&(t=n,n.textContent=a.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||a.isBreak(s)||(_=e)}e(s,_)}else{const e=a.createTextNode(1===p.nodeType?"":p.substringData(0,m)),n=a.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,a.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||a.isBreak(s)||(_=e)}e(s,_)}else{const e=a.createTextNode(1===p.nodeType?"":p.substringData(m,p.length-m)),n=a.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,a.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"),this._variable.wysiwygActive=!1,e.element.code.focus();else{const t=e.element.code.value.trim();e.element.wysiwyg.innerHTML=t.length>0?a.convertContentsForEditor(t):"


    ",e.element.wysiwyg.scrollTop=0,e.element.code.style.display="none",e.element.wysiwyg.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.element.code.style.height="0px"),this._variable.wysiwygActive=!0,this.focus()}},toggleFullScreen:function(t){const i=e.element.topArea,n=e.element.toolbar,s=e.element.editorArea,r=e.element.wysiwyg,c=e.element.code;this._variable.isFullScreen?(this._variable.isFullScreen=!1,r.style.cssText=this._variable._wysiwygOriginCssText,c.style.cssText=this._variable._codeOriginCssText,n.style.cssText="",s.style.cssText=this._variable._editorAreaOriginCssText,i.style.cssText=this._variable._originCssText,l.body.style.overflow=this._variable._bodyOverflow,e.option.stickyToolbar>-1&&(a.removeClass(n,"se-toolbar-sticky"),u.onScroll_window()),this._variable._fullScreenSticky&&(this._variable._fullScreenSticky=!1,e.element._stickyDummy.style.display="block",a.addClass(n,"se-toolbar-sticky")),a.removeClass(t.firstElementChild,"se-icon-reduction"),a.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",a.removeClass(n,"se-toolbar-sticky")),this._variable._bodyOverflow=l.body.style.overflow,l.body.style.overflow="hidden",this._variable._editorAreaOriginCssText=s.style.cssText,this._variable._wysiwygOriginCssText=r.style.cssText,this._variable._codeOriginCssText=c.style.cssText,s.style.cssText=n.style.cssText="",r.style.cssText=r.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=r.style.height=c.style.height="100%",n.style.position="relative",this._variable.innerHeight_fullScreen=o.innerHeight-n.offsetHeight,s.style.height=this._variable.innerHeight_fullScreen+"px",a.removeClass(t.firstElementChild,"se-icon-expansion"),a.addClass(t.firstElementChild,"se-icon-reduction"))},print:function(){const e=a.createElement("IFRAME");e.style.display="none";const t=a.createElement("DIV"),i=a.createElement("STYLE");i.innerHTML=a.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!==o.navigator.userAgent.indexOf("MSIE")||l.documentMode||o.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{a.removeItem(e)}},preview:function(){const e=a.getPageStyle(),t=this.getContents(),i=o.open("","_blank");i.mimeType="text/html",i.document.write(''+n.toolbar.preview+"
    '+t+"
    ")},getContents:function(){let t="";t=c._variable.wysiwygActive?e.element.wysiwyg.innerHTML:a.convertContentsForEditor(e.element.code.value);const i=a.createElement("DIV");i.innerHTML=t;const n=a.getListChildren(i,function(e){return/FIGCAPTION/i.test(e.nodeName)});for(let e=0,t=n.length;e0){let s=!1;const r=e.element.wysiwyg.textContent.length;if(r>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),s=!0}else r+t>l&&(s=!0);if(s)return i&&!a.hasClass(n,"se-blink")&&(a.addClass(n,"se-blink"),o.setTimeout(function(){a.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.checkVideos.call(this):this.callPlugin("video",this.plugins.video.checkVideos.bind(this)))}},u={_directionKeyKeyCode:new o.RegExp("^(8|13|32|46|33|34|35|36|37|38|39|40|46|98|100|102|104)$"),_historyIgnoreKeycode:new o.RegExp("^(9|1[6-8]|20|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new o.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(u._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,r=!0,d=!0,u=!0,h=!0,g=!0,p=!0,m="";for(let f=c.getSelectionNode();!a.isWysiwygDiv(f)&&f;f=f.parentNode)if(1===f.nodeType&&!a.isBreak(f))if(m=f.nodeName.toUpperCase(),o.push(m),a.isFormatElement(f)){s&&t.FORMAT&&(l.push("FORMAT"),a.changeTxt(t.FORMAT,m),t.FORMAT.setAttribute("data-focus",m),s=!1);const e=f.style.textAlign;r&&e&&t.ALIGN&&(l.push("ALIGN"),t.ALIGN.className="se-icon-align-"+e,t.ALIGN.setAttribute("data-focus",e),r=!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&&a.isList(m)&&t.LI&&(l.push("LI"),t.LI.setAttribute("data-focus",m),/UL/i.test(m)?(a.removeClass(t.LI_ICON,"se-icon-list-number"),a.addClass(t.LI_ICON,"se-icon-list-bullets")):(a.removeClass(t.LI_ICON,"se-icon-list-bullets"),a.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,"");a.changeTxt(t.FONT,e),a.changeTxt(t.FONT_TOOLTIP,e),u=!1}h&&f.style.fontSize.length>0&&t.SIZE&&(l.push("SIZE"),a.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)?(a.changeTxt(t.FONT,n.toolbar.font),a.changeTxt(t.FONT_TOOLTIP,n.toolbar.font)):t.SIZE&&/^SIZE$/i.test(e)?a.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&&a.isListCell(e)?(t.LI.removeAttribute("data-focus"),a.removeClass(t.LI_ICON,"se-icon-list-bullets"),a.addClass(t.LI_ICON,"se-icon-list-number"),a.removeClass(t.LI,"active")):a.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",u._cancelCaptionEdit)},onMouseDown_toolbar:function(e){let t=e.target;if(a.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){const t=a.getParentElement(e.target,a.isCell);if(!t)return;const i=c.plugins.table;t===i._fixedCell||i._shift||c.callPlugin("table",function(){i.onTableCellMultiSelect.call(c,t,!1)})},onMouseUp_wysiwyg:function(){if("false"!==e.element.wysiwyg.getAttribute("contenteditable")&&(c._editorRange(),c._isBalloon)){const e=c.getRange();e.collapsed?u._hideToolbar():u._showToolbarBalloon(e)}},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("false"!==i.getAttribute("contenteditable")&&c.callPlugin("image",function(){const t=c.plugins.resizing.call_controller_resize.call(c,e,"image");c.plugins.image.onModifyMode.call(c,e,t),a.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=a.getParentElement(i,"FIGCAPTION");if(n&&"ture"!==n.getAttribute("contenteditable")&&(t.preventDefault(),n.setAttribute("contenteditable",!0),n.focus(),c._isInline&&!c._inlineToolbarAttr.isShow)){u._showToolbarInline();const e=function(){u._hideToolbar(),n.removeEventListener("blur",e)};n.addEventListener("blur",e)}const l=a.getFormatElement(c.getSelectionNode()),o=a.getRangeFormatElement(c.getSelectionNode());if(c.getRange().collapsed&&(!l||l===o)&&"false"!==i.getAttribute("contenteditable"))return c.execCommand("formatBlock",!1,a.isRangeFormatElement(o)?"DIV":"P"),void c.focus();u._findButtonEffectTag(),h.onClick&&h.onClick(t)},_showToolbarBalloon:function(t){const i=t||c.getRange(),n=e.element.toolbar,s=o.getSelection();let r;if(s.focusNode===s.anchorNode)r=s.focusOffset=h?b-y:b-(r?0:20));e.element._arrow.style.left=(v+11>n.offsetWidth?n.offsetWidth-11:v)+"px"},_showToolbarInline:function(){const t=e.element.toolbar;t.style.display="block",c._inlineToolbarAttr.width=t.style.width=e.option.toolbarWidth,c._inlineToolbarAttr.top=t.style.top=-1-t.offsetHeight+"px",u.onScroll_window(),c._inlineToolbarAttr.isShow=!0},_hideToolbar:function(){c._notHideToolbar||(e.element.toolbar.style.display="none",c._inlineToolbarAttr.isShow=!1),c._notHideToolbar=!1},onKeyDown_wysiwyg:function(t){const i=t.keyCode,n=t.shiftKey,l=t.ctrlKey||t.metaKey,o=t.altKey;if(c._isBalloon&&u._hideToolbar(),l&&u._shortcutCommand(i,n))return t.preventDefault(),t.stopPropagation(),!1;const s=c.getSelectionNode(),r=c.getRange(),d=r.startContainer!==r.endContainer,g=c._resizingName;let p=a.getFormatElement(s)||s,m=a.getRangeFormatElement(p);switch(i){case 8:if(d)break;if(g){t.preventDefault(),t.stopPropagation(),c.plugins[g].destroy.call(c);break}if(a.isWysiwygDiv(s.parentNode)&&!s.previousSibling&&a.isFormatElement(s)&&!a.isListCell(s))return t.preventDefault(),t.stopPropagation(),s.innerHTML="
    ",!1;const u=r.commonAncestorContainer;if(0===r.startOffset&&0===r.endOffset){if(m&&p&&!a.isCell(m)&&!/^FIGCAPTION$/i.test(m.nodeName)){let e=!0,i=u;for(;i&&i!==m&&!a.isWysiwygDiv(i);){if(i.previousSibling){e=!1;break}i=i.parentNode}if(e&&m.parentNode){t.preventDefault(),c.detachRangeFormatElement(m,a.isListCell(p)?[p]:null,null,!1,!1);break}}if(a.isComponent(u.previousSibling)){const e=u.previousSibling;a.removeItem(e)}}break;case 46:if(g){t.preventDefault(),t.stopPropagation(),c.plugins[g].destroy.call(c);break}if((a.isFormatElement(s)||null===s.nextSibling)&&r.startOffset===s.textContent.length){let e=p.nextElementSibling;if(a.isComponent(e)){t.preventDefault(),a.onlyZeroWidthSpace(p)&&a.removeItem(p),(a.hasClass(e,"se-component")||/^IMG$/i.test(e.nodeName))&&(t.stopPropagation(),a.hasClass(e,"se-image-container")||/^IMG$/i.test(e.nodeName)?(e=/^IMG$/i.test(e.nodeName)?e:e.querySelector("img"),c.callPlugin("image",function(){const t=c.plugins.resizing.call_controller_resize.call(c,e,"image");c.plugins.image.onModifyMode.call(c,e,t),a.getParentElement(e,".se-component")||(c.plugins.image.openModify.call(c,!0),c.plugins.image.update_image.call(c,!0,!0))})):a.hasClass(e,"se-video-container")&&(t.stopPropagation(),c.callPlugin("video",function(){const t=e.querySelector("iframe"),i=c.plugins.resizing.call_controller_resize.call(c,t,"video");c.plugins.video.onModifyMode.call(c,t,i)})),c.history.push());break}}break;case 9:if(t.preventDefault(),l||o||a.isWysiwygDiv(s))break;c.controllersOff();let h=s;for(;!a.isCell(h)&&!a.isWysiwygDiv(h);)h=h.parentNode;if(h&&a.isCell(h)){const e=a.getParentElement(h,"table"),t=a.getListChildren(e,a.isCell);let i=n?a.prevIdx(t,h):a.nextIdx(t,h);i!==t.length||n||(i=0),-1===i&&n&&(i=t.length-1);const l=t[i];if(!l)return!1;c.setRange(l,0,l,0);break}const f=c.getSelectedElements();if(n)for(let e,t=0,i=f.length;t",n.parentNode.insertBefore(o,n),c.callPlugin(g,function(){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=a.getParentElement(p,a.isCell);if(t)return void e.onTableCellMultiSelect.call(c,t,!0)}}const f=!l&&!o&&1===t.key.length;if(!c._charCount(1,f)&&f)return t.preventDefault(),t.stopPropagation(),!1;h.onKeyDown&&h.onKeyDown(t)},onKeyUp_wysiwyg:function(e){c._editorRange();const t=e.keyCode;let i=c.getSelectionNode();if(c._isBalloon&&!c.getRange().collapsed)return void u._showToolbarBalloon();if(8===t&&a.isWysiwygDiv(i)&&""===i.textContent){e.preventDefault(),e.stopPropagation(),i.innerHTML="";const t=a.createElement(a.isFormatElement(c._variable.currentNodes[0])?c._variable.currentNodes[0]:"P");return t.innerHTML="
    ",i.appendChild(t),c.setRange(t,0,t,0),u._findButtonEffectTag(),void c._checkComponents()}const n=a.getFormatElement(i),l=a.getRangeFormatElement(i);if(n&&n!==l||(c.execCommand("formatBlock",!1,a.isRangeFormatElement(l)?"DIV":"P"),c.focus(),i=c.getSelectionNode()),u._directionKeyKeyCode.test(t)&&u._findButtonEffectTag(),c._checkComponents(),!c._charCount(1,1===e.key.length)&&1===e.key.length)return e.preventDefault(),e.stopPropagation(),!1;u._historyIgnoreKeycode.test(t)||c.history.push(),h.onKeyUp&&h.onKeyUp(e)},onScroll_wysiwyg:function(e){c.controllersOff(),h.onScroll&&h.onScroll(e)},onMouseDown_resizingBar:function(t){t.stopPropagation(),c._variable.resizeClientY=t.clientY,e.element.resizeBackground.style.display="block",l.addEventListener("mousemove",u._resize_editor),l.addEventListener("mouseup",function t(){e.element.resizeBackground.style.display="none",l.removeEventListener("mousemove",u._resize_editor),l.removeEventListener("mouseup",t)})},_resize_editor:function(t){const i=e.element.editorArea.offsetHeight+(t.clientY-c._variable.resizeClientY);e.element.wysiwyg.style.height=e.element.code.style.height=(i=i+o?(c._sticky||u._onStickyToolbar(t),t.toolbar.style.top=i+o+e.option.stickyToolbar-n-c._variable.minResizingSize+"px"):n>=o&&u._onStickyToolbar(t)},_getStickyOffsetTop:function(){let t=e.element.topArea,i=0;for(;t;)i+=t.offsetTop,t=t.offsetParent;return i},_onStickyToolbar:function(t){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",a.addClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!0},_offStickyToolbar:function(e){e._stickyDummy.style.display="none",e.toolbar.style.top=c._isInline?c._inlineToolbarAttr.top:"",e.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:"",e.editorArea.style.marginTop="",a.removeClass(e.toolbar,"se-toolbar-sticky"),c._sticky=!1},_codeViewAutoScroll:function(){e.element.code.style.height=e.element.code.scrollHeight+"px"},onPaste_wysiwyg:function(e){const t=e.clipboardData;if(!t)return!0;if(!c._charCount(t.getData("text/plain").length,!0))return e.preventDefault(),e.stopPropagation(),!1;const i=a.cleanHTML(t.getData("text/html"));i&&(e.stopPropagation(),e.preventDefault(),c.execCommand("insertHTML",!1,i))},onDrop_wysiwyg:function(t){const i=t.dataTransfer;if(!i)return!0;const n=i.files;if(n.length>0&&c.plugins.image)u._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=a.cleanHTML(i.getData("text/html"));e&&(u._setDropLocationSelection(t),c.execCommand("insertHTML",!1,e))}}h.onDrop&&h.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"),h.onChange&&h.onChange(c.getContents())}},h={onScroll:null,onClick:null,onKeyDown:null,onKeyUp:null,onDrop:null,onChange:null,onImageUpload:null,onImageUploadError:null,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=a.createElement("DIV");t.innerHTML=e,e=t.firstChild||t.content.firstChild}let t=null;(a.isFormatElement(e)||/^(IMG|IFRAME)$/i.test(e.nodeName))&&(t=a.getFormatElement(c.getSelectionNode())),c.insertNode(e,t),c.focus()},setContents:function(t){c._variable.wysiwygActive?e.element.wysiwyg.innerHTML=a.convertContentsForEditor(t):e.element.code.value=t,c.history.push()},appendContents:function(t){c._variable.wysiwygActive?e.element.wysiwyg.innerHTML+=a.convertContentsForEditor(t):e.element.code.value+=t,c.history.push()},disabled:function(){e.tool.cover.style.display="block",e.element.wysiwyg.setAttribute("contenteditable",!1),e.element.code.setAttribute("disabled","disabled")},enabled:function(){e.tool.cover.style.display="none",e.element.wysiwyg.setAttribute("contenteditable",!0),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(){o.removeEventListener("resize",u.onResize_window),o.removeEventListener("scroll",u.onScroll_window),a.removeItem(e.element.topArea),o.Object.keys(c).forEach(function(e){delete c[e]}),o.Object.keys(u).forEach(function(e){delete u[e]}),o.Object.keys(e).forEach(function(t){delete e[t]}),o.Object.keys(t).forEach(function(e){delete t[e]}),o.Object.keys(this).forEach(function(e){delete this[e]}.bind(this))}};return e.element.toolbar.addEventListener("mousedown",u.onMouseDown_toolbar,!1),e.element.toolbar.addEventListener("click",u.onClick_toolbar,!1),e.element.wysiwyg.addEventListener("mouseup",u.onMouseUp_wysiwyg,!1),e.element.wysiwyg.addEventListener("click",u.onClick_wysiwyg,!1),e.element.wysiwyg.addEventListener("scroll",u.onScroll_wysiwyg,!1),e.element.wysiwyg.addEventListener("keydown",u.onKeyDown_wysiwyg,!1),e.element.wysiwyg.addEventListener("keyup",u.onKeyUp_wysiwyg,!1),e.element.wysiwyg.addEventListener("paste",u.onPaste_wysiwyg,!1),e.element.wysiwyg.addEventListener("drop",u.onDrop_wysiwyg,!1),e.element.wysiwyg.addEventListener("dragover",function(e){e.preventDefault()},!1),c.plugins.table&&(e.element.wysiwyg.addEventListener("touchstart",u.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),e.element.wysiwyg.addEventListener("mousedown",u.onMouseDown_wysiwyg,!1)),"auto"===e.option.height&&e.element.code.addEventListener("keyup",u._codeViewAutoScroll,!1),e.element.resizingBar&&(/\d+/.test(e.option.height)?e.element.resizingBar.addEventListener("mousedown",u.onMouseDown_resizingBar,!1):a.addClass(e.element.resizingBar,"se-resizing-none")),c._isInline&&e.element.wysiwyg.addEventListener("focus",u._showToolbarInline,!1),(c._isInline||c._isBalloon)&&e.element.wysiwyg.addEventListener("blur",u._hideToolbar,!1),o.addEventListener("resize",u.onResize_window,!1),e.option.stickyToolbar>-1&&o.addEventListener("scroll",u.onScroll_window,!1),c.plugins.image&&e.element.wysiwyg.getElementsByTagName("IMG").length>0?o.setTimeout(function(){c.callPlugin("image",function(){const t=this.plugins.image.setImagesInfo,i=e.element.wysiwyg.getElementsByTagName("IMG");this.context.image._uploadFileLength=i.length;for(let e,n=0,l=i.length;n';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;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_menu"),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"),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),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.wysiwyg.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[this.context.resizing._resize_plugin],o=l._element,s=this.plugins[this.context.resizing._resize_plugin];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,o),s.setPercentSize.call(this,100*n+"%","auto"),s.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,this.context.resizing._resize_plugin));break;case"mirror":const e=o.getAttribute("data-rotate")||"0";let t=o.getAttribute("data-rotateX")||"",a=o.getAttribute("data-rotateY")||"";"h"===n&&!this.context.resizing._rotateVertical||"v"===n&&this.context.resizing._rotateVertical?a=a?"":"180":t=t?"":"180",o.setAttribute("data-rotateX",t),o.setAttribute("data-rotateY",a),this.plugins.resizing._setTransForm(o,e,t,a);break;case"rotate":const r=this.context.resizing,c=1*o.getAttribute("data-rotate")+1*n,d=this._w.Math.abs(c)>=360?0:c;o.setAttribute("data-rotate",d),r._rotateVertical=/^(90|270)$/.test(this._w.Math.abs(d).toString()),this.plugins.resizing.setTransformSize.call(this,o,null,null),s.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,r._resize_plugin));break;case"onalign":this.plugins.resizing.openAlignMenu.call(this);break;case"align":const u="basic"===n?"none":n;l._cover.style.margin=u&&"none"!==u?"auto":"0",this.util.removeClass(l._container,l._floatClassRegExp),this.util.addClass(l._container,"float-"+u),o.setAttribute("data-align",u),s.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,this.context.resizing._resize_plugin));break;case"revert":s.setAutoSize?s.setAutoSize.call(this):(s.resetAlign.call(this),this.plugins.resizing.resetTransform.call(this,o)),s.onModifyMode.call(this,o,this.plugins.resizing.call_controller_resize.call(this,o,this.context.resizing._resize_plugin));break;case"update":s.openModify.call(this),this.controllersOff();break;case"delete":s.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]+"px"||!1,e.style.height=t[1]+"px"||!1,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=""}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";const 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);this.plugins[this.context.resizing._resize_plugin].setSize.call(this,t,i,e),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.wysiwyg),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 e=0,t=n.length;e"}return l+=" ",i.innerHTML=l,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,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)));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>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)));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._d.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.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)));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._d.removeEventListener("touchmove",e._initBind),e._initBind=null),e._bindOnSelect&&(this._d.removeEventListener("mousedown",e._bindOnSelect),this._d.removeEventListener("mousemove",e._bindOnSelect),e._bindOnSelect=null),e._bindOffSelect&&(this._d.removeEventListener("mouseup",e._bindOffSelect),e._bindOffSelect=null),e._bindOffShift&&(this._d.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";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},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.focusElement.value,t=this.context.link.linkAnchorText,i=0===t.value.length?e:t.value;if(this.context.dialog.updateModal)this.context.link._linkAnchor.href=e,this.context.link._linkAnchor.textContent=i,this.context.link._linkAnchor.target=this.context.link.linkNewWindowCheck.checked?"_blank":"",this.history.push(),this.setRange(this.context.link._linkAnchor.childNodes[0],0,this.context.link._linkAnchor.childNodes[0],this.context.link._linkAnchor.textContent.length);else{const t=this.util.createElement("A");t.href=e,t.textContent=i,t.target=this.context.link.linkNewWindowCheck.checked?"_blank":"",this.insertNode(t),this.setRange(t.childNodes[0],0,t.childNodes[0],t.textContent.length)}this.context.link.focusElement.value="",this.context.link.linkAnchorText.value=""}.bind(this);try{t()}finally{this.plugins.dialog.close.call(this),this.closeLoading(),this.focus()}return!1},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);t.style.top=n.top+e.offsetHeight+10+"px",t.style.left=n.left-this.context.element.wysiwyg.scrollLeft+"px",t.style.display="block";const l=this.context.element.wysiwyg.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:"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='
    ';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,"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,"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)},setSize:function(e,t){const i=this.context.image;i._element.style.width=e+"px",i._element.style.height=t+"px"},setAutoSize:function(){const e=this.context.image;this.plugins.resizing.resetTransform.call(this,e._element),this.plugins.image.cancelPercentAttr.call(this),e._element.style.maxWidth="100%",e._element.style.width="100%",e._element.style.height="",e._cover.style.width="",e._cover.style.height=""},setPercentSize:function(e){const t=this.context.image;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,"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,"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
    ';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))},submit:function(e){this.showLoading(),e.preventDefault(),e.stopPropagation(),this.context.video._captionChecked=this.context.video.captionCheckEl.checked;const t=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++);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,"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()}.bind(this);try{t()}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(){const e=this.context.video;e.focusElement.value=e._element.src,e.videoWidth.value=e._element.offsetWidth,e.videoHeight.value=e._element.offsetHeight,e._captionChecked=e.captionCheckEl.checked=!!e._caption,e.modal.querySelector('input[name="suneditor_video_radio"][value="'+e._align+'"]').checked=!0,e._resizing&&(e.proportion.checked=e._proportionChecked="false"!==e._element.getAttribute("data-proportion"),e.proportion.disabled=!1),this.plugins.dialog.open.call(this,"video",!0)},checkVideos: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;nr&&(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"),t()}()},500)},undo:function(){r>0&&(r--,d())},redo:function(){c.length-1>r&&(r++,d())},reset:function(){c=c[r=0]}}};const c={_d:document,_w:window,_onlyZeroWidthRegExp:new RegExp("^"+String.fromCharCode(8203)+"+$"),_tagConvertor:function(e){const t={b:"strong",i:"em",var:"em",u:"ins",strike:"del",s:"del"};return e.replace(/(<\/?)(pre|blockquote|h[1-6]|ol|ul|dl|li|hr|b|strong|var|i|em|u|ins|s|strike|del|sub|sup)\b\s*(?:[^>^<]+)?\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={"&":"&"," ":" ","'":""","<":"<",">":">"};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"))},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))},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){let t=0,i=0,n=3===e.nodeType?e.parentElement:e;const l=this.getParentElement(e,this.isWysiwygDiv.bind(this));for(;n&&!this.hasClass(n,"se-container")&&n!==l;)t+=n.offsetLeft,i+=n.offsetTop,n=n.offsetParent;return{left:t,top:i-l.scrollTop}},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).children;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|data-file-size|data-file-name|data-origin|origin-size)\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-1?1*t.maxCharCount:null,t.charCounter=t.maxCharCount>0||"boolean"==typeof t.charCounter&&t.charCounter,t.popupDisplay=t.popupDisplay||"full",t.display=t.display||("none"!==e.style.display&&e.style.display?e.style.display:"block"),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||"",t.buttonList=t.buttonList||[["undo","redo"],["bold","underline","italic","strike","subscript","superscript"],["removeFormat"],["outdent","indent"],["fullScreen","showBlocks","codeView"],["preview","print"]];const l=document,o=l.createElement("DIV");o.className="sun-editor",e.id&&(o.id="suneditor_"+e.id),o.style.width=t.width,o.style.minWidth=t.minWidth,o.style.maxWidth=t.maxWidth,o.style.display=t.display;const s=l.createElement("DIV");s.className="se-container";const a=this._createToolBar(l,t.buttonList,n,i);let r=null;/inline/i.test(t.mode)?(a.element.className+=" se-toolbar-inline",a.element.style.width=t.toolbarWidth):/balloon/i.test(t.mode)&&(a.element.className+=" se-toolbar-balloon",(r=l.createElement("DIV")).className="se-arrow",a.element.appendChild(r));const c=l.createElement("DIV");c.className="se-toolbar-sticky-dummy";const u=l.createElement("DIV");u.className="se-wrapper";const h=l.createElement("DIV");h.setAttribute("contenteditable",!0),h.setAttribute("scrolling","auto"),h.className="se-wrapper-inner se-wrapper-wysiwyg sun-editor-editable",h.style.display="block",h.innerHTML=d.convertContentsForEditor(e.value),h.style.height=t.height,h.style.minHeight=t.minHeight,h.style.maxHeight=t.maxHeight;const g=l.createElement("TEXTAREA");g.className="se-wrapper-inner se-wrapper-code",g.style.display="none",g.style.height=t.height,g.style.minHeight=t.minHeight,g.style.maxHeight=t.maxHeight;let p=null,m=null,f=null;if(t.resizingBar&&((p=l.createElement("DIV")).className="se-resizing-bar sun-editor-common",(m=l.createElement("DIV")).className="se-navigation sun-editor-common",p.appendChild(m),t.charCounter)){const e=l.createElement("DIV");if(e.className="se-char-counter-wrapper",(f=l.createElement("SPAN")).className="se-char-counter",f.textContent="0",e.appendChild(f),t.maxCharCount>0){const i=l.createElement("SPAN");i.textContent=" / "+t.maxCharCount,e.appendChild(i)}p.appendChild(e)}const _=l.createElement("DIV");_.className="se-loading-box sun-editor-common",_.innerHTML='
    ';const b=l.createElement("DIV");return b.className="se-resizing-back",u.appendChild(h),u.appendChild(g),s.appendChild(a.element),s.appendChild(c),s.appendChild(u),s.appendChild(b),s.appendChild(_),p&&s.appendChild(p),o.appendChild(s),{constructed:{_top:o,_relative:s,_toolBar:a.element,_editorArea:u,_wysiwygArea:h,_codeArea:g,_resizingBar:p,_navigation:m,_charCounter:f,_loading:_,_resizeBack:b,_stickyDummy:c,_arrow:r},options:t,plugins:a.plugins,pluginCallButtons:a.pluginCallButtons}},_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",''],link:["",e.toolbar.link,"link","dialog",''],image:["",e.toolbar.image,"image","dialog",''],video:["",e.toolbar.video,"video","dialog",'']}},_createModuleGroup:function(e){const t=d.createElement("DIV");t.className="se-btn-module"+(e?"":" se-btn-module-border");const i=d.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=d.createElement("LI"),a=d.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;t0){for(let t=0;t":i),this.history.push()},focus:function(){if("none"===e.element.wysiwyg.style.display)return;const t=a.getParentElement(this.getSelectionNode(),"figcaption");t?t.focus():e.element.wysiwyg.focus(),this._editorRange(),u._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 s=l.createRange();s.setStart(e,t),s.setEnd(i,n);const a=o.getSelection();a.removeAllRanges&&a.removeAllRanges(),a.addRange(s),this._editorRange()},getRange:function(){return this._variable._range||this._createDefaultRange()},getSelectionNode:function(){return this._variable._selectionNode||e.element.wysiwyg.firstChild},_editorRange:function(){const e=o.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=l.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(a.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=a.getListChildren(o,function(e){return t?t(e):a.isFormatElement(e)});if(a.isWysiwygDiv(o)||a.isRangeFormatElement(o)||s.unshift(a.getFormatElement(o)),n===l||1===s.length)return s;let r=a.getFormatElement(n),c=a.getFormatElement(l),d=null,u=null;const h=function(e){return!a.isTable(e)||/^TABLE$/i.test(e.nodeName)},g=a.getRangeFormatElement(r,h),p=a.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?a.removeItem(o):o!==t?o!==n?(a.removeItem(o),this.history.push()):(r=1===n.nodeType?a.createTextNode(n.textContent):a.createTextNode(n.substringData(l,n.length-l))).length>0?n.data=r.data:a.removeItem(n):(s=1===t.nodeType?a.createTextNode(t.textContent):a.createTextNode(t.substringData(0,i))).length>0?t.data=s.data:a.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=a.isRangeFormatElement(o)||a.isFormatElement(o)?o:a.getRangeFormatElement(o)||a.getFormatElement(o),a.isCell(i)?(n=null,l=i):(n=i.nextSibling,l=i.parentNode);let s=a.getElementDepth(i),r=null;const c=[],d=function(e,t,i){let n=null;return e===t||a.isTable(t)||(n=a.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(r),r=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,r=o.endOffset,c=e.children,d=e.parentNode;let h=null,g=null,p=e.cloneNode(!1);const m=a.isList(i);let f=!1;function _(e,t,i){a.onlyZeroWidthSpace(t)&&(t.innerHTML=a.zeroWidthSpace);const n=t.childNodes;let l=t.cloneNode(!1),o=null,s=null;for(;n[0];)s=n[0],a.isIgnoreNodeChange(s)&&!a.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&&(d.insertBefore(p,e),p=null),!m&&a.isListCell(l)){const t=l.innerHTML;(l=a.isCell(e.parentNode)?a.createElement("DIV"):a.createElement("P")).innerHTML=t}else l=l.cloneNode(!0);n||(i?(f||(d.insertBefore(i,e),f=!0),l=_(i,l,null)):l=_(d,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),a.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,r):this.setRange(v.sc,0,v.sc,0)),u._findButtonEffectTag()},nodeChange:function(t,i,n){const l=this.getRange();i=!!(i&&i.length>0)&&i,n=!!(n&&n.length>0)&&n,this._editorRange();const s=!t,r=s&&!n&&!i;let c,d,u,h=l.startContainer,g=l.startOffset,p=l.endContainer,m=l.endOffset;if(r&&l.collapsed&&a.isFormatElement(h.parentNode)&&a.isFormatElement(p.parentNode))return;if(s&&(t=this.util.createElement("DIV")),!r&&h===p){let e=h;if(r){if(a.getFormatElement(e)===e.parentNode)return}else if(i.length>0){let n=0;for(let l=0;l=i.length)return;if(s&&0===n)return}}if(c=a.isWysiwygDiv(h)?e.element.wysiwyg.firstChild:h,d=g,a.isBreak(c)||1===c.nodeType&&c.childNodes.length>0){const e=a.isBreak(c);if(!e){for(;c&&!a.isBreak(c)&&1===c.nodeType;)c=c.childNodes[d]||c.nextElementSibling||c.nextSibling,d=0;let e=a.getFormatElement(c);e===a.getRangeFormatElement(e)&&(e=a.createElement(a.isCell(c)?"DIV":"P"),c.parentNode.insertBefore(e,c),e.appendChild(c))}if(a.isBreak(c)){const t=a.createTextNode(a.zeroWidthSpace);c.parentNode.insertBefore(t,c),c=t,e&&(h===p&&(p=c,m=1),a.removeItem(h))}}if(h=c,g=d,c=a.isWysiwygDiv(p)?e.element.wysiwyg.lastChild:p,d=m,a.isBreak(c)||1===c.nodeType&&c.childNodes.length>0){const e=a.isBreak(c);if(!e){for(;c&&!a.isBreak(c)&&1===c.nodeType;)d=(c=(u=c.childNodes)[d-1]||!/FIGURE/i.test(u[0].nodeName)?u[0]:c.previousElementSibling||c.previousSibling||h).textContent.length;let e=a.getFormatElement(c);e===a.getRangeFormatElement(e)&&(e=a.createElement(a.isCell(e)?"DIV":"P"),c.parentNode.insertBefore(e,c),e.appendChild(c))}if(a.isBreak(c)){const t=a.createTextNode(a.zeroWidthSpace);c.parentNode.insertBefore(t,c),c=t,d=0,e&&a.removeItem(p)}}p=c,m=d;const f=t.nodeName;this.setRange(h,g,p,m);let _,b,y,v={},x={};if(i){b="(?:;|^|\\s)(?:"+i[0];for(let e=1;e0&&(i=t.replace(b,"").trim()),s){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();a.getFormatElement(h)||(h=a.getChildElement(w[0],function(e){return 3===e.nodeType}),g=0),a.getFormatElement(p)||(m=(p=a.getChildElement(w[w.length-1],function(e){return 3===e.nodeType})).textContent.length);const k=a.getFormatElement(h)===a.getFormatElement(p),E=w.length-(k?0:1);if(_=t.cloneNode(!1),k){const e=this._nodeChange_oneLine(w[0],_,C,h,g,p,m,r,s,l.collapsed);v.container=e.startContainer,v.offset=e.startOffset,x.container=e.endContainer,x.offset=e.endOffset}else v=this._nodeChange_startLine(w[0],_,C,h,g,r,s);for(let e=1;e0&&!k?(_=t.cloneNode(!1),x=this._nodeChange_endLine(w[E],_,C,p,m,r,s)):k||(x=v),this.setRange(v.container,v.offset,x.container,x.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,s,r,c,d,u){const h=e,g=t,p=[t],m=e.cloneNode(!1),f=n===s;let _,b,y,v,x=n,C=l,w=s,k=r,E=!1,S=!1;function N(e){const t=new o.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=C?k-C:x.data.length-C));for(e.data.length>0&&l.appendChild(e),b=s,_=[],v="";b!==m&&b!==h&&null!==b;)i(b)&&1===b.nodeType&&N(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),x=n,C=0,E=!0,b!==n&&b.appendChild(x),!f)continue;if(r===C||r===n.data.length){w=n,k=n.data.length,S=!0;continue}}if(S||s!==w){if(E){if(1===s.nodeType&&!a.isBreak(s)){a.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&&!a.isBreak(s)&&(S||i(b))&&N(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)}d=s.cloneNode(!1),l.appendChild(d),1!==s.nodeType||a.isBreak(s)||(g=d),e(s,g)}else{const e=a.createTextNode(1===w.nodeType?"":w.substringData(k,w.length-k)),n=a.createTextNode(f||1===w.nodeType?"":w.substringData(0,k));if(e.data.length>0){for(b=s,v="",_=[];b!==m&&b!==h&&null!==b;)1===b.nodeType&&N(b)&&(_.push(b.cloneNode(!1)),v+=b.style.cssText.substr(0,b.style.cssText.indexOf(":"))+"|"),b=b.parentNode;for(d=y=b=_.pop()||e;_.length>0;)b=_.pop(),y.appendChild(b),y=b;m.appendChild(d),b.textContent=e.data}for(b=s,_=[],v="";b!==m&&b!==h&&null!==b;)i(b)&&1===b.nodeType&&N(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,k=n.data.length,S=!0,!c&&u&&(t=n,n.textContent=a.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||a.isBreak(s)||(_=e)}e(s,_)}else{const e=a.createTextNode(1===p.nodeType?"":p.substringData(0,m)),n=a.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,a.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||a.isBreak(s)||(_=e)}e(s,_)}else{const e=a.createTextNode(1===p.nodeType?"":p.substringData(m,p.length-m)),n=a.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,a.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"),this._variable.wysiwygActive=!1,e.element.code.focus();else{const t=e.element.code.value.trim();e.element.wysiwyg.innerHTML=t.length>0?a.convertContentsForEditor(t):"


    ",e.element.wysiwyg.scrollTop=0,e.element.code.style.display="none",e.element.wysiwyg.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.element.code.style.height="0px"),this._variable.wysiwygActive=!0,this.focus()}},toggleFullScreen:function(t){const i=e.element.topArea,n=e.element.toolbar,s=e.element.editorArea,r=e.element.wysiwyg,c=e.element.code;this._variable.isFullScreen?(this._variable.isFullScreen=!1,r.style.cssText=this._variable._wysiwygOriginCssText,c.style.cssText=this._variable._codeOriginCssText,n.style.cssText="",s.style.cssText=this._variable._editorAreaOriginCssText,i.style.cssText=this._variable._originCssText,l.body.style.overflow=this._variable._bodyOverflow,e.option.stickyToolbar>-1&&(a.removeClass(n,"se-toolbar-sticky"),u.onScroll_window()),this._variable._fullScreenSticky&&(this._variable._fullScreenSticky=!1,e.element._stickyDummy.style.display="block",a.addClass(n,"se-toolbar-sticky")),a.removeClass(t.firstElementChild,"se-icon-reduction"),a.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",a.removeClass(n,"se-toolbar-sticky")),this._variable._bodyOverflow=l.body.style.overflow,l.body.style.overflow="hidden",this._variable._editorAreaOriginCssText=s.style.cssText,this._variable._wysiwygOriginCssText=r.style.cssText,this._variable._codeOriginCssText=c.style.cssText,s.style.cssText=n.style.cssText="",r.style.cssText=r.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=r.style.height=c.style.height="100%",n.style.position="relative",this._variable.innerHeight_fullScreen=o.innerHeight-n.offsetHeight,s.style.height=this._variable.innerHeight_fullScreen+"px",a.removeClass(t.firstElementChild,"se-icon-expansion"),a.addClass(t.firstElementChild,"se-icon-reduction"))},print:function(){const e=a.createElement("IFRAME");e.style.display="none";const t=a.createElement("DIV"),i=a.createElement("STYLE");i.innerHTML=a.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!==o.navigator.userAgent.indexOf("MSIE")||l.documentMode||o.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{a.removeItem(e)}},preview:function(){const e=a.getPageStyle(),t=this.getContents(),i=o.open("","_blank");i.mimeType="text/html",i.document.write(''+n.toolbar.preview+"
    '+t+"
    ")},getContents:function(){let t="";t=c._variable.wysiwygActive?e.element.wysiwyg.innerHTML:a.convertContentsForEditor(e.element.code.value);const i=a.createElement("DIV");i.innerHTML=t;const n=a.getListChildren(i,function(e){return/FIGCAPTION/i.test(e.nodeName)});for(let e=0,t=n.length;e0){let s=!1;const r=e.element.wysiwyg.textContent.length;if(r>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),s=!0}else r+t>l&&(s=!0);if(s)return i&&!a.hasClass(n,"se-blink")&&(a.addClass(n,"se-blink"),o.setTimeout(function(){a.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.checkVideos.call(this):this.callPlugin("video",this.plugins.video.checkVideos.bind(this)))}},u={_directionKeyKeyCode:new o.RegExp("^(8|13|32|46|33|34|35|36|37|38|39|40|46|98|100|102|104)$"),_historyIgnoreKeycode:new o.RegExp("^(9|1[6-8]|20|3[3-9]|40|45|11[2-9]|12[0-3]|144|145)$"),_onButtonsCheck:new o.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(u._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,r=!0,d=!0,u=!0,h=!0,g=!0,p=!0,m="";for(let f=c.getSelectionNode();!a.isWysiwygDiv(f)&&f;f=f.parentNode)if(1===f.nodeType&&!a.isBreak(f))if(m=f.nodeName.toUpperCase(),o.push(m),a.isFormatElement(f)){s&&t.FORMAT&&(l.push("FORMAT"),a.changeTxt(t.FORMAT,m),t.FORMAT.setAttribute("data-focus",m),s=!1);const e=f.style.textAlign;r&&e&&t.ALIGN&&(l.push("ALIGN"),t.ALIGN.className="se-icon-align-"+e,t.ALIGN.setAttribute("data-focus",e),r=!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&&a.isList(m)&&t.LI&&(l.push("LI"),t.LI.setAttribute("data-focus",m),/UL/i.test(m)?(a.removeClass(t.LI_ICON,"se-icon-list-number"),a.addClass(t.LI_ICON,"se-icon-list-bullets")):(a.removeClass(t.LI_ICON,"se-icon-list-bullets"),a.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,"");a.changeTxt(t.FONT,e),a.changeTxt(t.FONT_TOOLTIP,e),u=!1}h&&f.style.fontSize.length>0&&t.SIZE&&(l.push("SIZE"),a.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)?(a.changeTxt(t.FONT,n.toolbar.font),a.changeTxt(t.FONT_TOOLTIP,n.toolbar.font)):t.SIZE&&/^SIZE$/i.test(e)?a.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&&a.isListCell(e)?(t.LI.removeAttribute("data-focus"),a.removeClass(t.LI_ICON,"se-icon-list-bullets"),a.addClass(t.LI_ICON,"se-icon-list-number"),a.removeClass(t.LI,"active")):a.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",u._cancelCaptionEdit)},onMouseDown_toolbar:function(e){let t=e.target;if(a.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){const t=a.getParentElement(e.target,a.isCell);if(!t)return;const i=c.plugins.table;t===i._fixedCell||i._shift||c.callPlugin("table",function(){i.onTableCellMultiSelect.call(c,t,!1)})},onMouseUp_wysiwyg:function(){if("false"!==e.element.wysiwyg.getAttribute("contenteditable")&&(c._editorRange(),c._isBalloon)){const e=c.getRange();e.collapsed?u._hideToolbar():u._showToolbarBalloon(e)}},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("false"!==i.getAttribute("contenteditable")&&c.callPlugin("image",function(){const t=c.plugins.resizing.call_controller_resize.call(c,e,"image");c.plugins.image.onModifyMode.call(c,e,t),a.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=a.getParentElement(i,"FIGCAPTION");if(n&&"ture"!==n.getAttribute("contenteditable")&&(t.preventDefault(),n.setAttribute("contenteditable",!0),n.focus(),c._isInline&&!c._inlineToolbarAttr.isShow)){u._showToolbarInline();const e=function(){u._hideToolbar(),n.removeEventListener("blur",e)};n.addEventListener("blur",e)}const l=a.getFormatElement(c.getSelectionNode()),o=a.getRangeFormatElement(c.getSelectionNode());if(c.getRange().collapsed&&(!l||l===o)&&"false"!==i.getAttribute("contenteditable"))return c.execCommand("formatBlock",!1,a.isRangeFormatElement(o)?"DIV":"P"),void c.focus();u._findButtonEffectTag(),h.onClick&&h.onClick(t)},_showToolbarBalloon:function(t){const i=t||c.getRange(),n=e.element.toolbar,s=o.getSelection();let r;if(s.focusNode===s.anchorNode)r=s.focusOffset=h?b-y:b-(r?0:20));e.element._arrow.style.left=(v+11>n.offsetWidth?n.offsetWidth-11:v)+"px"},_showToolbarInline:function(){const t=e.element.toolbar;t.style.display="block",c._inlineToolbarAttr.width=t.style.width=e.option.toolbarWidth,c._inlineToolbarAttr.top=t.style.top=-1-t.offsetHeight+"px",u.onScroll_window(),c._inlineToolbarAttr.isShow=!0},_hideToolbar:function(){c._notHideToolbar||(e.element.toolbar.style.display="none",c._inlineToolbarAttr.isShow=!1),c._notHideToolbar=!1},onKeyDown_wysiwyg:function(t){const i=t.keyCode,n=t.shiftKey,l=t.ctrlKey||t.metaKey,o=t.altKey;if(c._isBalloon&&u._hideToolbar(),l&&u._shortcutCommand(i,n))return t.preventDefault(),t.stopPropagation(),!1;const s=c.getSelectionNode(),r=c.getRange(),d=r.startContainer!==r.endContainer,g=c._resizingName;let p=a.getFormatElement(s)||s,m=a.getRangeFormatElement(p);switch(i){case 8:if(d)break;if(g){t.preventDefault(),t.stopPropagation(),c.plugins[g].destroy.call(c);break}if(a.isWysiwygDiv(s.parentNode)&&!s.previousSibling&&a.isFormatElement(s)&&!a.isListCell(s))return t.preventDefault(),t.stopPropagation(),s.innerHTML="
    ",!1;const u=r.commonAncestorContainer;if(0===r.startOffset&&0===r.endOffset){if(m&&p&&!a.isCell(m)&&!/^FIGCAPTION$/i.test(m.nodeName)){let e=!0,i=u;for(;i&&i!==m&&!a.isWysiwygDiv(i);){if(i.previousSibling){e=!1;break}i=i.parentNode}if(e&&m.parentNode){t.preventDefault(),c.detachRangeFormatElement(m,a.isListCell(p)?[p]:null,null,!1,!1);break}}if(a.isComponent(u.previousSibling)){const e=u.previousSibling;a.removeItem(e)}}break;case 46:if(g){t.preventDefault(),t.stopPropagation(),c.plugins[g].destroy.call(c);break}if((a.isFormatElement(s)||null===s.nextSibling)&&r.startOffset===s.textContent.length){let e=p.nextElementSibling;if(a.isComponent(e)){t.preventDefault(),a.onlyZeroWidthSpace(p)&&a.removeItem(p),(a.hasClass(e,"se-component")||/^IMG$/i.test(e.nodeName))&&(t.stopPropagation(),a.hasClass(e,"se-image-container")||/^IMG$/i.test(e.nodeName)?(e=/^IMG$/i.test(e.nodeName)?e:e.querySelector("img"),c.callPlugin("image",function(){const t=c.plugins.resizing.call_controller_resize.call(c,e,"image");c.plugins.image.onModifyMode.call(c,e,t),a.getParentElement(e,".se-component")||(c.plugins.image.openModify.call(c,!0),c.plugins.image.update_image.call(c,!0,!0))})):a.hasClass(e,"se-video-container")&&(t.stopPropagation(),c.callPlugin("video",function(){const t=e.querySelector("iframe"),i=c.plugins.resizing.call_controller_resize.call(c,t,"video");c.plugins.video.onModifyMode.call(c,t,i)})),c.history.push());break}}break;case 9:if(t.preventDefault(),l||o||a.isWysiwygDiv(s))break;c.controllersOff();let h=s;for(;!a.isCell(h)&&!a.isWysiwygDiv(h);)h=h.parentNode;if(h&&a.isCell(h)){const e=a.getParentElement(h,"table"),t=a.getListChildren(e,a.isCell);let i=n?a.prevIdx(t,h):a.nextIdx(t,h);i!==t.length||n||(i=0),-1===i&&n&&(i=t.length-1);const l=t[i];if(!l)return!1;c.setRange(l,0,l,0);break}const f=c.getSelectedElements();if(n)for(let e,t=0,i=f.length;t",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=a.getParentElement(p,a.isCell);if(t)return void e.onTableCellMultiSelect.call(c,t,!0)}}const f=!l&&!o&&1===t.key.length;if(!c._charCount(1,f)&&f)return t.preventDefault(),t.stopPropagation(),!1;h.onKeyDown&&h.onKeyDown(t)},onKeyUp_wysiwyg:function(e){c._editorRange();const t=e.keyCode;let i=c.getSelectionNode();if(c._isBalloon&&!c.getRange().collapsed)return void u._showToolbarBalloon();if(8===t&&a.isWysiwygDiv(i)&&""===i.textContent){e.preventDefault(),e.stopPropagation(),i.innerHTML="";const t=a.createElement(a.isFormatElement(c._variable.currentNodes[0])?c._variable.currentNodes[0]:"P");return t.innerHTML="
    ",i.appendChild(t),c.setRange(t,0,t,0),u._findButtonEffectTag(),void c._checkComponents()}const n=a.getFormatElement(i),l=a.getRangeFormatElement(i);if(n&&n!==l||(c.execCommand("formatBlock",!1,a.isRangeFormatElement(l)?"DIV":"P"),c.focus(),i=c.getSelectionNode()),u._directionKeyKeyCode.test(t)&&u._findButtonEffectTag(),c._checkComponents(),!c._charCount(1,1===e.key.length)&&1===e.key.length)return e.preventDefault(),e.stopPropagation(),!1;u._historyIgnoreKeycode.test(t)||c.history.push(),h.onKeyUp&&h.onKeyUp(e)},onScroll_wysiwyg:function(e){c.controllersOff(),h.onScroll&&h.onScroll(e)},onMouseDown_resizingBar:function(t){t.stopPropagation(),c._variable.resizeClientY=t.clientY,e.element.resizeBackground.style.display="block",l.addEventListener("mousemove",u._resize_editor),l.addEventListener("mouseup",function t(){e.element.resizeBackground.style.display="none",l.removeEventListener("mousemove",u._resize_editor),l.removeEventListener("mouseup",t)})},_resize_editor:function(t){const i=e.element.editorArea.offsetHeight+(t.clientY-c._variable.resizeClientY);e.element.wysiwyg.style.height=e.element.code.style.height=(i=i+o?(c._sticky||u._onStickyToolbar(t),t.toolbar.style.top=i+o+e.option.stickyToolbar-n-c._variable.minResizingSize+"px"):n>=o&&u._onStickyToolbar(t)},_getStickyOffsetTop:function(){let t=e.element.topArea,i=0;for(;t;)i+=t.offsetTop,t=t.offsetParent;return i},_onStickyToolbar:function(t){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",a.addClass(t.toolbar,"se-toolbar-sticky"),c._sticky=!0},_offStickyToolbar:function(e){e._stickyDummy.style.display="none",e.toolbar.style.top=c._isInline?c._inlineToolbarAttr.top:"",e.toolbar.style.width=c._isInline?c._inlineToolbarAttr.width:"",e.editorArea.style.marginTop="",a.removeClass(e.toolbar,"se-toolbar-sticky"),c._sticky=!1},_codeViewAutoScroll:function(){e.element.code.style.height=e.element.code.scrollHeight+"px"},onPaste_wysiwyg:function(e){const t=e.clipboardData;if(!t)return!0;if(!c._charCount(t.getData("text/plain").length,!0))return e.preventDefault(),e.stopPropagation(),!1;const i=a.cleanHTML(t.getData("text/html"));i&&(e.stopPropagation(),e.preventDefault(),c.execCommand("insertHTML",!1,i))},onDrop_wysiwyg:function(t){const i=t.dataTransfer;if(!i)return!0;const n=i.files;if(n.length>0&&c.plugins.image)u._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=a.cleanHTML(i.getData("text/html"));e&&(u._setDropLocationSelection(t),c.execCommand("insertHTML",!1,e))}}h.onDrop&&h.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"),h.onChange&&h.onChange(c.getContents())}},h={onScroll:null,onClick:null,onKeyDown:null,onKeyUp:null,onDrop:null,onChange:null,onImageUpload:null,onImageUploadError:null,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=a.createElement("DIV");t.innerHTML=e,e=t.firstChild||t.content.firstChild}let t=null;(a.isFormatElement(e)||/^(IMG|IFRAME)$/i.test(e.nodeName))&&(t=a.getFormatElement(c.getSelectionNode())),c.insertNode(e,t),c.focus()},setContents:function(t){c._variable.wysiwygActive?e.element.wysiwyg.innerHTML=a.convertContentsForEditor(t):e.element.code.value=t,c.history.push()},appendContents:function(t){c._variable.wysiwygActive?e.element.wysiwyg.innerHTML+=a.convertContentsForEditor(t):e.element.code.value+=t,c.history.push()},disabled:function(){e.tool.cover.style.display="block",e.element.wysiwyg.setAttribute("contenteditable",!1),e.element.code.setAttribute("disabled","disabled")},enabled:function(){e.tool.cover.style.display="none",e.element.wysiwyg.setAttribute("contenteditable",!0),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(){o.removeEventListener("resize",u.onResize_window),o.removeEventListener("scroll",u.onScroll_window),a.removeItem(e.element.topArea),o.Object.keys(c).forEach(function(e){delete c[e]}),o.Object.keys(u).forEach(function(e){delete u[e]}),o.Object.keys(e).forEach(function(t){delete e[t]}),o.Object.keys(t).forEach(function(e){delete t[e]}),o.Object.keys(this).forEach(function(e){delete this[e]}.bind(this))}};return e.element.toolbar.addEventListener("mousedown",u.onMouseDown_toolbar,!1),e.element.toolbar.addEventListener("click",u.onClick_toolbar,!1),e.element.wysiwyg.addEventListener("mouseup",u.onMouseUp_wysiwyg,!1),e.element.wysiwyg.addEventListener("click",u.onClick_wysiwyg,!1),e.element.wysiwyg.addEventListener("scroll",u.onScroll_wysiwyg,!1),e.element.wysiwyg.addEventListener("keydown",u.onKeyDown_wysiwyg,!1),e.element.wysiwyg.addEventListener("keyup",u.onKeyUp_wysiwyg,!1),e.element.wysiwyg.addEventListener("paste",u.onPaste_wysiwyg,!1),e.element.wysiwyg.addEventListener("drop",u.onDrop_wysiwyg,!1),e.element.wysiwyg.addEventListener("dragover",function(e){e.preventDefault()},!1),c.plugins.table&&(e.element.wysiwyg.addEventListener("touchstart",u.onMouseDown_wysiwyg,{passive:!0,useCapture:!1}),e.element.wysiwyg.addEventListener("mousedown",u.onMouseDown_wysiwyg,!1)),"auto"===e.option.height&&e.element.code.addEventListener("keyup",u._codeViewAutoScroll,!1),e.element.resizingBar&&(/\d+/.test(e.option.height)?e.element.resizingBar.addEventListener("mousedown",u.onMouseDown_resizingBar,!1):a.addClass(e.element.resizingBar,"se-resizing-none")),c._isInline&&e.element.wysiwyg.addEventListener("focus",u._showToolbarInline,!1),(c._isInline||c._isBalloon)&&e.element.wysiwyg.addEventListener("blur",u._hideToolbar,!1),o.addEventListener("resize",u.onResize_window,!1),e.option.stickyToolbar>-1&&o.addEventListener("scroll",u.onScroll_window,!1),c.plugins.image&&e.element.wysiwyg.getElementsByTagName("IMG").length>0?o.setTimeout(function(){c.callPlugin("image",function(){const t=this.plugins.image.setImagesInfo,i=e.element.wysiwyg.getElementsByTagName("IMG");this.context.image._uploadFileLength=i.length;for(let e,n=0,l=i.length;n