7 lines
40 KiB
JavaScript
7 lines
40 KiB
JavaScript
/*!
|
||
* tui-editor
|
||
* @version 1.3.3
|
||
* @author NHN Ent. FE Development Lab <dl_javascript@nhnent.com> (https://nhnent.github.io/tui.editor/)
|
||
* @license MIT
|
||
*/
|
||
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("jquery"),require("tui-code-snippet"),function(){try{return require("tui-editor")}catch(e){}}(),function(){try{return require("tui-editor/dist/tui-editor-Viewer")}catch(e){}}(),require("to-mark"));else if("function"==typeof define&&define.amd)define(["jquery","tui-code-snippet","tui-editor","tui-editor/dist/tui-editor-Viewer","to-mark"],t);else{var n="object"==typeof exports?t(require("jquery"),require("tui-code-snippet"),function(){try{return require("tui-editor")}catch(e){}}(),function(){try{return require("tui-editor/dist/tui-editor-Viewer")}catch(e){}}(),require("to-mark")):t(e.$,e.tui&&e.tui.util,e.tui&&e.tui.Editor,e.tui&&e.tui.Editor,e.toMark);for(var a in n)("object"==typeof exports?exports:e)[a]=n[a]}}("undefined"!=typeof self?self:this,function(e,t,n,a,r){return function(e){function t(a){if(n[a])return n[a].exports;var r=n[a]={i:a,l:!1,exports:{}};return e[a].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,a){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:a})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="dist/",t(t.s=49)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=void 0;try{a=n(4)}catch(e){}if(!a)try{a=n(5)}catch(e){}t.default=a},function(e,n){e.exports=t},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){var a=(0,w.default)(e),r=a.attr("colspan"),l=a.attr("rowspan"),o=e.nodeName;if("TH"!==o&&"TD"!==o)return null;var c={nodeName:e.nodeName,colspan:r?parseInt(r,10):1,rowspan:l?parseInt(l,10):1,content:a.html(),elementIndex:{rowIndex:t,colIndex:n}};return"TH"===e.nodeName&&e.align&&(c.align=e.align),c}function l(e,t,n,a){var r=t.colspan,l=t.rowspan,o=t.nodeName,c=r>1,i=l>1;if(c||i){var d=n+l,u=a+r;y.default.range(n,d).forEach(function(t){e[t]=e[t]||[],y.default.range(a,u).forEach(function(r){var l={nodeName:o};t===n&&r===a||(c&&(l.colMergeWith=a),i&&(l.rowMergeWith=n),e[t][r]=l)})})}}function o(e){var t=[];return e.find("tr").each(function(e,n){var a=0;t[e]=t[e]||[],(0,w.default)(n).children().each(function(n,o){var c=r(o,e,n);if(c){for(var i=n+a;t[e][i];)i+=1,a+=1;t[e][i]=c,l(t,c,e,i)}})}),e[0].className&&(t.className=e[0].className),t}function c(e){var t=[];return e.forEach(function(e,n){var a=[];e.forEach(function(e,t){y.default.isUndefined(e.colMergeWith)&&y.default.isUndefined(e.rowMergeWith)&&a.push({rowIndex:n,colIndex:t})}),t.push(a)}),t}function i(e){var t=e[0];return t.map(function(e){return y.default.isExisty(e.colMergeWith)?t[e.colMergeWith].align:e.align})}function d(e,t){var n=i(e),a=t.map(function(t){return t.map(function(t){var a=t.rowIndex,r=t.colIndex;return y.default.extend({align:n[r]},e[a][r])})});return e.className&&(a.className=e.className),a}function u(e,t,n){return{nodeName:n||"TD",colspan:1,rowspan:1,content:C,elementIndex:{rowIndex:e,colIndex:t}}}function f(e){var t=e.closest("tr"),n=t.prevAll().length;return"TBODY"===t.parent()[0].nodeName&&(n+=1),n}function s(e){return e.closest("td, th").prevAll().length}function g(e,t){var n=f(t),a=s(t);return e[n][a]}function p(e,t,n){var a=e[t][n],r=t;return a.rowspan>1&&(r+=a.rowspan-1),r}function h(e,t,n){var a=e[t][n],r=n;return a.colspan>1&&(r+=a.colspan-1),r}function m(e,t,n){var a=e[t][n];return t=y.default.isExisty(a.rowMergeWith)?a.rowMergeWith:t,n=y.default.isExisty(a.colMergeWith)?a.colMergeWith:n,e[t][n].elementIndex}function v(e,t){e.forEach(function(e,n){var a=e.length;if(a){var r=e[0].nodeName;y.default.range(a,t).forEach(function(t){e.push(u(n,t,r))})}})}function b(e){var t=e[0],n=t.length,a=!0;if(!n&&e[1])y.default.range(0,e[1].length).forEach(function(e){t.push(u(0,e,"TH"))});else if("TH"!==e[0][0].nodeName){var r,l=y.default.range(0,n).map(function(e){return u(0,e,"TH")});(r=[]).concat.apply(r,e).forEach(function(e){e.elementIndex&&(e.elementIndex.rowIndex+=1)}),e.unshift(l)}else if(1===e.length){var o=y.default.range(0,n).map(function(e){return u(1,e,"TD")});e.push(o)}else a=!1;return a}Object.defineProperty(t,"__esModule",{value:!0}),t.createTableData=o,t.createCellIndexData=c;var x=n(0),w=a(x),I=n(2),y=a(I),C=y.default.browser.msie?"":"<br>";t.default={createTableData:o,createCellIndexData:c,createRenderData:d,findElementRowIndex:f,findElementColIndex:s,findCellIndex:g,createBasicCell:u,findRowMergedLastIndex:p,findColMergedLastIndex:h,findElementIndex:m,stuffCellsIntoIncompleteRow:v,addTbodyOrTheadIfNeed:b}},function(e,t){if(void 0===n){var a=new Error('Cannot find module "undefined"');throw a.code="MODULE_NOT_FOUND",a}e.exports=n},function(e,t){if(void 0===a){var n=new Error('Cannot find module "undefined"');throw n.code="MODULE_NOT_FOUND",n}e.exports=a},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=e.colspan>1?' colspan="'+e.colspan+'"':"";return t+=e.rowspan>1?' rowspan="'+e.rowspan+'"':"",t+=e.align?' align="'+e.align+'"':"","<"+e.nodeName+t+">"+e.content+"</"+e.nodeName+">"}function l(e,t){var n="";return e.length&&(n=e.map(function(e){return"<tr>"+e.map(r).join("")+"</tr>"}).join(""),n="<"+t+">"+n+"</"+t+">"),n}function o(e){var t=[e[0]],n=e.slice(1),a=l(t,"THEAD"),r=l(n,"TBODY");return"<table"+(e.className?' class="'+e.className+'"':"")+">"+(a+r)+"</renderData>"}function c(e,t){var n=s.default.createCellIndexData(t),a=s.default.createRenderData(t,n),r=(0,u.default)(o(a));return e.replaceWith(r),r}function i(e,t,n){t.selectNodeContents(n),t.collapse(!0),e.setSelection(t)}Object.defineProperty(t,"__esModule",{value:!0});var d=n(0),u=a(d),f=n(3),s=a(f);t.default={createTableHtml:o,replaceTable:c,focusToCell:i}},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){var a=h.default.createCellIndexData(e),r=h.default.findCellIndex(a,t),l=h.default.findCellIndex(a,n),o=void 0,c=void 0,i=void 0,d=void 0;return r.rowIndex>l.rowIndex?(o=l.rowIndex,c=r.rowIndex):(o=r.rowIndex,c=l.rowIndex),r.colIndex>l.colIndex?(i=l.colIndex,d=r.colIndex):(i=r.colIndex,d=l.colIndex),{start:{rowIndex:o,colIndex:i},end:{rowIndex:c,colIndex:d}}}function l(e,t,n){var a=t[n].rowIndex,r=e[a];g.default.range(t.start.colIndex,t.end.colIndex+1).forEach(function(n){var l=r[n],o=l.rowMergeWith,c=-1;g.default.isExisty(o)?(o<t.start.rowIndex&&(t.start.rowIndex=o),c=o+e[o][n].rowspan-1):l.rowspan>1&&(c=a+l.rowspan-1),c>t.end.rowIndex&&(t.end.rowIndex=c)})}function o(e,t,n,a){var r=e[n],l=r[a],o=l.colMergeWith,c=-1;g.default.isExisty(o)?(o<t.start.colIndex&&(t.start.colIndex=o),c=o+r[o].colspan-1):l.colspan>1&&(c=a+l.colspan-1),c>t.end.colIndex&&(t.end.colIndex=c)}function c(e,t){for(var n="";n!==JSON.stringify(t);)n=JSON.stringify(t),l(e,t,"start"),l(e,t,"end"),g.default.range(t.start.rowIndex,t.end.rowIndex+1).forEach(function(n){o(e,t,n,t.start.colIndex),o(e,t,n,t.end.colIndex)});return t}function i(e,t,n){return c(e,r(e,t,n))}function d(e,t,n){var a=h.default.createCellIndexData(e),r={};if(t.length){var l=h.default.findCellIndex(a,t.first()),o=g.default.extend({},l);t.each(function(t,n){var r=h.default.findCellIndex(a,(0,f.default)(n)),l=e[r.rowIndex][r.colIndex],c=r.rowIndex+l.rowspan-1,i=r.colIndex+l.colspan-1;o.rowIndex=Math.max(o.rowIndex,c),o.colIndex=Math.max(o.colIndex,i)}),r.start=l,r.end=o}else{var c=h.default.findCellIndex(a,n);r.start=c,r.end=g.default.extend({},c)}return r}Object.defineProperty(t,"__esModule",{value:!0});var u=n(0),f=a(u),s=n(2),g=a(s),p=n(3),h=a(p);t.default={findSelectionRange:i,getTableSelectionRange:d}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=e.eventManager;if(e.toMarkOptions=e.toMarkOptions||{},e.toMarkOptions.renderer=x.default,d(t),!e.isViewer()){var n=e.wwEditor.componentManager,a=e.getUI().getPopupTableUtils();l(e),o(n),a&&U.default.updateContextMenu(a,t,n.getManager("tableSelection"))}}function l(e){e.addCommand(W.default),e.addCommand(L.default)}function o(e){e.removeManager("table"),e.removeManager("tableSelection"),e.addManager(I.default),e.addManager(C.default)}function c(e,t){var n=(0,f.default)("<div>"+e+"</div>"),a=n.find("table");return a.length&&(a.get().forEach(function(e){var n=t(e);(0,f.default)(e).replaceWith(n)}),e=n.html()),e}function i(e){var t=e.command;if(t.isWWType())switch(t.getName()){case"AddRow":e.command=M.default;break;case"AddCol":e.command=E.default;break;case"RemoveRow":e.command=S.default;break;case"RemoveCol":e.command=N.default;break;case"AlignCol":e.command=O.default}}function d(e){e.listen("convertorAfterMarkdownToHtmlConverted",function(e){return c(e,h.default)}),e.listen("convertorBeforeHtmlToMarkdownConverted",function(e){return c(e,v.default)}),e.listen("addCommandBefore",i)}var u=n(0),f=a(u),s=n(1),g=a(s);n(50);var p=n(51),h=a(p),m=n(52),v=a(m),b=n(53),x=a(b),w=n(55),I=a(w),y=n(56),C=a(y),_=n(57),M=a(_),T=n(58),E=a(T),k=n(59),S=a(k),D=n(60),N=a(D),R=n(61),O=a(R),j=n(62),W=a(j),A=n(63),L=a(A),P=n(64),U=a(P);g.default.defineExtension("table",r)},function(e,t,n){"use strict";var a=n(1),r=function(e){return e&&e.__esModule?e:{default:e}}(a),l=r.default.i18n;l&&(l.setLanguage(["ko","ko_KR"],{"Merge cells":"셀 병합","Unmerge cells":"셀 병합해제","Cannot change part of merged cell":"병합 된 셀의 일부를 변경할 수 없습니다.","Cannot paste row merged cells into the table header":"테이블 헤더에는 행 병합된 셀을 붙여넣을 수 없습니다."}),l.setLanguage(["en","en_US"],{"Merge cells":"Merge cells","Unmerge cells":"Unmerge cells","Cannot change part of merged cell":"Cannot change part of merged cell.","Cannot paste row merged cells into the table header":"Cannot paste row merged cells into the table header."}),l.setLanguage(["es","es_ES"],{"Merge cells":"Combinar celdas","Unmerge cells":"Separar celdas","Cannot change part of merged cell":"No se puede cambiar parte de una celda combinada.","Cannot paste row merged cells into the table header":"No se pueden pegar celdas combinadas en el encabezado de tabla."}),l.setLanguage(["ja","ja_JP"],{"Merge cells":"セルの結合","Unmerge cells":"セルの結合を解除","Cannot change part of merged cell":"結合されたセルの一部を変更することはできません。","Cannot paste row merged cells into the table header":"行にマージされたセルをヘッダーに貼り付けることはできません。"}),l.setLanguage(["nl","nl_NL"],{"Merge cells":"Cellen samenvoegen","Unmerge cells":"Samengevoegde cellen ongedaan maken","Cannot change part of merged cell":"Kan geen deel uit van een samengevoegde cel veranderen.","Cannot paste row merged cells into the table header":"Kan geen rij met samengevoegde cellen in de koptekst plakken."}),l.setLanguage(["zh","zh_CN"],{"Merge cells":"合并单元格","Unmerge cells":"取消合并单元格","Cannot change part of merged cell":"无法更改合并单元格的一部分。","Cannot paste row merged cells into the table header":"无法将行合并单元格粘贴到标题中。"}),l.setLanguage(["de","de_DE"],{"Merge cells":"Zellen zusammenführen","Unmerge cells":"Zusammenführen rückgängig machen","Cannot change part of merged cell":"Der Teil der verbundenen Zelle kann nicht geändert werden.","Cannot paste row merged cells into the table header":"Die Zeile der verbundenen Zellen kann nicht in die Kopfzeile eingefügt werden."}),l.setLanguage(["ru","ru_RU"],{"Merge cells":"Объединить ячейки","Unmerge cells":"Разъединить ячейки","Cannot change part of merged cell":"Вы не можете изменять часть комбинированной ячейки.","Cannot paste row merged cells into the table header":"Вы не можете вставлять объединенные ячейки в заголовок таблицы."}),l.setLanguage(["fr","fr_FR"],{"Merge cells":"Fusionner les cellules","Unmerge cells":"Séparer les cellules","Cannot change part of merged cell":"Impossible de modifier une partie de la cellule fusionnée.","Cannot paste row merged cells into the table header":"Impossible de coller les cellules fusionnées dans l'en-tête du tableau."}),l.setLanguage(["uk","uk_UA"],{"Merge cells":"Об'єднати комірки","Unmerge cells":"Роз'єднати комірки","Cannot change part of merged cell":"Ви не можете змінювати частину комбінованої комірки.","Cannot paste row merged cells into the table header":"Ви не можете вставляти об'єднані комірки в заголовок таблиці."}),l.setLanguage(["tr","tr_TR"],{"Merge cells":"Hücreleri birleştir","Unmerge cells":"Hücreleri ayır","Cannot change part of merged cell":"Birleştirilmiş hücrelerin bir kısmı değiştirelemez.","Cannot paste row merged cells into the table header":"Satırda birleştirilmiş hücreler sütun başlığına yapıştırılamaz"}),l.setLanguage(["fi","fi_FI"],{"Merge cells":"Yhdistä solut","Unmerge cells":"Jaa solut","Cannot change part of merged cell":"Yhdistettyjen solujen osaa ei voi muuttaa","Cannot paste row merged cells into the table header":"Soluja ei voi yhdistää taulukon otsikkoriviin"}),l.setLanguage(["cs","cs_CZ"],{"Merge cells":"Spojit buňky","Unmerge cells":"Rozpojit buňky","Cannot change part of merged cell":"Nelze měnit část spojené buňky","Cannot paste row merged cells into the table header":"Nelze vkládat spojené buňky do záhlaví tabulky"}),l.setLanguage(["ar","ar_AR"],{"Merge cells":"دمج الوحدات","Unmerge cells":"إلغاء دمج الوحدات","Cannot change part of merged cell":"لا يمكن تغيير جزء من الخلية المدموجة","Cannot paste row merged cells into the table header":"لا يمكن لصق الخلايا المدموجة من صف واحد في رأس الجدول"}),l.setLanguage(["pl","pl_PL"],{"Merge cells":"Scal komórki","Unmerge cells":"Rozłącz komórki","Cannot change part of merged cell":"Nie można zmienić części scalonej komórki.","Cannot paste row merged cells into the table header":"Nie można wkleić komórek o scalonym rzędzie w nagłówek tabeli."}),l.setLanguage(["zh","zh_TW"],{"Merge cells":"合併儲存格","Unmerge cells":"取消合併儲存格","Cannot change part of merged cell":"無法變更儲存格的一部分。","Cannot paste row merged cells into the table header":"無法將合併的儲存格貼上至表格標題中。"}))},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){var a=new RegExp("^((?:"+n+"=[0-9]+:)?)"+t+"=([0-9]+):(.*)"),r=a.exec(e),l=1;return r&&(l=parseInt(r[2],10),e=r[1]+r[3]),[l,e]}function l(e){var t=e.nodeName,n=e.align||"",a=e.innerHTML.trim(),l=null,o=null,c=r(a,"@cols","@rows");l=c[0],a=c[1];var i=r(a,"@rows","@cols");return o=i[0],a=i[1],{nodeName:t,colspan:l,rowspan:o,content:a,align:n}}function o(e){return e.find("tr").get().map(function(e){return(0,p.default)(e).find("td, th").get().map(l)})}function c(e,t){var n=-1;return m.default.forEach(e,function(e,a){var r=!0;return t(e,a)&&(n=a,r=!1),r}),n}function i(e){var t=c(e,function(e){return"TD"===e[0].nodeName});return[e.slice(0,t),e.slice(t)]}function d(e){e.forEach(function(e){var t=e.length,n=0;e.forEach(function(e){n+=e.colspan-1}),e.splice(t-n)})}function u(e){var t=e.map(function(e,t){return t}),n=t.map(function(){return 0});return e.forEach(function(e,a){var r=e.filter(function(e){return e.rowspan>1}),l=a+1;r.forEach(function(e){var a=e.colspan,r=l+(e.rowspan-1);t.slice(l,r).forEach(function(e){n[e]+=a})})}),n}function f(e){var t=u(e);e.forEach(function(e,n){e.splice(e.length-t[n])})}function s(e){var t=o((0,p.default)(e)),n=i(t),a=n[0],r=n[1];return d(a),d(r),f(r),(0,p.default)(b.default.createTableHtml(t))[0]}Object.defineProperty(t,"__esModule",{value:!0}),t._extractPropertiesForMerge=r,t._parseTableCell=l,t._createTableObjectFrom$Table=o,t._divideTrs=i,t._mergeByColspan=d,t._getRemovalTdCountsByRowspan=u,t._mergeByRowspan=f,t.default=s;var g=n(0),p=a(g),h=n(2),m=a(h),v=n(6),b=a(v)},function(e,t,n){"use strict";function a(e){var t=(0,o.default)(e),n=t.attr("colspan")||"",a=t.attr("rowspan")||"",r=t.html();n&&(r="@cols="+n+":"+r),a&&(r="@rows="+a+":"+r),r&&t.html(r)}function r(e){return(0,o.default)(e).find("td, th").get().forEach(a),e}Object.defineProperty(t,"__esModule",{value:!0}),t._prependMergeSyntaxToContent=a,t.default=r;var l=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return f.default.range(0,t).map(function(){return e}).join("")}function l(e){var t=e.align,n=(e.textContent||e.innerText).replace(p,""),a=n.length,l="",o="";return t&&("left"===t?(l=":",a-=1):"right"===t?(o=":",a-=1):"center"===t&&(o=":",l=":",a-=2)),a=Math.max(a,3),l+r("-",a)+o}function o(e){var t=0;return e.filter(function(e){return(0,d.default)(e).attr("colspan")}).forEach(function(e){t+=parseInt((0,d.default)(e).attr("colspan"),10)-1}),t}function c(e,t){var n=(0,d.default)(e).find("th").get(),a=n.map(function(e){return" "+l(e)+" |"}).join("");return a+=r(" --- |",o(n)),t?t+"|"+a+"\n":""}Object.defineProperty(t,"__esModule",{value:!0}),t._getAdditionalThCount=o,t._createTheadMarkdown=c;var i=n(0),d=a(i),u=n(2),f=a(u),s=n(54),g=a(s),p=/@cols=[0-9]+:/g;t.default=g.default.Renderer.factory(g.default.gfmRenderer,{THEAD:c})},function(e,t){e.exports=r},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function c(e,t){var n=!1;return s.default.forEach(e,function(e){return!(n=t(e))}),n}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),d=n(0),u=a(d),f=n(2),s=a(f),g=n(1),p=a(g),h=n(3),m=a(h),v=n(6),b=a(v),x=n(7),w=a(x),I=p.default.WwTableManager,y=p.default.i18n,C=function(e){function t(){return r(this,t),l(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return o(t,e),i(t,[{key:"_updateCopyDataMergeWith",value:function(e,t){e.forEach(function(e){e.forEach(function(e){s.default.isExisty(e.rowMergeWith)&&(e.rowMergeWith-=t.rowIndex),s.default.isExisty(e.colMergeWith)&&(e.colMergeWith-=t.colIndex)})})}},{key:"_createCopyTableData",value:function(e,t,n){var a=e.slice(t.rowIndex,n.rowIndex+1);return a=a.map(function(e){return e.slice(t.colIndex,n.colIndex+1)}),this._updateCopyDataMergeWith(a,t),a}},{key:"updateTableHtmlOfClipboardIfNeed",value:function(e){var t=this.wwe.componentManager.getManager("tableSelection").getSelectedCells();if(t.length){var n=m.default.createTableData((0,u.default)(t[0]).closest("TABLE")),a=w.default.getTableSelectionRange(n,t),r=a.start,l=a.end,o=this._createCopyTableData(n,r,l),c=m.default.createCellIndexData(o),i=m.default.createRenderData(o,c);e.html(b.default.createTableHtml(i))}}},{key:"prepareToTableCellStuffing",value:function(e){var t=e[0].length,n=!1;return e.slice(1).forEach(function(e){var a=e.length;t!==a&&(n=!0,t<a&&(t=a))}),{maximumCellLength:t,needTableCellStuffingAid:n}}},{key:"tableCellAppendAidForTableElement",value:function(e){var t=(0,u.default)(e),n=m.default.createTableData(t),a=m.default.addTbodyOrTheadIfNeed(n),r=this.prepareToTableCellStuffing(n),l=r.needTableCellStuffingAid;l&&m.default.stuffCellsIntoIncompleteRow(n,r.maximumCellLength),(a||l)&&b.default.replaceTable(t,n)}},{key:"_findStartCell",value:function(e){return 1===e.length?e.get(0):this.wwe.getEditor().getSelection().startContainer}},{key:"_findStartCellIndex",value:function(e,t){var n=m.default.createCellIndexData(e);return m.default.findCellIndex(n,t)}},{key:"_hasRowMergedHeader",value:function(e,t,n){var a="TH"===t[n.rowIndex][n.colIndex].nodeName,r=c(e[0],function(e){return e.rowspan&&e.rowspan>1});return a&&r}},{key:"_isExactlyFit",value:function(e,t,n){return t%e.length==0&&n%e[0].length==0}},{key:"_updateClipboardTableData",value:function(e,t,n){var a=e.length,r=e[0].length,l=parseInt(t/a,10),o=parseInt(n/r,10);if(l>1){var c=JSON.parse(JSON.stringify(e));s.default.range(0,l-1).forEach(function(){var t=JSON.parse(JSON.stringify(c));e.push.apply(e,t)})}if(o>1){var i=JSON.parse(JSON.stringify(e));s.default.range(0,o-1).forEach(function(){var t=JSON.parse(JSON.stringify(i));e.forEach(function(e,n){e.push.apply(e,t[n])})})}}},{key:"_updateTableDataByClipboardData",value:function(e,t,n){var a=n.rowIndex,r=n.colIndex;e.forEach(function(e,n){var l=a+n;e.forEach(function(e,n){var a=r+n,o=t[l][a];e.nodeName=o.nodeName,t[l][a]=e})})}},{key:"_isPossibleToPaste",value:function(e,t,n){var a=t.rowIndex,r=t.colIndex,l=n.rowIndex,o=n.colIndex,i=e.slice(a,l+1),d=i[0].slice(r,o+1),u=!c(d,function(e){return s.default.isExisty(e.rowMergeWith)});if(u){u=!c(s.default.pluck(i,r),function(e){return s.default.isExisty(e.colMergeWith)})}if(u&&e.length>l+1){u=!c(e[l+1].slice(r,o+1),function(e){return s.default.isExisty(e.rowMergeWith)})}if(u&&e[0].length>o+1){u=!c(s.default.pluck(i,o+1),function(e){return s.default.isExisty(e.colMergeWith)})}return u}},{key:"_spliceClipboardData",value:function(e,t,n){e.splice(t),e.forEach(function(e){e.splice(n)})}},{key:"_bookmarkLastTd",value:function(e){var t=e.rowIndex,n=e.colIndex,a=this.wwe.getEditor(),r=a.get$Body().find(".tui-paste-table-bookmark"),l=m.default.createTableData(r),o=l[t][n];t=s.default.isExisty(o.rowMergeWith)?o.rowMergeWith:t,n=s.default.isExisty(o.colMergeWith)?o.colMergeWith:n;var c=l[t][n].elementIndex,i=r.find("tr").eq(c.rowIndex).children()[c.colIndex];r.removeClass("tui-paste-table-bookmark"),(0,u.default)(i).addClass("tui-paste-table-cell-bookmark")}},{key:"_updateClipboardDataForPasteToSamllerSelectedArea",value:function(e,t,n,a,r){var l=!0,o={rowIndex:0,colIndex:0},c={rowIndex:n-1,colIndex:a-1};return this._isPossibleToPaste(e,o,c)?(this._spliceClipboardData(e,n,a),this._updateTableDataByClipboardData(e,t,r)):l=!1,l}},{key:"_pasteToSelectedArea",value:function(e,t,n,a){var r=w.default.getTableSelectionRange(n,a),l=r.start,o=r.end,c=o.rowIndex-l.rowIndex+1,i=o.colIndex-l.colIndex+1,d=t.length,u=t[0].length,f=c>=d&&i>=u,s=y.get("Cannot change part of merged cell"),g=!0,p=void 0;this._hasRowMergedHeader(t,n,l)?(s=y.get("Cannot paste row merged cells into the table header"),g=!1):this._isExactlyFit(t,c,i)?(p=o,this._updateClipboardTableData(t,c,i),this._updateTableDataByClipboardData(t,n,l)):f?(p={rowIndex:l.rowIndex+d-1,colIndex:l.colIndex+u-1},this._isPossibleToPaste(n,l,p)?this._updateTableDataByClipboardData(t,n,l):g=!1):(p={rowIndex:l.rowIndex+c-1,colIndex:l.colIndex+i-1},g=this._updateClipboardDataForPasteToSamllerSelectedArea(t,n,c,i,l)),g?(n.className+=" tui-paste-table-bookmark",b.default.replaceTable(e,n),this._bookmarkLastTd(p)):(alert(s),this.wwe.focus())}},{key:"_findEndCellIndex",value:function(e,t){var n=t.rowIndex,a=t.colIndex;return{rowIndex:n+e.length-1,colIndex:a+e[0].length-1}}},{key:"_expandRow",value:function(e,t){var n=e.length,a=e[0].length,r=s.default.range(n,n+t).map(function(e){return s.default.range(0,a).map(function(t){return m.default.createBasicCell(e,t)})});e.push.apply(e,r)}},{key:"_expandCoumn",value:function(e,t){var n=e[0].length,a=s.default.range(n,n+t);e.forEach(function(e,t){var n=e[0].nodeName,r=a.map(function(e){return m.default.createBasicCell(t,e,n)});e.push.apply(e,r)})}},{key:"_expandTableDataIfNeed",value:function(e,t,n){var a=n.rowIndex-e.length+1,r=n.colIndex-e[0].length+1;a>0&&this._expandRow(e,a),r>0&&this._expandCoumn(e,r)}},{key:"_pasteAllClipboardTableData",value:function(e,t,n,a){var r=this._findEndCellIndex(t,a);if(this._hasRowMergedHeader(t,n,a))return alert(y.get("Cannot paste row merged cells into the table header")),void this.wwe.focus();this._expandTableDataIfNeed(n,a,r),this._isPossibleToPaste(n,a,r)?(this._updateTableDataByClipboardData(t,n,a),n.className+=" tui-paste-table-bookmark",b.default.replaceTable(e,n),this._bookmarkLastTd(r)):(alert(y.get("Cannot change part of merged cell")),this.wwe.focus())}},{key:"pasteTableData",value:function(e){var t=(0,u.default)(e),n=m.default.createTableData(t),a=this.wwe.componentManager.getManager("tableSelection"),r=a.getSelectedCells(),l=(0,u.default)(this._findStartCell(r)),o=l.closest("table"),c=m.default.createTableData(o),i=this._findStartCellIndex(c,l);r.length>1?this._pasteToSelectedArea(o,n,c,r):this._pasteAllClipboardTableData(o,n,c,i)}}]),t}(I);t.default=C},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function l(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var c=function(){function e(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}}(),i=n(0),d=a(i),u=n(2),f=a(u),s=n(1),g=a(s),p=n(3),h=a(p),m=n(7),v=a(m),b=g.default.WwTableSelectionManager,x=function(e){function t(e){r(this,t);var n=l(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n._tableData=null,n.mergedTableSelectionManager=!0,n}return o(t,e),c(t,[{key:"_addClassToSelectedCells",value:function(e,t,n){var a=n.start,r=n.end,l=f.default.range(a.colIndex,r.colIndex+1),o=e.find("tr");f.default.range(a.rowIndex,r.rowIndex+1).forEach(function(e){var n=t[e],a=o.eq(e).find("td, th");return l.forEach(function(e){n[e].elementIndex&&a.eq(n[e].elementIndex.colIndex).addClass("te-cell-selected")})})}},{key:"onDragStart",value:function(e){var t=(0,d.default)(e).closest("[contenteditable=true] table");this._tableData=h.default.createTableData(t)}},{key:"onDragEnd",value:function(){this._tableData=null}},{key:"highlightTableCellsBy",value:function(e,t){var n=(0,d.default)(e),a=(0,d.default)(t),r=n.closest("[contenteditable=true] table"),l=v.default.findSelectionRange(this._tableData,n,a);this.removeClassAttrbuteFromAllCellsIfNeed(),this._addClassToSelectedCells(r,this._tableData,l)}},{key:"styleToSelectedCells",value:function(e,t){var n=this.wwe.getEditor(),a=n.getSelection().cloneRange();(0,d.default)(a.startContainer).closest("[contenteditable=true] table").find("tr").get().forEach(function(r){var l=(0,d.default)(r).find(".te-cell-selected"),o=l.first().get(0),c=l.last().get(0);l.length&&(a.setStart(o,0),a.setEnd(c,c.childNodes.length),n.setSelection(a),e(n,t))})}},{key:"hasSelectedBothThAndTd",value:function(e){return e=e||this.getSelectedCells(),e.first()[0].nodeName!==e.last()[0].nodeName}}]),t}(b);t.default=x},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){return{nodeName:"TD",rowMergeWith:e}}function l(e,t){var n=null;return e[t].map(function(a,l){var o=void 0;if(f.default.isExisty(a.rowMergeWith)){var c=a.rowMergeWith,i=e[c][l],d=c+i.rowspan-1;f.default.isExisty(i.colMergeWith)&&n?o=f.default.extend({},n):d>t&&(i.rowspan+=1,o=f.default.extend({},a))}else a.rowspan>1&&(a.rowspan+=1,o=r(t));return o||(o=h.default.createBasicCell(t+1,l)),n=o,o})}function o(e,t){var n=t.start.rowIndex,a=t.end,r=h.default.findRowMergedLastIndex(e,a.rowIndex,a.colIndex),o=f.default.range(n,r+1).map(function(){return l(e,r)});e.splice.apply(e,[r+1,0].concat(o))}function c(e,t,n){var a=h.default.createTableData(e),r=h.default.findRowMergedLastIndex(a,t,n)+1,l=h.default.findElementIndex(a,r,n);return e.find("tr").eq(l.rowIndex).find("td")[l.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._createNewRow=l,t._addRow=o;var i=n(0),d=a(i),u=n(2),f=a(u),s=n(1),g=a(s),p=n(3),h=a(p),m=n(7),v=a(m),b=n(6),x=a(b),w=g.default.CommandManager,I=void 0;w&&(I=w.command("wysiwyg",{name:"AddRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var a=(0,d.default)(n.startContainer),r=a.closest("table"),l=h.default.createTableData(r),i=e.componentManager.getManager("tableSelection").getSelectedCells(),u=v.default.getTableSelectionRange(l,i,a);t.saveUndoState(n),o(l,u);var f=x.default.replaceTable(r,l),s=c(f,u.end.rowIndex,u.start.colIndex);x.default.focusToCell(t,n,s)}}})),t.default=I},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t){return{nodeName:t,colMergeWith:e}}function l(e,t,n,a){var l=e[n],o=void 0;if(s.default.isExisty(l.colMergeWith)){var c=l.colMergeWith,i=e[c],d=c+i.colspan-1;s.default.isExisty(i.rowMergeWith)&&a?o=s.default.extend({},a):d>n&&(i.colspan+=1,o=s.default.extend({},l))}else l.colspan>1&&(l.colspan+=1,o=r(n,l.nodeName));return o||(o=m.default.createBasicCell(t,n+1,l.nodeName)),o}function o(e,t,n){var a=s.default.range(t,n+1),r=[],o=null;return e.forEach(function(e,t){var c=a.map(function(a,r){var c=o?o[r-1]:null;return l(e,t,n,c)});o=c,r.push(c)}),r}function c(e,t){var n=t.end,a=m.default.findColMergedLastIndex(e,n.rowIndex,n.colIndex),r=o(e,t.start.colIndex,a),l=a+1;e.forEach(function(e,t){e.splice.apply(e,[l,0].concat(r[t]))})}function i(e,t,n){var a=m.default.createTableData(e),r=m.default.findColMergedLastIndex(a,t,n)+1,l=m.default.findElementIndex(a,t,r);return e.find("tr").eq(l.rowIndex).find("td, th")[l.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._createNewColumns=o,t._addColumns=c;var d=n(0),u=a(d),f=n(2),s=a(f),g=n(1),p=a(g),h=n(3),m=a(h),v=n(7),b=a(v),x=n(6),w=a(x),I=p.default.CommandManager,y=void 0;I&&(y=I.command("wysiwyg",{name:"AddCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var a=(0,u.default)(n.startContainer),r=a.closest("table"),l=m.default.createTableData(r),o=e.componentManager.getManager("tableSelection").getSelectedCells(),d=b.default.getTableSelectionRange(l,o,a);t.saveUndoState(n),c(l,d);var f=w.default.replaceTable(r,l),s=i(f,d.start.rowIndex,d.end.colIndex);w.default.focusToCell(t,n,s)}}})),t.default=y},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){f.default.range(t,n+1).forEach(function(t){e[t].forEach(function(a,r){if(f.default.isExisty(a.rowMergeWith)){var l=e[a.rowMergeWith][r];l.rowspan&&(l.rowspan-=1)}else if(a.rowspan>1){var o=t+a.rowspan-1;a.rowspan-=n-t+1,o>n&&(e[n+1][r]=f.default.extend({},a))}})})}function l(e,t,n){e.slice(n+1).forEach(function(e){e.forEach(function(e){f.default.isExisty(e.rowMergeWith)&&e.rowMergeWith>=t&&(e.rowMergeWith=n+1)})})}function o(e,t){var n=t.start.rowIndex,a=t.end,o=h.default.findRowMergedLastIndex(e,a.rowIndex,a.colIndex);if(0!==n||0!==o){n=Math.max(n,1),o=Math.max(o,1);var c=o-n+1;e.length-c<2?e.splice(0,e.length):(r(e,n,o),l(e,n,o),e.splice(n,c))}}function c(e,t,n){var a=h.default.createTableData(e);a.length-1<t&&(t-=1);var r=h.default.findElementIndex(a,t,n);return e.find("tr").eq(r.rowIndex).find("th,td")[r.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._removeRow=o;var i=n(0),d=a(i),u=n(2),f=a(u),s=n(1),g=a(s),p=n(3),h=a(p),m=n(7),v=a(m),b=n(6),x=a(b),w=g.default.CommandManager,I=void 0;w&&(I=w.command("wysiwyg",{name:"RemoveRow",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var a=(0,d.default)(n.startContainer),r=a.closest("table"),l=h.default.createTableData(r),i=l.length,u=e.componentManager.getManager("tableSelection").getSelectedCells(),f=v.default.getTableSelectionRange(l,u,a);if(t.saveUndoState(n),o(l,f),l.length<2)r.remove();else if(i!==l.length){var s=x.default.replaceTable(r,l),g=f.start.rowIndex,p=g<l.length?g:g-1,m=c(s,p,f.start.colIndex);x.default.focusToCell(t,n,m)}}}})),t.default=I},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){e.forEach(function(e){f.default.range(t,n+1).forEach(function(t){var a=e[t];if(f.default.isExisty(a.colMergeWith)){var r=e[a.colMergeWith];r.colspan&&(r.colspan-=1)}else if(a.colspan>1){var l=t+a.colspan-1;a.colspan-=n-t+1,l>n&&(e[n+1]=f.default.extend({},a))}})})}function l(e,t,n){e.forEach(function(e){e.slice(n+1).forEach(function(e){f.default.isExisty(e.colMergeWith)&&e.colMergeWith>=t&&(e.colMergeWith=n+1)})})}function o(e,t){var n=t.start.colIndex,a=t.end,o=h.default.findColMergedLastIndex(e,a.rowIndex,a.colIndex),c=o-n+1;r(e,n,o),l(e,n,o),e.forEach(function(e){e.splice(n,c)})}function c(e,t,n){var a=h.default.createTableData(e);a[0].length-1<n&&(n-=1);var r=h.default.findElementIndex(a,t,n);return e.find("tr").eq(r.rowIndex).find("td, th")[r.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._removeColumns=o;var i=n(0),d=a(i),u=n(2),f=a(u),s=n(1),g=a(s),p=n(3),h=a(p),m=n(7),v=a(m),b=n(6),x=a(b),w=g.default.CommandManager,I=void 0;w&&(I=w.command("wysiwyg",{name:"RemoveCol",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var a=(0,d.default)(n.startContainer),r=a.closest("table"),l=h.default.createTableData(r),i=e.componentManager.getManager("tableSelection").getSelectedCells(),u=v.default.getTableSelectionRange(l,i,a),f=l[0].length;if(t.saveUndoState(n),o(l,u),0===l[0].length)r.remove();else if(f!==l[0].length){var s=x.default.replaceTable(r,l),g=u.start.colIndex,p=g>=l[0].length?g-1:g,m=c(s,u.start.rowIndex,p);x.default.focusToCell(t,n,m)}}}})),t.default=I},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n,a){d.default.range(t,n+1).forEach(function(t){var n=e[t];d.default.isExisty(n.colMergeWith)?e[n.colMergeWith].align=a:n.align=a})}function l(e,t){var n=g.default.findElementRowIndex(t),a=g.default.findElementColIndex(t);return e.find("tr").eq(n).find("td, th")[a]}Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),c=a(o),i=n(2),d=a(i),u=n(1),f=a(u),s=n(3),g=a(s),p=n(7),h=a(p),m=n(6),v=a(m),b=f.default.CommandManager,x=void 0;b&&(x=b.command("wysiwyg",{name:"AlignCol",exec:function(e,t){var n=e.getEditor(),a=n.getSelection().cloneRange();if(e.focus(),n.hasFormat("TABLE")){var o=(0,c.default)(a.startContainer),i=o.closest("table"),d=g.default.createTableData(i),u=e.componentManager.getManager("tableSelection").getSelectedCells(),f=h.default.getTableSelectionRange(d,u,o);r(d[0],f.start.colIndex,f.end.colIndex,t);var s=v.default.replaceTable(i,d),p=l(s,o);v.default.focusToCell(n,a,p)}}})),t.default=x},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t,n){var a,r=n+1,l=(a=[]).concat.apply(a,e.map(function(e){return e.slice(t,r)})),o=l.filter(function(e){var t=e.content;return t&&t!==C});return o.length?o[0].content:C}function l(e,t,n){var a,r=n+1,l=e.map(function(e){return e.slice(t,r)});(a=[]).concat.apply(a,l).slice(1).forEach(function(e){var t=e.nodeName;g.default.forEach(e,function(t,n){return delete e[n]}),e.nodeName=t})}function o(e,t,n,a){var r=n+1;e.forEach(function(e){e.slice(t,r).forEach(function(e){e.rowMergeWith=a})})}function c(e,t,n,a){var r=n+1;e.forEach(function(e){e.slice(t,r).forEach(function(e){e.colMergeWith=a})})}function i(e,t){var n=t.start,a=t.end,i=n.rowIndex,d=n.colIndex,u=a.rowIndex,f=a.colIndex,s=e[i][d],g=e.slice(i,u+1),p=u-i+1,h=f-d+1;s.rowspan=p,s.colspan=h,s.content=r(g,d,f),l(g,d,f),p>1&&o(g.slice(1),d,f,i),h>1&&c(g,d+1,f,d)}function d(e,t,n){var a=v.default.createTableData(e),r=v.default.findElementIndex(a,t,n);return e.find("tr").eq(r.rowIndex).find("td, th")[r.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._mergeCells=i;var u=n(0),f=a(u),s=n(2),g=a(s),p=n(1),h=a(p),m=n(3),v=a(m),b=n(7),x=a(b),w=n(6),I=a(w),y=h.default.CommandManager,C=g.default.browser.msie?"":"<br>",_=void 0;y&&(_=y.command("wysiwyg",{name:"MergeCells",exec:function(e){var t=e.getEditor();if(e.focus(),t.hasFormat("TABLE")){var n=e.componentManager.getManager("tableSelection"),a=n.getSelectedCells();if(!(a.length<2||n.hasSelectedBothThAndTd(a))){var r=t.getSelection().cloneRange(),l=(0,f.default)(r.startContainer),o=l.closest("table"),c=v.default.createTableData(o),u=x.default.getTableSelectionRange(c,a,l);i(c,u);var s=I.default.replaceTable(o,c),g=d(s,u.start.rowIndex,u.start.colIndex);I.default.focusToCell(t,r,g)}}}})),t.default=_},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n,a=t.start,r=t.end,l=a.colIndex,o=r.colIndex+1,c=e.slice(a.rowIndex,r.rowIndex+1),i=c.map(function(e){return e.slice(l,o)});return!!(n=[]).concat.apply(n,i).filter(function(e){return e.colspan>1||e.rowspan>1}).length}function l(e,t,n,a,r){var l=t+a,o=n+r,c=f.default.range(n,o);f.default.range(t,l).forEach(function(n){var a=e[n],r=n===t?1:0;c.slice(r).forEach(function(e){a[e]=h.default.createBasicCell(n,e,a[e].nodeName)})})}function o(e,t){var n=t.start,a=t.end,r=f.default.range(n.colIndex,a.colIndex+1);f.default.range(n.rowIndex,a.rowIndex+1).forEach(function(t){r.forEach(function(n){var a=e[t][n],r=a.colspan,o=a.rowspan;(r>1||o>1)&&(a.colspan=1,a.rowspan=1,l(e,t,n,o,r))})})}function c(e,t,n){var a=h.default.createTableData(e),r=h.default.findElementIndex(a,t,n);return e.find("tr").eq(r.rowIndex).find("td, th")[r.colIndex]}Object.defineProperty(t,"__esModule",{value:!0}),t._hasMergedCell=r,t._unmergeCells=o;var i=n(0),d=a(i),u=n(2),f=a(u),s=n(1),g=a(s),p=n(3),h=a(p),m=n(7),v=a(m),b=n(6),x=a(b),w=g.default.CommandManager,I=void 0;w&&(I=w.command("wysiwyg",{name:"UnmergeCells",exec:function(e){var t=e.getEditor(),n=t.getSelection().cloneRange();if(e.focus(),t.hasFormat("TABLE")){var a=(0,d.default)(n.startContainer),l=a.closest("table"),i=h.default.createTableData(l),u=e.componentManager.getManager("tableSelection").getSelectedCells(),f=v.default.getTableSelectionRange(i,u,a);if(r(i,f)){o(i,f);var s=x.default.replaceTable(l,i),g=c(s,f.start.rowIndex,f.start.colIndex);x.default.focusToCell(t,n,g)}}}})),t.default=I},function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){var t=['<button type="button" class="te-table-add-row">'+f.get("Add row")+"</button>",'<button type="button" class="te-table-add-col">'+f.get("Add col")+"</button>",'<button type="button" class="te-table-remove-row">'+f.get("Remove row")+"</button>",'<button type="button" class="te-table-remove-col">'+f.get("Remove col")+"</button>","<hr/>",'<button type="button" class="te-table-merge">'+f.get("Merge cells")+"</button>",'<button type="button" class="te-table-unmerge">'+f.get("Unmerge cells")+"</button>","<hr/>",'<button type="button" class="te-table-col-align-left">'+f.get("Align left")+"</button>",'<button type="button" class="te-table-col-align-center">'+f.get("Align center")+"</button>",'<button type="button" class="te-table-col-align-right">'+f.get("Align right")+"</button>","<hr/>",'<button type="button" class="te-table-remove">'+f.get("Remove table")+"</button>"].join(""),n=(0,i.default)(t);e.setContent(n)}function l(e,t,n){var a=e.$content,r=(0,i.default)(a[5]),l=(0,i.default)(a[6]),o=(0,i.default)(a[7]);e.on("click .te-table-merge",function(){t.emit("command","MergeCells")}),e.on("click .te-table-unmerge",function(){t.emit("command","UnmergeCells")}),t.listen("openPopupTableUtils",function(){var e=n.getSelectedCells(),t=e.length;t?(t<2||n.hasSelectedBothThAndTd(e)?r.hide():r.show(),e.is("[rowspan], [colspan]")?l.show():l.hide(),o.show()):(r.hide(),l.hide(),o.hide())})}function o(e,t,n){r(e),l(e,t,n)}Object.defineProperty(t,"__esModule",{value:!0});var c=n(0),i=a(c),d=n(1),u=a(d),f=u.default.i18n;t.default={updateContextMenu:o}}])}); |