/* Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license */ (function(){function y(a){return CKEDITOR.env.ie?a.$.clientWidth:parseInt(a.getComputedStyle("width"),10)}function r(a,c){var b=a.getComputedStyle("border-"+c+"-width"),h={thin:"0px",medium:"1px",thick:"2px"};0>b.indexOf("px")&&(b=b in h&&"none"!=a.getComputedStyle("border-style")?h[b]:0);return parseInt(b,10)}function F(a){a=a.$.rows;for(var c=0,b,h,e,k=0,g=a.length;kc&&(c=b,h=e);return h}function G(a){function c(a){a&&(a=new CKEDITOR.dom.element(a),e+=a.$.offsetHeight, k||(k=a.getDocumentPosition()))}var b=[],h=-1,e=0,k=null,g="rtl"==a.getComputedStyle("direction"),f=F(a);c(a.$.tHead);c(a.$.tBodies[0]);c(a.$.tFoot);if(f)for(var d=0,n=f.cells.length;dg.x+g.width))return g=null,x=l=0,f.removeListener("mouseup",e),d.removeListener("mousedown",h),d.removeListener("mousemove",k), f.getBody().setStyle("cursor","auto"),w?d.remove():d.hide(),0;a-=Math.round(d.$.offsetWidth/2);if(x){if(a==B||a==D)return 1;a=Math.max(a,B);a=Math.min(a,D);l=a-t}d.setStyle("left",n(a));return 1}}function A(a){var c=a.data.getTarget();if("mouseout"==a.name){if(!c.is("table"))return;for(var b=new CKEDITOR.dom.element(a.data.$.relatedTarget||a.data.$.toElement);b&&b.$&&!b.equals(c)&&!b.is("body");)b=b.getParent();if(!b||b.equals(c))return}c.getAscendant("table",1).removeCustomData("_cke_table_pillars"); a.removeListener()}var n=CKEDITOR.tools.cssLength,w=CKEDITOR.env.ie&&(CKEDITOR.env.ie7Compat||CKEDITOR.env.quirks);CKEDITOR.plugins.add("tableresize",{requires:"tabletools",init:function(a){a.on("contentDom",function(){var c,b=a.editable();b.attachListener(b.isInline()?b:a.document,"mousemove",function(b){b=b.data;var e=b.getTarget();if(e.type==CKEDITOR.NODE_ELEMENT){var k=b.getPageOffset().x;if(c&&c.move(k))z(b);else if(e.is("table")||e.getAscendant({thead:1,tbody:1,tfoot:1},1))if(e=e.getAscendant("table", 1),a.editable().contains(e)){(b=e.getCustomData("_cke_table_pillars"))||(e.setCustomData("_cke_table_pillars",b=G(e)),e.on("mouseout",A),e.on("mousedown",A));a:{for(var e=0,g=b.length;e=f.x&&k<=f.x+f.width){k=f;break a}}k=null}k&&(!c&&(c=new H(a)),c.attachTo(k))}}})})}})})();