!function(){function e(e){return""!==e&&e}function t(e){return/(o|u)l/i.test(e.parent.name)?(i.elements.replaceWithChildren(e),!1):e}function n(e){var t=e.parent;e=function(e){return NEW_CKEDITOR.tools.array.map(e,(function(e){return Number(e.attributes.width)}))}(e.children);var n=function(e){return NEW_CKEDITOR.tools.array.reduce(e,(function(e,t){return e+t}),0)}(e);t.attributes.width=n,function e(t,n){var r,i;if(t&&"tr"===t.name){for(r=t.children,i=0;i<n.length&&r[i];i++)r[i].attributes.width=n[i];e(t.next,n)}}(function(e){return(e=NEW_CKEDITOR.tools.array.find(e.children,(function(e){return e.name&&("tr"===e.name||"tbody"===e.name)})))&&e.name&&"tbody"===e.name?e.children[0]:e}(t),e)}var r=NEW_CKEDITOR.plugins.pastetools,i=r.filters.common,l=i.styles;NEW_CKEDITOR.plugins.pastetools.filters.gdocs={rules:function(r,a,u){return{elementNames:[[/^meta/,""]],comment:function(){return!1},attributes:{id:function(e){return!/^docs\-internal\-guid\-/.test(e)},dir:function(e){return"ltr"!==e&&e},style:function(t,n){return e(l.normalizedStyles(n,a))},class:function(t){return e(t.replace(/kix-line-break/gi,""))}},elements:{div:function(e){var t=1===e.children.length,n="table"===e.children[0].name;"div"===e.name&&t&&n&&delete e.attributes.align},colgroup:n,span:function(e){l.createStyleStack(e,u,a,/vertical-align|white-space|font-variant/);var t=e.attributes.style;/vertical-align:\s*super/.test(t)?e.name="sup":/vertical-align:\s*sub/.test(t)&&(e.name="sub"),e.attributes.style=t.replace(/vertical-align\s*.+?;?/,"")},b:function(e){return i.elements.replaceWithChildren(e),!1},p:function(e){if(e.parent&&"li"===e.parent.name)return i.elements.replaceWithChildren(e),!1},ul:function(e){return l.pushStylesLower(e),t(e)},ol:function(e){return l.pushStylesLower(e),t(e)},li:function(e){l.pushStylesLower(e);var t=e.children;return 1===t.length&&/(o|u)l/i.test(t[0].name)&&(i.elements.replaceWithChildren(e),e=!1),e}}}}},NEW_CKEDITOR.pasteFilters.gdocs=r.createFilter({rules:[i.rules,NEW_CKEDITOR.plugins.pastetools.filters.gdocs.rules]})}();