/*

Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license

*/ (function()function u(){return!1}function x(a,b){var c,d=[];a.filterChildren(b);for(c=a.children.length-1;0<=c;c--)d.unshift(a.children[c]),a.children[c].remove();c=a.attributes;var f=a,e=!0,h;for(h in c)if(e)e=!1;else{var l=new CKEDITOR.htmlParser.element(a.name);l.attributes[h]=c[h];f.add(l);f=l;delete c[h]}for(c=0;c/g,“]–x3e”);var d=CKEDITOR.htmlParser.fragment.fromHtml(a);q=new CKEDITOR.htmlParser.filter({root:function(e){e.filterChildren(q);CKEDITOR.plugins.pastefromword.lists.cleanup(g.createLists(e))},elementNames:[[/^?xml:namespace$/,“”],[/^v:shapetype/,“”],[new RegExp(y.join(“|”)),“”]],elements:{a:function(e){if(e.attributes.name){if(“_GoBack”== e.attributes.name){delete e.name;return}if(e.attributes.name.match(/^OLE_LINKd+$/)){delete e.name;return}}if(e.attributes.href&&e.attributes.href.match(/#.+$/)){var a=e.attributes.href.match(/#(.+)$/)[1];w[a]=e}e.attributes.name&&w[e.attributes.name]&&(e=w[e.attributes.name],e.attributes.href=e.attributes.href.replace(/.*#(.*)$/,“#$1”))},div:function(e){k.createStyleStack(e,q,b)},img:function(e){if(e.parent&&e.parent.attributes){var a=e.parent.attributes;(a=a.style||a.STYLE)&&a.match(/mso-list:s?Ignore/)&& (e.attributes[“cke-ignored”]=!0)}k.mapStyles(e,{width:function(a){k.setStyle(e,“width”,a+“px”)},height:function(a){k.setStyle(e,“height”,a+“px”)}});e.attributes.src&&e.attributes.src.match(/^file:///)&&e.attributes.alt&&e.attributes.alt.match(/^https?:///)&&(e.attributes.src=e.attributes.alt)},p:function(a){a.filterChildren(q);if(a.attributes.style&&a.attributes.style.match(/display:s*none/i))return!1;if(g.thisIsAListItem(b,a))t.isEdgeListItem(b,a)&&t.cleanupEdgeListItem(a),g.convertToFakeListItem(b, a),n.array.reduce(a.children,function(a,b){“p”===b.name&&(0c&&(c=a._tdBorders[d],b=d);k.setStyle(a,“border”,b);c=(b=a.parent)&& b.parent;if(b.name&&“div”===b.name&&b.attributes.align&&1===n.objectKeys(b.attributes).length&&1===b.children.length){a.attributes.align=b.attributes.align;d=b.children.splice(0);a.remove();for(a=d.length-1;0<=a;a--)c.add(d[a],b.getIndex());b.remove()}},td:function(a){var c=a.getAscendant("table"),d=c._tdBorders,f=["border","border-top","border-right","border-bottom","border-left"],c=n.parseCssText(c.attributes.style),m=c.background||c.BACKGROUND;m&&k.setStyle(a,"background",m,!0);(c=c["background-color"]|| c["BACKGROUND-COLOR"])&&k.setStyle(a,"background-color",c,!0);var c=n.parseCssText(a.attributes.style),p;for(p in c)m=c[p],delete c[p],c[p.toLowerCase()]=m;for(p=0;p/)?!0:!1},convertToFakeListItem:function(a,b){t.isDegenerateListItem(a,b)&&t.assignListLevels(a,b);this.getListItemInfo(b);if(!b.attributes[“cke-dissolved”]){var c; b.forEach(function(a){!c&&“img”==a.name&&a.attributes[“cke-ignored”]&&“*”==a.attributes.alt&&(c=“·”,a.remove())},CKEDITOR.NODE_ELEMENT);b.forEach(function(a){c||a.value.match(/^ /)||(c=a.value)},CKEDITOR.NODE_TEXT);if(“undefined”==typeof c)return;b.attributes[“cke-symbol”]=c.replace(/(?: | ).*$/,“”);g.removeSymbolText(b)}if(b.attributes.style){var d=n.parseCssText(b.attributes.style);d[“margin-left”]&&(delete d[“margin-left”],b.attributes.style=CKEDITOR.tools.writeCssText(d))}b.name=“cke:li”}, convertToRealListItems:function(a){var b=[];a.forEach(function(a){“cke:li”==a.name&&(a.name=“li”,b.push(a))},CKEDITOR.NODE_ELEMENT,!1);return b},removeSymbolText:function(a){var b,c=a.attributes[“cke-symbol”];a.forEach(function(d){!b&&d.value.match(c.replace(“)”,“\)”).replace(“(”,“”))&&(d.value=d.value.replace(c,“”),d.parent.getHtml().match(/^(s| )*$/)&&(b=d.parent!==a?d.parent:null))},CKEDITOR.NODE_TEXT);b&&b.remove()},setListSymbol:function(a,b,c){c=c||1;var d=n.parseCssText(a.attributes.style); if(“ol”==a.name){if(a.attributes.type||d[“list-style-type”])return;var f={“[ivx]”:“lower-roman”,“[IVX]”:“upper-roman”,“[a-z]”:“lower-alpha”,“[A-Z]”:“upper-alpha”,“\d”:“decimal”},e;for(e in f)if(g.getSubsectionSymbol(b).match(new RegExp(e))){d[“list-style-type”]=f[e];break}a.attributes[“cke-list-style-type”]=d[“list-style-type”]}else f={“·”:“disc”,o:“circle”,“§”:“square”},!d[“list-style-type”]&&f[b]&&(d[“list-style-type”]=f[b]);g.setListSymbol.removeRedundancies(d,c);(a.attributes.style=CKEDITOR.tools.writeCssText(d))|| delete a.attributes.style},setListStart:function(a){for(var b=[],c=0,d=0;d;b||(b=“decimal”,a.match(//)&&(b=“lower-alpha”),a.match(//)&&(b=“upper-alpha”));return b}}, getSubsectionSymbol:function(a){return(a.match(/([da-zA-Z]+).?$/)||[“placeholder”,“1”])[1]},setListDir:function(a){var b=0,c=0;a.forEach(function(a){“li”==a.name&&(“rtl”==(a.attributes.dir||a.attributes.DIR||“”).toLowerCase()?c+:b+l.length;){var p=g.createList(b),n=k.children;0f;f++)c[f]&&delete c[f];c[a[e].attributes[“cke-list-level”]]= k;d[d.length-1].push(a[e]);f=l}[].splice.apply(b,[“>)},CKEDITOR.ELEMENT_NODE);c>b&&(a.attributes.dir=”rtl“)},createList:function(a){return(a.attributes[”cke-symbol“].match(/([da-np-zA-NP-Z]).?/)||[]).concat(,d))},isAListContinuation:function(a){var b=a;do if((b=b.previous)&&b.type===CKEDITOR.NODE_ELEMENT){if(void 0===b.attributes)break;if(b.attributes===a.attributes)return b.attributes===a.attributes}while(b);return!1},getElementIndentation:function(a){a=n.parseCssText(a.attributes.style);if(a.margin||a.MARGIN){a.margin=a.margin||a.MARGIN;var b= {styles:{margin:a.margin}};CKEDITOR.filter.transformationsTools.splitMarginShorthand(b);a=b.styles}return parseInt(n.convertToPx(a||”0px“),10)},toArabic:function(a){return a.match(//i)?a.match(/^l/i)?50+g.toArabic(a.slice(1)):a.match(/^lx/i)?40+g.toArabic(a.slice(1)):a.match(/^x/i)?10+g.toArabic(a.slice(1)):a.match(/^ix/i)?9+g.toArabic(a.slice(2)):a.match(/^v/i)?5+g.toArabic(a.slice(1)):a.match(/^iv/i)?4+g.toArabic(a.slice(2)):a.match(/^i/i)?1+g.toArabic(a.slice(1)): g.toArabic(a.slice(1)):0},getSymbolInfo:function(a,b){var c=a.toUpperCase()==a?”upper-“:”lower-“,d={”·“:[”disc“,-1],o:,”§“:[”square“,-3]};if(a in d||b&&b.match(/(disc|circle|square)/))return{index:d[1],type:d[0]};if(a.match(/d/))return{index:a?parseInt(g.getSubsectionSymbol(a),10):0,type:”decimal“};a=a.replace(/W/g,”“).toLowerCase();return!b&&a.match(/+/i)||b&&”alpha“!=b||”roman“==b?{index:g.toArabic(a),type:c+”roman“}:a.match(//i)?{index:a.charCodeAt(0)-97,type:c+ ”alpha“}:{index:-1,type:”disc“}},getListItemInfo:function(a){if(void 0!==a.attributes)return{id:a.attributes,level:a.attributes};var b=n.parseCssText(a.attributes.style),c={id:”0“,level:”1“};b&&(b+=” “,c.level=b.match(/level(.+?)s+/),c.id=b.match(/l(d+?)s+/));a.attributes=void 0!==a.attributes?a.attributes:c.level;a.attributes=c.id;return c}};g=CKEDITOR.plugins.pastefromword.lists; CKEDITOR.plugins.pastefromword.heuristics={isEdgeListItem:function(a,b){if(!CKEDITOR.env.edge||!a.config.pasteFromWord_heuristicsEdgeList)return!1;var c=”“;b.forEach&&b.forEach(function(a){c+=a.value},CKEDITOR.NODE_TEXT);return c.match(/^(?: |&nbsp;)*(?+?[.)](?: |&nbsp;){2,}/)?!0:t.isDegenerateListItem(a,b)},cleanupEdgeListItem:function(a){var b=!1;a.forEach(function(a){b||(a.value=a.value.replace(/^(?: |)+/,”“),a.value.length&&(b=!0))},CKEDITOR.NODE_TEXT)},isDegenerateListItem:function(a, b){return!!b.attributes||b.attributes.style&&!b.attributes.style.match(/mso-list/)&&!!b.find(function(a){if(a.type==CKEDITOR.NODE_ELEMENT&&b.name.match(/hd/i)&&a.getHtml().match(/^+?[.)]$/))return!0;var d=n.parseCssText(a.attributes&&a.attributes.style,!0);if(!d)return!1;var f=d||”“;return(d.font||d||”“).match(/7pt/i)&&!!a.previous||f.match(/symbol/i)},!0).length},assignListLevels:function(a,b){if(!b.attributes||void 0===b.attributes){for(var c= [g.getElementIndentation(b)],d=,f=[],e=CKEDITOR.tools.array,h=e.map;b.next&&b.next.attributes&&!b.next.attributes&&t.isDegenerateListItem(a,b.next);)b=b.next,c.push(g.getElementIndentation(b)),d.push(b);var k=h(c,function(a,b){return 0===b?0:a-c}),n=this.guessIndentationStep(e.filter(c,function(a){return 0!==a})),f=h(c,function(a){return Math.round(a/n)});-1!==e.indexOf(f,0)&&(f=h(f,function(a){return a+1}));e.forEach(d,function(a,b){a.attributes=f}); return{indents:c,levels:f,diffs:k}}},guessIndentationStep:function(a){return a.length?Math.min.apply(null,a):null},correctLevelShift:function(a){if(this.isShifted(a)){var b=CKEDITOR.tools.array.filter(a.children,function(a){return”ul“==a.name||”ol“==a.name}),c=CKEDITOR.tools.array.reduce(b,function(a,b){return(b.children&&1==b.children.length&&t.isShifted(b.children)?[b]:b.children).concat(a)},[]);CKEDITOR.tools.array.forEach(b,function(a){a.remove()});CKEDITOR.tools.array.forEach(c,function(b){a.add(b, 0)});delete a.name}},isShifted:function(a){return”li“!==a.name?!1:0===CKEDITOR.tools.array.filter(a.children,function(a){return a.name&&(”ul“==a.name||”ol“==a.name||”p“==a.name&&0===a.children.length)?!1:!0}).length}};t=CKEDITOR.plugins.pastefromword.heuristics;g.setListSymbol.removeRedundancies=function(a,b){(1===b&&”disc“===a||”decimal“===a)&&delete a};CKEDITOR.plugins.pastefromword.createAttributeStack=x;CKEDITOR.config.pasteFromWord_heuristicsEdgeList= !0})();