芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/chacsinkinyucatan.gob.mx/media/vendor/tinymce/plugins/table/plugin.min.js
/** * Copyright (c) Tiny Technologies, Inc. All rights reserved. * Licensed under the LGPL or a commercial license. * For LGPL see License.txt in the project root for license information. * For commercial licenses see https://www.tiny.cloud/ * * Version: 5.8.2 (2021-06-23) */ !function(){"use strict";var e,n=function(r){return function(n){return t=typeof(e=n),(null===e?"null":"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t)===r;var e,t}},t=function(e){return function(n){return typeof n===e}},p=n("string"),g=n("object"),a=n("array"),r=t("boolean"),i=(e=undefined,function(n){return e===n}),c=function(n){return!(null===(e=n)||e===undefined);var e},l=t("function"),f=t("number"),C=function(){},b=function(n){return function(){return n}},d=function(n){return n};function S(r){for(var o=[],n=1;n
=e.length&&n.substr(t,t+e.length)===e},un=function(n,e){return-1!==n.indexOf(e)},cn=function(n,e){return on(n,e,0)},an=function(n,e){return on(n,e,n.length-e.length)},ln=(X=/^\s+|\s+$/g,function(n){return n.replace(X,"")}),fn=function(n){return 0
=n.startCol&&o<=n.finishRow&&u>=n.startRow},Mt=function(n,e){return e.column>=n.startCol&&e.column+e.colspan-1<=n.finishCol&&e.row>=n.startRow&&e.row+e.rowspan-1<=n.finishRow},Nt=function(n,e,t){var r=Et.findItem(n,e,Mn),o=Et.findItem(n,t,Mn);return r.bind(function(r){return o.map(function(n){return e=r,t=n,{startRow:Math.min(e.row,t.row),startCol:Math.min(e.column,t.column),finishRow:Math.max(e.row+e.rowspan-1,t.row+t.rowspan-1),finishCol:Math.max(e.column+e.colspan-1,t.column+t.colspan-1)};var e,t})})},jt=function(e,n,t){return Nt(e,n,t).bind(function(n){return function(n,e){for(var t=!0,r=S(Mt,e),o=e.startRow;o<=e.finishRow;o++)for(var u=e.startCol;u<=e.finishCol;u++)t=t&&Et.getAt(n,o,u).exists(r);return t?x.some(e):x.none()}(e,n)})},Wt=function(t,n,e){return Nt(t,n,e).map(function(n){var e=Et.filterItems(t,S(Pt,n));return B(e,function(n){return n.element})})},Lt=function(n,e){return Et.findItem(n,e,function(n,e){return jn(e,n)}).map(function(n){return n.element})},zt=function(i,c,a){return st(i).bind(function(n){var r,e,o,u,t=Ft(n);return r=t,e=i,o=c,u=a,Et.findItem(r,e,Mn).bind(function(n){var e=0
=r.length-1)return x.none();var n=r[o].fold(function(){var n,e,t=(n=r.slice(0,o),(e=R.call(n,0)).reverse(),e);return K(t,function(n,e){return n.map(function(n){return{value:n,delta:e+1}})})},function(n){return x.some({value:n,delta:0})}),e=r[o+1].fold(function(){var n=r.slice(o+1);return K(n,function(n,e){return n.map(function(n){return{value:n,delta:e+1}})})},function(n){return x.some({value:n,delta:1})});return n.bind(function(t){return e.map(function(n){var e=n.delta+t.delta;return Math.abs(n.value-t.value)/e})})},Hr=function(e,t){return function(n){return"rtl"===qr(n)?t:e}},qr=function(n){return"rtl"===Xe(n,"direction")?"rtl":"ltr"},Vr=Mr("height",function(n){var e=n.dom;return Se(n)?e.getBoundingClientRect().height:e.offsetHeight}),Ur=function(n){return Vr.get(n)},Kr=function(n){return Vr.getOuter(n)},$r=function(t,r){return{left:t,top:r,translate:function(n,e){return $r(t+n,r+e)}}},Gr=$r,Xr=function(n,e){return n!==undefined?n:e!==undefined?e:0},Yr=function(n){var e=n.dom.ownerDocument,t=e.body,r=e.defaultView,o=e.documentElement;if(t===n.dom)return Gr(t.offsetLeft,t.offsetTop);var u=Xr(null==r?void 0:r.pageYOffset,o.scrollTop),i=Xr(null==r?void 0:r.pageXOffset,o.scrollLeft),c=Xr(o.clientTop,t.clientTop),a=Xr(o.clientLeft,t.clientLeft);return Jr(n).translate(i-a,u-c)},Jr=function(n){var e,t=n.dom,r=t.ownerDocument.body;return r===t?Gr(r.offsetLeft,r.offsetTop):Se(n)?(e=t.getBoundingClientRect(),Gr(e.left,e.top)):Gr(0,0)},Qr=function(n,e){return{row:n,y:e}},Zr=function(n,e){return{col:n,x:e}},no=function(n){return Yr(n).left+Wr(n)},eo=function(n){return Yr(n).left},to=function(n,e){return Zr(n,eo(e))},ro=function(n,e){return Zr(n,no(e))},oo=function(n){return Yr(n).top},uo=function(n,e){return Qr(n,oo(e))},io=function(n,e){return Qr(n,oo(e)+Kr(e))},co=function(t,e,r){if(0===r.length)return[];var n=B(r.slice(1),function(n,e){return n.map(function(n){return t(e,n)})}),o=r[r.length-1].map(function(n){return e(r.length-1,n)});return n.concat([o])},ao={delta:d,positions:function(n){return co(uo,io,n)},edge:oo},lo=Hr({delta:d,edge:eo,positions:function(n){return co(to,ro,n)}},{delta:function(n){return-n},edge:no,positions:function(n){return co(ro,to,n)}}),fo={delta:function(n,e){return lo(e).delta(n,e)},positions:function(n,e){return lo(e).positions(n,e)},edge:function(n){return lo(n).edge(n)}},so={unsupportedLength:["em","ex","cap","ch","ic","rem","lh","rlh","vw","vh","vi","vb","vmin","vmax","cm","mm","Q","in","pc","pt","px"],fixed:["px","pt"],relative:["%"],empty:[""]},mo=(ur="[eE][+-]?[0-9]+",cr=["Infinity",(or="[0-9]+")+"\\."+(ir=function(n){return"(?:"+n+")?"})(or)+ir(ur),"\\."+or+ir(ur),or+ir(ur)].join("|"),new RegExp("^([+-]?(?:"+cr+"))(.*)$")),go=function(n,o){return x.from(mo.exec(n)).bind(function(n){var e,t=Number(n[1]),r=n[2];return e=r,k(o,function(n){return k(so[n],function(n){return e===n})})?x.some({value:t,unit:r}):x.none()})},po=function(){var n=kn().browser;return n.isIE()||n.isEdge()},ho=function(n,e,t){return r=Xe(n,e),o=t,u=parseFloat(r),isNaN(u)?o:u;var r,o,u},vo=function(n){return po()?(t=(e=n).dom.getBoundingClientRect().height,"border-box"===Xe(e,"box-sizing")?t:t-ho(e,"padding-top",0)-ho(e,"padding-bottom",0)-(ho(e,"border-top-width",0)+ho(e,"border-bottom-width",0))):ho(n,"height",Ur(n));var e,t},bo=function(n){return po()?(t=(e=n).dom.getBoundingClientRect().width,"border-box"===Xe(e,"box-sizing")?t:t-ho(e,"padding-left",0)-ho(e,"padding-right",0)-(ho(e,"border-left-width",0)+ho(e,"border-right-width",0))):ho(n,"width",jr(n));var e,t},wo=/(\d+(\.\d+)?)%/,yo=/(\d+(\.\d+)?)px|em/,Co=function(n,e){var t,r=(t=n,x.from(t.dom.offsetParent).map(Bn.fromDom).getOr(Te(le(n))));return e(n)/e(r)*100},xo=function(n,e){$e(n,"width",e+"px")},So=function(n,e){$e(n,"width",e+"%")},To=function(n,e){$e(n,"height",e+"px")},Ro=function(n,e,t,r){var o,u,i,c,a,l=parseInt(n,10);return an(n,"%")&&"table"!==ne(e)?(u=l,i=t,c=r,a=st(o=e).map(function(n){var e=i(n);return Math.floor(u/100*e)}).getOr(u),c(o,a),a):l},Do=function(n){var e,t=Je(e=n,"height").getOrThunk(function(){return vo(e)+"px"});return t?Ro(t,n,Ur,To):Ur(n)},Oo=function(n){return Je(n,"width").fold(function(){return x.from(Fe(n,"width"))},function(n){return x.some(n)})},Ao=function(n,e){return n/e.pixelWidth()*100},ko=function(e,t){return Oo(e).fold(function(){var n=jr(e);return Ao(n,t)},function(n){return function(n,e,t){var r=wo.exec(e);if(null!==r)return parseFloat(r[1]);var o=bo(n);return Ao(o,t)}(e,n,t)})},Io=function(e,t){return Oo(e).fold(function(){return bo(e)},function(n){return function(n,e,t){var r=yo.exec(e);if(null!==r)return parseInt(r[1],10);var o=wo.exec(e);if(null===o)return bo(n);var u=parseFloat(o[1]);return u/100*t.pixelWidth()}(e,n,t)})},Bo=function(n){return t="rowspan",Do(e=n)/nt(e,t);var e,t},Eo=function(n,e,t){$e(n,"width",e+t)},Po=function(n){return Co(n,jr)+"%"},Mo=b(wo),No=b(yo),jo=ae("col"),Wo=function(n,e,t){return Je(n,e).fold(function(){return t(n)+"px"},function(n){return n})},Lo=function(n,e){return Wo(n,"width",function(n){return jo(n)?jr(n):Io(n,e)})},zo=function(n){return Wo(n,"height",Bo)},_o=function(n,e){return Je(n,e).isSome()},Fo=function(n,e,t,r,o,u){return n.filter(r).fold(function(){return u(Fr(t,e))},function(n){return o(n)})},Ho=function(n,e,i,c,a){var t,l=Lr(n,function(n){return _o(n,"width")}),r=Et.hasColumns(n)?(t=n,B(Et.justColumns(t),function(n){return x.from(n.element)})):l,f=[x.some(fo.edge(e))].concat(B(fo.positions(l,e),function(n){return n.map(function(n){return n.x})})),s=h(et);return B(r,function(n,u){return Fo(n,u,f,s,function(n){if(!jo(r=n)||_o(r,"width"))return i(n,a);var e,t,r,o=(e=l[u],t=d,e!==undefined&&null!==e?t(e):x.none());return Fo(o,u,f,s,function(n){return c(x.some(jr(n)))},c)},c)})},qo=function(n){return n.map(function(n){return n+"px"}).getOr("")},Vo=function(n,e,t){return Ho(n,e,Io,function(n){return n.getOrThunk(t.minCellWidth)},t)},Uo=function(n,e,t,r,o){var u=_r(n),i=[x.some(t.edge(e))].concat(B(t.positions(u,e),function(n){return n.map(function(n){return n.y})}));return B(u,function(n,e){return Fo(n,e,i,h(tt),r,o)})},Ko=function(n){var e=n;return{get:function(){return e},set:function(n){e=n}}},$o=function(t){var n=function(){return jr(t)},e=b(0);return{width:n,pixelWidth:n,getWidths:function(n,e){return Vo(n,t,e)},getCellDelta:e,singleColumnWidth:b([0]),minCellWidth:e,setElementWidth:C,adjustTableWidth:C,isRelative:!0,label:"none"}},Go=function(n,r){var o=Ko(parseFloat(n)),u=Ko(jr(r));return{width:o.get,pixelWidth:u.get,getWidths:function(n,e){return Ho(n,r,ko,function(n){return n.fold(function(){return t.minCellWidth()},function(n){return n/t.pixelWidth()*100})},t=e);var t},getCellDelta:function(n){return n/u.get()*100},singleColumnWidth:function(n,e){return[100-n]},minCellWidth:function(){return ot()/u.get()*100},setElementWidth:So,adjustTableWidth:function(n){var e=o.get(),t=e+n/100*e;So(r,t),o.set(t),u.set(jr(r))},isRelative:!0,label:"percent"}},Xo=function(n,t){var r=Ko(n),o=r.get;return{width:o,pixelWidth:o,getWidths:function(n,e){return Vo(n,t,e)},getCellDelta:d,singleColumnWidth:function(n,e){return[Math.max(ot(),n+e)-n]},minCellWidth:ot,setElementWidth:xo,adjustTableWidth:function(n){var e=o()+n;xo(t,e),r.set(e)},isRelative:!1,label:"pixel"}},Yo=function(e){return Oo(e).fold(function(){return $o(e)},function(n){return function(n,e){var t=Mo().exec(e);if(null!==t)return Go(t[1],n);var r=No().exec(e);if(null!==r){var o=parseInt(r[1],10);return Xo(o,n)}var u=jr(n);return Xo(u,n)}(e,n)})},Jo=Xo,Qo=Go,Zo=function(n,e,t,r){for(var o,u,i,c=e.grid.columns,a=e.grid.rows,l=0;l
t.maxRow||s
t.maxCol||(Et.getAt(e,l,s).filter(r).isNone()?(o=f,0,u=n[l].element,i=Bn.fromTag("td"),Ut(i,Bn.fromTag("br")),(o?Ut:Vt)(u,i)):f=!0)}},nu=function(n,e){var t,u,r,i,c,a,l,f,s,o=function(n){return En(n.element,e)},d=Ir(n),m=ht(d),g=Yo(n),p=Et.generate(m),h=(u=o,r=(t=p).grid.columns,i=t.grid.rows,c=r,l=a=0,f=[],s=[],_n(t.access,function(n){var e,t,r,o;f.push(n),u(n)&&(s.push(n),t=(e=n.row)+n.rowspan-1,o=(r=n.column)+n.colspan-1,e
e.maxCol)&&Yt(n.element)});var o=P(it(n,"tr"),function(n){return 0===n.dom.childElementCount});E(o,Yt),e.minCol!==e.maxCol&&e.minRow!==e.maxRow||E(it(n,"th,td"),function(n){qe(n,"rowspan"),qe(n,"colspan")}),qe(n,Dt),qe(n,"data-snooker-col-series"),Yo(n).adjustTableWidth(r)}(d,h,p,function(n,e,t,r){if(0===r.minCol&&e.grid.columns===r.maxCol+1)return 0;var o=Vo(e,n,t),u=N(o,function(n,e){return n+e},0),i=N(o.slice(r.minCol,r.maxCol+1),function(n,e){return n+e},0)/u*t.pixelWidth()-t.pixelWidth();return t.getCellDelta(i)}(n,Et.fromTable(n),g,h)),d},eu=function(n){return"img"===ne(n)?1:nr(n).fold(function(){return pe(n).length},function(n){return n.length})},tu=["img","br"],ru=function(n){return nr(n).filter(function(n){return 0!==n.trim().length||-1
=e.column&&n<=Tt(t[0])+e.column})},xa=function(n,u,e,i,c){var t,r,o,a,l,f,s=At(u),d=(t=n,o=s,a=Tt((r=u)[0]),l=Rt(r).cols.length+t.row,f=I(a-t.column,function(n){return n+t.column}),{row:l,column:j(f,function(e){return _(o,function(n){return n!==e})}).getOr(a-1)}),m=Rt(e).rows,g=Ca(d,m,s);return function(n,e,t){if(n.row>=e.length||n.column>Tt(e[0]))return ma.error("invalid start address out of table bounds, row: "+n.row+", column: "+n.column);var r=e.slice(n.row),o=r[0].cells.slice(n.column),u=Tt(t[0]),i=t.length;return ma.value({rowDelta:r.length-i,colDelta:o.length-u})}(d,u,m).map(function(n){var e=$($({},n),{colDelta:n.colDelta-g.length}),t=wa(u,e,i),r=At(t),o=Ca(d,m,r);return ya(d,t,m,i,c,o)})},Sa=function(t,n,e,r,o){var u,i,c,a;u=n,i=t,c=o,a=r.cell,0
=e.grid.columns&&n.isLocked})},tl=function(n,e){var t=Lr(n),r=Ea(e);return N(r,function(n,e){return n+t[e.column].map(Wr).getOr(0)},0)},rl=function(t){return function(e,n){return ra(e,n).filter(function(n){return!(t?nl:el)(e,n)}).map(function(n){return{details:n,pixelDelta:tl(e,n)}})}},ol=function(t){return function(e,n){return ta(e,n).filter(function(n){return!(t?nl:el)(e,n.cells)})}},ul=na(function(n,e,t,r){var o=e[0].row,u=Xa(e),i=M(u,function(n,e){return{grid:Ra(n.grid,o,e.row+n.delta,t,r.getOrInit),delta:n.delta+1}},{grid:n,delta:0}).grid;return Ga(i,o,e[0].column)},ra,C,C,Na),il=na(function(n,e,t,r){var o=Xa(e),u=o[o.length-1],i=u.row+u.rowspan,c=M(o,function(n,e){return Ra(n,i,e.row,t,r.getOrInit)},n);return Ga(c,i,e[0].column)},ra,C,C,Na),cl=na(function(n,e,t,r){var o=e.details,u=Ea(o),i=u[0].column,c=M(u,function(n,e){return{grid:Da(n.grid,i,e.column+n.delta,t,r.getOrInit),delta:n.delta+1}},{grid:n,delta:0}).grid;return Ga(c,o[0].row,i)},rl(!0),Za,C,Na),al=na(function(n,e,t,r){var o=e.details,u=o[o.length-1],i=u.column+u.colspan,c=Ea(o),a=M(c,function(n,e){return Da(n,i,e.column,t,r.getOrInit)},n);return Ga(a,o[0].row,i)},rl(!1),Za,C,Na),ll=na(function(n,e,t,r){var o,u,i=Ea(e.details),c=(o=n,u=B(i,function(n){return n.column}),z(o,function(n){var e=n.cells,t=M(u,function(n,e){return 0<=e&&e
=t&&n.column
=t&&n.column
=o&&n.column
',u.insertBefore(i,u.firstChild)),""===a.align?Yl(o,u):Xl(o,u,a.align)),o.focus(),o.addVisual(),0
=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}),$f=function(t,r,n,e,o){var u=function(n){var e=t.dom.createRange();return e.setStart(r.dom,n),e.collapse(!0),e},i=Zt(r).length,c=function(n,e,t,r,o){if(0===o)return 0;if(e===r)return o-1;for(var u=r,i=1;i
r.left&&o.left
t.right;var e,t})});var t},fd={point:function(n){return n.bottom},adjuster:function(n,e,t,r,o){var u=ed(o,5);return Math.abs(t.bottom-r.bottom)<1||t.top>o.bottom?ad.retry(u):t.top===o.bottom?ad.retry(ed(o,1)):ld(n,e,o)?ad.retry(rd(u,5,0)):ad.none()},move:ed,gather:Ks},sd=function(t,r,o,u,i){return 0===i?x.some(u):(a=t,l=u.left,f=r.point(u),a.elementFromPoint(l,f).filter(function(n){return"table"===ne(n)}).isSome()?(e=u,c=i-1,sd(t,n=r,o,n.move(e,5),c)):t.situsFromPoint(u.left,r.point(u)).bind(function(n){return n.start.fold(x.none,function(e){return cd(t,e).bind(function(n){return r.adjuster(t,e,n,o,u).fold(x.none,function(n){return sd(t,r,o,n,i-1)})}).orThunk(function(){return x.some(u)})},x.none)}));var n,e,c,a,l,f},dd=function(e,t,n){var r,o,u,i=e.move(n,5),c=sd(t,e,n,i,100).getOr(i);return o=c,u=t,((r=e).point(o)>u.getInnerHeight()?x.some(r.point(o)-u.getInnerHeight()):r.point(o)<0?x.some(-r.point(o)):x.none()).fold(function(){return t.situsFromPoint(c.left,e.point(c))},function(n){return t.scrollBy(0,n),t.situsFromPoint(c.left,e.point(c)-n)})},md={tryUp:S(dd,{point:function(n){return n.top},adjuster:function(n,e,t,r,o){var u=td(o,5);return Math.abs(t.top-r.top)<1||t.bottom
=t.grid.columns&&(n.onLast=!0)),n},{onAny:!1,onFirst:!1,onLast:!1});return{mergeable:ca(t,o).isSome(),unmergeable:aa(t,o).isSome(),locked:r}})},l=function(){o.set(Y(c)()),t=o.get().bind(a),E(u.get(),function(n){return n()})},f=function(e,t){var r=function(){return o.get().fold(function(){e.setDisabled(!0)},function(n){e.setDisabled(t(n))})};return r(),u.set(u.get().concat([r])),function(){u.set(P(u.get(),function(n){return n!==r}))}},s=function(e){return t.exists(function(n){return n.locked[e]})};return n.on("NodeChange ExecCommand TableSelectorChange",l),{onSetupTable:function(n){return f(n,function(n){return!1})},onSetupCellOrRow:function(n){return f(n,function(n){return i(n.element)})},onSetupColumn:function(e){return function(n){return f(n,function(n){return i(n.element)||s(e)})}},onSetupPasteable:function(e){return function(n){return f(n,function(n){return i(n.element)||e().isNone()})}},onSetupPasteableColumn:function(e,t){return function(n){return f(n,function(n){return i(n.element)||e().isNone()||s(t)})}},onSetupMergeable:function(n){return f(n,function(n){return e("mergeable")})},onSetupUnmergeable:function(n){return f(n,function(n){return e("unmergeable")})},resetTargets:l,targets:function(){return o.get()}}},qd=function(a){var n,e,t,r,o,u,i,c,l=(n=function(){return bu(a)},e=function(){return Il(Du(a))},t=Bu.selectedSelector,{get:function(){return wr(n(),t).fold(function(){return e().map(Dr).getOrThunk(Tr)},function(n){return Rr(n)})}}),f=Hd(a,l),s=Nc(a),d=Fd(a,s.lazyResize,f),m=Pl(a,s.lazyWire,l),g=(r=Ko(x.none()),o=Ko(x.none()),u=function(n){n.set(x.none())},{getRows:r.get,setRows:function(n){r.set(n),u(o)},clearRows:function(){return u(r)},getColumns:o.get,setColumns:function(n){o.set(n),u(r)},clearColumns:function(){return u(o)}});return Of(a,m,d,l,g),Af(a,m,l),Pu(a,l,m,d),function(e,n,t){var r=function(n){return function(){return e.execCommand(n)}},o=function(n){e.execCommand("mceInsertTable",!1,{rows:n.numRows,columns:n.numColumns})},u={text:"Table properties",onSetup:n.onSetupTable,onAction:r("mceTableProps")},i={text:"Delete table",icon:"table-delete-table",onSetup:n.onSetupTable,onAction:r("mceTableDelete")};e.ui.registry.addMenuItem("tableinsertrowbefore",{text:"Insert row before",icon:"table-insert-row-above",onAction:r("mceTableInsertRowBefore"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tableinsertrowafter",{text:"Insert row after",icon:"table-insert-row-after",onAction:r("mceTableInsertRowAfter"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tabledeleterow",{text:"Delete row",icon:"table-delete-row",onAction:r("mceTableDeleteRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablerowprops",{text:"Row properties",icon:"table-row-properties",onAction:r("mceTableRowProps"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablecutrow",{text:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablecopyrow",{text:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablepasterowbefore",{text:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(t.getRows)}),e.ui.registry.addMenuItem("tablepasterowafter",{text:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(t.getRows)});e.ui.registry.addMenuItem("tableinsertcolumnbefore",{text:"Insert column before",icon:"table-insert-column-before",onAction:r("mceTableInsertColBefore"),onSetup:n.onSetupColumn("onFirst")}),e.ui.registry.addMenuItem("tableinsertcolumnafter",{text:"Insert column after",icon:"table-insert-column-after",onAction:r("mceTableInsertColAfter"),onSetup:n.onSetupColumn("onLast")}),e.ui.registry.addMenuItem("tabledeletecolumn",{text:"Delete column",icon:"table-delete-column",onAction:r("mceTableDeleteCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addMenuItem("tablecutcolumn",{text:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addMenuItem("tablecopycolumn",{text:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addMenuItem("tablepastecolumnbefore",{text:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(t.getColumns,"onFirst")}),e.ui.registry.addMenuItem("tablepastecolumnafter",{text:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(t.getColumns,"onLast")});e.ui.registry.addMenuItem("tablecellprops",{text:"Cell properties",icon:"table-cell-properties",onAction:r("mceTableCellProps"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addMenuItem("tablemergecells",{text:"Merge cells",icon:"table-merge-cells",onAction:r("mceTableMergeCells"),onSetup:n.onSetupMergeable}),e.ui.registry.addMenuItem("tablesplitcells",{text:"Split cell",icon:"table-split-cells",onAction:r("mceTableSplitCells"),onSetup:n.onSetupUnmergeable});!1===e.getParam("table_grid",!0,"boolean")?e.ui.registry.addMenuItem("inserttable",{text:"Table",icon:"table",onAction:r("mceInsertTable")}):e.ui.registry.addNestedMenuItem("inserttable",{text:"Table",icon:"table",getSubmenuItems:function(){return[{type:"fancymenuitem",fancytype:"inserttable",onAction:o}]}}),e.ui.registry.addMenuItem("inserttabledialog",{text:"Insert table",icon:"table",onAction:r("mceInsertTable")}),e.ui.registry.addMenuItem("tableprops",u),e.ui.registry.addMenuItem("deletetable",i),e.ui.registry.addNestedMenuItem("row",{type:"nestedmenuitem",text:"Row",getSubmenuItems:function(){return"tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter"}}),e.ui.registry.addNestedMenuItem("column",{type:"nestedmenuitem",text:"Column",getSubmenuItems:function(){return"tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter"}}),e.ui.registry.addNestedMenuItem("cell",{type:"nestedmenuitem",text:"Cell",getSubmenuItems:function(){return"tablecellprops tablemergecells tablesplitcells"}}),e.ui.registry.addContextMenu("table",{update:function(){return n.resetTargets(),n.targets().fold(function(){return""},function(n){return"caption"===ne(n.element)?"tableprops deletetable":"cell row column | advtablesort | tableprops deletetable"})}})}(a,f,g),function(e,n,t){e.ui.registry.addMenuButton("table",{tooltip:"Table",icon:"table",fetch:function(n){return n("inserttable | cell row column | advtablesort | tableprops deletetable")}});var r=function(n){return function(){return e.execCommand(n)}};e.ui.registry.addButton("tableprops",{tooltip:"Table properties",onAction:r("mceTableProps"),icon:"table",onSetup:n.onSetupTable}),e.ui.registry.addButton("tabledelete",{tooltip:"Delete table",onAction:r("mceTableDelete"),icon:"table-delete-table",onSetup:n.onSetupTable}),e.ui.registry.addButton("tablecellprops",{tooltip:"Cell properties",onAction:r("mceTableCellProps"),icon:"table-cell-properties",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablemergecells",{tooltip:"Merge cells",onAction:r("mceTableMergeCells"),icon:"table-merge-cells",onSetup:n.onSetupMergeable}),e.ui.registry.addButton("tablesplitcells",{tooltip:"Split cell",onAction:r("mceTableSplitCells"),icon:"table-split-cells",onSetup:n.onSetupUnmergeable}),e.ui.registry.addButton("tableinsertrowbefore",{tooltip:"Insert row before",onAction:r("mceTableInsertRowBefore"),icon:"table-insert-row-above",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tableinsertrowafter",{tooltip:"Insert row after",onAction:r("mceTableInsertRowAfter"),icon:"table-insert-row-after",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tabledeleterow",{tooltip:"Delete row",onAction:r("mceTableDeleteRow"),icon:"table-delete-row",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablerowprops",{tooltip:"Row properties",onAction:r("mceTableRowProps"),icon:"table-row-properties",onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tableinsertcolbefore",{tooltip:"Insert column before",onAction:r("mceTableInsertColBefore"),icon:"table-insert-column-before",onSetup:n.onSetupColumn("onFirst")}),e.ui.registry.addButton("tableinsertcolafter",{tooltip:"Insert column after",onAction:r("mceTableInsertColAfter"),icon:"table-insert-column-after",onSetup:n.onSetupColumn("onLast")}),e.ui.registry.addButton("tabledeletecol",{tooltip:"Delete column",onAction:r("mceTableDeleteCol"),icon:"table-delete-column",onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addButton("tablecutrow",{tooltip:"Cut row",icon:"cut-row",onAction:r("mceTableCutRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablecopyrow",{tooltip:"Copy row",icon:"duplicate-row",onAction:r("mceTableCopyRow"),onSetup:n.onSetupCellOrRow}),e.ui.registry.addButton("tablepasterowbefore",{tooltip:"Paste row before",icon:"paste-row-before",onAction:r("mceTablePasteRowBefore"),onSetup:n.onSetupPasteable(t.getRows)}),e.ui.registry.addButton("tablepasterowafter",{tooltip:"Paste row after",icon:"paste-row-after",onAction:r("mceTablePasteRowAfter"),onSetup:n.onSetupPasteable(t.getRows)}),e.ui.registry.addButton("tablecutcol",{tooltip:"Cut column",icon:"cut-column",onAction:r("mceTableCutCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addButton("tablecopycol",{tooltip:"Copy column",icon:"duplicate-column",onAction:r("mceTableCopyCol"),onSetup:n.onSetupColumn("onAny")}),e.ui.registry.addButton("tablepastecolbefore",{tooltip:"Paste column before",icon:"paste-column-before",onAction:r("mceTablePasteColBefore"),onSetup:n.onSetupPasteableColumn(t.getColumns,"onFirst")}),e.ui.registry.addButton("tablepastecolafter",{tooltip:"Paste column after",icon:"paste-column-after",onAction:r("mceTablePasteColAfter"),onSetup:n.onSetupPasteableColumn(t.getColumns,"onLast")}),e.ui.registry.addButton("tableinsertdialog",{tooltip:"Insert table",onAction:r("mceInsertTable"),icon:"table"})}(a,f,g),0<(c=(i=a).getParam("table_toolbar","tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol")).length&&i.ui.registry.addContextToolbar("table",{predicate:function(n){return i.dom.is(n,"table")&&i.getBody().contains(n)},items:c,scope:"node",position:"node"}),a.on("PreInit",function(){a.serializer.addTempAttr(Bu.firstSelected),a.serializer.addTempAttr(Bu.lastSelected),a.formatter.register(kf)}),a.getParam("table_tab_navigation",!0,"boolean")&&a.on("keydown",function(n){var e,t,r,o,u,i,c;t=a,r=d,(e=n).keyCode===Cs.TAB&&(o=bu(t),u=function(n){var e=ne(n);return Mn(n,o)||A(Ds,e)},i=t.selection.getRng(),c=Bn.fromDom(e.shiftKey?i.startContainer:i.endContainer),at(c,u).each(function(n){e.preventDefault(),st(n,u).each(r.clear),t.selection.collapse(e.shiftKey),(e.shiftKey?Ss:xs)(t,u,n).each(function(n){t.selection.setRng(n)})}))}),a.on("remove",function(){s.destroy()}),ql(a,g,s,f)};Or.add("table",qd)}();